1 /* GDK - The GIMP Drawing Kit
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 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.
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.
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.
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/.
29 #include "gdkselection.h"
31 #include "gdkproperty.h"
32 #include "gdkprivate.h"
33 #include "gdkprivate-broadway.h"
34 #include "gdkdisplay-broadway.h"
39 typedef struct _OwnerInfo OwnerInfo;
48 static GSList *owner_list;
50 /* When a window is destroyed we check if it is the owner
51 * of any selections. This is somewhat inefficient, but
52 * owner_list is typically short, and it is a low memory,
56 _gdk_selection_window_destroyed (GdkWindow *window)
58 GSList *tmp_list = owner_list;
61 OwnerInfo *info = tmp_list->data;
62 tmp_list = tmp_list->next;
64 if (info->owner == window)
66 owner_list = g_slist_remove (owner_list, info);
73 gdk_selection_owner_set_for_display (GdkDisplay *display,
83 gdk_selection_owner_get_for_display (GdkDisplay *display,
90 gdk_selection_convert (GdkWindow *requestor,
98 gdk_selection_property_get (GdkWindow *requestor,
104 *ret_type = GDK_NONE;
114 gdk_selection_send_notify_for_display (GdkDisplay *display,
115 GdkNativeWindow requestor,
121 g_return_if_fail (GDK_IS_DISPLAY (display));
125 gdk_text_property_to_text_list_for_display (GdkDisplay *display,
136 gdk_free_text_list (gchar **list)
138 g_return_if_fail (list != NULL);
144 gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
151 g_return_val_if_fail (text != NULL, 0);
152 g_return_val_if_fail (length >= 0, 0);
153 g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
159 gdk_string_to_compound_text_for_display (GdkDisplay *display,
166 g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
172 gdk_utf8_to_string_target (const gchar *str)
174 return g_strdup (str);
178 gdk_utf8_to_compound_text_for_display (GdkDisplay *display,
188 void gdk_free_compound_text (guchar *ctext)