gdkselection.h 5.53 KB
Newer Older
Cody Russell's avatar
Cody Russell committed
1
/* GDK - The GIMP Drawing Kit
2
3
4
5
6
7
8
9
10
11
12
13
14
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
15
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16
17
18
19
20
21
 */

/*
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 * files for a list of changes.  These files are distributed with
22
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23
24
 */

25
26
27
#ifndef __GDK_SELECTION_H__
#define __GDK_SELECTION_H__

28
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
29
30
31
#error "Only <gdk/gdk.h> can be included directly."
#endif

Owen Taylor's avatar
Started    
Owen Taylor committed
32
#include <gdk/gdktypes.h>
33
#include <gdk/gdkversionmacros.h>
Owen Taylor's avatar
Started    
Owen Taylor committed
34

35
G_BEGIN_DECLS
Owen Taylor's avatar
Started    
Owen Taylor committed
36

37
38
39
/* Predefined atoms relating to selections. In general, one will need to use
 * gdk_intern_atom
 */
40
41
42
/**
 * GDK_SELECTION_PRIMARY:
 *
43
 * A #GdkAtom representing the `PRIMARY` selection.
44
 */
45
#define GDK_SELECTION_PRIMARY 		_GDK_MAKE_ATOM (1)
46
47
48
49

/**
 * GDK_SELECTION_SECONDARY:
 *
50
 * A #GdkAtom representing the `SECONDARY` selection.
51
 */
52
#define GDK_SELECTION_SECONDARY 	_GDK_MAKE_ATOM (2)
53
54
55
56

/**
 * GDK_SELECTION_CLIPBOARD:
 *
57
 * A #GdkAtom representing the `CLIPBOARD` selection.
58
 */
59
#define GDK_SELECTION_CLIPBOARD 	_GDK_MAKE_ATOM (69)
60
61
62
63

/**
 * GDK_TARGET_BITMAP:
 *
64
 * A #GdkAtom representing the `BITMAP` selection target.
65
 */
66
#define GDK_TARGET_BITMAP 		_GDK_MAKE_ATOM (5)
67
68
69
70

/**
 * GDK_TARGET_COLORMAP:
 *
71
 * A #GdkAtom representing the `COLORMAP` selection target.
72
 */
73
#define GDK_TARGET_COLORMAP 		_GDK_MAKE_ATOM (7)
74
75
76
77

/**
 * GDK_TARGET_DRAWABLE:
 *
78
 * A #GdkAtom representing the `DRAWABLE` selection target.
79
 */
80
#define GDK_TARGET_DRAWABLE 		_GDK_MAKE_ATOM (17)
81
82
83
84

/**
 * GDK_TARGET_PIXMAP:
 *
85
 * A #GdkAtom representing the `PIXMAP` selection target.
86
 */
87
#define GDK_TARGET_PIXMAP 		_GDK_MAKE_ATOM (20)
88
89
90
91

/**
 * GDK_TARGET_STRING:
 *
92
 * A #GdkAtom representing the `STRING` selection target.
93
 */
94
#define GDK_TARGET_STRING 		_GDK_MAKE_ATOM (31)
95
96
97
98

/**
 * GDK_SELECTION_TYPE_ATOM:
 *
99
 * A #GdkAtom representing the `ATOM` selection type.
100
 */
101
#define GDK_SELECTION_TYPE_ATOM 	_GDK_MAKE_ATOM (4)
102
103
104
105

/**
 * GDK_SELECTION_TYPE_BITMAP:
 *
106
 * A #GdkAtom representing the `BITMAP` selection type.
107
 */
108
#define GDK_SELECTION_TYPE_BITMAP 	_GDK_MAKE_ATOM (5)
109
110
111
112

/**
 * GDK_SELECTION_TYPE_COLORMAP:
 *
113
 * A #GdkAtom representing the `COLORMAP` selection type.
114
 */
115
#define GDK_SELECTION_TYPE_COLORMAP 	_GDK_MAKE_ATOM (7)
116
117
118
119

/**
 * GDK_SELECTION_TYPE_DRAWABLE:
 *
120
 * A #GdkAtom representing the `DRAWABLE` selection type.
121
 */
122
#define GDK_SELECTION_TYPE_DRAWABLE 	_GDK_MAKE_ATOM (17)
123
124
125
126

/**
 * GDK_SELECTION_TYPE_INTEGER:
 *
127
 * A #GdkAtom representing the `INTEGER` selection type.
128
 */
129
#define GDK_SELECTION_TYPE_INTEGER 	_GDK_MAKE_ATOM (19)
130
131
132
133

/**
 * GDK_SELECTION_TYPE_PIXMAP:
 *
134
 * A #GdkAtom representing the `PIXMAP` selection type.
135
 */
136
#define GDK_SELECTION_TYPE_PIXMAP 	_GDK_MAKE_ATOM (20)
137
138
139
140

/**
 * GDK_SELECTION_TYPE_WINDOW:
 *
141
 * A #GdkAtom representing the `WINDOW` selection type.
142
 */
143
#define GDK_SELECTION_TYPE_WINDOW 	_GDK_MAKE_ATOM (33)
144
145
146
147

/**
 * GDK_SELECTION_TYPE_STRING:
 *
148
 * A #GdkAtom representing the `STRING` selection type.
149
 */
150
#define GDK_SELECTION_TYPE_STRING 	_GDK_MAKE_ATOM (31)
151

Owen Taylor's avatar
Started    
Owen Taylor committed
152
153
/* Selections
 */
154

155
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
156
157
gboolean   gdk_selection_owner_set (GdkWindow	 *owner,
				    GdkAtom	  selection,
158
				    guint32	  time_,
Owen Taylor's avatar
Owen Taylor committed
159
				    gboolean      send_event);
160
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
161
GdkWindow* gdk_selection_owner_get (GdkAtom	  selection);
162
GDK_AVAILABLE_IN_ALL
163
164
165
gboolean   gdk_selection_owner_set_for_display (GdkDisplay *display,
						GdkWindow  *owner,
						GdkAtom     selection,
166
						guint32     time_,
167
						gboolean    send_event);
168
GDK_AVAILABLE_IN_ALL
169
170
171
GdkWindow *gdk_selection_owner_get_for_display (GdkDisplay *display,
						GdkAtom     selection);

172
173
174
175
176
177
178
179
180
181
182
183
184
185
/**
 * gdk_selection_convert:
 * @requestor: a #GdkWindow.
 * @selection: an atom identifying the selection to get the
 *   contents of.
 * @target: the form in which to retrieve the selection.
 * @time_: 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.
 *
 * Retrieves the contents of a selection in a given
 * form.
 */
186
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
187
188
189
void	   gdk_selection_convert   (GdkWindow	 *requestor,
				    GdkAtom	  selection,
				    GdkAtom	  target,
190
				    guint32	  time_);
191
GDK_AVAILABLE_IN_ALL
192
gint       gdk_selection_property_get (GdkWindow  *requestor,
Owen Taylor's avatar
Started    
Owen Taylor committed
193
194
195
				       guchar	 **data,
				       GdkAtom	  *prop_type,
				       gint	  *prop_format);
196

197
GDK_AVAILABLE_IN_ALL
198
void	   gdk_selection_send_notify (GdkWindow      *requestor,
199
200
201
202
				      GdkAtom	      selection,
				      GdkAtom	      target,
				      GdkAtom	      property,
				      guint32	      time_);
203

204
GDK_AVAILABLE_IN_ALL
205
void       gdk_selection_send_notify_for_display (GdkDisplay      *display,
206
						  GdkWindow       *requestor,
207
208
209
210
						  GdkAtom     	   selection,
						  GdkAtom     	   target,
						  GdkAtom     	   property,
						  guint32     	   time_);
Owen Taylor's avatar
Started    
Owen Taylor committed
211

212
G_END_DECLS
Owen Taylor's avatar
Started    
Owen Taylor committed
213
214

#endif /* __GDK_SELECTION_H__ */