From 7bb002f75748f294ff6f8753ba64ef728919ed23 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Sat, 21 Feb 2009 22:50:45 +0000 Subject: [PATCH] add log formatting SVN revision: 39129 --- .../ecore/src/lib/ecore_win32/ecore_win32.c | 144 ++-- .../src/lib/ecore_win32/ecore_win32_cursor.c | 10 + .../src/lib/ecore_win32/ecore_win32_event.c | 42 +- .../src/lib/ecore_win32/ecore_win32_window.c | 626 ++++++++++++------ 4 files changed, 540 insertions(+), 282 deletions(-) diff --git a/legacy/ecore/src/lib/ecore_win32/ecore_win32.c b/legacy/ecore/src/lib/ecore_win32/ecore_win32.c index b5f0cfc396..5416918abc 100644 --- a/legacy/ecore/src/lib/ecore_win32/ecore_win32.c +++ b/legacy/ecore/src/lib/ecore_win32/ecore_win32.c @@ -14,6 +14,8 @@ #undef WIN32_LEAN_AND_MEAN #include +#include + #include "Ecore.h" #include "Ecore_Win32.h" #include "ecore_win32_private.h" @@ -66,6 +68,14 @@ LRESULT CALLBACK _ecore_win32_window_procedure(HWND window, WPARAM window_param, LPARAM data_param); +static void _ecore_wince_error_print_cb(Eina_Error_Level level, + const char *file, + const char *fnc, + int line, + const char *fmt, + void *data, + va_list args); + /***** API *****/ @@ -75,16 +85,22 @@ ecore_win32_init() { WNDCLASS wc; + eina_error_print_cb_set(_ecore_wince_error_print_cb, NULL); + + EINA_ERROR_PINFO("initializing ecore_win32 (current count: %d)\n", _ecore_win32_init_count); + if (_ecore_win32_init_count > 0) { _ecore_win32_init_count++; return _ecore_win32_init_count; } - printf (" *** ecore_win32_init\n"); _ecore_win32_instance = GetModuleHandle(NULL); if (!_ecore_win32_instance) - return 0; + { + EINA_ERROR_PERR("GetModuleHandle() failed\n"); + return 0; + } memset (&wc, 0, sizeof (WNDCLASS)); wc.style = CS_HREDRAW | CS_VREDRAW; @@ -100,12 +116,14 @@ ecore_win32_init() if(!RegisterClass(&wc)) { + EINA_ERROR_PERR("RegisterClass() failed\n"); FreeLibrary(_ecore_win32_instance); return 0; } if (!ecore_win32_dnd_init()) { + EINA_ERROR_PERR("ecore_win32_dnd_init() failed\n"); FreeLibrary(_ecore_win32_instance); return 0; } @@ -140,13 +158,21 @@ ecore_win32_init() int ecore_win32_shutdown() { + EINA_ERROR_PINFO("shutting down ecore_win32 (current count: %d)\n", _ecore_win32_init_count); + _ecore_win32_init_count--; if (_ecore_win32_init_count > 0) return _ecore_win32_init_count; if (!_ecore_win32_instance) return _ecore_win32_init_count; ecore_win32_dnd_shutdown(); - UnregisterClass(ECORE_WIN32_WINDOW_CLASS, _ecore_win32_instance); - FreeLibrary(_ecore_win32_instance); + if (!UnregisterClass(ECORE_WIN32_WINDOW_CLASS, _ecore_win32_instance)) + { + EINA_ERROR_PERR("UnregisterClass() failed\n"); + } + if (!FreeLibrary(_ecore_win32_instance)) + { + EINA_ERROR_PERR("FreeLibrary() failed\n"); + } _ecore_win32_instance = NULL; if (_ecore_win32_init_count < 0) _ecore_win32_init_count = 0; @@ -160,12 +186,20 @@ ecore_win32_screen_depth_get() HDC dc; int depth; + EINA_ERROR_PINFO("getting screen depth\n"); + dc = GetDC(NULL); if (!dc) - return 0; + { + EINA_ERROR_PERR("GetDC() failed\n"); + return 0; + } depth = GetDeviceCaps(dc, BITSPIXEL); - ReleaseDC(NULL, dc); + if (!ReleaseDC(NULL, dc)) + { + EINA_ERROR_PERR("ReleaseDC() failed (device context not released)\n"); + } return depth; } @@ -239,47 +273,37 @@ _ecore_win32_window_procedure(HWND window, { /* Keyboard input notifications */ case WM_KEYDOWN: - printf (" * ecore message : keystroke down\n"); _ecore_win32_event_handle_key_press(data, 1); return 0; case WM_CHAR: _ecore_win32_event_handle_key_press(data, 0); return 0; case WM_KEYUP: - printf (" * ecore message : keystroke up\n"); _ecore_win32_event_handle_key_release(data, 1); return 0; case WM_SETFOCUS: - printf (" * ecore message : focus in\n"); _ecore_win32_event_handle_focus_in(data); return 0; case WM_KILLFOCUS: - printf (" * ecore message : focus out\n"); _ecore_win32_event_handle_focus_out(data); return 0; /* Mouse input notifications */ case WM_LBUTTONDOWN: - printf (" * ecore message : lbuttondown\n"); _ecore_win32_event_handle_button_press(data, 1); return 0; case WM_MBUTTONDOWN: - printf (" * ecore message : mbuttondown\n"); _ecore_win32_event_handle_button_press(data, 2); return 0; case WM_RBUTTONDOWN: - printf (" * ecore message : rbuttondown\n"); _ecore_win32_event_handle_button_press(data, 3); return 0; case WM_LBUTTONUP: - printf (" * ecore message : lbuttonup\n"); _ecore_win32_event_handle_button_release(data, 1); return 0; case WM_MBUTTONUP: - printf (" * ecore message : mbuttonup\n"); _ecore_win32_event_handle_button_release(data, 2); return 0; case WM_RBUTTONUP: - printf (" * ecore message : rbuttonup\n"); _ecore_win32_event_handle_button_release(data, 3); return 0; case WM_MOUSEMOVE: @@ -290,58 +314,49 @@ _ecore_win32_window_procedure(HWND window, w = (struct _Ecore_Win32_Window *)GetWindowLong(window, GWL_USERDATA); if (GetClientRect(window, &rect)) - { - POINT pt; + { + POINT pt; - pt.x = GET_X_LPARAM(data_param); - pt.y = GET_Y_LPARAM(data_param); - if (!PtInRect(&rect, pt)) - { - if (w->pointer_is_in) - { - w->pointer_is_in = 0; - _ecore_win32_event_handle_leave_notify(data); - } - } - else - { - if (!w->pointer_is_in) - { - w->pointer_is_in = 1; - _ecore_win32_event_handle_enter_notify(data); - } + EINA_ERROR_PINFO("mouse in window\n"); - } - } + pt.x = GET_X_LPARAM(data_param); + pt.y = GET_Y_LPARAM(data_param); + if (!PtInRect(&rect, pt)) + { + if (w->pointer_is_in) + { + w->pointer_is_in = 0; + _ecore_win32_event_handle_leave_notify(data); + } + } + else + { + if (!w->pointer_is_in) + { + w->pointer_is_in = 1; + _ecore_win32_event_handle_enter_notify(data); + } + } + } + else + { + EINA_ERROR_PERR("GetClientRect() failed\n"); + } _ecore_win32_event_handle_motion_notify(data); return 0; } case WM_MOUSEWHEEL: - printf (" * ecore message : mouse wheel\n"); _ecore_win32_event_handle_button_press(data, 4); return 0; /* Window notifications */ case WM_CREATE: - { - RECT rect; - GetClientRect(window, &rect); - printf (" *** ecore message : create %ld %ld\n", - rect.right - rect.left, rect.bottom - rect.top); - } _ecore_win32_event_handle_create_notify(data); return 0; case WM_DESTROY: - printf (" * ecore message : destroy\n"); _ecore_win32_event_handle_destroy_notify(data); return 0; case WM_SHOWWINDOW: - { - RECT rect; - GetClientRect(window, &rect); - printf (" *** ecore message : show %ld %ld\n", - rect.right - rect.left, rect.bottom - rect.top); - } if ((data->data_param == SW_OTHERUNZOOM) || (data->data_param == SW_OTHERUNZOOM)) return 0; @@ -353,7 +368,6 @@ _ecore_win32_window_procedure(HWND window, return 0; case WM_CLOSE: - printf (" * ecore message : close\n"); _ecore_win32_event_handle_delete_request(data); return 0; case WM_MOVING: @@ -380,12 +394,6 @@ _ecore_win32_window_procedure(HWND window, /* _ecore_win32_event_handle_configure_notify(data); */ /* return 0; */ case WM_WINDOWPOSCHANGED: - { - RECT rect; - GetClientRect(window, &rect); - printf (" *** ecore message : WINDOWPOSCHANGED %ld %ld\n", - rect.right - rect.left, rect.bottom - rect.top); - } _ecore_win32_event_handle_configure_notify(data); return 0; case WM_ENTERSIZEMOVE : @@ -399,7 +407,6 @@ _ecore_win32_window_procedure(HWND window, { RECT rect; - printf (" * ecore message : paint\n"); if (GetUpdateRect(window, &rect, FALSE)) { PAINTSTRUCT ps; @@ -409,11 +416,6 @@ _ecore_win32_window_procedure(HWND window, data->update = rect; _ecore_win32_event_handle_expose(data); EndPaint(window, &ps); - printf (" * %ld %ld %ld %ld\n", - rect.left, - rect.top, - rect.right - rect.left, - rect.bottom - rect.top); } return 0; } @@ -426,5 +428,17 @@ _ecore_win32_window_procedure(HWND window, default: return DefWindowProc(window, message, window_param, data_param); } - +} + +static void +_ecore_wince_error_print_cb(Eina_Error_Level level __UNUSED__, + const char *file __UNUSED__, + const char *fnc, + int line, + const char *fmt, + void *data __UNUSED__, + va_list args) +{ + fprintf(stderr, "[%s:%d] ", fnc, line); + vfprintf(stderr, fmt, args); } diff --git a/legacy/ecore/src/lib/ecore_win32/ecore_win32_cursor.c b/legacy/ecore/src/lib/ecore_win32/ecore_win32_cursor.c index 7e89f9a274..bbfd5d68ea 100644 --- a/legacy/ecore/src/lib/ecore_win32/ecore_win32_cursor.c +++ b/legacy/ecore/src/lib/ecore_win32/ecore_win32_cursor.c @@ -10,6 +10,8 @@ #include #undef WIN32_LEAN_AND_MEAN +#include + #include "Ecore_Win32.h" #include "ecore_win32_private.h" @@ -28,6 +30,8 @@ ecore_win32_cursor_new(const void *pixels_and, int cursor_width; int cursor_height; + EINA_ERROR_PINFO("creating cursor\n"); + cursor_width = GetSystemMetrics(SM_CXCURSOR); cursor_height = GetSystemMetrics(SM_CYCURSOR); @@ -48,6 +52,8 @@ ecore_win32_cursor_new(const void *pixels_and, void ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor) { + EINA_ERROR_PINFO("destroying cursor\n"); + DestroyCursor(cursor); } @@ -57,6 +63,8 @@ ecore_win32_cursor_shape_get(Ecore_Win32_Cursor_Shape shape) Ecore_Win32_Cursor *cursor = NULL; const char *cursor_name; + EINA_ERROR_PINFO("geting shape cursor\n"); + switch (shape) { case ECORE_WIN32_CURSOR_SHAPE_APP_STARTING: @@ -117,6 +125,8 @@ ecore_win32_cursor_size_get(void) int width; int height; + EINA_ERROR_PINFO("geting size cursor\n"); + width = GetSystemMetrics(SM_CXCURSOR); height = GetSystemMetrics(SM_CYCURSOR); return (width > height) ? width : height; diff --git a/legacy/ecore/src/lib/ecore_win32/ecore_win32_event.c b/legacy/ecore/src/lib/ecore_win32/ecore_win32_event.c index 4b0b342015..abc3d4d656 100644 --- a/legacy/ecore/src/lib/ecore_win32/ecore_win32_event.c +++ b/legacy/ecore/src/lib/ecore_win32/ecore_win32_event.c @@ -14,6 +14,8 @@ #undef WIN32_LEAN_AND_MEAN #include +#include + #include "Ecore.h" #include "Ecore_Win32.h" #include "ecore_win32_private.h" @@ -54,6 +56,8 @@ _ecore_win32_event_handle_key_press(Ecore_Win32_Callback_Data *msg, { Ecore_Win32_Event_Key_Down *e; + EINA_ERROR_PINFO("key pressed\n"); + e = (Ecore_Win32_Event_Key_Down *)malloc(sizeof(Ecore_Win32_Event_Key_Down)); if (!e) return; @@ -101,6 +105,8 @@ _ecore_win32_event_handle_key_release(Ecore_Win32_Callback_Data *msg, { Ecore_Win32_Event_Key_Up *e; + EINA_ERROR_PINFO("key released\n"); + e = (Ecore_Win32_Event_Key_Up *)calloc(1, sizeof(Ecore_Win32_Event_Key_Up)); if (!e) return; @@ -148,6 +154,8 @@ _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg, { Ecore_Win32_Window *window; + EINA_ERROR_PINFO("mouse button pressed\n"); + window = (void *)GetWindowLong(msg->window, GWL_USERDATA); if (button > 3) @@ -240,7 +248,6 @@ _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg, ecore_event_add(ECORE_WIN32_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL); } } -/* printf (" * ecore event button press\n"); */ } void @@ -249,6 +256,8 @@ _ecore_win32_event_handle_button_release(Ecore_Win32_Callback_Data *msg, { Ecore_Win32_Window *window; + EINA_ERROR_PINFO("mouse button released\n"); + window = (void *)GetWindowLong(msg->window, GWL_USERDATA); { @@ -298,8 +307,6 @@ _ecore_win32_event_handle_button_release(Ecore_Win32_Callback_Data *msg, ecore_event_add(ECORE_WIN32_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL); } - -/* printf (" * ecore event button release\n"); */ } void @@ -307,6 +314,8 @@ _ecore_win32_event_handle_motion_notify(Ecore_Win32_Callback_Data *msg) { Ecore_Win32_Event_Mouse_Move *e; + EINA_ERROR_PINFO("mouse moved\n"); + e = (Ecore_Win32_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Win32_Event_Mouse_Move)); if (!e) return; @@ -324,6 +333,8 @@ _ecore_win32_event_handle_enter_notify(Ecore_Win32_Callback_Data *msg) { Ecore_Win32_Event_Mouse_Move *e; + EINA_ERROR_PINFO("mouse in\n"); + e = (Ecore_Win32_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Win32_Event_Mouse_Move)); if (!e) return; @@ -361,6 +372,8 @@ _ecore_win32_event_handle_leave_notify(Ecore_Win32_Callback_Data *msg) { Ecore_Win32_Event_Mouse_Move *e; + EINA_ERROR_PINFO("mouse out\n"); + e = (Ecore_Win32_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Win32_Event_Mouse_Move)); if (!e) return; @@ -397,6 +410,8 @@ _ecore_win32_event_handle_focus_in(Ecore_Win32_Callback_Data *msg) { Ecore_Win32_Event_Window_Focus_In *e; + EINA_ERROR_PINFO("focus in\n"); + e = (Ecore_Win32_Event_Window_Focus_In *)calloc(1, sizeof(Ecore_Win32_Event_Window_Focus_In)); if (!e) return; @@ -413,6 +428,8 @@ _ecore_win32_event_handle_focus_out(Ecore_Win32_Callback_Data *msg) { Ecore_Win32_Event_Window_Focus_Out *e; + EINA_ERROR_PINFO("focus out\n"); + e = (Ecore_Win32_Event_Window_Focus_Out *)calloc(1, sizeof(Ecore_Win32_Event_Window_Focus_Out)); if (!e) return; @@ -429,6 +446,8 @@ _ecore_win32_event_handle_expose(Ecore_Win32_Callback_Data *msg) { Ecore_Win32_Event_Window_Damage *e; + EINA_ERROR_PINFO("window expose\n"); + e = (Ecore_Win32_Event_Window_Damage *)calloc(1, sizeof(Ecore_Win32_Event_Window_Damage)); if (!e) return; @@ -438,7 +457,6 @@ _ecore_win32_event_handle_expose(Ecore_Win32_Callback_Data *msg) e->y = msg->update.top; e->width = msg->update.right - msg->update.left; e->height = msg->update.bottom - msg->update.top; -/* printf (" * ecore : event expose %d %d\n", e->width, e->height); */ e->time = _ecore_win32_event_last_time; @@ -450,6 +468,8 @@ _ecore_win32_event_handle_create_notify(Ecore_Win32_Callback_Data *msg) { Ecore_Win32_Event_Window_Create *e; + EINA_ERROR_PINFO("window create notify\n"); + e = calloc(1, sizeof(Ecore_Win32_Event_Window_Create)); if (!e) return; @@ -465,6 +485,8 @@ _ecore_win32_event_handle_destroy_notify(Ecore_Win32_Callback_Data *msg) { Ecore_Win32_Event_Window_Destroy *e; + EINA_ERROR_PINFO("window destroy notify\n"); + e = calloc(1, sizeof(Ecore_Win32_Event_Window_Destroy)); if (!e) return; @@ -481,6 +503,8 @@ _ecore_win32_event_handle_map_notify(Ecore_Win32_Callback_Data *msg) { Ecore_Win32_Event_Window_Show *e; + EINA_ERROR_PINFO("window map notify\n"); + e = calloc(1, sizeof(Ecore_Win32_Event_Window_Show)); if (!e) return; @@ -496,6 +520,8 @@ _ecore_win32_event_handle_unmap_notify(Ecore_Win32_Callback_Data *msg) { Ecore_Win32_Event_Window_Hide *e; + EINA_ERROR_PINFO("window unmap notify\n"); + e = calloc(1, sizeof(Ecore_Win32_Event_Window_Hide)); if (!e) return; @@ -513,6 +539,8 @@ _ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg) Ecore_Win32_Event_Window_Configure *e; WINDOWPOS *window_pos; + EINA_ERROR_PINFO("window configure notify\n"); + e = calloc(1, sizeof(Ecore_Win32_Event_Window_Configure)); if (!e) return; @@ -524,7 +552,6 @@ _ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg) return; } -/* printf ("_ecore_win32_event_handle_configure_notify\n"); */ e->window = (void *)GetWindowLong(msg->window, GWL_USERDATA); e->abovewin = (void *)GetWindowLong(window_pos->hwndInsertAfter, GWL_USERDATA); e->x = wi.rcClient.left; @@ -542,6 +569,8 @@ _ecore_win32_event_handle_resize(Ecore_Win32_Callback_Data *msg) RECT rect; Ecore_Win32_Event_Window_Resize *e; + EINA_ERROR_PINFO("window resize\n"); + if (!GetClientRect(msg->window, &rect)) return; @@ -552,7 +581,6 @@ _ecore_win32_event_handle_resize(Ecore_Win32_Callback_Data *msg) e->width = rect.right - rect.left; e->height = rect.bottom - rect.top; e->time = _ecore_win32_event_last_time; -/* printf (" * _ecore_win32_event_handle_resize %d %d\n", e->width, e->height); */ ecore_event_add(ECORE_WIN32_EVENT_WINDOW_RESIZE, e, NULL, NULL); } @@ -562,6 +590,8 @@ _ecore_win32_event_handle_delete_request(Ecore_Win32_Callback_Data *msg) { Ecore_Win32_Event_Window_Delete_Request *e; + EINA_ERROR_PINFO("window delete request\n"); + e = calloc(1, sizeof(Ecore_Win32_Event_Window_Delete_Request)); if (!e) return; diff --git a/legacy/ecore/src/lib/ecore_win32/ecore_win32_window.c b/legacy/ecore/src/lib/ecore_win32/ecore_win32_window.c index f9c2e4e511..cc1d45f022 100644 --- a/legacy/ecore/src/lib/ecore_win32/ecore_win32_window.c +++ b/legacy/ecore/src/lib/ecore_win32/ecore_win32_window.c @@ -15,6 +15,8 @@ #include #undef WIN32_LEAN_AND_MEAN +#include + #include "Ecore_Win32.h" #include "ecore_win32_private.h" @@ -48,6 +50,8 @@ ecore_win32_window_new(Ecore_Win32_Window *parent, int width, int height) { + EINA_ERROR_PINFO("creating window with border\n"); + return ecore_win32_window_internal_new(parent, x, y, width, height, @@ -62,6 +66,8 @@ ecore_win32_window_override_new(Ecore_Win32_Window *parent, int width, int height) { + EINA_ERROR_PINFO("creating window without border\n"); + return ecore_win32_window_internal_new(parent, x, y, width, height, @@ -75,12 +81,13 @@ ecore_win32_window_del(Ecore_Win32_Window *window) if (!window) return; + EINA_ERROR_PINFO("destroying window\n"); + if (wnd->shape.mask != NULL) free(wnd->shape.mask); DestroyWindow(((struct _Ecore_Win32_Window *)window)->window); free(window); - printf ("ecore_win32_window_del\n"); } void * @@ -133,15 +140,22 @@ ecore_win32_window_move(Ecore_Win32_Window *window, if (!window) return; - printf ("ecore_win32_window_move %p : %d %d\n", window, x, y); + EINA_ERROR_PINFO("moving window (%dx%d)\n", x, y); + w = ((struct _Ecore_Win32_Window *)window)->window; if (!GetWindowRect(w, &rect)) - return; + { + EINA_ERROR_PERR("GetWindowRect() failed\n"); + return; + } - MoveWindow(w, x, y, - rect.right - rect.left, - rect.bottom - rect.top, - TRUE); + if (!MoveWindow(w, x, y, + rect.right - rect.left, + rect.bottom - rect.top, + TRUE)) + { + EINA_ERROR_PERR("MoveWindow() failed\n"); + } } void @@ -157,17 +171,14 @@ ecore_win32_window_resize(Ecore_Win32_Window *window, if (!window) return; - w = (struct _Ecore_Win32_Window *)window; - if (!GetWindowRect(w->window, &rect)) return; + EINA_ERROR_PINFO("resizing window (%dx%d)\n", width, height); - printf ("ecore_win32_window_resize 0 : %p (%d %d) (%d %d) (%d %d)\n", - w, - w->min_width, - w->min_height, - w->max_width, - w->max_height, - width, - height); + w = (struct _Ecore_Win32_Window *)window; + if (!GetWindowRect(w->window, &rect)) + { + EINA_ERROR_PERR("GetWindowRect() failed\n"); + return; + } x = rect.left; y = rect.top; @@ -182,18 +193,24 @@ ecore_win32_window_resize(Ecore_Win32_Window *window, /* printf ("ecore_win32_window_resize 3 : %d %d\n", w->max_height, height); */ rect.right = width; rect.bottom = height; - style = GetWindowLong(w->window, GWL_STYLE); + if (!(style = GetWindowLong(w->window, GWL_STYLE))) + { + EINA_ERROR_PERR("GetWindowLong() failed\n"); + return; + } if (!AdjustWindowRect(&rect, style, FALSE)) - return; + { + EINA_ERROR_PERR("AdjustWindowRect() failed\n"); + return; + } if (!MoveWindow(w->window, x, y, rect.right - rect.left, rect.bottom - rect.top, FALSE)) { - printf (" MEEERDE !!!\n"); + EINA_ERROR_PERR("MoveWindow() failed\n"); } - printf ("ecore_win32_window_resize 4 : %d %d\n", width, height); } void @@ -209,7 +226,8 @@ ecore_win32_window_move_resize(Ecore_Win32_Window *window, if (!window) return; - printf ("ecore_win32_window_move_resize 0 : %p %d %d\n", window, width, height); + EINA_ERROR_PINFO("moving and resizing window (%dx%d %dx%d)\n", x, y, width, height); + w = ((struct _Ecore_Win32_Window *)window); rect.left = 0; rect.top = 0; @@ -217,17 +235,26 @@ ecore_win32_window_move_resize(Ecore_Win32_Window *window, if ((unsigned int)width > w->max_width) width = w->max_width; if ((unsigned int)height < w->min_height) height = w->min_height; if ((unsigned int)height > w->max_height) height = w->max_height; - printf ("ecore_win32_window_move_resize 1 : %d %d\n", width, height); rect.right = width; rect.bottom = height; - style = GetWindowLong(w->window, GWL_STYLE); + if (!(style = GetWindowLong(w->window, GWL_STYLE))) + { + EINA_ERROR_PERR("GetWindowLong() failed\n"); + return; + } if (!AdjustWindowRect(&rect, style, FALSE)) - return; + { + EINA_ERROR_PERR("AdjustWindowRect() failed\n"); + return; + } - MoveWindow(w->window, x, y, - rect.right - rect.left, - rect.bottom - rect.top, - TRUE); + if (!MoveWindow(w->window, x, y, + rect.right - rect.left, + rect.bottom - rect.top, + TRUE)) + { + EINA_ERROR_PERR("MoveWindow() failed\n"); + } } void @@ -241,7 +268,8 @@ ecore_win32_window_geometry_get(Ecore_Win32_Window *window, int w; int h; - printf ("ecore_win32_window_geometry_get %p\n", window); + EINA_ERROR_PINFO("getting window geometry\n"); + if (!window) { if (x) *x = 0; @@ -255,6 +283,8 @@ ecore_win32_window_geometry_get(Ecore_Win32_Window *window, if (!GetClientRect(((struct _Ecore_Win32_Window *)window)->window, &rect)) { + EINA_ERROR_PERR("GetClientRect() failed\n"); + if (x) *x = 0; if (y) *y = 0; if (width) *width = 0; @@ -269,6 +299,8 @@ ecore_win32_window_geometry_get(Ecore_Win32_Window *window, if (!GetWindowRect(((struct _Ecore_Win32_Window *)window)->window, &rect)) { + EINA_ERROR_PERR("GetWindowRect() failed\n"); + if (x) *x = 0; if (y) *y = 0; if (width) *width = 0; @@ -290,7 +322,8 @@ ecore_win32_window_size_get(Ecore_Win32_Window *window, { RECT rect; - printf ("ecore_win32_window_size_get %p\n", window); + EINA_ERROR_PINFO("getting window size\n"); + if (!window) { if (width) *width = GetSystemMetrics(SM_CXSCREEN); @@ -302,6 +335,8 @@ ecore_win32_window_size_get(Ecore_Win32_Window *window, if (!GetClientRect(((struct _Ecore_Win32_Window *)window)->window, &rect)) { + EINA_ERROR_PERR("GetClientRect() failed\n"); + if (width) *width = 0; if (height) *height = 0; } @@ -449,20 +484,31 @@ ecore_win32_window_shape_set(Ecore_Win32_Window *window, if (mask == NULL) { - wnd->shape.enabled = 0; - if (wnd->shape.layered != 0) - { - wnd->shape.layered = 0; + wnd->shape.enabled = 0; + if (wnd->shape.layered != 0) + { + wnd->shape.layered = 0; #if defined(WS_EX_LAYERED) - SetWindowLong(wnd->window, GWL_EXSTYLE, - GetWindowLong(wnd->window, GWL_EXSTYLE) & (~WS_EX_LAYERED)); - RedrawWindow(wnd->window, NULL, NULL, - RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN); + if (!SetWindowLong(wnd->window, GWL_EXSTYLE, + GetWindowLong(wnd->window, GWL_EXSTYLE) & (~WS_EX_LAYERED))) + { + EINA_ERROR_PERR("SetWindowLong() failed\n"); + return; + } + if (!RedrawWindow(wnd->window, NULL, NULL, + RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN)) + { + EINA_ERROR_PERR("RedrawWindow() failed\n"); + return; + } #endif - } - else - SetWindowRgn(wnd->window, NULL, TRUE); - return; + } + else + if (!SetWindowRgn(wnd->window, NULL, TRUE)) + { + EINA_ERROR_PERR("SetWindowRgn() failed\n"); + } + return; } if (width == 0 || height == 0) @@ -489,30 +535,67 @@ ecore_win32_window_shape_set(Ecore_Win32_Window *window, version_info.dwOSVersionInfoSize = sizeof(version_info); if (GetVersionEx(&version_info) == TRUE && version_info.dwMajorVersion == 5) { - SetWindowLong(wnd->window, GWL_EXSTYLE, - GetWindowLong(wnd->window, GWL_EXSTYLE) | WS_EX_LAYERED); + if (!SetWindowLong(wnd->window, GWL_EXSTYLE, + GetWindowLong(wnd->window, GWL_EXSTYLE) | WS_EX_LAYERED)) + { + EINA_ERROR_PERR("SetWindowLong() failed\n"); + return; + } wnd->shape.layered = 1; return; } #endif - rgn = CreateRectRgn(0, 0, 0, 0); + if (!(rgn = CreateRectRgn(0, 0, 0, 0))) + { + EINA_ERROR_PERR("CreateRectRgn() failed\n"); + return; + } for (y = 0; y < height; y++) { - HRGN rgnLine = CreateRectRgn(0, 0, 0, 0); - for (x = 0; x < width; x++) - { - if (mask[y * width + x] > 0) - { - HRGN rgnDot = CreateRectRgn(x, y, x + 1, y + 1); - CombineRgn(rgnLine, rgnLine, rgnDot, RGN_OR); - DeleteObject(rgnDot); - } - } - CombineRgn(rgn, rgn, rgnLine, RGN_OR); - DeleteObject(rgnLine); + HRGN rgnLine; + + if (!(rgnLine = CreateRectRgn(0, 0, 0, 0))) + { + EINA_ERROR_PERR("CreateRectRgn() failed\n"); + return; + } + for (x = 0; x < width; x++) + { + if (mask[y * width + x] > 0) + { + HRGN rgnDot; + + if (!(rgnDot = CreateRectRgn(x, y, x + 1, y + 1))) + { + EINA_ERROR_PERR("CreateRectRgn() failed\n"); + return; + } + if (CombineRgn(rgnLine, rgnLine, rgnDot, RGN_OR) == ERROR) + { + EINA_ERROR_PERR("CombineRgn() has not created a new region\n"); + } + if (!DeleteObject(rgnDot)) + { + EINA_ERROR_PERR("DeleteObject() failed\n"); + return; + } + } + } + if (CombineRgn(rgn, rgn, rgnLine, RGN_OR) == ERROR) + { + EINA_ERROR_PERR("CombineRgn() has not created a new region\n"); + } + if (!DeleteObject(rgnLine)) + { + EINA_ERROR_PERR("DeleteObject() failed\n"); + return; + } + } + if (!SetWindowRgn(wnd->window, rgn, TRUE)) + { + EINA_ERROR_PERR("SetWindowRgn() failed\n"); } - SetWindowRgn(wnd->window, rgn, TRUE); } void @@ -520,9 +603,21 @@ ecore_win32_window_show(Ecore_Win32_Window *window) { if (!window) return; - printf (" ** ecore_win32_window_show %p\n", window); - ShowWindow(((struct _Ecore_Win32_Window *)window)->window, SW_SHOWNORMAL); - UpdateWindow(((struct _Ecore_Win32_Window *)window)->window); + EINA_ERROR_PINFO("showing window\n"); + + if (!ShowWindow(((struct _Ecore_Win32_Window *)window)->window, SW_SHOWNORMAL)) + { + EINA_ERROR_PERR("ShowWindow() failed\n"); + return; + } + if (!UpdateWindow(((struct _Ecore_Win32_Window *)window)->window)) + { + EINA_ERROR_PERR("UpdateWindow() failed\n"); + } + if (!SendMessage(((struct _Ecore_Win32_Window *)window)->window, WM_SHOWWINDOW, 1, 0)) + { + EINA_ERROR_PERR("SendMessage() failed\n"); + } } /* FIXME: seems to block the taskbar */ @@ -531,8 +626,16 @@ ecore_win32_window_hide(Ecore_Win32_Window *window) { if (!window) return; - printf (" ** ecore_win32_window_hide %p\n", window); - ShowWindow(((struct _Ecore_Win32_Window *)window)->window, SW_HIDE); + EINA_ERROR_PINFO("hiding window\n"); + + if (!ShowWindow(((struct _Ecore_Win32_Window *)window)->window, SW_HIDE)) + { + EINA_ERROR_PERR("ShowWindow() failed\n"); + } + if (!SendMessage(((struct _Ecore_Win32_Window *)window)->window, WM_SHOWWINDOW, 0, 0)) + { + EINA_ERROR_PERR("SendMessage() failed\n"); + } } void @@ -540,10 +643,14 @@ ecore_win32_window_raise(Ecore_Win32_Window *window) { if (!window) return; - printf (" ** ecore_win32_window_raise %p\n", window); - SetWindowPos(((struct _Ecore_Win32_Window *)window)->window, - HWND_TOP, 0, 0, 0, 0, - SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); + EINA_ERROR_PINFO("raising window\n"); + + if (!SetWindowPos(((struct _Ecore_Win32_Window *)window)->window, + HWND_TOP, 0, 0, 0, 0, + SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE)) + { + EINA_ERROR_PERR("SetWindowPos() failed\n"); + } } void @@ -551,10 +658,14 @@ ecore_win32_window_lower(Ecore_Win32_Window *window) { if (!window) return; - printf (" ** ecore_win32_window_lower %p\n", window); - SetWindowPos(((struct _Ecore_Win32_Window *)window)->window, - HWND_BOTTOM, 0, 0, 0, 0, - SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); + EINA_ERROR_PINFO("lowering window\n"); + + if (!SetWindowPos(((struct _Ecore_Win32_Window *)window)->window, + HWND_BOTTOM, 0, 0, 0, 0, + SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE)) + { + EINA_ERROR_PERR("SetWindowPos() failed\n"); + } } void @@ -565,7 +676,12 @@ ecore_win32_window_title_set(Ecore_Win32_Window *window, if (!title || !title[0]) return; - SetWindowText(((struct _Ecore_Win32_Window *)window)->window, title); + EINA_ERROR_PINFO("setting window title\n"); + + if (!SetWindowText(((struct _Ecore_Win32_Window *)window)->window, title)) + { + EINA_ERROR_PERR("SetWindowText() failed\n"); + } } void @@ -573,7 +689,12 @@ ecore_win32_window_focus_set(Ecore_Win32_Window *window) { if (!window) return; - SetFocus(((struct _Ecore_Win32_Window *)window)->window); + EINA_ERROR_PINFO("focusing window\n"); + + if (!SetFocus(((struct _Ecore_Win32_Window *)window)->window)) + { + EINA_ERROR_PERR("SetFocus() failed\n"); + } } void @@ -589,15 +710,11 @@ ecore_win32_window_iconified_set(Ecore_Win32_Window *window, ((!ew->iconified) && (!on))) return; - if (on) + EINA_ERROR_PINFO("iconifying window: %s\n", on ? "yes" : "no"); + + if (!ShowWindow(ew->window, on ? SW_MINIMIZE : SW_RESTORE)) { - ShowWindow(ew->window, - SW_MINIMIZE); - } - else - { - ShowWindow(ew->window, - SW_RESTORE); + EINA_ERROR_PERR("ShowWindow() failed\n"); } ew->iconified = on; } @@ -613,31 +730,47 @@ ecore_win32_window_borderless_set(Ecore_Win32_Window *window, if (!window) return; - printf (" ** ecore_win32_window_borderless_set %p %d\n", window, on); ew = (struct _Ecore_Win32_Window *)window; if (((ew->borderless) && (on)) || ((!ew->borderless) && (!on))) return; + EINA_ERROR_PINFO("setting window border: %s\n", on ? "yes" : "no"); + w = ew->window; style = GetWindowLong(w, GWL_STYLE); if (on) { - if (!GetClientRect(w, &rect)) return; SetWindowLong(w, GWL_STYLE, style & ~WS_CAPTION); } else { - if (!GetWindowRect(w, &rect)) return; + if (!GetWindowRect(w, &rect)) + { + EINA_ERROR_PERR("GetWindowRect() failed\n"); + return; + } style |= WS_CAPTION; - AdjustWindowRect (&rect, style, FALSE); - SetWindowLong(w, GWL_STYLE, style); + if (!AdjustWindowRect (&rect, style, FALSE)) + { + EINA_ERROR_PERR("AdjustWindowRect() failed\n"); + return; + } + if (!SetWindowLong(w, GWL_STYLE, style)) + { + EINA_ERROR_PERR("SetWindowLong() failed\n"); + return; + } + } + if (!SetWindowPos(w, HWND_TOPMOST, + rect.left, rect.top, + rect.right - rect.left, rect.bottom - rect.top, + SWP_NOMOVE | SWP_FRAMECHANGED)) + { + EINA_ERROR_PERR("SetWindowPos() failed\n"); + return; } - SetWindowPos(w, HWND_TOPMOST, - rect.left, rect.top, - rect.right - rect.left, rect.bottom - rect.top, - SWP_NOMOVE | SWP_FRAMECHANGED); ew->borderless = on; } @@ -655,6 +788,8 @@ ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window, ((!ew->fullscreen) && (!on))) return; + EINA_ERROR_PINFO("setting fullscreen: %s\n", on ? "yes" : "no"); + ew->fullscreen = !!on; w = ew->window; @@ -662,26 +797,58 @@ ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window, { DWORD style; - if (!GetWindowRect(w, &ew->rect)) return; - if (!(ew->style = GetWindowLong(w, GWL_STYLE))) return; + if (!GetWindowRect(w, &ew->rect)) + { + EINA_ERROR_PERR("GetWindowRect() failed\n"); + return; + } + if (!(ew->style = GetWindowLong(w, GWL_STYLE))) + { + EINA_ERROR_PERR("GetWindowLong() failed\n"); + return; + } style = ew->style & ~WS_OVERLAPPEDWINDOW & ~WS_SIZEBOX; style |= WS_VISIBLE | WS_POPUP; - if (!SetWindowLong(w, GWL_STYLE, style)) return; - if (!SetWindowLong(w, GWL_EXSTYLE, WS_EX_TOPMOST)) return; - SetWindowPos(w, HWND_TOPMOST, 0, 0, - GetSystemMetrics (SM_CXSCREEN), GetSystemMetrics (SM_CYSCREEN), - SWP_NOCOPYBITS | SWP_SHOWWINDOW); + if (!SetWindowLong(w, GWL_STYLE, style)) + { + EINA_ERROR_PERR("SetWindowLong() failed\n"); + return; + } + if (!SetWindowLong(w, GWL_EXSTYLE, WS_EX_TOPMOST)) + { + EINA_ERROR_PERR("SetWindowLong() failed\n"); + return; + } + if (!SetWindowPos(w, HWND_TOPMOST, 0, 0, + GetSystemMetrics (SM_CXSCREEN), GetSystemMetrics (SM_CYSCREEN), + SWP_NOCOPYBITS | SWP_SHOWWINDOW)) + { + EINA_ERROR_PERR("SetWindowPos() failed\n"); + return; + } } else { - if (!SetWindowLong(w, GWL_STYLE, ew->style)) return; - if (!SetWindowLong(w, GWL_EXSTYLE, 0)) return; - SetWindowPos(w, HWND_NOTOPMOST, - ew->rect.left, - ew->rect.top, - ew->rect.right - ew->rect.left, - ew->rect.bottom - ew->rect.top, - SWP_NOCOPYBITS | SWP_SHOWWINDOW); + if (!SetWindowLong(w, GWL_STYLE, ew->style)) + { + EINA_ERROR_PERR("SetWindowLong() failed\n"); + return; + } + if (!SetWindowLong(w, GWL_EXSTYLE, 0)) + { + EINA_ERROR_PERR("SetWindowLong() failed\n"); + return; + } + if (!SetWindowPos(w, HWND_NOTOPMOST, + ew->rect.left, + ew->rect.top, + ew->rect.right - ew->rect.left, + ew->rect.bottom - ew->rect.top, + SWP_NOCOPYBITS | SWP_SHOWWINDOW)) + { + EINA_ERROR_PERR("SetWindowPos() failed\n"); + return; + } } } @@ -689,8 +856,13 @@ void ecore_win32_window_cursor_set(Ecore_Win32_Window *window, Ecore_Win32_Cursor *cursor) { - SetClassLong(((struct _Ecore_Win32_Window *)window)->window, - GCL_HCURSOR, (LONG)cursor); + EINA_ERROR_PINFO("setting cursor\n"); + + if (!SetClassLong(((struct _Ecore_Win32_Window *)window)->window, + GCL_HCURSOR, (LONG)cursor)) + { + EINA_ERROR_PERR("SetClassLong() failed\n"); + } } void @@ -700,9 +872,11 @@ ecore_win32_window_state_set(Ecore_Win32_Window *window, { unsigned int i; - if (!num) + if (!window || !state || !num) return; + EINA_ERROR_PINFO("setting cursor state\n"); + for (i = 0; i < num; i++) { switch (state[i]) @@ -756,107 +930,136 @@ ecore_win32_window_state_request_send(Ecore_Win32_Window *window, Ecore_Win32_Window_State state, unsigned int set) { - if (!window) - return; + if (!window) + return; + + EINA_ERROR_PINFO("sending cursor state\n"); switch (state) { - case ECORE_WIN32_WINDOW_STATE_ICONIFIED: - if (((struct _Ecore_Win32_Window *)window)->state.iconified) - ecore_win32_window_iconified_set(window, set); - break; - case ECORE_WIN32_WINDOW_STATE_MODAL: - ((struct _Ecore_Win32_Window *)window)->state.modal = 1; - break; - case ECORE_WIN32_WINDOW_STATE_STICKY: - ((struct _Ecore_Win32_Window *)window)->state.sticky = 1; - break; - case ECORE_WIN32_WINDOW_STATE_MAXIMIZED_VERT: - if (((struct _Ecore_Win32_Window *)window)->state.maximized_vert) - { - RECT rect; - int y; - int height; + case ECORE_WIN32_WINDOW_STATE_ICONIFIED: + if (((struct _Ecore_Win32_Window *)window)->state.iconified) + ecore_win32_window_iconified_set(window, set); + break; + case ECORE_WIN32_WINDOW_STATE_MODAL: + ((struct _Ecore_Win32_Window *)window)->state.modal = 1; + break; + case ECORE_WIN32_WINDOW_STATE_STICKY: + ((struct _Ecore_Win32_Window *)window)->state.sticky = 1; + break; + case ECORE_WIN32_WINDOW_STATE_MAXIMIZED_VERT: + if (((struct _Ecore_Win32_Window *)window)->state.maximized_vert) + { + RECT rect; + int y; + int height; - if (!SystemParametersInfo(SPI_GETWORKAREA, 0, - &rect, 0)) - break; - y = rect.top; - height = rect.bottom - rect.top; + if (!SystemParametersInfo(SPI_GETWORKAREA, 0, + &rect, 0)) + { + EINA_ERROR_PERR("SystemParametersInfo() failed\n"); + break; + } + y = rect.top; + height = rect.bottom - rect.top; - if (!GetClientRect(((struct _Ecore_Win32_Window *)window)->window, - &rect)) - break; + if (!GetClientRect(((struct _Ecore_Win32_Window *)window)->window, + &rect)) + { + EINA_ERROR_PERR("GetClientRect() failed\n"); + break; + } - MoveWindow(window, rect.left, y, - rect.right - rect.left, - height, - TRUE); - } - break; - case ECORE_WIN32_WINDOW_STATE_MAXIMIZED_HORZ: - if (((struct _Ecore_Win32_Window *)window)->state.maximized_horz) - { - RECT rect; + if (!MoveWindow(window, rect.left, y, + rect.right - rect.left, + height, + TRUE)) + { + EINA_ERROR_PERR("MoveWindow() failed\n"); + } + } + break; + case ECORE_WIN32_WINDOW_STATE_MAXIMIZED_HORZ: + if (((struct _Ecore_Win32_Window *)window)->state.maximized_horz) + { + RECT rect; - if (!GetClientRect(((struct _Ecore_Win32_Window *)window)->window, - &rect)) - break; + if (!GetClientRect(((struct _Ecore_Win32_Window *)window)->window, + &rect)) + { + EINA_ERROR_PERR("GetClientRect() failed\n"); + break; + } - MoveWindow(window, 0, rect.top, - GetSystemMetrics(SM_CXSCREEN), - rect.bottom - rect.top, - TRUE); - } - break; - case ECORE_WIN32_WINDOW_STATE_MAXIMIZED: - if (((struct _Ecore_Win32_Window *)window)->state.maximized_vert && - ((struct _Ecore_Win32_Window *)window)->state.maximized_horz) - { - RECT rect; + if (!MoveWindow(window, 0, rect.top, + GetSystemMetrics(SM_CXSCREEN), + rect.bottom - rect.top, + TRUE)) + { + EINA_ERROR_PERR("MoveWindow() failed\n"); + } + } + break; + case ECORE_WIN32_WINDOW_STATE_MAXIMIZED: + if (((struct _Ecore_Win32_Window *)window)->state.maximized_vert && + ((struct _Ecore_Win32_Window *)window)->state.maximized_horz) + { + RECT rect; - if (!SystemParametersInfo(SPI_GETWORKAREA, 0, - &rect, 0)) - break; + if (!SystemParametersInfo(SPI_GETWORKAREA, 0, + &rect, 0)) + { + EINA_ERROR_PERR("SystemParametersInfo() failed\n"); + break; + } - MoveWindow(window, 0, 0, - GetSystemMetrics(SM_CXSCREEN), - rect.bottom - rect.top, - TRUE); - } - break; - case ECORE_WIN32_WINDOW_STATE_SHADED: - ((struct _Ecore_Win32_Window *)window)->state.shaded = 1; - break; - case ECORE_WIN32_WINDOW_STATE_HIDDEN: - ((struct _Ecore_Win32_Window *)window)->state.hidden = 1; - break; - case ECORE_WIN32_WINDOW_STATE_FULLSCREEN: - if (((struct _Ecore_Win32_Window *)window)->state.fullscreen) - ecore_win32_window_fullscreen_set(window, set); - break; - case ECORE_WIN32_WINDOW_STATE_ABOVE: - if (((struct _Ecore_Win32_Window *)window)->state.above) - SetWindowPos(((struct _Ecore_Win32_Window *)window)->window, - HWND_TOP, - 0, 0, - 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); - break; - case ECORE_WIN32_WINDOW_STATE_BELOW: - if (((struct _Ecore_Win32_Window *)window)->state.below) - SetWindowPos(((struct _Ecore_Win32_Window *)window)->window, - HWND_BOTTOM, - 0, 0, - 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); - break; - case ECORE_WIN32_WINDOW_STATE_DEMANDS_ATTENTION: - ((struct _Ecore_Win32_Window *)window)->state.demands_attention = 1; - break; - case ECORE_WIN32_WINDOW_STATE_UNKNOWN: - /* nothing to be done */ - break; + if (!MoveWindow(window, 0, 0, + GetSystemMetrics(SM_CXSCREEN), + rect.bottom - rect.top, + TRUE)) + { + EINA_ERROR_PERR("MoveWindow() failed\n"); + } + } + break; + case ECORE_WIN32_WINDOW_STATE_SHADED: + ((struct _Ecore_Win32_Window *)window)->state.shaded = 1; + break; + case ECORE_WIN32_WINDOW_STATE_HIDDEN: + ((struct _Ecore_Win32_Window *)window)->state.hidden = 1; + break; + case ECORE_WIN32_WINDOW_STATE_FULLSCREEN: + if (((struct _Ecore_Win32_Window *)window)->state.fullscreen) + ecore_win32_window_fullscreen_set(window, set); + break; + case ECORE_WIN32_WINDOW_STATE_ABOVE: + if (((struct _Ecore_Win32_Window *)window)->state.above) + if (!SetWindowPos(((struct _Ecore_Win32_Window *)window)->window, + HWND_TOP, + 0, 0, + 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW)) + { + EINA_ERROR_PERR("SetWindowPos() failed\n"); + } + break; + case ECORE_WIN32_WINDOW_STATE_BELOW: + if (((struct _Ecore_Win32_Window *)window)->state.below) + if (!SetWindowPos(((struct _Ecore_Win32_Window *)window)->window, + HWND_BOTTOM, + 0, 0, + 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW)) + { + EINA_ERROR_PERR("SetWindowPos() failed\n"); + } + break; + case ECORE_WIN32_WINDOW_STATE_DEMANDS_ATTENTION: + ((struct _Ecore_Win32_Window *)window)->state.demands_attention = 1; + break; + case ECORE_WIN32_WINDOW_STATE_UNKNOWN: + /* nothing to be done */ + break; } } @@ -864,6 +1067,11 @@ void ecore_win32_window_type_set(Ecore_Win32_Window *window, Ecore_Win32_Window_Type type) { + if (!window) + return; + + EINA_ERROR_PINFO("setting window type\n"); + switch (type) { case ECORE_WIN32_WINDOW_TYPE_DESKTOP: @@ -914,22 +1122,22 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent, w = (struct _Ecore_Win32_Window *)calloc(1, sizeof(struct _Ecore_Win32_Window)); if (!w) + { + EINA_ERROR_PERR("malloc() failed\n"); + return NULL; + } return NULL; - printf (" *** ecore_win32_window_new : %p %d %d %d\n", - w, - width, height, GetSystemMetrics(SM_CXMIN)); rect.left = 0; rect.top = 0; rect.right = width; rect.bottom = height; if (!AdjustWindowRect(&rect, style, FALSE)) { + EINA_ERROR_PERR("AdjustWindowRect() failed\n"); free(w); return NULL; } - printf (" * ecore : new debut : %ld %d %d\n", - rect.right - rect.left, GetSystemMetrics(SM_CXMIN), GetSystemMetrics(SM_CYMIN)); minimal_width = GetSystemMetrics(SM_CXMIN); minimal_height = GetSystemMetrics(SM_CYMIN); @@ -956,6 +1164,7 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent, NULL, _ecore_win32_instance, NULL); if (!w->window) { + EINA_ERROR_PERR("CreateWindowEx() failed\n"); free(w); return NULL; } @@ -963,6 +1172,7 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent, SetLastError(0); if (!SetWindowLong(w->window, GWL_USERDATA, (LONG)w) && (GetLastError() != 0)) { + EINA_ERROR_PERR("SetWindowLong() failed\n"); DestroyWindow(w->window); free(w); return NULL; @@ -1003,11 +1213,5 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent, w->iconified = 0; w->fullscreen = 0; - printf (" *** ecore_win32_window_new fin : (%d %d) (%d %d)\n", - w->min_width, - w->min_height, - w->max_width, - w->max_height); - return w; }