forked from enlightenment/expedite
* add shutdown function to properly shut down the graphic system
* fix seg fault with the xcb (soft and render) engines Notes: * install fontconfig >= 2.7: it frees correctly its mem * strangely, the xrender xlib and gl xlib engines are segfaulting when XCloseDisplay is called (in the shutdown function). It does not with soft xlib. I absolutely don't know why. SVN revision: 43373
This commit is contained in:
parent
7a78718583
commit
d23ff9c849
|
@ -5,6 +5,7 @@
|
|||
|
||||
|
||||
static HWND window;
|
||||
static HINSTANCE instance;
|
||||
|
||||
|
||||
static LRESULT CALLBACK
|
||||
|
@ -175,7 +176,6 @@ engine_direct3d_args(int argc, char **argv)
|
|||
{
|
||||
WNDCLASS wc;
|
||||
RECT rect;
|
||||
HINSTANCE instance;
|
||||
HDC dc;
|
||||
MSG msg;
|
||||
Evas_Engine_Info_Direct3D *einfo;
|
||||
|
@ -289,3 +289,11 @@ engine_direct3d_loop(void)
|
|||
|
||||
goto again;
|
||||
}
|
||||
|
||||
void
|
||||
engine_direct3d_shutdown(void)
|
||||
{
|
||||
DestroyWindow(window);
|
||||
UnregisterClass("Evas_Direct3D_Test", instance);
|
||||
FreeLibrary(instance);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ extern "C" {
|
|||
|
||||
int engine_direct3d_args(int argc, char **argv);
|
||||
void engine_direct3d_loop(void);
|
||||
void engine_direct3d_shutdown(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -275,3 +275,14 @@ engine_directfb_loop(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
|
||||
int engine_directfb_args(int argc, char **argv);
|
||||
void engine_directfb_loop(void);
|
||||
void engine_directfb_shutdown(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -46,3 +46,9 @@ engine_fb_loop(void)
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
engine_fb_shutdown(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
|
||||
int engine_fb_args(int argc, char **argv);
|
||||
void engine_fb_loop(void);
|
||||
void engine_fb_shutdown(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
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__ */
|
||||
|
|
|
@ -36,7 +36,7 @@ engine_gl_x11_args(int argc, char **argv)
|
|||
if (!einfo)
|
||||
{
|
||||
printf("Evas does not support the OpenGL X11 Engine\n");
|
||||
return 0;
|
||||
goto close_display;
|
||||
}
|
||||
|
||||
einfo->info.display = disp;
|
||||
|
@ -60,11 +60,14 @@ engine_gl_x11_args(int argc, char **argv)
|
|||
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");
|
||||
|
@ -80,6 +83,13 @@ engine_gl_x11_args(int argc, char **argv)
|
|||
while (!first_expose)
|
||||
engine_gl_x11_loop();
|
||||
return 1;
|
||||
|
||||
destroy_window:
|
||||
XDestroyWindow(disp, win);
|
||||
close_display:
|
||||
XCloseDisplay(disp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -204,3 +214,10 @@ engine_gl_x11_loop(void)
|
|||
}
|
||||
goto again;
|
||||
}
|
||||
|
||||
void
|
||||
engine_gl_x11_shutdown(void)
|
||||
{
|
||||
XDestroyWindow(disp, win);
|
||||
XCloseDisplay(disp);
|
||||
}
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
|
||||
int engine_gl_x11_args(int argc, char **argv);
|
||||
void engine_gl_x11_loop(void);
|
||||
void engine_gl_x11_shutdown(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
|
||||
int engine_quartz_args(int argc, char **argv);
|
||||
void engine_quartz_loop(void);
|
||||
void engine_quartz_shutdown(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -257,3 +257,9 @@ engine_quartz_loop(void)
|
|||
[event release];
|
||||
[NSAutoreleasePool release];
|
||||
}
|
||||
|
||||
void
|
||||
engine_quartz_shutdown(void)
|
||||
{
|
||||
/* If someone knows what to do here... */
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
|
||||
static HWND window;
|
||||
static HINSTANCE instance;
|
||||
|
||||
|
||||
static int
|
||||
|
@ -267,7 +268,6 @@ engine_software_16_ddraw_args(int argc, char **argv)
|
|||
{
|
||||
WNDCLASS wc;
|
||||
RECT rect;
|
||||
HINSTANCE instance;
|
||||
LPDIRECTDRAW object;
|
||||
LPDIRECTDRAWSURFACE surface_primary;
|
||||
LPDIRECTDRAWSURFACE surface_back;
|
||||
|
@ -337,7 +337,7 @@ engine_software_16_ddraw_args(int argc, char **argv)
|
|||
&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);
|
||||
|
@ -393,3 +393,11 @@ engine_software_16_ddraw_loop(void)
|
|||
|
||||
goto again;
|
||||
}
|
||||
|
||||
void
|
||||
engine_software_16_ddraw_shutdown(void)
|
||||
{
|
||||
DestroyWindow(window);
|
||||
UnregisterClass("Evas_Software_16_DDraw_Test", instance);
|
||||
FreeLibrary(instance);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ extern "C" {
|
|||
|
||||
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
|
||||
|
|
|
@ -215,10 +215,7 @@ engine_software_16_wince_args(int argc, char **argv)
|
|||
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),
|
||||
|
@ -233,11 +230,7 @@ engine_software_16_wince_args(int argc, char **argv)
|
|||
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);
|
||||
|
@ -251,12 +244,7 @@ engine_software_16_wince_args(int argc, char **argv)
|
|||
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"));
|
||||
|
||||
|
@ -264,10 +252,7 @@ engine_software_16_wince_args(int argc, char **argv)
|
|||
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;
|
||||
|
@ -278,10 +263,7 @@ engine_software_16_wince_args(int argc, char **argv)
|
|||
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;
|
||||
|
@ -292,6 +274,15 @@ engine_software_16_wince_args(int argc, char **argv)
|
|||
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
|
||||
|
@ -310,3 +301,11 @@ engine_software_16_wince_loop(void)
|
|||
|
||||
goto again;
|
||||
}
|
||||
|
||||
void
|
||||
engine_software_16_wince_shutdown(void)
|
||||
{
|
||||
DestroyWindow(window);
|
||||
UnregisterClass(L"Evas_Software_16_WinCE_Test", instance);
|
||||
FreeLibrary(instance);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
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__ */
|
||||
|
|
|
@ -36,7 +36,7 @@ engine_software_16_x11_args(int argc, char **argv)
|
|||
if (!einfo)
|
||||
{
|
||||
printf("Evas does not support the Software 16bit X11 Engine\n");
|
||||
return 0;
|
||||
goto close_display;
|
||||
}
|
||||
|
||||
einfo->info.display = disp;
|
||||
|
@ -57,11 +57,14 @@ engine_software_16_x11_args(int argc, char **argv)
|
|||
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");
|
||||
|
@ -77,6 +80,13 @@ engine_software_16_x11_args(int argc, char **argv)
|
|||
while (!first_expose)
|
||||
engine_software_16_x11_loop();
|
||||
return 1;
|
||||
|
||||
destroy_window:
|
||||
XDestroyWindow(disp, win);
|
||||
close_display:
|
||||
XCloseDisplay(disp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -201,3 +211,10 @@ engine_software_16_x11_loop(void)
|
|||
}
|
||||
goto again;
|
||||
}
|
||||
|
||||
void
|
||||
engine_software_16_x11_shutdown(void)
|
||||
{
|
||||
XDestroyWindow(disp, win);
|
||||
XCloseDisplay(disp);
|
||||
}
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
|
||||
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
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
|
||||
static HWND window;
|
||||
static HINSTANCE instance;
|
||||
|
||||
|
||||
static LRESULT CALLBACK
|
||||
|
@ -175,7 +176,6 @@ engine_software_ddraw_args(int argc, char **argv)
|
|||
{
|
||||
WNDCLASS wc;
|
||||
RECT rect;
|
||||
HINSTANCE instance;
|
||||
HDC dc;
|
||||
Evas_Engine_Info_Software_DDraw *einfo;
|
||||
DWORD style;
|
||||
|
@ -292,3 +292,11 @@ engine_software_ddraw_loop(void)
|
|||
|
||||
goto again;
|
||||
}
|
||||
|
||||
void
|
||||
engine_software_ddraw_shutdown(void)
|
||||
{
|
||||
DestroyWindow(window);
|
||||
UnregisterClass("Evas_Software_DDraw_Test", instance);
|
||||
FreeLibrary(instance);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ extern "C" {
|
|||
|
||||
int engine_software_ddraw_args(int argc, char **argv);
|
||||
void engine_software_ddraw_loop(void);
|
||||
void engine_software_ddraw_shutdown(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
|
||||
static HWND window;
|
||||
static HINSTANCE instance;
|
||||
|
||||
|
||||
static LRESULT CALLBACK
|
||||
|
@ -175,7 +176,6 @@ engine_software_gdi_args(int argc, char **argv)
|
|||
{
|
||||
WNDCLASS wc;
|
||||
RECT rect;
|
||||
HINSTANCE instance;
|
||||
HDC dc;
|
||||
Evas_Engine_Info_Software_Gdi *einfo;
|
||||
DWORD style;
|
||||
|
@ -294,3 +294,11 @@ engine_software_gdi_loop(void)
|
|||
|
||||
goto again;
|
||||
}
|
||||
|
||||
void
|
||||
engine_software_gdi_shutdown(void)
|
||||
{
|
||||
DestroyWindow(window);
|
||||
UnregisterClass("Evas_Software_Gdi_Test", instance);
|
||||
FreeLibrary(instance);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ extern "C" {
|
|||
|
||||
int engine_software_gdi_args(int argc, char **argv);
|
||||
void engine_software_gdi_loop(void);
|
||||
void engine_software_gdi_shutdown(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -178,3 +178,8 @@ engine_software_sdl_loop(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
engine_software_sdl_shutdown(void)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
|
||||
int engine_software_sdl_args(int argc, char **argv);
|
||||
void engine_software_sdl_loop(void);
|
||||
void engine_software_sdl_shutdown(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -92,7 +92,7 @@ engine_software_xcb_args(int argc, char **argv)
|
|||
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;
|
||||
|
@ -121,6 +121,8 @@ engine_software_xcb_args(int argc, char **argv)
|
|||
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,
|
||||
|
@ -135,7 +137,7 @@ engine_software_xcb_args(int argc, char **argv)
|
|||
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"); */
|
||||
|
@ -206,6 +208,13 @@ engine_software_xcb_args(int argc, char **argv)
|
|||
while (!first_expose)
|
||||
engine_software_xcb_loop();
|
||||
return 1;
|
||||
|
||||
destroy_window:
|
||||
xcb_destroy_window(conn, win);
|
||||
close_connection:
|
||||
xcb_disconnect(conn);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -290,7 +299,7 @@ engine_software_xcb_loop(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;
|
||||
|
||||
|
@ -329,7 +338,7 @@ engine_software_xcb_loop(void)
|
|||
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);
|
||||
|
@ -342,7 +351,7 @@ engine_software_xcb_loop(void)
|
|||
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;
|
||||
|
||||
|
@ -367,7 +376,7 @@ engine_software_xcb_loop(void)
|
|||
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);
|
||||
|
@ -383,3 +392,10 @@ engine_software_xcb_loop(void)
|
|||
|
||||
goto again;
|
||||
}
|
||||
|
||||
void
|
||||
engine_software_xcb_shutdown(void)
|
||||
{
|
||||
xcb_destroy_window(conn, win);
|
||||
xcb_disconnect(conn);
|
||||
}
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
|
||||
int engine_software_xcb_args(int argc, char **argv);
|
||||
void engine_software_xcb_loop(void);
|
||||
void engine_software_xcb_shutdown(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -36,7 +36,7 @@ engine_software_xlib_args(int argc, char **argv)
|
|||
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;
|
||||
|
@ -64,11 +64,14 @@ engine_software_xlib_args(int argc, char **argv)
|
|||
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");
|
||||
|
@ -84,6 +87,13 @@ engine_software_xlib_args(int argc, char **argv)
|
|||
while (!first_expose)
|
||||
engine_software_xlib_loop();
|
||||
return 1;
|
||||
|
||||
destroy_window:
|
||||
XDestroyWindow(disp, win);
|
||||
close_display:
|
||||
XCloseDisplay(disp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -208,3 +218,10 @@ engine_software_xlib_loop(void)
|
|||
}
|
||||
goto again;
|
||||
}
|
||||
|
||||
void
|
||||
engine_software_xlib_shutdown(void)
|
||||
{
|
||||
XDestroyWindow(disp, win);
|
||||
XCloseDisplay(disp);
|
||||
}
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
|
||||
int engine_software_xlib_args(int argc, char **argv);
|
||||
void engine_software_xlib_loop(void);
|
||||
void engine_software_xlib_shutdown(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -36,7 +36,7 @@ engine_xrender_x11_args(int argc, char **argv)
|
|||
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;
|
||||
|
@ -59,12 +59,14 @@ engine_xrender_x11_args(int argc, char **argv)
|
|||
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");
|
||||
|
@ -80,6 +82,13 @@ engine_xrender_x11_args(int argc, char **argv)
|
|||
while (!first_expose)
|
||||
engine_xrender_x11_loop();
|
||||
return 1;
|
||||
|
||||
destroy_window:
|
||||
XDestroyWindow(disp, win);
|
||||
close_display:
|
||||
XCloseDisplay(disp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -204,3 +213,10 @@ engine_xrender_x11_loop(void)
|
|||
}
|
||||
goto again;
|
||||
}
|
||||
|
||||
void
|
||||
engine_xrender_x11_shutdown(void)
|
||||
{
|
||||
XDestroyWindow(disp, win);
|
||||
XCloseDisplay(disp);
|
||||
}
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
|
||||
int engine_xrender_x11_args(int argc, char **argv);
|
||||
void engine_xrender_x11_loop(void);
|
||||
void engine_xrender_x11_shutdown(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -111,7 +111,7 @@ engine_xrender_xcb_args(int argc, char **argv)
|
|||
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;
|
||||
|
@ -136,6 +136,8 @@ engine_xrender_xcb_args(int argc, char **argv)
|
|||
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,
|
||||
|
@ -148,7 +150,7 @@ engine_xrender_xcb_args(int argc, char **argv)
|
|||
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);
|
||||
|
@ -221,6 +223,13 @@ engine_xrender_xcb_args(int argc, char **argv)
|
|||
while (!first_expose)
|
||||
engine_xrender_xcb_loop();
|
||||
return 1;
|
||||
|
||||
destroy_window:
|
||||
xcb_destroy_window(conn, win);
|
||||
close_connection:
|
||||
xcb_disconnect(conn);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -305,7 +314,7 @@ engine_xrender_xcb_loop(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;
|
||||
|
||||
|
@ -344,7 +353,7 @@ engine_xrender_xcb_loop(void)
|
|||
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);
|
||||
|
@ -357,7 +366,7 @@ engine_xrender_xcb_loop(void)
|
|||
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;
|
||||
|
||||
|
@ -382,7 +391,7 @@ engine_xrender_xcb_loop(void)
|
|||
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);
|
||||
|
@ -398,3 +407,10 @@ engine_xrender_xcb_loop(void)
|
|||
|
||||
goto again;
|
||||
}
|
||||
|
||||
void
|
||||
engine_xrender_xcb_shutdown(void)
|
||||
{
|
||||
xcb_destroy_window(conn, win);
|
||||
xcb_disconnect(conn);
|
||||
}
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
|
||||
int engine_xrender_xcb_args(int argc, char **argv);
|
||||
void engine_xrender_xcb_loop(void);
|
||||
void engine_xrender_xcb_shutdown(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -7,6 +7,7 @@ int loops = LOOPS;
|
|||
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
|
||||
|
@ -1118,6 +1119,12 @@ engine_loop(void)
|
|||
loop_func();
|
||||
}
|
||||
|
||||
void
|
||||
engine_shutdown(void)
|
||||
{
|
||||
shutdown_func();
|
||||
}
|
||||
|
||||
static int
|
||||
_engine_go(void)
|
||||
{
|
||||
|
@ -1191,67 +1198,115 @@ _engine_args(int argc, char **argv)
|
|||
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))
|
||||
{
|
||||
|
@ -1377,5 +1432,6 @@ main(int argc, char **argv)
|
|||
evas_free(evas);
|
||||
|
||||
evas_shutdown();
|
||||
engine_shutdown();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue