The OpenD Programming Language

1 /**
2  *
3  * License:
4  * $(TABLE
5  *   $(TR $(TD cairoD wrapper/bindings)
6  *     $(TD $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)))
7  *   $(TR $(TD $(LINK2 http://cgit.freedesktop.org/cairo/tree/COPYING, _cairo))
8  *     $(TD $(LINK2 http://cgit.freedesktop.org/cairo/tree/COPYING-LGPL-2.1, LGPL 2.1) /
9  *     $(LINK2 http://cgit.freedesktop.org/cairo/plain/COPYING-MPL-1.1, MPL 1.1)))
10  * )
11  * Authors:
12  * $(TABLE
13  *   $(TR $(TD Johannes Pfau) $(TD cairoD))
14  *   $(TR $(TD $(LINK2 http://cairographics.org, _cairo team)) $(TD _cairo))
15  * )
16  */
17 /*
18  * Distributed under the Boost Software License, Version 1.0.
19  *    (See accompanying file LICENSE_1_0.txt or copy at
20  *          http://www.boost.org/LICENSE_1_0.txt)
21  */
22 module cairo.c.win32;
23 
24 import cairo.c.cairo;
25 
26 static if(CAIRO_HAS_WIN32_SURFACE)
27 {
28     version (CairoWindowsDruntime)
29     {
30         import core.sys.windows.windef;
31         import core.sys.windows.wingdi;
32     }
33     else
34     {
35         import windows.windef;
36         import windows.wingdi;
37     }
38 
39     extern(C):
40     ///
41     cairo_surface_t* cairo_win32_surface_create (HDC hdc);
42     ///
43     cairo_surface_t* cairo_win32_printing_surface_create (HDC hdc);
44     ///
45     cairo_surface_t* cairo_win32_surface_create_with_ddb (HDC hdc,
46                                          cairo_format_t format,
47                                          int width,
48                                          int height);
49     ///
50     cairo_surface_t* cairo_win32_surface_create_with_dib (cairo_format_t format,
51                                          int width,
52                                          int height);
53     ///
54     HDC cairo_win32_surface_get_dc (cairo_surface_t* surface);
55     ///
56     cairo_surface_t* cairo_win32_surface_get_image (cairo_surface_t* surface);
57 
58     static if(CAIRO_HAS_WIN32_FONT)
59     {
60         extern(C):
61         /*
62          * Win32 font support
63          */
64         ///
65         cairo_font_face_t* cairo_win32_font_face_create_for_logfontw (LOGFONTW *logfont);
66         ///
67         cairo_font_face_t* cairo_win32_font_face_create_for_hfont (HFONT font);
68         ///
69         cairo_font_face_t* cairo_win32_font_face_create_for_logfontw_hfont (LOGFONTW *logfont, HFONT font);
70         ///
71         cairo_status_t cairo_win32_scaled_font_select_font (cairo_scaled_font_t* scaled_font,
72                              HDC                  hdc);
73         ///
74         void
75         cairo_win32_scaled_font_done_font (cairo_scaled_font_t* scaled_font);
76         ///
77         double
78         cairo_win32_scaled_font_get_metrics_factor (cairo_scaled_font_t* scaled_font);
79         ///
80         void
81         cairo_win32_scaled_font_get_logical_to_device (cairo_scaled_font_t* scaled_font,
82                                    cairo_matrix_t *logical_to_device);
83         ///
84         void
85         cairo_win32_scaled_font_get_device_to_logical (cairo_scaled_font_t* scaled_font,
86                                    cairo_matrix_t* device_to_logical);
87     }
88 }
89 else
90 {
91     //static assert(false, "Cairo was not compiled with support for the win32 backend");
92 }