gdkselection.h 5.65 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
33
#include <gdk/gdktypes.h>

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

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

/**
 * GDK_SELECTION_SECONDARY:
 *
 * A #GdkAtom representing the <literal>SECONDARY</literal> selection.
 */
51
#define GDK_SELECTION_SECONDARY 	_GDK_MAKE_ATOM (2)
52
53
54
55
56
57

/**
 * GDK_SELECTION_CLIPBOARD:
 *
 * A #GdkAtom representing the <literal>CLIPBOARD</literal> selection.
 */
58
#define GDK_SELECTION_CLIPBOARD 	_GDK_MAKE_ATOM (69)
59
60
61
62
63
64

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

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

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

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

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

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

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

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

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

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

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

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

/**
 * GDK_SELECTION_TYPE_STRING:
 *
 * A #GdkAtom representing the <literal>STRING</literal> selection type.
 */
149
#define GDK_SELECTION_TYPE_STRING 	_GDK_MAKE_ATOM (31)
150

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

#ifndef GDK_MULTIHEAD_SAFE
Owen Taylor's avatar
Started  
Owen Taylor committed
155
156
gboolean   gdk_selection_owner_set (GdkWindow	 *owner,
				    GdkAtom	  selection,
157
				    guint32	  time_,
Owen Taylor's avatar
Owen Taylor committed
158
				    gboolean      send_event);
Owen Taylor's avatar
Started  
Owen Taylor committed
159
GdkWindow* gdk_selection_owner_get (GdkAtom	  selection);
160
161
162
163
164
#endif/* GDK_MULTIHEAD_SAFE */

gboolean   gdk_selection_owner_set_for_display (GdkDisplay *display,
						GdkWindow  *owner,
						GdkAtom     selection,
165
						guint32     time_,
166
167
168
169
						gboolean    send_event);
GdkWindow *gdk_selection_owner_get_for_display (GdkDisplay *display,
						GdkAtom     selection);

170
171
172
173
174
175
176
177
178
179
180
181
182
183
/**
 * 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.
 */
Owen Taylor's avatar
Started  
Owen Taylor committed
184
185
186
void	   gdk_selection_convert   (GdkWindow	 *requestor,
				    GdkAtom	  selection,
				    GdkAtom	  target,
187
				    guint32	  time_);
188
gint       gdk_selection_property_get (GdkWindow  *requestor,
Owen Taylor's avatar
Started  
Owen Taylor committed
189
190
191
				       guchar	 **data,
				       GdkAtom	  *prop_type,
				       gint	  *prop_format);
192

193
void	   gdk_selection_send_notify (GdkWindow      *requestor,
194
195
196
197
				      GdkAtom	      selection,
				      GdkAtom	      target,
				      GdkAtom	      property,
				      guint32	      time_);
198

199
void       gdk_selection_send_notify_for_display (GdkDisplay      *display,
200
						  GdkWindow       *requestor,
201
202
203
204
						  GdkAtom     	   selection,
						  GdkAtom     	   target,
						  GdkAtom     	   property,
						  guint32     	   time_);
Owen Taylor's avatar
Started  
Owen Taylor committed
205

206
G_END_DECLS
Owen Taylor's avatar
Started  
Owen Taylor committed
207
208

#endif /* __GDK_SELECTION_H__ */