[gtk+] Remove deprecated code from X interaction



commit c1affa4f3cbe51574a1895df9c4d9b77f50f81aa
Author: Javier Jardón <jjardon gnome org>
Date:   Thu Jun 24 22:20:02 2010 +0200

    Remove deprecated code from X interaction

 docs/reference/gdk/gdk3-sections.txt       |   10 --
 docs/reference/gdk/tmpl/fonts.sgml         |   37 -------
 docs/reference/gdk/tmpl/x_interaction.sgml |   65 -------------
 gdk/directfb/gdkfont-directfb.c            |   30 ------
 gdk/gdk.symbols                            |   16 ---
 gdk/gdkfont.c                              |   35 -------
 gdk/gdkfont.h                              |    6 -
 gdk/quartz/gdkfont-quartz.c                |   15 ---
 gdk/win32/gdkfont-win32.c                  |   77 ---------------
 gdk/x11/gdkfont-x11.c                      |  144 ----------------------------
 gdk/x11/gdkx.h                             |   22 ----
 11 files changed, 0 insertions(+), 457 deletions(-)
---
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index 6344697..35b29e1 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -400,11 +400,8 @@ gdk_color_get_type
 GdkFont
 GdkFontType
 gdk_font_load
-gdk_font_load_for_display
 gdk_fontset_load
 gdk_fontset_load_for_display
-gdk_font_from_description
-gdk_font_from_description_for_display
 gdk_font_get_display
 gdk_font_ref
 gdk_font_unref
@@ -1286,8 +1283,6 @@ GDK_SCREEN_XDISPLAY
 GDK_SCREEN_XNUMBER
 GDK_SCREEN_XSCREEN
 GDK_VISUAL_XVISUAL
-GDK_FONT_XDISPLAY
-GDK_FONT_XFONT
 GDK_CURSOR_XCURSOR
 GDK_CURSOR_XDISPLAY
 GDK_GC_XGC
@@ -1305,8 +1300,6 @@ gdk_window_lookup
 gdk_window_lookup_for_display
 gdk_pixmap_lookup
 gdk_pixmap_lookup_for_display
-gdk_font_lookup
-gdk_font_lookup_for_display
 gdk_x11_lookup_xdisplay
 gdk_x11_get_server_time
 gdk_net_wm_supports
@@ -1331,9 +1324,6 @@ gdk_x11_display_set_cursor_theme
 gdk_x11_register_standard_event_type
 gdk_x11_drawable_get_xdisplay
 gdk_x11_drawable_get_xid
-gdk_x11_font_get_name
-gdk_x11_font_get_xdisplay
-gdk_x11_font_get_xfont
 gdk_x11_gc_get_xdisplay
 gdk_x11_gc_get_xgc
 gdk_x11_get_default_root_xwindow
diff --git a/docs/reference/gdk/tmpl/fonts.sgml b/docs/reference/gdk/tmpl/fonts.sgml
index a96238b..2e69396 100644
--- a/docs/reference/gdk/tmpl/fonts.sgml
+++ b/docs/reference/gdk/tmpl/fonts.sgml
@@ -275,24 +275,6 @@ are currently:
 @GDK_FONT_FONT: the font is a single font.
 @GDK_FONT_FONTSET: the font is a fontset.
 
-<!-- ##### FUNCTION gdk_font_load ##### -->
-<para>
-</para>
-
- font_name: 
- Returns: 
-
-
-<!-- ##### FUNCTION gdk_font_load_for_display ##### -->
-<para>
-
-</para>
-
- display: 
- font_name: 
- Returns: 
-
-
 <!-- ##### FUNCTION gdk_fontset_load ##### -->
 <para>
 </para>
@@ -311,25 +293,6 @@ are currently:
 @Returns: 
 
 
-<!-- ##### FUNCTION gdk_font_from_description ##### -->
-<para>
-
-</para>
-
- font_desc: 
- Returns: 
-
-
-<!-- ##### FUNCTION gdk_font_from_description_for_display ##### -->
-<para>
-
-</para>
-
- display: 
- font_desc: 
- Returns: 
-
-
 <!-- ##### FUNCTION gdk_font_get_display ##### -->
 <para>
 
diff --git a/docs/reference/gdk/tmpl/x_interaction.sgml b/docs/reference/gdk/tmpl/x_interaction.sgml
index 6d3620d..52bd20e 100644
--- a/docs/reference/gdk/tmpl/x_interaction.sgml
+++ b/docs/reference/gdk/tmpl/x_interaction.sgml
@@ -179,24 +179,6 @@ Returns the X visual belonging to a #GdkVisual.
 @Returns: an Xlib <type>Visual*</type>.
 
 
-<!-- ##### MACRO GDK_FONT_XDISPLAY ##### -->
-<para>
-Returns the display of a #GdkFont.
-</para>
-
- font: a #GdkFont.
- Returns: an Xlib <type>Display*</type>.
-
-
-<!-- ##### MACRO GDK_FONT_XFONT ##### -->
-<para>
-Returns the X font belonging to a #GdkFont.
-</para>
-
- font: a #GdkFont.
- Returns: an Xlib <type>XFontStruct*</type> or an <type>XFontSet</type>.
-
-
 <!-- ##### MACRO GDK_CURSOR_XCURSOR ##### -->
 <para>
 Returns the X cursor belonging to a #GdkCursor.
@@ -355,26 +337,6 @@ Another name for GDK_DRAWABLE_XID().
 @Returns: 
 
 
-<!-- ##### MACRO gdk_font_lookup ##### -->
-<para>
-Obtains the #GdkFont for the given Xlib font ID, or %NULL if no #GdkFont has
-been created for @xid.
-</para>
-
- xid: an Xlib font ID
-
-
-<!-- ##### MACRO gdk_font_lookup_for_display ##### -->
-<para>
-Obtains the #GdkFont for the given Xlib font ID on @display, or %NULL if no
-#GdkFont has been created for @xid.
-</para>
-
- display: a #GdkDisplay
- xid: an Xlib font ID
-Since: 2.2
-
-
 <!-- ##### FUNCTION gdk_x11_lookup_xdisplay ##### -->
 <para>
 
@@ -595,33 +557,6 @@ Since: 2.2
 @Returns: 
 
 
-<!-- ##### FUNCTION gdk_x11_font_get_name ##### -->
-<para>
-
-</para>
-
- font: 
- Returns: 
-
-
-<!-- ##### FUNCTION gdk_x11_font_get_xdisplay ##### -->
-<para>
-
-</para>
-
- font: 
- Returns: 
-
-
-<!-- ##### FUNCTION gdk_x11_font_get_xfont ##### -->
-<para>
-
-</para>
-
- font: 
- Returns: 
-
-
 <!-- ##### FUNCTION gdk_x11_gc_get_xdisplay ##### -->
 <para>
 
diff --git a/gdk/directfb/gdkfont-directfb.c b/gdk/directfb/gdkfont-directfb.c
index 93ca82a..06635c5 100644
--- a/gdk/directfb/gdkfont-directfb.c
+++ b/gdk/directfb/gdkfont-directfb.c
@@ -73,17 +73,6 @@ gdk_directfb_bogus_font (gint height)
   return font;
 }
 
-GdkFont*
-gdk_font_from_description_for_display (GdkDisplay * display,PangoFontDescription *font_desc)
-{
-  gint size;
-
-  g_return_val_if_fail (font_desc, NULL);
-
-  size = pango_font_description_get_size (font_desc);
-
-  return gdk_directfb_bogus_font (PANGO_PIXELS (size));
-}
 
 /* ********************* */
 
@@ -98,12 +87,6 @@ gdk_fontset_load_for_display (GdkDisplay *display,const gchar *font_name) {
   return gdk_directfb_bogus_font (10);
 }
 
-GdkFont *
-gdk_font_load_for_display (GdkDisplay *display,const gchar *font_name)
-{
-  return gdk_directfb_bogus_font (10);
-}
-
 void
 _gdk_font_destroy (GdkFont *font)
 {
@@ -188,19 +171,6 @@ gdk_font_equal (const GdkFont *fonta,
   return FALSE;
 }
 
-GdkFont *
-gdk_font_lookup (GdkNativeWindow xid)
-{
-	g_warning(" gdk_font_lookup unimplemented \n");
-  return NULL;
-}
-
-GdkDisplay*
-gdk_font_get_display (GdkFont* font)
-{
-	g_warning(" gdk_font_get_display unimplemented \n");
-  return NULL;
-}
 
 #define __GDK_FONT_X11_C__
 #include "gdkaliasdef.c"
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 15e328a..bfb1d76 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -297,15 +297,9 @@ gdk_visual_type_get_type G_GNUC_CONST
 
 #if IN_HEADER(__GDK_FONT_H__)
 #if IN_FILE(__GDK_FONT_C__)
-#ifndef GDK_DISABLE_DEPRECATED
-gdk_font_from_description
-#endif
 gdk_font_get_type G_GNUC_CONST
 gdk_font_ref
 gdk_font_unref
-#ifndef GDK_DISABLE_DEPRECATED
-gdk_font_load
-#endif
 #endif
 #endif
 
@@ -317,8 +311,6 @@ gdk_fontset_load
 #endif
 gdk_font_id
 gdk_font_equal
-gdk_font_load_for_display
-gdk_font_from_description_for_display
 gdk_fontset_load_for_display
 #endif
 #endif
@@ -1262,14 +1254,6 @@ gdk_x11_window_get_drawable_impl
 gdk_x11_pixmap_get_drawable_impl
 #endif
 
-#if IN_FILE(__GDK_FONT_X11_C__)
-#ifndef GDK_DISABLE_DEPRECATED
-gdk_x11_font_get_name
-gdk_x11_font_get_xdisplay
-#endif
-gdk_x11_font_get_xfont
-#endif
-
 #if IN_FILE(__GDK_GC_X11_C__)
 gdk_x11_gc_get_xdisplay
 gdk_x11_gc_get_xgc
diff --git a/gdk/gdkfont.c b/gdk/gdkfont.c
index 56830e0..4f2f39c 100644
--- a/gdk/gdkfont.c
+++ b/gdk/gdkfont.c
@@ -85,41 +85,6 @@ gdk_font_unref (GdkFont *font)
     _gdk_font_destroy (font);
 }
 
-/**
- * gdk_font_from_description:
- * @font_desc: a #PangoFontDescription.
- * 
- * Load a #GdkFont based on a Pango font description. This font will
- * only be an approximation of the Pango font, and
- * internationalization will not be handled correctly. This function
- * should only be used for legacy code that cannot be easily converted
- * to use Pango. Using Pango directly will produce better results.
- * 
- * Return value: the newly loaded font, or %NULL if the font
- * cannot be loaded.
- **/
-GdkFont*
-gdk_font_from_description (PangoFontDescription *font_desc)
-{
-  return gdk_font_from_description_for_display (gdk_display_get_default (),font_desc);
-}
-
-/**
- * gdk_font_load:
- * @font_name: a XLFD describing the font to load.
- * 
- * Loads a font.
- * 
- * The font may be newly loaded or looked up the font in a cache. 
- * You should make no assumptions about the initial reference count.
- * 
- * Return value: a #GdkFont, or %NULL if the font could not be loaded.
- **/
-GdkFont*
-gdk_font_load (const gchar *font_name)
-{  
-   return gdk_font_load_for_display (gdk_display_get_default(), font_name);
-}
 
 #define __GDK_FONT_C__
 #include "gdkaliasdef.c"
diff --git a/gdk/gdkfont.h b/gdk/gdkfont.h
index 0e17f60..79e6e2f 100644
--- a/gdk/gdkfont.h
+++ b/gdk/gdkfont.h
@@ -61,19 +61,13 @@ gint	 gdk_font_id	    (const GdkFont  *font);
 gboolean gdk_font_equal	    (const GdkFont  *fonta,
 			     const GdkFont  *fontb);
 
-GdkFont *gdk_font_load_for_display             (GdkDisplay           *display,
-						const gchar          *font_name);
 GdkFont *gdk_fontset_load_for_display          (GdkDisplay           *display,
 						const gchar          *fontset_name);
-GdkFont *gdk_font_from_description_for_display (GdkDisplay           *display,
-						PangoFontDescription *font_desc);
 
 #ifndef GDK_DISABLE_DEPRECATED
 
 #ifndef GDK_MULTIHEAD_SAFE
-GdkFont* gdk_font_load             (const gchar          *font_name);
 GdkFont* gdk_fontset_load          (const gchar          *fontset_name);
-GdkFont* gdk_font_from_description (PangoFontDescription *font_desc);
 #endif
 
 GdkDisplay * gdk_font_get_display (GdkFont *font);
diff --git a/gdk/quartz/gdkfont-quartz.c b/gdk/quartz/gdkfont-quartz.c
index 71edb99..d4e1ba2 100644
--- a/gdk/quartz/gdkfont-quartz.c
+++ b/gdk/quartz/gdkfont-quartz.c
@@ -23,21 +23,6 @@
 
 #include "gdkfont.h"
 
-GdkFont*
-gdk_font_load_for_display (GdkDisplay  *display,
-			   const gchar *font_name)
-{
-  /* FIXME: Implement */
-  return NULL;
-}
-
-GdkFont*
-gdk_font_from_description_for_display (GdkDisplay           *display,
-				       PangoFontDescription *desc)
-{
-  /* FIXME: Implement */
-  return NULL;
-}
 
 GdkFont *
 gdk_fontset_load_for_display (GdkDisplay  *display,
diff --git a/gdk/win32/gdkfont-win32.c b/gdk/win32/gdkfont-win32.c
index d284ca7..73ea282 100644
--- a/gdk/win32/gdkfont-win32.c
+++ b/gdk/win32/gdkfont-win32.c
@@ -1189,83 +1189,6 @@ gdk_font_from_one_singlefont (GdkWin32SingleFont *singlefont)
 }
 
 GdkFont*
-gdk_font_load_for_display (GdkDisplay  *display,
-                           const gchar *font_name)
-{
-  GdkFont *font;
-  GdkFontPrivateWin32 *private;
-  GdkWin32SingleFont *singlefont;
-  HGDIOBJ oldfont;
-  TEXTMETRIC textmetric;
-
-  g_return_val_if_fail (font_name != NULL, NULL);
-  g_return_val_if_fail (display == gdk_display_get_default (), NULL);
-
-  font = gdk_font_hash_lookup (GDK_FONT_FONTSET, font_name);
-  if (font)
-    return font;
-
-  private = g_new (GdkFontPrivateWin32, 1);
-  font = (GdkFont*) private;
-
-  singlefont = gdk_font_load_internal (font_name);
-
-  private->base.ref_count = 1;
-  private->names = NULL;
-  private->fonts = g_slist_append (NULL, singlefont);
-
-  /* Pretend all fonts are fontsets... Gtktext and gtkentry work better
-   * that way, they use wide chars, which is necessary for non-ASCII
-   * chars to work. (Yes, even Latin-1, as we use Unicode internally.)
-   */
-  font->type = GDK_FONT_FONTSET;
-  oldfont = SelectObject (_gdk_display_hdc, singlefont->hfont);
-  GetTextMetrics (_gdk_display_hdc, &textmetric);
-  SelectObject (_gdk_display_hdc, oldfont);
-  font->ascent = textmetric.tmAscent;
-  font->descent = textmetric.tmDescent;
-
-  GDK_NOTE (MISC, g_print ("... asc %d desc %d\n",
-			   font->ascent, font->descent));
-
-  gdk_font_hash_insert (GDK_FONT_FONTSET, font, font_name);
-
-  return gdk_font_from_one_singlefont (gdk_font_load_internal (font_name));
-}
-
-GdkFont*
-gdk_font_from_description_for_display (GdkDisplay           *display,
-                                       PangoFontDescription *font_desc)
-{
-  LOGFONT logfont;
-  int size;
-
-  g_return_val_if_fail (font_desc != NULL, NULL);
-  g_return_val_if_fail (display == gdk_display_get_default (), NULL);
-
-  size = PANGO_PIXELS (pango_font_description_get_size (font_desc));
-
-  logfont.lfHeight = - MulDiv (size,
-  			       GetDeviceCaps (_gdk_display_hdc, LOGPIXELSY),
-			       72);
-  logfont.lfWidth = 0;
-  logfont.lfEscapement = 0;
-  logfont.lfOrientation = 0;
-  logfont.lfWeight = FW_DONTCARE;
-  logfont.lfItalic = FALSE;
-  logfont.lfUnderline = FALSE;
-  logfont.lfStrikeOut = FALSE;
-  logfont.lfCharSet = ANSI_CHARSET;
-  logfont.lfOutPrecision = OUT_TT_ONLY_PRECIS;
-  logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
-  logfont.lfQuality = PROOF_QUALITY;
-  logfont.lfPitchAndFamily = DEFAULT_PITCH;
-  strcpy (logfont.lfFaceName, "Arial");
-
-  return gdk_font_from_one_singlefont (gdk_font_load_logfont (&logfont));
-}
-
-GdkFont*
 gdk_fontset_load (const gchar *fontset_name)
 {
   GdkFont *font;
diff --git a/gdk/x11/gdkfont-x11.c b/gdk/x11/gdkfont-x11.c
index d2edafc..43282e5 100644
--- a/gdk/x11/gdkfont-x11.c
+++ b/gdk/x11/gdkfont-x11.c
@@ -170,95 +170,6 @@ gdk_font_hash_lookup (GdkDisplay  *display,
 }
 
 /**
- * gdk_font_load_for_display:
- * @display: a #GdkDisplay
- * @font_name: a XLFD describing the font to load.
- * @returns: a #GdkFont, or %NULL if the font could not be loaded.
- *
- * Loads a font for use on @display.
- *
- * The font may be newly loaded or looked up the font in a cache. 
- * You should make no assumptions about the initial reference count.
- *
- * Since: 2.2
- */
-GdkFont *
-gdk_font_load_for_display (GdkDisplay  *display, 
-			   const gchar *font_name)
-{
-  GdkFont *font;
-  GdkFontPrivateX *private;
-  XFontStruct *xfont;
-
-  g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
-  g_return_val_if_fail (font_name != NULL, NULL);
-  
-  font = gdk_font_hash_lookup (display, GDK_FONT_FONT, font_name);
-  if (font)
-    return font;
-
-  xfont = XLoadQueryFont (GDK_DISPLAY_XDISPLAY (display), font_name);
-  if (xfont == NULL)
-    return NULL;
-
-  font = gdk_font_lookup_for_display (display, xfont->fid);
-  if (font != NULL) 
-    {
-      private = (GdkFontPrivateX *) font;
-      if (xfont != private->xfont)
-	XFreeFont (GDK_DISPLAY_XDISPLAY (display), xfont);
-
-      gdk_font_ref (font);
-    }
-  else
-    {
-      private = g_new (GdkFontPrivateX, 1);
-      private->display = display;
-      private->xfont = xfont;
-      private->base.ref_count = 1;
-      private->names = NULL;
-      private->xid = xfont->fid | XID_FONT_BIT;
- 
-      font = (GdkFont*) private;
-      font->type = GDK_FONT_FONT;
-      font->ascent =  xfont->ascent;
-      font->descent = xfont->descent;
-      
-      _gdk_xid_table_insert (display, &private->xid, font);
-    }
-
-  gdk_font_hash_insert (GDK_FONT_FONT, font, font_name);
-
-  return font;
-}
-
-/**
- * gdk_font_from_description_for_display:
- * @display: a #GdkDisplay
- * @font_desc: a #PangoFontDescription.
- * 
- * Loads a #GdkFont based on a Pango font description for use on @display. 
- * This font will only be an approximation of the Pango font, and
- * internationalization will not be handled correctly. This function
- * should only be used for legacy code that cannot be easily converted
- * to use Pango. Using Pango directly will produce better results.
- * 
- * Return value: the newly loaded font, or %NULL if the font
- * cannot be loaded.
- *
- * Since: 2.2
- */
-GdkFont *
-gdk_font_from_description_for_display (GdkDisplay           *display,
-				       PangoFontDescription *font_desc)
-{
-  g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
-  g_return_val_if_fail (font_desc != NULL, NULL);
-
-  return gdk_font_load_for_display (display, "fixed");
-}
-
-/**
  * gdk_fontset_load_for_display:
  * @display: a #GdkDisplay
  * @fontset_name: a comma-separated list of XLFDs describing
@@ -491,61 +402,6 @@ gdk_font_equal (const GdkFont *fonta,
     return FALSE;
 }
 
-/**
- * gdk_x11_font_get_xdisplay:
- * @font: a #GdkFont.
- * 
- * Returns the display of a #GdkFont.
- * 
- * Return value:  an Xlib <type>Display*</type>.
- **/
-Display *
-gdk_x11_font_get_xdisplay (GdkFont *font)
-{
-  g_return_val_if_fail (font != NULL, NULL);
 
-  return GDK_DISPLAY_XDISPLAY (((GdkFontPrivateX *)font)->display);
-}
-
-/**
- * gdk_x11_font_get_xfont:
- * @font: a #GdkFont.
- * 
- * Returns the X font belonging to a #GdkFont.
- * 
- * Return value: an Xlib <type>XFontStruct*</type> or an <type>XFontSet</type>.
- **/
-gpointer
-gdk_x11_font_get_xfont (GdkFont *font)
-{
-  g_return_val_if_fail (font != NULL, NULL);
-
-  return ((GdkFontPrivateX *)font)->xfont;
-}
-
-/**
- * gdk_x11_font_get_name:
- * @font: a #GdkFont.
- * 
- * Return the X Logical Font Description (for font->type == GDK_FONT_FONT)
- * or comma separated list of XLFDs (for font->type == GDK_FONT_FONTSET)
- * that was used to load the font. If the same font was loaded
- * via multiple names, which name is returned is undefined.
- * 
- * Return value: the name of the font. This string is owned
- *   by GDK and must not be modified or freed.
- **/
-G_CONST_RETURN char *
-gdk_x11_font_get_name (GdkFont *font)
-{
-  GdkFontPrivateX *private = (GdkFontPrivateX *)font;
-
-  g_return_val_if_fail (font != NULL, NULL);
-
-  g_assert (private->names);
-
-  return private->names->data;
-}
-     
 #define __GDK_FONT_X11_C__
 #include "gdkaliasdef.c"
diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h
index c56d462..d23f1fb 100644
--- a/gdk/x11/gdkx.h
+++ b/gdk/x11/gdkx.h
@@ -187,28 +187,6 @@ void        gdk_x11_register_standard_event_type (GdkDisplay *display,
 						  gint        event_base,
 						  gint        n_events);
 
-#if !defined(GDK_DISABLE_DEPRECATED) || defined(GDK_COMPILATION)
-
-gpointer             gdk_x11_font_get_xfont    (GdkFont *font);
-#define GDK_FONT_XFONT(font)          (gdk_x11_font_get_xfont (font))
-
-#define gdk_font_lookup_for_display(display, xid) ((GdkFont*) gdk_xid_table_lookup_for_display (display, ((xid)|XID_FONT_BIT)))
-
-#endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION */
-
-#ifndef GDK_DISABLE_DEPRECATED
-
-Display *            gdk_x11_font_get_xdisplay (GdkFont *font);
-G_CONST_RETURN char *gdk_x11_font_get_name     (GdkFont *font);
-
-#define GDK_FONT_XDISPLAY(font)       (gdk_x11_font_get_xdisplay (font))
-
-#ifndef GDK_MULTIHEAD_SAFE
-
-#define gdk_font_lookup(xid)	   ((GdkFont*) gdk_xid_table_lookup (xid))
-
-#endif /* GDK_MULTIHEAD_SAFE */
-#endif /* GDK_DISABLE_DEPRECATED */
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]