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.
26 * GTK+ DirectFB backend
27 * Copyright (C) 2001-2002 convergence integrated media GmbH
28 * Copyright (C) 2002-2004 convergence GmbH
29 * Written by Denis Oliver Kropp <dok@convergence.de> and
30 * Sven Neumann <sven@convergence.de>
33 #undef GDK_DISABLE_DEPRECATED
40 #include "gdkdirectfb.h"
41 #include "gdkprivate-directfb.h"
43 #include "gdkinternals.h"
49 typedef struct _GdkFontDirectFB GdkFontDirectFB;
51 struct _GdkFontDirectFB
55 IDirectFBFont *dfbfont;
60 gdk_directfb_bogus_font (gint height)
63 GdkFontDirectFB *private;
65 private = g_new0 (GdkFontDirectFB, 1);
66 font = (GdkFont *)private;
68 font->type = GDK_FONT_FONT;
69 font->ascent = height*3/4;
70 font->descent = height/4;
71 private->size = height;
72 private->base.ref_count = 1;
77 /* ********************* */
80 gdk_fontset_load (const gchar *fontset_name)
82 return gdk_directfb_bogus_font (10);
86 gdk_fontset_load_for_display (GdkDisplay *display,const gchar *font_name) {
87 return gdk_directfb_bogus_font (10);
91 _gdk_font_destroy (GdkFont *font)
97 case GDK_FONT_FONTSET:
100 g_error ("unknown font type.");
108 _gdk_font_strlen (GdkFont *font,
111 GdkFontDirectFB *font_private;
114 g_return_val_if_fail (font != NULL, -1);
115 g_return_val_if_fail (str != NULL, -1);
117 font_private = (GdkFontDirectFB*) font;
119 if (font->type == GDK_FONT_FONT)
121 guint16 *string_2b = (guint16 *)str;
123 while (*(string_2b++))
126 else if (font->type == GDK_FONT_FONTSET)
128 length = strlen (str);
131 g_error("undefined font type\n");
137 gdk_font_id (const GdkFont *font)
139 const GdkFontDirectFB *font_private;
141 g_return_val_if_fail (font != NULL, 0);
143 font_private = (const GdkFontDirectFB*) font;
145 if (font->type == GDK_FONT_FONT)
156 gdk_font_equal (const GdkFont *fonta,
157 const GdkFont *fontb)
159 const GdkFontDirectFB *privatea;
160 const GdkFontDirectFB *privateb;
162 g_return_val_if_fail (fonta != NULL, FALSE);
163 g_return_val_if_fail (fontb != NULL, FALSE);
165 privatea = (const GdkFontDirectFB*) fonta;
166 privateb = (const GdkFontDirectFB*) fontb;
175 #define __GDK_FONT_X11_C__
176 #include "gdkaliasdef.c"