[gnome-panel] libgnome-panel: add gp_module_get_standalone_menu
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] libgnome-panel: add gp_module_get_standalone_menu
- Date: Mon, 17 Sep 2018 14:57:40 +0000 (UTC)
commit 5ddbe331d3aa18125e25ac47dc75785378b69fb1
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Sep 17 14:51:14 2018 +0300
libgnome-panel: add gp_module_get_standalone_menu
libgnome-panel/gp-module-private.h | 5 +++++
libgnome-panel/gp-module.c | 30 ++++++++++++++++++++++++++++++
libgnome-panel/gp-module.h | 18 ++++++++++++++++++
3 files changed, 53 insertions(+)
---
diff --git a/libgnome-panel/gp-module-private.h b/libgnome-panel/gp-module-private.h
index 200290e63..87761bd49 100644
--- a/libgnome-panel/gp-module-private.h
+++ b/libgnome-panel/gp-module-private.h
@@ -48,6 +48,11 @@ GpAppletInfo *gp_module_get_applet_info (GpModule *module,
const gchar *gp_module_get_applet_id_from_iid (GpModule *module,
const gchar *old_iid);
+GtkWidget *gp_module_get_standalone_menu (GpModule *module,
+ gboolean enable_tooltips,
+ gboolean locked_down,
+ guint menu_icon_size);
+
GpApplet *gp_module_applet_new (GpModule *module,
const gchar *applet,
const gchar *settings_path,
diff --git a/libgnome-panel/gp-module.c b/libgnome-panel/gp-module.c
index f915ecbdd..fbad87e3f 100644
--- a/libgnome-panel/gp-module.c
+++ b/libgnome-panel/gp-module.c
@@ -137,6 +137,8 @@ struct _GpModule
GetAppletIdFromIidFunc compatibility_func;
+ GetStandaloneMenuFunc standalone_menu_func;
+
GHashTable *applets;
};
@@ -555,6 +557,34 @@ gp_module_get_applet_id_from_iid (GpModule *module,
return module->compatibility_func (old_iid);
}
+/**
+ * gp_module_set_standalone_menu:
+ * @module: a #GpModule
+ * @func: the function to call to create a menu
+ *
+ * Specifies a function to be used to create standalone menu.
+ */
+void
+gp_module_set_standalone_menu (GpModule *module,
+ GetStandaloneMenuFunc func)
+{
+ module->standalone_menu_func = func;
+}
+
+GtkWidget *
+gp_module_get_standalone_menu (GpModule *module,
+ gboolean enable_tooltips,
+ gboolean locked_down,
+ guint menu_icon_size)
+{
+ if (module->standalone_menu_func == NULL)
+ return NULL;
+
+ return module->standalone_menu_func (enable_tooltips,
+ locked_down,
+ menu_icon_size);
+}
+
/**
* gp_module_applet_new:
* @module: a #GpModule
diff --git a/libgnome-panel/gp-module.h b/libgnome-panel/gp-module.h
index 91054ac6d..0aa70fbd3 100644
--- a/libgnome-panel/gp-module.h
+++ b/libgnome-panel/gp-module.h
@@ -49,6 +49,21 @@ typedef GpAppletInfo * (* GpGetAppletInfoFunc) (const gchar *id);
*/
typedef const gchar * (* GetAppletIdFromIidFunc) (const gchar *iid);
+/**
+ * GetStandaloneMenuFunc:
+ * @enable_tooltips:
+ * @locked_down:
+ * @menu_icon_size:
+ *
+ * Specifies the type of the module function called to create a
+ * standalone menu.
+ *
+ * Returns: (transfer full): returns a #GtkMenu.
+ */
+typedef GtkWidget * (* GetStandaloneMenuFunc) (gboolean enable_tooltips,
+ gboolean locked_down,
+ guint menu_icon_size);
+
#define GP_TYPE_MODULE (gp_module_get_type ())
G_DECLARE_FINAL_TYPE (GpModule, gp_module, GP, MODULE, GObject)
@@ -73,6 +88,9 @@ void gp_module_set_get_applet_info (GpModule *module,
void gp_module_set_compatibility (GpModule *module,
GetAppletIdFromIidFunc func);
+void gp_module_set_standalone_menu (GpModule *module,
+ GetStandaloneMenuFunc func);
+
/**
* gp_module_load:
* @module: a #GpModule
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]