![]() |
![]() |
![]() |
hud-service Hacking Guide | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
HudItem; struct HudItemClass; void hud_item_activate (HudItem *item
,GVariant *platform_data
); gpointer hud_item_construct (GType g_type
,HudStringList *tokens
,const gchar *desktop_file
,const gchar *app_icon
,gboolean enabled
); const gchar * hud_item_get_app_icon (HudItem *item
); gboolean hud_item_get_enabled (HudItem *item
); const gchar * hud_item_get_item_icon (HudItem *item
); HudStringList * hud_item_get_tokens (HudItem *item
); guint hud_item_get_usage (HudItem *item
); HudItem * hud_item_new (HudStringList *tokens
,const gchar *desktop_file
,const gchar *app_icon
,gboolean enabled
);
A HudItem represents a user-interesting action that can be activated from the Hud user interface.
struct HudItemClass { GObjectClass parent_class; void (* activate) (HudItem *item, GVariant *platform_data); };
This is the class vtable for HudItem.
GObjectClass |
the GObjectClass |
virtual function pointer for hud_item_activate()
|
void hud_item_activate (HudItem *item
,GVariant *platform_data
);
Activates item
.
platform_data
is platform data in the GApplication or
GRemoteActionGroup sense. It should be a GVariant with the type
a{sv}
.
|
a HudItem |
|
platform data |
gpointer hud_item_construct (GType g_type
,HudStringList *tokens
,const gchar *desktop_file
,const gchar *app_icon
,gboolean enabled
);
This is the Vala-style chain-up constructor corresponding to
hud_item_new()
. g_type
must be a subtype of HudItem.
Only subclasses of HudItem should call this.
const gchar * hud_item_get_app_icon (HudItem *item
);
Gets the icon of the application that item
lies within.
|
a HudItem |
Returns : |
the icon name, or "" if there is no icon |
gboolean hud_item_get_enabled (HudItem *item
);
Checks if the item is disabled or enabled.
Disabled items should never appear in search results.
|
a HudItem |
Returns : |
if the item is enabled |
const gchar * hud_item_get_item_icon (HudItem *item
);
Gets the icon for the action represented by item
, if one exists.
|
a HudItem |
Returns : |
the icon name, or "" if there is no icon |
HudStringList * hud_item_get_tokens (HudItem *item
);
Gets the tokens that represent the description of item
.
This is a HudStringList in reverse order of how the item should
appear in the Hud. For example, "File > Open" would be represneted
by the list ['Open', 'File']
.
|
a HudItem |
Returns : |
the tokens. [transfer none] |
guint hud_item_get_usage (HudItem *item
);
Gets the use-count of item
.
This is the number of times the item has been activated in recent history.
|
a HudItem |
Returns : |
the usage count |
HudItem * hud_item_new (HudStringList *tokens
,const gchar *desktop_file
,const gchar *app_icon
,gboolean enabled
);
Creates a new HudItem.
If enabled
is FALSE
then the item will never be in the result of a
search.
|
the search tokens for the item |
|
the desktop file of the provider of the item |
|
the icon name for the application that created this item |
|
if the item is enabled |
Returns : |
a new HudItem |