summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2014-08-22 00:47:19 +0200
committerCedric BAIL <cedric@osg.samsung.com>2014-08-22 18:28:59 +0200
commit281bbd90fdb3942922e931bcd7f364e9204a1488 (patch)
tree074a1b46d3b0c439d885a2f9ddc2c0773ff0b587
parentec0863e6ed1cab8c32e4f9e178614a62dd7d09be (diff)
move to use Ecore and Ecore_Evas.
-rw-r--r--configure.ac164
-rw-r--r--src/bin/Makefile.am106
-rw-r--r--src/bin/engine_direct3d.h20
-rw-r--r--src/bin/engine_directfb.c277
-rw-r--r--src/bin/engine_directfb.h8
-rw-r--r--src/bin/engine_drm.c49
-rw-r--r--src/bin/engine_drm.h8
-rw-r--r--src/bin/engine_fb.c42
-rw-r--r--src/bin/engine_fb.h8
-rw-r--r--src/bin/engine_gl_cocoa.h8
-rw-r--r--src/bin/engine_gl_sdl.c174
-rw-r--r--src/bin/engine_gl_sdl.h8
-rw-r--r--src/bin/engine_gl_x11.c223
-rw-r--r--src/bin/engine_gl_x11.h8
-rw-r--r--src/bin/engine_psl1ght.c284
-rw-r--r--src/bin/engine_psl1ght.h8
-rw-r--r--src/bin/engine_software_16_wince.c324
-rw-r--r--src/bin/engine_software_16_wince.h10
-rw-r--r--src/bin/engine_software_ddraw.h19
-rw-r--r--src/bin/engine_software_gdi.c293
-rw-r--r--src/bin/engine_software_gdi.h19
-rw-r--r--src/bin/engine_software_sdl.c242
-rw-r--r--src/bin/engine_software_sdl.h8
-rw-r--r--src/bin/engine_software_xcb.c399
-rw-r--r--src/bin/engine_software_xcb.h8
-rw-r--r--src/bin/engine_software_xlib.c236
-rw-r--r--src/bin/engine_software_xlib.h8
-rw-r--r--src/bin/engine_wayland_common.c152
-rw-r--r--src/bin/engine_wayland_common.h10
-rw-r--r--src/bin/engine_wayland_egl.c112
-rw-r--r--src/bin/engine_wayland_egl.h8
-rw-r--r--src/bin/engine_wayland_shm.c126
-rw-r--r--src/bin/engine_wayland_shm.h8
-rw-r--r--src/bin/engine_xrender_x11.c221
-rw-r--r--src/bin/engine_xrender_x11.h8
-rw-r--r--src/bin/engine_xrender_xcb.c405
-rw-r--r--src/bin/engine_xrender_xcb.h8
-rw-r--r--src/bin/image_data_argb.c2
-rw-r--r--src/bin/image_data_argb_alpha.c2
-rw-r--r--src/bin/image_data_ycbcr601pl.c2
-rw-r--r--src/bin/image_data_ycbcr601pl_map_solid_rotate.c2
-rw-r--r--src/bin/image_map_3d_1.c2
-rw-r--r--src/bin/image_map_3d_2.c2
-rw-r--r--src/bin/image_map_3d_3.c2
-rw-r--r--src/bin/image_map_3d_4.c2
-rw-r--r--src/bin/image_map_3d_5.c2
-rw-r--r--src/bin/image_map_3d_6.c2
-rw-r--r--src/bin/image_map_3d_flow.c2
-rw-r--r--src/bin/image_map_color_alpha_nearest_rotate.c2
-rw-r--r--src/bin/image_map_color_alpha_nearest_solid_rotate.c2
-rw-r--r--src/bin/image_map_color_alpha_rotate.c2
-rw-r--r--src/bin/image_map_color_alpha_solid_rotate.c2
-rw-r--r--src/bin/image_map_color_nearest_rotate.c2
-rw-r--r--src/bin/image_map_color_nearest_solid_rotate.c2
-rw-r--r--src/bin/image_map_color_rotate.c2
-rw-r--r--src/bin/image_map_color_solid_rotate.c2
-rw-r--r--src/bin/image_map_nearest_rotate.c2
-rw-r--r--src/bin/image_map_nearest_solid_rotate.c2
-rw-r--r--src/bin/image_map_rotate.c2
-rw-r--r--src/bin/image_map_solid_rotate.c2
-rw-r--r--src/bin/main.c412
-rw-r--r--src/bin/main.h62
-rw-r--r--src/bin/ui.c797
-rw-r--r--src/bin/ui.h19
64 files changed, 524 insertions, 4831 deletions
diff --git a/configure.ac b/configure.ac
index 43b52a8..bccd4ce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,86 +16,6 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
16PKG_PROG_PKG_CONFIG 16PKG_PROG_PKG_CONFIG
17 17
18 18
19### Additional options to configure
20
21## Simple X11 build/link
22
23## Evas engines
24
25AC_ARG_ENABLE(simple-x11,
26 [AC_HELP_STRING([--enable-simple-x11], [enable simple x11 linking])],
27 [want_evas_simple_x11=$enableval]
28)
29
30# Software X11
31have_software_xlib="no"
32have_software_xcb="no"
33EXPEDITE_CHECK_ENGINE([software-x11], [Software X11], "yes")
34
35if test "x${have_software_x11}" = "xyes" ; then
36 have_software_xlib=`${PKG_CONFIG} --variable=Xlib evas-software-x11`
37 if test "x${have_software_xlib}" = "xstatic" ; then
38 have_software_xlib="yes"
39 fi
40 if test "x${have_software_xlib}" = "xyes" ; then
41 AC_DEFINE(HAVE_EVAS_SOFTWARE_XLIB, 1, [Evas Software Xlib Engine Support])
42 fi
43 have_software_xcb=`${PKG_CONFIG} --variable=XCB evas-software-x11`
44 if test "x${have_software_xcb}" = "xstatic" ; then
45 have_software_xcb="yes"
46 fi
47 if test "x${have_software_xcb}" = "xyes" ; then
48 AC_DEFINE(HAVE_EVAS_SOFTWARE_XCB, 1, [Evas Software XCB Engine Support])
49 fi
50fi
51
52AM_CONDITIONAL([BUILD_SOFTWARE_XLIB], [test "x${have_software_xlib}" = "xyes"])
53AM_CONDITIONAL([BUILD_SOFTWARE_XCB], [test "x${have_software_xcb}" = "xyes"])
54
55# XRender X11
56EXPEDITE_CHECK_ENGINE([xrender-x11], [XRender X11], "yes")
57
58# OpenGL X11
59EXPEDITE_CHECK_ENGINE([opengl-x11], [OpenGL X11], "yes")
60
61# XRender XCB
62EXPEDITE_CHECK_ENGINE([xrender-xcb], [XRender XCB], "yes")
63
64# GDI
65EXPEDITE_CHECK_ENGINE([software-gdi], [Software GDI], "yes", [gdi_libs="-lgdi32"])
66AC_SUBST(gdi_libs)
67
68# DirectDraw
69EXPEDITE_CHECK_ENGINE([software-ddraw], [Software DirectDraw], "yes", [ddraw_libs="-lddraw -ldxguid -lgdi32"])
70AC_SUBST(ddraw_libs)
71
72# Direct3D
73EXPEDITE_CHECK_ENGINE([direct3d], [Direct3D], "yes", [d3d_libs="-ld3d9 -ld3dx9d -lgdi32"])
74AC_SUBST(d3d_libs)
75
76# PSL1GHT
77EXPEDITE_CHECK_ENGINE([psl1ght], [PSL1GHT], "yes")
78
79# GL SDL
80EXPEDITE_CHECK_ENGINE([opengl-sdl], [OpenGL SDL], "yes")
81
82# FB
83EXPEDITE_CHECK_ENGINE([fb], [Framebuffer], "yes")
84
85# DIRECTFB
86EXPEDITE_CHECK_ENGINE([directfb], [DirectFB], "yes")
87
88# GL Cocoa
89EXPEDITE_CHECK_ENGINE([opengl-cocoa], [OpenGL Cocoa], "yes", [gl_cocoa_libs="-framework Cocoa"])
90AC_SUBST(gl_cocoa_libs)
91
92# 16bit WinCE
93EXPEDITE_CHECK_ENGINE([software-16-wince], [Software 16 bits WinCE], "yes", [wince_16_libs="-laygshell"])
94AC_SUBST(wince_16_libs)
95
96# DRM
97EXPEDITE_CHECK_ENGINE([drm], [Drm], "no")
98
99### Checks for programs 19### Checks for programs
100 20
101AC_ISC_POSIX 21AC_ISC_POSIX
@@ -128,74 +48,13 @@ case "$host_os" in
128 ;; 48 ;;
129esac 49esac
130 50
131# Eina 51# EFL dependencies
132 52
133PKG_CHECK_MODULES([EINA], eina >= 1.7.99 eo >= 1.7.99) 53PKG_CHECK_MODULES([EFL], eina >= 1.7.99 eo >= 1.7.99 evas >= 1.7.99 eet >= 1.7.99 ecore-evas >= 1.7.99 ecore >= 1.7.99)
134 54
135EFL_ENABLE_EO_API_SUPPORT 55EFL_ENABLE_EO_API_SUPPORT
136EFL_ENABLE_BETA_API_SUPPORT 56EFL_ENABLE_BETA_API_SUPPORT
137 57
138# Evas
139
140PKG_CHECK_MODULES([EVAS], evas >= 1.7.99 eet >= 1.7.99)
141
142# Xlib
143
144if test "x$have_software_xlib" = "xyes" -o "x$have_xrender_x11" = "xyes" -o "x$have_opengl_x11" = "xyes"; then
145 AC_PATH_XTRA
146 AC_CHECK_HEADERS([X11/Xlib.h X11/Xutil.h],
147 [have_xlib="yes"],
148 [have_xlib="no"])
149 if test "x$want_evas_simple_x11" = "xyes"; then
150 x_libs="${x_libs} -lX11"
151 else
152 x_dir=${x_dir:-/usr/X11R6}
153 x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
154 x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11"
155 fi
156fi
157AM_CONDITIONAL(BUILD_X11, [test "x$have_xlib" = "xyes"])
158
159AC_SUBST(x_cflags)
160AC_SUBST(x_libs)
161
162# XCB
163
164if test "x$have_software_xcb" = "xyes"; then
165 PKG_CHECK_MODULES([XCB], [xcb xcb-keysyms], [have_xcb="yes"], [have_xcb="no"])
166fi
167AM_CONDITIONAL(BUILD_XCB, test "x$have_xcb" = "xyes")
168if test "x$have_xcb" = "xyes"; then
169 AC_DEFINE(BUILD_XCB, 1, [build xcb support])
170fi
171
172# SDL
173
174PKG_CHECK_MODULES([SDL], [sdl], [have_sdl="yes"], [have_sdl="no"])
175AM_CONDITIONAL(BUILD_SDL, test "x$have_sdl" = "xyes")
176if test "x$have_sdl" = "xyes"; then
177 AC_DEFINE(BUILD_SDL, 1, [build sdl support])
178fi
179
180# PSL1GHT
181AM_CONDITIONAL(BUILD_PSL1GHT, test "x$have_psl1ght" = "xyes")
182
183# DirectFB
184
185if test "x$have_directfb" = "xyes"; then
186 PKG_CHECK_MODULES([DIRECTFB], [directfb], [have_directfb="yes"], [have_directfb="no"])
187fi
188AM_CONDITIONAL(BUILD_DIRECTFB, test "x$have_directfb" = "xyes")
189
190# Wayland
191EXPEDITE_CHECK_ENGINE([wayland-shm], [Wayland SHM], "no")
192EXPEDITE_CHECK_ENGINE([wayland-egl], [Wayland EGL], "no")
193
194have_wl="no"
195if test "x$have_wayland_shm" = "xyes" -o "x$have_wayland_egl" = "xyes"; then
196 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client], [have_wl="yes"], [have_wl="no"])
197fi
198AM_CONDITIONAL(BUILD_WAYLAND, test "x$have_wl" = "xyes")
199 58
200### Checks for header files 59### Checks for header files
201 60
@@ -266,25 +125,6 @@ data/Makefile
266echo 125echo
267echo " $PACKAGE $VERSION" 126echo " $PACKAGE $VERSION"
268echo 127echo
269echo " Engines:"
270echo " Software X11.................: ${have_software_x11} (Xlib: ${have_software_xlib}) (XCB: ${have_software_xcb})"
271echo " X Render X11.................: ${have_xrender_x11}"
272echo " Open GL X11..................: ${have_opengl_x11}"
273echo " X Render XCB.................: ${have_xrender_xcb}"
274echo " Software GDI.................: ${have_software_gdi}"
275echo " Software DirectDraw..........: ${have_software_ddraw}"
276echo " Direct3D.....................: ${have_direct3d}"
277echo " Software SDL.................: ${have_software_sdl}"
278echo " Open GL SDL..................: ${have_opengl_sdl}"
279echo " Open GL Cocoa................: ${have_opengl_cocoa}"
280echo " FB...........................: ${have_fb}"
281echo " DirectFB.....................: ${have_directfb}"
282echo " PSL1GHT......................: ${have_psl1ght}"
283echo " Software WinCE 16 bits.......: ${have_software_16_wince}"
284echo " Wayland EGL..................: ${have_wayland_egl}"
285echo " Wayland SHM..................: ${have_wayland_shm}"
286echo " DRM..........................: ${have_drm}"
287echo
288echo " Installation:" 128echo " Installation:"
289echo " prefix.......................: ${prefix}" 129echo " prefix.......................: ${prefix}"
290echo 130echo
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 4d93ab7..68680ab 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -6,12 +6,7 @@ AM_CPPFLAGS = \
6-DPACKAGE_BIN_DIR=\"$(bindir)\" \ 6-DPACKAGE_BIN_DIR=\"$(bindir)\" \
7-DPACKAGE_LIB_DIR=\"$(libdir)\" \ 7-DPACKAGE_LIB_DIR=\"$(libdir)\" \
8-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ 8-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
9@EINA_CFLAGS@ \ 9@EFL_CFLAGS@ \
10@EVAS_CFLAGS@ \
11@x_cflags@ \
12@SDL_CFLAGS@ \
13@DIRECTFB_CFLAGS@ \
14@XCB_CFLAGS@ \
15@EVIL_CFLAGS@ 10@EVIL_CFLAGS@
16 11
17bin_PROGRAMS = expedite 12bin_PROGRAMS = expedite
@@ -134,106 +129,11 @@ font_effect_blur_color.c
134# image_mask_14.c \ 129# image_mask_14.c \
135# image_mask_15.c 130# image_mask_15.c
136 131
137expedite_CFLAGS = @WIN32_CFLAGS@ @WAYLAND_CLIENT_CFLAGS@ 132expedite_CFLAGS = @WIN32_CFLAGS@
138expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@ 133expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@
139expedite_LDADD = @SDL_LIBS@ @x_libs@ @gdi_libs@ @ddraw_libs@ @d3d_libs@ @wince_16_libs@ @DIRECTFB_LIBS@ @XCB_LIBS@ @EVAS_LIBS@ @EINA_LIBS@ @EVIL_LIBS@ @gl_cocoa_libs@ @WAYLAND_CLIENT_LIBS@ -lm 134expedite_LDADD = @EFL_LIBS@ @EVIL_LIBS@ -lm
140expedite_LDFLAGS = @lt_enable_auto_import@ 135expedite_LDFLAGS = @lt_enable_auto_import@
141 136
142if BUILD_SOFTWARE_XLIB
143expedite_SOURCES += \
144engine_software_xlib.c engine_software_xlib.h
145endif
146
147if BUILD_XRENDER_X11
148expedite_SOURCES += \
149engine_xrender_x11.c engine_xrender_x11.h
150endif
151
152if BUILD_OPENGL_X11
153expedite_SOURCES += \
154engine_gl_x11.c engine_gl_x11.h
155endif
156
157if BUILD_SOFTWARE_XCB
158expedite_SOURCES += \
159engine_software_xcb.c engine_software_xcb.h
160endif
161
162if BUILD_XRENDER_XCB
163expedite_SOURCES += \
164engine_xrender_xcb.c engine_xrender_xcb.h
165endif
166
167if BUILD_SOFTWARE_GDI
168expedite_SOURCES += \
169engine_software_gdi.c engine_software_gdi.h
170endif
171
172if BUILD_SOFTWARE_DDRAW
173expedite_SOURCES += \
174engine_software_ddraw.cpp engine_software_ddraw.h
175endif
176
177if BUILD_DIRECT3D
178expedite_SOURCES += \
179engine_direct3d.cpp engine_direct3d.h
180endif
181
182if BUILD_SDL
183expedite_SOURCES += \
184engine_software_sdl.c engine_software_sdl.h
185endif
186
187if BUILD_OPENGL_SDL
188expedite_SOURCES += \
189engine_gl_sdl.c engine_gl_sdl.h
190endif
191
192if BUILD_PSL1GHT
193expedite_SOURCES += \
194engine_psl1ght.c
195endif
196
197if BUILD_FB
198expedite_SOURCES += \
199engine_fb.c engine_fb.h
200endif
201
202if BUILD_DIRECTFB
203expedite_SOURCES += \
204engine_directfb.c engine_directfb.h
205endif
206
207if BUILD_OPENGL_COCOA
208expedite_SOURCES += \
209engine_gl_cocoa.m engine_gl_cocoa.h
210endif
211
212if BUILD_SOFTWARE_16_WINCE
213expedite_SOURCES += \
214engine_software_16_wince.c engine_software_16_wince.h engine_software_16_wince.rc
215endif
216
217if BUILD_WAYLAND
218expedite_SOURCES += \
219engine_wayland_common.c engine_wayland_common.h
220endif
221
222if BUILD_WAYLAND_EGL
223expedite_SOURCES += \
224engine_wayland_egl.c engine_wayland_egl.h
225endif
226
227if BUILD_WAYLAND_SHM
228expedite_SOURCES += \
229engine_wayland_shm.c engine_wayland_shm.h
230endif
231
232if BUILD_DRM
233expedite_SOURCES += \
234engine_drm.c engine_drm.h
235endif
236
237.rc.lo: 137.rc.lo:
238 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) $< -o $@ 138 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) $< -o $@
239 139
diff --git a/src/bin/engine_direct3d.h b/src/bin/engine_direct3d.h
deleted file mode 100644
index 2fa3bd1..0000000
--- a/src/bin/engine_direct3d.h
+++ /dev/null
@@ -1,20 +0,0 @@
1#ifndef __ENGINE_DIRECT3D_H__
2#define __ENGINE_DIRECT3D_H__
3
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9
10Eina_Bool engine_direct3d_args(const char *engine, int width, int height);
11void engine_direct3d_loop(void);
12void engine_direct3d_shutdown(void);
13
14
15#ifdef __cplusplus
16}
17#endif
18
19
20#endif /* __ENGINE_DIRECT3D_H__ */
diff --git a/src/bin/engine_directfb.c b/src/bin/engine_directfb.c
deleted file mode 100644
index acbc6f8..0000000
--- a/src/bin/engine_directfb.c
+++ /dev/null
@@ -1,277 +0,0 @@
1#include "main.h"
2
3#include <Evas_Engine_DirectFB.h>
4
5static IDirectFB *_dfb;
6static IDirectFBEventBuffer *_window_event;
7static IDirectFBEventBuffer *_input_event;
8static IDirectFBDisplayLayer *_layer;
9static DFBResult _err;
10static IDirectFBWindow *_dfb_window;
11static IDirectFBSurface *_dfb_surface;
12
13#define DBG(...) do {} while (0)
14//#define DBG(...) fprintf(stderr, __VA_ARGS__)
15
16#define DFBCHECK(x...) \
17 { \
18 _err = x; \
19 if (_err != DFB_OK) { \
20 fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
21 DirectFBErrorFatal( #x, _err ); \
22 } \
23 }
24
25Eina_Bool
26engine_directfb_args(const char *engine, int width, int height)
27{
28 Evas_Engine_Info_DirectFB *einfo;
29 DFBWindowDescription desc;
30 int i;
31
32 evas_output_method_set(evas, evas_render_method_lookup("directfb"));
33 einfo = (Evas_Engine_Info_DirectFB *)evas_engine_info_get(evas);
34 if (!einfo)
35 {
36 printf("Evas does not support the DirectFB Engine\n");
37 return EINA_FALSE;
38 }
39
40 DFBCHECK(DirectFBInit(NULL, NULL));
41 DFBCHECK(DirectFBCreate(&_dfb));
42 DFBCHECK(_dfb->GetDisplayLayer(_dfb, DLID_PRIMARY, &_layer));
43 DFBCHECK(_dfb->CreateEventBuffer(_dfb, &_window_event));
44 DFBCHECK(_dfb->CreateInputEventBuffer(_dfb, DICAPS_ALL, DFB_FALSE, &_input_event));
45
46 memset(&desc, 0, sizeof(DFBWindowDescription));
47 desc.flags = (DWDESC_POSX | DWDESC_POSY | DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_PIXELFORMAT);
48 desc.posx = 0;
49 desc.posy = 0;
50 desc.width = width;
51 desc.height = height;
52 desc.pixelformat = DSPF_ARGB;
53
54 DFBCHECK(_layer->CreateWindow(_layer, &desc, &_dfb_window));
55 DFBCHECK(_dfb_window->AttachEventBuffer(_dfb_window, _window_event));
56 DFBCHECK(_dfb_window->SetOptions(_dfb_window, DWOP_NONE));
57 DFBCHECK(_dfb_window->SetOpacity(_dfb_window, 0xFF));
58 DFBCHECK(_dfb_window->GetSurface(_dfb_window, &_dfb_surface));
59 DFBCHECK(_dfb_surface->SetPorterDuff(_dfb_surface, DSPD_SRC_OVER));
60
61 einfo->info.dfb = _dfb;
62 einfo->info.surface = _dfb_surface;
63 if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
64 {
65 printf("Evas can not setup the informations of the DirectFB Engine\n");
66 return EINA_FALSE;
67 }
68
69 return EINA_TRUE;
70}
71
72static void
73engine_directfb_quit(void)
74{
75 DFBCHECK(_input_event->Release(_input_event));
76 DFBCHECK(_window_event->Release(_window_event));
77 DFBCHECK(_dfb_surface->Release(_dfb_surface));
78 DFBCHECK(_dfb_window->Release(_dfb_window));
79 DFBCHECK(_layer->Release(_layer));
80 DFBCHECK(_dfb->Release(_dfb));
81
82 evas_engine_info_set(evas, NULL);
83
84 engine_abort();
85}
86
87static const char *
88key_string(DFBInputDeviceKeySymbol sym)
89{
90 switch (sym)
91 {
92 case DIKS_ESCAPE:
93 {
94 static const char k[] = "Escape";
95 return k;
96 }
97 case DIKS_RETURN:
98 {
99 static const char k[] = "Return";
100 return k;
101 }
102 case DIKS_CURSOR_LEFT:
103 {
104 static const char k[] = "Left";
105 return k;
106 }
107 case DIKS_CURSOR_RIGHT:
108 {
109 static const char k[] = "Right";
110 return k;
111 }
112 default:
113 {
114 static char k[2];
115 k[0] = (char)sym;
116 k[1] = 0;
117 return k;
118 }
119 }
120}
121
122static void
123engine_directfb_event_window(const DFBWindowEvent *ev)
124{
125 DBG("===> Window Event (type=%#10x, window=%d) <===\n",
126 ev->type, ev->window_id);
127
128 if (ev->type & DWET_POSITION)
129 {
130 DBG("\tDWET_POSITION %d, %d\n", ev->x, ev->y);
131 }
132
133 if (ev->type & DWET_SIZE)
134 {
135 DBG("\tDWET_SIZE %dx%d\n", ev->w, ev->h);
136 evas_output_viewport_set(evas, 0, 0,
137 ev->w, ev->h);
138 evas_output_size_set(evas, ev->w, ev->h);
139 win_w = ev->w;
140 win_h = ev->h;
141 }
142
143 if (ev->type & DWET_CLOSE)
144 {
145 DBG("\tDWET_CLOSE\n");
146 engine_directfb_quit();
147 }
148
149 if (ev->type & DWET_DESTROYED)
150 {
151 DBG("\tDWET_DESTROYED\n");
152 engine_directfb_quit();
153 }
154
155 if (ev->type & DWET_GOTFOCUS)
156 {
157 DBG("\tDWET_GOTFOCUS\n");
158 }
159
160 if (ev->type & DWET_LOSTFOCUS)
161 {
162 DBG("\tDWET_LOSTFOCUS\n");
163 }
164
165 if (ev->type & DWET_KEYDOWN)
166 {
167 const char *k;
168
169 k = key_string(ev->key_symbol);
170 DBG("\tDWET_KEYDOWN key_symbol=%s\n", k);
171
172 if (k)
173 evas_event_feed_key_down(evas, k, k, NULL, NULL, 0, NULL);
174 }
175
176 if (ev->type & DWET_KEYUP)
177 {
178 const char *k;
179
180 k = key_string(ev->key_symbol);
181 DBG("\tDWET_KEYUP key_symbol=%s\n", k);
182
183 if (k)
184 evas_event_feed_key_up(evas, k, k, NULL, NULL, 0, NULL);
185 }
186
187 if (ev->type & DWET_BUTTONDOWN)
188 {
189 DBG("\tDWET_BUTTONDOWN pos=(%d, %d) cur_pos=(%d, %d) "
190 "button=%#x buttons=%#x\n",
191 ev->x, ev->y, ev->cx, ev->cy, ev->button, ev->buttons);
192 evas_event_feed_mouse_move(evas, ev->cx, ev->cy, 0, NULL);
193 evas_event_feed_mouse_down(evas, ev->button, EVAS_BUTTON_NONE, 0, NULL);
194 }
195
196 if (ev->type & DWET_BUTTONUP)
197 {
198 DBG("\tDWET_BUTTONUP pos=(%d, %d) cur_pos=(%d, %d) "
199 "button=%#x buttons=%#x\n",
200 ev->x, ev->y, ev->cx, ev->cy, ev->button, ev->buttons);
201 evas_event_feed_mouse_move(evas, ev->cx, ev->cy, 0, NULL);
202 evas_event_feed_mouse_up(evas, ev->button, EVAS_BUTTON_NONE, 0, NULL);
203 }
204
205 if (ev->type & DWET_MOTION)
206 {
207 DBG("\tDWET_MOTION pos=(%d, %d) cur_pos=(%d, %d) buttons=%#x\n",
208 ev->x, ev->y, ev->cx, ev->cy, ev->buttons);
209 /* Mouse Motion Compression [tm] */
210 _layer->GetCursorPosition( _layer, (int*)&ev->x, (int*)&ev->y );
211
212 evas_event_feed_mouse_move(evas, ev->x, ev->y, 0, NULL);
213 }
214
215 if (ev->type & DWET_LEAVE)
216 {
217 DBG("\tDWET_LEAVE pos=(%d, %d) cur_pos=(%d, %d)\n",
218 ev->x, ev->y, ev->cx, ev->cy);
219 evas_event_feed_mouse_out(evas, 0, NULL);
220 }
221
222 if (ev->type & DWET_ENTER)
223 {
224 DBG("\tDWET_ENTER pos=(%d, %d) cur_pos=(%d, %d)\n",
225 ev->x, ev->y, ev->cx, ev->cy);
226 evas_event_feed_mouse_in(evas, 0, NULL);
227 }
228
229 if (ev->type & DWET_WHEEL)
230 {
231 DBG("\tDWET_WHEEL step=%d\n", ev->step);
232 }
233
234
235 DBG("\n");
236}
237
238void
239engine_directfb_loop(void)
240{
241 DFBEvent ev;
242
243 while ((_input_event->GetEvent(_input_event, &ev) == DFB_OK) ||
244 (_window_event->GetEvent(_window_event, &ev) == DFB_OK))
245 {
246 DBG("got dfb input event %d\n", ev.clazz);
247 switch (ev.clazz)
248 {
249 case DFEC_NONE:
250 DBG("No event?\n");
251 break;
252 case DFEC_INPUT:
253 DBG("Input\n");
254 break;
255 case DFEC_WINDOW:
256 engine_directfb_event_window((const DFBWindowEvent *)&ev);
257 break;
258 case DFEC_USER:
259 DBG("User\n");
260 break;
261 case DFEC_UNIVERSAL:
262 DBG("Universal\n");
263 break;
264 }
265 }
266}
267
268void
269engine_directfb_shutdown(void)
270{
271 DFBCHECK(_input_event->Release(_input_event));
272 DFBCHECK(_window_event->Release(_window_event));
273 DFBCHECK(_dfb_surface->Release(_dfb_surface));
274 DFBCHECK(_dfb_window->Release(_dfb_window));
275 DFBCHECK(_layer->Release(_layer));
276 DFBCHECK(_dfb->Release(_dfb));
277}
diff --git a/src/bin/engine_directfb.h b/src/bin/engine_directfb.h
deleted file mode 100644
index 7f22382..0000000
--- a/src/bin/engine_directfb.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef ENGINE_DIRECTFB_H
2#define ENGINE_DIRECTFB_H
3
4Eina_Bool engine_directfb_args(const char *engine, int width, int height);
5void engine_directfb_loop(void);
6void engine_directfb_shutdown(void);
7
8#endif
diff --git a/src/bin/engine_drm.c b/src/bin/engine_drm.c
deleted file mode 100644
index 4fa6a7e..0000000
--- a/src/bin/engine_drm.c
+++ /dev/null
@@ -1,49 +0,0 @@
1#include "main.h"
2
3#include <Evas_Engine_Drm.h>
4
5Eina_Bool
6engine_drm_args(const char *engine __UNUSED__, int width __UNUSED__, int height __UNUSED__)
7{
8 Evas_Engine_Info_Drm *einfo;
9
10 evas_output_method_set(evas, evas_render_method_lookup("drm"));
11 einfo = (Evas_Engine_Info_Drm *)evas_engine_info_get(evas);
12 if (!einfo)
13 {
14 printf("Evas does not support the Drm Engine\n");
15 return EINA_FALSE;
16 }
17
18 /* setup drm props in such a way so that evas itself will handle doing
19 * the drm card init, etc, etc because we are not using ecore_evas here */
20 einfo->info.fd = -1;
21 einfo->info.tty = -1;
22 einfo->info.output = -1;
23 einfo->info.plane = -1;
24 einfo->info.rotation = 0;
25 einfo->info.depth = 32;
26 einfo->info.destination_alpha = EINA_FALSE;
27 einfo->info.vsync = EINA_FALSE;
28 einfo->info.use_hw_accel = EINA_TRUE;
29
30 if (!evas_engine_info_set(evas, (Evas_Engine_Info *)einfo))
31 {
32 printf("Evas could not setup the information for the Drm Engine\n");
33 return EINA_FALSE;
34 }
35
36 return EINA_TRUE;
37}
38
39void
40engine_drm_loop(void)
41{
42
43}
44
45void
46engine_drm_shutdown(void)
47{
48
49}
diff --git a/src/bin/engine_drm.h b/src/bin/engine_drm.h
deleted file mode 100644
index a031a9b..0000000
--- a/src/bin/engine_drm.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef ENGINE_DRM_H
2#define ENGINE_DRM_H
3
4Eina_Bool engine_drm_args(const char *engine, int width, int height);
5void engine_drm_loop(void);
6void engine_drm_shutdown(void);
7
8#endif
diff --git a/src/bin/engine_fb.c b/src/bin/engine_fb.c
deleted file mode 100644
index 863487a..0000000
--- a/src/bin/engine_fb.c
+++ /dev/null
@@ -1,42 +0,0 @@
1#include "main.h"
2
3#include <Evas_Engine_FB.h>
4
5Eina_Bool
6engine_fb_args(const char *engine __UNUSED__, int width __UNUSED__, int height __UNUSED__)
7{
8 Evas_Engine_Info_FB *einfo;
9
10 evas_output_method_set(evas, evas_render_method_lookup("fb"));
11 einfo = (Evas_Engine_Info_FB *)evas_engine_info_get(evas);
12 if (!einfo)
13 {
14 printf("Evas does not support the FB Engine\n");
15 return EINA_FALSE;
16 }
17
18 einfo->info.virtual_terminal = 0;
19 einfo->info.device_number = 0;
20 einfo->info.device_number = 0;
21 einfo->info.refresh = 0;
22 einfo->info.rotation = 0;
23 if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
24 {
25 printf("Evas can not setup the informations of the FB Engine\n");
26 return EINA_FALSE;
27 }
28
29 return EINA_TRUE;
30}
31
32void
33engine_fb_loop(void)
34{
35 return;
36}
37
38void
39engine_fb_shutdown(void)
40{
41 return;
42}
diff --git a/src/bin/engine_fb.h b/src/bin/engine_fb.h
deleted file mode 100644
index 288208f..0000000
--- a/src/bin/engine_fb.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef ENGINE_FB_H
2#define ENGINE_FB_H
3
4Eina_Bool engine_fb_args(const char *engine, int width, int height);
5void engine_fb_loop(void);
6void engine_fb_shutdown(void);
7
8#endif
diff --git a/src/bin/engine_gl_cocoa.h b/src/bin/engine_gl_cocoa.h
deleted file mode 100644
index 77430c9..0000000
--- a/src/bin/engine_gl_cocoa.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef ENGINE_GL_COCOA_H
2#define ENGINE_GL_COCOA_H
3
4int engine_gl_cocoa_args(int argc, char **argv);
5void engine_gl_cocoa_loop(void);
6void engine_gl_cocoa_shutdown(void);
7
8#endif
diff --git a/src/bin/engine_gl_sdl.c b/src/bin/engine_gl_sdl.c
deleted file mode 100644
index c30a008..0000000
--- a/src/bin/engine_gl_sdl.c
+++ /dev/null
@@ -1,174 +0,0 @@
1#include <assert.h>
2#include "main.h"
3
4#include <Evas_Engine_GL_SDL.h>
5
6Eina_Bool
7engine_gl_sdl_args(const char *engine, int width, int height)
8{
9 Evas_Engine_Info_GL_SDL *einfo;
10 int i;
11
12 evas_output_method_set(evas, evas_render_method_lookup("gl_sdl"));
13
14 einfo = (Evas_Engine_Info_GL_SDL *) evas_engine_info_get(evas);
15 if (!einfo)
16 {
17 printf("Evas wasn't build with GL SDL backend.\n");
18 return EINA_FALSE;
19 }
20
21 /* the following is specific to the engine */
22 einfo->flags.fullscreen = fullscreen;
23 einfo->flags.noframe = 0;
24
25 if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
26 {
27 printf("Evas could not initialize the GL SDL Engine\n");
28 return EINA_FALSE;
29 }
30
31 return EINA_TRUE;
32}
33
34void
35engine_gl_sdl_loop(void)
36{
37 SDL_Event event;
38
39 while(SDL_PollEvent(&event))
40 {
41 switch(event.type)
42 {
43 case SDL_MOUSEMOTION:
44 evas_event_feed_mouse_move(evas, event.motion.x, event.motion.y, 0, NULL);
45 break;
46 case SDL_MOUSEBUTTONDOWN:
47 evas_event_feed_mouse_move(evas, event.button.x, event.button.y, 0, NULL);
48 evas_event_feed_mouse_down(evas, event.button.button, EVAS_BUTTON_NONE, 0, NULL);
49 break;
50 case SDL_MOUSEBUTTONUP:
51 evas_event_feed_mouse_move(evas, event.button.x, event.button.y, 0, NULL);
52 evas_event_feed_mouse_up(evas, event.button.button, EVAS_BUTTON_NONE, 0, NULL);
53 break;
54 case SDL_VIDEORESIZE:
55 evas_output_viewport_set(evas, 0, 0,
56 event.resize.w, event.resize.w);
57 evas_output_size_set(evas, event.resize.w, event.resize.w);
58 evas_output_size_get(evas, &win_w, &win_h);
59 break;
60 case SDL_VIDEOEXPOSE:
61 evas_output_size_get(evas, &win_w, &win_h);
62 evas_damage_rectangle_add(evas, 0, 0, win_w, win_h);
63 break;
64 case SDL_KEYDOWN:
65 switch (event.key.keysym.sym)
66 {
67 case SDLK_LSHIFT:
68 case SDLK_RSHIFT:
69 evas_key_modifier_on(evas, "Shift");
70 break;
71 case SDLK_RCTRL:
72 case SDLK_LCTRL:
73 evas_key_modifier_on(evas, "Control");
74 break;
75 case SDLK_MENU:
76 case SDLK_RALT:
77 case SDLK_LALT:
78 evas_key_modifier_on(evas, "Alt");
79 break;
80 case SDLK_LSUPER:
81 case SDLK_RSUPER:
82 evas_key_modifier_on(evas, "Super");
83 break;
84 case SDLK_CAPSLOCK:
85 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
86 evas_key_lock_off(evas, "Caps_Lock");
87 else
88 evas_key_lock_on(evas, "Caps_Lock");
89 break;
90 case SDLK_NUMLOCK:
91 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Num_Lock"))
92 evas_key_lock_off(evas, "Num_Lock");
93 else
94 evas_key_lock_on(evas, "Num_Lock");
95 break;
96 case SDLK_SCROLLOCK:
97 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock"))
98 evas_key_lock_off(evas, "Scroll_Lock");
99 else
100 evas_key_lock_on(evas, "Scroll_Lock");
101 break;
102 case SDLK_s:
103 case SDLK_ESCAPE:
104 evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL);
105 break;
106 case SDLK_KP_ENTER:
107 case SDLK_RETURN:
108 evas_event_feed_key_down(evas, "Return", "Return", NULL, NULL, 0, NULL);
109 break;
110 case SDLK_LEFT: evas_event_feed_key_down(evas, "Left", "Left", NULL, NULL, 0, NULL); break;
111 case SDLK_RIGHT: evas_event_feed_key_down(evas, "Right", "Right", NULL, NULL, 0, NULL); break;
112 case SDLK_q:
113 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
114 evas_event_feed_key_down(evas, "Q", "Q", NULL, NULL, 0, NULL);
115 else
116 evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL);
117 break;
118 default:
119 break;
120 }
121 break;
122 case SDL_KEYUP:
123 switch (event.key.keysym.sym)
124 {
125 case SDLK_LSHIFT:
126 case SDLK_RSHIFT:
127 evas_key_modifier_off(evas, "Shift");
128 break;
129 case SDLK_RCTRL:
130 case SDLK_LCTRL:
131 evas_key_modifier_off(evas, "Control");
132 break;
133 case SDLK_MENU:
134 case SDLK_RALT:
135 case SDLK_LALT:
136 evas_key_modifier_off(evas, "Alt");
137 break;
138 case SDLK_LSUPER:
139 case SDLK_RSUPER:
140 evas_key_modifier_off(evas, "Super");
141 break;
142 case SDLK_ESCAPE: evas_event_feed_key_up(evas, "Escape", "Escape", NULL, NULL, 0, NULL); break;
143 case SDLK_RETURN: evas_event_feed_key_up(evas, "Return", "Return", NULL, NULL, 0, NULL); break;
144 case SDLK_LEFT: evas_event_feed_key_up(evas, "Left", "Left", NULL, NULL, 0, NULL); break;
145 case SDLK_RIGHT: evas_event_feed_key_up(evas, "Right", "Right", NULL, NULL, 0, NULL); break;
146 case SDLK_q:
147 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
148 evas_event_feed_key_up(evas, "Q", "Q", NULL, NULL, 0, NULL);
149 else
150 evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL);
151 break;
152 default:
153 break;
154 }
155 break;
156 case SDL_QUIT:
157 case SDL_SYSWMEVENT:
158 case SDL_USEREVENT:
159 case SDL_ACTIVEEVENT:
160 case SDL_JOYAXISMOTION:
161 case SDL_JOYBALLMOTION:
162 case SDL_JOYHATMOTION:
163 case SDL_JOYBUTTONDOWN:
164 case SDL_JOYBUTTONUP:
165 default:
166 break;
167 }
168 }
169}
170
171void
172engine_gl_sdl_shutdown(void)
173{
174}
diff --git a/src/bin/engine_gl_sdl.h b/src/bin/engine_gl_sdl.h
deleted file mode 100644
index 793db3d..0000000
--- a/src/bin/engine_gl_sdl.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef ENGINE_GL_SDL_H
2#define ENGINE_GL_SDL_H
3
4Eina_Bool engine_gl_sdl_args(const char *engine, int width, int height);
5void engine_gl_sdl_loop(void);
6void engine_gl_sdl_shutdown(void);
7
8#endif
diff --git a/src/bin/engine_gl_x11.c b/src/bin/engine_gl_x11.c
deleted file mode 100644
index 4c8fdd1..0000000
--- a/src/bin/engine_gl_x11.c
+++ /dev/null
@@ -1,223 +0,0 @@
1#include "main.h"
2
3#include <X11/Xlib.h>
4#include <X11/XKBlib.h>
5#include <X11/Xutil.h>
6#include <X11/Xatom.h>
7#include <Evas_Engine_GL_X11.h>
8
9static Display *disp = NULL;
10static Window win = 0;
11static int first_expose = 0;
12
13Eina_Bool
14engine_gl_x11_args(const char *engine __UNUSED__, int width, int height)
15{
16 XSetWindowAttributes attr;
17 XClassHint chint;
18 XSizeHints szhints;
19 Evas_Engine_Info_GL_X11 *einfo;
20
21 disp = XOpenDisplay(NULL);
22 if (!disp) return EINA_FALSE;
23
24 evas_output_method_set(evas, evas_render_method_lookup("gl_x11"));
25 einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(evas);
26 if (!einfo)
27 {
28 printf("Evas does not support the OpenGL X11 Engine\n");
29 goto close_display;
30 }
31
32 einfo->info.display = disp;
33 einfo->info.screen = DefaultScreen(einfo->info.display);
34 einfo->info.visual = einfo->func.best_visual_get(einfo);
35 einfo->info.colormap = einfo->func.best_colormap_get(einfo);
36 einfo->info.depth = einfo->func.best_depth_get(einfo);
37 attr.backing_store = NotUseful;
38 attr.colormap = einfo->info.colormap;
39 attr.border_pixel = 0;
40 attr.background_pixmap = None;
41 attr.event_mask =
42 ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask |
43 StructureNotifyMask | EnterWindowMask | LeaveWindowMask |
44 KeyPressMask | KeyReleaseMask;
45 attr.bit_gravity = ForgetGravity;
46 win = XCreateWindow(disp, DefaultRootWindow(disp),
47 0, 0, width, height, 0,
48 einfo->info.depth, InputOutput,
49 einfo->info.visual,
50 CWBackingStore | CWColormap |
51 CWBackPixmap | CWBorderPixel |
52 CWBitGravity | CWEventMask,
53 &attr);
54 if (!win)
55 goto close_display;
56
57 einfo->info.drawable = win;
58 if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
59 {
60 printf("Evas can not setup the informations of the OpenGL X11 Engine\n");
61 goto destroy_window;
62 }
63
64 if (fullscreen)
65 {
66 Atom prop = XInternAtom(disp, "_NET_WM_STATE", False);
67 Atom state = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False);
68 unsigned long data = state;
69 XChangeProperty(disp, win, prop, XA_ATOM, 32, PropModeReplace,
70 (unsigned char*) &data, 1);
71 }
72
73 XStoreName(disp, win, "Expedite - Evas Test Suite");
74 chint.res_name = "expedite";
75 chint.res_class = "Expedite";
76 XSetClassHint(disp, win, &chint);
77 szhints.flags = PMinSize | PMaxSize | PSize | USSize;
78 szhints.min_width = szhints.max_width = width;
79 szhints.min_height = szhints.max_height = height;
80 XSetWMNormalHints(disp, win, &szhints);
81 XMapWindow(disp, win);
82 XSync(disp, False);
83 while (!first_expose)
84 engine_gl_x11_loop();
85 return EINA_TRUE;
86
87 destroy_window:
88 XDestroyWindow(disp, win);
89 close_display:
90 XCloseDisplay(disp);
91
92 return EINA_FALSE;
93}
94
95void
96engine_gl_x11_loop(void)
97{
98 XEvent ev;
99 KeySym ks;
100 char *kstr;
101
102 again:
103 if (!XCheckMaskEvent(disp,
104 ExposureMask |
105 StructureNotifyMask |
106 KeyPressMask |
107 KeyReleaseMask |
108 ButtonPressMask |
109 ButtonReleaseMask |
110 PointerMotionMask |
111 EnterWindowMask |
112 LeaveWindowMask, &ev))
113 return;
114 switch (ev.type)
115 {
116 case ButtonPress:
117 evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y, 0, NULL);
118 evas_event_feed_mouse_down(evas, ev.xbutton.button, EVAS_BUTTON_NONE, 0, NULL);
119 break;
120 case ButtonRelease:
121 evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y, 0, NULL);
122 evas_event_feed_mouse_up(evas, ev.xbutton.button, EVAS_BUTTON_NONE, 0, NULL);
123 break;
124 case MotionNotify:
125 evas_event_feed_mouse_move(evas, ev.xmotion.x, ev.xmotion.y, 0, NULL);
126 break;
127 case Expose:
128 first_expose = 1;
129 evas_damage_rectangle_add(evas,
130 ev.xexpose.x,
131 ev.xexpose.y,
132 ev.xexpose.width,
133 ev.xexpose.height);
134 break;
135 case ConfigureNotify:
136 evas_output_viewport_set(evas, 0, 0,
137 ev.xconfigure.width,
138 ev.xconfigure.height);
139 evas_output_size_set(evas,
140 ev.xconfigure.width,
141 ev.xconfigure.height);
142 win_w = ev.xconfigure.width;
143 win_h = ev.xconfigure.height;
144 break;
145 case EnterNotify:
146 evas_event_feed_mouse_in(evas, 0, NULL);
147 break;
148 case LeaveNotify:
149 evas_event_feed_mouse_out(evas, 0, NULL);
150 break;
151 case KeyPress:
152 ks = XkbKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0, 0);
153 kstr = XKeysymToString(ks);
154 if (kstr)
155 {
156 if ((!strcmp(kstr, "Shift_L")) ||
157 (!strcmp(kstr, "Shift_R")))
158 evas_key_modifier_on(evas, "Shift");
159 if ((!strcmp(kstr, "Control_L")) ||
160 (!strcmp(kstr, "Control_R")))
161 evas_key_modifier_on(evas, "Control");
162 if ((!strcmp(kstr, "Alt_L")) ||
163 (!strcmp(kstr, "Alt_R")))
164 evas_key_modifier_on(evas, "Alt");
165 if ((!strcmp(kstr, "Super_L")) ||
166 (!strcmp(kstr, "Super_R")))
167 evas_key_modifier_on(evas, "Super");
168 if (!strcmp(kstr, "Caps_Lock"))
169 {
170 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
171 evas_key_lock_off(evas, "Caps_Lock");
172 else
173 evas_key_lock_on(evas, "Caps_Lock");
174 }
175 if (!strcmp(kstr, "Num_Lock"))
176 {
177 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Num_Lock"))
178 evas_key_lock_off(evas, "Num_Lock");
179 else
180 evas_key_lock_on(evas, "Num_Lock");
181 }
182 if (!strcmp(kstr, "Scroll_Lock"))
183 {
184 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock"))
185 evas_key_lock_off(evas, "Scroll_Lock");
186 else
187 evas_key_lock_on(evas, "Scroll_Lock");
188 }
189 if (kstr) evas_event_feed_key_down(evas, kstr, kstr, NULL, NULL, 0, NULL);
190 }
191 break;
192 case KeyRelease:
193 ks = XkbKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0, 0);
194 kstr = XKeysymToString(ks);
195 if (kstr)
196 {
197 if ((!strcmp(kstr, "Shift_L")) ||
198 (!strcmp(kstr, "Shift_R")))
199 evas_key_modifier_off(evas, "Shift");
200 if ((!strcmp(kstr, "Control_L")) ||
201 (!strcmp(kstr, "Control_R")))
202 evas_key_modifier_off(evas, "Control");
203 if ((!strcmp(kstr, "Alt_L")) ||
204 (!strcmp(kstr, "Alt_R")))
205 evas_key_modifier_off(evas, "Alt");
206 if ((!strcmp(kstr, "Super_L")) ||
207 (!strcmp(kstr, "Super_R")))
208 evas_key_modifier_off(evas, "Super");
209 evas_event_feed_key_up(evas, kstr, kstr, NULL, NULL, 0, NULL);
210 }
211 break;
212 default:
213 break;
214 }
215 goto again;
216}
217
218void
219engine_gl_x11_shutdown(void)
220{
221 XDestroyWindow(disp, win);
222 XCloseDisplay(disp);
223}
diff --git a/src/bin/engine_gl_x11.h b/src/bin/engine_gl_x11.h
deleted file mode 100644
index 9702d8b..0000000
--- a/src/bin/engine_gl_x11.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef ENGINE_GL_X11_H
2#define ENGINE_GL_X11_H
3
4Eina_Bool engine_gl_x11_args(const char *engine, int width, int height);
5void engine_gl_x11_loop(void);
6void engine_gl_x11_shutdown(void);
7
8#endif
diff --git a/src/bin/engine_psl1ght.c b/src/bin/engine_psl1ght.c
deleted file mode 100644
index 2661a6c..0000000
--- a/src/bin/engine_psl1ght.c
+++ /dev/null
@@ -1,284 +0,0 @@
1#include "main.h"
2
3#include <Evas_Engine_PSL1GHT.h>
4#include <io/mouse.h>
5#include <io/kb.h>
6
7static int window_width = 0;
8static int window_height = 0;
9
10Eina_Bool
11engine_psl1ght_args(const char *engine, int width, int height)
12{
13 Evas_Engine_Info_PSL1GHT *einfo;
14
15 evas_output_method_set(evas, evas_render_method_lookup("psl1ght"));
16 einfo = (Evas_Engine_Info_PSL1GHT *)evas_engine_info_get(evas);
17 if (!einfo)
18 {
19 printf("Evas does not support the PSL1GHT Engine\n");
20 return EINA_FALSE;
21 }
22
23 if (!evas_engine_info_set(evas, (Evas_Engine_Info *)einfo))
24 {
25 printf("Evas can not setup the informations of the PSL1GHT Engine\n");
26 return EINA_FALSE;
27 }
28
29 window_width = width;
30 window_height = height;
31 ioMouseInit(1);
32 ioKbInit(1);
33 return EINA_TRUE;
34}
35
36void
37engine_psl1ght_loop(void)
38{
39 mouseInfo mouseinfo;
40 static int mouse_connected = FALSE;
41 static u8 mouse_buttons = 0;
42 static int mouse_x = 0;
43 static int mouse_y = 0;
44 KbInfo kbInfo;
45 static int keyboard_connected = FALSE;
46 static KbLed keyboard_leds = {{0}};
47 static KbMkey keyboard_mods = {{0}};
48 static u16 keyboard_old_key = 0;
49 int i;
50
51 /* Check mouse events */
52 ioMouseGetInfo(&mouseinfo);
53
54 if (mouseinfo.status[0] == 1 && !mouse_connected) // Connected
55 {
56 mouse_connected = TRUE;
57 mouse_buttons = 0;
58
59 // Old events in the queue are discarded
60 ioMouseClearBuf(0);
61 }
62 else if (mouseinfo.status[0] != 1 && mouse_connected) // Disconnected
63 {
64 mouse_connected = FALSE;
65 mouse_buttons = 0;
66 }
67
68 if (mouse_connected)
69 {
70 mouseDataList datalist;
71
72 ioMouseGetDataList(0, &datalist);
73
74 for (i = 0; i < datalist.count; i++) {
75 u8 old_left = mouse_buttons & 1;
76 u8 new_left = datalist.list[i].buttons & 1;
77 u8 old_right = mouse_buttons & 2;
78 u8 new_right = datalist.list[i].buttons & 2;
79 u8 old_middle = mouse_buttons & 4;
80 u8 new_middle = datalist.list[i].buttons & 4;
81
82 mouse_x += datalist.list[i].x_axis;
83 mouse_y += datalist.list[i].y_axis;
84 if (mouse_x < 0) mouse_x = 0;
85 if (mouse_y < 0) mouse_y = 0;
86 if (mouse_x > window_width) mouse_x = window_width;
87 if (mouse_y > window_height) mouse_x = window_height;
88
89 evas_event_feed_mouse_move(evas, mouse_x, mouse_y, 0, NULL);
90
91 if (old_left != new_left)
92 {
93 if (new_left)
94 evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
95 else
96 evas_event_feed_mouse_up(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
97 }
98 if (old_right != new_right)
99 {
100 if (new_right)
101 evas_event_feed_mouse_down(evas, 3, EVAS_BUTTON_NONE, 0, NULL);
102 else
103 evas_event_feed_mouse_up(evas, 3, EVAS_BUTTON_NONE, 0, NULL);
104 }
105 if (old_middle != new_middle)
106 {
107 if (new_middle)
108 evas_event_feed_mouse_down(evas, 2, EVAS_BUTTON_NONE, 0, NULL);
109 else
110 evas_event_feed_mouse_up(evas, 2, EVAS_BUTTON_NONE, 0, NULL);
111 }
112 mouse_buttons = datalist.list[i].buttons;
113 }
114 }
115
116 /* Check keyboard events */
117 ioKbGetInfo(&kbInfo);
118
119 if (kbInfo.status[0] == 1 && !keyboard_connected)
120 {
121 /* Connected */
122 keyboard_connected = true;
123
124 // Old events in the queue are discarded
125 ioKbClearBuf(0);
126 keyboard_leds._KbLedU.leds = 0;
127 keyboard_mods._KbMkeyU.mkeys = 0;
128 keyboard_old_key = 0;
129
130 // Set raw keyboard code types to get scan codes
131 ioKbSetCodeType(0, KB_CODETYPE_ASCII);
132 ioKbSetReadMode(0, KB_RMODE_INPUTCHAR);
133 }
134 else if (kbInfo.status[0] != 1 && keyboard_connected)
135 {
136 /* Disconnected keyboard */
137 keyboard_connected = FALSE;
138 }
139
140 if (keyboard_connected)
141 {
142 KbData Keys;
143
144 // Read data from the keyboard buffer
145 if (ioKbRead(0, &Keys) == 0 && Keys.nb_keycode > 0)
146 {
147 if (Keys.mkey._KbMkeyU._KbMkeyS.l_shift !=
148 keyboard_mods._KbMkeyU._KbMkeyS.l_shift ||
149 Keys.mkey._KbMkeyU._KbMkeyS.r_shift !=
150 keyboard_mods._KbMkeyU._KbMkeyS.r_shift)
151 {
152 if (Keys.mkey._KbMkeyU._KbMkeyS.r_shift ||
153 Keys.mkey._KbMkeyU._KbMkeyS.l_shift)
154 evas_key_modifier_on(evas, "Shift");
155 else
156 evas_key_modifier_off(evas, "Shift");
157 }
158 if (Keys.mkey._KbMkeyU._KbMkeyS.l_ctrl !=
159 keyboard_mods._KbMkeyU._KbMkeyS.l_ctrl ||
160 Keys.mkey._KbMkeyU._KbMkeyS.r_ctrl !=
161 keyboard_mods._KbMkeyU._KbMkeyS.r_ctrl)
162 {
163 if (Keys.mkey._KbMkeyU._KbMkeyS.r_ctrl ||
164 Keys.mkey._KbMkeyU._KbMkeyS.l_ctrl)
165 evas_key_modifier_on(evas, "Control");
166 else
167 evas_key_modifier_off(evas, "Control");
168 }
169 if (Keys.mkey._KbMkeyU._KbMkeyS.l_alt !=
170 keyboard_mods._KbMkeyU._KbMkeyS.l_alt ||
171 Keys.mkey._KbMkeyU._KbMkeyS.r_alt !=
172 keyboard_mods._KbMkeyU._KbMkeyS.r_alt)
173 {
174 if (Keys.mkey._KbMkeyU._KbMkeyS.r_alt ||
175 Keys.mkey._KbMkeyU._KbMkeyS.l_alt)
176 evas_key_modifier_on(evas, "Alt");
177 else
178 evas_key_modifier_off(evas, "Alt");
179 }
180 if (Keys.mkey._KbMkeyU._KbMkeyS.l_win !=
181 keyboard_mods._KbMkeyU._KbMkeyS.l_win ||
182 Keys.mkey._KbMkeyU._KbMkeyS.r_win !=
183 keyboard_mods._KbMkeyU._KbMkeyS.r_win)
184 {
185 if (Keys.mkey._KbMkeyU._KbMkeyS.r_win ||
186 Keys.mkey._KbMkeyU._KbMkeyS.l_win)
187 evas_key_modifier_on(evas, "Super");
188 else
189 evas_key_modifier_off(evas, "Super");
190 }
191 keyboard_mods = Keys.mkey;
192
193 if (Keys.led._KbLedU._KbLedS.num_lock !=
194 keyboard_leds._KbLedU._KbLedS.num_lock)
195 {
196 if (Keys.led._KbLedU._KbLedS.num_lock)
197 evas_key_lock_on(evas, "Num_Lock");
198 else
199 evas_key_lock_on(evas, "Num_Lock");
200 }
201 if (Keys.led._KbLedU._KbLedS.caps_lock !=
202 keyboard_leds._KbLedU._KbLedS.caps_lock)
203 {
204 if (Keys.led._KbLedU._KbLedS.caps_lock)
205 evas_key_lock_on(evas, "Caps_Lock");
206 else
207 evas_key_lock_on(evas, "Caps_Lock");
208 }
209 if (Keys.led._KbLedU._KbLedS.scroll_lock !=
210 keyboard_leds._KbLedU._KbLedS.scroll_lock)
211 {
212 if (Keys.led._KbLedU._KbLedS.scroll_lock)
213 evas_key_lock_on(evas, "Scroll_Lock");
214 else
215 evas_key_lock_on(evas, "Scroll_Lock");
216 }
217 keyboard_leds = Keys.led;
218
219 for (i = 0; i < Keys.nb_keycode; i++) {
220 if (Keys.keycode[i] != keyboard_old_key)
221 {
222 u16 key = Keys.keycode[i];
223 char *key_str = NULL;
224
225 if (key == 0)
226 key = keyboard_old_key;
227 key_str = (char *)&key;
228
229 printf ("Key %d is %X\n", i, key);
230 key &= ~KB_KEYPAD;
231 if (key & KB_RAWDAT)
232 {
233 key &= 0xFF;
234 if (key == KB_RAWKEY_ESCAPE)
235 key_str = "Escape";
236 else if (key == KB_RAWKEY_ENTER)
237 key_str = "Return";
238 else if (key == KB_RAWKEY_UP_ARROW)
239 key_str = "Up";
240 else if (key == KB_RAWKEY_DOWN_ARROW)
241 key_str = "Down";
242 else if (key == KB_RAWKEY_LEFT_ARROW)
243 key_str = "Left";
244 else if (key == KB_RAWKEY_RIGHT_ARROW)
245 key_str = "Right";
246 else
247 key_str = NULL;
248 }
249 else {
250 if (key == 0x0A)
251 key_str = "Return";
252 else {
253 key_str[0] = key_str[1];
254 key_str[1] = 0;
255 }
256 }
257 if (key_str)
258 {
259 if (Keys.keycode[i] != 0)
260 {
261 printf ("Key %s pressed\n", key_str);
262 evas_event_feed_key_up(evas, key_str, key_str, NULL, NULL, 0, NULL);
263 }
264 else {
265 evas_event_feed_key_down(evas, key_str, key_str, NULL, NULL, 0, NULL);
266 printf ("Key %s released\n", key_str);
267 }
268 }
269 keyboard_old_key = Keys.keycode[0];
270 }
271 }
272 }
273 }
274 return;
275}
276
277void
278engine_psl1ght_shutdown(void)
279{
280 ioMouseEnd();
281 ioKbEnd();
282 return;
283}
284
diff --git a/src/bin/engine_psl1ght.h b/src/bin/engine_psl1ght.h
deleted file mode 100644
index 69610c5..0000000
--- a/src/bin/engine_psl1ght.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef ENGINE_SOFTWARE_PSL1GHT_H
2#define ENGINE_SOFTWARE_PSL1GHT_H
3
4Eina_Bool engine_psl1ght_args(const char *engine, int width, int height);
5void engine_psl1ght_loop(void);
6void engine_psl1ght_shutdown(void);
7
8#endif
diff --git a/src/bin/engine_software_16_wince.c b/src/bin/engine_software_16_wince.c
deleted file mode 100644
index 4506f2e..0000000
--- a/src/bin/engine_software_16_wince.c
+++ /dev/null
@@ -1,324 +0,0 @@
1#include "main.h"
2
3#include <windows.h>
4#include <aygshell.h>
5#include <Evas_Engine_Software_16_WinCE.h>
6
7
8static HINSTANCE instance = NULL;
9static HWND window = NULL;
10static int backend = 0;
11
12typedef int (*suspend) (int backend);
13typedef int (*resume) (int backend);
14
15static suspend _suspend = NULL;
16static resume _resume = NULL;
17
18
19typedef BOOL (__stdcall *UnregisterFunc1Proc)(UINT, UINT);
20
21static int
22_wince_hardware_keys_register(HWND window)
23{
24 HINSTANCE core_dll;
25 UnregisterFunc1Proc unregister_fct;
26 int i;
27
28 core_dll = LoadLibrary(L"coredll.dll");
29 if (!core_dll)
30 return 0;
31
32 unregister_fct = (UnregisterFunc1Proc)GetProcAddress(core_dll, L"UnregisterFunc1");
33 if (!unregister_fct)
34 {
35 FreeLibrary(core_dll);
36 return 0;
37 }
38
39 for (i = 0xc1; i <= 0xcf; i++)
40 {
41 unregister_fct(MOD_WIN, i);
42 RegisterHotKey(window, i, MOD_WIN, i);
43 }
44
45 FreeLibrary(core_dll);
46
47 return 1;
48}
49
50static void
51_wince_key_down(WPARAM wParam)
52{
53 int key;
54
55 key = LOWORD(wParam);
56
57 if ((key == VK_SHIFT) ||
58 (key == VK_LSHIFT) ||
59 (key == VK_RSHIFT))
60 evas_key_modifier_on(evas, "Shift");
61
62 if (key == VK_CAPITAL)
63 {
64 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
65 evas_key_lock_off(evas, "Caps_Lock");
66 else
67 evas_key_lock_on(evas, "Caps_Lock");
68 }
69 if ((key == VK_RETURN) || (key == VK_APP1))
70 evas_event_feed_key_down(evas, "Return", "Return", NULL, NULL, 0, NULL);
71 if (key == VK_LEFT)
72 evas_event_feed_key_down(evas, "Left", "Left", NULL, NULL, 0, NULL);
73 if (key == VK_RIGHT)
74 evas_event_feed_key_down(evas, "Right", "Right", NULL, NULL, 0, NULL);
75 if ((key == 81) || (key == VK_APP2))
76 evas_event_feed_key_down(evas, "Q", "Q", NULL, NULL, 0, NULL);
77 if ((key == 113) || (key == VK_APP3))
78 evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL);
79}
80
81static void
82_wince_key_up(WPARAM wParam)
83{
84 int key;
85
86 key = LOWORD(wParam);
87
88 if ((key == VK_SHIFT) ||
89 (key == VK_LSHIFT) ||
90 (key == VK_RSHIFT))
91 evas_key_modifier_off(evas, "Shift");
92 if ((key == VK_RETURN) || (key == VK_APP1))
93 evas_event_feed_key_up(evas, "Return", "Return", NULL, NULL, 0, NULL);
94 if (key == VK_LEFT)
95 evas_event_feed_key_up(evas, "Left", "Left", NULL, NULL, 0, NULL);
96 if (key == VK_RIGHT)
97 evas_event_feed_key_up(evas, "Right", "Right", NULL, NULL, 0, NULL);
98 if ((key == 81) || (key == VK_APP2))
99 evas_event_feed_key_up(evas, "Q", "Q", NULL, NULL, 0, NULL);
100 if ((key == 113) || (key == VK_APP3))
101 evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL);
102}
103
104static LRESULT CALLBACK
105MainWndProc(HWND hwnd,
106 UINT uMsg,
107 WPARAM wParam,
108 LPARAM lParam)
109{
110 switch (uMsg)
111 {
112 case WM_DESTROY:
113 PostQuitMessage(0);
114 return 0;
115 case WM_CLOSE:
116 PostQuitMessage(0);
117 return 0;
118 case WM_PAINT:
119 ValidateRect(hwnd, NULL);
120 return 0;
121 case WM_HOTKEY:
122 _wince_key_down(wParam);
123 return 0;
124 case WM_KEYDOWN:
125 _wince_key_down(wParam);
126 return 0;
127 case WM_KEYUP:
128 _wince_key_up(wParam);
129 return 0;
130 case WM_KILLFOCUS:
131 if (_suspend)
132 _suspend (backend);
133 return 0;
134 case WM_SETFOCUS:
135 if (_resume)
136 _resume (backend);
137 return 0;
138 case WM_SIZE:
139 {
140 Evas_Engine_Info_Software_16_WinCE *einfo;
141
142 printf ("WM_SIZE %dx%d\n", LOWORD(lParam), HIWORD(lParam));
143 einfo = (Evas_Engine_Info_Software_16_WinCE *)evas_engine_info_get(evas);
144 if (!einfo)
145 return 0;
146
147 if (einfo->info.rotation != 0)
148 {
149 einfo->info.width = win_h;
150 einfo->info.height = win_w;
151 einfo->info.rotation = 90;
152 }
153 else
154 {
155 einfo->info.width = win_w;
156 einfo->info.height = win_h;
157 einfo->info.rotation = 0;
158 }
159
160 evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
161
162 return 0;
163 }
164 default:
165 return DefWindowProc(hwnd, uMsg, wParam, lParam);
166 }
167}
168
169Eina_Bool
170engine_software_16_wince_args(const char *engine, int width, int height)
171{
172 WNDCLASS wc;
173 RECT rect;
174 Evas_Engine_Info_Software_16_WinCE *einfo;
175 HWND task_bar;
176 HWND sip_window;
177 HWND sip_icon;
178 int stride_x;
179 int stride_y;
180 int bpp;
181 int format;
182 void *buffer;
183 int ok = 0;
184 int i;
185
186 if (!strcmp(engine, "wince")) ok = 1;
187 if (!strcmp(engine, "wince-fb")) { ok = 1; backend = 1; }
188 if (!strcmp(engine, "wince-gapi")) { ok = 1; backend = 2; }
189 if (!strcmp(engine, "wince-ddraw")) { ok = 1; backend = 3; }
190 if (!strcmp(engine, "wince-gdi")) { ok = 1; backend = 4; }
191 if (!ok) return EINA_FALSE;
192
193 instance = GetModuleHandle(NULL);
194 if (!instance) return EINA_FALSE;
195
196 memset (&wc, 0, sizeof (wc));
197 wc.style = CS_HREDRAW | CS_VREDRAW;
198 wc.lpfnWndProc = MainWndProc;
199 wc.cbClsExtra = 0;
200 wc.cbWndExtra = 0;
201 wc.hInstance = instance;
202 wc.hIcon = NULL;
203 wc.hCursor = LoadCursor (NULL, IDC_ARROW);
204 wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE);
205 wc.lpszMenuName = NULL;
206 wc.lpszClassName = L"Evas_Software_16_WinCE_Test";
207
208 if(!RegisterClass(&wc))
209 goto free_library;
210
211 SetRect(&rect, 0, 0,
212 GetSystemMetrics(SM_CXSCREEN),
213 GetSystemMetrics(SM_CYSCREEN));
214
215 window = CreateWindowEx(WS_EX_TOPMOST,
216 L"Evas_Software_16_WinCE_Test",
217 L"Evas_Software_16_WinCE_Test",
218 WS_VISIBLE | WS_POPUP,
219 rect.left, rect.top,
220 rect.right - rect.left,
221 rect.bottom - rect.top,
222 NULL, NULL, instance, NULL);
223 if (!window)
224 goto unregister_class;
225
226 /* hide top level windows (Task bar, SIP and SIP button */
227 task_bar = FindWindow(L"HHTaskBar", NULL);
228 ShowWindow(task_bar, SW_HIDE);
229 EnableWindow(task_bar, FALSE);
230 sip_window = FindWindow(L"SipWndClass", NULL);
231 ShowWindow(sip_window, SW_HIDE);
232 EnableWindow(sip_window, FALSE);
233 sip_icon = FindWindow(L"MS_SIPBUTTON", NULL);
234 ShowWindow(sip_icon, SW_HIDE);
235 EnableWindow(sip_icon, FALSE);
236
237 if (!_wince_hardware_keys_register(window))
238 goto destroy_window;
239
240 evas_output_method_set(evas, evas_render_method_lookup("software_16_wince"));
241
242 einfo = (Evas_Engine_Info_Software_16_WinCE *)evas_engine_info_get(evas);
243 if (!einfo)
244 {
245 printf("Evas does not support the 16bit Software WinCE Engine\n");
246 goto destroy_window;
247 }
248
249 einfo->info.window = window;
250 einfo->info.width = width;
251 einfo->info.height = height;
252 einfo->info.backend = backend;
253 einfo->info.rotation = 0;
254 if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
255 {
256 printf("Evas can not setup the informations of the 16 bits Software WinCE Engine\n");
257 goto destroy_window;
258 }
259
260 _suspend = einfo->func.suspend;
261 _resume = einfo->func.resume;
262
263 /* the second parameter is ignored, as it's the first call of ShowWindow */
264 ShowWindow(window, SW_SHOWDEFAULT);
265 UpdateWindow(window);
266
267 return EINA_TRUE;
268
269 destroy_window:
270 DestroyWindow(window);
271 ShowWindow(task_bar, SW_SHOW);
272 EnableWindow(task_bar, TRUE);
273 ShowWindow(sip_window, SW_SHOW);
274 EnableWindow(sip_window, TRUE);
275 ShowWindow(sip_icon, SW_SHOW);
276 EnableWindow(sip_icon, TRUE);
277 unregister_class:
278 UnregisterClass(L"Evas_Software_16_WinCE_Test", instance);
279 free_library:
280 FreeLibrary(instance);
281
282 return EINA_FALSE;
283}
284
285void
286engine_software_16_wince_loop(void)
287{
288 MSG msg;
289 int res;
290
291 again:
292 if (!PeekMessage (&msg, window, 0, 0, PM_NOREMOVE))
293 return;
294
295 res = GetMessage (&msg, NULL, 0, 0);
296 TranslateMessage (&msg);
297 DispatchMessage (&msg);
298
299 goto again;
300}
301
302void
303engine_software_16_wince_shutdown(void)
304{
305 HWND task_bar;
306 HWND sip_window;
307 HWND sip_icon;
308
309 DestroyWindow(window);
310
311 /* show top level windows (Task bar, SIP and SIP button */
312 task_bar = FindWindow(L"HHTaskBar", NULL);
313 ShowWindow(task_bar, SW_SHOW);
314 EnableWindow(task_bar, TRUE);
315 sip_window = FindWindow(L"SipWndClass", NULL);
316 ShowWindow(sip_window, SW_SHOW);
317 EnableWindow(sip_window, TRUE);
318 sip_icon = FindWindow(L"MS_SIPBUTTON", NULL);
319 ShowWindow(sip_icon, SW_SHOW);
320 EnableWindow(sip_icon, TRUE);
321
322 UnregisterClass(L"Evas_Software_16_WinCE_Test", instance);
323 FreeLibrary(instance);
324}
diff --git a/src/bin/engine_software_16_wince.h b/src/bin/engine_software_16_wince.h
deleted file mode 100644
index 10be16c..0000000
--- a/src/bin/engine_software_16_wince.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef __ENGINE_SOFTWARE_16_WINCE_H__
2#define __ENGINE_SOFTWARE_16_WINCE_H__
3
4
5Eina_Bool engine_software_16_wince_args(const char *engine, int width, int height);
6void engine_software_16_wince_loop(void);
7void engine_software_16_wince_shutdown(void);
8
9
10#endif /* __ENGINE_SOFTWARE_16_WINCE_H__ */
diff --git a/src/bin/engine_software_ddraw.h b/src/bin/engine_software_ddraw.h
deleted file mode 100644
index ec7e7c9..0000000
--- a/src/bin/engine_software_ddraw.h
+++ /dev/null
@@ -1,19 +0,0 @@
1#ifndef __ENGINE_SOFTWARE_DDRAW_H__
2#define __ENGINE_SOFTWARE_DDRAW_H__
3
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9Eina_Bool engine_software_ddraw_args(const char *engine, int width, int height);
10void engine_software_ddraw_loop(void);
11void engine_software_ddraw_shutdown(void);
12
13
14#ifdef __cplusplus
15}
16#endif
17
18
19#endif /* __ENGINE_SOFTWARE_DDRAW_H__ */
diff --git a/src/bin/engine_software_gdi.c b/src/bin/engine_software_gdi.c
deleted file mode 100644
index 92218b1..0000000
--- a/src/bin/engine_software_gdi.c
+++ /dev/null
@@ -1,293 +0,0 @@
1#include "main.h"
2
3#include <windowsx.h>
4#include <Evas_Engine_Software_Gdi.h>
5
6
7static HWND window;
8static HINSTANCE instance;
9
10
11static LRESULT CALLBACK
12MainWndProc(HWND hwnd,
13 UINT uMsg,
14 WPARAM wParam,
15 LPARAM lParam)
16{
17 switch (uMsg)
18 {
19 case WM_CREATE:
20 return 0;
21 case WM_DESTROY:
22 PostQuitMessage(0);
23 return 0;
24 case WM_CLOSE:
25 PostQuitMessage(0);
26 return 0;
27 case WM_WINDOWPOSCHANGED: {
28 PAINTSTRUCT ps;
29 HDC hdc;
30
31 hdc = BeginPaint (window, &ps);
32 evas_damage_rectangle_add(evas,
33 ps.rcPaint.left, ps.rcPaint.top,
34 ps.rcPaint.right - ps.rcPaint.left,
35 ps.rcPaint.bottom - ps.rcPaint.top);
36 EndPaint(window, &ps);
37 return 0;
38 }
39 case WM_SIZING:
40 {
41 PRECT rect = (PRECT)lParam;
42
43 evas_output_viewport_set(evas, 0, 0,
44 rect->right - rect->left,
45 rect->bottom - rect->top);
46 evas_output_size_set(evas,
47 rect->right - rect->left,
48 rect->bottom - rect->top);
49 win_w = rect->right - rect->left;
50 win_h = rect->bottom - rect->top;
51 return 0;
52 }
53 case WM_RBUTTONDOWN:
54 evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL);
55 evas_event_feed_mouse_down(evas, 3, EVAS_BUTTON_NONE, 0, NULL);
56 return 0;
57 case WM_LBUTTONDOWN:
58 evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL);
59 evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
60 return 0;
61 case WM_LBUTTONUP:
62 evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL);
63 evas_event_feed_mouse_up(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
64 return 0;
65 case WM_RBUTTONUP:
66 evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL);
67 evas_event_feed_mouse_up(evas, 3, EVAS_BUTTON_NONE, 0, NULL);
68 return 0;
69 case WM_MOUSEMOVE:
70 if (!evas_pointer_inside_get(evas)) evas_event_feed_mouse_in(evas, 0, NULL);
71 evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL);
72 return 0;
73 case WM_MOUSELEAVE:
74 evas_event_feed_mouse_out(evas, 0, NULL);
75 return 0;
76 /* FIXME : can't find an event when the mouse is entering */
77 case WM_KEYDOWN:
78 case WM_SYSKEYDOWN: {
79 int key;
80
81 key = LOWORD(wParam);
82
83 if ((key == VK_SHIFT) ||
84 (key == VK_LSHIFT) ||
85 (key == VK_RSHIFT))
86 evas_key_modifier_on(evas, "Shift");
87 if ((key == VK_CONTROL) ||
88 (key == VK_LCONTROL) ||
89 (key == VK_RCONTROL))
90 evas_key_modifier_on(evas, "Control");
91 if ((key == VK_MENU) ||
92 (key == VK_LMENU) ||
93 (key == VK_RMENU))
94 evas_key_modifier_on(evas, "Alt");
95 if ((key == VK_LWIN) ||
96 (key == VK_RWIN))
97 evas_key_modifier_on(evas, "Super");
98
99 if (key == VK_CAPITAL)
100 {
101 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
102 evas_key_lock_off(evas, "Caps_Lock");
103 else
104 evas_key_lock_on(evas, "Caps_Lock");
105 }
106 if (key == VK_NUMLOCK)
107 {
108 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Num_Lock"))
109 evas_key_lock_off(evas, "Num_Lock");
110 else
111 evas_key_lock_on(evas, "Num_Lock");
112 }
113 if (key == VK_SCROLL)
114 {
115 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock"))
116 evas_key_lock_off(evas, "Scroll_Lock");
117 else
118 evas_key_lock_on(evas, "Scroll_Lock");
119 }
120 if (key == VK_ESCAPE)
121 evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL);
122 if (key == VK_RETURN)
123 evas_event_feed_key_down(evas, "Return", "Return", NULL, NULL, 0, NULL);
124 if (key == VK_LEFT)
125 evas_event_feed_key_down(evas, "Left", "Left", NULL, NULL, 0, NULL);
126 if (key == VK_RIGHT)
127 evas_event_feed_key_down(evas, "Right", "Right", NULL, NULL, 0, NULL);
128 if (key == 81)
129 evas_event_feed_key_down(evas, "Q", "Q", NULL, NULL, 0, NULL);
130 if (key == 113)
131 evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL);
132 return 0;
133 }
134 case WM_KEYUP:
135 case WM_SYSKEYUP: {
136 int key;
137
138 key = LOWORD(wParam);
139
140 if ((key == VK_SHIFT) ||
141 (key == VK_LSHIFT) ||
142 (key == VK_RSHIFT))
143 evas_key_modifier_off(evas, "Shift");
144 if ((key == VK_CONTROL) ||
145 (key == VK_LCONTROL) ||
146 (key == VK_RCONTROL))
147 evas_key_modifier_off(evas, "Control");
148 if ((key == VK_MENU) ||
149 (key == VK_LMENU) ||
150 (key == VK_RMENU))
151 evas_key_modifier_off(evas, "Alt");
152 if ((key == VK_LWIN) ||
153 (key == VK_RWIN))
154 evas_key_modifier_off(evas, "Super");
155 if (key == VK_ESCAPE)
156 evas_event_feed_key_up(evas, "Escape", "Escape", NULL, NULL, 0, NULL);
157 if (key == VK_RETURN)
158 evas_event_feed_key_up(evas, "Return", "Return", NULL, NULL, 0, NULL);
159 if (key == VK_LEFT)
160 evas_event_feed_key_up(evas, "Left", "Left", NULL, NULL, 0, NULL);
161 if (key == VK_RIGHT)
162 evas_event_feed_key_up(evas, "Right", "Right", NULL, NULL, 0, NULL);
163 if (key == 81)
164 evas_event_feed_key_up(evas, "Q", "Q", NULL, NULL, 0, NULL);
165 if (key == 113)
166 evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL);
167 return 0;
168 }
169 default:
170 return DefWindowProc(hwnd, uMsg, wParam, lParam);
171 }
172}
173
174Eina_Bool
175engine_software_gdi_args(const char *engine __UNUSED__, int width, int height)
176{
177 WNDCLASS wc;
178 RECT rect;
179 HDC dc;
180 Evas_Engine_Info_Software_Gdi *einfo;
181 DWORD style;
182 DWORD exstyle;
183 int depth;
184
185 instance = GetModuleHandle(NULL);
186 if (!instance) return EINA_FALSE;
187
188 wc.style = CS_HREDRAW | CS_VREDRAW;
189 wc.lpfnWndProc = MainWndProc;
190 wc.cbClsExtra = 0;
191 wc.cbWndExtra = 0;
192 wc.hInstance = instance;
193 wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
194 wc.hCursor = LoadCursor(NULL, IDC_ARROW);
195 wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE);
196 wc.lpszMenuName = NULL;
197 wc.lpszClassName = "Evas_Software_Gdi_Test";
198
199 if(!RegisterClass(&wc))
200 goto free_library;
201
202 style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
203 exstyle = 0;
204
205 rect.left = 0;
206 rect.top = 0;
207 rect.right = width;
208 rect.bottom = height;
209 AdjustWindowRectEx (&rect, style, FALSE, exstyle);
210
211 window = CreateWindowEx(exstyle,
212 "Evas_Software_Gdi_Test",
213 "Evas_Software_Gdi_Test",
214 style,
215 CW_USEDEFAULT, CW_USEDEFAULT,
216 rect.right - rect.left, rect.bottom - rect.top,
217 NULL, NULL, instance, NULL);
218 if (!window)
219 goto destroy_window;
220
221 /* make the window non resizable */
222 style = GetWindowLong(window, GWL_STYLE);
223 style &= ~WS_THICKFRAME;
224 if (!SetWindowLong(window, GWL_STYLE, style))
225 goto unregister_class;
226
227 dc = GetDC(NULL);
228 if (!dc)
229 goto destroy_window;
230
231 depth = GetDeviceCaps(dc, BITSPIXEL);
232 ReleaseDC(NULL, dc);
233
234 evas_output_method_set(evas, evas_render_method_lookup("software_gdi"));
235 einfo = (Evas_Engine_Info_Software_Gdi *)evas_engine_info_get(evas);
236 if (!einfo)
237 {
238 fprintf(stderr, "Evas does not support the Software GDI Engine\n");
239 goto destroy_window;
240 }
241
242 einfo->info.window = window;
243 einfo->info.depth = depth;
244 einfo->info.rotation = 0;
245 einfo->info.borderless = 0;
246 einfo->info.fullscreen = 0;
247 einfo->info.region = 0;
248 if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
249 {
250 printf("Evas can not setup the informations of the Software GDI Engine\n");
251 goto destroy_window;
252 }
253
254 /* the second parameter is ignored, as it's the first call of ShowWindow */
255 ShowWindow(window, SW_SHOWDEFAULT);
256 UpdateWindow(window);
257
258 return EINA_TRUE;
259
260 destroy_window:
261 DestroyWindow(window);
262 unregister_class:
263 UnregisterClass("Evas_Software_Gdi_Test", instance);
264 free_library:
265 FreeLibrary(instance);
266
267 return EINA_FALSE;
268}
269
270void
271engine_software_gdi_loop(void)
272{
273 MSG msg;
274 int res;
275
276 again:
277 if (!PeekMessage (&msg, window, 0, 0, PM_NOREMOVE))
278 return;
279
280 res = GetMessage (&msg, NULL, 0, 0);
281 TranslateMessage (&msg);
282 DispatchMessage (&msg);
283
284 goto again;
285}
286
287void
288engine_software_gdi_shutdown(void)
289{
290 DestroyWindow(window);
291 UnregisterClass("Evas_Software_Gdi_Test", instance);
292 FreeLibrary(instance);
293}
diff --git a/src/bin/engine_software_gdi.h b/src/bin/engine_software_gdi.h
deleted file mode 100644
index 47bd58a..0000000
--- a/src/bin/engine_software_gdi.h
+++ /dev/null
@@ -1,19 +0,0 @@
1#ifndef __ENGINE_SOFTWARE_GDI_H__
2#define __ENGINE_SOFTWARE_GDI_H__
3
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9Eina_Bool engine_software_gdi_args(const char *engine, int width, int height);
10void engine_software_gdi_loop(void);
11void engine_software_gdi_shutdown(void);
12
13
14#ifdef __cplusplus
15}
16#endif
17
18
19#endif /* __ENGINE_SOFTWARE_GDI_H__ */
diff --git a/src/bin/engine_software_sdl.c b/src/bin/engine_software_sdl.c
deleted file mode 100644
index a786d9f..0000000
--- a/src/bin/engine_software_sdl.c
+++ /dev/null
@@ -1,242 +0,0 @@
1#include <assert.h>
2#include "main.h"
3
4#include <SDL/SDL.h>
5#include <Evas_Engine_Buffer.h>
6
7static void *
8_expedite_sdl_switch_buffer(void *data, void *dest __UNUSED__)
9{
10 SDL_Flip(data);
11 return ((SDL_Surface*)data)->pixels;
12}
13
14Eina_Bool
15engine_software_sdl_args(const char *engine, int width, int height)
16{
17 int ok = 0;
18
19 if (!strcmp(engine, "sdl")) ok = 1;
20 if (!ok) return EINA_FALSE;
21
22 if (ok == 1)
23 {
24 Evas_Engine_Info_Buffer *einfo;
25
26 evas_output_method_set(evas, evas_render_method_lookup("buffer"));
27
28 einfo = (Evas_Engine_Info_Buffer *) evas_engine_info_get(evas);
29 if (einfo)
30 {
31 SDL_Init(SDL_INIT_NOPARACHUTE);
32
33 if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
34 {
35 printf("SDL_Init failed with %s", SDL_GetError());
36 SDL_Quit();
37 return EINA_FALSE;
38 }
39
40 einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
41 einfo->info.switch_data = SDL_SetVideoMode(width, height, 32, SDL_HWSURFACE | SDL_DOUBLEBUF);
42 if (!einfo->info.switch_data)
43 {
44 printf("SDL_SetVideoMode failed !");
45 return EINA_FALSE;
46 }
47
48 SDL_SetAlpha(einfo->info.switch_data, SDL_SRCALPHA, 0);
49 SDL_FillRect(einfo->info.switch_data, NULL, 0);
50
51 einfo->info.dest_buffer = ((SDL_Surface*)einfo->info.switch_data)->pixels;
52 einfo->info.dest_buffer_row_bytes = width * sizeof (int);
53 einfo->info.use_color_key = 0;
54 einfo->info.alpha_threshold = 0;
55 einfo->info.func.new_update_region = NULL;
56 einfo->info.func.free_update_region = NULL;
57 einfo->info.func.switch_buffer = _expedite_sdl_switch_buffer;
58 if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
59 {
60 printf("evas_engine_info_set() for engine 'sdl' with 'buffer' backend failed.");
61 return EINA_FALSE;
62 }
63 }
64 }
65
66 return EINA_TRUE;
67}
68
69void
70engine_software_sdl_loop(void)
71{
72 SDL_Event event;
73 int rmethod;
74
75 while(SDL_PollEvent(&event))
76 {
77 switch(event.type)
78 {
79 case SDL_MOUSEMOTION:
80 evas_event_feed_mouse_move(evas, event.motion.x, event.motion.y, 0, NULL);
81 break;
82 case SDL_MOUSEBUTTONDOWN:
83 evas_event_feed_mouse_move(evas, event.button.x, event.button.y, 0, NULL);
84 evas_event_feed_mouse_down(evas, event.button.button, EVAS_BUTTON_NONE, 0, NULL);
85 break;
86 case SDL_MOUSEBUTTONUP:
87 evas_event_feed_mouse_move(evas, event.button.x, event.button.y, 0, NULL);
88 evas_event_feed_mouse_up(evas, event.button.button, EVAS_BUTTON_NONE, 0, NULL);
89 break;
90 case SDL_VIDEORESIZE:
91 rmethod = evas_output_method_get(evas);
92 if (rmethod == evas_render_method_lookup("buffer"))
93 {
94 Evas_Engine_Info_Buffer *einfo;
95
96 einfo = (Evas_Engine_Info_Buffer *) evas_engine_info_get(evas);
97 if (einfo)
98 {
99 einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
100 einfo->info.switch_data = SDL_SetVideoMode(event.resize.w, event.resize.h, 32, SDL_HWSURFACE | SDL_DOUBLEBUF);
101 if (!einfo->info.switch_data)
102 {
103 return ;
104 }
105
106 SDL_SetAlpha(einfo->info.switch_data, SDL_SRCALPHA, 0);
107 SDL_FillRect(einfo->info.switch_data, NULL, 0);
108
109 einfo->info.dest_buffer = ((SDL_Surface*)einfo->info.switch_data)->pixels;
110 einfo->info.dest_buffer_row_bytes = event.resize.w * sizeof (int);
111 einfo->info.use_color_key = 0;
112 einfo->info.alpha_threshold = 0;
113 einfo->info.func.new_update_region = NULL;
114 einfo->info.func.free_update_region = NULL;
115 einfo->info.func.switch_buffer = _expedite_sdl_switch_buffer;
116 if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
117 {
118 return ;
119 }
120 }
121 }
122
123 evas_output_viewport_set(evas, 0, 0,
124 event.resize.h, event.resize.w);
125 evas_output_size_set(evas, event.resize.h, event.resize.w);
126 evas_output_size_get(evas, &win_w, &win_h);
127 break;
128 case SDL_VIDEOEXPOSE:
129 evas_output_size_get(evas, &win_w, &win_h);
130 evas_damage_rectangle_add(evas, 0, 0, win_w, win_h);
131 break;
132 case SDL_KEYDOWN:
133 switch (event.key.keysym.sym)
134 {
135 case SDLK_LSHIFT:
136 case SDLK_RSHIFT:
137 evas_key_modifier_on(evas, "Shift");
138 break;
139 case SDLK_RCTRL:
140 case SDLK_LCTRL:
141 evas_key_modifier_on(evas, "Control");
142 break;
143 case SDLK_MENU:
144 case SDLK_RALT:
145 case SDLK_LALT:
146 evas_key_modifier_on(evas, "Alt");
147 break;
148 case SDLK_LSUPER:
149 case SDLK_RSUPER:
150 evas_key_modifier_on(evas, "Super");
151 break;
152 case SDLK_CAPSLOCK:
153 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
154 evas_key_lock_off(evas, "Caps_Lock");
155 else
156 evas_key_lock_on(evas, "Caps_Lock");
157 break;
158 case SDLK_NUMLOCK:
159 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Num_Lock"))
160 evas_key_lock_off(evas, "Num_Lock");
161 else
162 evas_key_lock_on(evas, "Num_Lock");
163 break;
164 case SDLK_SCROLLOCK:
165 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock"))
166 evas_key_lock_off(evas, "Scroll_Lock");
167 else
168 evas_key_lock_on(evas, "Scroll_Lock");
169 break;
170 case SDLK_s:
171 case SDLK_ESCAPE:
172 evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL);
173 break;
174 case SDLK_KP_ENTER:
175 case SDLK_RETURN:
176 evas_event_feed_key_down(evas, "Return", "Return", NULL, NULL, 0, NULL);
177 break;
178 case SDLK_LEFT: evas_event_feed_key_down(evas, "Left", "Left", NULL, NULL, 0, NULL); break;
179 case SDLK_RIGHT: evas_event_feed_key_down(evas, "Right", "Right", NULL, NULL, 0, NULL); break;
180 case SDLK_q:
181 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
182 evas_event_feed_key_down(evas, "Q", "Q", NULL, NULL, 0, NULL);
183 else
184 evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL);
185 break;
186 default:
187 break;
188 }
189 break;
190 case SDL_KEYUP:
191 switch (event.key.keysym.sym)
192 {
193 case SDLK_LSHIFT:
194 case SDLK_RSHIFT:
195 evas_key_modifier_off(evas, "Shift");
196 break;
197 case SDLK_RCTRL:
198 case SDLK_LCTRL:
199 evas_key_modifier_off(evas, "Control");
200 break;
201 case SDLK_MENU:
202 case SDLK_RALT:
203 case SDLK_LALT:
204 evas_key_modifier_off(evas, "Alt");
205 break;
206 case SDLK_LSUPER:
207 case SDLK_RSUPER:
208 evas_key_modifier_off(evas, "Super");
209 break;
210 case SDLK_ESCAPE: evas_event_feed_key_up(evas, "Escape", "Escape", NULL, NULL, 0, NULL); break;
211 case SDLK_RETURN: evas_event_feed_key_up(evas, "Return", "Return", NULL, NULL, 0, NULL); break;
212 case SDLK_LEFT: evas_event_feed_key_up(evas, "Left", "Left", NULL, NULL, 0, NULL); break;
213 case SDLK_RIGHT: evas_event_feed_key_up(evas, "Right", "Right", NULL, NULL, 0, NULL); break;
214 case SDLK_q:
215 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
216 evas_event_feed_key_up(evas, "Q", "Q", NULL, NULL, 0, NULL);
217 else
218 evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL);
219 break;
220 default:
221 break;
222 }
223 break;
224 case SDL_QUIT:
225 case SDL_SYSWMEVENT:
226 case SDL_USEREVENT:
227 case SDL_ACTIVEEVENT:
228 case SDL_JOYAXISMOTION:
229 case SDL_JOYBALLMOTION:
230 case SDL_JOYHATMOTION:
231 case SDL_JOYBUTTONDOWN:
232 case SDL_JOYBUTTONUP:
233 default:
234 break;
235 }
236 }
237}
238
239void
240engine_software_sdl_shutdown(void)
241{
242}
diff --git a/src/bin/engine_software_sdl.h b/src/bin/engine_software_sdl.h
deleted file mode 100644
index 0641005..0000000
--- a/src/bin/engine_software_sdl.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef ENGINE_SOFTWARE_SDL_H
2#define ENGINE_SOFTWARE_SDL_H
3
4Eina_Bool engine_software_sdl_args(const char *engine, int width, int height);
5void engine_software_sdl_loop(void);
6void engine_software_sdl_shutdown(void);
7
8#endif
diff --git a/src/bin/engine_software_xcb.c b/src/bin/engine_software_xcb.c
deleted file mode 100644
index f1a8bbd..0000000
--- a/src/bin/engine_software_xcb.c
+++ /dev/null
@@ -1,399 +0,0 @@
1#include "main.h"
2
3#include <xcb/xcb.h>
4#include <xcb/xcb_keysyms.h>
5#include <Evas_Engine_Software_X11.h>
6
7#define XK_MISCELLANY
8#include <X11/keysymdef.h>
9
10enum {
11 XCB_SIZE_US_POSITION_HINT = 1 << 0,
12 XCB_SIZE_US_SIZE_HINT = 1 << 1,
13 XCB_SIZE_P_POSITION_HINT = 1 << 2,
14 XCB_SIZE_P_SIZE_HINT = 1 << 3,
15 XCB_SIZE_P_MIN_SIZE_HINT = 1 << 4,
16 XCB_SIZE_P_MAX_SIZE_HINT = 1 << 5,
17 XCB_SIZE_P_RESIZE_INC_HINT = 1 << 6,
18 XCB_SIZE_P_ASPECT_HINT = 1 << 7,
19 XCB_SIZE_BASE_SIZE_HINT = 1 << 8,
20 XCB_SIZE_P_WIN_GRAVITY_HINT = 1 << 9
21};
22
23struct xcb_size_hints_t {
24 uint32_t flags;
25 int32_t x, y, width, height;
26 int32_t min_width, min_height;
27 int32_t max_width, max_height;
28 int32_t width_inc, height_inc;
29 int32_t min_aspect_num, min_aspect_den;
30 int32_t max_aspect_num, max_aspect_den;
31 int32_t base_width, base_height;
32 uint32_t win_gravity;
33};
34
35
36static xcb_connection_t *conn = NULL;
37static xcb_screen_t *screen = NULL;
38static xcb_window_t win = 0;
39static int first_expose = 0;
40
41Eina_Bool
42engine_software_xcb_args(const char *engine, int width, int height)
43{
44 struct xcb_size_hints_t hints;
45 uint32_t value_list[6];
46 xcb_screen_iterator_t iter;
47 Evas_Engine_Info_Software_X11 *einfo;
48 xcb_intern_atom_reply_t *reply;
49 const char *str;
50 xcb_intern_atom_cookie_t cookie1;
51 xcb_intern_atom_cookie_t cookie2;
52 xcb_intern_atom_cookie_t cookie3;
53 xcb_intern_atom_cookie_t cookie4;
54 xcb_intern_atom_cookie_t cookie5;
55 xcb_atom_t string;
56 xcb_atom_t wm_name;
57 xcb_atom_t wm_class;
58 xcb_atom_t wm_normal_hint;
59 xcb_atom_t wm_size_hint;
60 uint32_t value_mask;
61 int s;
62 int s_tmp;
63 int l1;
64 int l2;
65 int i;
66
67 conn = xcb_connect(NULL, &s);
68 if (xcb_connection_has_error(conn)) return EINA_FALSE;
69
70 cookie1 = xcb_intern_atom_unchecked(conn, 0, strlen("STRING"), "STRING");
71 cookie2 = xcb_intern_atom_unchecked(conn, 0, strlen("WM_NAME"), "WM_NAME");
72 cookie3 = xcb_intern_atom_unchecked(conn, 0, strlen("WM_CLASS"), "WM_CLASS");
73 cookie4 = xcb_intern_atom_unchecked(conn, 0, strlen("WM_NORMAL_HINTS)"), "WM_NORMAL_HINTS)");
74 cookie5 = xcb_intern_atom_unchecked(conn, 0, strlen("WM_SIZE_HINTS)"), "WM_SIZE_HINTS)");
75
76 s_tmp = s;
77 iter = xcb_setup_roots_iterator(xcb_get_setup(conn));
78 for (; iter.rem; --s_tmp, xcb_screen_next (&iter))
79 if (s_tmp == 0)
80 {
81 screen = iter.data;
82 break;
83 }
84
85 evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
86 einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
87 if (!einfo)
88 {
89 printf("Evas does not support the Software XCB Engine\n");
90 goto close_connection;
91 }
92
93 einfo->info.backend = EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB;
94 einfo->info.connection = conn;
95 einfo->info.screen = screen;
96 einfo->info.visual = einfo->func.best_visual_get(1, conn, s);
97 einfo->info.colormap = einfo->func.best_colormap_get(1, conn, s);
98 einfo->info.depth = einfo->func.best_depth_get(1, conn, s);
99 einfo->info.rotation = 0;
100 einfo->info.debug = 0;
101
102 value_mask =
103 XCB_CW_BACK_PIXMAP | XCB_CW_BORDER_PIXEL | XCB_CW_BIT_GRAVITY |
104 XCB_CW_BACKING_STORE | XCB_CW_EVENT_MASK | XCB_CW_COLORMAP;
105
106 value_list[0] = XCB_NONE;
107 value_list[1] = 0;
108 value_list[2] = XCB_GRAVITY_BIT_FORGET;
109 value_list[3] = XCB_BACKING_STORE_NOT_USEFUL;
110 value_list[4] =
111 XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE |
112 XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE |
113 XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW |
114 XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_EXPOSURE |
115 XCB_EVENT_MASK_STRUCTURE_NOTIFY;
116 value_list[5] = einfo->info.colormap;
117
118 win = xcb_generate_id(conn);
119 if (!win)
120 goto close_connection;
121 xcb_create_window(conn,
122 einfo->info.depth,
123 win, screen->root, 0, 0, width, height, 0,
124 XCB_WINDOW_CLASS_INPUT_OUTPUT,
125 ((xcb_visualtype_t *)einfo->info.visual)->visual_id,
126 value_mask,
127 value_list);
128 einfo->info.drawable = win;
129
130 if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
131 {
132 printf("Evas can not setup the informations of the Software XCB Engine\n");
133 goto destroy_window;
134 }
135
136 if (fullscreen)
137 {
138 xcb_intern_atom_cookie_t cookie1;
139 xcb_intern_atom_cookie_t cookie2;
140 xcb_intern_atom_reply_t *reply;
141 xcb_atom_t prop;
142 xcb_atom_t type;
143 xcb_atom_t state;
144
145 cookie1 = xcb_intern_atom_unchecked(conn, 0, strlen("_NET_WM_STATE"), "_NET_WM_STATE");
146 cookie2 = xcb_intern_atom_unchecked(conn, 0, strlen("_NET_WM_STATE_FULLSCREEN"), "_NET_WM_STATE_FULLSCREEN");
147 reply = xcb_intern_atom_reply(conn, cookie1, NULL);
148 prop = reply->atom;
149 free(reply);
150 reply = xcb_intern_atom_reply(conn, cookie2, NULL);
151 state = reply->atom;
152 free(reply);
153 xcb_change_property(conn, XCB_PROP_MODE_REPLACE, win, prop, XCB_ATOM_ATOM, 32, 1, (const void *)&state);
154 }
155
156 str = "expedite\0Expedite";
157
158 memset(&hints, 0, sizeof(hints));
159 hints.flags = XCB_SIZE_US_SIZE_HINT | XCB_SIZE_P_SIZE_HINT | XCB_SIZE_P_MIN_SIZE_HINT | XCB_SIZE_P_MAX_SIZE_HINT;
160 hints.min_width = width;
161 hints.max_width = width;
162 hints.min_height = height;
163 hints.max_height = height;
164
165 reply = xcb_intern_atom_reply(conn, cookie1, NULL);
166 string = reply->atom;
167 free(reply);
168
169 reply = xcb_intern_atom_reply(conn, cookie2, NULL);
170 wm_name = reply->atom;
171 free(reply);
172
173 xcb_change_property(conn, XCB_PROP_MODE_REPLACE, win,
174 wm_name, string, 8,
175 strlen("Expedite - Evas Test Suite"), "Expedite - Evas Test Suite");
176
177 reply = xcb_intern_atom_reply(conn, cookie3, NULL);
178 wm_class = reply->atom;
179 free(reply);
180
181 xcb_change_property(conn, XCB_PROP_MODE_REPLACE, win,
182 wm_class, string, 8,
183 l1 + l2 + 1, str);
184
185 reply = xcb_intern_atom_reply(conn, cookie4, NULL);
186 wm_normal_hint = reply->atom;
187 free(reply);
188
189 reply = xcb_intern_atom_reply(conn, cookie5, NULL);
190 wm_size_hint = reply->atom;
191 free(reply);
192
193 xcb_change_property(conn, XCB_PROP_MODE_REPLACE, win,
194 wm_normal_hint, wm_size_hint, 32,
195 sizeof(hints) / 4, &hints);
196
197 xcb_map_window(conn, win);
198
199 free(xcb_get_input_focus_reply(conn, xcb_get_input_focus_unchecked(conn), NULL));
200
201 while (!first_expose)
202 engine_software_xcb_loop();
203 return EINA_TRUE;
204
205 destroy_window:
206 xcb_destroy_window(conn, win);
207 close_connection:
208 free(xcb_intern_atom_reply(conn, cookie1, NULL));
209 free(xcb_intern_atom_reply(conn, cookie2, NULL));
210 free(xcb_intern_atom_reply(conn, cookie3, NULL));
211 free(xcb_intern_atom_reply(conn, cookie4, NULL));
212 free(xcb_intern_atom_reply(conn, cookie5, NULL));
213 xcb_disconnect(conn);
214
215 return EINA_FALSE;
216}
217
218void
219engine_software_xcb_loop(void)
220{
221 xcb_generic_event_t *ev;
222
223 again:
224 ev = xcb_poll_for_event(conn);
225 if (!ev)
226 return;
227
228 switch (ev->response_type)
229 {
230 case XCB_BUTTON_PRESS:
231 {
232 xcb_button_press_event_t *e;
233
234 e = (xcb_button_press_event_t *)ev;
235
236 evas_event_feed_mouse_move(evas, e->event_x, e->event_y, 0, NULL);
237 evas_event_feed_mouse_down(evas, e->detail, EVAS_BUTTON_NONE, 0, NULL);
238 break;
239 }
240 case XCB_BUTTON_RELEASE:
241 {
242 xcb_button_release_event_t *e;
243
244 e = (xcb_button_release_event_t *)ev;
245
246 evas_event_feed_mouse_move(evas, e->event_x, e->event_y, 0, NULL);
247 evas_event_feed_mouse_up(evas, e->detail, EVAS_BUTTON_NONE, 0, NULL);
248 break;
249 }
250 case XCB_MOTION_NOTIFY:
251 {
252 xcb_motion_notify_event_t *e;
253
254 e = (xcb_motion_notify_event_t *)ev;
255
256 evas_event_feed_mouse_move(evas, e->event_x, e->event_y, 0, NULL);
257 break;
258 }
259 case XCB_EXPOSE:
260 {
261 xcb_expose_event_t *e;
262
263 e = (xcb_expose_event_t *)ev;
264
265 first_expose = 1;
266 evas_damage_rectangle_add(evas,
267 e->x,
268 e->y,
269 e->width,
270 e->height);
271 break;
272 }
273 case XCB_CONFIGURE_NOTIFY:
274 {
275 xcb_configure_notify_event_t *e;
276
277 e = (xcb_configure_notify_event_t *)ev;
278
279 evas_output_viewport_set(evas, 0, 0,
280 e->width,
281 e->height);
282 evas_output_size_set(evas,
283 e->width,
284 e->height);
285 win_w = e->width;
286 win_h = e->height;
287 break;
288 }
289 case XCB_ENTER_NOTIFY:
290 evas_event_feed_mouse_in(evas, 0, NULL);
291 break;
292 case XCB_LEAVE_NOTIFY:
293 evas_event_feed_mouse_out(evas, 0, NULL);
294 break;
295 case XCB_KEY_PRESS:
296 {
297 xcb_key_press_event_t *e;
298 xcb_key_symbols_t *kss;
299 xcb_keysym_t ks;
300 char *str = "";
301
302 e = (xcb_key_press_event_t *)ev;
303
304 kss = xcb_key_symbols_alloc(conn);
305
306 ks = xcb_key_symbols_get_keysym(kss, e->detail, 0);
307
308 if ((ks == XK_Shift_L) || (ks == XK_Shift_R))
309 evas_key_modifier_on(evas, "Shift");
310 else if ((ks == XK_Control_L) || (ks == XK_Control_R))
311 evas_key_modifier_on(evas, "Control");
312 else if ((ks == XK_Alt_L) || (ks == XK_Alt_R))
313 evas_key_modifier_on(evas, "Alt");
314 else if ((ks == XK_Super_L) || (ks == XK_Super_R))
315 evas_key_modifier_on(evas, "Super");
316 else if (ks == XK_Caps_Lock)
317 {
318 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
319 evas_key_lock_off(evas, "Caps_Lock");
320 else
321 evas_key_lock_on(evas, "Caps_Lock");
322 }
323 else if (ks == XK_Scroll_Lock)
324 {
325 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock"))
326 evas_key_lock_off(evas, "Scroll_Lock");
327 else
328 evas_key_lock_on(evas, "Scroll_Lock");
329 }
330
331 if (ks == XK_Left)
332 str = "Left";
333 if (ks == XK_Right)
334 str = "Right";
335 if (ks == XK_Escape)
336 str = "Escape";
337 if (ks == XK_Return)
338 str = "Return";
339 if (ks == 113)
340 str = "q";
341
342 evas_event_feed_key_down(evas, str, str, NULL, NULL, 0, NULL);
343
344 xcb_key_symbols_free(kss);
345 break;
346 }
347 case XCB_KEY_RELEASE:
348 {
349 xcb_key_release_event_t *e;
350 xcb_key_symbols_t *kss;
351 xcb_keysym_t ks;
352 char *str = "";
353
354 e = (xcb_key_release_event_t *)ev;
355
356 kss = xcb_key_symbols_alloc(conn);
357
358 ks = xcb_key_symbols_get_keysym(kss, e->detail, 0);
359
360 if ((ks == XK_Shift_L) || (ks == XK_Shift_R))
361 evas_key_modifier_on(evas, "Shift");
362 else if ((ks == XK_Control_L) || (ks == XK_Control_R))
363 evas_key_modifier_on(evas, "Control");
364 else if ((ks == XK_Alt_L) || (ks == XK_Alt_R))
365 evas_key_modifier_on(evas, "Alt");
366 else if ((ks == XK_Super_L) || (ks == XK_Super_R))
367 evas_key_modifier_on(evas, "Super");
368
369 if (ks == XK_Left)
370 str = "Left";
371 if (ks == XK_Right)
372 str = "Right";
373 if (ks == XK_Escape)
374 str = "Escape";
375 if (ks == XK_Return)
376 str = "Return";
377 if (ks == 113)
378 str = "q";
379
380 evas_event_feed_key_up(evas, str, str, NULL, NULL, 0, NULL);
381
382 xcb_key_symbols_free(kss);
383 break;
384 }
385 default:
386 free(ev);
387 return;
388 }
389 free(ev);
390
391 goto again;
392}
393
394void
395engine_software_xcb_shutdown(void)
396{
397 xcb_destroy_window(conn, win);
398 xcb_disconnect(conn);
399}
diff --git a/src/bin/engine_software_xcb.h b/src/bin/engine_software_xcb.h
deleted file mode 100644
index 3cbf3b8..0000000
--- a/src/bin/engine_software_xcb.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef ENGINE_SOFTWARE_XCB_H
2#define ENGINE_SOFTWARE_XCB_H
3
4Eina_Bool engine_software_xcb_args(const char *engine, int width, int height);
5void engine_software_xcb_loop(void);
6void engine_software_xcb_shutdown(void);
7
8#endif
diff --git a/src/bin/engine_software_xlib.c b/src/bin/engine_software_xlib.c
deleted file mode 100644
index 0273796..0000000
--- a/src/bin/engine_software_xlib.c
+++ /dev/null
@@ -1,236 +0,0 @@
1#include "main.h"
2
3#include <X11/Xlib.h>
4#include <X11/XKBlib.h>
5#include <X11/Xutil.h>
6#include <X11/Xatom.h>
7#include <Evas_Engine_Software_X11.h>
8
9static Display *disp = NULL;
10static Window win = 0;
11static int first_expose = 0;
12
13Eina_Bool
14engine_software_xlib_args(const char *engine __UNUSED__, int width, int height)
15{
16 XSetWindowAttributes attr;
17 XClassHint chint;
18 XSizeHints szhints;
19 Evas_Engine_Info_Software_X11 *einfo;
20
21 disp = XOpenDisplay(NULL);
22 if (!disp) return EINA_FALSE;
23
24 evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
25 einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
26 if (!einfo)
27 {
28 printf("Evas does not support the Software Xlib Engine\n");
29 goto close_display;
30 }
31
32 einfo->info.backend = EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB;
33 einfo->info.connection = disp;
34 einfo->info.screen = NULL;
35 einfo->info.visual = einfo->func.best_visual_get(0, disp, DefaultScreen(disp));
36 einfo->info.colormap = einfo->func.best_colormap_get(0, disp, DefaultScreen(disp));
37 einfo->info.depth = einfo->func.best_depth_get(0, disp, DefaultScreen(disp));
38 einfo->info.rotation = 0;
39 einfo->info.debug = 0;
40#ifdef EVAS_FRAME_QUEUING
41 {
42 char *render_mode;
43 render_mode = getenv("EVAS_RENDER_MODE");
44 if (render_mode && !strcmp(render_mode, "non-blocking"))
45 {
46 einfo->render_mode = EVAS_RENDER_MODE_NONBLOCKING;
47 }
48 }
49#endif
50 attr.backing_store = NotUseful;
51 attr.colormap = einfo->info.colormap;
52 attr.border_pixel = 0;
53 attr.background_pixmap = None;
54 attr.event_mask =
55 ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask |
56 StructureNotifyMask | EnterWindowMask | LeaveWindowMask |
57 KeyPressMask | KeyReleaseMask;
58 attr.bit_gravity = ForgetGravity;
59 win = XCreateWindow(disp, DefaultRootWindow(disp),
60 0, 0, width, height, 0,
61 einfo->info.depth, InputOutput,
62 einfo->info.visual,
63 CWBackingStore | CWColormap |
64 CWBackPixmap | CWBorderPixel |
65 CWBitGravity | CWEventMask,
66 &attr);
67 if (!win)
68 goto close_display;
69
70 einfo->info.drawable = win;
71 if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
72 {
73 printf("Evas can not setup the informations of the Software Xlib Engine\n");
74 goto destroy_window;
75 }
76
77 if (fullscreen)
78 {
79 Atom prop = XInternAtom(disp, "_NET_WM_STATE", False);
80 Atom state = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False);
81 unsigned long data = state;
82 XChangeProperty(disp, win, prop, XA_ATOM, 32, PropModeReplace,
83 (unsigned char*) &data, 1);
84 }
85
86 XStoreName(disp, win, "Expedite - Evas Test Suite");
87 chint.res_name = "expedite";
88 chint.res_class = "Expedite";
89 XSetClassHint(disp, win, &chint);
90 szhints.flags = PMinSize | PMaxSize | PSize | USSize;
91 szhints.min_width = szhints.max_width = width;
92 szhints.min_height = szhints.max_height = height;
93 XSetWMNormalHints(disp, win, &szhints);
94 XMapWindow(disp, win);
95 XSync(disp, False);
96 while (!first_expose)
97 engine_software_xlib_loop();
98 return EINA_TRUE;
99
100 destroy_window:
101 XDestroyWindow(disp, win);
102 close_display:
103 XCloseDisplay(disp);
104
105 return EINA_FALSE;
106}
107
108void
109engine_software_xlib_loop(void)
110{
111 XEvent ev;
112 KeySym ks;
113 char *kstr;
114
115 again:
116 if (!XCheckMaskEvent(disp,
117 ExposureMask |
118 StructureNotifyMask |
119 KeyPressMask |
120 KeyReleaseMask |
121 ButtonPressMask |
122 ButtonReleaseMask |
123 PointerMotionMask |
124 EnterWindowMask |
125 LeaveWindowMask, &ev))
126 return;
127 switch (ev.type)
128 {
129 case ButtonPress:
130 evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y, 0, NULL);
131 evas_event_feed_mouse_down(evas, ev.xbutton.button, EVAS_BUTTON_NONE, 0, NULL);
132 break;
133 case ButtonRelease:
134 evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y, 0, NULL);
135 evas_event_feed_mouse_up(evas, ev.xbutton.button, EVAS_BUTTON_NONE, 0, NULL);
136 break;
137 case MotionNotify:
138 evas_event_feed_mouse_move(evas, ev.xmotion.x, ev.xmotion.y, 0, NULL);
139 break;
140 case Expose:
141 first_expose = 1;
142 evas_damage_rectangle_add(evas,
143 ev.xexpose.x,
144 ev.xexpose.y,
145 ev.xexpose.width,
146 ev.xexpose.height);
147 break;
148 case ConfigureNotify:
149 evas_output_viewport_set(evas, 0, 0,
150 ev.xconfigure.width,
151 ev.xconfigure.height);
152 evas_output_size_set(evas,
153 ev.xconfigure.width,
154 ev.xconfigure.height);
155 win_w = ev.xconfigure.width;
156 win_h = ev.xconfigure.height;
157 break;
158 case EnterNotify:
159 evas_event_feed_mouse_in(evas, 0, NULL);
160 break;
161 case LeaveNotify:
162 evas_event_feed_mouse_out(evas, 0, NULL);
163 break;
164 case KeyPress:
165 ks = XkbKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0, 0);
166 kstr = XKeysymToString(ks);
167 if (kstr)
168 {
169 if ((!strcmp(kstr, "Shift_L")) ||
170 (!strcmp(kstr, "Shift_R")))
171 evas_key_modifier_on(evas, "Shift");
172 if ((!strcmp(kstr, "Control_L")) ||
173 (!strcmp(kstr, "Control_R")))
174 evas_key_modifier_on(evas, "Control");
175 if ((!strcmp(kstr, "Alt_L")) ||
176 (!strcmp(kstr, "Alt_R")))
177 evas_key_modifier_on(evas, "Alt");
178 if ((!strcmp(kstr, "Super_L")) ||
179 (!strcmp(kstr, "Super_R")))
180 evas_key_modifier_on(evas, "Super");
181 if (!strcmp(kstr, "Caps_Lock"))
182 {
183 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
184 evas_key_lock_off(evas, "Caps_Lock");
185 else
186 evas_key_lock_on(evas, "Caps_Lock");
187 }
188 if (!strcmp(kstr, "Num_Lock"))
189 {
190 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Num_Lock"))
191 evas_key_lock_off(evas, "Num_Lock");
192 else
193 evas_key_lock_on(evas, "Num_Lock");
194 }
195 if (!strcmp(kstr, "Scroll_Lock"))
196 {
197 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock"))
198 evas_key_lock_off(evas, "Scroll_Lock");
199 else
200 evas_key_lock_on(evas, "Scroll_Lock");
201 }
202 if (kstr) evas_event_feed_key_down(evas, kstr, kstr, NULL, NULL, 0, NULL);
203 }
204 break;
205 case KeyRelease:
206 ks = XkbKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0, 0);
207 kstr = XKeysymToString(ks);
208 if (kstr)
209 {
210 if ((!strcmp(kstr, "Shift_L")) ||
211 (!strcmp(kstr, "Shift_R")))
212 evas_key_modifier_off(evas, "Shift");
213 if ((!strcmp(kstr, "Control_L")) ||
214 (!strcmp(kstr, "Control_R")))
215 evas_key_modifier_off(evas, "Control");
216 if ((!strcmp(kstr, "Alt_L")) ||
217 (!strcmp(kstr, "Alt_R")))
218 evas_key_modifier_off(evas, "Alt");
219 if ((!strcmp(kstr, "Super_L")) ||
220 (!strcmp(kstr, "Super_R")))
221 evas_key_modifier_off(evas, "Super");
222 evas_event_feed_key_up(evas, kstr, kstr, NULL, NULL, 0, NULL);
223 }
224 break;
225 default:
226 break;
227 }
228 goto again;
229}
230
231void
232engine_software_xlib_shutdown(void)
233{
234 XDestroyWindow(disp, win);
235 XCloseDisplay(disp);
236}
diff --git a/src/bin/engine_software_xlib.h b/src/bin/engine_software_xlib.h
deleted file mode 100644
index f441d4c..0000000
--- a/src/bin/engine_software_xlib.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef ENGINE_SOFTWARE_XLIB_H
2#define ENGINE_SOFTWARE_XLIB_H
3
4Eina_Bool engine_software_xlib_args(const char *engine, int width, int height);
5void engine_software_xlib_loop(void);
6void engine_software_xlib_shutdown(void);
7
8#endif
diff --git a/src/bin/engine_wayland_common.c b/src/bin/engine_wayland_common.c
deleted file mode 100644
index ca53163..0000000
--- a/src/bin/engine_wayland_common.c
+++ /dev/null
@@ -1,152 +0,0 @@
1#include <linux/input.h>
2
3#include "main.h"
4#include "engine_wayland_common.h"
5
6
7/* Seat (input) handler */
8static void _seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps);
9static const struct wl_seat_listener engine_wayland_seat_listener =
10{
11 _seat_handle_capabilities,
12 NULL // _seat_handle_name
13};
14
15/* Keyboard handler */
16static void _keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, uint32_t format, int fd, uint32_t size);
17static void _keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys);
18static void _keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface);
19static void _keyboard_handle_key(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state);
20static void _keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group);
21static const struct wl_keyboard_listener engine_wayland_keyboard_listener =
22{
23 _keyboard_handle_keymap,
24 _keyboard_handle_enter,
25 _keyboard_handle_leave,
26 _keyboard_handle_key,
27 _keyboard_handle_modifiers,
28};
29
30/* Shell Surface handler */
31static void _shell_surface_handle_ping(void *data, struct wl_shell_surface *shell_surface, uint32_t serial);
32static const struct wl_shell_surface_listener _shell_surface_listener =
33{
34 _shell_surface_handle_ping,
35 NULL, /* configure */
36 NULL, /* popup_done */
37};
38
39/*
40 * Public
41 */
42void
43engine_wayland_register_seat(struct wl_registry *registry, unsigned int id)
44{
45 struct wl_seat *seat = wl_registry_bind(registry, id, &wl_seat_interface, 1);
46 wl_seat_add_listener(seat, &engine_wayland_seat_listener, NULL);
47}
48
49struct wl_shell_surface *
50engine_wayland_create_shell_surface(struct wl_shell *shell, struct wl_surface *surface, const char *title)
51{
52 struct wl_shell_surface *shell_surface = wl_shell_get_shell_surface(shell, surface);
53 wl_shell_surface_set_title(shell_surface, title);
54 wl_shell_surface_add_listener(shell_surface, &_shell_surface_listener, NULL);
55 wl_shell_surface_set_toplevel(shell_surface);
56
57 return shell_surface;
58}
59
60/*
61 * Static
62 */
63static void
64_seat_handle_capabilities(void *data __UNUSED__, struct wl_seat *seat, enum wl_seat_capability caps)
65{
66 static struct wl_keyboard *kbd = NULL;
67
68 if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !kbd)
69 {
70 kbd = wl_seat_get_keyboard(seat);
71 wl_keyboard_add_listener(kbd, &engine_wayland_keyboard_listener, NULL);
72 }
73 else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && kbd)
74 {
75 wl_keyboard_destroy(kbd);
76 kbd = NULL;
77 }
78}
79
80static void
81_keyboard_handle_keymap(void *data __UNUSED__, struct wl_keyboard *keyboard __UNUSED__, uint32_t format __UNUSED__, int fd __UNUSED__, uint32_t size __UNUSED__)
82{
83}
84
85static void
86_keyboard_handle_enter(void *data __UNUSED__, struct wl_keyboard *keyboard __UNUSED__, uint32_t serial __UNUSED__, struct wl_surface *surface __UNUSED__, struct wl_array *keys __UNUSED__)
87{
88}
89
90static void
91_keyboard_handle_leave(void *data __UNUSED__, struct wl_keyboard *keyboard __UNUSED__, uint32_t serial __UNUSED__, struct wl_surface *surface __UNUSED__)
92{
93}
94
95static void
96_keyboard_handle_key(void *data __UNUSED__, struct wl_keyboard *keyboard __UNUSED__, uint32_t serial __UNUSED__, uint32_t time __UNUSED__, uint32_t key, uint32_t state)
97{
98 const char *key_str;
99
100 switch (key)
101 {
102 case KEY_LEFT:
103 key_str = "Left";
104 break;
105
106 case KEY_RIGHT:
107 key_str = "Right";
108 break;
109
110 case KEY_ENTER:
111 case KEY_KPENTER:
112 key_str = "Return";
113 break;
114
115 case KEY_ESC:
116 key_str = "Escape";
117 break;
118
119 default:
120 key_str = NULL;
121 break;
122 }
123
124 if (key_str)
125 {
126 switch (state)
127 {
128 case WL_KEYBOARD_KEY_STATE_RELEASED:
129 evas_event_feed_key_up(evas, key_str, key_str, NULL, NULL, 0, NULL);
130 break;
131
132 case WL_KEYBOARD_KEY_STATE_PRESSED:
133 evas_event_feed_key_down(evas, key_str, key_str, NULL, NULL, 0, NULL);
134 break;
135
136 default:
137 break;
138 }
139 }
140}
141
142static void
143_keyboard_handle_modifiers(void *data __UNUSED__, struct wl_keyboard *keyboard __UNUSED__, uint32_t serial __UNUSED__, uint32_t mods_depressed __UNUSED__, uint32_t mods_latched __UNUSED__, uint32_t mods_locked __UNUSED__, uint32_t group __UNUSED__)
144{
145}
146
147static void
148_shell_surface_handle_ping(void *data __UNUSED__, struct wl_shell_surface *shell_surface, uint32_t serial)
149{
150 wl_shell_surface_pong(shell_surface, serial);
151}
152
diff --git a/src/bin/engine_wayland_common.h b/src/bin/engine_wayland_common.h
deleted file mode 100644
index 408b65d..0000000
--- a/src/bin/engine_wayland_common.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef ENGINE_WAYLAND_COMMON_H
2#define ENGINE_WAYLAND_COMMON_H
3
4#include <wayland-client.h>
5
6void engine_wayland_register_seat(struct wl_registry *registry, unsigned int id);
7struct wl_shell_surface *engine_wayland_create_shell_surface(struct wl_shell *shell, struct wl_surface *surface, const char *title);
8
9#endif
10
diff --git a/src/bin/engine_wayland_egl.c b/src/bin/engine_wayland_egl.c
deleted file mode 100644
index 3bb1972..0000000
--- a/src/bin/engine_wayland_egl.c
+++ /dev/null
@@ -1,112 +0,0 @@
1#include <string.h>
2#include <assert.h>
3
4#include "main.h"
5#include "engine_wayland_common.h"
6
7#include <Evas_Engine_Wayland_Egl.h>
8#include <wayland-client.h>
9#include <wayland-egl.h>
10
11/*
12 * Global struct
13 */
14struct _engine_wayland_egl_display
15{
16 struct wl_display *display;
17 struct wl_registry *registry;
18 struct wl_compositor *compositor;
19 struct wl_surface *surface;
20 struct wl_shell *shell;
21 struct wl_shell_surface *shell_surface;
22};
23
24static struct _engine_wayland_egl_display wl;
25
26/*
27 * Function Prototypes
28 */
29/* Registry handler */
30static void _registry_handle_global(void *data, struct wl_registry *registry, unsigned int id, const char *interface, unsigned int version __UNUSED__);
31static const struct wl_registry_listener _registry_listener =
32{
33 _registry_handle_global,
34 NULL, /* global_remove */
35};
36
37/*
38 * API
39 */
40Eina_Bool
41engine_wayland_egl_args(const char *engine __UNUSED__, int width __UNUSED__, int height __UNUSED__)
42{
43 Evas_Engine_Info_Wayland_Egl *einfo;
44
45 evas_output_method_set(evas, evas_render_method_lookup("wayland_egl"));
46 einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(evas);
47 if (!einfo)
48 {
49 printf("Evas does not support the Wayland EGL Engine\n");
50 return EINA_FALSE;
51 }
52
53 wl.display = wl_display_connect(NULL);
54 if (!wl.display)
55 {
56 printf("Expedite cannot connect to wayland display\n");
57 return EINA_FALSE;
58 }
59
60 wl.registry = wl_display_get_registry(wl.display);
61 wl_registry_add_listener(wl.registry, &_registry_listener, NULL);
62 wl_display_roundtrip(wl.display);
63
64 assert(wl.compositor != NULL);
65 assert(wl.shell != NULL);
66
67 wl.surface = wl_compositor_create_surface(wl.compositor);
68 wl.shell_surface = engine_wayland_create_shell_surface(wl.shell, wl.surface, "Expedite Wayland EGL");
69
70 einfo->info.display = wl.display;
71 einfo->info.surface = wl.surface;
72 if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
73 {
74 printf("Evas can not setup the informations of the Wayland EGL Engine\n");
75 return EINA_FALSE;
76 }
77
78 return EINA_TRUE;
79}
80
81void
82engine_wayland_egl_loop(void)
83{
84 assert(wl_display_dispatch_pending(wl.display) != -1);
85 wl_display_flush(wl.display);
86}
87
88void
89engine_wayland_egl_shutdown(void)
90{
91 wl_shell_surface_destroy(wl.shell_surface);
92 wl_surface_destroy(wl.surface);
93 wl_shell_destroy(wl.shell);
94 wl_compositor_destroy(wl.compositor);
95 wl_registry_destroy(wl.registry);
96 wl_display_flush(wl.display);
97 wl_display_disconnect(wl.display);
98}
99
100/*
101 * Function implementation
102 */
103static void
104_registry_handle_global(void *data __UNUSED__, struct wl_registry *registry, unsigned int id, const char *interface, unsigned int version __UNUSED__)
105{
106 if (!strcmp(interface, "wl_compositor"))
107 wl.compositor = wl_registry_bind(registry, id, &wl_compositor_interface, 1);
108 else if (!strcmp(interface, "wl_shell"))
109 wl.shell = wl_registry_bind(registry, id, &wl_shell_interface, 1);
110 else if (!strcmp(interface, "wl_seat"))
111 engine_wayland_register_seat(registry, id);
112}
diff --git a/src/bin/engine_wayland_egl.h b/src/bin/engine_wayland_egl.h
deleted file mode 100644
index d8e6781..0000000
--- a/src/bin/engine_wayland_egl.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef ENGINE_WAYLAND_EGL_H
2#define ENGINE_WAYLAND_EGL_H
3
4Eina_Bool engine_wayland_egl_args(const char *engine, int width, int height);
5void engine_wayland_egl_loop(void);
6void engine_wayland_egl_shutdown(void);
7
8#endif
diff --git a/src/bin/engine_wayland_shm.c b/src/bin/engine_wayland_shm.c
deleted file mode 100644
index 395ca9f..0000000
--- a/src/bin/engine_wayland_shm.c
+++ /dev/null
@@ -1,126 +0,0 @@
1#include <stdio.h>
2#include <string.h>
3#include <assert.h>
4#include <sys/mman.h>
5
6#include "main.h"
7#include "engine_wayland_common.h"
8
9#include <Evas_Engine_Wayland_Shm.h>
10#include <wayland-client.h>
11
12/*
13 * Global struct
14 */
15struct _engine_wayland_shm_display
16{
17 struct wl_display *display;
18 struct wl_registry *registry;
19 struct wl_compositor *compositor;
20 struct wl_surface *surface;
21 struct wl_shell *shell;
22 struct wl_shell_surface *shell_surface;
23 struct wl_shm *shm;
24 int width;
25 int height;
26};
27
28static struct _engine_wayland_shm_display wl;
29
30/*
31 * Function Prototypes
32 */
33/* static void _engine_wayland_shm_create_buffer(int width, int height); */
34
35/* Registry handler */
36static void _registry_handle_global(void *data, struct wl_registry *registry, unsigned int id, const char *interface, unsigned int version __UNUSED__);
37static const struct wl_registry_listener _registry_listener =
38{
39 _registry_handle_global,
40 NULL, /* global_remove */
41};
42
43/*
44 * API
45 */
46Eina_Bool
47engine_wayland_shm_args(const char *engine __UNUSED__, int width, int height)
48{
49 Evas_Engine_Info_Wayland_Shm *einfo;
50
51 evas_output_method_set(evas, evas_render_method_lookup("wayland_shm"));
52 einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(evas);
53 if (!einfo)
54 {
55 printf("Evas does not support the Wayland SHM Engine\n");
56 return EINA_FALSE;
57 }
58
59 wl.display = wl_display_connect(NULL);
60 if (!wl.display)
61 {
62 printf("Expedite cannot connect to wayland display\n");
63 return EINA_FALSE;
64 }
65
66 wl.registry = wl_display_get_registry(wl.display);
67 wl_registry_add_listener(wl.registry, &_registry_listener, NULL);
68 wl_display_roundtrip(wl.display);
69
70 assert(wl.compositor != NULL);
71 assert(wl.shell != NULL);
72 assert(wl.shm != NULL);
73
74 wl.surface = wl_compositor_create_surface(wl.compositor);
75 wl.shell_surface = engine_wayland_create_shell_surface(wl.shell, wl.surface, "Expedite Wayland SHM");
76
77 einfo->info.wl_shm = wl.shm;
78 einfo->info.wl_surface = wl.surface;
79 if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
80 {
81 printf("Evas can not setup the informations of the Wayland SHM Engine\n");
82 return EINA_FALSE;
83 }
84
85 wl.width = width;
86 wl.height = height;
87
88 return EINA_TRUE;
89}
90
91void
92engine_wayland_shm_loop(void)
93{
94 assert(wl_display_dispatch_pending(wl.display) != -1);
95 wl_display_flush(wl.display);
96}
97
98
99void
100engine_wayland_shm_shutdown(void)
101{
102 wl_shell_surface_destroy(wl.shell_surface);
103 wl_surface_destroy(wl.surface);
104 wl_shm_destroy(wl.shm);
105 wl_shell_destroy(wl.shell);
106 wl_compositor_destroy(wl.compositor);
107 wl_registry_destroy(wl.registry);
108 wl_display_flush(wl.display);
109 wl_display_disconnect(wl.display);
110}
111
112/*
113 * Function implementation
114 */
115static void
116_registry_handle_global(void *data __UNUSED__, struct wl_registry *registry, unsigned int id, const char *interface, unsigned int version __UNUSED__)
117{
118 if (!strcmp(interface, "wl_compositor"))
119 wl.compositor = wl_registry_bind(registry, id, &wl_compositor_interface, 1);
120 else if (!strcmp(interface, "wl_shell"))
121 wl.shell = wl_registry_bind(registry, id, &wl_shell_interface, 1);
122 else if (!strcmp(interface, "wl_seat"))
123 engine_wayland_register_seat(registry, id);
124 else if (!strcmp(interface, "wl_shm"))
125 wl.shm = wl_registry_bind(registry, id, &wl_shm_interface, 1);
126}
diff --git a/src/bin/engine_wayland_shm.h b/src/bin/engine_wayland_shm.h
deleted file mode 100644
index 5e16451..0000000
--- a/src/bin/engine_wayland_shm.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef ENGINE_WAYLAND_SHM_H
2#define ENGINE_WAYLAND_SHM_H
3
4Eina_Bool engine_wayland_shm_args(const char *engine, int width, int height);
5void engine_wayland_shm_loop(void);
6void engine_wayland_shm_shutdown(void);
7
8#endif
diff --git a/src/bin/engine_xrender_x11.c b/src/bin/engine_xrender_x11.c
deleted file mode 100644
index 7e3023a..0000000
--- a/src/bin/engine_xrender_x11.c
+++ /dev/null
@@ -1,221 +0,0 @@
1#include "main.h"
2
3#include <X11/Xlib.h>
4#include <X11/Xutil.h>
5#include <X11/Xatom.h>
6#include <Evas_Engine_XRender_X11.h>
7
8static Display *disp = NULL;
9static Window win = 0;
10static int first_expose = 0;
11
12Eina_Bool
13engine_xrender_x11_args(const char *engine, int width, int height)
14{
15 XSetWindowAttributes attr;
16 XClassHint chint;
17 XSizeHints szhints;
18 Evas_Engine_Info_XRender_X11 *einfo;
19 int i;
20
21 disp = XOpenDisplay(NULL);
22 if (!disp) return EINA_FALSE;
23
24 evas_output_method_set(evas, evas_render_method_lookup("xrender_x11"));
25 einfo = (Evas_Engine_Info_XRender_X11 *)evas_engine_info_get(evas);
26 if (!einfo)
27 {
28 printf("Evas does not support the XRender X11 Engine\n");
29 goto close_display;
30 }
31
32 einfo->info.backend = EVAS_ENGINE_INFO_XRENDER_BACKEND_XLIB;
33 einfo->info.connection = disp;
34 einfo->info.screen = NULL;
35 einfo->info.visual = DefaultVisual(disp, DefaultScreen(disp));
36 attr.backing_store = NotUseful;
37 attr.border_pixel = 0;
38 attr.background_pixmap = None;
39 attr.event_mask =
40 ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask |
41 StructureNotifyMask | EnterWindowMask | LeaveWindowMask |
42 KeyPressMask | KeyReleaseMask;
43 attr.bit_gravity = ForgetGravity;
44 win = XCreateWindow(disp, DefaultRootWindow(disp),
45 0, 0, width, height, 0,
46 0, InputOutput,
47 einfo->info.visual,
48 CWBackingStore |
49 CWBackPixmap | CWBorderPixel |
50 CWBitGravity | CWEventMask,
51 &attr);
52 if (!win)
53 goto close_display;
54 einfo->info.drawable = win;
55
56 if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
57 {
58 printf("Evas can not setup the informations of the XRender X11 Engine\n");
59 goto destroy_window;
60 }
61
62 if (fullscreen)
63 {
64 Atom prop = XInternAtom(disp, "_NET_WM_STATE", False);
65 Atom state = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False);
66 unsigned long data = state;
67 XChangeProperty(disp, win, prop, XA_ATOM, 32, PropModeReplace,
68 (unsigned char*) &data, 1);
69 }
70
71 XStoreName(disp, win, "Expedite - Evas Test Suite");
72 chint.res_name = "expedite";
73 chint.res_class = "Expedite";
74 XSetClassHint(disp, win, &chint);
75 szhints.flags = PMinSize | PMaxSize | PSize | USSize;
76 szhints.min_width = szhints.max_width = width;
77 szhints.min_height = szhints.max_height = height;
78 XSetWMNormalHints(disp, win, &szhints);
79 XMapWindow(disp, win);
80 XSync(disp, False);
81 while (!first_expose)
82 engine_xrender_x11_loop();
83 return EINA_TRUE;
84
85 destroy_window:
86 XDestroyWindow(disp, win);
87 close_display:
88 XCloseDisplay(disp);
89
90 return EINA_FALSE;
91}
92
93void
94engine_xrender_x11_loop(void)
95{
96 XEvent ev;
97 KeySym ks;
98 char *kstr;
99
100 again:
101 if (!XCheckMaskEvent(disp,
102 ExposureMask |
103 StructureNotifyMask |
104 KeyPressMask |
105 KeyReleaseMask |
106 ButtonPressMask |
107 ButtonReleaseMask |
108 PointerMotionMask |
109 EnterWindowMask |
110 LeaveWindowMask, &ev))
111 return;
112 switch (ev.type)
113 {
114 case ButtonPress:
115 evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y, 0, NULL);
116 evas_event_feed_mouse_down(evas, ev.xbutton.button, EVAS_BUTTON_NONE, 0, NULL);
117 break;
118 case ButtonRelease:
119 evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y, 0, NULL);
120 evas_event_feed_mouse_up(evas, ev.xbutton.button, EVAS_BUTTON_NONE, 0, NULL);
121 break;
122 case MotionNotify:
123 evas_event_feed_mouse_move(evas, ev.xmotion.x, ev.xmotion.y, 0, NULL);
124 break;
125 case Expose:
126 first_expose = 1;
127 evas_damage_rectangle_add(evas,
128 ev.xexpose.x,
129 ev.xexpose.y,
130 ev.xexpose.width,
131 ev.xexpose.height);
132 break;
133 case ConfigureNotify:
134 evas_output_viewport_set(evas, 0, 0,
135 ev.xconfigure.width,
136 ev.xconfigure.height);
137 evas_output_size_set(evas,
138 ev.xconfigure.width,
139 ev.xconfigure.height);
140 win_w = ev.xconfigure.width;
141 win_h = ev.xconfigure.height;
142 break;
143 case EnterNotify:
144 evas_event_feed_mouse_in(evas, 0, NULL);
145 break;
146 case LeaveNotify:
147 evas_event_feed_mouse_out(evas, 0, NULL);
148 break;
149 case KeyPress:
150 ks = XKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0);
151 kstr = XKeysymToString(ks);
152 if (kstr)
153 {
154 if ((!strcmp(kstr, "Shift_L")) ||
155 (!strcmp(kstr, "Shift_R")))
156 evas_key_modifier_on(evas, "Shift");
157 if ((!strcmp(kstr, "Control_L")) ||
158 (!strcmp(kstr, "Control_R")))
159 evas_key_modifier_on(evas, "Control");
160 if ((!strcmp(kstr, "Alt_L")) ||
161 (!strcmp(kstr, "Alt_R")))
162 evas_key_modifier_on(evas, "Alt");
163 if ((!strcmp(kstr, "Super_L")) ||
164 (!strcmp(kstr, "Super_R")))
165 evas_key_modifier_on(evas, "Super");
166 if (!strcmp(kstr, "Caps_Lock"))
167 {
168 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
169 evas_key_lock_off(evas, "Caps_Lock");
170 else
171 evas_key_lock_on(evas, "Caps_Lock");
172 }
173 if (!strcmp(kstr, "Num_Lock"))
174 {
175 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Num_Lock"))
176 evas_key_lock_off(evas, "Num_Lock");
177 else
178 evas_key_lock_on(evas, "Num_Lock");
179 }
180 if (!strcmp(kstr, "Scroll_Lock"))
181 {
182 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock"))
183 evas_key_lock_off(evas, "Scroll_Lock");
184 else
185 evas_key_lock_on(evas, "Scroll_Lock");
186 }
187 if (kstr) evas_event_feed_key_down(evas, kstr, kstr, NULL, NULL, 0, NULL);
188 }
189 break;
190 case KeyRelease:
191 ks = XKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0);
192 kstr = XKeysymToString(ks);
193 if (kstr)
194 {
195 if ((!strcmp(kstr, "Shift_L")) ||
196 (!strcmp(kstr, "Shift_R")))
197 evas_key_modifier_off(evas, "Shift");
198 if ((!strcmp(kstr, "Control_L")) ||
199 (!strcmp(kstr, "Control_R")))
200 evas_key_modifier_off(evas, "Control");
201 if ((!strcmp(kstr, "Alt_L")) ||
202 (!strcmp(kstr, "Alt_R")))
203 evas_key_modifier_off(evas, "Alt");
204 if ((!strcmp(kstr, "Super_L")) ||
205 (!strcmp(kstr, "Super_R")))
206 evas_key_modifier_off(evas, "Super");
207 evas_event_feed_key_up(evas, kstr, kstr, NULL, NULL, 0, NULL);
208 }
209 break;
210 default:
211 break;
212 }
213 goto again;
214}
215
216void
217engine_xrender_x11_shutdown(void)
218{
219 XDestroyWindow(disp, win);
220 XCloseDisplay(disp);
221}
diff --git a/src/bin/engine_xrender_x11.h b/src/bin/engine_xrender_x11.h
deleted file mode 100644
index 3643531..0000000
--- a/src/bin/engine_xrender_x11.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef ENGINE_XRENDER_X11_H
2#define ENGINE_XRENDER_X11_H
3
4Eina_Bool engine_xrender_x11_args(const char *engine, int width, int height);
5void engine_xrender_x11_loop(void);
6void engine_xrender_x11_shutdown(void);
7
8#endif
diff --git a/src/bin/engine_xrender_xcb.c b/src/bin/engine_xrender_xcb.c
deleted file mode 100644
index 4ea668f..0000000
--- a/src/bin/engine_xrender_xcb.c
+++ /dev/null
@@ -1,405 +0,0 @@
1#include "main.h"
2
3#include <xcb/xcb.h>
4#include <xcb/xcb_keysyms.h>
5#include <Evas_Engine_XRender_X11.h>
6
7#define XK_MISCELLANY
8#include <X11/keysymdef.h>
9
10enum {
11 XCB_SIZE_US_POSITION_HINT = 1 << 0,
12 XCB_SIZE_US_SIZE_HINT = 1 << 1,
13 XCB_SIZE_P_POSITION_HINT = 1 << 2,
14 XCB_SIZE_P_SIZE_HINT = 1 << 3,
15 XCB_SIZE_P_MIN_SIZE_HINT = 1 << 4,
16 XCB_SIZE_P_MAX_SIZE_HINT = 1 << 5,
17 XCB_SIZE_P_RESIZE_INC_HINT = 1 << 6,
18 XCB_SIZE_P_ASPECT_HINT = 1 << 7,
19 XCB_SIZE_BASE_SIZE_HINT = 1 << 8,
20 XCB_SIZE_P_WIN_GRAVITY_HINT = 1 << 9
21};
22
23struct xcb_size_hints_t {
24 uint32_t flags;
25 int32_t x, y, width, height;
26 int32_t min_width, min_height;
27 int32_t max_width, max_height;
28 int32_t width_inc, height_inc;
29 int32_t min_aspect_num, min_aspect_den;
30 int32_t max_aspect_num, max_aspect_den;
31 int32_t base_width, base_height;
32 uint32_t win_gravity;
33};
34
35
36static xcb_connection_t *conn = NULL;
37static xcb_screen_t *screen = NULL;
38static xcb_window_t win = 0;
39static int first_expose = 0;
40
41static xcb_visualtype_t *
42_engine_xrender_visual_get(xcb_connection_t *conn, xcb_screen_t *screen)
43{
44 xcb_depth_iterator_t iter_depth;
45
46 iter_depth = xcb_screen_allowed_depths_iterator(screen);
47 for (; iter_depth.rem; xcb_depth_next (&iter_depth))
48 {
49 xcb_visualtype_iterator_t iter_vis;
50
51 iter_vis = xcb_depth_visuals_iterator(iter_depth.data);
52 for (; iter_vis.rem; xcb_visualtype_next (&iter_vis))
53 {
54 if (screen->root_visual == iter_vis.data->visual_id)
55 return iter_vis.data;
56 }
57 }
58}
59
60Eina_Bool
61engine_xrender_xcb_args(const char *engine, int width, int height)
62{
63 struct xcb_size_hints_t hints;
64 uint32_t value_list[6];
65 xcb_screen_iterator_t iter;
66 Evas_Engine_Info_XRender_X11 *einfo;
67 xcb_intern_atom_reply_t *reply;
68 char *str;
69 xcb_intern_atom_cookie_t cookie1;
70 xcb_intern_atom_cookie_t cookie2;
71 xcb_intern_atom_cookie_t cookie3;
72 xcb_intern_atom_cookie_t cookie4;
73 xcb_intern_atom_cookie_t cookie5;
74 xcb_atom_t string;
75 xcb_atom_t wm_name;
76 xcb_atom_t wm_class;
77 xcb_atom_t wm_normal_hint;
78 xcb_atom_t wm_size_hint;
79 uint32_t value_mask;
80 int s;
81 int s_tmp;
82 int l1;
83 int l2;
84 int i;
85
86 conn = xcb_connect(NULL, &s);
87 if (xcb_connection_has_error(conn)) return EINA_FALSE;
88
89 s_tmp = s;
90 iter = xcb_setup_roots_iterator(xcb_get_setup(conn));
91 for (; iter.rem; --s_tmp, xcb_screen_next (&iter))
92 if (s_tmp == 0)
93 {
94 screen = iter.data;
95 break;
96 }
97
98 evas_output_method_set(evas, evas_render_method_lookup("xrender_x11"));
99 einfo = (Evas_Engine_Info_XRender_X11 *)evas_engine_info_get(evas);
100 if (!einfo)
101 {
102 printf("Evas does not support the XRender XCB Engine\n");
103 goto close_connection;
104 }
105
106 einfo->info.backend = EVAS_ENGINE_INFO_XRENDER_BACKEND_XCB;