/src/wrappers/gtk/library/gtk_accelerator_map.e

http://github.com/tybor/Liberty · Specman e · 287 lines · 40 code · 33 blank · 214 comment · 2 complexity · be45022492f31b91afd27815fcb2946f MD5 · raw file

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