-
public static void add_entry (string accel_path, uint accel_key, ModifierType accel_mods)
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 change_entry. 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...".
-
public static void add_filter (string filter_pattern)
Adds a filter to the global list of accel path filters.
-
public static bool change_entry (string accel_path, uint accel_key, ModifierType accel_mods, bool replace)
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.
-
public static void foreach (void* data, AccelMapForeach foreach_func)
Loops over the entries in the accelerator map whose accel path doesn't match any of the filters added
with add_filter, and execute foreach_func on each. The
signature of foreach_func is that of AccelMapForeach, the
changed parameter indicates whether this accelerator was changed during runtime (thus, would need saving during an
accelerator map dump).
-
public static void foreach_unfiltered (void* data, AccelMapForeach foreach_func)
Loops over all entries in the accelerator map, and execute foreach_func on each. The
signature of foreach_func is that of AccelMapForeach, the
changed parameter indicates whether this accelerator was changed during runtime (thus, would need saving during an
accelerator map dump).
-
public static weak AccelMap get ()
Gets the singleton global AccelMap 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.
-
public static void load (string file_name)
Parses a file previously saved with save for
accelerator specifications, and propagates them accordingly.
-
public static void load_fd (int fd)
Filedescriptor variant of load.
-
public static void load_scanner (Scanner scanner)
-
public static void lock_path (string accel_path)
Locks the given accelerator path. If the accelerator map doesn't yet contain an entry for
accel_path, a new one is created.
-
public static bool lookup_entry (string accel_path, out AccelKey key)
Looks up the accelerator entry for accel_path and fills in key.
-
public static void save (string file_name)
Saves current accelerator specifications (accelerator path, key and modifiers) to file_name
. The file is written in a format suitable to be read back in by load.
-
public static void save_fd (int fd)
Filedescriptor variant of save.
-
public static void unlock_path (string accel_path)
Undoes the last call to lock_path on
this accel_path. Refer to lock_path for information about
accelerator path locking.