Top | ![]() |
![]() |
![]() |
![]() |
HudActionPublisher * | hud_action_publisher_new () |
HudActionPublisher * | hud_action_publisher_new_for_application () |
|
hud_action_publisher_add_description () |
|
hud_action_publisher_add_action_group () |
|
hud_action_publisher_remove_action_group () |
|
hud_action_publisher_get_window_id () |
const |
hud_action_publisher_get_context_id () |
|
hud_action_publisher_get_action_groups () |
const |
hud_action_publisher_get_description_path () |
HudActionDescription * | hud_action_description_new () |
HudActionDescription * | hud_action_description_ref () |
|
hud_action_description_unref () |
const |
hud_action_description_get_action_name () |
|
hud_action_description_get_action_target () |
|
hud_action_description_set_attribute_value () |
|
hud_action_description_set_attribute () |
|
hud_action_description_set_parameterized () |
action-group-added | ||
action-group-removed | ||
changed |
Each context in the application should have a HudActionPublisher object to represents the actions that are available to the user when that window and context are visible. This acts as a set of actions that can be activated by either the window manager changing focus or the application changing contexts.
On each action publisher there exits several action groups which can be separated by allowing different prefixes for those action groups. A particular prefix should only be used once per action publisher, but an action group can by used by several action publishers.
The values describing the action, including the label and description that show up in the HUD are set via creating a HudActionDescription for a action. Each action can have more than one description if there is a reason to do so. But, it is probably better to use the keywords attribute in the majority cases.
HudActionPublisher * hud_action_publisher_new (,
guint window_idconst
);gchar *context_id
Creates a new HudActionPublisher based on the window ID passed
in via window_id
and context ID from context_id
.
Either one of them can be not used by passing in eithe of the defines HUD_ACTION_PUBLISHER_ALL_WINDOWS or HUD_ACTION_PUBLISHER_NO_CONTEXT for the appropriate parameter.
HudActionPublisher *
hud_action_publisher_new_for_application
(GApplication *application
);
Creates a new HudActionPublisher and automatically registers the default actions under the "app" prefix.
void hud_action_publisher_add_description (HudActionPublisher *publisher
,HudActionDescription *description
);
Adds description
to the list of actions that the application exports
to the HUD.
If the application is already exporting an action with the same name
and target value as description
then it will be replaced.
You should only use this API for situations like recent documents and bookmarks.
void hud_action_publisher_add_action_group (HudActionPublisher *publisher
,const
,gchar *prefixconst
);gchar *object_path
Informs the HUD of the existance of an action group.
The action group must be published on the shared session bus
connection of this process at object_path
.
The prefix
defines the type of action group. Currently "app" and
"win" are supported. For example, if the exported action group
contained a "quit" action and you wanted to refer to it as "app.quit"
from action descriptions, then you would use the prefix
"app" here.
identifier
is a piece of identifying information, depending on which
prefix
is used. Currently, this should be NULL
prefix
and should be a uint32 specifying the window ID (eg: XID) for
the "win" prefix
.
You do not need to manually export your action groups if you are
using
void hud_action_publisher_remove_action_group (HudActionPublisher *publisher
,const
,gchar *prefix);
GVariant *identifier
Informs the HUD that an action group no longer exists.
This reverses the effect of a previous call to
hud_action_publisher_add_action_group()
with the same parameters.
guint hud_action_publisher_get_window_id (HudActionPublisher *publisher
);
Gets the window ID for this publisher
constgchar * hud_action_publisher_get_context_id (HudActionPublisher *publisher
);
Gets the context ID for this publisher
GList * hud_action_publisher_get_action_groups (HudActionPublisher *publisher
);
Grabs the action groups for this publisher
constgchar * hud_action_publisher_get_description_path (HudActionPublisher *publisher
);
Grabs the object path of the description for this publisher
HudActionDescription * hud_action_description_new (const
,gchar *action_name);
GVariant *action_target
Creates a new HudActionDescription.
The situations in which you want to do this are limited to "dynamic" types of actions -- things like bookmarks or recent documents.
Use hud_action_publisher_add_descriptions_from_file()
HudActionDescription *
hud_action_description_ref (HudActionDescription *description
);
Increase the reference count to an action description
void hud_action_description_unref (HudActionDescription *description
);
Decrease the reference count to an action description
constgchar * hud_action_description_get_action_name (HudActionDescription *description
);
Gets the action name of description
.
This, together with the action target, uniquely identify an action description.
GVariant * hud_action_description_get_action_target (HudActionDescription *description
);
Gets the action target of description
(ie: the
This may be NULL
This, together with the action name, uniquely identify an action description.
void hud_action_description_set_attribute_value (HudActionDescription *description
,const
,gchar *attribute_name);
GVariant *value
Sets or unsets an attribute on description
.
You may not change the "action" or "target" attributes.
If value
is non-NULL
NULL
value
unsets attribute_name
.
value
is consumed if it is floating.
void hud_action_description_set_attribute (HudActionDescription *description
,const
,gchar *attribute_nameconst
,gchar *format_string...
);
Sets or unsets an attribute on description
.
You may not change the "action" or "target" attributes.
If format_string
is non-NULL
g_variant_new()
hud_action_description_set_attribute_value()
.
If format_string
is NULL
hud_action_description_set_attribute_value()
with a NULL
void hud_action_description_set_parameterized (HudActionDescription *parent
,);
GMenuModel *child
A function to put one action description as a child for the first one. This is used for parameterized actions where one can set up children that are displayed on the 'dialog' mode of the HUD.
#define HUD_ACTION_PUBLISHER_SIGNAL_ACTION_GROUP_ADDED "action-group-added"
Define for the string to access the signal HudActionPublisher::action-group-added
#define HUD_ACTION_PUBLISHER_SIGNAL_ACTION_GROUP_REMOVED "action-group-removed"
Define for the string to access the signal HudActionPublisher::action-group-removed
#define HUD_ACTION_PUBLISHER_NO_CONTEXT (NULL)
Can be passed to hud_action_publisher_new()
to request that it build
it's own context.
#define HUD_ACTION_PUBLISHER_ALL_WINDOWS (0)
Can be passed to hud_action_publisher_new()
to request that these actions
apply to all windows for the application.
struct HudActionPublisherActionGroupSet { gchar * prefix; gchar * path; };
A set of properties of that describe the action group.
“action-group-added”
signalvoid user_function (HudActionPublisher *param1,gchar *param2,gchar *arg2,gpointer user_data)
Emitted when a new action group is added to the publisher
param1 |
Prefix for the action group |
|
param2 |
Path group is exported on DBus |
|
user_data |
user data set when the signal handler was connected. |
Flags:
“action-group-removed”
signalvoid user_function (HudActionPublisher *param1,gchar *param2,gchar *arg2,gpointer user_data)
Emitted when a new action group is removed from the publisher
param1 |
Prefix for the action group |
|
param2 |
Path group is exported on DBus |
|
user_data |
user data set when the signal handler was connected. |
Flags:
“changed”
signalvoid user_function (HudActionDescription *param1,gchar *arg1,gpointer user_data)
Flags: