Updating branch refs/heads/nick/gtk3 to e75149caaa8ce162f8ec260543b9f698220ec961 (commit) from 3ad863389f96b218ff286c922b091473b8cda1b6 (commit)
commit e75149caaa8ce162f8ec260543b9f698220ec961 Author: Andrzej <ndrwr...@gmail.com> Date: Sun Apr 7 22:49:33 2013 +0100 Loading external gtk2 panel plugins in gtk3 panel. Addeding X-XFCE-API to the plugin .desktop files to determine which wrapper to use. This falls back to 1.0 wrapper for compatibility with the current plugins. configure.ac.in | 12 ++++++++++ libxfce4panel/libxfce4panel-1.0.pc.in | 1 + libxfce4panel/libxfce4panel-2.0.pc.in | 1 + panel/panel-module.c | 22 +++++++++++++++++++- panel/panel-module.h | 2 + panel/panel-plugin-external-wrapper.c | 2 +- plugins/actions/Makefile.am | 4 +- .../{actions.desktop.in => actions.desktop.in.in} | 1 + plugins/applicationsmenu/Makefile.am | 4 +- ...u.desktop.in => applicationsmenu.desktop.in.in} | 1 + plugins/clock/Makefile.am | 4 +- .../{clock.desktop.in => clock.desktop.in.in} | 1 + plugins/directorymenu/Makefile.am | 4 +- ...menu.desktop.in => directorymenu.desktop.in.in} | 1 + plugins/launcher/Makefile.am | 4 +- ...{launcher.desktop.in => launcher.desktop.in.in} | 1 + plugins/pager/Makefile.am | 4 +- .../{pager.desktop.in => pager.desktop.in.in} | 1 + plugins/separator/Makefile.am | 4 +- ...eparator.desktop.in => separator.desktop.in.in} | 1 + plugins/showdesktop/Makefile.am | 4 +- ...esktop.desktop.in => showdesktop.desktop.in.in} | 1 + plugins/systray/Makefile.am | 4 +- .../{systray.desktop.in => systray.desktop.in.in} | 1 + plugins/tasklist/Makefile.am | 4 +- ...{tasklist.desktop.in => tasklist.desktop.in.in} | 1 + plugins/windowmenu/Makefile.am | 4 +- ...dowmenu.desktop.in => windowmenu.desktop.in.in} | 1 + 28 files changed, 71 insertions(+), 24 deletions(-) diff --git a/configure.ac.in b/configure.ac.in index d3291ad..ccd30b0 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -91,6 +91,7 @@ LIBXFCE4PANEL_VERSION_API=libxfce4panel_version_api() LIBXFCE4PANEL_VERSION_MAJOR=xfce4_panel_version_major() LIBXFCE4PANEL_VERSION_MINOR=xfce4_panel_version_minor() LIBXFCE4PANEL_VERSION_MICRO=xfce4_panel_version_micro() +AC_DEFINE([LIBXFCE4PANEL_VERSION_API], "libxfce4panel_version_api()", [libxfce4panel api version]) AC_SUBST([LIBXFCE4PANEL_VERSION]) AC_SUBST([LIBXFCE4PANEL_VERSION_API]) AC_SUBST([LIBXFCE4PANEL_VERSION_MAJOR]) @@ -243,16 +244,27 @@ panel/Makefile wrapper/Makefile plugins/Makefile plugins/actions/Makefile +plugins/actions/actions.desktop.in plugins/applicationsmenu/Makefile +plugins/applicationsmenu/applicationsmenu.desktop.in plugins/clock/Makefile +plugins/clock/clock.desktop.in plugins/directorymenu/Makefile +plugins/directorymenu/directorymenu.desktop.in plugins/launcher/Makefile +plugins/launcher/launcher.desktop.in plugins/pager/Makefile +plugins/pager/pager.desktop.in plugins/separator/Makefile +plugins/separator/separator.desktop.in plugins/showdesktop/Makefile +plugins/showdesktop/showdesktop.desktop.in plugins/systray/Makefile +plugins/systray/systray.desktop.in plugins/tasklist/Makefile +plugins/tasklist/tasklist.desktop.in plugins/windowmenu/Makefile +plugins/windowmenu/windowmenu.desktop.in po/Makefile.in ]) diff --git a/libxfce4panel/libxfce4panel-1.0.pc.in b/libxfce4panel/libxfce4panel-1.0.pc.in index d30feda..90423b6 100644 --- a/libxfce4panel/libxfce4panel-1.0.pc.in +++ b/libxfce4panel/libxfce4panel-1.0.pc.in @@ -3,6 +3,7 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ localedir=@localedir@ +api=1.0 Name: libxfce4panel Description: Library for the Xfce Panel diff --git a/libxfce4panel/libxfce4panel-2.0.pc.in b/libxfce4panel/libxfce4panel-2.0.pc.in index 1358023..4f18f0f 100644 --- a/libxfce4panel/libxfce4panel-2.0.pc.in +++ b/libxfce4panel/libxfce4panel-2.0.pc.in @@ -3,6 +3,7 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ localedir=@localedir@ +api=@LIBXFCE4PANEL_VERSION_API@ Name: libxfce4panel Description: Library for the Xfce Panel diff --git a/panel/panel-module.c b/panel/panel-module.c index 2c29f03..48d9745 100644 --- a/panel/panel-module.c +++ b/panel/panel-module.c @@ -100,6 +100,9 @@ struct _PanelModule /* for gobject plugins */ GType plugin_type; + + /* for wrapper plugins */ + gchar *api; }; @@ -144,6 +147,7 @@ panel_module_init (PanelModule *module) module->library = NULL; module->construct_func = NULL; module->plugin_type = G_TYPE_NONE; + module->api = NULL; } @@ -170,6 +174,7 @@ panel_module_finalize (GObject *object) g_free (module->display_name); g_free (module->comment); g_free (module->icon_name); + g_free (module->api); (*G_OBJECT_CLASS (panel_module_parent_class)->finalize) (object); } @@ -214,6 +219,7 @@ panel_module_load (GTypeModule *type_module) /* from now on, run this plugin in a wrapper */ module->mode = WRAPPER; + module->api = g_strdup (LIBXFCE4PANEL_VERSION_API); return FALSE; } @@ -359,7 +365,10 @@ panel_module_new_from_desktop_file (const gchar *filename, /* run mode of the module, by default everything runs in * the wrapper, unless defined otherwise */ if (force_external || !xfce_rc_read_bool_entry (rc, "X-XFCE-Internal", FALSE)) - module->mode = WRAPPER; + { + module->mode = WRAPPER; + module->api = g_strdup (xfce_rc_read_entry (rc, "X-XFCE-API", "1.0")); + } else module->mode = INTERNAL; } @@ -575,6 +584,17 @@ panel_module_get_icon_name (PanelModule *module) +const gchar * +panel_module_get_api (PanelModule *module) +{ + panel_return_val_if_fail (PANEL_IS_MODULE (module), NULL); + panel_return_val_if_fail (G_IS_TYPE_MODULE (module), NULL); + + return module->api; +} + + + PanelModule * panel_module_get_from_plugin_provider (XfcePanelPluginProvider *provider) { diff --git a/panel/panel-module.h b/panel/panel-module.h index 19efd7a..e4c064f 100644 --- a/panel/panel-module.h +++ b/panel/panel-module.h @@ -58,6 +58,8 @@ const gchar *panel_module_get_comment (PanelModule *mod const gchar *panel_module_get_icon_name (PanelModule *module) G_GNUC_PURE; +const gchar *panel_module_get_api (PanelModule *module) G_GNUC_PURE; + PanelModule *panel_module_get_from_plugin_provider (XfcePanelPluginProvider *provider); gboolean panel_module_is_valid (PanelModule *module); diff --git a/panel/panel-plugin-external-wrapper.c b/panel/panel-plugin-external-wrapper.c index 7260252..6b61713 100644 --- a/panel/panel-plugin-external-wrapper.c +++ b/panel/panel-plugin-external-wrapper.c @@ -217,7 +217,7 @@ panel_plugin_external_wrapper_get_argv (PanelPluginExternal *external, /* setup the basic argv */ argv = g_new0 (gchar *, argc + 1); - argv[PLUGIN_ARGV_0] = g_strdup (WRAPPER_BIN); + argv[PLUGIN_ARGV_0] = g_strjoin ("-", WRAPPER_BIN, panel_module_get_api (external->module), NULL); argv[PLUGIN_ARGV_FILENAME] = g_strdup (panel_module_get_filename (external->module)); argv[PLUGIN_ARGV_UNIQUE_ID] = g_strdup_printf ("%d", external->unique_id);; argv[PLUGIN_ARGV_SOCKET_ID] = g_strdup_printf ("%lu", gtk_socket_get_id (GTK_SOCKET (external)));; diff --git a/plugins/actions/Makefile.am b/plugins/actions/Makefile.am index 83655b3..af74ee4 100644 --- a/plugins/actions/Makefile.am +++ b/plugins/actions/Makefile.am @@ -49,8 +49,8 @@ libactions_la_DEPENDENCIES = \ # .desktop file # desktopdir = $(datadir)/xfce4/panel/plugins -desktop_in_files = actions.desktop.in -desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +desktop_in_files = actions.desktop.in.in +desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop) @INTLTOOL_DESKTOP_RULE@ EXTRA_DIST = \ diff --git a/plugins/actions/actions.desktop.in b/plugins/actions/actions.desktop.in.in similarity index 81% rename from plugins/actions/actions.desktop.in rename to plugins/actions/actions.desktop.in.in index 158b024..96801d4 100644 --- a/plugins/actions/actions.desktop.in +++ b/plugins/actions/actions.desktop.in.in @@ -5,3 +5,4 @@ _Comment=Log out, lock or other system actions Icon=system-log-out X-XFCE-Module=actions X-XFCE-Internal=FALSE +X-XFCE-API=@LIBXFCE4PANEL_VERSION_API@ diff --git a/plugins/applicationsmenu/Makefile.am b/plugins/applicationsmenu/Makefile.am index 834cfc9..8dd1d88 100644 --- a/plugins/applicationsmenu/Makefile.am +++ b/plugins/applicationsmenu/Makefile.am @@ -59,8 +59,8 @@ xfce4-popup-applicationsmenu: xfce4-popup-applicationsmenu.sh Makefile # .desktop file # desktopdir = $(datadir)/xfce4/panel/plugins -desktop_in_files = applicationsmenu.desktop.in -desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +desktop_in_files = applicationsmenu.desktop.in.in +desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop) @INTLTOOL_DESKTOP_RULE@ EXTRA_DIST = \ diff --git a/plugins/applicationsmenu/applicationsmenu.desktop.in b/plugins/applicationsmenu/applicationsmenu.desktop.in.in similarity index 83% rename from plugins/applicationsmenu/applicationsmenu.desktop.in rename to plugins/applicationsmenu/applicationsmenu.desktop.in.in index ab1802d..3d7b180 100644 --- a/plugins/applicationsmenu/applicationsmenu.desktop.in +++ b/plugins/applicationsmenu/applicationsmenu.desktop.in.in @@ -5,3 +5,4 @@ _Comment=Show a menu containing categories of installed applications Icon=xfce4-panel-menu X-XFCE-Module=applicationsmenu X-XFCE-Internal=TRUE +X-XFCE-API=@LIBXFCE4PANEL_VERSION_API@ diff --git a/plugins/clock/Makefile.am b/plugins/clock/Makefile.am index 672da22..3260aca 100644 --- a/plugins/clock/Makefile.am +++ b/plugins/clock/Makefile.am @@ -64,8 +64,8 @@ libclock_la_DEPENDENCIES = \ # .desktop file # desktopdir = $(datadir)/xfce4/panel/plugins -desktop_in_files = clock.desktop.in -desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +desktop_in_files = clock.desktop.in.in +desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop) @INTLTOOL_DESKTOP_RULE@ EXTRA_DIST = \ diff --git a/plugins/clock/clock.desktop.in b/plugins/clock/clock.desktop.in.in similarity index 77% rename from plugins/clock/clock.desktop.in rename to plugins/clock/clock.desktop.in.in index d3c91e2..62e8c2d 100644 --- a/plugins/clock/clock.desktop.in +++ b/plugins/clock/clock.desktop.in.in @@ -5,3 +5,4 @@ _Comment=What time is it? Icon=office-calendar X-XFCE-Module=clock X-XFCE-Internal=TRUE +X-XFCE-API=@LIBXFCE4PANEL_VERSION_API@ diff --git a/plugins/directorymenu/Makefile.am b/plugins/directorymenu/Makefile.am index 57eb616..c8208f6 100644 --- a/plugins/directorymenu/Makefile.am +++ b/plugins/directorymenu/Makefile.am @@ -61,8 +61,8 @@ xfce4-popup-directorymenu: xfce4-popup-directorymenu.sh Makefile # .desktop file # desktopdir = $(datadir)/xfce4/panel/plugins -desktop_in_files = directorymenu.desktop.in -desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +desktop_in_files = directorymenu.desktop.in.in +desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop) @INTLTOOL_DESKTOP_RULE@ EXTRA_DIST = \ diff --git a/plugins/directorymenu/directorymenu.desktop.in b/plugins/directorymenu/directorymenu.desktop.in.in similarity index 80% rename from plugins/directorymenu/directorymenu.desktop.in rename to plugins/directorymenu/directorymenu.desktop.in.in index 3043e94..fb650ce 100644 --- a/plugins/directorymenu/directorymenu.desktop.in +++ b/plugins/directorymenu/directorymenu.desktop.in.in @@ -5,3 +5,4 @@ _Comment=Show a directory tree in a menu Icon=folder X-XFCE-Module=directorymenu X-XFCE-Internal=TRUE +X-XFCE-API=@LIBXFCE4PANEL_VERSION_API@ diff --git a/plugins/launcher/Makefile.am b/plugins/launcher/Makefile.am index 1c3bed0..19fcda3 100644 --- a/plugins/launcher/Makefile.am +++ b/plugins/launcher/Makefile.am @@ -56,8 +56,8 @@ liblauncher_la_DEPENDENCIES = \ # .desktop file # desktopdir = $(datadir)/xfce4/panel/plugins -desktop_in_files = launcher.desktop.in -desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +desktop_in_files = launcher.desktop.in.in +desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop) @INTLTOOL_DESKTOP_RULE@ EXTRA_DIST = \ diff --git a/plugins/launcher/launcher.desktop.in b/plugins/launcher/launcher.desktop.in.in similarity index 81% rename from plugins/launcher/launcher.desktop.in rename to plugins/launcher/launcher.desktop.in.in index b41f222..c760f3d 100644 --- a/plugins/launcher/launcher.desktop.in +++ b/plugins/launcher/launcher.desktop.in.in @@ -5,3 +5,4 @@ _Comment=Program launcher with optional menu Icon=application-x-executable X-XFCE-Module=launcher X-XFCE-Internal=TRUE +X-XFCE-API=@LIBXFCE4PANEL_VERSION_API@ diff --git a/plugins/pager/Makefile.am b/plugins/pager/Makefile.am index 3268d95..5959eb9 100644 --- a/plugins/pager/Makefile.am +++ b/plugins/pager/Makefile.am @@ -52,8 +52,8 @@ libpager_la_DEPENDENCIES = \ # .desktop file # desktopdir = $(datadir)/xfce4/panel/plugins -desktop_in_files = pager.desktop.in -desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +desktop_in_files = pager.desktop.in.in +desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop) @INTLTOOL_DESKTOP_RULE@ EXTRA_DIST = \ diff --git a/plugins/pager/pager.desktop.in b/plugins/pager/pager.desktop.in.in similarity index 80% rename from plugins/pager/pager.desktop.in rename to plugins/pager/pager.desktop.in.in index ee9fe1d..3869ed5 100644 --- a/plugins/pager/pager.desktop.in +++ b/plugins/pager/pager.desktop.in.in @@ -5,3 +5,4 @@ _Comment=Switch between virtual desktops Icon=xfce4-workspaces X-XFCE-Module=pager X-XFCE-Internal=TRUE +X-XFCE-API=@LIBXFCE4PANEL_VERSION_API@ diff --git a/plugins/separator/Makefile.am b/plugins/separator/Makefile.am index ced05f9..c76c3eb 100644 --- a/plugins/separator/Makefile.am +++ b/plugins/separator/Makefile.am @@ -49,8 +49,8 @@ libseparator_la_DEPENDENCIES = \ # .desktop file # desktopdir = $(datadir)/xfce4/panel/plugins -desktop_in_files = separator.desktop.in -desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +desktop_in_files = separator.desktop.in.in +desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop) @INTLTOOL_DESKTOP_RULE@ EXTRA_DIST = \ diff --git a/plugins/separator/separator.desktop.in b/plugins/separator/separator.desktop.in.in similarity index 81% rename from plugins/separator/separator.desktop.in rename to plugins/separator/separator.desktop.in.in index 4e58083..01dab58 100644 --- a/plugins/separator/separator.desktop.in +++ b/plugins/separator/separator.desktop.in.in @@ -5,3 +5,4 @@ _Comment=Adds a separator or space between panel items Icon=gtk-remove X-XFCE-Module=separator X-XFCE-Internal=TRUE +X-XFCE-API=@LIBXFCE4PANEL_VERSION_API@ diff --git a/plugins/showdesktop/Makefile.am b/plugins/showdesktop/Makefile.am index 6180434..e850d8c 100644 --- a/plugins/showdesktop/Makefile.am +++ b/plugins/showdesktop/Makefile.am @@ -42,8 +42,8 @@ libshowdesktop_la_DEPENDENCIES = \ # .desktop file # desktopdir = $(datadir)/xfce4/panel/plugins -desktop_in_files = showdesktop.desktop.in -desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +desktop_in_files = showdesktop.desktop.in.in +desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop) @INTLTOOL_DESKTOP_RULE@ EXTRA_DIST = \ diff --git a/plugins/showdesktop/showdesktop.desktop.in b/plugins/showdesktop/showdesktop.desktop.in.in similarity index 81% rename from plugins/showdesktop/showdesktop.desktop.in rename to plugins/showdesktop/showdesktop.desktop.in.in index 26acae7..c4036bc 100644 --- a/plugins/showdesktop/showdesktop.desktop.in +++ b/plugins/showdesktop/showdesktop.desktop.in.in @@ -5,3 +5,4 @@ _Comment=Hide all windows and show the desktop Icon=user-desktop X-XFCE-Module=showdesktop X-XFCE-Internal=TRUE +X-XFCE-API=@LIBXFCE4PANEL_VERSION_API@ diff --git a/plugins/systray/Makefile.am b/plugins/systray/Makefile.am index 58fb864..f1e0882 100644 --- a/plugins/systray/Makefile.am +++ b/plugins/systray/Makefile.am @@ -57,8 +57,8 @@ libsystray_la_DEPENDENCIES = \ # .desktop file # desktopdir = $(datadir)/xfce4/panel/plugins -desktop_in_files = systray.desktop.in -desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +desktop_in_files = systray.desktop.in.in +desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop) @INTLTOOL_DESKTOP_RULE@ EXTRA_DIST = \ diff --git a/plugins/systray/systray.desktop.in b/plugins/systray/systray.desktop.in.in similarity index 83% rename from plugins/systray/systray.desktop.in rename to plugins/systray/systray.desktop.in.in index a80204f..b0356e1 100644 --- a/plugins/systray/systray.desktop.in +++ b/plugins/systray/systray.desktop.in.in @@ -6,3 +6,4 @@ Icon=applications-system X-XFCE-Module=systray X-XFCE-Internal=FALSE X-XFCE-Unique=SCREEN +X-XFCE-API=@LIBXFCE4PANEL_VERSION_API@ diff --git a/plugins/tasklist/Makefile.am b/plugins/tasklist/Makefile.am index 0d1234e..34c38ab 100644 --- a/plugins/tasklist/Makefile.am +++ b/plugins/tasklist/Makefile.am @@ -53,8 +53,8 @@ libtasklist_la_DEPENDENCIES = \ # .desktop file # desktopdir = $(datadir)/xfce4/panel/plugins -desktop_in_files = tasklist.desktop.in -desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +desktop_in_files = tasklist.desktop.in.in +desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop) @INTLTOOL_DESKTOP_RULE@ EXTRA_DIST = \ diff --git a/plugins/tasklist/tasklist.desktop.in b/plugins/tasklist/tasklist.desktop.in.in similarity index 82% rename from plugins/tasklist/tasklist.desktop.in rename to plugins/tasklist/tasklist.desktop.in.in index aebbb90..ab82881 100644 --- a/plugins/tasklist/tasklist.desktop.in +++ b/plugins/tasklist/tasklist.desktop.in.in @@ -5,3 +5,4 @@ _Comment=Switch between open windows using buttons Icon=preferences-system-windows X-XFCE-Module=tasklist X-XFCE-Internal=TRUE +X-XFCE-API=@LIBXFCE4PANEL_VERSION_API@ diff --git a/plugins/windowmenu/Makefile.am b/plugins/windowmenu/Makefile.am index 77a87b8..029da7b 100644 --- a/plugins/windowmenu/Makefile.am +++ b/plugins/windowmenu/Makefile.am @@ -60,8 +60,8 @@ xfce4-popup-windowmenu: xfce4-popup-windowmenu.sh Makefile # .desktop file # desktopdir = $(datadir)/xfce4/panel/plugins -desktop_in_files = windowmenu.desktop.in -desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +desktop_in_files = windowmenu.desktop.in.in +desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop) @INTLTOOL_DESKTOP_RULE@ EXTRA_DIST = \ diff --git a/plugins/windowmenu/windowmenu.desktop.in b/plugins/windowmenu/windowmenu.desktop.in.in similarity index 82% rename from plugins/windowmenu/windowmenu.desktop.in rename to plugins/windowmenu/windowmenu.desktop.in.in index 48e51d3..ffd9af5 100644 --- a/plugins/windowmenu/windowmenu.desktop.in +++ b/plugins/windowmenu/windowmenu.desktop.in.in @@ -5,3 +5,4 @@ _Comment=Switch between open windows using a menu Icon=preferences-system-windows X-XFCE-Module=windowmenu X-XFCE-Internal=TRUE +X-XFCE-API=@LIBXFCE4PANEL_VERSION_API@ _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits