aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/evas/src/modules/engines/software_gdi/evas_engine.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/evas/src/modules/engines/software_gdi/evas_engine.h')
-rw-r--r--libraries/evas/src/modules/engines/software_gdi/evas_engine.h209
1 files changed, 209 insertions, 0 deletions
diff --git a/libraries/evas/src/modules/engines/software_gdi/evas_engine.h b/libraries/evas/src/modules/engines/software_gdi/evas_engine.h
new file mode 100644
index 0000000..b8ddc85
--- /dev/null
+++ b/libraries/evas/src/modules/engines/software_gdi/evas_engine.h
@@ -0,0 +1,209 @@
1#ifndef EVAS_ENGINE_H
2#define EVAS_ENGINE_H
3
4
5#define WIN32_LEAN_AND_MEAN
6#include <windows.h>
7#undef WIN32_LEAN_AND_MEAN
8
9extern int _evas_engine_soft_gdi_log_dom;
10
11#ifdef ERR
12# undef ERR
13#endif
14#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_soft_gdi_log_dom, __VA_ARGS__)
15
16#ifdef DBG
17# undef DBG
18#endif
19#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_soft_gdi_log_dom, __VA_ARGS__)
20
21#ifdef INF
22# undef INF
23#endif
24#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_soft_gdi_log_dom, __VA_ARGS__)
25
26#ifdef WRN
27# undef WRN
28#endif
29#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_soft_gdi_log_dom, __VA_ARGS__)
30
31#ifdef CRIT
32# undef CRIT
33#endif
34#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_soft_gdi_log_dom, __VA_ARGS__)
35
36typedef enum _Outbuf_Depth Outbuf_Depth;
37
38enum _Outbuf_Depth
39{
40 OUTBUF_DEPTH_NONE,
41 OUTBUF_DEPTH_INHERIT,
42 OUTBUF_DEPTH_RGB_16BPP_565_565_DITHERED,
43 OUTBUF_DEPTH_RGB_32BPP_888_8888,
44 OUTBUF_DEPTH_LAST
45};
46
47typedef struct BITMAPINFO_GDI BITMAPINFO_GDI;
48typedef struct _Outbuf Outbuf;
49typedef struct _Outbuf_Region Outbuf_Region;
50typedef struct _Gdi_Output_Buffer Gdi_Output_Buffer;
51
52struct BITMAPINFO_GDI
53{
54 BITMAPINFOHEADER bih;
55 DWORD masks[3];
56};
57
58struct _Outbuf
59{
60 Outbuf_Depth depth;
61 int width;
62 int height;
63 int rot;
64 int onebuf;
65
66 struct {
67 Convert_Pal *pal;
68 struct {
69 BITMAPINFO_GDI *bitmap_info;
70 HWND window;
71 HDC dc;
72 HRGN regions;
73 int depth;
74 unsigned char borderless : 1;
75 unsigned char fullscreen : 1;
76 unsigned char region : 1;
77 } gdi;
78
79 /* 1 big buffer for updates - flush on idle_flush */
80 RGBA_Image *onebuf;
81 Eina_List *onebuf_regions;
82
83 /* a list of pending regions to write to the target */
84 Eina_List *pending_writes;
85 /* a list of previous frame pending regions to write to the target */
86 Eina_List *prev_pending_writes;
87
88 unsigned char mask_dither : 1;
89 unsigned char destination_alpha : 1;
90 unsigned char debug : 1;
91 unsigned char synced : 1;
92
93 unsigned char region_built : 1;
94 } priv;
95};
96
97struct _Outbuf_Region
98{
99 Gdi_Output_Buffer *gdiob;
100 int x;
101 int y;
102 int width;
103 int height;
104};
105
106struct _Gdi_Output_Buffer
107{
108 BITMAPINFO_GDI *bitmap_info;
109 HBITMAP bitmap;
110 HDC dc;
111 int width;
112 int height;
113 void *data;
114 int depth;
115 int pitch;
116 int psize;
117};
118
119/* evas_gdi_main.c */
120
121int evas_software_gdi_init (HWND window,
122 int depth,
123 unsigned int borderless,
124 unsigned int fullscreen,
125 unsigned int region,
126 Outbuf *buf);
127
128void evas_software_gdi_shutdown(Outbuf *buf);
129
130void evas_software_gdi_bitmap_resize(Outbuf *buf);
131
132/* evas_gdi_buffer.c */
133
134Gdi_Output_Buffer *evas_software_gdi_output_buffer_new(HDC dc,
135 BITMAPINFO_GDI *bitmap_info,
136 int depth,
137 int width,
138 int height,
139 void *data);
140
141void evas_software_gdi_output_buffer_free(Gdi_Output_Buffer *gdiob);
142
143void evas_software_gdi_output_buffer_paste(Gdi_Output_Buffer *gdiob,
144 int x,
145 int y);
146
147DATA8 *evas_software_gdi_output_buffer_data(Gdi_Output_Buffer *gdiob,
148 int *pitch);
149
150int evas_software_gdi_output_buffer_depth(Gdi_Output_Buffer *gdiob);
151
152/* evas_outbuf.c */
153
154void evas_software_gdi_outbuf_init(void);
155
156void evas_software_gdi_outbuf_free(Outbuf *buf);
157
158Outbuf *evas_software_gdi_outbuf_setup(int width,
159 int height,
160 int rotation,
161 Outbuf_Depth depth,
162 HWND window,
163 int w_depth,
164 unsigned int borderless,
165 unsigned int fullscreen,
166 unsigned int region,
167 int mask_dither,
168 int destination_alpha);
169
170void evas_software_gdi_outbuf_reconfigure(Outbuf *buf,
171 int width,
172 int height,
173 int rotation,
174 Outbuf_Depth depth);
175
176RGBA_Image *evas_software_gdi_outbuf_new_region_for_update(Outbuf *buf,
177 int x,
178 int y,
179 int w,
180 int h,
181 int *cx,
182 int *cy,
183 int *cw,
184 int *ch);
185
186void evas_software_gdi_outbuf_push_updated_region(Outbuf *buf,
187 RGBA_Image *update,
188 int x,
189 int y,
190 int w,
191 int h);
192
193void evas_software_gdi_outbuf_free_region_for_update(Outbuf *buf,
194 RGBA_Image *update);
195
196void evas_software_gdi_outbuf_flush(Outbuf *buf);
197
198void evas_software_gdi_outbuf_idle_flush(Outbuf *buf);
199
200int evas_software_gdi_outbuf_width_get(Outbuf *buf);
201
202int evas_software_gdi_outbuf_height_get(Outbuf *buf);
203
204Outbuf_Depth evas_software_gdi_outbuf_depth_get(Outbuf *buf);
205
206int evas_software_gdi_outbuf_rot_get(Outbuf *buf);
207
208
209#endif /* EVAS_ENGINE_H */