and add in the 8bpp gray stuff
[framework/uifw/evas.git] / src / modules / engines / software_8_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 #include <xcb/xcb.h>
8 #include <xcb/shm.h>
9 #include <xcb/xcb_image.h>
10
11 #include "evas_common.h"
12 #include "evas_common_soft8.h"
13
14 extern int _evas_engine_soft8_x11_log_dom;
15 #ifdef ERR
16 # undef ERR
17 #endif
18 #define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_soft8_x11_log_dom, __VA_ARGS__)
19
20 #ifdef DBG
21 # undef DBG
22 #endif
23 #define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_soft8_x11_log_dom, __VA_ARGS__)
24
25 #ifdef INF
26 # undef INF
27 #endif
28 #define INF(...) EINA_LOG_DOM_INFO(_evas_engine_soft8_x11_log_dom, __VA_ARGS__)
29
30 #ifdef WRN
31 # undef WRN
32 #endif
33 #define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_soft8_x11_log_dom, __VA_ARGS__)
34
35 #ifdef CRIT
36 # undef CRIT
37 #endif
38 #define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_soft8_x11_log_dom, __VA_ARGS__)
39
40 typedef struct _X_Output_Buffer       X_Output_Buffer;
41
42 struct _X_Output_Buffer
43 {
44    Soft8_Image                  *im;
45    xcb_connection_t             *connection;
46    xcb_screen_t                 *screen;
47    xcb_image_t                  *xim;
48    xcb_drawable_t               drawable;
49    xcb_gcontext_t               gc;
50    xcb_shm_segment_info_t       *shm_info;
51    unsigned char                *pal;
52    void                         *data;
53 };
54
55 /****/
56 void             evas_software_x11_x_init                        (void);
57
58 int              evas_software_x11_x_can_do_shm                  (xcb_connection_t *c, xcb_screen_t *screen);
59 X_Output_Buffer *evas_software_x11_x_output_buffer_new           (xcb_connection_t *, xcb_screen_t *screen, int depth, unsigned char *pal, int w, int h, int try_shm, void *data);
60 void             evas_software_x11_x_output_buffer_free          (X_Output_Buffer *xob, int sync);
61 void             evas_software_x11_x_output_buffer_paste         (X_Output_Buffer *xob, xcb_drawable_t d, xcb_gcontext_t gc, int x, int y, int w, int h, int sync);
62 DATA8           *evas_software_x11_x_output_buffer_data          (X_Output_Buffer *xob, int *bytes_per_line_ret);
63 int              evas_software_x11_x_output_buffer_depth         (X_Output_Buffer *xob);
64 int              evas_software_x11_x_output_buffer_byte_order    (X_Output_Buffer *xob);
65 int              evas_software_x11_x_output_buffer_bit_order     (X_Output_Buffer *xob);
66
67 #endif