summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libmate-panel-applet/mate-panel-applet-factory.c19
-rw-r--r--libmate-panel-applet/mate-panel-applet-factory.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/libmate-panel-applet/mate-panel-applet-factory.c b/libmate-panel-applet/mate-panel-applet-factory.c
index b7e237c1..cf38d64c 100644
--- a/libmate-panel-applet/mate-panel-applet-factory.c
+++ b/libmate-panel-applet/mate-panel-applet-factory.c
@@ -306,4 +306,23 @@ mate_panel_applet_factory_register_service (MatePanelAppletFactory *factory)
return TRUE;
}
+GtkWidget *
+mate_panel_applet_factory_get_applet_widget (const gchar *id,
+ guint uid)
+{
+ MatePanelAppletFactory *factory;
+ GObject *object;
+
+ if (!factories)
+ return NULL;
+ factory = g_hash_table_lookup (factories, id);
+ if (!factory)
+ return NULL;
+
+ object = g_hash_table_lookup (factory->applets, GUINT_TO_POINTER (uid));
+ if (!object || !GTK_IS_WIDGET (object))
+ return NULL;
+
+ return GTK_WIDGET (object);
+}
diff --git a/libmate-panel-applet/mate-panel-applet-factory.h b/libmate-panel-applet/mate-panel-applet-factory.h
index 4bffc444..9726dd47 100644
--- a/libmate-panel-applet/mate-panel-applet-factory.h
+++ b/libmate-panel-applet/mate-panel-applet-factory.h
@@ -44,6 +44,8 @@ MatePanelAppletFactory *mate_panel_applet_factory_new (const gchar
GType applet_type,
GClosure *closure);
gboolean mate_panel_applet_factory_register_service (MatePanelAppletFactory *factory);
+GtkWidget *mate_panel_applet_factory_get_applet_widget (const gchar *id,
+ guint uid);
/* This technically belongs to mate-panel-applet.h, but it's not something that
* should be public API. */