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 Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 #ifndef __GTK_SELECTION_H__
19 #define __GTK_SELECTION_H__
23 #include <gtk/gtkenums.h>
24 #include <gtk/gtkwidget.h>
28 #endif /* __cplusplus */
30 typedef struct _GtkSelectionData GtkSelectioData;
32 /* a callback function that provides the selection. Arguments are:
33 widget: selection owner
34 offset: offset into selection
35 buffer: buffer into which to store selection
36 length: length of buffer
37 bytes_after: (sizeof(selection) - offset - length ) (return)
38 data: callback data */
40 typedef void (*GtkSelectionFunction) (GtkWidget *widget,
41 GtkSelectionData *selection_data,
44 /* Public interface */
46 gint gtk_selection_owner_set (GtkWidget *widget,
49 void gtk_selection_add_handler (GtkWidget *widget,
52 GtkSelectionFunction function,
53 GtkRemoveFunction remove_func,
55 gint gtk_selection_convert (GtkWidget *widget,
61 void gtk_selection_data_set (GtkSelectionData *selection_data,
67 /* Called when a widget is destroyed */
69 void gtk_selection_remove_all (GtkWidget *widget);
73 gint gtk_selection_clear (GtkWidget *widget,
74 GdkEventSelection *event);
75 gint gtk_selection_request (GtkWidget *widget,
76 GdkEventSelection *event);
77 gint gtk_selection_incr_event (GdkWindow *window,
78 GdkEventProperty *event);
79 gint gtk_selection_notify (GtkWidget *widget,
80 GdkEventSelection *event);
81 gint gtk_selection_property_notify (GtkWidget *widget,
82 GdkEventProperty *event);
88 #endif /* __cplusplus */
91 #endif /* __GTK_SELECTION_H__ */