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