DbusmenuServer

DbusmenuServer — The server signals changed and updates on a tree of DbusmenuMenuitem objecs.

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libdbusmenu-glib/server.h>

#define             DBUSMENU_SERVER_SIGNAL_ID_PROP_UPDATE
#define             DBUSMENU_SERVER_SIGNAL_ID_UPDATE
#define             DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATED
#define             DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATE
#define             DBUSMENU_SERVER_SIGNAL_ITEM_ACTIVATION
#define             DBUSMENU_SERVER_PROP_DBUS_OBJECT
#define             DBUSMENU_SERVER_PROP_ROOT_NODE
#define             DBUSMENU_SERVER_PROP_STATUS
#define             DBUSMENU_SERVER_PROP_TEXT_DIRECTION
#define             DBUSMENU_SERVER_PROP_VERSION
                    DbusmenuServer;
struct              DbusmenuServerClass;
DbusmenuServer *    dbusmenu_server_new                 (const gchar *object);
DbusmenuStatus      dbusmenu_server_get_status          (DbusmenuServer *server);
DbusmenuTextDirection dbusmenu_server_get_text_direction
                                                        (DbusmenuServer *server);
void                dbusmenu_server_set_root            (DbusmenuServer *self,
                                                         DbusmenuMenuitem *root);
void                dbusmenu_server_set_status          (DbusmenuServer *server,
                                                         DbusmenuStatus status);
void                dbusmenu_server_set_text_direction  (DbusmenuServer *server,
                                                         DbusmenuTextDirection dir);

Description

A DbusmenuServer is the object that represents the local tree of DbusmenuMenuitem objects on DBus. It watches the various signals that those objects emit and correctly represents them across DBus to a DbusmenuClient so that the same tree can be maintained in another process.

The server needs to have the root set of DbusmenuMenuitem objects set via dbusmenu_server_set_root but it will query all of the objects in that tree automatically. After setting the root there should be no other maintence required by users of the server class.

Details

DBUSMENU_SERVER_SIGNAL_ID_PROP_UPDATE

#define DBUSMENU_SERVER_SIGNAL_ID_PROP_UPDATE  "item-property-updated"

String to attach to signal "item-property-updated"


DBUSMENU_SERVER_SIGNAL_ID_UPDATE

#define DBUSMENU_SERVER_SIGNAL_ID_UPDATE       "item-updated"

String to attach to signal "item-updated"


DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATED

#define DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATED  "layout-updated"

String to attach to signal "layout-updated"


DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATE

#define DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATE   DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATED

String to attach to signal "layout-updated"


DBUSMENU_SERVER_SIGNAL_ITEM_ACTIVATION

#define DBUSMENU_SERVER_SIGNAL_ITEM_ACTIVATION "item-activation-requested"

String to attach to signal "item-activation-requested"


DBUSMENU_SERVER_PROP_DBUS_OBJECT

#define DBUSMENU_SERVER_PROP_DBUS_OBJECT       "dbus-object"

String to access property "dbus-object"


DBUSMENU_SERVER_PROP_ROOT_NODE

#define DBUSMENU_SERVER_PROP_ROOT_NODE         "root-node"

String to access property "root-node"


DBUSMENU_SERVER_PROP_STATUS

#define DBUSMENU_SERVER_PROP_STATUS            "status"

String to access property "status"


DBUSMENU_SERVER_PROP_TEXT_DIRECTION

#define DBUSMENU_SERVER_PROP_TEXT_DIRECTION    "text-direction"

String to access property "text-direction"


DBUSMENU_SERVER_PROP_VERSION

#define DBUSMENU_SERVER_PROP_VERSION           "version"

String to access property "version"


DbusmenuServer

typedef struct _DbusmenuServer DbusmenuServer;

A server which represents a sharing of a set of DbusmenuMenuitems across DBus to a DbusmenuClient.


struct DbusmenuServerClass

struct DbusmenuServerClass {
	GObjectClass parent_class;

	/* Signals */
	void (*id_prop_update)(gint id, gchar * property, gchar * value);
	void (*id_update)(gint id);
	void (*layout_updated)(gint revision);
	void (*item_activation)(gint id, guint timestamp);

	/*< Private >*/
	void (*reserved1) (void);
	void (*reserved2) (void);
	void (*reserved3) (void);
	void (*reserved4) (void);
	void (*reserved5) (void);
	void (*reserved6) (void);
};

The class implementing the virtual functions for DbusmenuServer.

GObjectClass parent_class;

GObjectClass

id_prop_update ()

Slot for "id-prop-update".

id_update ()

Slot for "id-update".

layout_updated ()

Slot for "layout-update".

item_activation ()

Slot for "item-activation-requested".

reserved1 ()

Reserved for future use.

reserved2 ()

Reserved for future use.

reserved3 ()

Reserved for future use.

reserved4 ()

Reserved for future use.

reserved5 ()

Reserved for future use.

reserved6 ()

Reserved for future use.

dbusmenu_server_new ()

DbusmenuServer *    dbusmenu_server_new                 (const gchar *object);

Creates a new DbusmenuServer object with a specific object path on DBus. If object is set to NULL the default object name of "/com/canonical/dbusmenu" will be used.

object :

The object name to show for this menu structure on DBus. May be NULL.

Returns :

A brand new DbusmenuServer

dbusmenu_server_get_status ()

DbusmenuStatus      dbusmenu_server_get_status          (DbusmenuServer *server);

Gets the current statust hat the server is sending out over DBus.

server :

The DbusmenuServer to get the status from

Returns :

The current status the server is sending

dbusmenu_server_get_text_direction ()

DbusmenuTextDirection dbusmenu_server_get_text_direction
                                                        (DbusmenuServer *server);

Returns the value of the text direction that is being exported over DBus for this server. It should relate to the direction of the labels and other text fields that are being exported by this server.

server :

The DbusmenuServer object to get the text direction from

Returns :

Text direction exported for this server.

dbusmenu_server_set_root ()

void                dbusmenu_server_set_root            (DbusmenuServer *self,
                                                         DbusmenuMenuitem *root);

This function contains all of the GValue wrapping required to set the property "root-node" on the server self.

self :

The DbusmenuServer object to set the root on

root :

The new root DbusmenuMenuitem tree

dbusmenu_server_set_status ()

void                dbusmenu_server_set_status          (DbusmenuServer *server,
                                                         DbusmenuStatus status);

Changes the status of the server.

server :

The DbusmenuServer to set the status on

status :

Status value to set on the server

dbusmenu_server_set_text_direction ()

void                dbusmenu_server_set_text_direction  (DbusmenuServer *server,
                                                         DbusmenuTextDirection dir);

Sets the text direction that should be exported over DBus for this server. If the value is set to DBUSMENU_TEXT_DIRECTION_NONE the default detection will be used for setting the value and exported over DBus.

server :

The DbusmenuServer object to set the text direction on

dir :

Direction of the text