Upload tizen 2.0 beta source
[external/pango1.0.git] / pango / pangowin32.h
1 /* Pango
2  * pangowin32.h:
3  *
4  * Copyright (C) 1999 Red Hat Software
5  * Copyright (C) 2000 Tor Lillqvist
6  * Copyright (C) 2001 Alexander Larsson
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23
24 #ifndef __PANGOWIN32_H__
25 #define __PANGOWIN32_H__
26
27 #include <glib.h>
28 #include <pango/pango-font.h>
29 #include <pango/pango-layout.h>
30
31 G_BEGIN_DECLS
32
33 #define STRICT
34 #ifndef _WIN32_WINNT
35 #define _WIN32_WINNT 0x0501     /* To get ClearType-related macros */
36 #endif
37 #include <windows.h>
38 #undef STRICT
39
40 #define PANGO_RENDER_TYPE_WIN32 "PangoRenderWin32"
41
42 /* Calls for applications
43  */
44 #ifndef PANGO_DISABLE_DEPRECATED
45 PangoContext * pango_win32_get_context        (void);
46 #endif
47
48 void           pango_win32_render             (HDC               hdc,
49                                                PangoFont        *font,
50                                                PangoGlyphString *glyphs,
51                                                gint              x,
52                                                gint              y);
53 void           pango_win32_render_layout_line (HDC               hdc,
54                                                PangoLayoutLine  *line,
55                                                int               x,
56                                                int               y);
57 void           pango_win32_render_layout      (HDC               hdc,
58                                                PangoLayout      *layout,
59                                                int               x,
60                                                int               y);
61
62 void           pango_win32_render_transformed (HDC         hdc,
63                                                const PangoMatrix *matrix,
64                                                PangoFont         *font,
65                                                PangoGlyphString  *glyphs,
66                                                int                x,
67                                                int                y);
68
69 #ifdef PANGO_ENABLE_ENGINE
70
71 /* For shape engines
72  */
73
74 #ifndef PANGO_DISABLE_DEPRECATED
75 PangoGlyph     pango_win32_get_unknown_glyph  (PangoFont        *font,
76                                                gunichar          wc);
77 #endif /* PANGO_DISABLE_DEPRECATED */
78 gint          pango_win32_font_get_glyph_index(PangoFont        *font,
79                                                gunichar          wc);
80
81 HDC            pango_win32_get_dc             (void);
82
83 gboolean       pango_win32_get_debug_flag     (void);
84
85 gboolean pango_win32_font_select_font        (PangoFont *font,
86                                               HDC        hdc);
87 void     pango_win32_font_done_font          (PangoFont *font);
88 double   pango_win32_font_get_metrics_factor (PangoFont *font);
89
90 #endif
91
92 /* API for libraries that want to use PangoWin32 mixed with classic
93  * Win32 fonts.
94  */
95 typedef struct _PangoWin32FontCache PangoWin32FontCache;
96
97 PangoWin32FontCache *pango_win32_font_cache_new          (void);
98 void                 pango_win32_font_cache_free         (PangoWin32FontCache *cache);
99
100 HFONT                pango_win32_font_cache_load         (PangoWin32FontCache *cache,
101                                                           const LOGFONTA      *logfont);
102 HFONT                pango_win32_font_cache_loadw        (PangoWin32FontCache *cache,
103                                                           const LOGFONTW      *logfont);
104 void                 pango_win32_font_cache_unload       (PangoWin32FontCache *cache,
105                                                           HFONT                hfont);
106
107 PangoFontMap        *pango_win32_font_map_for_display    (void);
108 void                 pango_win32_shutdown_display        (void);
109 PangoWin32FontCache *pango_win32_font_map_get_font_cache (PangoFontMap       *font_map);
110
111 LOGFONTA            *pango_win32_font_logfont            (PangoFont          *font);
112 LOGFONTW            *pango_win32_font_logfontw           (PangoFont          *font);
113
114 PangoFontDescription *pango_win32_font_description_from_logfont (const LOGFONTA *lfp);
115
116 PangoFontDescription *pango_win32_font_description_from_logfontw (const LOGFONTW *lfp);
117
118 G_END_DECLS
119
120 #endif /* __PANGOWIN32_H__ */