* rename 'x11' to 'xlib' when it makes sense
[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
20 typedef enum   _Outbuf_Depth    Outbuf_Depth;
21
22 enum _Outbuf_Depth
23 {
24    OUTBUF_DEPTH_NONE,
25    OUTBUF_DEPTH_INHERIT,
26    OUTBUF_DEPTH_RGB_16BPP_565_565_DITHERED,
27    OUTBUF_DEPTH_RGB_16BPP_555_555_DITHERED,
28    OUTBUF_DEPTH_RGB_16BPP_444_444_DITHERED,
29    OUTBUF_DEPTH_RGB_16BPP_565_444_DITHERED,
30    OUTBUF_DEPTH_RGB_32BPP_888_8888,
31    OUTBUF_DEPTH_LAST
32 };
33
34 typedef struct _Outbuf          Outbuf;
35
36 struct _Outbuf
37 {
38    Outbuf_Depth    depth;
39    int             w, h;
40    int             rot;
41    int             onebuf;
42
43    struct {
44       Convert_Pal *pal;
45       union {
46 #ifdef BUILD_ENGINE_SOFTWARE_XLIB
47          struct {
48             Display          *disp;
49             Window            win;
50             Pixmap            mask;
51             Visual           *vis;
52             Colormap          cmap;
53             int               depth;
54             int               shm;
55             GC                gc;
56             GC                gcm;
57             unsigned char     swap     : 1;
58             unsigned char     bit_swap : 1;
59          } xlib;
60 #endif
61 #ifdef BUILD_ENGINE_SOFTWARE_XCB
62          struct {
63             xcb_connection_t *conn;
64             xcb_screen_t     *screen;
65             xcb_drawable_t    win;
66             xcb_pixmap_t      mask;
67             xcb_visualtype_t *vis;
68             xcb_colormap_t    cmap;
69             int               depth;
70             int               shm;
71             xcb_gcontext_t    gc;
72             xcb_gcontext_t    gcm;
73             unsigned char     swap     : 1;
74             unsigned char     bit_swap : 1;
75          } xcb;
76 #endif
77       } x11;
78       struct {
79          DATA32    r, g, b;
80       } mask;
81
82       /* 1 big buffer for updates - flush on idle_flush */
83       RGBA_Image  *onebuf;
84       Eina_List   *onebuf_regions;
85
86       /* a list of pending regions to write to the target */
87       Eina_List   *pending_writes;
88       /* a list of previous frame pending regions to write to the target */
89       Eina_List   *prev_pending_writes;
90
91       unsigned char mask_dither : 1;
92       unsigned char destination_alpha : 1;
93       unsigned char debug : 1;
94       unsigned char synced : 1;
95    } priv;
96 };
97
98
99 void evas_software_xlib_x_init (void);
100 void evas_software_xcb_x_init  (void);
101
102
103 #endif