move around - flatter.
[profile/ivi/evas.git] / src / lib / include / evas_common.h
1 /*
2  * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
3  */
4
5 #ifndef EVAS_COMMON_H
6 #define EVAS_COMMON_H
7
8 #ifdef HAVE_CONFIG_H
9 # include "config.h"  /* so that EAPI in Evas.h is correctly defined */
10 #endif
11
12 #include "Evas.h"
13
14 /*****************************************************************************/
15
16 #include "evas_options.h"
17
18 #ifndef _GNU_SOURCE
19 #define _GNU_SOURCE
20 #endif
21
22 #ifdef BUILD_PTHREAD
23 # include <pthread.h>
24 # include <sched.h>
25 # define LK(x)  pthread_mutex_t x
26 # define LKI(x) pthread_mutex_init(&(x), NULL);
27 # define LKD(x) pthread_mutex_destroy(&(x));
28 # define LKL(x) pthread_mutex_lock(&(x));
29 # define LKU(x) pthread_mutex_unlock(&(x));
30 # define TH(x)  pthread_t x
31 # define THI(x) int x
32 # define TH_MAX 8
33
34 // even though in theory having every Nth rendered line done by a different
35 // thread might even out load across threads - it actually slows things down.
36 //#define EVAS_SLI 1
37
38 #else
39 # define LK(x)
40 # define LKI(x)
41 # define LKD(x)
42 # define LKL(x)
43 # define LKU(x)
44 # define TH(x)
45 # define THI(x)
46 # define TH_MAX 0
47 #endif
48
49 #include <stdio.h>
50 #include <stdlib.h>
51 #include <string.h>
52 #include <signal.h>
53 #include <setjmp.h>
54 #include <sys/types.h>
55 #include <sys/stat.h>
56 #include <unistd.h>
57 #include <time.h>
58 #include <ctype.h>
59 #include <stdint.h>
60
61 #ifdef HAVE_ALLOCA_H
62 # include <alloca.h>
63 #elif defined __GNUC__
64 # define alloca __builtin_alloca
65 #elif defined _AIX
66 # define alloca __alloca
67 #elif defined _MSC_VER
68 # include <malloc.h>
69 # define alloca _alloca
70 #else
71 # include <stddef.h>
72 # ifdef  __cplusplus
73 extern "C"
74 # endif
75 void *alloca (size_t);
76 #endif
77
78 #include <ft2build.h>
79 #include FT_FREETYPE_H
80 #include FT_GLYPH_H
81 #include FT_SIZES_H
82 #include FT_MODULE_H
83
84 #ifdef __GNUC__
85 # if __GNUC__ >= 4
86 // BROKEN in gcc 4 on amd64
87 //#  pragma GCC visibility push(hidden)
88 # endif
89 #define LIKELY(x)   __builtin_expect(!!(x), 1)
90 #define UNLIKELY(x) __builtin_expect(!!(x), 0)
91 #else
92 #define LIKELY(x)   (x)
93 #define UNLIKELY(x) (x)
94 #endif
95
96 /*****************************************************************************/
97
98 /* use exact rects for updates not tiles */
99 /* #define RECTUPDATE */
100 #define TILESIZE 8
101
102 #ifdef BUILD_SMALL_DITHER_MASK
103 # define DM_TABLE     _evas_dither_44
104 # define DM_SIZE      4
105 # define DM_BITS      4
106 # define DM_DIV       16
107 # define USE_DITHER_44 1
108 # define DM_MSK       (DM_SIZE - 1)
109 # define DM_SHF(_b)   (DM_BITS - (8 - _b))
110 #else
111 # define DM_TABLE     _evas_dither_128128
112 # define DM_SIZE      128
113 # define DM_BITS      6
114 # define DM_DIV       64
115 # define USE_DITHER_128128 1
116 # define DM_MSK       (DM_SIZE - 1)
117 # define DM_SHF(_b)   (DM_BITS - (8 - _b))
118 #endif
119
120 /* if more than 1/ALPHA_SPARSE_INV_FRACTION is "alpha" (1-254) then sparse
121  * alpha flag gets set */
122 #define ALPHA_SPARSE_INV_FRACTION 3
123
124 /*****************************************************************************/
125
126 /*****************************************************************************/
127
128 typedef unsigned long long              DATA64;
129 typedef unsigned int                    DATA32;
130 typedef unsigned short                  DATA16;
131 typedef unsigned char                   DATA8;
132
133 typedef struct _Image_Entry             Image_Entry;
134 typedef struct _Image_Entry_Flags       Image_Entry_Flags;
135 typedef struct _Engine_Image_Entry      Engine_Image_Entry;
136
137 typedef struct _RGBA_Image_Loadopts   RGBA_Image_Loadopts;
138 typedef struct _RGBA_Pipe_Op          RGBA_Pipe_Op;
139 typedef struct _RGBA_Pipe             RGBA_Pipe;
140 typedef struct _RGBA_Pipe_Thread_Info RGBA_Pipe_Thread_Info;
141 typedef struct _RGBA_Image            RGBA_Image;
142 typedef struct _RGBA_Image_Span       RGBA_Image_Span;
143 typedef struct _RGBA_Draw_Context     RGBA_Draw_Context;
144 typedef struct _RGBA_Gradient         RGBA_Gradient;
145 typedef struct _RGBA_Gradient_Color_Stop   RGBA_Gradient_Color_Stop;
146 typedef struct _RGBA_Gradient_Alpha_Stop   RGBA_Gradient_Alpha_Stop;
147 typedef struct _RGBA_Gradient_Type    RGBA_Gradient_Type;
148 typedef struct _RGBA_Polygon_Point    RGBA_Polygon_Point;
149 typedef struct _RGBA_Font             RGBA_Font;
150 typedef struct _RGBA_Font_Int         RGBA_Font_Int;
151 typedef struct _RGBA_Font_Source      RGBA_Font_Source;
152 typedef struct _RGBA_Font_Glyph       RGBA_Font_Glyph;
153 typedef struct _RGBA_Gfx_Compositor   RGBA_Gfx_Compositor;
154
155 typedef struct _Cutout_Rect           Cutout_Rect;
156 typedef struct _Cutout_Rects            Cutout_Rects;
157
158 typedef struct _Convert_Pal             Convert_Pal;
159
160 typedef struct _Tilebuf                 Tilebuf;
161 typedef struct _Tilebuf_Tile            Tilebuf_Tile;
162 typedef struct _Tilebuf_Rect            Tilebuf_Rect;
163
164 /*
165 typedef struct _Regionbuf             Regionbuf;
166 typedef struct _Regionspan            Regionspan;
167 */
168
169 typedef void (*RGBA_Gfx_Func)    (DATA32 *src, DATA8 *mask, DATA32 col, DATA32 *dst, int len);
170 typedef void (*RGBA_Gfx_Pt_Func) (DATA32 src, DATA8 mask, DATA32 col, DATA32 *dst);
171 typedef void (*Gfx_Func_Copy)    (DATA32 *src, DATA32 *dst, int len);
172
173 typedef void (*Gfx_Func_Convert) (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
174
175 typedef void (*Gfx_Func_Gradient_Fill)(DATA32 *src, int src_len,
176                                          DATA32 *dst, DATA8 *mask, int len,
177                                          int x, int y, int axx, int axy, int ayx, int ayy,
178                                          void *geom_data);
179
180 #include "../cache/evas_cache.h"
181
182 /*****************************************************************************/
183
184 typedef enum _RGBA_Image_Flags
185 {
186    RGBA_IMAGE_NOTHING       = (0),
187 /*    RGBA_IMAGE_HAS_ALPHA     = (1 << 0), */
188    RGBA_IMAGE_IS_DIRTY      = (1 << 1),
189    RGBA_IMAGE_INDEXED       = (1 << 2),
190    RGBA_IMAGE_ALPHA_ONLY    = (1 << 3),
191    RGBA_IMAGE_ALPHA_TILES   = (1 << 4),
192 /*    RGBA_IMAGE_ALPHA_SPARSE  = (1 << 5), */
193 /*    RGBA_IMAGE_LOADED        = (1 << 6), */
194 /*    RGBA_IMAGE_NEED_DATA     = (1 << 7) */
195 } RGBA_Image_Flags;
196
197 typedef enum _Convert_Pal_Mode
198 {
199    PAL_MODE_NONE,
200    PAL_MODE_MONO,
201    PAL_MODE_GRAY4,
202    PAL_MODE_GRAY16,
203    PAL_MODE_GRAY64,
204    PAL_MODE_GRAY256,
205    PAL_MODE_RGB111,
206    PAL_MODE_RGB121,
207    PAL_MODE_RGB221,
208    PAL_MODE_RGB222,
209    PAL_MODE_RGB232,
210    PAL_MODE_RGB332,
211    PAL_MODE_RGB666,
212    PAL_MODE_LAST
213 } Convert_Pal_Mode;
214
215 typedef enum _CPU_Features
216 {
217    CPU_FEATURE_C       = 0,
218    CPU_FEATURE_MMX     = (1 << 0),
219    CPU_FEATURE_MMX2    = (1 << 1),
220    CPU_FEATURE_SSE     = (1 << 2),
221    CPU_FEATURE_ALTIVEC = (1 << 3),
222    CPU_FEATURE_VIS     = (1 << 4),
223    CPU_FEATURE_VIS2    = (1 << 5)
224 } CPU_Features;
225
226 typedef enum _Font_Hint_Flags
227 {
228    FONT_NO_HINT,
229    FONT_AUTO_HINT,
230    FONT_BYTECODE_HINT
231 } Font_Hint_Flags;
232
233 /*****************************************************************************/
234
235 struct _RGBA_Image_Loadopts
236 {
237    int                  scale_down_by; // if > 1 then use this
238    double               dpi; // if > 0.0 use this
239    int                  w, h; // if > 0 use this
240 };
241
242 struct _Image_Entry_Flags
243 {
244    Evas_Bool loaded       : 1;
245    Evas_Bool dirty        : 1;
246    Evas_Bool activ        : 1;
247    Evas_Bool need_data    : 1;
248    Evas_Bool lru_nodata   : 1;
249    Evas_Bool cached       : 1;
250    Evas_Bool alpha        : 1;
251    Evas_Bool alpha_sparse : 1;
252 };
253
254 struct _Image_Entry
255 {
256   Evas_Object_List       _list_data;
257
258   Evas_Cache_Image      *cache;
259
260   const char            *cache_key;
261
262   const char            *file;
263   const char            *key;
264
265   time_t                 timestamp;
266   time_t                 laststat;
267
268   int                    references;
269
270   unsigned char          scale;
271
272   RGBA_Image_Loadopts    load_opts;
273   int                    space;
274   int                    w;
275   int                    h;
276
277   struct
278   {
279      int                 w;
280      int                 h;
281   } allocated;
282
283   struct
284   {
285      void               *module;
286      void               *loader;
287   } info;
288
289   Image_Entry_Flags      flags;
290 };
291
292 struct _Engine_Image_Entry
293 {
294    Evas_Object_List              _list_data;
295
296    /* Upper Engine data. */
297    Image_Entry                  *src;
298
299    /* Cache stuff. */
300    Evas_Cache_Engine_Image      *cache;
301    const char                   *cache_key;
302
303    struct
304    {
305      Evas_Bool                   cached : 1;
306      Evas_Bool                   activ : 1;
307      Evas_Bool                   dirty : 1;
308      Evas_Bool                   loaded : 1;
309      Evas_Bool                   need_parent : 1;
310    } flags;
311
312    int                           references;
313    int                           w;
314    int                           h;
315 };
316
317 struct _Cutout_Rect
318 {
319    int               x, y, w, h;
320 };
321
322 struct _Cutout_Rects
323 {
324    Cutout_Rect*      rects;
325    int               active;
326    int               max;
327 };
328
329 struct _RGBA_Draw_Context
330 {
331    struct {
332       Evas_Bool use : 1;
333       DATA32 col;
334    } mul;
335    struct {
336       DATA32 col;
337    } col;
338    struct RGBA_Draw_Context_clip {
339       int    x, y, w, h;
340       Evas_Bool use : 1;
341    } clip;
342    Cutout_Rects cutout;
343    struct {
344       struct {
345          void *(*gl_new)  (void *data, RGBA_Font_Glyph *fg);
346          void  (*gl_free) (void *ext_dat);
347          void  (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y);
348       } func;
349       void *data;
350    } font_ext;
351    struct {
352       int color_space;
353    } interpolation;
354    struct {
355       int y, h;
356    } sli;
357    int            render_op;
358    Evas_Bool anti_alias : 1;
359 };
360
361 struct _RGBA_Pipe_Op
362 {
363    RGBA_Draw_Context         context;
364    void                    (*op_func) (RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Thread_Info *info);
365    void                    (*free_func) (RGBA_Pipe_Op *op);
366
367    union {
368       struct {
369          int                 x, y, w, h;
370       } rect;
371       struct {
372          int                 x0, y0, x1, y1;
373       } line;
374       struct {
375          RGBA_Polygon_Point *points;
376       } poly;
377       struct {
378          RGBA_Gradient      *grad;
379          int                 x, y, w, h;
380       } grad;
381       struct {
382          RGBA_Font          *font;
383          int                 x, y;
384          char               *text;
385       } text;
386       struct {
387          RGBA_Image         *src;
388          int                 sx, sy, sw, sh, dx, dy, dw, dh;
389          int                 smooth;
390          char               *text;
391       } image;
392    } op;
393 };
394
395 #define PIPE_LEN 256
396
397 struct _RGBA_Pipe
398 {
399    Evas_Object_List  _list_data;
400    int               op_num;
401    RGBA_Pipe_Op      op[PIPE_LEN];
402 };
403
404 struct _RGBA_Pipe_Thread_Info
405 {
406    RGBA_Image *im;
407    int         x, y, w, h;
408 };
409
410 struct _RGBA_Image
411 {
412    Image_Entry          cache_entry;
413
414    RGBA_Image_Flags     flags;
415    struct
416      {
417 /*      void           *module; */
418 /*      void           *loader; */
419 /*      char           *real_file; */
420         char           *comment;
421 //      int             format;
422      } info;
423
424    void                *extended_info;
425    RGBA_Pipe           *pipe;
426    int                  ref;
427
428 /*    unsigned char        scale; */
429
430    /* Colorspace stuff. */
431    struct {
432       void              *data;
433       Evas_Bool          no_free : 1;
434       Evas_Bool          dirty : 1;
435    } cs;
436
437    /* RGBA stuff */
438    struct
439    {
440       DATA32            *data;
441       Evas_Bool          no_free : 1;
442    } image;
443 };
444
445 struct _RGBA_Gradient_Color_Stop
446 {
447    Evas_Object_List  _list_data;
448    int               r, g, b, a;
449    int               dist;
450 };
451
452 struct _RGBA_Gradient_Alpha_Stop
453 {
454    Evas_Object_List  _list_data;
455    int               a;
456    int               dist;
457 };
458
459 struct _RGBA_Gradient
460 {
461    struct
462      {
463         DATA32        *data;
464         int            len;
465         float          angle;
466         int            direction;
467         float          offset;
468         Evas_Bool      has_alpha : 1;
469      } map;
470
471    struct {
472         Evas_Object_List *stops;
473         DATA32           *data;
474         int               nstops;
475         int               len;
476    }  color;
477    struct {
478         Evas_Object_List *stops;
479         DATA8            *data;
480         int               nstops;
481         int               len;
482    }  alpha;
483
484    struct
485      {
486         int            x, y, w, h;
487         int            spread;
488         float          angle;
489      } fill;
490    struct
491      {
492         char          *name;
493         char          *params;
494         RGBA_Gradient_Type *geometer;
495         void          *gdata;
496      } type;
497
498    int references;
499
500    Evas_Bool imported_data : 1;
501    Evas_Bool has_alpha : 1;
502 };
503
504 struct _RGBA_Gradient_Type
505 {
506    const char              *name;
507    void                    (*init)(void);
508    void                    (*shutdown)(void);
509    void                    (*geom_init)(RGBA_Gradient *gr);
510    void                    (*geom_set)(RGBA_Gradient *gr);
511    void                    (*geom_free)(void *gdata);
512    int                     (*has_alpha)(RGBA_Gradient *gr, int render_op);
513    int                     (*has_mask)(RGBA_Gradient *gr, int render_op);
514    int                     (*get_map_len)(RGBA_Gradient *gr);
515    Gfx_Func_Gradient_Fill  (*get_fill_func)(RGBA_Gradient *gr, int render_op, unsigned char aa);
516 };
517
518 struct _RGBA_Polygon_Point
519 {
520    Evas_Object_List  _list_data;
521    int               x, y;
522 };
523
524 struct _RGBA_Font
525 {
526    Evas_List *fonts;
527    Font_Hint_Flags hinting;
528    int references;
529    LK(lock);
530 };
531
532 struct _RGBA_Font_Int
533 {
534    Evas_Object_List  _list_data;
535
536    RGBA_Font_Source *src;
537
538    int               size;
539    int               real_size;
540
541    struct {
542       FT_Size       size;
543    } ft;
544
545    Evas_Hash       *glyphs;
546
547    int              usage;
548    Font_Hint_Flags hinting;
549
550    int              references;
551 };
552
553 struct _RGBA_Font_Source
554 {
555    Evas_Object_List  _list_data;
556
557    const char       *name;
558    const char       *file;
559
560    void             *data;
561    int               data_size;
562    int               current_size;
563    Evas_Array_Hash  *charmap;
564
565    struct {
566       int           orig_upem;
567       FT_Face       face;
568    } ft;
569
570    int              references;
571 };
572
573 struct _RGBA_Font_Glyph
574 {
575    FT_Glyph        glyph;
576    FT_BitmapGlyph  glyph_out;
577    /* this is a problem - only 1 engine at a time can extend such a font... grrr */
578    void           *ext_dat;
579    void           (*ext_dat_free) (void *ext_dat);
580 };
581
582 struct _RGBA_Gfx_Compositor
583 {
584    const char *name;
585
586    void              (*init)(void);
587    void              (*shutdown)(void);
588
589    RGBA_Gfx_Func  (*composite_pixel_span_get)(RGBA_Image *src, RGBA_Image *dst, int pixels);
590    RGBA_Gfx_Func  (*composite_color_span_get)(DATA32 col, RGBA_Image *dst, int pixels);
591    RGBA_Gfx_Func  (*composite_pixel_color_span_get)(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
592    RGBA_Gfx_Func  (*composite_mask_color_span_get)(DATA32 col, RGBA_Image *dst, int pixels);
593    RGBA_Gfx_Func  (*composite_pixel_mask_span_get)(RGBA_Image *src, RGBA_Image *dst, int pixels);
594
595    RGBA_Gfx_Pt_Func  (*composite_pixel_pt_get)(Image_Entry_Flags src_flags, RGBA_Image *dst);
596    RGBA_Gfx_Pt_Func  (*composite_color_pt_get)(DATA32 col, RGBA_Image *dst);
597    RGBA_Gfx_Pt_Func  (*composite_pixel_color_pt_get)(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
598    RGBA_Gfx_Pt_Func  (*composite_mask_color_pt_get)(DATA32 col, RGBA_Image *dst);
599    RGBA_Gfx_Pt_Func  (*composite_pixel_mask_pt_get)(Image_Entry_Flags src_flags, RGBA_Image *dst);
600 };
601
602 #define EVAS_RECT_SPLIT 1
603 #ifdef EVAS_RECT_SPLIT
604 typedef struct list_node list_node_t;
605 typedef struct list list_t;
606 typedef struct rect rect_t;
607 typedef struct rect_node rect_node_t;
608
609 struct list_node
610 {
611     struct list_node *next;
612 };
613
614 struct list
615 {
616     struct list_node *head;
617     struct list_node *tail;
618 };
619
620 struct rect
621 {
622     short left;
623     short top;
624     short right;
625     short bottom;
626     short width;
627     short height;
628     int area;
629 };
630
631 struct rect_node
632 {
633     struct list_node _lst;
634     struct rect rect;
635 };
636
637 void rect_list_node_pool_set_max(int max);
638 void rect_list_node_pool_flush(void);
639 list_node_t *rect_list_node_pool_get(void);
640 void rect_list_node_pool_put(list_node_t *node);
641
642 void rect_init(rect_t *r, int x, int y, int w, int h);
643 void rect_list_append_node(list_t *rects, list_node_t *node);
644 void rect_list_append(list_t *rects, const rect_t r);
645 void rect_list_append_xywh(list_t *rects, int x, int y, int w, int h);
646 void rect_list_concat(list_t *rects, list_t *other);
647 list_node_t *rect_list_unlink_next(list_t *rects, list_node_t *parent_node);
648 void rect_list_del_next(list_t *rects, list_node_t *parent_node);
649 void rect_list_clear(list_t *rects);
650 void rect_list_del_split_strict(list_t *rects, const rect_t del_r);
651 void rect_list_add_split_strict(list_t *rects, list_node_t *node);
652 list_node_t *rect_list_add_split_fuzzy(list_t *rects, list_node_t *node, int accepted_error);
653 void rect_list_merge_rects(list_t *rects, list_t *to_merge, int accepted_error);void rect_list_add_split_fuzzy_and_merge(list_t *rects, list_node_t *node, int split_accepted_error, int merge_accepted_error);
654
655 void rect_print(const rect_t r);
656 void rect_list_print(const list_t rects);
657 #endif /* EVAS_RECT_SPLIT */
658
659 struct _Tilebuf
660 {
661    int outbuf_w;
662    int outbuf_h;
663
664    struct {
665       int           w, h;
666    } tile_size;
667
668 #ifdef RECTUPDATE
669    Regionbuf *rb;
670 #elif defined(EVAS_RECT_SPLIT)
671    int need_merge;
672    list_t rects;
673 #else
674    struct {
675       int           w, h;
676       Tilebuf_Tile *tiles;
677    } tiles;
678 #endif
679 };
680
681 struct _Tilebuf_Tile
682 {
683    Evas_Bool redraw : 1;
684 /* FIXME: need these flags later - but not now */
685 /*
686    Evas_Bool done   : 1;
687    Evas_Bool edge   : 1;
688    Evas_Bool from   : 1;
689
690    struct {
691       int dx, dy;
692    } vector;
693  */
694 };
695
696 struct _Tilebuf_Rect
697 {
698    Evas_Object_List  _list_data;
699    int               x, y, w, h;
700 };
701 /*
702 struct _Regionbuf
703 {
704    int w, h;
705    Regionspan **spans;
706 };
707
708 struct _Regionspan
709 {
710    Evas_Object_List  _list_data;
711    int x1, x2;
712 };
713 */
714
715 struct _Convert_Pal
716 {
717    int               references;
718    int               count;
719    Convert_Pal_Mode  colors;
720    DATA8            *lookup;
721    void             *data;
722 };
723
724 /****/
725
726 /*****************************************************************************/
727 #include "evas_macros.h"
728
729 #ifndef WORDS_BIGENDIAN
730 /* x86 */
731 #define A_VAL(p) ((DATA8 *)(p))[3]
732 #define R_VAL(p) ((DATA8 *)(p))[2]
733 #define G_VAL(p) ((DATA8 *)(p))[1]
734 #define B_VAL(p) ((DATA8 *)(p))[0]
735 #define AR_VAL(p) ((DATA16 *)(p)[1])
736 #define GB_VAL(p) ((DATA16 *)(p)[0])
737 #else
738 /* ppc */
739 #define A_VAL(p) ((DATA8 *)(p))[0]
740 #define R_VAL(p) ((DATA8 *)(p))[1]
741 #define G_VAL(p) ((DATA8 *)(p))[2]
742 #define B_VAL(p) ((DATA8 *)(p))[3]
743 #define AR_VAL(p) ((DATA16 *)(p)[0])
744 #define GB_VAL(p) ((DATA16 *)(p)[1])
745 #endif
746
747 #define RGB_JOIN(r,g,b) \
748         (((r) << 16) + ((g) << 8) + (b))
749
750 #define ARGB_JOIN(a,r,g,b) \
751         (((a) << 24) + ((r) << 16) + ((g) << 8) + (b))
752
753 #include "evas_blend_ops.h"
754
755 #define _EVAS_RENDER_FILL        -1
756 #define _EVAS_RENDER_BLEND        0
757 #define _EVAS_RENDER_BLEND_REL    1
758 #define _EVAS_RENDER_COPY         2
759 #define _EVAS_RENDER_COPY_REL     3
760 #define _EVAS_RENDER_ADD          4
761 #define _EVAS_RENDER_ADD_REL      5
762 #define _EVAS_RENDER_SUB          6
763 #define _EVAS_RENDER_SUB_REL      7
764 #define _EVAS_RENDER_TINT         8
765 #define _EVAS_RENDER_TINT_REL     9
766 #define _EVAS_RENDER_MASK         10
767 #define _EVAS_RENDER_MUL          11
768 #define _EVAS_RENDER_CLIP         12
769
770 #define _EVAS_TEXTURE_REFLECT           0
771 #define _EVAS_TEXTURE_REPEAT            1
772 #define _EVAS_TEXTURE_RESTRICT          2
773 #define _EVAS_TEXTURE_RESTRICT_REFLECT  3
774 #define _EVAS_TEXTURE_RESTRICT_REPEAT   4
775 #define _EVAS_TEXTURE_PAD               5
776
777 #define _EVAS_COLOR_SPACE_ARGB    0
778 #define _EVAS_COLOR_SPACE_AHSV    1
779
780 /*****************************************************************************/
781
782 #ifdef __cplusplus
783 extern "C" {
784 #endif
785
786 /****/
787 void evas_common_init                                   (void);
788 void evas_common_shutdown                               (void);
789
790 EAPI void evas_common_cpu_init                          (void);
791
792 int  evas_common_cpu_have_cpuid                         (void);
793 int  evas_common_cpu_has_feature                        (unsigned int feature);
794 EAPI void evas_common_cpu_can_do                        (int *mmx, int *sse, int *sse2);
795 EAPI void evas_common_cpu_end_opt                       (void);
796 EAPI int evas_common_cpu_count                          (void);
797
798 /****/
799 #include "../engines/common/evas_blend.h"
800
801 EAPI Gfx_Func_Copy        evas_common_draw_func_copy_get        (int pixels, int reverse);
802
803 /****/
804 #include "../engines/common/evas_convert_color.h"
805 #include "../engines/common/evas_convert_colorspace.h"
806 #include "../engines/common/evas_convert_main.h"
807 #include "../engines/common/evas_convert_yuv.h"
808 #include "../engines/common/evas_scale_main.h"
809 #include "../engines/common/evas_scale_smooth.h"
810 #include "../engines/common/evas_scale_span.h"
811
812 /****/
813 #include "../engines/common/evas_image.h"
814
815 /****/
816 #include "../engines/common/evas_line.h"
817 #include "../engines/common/evas_polygon.h"
818 #include "../engines/common/evas_rectangle.h"
819
820 /****/
821 EAPI void     evas_common_blit_init               (void);
822
823 EAPI void     evas_common_blit_rectangle          (const RGBA_Image *src, RGBA_Image *dst, int src_x, int src_y, int w, int h, int dst_x, int dst_y);
824
825 /****/
826 #include "../engines/common/evas_gradient.h"
827 #include "../engines/common/evas_font.h"
828
829 /****/
830 EAPI void          evas_common_tilebuf_init               (void);
831
832 EAPI Tilebuf      *evas_common_tilebuf_new               (int w, int h);
833 EAPI void          evas_common_tilebuf_free              (Tilebuf *tb);
834 EAPI void          evas_common_tilebuf_set_tile_size     (Tilebuf *tb, int tw, int th);
835 EAPI void          evas_common_tilebuf_get_tile_size     (Tilebuf *tb, int *tw, int *th);
836 EAPI int           evas_common_tilebuf_add_redraw        (Tilebuf *tb, int x, int y, int w, int h);
837 EAPI int           evas_common_tilebuf_del_redraw        (Tilebuf *tb, int x, int y, int w, int h);
838 EAPI int           evas_common_tilebuf_add_motion_vector (Tilebuf *tb, int x, int y, int w, int h, int dx, int dy, int alpha);
839 EAPI void          evas_common_tilebuf_clear             (Tilebuf *tb);
840 EAPI Tilebuf_Rect *evas_common_tilebuf_get_render_rects  (Tilebuf *tb);
841 EAPI void          evas_common_tilebuf_free_render_rects (Tilebuf_Rect *rects);
842
843 /*
844 Regionbuf    *evas_common_regionbuf_new       (int w, int h);
845 void          evas_common_regionbuf_free      (Regionbuf *rb);
846 void          evas_common_regionbuf_clear     (Regionbuf *rb);
847 void          evas_common_regionbuf_span_add  (Regionbuf *rb, int x1, int x2, int y);
848 void          evas_common_regionbuf_span_del  (Regionbuf *rb, int x1, int x2, int y);
849 Tilebuf_Rect *evas_common_regionbuf_rects_get (Regionbuf *rb);
850 */
851
852 /****/
853 #include "../engines/common/evas_draw.h"
854
855 /****/
856 #include "../engines/common/evas_pipe.h"
857
858 void              evas_font_dir_cache_free(void);
859
860 /****/
861
862 /*****************************************************************************/
863
864 #ifdef __cplusplus
865 }
866 #endif
867
868 #endif