Remove deprecated code from X interaction

This commit is contained in:
Javier Jardón 2010-06-24 22:20:02 +02:00
parent c3987f9ee2
commit c1affa4f3c
11 changed files with 0 additions and 457 deletions

View File

@ -400,11 +400,8 @@ gdk_color_get_type
GdkFont GdkFont
GdkFontType GdkFontType
gdk_font_load gdk_font_load
gdk_font_load_for_display
gdk_fontset_load gdk_fontset_load
gdk_fontset_load_for_display gdk_fontset_load_for_display
gdk_font_from_description
gdk_font_from_description_for_display
gdk_font_get_display gdk_font_get_display
gdk_font_ref gdk_font_ref
gdk_font_unref gdk_font_unref
@ -1286,8 +1283,6 @@ GDK_SCREEN_XDISPLAY
GDK_SCREEN_XNUMBER GDK_SCREEN_XNUMBER
GDK_SCREEN_XSCREEN GDK_SCREEN_XSCREEN
GDK_VISUAL_XVISUAL GDK_VISUAL_XVISUAL
GDK_FONT_XDISPLAY
GDK_FONT_XFONT
GDK_CURSOR_XCURSOR GDK_CURSOR_XCURSOR
GDK_CURSOR_XDISPLAY GDK_CURSOR_XDISPLAY
GDK_GC_XGC GDK_GC_XGC
@ -1305,8 +1300,6 @@ gdk_window_lookup
gdk_window_lookup_for_display gdk_window_lookup_for_display
gdk_pixmap_lookup gdk_pixmap_lookup
gdk_pixmap_lookup_for_display gdk_pixmap_lookup_for_display
gdk_font_lookup
gdk_font_lookup_for_display
gdk_x11_lookup_xdisplay gdk_x11_lookup_xdisplay
gdk_x11_get_server_time gdk_x11_get_server_time
gdk_net_wm_supports gdk_net_wm_supports
@ -1331,9 +1324,6 @@ gdk_x11_display_set_cursor_theme
gdk_x11_register_standard_event_type gdk_x11_register_standard_event_type
gdk_x11_drawable_get_xdisplay gdk_x11_drawable_get_xdisplay
gdk_x11_drawable_get_xid 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_xdisplay
gdk_x11_gc_get_xgc gdk_x11_gc_get_xgc
gdk_x11_get_default_root_xwindow gdk_x11_get_default_root_xwindow

View File

@ -275,24 +275,6 @@ are currently:
@GDK_FONT_FONT: the font is a single font. @GDK_FONT_FONT: the font is a single font.
@GDK_FONT_FONTSET: the font is a fontset. @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 ##### --> <!-- ##### FUNCTION gdk_fontset_load ##### -->
<para> <para>
</para> </para>
@ -311,25 +293,6 @@ are currently:
@Returns: @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 ##### --> <!-- ##### FUNCTION gdk_font_get_display ##### -->
<para> <para>

View File

@ -179,24 +179,6 @@ Returns the X visual belonging to a #GdkVisual.
@Returns: an Xlib <type>Visual*</type>. @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 ##### --> <!-- ##### MACRO GDK_CURSOR_XCURSOR ##### -->
<para> <para>
Returns the X cursor belonging to a #GdkCursor. Returns the X cursor belonging to a #GdkCursor.
@ -355,26 +337,6 @@ Another name for GDK_DRAWABLE_XID().
@Returns: @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 ##### --> <!-- ##### FUNCTION gdk_x11_lookup_xdisplay ##### -->
<para> <para>
@ -595,33 +557,6 @@ Since: 2.2
@Returns: @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 ##### --> <!-- ##### FUNCTION gdk_x11_gc_get_xdisplay ##### -->
<para> <para>

View File

@ -73,17 +73,6 @@ gdk_directfb_bogus_font (gint height)
return font; 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); 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 void
_gdk_font_destroy (GdkFont *font) _gdk_font_destroy (GdkFont *font)
{ {
@ -188,19 +171,6 @@ gdk_font_equal (const GdkFont *fonta,
return FALSE; 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__ #define __GDK_FONT_X11_C__
#include "gdkaliasdef.c" #include "gdkaliasdef.c"

View File

@ -297,15 +297,9 @@ gdk_visual_type_get_type G_GNUC_CONST
#if IN_HEADER(__GDK_FONT_H__) #if IN_HEADER(__GDK_FONT_H__)
#if IN_FILE(__GDK_FONT_C__) #if IN_FILE(__GDK_FONT_C__)
#ifndef GDK_DISABLE_DEPRECATED
gdk_font_from_description
#endif
gdk_font_get_type G_GNUC_CONST gdk_font_get_type G_GNUC_CONST
gdk_font_ref gdk_font_ref
gdk_font_unref gdk_font_unref
#ifndef GDK_DISABLE_DEPRECATED
gdk_font_load
#endif
#endif #endif
#endif #endif
@ -317,8 +311,6 @@ gdk_fontset_load
#endif #endif
gdk_font_id gdk_font_id
gdk_font_equal gdk_font_equal
gdk_font_load_for_display
gdk_font_from_description_for_display
gdk_fontset_load_for_display gdk_fontset_load_for_display
#endif #endif
#endif #endif
@ -1262,14 +1254,6 @@ gdk_x11_window_get_drawable_impl
gdk_x11_pixmap_get_drawable_impl gdk_x11_pixmap_get_drawable_impl
#endif #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__) #if IN_FILE(__GDK_GC_X11_C__)
gdk_x11_gc_get_xdisplay gdk_x11_gc_get_xdisplay
gdk_x11_gc_get_xgc gdk_x11_gc_get_xgc

View File

@ -85,41 +85,6 @@ gdk_font_unref (GdkFont *font)
_gdk_font_destroy (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__ #define __GDK_FONT_C__
#include "gdkaliasdef.c" #include "gdkaliasdef.c"

View File

@ -61,19 +61,13 @@ gint gdk_font_id (const GdkFont *font);
gboolean gdk_font_equal (const GdkFont *fonta, gboolean gdk_font_equal (const GdkFont *fonta,
const GdkFont *fontb); const GdkFont *fontb);
GdkFont *gdk_font_load_for_display (GdkDisplay *display,
const gchar *font_name);
GdkFont *gdk_fontset_load_for_display (GdkDisplay *display, GdkFont *gdk_fontset_load_for_display (GdkDisplay *display,
const gchar *fontset_name); const gchar *fontset_name);
GdkFont *gdk_font_from_description_for_display (GdkDisplay *display,
PangoFontDescription *font_desc);
#ifndef GDK_DISABLE_DEPRECATED #ifndef GDK_DISABLE_DEPRECATED
#ifndef GDK_MULTIHEAD_SAFE #ifndef GDK_MULTIHEAD_SAFE
GdkFont* gdk_font_load (const gchar *font_name);
GdkFont* gdk_fontset_load (const gchar *fontset_name); GdkFont* gdk_fontset_load (const gchar *fontset_name);
GdkFont* gdk_font_from_description (PangoFontDescription *font_desc);
#endif #endif
GdkDisplay * gdk_font_get_display (GdkFont *font); GdkDisplay * gdk_font_get_display (GdkFont *font);

View File

@ -23,21 +23,6 @@
#include "gdkfont.h" #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 * GdkFont *
gdk_fontset_load_for_display (GdkDisplay *display, gdk_fontset_load_for_display (GdkDisplay *display,

View File

@ -1188,83 +1188,6 @@ gdk_font_from_one_singlefont (GdkWin32SingleFont *singlefont)
return font; return font;
} }
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* GdkFont*
gdk_fontset_load (const gchar *fontset_name) gdk_fontset_load (const gchar *fontset_name)
{ {

View File

@ -169,95 +169,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: * gdk_fontset_load_for_display:
* @display: a #GdkDisplay * @display: a #GdkDisplay
@ -491,61 +402,6 @@ gdk_font_equal (const GdkFont *fonta,
return FALSE; 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__ #define __GDK_FONT_X11_C__
#include "gdkaliasdef.c" #include "gdkaliasdef.c"

View File

@ -187,28 +187,6 @@ void gdk_x11_register_standard_event_type (GdkDisplay *display,
gint event_base, gint event_base,
gint n_events); 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 G_END_DECLS