static HWND window;
+static HINSTANCE instance;
static LRESULT CALLBACK
{
WNDCLASS wc;
RECT rect;
- HINSTANCE instance;
HDC dc;
MSG msg;
Evas_Engine_Info_Direct3D *einfo;
goto again;
}
+
+void
+engine_direct3d_shutdown(void)
+{
+ DestroyWindow(window);
+ UnregisterClass("Evas_Direct3D_Test", instance);
+ FreeLibrary(instance);
+}
int engine_direct3d_args(int argc, char **argv);
void engine_direct3d_loop(void);
+void engine_direct3d_shutdown(void);
#ifdef __cplusplus
}
}
}
+
+void
+engine_directfb_shutdown(void)
+{
+ DFBCHECK(_input_event->Release(_input_event));
+ DFBCHECK(_window_event->Release(_window_event));
+ DFBCHECK(_dfb_surface->Release(_dfb_surface));
+ DFBCHECK(_dfb_window->Release(_dfb_window));
+ DFBCHECK(_layer->Release(_layer));
+ DFBCHECK(_dfb->Release(_dfb));
+}
int engine_directfb_args(int argc, char **argv);
void engine_directfb_loop(void);
+void engine_directfb_shutdown(void);
#endif
{
return;
}
+
+void
+engine_fb_shutdown(void)
+{
+ return;
+}
int engine_fb_args(int argc, char **argv);
void engine_fb_loop(void);
+void engine_fb_shutdown(void);
#endif
int engine_gl_glew_args(int argc, char **argv);
void engine_gl_glew_loop(void);
+void engine_gl_glew_shutdown(void);
#endif /* __ENGINE_GL_GLEW_H__ */
if (!einfo)
{
printf("Evas does not support the OpenGL X11 Engine\n");
- return 0;
+ goto close_display;
}
einfo->info.display = disp;
CWBackPixmap | CWBorderPixel |
CWBitGravity | CWEventMask,
&attr);
+ if (!win)
+ goto close_display;
+
einfo->info.drawable = win;
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the OpenGL X11 Engine\n");
- return 0;
+ goto destroy_window;
}
XStoreName(disp, win, "Expedite - Evas Test Suite");
while (!first_expose)
engine_gl_x11_loop();
return 1;
+
+ destroy_window:
+ XDestroyWindow(disp, win);
+ close_display:
+ XCloseDisplay(disp);
+
+ return 0;
}
void
}
goto again;
}
+
+void
+engine_gl_x11_shutdown(void)
+{
+ XDestroyWindow(disp, win);
+ XCloseDisplay(disp);
+}
int engine_gl_x11_args(int argc, char **argv);
void engine_gl_x11_loop(void);
+void engine_gl_x11_shutdown(void);
#endif
int engine_quartz_args(int argc, char **argv);
void engine_quartz_loop(void);
+void engine_quartz_shutdown(void);
#endif
[event release];
[NSAutoreleasePool release];
}
+
+void
+engine_quartz_shutdown(void)
+{
+ /* If someone knows what to do here... */
+}
static HWND window;
+static HINSTANCE instance;
static int
{
WNDCLASS wc;
RECT rect;
- HINSTANCE instance;
LPDIRECTDRAW object;
LPDIRECTDRAWSURFACE surface_primary;
LPDIRECTDRAWSURFACE surface_back;
&surface_back,
&surface_source,
&depth))
- goto destroy_window;
+ goto destroy_window;
evas_output_method_set(evas, evas_render_method_lookup("software_16_ddraw"));
einfo = (Evas_Engine_Info_Software_16_DDraw *)evas_engine_info_get(evas);
goto again;
}
+
+void
+engine_software_16_ddraw_shutdown(void)
+{
+ DestroyWindow(window);
+ UnregisterClass("Evas_Software_16_DDraw_Test", instance);
+ FreeLibrary(instance);
+}
int engine_software_16_ddraw_args(int argc, char **argv);
void engine_software_16_ddraw_loop(void);
+void engine_software_16_ddraw_shutdown(void);
#ifdef __cplusplus
wc.lpszClassName = L"Evas_Software_16_WinCE_Test";
if(!RegisterClass(&wc))
- {
- FreeLibrary(instance);
- return 0;
- }
+ goto free_library;
SetRect(&rect, 0, 0,
GetSystemMetrics(SM_CXSCREEN),
rect.bottom - rect.top,
NULL, NULL, instance, NULL);
if (!window)
- {
- UnregisterClass(L"Evas_Software_16_WinCE_Test", instance);
- FreeLibrary(instance);
- return 0;
- }
+ goto unregister_class;
/* hide top level windows (Task bar, SIP and SIP button */
task_bar = FindWindow(L"HHTaskBar", NULL);
EnableWindow(sip_icon, FALSE);
if (!_wince_hardware_keys_register(window))
- {
- DestroyWindow(window);
- UnregisterClass(L"Evas_Software_16_WinCE_Test", instance);
- FreeLibrary(instance);
- return 0;
- }
+ goto destroy_window;
evas_output_method_set(evas, evas_render_method_lookup("software_16_wince"));
if (!einfo)
{
printf("Evas does not support the 16bit Software WinCE Engine\n");
- DestroyWindow(window);
- UnregisterClass(L"Evas_Software_16_WinCE_Test", instance);
- FreeLibrary(instance);
- return 0;
+ goto destroy_window;
}
einfo->info.window = window;
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the 16 bits Software WinCE Engine\n");
- DestroyWindow(window);
- UnregisterClass(L"Evas_Software_16_WinCE_Test", instance);
- FreeLibrary(instance);
- return 0;
+ goto destroy_window;
}
_suspend = einfo->func.suspend;
UpdateWindow(window);
return 1;
+
+ destroy_window:
+ DestroyWindow(window);
+ unregister_class:
+ UnregisterClass(L"Evas_Software_16_WinCE_Test", instance);
+ free_library:
+ FreeLibrary(instance);
+
+ return 0;
}
void
goto again;
}
+
+void
+engine_software_16_wince_shutdown(void)
+{
+ DestroyWindow(window);
+ UnregisterClass(L"Evas_Software_16_WinCE_Test", instance);
+ FreeLibrary(instance);
+}
int engine_software_16_wince_args(int argc, char **argv);
void engine_software_16_wince_loop(void);
+void engine_software_16_wince_shutdown(void);
#endif /* __ENGINE_SOFTWARE_16_WINCE_H__ */
if (!einfo)
{
printf("Evas does not support the Software 16bit X11 Engine\n");
- return 0;
+ goto close_display;
}
einfo->info.display = disp;
CWBackPixmap | CWBorderPixel |
CWBitGravity | CWEventMask,
&attr);
+ if (!win)
+ goto close_display;
+
einfo->info.drawable = win;
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the Software 16bit X11 Engine\n");
- return 0;
+ goto destroy_window;
}
XStoreName(disp, win, "Expedite - Evas Test Suite");
while (!first_expose)
engine_software_16_x11_loop();
return 1;
+
+ destroy_window:
+ XDestroyWindow(disp, win);
+ close_display:
+ XCloseDisplay(disp);
+
+ return 0;
}
void
}
goto again;
}
+
+void
+engine_software_16_x11_shutdown(void)
+{
+ XDestroyWindow(disp, win);
+ XCloseDisplay(disp);
+}
int engine_software_16_x11_args(int argc, char **argv);
void engine_software_16_x11_loop(void);
+void engine_software_16_x11_shutdown(void);
#endif
static HWND window;
+static HINSTANCE instance;
static LRESULT CALLBACK
{
WNDCLASS wc;
RECT rect;
- HINSTANCE instance;
HDC dc;
Evas_Engine_Info_Software_DDraw *einfo;
DWORD style;
goto again;
}
+
+void
+engine_software_ddraw_shutdown(void)
+{
+ DestroyWindow(window);
+ UnregisterClass("Evas_Software_DDraw_Test", instance);
+ FreeLibrary(instance);
+}
int engine_software_ddraw_args(int argc, char **argv);
void engine_software_ddraw_loop(void);
+void engine_software_ddraw_shutdown(void);
#ifdef __cplusplus
static HWND window;
+static HINSTANCE instance;
static LRESULT CALLBACK
{
WNDCLASS wc;
RECT rect;
- HINSTANCE instance;
HDC dc;
Evas_Engine_Info_Software_Gdi *einfo;
DWORD style;
goto again;
}
+
+void
+engine_software_gdi_shutdown(void)
+{
+ DestroyWindow(window);
+ UnregisterClass("Evas_Software_Gdi_Test", instance);
+ FreeLibrary(instance);
+}
int engine_software_gdi_args(int argc, char **argv);
void engine_software_gdi_loop(void);
+void engine_software_gdi_shutdown(void);
#ifdef __cplusplus
}
}
}
+
+void
+engine_software_sdl_shutdown(void)
+{
+}
int engine_software_sdl_args(int argc, char **argv);
void engine_software_sdl_loop(void);
+void engine_software_sdl_shutdown(void);
#endif
if (!einfo)
{
printf("Evas does not support the Software XCB Engine\n");
- return 0;
+ goto close_connection;
}
einfo->info.backend = EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB;
value_list[5] = einfo->info.colormap;
win = xcb_generate_id(conn);
+ if (!win)
+ goto close_connection;
xcb_create_window(conn,
einfo->info.depth,
win, screen->root, 0, 0, win_w, win_h, 0,
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the Software XCB Engine\n");
- return 0;
+ goto destroy_window;
}
/* XStoreName(disp, win, "Expedite - Evas Test Suite"); */
while (!first_expose)
engine_software_xcb_loop();
return 1;
+
+ destroy_window:
+ xcb_destroy_window(conn, win);
+ close_connection:
+ xcb_disconnect(conn);
+
+ return 0;
}
void
xcb_key_press_event_t *e;
xcb_key_symbols_t *kss;
xcb_keysym_t ks;
- char *str;
+ char *str = "";
e = (xcb_key_press_event_t *)ev;
str = "Escape";
if (ks == XK_Return)
str = "Return";
- if (ks == 71)
+ if (ks == 113)
str = "q";
evas_event_feed_key_down(evas, str, str, NULL, NULL, 0, NULL);
xcb_key_release_event_t *e;
xcb_key_symbols_t *kss;
xcb_keysym_t ks;
- char *str;
+ char *str = "";
e = (xcb_key_release_event_t *)ev;
str = "Escape";
if (ks == XK_Return)
str = "Return";
- if (ks == 71)
+ if (ks == 113)
str = "q";
evas_event_feed_key_up(evas, str, str, NULL, NULL, 0, NULL);
goto again;
}
+
+void
+engine_software_xcb_shutdown(void)
+{
+ xcb_destroy_window(conn, win);
+ xcb_disconnect(conn);
+}
int engine_software_xcb_args(int argc, char **argv);
void engine_software_xcb_loop(void);
+void engine_software_xcb_shutdown(void);
#endif
if (!einfo)
{
printf("Evas does not support the Software Xlib Engine\n");
- return 0;
+ goto close_display;
}
einfo->info.backend = EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB;
CWBackPixmap | CWBorderPixel |
CWBitGravity | CWEventMask,
&attr);
+ if (!win)
+ goto close_display;
+
einfo->info.drawable = win;
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the Software Xlib Engine\n");
- return 0;
+ goto destroy_window;
}
XStoreName(disp, win, "Expedite - Evas Test Suite");
while (!first_expose)
engine_software_xlib_loop();
return 1;
+
+ destroy_window:
+ XDestroyWindow(disp, win);
+ close_display:
+ XCloseDisplay(disp);
+
+ return 0;
}
void
}
goto again;
}
+
+void
+engine_software_xlib_shutdown(void)
+{
+ XDestroyWindow(disp, win);
+ XCloseDisplay(disp);
+}
int engine_software_xlib_args(int argc, char **argv);
void engine_software_xlib_loop(void);
+void engine_software_xlib_shutdown(void);
#endif
if (!einfo)
{
printf("Evas does not support the XRender X11 Engine\n");
- return 0;
+ goto close_display;
}
einfo->info.backend = EVAS_ENGINE_INFO_XRENDER_BACKEND_XLIB;
CWBackPixmap | CWBorderPixel |
CWBitGravity | CWEventMask,
&attr);
+ if (!win)
+ goto close_display;
einfo->info.drawable = win;
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the XRender X11 Engine\n");
- return 0;
+ goto destroy_window;
}
XStoreName(disp, win, "Expedite - Evas Test Suite");
while (!first_expose)
engine_xrender_x11_loop();
return 1;
+
+ destroy_window:
+ XDestroyWindow(disp, win);
+ close_display:
+ XCloseDisplay(disp);
+
+ return 0;
}
void
}
goto again;
}
+
+void
+engine_xrender_x11_shutdown(void)
+{
+ XDestroyWindow(disp, win);
+ XCloseDisplay(disp);
+}
int engine_xrender_x11_args(int argc, char **argv);
void engine_xrender_x11_loop(void);
+void engine_xrender_x11_shutdown(void);
#endif
if (!einfo)
{
printf("Evas does not support the XRender XCB Engine\n");
- return 0;
+ goto close_connection;
}
einfo->info.backend = EVAS_ENGINE_INFO_XRENDER_BACKEND_XCB;
value_list[5] =screen->default_colormap;
win = xcb_generate_id(conn);
+ if (!win)
+ goto close_connection;
xcb_create_window(conn,
screen->root_depth,
win, screen->root, 0, 0, win_w, win_h, 0,
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the XRender XCB Engine\n");
- return 0;
+ goto destroy_window;
}
xcb_map_window(conn, win);
while (!first_expose)
engine_xrender_xcb_loop();
return 1;
+
+ destroy_window:
+ xcb_destroy_window(conn, win);
+ close_connection:
+ xcb_disconnect(conn);
+
+ return 0;
}
void
xcb_key_press_event_t *e;
xcb_key_symbols_t *kss;
xcb_keysym_t ks;
- char *str;
+ char *str = "";
e = (xcb_key_press_event_t *)ev;
str = "Escape";
if (ks == XK_Return)
str = "Return";
- if (ks == 71)
+ if (ks == 113)
str = "q";
evas_event_feed_key_down(evas, str, str, NULL, NULL, 0, NULL);
xcb_key_release_event_t *e;
xcb_key_symbols_t *kss;
xcb_keysym_t ks;
- char *str;
+ char *str = "";
e = (xcb_key_release_event_t *)ev;
str = "Escape";
if (ks == XK_Return)
str = "Return";
- if (ks == 71)
+ if (ks == 113)
str = "q";
evas_event_feed_key_up(evas, str, str, NULL, NULL, 0, NULL);
goto again;
}
+
+void
+engine_xrender_xcb_shutdown(void)
+{
+ xcb_destroy_window(conn, win);
+ xcb_disconnect(conn);
+}
int engine_xrender_xcb_args(int argc, char **argv);
void engine_xrender_xcb_loop(void);
+void engine_xrender_xcb_shutdown(void);
#endif
static char *datadir = NULL;
static int go = 1;
static void (*loop_func) (void) = NULL;
+static void (*shutdown_func) (void) = NULL;
/* this guarantees that "random" numbers will always be the same set regardless
* of what os/system/etc we are on - as often i need just some "random" set of
loop_func();
}
+void
+engine_shutdown(void)
+{
+ shutdown_func();
+}
+
static int
_engine_go(void)
{
profile_ok = _profile_parse(argc, argv);
#if HAVE_EVAS_SOFTWARE_XLIB
if (engine_software_xlib_args(argc, argv))
- loop_func = engine_software_xlib_loop;
+ {
+ loop_func = engine_software_xlib_loop;
+ shutdown_func = engine_software_xlib_shutdown;
+ }
#endif
#if HAVE_EVAS_XRENDER_X11
if (engine_xrender_x11_args(argc, argv))
- loop_func = engine_xrender_x11_loop;
+ {
+ loop_func = engine_xrender_x11_loop;
+ shutdown_func = engine_xrender_x11_shutdown;
+ }
#endif
#if HAVE_EVAS_OPENGL_X11
if (engine_gl_x11_args(argc, argv))
- loop_func = engine_gl_x11_loop;
+ {
+ loop_func = engine_gl_x11_loop;
+ shutdown_func = engine_gl_x11_shutdown;
+ }
#endif
#if HAVE_EVAS_SOFTWARE_XCB
if (engine_software_xcb_args(argc, argv))
- loop_func = engine_software_xcb_loop;
+ {
+ loop_func = engine_software_xcb_loop;
+ shutdown_func = engine_software_xcb_shutdown;
+ }
#endif
#if HAVE_EVAS_XRENDER_XCB
if (engine_xrender_xcb_args(argc, argv))
- loop_func = engine_xrender_xcb_loop;
+ {
+ loop_func = engine_xrender_xcb_loop;
+ shutdown_func = engine_xrender_xcb_shutdown;
+ }
#endif
#if HAVE_EVAS_SOFTWARE_GDI
if (engine_software_gdi_args(argc, argv))
- loop_func = engine_software_gdi_loop;
+ {
+ loop_func = engine_software_gdi_loop;
+ shutdown_func = engine_software_gdi_shutdown;
+ }
#endif
#if HAVE_EVAS_SOFTWARE_DDRAW
if (engine_software_ddraw_args(argc, argv))
- loop_func = engine_software_ddraw_loop;
+ {
+ loop_func = engine_software_ddraw_loop;
+ shutdown_func = engine_software_ddraw_shutdown;
+ }
#endif
#if HAVE_EVAS_DIRECT3D
if (engine_direct3d_args(argc, argv))
- loop_func = engine_direct3d_loop;
+ {
+ loop_func = engine_direct3d_loop;
+ shutdown_func = engine_direct3d_shutdown;
+ }
#endif
#if HAVE_EVAS_OPENGL_GLEW
if (engine_gl_glew_args(argc, argv))
- loop_func = engine_gl_glew_loop;
+ {
+ loop_func = engine_gl_glew_loop;
+ shutdown_func = engine_gl_glew_shutdown;
+ }
#endif
#if HAVE_EVAS_SOFTWARE_SDL
if (engine_software_sdl_args(argc, argv))
- loop_func = engine_software_sdl_loop;
+ {
+ loop_func = engine_software_sdl_loop;
+ shutdown_func = engine_software_sdl_shutdown;
+ }
#endif
#if HAVE_EVAS_FB
if (engine_fb_args(argc, argv))
- loop_func = engine_fb_loop;
+ {
+ loop_func = engine_fb_loop;
+ shutdown_func = engine_fb_shutdown;
+ }
#endif
#if HAVE_EVAS_DIRECTFB
if (engine_directfb_args(argc, argv))
- loop_func = engine_directfb_loop;
+ {
+ loop_func = engine_directfb_loop;
+ shutdown_func = engine_directfb_shutdown;
+ }
#endif
#if HAVE_EVAS_QUARTZ
if (engine_quartz_args(argc, argv))
- loop_func = engine_quartz_loop;
+ {
+ loop_func = engine_quartz_loop;
+ shutdown_func = engine_quartz_shutdown;
+ }
#endif
#if HAVE_EVAS_SOFTWARE_16_X11
if (engine_software_16_x11_args(argc, argv))
- loop_func = engine_software_16_x11_loop;
+ {
+ loop_func = engine_software_16_x11_loop;
+ shutdown_func = engine_software_16_x11_shutdown;
+ }
#endif
#if HAVE_EVAS_SOFTWARE_16_DDRAW
if (engine_software_16_ddraw_args(argc, argv))
- loop_func = engine_software_16_ddraw_loop;
+ {
+ loop_func = engine_software_16_ddraw_loop;
+ shutdown_func = engine_software_16_ddraw_shutdown;
+ }
#endif
#if HAVE_EVAS_SOFTWARE_16_WINCE
if (engine_software_16_wince_args(argc, argv))
- loop_func = engine_software_16_wince_loop;
+ {
+ loop_func = engine_software_16_wince_loop;
+ shutdown_func = engine_software_16_wince_shutdown;
+ }
#endif
if ((!loop_func) || (!profile_ok))
{
evas_free(evas);
evas_shutdown();
+ engine_shutdown();
return 0;
}