]> Pileus Git - ~andy/gtk/blob - gtk/gtkselection.h
removed unused var 64-bit cast point to const data Made const-correct.
[~andy/gtk] / gtk / gtkselection.h
1 /* GTK - The GIMP Toolkit
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 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.
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  * Library General Public License for more details.
13  *
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.
18  */
19 #ifndef __GTK_SELECTION_H__
20 #define __GTK_SELECTION_H__
21
22
23 #include <gdk/gdk.h>
24 #include <gtk/gtkenums.h>
25 #include <gtk/gtkwidget.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30
31 typedef struct _GtkSelectionData GtkSelectioData;
32 typedef struct _GtkTargetList    GtkTargetList;
33 typedef struct _GtkTargetEntry   GtkTargetEntry;
34
35 struct _GtkTargetEntry {
36   gchar *target;
37   guint  flags;
38   guint  info;
39 };
40
41 /* These structures not public, and are here only for the convenience of
42  * gtkdnd.c 
43  */
44
45 typedef struct _GtkTargetPair GtkTargetPair;
46
47 /* This structure is a list of destinations, and associated guint id's */
48 struct _GtkTargetList {
49   GList *list;
50   guint ref_count;
51 };
52
53 struct _GtkTargetPair {
54   GdkAtom   target;
55   guint     flags;
56   guint     info;
57 };
58
59 GtkTargetList *gtk_target_list_new       (const GtkTargetEntry *targets,
60                                           guint                 ntargets);
61 void           gtk_target_list_ref       (GtkTargetList  *list);
62 void           gtk_target_list_unref     (GtkTargetList  *list);
63 void           gtk_target_list_add       (GtkTargetList  *list,
64                                           GdkAtom         target,
65                                           guint           flags,
66                                           guint           info);
67 void           gtk_target_list_add_table (GtkTargetList        *list,
68                                           const GtkTargetEntry *targets,
69                                           guint                 ntargets);
70 void           gtk_target_list_remove    (GtkTargetList  *list,
71                                           GdkAtom         target);
72 gboolean       gtk_target_list_find      (GtkTargetList  *list,
73                                           GdkAtom         target,
74                                           guint          *info);
75
76 /* Public interface */
77
78 gint gtk_selection_owner_set (GtkWidget           *widget,
79                               GdkAtom              selection,
80                               guint32              time);
81 void gtk_selection_add_target (GtkWidget           *widget, 
82                                GdkAtom              selection,
83                                GdkAtom              target,
84                                guint                info);
85 void gtk_selection_add_targets (GtkWidget            *widget, 
86                                 GdkAtom               selection,
87                                 const GtkTargetEntry *targets,
88                                 guint                 ntargets);
89 gint gtk_selection_convert   (GtkWidget           *widget, 
90                               GdkAtom              selection, 
91                               GdkAtom              target,
92                               guint32              time);
93
94
95 void gtk_selection_data_set (GtkSelectionData *selection_data,
96                              GdkAtom           type,
97                              gint              format,
98                              guchar           *data,
99                              gint              length);
100
101 /* Called when a widget is destroyed */
102
103 void gtk_selection_remove_all      (GtkWidget *widget);
104
105 /* Event handlers */
106
107 gint gtk_selection_clear           (GtkWidget         *widget,
108                                     GdkEventSelection *event);
109 gint gtk_selection_request         (GtkWidget         *widget,
110                                     GdkEventSelection *event);
111 gint gtk_selection_incr_event      (GdkWindow         *window,
112                                     GdkEventProperty  *event);
113 gint gtk_selection_notify          (GtkWidget         *widget,
114                                     GdkEventSelection *event);
115 gint gtk_selection_property_notify (GtkWidget         *widget,
116                                     GdkEventProperty  *event);
117 GtkSelectioData *gtk_selection_data_copy (GtkSelectionData *data);
118 void             gtk_selection_data_free (GtkSelectionData *data);
119
120
121
122 #ifdef __cplusplus
123 }
124 #endif /* __cplusplus */
125
126
127 #endif /* __GTK_SELECTION_H__ */