comparison include/mb_graph_engine_openvg.h @ 578:fd5f5d9e00d2 openvg

A dummy graphic engine for OpenVG.
author Thinker K.F. Li <thinker@branda.to>
date Wed, 16 Jun 2010 21:02:49 +0800
parents
children 7bfeccdc91cb
comparison
equal deleted inserted replaced
577:d561b2415711 578:fd5f5d9e00d2
1 #ifndef __MB_GE_OPENVG_H_
2 #define __MB_GE_OPENVG_H_
3
4 #include <stdio.h>
5 #include <GL/glut.h>
6 #include "mb_basic_types.h"
7 #include "mb_img_ldr.h"
8
9 /*! \defgroup mb_ge_cairo MadButterfly Graphic Engine with Cairo
10 * @{
11 */
12 #define MBE_OPERATOR_CLEAR OPENVG_OPERATOR_CLEAR
13 #define MBE_OPERATOR_SOURCE OPENVG_OPERATOR_SOURCE
14 #define MBE_STATUS_SUCCESS OPENVG_STATUS_SUCCESS
15
16 #define mbe_image_surface_create_from_png(fn) ((mbe_surface_t *)NULL)
17 #define mbe_image_surface_create_for_data(data, fmt, w, h, stride) \
18 ((mbe_surface_t *)NULL)
19 #define mbe_pattern_create_for_surface(canvas) ((mbe_pattern_t *)NULL)
20 #define mbe_scaled_font_text_extents(scaled, utf8, extents)
21 #define mbe_image_surface_get_stride(surface) (20)
22 #define mbe_image_surface_get_format(surface) ((mb_img_fmt_t)0)
23 #define mbe_image_surface_get_height(surface) (1)
24 #define mbe_image_surface_get_width(surface) (1)
25 #define mbe_image_surface_get_data(surface) ((unsigned char *)NULL)
26 #define mbe_scaled_font_reference(scaled) ((mbe_scaled_font_t *)NULL)
27 /* For OpenVG backend, never invoke xlib surface.
28 * #define mbe_xlib_surface_create cairo_xlib_surface_create
29 */
30 #define mbe_pattern_create_radial(cx0, cy0, radius0, \
31 cx1, cy1, radius1, stops, stop_cnt) \
32 ((mbe_pattern_t *)NULL)
33 #define mbe_pattern_create_linear(x0, y0, x1, y1, stops, stop_cnt) \
34 ((mbe_pattern_t *)NULL)
35 #define mbe_image_surface_create(fmt, w, h) ((mbe_surface_t *)NULL)
36 #define mbe_scaled_font_destroy(scaled)
37 #define mbe_font_face_reference(face) ((mbe_font_face_t *)NULL)
38 #define mbe_scaled_font_create(face, fnt_mtx, ctm) ((mbe_scaled_font_t *)NULL)
39 #define mbe_pattern_set_matrix(ptn, mtx)
40 #define mbe_font_face_destroy(face)
41 #define mbe_paint_with_alpha(canvas, alpha)
42 #define mbe_surface_destroy(surface)
43 #define mbe_set_source_rgba(canvas, r, g, b, a)
44 #define mbe_set_scaled_font(canvas, scaled)
45 #define mbe_pattern_destroy(pattern)
46 #define mbe_get_scaled_font(canvas) ((mbe_scaled_font_t *)NULL)
47 #define mbe_query_font_face(family, slant, weight) ((mbe_font_face_t *)NULL)
48 #define mbe_free_font_face(face)
49 #define mbe_set_line_width(canvas, w)
50 #define mbe_set_source_rgb(canvas, r, g, b)
51 #define mbe_get_font_face(canvas) ((mbe_font_face_t *)NULL)
52 #define mbe_fill_preserve(canvas)
53 #define mbe_copy_source(src_canvas, dst_canvas)
54 #define mbe_set_source(canvas, pattern)
55 #define mbe_reset_clip(canvas)
56 #define mbe_get_target(canvas) ((mbe_surface_t *)NULL)
57 #define mbe_close_path(canvas)
58 #define mbe_text_path(canvas, utf8)
59 #define mbe_transform(canvas, mtx)
60 #define mbe_rectangle(canvas, x, y, w, h)
61 #define mbe_in_stroke(canvas, x, y) (0)
62 #define mbe_new_path(canvas)
63 #define mbe_curve_to(canvas, x1, y1, x2, y2, x3, y3)
64 #define mbe_restore(canvas)
65 #define mbe_move_to(canvas, x, y)
66 #define mbe_line_to(canvas, x, y)
67 #define mbe_in_fill(canvas, x, y) (0)
68 #define mbe_destroy(canvas)
69 #define mbe_stroke(canvas)
70 #define mbe_create(surface) ((mbe_t *)NULL)
71 #define mbe_clear(canvas)
72 #define mbe_paint(canvas)
73 #define mbe_save(canvas)
74 #define mbe_fill(canvas)
75 #define mbe_clip(canvas)
76 #define mbe_arc(canvas, x, y, radius, angle_start, angle_stop)
77
78 struct _mbe_text_extents_t {
79 co_aix x_bearing;
80 co_aix y_bearing;
81 co_aix width;
82 co_aix height;
83 co_aix x_advance;
84 co_aix y_advance;
85 };
86 typedef struct _mbe_text_extents_t mbe_text_extents_t;
87 typedef int mbe_scaled_font_t;
88 typedef int mbe_font_face_t;
89 typedef int mbe_surface_t;
90 typedef int mbe_pattern_t;
91 typedef int mbe_t;
92
93 #define MB_MATRIX_2_OPENVG(vgmtx, mtx) do { \
94 (vgmtx)[0] = (mtx)[0]; \
95 (vgmtx)[1] = (mtx)[3]; \
96 (vgmtx)[2] = 0; \
97 (vgmtx)[3] = (mtx)[1]; \
98 (vgmtx)[4] = (mtx)[4]; \
99 (vgmtx)[5] = 0; \
100 (vgmtx)[6] = (mtx)[2]; \
101 (vgmtx)[7] = (mtx)[5]; \
102 (vgmtx)[8] = 1; \
103 } while(0)
104
105
106 /* @} */
107
108 #endif /* __MB_GE_OPENVG_H_ */