Top | ![]() |
![]() |
![]() |
![]() |
AmtkActionInfoStoreAmtkActionInfoStore — A store of AmtkActionInfo's |
AmtkActionInfoStore contains a set of AmtkActionInfo's. It is add-only, an AmtkActionInfo cannot be removed.
AmtkActionInfoStore is designed so that libraries can provide their own store, to share action information (with translations) and possibly the GAction implementations as well.
A library AmtkActionInfoStore must namespace the action names to not have
conflicts when an AmtkActionInfo is added to the
AmtkActionInfoCentralStore. Examples of namespaced action names:
"win.amtk-save"
or "app.amtk-quit"
.
Once an AmtkActionInfo has been added to an AmtkActionInfoStore, it is discouraged to modify it afterwards. An AmtkActionInfoStore is meant to be something static, created on application startup. See the paragraph about static objects in AmtkFactory.
void amtk_action_info_store_add (AmtkActionInfoStore *store
,AmtkActionInfo *info
);
Inserts info
into store
and into the AmtkActionInfoCentralStore. Both the
store
and central store must not already contain an
AmtkActionInfo with the same action name. The stores take their own
reference on info
.
Since: 2.0
void amtk_action_info_store_add_entries (AmtkActionInfoStore *store
,const AmtkActionInfoEntry *entries
,gint n_entries
,const gchar *translation_domain
);
Calls amtk_action_info_store_add()
for each entry.
If translation_domain
is not NULL
, g_dgettext()
is used to translate the
label
and tooltip
of each entry before setting them to the AmtkActionInfo.
An API similar to g_action_map_add_action_entries()
.
store |
||
entries |
a pointer to the first item in an array of AmtkActionInfoEntry structs. |
[array length=n_entries][element-type AmtkActionInfoEntry] |
n_entries |
the length of |
|
translation_domain |
a gettext domain, or |
[nullable] |
Since: 2.0
AmtkActionInfo * amtk_action_info_store_lookup (AmtkActionInfoStore *store
,const gchar *action_name
);
Since: 2.0
void
amtk_action_info_store_check_all_used (AmtkActionInfoStore *store
);
Checks for each AmtkActionInfo of store
that it has been used (see
amtk_action_info_has_been_used()
). If an AmtkActionInfo has not been used, a
warning is printed and might indicate dead code.
You probably want to call this function on the application store after creating the menu and toolbar. But it can also be useful for a store provided by a library, to easily see which actions are not used by the application.
Since: 2.0