annotate include/mb_graph_engine_dummy.h @ 1139:a2b068594412

Use pybind with new DOM API (at PYNode). - MBScene.document is a PYDocument instead of PYSPDocument. - MBScene.root is a PYNode isntead of PYSPItem. - getNext() was replaced by next(). - attribute() was replaced by getAttribute(). - getID() was removed, use setAttribute() instead. - MBScene.dom was removed, use MBScene.document.root() instead. - MBScene.nodeToItem was removed, use PYNode.spitem instead.
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 22 Dec 2010 13:27:37 +0800
parents bd18951b51d5
children
rev   line source
581
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
1 /* This is a dummy Graphic Engine to consume all graphic operators.
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
2 */
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
3 #ifndef __MB_GE_OPENVG_H_
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
4 #define __MB_GE_OPENVG_H_
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
5
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
6 #include <stdio.h>
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
7 #include <GL/glut.h>
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
8 #include "mb_basic_types.h"
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
9 #include "mb_img_ldr.h"
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
10
611
38383f5f645d Change group of OpenVG and Dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents: 610
diff changeset
11 /*! \defgroup mb_ge_dummy Dummy Implementation of MadButterfly Graphic Engine
581
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
12 * @{
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
13 */
610
e78bff7d23d3 create pattern from surface for OpenVG
Thinker K.F. Li <thinker@branda.to>
parents: 603
diff changeset
14 #define mbe_pattern_create_for_surface(surface) ((mbe_pattern_t *)NULL)
581
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
15 #define mbe_scaled_font_text_extents(scaled, utf8, extents)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
16 #define mbe_image_surface_get_stride(surface) (20)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
17 #define mbe_image_surface_get_format(surface) ((mb_img_fmt_t)0)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
18 #define mbe_image_surface_get_height(surface) (1)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
19 #define mbe_image_surface_get_width(surface) (1)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
20 #define mbe_image_surface_get_data(surface) ((unsigned char *)NULL)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
21 #define mbe_scaled_font_reference(scaled) ((mbe_scaled_font_t *)NULL)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
22 /* For OpenVG backend, never invoke xlib surface.
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
23 * #define mbe_xlib_surface_create cairo_xlib_surface_create
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
24 */
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
25 #define mbe_pattern_create_radial(cx0, cy0, radius0, \
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
26 cx1, cy1, radius1, stops, stop_cnt) \
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
27 ((mbe_pattern_t *)NULL)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
28 #define mbe_pattern_create_linear(x0, y0, x1, y1, stops, stop_cnt) \
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
29 ((mbe_pattern_t *)NULL)
602
ac2e6468a22a Replace mbe_image_surface_create_from_png() with mbe_pattern_create_image()
Thinker K.F. Li <thinker@branda.to>
parents: 599
diff changeset
30 #define mbe_pattern_create_image(img) ((mbe_pattern_t *)NULL)
581
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
31 #define mbe_image_surface_create(fmt, w, h) ((mbe_surface_t *)NULL)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
32 #define mbe_scaled_font_destroy(scaled)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
33 #define mbe_font_face_reference(face) ((mbe_font_face_t *)NULL)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
34 #define mbe_scaled_font_create(face, fnt_mtx, ctm) ((mbe_scaled_font_t *)NULL)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
35 #define mbe_pattern_set_matrix(ptn, mtx)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
36 #define mbe_font_face_destroy(face)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
37 #define mbe_paint_with_alpha(canvas, alpha)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
38 #define mbe_surface_destroy(surface)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
39 #define mbe_set_source_rgba(canvas, r, g, b, a)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
40 #define mbe_set_scaled_font(canvas, scaled)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
41 #define mbe_pattern_destroy(pattern)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
42 #define mbe_get_scaled_font(canvas) ((mbe_scaled_font_t *)NULL)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
43 #define mbe_query_font_face(family, slant, weight) ((mbe_font_face_t *)NULL)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
44 #define mbe_free_font_face(face)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
45 #define mbe_set_line_width(canvas, w)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
46 #define mbe_set_source_rgb(canvas, r, g, b)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
47 #define mbe_get_font_face(canvas) ((mbe_font_face_t *)NULL)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
48 #define mbe_fill_preserve(canvas)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
49 #define mbe_copy_source(src_canvas, dst_canvas)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
50 #define mbe_set_source(canvas, pattern)
586
b42d69ab8857 Replace mbe_clip() with mbe_scissoring()
Thinker K.F. Li <thinker@branda.to>
parents: 581
diff changeset
51 #define mbe_reset_scissoring(canvas)
581
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
52 #define mbe_get_target(canvas) ((mbe_surface_t *)NULL)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
53 #define mbe_close_path(canvas)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
54 #define mbe_text_path(canvas, utf8)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
55 #define mbe_transform(canvas, mtx)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
56 #define mbe_rectangle(canvas, x, y, w, h)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
57 #define mbe_in_stroke(canvas, x, y) (0)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
58 #define mbe_new_path(canvas)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
59 #define mbe_curve_to(canvas, x1, y1, x2, y2, x3, y3)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
60 #define mbe_restore(canvas)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
61 #define mbe_move_to(canvas, x, y)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
62 #define mbe_line_to(canvas, x, y)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
63 #define mbe_in_fill(canvas, x, y) (0)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
64 #define mbe_destroy(canvas)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
65 #define mbe_stroke(canvas)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
66 #define mbe_create(surface) ((mbe_t *)NULL)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
67 #define mbe_clear(canvas)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
68 #define mbe_paint(canvas)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
69 #define mbe_save(canvas)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
70 #define mbe_fill(canvas)
586
b42d69ab8857 Replace mbe_clip() with mbe_scissoring()
Thinker K.F. Li <thinker@branda.to>
parents: 581
diff changeset
71 /*! \brief Make scissoring rectangles.
b42d69ab8857 Replace mbe_clip() with mbe_scissoring()
Thinker K.F. Li <thinker@branda.to>
parents: 581
diff changeset
72 *
b42d69ab8857 Replace mbe_clip() with mbe_scissoring()
Thinker K.F. Li <thinker@branda.to>
parents: 581
diff changeset
73 * It would reset all previous pathes.
b42d69ab8857 Replace mbe_clip() with mbe_scissoring()
Thinker K.F. Li <thinker@branda.to>
parents: 581
diff changeset
74 */
b42d69ab8857 Replace mbe_clip() with mbe_scissoring()
Thinker K.F. Li <thinker@branda.to>
parents: 581
diff changeset
75 #define mbe_scissoring(canvas, n_areas, areas)
581
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
76 #define mbe_arc(canvas, x, y, radius, angle_start, angle_stop)
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
77
630
bd18951b51d5 Add initial code for graphic engines
Thinker K.F. Li <thinker@branda.to>
parents: 611
diff changeset
78 /*! \brief Initialize graphic engine */
bd18951b51d5 Add initial code for graphic engines
Thinker K.F. Li <thinker@branda.to>
parents: 611
diff changeset
79 #define mbe_init()
bd18951b51d5 Add initial code for graphic engines
Thinker K.F. Li <thinker@branda.to>
parents: 611
diff changeset
80
581
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
81 typedef struct _mbe_text_extents_t mbe_text_extents_t;
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
82 typedef int mbe_scaled_font_t;
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
83 typedef int mbe_font_face_t;
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
84 typedef int mbe_surface_t;
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
85 typedef int mbe_pattern_t;
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
86 typedef int mbe_t;
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
87
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
88 struct _mbe_text_extents_t {
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
89 co_aix x_bearing;
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
90 co_aix y_bearing;
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
91 co_aix width;
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
92 co_aix height;
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
93 co_aix x_advance;
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
94 co_aix y_advance;
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
95 };
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
96
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
97 /* @} */
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
98
953acea89f76 dummy implementation of graphic engine
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
99 #endif /* __MB_GE_OPENVG_H_ */