summaryrefslogtreecommitdiff
path: root/libmate-panel-applet/mate-panel-applet.c
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2017-07-14 02:57:41 -0400
committerlukefromdc <[email protected]>2017-08-13 14:37:24 -0400
commit025a11fdaa76111afc8e03faf6ac36b17028e585 (patch)
tree4c58def9e909bf5e57cc30bc2629456d74d67a61 /libmate-panel-applet/mate-panel-applet.c
parent7b2bc7d9f98c6ba8c2c31bdf9605faadb42a7e0e (diff)
downloadmate-panel-025a11fdaa76111afc8e03faf6ac36b17028e585.tar.bz2
mate-panel-025a11fdaa76111afc8e03faf6ac36b17028e585.tar.xz
libpanel-applet: Remove out_process from panel_applet_factory_main()
This argument makes no sense when introspection is used since, in that case, the applet will be out-of-process anyway. Instead, create a panel_applet_factory_setup_in_process() API that is marked as "skip" for introspection, that is used to setup the factory for in-process applets. Based on https://github.com/GNOME/gnome-panel/commit/6ef943dd473ac662dea01645e0ab1f6564361253
Diffstat (limited to 'libmate-panel-applet/mate-panel-applet.c')
-rw-r--r--libmate-panel-applet/mate-panel-applet.c57
1 files changed, 46 insertions, 11 deletions
diff --git a/libmate-panel-applet/mate-panel-applet.c b/libmate-panel-applet/mate-panel-applet.c
index e4a61cf2..c83e5671 100644
--- a/libmate-panel-applet/mate-panel-applet.c
+++ b/libmate-panel-applet/mate-panel-applet.c
@@ -2290,17 +2290,13 @@ _mate_panel_applet_setup_x_error_handler (void)
_x_error_func = XSetErrorHandler (_x_error_handler);
}
-/**
- * mate_panel_applet_factory_main:
- * @factory_id: Factory ID.
- * @out_process: If the factory is on a separate process or not.
- * @applet_type: GType of the applet this factory creates.
- * @callback: (scope call): Callback to be called when a new applet is to be created.
- * @data: (closure): Callback data.
- *
- * Returns: 0 on success, 1 if there is an error.
- */
-int mate_panel_applet_factory_main(const gchar* factory_id, gboolean out_process, GType applet_type, MatePanelAppletFactoryCallback callback, gpointer user_data)
+static int
+_mate_panel_applet_factory_main_internal (const gchar *factory_id,
+ gboolean out_process,
+ GType applet_type,
+ MatePanelAppletFactoryCallback callback,
+ gpointer user_data)
+
{
MatePanelAppletFactory* factory;
GClosure* closure;
@@ -2335,6 +2331,45 @@ int mate_panel_applet_factory_main(const gchar* factory_id, gboolean out_process
}
/**
+ * panel_applet_factory_main:
+ * @factory_id: Factory ID.
+ * @applet_type: GType of the applet this factory creates.
+ * @callback: (scope call): Callback to be called when a new applet is to be created.
+ * @data: (closure): Callback data.
+ *
+ * Returns: 0 on success, 1 if there is an error.
+ */
+int
+mate_panel_applet_factory_main (const gchar *factory_id,
+ GType applet_type,
+ MatePanelAppletFactoryCallback callback,
+ gpointer user_data)
+{
+ return _mate_panel_applet_factory_main_internal (factory_id, TRUE, applet_type,
+ callback, user_data);
+}
+
+/**
+ * panel_applet_factory_setup_in_process: (skip)
+ * @factory_id: Factory ID.
+ * @applet_type: GType of the applet this factory creates.
+ * @callback: (scope call): Callback to be called when a new applet is to be created.
+ * @data: (closure): Callback data.
+ *
+ * Returns: 0 on success, 1 if there is an error.
+ */
+int
+mate_panel_applet_factory_setup_in_process (const gchar *factory_id,
+ GType applet_type,
+ MatePanelAppletFactoryCallback callback,
+ gpointer user_data)
+{
+ return _mate_panel_applet_factory_main_internal (factory_id, FALSE, applet_type,
+ callback, user_data);
+}
+
+
+/**
* mate_panel_applet_set_background_widget:
* @applet: a #PanelApplet.
* @widget: a #GtkWidget.