[gtk+/gtk-2-24] Deprecate some gdk text conversion routines
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24] Deprecate some gdk text conversion routines
- Date: Tue, 21 Dec 2010 14:56:12 +0000 (UTC)
commit bad6d00966fe6b2ad45ac0c1201b7dcb777fa798
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Dec 17 01:43:24 2010 -0500
Deprecate some gdk text conversion routines
And add x11-specific replacements for them
gdk/gdk.symbols | 16 ++++++++++++-
gdk/gdkproperty.h | 22 ++++++++++-------
gdk/x11/gdkselection-x11.c | 55 ++++++++++++++++++++++++++++++++++++++++++++
gdk/x11/gdkx.h | 21 ++++++++++++++++
4 files changed, 104 insertions(+), 10 deletions(-)
---
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index a0d0612..9d9dfc3 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -175,12 +175,14 @@ gdk_screen_height_mm G_GNUC_CONST
#if IN_HEADER(__GDK_PROPERTY_H__)
#if IN_FILE(__GDK_SELECTION_C__)
+#ifndef GDK_DISABLE_DEPRECATED
gdk_string_to_compound_text
gdk_text_property_to_text_list
gdk_text_property_to_utf8_list
gdk_utf8_to_compound_text
#endif
#endif
+#endif
#if IN_HEADER(__GDK_PROPERTY_H__)
#if IN_FILE(__GDK_PROPERTY_X11_C__)
@@ -195,13 +197,25 @@ gdk_property_get
#if IN_HEADER(__GDK_PROPERTY_H__)
#if IN_FILE(__GDK_SELECTION_X11_C__)
+#ifndef GDK_DISABLE_DEPRECATED
gdk_free_compound_text
gdk_free_text_list
gdk_string_to_compound_text_for_display
gdk_text_property_to_text_list_for_display
+gdk_utf8_to_compound_text_for_display
+#endif
gdk_text_property_to_utf8_list_for_display
gdk_utf8_to_string_target
-gdk_utf8_to_compound_text_for_display
+#endif
+#endif
+
+#if IN_HEADER(__GDK_X_H__)
+#if IN_FILE(__GDK_SELECTION_X11_C__)
+gdk_x11_display_string_to_compound_text
+gdk_x11_display_text_property_to_text_list
+gdk_x11_display_utf8_to_compound_text
+gdk_x11_free_compound_text
+gdk_x11_free_text_list
#endif
#endif
diff --git a/gdk/gdkproperty.h b/gdk/gdkproperty.h
index 3cfda50..ba99e6e 100644
--- a/gdk/gdkproperty.h
+++ b/gdk/gdkproperty.h
@@ -67,16 +67,12 @@ void gdk_property_change (GdkWindow *window,
void gdk_property_delete (GdkWindow *window,
GdkAtom property);
#ifndef GDK_MULTIHEAD_SAFE
+#ifndef GDK_DISABLE_DEPRECATED
gint gdk_text_property_to_text_list (GdkAtom encoding,
gint format,
const guchar *text,
gint length,
gchar ***list);
-gint gdk_text_property_to_utf8_list (GdkAtom encoding,
- gint format,
- const guchar *text,
- gint length,
- gchar ***list);
gboolean gdk_utf8_to_compound_text (const gchar *str,
GdkAtom *encoding,
gint *format,
@@ -87,22 +83,29 @@ gint gdk_string_to_compound_text (const gchar *str,
gint *format,
guchar **ctext,
gint *length);
+gint gdk_text_property_to_utf8_list (GdkAtom encoding,
+ gint format,
+ const guchar *text,
+ gint length,
+ gchar ***list);
+#endif
#endif
-gint gdk_text_property_to_text_list_for_display (GdkDisplay *display,
+gint gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
GdkAtom encoding,
gint format,
const guchar *text,
gint length,
gchar ***list);
-gint gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
+
+gchar *gdk_utf8_to_string_target (const gchar *str);
+#ifndef GDK_DISABLE_DEPRECATED
+gint gdk_text_property_to_text_list_for_display (GdkDisplay *display,
GdkAtom encoding,
gint format,
const guchar *text,
gint length,
gchar ***list);
-
-gchar *gdk_utf8_to_string_target (const gchar *str);
gint gdk_string_to_compound_text_for_display (GdkDisplay *display,
const gchar *str,
GdkAtom *encoding,
@@ -118,6 +121,7 @@ gboolean gdk_utf8_to_compound_text_for_display (GdkDisplay *display,
void gdk_free_text_list (gchar **list);
void gdk_free_compound_text (guchar *ctext);
+#endif
G_END_DECLS
diff --git a/gdk/x11/gdkselection-x11.c b/gdk/x11/gdkselection-x11.c
index f993b5b..3a69578 100644
--- a/gdk/x11/gdkselection-x11.c
+++ b/gdk/x11/gdkselection-x11.c
@@ -438,10 +438,28 @@ gdk_selection_send_notify_for_display (GdkDisplay *display,
* if the conversion failed.
*
* Since: 2.2
+ *
+ * Deprecated:2.24: Use gdk_x11_display_text_property_to_text_list()
*/
gint
gdk_text_property_to_text_list_for_display (GdkDisplay *display,
GdkAtom encoding,
+ gint format,
+ const guchar *text,
+ gint length,
+ gchar ***list)
+{
+ return gdk_x11_display_text_property_to_text_list (display,
+ encoding,
+ format,
+ text,
+ length,
+ list);
+}
+
+gint
+gdk_x11_display_text_property_to_text_list (GdkDisplay *display,
+ GdkAtom encoding,
gint format,
const guchar *text,
gint length,
@@ -481,6 +499,12 @@ gdk_text_property_to_text_list_for_display (GdkDisplay *display,
void
gdk_free_text_list (gchar **list)
{
+ gdk_x11_free_text_list (list);
+}
+
+void
+gdk_x11_free_text_list (gchar **list)
+{
g_return_if_fail (list != NULL);
XFreeStringList (list);
@@ -685,6 +709,8 @@ gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
* Returns: 0 upon success, non-zero upon failure.
*
* Since: 2.2
+ *
+ * Deprecated:2.24: Use gdk_x11_display_string_to_compound_text()
**/
gint
gdk_string_to_compound_text_for_display (GdkDisplay *display,
@@ -694,6 +720,17 @@ gdk_string_to_compound_text_for_display (GdkDisplay *display,
guchar **ctext,
gint *length)
{
+ return gdk_x11_display_string_to_compound_text (display, str, encoding, format, ctext, length);
+}
+
+gint
+gdk_x11_display_string_to_compound_text (GdkDisplay *display,
+ const gchar *str,
+ GdkAtom *encoding,
+ gint *format,
+ guchar **ctext,
+ gint *length)
+{
gint res;
XTextProperty property;
@@ -818,6 +855,8 @@ gdk_utf8_to_string_target (const gchar *str)
* %FALSE.
*
* Since: 2.2
+ *
+ * Deprecated:2.24: Use gdk_x11_display_utf8_to_compound_text()
**/
gboolean
gdk_utf8_to_compound_text_for_display (GdkDisplay *display,
@@ -827,6 +866,17 @@ gdk_utf8_to_compound_text_for_display (GdkDisplay *display,
guchar **ctext,
gint *length)
{
+ return gdk_x11_display_utf8_to_compound_text (display, str, encoding, format, ctext, length);
+}
+
+gboolean
+gdk_x11_display_utf8_to_compound_text (GdkDisplay *display,
+ const gchar *str,
+ GdkAtom *encoding,
+ gint *format,
+ guchar **ctext,
+ gint *length)
+{
gboolean need_conversion;
const gchar *charset;
gchar *locale_str, *tmp_str;
@@ -884,6 +934,11 @@ gdk_utf8_to_compound_text_for_display (GdkDisplay *display,
void gdk_free_compound_text (guchar *ctext)
{
+ gdk_x11_free_compound_text (ctext);
+}
+
+void gdk_x11_free_compound_text (guchar *ctext)
+{
if (ctext)
XFree (ctext);
}
diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h
index cdadd64..f3ac394 100644
--- a/gdk/x11/gdkx.h
+++ b/gdk/x11/gdkx.h
@@ -228,6 +228,27 @@ GdkWindow *gdk_x11_window_foreign_new_for_display (GdkDisplay *display,
GdkWindow *gdk_x11_window_lookup_for_display (GdkDisplay *display,
Window window);
+gint gdk_x11_display_text_property_to_text_list (GdkDisplay *display,
+ GdkAtom encoding,
+ gint format,
+ const guchar *text,
+ gint length,
+ gchar ***list);
+void gdk_x11_free_text_list (gchar **list);
+gint gdk_x11_display_string_to_compound_text (GdkDisplay *display,
+ const gchar *str,
+ GdkAtom *encoding,
+ gint *format,
+ guchar **ctext,
+ gint *length);
+gboolean gdk_x11_display_utf8_to_compound_text (GdkDisplay *display,
+ const gchar *str,
+ GdkAtom *encoding,
+ gint *format,
+ guchar **ctext,
+ gint *length);
+void gdk_x11_free_compound_text (guchar *ctext);
+
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]