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