Top |
#define | DBUSMENU_CLIENT_SIGNAL_LAYOUT_UPDATED |
#define | DBUSMENU_CLIENT_SIGNAL_ROOT_CHANGED |
#define | DBUSMENU_CLIENT_SIGNAL_NEW_MENUITEM |
#define | DBUSMENU_CLIENT_SIGNAL_EVENT_RESULT |
#define | DBUSMENU_CLIENT_SIGNAL_ITEM_ACTIVATE |
#define | DBUSMENU_CLIENT_SIGNAL_ICON_THEME_DIRS_CHANGED |
#define | DBUSMENU_CLIENT_PROP_DBUS_NAME |
#define | DBUSMENU_CLIENT_PROP_DBUS_OBJECT |
#define | DBUSMENU_CLIENT_PROP_GROUP_EVENTS |
#define | DBUSMENU_CLIENT_PROP_STATUS |
#define | DBUSMENU_CLIENT_PROP_TEXT_DIRECTION |
#define | DBUSMENU_CLIENT_TYPES_DEFAULT |
#define | DBUSMENU_CLIENT_TYPES_SEPARATOR |
#define | DBUSMENU_CLIENT_TYPES_IMAGE |
struct | DbusmenuClient |
The client exists as a mirror to the server. For most folks all they will do with a client is set it up to connect to a server and then watch as the menu items on their side of the bus change. This is all they should need to know about the client, that it magically makes their menuitems dance.
It does this by setting up signal watchers and adjusting the menuitems appropriately. Most users should watch the menu items and the signal “layout-changed” for larger events so that they can be optimized. It is possible with that signal that even the root node would change. If that doesn't happen the normal signals on the individual nodes should be enough for most users.
gboolean (*DbusmenuClientTypeHandler) (DbusmenuMenuitem *newitem
,DbusmenuMenuitem *parent
,DbusmenuClient *client
,gpointer user_data
);
The type handler is called when a dbusmenu item is created with a matching type as setup in dbusmenu_client_add_type_handler
newitem |
The DbusmenuMenuitem that was created |
|
parent |
The parent of |
|
client |
A pointer to the DbusmenuClient |
|
user_data |
The data you gave us |
DbusmenuClient * dbusmenu_client_new (const gchar *name
,const gchar *object
);
This function creates a new client that connects to a specific server on DBus. That server is at a specific location sharing a known object. The interface is assumed by the code to be the DBus menu interface. The newly created client will start sending out events as it syncs up with the server.
GStrv
dbusmenu_client_get_icon_paths (DbusmenuClient *client
);
Gets the stored and exported icon paths from the client.
DbusmenuMenuitem *
dbusmenu_client_get_root (DbusmenuClient *client
);
Grabs the root node for the specified client client
. This
function may block. It will block if there is currently a
call to update the layout, it will block on that layout
updated and then return the newly updated layout. Chances
are that this update is in the queue for the mainloop as
it would have been requested some time ago, but in theory
it could block longer.
A DbusmenuMenuitem representing the root of menu on the server. If there is no server or there is an error receiving its layout it'll return NULL.
[transfer none]
DbusmenuStatus
dbusmenu_client_get_status (DbusmenuClient *client
);
Gets the recommended current status that the server is exporting for the menus. In situtations where the value is DBUSMENU_STATUS_NOTICE it is recommended that the client show the menus to the user an a more noticible way.
DbusmenuTextDirection
dbusmenu_client_get_text_direction (DbusmenuClient *client
);
Gets the text direction that the server is exporting. If the server is not exporting a direction then the value DBUSMENU_TEXT_DIRECTION_NONE will be returned.
gboolean dbusmenu_client_add_type_handler (DbusmenuClient *client
,const gchar *type
,DbusmenuClientTypeHandler newfunc
);
This function connects into the type handling of the DbusmenuClient.
Every new menuitem that comes in immediately gets asked for its
properties. When we get those properties we check the 'type'
property and look to see if it matches a handler that is known
by the client. If so, the newfunc
function is executed on that
DbusmenuMenuitem. If not, then the DbusmenuClient::new-menuitem
signal is sent.
In the future the known types will be sent to the server so that it can make choices about the menu item types availble.
gboolean dbusmenu_client_add_type_handler_full (DbusmenuClient *client
,const gchar *type
,DbusmenuClientTypeHandler newfunc
,gpointer user_data
,GDestroyNotify destroy_func
);
This function connects into the type handling of the DbusmenuClient.
Every new menuitem that comes in immediately gets asked for its
properties. When we get those properties we check the 'type'
property and look to see if it matches a handler that is known
by the client. If so, the newfunc
function is executed on that
DbusmenuMenuitem. If not, then the DbusmenuClient::new-menuitem
signal is sent.
In the future the known types will be sent to the server so that it can make choices about the menu item types availble.
client |
Client where we're getting types coming in |
|
type |
A text string that will be matched with the 'type' property on incoming menu items |
|
newfunc |
The function that will be executed with those new items when they come in. |
[scope notified] |
user_data |
Data passed to |
|
destroy_func |
A function that is called when the type handler is
removed (usually on client destruction) which will free
the resources in |
#define DBUSMENU_CLIENT_SIGNAL_LAYOUT_UPDATED "layout-updated"
String to attach to signal “layout-updated”
#define DBUSMENU_CLIENT_SIGNAL_ROOT_CHANGED "root-changed"
String to attach to signal “root-changed”
#define DBUSMENU_CLIENT_SIGNAL_NEW_MENUITEM "new-menuitem"
String to attach to signal “new-menuitem”
#define DBUSMENU_CLIENT_SIGNAL_EVENT_RESULT "event-result"
String to attach to signal “event-result”
#define DBUSMENU_CLIENT_SIGNAL_ITEM_ACTIVATE "item-activate"
String to attach to signal “item-activate”
#define DBUSMENU_CLIENT_SIGNAL_ICON_THEME_DIRS_CHANGED "icon-theme-dirs-changed"
String to attach to signal “icon-theme-dirs-changed”
#define DBUSMENU_CLIENT_PROP_DBUS_NAME "dbus-name"
String to access property “dbus-name”
#define DBUSMENU_CLIENT_PROP_DBUS_OBJECT "dbus-object"
String to access property “dbus-object”
#define DBUSMENU_CLIENT_PROP_GROUP_EVENTS "group-events"
String to access property “group-events”
#define DBUSMENU_CLIENT_PROP_STATUS "status"
String to access property “status”
#define DBUSMENU_CLIENT_PROP_TEXT_DIRECTION "text-direction"
String to access property “text-direction”
#define DBUSMENU_CLIENT_TYPES_DEFAULT "standard"
Used to set the 'type' property on a menu item to create a standard menu item.
#define DBUSMENU_CLIENT_TYPES_SEPARATOR "separator"
Used to set the 'type' property on a menu item to create a separator menu item.
#define DBUSMENU_CLIENT_TYPES_IMAGE "standard"
Used to set the 'type' property on a menu item to create an image menu item. Deprecated as standard menu items now support images as well.
struct DbusmenuClient { };
The client for a DbusmenuServer creating a shared object set of DbusmenuMenuitem objects.