1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /* This file is part of the GtkHTML library. |
---|
3 | |
---|
4 | Copyright (C) 2000 Helix Code, Inc. |
---|
5 | |
---|
6 | This library is free software; you can redistribute it and/or |
---|
7 | modify it under the terms of the GNU Library General Public |
---|
8 | License as published by the Free Software Foundation; either |
---|
9 | version 2 of the License, or (at your option) any later version. |
---|
10 | |
---|
11 | This library is distributed in the hope that it will be useful, |
---|
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
14 | Library General Public License for more details. |
---|
15 | |
---|
16 | You should have received a copy of the GNU Library General Public License |
---|
17 | along with this library; see the file COPYING.LIB. If not, write to |
---|
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
19 | Boston, MA 02111-1307, USA. |
---|
20 | */ |
---|
21 | |
---|
22 | #ifndef _HTML_FONT_MANAGER_H_ |
---|
23 | #define _HTML_FONT_MANAGER_H_ |
---|
24 | |
---|
25 | #define HTML_FONT_MANAGER(x) ((HTMLFontManager *)x) |
---|
26 | |
---|
27 | #include "htmltypes.h" |
---|
28 | #include "gtkhtml-enums.h" |
---|
29 | #include "gtkhtmlfontstyle.h" |
---|
30 | |
---|
31 | struct _HTMLFont { |
---|
32 | gpointer data; |
---|
33 | guint space_width; |
---|
34 | guint nbsp_width; |
---|
35 | guint tab_width; |
---|
36 | gint ref_count; |
---|
37 | }; |
---|
38 | |
---|
39 | struct _HTMLFontSet { |
---|
40 | HTMLFont *font [GTK_HTML_FONT_STYLE_MAX_FONT]; |
---|
41 | gint ref_count; |
---|
42 | gchar *face; |
---|
43 | }; |
---|
44 | |
---|
45 | struct _HTMLFontManager { |
---|
46 | HTMLPainterClass *painter_class; |
---|
47 | |
---|
48 | GHashTable *font_sets; |
---|
49 | HTMLFontSet variable; |
---|
50 | HTMLFontSet fixed; |
---|
51 | |
---|
52 | gint var_size; |
---|
53 | gint fix_size; |
---|
54 | gboolean var_points; |
---|
55 | gboolean fix_points; |
---|
56 | |
---|
57 | gdouble magnification; |
---|
58 | }; |
---|
59 | |
---|
60 | HTMLFontManager * html_font_manager_new (HTMLPainterClass *pc); |
---|
61 | void html_font_manager_init (HTMLFontManager *manager, |
---|
62 | HTMLPainterClass *pc); |
---|
63 | void html_font_manager_destroy (HTMLFontManager *manager); |
---|
64 | void html_font_manager_finalize (HTMLFontManager *manager); |
---|
65 | |
---|
66 | void html_font_manager_set_default (HTMLFontManager *manager, |
---|
67 | gchar *variable, |
---|
68 | gchar *fixed, |
---|
69 | gint var_size, |
---|
70 | gboolean var_points, |
---|
71 | gint fix_size, |
---|
72 | gboolean fix_points); |
---|
73 | HTMLFont *html_font_manager_get_font (HTMLFontManager *manager, |
---|
74 | gchar *face, |
---|
75 | GtkHTMLFontStyle style); |
---|
76 | void html_font_manager_clear_font_cache (HTMLFontManager *manager); |
---|
77 | void html_font_manager_set_magnification (HTMLFontManager *manager, |
---|
78 | gdouble magnification); |
---|
79 | gchar * html_font_manager_get_attr (gchar *font_name, |
---|
80 | gint n); |
---|
81 | /* |
---|
82 | * HTMLFont |
---|
83 | */ |
---|
84 | HTMLFont *html_font_new (gpointer data, |
---|
85 | guint space_width, |
---|
86 | guint nbsp_width, |
---|
87 | guint tab_width); |
---|
88 | void html_font_destroy (HTMLFont *font); |
---|
89 | void html_font_ref (HTMLFont *font, |
---|
90 | HTMLPainterClass *painter_class); |
---|
91 | void html_font_unref (HTMLFont *font, |
---|
92 | HTMLPainterClass *painter_class); |
---|
93 | #endif |
---|