Tizen 2.0 Release
[framework/graphics/cairo.git] / src / cairo-vg.h
1 /* -*- Mode: c; tab-width: 8; c-basic-offset: 4; indent-tabs-mode: t; -*- */
2 /* cairo - a vector graphics library with display and print output
3  *
4  * Copyright © 2007 * Mozilla Corporation
5  * Copyright © 2009 Chris Wilson
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it either under the terms of the GNU Lesser General Public
9  * License version 2.1 as published by the Free Software Foundation
10  * (the "LGPL") or, at your option, under the terms of the Mozilla
11  * Public License Version 1.1 (the "MPL"). If you do not alter this
12  * notice, a recipient may use your version of this file under either
13  * the MPL or the LGPL.
14  *
15  * You should have received a copy of the LGPL along with this library
16  * in the file COPYING-LGPL-2.1; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
18  * You should have received a copy of the MPL along with this library
19  * in the file COPYING-MPL-1.1
20  *
21  * The contents of this file are subject to the Mozilla Public License
22  * Version 1.1 (the "License"); you may not use this file except in
23  * compliance with the License. You may obtain a copy of the License at
24  * http://www.mozilla.org/MPL/
25  *
26  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
27  * OF ANY KIND, either express or implied. See the LGPL or the MPL for
28  * the specific language governing rights and limitations.
29  *
30  * The Original Code is the cairo graphics library.
31  *
32  * The Initial Developer of the Original Code is Mozilla Corporation.
33  *
34  * Contributor(s):
35  *      Vladimir Vukicevic <vladimir@mozilla.com>
36  *      Chris Wilson <chris@chris-wilson.co.uk>
37  */
38
39 #ifndef CAIRO_VG_H
40 #define CAIRO_VG_H
41
42 #include "cairo.h"
43
44 #if CAIRO_HAS_VG_SURFACE
45
46 #include <VG/openvg.h>
47
48 CAIRO_BEGIN_DECLS
49
50 typedef struct _cairo_vg_context cairo_vg_context_t;
51
52 #if CAIRO_HAS_GLX_FUNCTIONS
53 typedef struct __GLXcontextRec *GLXContext;
54 typedef struct _XDisplay Display;
55
56 cairo_public cairo_vg_context_t *
57 cairo_vg_context_create_for_glx (Display *dpy,
58                                  GLXContext ctx);
59 #endif
60
61 #if CAIRO_HAS_EGL_FUNCTIONS
62 #include <EGL/egl.h>
63
64 cairo_public cairo_vg_context_t *
65 cairo_vg_context_create_for_egl (EGLDisplay egl_display,
66                                  EGLContext egl_context);
67 #endif
68
69 cairo_public cairo_status_t
70 cairo_vg_context_status (cairo_vg_context_t *context);
71
72 cairo_public void
73 cairo_vg_context_destroy (cairo_vg_context_t *context);
74
75 cairo_public cairo_surface_t *
76 cairo_vg_surface_create (cairo_vg_context_t *context,
77                          cairo_content_t content, int width, int height);
78
79 cairo_public cairo_surface_t *
80 cairo_vg_surface_create_for_image (cairo_vg_context_t *context,
81                                    VGImage image,
82                                    VGImageFormat format,
83                                    int width, int height);
84
85 cairo_public VGImage
86 cairo_vg_surface_get_image (cairo_surface_t *abstract_surface);
87
88 cairo_public VGImageFormat
89 cairo_vg_surface_get_format (cairo_surface_t *abstract_surface);
90
91 cairo_public int
92 cairo_vg_surface_get_height (cairo_surface_t *abstract_surface);
93
94 cairo_public int
95 cairo_vg_surface_get_width (cairo_surface_t *abstract_surface);
96
97 CAIRO_END_DECLS
98
99 #else  /* CAIRO_HAS_VG_SURFACE*/
100 # error Cairo was not compiled with support for the OpenVG backend
101 #endif /* CAIRO_HAS_VG_SURFACE*/
102
103 #endif /* CAIRO_VG_H */