| Top |
AmtkActionInfoAmtkActionInfo — GAction information |
| AmtkActionInfo * | amtk_action_info_new () |
| AmtkActionInfo * | amtk_action_info_new_from_entry () |
| AmtkActionInfo * | amtk_action_info_ref () |
| void | amtk_action_info_unref () |
| AmtkActionInfo * | amtk_action_info_copy () |
| const gchar * | amtk_action_info_get_action_name () |
| void | amtk_action_info_set_action_name () |
| const gchar * | amtk_action_info_get_icon_name () |
| void | amtk_action_info_set_icon_name () |
| const gchar * | amtk_action_info_get_label () |
| void | amtk_action_info_set_label () |
| const gchar * | amtk_action_info_get_tooltip () |
| void | amtk_action_info_set_tooltip () |
| const gchar * const * | amtk_action_info_get_accels () |
| void | amtk_action_info_set_accels () |
| void | amtk_action_info_mark_as_used () |
| gboolean | amtk_action_info_has_been_used () |
An AmtkActionInfo instance contains a set of information about a GAction. Those pieces of information are useful to create UI elements that trigger the GAction, for example a menu item or a toolbar item.
The recommended way to create a set of AmtkActionInfo's is to use the
amtk_action_info_store_add_entries() function.
AmtkActionInfo * amtk_action_info_new_from_entry (const AmtkActionInfoEntry *info_entry,const gchar *translation_domain);
Creates a new AmtkActionInfo from an AmtkActionInfoEntry.
If translation_domain
is not NULL, g_dgettext() is used to translate the
label
and tooltip
before setting them to the AmtkActionInfo.
Since: 2.0
AmtkActionInfo *
amtk_action_info_ref (AmtkActionInfo *info);
Increments the reference count of info
by one.
Since: 2.0
void
amtk_action_info_unref (AmtkActionInfo *info);
Decrements the reference count of info
by one. If the reference count drops
to 0, info
is freed.
Since: 2.0
AmtkActionInfo *
amtk_action_info_copy (const AmtkActionInfo *info);
Since: 2.0
const gchar *
amtk_action_info_get_action_name (const AmtkActionInfo *info);
Since: 2.0
void amtk_action_info_set_action_name (AmtkActionInfo *info,const gchar *action_name);
Sets the action name, for example "win.save".
Since: 2.0
const gchar *
amtk_action_info_get_icon_name (const AmtkActionInfo *info);
Since: 2.0
void amtk_action_info_set_icon_name (AmtkActionInfo *info,const gchar *icon_name);
Since: 2.0
const gchar *
amtk_action_info_get_label (const AmtkActionInfo *info);
Gets the label. The label has normally a mnemonic.
Since: 2.0
void amtk_action_info_set_label (AmtkActionInfo *info,const gchar *label);
Sets the label with a mnemonic.
Since: 2.0
const gchar *
amtk_action_info_get_tooltip (const AmtkActionInfo *info);
Since: 2.0
void amtk_action_info_set_tooltip (AmtkActionInfo *info,const gchar *tooltip);
info |
an AmtkActionInfo. |
|
tooltip |
the tooltip (i.e. a long description), or |
[nullable] |
Since: 2.0
const gchar * const *
amtk_action_info_get_accels (const AmtkActionInfo *info);
Returns the accelerators. This function never returns NULL, it always
returns a NULL-terminated array, to be suitable for
gtk_application_set_accels_for_action().
a NULL-terminated array
of accelerators in the format understood by gtk_accelerator_parse().
[transfer none][array zero-terminated=1]
Since: 2.0
void amtk_action_info_set_accels (AmtkActionInfo *info,const gchar * const *accels);
A function similar to gtk_application_set_accels_for_action().
accels
must not be NULL, it must be a NULL-terminated array, to be
consistent with gtk_application_set_accels_for_action().
info |
an AmtkActionInfo. |
|
accels |
a |
[array zero-terminated=1] |
Since: 2.0
void
amtk_action_info_mark_as_used (AmtkActionInfo *info);
Mark info
as used. An AmtkFactory function that uses an AmtkActionInfo
should call this function. See amtk_action_info_store_check_all_used().
Since: 3.0
gboolean
amtk_action_info_has_been_used (const AmtkActionInfo *info);
Returns whether info
has been used (for example by an AmtkFactory
function). See also amtk_action_info_store_check_all_used().
Since: 3.0
typedef struct {
const gchar *action_name;
const gchar *icon_name;
const gchar *label;
const gchar *accel;
const gchar *tooltip;
} AmtkActionInfoEntry;
This struct defines a set of information for a single action. It is for use
with amtk_action_info_store_add_entries().
Like GActionEntry, it is permissible to use an incomplete initialiser in
order to leave some of the later values as NULL. Additional optional fields
may be added in the future.
const gchar * |
the action name. |
|
const gchar * |
the icon name, or |
|
const gchar * |
the label (i.e. a short description) with a mnemonic, or |
|
const gchar * |
the accelerator, in the format understood by |
|
const gchar * |
the tooltip (i.e. a long description), or |
Since: 2.0