Tizen 2.0 Release
[framework/graphics/cairo.git] / boilerplate / cairo-boilerplate-win32.c
1 /* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
2 /*
3  * Copyright © 2004,2006 Red Hat, Inc.
4  *
5  * Permission to use, copy, modify, distribute, and sell this software
6  * and its documentation for any purpose is hereby granted without
7  * fee, provided that the above copyright notice appear in all copies
8  * and that both that copyright notice and this permission notice
9  * appear in supporting documentation, and that the name of
10  * Red Hat, Inc. not be used in advertising or publicity pertaining to
11  * distribution of the software without specific, written prior
12  * permission. Red Hat, Inc. makes no representations about the
13  * suitability of this software for any purpose.  It is provided "as
14  * is" without express or implied warranty.
15  *
16  * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
17  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
18  * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
19  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
20  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
21  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
22  * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23  *
24  * Author: Carl D. Worth <cworth@cworth.org>
25  */
26
27 #include "cairo-boilerplate-private.h"
28
29 #include <cairo-win32.h>
30
31 static cairo_surface_t *
32 _cairo_boilerplate_win32_create_surface (const char                *name,
33                                          cairo_content_t            content,
34                                          double                     width,
35                                          double                     height,
36                                          double                     max_width,
37                                          double                     max_height,
38                                          cairo_boilerplate_mode_t   mode,
39                                          void                     **closure)
40 {
41     cairo_format_t format;
42
43     format = cairo_boilerplate_format_from_content (content);
44
45     *closure = NULL;
46
47     return cairo_win32_surface_create_with_dib (format, width, height);
48 }
49
50 static const cairo_boilerplate_target_t targets[] = {
51     {
52         "win32", "win32", NULL, NULL,
53         CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR, 0,
54         "cairo_win32_surface_create_with_dib",
55         _cairo_boilerplate_win32_create_surface,
56         cairo_surface_create_similar,
57         NULL, NULL,
58         _cairo_boilerplate_get_image_surface,
59         cairo_surface_write_to_png,
60         NULL, NULL, NULL, TRUE, FALSE, FALSE
61     },
62     /* Testing the win32 surface isn't interesting, since for
63      * ARGB images it just chains to the image backend
64      */
65     {
66         "win32", "win32", NULL, NULL,
67         CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR_ALPHA, 0,
68         "cairo_win32_surface_create_with_dib",
69         _cairo_boilerplate_win32_create_surface,
70         cairo_surface_create_similar,
71         NULL, NULL,
72         _cairo_boilerplate_get_image_surface,
73         cairo_surface_write_to_png,
74         NULL, NULL, NULL, FALSE, FALSE, FALSE
75     },
76 };
77 CAIRO_BOILERPLATE (win32, targets)