2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gdk-Selections.html
47 * - GdkDisplay* -> Display
48 * - GdkWindow* -> Window
59 import tango
.io
.Stdout
; // use the tango loging?
63 private import gtkc
.gdktypes
;
65 private import gtkc
.gdk
;
68 private import gdk
.Window
;
69 private import gdk
.Display
;
76 * The X selection mechanism provides a way to transfer
77 * arbitrary chunks of data between programs.
78 * A selection is a essentially
79 * a named clipboard, identified by a string interned
80 * as a GdkAtom. By claiming ownership of a selection,
81 * an application indicates that it will be responsible
82 * for supplying its contents. The most common
83 * selections are PRIMARY and
85 * The contents of a selection can be represented in
86 * a number of formats, called targets.
87 * Each target is identified by an atom. A list of
88 * all possible targets supported by the selection owner
89 * can be retrieved by requesting the special target
90 * TARGETS. When a selection is
91 * retrieved, the data is accompanied by a type
92 * (an atom), and a format (an integer, representing
93 * the number of bits per item).
94 * See Properties and Atoms
95 * for more information.
96 * The functions in this section only contain the lowlevel
97 * parts of the selection protocol. A considerably more
98 * complicated implementation is needed on top of this.
99 * GTK+ contains such an implementation in the functions
100 * in gtkselection.h and programmers
101 * should use those functions instead of the ones presented
102 * here. If you plan to implement selection handling
103 * directly on top of the functions here, you should refer
104 * to the X Inter-client Communication Conventions Manual
107 public class Selection
133 * Sets the owner of the given selection.
135 * a GdkWindow or NULL to indicate that the
136 * the owner for the given should be unset.
138 * an atom identifying a selection.
140 * timestamp to use when setting the selection.
141 * If this is older than the timestamp given last
142 * time the owner was set for the given selection, the
143 * request will be ignored.
145 * if TRUE, and the new owner is different
146 * from the current owner, the current owner
147 * will be sent a SelectionClear event.
149 * TRUE if the selection owner was successfully
150 * changed to owner, otherwise FALSE.
152 public static int ownerSet(Window owner
, GdkAtom selection
, uint time
, int sendEvent
)
154 // gboolean gdk_selection_owner_set (GdkWindow *owner, GdkAtom selection, guint32 time_, gboolean send_event);
155 return gdk_selection_owner_set((owner
is null) ?
null : owner
.getWindowStruct(), selection
, time
, sendEvent
);
159 * Sets the GdkWindow owner as the current owner of the selection selection.
163 * a GdkWindow or NULL to indicate that the owner for
164 * the given should be unset.
166 * an atom identifying a selection.
168 * timestamp to use when setting the selection.
169 * If this is older than the timestamp given last time the owner was
170 * set for the given selection, the request will be ignored.
172 * if TRUE, and the new owner is different from the current
173 * owner, the current owner will be sent a SelectionClear event.
175 * TRUE if the selection owner was successfully changed to owner,
179 public static int ownerSetForDisplay(Display display
, Window owner
, GdkAtom selection
, uint time
, int sendEvent
)
181 // gboolean gdk_selection_owner_set_for_display (GdkDisplay *display, GdkWindow *owner, GdkAtom selection, guint32 time_, gboolean send_event);
182 return gdk_selection_owner_set_for_display((display
is null) ?
null : display
.getDisplayStruct(), (owner
is null) ?
null : owner
.getWindowStruct(), selection
, time
, sendEvent
);
186 * Determines the owner of the given selection.
188 * an atom indentifying a selection.
190 * if there is a selection owner for this window,
191 * and it is a window known to the current process,
192 * the GdkWindow that owns the selection, otherwise
193 * NULL. Note that the return value may be owned
194 * by a different process if a foreign window
195 * was previously created for that window, but
196 * a new foreign window will never be created by
199 public static Window
ownerGet(GdkAtom selection
)
201 // GdkWindow* gdk_selection_owner_get (GdkAtom selection);
202 return new Window( gdk_selection_owner_get(selection
) );
206 * Determine the owner of the given selection.
207 * Note that the return value may be owned by a different
208 * process if a foreign window was previously created for that
209 * window, but a new foreign window will never be created by this call.
213 * an atom indentifying a selection.
215 * if there is a selection owner for this window, and it is a
216 * window known to the current process, the GdkWindow that owns the
217 * selection, otherwise NULL.
220 public static Window
ownerGetForDisplay(Display display
, GdkAtom selection
)
222 // GdkWindow* gdk_selection_owner_get_for_display (GdkDisplay *display, GdkAtom selection);
223 return new Window( gdk_selection_owner_get_for_display((display
is null) ?
null : display
.getDisplayStruct(), selection
) );
227 * Retrieves the contents of a selection in a given
232 * an atom identifying the selection to get the
235 * the form in which to retrieve the selection.
237 * the timestamp to use when retrieving the
238 * selection. The selection owner may refuse the
239 * request if it did not own the selection at
240 * the time indicated by the timestamp.
242 public static void convert(Window requestor
, GdkAtom selection
, GdkAtom target
, uint time
)
244 // void gdk_selection_convert (GdkWindow *requestor, GdkAtom selection, GdkAtom target, guint32 time_);
245 gdk_selection_convert((requestor
is null) ?
null : requestor
.getWindowStruct(), selection
, target
, time
);
249 * Retrieves selection data that was stored by the selection
250 * data in response to a call to gdk_selection_convert(). This function
251 * will not be used by applications, who should use the GtkClipboard
254 * the window on which the data is stored
256 * location to store a pointer to the retrieved data.
257 * If the retrieval failed, NULL we be stored here, otherwise, it
258 * will be non-NULL and the returned data should be freed with g_free()
259 * when you are finished using it. The length of the
260 * allocated memory is one more than the length
261 * of the returned data, and the final byte will always
262 * be zero, to ensure nul-termination of strings.
264 * location to store the type of the property.
266 * location to store the format of the property.
268 * the length of the retrieved data.
270 public static int propertyGet(Window requestor
, char** data
, GdkAtom
* propType
, int* propFormat
)
272 // gboolean gdk_selection_property_get (GdkWindow *requestor, guchar **data, GdkAtom *prop_type, gint *prop_format);
273 return gdk_selection_property_get((requestor
is null) ?
null : requestor
.getWindowStruct(), data
, propType
, propFormat
);
277 * Sends a response to SelectionRequest event.
279 * window to which to deliver response.
281 * selection that was requested.
283 * target that was selected.
285 * property in which the selection owner stored the
286 * data, or GDK_NONE to indicate that the request
291 public static void sendNotify(uint requestor
, GdkAtom selection
, GdkAtom target
, GdkAtom property
, uint time
)
293 // void gdk_selection_send_notify (guint32 requestor, GdkAtom selection, GdkAtom target, GdkAtom property, guint32 time_);
294 gdk_selection_send_notify(requestor
, selection
, target
, property
, time
);
298 * Send a response to SelectionRequest event.
300 * the GdkDisplay where requestor is realized
302 * window to which to deliver response.
304 * selection that was requested.
306 * target that was selected.
308 * property in which the selection owner stored the data,
309 * or GDK_NONE to indicate that the request was rejected.
314 public static void sendNotifyForDisplay(Display display
, uint requestor
, GdkAtom selection
, GdkAtom target
, GdkAtom property
, uint time
)
316 // void gdk_selection_send_notify_for_display (GdkDisplay *display, guint32 requestor, GdkAtom selection, GdkAtom target, GdkAtom property, guint32 time_);
317 gdk_selection_send_notify_for_display((display
is null) ?
null : display
.getDisplayStruct(), requestor
, selection
, target
, property
, time
);