Top | ![]() |
![]() |
![]() |
![]() |
TeplActionInfo * | tepl_action_info_new () |
TeplActionInfo * | tepl_action_info_new_from_entry () |
TeplActionInfo * | tepl_action_info_ref () |
void | tepl_action_info_unref () |
TeplActionInfo * | tepl_action_info_copy () |
const gchar * | tepl_action_info_get_action_name () |
void | tepl_action_info_set_action_name () |
const gchar * | tepl_action_info_get_icon_name () |
void | tepl_action_info_set_icon_name () |
const gchar * | tepl_action_info_get_label () |
void | tepl_action_info_set_label () |
const gchar * | tepl_action_info_get_tooltip () |
void | tepl_action_info_set_tooltip () |
const gchar * const * | tepl_action_info_get_accels () |
void | tepl_action_info_set_accels () |
A TeplActionInfo 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.
When writing an XML file to create a GMenu, with the format understood by GtkBuilder (see the class description of GtkApplicationWindow), the information in the XML file can be used only to create a GMenu. The initial goal with TeplActionInfo and its related classes is to encode the information just once, and be able to create both a menu and a toolbar easily (to have a traditional user interface).
TeplActionInfo * tepl_action_info_new_from_entry (const TeplActionInfoEntry *info_entry
,const gchar *translation_domain
);
Creates a new TeplActionInfo from a TeplActionInfoEntry.
If translation_domain
is not NULL
, g_dgettext()
is used to translate the
label
and tooltip
before setting them to the TeplActionInfo.
Since: 2.0
TeplActionInfo *
tepl_action_info_ref (TeplActionInfo *info
);
Increments the reference count of info
by one.
Since: 2.0
void
tepl_action_info_unref (TeplActionInfo *info
);
Decrements the reference count of info
by one. If the reference count drops
to 0, info
is freed.
Since: 2.0
TeplActionInfo *
tepl_action_info_copy (const TeplActionInfo *info
);
Since: 2.0
const gchar *
tepl_action_info_get_action_name (const TeplActionInfo *info
);
Since: 2.0
void tepl_action_info_set_action_name (TeplActionInfo *info
,const gchar *action_name
);
Sets the action name, for example "win.save"
.
Since: 2.0
const gchar *
tepl_action_info_get_icon_name (const TeplActionInfo *info
);
Since: 2.0
void tepl_action_info_set_icon_name (TeplActionInfo *info
,const gchar *icon_name
);
Since: 2.0
const gchar *
tepl_action_info_get_label (const TeplActionInfo *info
);
Since: 2.0
void tepl_action_info_set_label (TeplActionInfo *info
,const gchar *label
);
Since: 2.0
const gchar *
tepl_action_info_get_tooltip (const TeplActionInfo *info
);
Since: 2.0
void tepl_action_info_set_tooltip (TeplActionInfo *info
,const gchar *tooltip
);
Since: 2.0
const gchar * const *
tepl_action_info_get_accels (const TeplActionInfo *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 tepl_action_info_set_accels (TeplActionInfo *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 |
||
accels |
a |
[array zero-terminated=1] |
Since: 2.0
typedef struct { const gchar *action_name; const gchar *icon_name; const gchar *label; const gchar *accel; const gchar *tooltip; } TeplActionInfoEntry;
This struct defines a set of information for a single action. It is for use
with tepl_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), or |
|
const gchar * |
the accelerator, in the format understood by |
|
const gchar * |
the tooltip (i.e. a long description), or |
Since: 2.0