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>
30 #endif /* __cplusplus */
32 typedef struct _GtkSelectionData GtkSelectioData;
34 /* a callback function that provides the selection. Arguments are:
35 widget: selection owner
36 offset: offset into selection
37 buffer: buffer into which to store selection
38 length: length of buffer
39 bytes_after: (sizeof(selection) - offset - length ) (return)
40 data: callback data */
42 typedef void (*GtkSelectionFunction) (GtkWidget *widget,
43 GtkSelectionData *selection_data,
46 /* Public interface */
48 gint gtk_selection_owner_set (GtkWidget *widget,
51 void gtk_selection_add_handler (GtkWidget *widget,
54 GtkSelectionFunction function,
56 void gtk_selection_add_handler_full (GtkWidget *widget,
59 GtkSelectionFunction function,
60 GtkCallbackMarshal marshal,
62 GtkDestroyNotify destroy);
63 gint gtk_selection_convert (GtkWidget *widget,
69 void gtk_selection_data_set (GtkSelectionData *selection_data,
75 /* Called when a widget is destroyed */
77 void gtk_selection_remove_all (GtkWidget *widget);
81 gint gtk_selection_clear (GtkWidget *widget,
82 GdkEventSelection *event);
83 gint gtk_selection_request (GtkWidget *widget,
84 GdkEventSelection *event);
85 gint gtk_selection_incr_event (GdkWindow *window,
86 GdkEventProperty *event);
87 gint gtk_selection_notify (GtkWidget *widget,
88 GdkEventSelection *event);
89 gint gtk_selection_property_notify (GtkWidget *widget,
90 GdkEventProperty *event);
91 GtkSelectioData *gtk_selection_data_copy (GtkSelectionData *data);
92 void gtk_selection_data_free (GtkSelectionData *data);
98 #endif /* __cplusplus */
101 #endif /* __GTK_SELECTION_H__ */