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