Top |
AmtkActionInfoAmtkActionInfo — GAction information |
Functions
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 () |
Description
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.
Functions
amtk_action_info_new_from_entry ()
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
amtk_action_info_ref ()
AmtkActionInfo *
amtk_action_info_ref (AmtkActionInfo *info
);
Increments the reference count of info
by one.
Since: 2.0
amtk_action_info_unref ()
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
amtk_action_info_copy ()
AmtkActionInfo *
amtk_action_info_copy (const AmtkActionInfo *info
);
Since: 2.0
amtk_action_info_get_action_name ()
const gchar *
amtk_action_info_get_action_name (const AmtkActionInfo *info
);
Returns
the action name, or NULL
. Example: "win.save"
. Can be
a detailed action name, see g_action_parse_detailed_name()
.
[nullable]
Since: 2.0
amtk_action_info_set_action_name ()
void amtk_action_info_set_action_name (AmtkActionInfo *info
,const gchar *action_name
);
Sets the action name, for example "win.save"
. Can be a detailed action
name, see g_action_parse_detailed_name()
.
Since: 2.0
amtk_action_info_get_icon_name ()
const gchar *
amtk_action_info_get_icon_name (const AmtkActionInfo *info
);
Since: 2.0
amtk_action_info_set_icon_name ()
void amtk_action_info_set_icon_name (AmtkActionInfo *info
,const gchar *icon_name
);
Since: 2.0
amtk_action_info_get_label ()
const gchar *
amtk_action_info_get_label (const AmtkActionInfo *info
);
Gets the label. The label has normally a mnemonic. To remove the mnemonic,
there is the amtk_utils_remove_mnemonic()
function.
Since: 2.0
amtk_action_info_set_label ()
void amtk_action_info_set_label (AmtkActionInfo *info
,const gchar *label
);
Sets the label with a mnemonic. To know how to encode the mnemonic, see the
documentation of gtk_label_new_with_mnemonic()
.
Since: 2.0
amtk_action_info_get_tooltip ()
const gchar *
amtk_action_info_get_tooltip (const AmtkActionInfo *info
);
Since: 2.0
amtk_action_info_set_tooltip ()
void amtk_action_info_set_tooltip (AmtkActionInfo *info
,const gchar *tooltip
);
Parameters
info |
an AmtkActionInfo. |
|
tooltip |
the tooltip (i.e. a long description), or |
[nullable] |
Since: 2.0
amtk_action_info_get_accels ()
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()
.
Returns
a NULL
-terminated array
of accelerators in the format understood by gtk_accelerator_parse()
.
[transfer none][array zero-terminated=1]
Since: 2.0
amtk_action_info_set_accels ()
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()
.
Parameters
info |
an AmtkActionInfo. |
|
accels |
a |
[array zero-terminated=1] |
Since: 2.0
amtk_action_info_mark_as_used ()
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
amtk_action_info_has_been_used ()
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
Types and Values
AmtkActionInfoEntry
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.
Members
const gchar * |
the action name. Can be a detailed action name, see
|
|
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