PageRenderTime 21ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

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