]> Pileus Git - ~andy/gtk/blob - gtk/gtkselection.h
Remove g_convert (moved to glib) and now useless utf_to_latin1()
[~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 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, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
25  */
26
27 #ifndef __GTK_SELECTION_H__
28 #define __GTK_SELECTION_H__
29
30
31 #include <gdk/gdk.h>
32 #include <gtk/gtkenums.h>
33 #include <gtk/gtkwidget.h>
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif /* __cplusplus */
38
39 typedef struct _GtkSelectionData GtkSelectioData;
40 typedef struct _GtkTargetList    GtkTargetList;
41 typedef struct _GtkTargetEntry   GtkTargetEntry;
42
43 struct _GtkTargetEntry {
44   gchar *target;
45   guint  flags;
46   guint  info;
47 };
48
49 /* These structures not public, and are here only for the convenience of
50  * gtkdnd.c 
51  */
52
53 typedef struct _GtkTargetPair GtkTargetPair;
54
55 /* This structure is a list of destinations, and associated guint id's */
56 struct _GtkTargetList {
57   GList *list;
58   guint ref_count;
59 };
60
61 struct _GtkTargetPair {
62   GdkAtom   target;
63   guint     flags;
64   guint     info;
65 };
66
67 GtkTargetList *gtk_target_list_new       (const GtkTargetEntry *targets,
68                                           guint                 ntargets);
69 void           gtk_target_list_ref       (GtkTargetList  *list);
70 void           gtk_target_list_unref     (GtkTargetList  *list);
71 void           gtk_target_list_add       (GtkTargetList  *list,
72                                           GdkAtom         target,
73                                           guint           flags,
74                                           guint           info);
75 void           gtk_target_list_add_table (GtkTargetList        *list,
76                                           const GtkTargetEntry *targets,
77                                           guint                 ntargets);
78 void           gtk_target_list_remove    (GtkTargetList  *list,
79                                           GdkAtom         target);
80 gboolean       gtk_target_list_find      (GtkTargetList  *list,
81                                           GdkAtom         target,
82                                           guint          *info);
83
84 /* Public interface */
85
86 gboolean gtk_selection_owner_set     (GtkWidget            *widget,
87                                       GdkAtom               selection,
88                                       guint32               time);
89 void     gtk_selection_add_target    (GtkWidget            *widget,
90                                       GdkAtom               selection,
91                                       GdkAtom               target,
92                                       guint                 info);
93 void     gtk_selection_add_targets   (GtkWidget            *widget,
94                                       GdkAtom               selection,
95                                       const GtkTargetEntry *targets,
96                                       guint                 ntargets);
97 void     gtk_selection_clear_targets (GtkWidget            *widget,
98                                       GdkAtom               selection);
99 gint     gtk_selection_convert       (GtkWidget            *widget,
100                                       GdkAtom               selection,
101                                       GdkAtom               target,
102                                       guint32               time);
103 void     gtk_selection_data_set      (GtkSelectionData     *selection_data,
104                                       GdkAtom               type,
105                                       gint                  format,
106                                       const guchar         *data,
107                                       gint                  length);
108 gboolean gtk_selection_data_set_text (GtkSelectionData     *selection_data,
109                                       const guchar         *str);
110 guchar * gtk_selection_data_get_text (GtkSelectionData     *selection_data);
111
112 /* Called when a widget is destroyed */
113
114 void gtk_selection_remove_all      (GtkWidget *widget);
115
116 /* Event handlers */
117
118 gint gtk_selection_clear           (GtkWidget         *widget,
119                                     GdkEventSelection *event);
120 gint gtk_selection_request         (GtkWidget         *widget,
121                                     GdkEventSelection *event);
122 gint gtk_selection_incr_event      (GdkWindow         *window,
123                                     GdkEventProperty  *event);
124 gint gtk_selection_notify          (GtkWidget         *widget,
125                                     GdkEventSelection *event);
126 gint gtk_selection_property_notify (GtkWidget         *widget,
127                                     GdkEventProperty  *event);
128 GtkSelectioData *gtk_selection_data_copy (GtkSelectionData *data);
129 void             gtk_selection_data_free (GtkSelectionData *data);
130
131
132
133 #ifdef __cplusplus
134 }
135 #endif /* __cplusplus */
136
137
138 #endif /* __GTK_SELECTION_H__ */