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 #include <gdk/gdkversionmacros.h> 34 35 G_BEGIN_DECLS 36 37 /* Predefined atoms relating to selections. In general, one will need to use 38 * gdk_intern_atom 39 */ 40 /** 41 * GDK_SELECTION_PRIMARY: 42 * 43 * A #GdkAtom representing the `PRIMARY` selection. 44 */ 45 #define GDK_SELECTION_PRIMARY _GDK_MAKE_ATOM (1) 46 47 /** 48 * GDK_SELECTION_SECONDARY: 49 * 50 * A #GdkAtom representing the `SECONDARY` selection. 51 */ 52 #define GDK_SELECTION_SECONDARY _GDK_MAKE_ATOM (2) 53 54 /** 55 * GDK_SELECTION_CLIPBOARD: 56 * 57 * A #GdkAtom representing the `CLIPBOARD` selection. 58 */ 59 #define GDK_SELECTION_CLIPBOARD _GDK_MAKE_ATOM (69) 60 61 /** 62 * GDK_TARGET_BITMAP: 63 * 64 * A #GdkAtom representing the `BITMAP` selection target. 65 */ 66 #define GDK_TARGET_BITMAP _GDK_MAKE_ATOM (5) 67 68 /** 69 * GDK_TARGET_COLORMAP: 70 * 71 * A #GdkAtom representing the `COLORMAP` selection target. 72 */ 73 #define GDK_TARGET_COLORMAP _GDK_MAKE_ATOM (7) 74 75 /** 76 * GDK_TARGET_DRAWABLE: 77 * 78 * A #GdkAtom representing the `DRAWABLE` selection target. 79 */ 80 #define GDK_TARGET_DRAWABLE _GDK_MAKE_ATOM (17) 81 82 /** 83 * GDK_TARGET_PIXMAP: 84 * 85 * A #GdkAtom representing the `PIXMAP` selection target. 86 */ 87 #define GDK_TARGET_PIXMAP _GDK_MAKE_ATOM (20) 88 89 /** 90 * GDK_TARGET_STRING: 91 * 92 * A #GdkAtom representing the `STRING` selection target. 93 */ 94 #define GDK_TARGET_STRING _GDK_MAKE_ATOM (31) 95 96 /** 97 * GDK_SELECTION_TYPE_ATOM: 98 * 99 * A #GdkAtom representing the `ATOM` selection type. 100 */ 101 #define GDK_SELECTION_TYPE_ATOM _GDK_MAKE_ATOM (4) 102 103 /** 104 * GDK_SELECTION_TYPE_BITMAP: 105 * 106 * A #GdkAtom representing the `BITMAP` selection type. 107 */ 108 #define GDK_SELECTION_TYPE_BITMAP _GDK_MAKE_ATOM (5) 109 110 /** 111 * GDK_SELECTION_TYPE_COLORMAP: 112 * 113 * A #GdkAtom representing the `COLORMAP` selection type. 114 */ 115 #define GDK_SELECTION_TYPE_COLORMAP _GDK_MAKE_ATOM (7) 116 117 /** 118 * GDK_SELECTION_TYPE_DRAWABLE: 119 * 120 * A #GdkAtom representing the `DRAWABLE` selection type. 121 */ 122 #define GDK_SELECTION_TYPE_DRAWABLE _GDK_MAKE_ATOM (17) 123 124 /** 125 * GDK_SELECTION_TYPE_INTEGER: 126 * 127 * A #GdkAtom representing the `INTEGER` selection type. 128 */ 129 #define GDK_SELECTION_TYPE_INTEGER _GDK_MAKE_ATOM (19) 130 131 /** 132 * GDK_SELECTION_TYPE_PIXMAP: 133 * 134 * A #GdkAtom representing the `PIXMAP` selection type. 135 */ 136 #define GDK_SELECTION_TYPE_PIXMAP _GDK_MAKE_ATOM (20) 137 138 /** 139 * GDK_SELECTION_TYPE_WINDOW: 140 * 141 * A #GdkAtom representing the `WINDOW` selection type. 142 */ 143 #define GDK_SELECTION_TYPE_WINDOW _GDK_MAKE_ATOM (33) 144 145 /** 146 * GDK_SELECTION_TYPE_STRING: 147 * 148 * A #GdkAtom representing the `STRING` selection type. 149 */ 150 #define GDK_SELECTION_TYPE_STRING _GDK_MAKE_ATOM (31) 151 152 /* Selections 153 */ 154 155 GDK_AVAILABLE_IN_ALL 156 gboolean gdk_selection_owner_set (GdkWindow *owner, 157 GdkAtom selection, 158 guint32 time_, 159 gboolean send_event); 160 GDK_AVAILABLE_IN_ALL 161 GdkWindow* gdk_selection_owner_get (GdkAtom selection); 162 GDK_AVAILABLE_IN_ALL 163 gboolean gdk_selection_owner_set_for_display (GdkDisplay *display, 164 GdkWindow *owner, 165 GdkAtom selection, 166 guint32 time_, 167 gboolean send_event); 168 GDK_AVAILABLE_IN_ALL 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 GDK_AVAILABLE_IN_ALL 187 void gdk_selection_convert (GdkWindow *requestor, 188 GdkAtom selection, 189 GdkAtom target, 190 guint32 time_); 191 GDK_AVAILABLE_IN_ALL 192 gint gdk_selection_property_get (GdkWindow *requestor, 193 guchar **data, 194 GdkAtom *prop_type, 195 gint *prop_format); 196 197 GDK_AVAILABLE_IN_ALL 198 void gdk_selection_send_notify (GdkWindow *requestor, 199 GdkAtom selection, 200 GdkAtom target, 201 GdkAtom property, 202 guint32 time_); 203 204 GDK_AVAILABLE_IN_ALL 205 void gdk_selection_send_notify_for_display (GdkDisplay *display, 206 GdkWindow *requestor, 207 GdkAtom selection, 208 GdkAtom target, 209 GdkAtom property, 210 guint32 time_); 211 212 G_END_DECLS 213 214 #endif /* __GDK_SELECTION_H__ */ 215