/src/wrappers/gdk/library/gdk_selection.e

http://github.com/tybor/Liberty · Specman e · 380 lines · 39 code · 19 blank · 322 comment · 3 complexity · 39679df3a8be1a7e04a64069422a9294 MD5 · raw file

  1. indexing
  2. description: "GDK_SELECTION - Functions for transfering data via the X selection mechanism."
  3. copyright: "[
  4. Copyright (C) 2008 eiffel-libraries team, 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 hope 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. deferred class GDK_SELECTION
  19. -- The X selection mechanism provides a way to transfer arbitrary
  20. -- chunks of data between programs. A selection is a essentially a
  21. -- named clipboard, identified by a string interned as a
  22. -- GdkAtom. By claiming ownership of a selection, an application
  23. -- indicates that it will be responsible for supplying its
  24. -- contents. The most common selections are PRIMARY and CLIPBOARD.
  25. -- The contents of a selection can be represented in a number of
  26. -- formats, called targets. Each target is identified by an atom. A
  27. -- list of all possible targets supported by the selection owner
  28. -- can be retrieved by requesting the special target TARGETS. When
  29. -- a selection is retrieved, the data is accompanied by a type (an
  30. -- atom), and a format (an integer, representing the number of bits
  31. -- per item). See Properties and Atoms for more information.
  32. -- The functions in this section only contain the lowlevel parts of
  33. -- the selection protocol. A considerably more complicated
  34. -- implementation is needed on top of this. GTK+ contains such an
  35. -- implementation in the functions in gtkselection.h and
  36. -- programmers should use those functions instead of the ones
  37. -- presented here. If you plan to implement selection handling
  38. -- directly on top of the functions here, you should refer to the X
  39. -- Inter-client Communication Conventions Manual (ICCCM).
  40. insert
  41. WRAPPER_HANDLER
  42. feature -- Constants
  43. primary: GDK_ATOM is
  44. -- A GdkAtom representing the PRIMARY selection.
  45. do
  46. Result.from_external_pointer (gdk_selection_primary)
  47. end
  48. -- GDK_SELECTION_SECONDARY
  49. --
  50. -- #define GDK_SELECTION_SECONDARY _GDK_MAKE_ATOM (2)
  51. --
  52. -- A GdkAtom representing the SECONDARY selection.
  53. clipboard: GDK_ATOM is
  54. -- A GdkAtom representing the CLIPBOARD selection.
  55. do
  56. Result.from_external_pointer (gdk_selection_clipboard)
  57. end
  58. -- GDK_TARGET_BITMAP
  59. --
  60. -- #define GDK_TARGET_BITMAP _GDK_MAKE_ATOM (5)
  61. --
  62. -- A GdkAtom representing the BITMAP selection target.
  63. -- GDK_TARGET_COLORMAP
  64. --
  65. -- #define GDK_TARGET_COLORMAP _GDK_MAKE_ATOM (7)
  66. --
  67. -- A GdkAtom representing the COLORMAP selection target.
  68. -- GDK_TARGET_DRAWABLE
  69. --
  70. -- #define GDK_TARGET_DRAWABLE _GDK_MAKE_ATOM (17)
  71. --
  72. -- A GdkAtom representing the DRAWABLE selection target.
  73. -- GDK_TARGET_PIXMAP
  74. --
  75. -- #define GDK_TARGET_PIXMAP _GDK_MAKE_ATOM (20)
  76. --
  77. -- A GdkAtom representing the PIXMAP selection target.
  78. -- GDK_TARGET_STRING
  79. --
  80. -- #define GDK_TARGET_STRING _GDK_MAKE_ATOM (31)
  81. --
  82. -- A GdkAtom representing the STRING selection target.
  83. -- GDK_SELECTION_TYPE_ATOM
  84. --
  85. -- #define GDK_SELECTION_TYPE_ATOM _GDK_MAKE_ATOM (4)
  86. --
  87. -- A GdkAtom representing the ATOM selection type.
  88. -- GDK_SELECTION_TYPE_BITMAP
  89. --
  90. -- #define GDK_SELECTION_TYPE_BITMAP _GDK_MAKE_ATOM (5)
  91. --
  92. -- A GdkAtom representing the BITMAP selection type.
  93. -- GDK_SELECTION_TYPE_COLORMAP
  94. --
  95. -- #define GDK_SELECTION_TYPE_COLORMAP _GDK_MAKE_ATOM (7)
  96. --
  97. -- A GdkAtom representing the COLORMAP selection type.
  98. -- GDK_SELECTION_TYPE_DRAWABLE
  99. --
  100. -- #define GDK_SELECTION_TYPE_DRAWABLE _GDK_MAKE_ATOM (17)
  101. --
  102. -- A GdkAtom representing the DRAWABLE selection type.
  103. -- GDK_SELECTION_TYPE_INTEGER
  104. --
  105. -- #define GDK_SELECTION_TYPE_INTEGER _GDK_MAKE_ATOM (19)
  106. --
  107. -- A GdkAtom representing the INTEGER selection type.
  108. -- GDK_SELECTION_TYPE_PIXMAP
  109. --
  110. -- #define GDK_SELECTION_TYPE_PIXMAP _GDK_MAKE_ATOM (20)
  111. --
  112. -- A GdkAtom representing the PIXMAP selection type.
  113. -- GDK_SELECTION_TYPE_WINDOW
  114. --
  115. -- #define GDK_SELECTION_TYPE_WINDOW _GDK_MAKE_ATOM (33)
  116. --
  117. -- A GdkAtom representing the WINDOW selection type.
  118. -- GDK_SELECTION_TYPE_STRING
  119. --
  120. -- #define GDK_SELECTION_TYPE_STRING _GDK_MAKE_ATOM (31)
  121. --
  122. -- A GdkAtom representing the STRING selection type.
  123. -- gdk_selection_owner_set ()
  124. --
  125. -- gboolean gdk_selection_owner_set (GdkWindow *owner,
  126. -- GdkAtom selection,
  127. -- guint32 time_,
  128. -- gboolean send_event);
  129. --
  130. -- Sets the owner of the given selection.
  131. --
  132. -- owner :
  133. -- a GdkWindow or NULL to indicate that the the owner for the given should be unset.
  134. --
  135. -- selection :
  136. -- an atom identifying a selection.
  137. --
  138. -- time_ :
  139. -- timestamp to use when setting the selection. If this is older than the timestamp given last time the owner was set for the given selection, the request will be ignored.
  140. --
  141. -- send_event :
  142. -- if TRUE, and the new owner is different from the current owner, the current owner will be sent a SelectionClear event.
  143. --
  144. -- Returns :
  145. -- TRUE if the selection owner was successfully changed to owner, otherwise FALSE.
  146. -- gdk_selection_owner_set_for_display ()
  147. --
  148. -- gboolean gdk_selection_owner_set_for_display (GdkDisplay *display,
  149. -- GdkWindow *owner,
  150. -- GdkAtom selection,
  151. -- guint32 time_,
  152. -- gboolean send_event);
  153. --
  154. -- Sets the GdkWindow owner as the current owner of the selection selection.
  155. --
  156. -- display :
  157. -- the GdkDisplay.
  158. --
  159. -- owner :
  160. -- a GdkWindow or NULL to indicate that the owner for the given should be unset.
  161. --
  162. -- selection :
  163. -- an atom identifying a selection.
  164. --
  165. -- time_ :
  166. -- timestamp to use when setting the selection. If this is older than the timestamp given last time the owner was set for the given selection, the request will be ignored.
  167. --
  168. -- send_event :
  169. -- if TRUE, and the new owner is different from the current owner, the current owner will be sent a SelectionClear event.
  170. --
  171. -- Returns :
  172. -- TRUE if the selection owner was successfully changed to owner, otherwise FALSE.
  173. --
  174. -- Since 2.2
  175. -- gdk_selection_owner_get ()
  176. --
  177. -- GdkWindow* gdk_selection_owner_get (GdkAtom selection);
  178. --
  179. -- Determines the owner of the given selection.
  180. --
  181. -- selection :
  182. -- an atom indentifying a selection.
  183. --
  184. -- Returns :
  185. -- if there is a selection owner for this window, and it is a window known to the current process, the GdkWindow that owns the selection, otherwise NULL. Note that the return value may be owned by a different process if a foreign window was previously created for that window, but a new foreign window will never be created by this call.
  186. -- gdk_selection_owner_get_for_display ()
  187. --
  188. -- GdkWindow* gdk_selection_owner_get_for_display (GdkDisplay *display,
  189. -- GdkAtom selection);
  190. --
  191. -- Determine the owner of the given selection.
  192. --
  193. -- Note that the return value may be owned by a different process if a foreign window was previously created for that window, but a new foreign window will never be created by this call.
  194. --
  195. -- display :
  196. -- a GdkDisplay.
  197. --
  198. -- selection :
  199. -- an atom indentifying a selection.
  200. --
  201. -- Returns :
  202. -- if there is a selection owner for this window, and it is a window known to the current process, the GdkWindow that owns the selection, otherwise NULL.
  203. --
  204. -- Since 2.2
  205. -- gdk_selection_convert ()
  206. --
  207. -- void gdk_selection_convert (GdkWindow *requestor,
  208. -- GdkAtom selection,
  209. -- GdkAtom target,
  210. -- guint32 time_);
  211. --
  212. -- Retrieves the contents of a selection in a given form.
  213. --
  214. -- requestor :
  215. -- a GdkWindow.
  216. --
  217. -- selection :
  218. -- an atom identifying the selection to get the contents of.
  219. --
  220. -- target :
  221. -- the form in which to retrieve the selection.
  222. --
  223. -- time_ :
  224. -- the timestamp to use when retrieving the selection. The selection owner may refuse the request if it did not own the selection at the time indicated by the timestamp.
  225. -- gdk_selection_property_get ()
  226. --
  227. -- gboolean gdk_selection_property_get (GdkWindow *requestor,
  228. -- guchar **data,
  229. -- GdkAtom *prop_type,
  230. -- gint *prop_format);
  231. --
  232. -- Retrieves selection data that was stored by the selection data in response to a call to gdk_selection_convert(). This function will not be used by applications, who should use the GtkClipboard API instead.
  233. --
  234. -- requestor :
  235. -- the window on which the data is stored
  236. --
  237. -- data :
  238. -- location to store a pointer to the retrieved data. If the retrieval failed, NULL we be stored here, otherwise, it will be non-NULL and the returned data should be freed with g_free() when you are finished using it. The length of the allocated memory is one more than the length of the returned data, and the final byte will always be zero, to ensure nul-termination of strings.
  239. --
  240. -- prop_type :
  241. -- location to store the type of the property.
  242. --
  243. -- prop_format :
  244. -- location to store the format of the property.
  245. --
  246. -- Returns :
  247. -- the length of the retrieved data.
  248. -- gdk_selection_send_notify ()
  249. --
  250. -- void gdk_selection_send_notify (guint32 requestor,
  251. -- GdkAtom selection,
  252. -- GdkAtom target,
  253. -- GdkAtom property,
  254. -- guint32 time_);
  255. --
  256. -- Sends a response to SelectionRequest event.
  257. --
  258. -- requestor :
  259. -- window to which to deliver response.
  260. --
  261. -- selection :
  262. -- selection that was requested.
  263. --
  264. -- target :
  265. -- target that was selected.
  266. --
  267. -- property :
  268. -- property in which the selection owner stored the data, or GDK_NONE to indicate that the request was rejected.
  269. --
  270. -- time_ :
  271. -- timestamp.
  272. -- gdk_selection_send_notify_for_display ()
  273. --
  274. -- void gdk_selection_send_notify_for_display
  275. -- (GdkDisplay *display,
  276. -- guint32 requestor,
  277. -- GdkAtom selection,
  278. -- GdkAtom target,
  279. -- GdkAtom property,
  280. -- guint32 time_);
  281. --
  282. -- Send a response to SelectionRequest event.
  283. --
  284. -- display :
  285. -- the GdkDisplay where requestor is realized
  286. --
  287. -- requestor :
  288. -- window to which to deliver response.
  289. --
  290. -- selection :
  291. -- selection that was requested.
  292. --
  293. -- target :
  294. -- target that was selected.
  295. --
  296. -- property :
  297. -- property in which the selection owner stored the data, or GDK_NONE to indicate that the request was rejected.
  298. --
  299. -- time_ :
  300. -- timestamp.
  301. --
  302. -- Since 2.2
  303. feature {} -- Externals
  304. -- typedef GdkSelection;
  305. -- typedef GdkSelectionType;
  306. -- typedef GdkTarget;
  307. gdk_selection_primary: POINTER is
  308. external "C macro use <gdk/gdk.h>"
  309. alias "GDK_SELECTION_PRIMARY"
  310. end
  311. -- #define GDK_SELECTION_SECONDARY
  312. gdk_selection_clipboard: POINTER is
  313. external "C macro use <gdk/gdk.h>"
  314. alias "GDK_SELECTION_CLIPBOARD"
  315. end
  316. -- #define GDK_TARGET_BITMAP
  317. -- #define GDK_TARGET_COLORMAP
  318. -- #define GDK_TARGET_DRAWABLE
  319. -- #define GDK_TARGET_PIXMAP
  320. -- #define GDK_TARGET_STRING
  321. -- #define GDK_SELECTION_TYPE_ATOM
  322. -- #define GDK_SELECTION_TYPE_BITMAP
  323. -- #define GDK_SELECTION_TYPE_COLORMAP
  324. -- #define GDK_SELECTION_TYPE_DRAWABLE
  325. -- #define GDK_SELECTION_TYPE_INTEGER
  326. -- #define GDK_SELECTION_TYPE_PIXMAP
  327. -- #define GDK_SELECTION_TYPE_WINDOW
  328. -- #define GDK_SELECTION_TYPE_STRING
  329. -- gboolean gdk_selection_owner_set (GdkWindow *owner,
  330. -- GdkAtom selection,
  331. -- guint32 time_,
  332. -- gboolean send_event);
  333. -- gboolean gdk_selection_owner_set_for_display (GdkDisplay *display,
  334. -- GdkWindow *owner,
  335. -- GdkAtom selection,
  336. -- guint32 time_,
  337. -- gboolean send_event);
  338. -- GdkWindow* gdk_selection_owner_get (GdkAtom selection);
  339. -- GdkWindow* gdk_selection_owner_get_for_display (GdkDisplay *display,
  340. -- GdkAtom selection);
  341. -- void gdk_selection_convert (GdkWindow *requestor,
  342. -- GdkAtom selection,
  343. -- GdkAtom target,
  344. -- guint32 time_);
  345. -- gboolean gdk_selection_property_get (GdkWindow *requestor,
  346. -- guchar **data,
  347. -- GdkAtom *prop_type,
  348. -- gint *prop_format);
  349. -- void gdk_selection_send_notify (guint32 requestor,
  350. -- GdkAtom selection,
  351. -- GdkAtom target,
  352. -- GdkAtom property,
  353. -- guint32 time_);
  354. -- void gdk_selection_send_notify_for_display
  355. -- (GdkDisplay *display,
  356. -- guint32 requestor,
  357. -- GdkAtom selection,
  358. -- GdkAtom target,
  359. -- GdkAtom property,
  360. -- guint32 time_);
  361. end