1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library 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.
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 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library 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.
19 #ifndef __GTK_SELECTION_H__
20 #define __GTK_SELECTION_H__
24 #include <gtk/gtkenums.h>
25 #include <gtk/gtkwidget.h>
29 #endif /* __cplusplus */
31 typedef struct _GtkSelectionData GtkSelectioData;
33 /* a callback function that provides the selection. Arguments are:
34 widget: selection owner
35 offset: offset into selection
36 buffer: buffer into which to store selection
37 length: length of buffer
38 bytes_after: (sizeof(selection) - offset - length ) (return)
39 data: callback data */
41 typedef void (*GtkSelectionFunction) (GtkWidget *widget,
42 GtkSelectionData *selection_data,
45 /* Public interface */
47 gint gtk_selection_owner_set (GtkWidget *widget,
50 void gtk_selection_add_handler (GtkWidget *widget,
53 GtkSelectionFunction function,
55 void gtk_selection_add_handler_full (GtkWidget *widget,
58 GtkSelectionFunction function,
59 GtkCallbackMarshal marshal,
61 GtkDestroyNotify destroy);
62 gint gtk_selection_convert (GtkWidget *widget,
68 void gtk_selection_data_set (GtkSelectionData *selection_data,
74 /* Called when a widget is destroyed */
76 void gtk_selection_remove_all (GtkWidget *widget);
80 gint gtk_selection_clear (GtkWidget *widget,
81 GdkEventSelection *event);
82 gint gtk_selection_request (GtkWidget *widget,
83 GdkEventSelection *event);
84 gint gtk_selection_incr_event (GdkWindow *window,
85 GdkEventProperty *event);
86 gint gtk_selection_notify (GtkWidget *widget,
87 GdkEventSelection *event);
88 gint gtk_selection_property_notify (GtkWidget *widget,
89 GdkEventProperty *event);
95 #endif /* __cplusplus */
98 #endif /* __GTK_SELECTION_H__ */