add debug messages, formatting, fix initialisation of mouse_in and mouse_out events

SVN revision: 34758
This commit is contained in:
doursse 2008-06-06 12:20:47 +00:00 committed by doursse
parent 4e78b97de8
commit fb34ce418d
3 changed files with 36 additions and 44 deletions

View File

@ -91,6 +91,8 @@ ecore_wince_init()
ECORE_WINCE_EVENT_MOUSE_BUTTON_DOWN = ecore_event_type_new();
ECORE_WINCE_EVENT_MOUSE_BUTTON_UP = ecore_event_type_new();
ECORE_WINCE_EVENT_MOUSE_MOVE = ecore_event_type_new();
ECORE_WINCE_EVENT_MOUSE_IN = ecore_event_type_new();
ECORE_WINCE_EVENT_MOUSE_OUT = ecore_event_type_new();
ECORE_WINCE_EVENT_WINDOW_FOCUS_IN = ecore_event_type_new();
ECORE_WINCE_EVENT_WINDOW_FOCUS_OUT = ecore_event_type_new();
ECORE_WINCE_EVENT_WINDOW_DAMAGE = ecore_event_type_new();
@ -226,31 +228,39 @@ _ecore_wince_window_procedure(HWND window,
struct _Ecore_WinCE_Window *w = NULL;
w = (struct _Ecore_WinCE_Window *)GetWindowLong(window, GWL_USERDATA);
printf (" * ecore message : mouse move\n");
if (GetClientRect(window, &rect))
{
POINT pt;
{
POINT pt;
pt.x = LOWORD(data_param);
pt.y = HIWORD(data_param);
if (!PtInRect(&rect, pt))
{
if (w->pointer_is_in)
{
w->pointer_is_in = 0;
_ecore_wince_event_handle_leave_notify(data);
}
}
else
{
if (!w->pointer_is_in)
{
w->pointer_is_in = 1;
_ecore_wince_event_handle_enter_notify(data);
}
}
}
printf ("GetClientRect !!\n");
pt.x = LOWORD(data_param);
pt.y = HIWORD(data_param);
if (!PtInRect(&rect, pt))
{
printf ("pas dans rect...\n");
if (w->pointer_is_in)
{
w->pointer_is_in = 0;
_ecore_wince_event_handle_leave_notify(data);
}
}
else
{
printf ("dans rect... %d\n", w->pointer_is_in);
if (!w->pointer_is_in)
{
printf ("w->pointer_is_in a 0\n");
w->pointer_is_in = 1;
_ecore_wince_event_handle_enter_notify(data);
}
}
}
else
{
printf ("pas de GetClientRect !!\n");
}
_ecore_wince_event_handle_motion_notify(data);
return 0;

View File

@ -254,6 +254,7 @@ _ecore_wince_event_handle_motion_notify(Ecore_WinCE_Callback_Data *msg)
e->time = (double)msg->time / 1000.0;
ecore_event_add(ECORE_WINCE_EVENT_MOUSE_MOVE, e, NULL, NULL);
printf (" * ecore event motion notify\n");
}
void
@ -262,6 +263,7 @@ _ecore_wince_event_handle_enter_notify(Ecore_WinCE_Callback_Data *msg)
Ecore_WinCE_Window *window;
window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
printf (" * ecore event enter notify 0\n");
{
Ecore_WinCE_Event_Mouse_Move *e;
@ -295,6 +297,7 @@ _ecore_wince_event_handle_enter_notify(Ecore_WinCE_Callback_Data *msg)
ecore_event_add(ECORE_WINCE_EVENT_MOUSE_IN, e, NULL, NULL);
}
printf (" * ecore event enter notify 1\n");
}
void
@ -336,6 +339,7 @@ _ecore_wince_event_handle_leave_notify(Ecore_WinCE_Callback_Data *msg)
ecore_event_add(ECORE_WINCE_EVENT_MOUSE_OUT, e, NULL, NULL);
}
printf (" * ecore event leave notify\n");
}
void

View File

@ -13,28 +13,6 @@
#include "Ecore_WinCE.h"
#include "ecore_wince_private.h"
char *
_wchar_to_char(const wchar_t *text)
{
char * atext;
int size;
int asize;
size = wcslen(text) + 1;
asize = WideCharToMultiByte(CP_ACP, 0, text, size, NULL, 0, NULL, NULL);
if (asize == 0)
return NULL;
atext = (char*)malloc((asize + 1) * sizeof(char));
if (atext)
if (!WideCharToMultiByte(CP_ACP, 0, text, size, atext, asize, NULL, NULL))
return NULL;
atext[asize] = '\0';
return atext;
}
/***** Private declarations *****/