1 2@c %start of fragment 3 4@deftp Class <gtk-accel-map> 5Derives from @code{<gobject>}. 6 7This class defines no direct slots. 8 9@end deftp 10 11@defop Signal <gtk-accel-map> changed (arg0@tie{}@code{<gchararray>}) (arg1@tie{}@code{<guint>}) (arg2@tie{}@code{<gdk-modifier-type>}) 12Notifies of a change in the global accelerator map. The path is also used as the 13detail for the signal, so it is possible to connect to 14changed::@var{accel_path}. 15 16Since 2.4 17 18@end defop 19 20@deffn Function gtk-accel-map-add-entry (accel_path@tie{}@code{mchars}) (accel_key@tie{}@code{unsigned-int}) (accel_mods@tie{}@code{<gdk-modifier-type>}) 21Registers a new accelerator with the global accelerator map. This function 22should only be called once per @var{accel-path} with the canonical 23@var{accel-key} and @var{accel-mods} for this path. To change the accelerator 24during runtime programatically, use @code{gtk-accel-map-change-entry}. The 25accelerator path must consist of "<WINDOWTYPE>/Category1/Category2/.../Action", 26where <WINDOWTYPE> should be a unique application-specific identifier, that 27corresponds to the kind of window the accelerator is being used in, e.g. 28"Gimp-Image", "Abiword-Document" or "Gnumeric-Settings". The 29Category1/.../Action portion is most appropriately chosen by the action the 30accelerator triggers, i.e. for accelerators on menu items, choose the item's 31menu path, e.g. "File/Save As", "Image/View/Zoom" or "Edit/Select All". So a 32full valid accelerator path may look like: "<Gimp-Toolbox>/File/Dialogs/Tool 33Options...". 34 35@table @var 36@item accel-path 37valid accelerator path 38 39@item accel-key 40the accelerator key 41 42@item accel-mods 43the accelerator modifiers 44 45@end table 46 47@end deffn 48 49@deffn Function gtk-accel-map-change-entry (accel_path@tie{}@code{mchars}) (accel_key@tie{}@code{unsigned-int}) (accel_mods@tie{}@code{<gdk-modifier-type>}) (replace@tie{}@code{bool}) @result{}@tie{} (ret@tie{}@code{bool}) 50Changes the @var{accel-key} and @var{accel-mods} currently associated with 51@var{accel-path}. Due to conflicts with other accelerators, a change may not 52always be possible, @var{replace} indicates whether other accelerators may be 53deleted to resolve such conflicts. A change will only occur if all conflicts 54could be resolved (which might not be the case if conflicting accelerators are 55locked). Successful changes are indicated by a @samp{@code{#t}} return value. 56 57@table @var 58@item accel-path 59a valid accelerator path 60 61@item accel-key 62the new accelerator key 63 64@item accel-mods 65the new accelerator modifiers 66 67@item replace 68@samp{@code{#t}} if other accelerators may be deleted upon conflicts 69 70@item ret 71@samp{@code{#t}} if the accelerator could be changed, @samp{@code{#f}} otherwise 72 73@end table 74 75@end deffn 76 77@deffn Function gtk-accel-map-load (file_name@tie{}@code{mchars}) 78Parses a file previously saved with @code{gtk-accel-map-save} for accelerator 79specifications, and propagates them accordingly. 80 81@table @var 82@item file-name 83a file containing accelerator specifications, in the GLib file name encoding 84 85@end table 86 87@end deffn 88 89@deffn Function gtk-accel-map-save (file_name@tie{}@code{mchars}) 90Saves current accelerator specifications (accelerator path, key and modifiers) 91to @var{file-name}. The file is written in a format suitable to be read back in 92by @code{gtk-accel-map-load}. 93 94@table @var 95@item file-name 96the name of the file to contain accelerator specifications, in the GLib file 97name encoding 98 99@end table 100 101@end deffn 102 103@deffn Function gtk-accel-map-load-fd (fd@tie{}@code{int}) 104Filedescriptor variant of @code{gtk-accel-map-load}. 105 106Note that the file descriptor will not be closed by this function. 107 108@table @var 109@item fd 110a valid readable file descriptor 111 112@end table 113 114@end deffn 115 116@deffn Function gtk-accel-map-save-fd (fd@tie{}@code{int}) 117Filedescriptor variant of @code{gtk-accel-map-save}. 118 119Note that the file descriptor will not be closed by this function. 120 121@table @var 122@item fd 123a valid writable file descriptor 124 125@end table 126 127@end deffn 128 129@deffn Function gtk-accel-map-add-filter (filter_pattern@tie{}@code{mchars}) 130Adds a filter to the global list of accel path filters. 131 132Accel map entries whose accel path matches one of the filters are skipped by 133@code{gtk-accel-map-foreach}. 134 135This function is intended for GTK+ modules that create their own menus, but 136don't want them to be saved into the applications accelerator map dump. 137 138@table @var 139@item filter-pattern 140a pattern (see @code{<g-pattern-spec>}) 141 142@end table 143 144@end deffn 145 146@deffn Function gtk-accel-map-get @result{}@tie{} (ret@tie{}@code{<gtk-accel-map>}) 147Gets the singleton global @code{<gtk-accel-map>} object. This object is useful 148only for notification of changes to the accelerator map via the ::changed 149signal; it isn't a parameter to the other accelerator map functions. 150 151@table @var 152@item ret 153the global @code{<gtk-accel-map>} object 154 155@end table 156 157Since 2.4 158 159@end deffn 160 161@deffn Function gtk-accel-map-lock-path (accel_path@tie{}@code{mchars}) 162Locks the given accelerator path. If the accelerator map doesn't yet contain an 163entry for @var{accel-path}, a new one is created. 164 165Locking an accelerator path prevents its accelerator from being changed during 166runtime. A locked accelerator path can be unlocked by 167@code{gtk-accel-map-unlock-path}. Refer to @code{gtk-accel-map-change-entry} for 168information about runtime accelerator changes. 169 170If called more than once, @var{accel-path} remains locked until 171@code{gtk-accel-map-unlock-path} has been called an equivalent number of times. 172 173Note that locking of individual accelerator paths is independent from locking 174the @code{<gtk-accel-group>} containing them. For runtime accelerator changes to 175be possible both the accelerator path and its @code{<gtk-accel-group>} have to 176be unlocked. 177 178@table @var 179@item accel-path 180a valid accelerator path 181 182@end table 183 184Since 2.4 185 186@end deffn 187 188@deffn Function gtk-accel-map-unlock-path (accel_path@tie{}@code{mchars}) 189Undoes the last call to @code{gtk-accel-map-lock-path} on this @var{accel-path}. 190Refer to @code{gtk-accel-map-lock-path} for information about accelerator path 191locking. 192 193@table @var 194@item accel-path 195a valid accelerator path 196 197@end table 198 199Since 2.4 200 201@end deffn 202 203 204@c %end of fragment 205