comparison include/mb_paint.h @ 186:530bb7728546 include_mb_test

Move header files to $(top_srcdir)/include/ and prefixed with 'mb_'. This is the solution that I dicussed with FourDollars, last night.
author Thinker K.F. Li <thinker@branda.to>
date Wed, 05 Nov 2008 15:24:01 +0800
parents include/mb/paint.h@c7e5b8779bb5
children 29acbd8a0dd0
comparison
equal deleted inserted replaced
185:c7e5b8779bb5 186:530bb7728546
1 #ifndef __PAINT_H_
2 #define __PAINT_H_
3
4 #include <cairo.h>
5 #include "mb_types.h"
6 #include "mb_redraw_man.h"
7 #include "mb_tools.h"
8
9 typedef float co_comp_t;
10
11 extern paint_t *rdman_paint_color_new(redraw_man_t *rdman,
12 co_comp_t r, co_comp_t g,
13 co_comp_t b, co_comp_t a);
14 extern void paint_color_set(paint_t *paint,
15 co_comp_t r, co_comp_t g,
16 co_comp_t b, co_comp_t a);
17 extern void paint_color_get(paint_t *paint,
18 co_comp_t *r, co_comp_t *g,
19 co_comp_t *b, co_comp_t *a);
20 #define paint_init(_paint, _prepare, _free) \
21 do { \
22 (_paint)->flags = 0; \
23 (_paint)->prepare = _prepare; \
24 (_paint)->free = _free; \
25 STAILQ_INIT((_paint)->members); \
26 (_paint)->pnt_next = NULL; \
27 } while(0) \
28
29
30 typedef struct _grad_stop {
31 co_aix offset;
32 co_comp_t r, g, b, a;
33 } grad_stop_t;
34
35 extern paint_t *rdman_paint_linear_new(redraw_man_t *rdman,
36 co_aix x1, co_aix y1,
37 co_aix x2, co_aix y2);
38 extern grad_stop_t *paint_linear_stops(paint_t *paint,
39 int n_stops,
40 grad_stop_t *stops);
41 extern paint_t *rdman_paint_radial_new(redraw_man_t *rdman,
42 co_aix cx, co_aix cy, co_aix r);
43 extern grad_stop_t *paint_radial_stops(paint_t *paint,
44 int n_stops,
45 grad_stop_t *stops);
46
47 #define grad_stop_init(stop, _offset, _r, _g, _b, _a) \
48 do { \
49 (stop)->offset = _offset; \
50 (stop)->r = _r; \
51 (stop)->g = _g; \
52 (stop)->b = _b; \
53 (stop)->a = _a; \
54 } while(0)
55
56
57 #endif /* __PAINT_H_ */