* evas: Cleanup move to eina log.
[framework/uifw/evas.git] / src / modules / engines / software_x11 / evas_engine.h
1 #ifndef EVAS_ENGINE_H
2 #define EVAS_ENGINE_H
3
4 #include <sys/ipc.h>
5 #include <sys/shm.h>
6
7 #ifdef BUILD_ENGINE_SOFTWARE_XLIB
8 # include <X11/Xlib.h>
9 # include <X11/Xutil.h>
10 # include <X11/Xatom.h>
11 # include <X11/extensions/XShm.h>
12 #endif
13
14 #ifdef BUILD_ENGINE_SOFTWARE_XCB
15 # include <xcb/xcb.h>
16 # include <xcb/xcb_image.h>
17 #endif
18
19 extern int _evas_engine_soft_x11_log_dom;
20 #ifdef ERR
21 # undef ERR
22 #endif
23 #define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_soft_x11_log_dom, __VA_ARGS__)
24
25 #ifdef DBG
26 # undef DBG
27 #endif
28 #define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_soft_x11_log_dom, __VA_ARGS__)
29
30 #ifdef INF
31 # undef INF
32 #endif
33 #define INF(...) EINA_LOG_DOM_INFO(_evas_engine_soft_x11_log_dom, __VA_ARGS__)
34
35 #ifdef WRN
36 # undef WRN
37 #endif
38 #define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_soft_x11_log_dom, __VA_ARGS__)
39
40 #ifdef CRIT
41 # undef CRIT
42 #endif
43 #define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_soft_x11_log_dom, __VA_ARGS__)
44
45 typedef enum   _Outbuf_Depth    Outbuf_Depth;
46
47 enum _Outbuf_Depth
48 {
49    OUTBUF_DEPTH_NONE,
50    OUTBUF_DEPTH_INHERIT,
51    OUTBUF_DEPTH_RGB_16BPP_565_565_DITHERED,
52    OUTBUF_DEPTH_RGB_16BPP_555_555_DITHERED,
53    OUTBUF_DEPTH_RGB_16BPP_444_444_DITHERED,
54    OUTBUF_DEPTH_RGB_16BPP_565_444_DITHERED,
55    OUTBUF_DEPTH_RGB_32BPP_888_8888,
56    OUTBUF_DEPTH_LAST
57 };
58
59 typedef struct _Outbuf          Outbuf;
60
61 struct _Outbuf
62 {
63    Outbuf_Depth    depth;
64    int             w, h;
65    int             rot;
66    int             onebuf;
67
68    struct {
69       Convert_Pal *pal;
70       union {
71 #ifdef BUILD_ENGINE_SOFTWARE_XLIB
72          struct {
73             Display          *disp;
74             Window            win;
75             Pixmap            mask;
76             Visual           *vis;
77             Colormap          cmap;
78             int               depth;
79             int               shm;
80             GC                gc;
81             GC                gcm;
82             unsigned char     swap     : 1;
83             unsigned char     bit_swap : 1;
84          } xlib;
85 #endif
86 #ifdef BUILD_ENGINE_SOFTWARE_XCB
87          struct {
88             xcb_connection_t *conn;
89             xcb_screen_t     *screen;
90             xcb_drawable_t    win;
91             xcb_pixmap_t      mask;
92             xcb_visualtype_t *vis;
93             xcb_colormap_t    cmap;
94             int               depth;
95             int               shm;
96             xcb_gcontext_t    gc;
97             xcb_gcontext_t    gcm;
98             unsigned char     swap     : 1;
99             unsigned char     bit_swap : 1;
100          } xcb;
101 #endif
102       } x11;
103       struct {
104          DATA32    r, g, b;
105       } mask;
106
107       /* 1 big buffer for updates - flush on idle_flush */
108       RGBA_Image  *onebuf;
109       Eina_List   *onebuf_regions;
110
111       /* a list of pending regions to write to the target */
112       Eina_List   *pending_writes;
113       /* a list of previous frame pending regions to write to the target */
114       Eina_List   *prev_pending_writes;
115
116       unsigned char mask_dither : 1;
117       unsigned char destination_alpha : 1;
118       unsigned char debug : 1;
119       unsigned char synced : 1;
120    } priv;
121 };
122
123
124 void evas_software_xlib_x_init (void);
125 void evas_software_xcb_x_init  (void);
126
127
128 #endif