* simplify a bit and fix init/shutdown functions

* rename logging macros


SVN revision: 42992
This commit is contained in:
Vincent Torri 2009-10-10 03:45:06 +00:00
parent 43d3c84907
commit d6c7cc65d9
5 changed files with 153 additions and 151 deletions

View File

@ -82,31 +82,31 @@ ecore_win32_init()
{
WNDCLASS wc;
if (++_ecore_win32_init_count != 1)
return _ecore_win32_init_count;
if (!eina_init())
return --_ecore_win32_init_count;
eina_log_print_cb_set(_ecore_win32_error_print_cb, NULL);
/* in case of double initialization of the module */
if(_ecore_win32_log_dom < 0)
_ecore_win32_log_dom = eina_log_domain_register("ecore_win32", EINA_COLOR_LIGHTBLUE);
if (_ecore_win32_log_dom < 0)
_ecore_win32_log_dom_global = eina_log_domain_register("ecore_win32", EINA_COLOR_LIGHTBLUE);
if (_ecore_win32_log_dom_global < 0)
{
EINA_LOG_ERR("Could not register log domain: ecore_win32");
return 0;
EINA_LOG_ERR("Ecore_Win32: Could not register log domain");
goto shutdown_eina;
}
ECORE_WIN32_MSG_INFO("initializing ecore_win32 (current count: %d)", _ecore_win32_init_count);
if (_ecore_win32_init_count > 0)
if (!ecore_event_init())
{
_ecore_win32_init_count++;
return _ecore_win32_init_count;
ERR("Ecore_Win32: Could not init ecore_event");
goto unregister_log_domain;
}
_ecore_win32_instance = GetModuleHandle(NULL);
if (!_ecore_win32_instance)
{
ECORE_WIN32_MSG_ERR("GetModuleHandle() failed");
return 0;
ERR("GetModuleHandle() failed");
goto shutdown_ecore_event;
}
memset (&wc, 0, sizeof (WNDCLASS));
@ -123,16 +123,14 @@ ecore_win32_init()
if(!RegisterClass(&wc))
{
ECORE_WIN32_MSG_ERR("RegisterClass() failed");
FreeLibrary(_ecore_win32_instance);
return 0;
ERR("RegisterClass() failed");
goto free_library;
}
if (!ecore_win32_dnd_init())
{
ECORE_WIN32_MSG_ERR("ecore_win32_dnd_init() failed");
FreeLibrary(_ecore_win32_instance);
return 0;
ERR("ecore_win32_dnd_init() failed");
goto unregister_class;
}
if (!ECORE_WIN32_EVENT_MOUSE_IN)
@ -151,37 +149,41 @@ ecore_win32_init()
ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST = ecore_event_type_new();
}
ecore_event_init();
_ecore_win32_init_count++;
return _ecore_win32_init_count;
unregister_class:
UnregisterClass(ECORE_WIN32_WINDOW_CLASS, _ecore_win32_instance);
free_library:
FreeLibrary(_ecore_win32_instance);
shutdown_ecore_event:
ecore_event_shutdown();
unregister_log_domain:
eina_log_domain_unregister(_ecore_win32_log_dom_global);
shutdown_eina:
eina_shutdown();
return --_ecore_win32_init_count;
}
int
ecore_win32_shutdown()
{
ECORE_WIN32_MSG_INFO("shutting down ecore_win32 (current count: %d)", _ecore_win32_init_count);
_ecore_win32_init_count--;
if (_ecore_win32_init_count > 0) return _ecore_win32_init_count;
ecore_event_shutdown();
if (--_ecore_win32_init_count != 0)
return _ecore_win32_init_count;
ecore_win32_dnd_shutdown();
if (!UnregisterClass(ECORE_WIN32_WINDOW_CLASS, _ecore_win32_instance))
{
ECORE_WIN32_MSG_INFO("UnregisterClass() failed");
}
INF("UnregisterClass() failed");
if (!FreeLibrary(_ecore_win32_instance))
{
ECORE_WIN32_MSG_INFO("FreeLibrary() failed");
}
INF("FreeLibrary() failed");
_ecore_win32_instance = NULL;
eina_log_domain_unregister(_ecore_win32_log_dom);
if (_ecore_win32_init_count < 0) _ecore_win32_init_count = 0;
ecore_event_shutdown();
eina_log_domain_unregister(_ecore_win32_log_dom_global);
eina_shutdown();
return _ecore_win32_init_count;
}
@ -192,19 +194,19 @@ ecore_win32_screen_depth_get()
HDC dc;
int depth;
ECORE_WIN32_MSG_INFO("getting screen depth");
INF("getting screen depth");
dc = GetDC(NULL);
if (!dc)
{
ECORE_WIN32_MSG_ERR("GetDC() failed");
ERR("GetDC() failed");
return 0;
}
depth = GetDeviceCaps(dc, BITSPIXEL);
if (!ReleaseDC(NULL, dc))
{
ECORE_WIN32_MSG_ERR("ReleaseDC() failed (device context not released)");
ERR("ReleaseDC() failed (device context not released)");
}
return depth;
@ -323,7 +325,7 @@ _ecore_win32_window_procedure(HWND window,
{
POINT pt;
ECORE_WIN32_MSG_INFO("mouse in window");
INF("mouse in window");
pt.x = GET_X_LPARAM(data_param);
pt.y = GET_Y_LPARAM(data_param);
@ -346,7 +348,7 @@ _ecore_win32_window_procedure(HWND window,
}
else
{
ECORE_WIN32_MSG_ERR("GetClientRect() failed");
ERR("GetClientRect() failed");
}
_ecore_win32_event_handle_motion_notify(data);

View File

@ -30,7 +30,7 @@ ecore_win32_cursor_new(const void *pixels_and,
int cursor_width;
int cursor_height;
ECORE_WIN32_MSG_INFO("creating cursor");
INF("creating cursor");
cursor_width = GetSystemMetrics(SM_CXCURSOR);
cursor_height = GetSystemMetrics(SM_CYCURSOR);
@ -52,7 +52,7 @@ ecore_win32_cursor_new(const void *pixels_and,
void
ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor)
{
ECORE_WIN32_MSG_INFO("destroying cursor");
INF("destroying cursor");
DestroyCursor(cursor);
}
@ -63,7 +63,7 @@ ecore_win32_cursor_shape_get(Ecore_Win32_Cursor_Shape shape)
Ecore_Win32_Cursor *cursor = NULL;
const char *cursor_name;
ECORE_WIN32_MSG_INFO("geting shape cursor");
INF("geting shape cursor");
switch (shape)
{
@ -125,7 +125,7 @@ ecore_win32_cursor_size_get(void)
int width;
int height;
ECORE_WIN32_MSG_INFO("geting size cursor");
INF("geting size cursor");
width = GetSystemMetrics(SM_CXCURSOR);
height = GetSystemMetrics(SM_CYCURSOR);

View File

@ -58,7 +58,7 @@ _ecore_win32_event_handle_key_press(Ecore_Win32_Callback_Data *msg,
{
Ecore_Event_Key *e;
ECORE_WIN32_MSG_INFO("key pressed");
INF("key pressed");
e = (Ecore_Event_Key *)malloc(sizeof(Ecore_Event_Key));
if (!e) return;
@ -108,7 +108,7 @@ _ecore_win32_event_handle_key_release(Ecore_Win32_Callback_Data *msg,
{
Ecore_Event_Key *e;
ECORE_WIN32_MSG_INFO("key released");
INF("key released");
e = (Ecore_Event_Key *)calloc(1, sizeof(Ecore_Event_Key));
if (!e) return;
@ -158,7 +158,7 @@ _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg,
{
Ecore_Win32_Window *window;
ECORE_WIN32_MSG_INFO("mouse button pressed");
INF("mouse button pressed");
window = (Ecore_Win32_Window *)GetWindowLong(msg->window, GWL_USERDATA);
@ -260,7 +260,7 @@ _ecore_win32_event_handle_button_release(Ecore_Win32_Callback_Data *msg,
{
Ecore_Win32_Window *window;
ECORE_WIN32_MSG_INFO("mouse button released");
INF("mouse button released");
window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
@ -318,7 +318,7 @@ _ecore_win32_event_handle_motion_notify(Ecore_Win32_Callback_Data *msg)
{
Ecore_Event_Mouse_Move *e;
ECORE_WIN32_MSG_INFO("mouse moved");
INF("mouse moved");
e = (Ecore_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Event_Mouse_Move));
if (!e) return;
@ -337,7 +337,7 @@ _ecore_win32_event_handle_enter_notify(Ecore_Win32_Callback_Data *msg)
{
Ecore_Event_Mouse_Move *e;
ECORE_WIN32_MSG_INFO("mouse in");
INF("mouse in");
e = (Ecore_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Event_Mouse_Move));
if (!e) return;
@ -376,7 +376,7 @@ _ecore_win32_event_handle_leave_notify(Ecore_Win32_Callback_Data *msg)
{
Ecore_Event_Mouse_Move *e;
ECORE_WIN32_MSG_INFO("mouse out");
INF("mouse out");
e = (Ecore_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Event_Mouse_Move));
if (!e) return;
@ -414,7 +414,7 @@ _ecore_win32_event_handle_focus_in(Ecore_Win32_Callback_Data *msg)
{
Ecore_Win32_Event_Window_Focus_In *e;
ECORE_WIN32_MSG_INFO("focus in");
INF("focus in");
e = (Ecore_Win32_Event_Window_Focus_In *)calloc(1, sizeof(Ecore_Win32_Event_Window_Focus_In));
if (!e) return;
@ -432,7 +432,7 @@ _ecore_win32_event_handle_focus_out(Ecore_Win32_Callback_Data *msg)
{
Ecore_Win32_Event_Window_Focus_Out *e;
ECORE_WIN32_MSG_INFO("focus out");
INF("focus out");
e = (Ecore_Win32_Event_Window_Focus_Out *)calloc(1, sizeof(Ecore_Win32_Event_Window_Focus_Out));
if (!e) return;
@ -450,7 +450,7 @@ _ecore_win32_event_handle_expose(Ecore_Win32_Callback_Data *msg)
{
Ecore_Win32_Event_Window_Damage *e;
ECORE_WIN32_MSG_INFO("window expose");
INF("window expose");
e = (Ecore_Win32_Event_Window_Damage *)calloc(1, sizeof(Ecore_Win32_Event_Window_Damage));
if (!e) return;
@ -472,7 +472,7 @@ _ecore_win32_event_handle_create_notify(Ecore_Win32_Callback_Data *msg)
{
Ecore_Win32_Event_Window_Create *e;
ECORE_WIN32_MSG_INFO("window create notify");
INF("window create notify");
e = calloc(1, sizeof(Ecore_Win32_Event_Window_Create));
if (!e) return;
@ -489,7 +489,7 @@ _ecore_win32_event_handle_destroy_notify(Ecore_Win32_Callback_Data *msg)
{
Ecore_Win32_Event_Window_Destroy *e;
ECORE_WIN32_MSG_INFO("window destroy notify");
INF("window destroy notify");
e = calloc(1, sizeof(Ecore_Win32_Event_Window_Destroy));
if (!e) return;
@ -507,7 +507,7 @@ _ecore_win32_event_handle_map_notify(Ecore_Win32_Callback_Data *msg)
{
Ecore_Win32_Event_Window_Show *e;
ECORE_WIN32_MSG_INFO("window map notify");
INF("window map notify");
e = calloc(1, sizeof(Ecore_Win32_Event_Window_Show));
if (!e) return;
@ -524,7 +524,7 @@ _ecore_win32_event_handle_unmap_notify(Ecore_Win32_Callback_Data *msg)
{
Ecore_Win32_Event_Window_Hide *e;
ECORE_WIN32_MSG_INFO("window unmap notify");
INF("window unmap notify");
e = calloc(1, sizeof(Ecore_Win32_Event_Window_Hide));
if (!e) return;
@ -539,17 +539,17 @@ _ecore_win32_event_handle_unmap_notify(Ecore_Win32_Callback_Data *msg)
void
_ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg)
{
WINDOWINFO wi;
WINDOWINF wi;
Ecore_Win32_Event_Window_Configure *e;
WINDOWPOS *window_pos;
ECORE_WIN32_MSG_INFO("window configure notify");
INF("window configure notify");
e = calloc(1, sizeof(Ecore_Win32_Event_Window_Configure));
if (!e) return;
window_pos = (WINDOWPOS *)msg->data_param;
wi.cbSize = sizeof(WINDOWINFO);
wi.cbSize = sizeof(WINDOWINF);
if (!GetWindowInfo(window_pos->hwnd, &wi))
{
free(e);
@ -573,7 +573,7 @@ _ecore_win32_event_handle_resize(Ecore_Win32_Callback_Data *msg)
RECT rect;
Ecore_Win32_Event_Window_Resize *e;
ECORE_WIN32_MSG_INFO("window resize");
INF("window resize");
if (!GetClientRect(msg->window, &rect))
return;
@ -594,7 +594,7 @@ _ecore_win32_event_handle_delete_request(Ecore_Win32_Callback_Data *msg)
{
Ecore_Win32_Event_Window_Delete_Request *e;
ECORE_WIN32_MSG_INFO("window delete request");
INF("window delete request");
e = calloc(1, sizeof(Ecore_Win32_Event_Window_Delete_Request));
if (!e) return;

View File

@ -12,11 +12,11 @@ extern "C" {
/* logging messages macros */
extern int _ecore_win32_log_dom;
extern int _ecore_win32_log_dom_global;
#define ECORE_WIN32_MSG_ERR(...) EINA_LOG_DOM_ERR(_ecore_win32_log_dom , __VA_ARGS__)
#define ECORE_WIN32_MSG_DBG(...) EINA_LOG_DOM_DBG(_ecore_win32_log_dom , __VA_ARGS__)
#define ECORE_WIN32_MSG_INFO(...) EINA_LOG_DOM_INFO(_ecore_win32_log_dom , __VA_ARGS__)
#define ERR(...) EINA_LOG_DOM_ERR(_ecore_win32_log_dom_global , __VA_ARGS__)
#define DBG(...) EINA_LOG_DOM_DBG(_ecore_win32_log_dom_global , __VA_ARGS__)
#define INF(...) EINA_LOG_DOM_INFO(_ecore_win32_log_dom_global , __VA_ARGS__)
#define ECORE_WIN32_WINDOW_CLASS "Ecore_Win32_Window_Class"

View File

@ -50,7 +50,7 @@ ecore_win32_window_new(Ecore_Win32_Window *parent,
int width,
int height)
{
ECORE_WIN32_MSG_INFO("creating window with border");
INF("creating window with border");
return ecore_win32_window_internal_new(parent,
x, y,
@ -66,7 +66,7 @@ ecore_win32_window_override_new(Ecore_Win32_Window *parent,
int width,
int height)
{
ECORE_WIN32_MSG_INFO("creating window without border");
INF("creating window without border");
return ecore_win32_window_internal_new(parent,
x, y,
@ -81,7 +81,7 @@ ecore_win32_window_free(Ecore_Win32_Window *window)
if (!window) return;
ECORE_WIN32_MSG_INFO("destroying window");
INF("destroying window");
if (wnd->shape.mask != NULL)
free(wnd->shape.mask);
@ -140,12 +140,12 @@ ecore_win32_window_move(Ecore_Win32_Window *window,
if (!window) return;
ECORE_WIN32_MSG_INFO("moving window (%dx%d)", x, y);
INF("moving window (%dx%d)", x, y);
w = ((struct _Ecore_Win32_Window *)window)->window;
if (!GetWindowRect(w, &rect))
{
ECORE_WIN32_MSG_ERR("GetWindowRect() failed");
ERR("GetWindowRect() failed");
return;
}
@ -154,7 +154,7 @@ ecore_win32_window_move(Ecore_Win32_Window *window,
rect.bottom - rect.top,
TRUE))
{
ECORE_WIN32_MSG_ERR("MoveWindow() failed");
ERR("MoveWindow() failed");
}
}
@ -171,12 +171,12 @@ ecore_win32_window_resize(Ecore_Win32_Window *window,
if (!window) return;
ECORE_WIN32_MSG_INFO("resizing window (%dx%d)", width, height);
INF("resizing window (%dx%d)", width, height);
w = (struct _Ecore_Win32_Window *)window;
if (!GetWindowRect(w->window, &rect))
{
ECORE_WIN32_MSG_ERR("GetWindowRect() failed");
ERR("GetWindowRect() failed");
return;
}
@ -195,12 +195,12 @@ ecore_win32_window_resize(Ecore_Win32_Window *window,
rect.bottom = height;
if (!(style = GetWindowLong(w->window, GWL_STYLE)))
{
ECORE_WIN32_MSG_ERR("GetWindowLong() failed");
ERR("GetWindowLong() failed");
return;
}
if (!AdjustWindowRect(&rect, style, FALSE))
{
ECORE_WIN32_MSG_ERR("AdjustWindowRect() failed");
ERR("AdjustWindowRect() failed");
return;
}
@ -209,7 +209,7 @@ ecore_win32_window_resize(Ecore_Win32_Window *window,
rect.bottom - rect.top,
TRUE))
{
ECORE_WIN32_MSG_ERR("MoveWindow() failed");
ERR("MoveWindow() failed");
}
}
@ -226,7 +226,7 @@ ecore_win32_window_move_resize(Ecore_Win32_Window *window,
if (!window) return;
ECORE_WIN32_MSG_INFO("moving and resizing window (%dx%d %dx%d)", x, y, width, height);
INF("moving and resizing window (%dx%d %dx%d)", x, y, width, height);
w = ((struct _Ecore_Win32_Window *)window);
rect.left = 0;
@ -239,12 +239,12 @@ ecore_win32_window_move_resize(Ecore_Win32_Window *window,
rect.bottom = height;
if (!(style = GetWindowLong(w->window, GWL_STYLE)))
{
ECORE_WIN32_MSG_ERR("GetWindowLong() failed");
ERR("GetWindowLong() failed");
return;
}
if (!AdjustWindowRect(&rect, style, FALSE))
{
ECORE_WIN32_MSG_ERR("AdjustWindowRect() failed");
ERR("AdjustWindowRect() failed");
return;
}
@ -253,7 +253,7 @@ ecore_win32_window_move_resize(Ecore_Win32_Window *window,
rect.bottom - rect.top,
TRUE))
{
ECORE_WIN32_MSG_ERR("MoveWindow() failed");
ERR("MoveWindow() failed");
}
}
@ -268,7 +268,7 @@ ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
int w;
int h;
ECORE_WIN32_MSG_INFO("getting window geometry");
INF("getting window geometry");
if (!window)
{
@ -283,7 +283,7 @@ ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
if (!GetClientRect(((struct _Ecore_Win32_Window *)window)->window,
&rect))
{
ECORE_WIN32_MSG_ERR("GetClientRect() failed");
ERR("GetClientRect() failed");
if (x) *x = 0;
if (y) *y = 0;
@ -299,7 +299,7 @@ ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
if (!GetWindowRect(((struct _Ecore_Win32_Window *)window)->window,
&rect))
{
ECORE_WIN32_MSG_ERR("GetWindowRect() failed");
ERR("GetWindowRect() failed");
if (x) *x = 0;
if (y) *y = 0;
@ -322,7 +322,7 @@ ecore_win32_window_size_get(Ecore_Win32_Window *window,
{
RECT rect;
ECORE_WIN32_MSG_INFO("getting window size");
INF("getting window size");
if (!window)
{
@ -335,7 +335,7 @@ ecore_win32_window_size_get(Ecore_Win32_Window *window,
if (!GetClientRect(((struct _Ecore_Win32_Window *)window)->window,
&rect))
{
ECORE_WIN32_MSG_ERR("GetClientRect() failed");
ERR("GetClientRect() failed");
if (width) *width = 0;
if (height) *height = 0;
@ -475,7 +475,7 @@ ecore_win32_window_shape_set(Ecore_Win32_Window *window,
HRGN rgn;
int x;
int y;
OSVERSIONINFO version_info;
OSVERSIONINF version_info;
if (window == NULL)
return;
@ -494,13 +494,13 @@ ecore_win32_window_shape_set(Ecore_Win32_Window *window,
GetWindowLong(wnd->window, GWL_EXSTYLE) & (~WS_EX_LAYERED)) &&
(GetLastError() != 0))
{
ECORE_WIN32_MSG_ERR("SetWindowLongPtr() failed");
ERR("SetWindowLongPtr() failed");
return;
}
if (!RedrawWindow(wnd->window, NULL, NULL,
RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN))
{
ECORE_WIN32_MSG_ERR("RedrawWindow() failed");
ERR("RedrawWindow() failed");
return;
}
#endif
@ -508,7 +508,7 @@ ecore_win32_window_shape_set(Ecore_Win32_Window *window,
else
if (!SetWindowRgn(wnd->window, NULL, TRUE))
{
ECORE_WIN32_MSG_ERR("SetWindowRgn() failed");
ERR("SetWindowRgn() failed");
}
return;
}
@ -542,7 +542,7 @@ ecore_win32_window_shape_set(Ecore_Win32_Window *window,
GetWindowLong(wnd->window, GWL_EXSTYLE) | WS_EX_LAYERED) &&
(GetLastError() != 0))
{
ECORE_WIN32_MSG_ERR("SetWindowLongPtr() failed");
ERR("SetWindowLongPtr() failed");
return;
}
wnd->shape.layered = 1;
@ -552,7 +552,7 @@ ecore_win32_window_shape_set(Ecore_Win32_Window *window,
if (!(rgn = CreateRectRgn(0, 0, 0, 0)))
{
ECORE_WIN32_MSG_ERR("CreateRectRgn() failed");
ERR("CreateRectRgn() failed");
return;
}
for (y = 0; y < height; y++)
@ -561,7 +561,7 @@ ecore_win32_window_shape_set(Ecore_Win32_Window *window,
if (!(rgnLine = CreateRectRgn(0, 0, 0, 0)))
{
ECORE_WIN32_MSG_ERR("CreateRectRgn() failed");
ERR("CreateRectRgn() failed");
return;
}
for (x = 0; x < width; x++)
@ -572,33 +572,33 @@ ecore_win32_window_shape_set(Ecore_Win32_Window *window,
if (!(rgnDot = CreateRectRgn(x, y, x + 1, y + 1)))
{
ECORE_WIN32_MSG_ERR("CreateRectRgn() failed");
ERR("CreateRectRgn() failed");
return;
}
if (CombineRgn(rgnLine, rgnLine, rgnDot, RGN_OR) == ERROR)
{
ECORE_WIN32_MSG_ERR("CombineRgn() has not created a new region");
ERR("CombineRgn() has not created a new region");
}
if (!DeleteObject(rgnDot))
{
ECORE_WIN32_MSG_ERR("DeleteObject() failed");
ERR("DeleteObject() failed");
return;
}
}
}
if (CombineRgn(rgn, rgn, rgnLine, RGN_OR) == ERROR)
{
ECORE_WIN32_MSG_ERR("CombineRgn() has not created a new region");
ERR("CombineRgn() has not created a new region");
}
if (!DeleteObject(rgnLine))
{
ECORE_WIN32_MSG_ERR("DeleteObject() failed");
ERR("DeleteObject() failed");
return;
}
}
if (!SetWindowRgn(wnd->window, rgn, TRUE))
{
ECORE_WIN32_MSG_ERR("SetWindowRgn() failed");
ERR("SetWindowRgn() failed");
}
}
@ -607,12 +607,12 @@ ecore_win32_window_show(Ecore_Win32_Window *window)
{
if (!window) return;
ECORE_WIN32_MSG_INFO("showing window");
INF("showing window");
ShowWindow(((struct _Ecore_Win32_Window *)window)->window, SW_SHOWNORMAL);
if (!UpdateWindow(((struct _Ecore_Win32_Window *)window)->window))
{
ECORE_WIN32_MSG_ERR("UpdateWindow() failed");
ERR("UpdateWindow() failed");
}
}
@ -622,7 +622,7 @@ ecore_win32_window_hide(Ecore_Win32_Window *window)
{
if (!window) return;
ECORE_WIN32_MSG_INFO("hiding window");
INF("hiding window");
ShowWindow(((struct _Ecore_Win32_Window *)window)->window, SW_HIDE);
}
@ -632,13 +632,13 @@ ecore_win32_window_raise(Ecore_Win32_Window *window)
{
if (!window) return;
ECORE_WIN32_MSG_INFO("raising window");
INF("raising window");
if (!SetWindowPos(((struct _Ecore_Win32_Window *)window)->window,
HWND_TOP, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE))
{
ECORE_WIN32_MSG_ERR("SetWindowPos() failed");
ERR("SetWindowPos() failed");
}
}
@ -647,13 +647,13 @@ ecore_win32_window_lower(Ecore_Win32_Window *window)
{
if (!window) return;
ECORE_WIN32_MSG_INFO("lowering window");
INF("lowering window");
if (!SetWindowPos(((struct _Ecore_Win32_Window *)window)->window,
HWND_BOTTOM, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE))
{
ECORE_WIN32_MSG_ERR("SetWindowPos() failed");
ERR("SetWindowPos() failed");
}
}
@ -665,11 +665,11 @@ ecore_win32_window_title_set(Ecore_Win32_Window *window,
if (!title || !title[0]) return;
ECORE_WIN32_MSG_INFO("setting window title");
INF("setting window title");
if (!SetWindowText(((struct _Ecore_Win32_Window *)window)->window, title))
{
ECORE_WIN32_MSG_ERR("SetWindowText() failed");
ERR("SetWindowText() failed");
}
}
@ -678,11 +678,11 @@ ecore_win32_window_focus_set(Ecore_Win32_Window *window)
{
if (!window) return;
ECORE_WIN32_MSG_INFO("focusing window");
INF("focusing window");
if (!SetFocus(((struct _Ecore_Win32_Window *)window)->window))
{
ECORE_WIN32_MSG_ERR("SetFocus() failed");
ERR("SetFocus() failed");
}
}
@ -699,7 +699,7 @@ ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
((!ew->iconified) && (!on)))
return;
ECORE_WIN32_MSG_INFO("iconifying window: %s", on ? "yes" : "no");
INF("iconifying window: %s", on ? "yes" : "no");
ShowWindow(ew->window, on ? SW_MINIMIZE : SW_RESTORE);
ew->iconified = on;
@ -721,7 +721,7 @@ ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
((!ew->borderless) && (!on)))
return;
ECORE_WIN32_MSG_INFO("setting window without border: %s", on ? "yes" : "no");
INF("setting window without border: %s", on ? "yes" : "no");
w = ew->window;
@ -730,13 +730,13 @@ ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
{
if (!GetClientRect(w, &rect))
{
ECORE_WIN32_MSG_ERR("GetClientRect() failed");
ERR("GetClientRect() failed");
return;
}
SetLastError(0);
if (!SetWindowLongPtr(w, GWL_STYLE, style & ~(WS_CAPTION | WS_THICKFRAME)) && (GetLastError() != 0))
{
ECORE_WIN32_MSG_ERR("SetWindowLongPtr() failed");
ERR("SetWindowLongPtr() failed");
return;
}
}
@ -744,19 +744,19 @@ ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
{
if (!GetWindowRect(w, &rect))
{
ECORE_WIN32_MSG_ERR("GetWindowRect() failed");
ERR("GetWindowRect() failed");
return;
}
style |= WS_CAPTION | WS_THICKFRAME;
if (!AdjustWindowRect (&rect, style, FALSE))
{
ECORE_WIN32_MSG_ERR("AdjustWindowRect() failed");
ERR("AdjustWindowRect() failed");
return;
}
SetLastError(0);
if (!SetWindowLongPtr(w, GWL_STYLE, style) && (GetLastError() != 0))
{
ECORE_WIN32_MSG_ERR("SetWindowLongPtr() failed");
ERR("SetWindowLongPtr() failed");
return;
}
}
@ -765,7 +765,7 @@ ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
rect.right - rect.left, rect.bottom - rect.top,
SWP_NOMOVE | SWP_FRAMECHANGED))
{
ECORE_WIN32_MSG_ERR("SetWindowPos() failed");
ERR("SetWindowPos() failed");
return;
}
ew->borderless = on;
@ -785,7 +785,7 @@ ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
((!ew->fullscreen) && (!on)))
return;
ECORE_WIN32_MSG_INFO("setting fullscreen: %s", on ? "yes" : "no");
INF("setting fullscreen: %s", on ? "yes" : "no");
ew->fullscreen = !!on;
w = ew->window;
@ -796,12 +796,12 @@ ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
if (!GetWindowRect(w, &ew->rect))
{
ECORE_WIN32_MSG_ERR("GetWindowRect() failed");
ERR("GetWindowRect() failed");
return;
}
if (!(ew->style = GetWindowLong(w, GWL_STYLE)))
{
ECORE_WIN32_MSG_ERR("GetWindowLong() failed");
ERR("GetWindowLong() failed");
return;
}
style = ew->style & ~WS_OVERLAPPEDWINDOW & ~WS_SIZEBOX;
@ -809,20 +809,20 @@ ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
SetLastError(0);
if (!SetWindowLongPtr(w, GWL_STYLE, style) && (GetLastError() != 0))
{
ECORE_WIN32_MSG_ERR("SetWindowLongPtr() failed");
ERR("SetWindowLongPtr() failed");
return;
}
SetLastError(0);
if (!SetWindowLongPtr(w, GWL_EXSTYLE, WS_EX_TOPMOST) && (GetLastError() != 0))
{
ECORE_WIN32_MSG_ERR("SetWindowLongPtr() failed");
ERR("SetWindowLongPtr() failed");
return;
}
if (!SetWindowPos(w, HWND_TOPMOST, 0, 0,
GetSystemMetrics (SM_CXSCREEN), GetSystemMetrics (SM_CYSCREEN),
SWP_NOCOPYBITS | SWP_SHOWWINDOW))
{
ECORE_WIN32_MSG_ERR("SetWindowPos() failed");
ERR("SetWindowPos() failed");
return;
}
}
@ -831,13 +831,13 @@ ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
SetLastError(0);
if (!SetWindowLongPtr(w, GWL_STYLE, ew->style) && (GetLastError() != 0))
{
ECORE_WIN32_MSG_ERR("SetWindowLongPtr() failed");
ERR("SetWindowLongPtr() failed");
return;
}
SetLastError(0);
if (!SetWindowLongPtr(w, GWL_EXSTYLE, 0) && (GetLastError() != 0))
{
ECORE_WIN32_MSG_ERR("SetWindowLongPtr() failed");
ERR("SetWindowLongPtr() failed");
return;
}
if (!SetWindowPos(w, HWND_NOTOPMOST,
@ -847,7 +847,7 @@ ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
ew->rect.bottom - ew->rect.top,
SWP_NOCOPYBITS | SWP_SHOWWINDOW))
{
ECORE_WIN32_MSG_ERR("SetWindowPos() failed");
ERR("SetWindowPos() failed");
return;
}
}
@ -857,12 +857,12 @@ void
ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
Ecore_Win32_Cursor *cursor)
{
ECORE_WIN32_MSG_INFO("setting cursor");
INF("setting cursor");
if (!SetClassLong(((struct _Ecore_Win32_Window *)window)->window,
GCL_HCURSOR, (LONG)cursor))
{
ECORE_WIN32_MSG_ERR("SetClassLong() failed");
ERR("SetClassLong() failed");
}
}
@ -876,7 +876,7 @@ ecore_win32_window_state_set(Ecore_Win32_Window *window,
if (!window || !state || !num)
return;
ECORE_WIN32_MSG_INFO("setting cursor state");
INF("setting cursor state");
for (i = 0; i < num; i++)
{
@ -939,7 +939,7 @@ ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
ew = (struct _Ecore_Win32_Window *)window;
w = ew->window;
ECORE_WIN32_MSG_INFO("sending cursor state");
INF("sending cursor state");
switch (state)
{
@ -963,7 +963,7 @@ ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
if (!SystemParametersInfo(SPI_GETWORKAREA, 0,
&rect, 0))
{
ECORE_WIN32_MSG_ERR("SystemParametersInfo() failed");
ERR("SystemParametersInfo() failed");
break;
}
y = rect.top;
@ -971,7 +971,7 @@ ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
if (!GetClientRect(w, &rect))
{
ECORE_WIN32_MSG_ERR("GetClientRect() failed");
ERR("GetClientRect() failed");
break;
}
@ -980,7 +980,7 @@ ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
height,
TRUE))
{
ECORE_WIN32_MSG_ERR("MoveWindow() failed");
ERR("MoveWindow() failed");
}
}
break;
@ -991,7 +991,7 @@ ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
if (!GetClientRect(w, &rect))
{
ECORE_WIN32_MSG_ERR("GetClientRect() failed");
ERR("GetClientRect() failed");
break;
}
@ -1000,7 +1000,7 @@ ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
rect.bottom - rect.top,
TRUE))
{
ECORE_WIN32_MSG_ERR("MoveWindow() failed");
ERR("MoveWindow() failed");
}
}
break;
@ -1012,7 +1012,7 @@ ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
if (!SystemParametersInfo(SPI_GETWORKAREA, 0,
&rect, 0))
{
ECORE_WIN32_MSG_ERR("SystemParametersInfo() failed");
ERR("SystemParametersInfo() failed");
break;
}
@ -1021,7 +1021,7 @@ ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
rect.bottom - rect.top,
TRUE))
{
ECORE_WIN32_MSG_ERR("MoveWindow() failed");
ERR("MoveWindow() failed");
}
}
break;
@ -1042,7 +1042,7 @@ ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW))
{
ECORE_WIN32_MSG_ERR("SetWindowPos() failed");
ERR("SetWindowPos() failed");
}
break;
case ECORE_WIN32_WINDOW_STATE_BELOW:
@ -1052,7 +1052,7 @@ ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW))
{
ECORE_WIN32_MSG_ERR("SetWindowPos() failed");
ERR("SetWindowPos() failed");
}
break;
case ECORE_WIN32_WINDOW_STATE_DEMANDS_ATTENTION:
@ -1071,7 +1071,7 @@ ecore_win32_window_type_set(Ecore_Win32_Window *window,
if (!window)
return;
ECORE_WIN32_MSG_INFO("setting window type");
INF("setting window type");
switch (type)
{
@ -1124,7 +1124,7 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
w = (struct _Ecore_Win32_Window *)calloc(1, sizeof(struct _Ecore_Win32_Window));
if (!w)
{
ECORE_WIN32_MSG_ERR("malloc() failed");
ERR("malloc() failed");
return NULL;
}
@ -1134,7 +1134,7 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
rect.bottom = height;
if (!AdjustWindowRect(&rect, style, FALSE))
{
ECORE_WIN32_MSG_ERR("AdjustWindowRect() failed");
ERR("AdjustWindowRect() failed");
free(w);
return NULL;
}
@ -1164,7 +1164,7 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
NULL, _ecore_win32_instance, NULL);
if (!w->window)
{
ECORE_WIN32_MSG_ERR("CreateWindowEx() failed");
ERR("CreateWindowEx() failed");
free(w);
return NULL;
}
@ -1172,7 +1172,7 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
SetLastError(0);
if (!SetWindowLongPtr(w->window, GWL_USERDATA, (LONG)w) && (GetLastError() != 0))
{
ECORE_WIN32_MSG_ERR("SetWindowLongPtr() failed");
ERR("SetWindowLongPtr() failed");
DestroyWindow(w->window);
free(w);
return NULL;