fail if evas_engine_info_set() fails

SVN revision: 39671
This commit is contained in:
Vincent Torri 2009-03-24 09:06:40 +00:00
parent 7db88370f1
commit 0f6c7f1ede
15 changed files with 121 additions and 19 deletions

View File

@ -239,14 +239,18 @@ engine_direct3d_args(int argc, char **argv)
einfo = (Evas_Engine_Info_Direct3D *)evas_engine_info_get(evas);
if (!einfo)
{
fprintf(stderr, "Evas does not support the Direct3D Engine\n");
fprintf(stderr, "Evas does not support the Direct3D Engine\n");
goto destroy_window;
}
einfo->info.window = window;
einfo->info.depth = depth;
einfo->info.rotation = 0;
evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
if (!evas_engine_info_set(evas, (Evas_Engine_Info *)einfo))
{
printf("Evas can not setup the informations of the Direct3D Engine\n");
goto destroy_window;
}
/* the second parameter is ignored, as it's the first call of ShowWindow */
ShowWindow(window, SW_SHOWDEFAULT);

View File

@ -71,7 +71,11 @@ engine_directfb_args(int argc, char **argv)
einfo->info.dfb = _dfb;
einfo->info.surface = _dfb_surface;
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the DirectFB Engine\n");
return 0;
}
return 1;
}

View File

@ -32,7 +32,11 @@ engine_fb_args(int argc, char **argv)
einfo->info.device_number = 0;
einfo->info.refresh = 0;
einfo->info.rotation = 0;
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the FB Engine\n");
return 0;
}
return 1;
}

View File

@ -237,7 +237,11 @@ engine_gl_glew_args(int argc, char **argv)
einfo->info.window = window;
einfo->info.depth = depth;
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the GL Glew Engine\n");
goto destroy_window;
}
/* the second parameter is ignored, as it's the first call of ShowWindow */
ShowWindow(window, SW_SHOWDEFAULT);

View File

@ -60,7 +60,11 @@ engine_gl_x11_args(int argc, char **argv)
CWBitGravity | CWEventMask,
&attr);
einfo->info.drawable = win;
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the OpenGL X11 Engine\n");
goto destroy_window;
}
XStoreName(disp, win, "Expedite - Evas Test Suite");
chint.res_name = "expedite";

View File

@ -100,7 +100,11 @@ engine_quartz_args(int argc, char **argv)
evas_output_viewport_set(evas, 0, 0, win_w, win_h);
einfo->info.context = [evas_view context];
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the Quartz Engine\n");
goto destroy_window;
}
return 1;
}

View File

@ -350,7 +350,11 @@ engine_software_16_ddraw_args(int argc, char **argv)
einfo->info.surface_source = surface_source;
einfo->info.depth = depth;
einfo->info.rotation = 0;
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the 16 bits Software DirectDraw Engine\n");
goto destroy_window;
}
/* the second parameter is ignored, as it's the first call of ShowWindow */
ShowWindow(window, SW_SHOWDEFAULT);

View File

@ -135,6 +135,32 @@ MainWndProc(HWND hwnd,
if (_resume)
_resume (backend);
return 0;
case WM_SIZE:
{
Evas_Engine_Info_Software_16_WinCE *einfo;
printf ("WM_SIZE %dx%d\n", LOWORD(lParam), HIWORD(lParam));
einfo = (Evas_Engine_Info_Software_16_WinCE *)evas_engine_info_get(evas);
if (!einfo)
return 0;
if (einfo->info.rotation != 0)
{
einfo->info.width = win_h;
einfo->info.height = win_w;
einfo->info.rotation = 90;
}
else
{
einfo->info.width = win_w;
einfo->info.height = win_h;
einfo->info.rotation = 0;
}
evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
return 0;
}
default:
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
@ -146,6 +172,9 @@ engine_software_16_wince_args(int argc, char **argv)
WNDCLASS wc;
RECT rect;
Evas_Engine_Info_Software_16_WinCE *einfo;
HWND task_bar;
HWND sip_window;
HWND sip_icon;
int width;
int height;
int stride_x;
@ -210,8 +239,16 @@ engine_software_16_wince_args(int argc, char **argv)
return 0;
}
SHFullScreen(window,
SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
/* hide top level windows (Task bar, SIP and SIP button */
task_bar = FindWindow(L"HHTaskBar", NULL);
ShowWindow(task_bar, SW_HIDE);
EnableWindow(task_bar, FALSE);
sip_window = FindWindow(L"SipWndClass", NULL);
ShowWindow(sip_icon, SW_HIDE);
EnableWindow(sip_icon, FALSE);
sip_icon = FindWindow(L"MS_SIPBUTTON", NULL);
ShowWindow(sip_icon, SW_HIDE);
EnableWindow(sip_icon, FALSE);
if (!_wince_hardware_keys_register(window))
{
@ -238,7 +275,14 @@ engine_software_16_wince_args(int argc, char **argv)
einfo->info.height = win_h;
einfo->info.backend = backend;
einfo->info.rotation = 0;
evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
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;
}
_suspend = einfo->func.suspend;
_resume = einfo->func.resume;

View File

@ -57,7 +57,11 @@ engine_software_16_x11_args(int argc, char **argv)
CWBitGravity | CWEventMask,
&attr);
einfo->info.drawable = win;
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
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;
}
XStoreName(disp, win, "Expedite - Evas Test Suite");
chint.res_name = "expedite";

View File

@ -249,7 +249,11 @@ engine_software_ddraw_args(int argc, char **argv)
einfo->info.window = window;
einfo->info.depth = depth;
einfo->info.rotation = 0;
evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the Software DirectDraw Engine\n");
goto destroy_window;
}
/* the second parameter is ignored, as it's the first call of ShowWindow */
ShowWindow(window, SW_SHOWDEFAULT);

View File

@ -33,7 +33,12 @@ engine_software_sdl_args(int argc, char **argv)
einfo->info.fullscreen = 0;
einfo->info.noframe = 0;
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the Software SDL Engine\n");
return 0;
}
return 1;
}

View File

@ -64,7 +64,11 @@ engine_software_x11_args(int argc, char **argv)
CWBitGravity | CWEventMask,
&attr);
einfo->info.drawable = win;
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the Software X11 Engine\n");
return 0;
}
XStoreName(disp, win, "Expedite - Evas Test Suite");
chint.res_name = "expedite";

View File

@ -131,7 +131,11 @@ engine_software_xcb_args(int argc, char **argv)
xcb_map_window(conn, win);
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
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;
}
/* XStoreName(disp, win, "Expedite - Evas Test Suite"); */

View File

@ -59,7 +59,12 @@ engine_xrender_x11_args(int argc, char **argv)
CWBitGravity | CWEventMask,
&attr);
einfo->info.drawable = win;
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
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;
}
XStoreName(disp, win, "Expedite - Evas Test Suite");
chint.res_name = "expedite";

View File

@ -144,9 +144,13 @@ engine_xrender_xcb_args(int argc, char **argv)
value_list);
einfo->info.drawable = win;
xcb_map_window(conn, win);
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;
}
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
xcb_map_window(conn, win);
/* XStoreName(disp, win, "Expedite - Evas Test Suite"); */