![]() |
![]() |
![]() |
hud-service Hacking Guide | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces |
HudDbusmenuCollector; HudDbusmenuCollector * hud_dbusmenu_collector_new_for_endpoint (const gchar *application_id
,const gchar *prefix
,const gchar *icon
,guint penalty
,const gchar *bus_name
,const gchar *object_path
); HudDbusmenuCollector * hud_dbusmenu_collector_new_for_window (BamfWindow *window
,const gchar *desktop_file
,const gchar *icon
); void hud_dbusmenu_collector_set_prefix (HudDbusmenuCollector *collector
,const gchar *prefix
);
The HudDbusmenuCollector collects menu items from a DbusmenuClient.
There are two modes of operation.
In the simple mode, the collector is created with a specified
endpoint using hud_dbusmenu_collector_new_for_endpoint()
. A
DbusmenuClient is constructed using this endpoint and the collector
constructs HudItems for the contents of the menu found there. This
mode is intended for use with indicators.
For menus associated with application windows (ie: menubars), we must
consult the AppMenu registrar in order to discover the endpoint to
use. This second mode of the collector is used by calling
hud_dbusmenu_collector_new_for_window()
.
typedef struct _HudDbusmenuCollector HudDbusmenuCollector;
This is an opaque structure type.
HudDbusmenuCollector * hud_dbusmenu_collector_new_for_endpoint (const gchar *application_id
,const gchar *prefix
,const gchar *icon
,guint penalty
,const gchar *bus_name
,const gchar *object_path
);
Creates a new HudDbusmenuCollector for the specified endpoint.
Internally, a DbusmenuClient is created for this endpoint. Searches are performed against the contents of those menus.
This call is intended to be used for indicators.
If prefix
is non-NULL
(which, for indicators, it ought to be), then
it is prefixed to every item created by the collector.
If penalty
is non-zero then all results returned from the collector
have their distance increased by a percentage equal to the penalty.
This allows items from indicators to score lower than they would
otherwise.
|
a unique identifier for the application |
|
the title to prefix to all items |
|
the icon for the appliction |
|
the penalty to apply to all results |
|
a D-Bus bus name |
|
an object path at the destination given by bus_name
|
Returns : |
a new HudDbusmenuCollector |
HudDbusmenuCollector * hud_dbusmenu_collector_new_for_window (BamfWindow *window
,const gchar *desktop_file
,const gchar *icon
);
Creates a new HudDbusmenuCollector for the endpoint indicated by the
HudAppMenuRegistrar for window
.
This call is intended to be used for application menus.
|
a BamfWindow |
Returns : |
a new HudDbusmenuCollector |
void hud_dbusmenu_collector_set_prefix (HudDbusmenuCollector *collector
,const gchar *prefix
);
Changes the prefix applied to all items of the collector.
This will involve destroying all of the items and recreating them (since each item's prefix has to be changed).
|
a HudDbusmenuCollector |
|
the new prefix to use |