big patch from Samsung SAIT (Advanced research group) for async multi-frame
[framework/uifw/evas.git] / src / modules / engines / software_16_wince / evas_engine.c
1 #include "evas_common.h"
2 #include "evas_private.h"
3 #include "evas_engine.h"
4 #include "Evas_Engine_Software_16_WinCE.h"
5 #include "evas_common_soft16.h"
6
7 int _evas_engine_soft16_wince_log_dom = -1;
8
9 typedef enum
10 {
11   EVAS_ENGINE_WINCE_FB,
12   EVAS_ENGINE_WINCE_GAPI,
13   EVAS_ENGINE_WINCE_DDRAW,
14   EVAS_ENGINE_WINCE_GDI
15 } Evas_Engine_WinCE_Backend;
16
17
18 /* function tables - filled in later (func and parent func) */
19 static Evas_Func func, pfunc;
20
21 /* engine struct data */
22 typedef struct _Render_Engine Render_Engine;
23
24 struct _Render_Engine
25 {
26    Evas_Engine_WinCE_Backend backend; /* 1: raw, 2: gapi, 3: ddraw, 4: GDI */
27    void               *backend_priv;
28    void              (*backend_shutdown)(void *priv);
29    FB_Output_Buffer *(*backend_output_buffer_new)(void *priv,
30                                                   int width,
31                                                   int height);
32    void              (*backend_output_buffer_free)(FB_Output_Buffer *fbob);
33    void              (*backend_output_buffer_paste)(FB_Output_Buffer *fbob);
34    void              (*backend_surface_resize)(FB_Output_Buffer *fbob);
35
36    int               width;
37    int               height;
38    int               rotation;
39    Tilebuf          *tb;
40    Tilebuf_Rect     *rects;
41    Tilebuf_Rect     *cur_rect;
42    FB_Output_Buffer *fbob;
43    Soft16_Image     *tmp_out; /* used by indirect render, like rotation */
44    HRGN              clip_rects;
45    unsigned char     end : 1;
46 };
47
48 /* prototypes we will use here */
49
50 static void *eng_info(Evas *e);
51 static void eng_info_free(Evas *e, void *info);
52 static int eng_setup(Evas *e, void *info);
53 static void eng_output_free(void *data);
54 static void eng_output_resize(void *data, int w, int h);
55 static void eng_output_tile_size_set(void *data, int w, int h);
56 static void eng_output_redraws_rect_add(void *data, int x, int y, int w, int h);
57 static void eng_output_redraws_rect_del(void *data, int x, int y, int w, int h);
58 static void eng_output_redraws_clear(void *data);
59 static void *eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch);
60 static void eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int w, int h);
61 static void eng_output_flush(void *data);
62 static void eng_output_idle_flush(void *data);
63
64 static int
65 _suspend(int backend)
66 {
67    switch (backend)
68      {
69       case 2: /* gapi */
70          return evas_software_wince_gapi_suspend();
71       default: /* other engines do not need it */
72          return 0;
73      }
74 }
75
76 static int
77 _resume(int backend)
78 {
79    switch (backend)
80      {
81       case 2: /* gapi */
82          return evas_software_wince_gapi_resume();
83       default: /* other engines do not need it */
84          return 0;
85      }
86 }
87
88 /* engine api this module provides */
89 static void *
90 eng_info(Evas *e)
91 {
92    Evas_Engine_Info_Software_16_WinCE *info;
93    info = calloc(1, sizeof(Evas_Engine_Info_Software_16_WinCE));
94    if (!info) return NULL;
95    info->magic.magic = rand();
96    info->func.suspend = _suspend;
97    info->func.resume = _resume;
98    info->render_mode = EVAS_RENDER_MODE_BLOCKING;
99    return info;
100    e = NULL;
101 }
102
103 static void
104 eng_info_free(Evas *e, void *info)
105 {
106    Evas_Engine_Info_Software_16_WinCE *in;
107    in = (Evas_Engine_Info_Software_16_WinCE *)info;
108    free(in);
109 }
110
111 static void
112 _tmp_out_alloc(Render_Engine *re)
113 {
114    Tilebuf_Rect *r;
115    int w = 0, h = 0;
116
117    EINA_INLIST_FOREACH(re->rects, r)
118      {
119         if (r->w > w) w = r->w;
120         if (r->h > h) h = r->h;
121      }
122
123    if (re->tmp_out)
124      {
125         if ((re->tmp_out->cache_entry.w < w) || (re->tmp_out->cache_entry.h < h))
126           {
127              evas_cache_image_drop(&re->tmp_out->cache_entry);
128              re->tmp_out = NULL;
129           }
130      }
131
132    if (!re->tmp_out)
133      {
134         Soft16_Image *im;
135
136         im = (Soft16_Image *) evas_cache_image_empty(evas_common_soft16_image_cache_get());
137         im->cache_entry.flags.alpha = 0;
138         evas_cache_image_surface_alloc(&im->cache_entry, w, h);
139
140         re->tmp_out = im;
141      }
142 }
143
144
145 static int
146 eng_setup(Evas *e, void *in)
147 {
148    Render_Engine                      *re;
149    Evas_Engine_Info_Software_16_WinCE *info;
150
151    info = (Evas_Engine_Info_Software_16_WinCE *)in;
152    if (!e->engine.data.output)
153      {
154         /* do common routine init - we wil at least use it for core
155          * image loading and font loading/glyph rendering & placement */
156         evas_common_cpu_init();
157
158         evas_common_blend_init();
159         evas_common_image_init();
160         evas_common_convert_init();
161         evas_common_scale_init();
162         evas_common_rectangle_init();
163         evas_common_gradient_init();
164         evas_common_polygon_init();
165         evas_common_line_init();
166         evas_common_font_init();
167         evas_common_draw_init();
168         evas_common_tilebuf_init();
169         evas_common_soft16_image_init();
170
171         /* render engine specific data */
172         re = calloc(1, sizeof(Render_Engine));
173         if (!re)
174           return 0;
175         e->engine.data.output = re;
176
177         switch(info->info.backend)
178           {
179            case 1: /* FB */
180               re->backend = EVAS_ENGINE_WINCE_FB;
181               re->backend_priv = evas_software_wince_fb_init(info->info.window, info->info.width, info->info.height);
182               if (!re->backend_priv)
183                 {
184                    free(re);
185                    return 0;
186                 }
187               re->backend_shutdown = evas_software_wince_fb_shutdown;
188               re->backend_output_buffer_new = evas_software_wince_fb_output_buffer_new;
189               re->backend_output_buffer_free = evas_software_wince_fb_output_buffer_free;
190               re->backend_output_buffer_paste = evas_software_wince_fb_output_buffer_paste;
191               re->backend_surface_resize = evas_software_wince_fb_surface_resize;
192               break;
193            case 2: /* GAPI */
194               re->backend = EVAS_ENGINE_WINCE_GAPI;
195               re->backend_priv = evas_software_wince_gapi_init(info->info.window, info->info.width, info->info.height);
196               if (!re->backend_priv)
197                 {
198                    free(re);
199                    return 0;
200                 }
201               re->backend_shutdown = evas_software_wince_gapi_shutdown;
202               re->backend_output_buffer_new = evas_software_wince_gapi_output_buffer_new;
203               re->backend_output_buffer_free = evas_software_wince_gapi_output_buffer_free;
204               re->backend_output_buffer_paste = evas_software_wince_gapi_output_buffer_paste;
205               re->backend_surface_resize = evas_software_wince_gapi_surface_resize;
206               break;
207            case 3: /* DirectDraw */
208               re->backend = EVAS_ENGINE_WINCE_DDRAW;
209               re->backend_priv = evas_software_wince_ddraw_init(info->info.window, info->info.width, info->info.height);
210               if (!re->backend_priv)
211                 {
212                    free(re);
213                    return 0;
214                 }
215               re->backend_shutdown = evas_software_wince_ddraw_shutdown;
216               re->backend_output_buffer_new = evas_software_wince_ddraw_output_buffer_new;
217               re->backend_output_buffer_free = evas_software_wince_ddraw_output_buffer_free;
218               re->backend_output_buffer_paste = evas_software_wince_ddraw_output_buffer_paste;
219               re->backend_surface_resize = evas_software_wince_ddraw_surface_resize;
220               break;
221            case 4: /* GDI */
222               re->backend = EVAS_ENGINE_WINCE_GDI;
223               re->backend_priv = evas_software_wince_gdi_init(info->info.window, info->info.width, info->info.height, info->info.fullscreen);
224               if (!re->backend_priv)
225                 {
226                    free(re);
227                    return 0;
228                 }
229               re->backend_shutdown = evas_software_wince_gdi_shutdown;
230               re->backend_output_buffer_new = evas_software_wince_gdi_output_buffer_new;
231               re->backend_output_buffer_free = evas_software_wince_gdi_output_buffer_free;
232               re->backend_output_buffer_paste = evas_software_wince_gdi_output_buffer_paste;
233               re->backend_surface_resize = evas_software_wince_gdi_surface_resize;
234               break;
235            default:
236               free(re);
237               return 0;
238           }
239
240         re->width = e->output.w;
241         re->height = e->output.h;
242         re->rotation = info->info.rotation;
243         re->tb = evas_common_tilebuf_new(e->output.w, e->output.h);
244         if (re->tb)
245           evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
246      }
247    else
248      {
249         re = e->engine.data.output;
250         if (re->tb) evas_common_tilebuf_free(re->tb);
251
252         switch(info->info.backend)
253           {
254            case 1: /* FB */
255               re->backend = EVAS_ENGINE_WINCE_FB;
256               re->backend_priv = evas_software_wince_fb_init(info->info.window, info->info.width, info->info.height);
257               if (!re->backend_priv)
258                 {
259                    free(re);
260                    return 0;
261                 }
262               re->backend_shutdown = evas_software_wince_fb_shutdown;
263               re->backend_output_buffer_new = evas_software_wince_fb_output_buffer_new;
264               re->backend_output_buffer_free = evas_software_wince_fb_output_buffer_free;
265               re->backend_output_buffer_paste = evas_software_wince_fb_output_buffer_paste;
266               re->backend_surface_resize = evas_software_wince_fb_surface_resize;
267               break;
268            case 2: /* GAPI */
269               re->backend = EVAS_ENGINE_WINCE_GAPI;
270               re->backend_priv = evas_software_wince_gapi_init(info->info.window, info->info.width, info->info.height);
271               if (!re->backend_priv)
272                 {
273                    free(re);
274                    return 0;
275                 }
276               re->backend_shutdown = evas_software_wince_gapi_shutdown;
277               re->backend_output_buffer_new = evas_software_wince_gapi_output_buffer_new;
278               re->backend_output_buffer_free = evas_software_wince_gapi_output_buffer_free;
279               re->backend_output_buffer_paste = evas_software_wince_gapi_output_buffer_paste;
280               re->backend_surface_resize = evas_software_wince_gapi_surface_resize;
281               break;
282            case 3: /* DirectDraw */
283               re->backend = EVAS_ENGINE_WINCE_DDRAW;
284               re->backend_priv = evas_software_wince_ddraw_init(info->info.window, info->info.width, info->info.height);
285               if (!re->backend_priv)
286                 {
287                    free(re);
288                    return 0;
289                 }
290               re->backend_shutdown = evas_software_wince_ddraw_shutdown;
291               re->backend_output_buffer_new = evas_software_wince_ddraw_output_buffer_new;
292               re->backend_output_buffer_free = evas_software_wince_ddraw_output_buffer_free;
293               re->backend_output_buffer_paste = evas_software_wince_ddraw_output_buffer_paste;
294               re->backend_surface_resize = evas_software_wince_ddraw_surface_resize;
295               break;
296            case 4: /* GDI */
297               re->backend = EVAS_ENGINE_WINCE_GDI;
298               re->backend_priv = evas_software_wince_gdi_init(info->info.window, info->info.width, info->info.height, info->info.fullscreen);
299               if (!re->backend_priv)
300                 {
301                    free(re);
302                    return 0;
303                 }
304               re->backend_shutdown = evas_software_wince_gdi_shutdown;
305               re->backend_output_buffer_new = evas_software_wince_gdi_output_buffer_new;
306               re->backend_output_buffer_free = evas_software_wince_gdi_output_buffer_free;
307               re->backend_output_buffer_paste = evas_software_wince_gdi_output_buffer_paste;
308               re->backend_surface_resize = evas_software_wince_gdi_surface_resize;
309               break;
310            default:
311               free(re);
312               return 0;
313           }
314
315         re->width = e->output.w;
316         re->height = e->output.h;
317         re->rotation = info->info.rotation;
318         re->tb = evas_common_tilebuf_new(e->output.w, e->output.h);
319         if (re->tb)
320           evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
321         if (re->tmp_out)
322           {
323              evas_cache_image_drop(&re->tmp_out->cache_entry);
324              re->tmp_out = NULL;
325           }
326      }
327    if (!e->engine.data.output) return 0;
328    /* add a draw context if we dont have one */
329    if (!e->engine.data.context)
330      e->engine.data.context =
331      e->engine.func->context_new(e->engine.data.output);
332
333    return 1;
334 }
335
336 static void
337 eng_output_free(void *data)
338 {
339    Render_Engine *re;
340
341    re = (Render_Engine *)data;
342    if (re->fbob) re->backend_output_buffer_free(re->backend_priv);
343    re->backend_shutdown(re->backend_priv);
344    if (re->clip_rects) DeleteObject(re->clip_rects);
345    if (re->tb) evas_common_tilebuf_free(re->tb);
346    if (re->rects) evas_common_tilebuf_free_render_rects(re->rects);
347    if (re->tmp_out) evas_cache_image_drop(&re->tmp_out->cache_entry);
348    free(re);
349
350    evas_common_font_shutdown();
351    evas_common_image_shutdown();
352    evas_common_soft16_image_shutdown();
353 }
354
355 static void
356 eng_output_resize(void *data, int w, int h)
357 {
358    Render_Engine *re;
359
360    re = (Render_Engine *)data;
361
362    if ((re->width == w) && (re->height == h)) return;
363
364    /* FIXME: is it needed ?? */
365    if (re->fbob)
366      re->backend_surface_resize(re->fbob);
367
368    evas_common_tilebuf_free(re->tb);
369    re->width = w;
370    re->height = h;
371    re->tb = evas_common_tilebuf_new(w, h);
372    if (re->tb)
373      evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
374    if (re->fbob)
375      {
376         re->backend_output_buffer_free(re->fbob);
377         re->fbob = NULL;
378      }
379    if (re->clip_rects)
380      {
381         DeleteObject(re->clip_rects);
382         re->clip_rects = NULL;
383      }
384    if (re->tmp_out)
385      {
386         evas_cache_image_drop(&re->tmp_out->cache_entry);
387         re->tmp_out = NULL;
388      }
389 }
390
391 static void
392 eng_output_tile_size_set(void *data, int w, int h)
393 {
394    Render_Engine *re;
395
396    re = (Render_Engine *)data;
397    evas_common_tilebuf_set_tile_size(re->tb, w, h);
398 }
399
400 static void
401 eng_output_redraws_rect_add(void *data, int x, int y, int w, int h)
402 {
403    Render_Engine *re;
404
405    re = (Render_Engine *)data;
406    evas_common_tilebuf_add_redraw(re->tb, x, y, w, h);
407 }
408
409 static void
410 eng_output_redraws_rect_del(void *data, int x, int y, int w, int h)
411 {
412    Render_Engine *re;
413
414    re = (Render_Engine *)data;
415    evas_common_tilebuf_del_redraw(re->tb, x, y, w, h);
416 }
417
418 static void
419 eng_output_redraws_clear(void *data)
420 {
421    Render_Engine *re;
422
423    re = (Render_Engine *)data;
424    evas_common_tilebuf_clear(re->tb);
425 }
426
427 static inline void
428 _output_buffer_alloc(Render_Engine *re)
429 {
430    int width;
431    int height;
432
433    if (re->fbob) return;
434
435    if ((re->rotation == 0) || (re->rotation == 180))
436      {
437         width = re->width;
438         height = re->height;
439      }
440    else
441      {
442         width = re->height;
443         height = re->width;
444      }
445
446    re->fbob = re->backend_output_buffer_new(re->backend_priv,
447                                             width,
448                                             height);
449 }
450
451 static void *
452 eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch)
453 {
454    Render_Engine *re;
455    Tilebuf_Rect *rect;
456    int ux, uy, uw, uh;
457
458    re = (Render_Engine *)data;
459    if (re->end)
460      {
461         re->end = 0;
462         return NULL;
463      }
464    if (!re->rects)
465      {
466         re->rects = evas_common_tilebuf_get_render_rects(re->tb);
467         if (!re->rects) return NULL;
468
469         re->cur_rect = re->rects;
470         _output_buffer_alloc(re);
471         if (re->rotation != 0) _tmp_out_alloc(re); /* grows if required */
472      }
473    if (!re->cur_rect)
474      {
475         if (re->rects) evas_common_tilebuf_free_render_rects(re->rects);
476         re->rects = NULL;
477         return NULL;
478      }
479    rect = re->cur_rect;
480    ux = rect->x; uy = rect->y; uw = rect->w; uh = rect->h;
481    re->cur_rect = (Tilebuf_Rect *)((EINA_INLIST_GET(re->cur_rect))->next);
482    if (!re->cur_rect)
483      {
484         evas_common_tilebuf_free_render_rects(re->rects);
485         re->rects = NULL;
486         re->end = 1;
487      }
488
489    *x = ux; *y = uy; *w = uw; *h = uh;
490    if (re->rotation == 0)
491      {
492         *cx = ux; *cy = uy; *cw = uw; *ch = uh;
493         return re->fbob->im;
494      }
495    else
496      {
497         *cx = 0; *cy = 0; *cw = uw; *ch = uh;
498         return re->tmp_out;
499      }
500 }
501
502 static void
503 _blit_rot_90(Soft16_Image *dst, const Soft16_Image *src,
504              int out_x, int out_y, int w, int h)
505 {
506    DATA16 *dp, *sp;
507    int x, y;
508
509    sp = src->pixels;
510    dp = dst->pixels + (out_x +
511                        (w + out_y - 1) * dst->stride);
512
513    for (y = 0; y < h; y++)
514      {
515         DATA16 *dp_itr, *sp_itr;
516
517         sp_itr = sp;
518         dp_itr = dp;
519
520         for (x = 0; x < w; x++)
521           {
522              *dp_itr = *sp_itr;
523
524              sp_itr++;
525              dp_itr -= dst->stride;
526           }
527         sp += src->stride;
528         dp++;
529      }
530 }
531
532 static void
533 _blit_rot_180(Soft16_Image *dst, const Soft16_Image *src,
534               int out_x, int out_y, int w, int h)
535 {
536    DATA16 *dp, *sp;
537    int x, y;
538
539    sp = src->pixels;
540    dp = dst->pixels + ((w + out_x - 1) +
541                        (h + out_y - 1) * dst->stride);
542
543    for (y = 0; y < h; y++)
544      {
545         DATA16 *dp_itr, *sp_itr;
546
547         sp_itr = sp;
548         dp_itr = dp;
549
550         for (x = 0; x < w; x++)
551           {
552              *dp_itr = *sp_itr;
553
554              sp_itr++;
555              dp_itr--;
556           }
557         sp += src->stride;
558         dp -= dst->stride;
559      }
560 }
561
562 static void
563 _blit_rot_270(Soft16_Image *dst, const Soft16_Image *src,
564               int out_x, int out_y, int w, int h)
565 {
566    DATA16 *dp, *sp;
567    int x, y;
568
569    sp = src->pixels;
570    dp = dst->pixels + ((h + out_x - 1) +
571                        out_y * dst->stride);
572
573    for (y = 0; y < h; y++)
574      {
575         DATA16 *dp_itr, *sp_itr;
576
577         sp_itr = sp;
578         dp_itr = dp;
579
580         for (x = 0; x < w; x++)
581           {
582              *dp_itr = *sp_itr;
583
584              sp_itr++;
585              dp_itr += dst->stride;
586           }
587         sp += src->stride;
588         dp--;
589      }
590 }
591
592 static void
593 _tmp_out_process(Render_Engine *re, int out_x, int out_y, int w, int h)
594 {
595    Soft16_Image *d, *s;
596
597    d = re->fbob->im;
598    s = re->tmp_out;
599
600    if ((w < 1) || (h < 1) || (out_x >= d->cache_entry.w) || (out_y >= d->cache_entry.h))
601      return;
602
603    if (re->rotation == 90)
604      _blit_rot_90(d, s, out_x, out_y, w, h);
605    else if (re->rotation == 180)
606      _blit_rot_180(d, s, out_x, out_y, w, h);
607    else if (re->rotation == 270)
608      _blit_rot_270(d, s, out_x, out_y, w, h);
609 }
610
611 static void
612 eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int w, int h)
613 {
614    Render_Engine *re;
615    HRGN           region;
616    int            xx;
617    int            yy;
618    int            width;
619    int            height;
620
621    re = (Render_Engine *)data;
622
623    if (!re->clip_rects)
624       re->clip_rects = CreateRectRgn(0, 0, 0, 0);
625
626    if (re->rotation == 0)
627      {
628         xx = x;
629         yy = y;
630         width = w;
631         height = h;
632      }
633    else if (re->rotation == 90)
634      {
635         xx = y;
636         yy = re->width - w - x;
637         width = h;
638         height = w;
639      }
640    else if (re->rotation == 180)
641      {
642         xx = re->width - w - x;
643         yy = re->height - h - y;
644         width = w;
645         height = h;
646      }
647    else if (re->rotation == 270)
648      {
649         xx = re->height - h - y;
650         yy = x;
651         width = h;
652         height = w;
653      }
654
655    region = CreateRectRgn(xx, yy, xx + width, yy + height);
656
657    if (re->rotation != 0)
658      _tmp_out_process(re, xx, yy, w, h);
659    CombineRgn(re->clip_rects, re->clip_rects, region, RGN_OR);
660 }
661
662 static void
663 eng_output_flush(void *data)
664 {
665    Render_Engine *re;
666
667    re = (Render_Engine *)data;
668    if (re->clip_rects)
669      {
670         /* FIXME : i have to manage that */
671 /*      XSetRegion(re->disp, re->gc, re->clip_rects); */
672         DeleteObject(re->clip_rects);
673         re->clip_rects = NULL;
674      }
675    else return;
676
677    re->backend_output_buffer_paste(re->fbob);
678
679    /* FIXME : i have to manage that */
680 /*    XSetClipMask(re->disp, re->gc, None); */
681 }
682
683 static void
684 eng_output_idle_flush(void *data)
685 {
686    Render_Engine *re;
687
688    re = (Render_Engine *)data;
689    if (re->fbob)
690      {
691         re->backend_output_buffer_free(re->fbob);
692         re->fbob = NULL;
693      }
694    if (re->clip_rects)
695      {
696         DeleteObject(re->clip_rects);
697         re->clip_rects = NULL;
698      }
699    if (re->tmp_out)
700      {
701         evas_cache_image_drop(&re->tmp_out->cache_entry);
702         re->tmp_out = NULL;
703      }
704 }
705
706 static Eina_Bool
707 eng_canvas_alpha_get(void *data, void *context)
708 {
709    return EINA_FALSE;
710 }
711
712 /* module advertising code */
713 static int
714 module_open(Evas_Module *em)
715 {
716    if (!em) return 0;
717    /* get whatever engine module we inherit from */
718    if (!_evas_module_engine_inherit(&pfunc, "software_16")) return 0;
719    _evas_engine_soft16_wince_log_dom = eina_log_domain_register("EvasSoft16Wince", EVAS_DEFAULT_LOG_COLOR);
720    
721    if(_evas_engine_soft16_wince_log_dom < 0)
722      {
723         EINA_LOG_ERR("Impossible to create a log domain for the Soft16 Wince engine.");
724         return 0;
725      }
726
727    /* store it for later use */
728    func = pfunc;
729    /* now to override methods */
730 #define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
731    ORD(info);
732    ORD(info_free);
733    ORD(setup);
734    ORD(canvas_alpha_get);
735    ORD(output_free);
736    ORD(output_resize);
737    ORD(output_tile_size_set);
738    ORD(output_redraws_rect_add);
739    ORD(output_redraws_rect_del);
740    ORD(output_redraws_clear);
741    ORD(output_redraws_next_update_get);
742    ORD(output_redraws_next_update_push);
743    ORD(output_flush);
744    ORD(output_idle_flush);
745    /* now advertise out own api */
746    em->functions = (void *)(&func);
747    return 1;
748 }
749
750 static void
751 module_close(Evas_Module *em)
752 {
753   eina_log_domain_unregister(_evas_engine_soft16_wince_log_dom);
754 }
755
756 static Evas_Module_Api evas_modapi =
757 {
758    EVAS_MODULE_API_VERSION,
759    "software_16_wince",
760    "none",
761    {
762      module_open,
763      module_close
764    }
765 };
766
767 EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_ENGINE, engine, software_16_wince);
768
769 #ifndef EVAS_STATIC_BUILD_SOFTWARE_16_WINCE
770 EVAS_EINA_MODULE_DEFINE(engine, software_16_wince);
771 #endif