]> Pileus Git - ~andy/gtk/blob - gdk/gdkselection.h
wayland: Fix return type from gdk_wayland_window_configure()
[~andy/gtk] / gdk / gdkselection.h
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library 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 GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25  */
26
27 #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
28 #error "Only <gdk/gdk.h> can be included directly."
29 #endif
30
31 #ifndef __GDK_SELECTION_H__
32 #define __GDK_SELECTION_H__
33
34 #include <gdk/gdktypes.h>
35
36 G_BEGIN_DECLS
37
38 /* Predefined atoms relating to selections. In general, one will need to use
39  * gdk_intern_atom
40  */
41 /**
42  * GDK_SELECTION_PRIMARY:
43  *
44  * A #GdkAtom representing the <literal>PRIMARY</literal> selection.
45  */
46 #define GDK_SELECTION_PRIMARY           _GDK_MAKE_ATOM (1)
47
48 /**
49  * GDK_SELECTION_SECONDARY:
50  *
51  * A #GdkAtom representing the <literal>SECONDARY</literal> selection.
52  */
53 #define GDK_SELECTION_SECONDARY         _GDK_MAKE_ATOM (2)
54
55 /**
56  * GDK_SELECTION_CLIPBOARD:
57  *
58  * A #GdkAtom representing the <literal>CLIPBOARD</literal> selection.
59  */
60 #define GDK_SELECTION_CLIPBOARD         _GDK_MAKE_ATOM (69)
61
62 /**
63  * GDK_TARGET_BITMAP:
64  *
65  * A #GdkAtom representing the <literal>BITMAP</literal> selection target.
66  */
67 #define GDK_TARGET_BITMAP               _GDK_MAKE_ATOM (5)
68
69 /**
70  * GDK_TARGET_COLORMAP:
71  *
72  * A #GdkAtom representing the <literal>COLORMAP</literal> selection target.
73  */
74 #define GDK_TARGET_COLORMAP             _GDK_MAKE_ATOM (7)
75
76 /**
77  * GDK_TARGET_DRAWABLE:
78  *
79  * A #GdkAtom representing the <literal>DRAWABLE</literal> selection target.
80  */
81 #define GDK_TARGET_DRAWABLE             _GDK_MAKE_ATOM (17)
82
83 /**
84  * GDK_TARGET_PIXMAP:
85  *
86  * A #GdkAtom representing the <literal>PIXMAP</literal> selection target.
87  */
88 #define GDK_TARGET_PIXMAP               _GDK_MAKE_ATOM (20)
89
90 /**
91  * GDK_TARGET_STRING:
92  *
93  * A #GdkAtom representing the <literal>STRING</literal> selection target.
94  */
95 #define GDK_TARGET_STRING               _GDK_MAKE_ATOM (31)
96
97 /**
98  * GDK_SELECTION_TYPE_ATOM:
99  *
100  * A #GdkAtom representing the <literal>ATOM</literal> selection type.
101  */
102 #define GDK_SELECTION_TYPE_ATOM         _GDK_MAKE_ATOM (4)
103
104 /**
105  * GDK_SELECTION_TYPE_BITMAP:
106  *
107  * A #GdkAtom representing the <literal>BITMAP</literal> selection type.
108  */
109 #define GDK_SELECTION_TYPE_BITMAP       _GDK_MAKE_ATOM (5)
110
111 /**
112  * GDK_SELECTION_TYPE_COLORMAP:
113  *
114  * A #GdkAtom representing the <literal>COLORMAP</literal> selection type.
115  */
116 #define GDK_SELECTION_TYPE_COLORMAP     _GDK_MAKE_ATOM (7)
117
118 /**
119  * GDK_SELECTION_TYPE_DRAWABLE:
120  *
121  * A #GdkAtom representing the <literal>DRAWABLE</literal> selection type.
122  */
123 #define GDK_SELECTION_TYPE_DRAWABLE     _GDK_MAKE_ATOM (17)
124
125 /**
126  * GDK_SELECTION_TYPE_INTEGER:
127  *
128  * A #GdkAtom representing the <literal>INTEGER</literal> selection type.
129  */
130 #define GDK_SELECTION_TYPE_INTEGER      _GDK_MAKE_ATOM (19)
131
132 /**
133  * GDK_SELECTION_TYPE_PIXMAP:
134  *
135  * A #GdkAtom representing the <literal>PIXMAP</literal> selection type.
136  */
137 #define GDK_SELECTION_TYPE_PIXMAP       _GDK_MAKE_ATOM (20)
138
139 /**
140  * GDK_SELECTION_TYPE_WINDOW:
141  *
142  * A #GdkAtom representing the <literal>WINDOW</literal> selection type.
143  */
144 #define GDK_SELECTION_TYPE_WINDOW       _GDK_MAKE_ATOM (33)
145
146 /**
147  * GDK_SELECTION_TYPE_STRING:
148  *
149  * A #GdkAtom representing the <literal>STRING</literal> selection type.
150  */
151 #define GDK_SELECTION_TYPE_STRING       _GDK_MAKE_ATOM (31)
152
153 /* Selections
154  */
155
156 #ifndef GDK_MULTIHEAD_SAFE
157 gboolean   gdk_selection_owner_set (GdkWindow    *owner,
158                                     GdkAtom       selection,
159                                     guint32       time_,
160                                     gboolean      send_event);
161 GdkWindow* gdk_selection_owner_get (GdkAtom       selection);
162 #endif/* GDK_MULTIHEAD_SAFE */
163
164 gboolean   gdk_selection_owner_set_for_display (GdkDisplay *display,
165                                                 GdkWindow  *owner,
166                                                 GdkAtom     selection,
167                                                 guint32     time_,
168                                                 gboolean    send_event);
169 GdkWindow *gdk_selection_owner_get_for_display (GdkDisplay *display,
170                                                 GdkAtom     selection);
171
172 /**
173  * gdk_selection_convert:
174  * @requestor: a #GdkWindow.
175  * @selection: an atom identifying the selection to get the
176  *   contents of.
177  * @target: the form in which to retrieve the selection.
178  * @time_: the timestamp to use when retrieving the
179  *   selection. The selection owner may refuse the
180  *   request if it did not own the selection at
181  *   the time indicated by the timestamp.
182  *
183  * Retrieves the contents of a selection in a given
184  * form.
185  */
186 void       gdk_selection_convert   (GdkWindow    *requestor,
187                                     GdkAtom       selection,
188                                     GdkAtom       target,
189                                     guint32       time_);
190 gint       gdk_selection_property_get (GdkWindow  *requestor,
191                                        guchar    **data,
192                                        GdkAtom    *prop_type,
193                                        gint       *prop_format);
194
195 void       gdk_selection_send_notify (GdkWindow      *requestor,
196                                       GdkAtom         selection,
197                                       GdkAtom         target,
198                                       GdkAtom         property,
199                                       guint32         time_);
200
201 void       gdk_selection_send_notify_for_display (GdkDisplay      *display,
202                                                   GdkWindow       *requestor,
203                                                   GdkAtom          selection,
204                                                   GdkAtom          target,
205                                                   GdkAtom          property,
206                                                   guint32          time_);
207
208 G_END_DECLS
209
210 #endif /* __GDK_SELECTION_H__ */