]> Pileus Git - ~andy/gtk/blob - gdk/gdkselection.c
Make PLT-reduction work with gcc4, and don't include everything in
[~andy/gtk] / gdk / gdkselection.c
1 #include <config.h>
2 #include "gdkproperty.h"
3 #include "gdkdisplay.h"
4 #include "gdkselection.h"
5 #include "gdkalias.h"
6
7 gboolean
8 gdk_selection_owner_set (GdkWindow *owner,
9                          GdkAtom    selection,
10                          guint32    time,
11                          gboolean   send_event)
12 {
13   return gdk_selection_owner_set_for_display (gdk_display_get_default (),
14                                               owner, selection, 
15                                               time, send_event);
16 }
17
18 GdkWindow*
19 gdk_selection_owner_get (GdkAtom selection)
20 {
21   return gdk_selection_owner_get_for_display (gdk_display_get_default (), 
22                                               selection);
23 }
24
25 void
26 gdk_selection_send_notify (guint32  requestor,
27                            GdkAtom  selection,
28                            GdkAtom  target,
29                            GdkAtom  property,
30                            guint32  time)
31 {
32   gdk_selection_send_notify_for_display (gdk_display_get_default (), 
33                                          requestor, selection, 
34                                          target, property, time);
35 }
36
37 gint
38 gdk_text_property_to_text_list (GdkAtom       encoding,
39                                 gint          format, 
40                                 const guchar *text,
41                                 gint          length,
42                                 gchar      ***list)
43 {
44   return gdk_text_property_to_text_list_for_display (gdk_display_get_default (),
45                                                      encoding, format, text, length, list);
46 }
47
48 /**
49  * gdk_text_property_to_utf8_list:
50  * @encoding: an atom representing the encoding of the text
51  * @format:   the format of the property
52  * @text:     the text to convert
53  * @length:   the length of @text, in bytes
54  * @list:     location to store the list of strings or %NULL. The
55  *            list should be freed with g_strfreev().
56  * 
57  * Convert a text property in the giving encoding to
58  * a list of UTF-8 strings. 
59  * 
60  * Return value: the number of strings in the resulting
61  *               list.
62  **/
63 gint 
64 gdk_text_property_to_utf8_list (GdkAtom        encoding,
65                                 gint           format,
66                                 const guchar  *text,
67                                 gint           length,
68                                 gchar       ***list)
69 {
70   return gdk_text_property_to_utf8_list_for_display (gdk_display_get_default (),
71                                                      encoding, format, text, length, list);
72 }
73
74 gint
75 gdk_string_to_compound_text (const gchar *str,
76                              GdkAtom     *encoding,
77                              gint        *format,
78                              guchar     **ctext,
79                              gint        *length)
80 {
81   return gdk_string_to_compound_text_for_display (gdk_display_get_default (),
82                                                   str, encoding, format, 
83                                                   ctext, length);
84 }
85
86 /**
87  * gdk_utf8_to_compound_text:
88  * @str:      a UTF-8 string
89  * @encoding: location to store resulting encoding
90  * @format:   location to store format of the result
91  * @ctext:    location to store the data of the result
92  * @length:   location to store the length of the data
93  *            stored in @ctext
94  * 
95  * Convert from UTF-8 to compound text. 
96  * 
97  * Return value: %TRUE if the conversion succeeded, otherwise
98  *               false.
99  **/
100 gboolean
101 gdk_utf8_to_compound_text (const gchar *str,
102                            GdkAtom     *encoding,
103                            gint        *format,
104                            guchar     **ctext,
105                            gint        *length)
106 {
107   return gdk_utf8_to_compound_text_for_display (gdk_display_get_default (),
108                                                 str, encoding, format, 
109                                                 ctext, length);
110 }
111
112 #define __GDK_SELECTION_C__
113 #include "gdkaliasdef.c"