2007-08-26 04:17:21 -07:00
|
|
|
/*
|
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
|
|
|
*/
|
|
|
|
|
2008-06-25 22:11:16 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h> /* for printf */
|
|
|
|
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
|
#include <windows.h>
|
|
|
|
#undef WIN32_LEAN_AND_MEAN
|
2007-08-26 04:17:21 -07:00
|
|
|
#include <windowsx.h>
|
|
|
|
|
2009-02-21 14:50:45 -08:00
|
|
|
#include <Eina.h>
|
2009-04-14 13:04:16 -07:00
|
|
|
#include <Ecore.h>
|
|
|
|
#include <Ecore_Input.h>
|
2009-02-21 14:50:45 -08:00
|
|
|
|
2008-06-25 22:11:16 -07:00
|
|
|
#include "Ecore_Win32.h"
|
2007-08-26 04:17:21 -07:00
|
|
|
#include "ecore_win32_private.h"
|
|
|
|
|
|
|
|
|
2008-11-27 11:30:39 -08:00
|
|
|
/* OLE IID for Drag'n Drop */
|
|
|
|
|
|
|
|
# define INITGUID
|
|
|
|
# include <basetyps.h>
|
|
|
|
DEFINE_OLEGUID(IID_IEnumFORMATETC, 0x00000103L, 0, 0);
|
|
|
|
DEFINE_OLEGUID(IID_IDataObject, 0x0000010EL, 0, 0);
|
|
|
|
DEFINE_OLEGUID(IID_IDropSource, 0x00000121L, 0, 0);
|
|
|
|
DEFINE_OLEGUID(IID_IDropTarget, 0x00000122L, 0, 0);
|
|
|
|
DEFINE_OLEGUID(IID_IUnknown, 0x00000000L, 0, 0);
|
|
|
|
|
|
|
|
|
2008-06-25 22:11:16 -07:00
|
|
|
/***** Global declarations *****/
|
|
|
|
|
2007-08-26 04:17:21 -07:00
|
|
|
HINSTANCE _ecore_win32_instance = NULL;
|
|
|
|
double _ecore_win32_double_click_time = 0.25;
|
2009-09-28 10:36:43 -07:00
|
|
|
long _ecore_win32_event_last_time = 0;
|
2007-08-26 04:17:21 -07:00
|
|
|
Ecore_Win32_Window *_ecore_win32_event_last_window = NULL;
|
2009-10-17 21:24:02 -07:00
|
|
|
int _ecore_win32_log_dom_global = -1;
|
2007-08-26 04:17:21 -07:00
|
|
|
|
2008-06-25 22:11:16 -07:00
|
|
|
int ECORE_WIN32_EVENT_MOUSE_IN = 0;
|
|
|
|
int ECORE_WIN32_EVENT_MOUSE_OUT = 0;
|
|
|
|
int ECORE_WIN32_EVENT_WINDOW_FOCUS_IN = 0;
|
|
|
|
int ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT = 0;
|
|
|
|
int ECORE_WIN32_EVENT_WINDOW_DAMAGE = 0;
|
|
|
|
int ECORE_WIN32_EVENT_WINDOW_CREATE = 0;
|
|
|
|
int ECORE_WIN32_EVENT_WINDOW_DESTROY = 0;
|
|
|
|
int ECORE_WIN32_EVENT_WINDOW_SHOW = 0;
|
|
|
|
int ECORE_WIN32_EVENT_WINDOW_HIDE = 0;
|
|
|
|
int ECORE_WIN32_EVENT_WINDOW_CONFIGURE = 0;
|
|
|
|
int ECORE_WIN32_EVENT_WINDOW_RESIZE = 0;
|
|
|
|
int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST = 0;
|
|
|
|
|
|
|
|
|
|
|
|
/***** Private declarations *****/
|
|
|
|
|
|
|
|
static int _ecore_win32_init_count = 0;
|
|
|
|
|
|
|
|
LRESULT CALLBACK _ecore_win32_window_procedure(HWND window,
|
|
|
|
UINT message,
|
|
|
|
WPARAM window_param,
|
|
|
|
LPARAM data_param);
|
|
|
|
|
2009-09-05 01:39:34 -07:00
|
|
|
static void _ecore_win32_error_print_cb(const Eina_Log_Domain *d,
|
|
|
|
Eina_Log_Level level,
|
2009-02-21 14:50:45 -08:00
|
|
|
const char *file,
|
|
|
|
const char *fnc,
|
|
|
|
int line,
|
|
|
|
const char *fmt,
|
|
|
|
void *data,
|
|
|
|
va_list args);
|
|
|
|
|
2008-06-25 22:11:16 -07:00
|
|
|
|
|
|
|
/***** API *****/
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
ecore_win32_init()
|
|
|
|
{
|
|
|
|
WNDCLASS wc;
|
|
|
|
|
2009-10-09 20:45:06 -07:00
|
|
|
if (++_ecore_win32_init_count != 1)
|
|
|
|
return _ecore_win32_init_count;
|
2009-02-21 14:50:45 -08:00
|
|
|
|
2009-10-09 20:45:06 -07:00
|
|
|
if (!eina_init())
|
|
|
|
return --_ecore_win32_init_count;
|
2009-09-05 01:39:34 -07:00
|
|
|
|
2009-10-09 20:45:06 -07:00
|
|
|
eina_log_print_cb_set(_ecore_win32_error_print_cb, NULL);
|
2010-01-06 16:30:05 -08:00
|
|
|
_ecore_win32_log_dom_global = eina_log_domain_register("ecore_win32", ECORE_WIN32_DEFAULT_LOG_COLOR);
|
2009-10-09 20:45:06 -07:00
|
|
|
if (_ecore_win32_log_dom_global < 0)
|
2009-09-05 01:39:34 -07:00
|
|
|
{
|
2009-10-09 20:45:06 -07:00
|
|
|
EINA_LOG_ERR("Ecore_Win32: Could not register log domain");
|
|
|
|
goto shutdown_eina;
|
2009-09-05 01:39:34 -07:00
|
|
|
}
|
|
|
|
|
2009-10-09 20:45:06 -07:00
|
|
|
if (!ecore_event_init())
|
2008-06-25 22:11:16 -07:00
|
|
|
{
|
2009-10-09 20:45:06 -07:00
|
|
|
ERR("Ecore_Win32: Could not init ecore_event");
|
|
|
|
goto unregister_log_domain;
|
2008-06-25 22:11:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
_ecore_win32_instance = GetModuleHandle(NULL);
|
|
|
|
if (!_ecore_win32_instance)
|
2009-02-21 14:50:45 -08:00
|
|
|
{
|
2009-10-09 20:45:06 -07:00
|
|
|
ERR("GetModuleHandle() failed");
|
|
|
|
goto shutdown_ecore_event;
|
2009-02-21 14:50:45 -08:00
|
|
|
}
|
2008-06-25 22:11:16 -07:00
|
|
|
|
|
|
|
memset (&wc, 0, sizeof (WNDCLASS));
|
|
|
|
wc.style = CS_HREDRAW | CS_VREDRAW;
|
|
|
|
wc.lpfnWndProc = _ecore_win32_window_procedure;
|
|
|
|
wc.cbClsExtra = 0;
|
|
|
|
wc.cbWndExtra = 0;
|
|
|
|
wc.hInstance = _ecore_win32_instance;
|
|
|
|
wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
|
|
|
|
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
|
|
|
|
wc.hbrBackground = (HBRUSH)(1 + COLOR_BTNFACE);
|
|
|
|
wc.lpszMenuName = NULL;
|
|
|
|
wc.lpszClassName = ECORE_WIN32_WINDOW_CLASS;
|
|
|
|
|
|
|
|
if(!RegisterClass(&wc))
|
|
|
|
{
|
2009-10-09 20:45:06 -07:00
|
|
|
ERR("RegisterClass() failed");
|
|
|
|
goto free_library;
|
2008-06-25 22:11:16 -07:00
|
|
|
}
|
|
|
|
|
2008-11-27 11:30:39 -08:00
|
|
|
if (!ecore_win32_dnd_init())
|
|
|
|
{
|
2009-10-09 20:45:06 -07:00
|
|
|
ERR("ecore_win32_dnd_init() failed");
|
|
|
|
goto unregister_class;
|
2008-11-27 11:30:39 -08:00
|
|
|
}
|
|
|
|
|
2009-04-14 13:04:16 -07:00
|
|
|
if (!ECORE_WIN32_EVENT_MOUSE_IN)
|
2008-06-25 22:11:16 -07:00
|
|
|
{
|
|
|
|
ECORE_WIN32_EVENT_MOUSE_IN = ecore_event_type_new();
|
|
|
|
ECORE_WIN32_EVENT_MOUSE_OUT = ecore_event_type_new();
|
|
|
|
ECORE_WIN32_EVENT_WINDOW_FOCUS_IN = ecore_event_type_new();
|
|
|
|
ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT = ecore_event_type_new();
|
|
|
|
ECORE_WIN32_EVENT_WINDOW_DAMAGE = ecore_event_type_new();
|
|
|
|
ECORE_WIN32_EVENT_WINDOW_CREATE = ecore_event_type_new();
|
|
|
|
ECORE_WIN32_EVENT_WINDOW_DESTROY = ecore_event_type_new();
|
|
|
|
ECORE_WIN32_EVENT_WINDOW_SHOW = ecore_event_type_new();
|
|
|
|
ECORE_WIN32_EVENT_WINDOW_HIDE = ecore_event_type_new();
|
|
|
|
ECORE_WIN32_EVENT_WINDOW_CONFIGURE = ecore_event_type_new();
|
|
|
|
ECORE_WIN32_EVENT_WINDOW_RESIZE = ecore_event_type_new();
|
|
|
|
ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST = ecore_event_type_new();
|
|
|
|
}
|
|
|
|
|
2009-10-09 20:45:06 -07:00
|
|
|
return _ecore_win32_init_count;
|
2009-04-14 13:04:16 -07:00
|
|
|
|
2009-10-09 20:45:06 -07:00
|
|
|
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();
|
2008-06-25 22:11:16 -07:00
|
|
|
|
2009-10-09 20:45:06 -07:00
|
|
|
return --_ecore_win32_init_count;
|
2008-06-25 22:11:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
ecore_win32_shutdown()
|
|
|
|
{
|
2009-10-09 20:45:06 -07:00
|
|
|
if (--_ecore_win32_init_count != 0)
|
|
|
|
return _ecore_win32_init_count;
|
2008-06-25 22:11:16 -07:00
|
|
|
|
2008-11-27 11:30:39 -08:00
|
|
|
ecore_win32_dnd_shutdown();
|
2009-10-09 20:45:06 -07:00
|
|
|
|
2009-02-21 14:50:45 -08:00
|
|
|
if (!UnregisterClass(ECORE_WIN32_WINDOW_CLASS, _ecore_win32_instance))
|
2009-10-09 20:45:06 -07:00
|
|
|
INF("UnregisterClass() failed");
|
|
|
|
|
2009-02-21 14:50:45 -08:00
|
|
|
if (!FreeLibrary(_ecore_win32_instance))
|
2009-10-09 20:45:06 -07:00
|
|
|
INF("FreeLibrary() failed");
|
2008-06-25 22:11:16 -07:00
|
|
|
|
2009-10-09 20:45:06 -07:00
|
|
|
_ecore_win32_instance = NULL;
|
2009-09-05 01:39:34 -07:00
|
|
|
|
2009-10-09 20:45:06 -07:00
|
|
|
ecore_event_shutdown();
|
|
|
|
eina_log_domain_unregister(_ecore_win32_log_dom_global);
|
2009-12-21 09:32:19 -08:00
|
|
|
_ecore_win32_log_dom_global = -1;
|
2009-10-09 20:45:06 -07:00
|
|
|
eina_shutdown();
|
2008-06-25 22:11:16 -07:00
|
|
|
|
|
|
|
return _ecore_win32_init_count;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
ecore_win32_screen_depth_get()
|
|
|
|
{
|
|
|
|
HDC dc;
|
|
|
|
int depth;
|
|
|
|
|
2009-10-09 20:45:06 -07:00
|
|
|
INF("getting screen depth");
|
2009-02-21 14:50:45 -08:00
|
|
|
|
2008-06-25 22:11:16 -07:00
|
|
|
dc = GetDC(NULL);
|
|
|
|
if (!dc)
|
2009-02-21 14:50:45 -08:00
|
|
|
{
|
2009-10-09 20:45:06 -07:00
|
|
|
ERR("GetDC() failed");
|
2009-02-21 14:50:45 -08:00
|
|
|
return 0;
|
|
|
|
}
|
2008-06-25 22:11:16 -07:00
|
|
|
|
|
|
|
depth = GetDeviceCaps(dc, BITSPIXEL);
|
2009-02-21 14:50:45 -08:00
|
|
|
if (!ReleaseDC(NULL, dc))
|
|
|
|
{
|
2009-10-09 20:45:06 -07:00
|
|
|
ERR("ReleaseDC() failed (device context not released)");
|
2009-02-21 14:50:45 -08:00
|
|
|
}
|
2008-06-25 22:11:16 -07:00
|
|
|
|
|
|
|
return depth;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the timeout for a double and triple clicks to be flagged.
|
|
|
|
*
|
|
|
|
* This sets the time between clicks before the double_click flag is
|
|
|
|
* set in a button down event. If 3 clicks occur within double this
|
|
|
|
* time, the triple_click flag is also set.
|
|
|
|
*
|
|
|
|
* @param t The time in seconds
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
ecore_win32_double_click_time_set(double t)
|
|
|
|
{
|
|
|
|
if (t < 0.0) t = 0.0;
|
|
|
|
_ecore_win32_double_click_time = t;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieves the double and triple click flag timeout.
|
|
|
|
*
|
|
|
|
* See @ref ecore_win32_double_click_time_set for more information.
|
|
|
|
*
|
|
|
|
* @return The timeout for double clicks in seconds.
|
|
|
|
*/
|
|
|
|
double
|
|
|
|
ecore_win32_double_click_time_get(void)
|
|
|
|
{
|
|
|
|
return _ecore_win32_double_click_time;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the last event time
|
|
|
|
*/
|
2009-09-28 10:36:43 -07:00
|
|
|
long
|
2008-06-25 22:11:16 -07:00
|
|
|
ecore_win32_current_time_get(void)
|
|
|
|
{
|
|
|
|
return _ecore_win32_event_last_time;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***** Private functions definitions *****/
|
2007-08-26 04:17:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
LRESULT CALLBACK
|
|
|
|
_ecore_win32_window_procedure(HWND window,
|
|
|
|
UINT message,
|
|
|
|
WPARAM window_param,
|
|
|
|
LPARAM data_param)
|
|
|
|
{
|
|
|
|
Ecore_Win32_Callback_Data *data;
|
|
|
|
POINTS pt;
|
|
|
|
DWORD coord;
|
|
|
|
|
|
|
|
data = (Ecore_Win32_Callback_Data *)malloc(sizeof(Ecore_Win32_Callback_Data));
|
|
|
|
if (!data) return DefWindowProc(window, message, window_param, data_param);
|
|
|
|
|
|
|
|
data->window = window;
|
|
|
|
data->message = message;
|
|
|
|
data->window_param = window_param;
|
|
|
|
data->data_param = data_param;
|
|
|
|
data->time = GetMessageTime();
|
|
|
|
coord = GetMessagePos();
|
|
|
|
pt = MAKEPOINTS(coord);
|
|
|
|
data->x = pt.x;
|
|
|
|
data->y = pt.y;
|
|
|
|
|
|
|
|
switch (data->message)
|
|
|
|
{
|
2007-09-23 04:08:52 -07:00
|
|
|
/* Keyboard input notifications */
|
2007-08-26 04:17:21 -07:00
|
|
|
case WM_KEYDOWN:
|
|
|
|
_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:
|
|
|
|
_ecore_win32_event_handle_key_release(data, 1);
|
|
|
|
return 0;
|
2007-09-23 04:08:52 -07:00
|
|
|
case WM_SETFOCUS:
|
|
|
|
_ecore_win32_event_handle_focus_in(data);
|
|
|
|
return 0;
|
|
|
|
case WM_KILLFOCUS:
|
|
|
|
_ecore_win32_event_handle_focus_out(data);
|
|
|
|
return 0;
|
|
|
|
/* Mouse input notifications */
|
2007-08-26 04:17:21 -07:00
|
|
|
case WM_LBUTTONDOWN:
|
|
|
|
_ecore_win32_event_handle_button_press(data, 1);
|
|
|
|
return 0;
|
|
|
|
case WM_MBUTTONDOWN:
|
|
|
|
_ecore_win32_event_handle_button_press(data, 2);
|
|
|
|
return 0;
|
|
|
|
case WM_RBUTTONDOWN:
|
|
|
|
_ecore_win32_event_handle_button_press(data, 3);
|
|
|
|
return 0;
|
|
|
|
case WM_LBUTTONUP:
|
|
|
|
_ecore_win32_event_handle_button_release(data, 1);
|
|
|
|
return 0;
|
|
|
|
case WM_MBUTTONUP:
|
|
|
|
_ecore_win32_event_handle_button_release(data, 2);
|
|
|
|
return 0;
|
|
|
|
case WM_RBUTTONUP:
|
|
|
|
_ecore_win32_event_handle_button_release(data, 3);
|
|
|
|
return 0;
|
|
|
|
case WM_MOUSEMOVE:
|
|
|
|
{
|
|
|
|
RECT rect;
|
|
|
|
struct _Ecore_Win32_Window *w = NULL;
|
|
|
|
|
2008-06-25 21:30:29 -07:00
|
|
|
w = (struct _Ecore_Win32_Window *)GetWindowLong(window, GWL_USERDATA);
|
2007-08-26 04:17:21 -07:00
|
|
|
|
|
|
|
if (GetClientRect(window, &rect))
|
2009-02-21 14:50:45 -08:00
|
|
|
{
|
|
|
|
POINT pt;
|
|
|
|
|
2009-10-09 20:45:06 -07:00
|
|
|
INF("mouse in window");
|
2009-02-21 14:50:45 -08:00
|
|
|
|
|
|
|
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
|
|
|
|
{
|
2009-10-09 20:45:06 -07:00
|
|
|
ERR("GetClientRect() failed");
|
2009-02-21 14:50:45 -08:00
|
|
|
}
|
2007-08-26 04:17:21 -07:00
|
|
|
_ecore_win32_event_handle_motion_notify(data);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2007-09-23 04:08:52 -07:00
|
|
|
case WM_MOUSEWHEEL:
|
|
|
|
_ecore_win32_event_handle_button_press(data, 4);
|
|
|
|
return 0;
|
|
|
|
/* Window notifications */
|
|
|
|
case WM_CREATE:
|
|
|
|
_ecore_win32_event_handle_create_notify(data);
|
|
|
|
return 0;
|
2007-08-26 04:17:21 -07:00
|
|
|
case WM_DESTROY:
|
|
|
|
_ecore_win32_event_handle_destroy_notify(data);
|
|
|
|
return 0;
|
|
|
|
case WM_SHOWWINDOW:
|
|
|
|
if ((data->data_param == SW_OTHERUNZOOM) ||
|
|
|
|
(data->data_param == SW_OTHERUNZOOM))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (data->window_param)
|
|
|
|
_ecore_win32_event_handle_map_notify(data);
|
|
|
|
else
|
|
|
|
_ecore_win32_event_handle_unmap_notify(data);
|
|
|
|
|
|
|
|
return 0;
|
2007-09-23 04:08:52 -07:00
|
|
|
case WM_CLOSE:
|
|
|
|
_ecore_win32_event_handle_delete_request(data);
|
|
|
|
return 0;
|
|
|
|
case WM_MOVING:
|
|
|
|
printf (" * ecore message : moving\n");
|
2010-02-26 16:01:10 -08:00
|
|
|
return EINA_TRUE;
|
2007-09-23 04:08:52 -07:00
|
|
|
case WM_MOVE:
|
|
|
|
printf (" * ecore message : moved\n");
|
|
|
|
return 0;
|
|
|
|
case WM_SIZING:
|
|
|
|
printf (" * ecore message : sizing\n");
|
|
|
|
_ecore_win32_event_handle_resize(data);
|
2007-11-16 11:31:32 -08:00
|
|
|
_ecore_win32_event_handle_configure_notify(data);
|
2010-02-26 16:01:10 -08:00
|
|
|
return EINA_TRUE;
|
2007-09-23 04:08:52 -07:00
|
|
|
case WM_SIZE:
|
|
|
|
printf (" * ecore message : sized\n");
|
|
|
|
return 0;
|
2007-11-16 11:31:32 -08:00
|
|
|
/* case WM_WINDOWPOSCHANGING: */
|
|
|
|
/* { */
|
|
|
|
/* RECT rect; */
|
|
|
|
/* GetClientRect(window, &rect); */
|
|
|
|
/* printf (" *** ecore message : WINDOWPOSCHANGING %ld %ld\n", */
|
|
|
|
/* rect.right - rect.left, rect.bottom - rect.top); */
|
|
|
|
/* } */
|
|
|
|
/* _ecore_win32_event_handle_configure_notify(data); */
|
|
|
|
/* return 0; */
|
2007-09-23 04:08:52 -07:00
|
|
|
case WM_WINDOWPOSCHANGED:
|
|
|
|
_ecore_win32_event_handle_configure_notify(data);
|
|
|
|
return 0;
|
|
|
|
case WM_ENTERSIZEMOVE :
|
|
|
|
printf (" * ecore message : WM_ENTERSIZEMOVE \n");
|
|
|
|
return 0;
|
|
|
|
case WM_EXITSIZEMOVE:
|
|
|
|
printf (" * ecore message : WM_EXITSIZEMOVE\n");
|
|
|
|
return 0;
|
|
|
|
/* GDI notifications */
|
2007-08-26 04:17:21 -07:00
|
|
|
case WM_PAINT:
|
|
|
|
{
|
|
|
|
RECT rect;
|
|
|
|
|
2010-02-26 16:01:10 -08:00
|
|
|
if (GetUpdateRect(window, &rect, EINA_FALSE))
|
2007-08-26 04:17:21 -07:00
|
|
|
{
|
|
|
|
PAINTSTRUCT ps;
|
|
|
|
HDC hdc;
|
|
|
|
|
|
|
|
hdc = BeginPaint(window, &ps);
|
2007-09-23 04:08:52 -07:00
|
|
|
data->update = rect;
|
|
|
|
_ecore_win32_event_handle_expose(data);
|
2007-08-26 04:17:21 -07:00
|
|
|
EndPaint(window, &ps);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2007-09-23 04:08:52 -07:00
|
|
|
case WM_SETREDRAW:
|
|
|
|
printf (" * ecore message : WM_SETREDRAW\n");
|
2007-08-26 04:17:21 -07:00
|
|
|
return 0;
|
2007-09-23 04:08:52 -07:00
|
|
|
case WM_SYNCPAINT:
|
|
|
|
printf (" * ecore message : WM_SYNCPAINT\n");
|
2007-08-26 04:17:21 -07:00
|
|
|
return 0;
|
|
|
|
default:
|
|
|
|
return DefWindowProc(window, message, window_param, data_param);
|
|
|
|
}
|
2009-02-21 14:50:45 -08:00
|
|
|
}
|
2007-08-26 04:17:21 -07:00
|
|
|
|
2009-02-21 14:50:45 -08:00
|
|
|
static void
|
2009-09-05 01:39:34 -07:00
|
|
|
_ecore_win32_error_print_cb(const Eina_Log_Domain *d __UNUSED__,
|
|
|
|
Eina_Log_Level level __UNUSED__,
|
|
|
|
const char *file __UNUSED__,
|
|
|
|
const char *fnc,
|
|
|
|
int line,
|
|
|
|
const char *fmt,
|
|
|
|
void *data __UNUSED__,
|
|
|
|
va_list args)
|
2009-02-21 14:50:45 -08:00
|
|
|
{
|
|
|
|
fprintf(stderr, "[%s:%d] ", fnc, line);
|
|
|
|
vfprintf(stderr, fmt, args);
|
2007-08-26 04:17:21 -07:00
|
|
|
}
|