DbusmenuGtkSerializableMenuItem

DbusmenuGtkSerializableMenuItem — A way to build GtkMenuItems that can be sent over Dbusmenu

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libdbusmenu-gtk/serializablemenuitem.h>

#define             DBUSMENU_GTK_SERIALIZABLE_MENU_ITEM_PROP_MENUITEM
struct              DbusmenuGtkSerializableMenuItemClass;
DbusmenuMenuitem *   dbusmenu_gtk_serializable_menu_item_build_menuitem
                                                        (DbusmenuGtkSerializableMenuItem *smi);
void                dbusmenu_gtk_serializable_menu_item_register_to_client
                                                        (DbusmenuClient *client,
                                                         GType item_type);
void                dbusmenu_gtk_serializable_menu_item_set_menuitem
                                                        (DbusmenuGtkSerializableMenuItem *smi,
                                                         DbusmenuMenuitem *mi);

Description

Menuitems can subclass from this instead of GtkMenuItem and by providing the appropriate functions Dbusmenu will be able to parse them and send them over the bus.

Details

DBUSMENU_GTK_SERIALIZABLE_MENU_ITEM_PROP_MENUITEM

#define DBUSMENU_GTK_SERIALIZABLE_MENU_ITEM_PROP_MENUITEM   "dbusmenu-menuitem"

String to access property "dbusmenu-menuitem"


struct DbusmenuGtkSerializableMenuItemClass

struct DbusmenuGtkSerializableMenuItemClass {
	GtkMenuItemClass parent_class;

	/* Subclassable functions */
	const gchar *        (*get_type_string)          (void);
	GHashTable *         (*get_default_properties)   (void);

	DbusmenuMenuitem *   (*build_dbusmenu_menuitem)    (DbusmenuGtkSerializableMenuItem * smi);

	/* Signals */



	/* Empty Space */
	/*< Private >*/
	void (*_dbusmenu_gtk_serializable_menu_item_reserved1) (void);
	void (*_dbusmenu_gtk_serializable_menu_item_reserved2) (void);
	void (*_dbusmenu_gtk_serializable_menu_item_reserved3) (void);
	void (*_dbusmenu_gtk_serializable_menu_item_reserved4) (void);
	void (*_dbusmenu_gtk_serializable_menu_item_reserved5) (void);
	void (*_dbusmenu_gtk_serializable_menu_item_reserved6) (void);
};

Signals and functions for DbusmenuGtkSerializableMenuItem.

GtkMenuItemClass parent_class;

Inherit from GtkMenuItem

get_type_string ()

Static function to get a string describing this type

get_default_properties ()

Return a hashtable of defaults for the menu item type

build_dbusmenu_menuitem ()

Build a menuitem that can be sent over dbus

_dbusmenu_gtk_serializable_menu_item_reserved1 ()

Reserved for future use.

_dbusmenu_gtk_serializable_menu_item_reserved2 ()

Reserved for future use.

_dbusmenu_gtk_serializable_menu_item_reserved3 ()

Reserved for future use.

_dbusmenu_gtk_serializable_menu_item_reserved4 ()

Reserved for future use.

_dbusmenu_gtk_serializable_menu_item_reserved5 ()

Reserved for future use.

_dbusmenu_gtk_serializable_menu_item_reserved6 ()

Reserved for future use.

dbusmenu_gtk_serializable_menu_item_build_menuitem ()

DbusmenuMenuitem *   dbusmenu_gtk_serializable_menu_item_build_menuitem
                                                        (DbusmenuGtkSerializableMenuItem *smi);

This function is for menu items that are instanciated from GTK and have their properites set using GTK functions. This builds a DbusmenuMenuitem that then has the properties that should be sent over the bus to create a new item of this type on the other side.

smi :

DbusmenuGtkSerializableMenuItem to build a DbusmenuMenuitem mirroring

Returns :

A DbusmenuMenuitem who's values will be set by this object. [transfer full]

dbusmenu_gtk_serializable_menu_item_register_to_client ()

void                dbusmenu_gtk_serializable_menu_item_register_to_client
                                                        (DbusmenuClient *client,
                                                         GType item_type);

Registers a generic handler for dealing with all subclasses of DbusmenuGtkSerializableMenuItem. This handler responds to the callback, creates a new object and attaches it to the appropriate DbusmenuMenuitem object.

client :

DbusmenuClient that we should register a type at.

item_type :

The GType of a class that is a subclass of DbusmenuGtkSerializableMenuItem

dbusmenu_gtk_serializable_menu_item_set_menuitem ()

void                dbusmenu_gtk_serializable_menu_item_set_menuitem
                                                        (DbusmenuGtkSerializableMenuItem *smi,
                                                         DbusmenuMenuitem *mi);

This function is used on the server side to signal to the object that it should get its' property change events from mi instead of expecting calls to its' API. A call to this function sets the property and subclasses should listen to the notify signal to pick up this property being set.

smi :

DbusmenuGtkSerializableMenuItem to set the DbusmenuGtkSerializableMenuItem::dbusmenu-menuitem of

mi :

Menuitem to get the properties from