Commit 5ddbe331 authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

libgnome-panel: add gp_module_get_standalone_menu

parent b90f0393
......@@ -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,
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment