Libraries:Gtk:Gtk:AccelMap
Types
T
Inherits from:Constants
Nil : T
Functions
AddEntry(accel_path @ Std.String.T, accel_key @ Std.Integer.SmallT, accel_mods @ Std.Integer.SmallT) : Std.Object.T
Registers a new accelerator with the global accelerator map. This function should only be called once per accel_path with the canonical accel_key and accel_mods for this path. To change the accelerator during runtime programatically, use ChangeEntry. The accelerator path must consist of "<WINDOWTYPE>/Category1/Category2/.../Action", where <WINDOWTYPE> should be a unique application-specific identifier, that corresponds to the kind of window the accelerator is being used in, e.g. "Gimp-Image", "Abiword-Document" or "Gnumeric-Settings". The Category1/.../Action portion is most appropriately chosen by the action the accelerator triggers, i.e. for accelerators on menu items, choose the item's menu path, e.g. "File/Save As", "Image/View/Zoom" or "Edit/Select All". So a full valid accelerator path may look like: "<Gimp-Toolbox>/File/Dialogs/Tool Options...".
Note that accel_path string will be stored in a GQuark. Therefore, if you pass a static string, you can save some memory by interning it first with g_intern_static_string().
accel_path | valid accelerator path |
accel_key | the accelerator key |
accel_mods | the accelerator modifiers |
AddFilter(filter_pattern @ Std.String.T) : Std.Object.T
Adds a filter to the global list of accel path filters.
Accel map entries whose accel path matches one of the filters are skipped by Foreach.
This function is intended for GTK+ modules that create their own menus, but don't want them to be saved into the applications accelerator map dump.
filter_pattern | a pattern (see GPatternSpec) |
ChangeEntry(accel_path @ Std.String.T, accel_key @ Std.Integer.SmallT, accel_mods @ Std.Integer.SmallT, replace @ Std.Symbol.T) : Std.Symbol.T
Changes the accel_key and accel_mods currently associated with accel_path. Due to conflicts with other accelerators, a change may not always be possible, replace indicates whether other accelerators may be deleted to resolve such conflicts. A change will only occur if all conflicts could be resolved (which might not be the case if conflicting accelerators are locked). Successful changes are indicated by a TRUE return value.
Note that accel_path string will be stored in a GQuark. Therefore, if you pass a static string, you can save some memory by interning it first with g_intern_static_string().
accel_path | a valid accelerator path |
accel_key | the new accelerator key |
accel_mods | the new accelerator modifiers |
replace | TRUE if other accelerators may be deleted upon conflicts |
Returns | TRUE if the accelerator could be changed, FALSE otherwise |
Foreach(data @ Std.Address.T, foreach_func @ Std.Function.T) : Std.Object.T
Loops over the entries in the accelerator map whose accel path doesn't match any of the filters added with AddFilter, and execute foreach_func on each. The signature of foreach_func is that of Gtk.Gtk.AccelMapForeach, the changed parameter indicates whether this accelerator was changed during runtime (thus, would need saving during an accelerator map dump).
data | data to be passed into foreach_func |
foreach_func | function to be executed for each accel map entry which is not filtered out |
ForeachUnfiltered(data @ Std.Address.T, foreach_func @ Std.Function.T) : Std.Object.T
Loops over all entries in the accelerator map, and execute foreach_func on each. The signature of foreach_func is that of Gtk.Gtk.AccelMapForeach, the changed parameter indicates whether this accelerator was changed during runtime (thus, would need saving during an accelerator map dump).
data | data to be passed into foreach_func |
foreach_func | function to be executed for each accel map entry |
Get() : Gtk.Gtk.AccelMap.T
Gets the singleton global T object. This object is useful only for notification of changes to the accelerator map via the ::changed signal; it isn't a parameter to the other accelerator map functions.
Returns | the global T object |
GetType() : Gtk.GObject.Type.T
Load(file_name @ Std.String.T) : Std.Object.T
LoadFd(fd @ Std.Integer.SmallT) : Std.Object.T
Filedescriptor variant of Load.
Note that the file descriptor will not be closed by this function.
fd | a valid readable file descriptor |
LoadScanner(scanner @ Std.Object.T) : Std.Object.T
LockPath(accel_path @ Std.String.T) : Std.Object.T
Locks the given accelerator path. If the accelerator map doesn't yet contain an entry for accel_path, a new one is created.
Locking an accelerator path prevents its accelerator from being changed during runtime. A locked accelerator path can be unlocked by UnlockPath. Refer to ChangeEntry for information about runtime accelerator changes.
If called more than once, accel_path remains locked until UnlockPath has been called an equivalent number of times.
Note that locking of individual accelerator paths is independent from locking the Gtk.Gtk.AccelGroup.T containing them. For runtime accelerator changes to be possible both the accelerator path and its Gtk.Gtk.AccelGroup.T have to be unlocked.
accel_path | a valid accelerator path |
LookupEntry(accel_path @ Std.String.T, key @ Gtk.Gtk.AccelKey.T) : Std.Symbol.T
Looks up the accelerator entry for accel_path and fills in key.
accel_path | a valid accelerator path |
key | the accelerator key to be filled in (optional) |
Returns | TRUE if accel_path is known, FALSE otherwise |
Save(file_name @ Std.String.T) : Std.Object.T
SaveFd(fd @ Std.Integer.SmallT) : Std.Object.T
Filedescriptor variant of Save.
Note that the file descriptor will not be closed by this function.
fd | a valid writable file descriptor |