/src/wrappers/gtk/library/gtk_accelerator_map.e
Specman e | 287 lines | 40 code | 33 blank | 214 comment | 2 complexity | be45022492f31b91afd27815fcb2946f MD5 | raw file
1indexing 2 description: "Accelerator Maps -- Loadable keyboard accelerator specifications." 3 copyright: "[ 4 Copyright (C) 2007 Paolo Redaelli, GTK+ team 5 6 This library is free software; you can redistribute it and/or 7 modify it under the terms of the GNU Lesser General Public License 8 as published by the Free Software Foundation; either version 2.1 of 9 the License, or (at your option) any later version. 10 11 This library is distributed in the hopeOA that it will be useful, but 12 WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 Lesser General Public License for more details. 15 16 You should have received a copy of the GNU Lesser General Public 17 License along with this library; if not, write to the Free Software 18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 19 02110-1301 USA 20 ]" 21 22 wrapped_version: "2.10.6" 23 24class GTK_ACCELERATOR_MAP 25 26inherit 27 C_STRUCT 28 redefine default_create 29 end 30 31 C_OWNED 32 redefine default_create 33 end 34 35 SINGLETON 36 undefine copy,is_equal 37 redefine default_create 38 end 39 40insert 41 GTK_ACCEL_MAPS_EXTERNALS redefine default_create end 42 43creation default_create 44 45feature 46 default_create is 47 -- Create the singleton global GTK_ACCELERATOR_MAP object. This object 48 -- is useful only for notification of changes to the accelerator map 49 -- via the ::changed signal; it isn't a parameter to the other 50 -- accelerator map functions. 51 52 do 53 from_external_pointer (gtk_accel_map_get) 54 55 end 56 57feature {} -- Unwrapped code 58 59 --add_entry () 60 -- 61 -- void gtk_accel_map_add_entry (const gchar *accel_path, 62 -- guint accel_key, 63 -- GdkModifierType accel_mods); 64 -- 65 -- Registers a new accelerator with the global accelerator map. This function 66 -- should only be called once per accel_path with the canonical accel_key and 67 -- accel_mods for this path. To change the accelerator during runtime 68 -- programatically, use gtk_accel_map_change_entry(). The accelerator path 69 -- must consist of "<WINDOWTYPE>/Category1/Category2/.../Action", where 70 -- <WINDOWTYPE> should be a unique application-specific identifier, that 71 -- corresponds to the kind of window the accelerator is being used in, e.g. 72 -- "Gimp-Image", "Abiword-Document" or "Gnumeric-Settings". The 73 -- Category1/.../Action portion is most appropriately chosen by the action 74 -- the accelerator triggers, i.e. for accelerators on menu items, choose the 75 -- item's menu path, e.g. "File/Save As", "Image/View/Zoom" or "Edit/Select 76 -- All". So a full valid accelerator path may look like: 77 -- "<Gimp-Toolbox>/File/Dialogs/Tool Options...". 78 -- 79 -- accel_path : valid accelerator path 80 -- accel_key : the accelerator key 81 -- accel_mods : the accelerator modifiers 82 83 -- gtk_accel_map_lookup_entry () 84 -- 85 -- gboolean gtk_accel_map_lookup_entry (const gchar *accel_path, 86 -- GtkAccelKey *key); 87 -- 88 -- Looks up the accelerator entry for accel_path and fills in key. 89 -- 90 -- accel_path : a valid accelerator path 91 -- key : the accelerator key to be filled in (optional) 92 -- Returns : TRUE if accel_path is known, FALSE otherwise 93 94 -- gtk_accel_map_change_entry () 95 96 -- gboolean gtk_accel_map_change_entry (const gchar *accel_path, 97 -- guint accel_key, GdkModifierType accel_mods, gboolean replace); 98 99 -- Changes the accel_key and accel_mods currently associated with accel_path. 100 -- Due to conflicts with other accelerators, a change may not always be 101 -- possible, replace indicates whether other accelerators may be deleted to 102 -- resolve such conflicts. A change will only occur if all conflicts could be 103 -- resolved (which might not be the case if conflicting accelerators are 104 -- locked). Successful changes are indicated by a TRUE return value. 105 -- 106 -- accel_path : a valid accelerator path 107 -- accel_key : the new accelerator key 108 -- accel_mods : the new accelerator modifiers 109 -- replace : TRUE if other accelerators may be deleted upon conflicts 110 -- Returns : TRUE if the accelerator could be changed, FALSE otherwise 111 112 -- gtk_accel_map_load () 113 114 -- void gtk_accel_map_load (const gchar *file_name); 115 -- 116 -- Parses a file previously saved with gtk_accel_map_save() for accelerator 117 -- specifications, and propagates them accordingly. 118 -- 119 -- file_name : a file containing accelerator specifications, in the GLib file 120 -- name encoding 121 122 -- gtk_accel_map_save () 123 -- 124 -- void gtk_accel_map_save (const gchar *file_name); 125 -- 126 -- Saves current accelerator specifications (accelerator path, key and 127 -- modifiers) to file_name. The file is written in a format suitable to be 128 -- read back in by gtk_accel_map_load(). 129 -- 130 -- file_name : the name of the file to contain accelerator specifications, in 131 -- the GLib file name encoding 132 133 -- gtk_accel_map_foreach () 134 -- 135 -- void gtk_accel_map_foreach (gpointer data, 136 -- GtkAccelMapForeach foreach_func); 137 -- 138 -- Loops over the entries in the accelerator map whose accel path doesn't 139 -- match any of the filters added with gtk_accel_map_add_filter(), and 140 -- execute foreach_func on each. The signature of foreach_func is that of 141 -- GtkAccelMapForeach, the changed parameter indicates whether this 142 -- accelerator was changed during runtime (thus, would need saving during an 143 -- accelerator map dump). 144 -- 145 -- data : data to be passed into foreach_func 146 -- foreach_func : function to be executed for each accel map entry which is 147 -- not filtered out 148 149 -- gtk_accel_map_load_fd () 150 -- 151 -- void gtk_accel_map_load_fd (gint fd); 152 -- 153 -- Filedescriptor variant of gtk_accel_map_load(). 154 -- 155 -- Note that the file descriptor will not be closed by this function. 156 -- 157 -- fd : a valid readable file descriptor 158 159 -- gtk_accel_map_save_fd () 160 -- 161 -- void gtk_accel_map_save_fd (gint fd); 162 -- 163 -- Filedescriptor variant of gtk_accel_map_save(). 164 -- 165 -- Note that the file descriptor will not be closed by this function. 166 -- 167 -- fd : a valid writable file descriptor 168 169 -- gtk_accel_map_load_scanner () 170 -- 171 -- void gtk_accel_map_load_scanner (GScanner *scanner); 172 -- 173 -- GScanner variant of gtk_accel_map_load(). 174 -- 175 -- scanner : a GScanner which has already been provided with an input file 176 177 -- gtk_accel_map_add_filter () 178 -- 179 -- void gtk_accel_map_add_filter (const gchar *filter_pattern); 180 -- 181 -- Adds a filter to the global list of accel path filters. 182 -- 183 -- Accel map entries whose accel path matches one of the filters are skipped 184 -- by gtk_accel_map_foreach(). 185 -- 186 -- This function is intended for GTK+ modules that create their own menus, 187 -- but don't want them to be saved into the applications accelerator map 188 -- dump. 189 -- 190 -- filter_pattern : a pattern (see GPatternSpec) 191 192 -- gtk_accel_map_foreach_unfiltered () 193 -- 194 -- void gtk_accel_map_foreach_unfiltered 195 -- (gpointer data, 196 -- GtkAccelMapForeach foreach_func); 197 -- 198 -- Loops over all entries in the accelerator map, and execute foreach_func on 199 -- each. The signature of foreach_func is that of GtkAccelMapForeach, the 200 -- changed parameter indicates whether this accelerator was changed during 201 -- runtime (thus, would need saving during an accelerator map dump). 202 -- 203 -- data : data to be passed into foreach_func 204 -- foreach_func : function to be executed for each accel map entry 205 206 -- gtk_accel_map_lock_path () 207 -- 208 -- void gtk_accel_map_lock_path (const gchar *accel_path); 209 -- 210 -- Locks the given accelerator path. If the accelerator map doesn't yet 211 -- contain an entry for accel_path, a new one is created. 212 -- 213 -- Locking an accelerator path prevents its accelerator from being changed 214 -- during runtime. A locked accelerator path can be unlocked by 215 -- gtk_accel_map_unlock_path(). Refer to gtk_accel_map_change_entry() for 216 -- information about runtime accelerator changes. 217 -- 218 -- If called more than once, accel_path remains locked until 219 -- gtk_accel_map_unlock_path() has been called an equivalent number of times. 220 -- 221 -- Note that locking of individual accelerator paths is independent from 222 -- locking the GtkAccelGroup containing them. For runtime accelerator changes 223 -- to be possible both the accelerator path and its GtkAccelGroup have to be 224 -- unlocked. 225 -- 226 -- accel_path : a valid accelerator path 227 -- 228 -- Since 2.4 229 230 -- gtk_accel_map_unlock_path () 231 -- 232 -- void gtk_accel_map_unlock_path (const gchar *accel_path); 233 -- 234 -- Undoes the last call to gtk_accel_map_lock_path() on this accel_path. 235 -- Refer to gtk_accel_map_lock_path() for information about accelerator path 236 -- locking. 237 -- 238 -- accel_path : a valid accelerator path 239 -- 240 -- Since 2.4 241 -- 242 --Signals 243 -- 244 -- "changed" void user_function (GtkAccelMap *object, 245 -- gchar *accel_path, 246 -- guint accel_key, 247 -- GdkModifierType accel_mods, 248 -- gpointer user_data) : Run last / Has 249 -- details 250 --Signal Details 251 -- 252 -- The "changed" signal 253 -- 254 -- void user_function (GtkAccelMap *object, 255 -- gchar *accel_path, 256 -- guint accel_key, 257 -- GdkModifierType accel_mods, 258 -- gpointer user_data) : Run last / Has details 259 -- 260 -- Notifies of a change in the global accelerator map. The path is also used 261 -- as the detail for the signal, so it is possible to connect to 262 -- changed::accel_path. 263 -- 264 -- object : the global accel map object 265 -- accel_path : the path of the accelerator that changed 266 -- accel_key : the key value for the new accelerator 267 -- accel_mods : the modifier mask for the new accelerator 268 -- user_data : user data set when the signal handler was connected. 269 -- 270 -- Since 2.4 271 272 -- GtkAccelMapForeach () 273 -- 274 -- void (*GtkAccelMapForeach) (gpointer data, 275 -- const gchar *accel_path, 276 -- guint accel_key, 277 -- GdkModifierType accel_mods, 278 -- gboolean changed); 279 -- 280 -- data : 281 -- accel_path : 282 -- accel_key : 283 -- accel_mods : 284 -- changed : 285 286 287end -- class GTK_ACCELERATOR_MAP