Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi Michael,

What about such a simple change, which will let us set LibO version
once and for all GTK theme calls:
-------------------------------
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 14a1949..ec11a8f 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -667,6 +667,7 @@ void GtkData::Init()

     // init gtk/gdk
     gtk_init_check( &nParams, &pCmdLineAry );
+    g_setenv("LibreOffice_Version","4.0.0.0",true);
     gdk_error_trap_push();
     aOrigXIOErrorHandler = XSetIOErrorHandler(XIOErrorHdl);

--------------------------------
Of course, "4.0.0.0" should be replaced by some variable, name of
which I currently don't know. But how do you like this idea? It seems
the easiest and most efficient compared to any g_object_set_data()
way.

Regards,
Ruslan

On Thu, Nov 22, 2012 at 4:19 PM, Michael Meeks <michael.meeks@suse.com> wrote:

On Wed, 2012-11-21 at 19:46 +0400, Ruslan Kabatsayev wrote:
This doesn't seem to be a very easy thing. Oxygen-gtk gets application
name via g_get_prgname() and also from PID reading /proc/$PID/cmdline.
Not very extensible for versions.

        Right :-)

Yeah, g_object_set_data with LibO version on widget passed to theme
would be just fine.

        Drat - I added it to each gtk top-level; but now I recall that the
widgets prolly behave somewhat oddly wrt. their parenting.

Something like this:
g_object_set_data(G_OBJECT(widget),"LibreOfficeVersion",(gpointer)0xMAJVMINV).
At least this will work for gtk2, not for gtk3 since no widgets are
passed there. Though I don't think we really want to explicitely
support LibO in oxygen-gtk3.

        I have:

        m_pWindow = gtk_widget_new( GTK_TYPE_WINDOW, "type", eWinType,
                                    "visible", FALSE, NULL );
    g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", this );

    static char pVersion[16] = "";
    if( pVersion[0] == '\0' )
        g_sprintf( pVersion, "%d", SUPD );
    g_object_set_data( G_OBJECT( m_pWindow ), "libo-version", pVersion );

        If that helps; if not - a patch to
vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx would be appreciated :-) [ I
guess adding a helper and calling it in all those NWFooBaaEnsure methods
would do it - they look like they could use some re-factoring love
anyway ].

        Thanks !

                Michael.

--
michael.meeks@suse.com  <><, Pseudo Engineer, itinerant idiot


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.