forked from enlightenment/efl
* fix a bug in the key up event ('space' key was not handled)
* Greatly improve the resize. Plain, without flickering, etc... SVN revision: 57182
This commit is contained in:
parent
981da7524b
commit
4bf163a1e4
|
@ -43,3 +43,7 @@
|
||||||
|
|
||||||
* Added ecore_file_download_full API.
|
* Added ecore_file_download_full API.
|
||||||
|
|
||||||
|
2011-02-20 Vincent Torri
|
||||||
|
|
||||||
|
* Ecore_Win32: improve resize of windows and fix key up event for
|
||||||
|
the 'space' key.
|
||||||
|
|
|
@ -38,6 +38,24 @@ DEFINE_OLEGUID(IID_IUnknown, 0x00000000L, 0, 0);
|
||||||
|
|
||||||
static int _ecore_win32_init_count = 0;
|
static int _ecore_win32_init_count = 0;
|
||||||
|
|
||||||
|
static void
|
||||||
|
_ecore_win32_size_check(Ecore_Win32_Window *win, int w, int h, int *dx, int *dy)
|
||||||
|
{
|
||||||
|
int minimal_width;
|
||||||
|
int minimal_height;
|
||||||
|
|
||||||
|
minimal_width = GetSystemMetrics(SM_CXMIN);
|
||||||
|
minimal_height = GetSystemMetrics(SM_CYMIN);
|
||||||
|
if ((w) < MAX(minimal_width, (int)win->min_width))
|
||||||
|
*dx = 0;
|
||||||
|
if ((w) > (int)win->max_width)
|
||||||
|
*dx = 0;
|
||||||
|
if ((h) < MAX(minimal_height, (int)win->min_height))
|
||||||
|
*dy = 0;
|
||||||
|
if ((h) > (int)win->max_height)
|
||||||
|
*dy = 0;
|
||||||
|
}
|
||||||
|
|
||||||
LRESULT CALLBACK
|
LRESULT CALLBACK
|
||||||
_ecore_win32_window_procedure(HWND window,
|
_ecore_win32_window_procedure(HWND window,
|
||||||
UINT message,
|
UINT message,
|
||||||
|
@ -45,7 +63,7 @@ _ecore_win32_window_procedure(HWND window,
|
||||||
LPARAM data_param)
|
LPARAM data_param)
|
||||||
{
|
{
|
||||||
Ecore_Win32_Callback_Data *data;
|
Ecore_Win32_Callback_Data *data;
|
||||||
POINTS pt;
|
POINTS point;
|
||||||
DWORD coord;
|
DWORD coord;
|
||||||
|
|
||||||
data = (Ecore_Win32_Callback_Data *)malloc(sizeof(Ecore_Win32_Callback_Data));
|
data = (Ecore_Win32_Callback_Data *)malloc(sizeof(Ecore_Win32_Callback_Data));
|
||||||
|
@ -57,9 +75,9 @@ _ecore_win32_window_procedure(HWND window,
|
||||||
data->data_param = data_param;
|
data->data_param = data_param;
|
||||||
data->time = GetMessageTime();
|
data->time = GetMessageTime();
|
||||||
coord = GetMessagePos();
|
coord = GetMessagePos();
|
||||||
pt = MAKEPOINTS(coord);
|
point = MAKEPOINTS(coord);
|
||||||
data->x = pt.x;
|
data->x = point.x;
|
||||||
data->y = pt.y;
|
data->y = point.y;
|
||||||
|
|
||||||
switch (data->message)
|
switch (data->message)
|
||||||
{
|
{
|
||||||
|
@ -68,10 +86,10 @@ _ecore_win32_window_procedure(HWND window,
|
||||||
INF("keydown message");
|
INF("keydown message");
|
||||||
_ecore_win32_event_handle_key_press(data, 1);
|
_ecore_win32_event_handle_key_press(data, 1);
|
||||||
return 0;
|
return 0;
|
||||||
case WM_CHAR:
|
/* case WM_CHAR: */
|
||||||
INF("char message");
|
/* INF("char message"); */
|
||||||
_ecore_win32_event_handle_key_press(data, 0);
|
/* _ecore_win32_event_handle_key_press(data, 0); */
|
||||||
return 0;
|
/* return 0; */
|
||||||
case WM_KEYUP:
|
case WM_KEYUP:
|
||||||
INF("keyup message");
|
INF("keyup message");
|
||||||
_ecore_win32_event_handle_key_release(data, 1);
|
_ecore_win32_event_handle_key_release(data, 1);
|
||||||
|
@ -98,9 +116,22 @@ _ecore_win32_window_procedure(HWND window,
|
||||||
_ecore_win32_event_handle_button_press(data, 3);
|
_ecore_win32_event_handle_button_press(data, 3);
|
||||||
return 0;
|
return 0;
|
||||||
case WM_LBUTTONUP:
|
case WM_LBUTTONUP:
|
||||||
|
{
|
||||||
|
struct _Ecore_Win32_Window *w = NULL;
|
||||||
|
|
||||||
INF("left button up message");
|
INF("left button up message");
|
||||||
|
|
||||||
|
w = (struct _Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA);
|
||||||
|
if (w->drag.dragging)
|
||||||
|
{
|
||||||
|
ReleaseCapture();
|
||||||
|
w->drag.dragging = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
_ecore_win32_event_handle_button_release(data, 1);
|
_ecore_win32_event_handle_button_release(data, 1);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
case WM_MBUTTONUP:
|
case WM_MBUTTONUP:
|
||||||
INF("middle button up message");
|
INF("middle button up message");
|
||||||
_ecore_win32_event_handle_button_release(data, 2);
|
_ecore_win32_event_handle_button_release(data, 2);
|
||||||
|
@ -118,6 +149,159 @@ _ecore_win32_window_procedure(HWND window,
|
||||||
|
|
||||||
w = (struct _Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA);
|
w = (struct _Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA);
|
||||||
|
|
||||||
|
if (w->drag.dragging)
|
||||||
|
{
|
||||||
|
POINT pt;
|
||||||
|
|
||||||
|
pt.x = GET_X_LPARAM(data_param);
|
||||||
|
pt.y = GET_Y_LPARAM(data_param);
|
||||||
|
if (ClientToScreen(window, &pt))
|
||||||
|
{
|
||||||
|
if (w->drag.type == HTCAPTION)
|
||||||
|
{
|
||||||
|
int dx;
|
||||||
|
int dy;
|
||||||
|
|
||||||
|
dx = pt.x - w->drag.px;
|
||||||
|
dy = pt.y - w->drag.py;
|
||||||
|
ecore_win32_window_move(w, w->drag.x + dx, w->drag.y + dy);
|
||||||
|
w->drag.x += dx;
|
||||||
|
w->drag.y += dy;
|
||||||
|
w->drag.px = pt.x;
|
||||||
|
w->drag.py = pt.y;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (w->drag.type == HTLEFT)
|
||||||
|
{
|
||||||
|
int dw;
|
||||||
|
|
||||||
|
dw = pt.x - w->drag.px;
|
||||||
|
ecore_win32_window_move_resize(w, w->drag.x + dw, w->drag.y, w->drag.w - dw, w->drag.h);
|
||||||
|
w->drag.x += dw;
|
||||||
|
w->drag.w -= dw;
|
||||||
|
w->drag.px = pt.x;
|
||||||
|
w->drag.py = pt.y;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (w->drag.type == HTRIGHT)
|
||||||
|
{
|
||||||
|
int dw;
|
||||||
|
|
||||||
|
dw = pt.x - w->drag.px;
|
||||||
|
ecore_win32_window_resize(w, w->drag.w + dw, w->drag.h);
|
||||||
|
w->drag.w += dw;
|
||||||
|
w->drag.px = pt.x;
|
||||||
|
w->drag.py = pt.y;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (w->drag.type == HTTOP)
|
||||||
|
{
|
||||||
|
int dh;
|
||||||
|
|
||||||
|
dh = pt.y - w->drag.py;
|
||||||
|
ecore_win32_window_move_resize(w, w->drag.x, w->drag.y + dh, w->drag.w, w->drag.h - dh);
|
||||||
|
w->drag.y += dh;
|
||||||
|
w->drag.h -= dh;
|
||||||
|
w->drag.px = pt.x;
|
||||||
|
w->drag.py = pt.y;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (w->drag.type == HTBOTTOM)
|
||||||
|
{
|
||||||
|
int dh;
|
||||||
|
|
||||||
|
dh = pt.y - w->drag.py;
|
||||||
|
ecore_win32_window_resize(w, w->drag.w, w->drag.h + dh);
|
||||||
|
w->drag.h += dh;
|
||||||
|
w->drag.px = pt.x;
|
||||||
|
w->drag.py = pt.y;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (w->drag.type == HTTOPLEFT)
|
||||||
|
{
|
||||||
|
int dx;
|
||||||
|
int dy;
|
||||||
|
int dh;
|
||||||
|
int dw;
|
||||||
|
|
||||||
|
dw = pt.x - w->drag.px;
|
||||||
|
dh = pt.y - w->drag.py;
|
||||||
|
dx = dw;
|
||||||
|
dy = dh;
|
||||||
|
_ecore_win32_size_check(w,
|
||||||
|
w->drag.w - dw, w->drag.h - dh,
|
||||||
|
&dx, &dy);
|
||||||
|
|
||||||
|
ecore_win32_window_move_resize(w, w->drag.x + dx, w->drag.y + dy, w->drag.w - dw, w->drag.h - dh);
|
||||||
|
w->drag.x += dx;
|
||||||
|
w->drag.y += dy;
|
||||||
|
w->drag.w -= dw;
|
||||||
|
w->drag.h -= dh;
|
||||||
|
w->drag.px = pt.x;
|
||||||
|
w->drag.py = pt.y;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (w->drag.type == HTTOPRIGHT)
|
||||||
|
{
|
||||||
|
int dx;
|
||||||
|
int dy;
|
||||||
|
int dh;
|
||||||
|
int dw;
|
||||||
|
|
||||||
|
dw = pt.x - w->drag.px;
|
||||||
|
dh = pt.y - w->drag.py;
|
||||||
|
dx = dw;
|
||||||
|
dy = dh;
|
||||||
|
_ecore_win32_size_check(w,
|
||||||
|
w->drag.w, w->drag.h - dh,
|
||||||
|
&dx, &dy);
|
||||||
|
ecore_win32_window_move_resize(w, w->drag.x, w->drag.y + dy, w->drag.w, w->drag.h - dh);
|
||||||
|
w->drag.y += dy;
|
||||||
|
w->drag.w += dw;
|
||||||
|
w->drag.h -= dh;
|
||||||
|
w->drag.px = pt.x;
|
||||||
|
w->drag.py = pt.y;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (w->drag.type == HTBOTTOMLEFT)
|
||||||
|
{
|
||||||
|
int dx;
|
||||||
|
int dy;
|
||||||
|
int dh;
|
||||||
|
int dw;
|
||||||
|
|
||||||
|
dw = pt.x - w->drag.px;
|
||||||
|
dh = pt.y - w->drag.py;
|
||||||
|
dx = dw;
|
||||||
|
dy = dh;
|
||||||
|
_ecore_win32_size_check(w,
|
||||||
|
w->drag.w - dw, w->drag.h + dh,
|
||||||
|
&dx, &dy);
|
||||||
|
ecore_win32_window_move_resize(w, w->drag.x + dx, w->drag.y, w->drag.w - dw, w->drag.h + dh);
|
||||||
|
w->drag.x += dx;
|
||||||
|
w->drag.w -= dw;
|
||||||
|
w->drag.h += dh;
|
||||||
|
w->drag.px = pt.x;
|
||||||
|
w->drag.py = pt.y;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (w->drag.type == HTBOTTOMRIGHT)
|
||||||
|
{
|
||||||
|
int dh;
|
||||||
|
int dw;
|
||||||
|
|
||||||
|
dw = pt.x - w->drag.px;
|
||||||
|
dh = pt.y - w->drag.py;
|
||||||
|
ecore_win32_window_resize(w, w->drag.w + dw, w->drag.h + dh);
|
||||||
|
w->drag.w += dw;
|
||||||
|
w->drag.h += dh;
|
||||||
|
w->drag.px = pt.x;
|
||||||
|
w->drag.py = pt.y;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (GetClientRect(window, &rect))
|
if (GetClientRect(window, &rect))
|
||||||
{
|
{
|
||||||
POINT pt;
|
POINT pt;
|
||||||
|
@ -219,6 +403,7 @@ _ecore_win32_window_procedure(HWND window,
|
||||||
return 0;
|
return 0;
|
||||||
case WM_NCLBUTTONDOWN:
|
case WM_NCLBUTTONDOWN:
|
||||||
INF("non client left button down window message");
|
INF("non client left button down window message");
|
||||||
|
|
||||||
if (((DWORD)window_param == HTCAPTION) ||
|
if (((DWORD)window_param == HTCAPTION) ||
|
||||||
((DWORD)window_param == HTBOTTOM) ||
|
((DWORD)window_param == HTBOTTOM) ||
|
||||||
((DWORD)window_param == HTBOTTOMLEFT) ||
|
((DWORD)window_param == HTBOTTOMLEFT) ||
|
||||||
|
@ -233,8 +418,10 @@ _ecore_win32_window_procedure(HWND window,
|
||||||
|
|
||||||
w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA);
|
w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA);
|
||||||
ecore_win32_window_geometry_get(w,
|
ecore_win32_window_geometry_get(w,
|
||||||
&w->drag.x, &w->drag.y,
|
NULL, NULL,
|
||||||
&w->drag.w, &w->drag.h);
|
&w->drag.w, &w->drag.h);
|
||||||
|
SetCapture(window);
|
||||||
|
w->drag.type = (DWORD)window_param;
|
||||||
w->drag.px = GET_X_LPARAM(data_param);
|
w->drag.px = GET_X_LPARAM(data_param);
|
||||||
w->drag.py = GET_Y_LPARAM(data_param);
|
w->drag.py = GET_Y_LPARAM(data_param);
|
||||||
w->drag.dragging = 1;
|
w->drag.dragging = 1;
|
||||||
|
@ -242,7 +429,8 @@ _ecore_win32_window_procedure(HWND window,
|
||||||
}
|
}
|
||||||
return DefWindowProc(window, message, window_param, data_param);
|
return DefWindowProc(window, message, window_param, data_param);
|
||||||
case WM_SYSCOMMAND:
|
case WM_SYSCOMMAND:
|
||||||
INF("sys command window message", (int)window_param);
|
INF("sys command window message %d", (int)window_param);
|
||||||
|
|
||||||
if ((((DWORD)window_param & 0xfff0) == SC_MOVE) ||
|
if ((((DWORD)window_param & 0xfff0) == SC_MOVE) ||
|
||||||
(((DWORD)window_param & 0xfff0) == SC_SIZE))
|
(((DWORD)window_param & 0xfff0) == SC_SIZE))
|
||||||
{
|
{
|
||||||
|
@ -255,118 +443,9 @@ _ecore_win32_window_procedure(HWND window,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return DefWindowProc(window, message, window_param, data_param);
|
return DefWindowProc(window, message, window_param, data_param);
|
||||||
case WM_NCMOUSEMOVE:
|
|
||||||
INF("non client mouse move window message");
|
|
||||||
if ((DWORD)window_param == HTCAPTION)
|
|
||||||
{
|
|
||||||
Ecore_Win32_Window *w;
|
|
||||||
|
|
||||||
w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA);
|
|
||||||
if (w->drag.dragging)
|
|
||||||
{
|
|
||||||
int dx;
|
|
||||||
int dy;
|
|
||||||
|
|
||||||
dx = GET_X_LPARAM(data_param) - w->drag.px;
|
|
||||||
dy = GET_Y_LPARAM(data_param) - w->drag.py;
|
|
||||||
ecore_win32_window_move(w, w->drag.x + dx, w->drag.y + dy);
|
|
||||||
w->drag.x += dx;
|
|
||||||
w->drag.y += dy;
|
|
||||||
w->drag.px = GET_X_LPARAM(data_param);
|
|
||||||
w->drag.py = GET_Y_LPARAM(data_param);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((DWORD)window_param == HTLEFT)
|
|
||||||
{
|
|
||||||
Ecore_Win32_Window *w;
|
|
||||||
|
|
||||||
w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA);
|
|
||||||
if (w->drag.dragging)
|
|
||||||
{
|
|
||||||
int dw;
|
|
||||||
dw = GET_X_LPARAM(data_param) - w->drag.px;
|
|
||||||
ecore_win32_window_move_resize(w, w->drag.x + dw, w->drag.y, w->drag.w - dw, w->drag.h);
|
|
||||||
w->drag.x += dw;
|
|
||||||
w->drag.w -= dw;
|
|
||||||
w->drag.px = GET_X_LPARAM(data_param);
|
|
||||||
w->drag.py = GET_Y_LPARAM(data_param);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((DWORD)window_param == HTRIGHT)
|
|
||||||
{
|
|
||||||
Ecore_Win32_Window *w;
|
|
||||||
|
|
||||||
w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA);
|
|
||||||
if (w->drag.dragging)
|
|
||||||
{
|
|
||||||
int dw;
|
|
||||||
dw = GET_X_LPARAM(data_param) - w->drag.px;
|
|
||||||
ecore_win32_window_resize(w, w->drag.w + dw, w->drag.h);
|
|
||||||
w->drag.w += dw;
|
|
||||||
w->drag.px = GET_X_LPARAM(data_param);
|
|
||||||
w->drag.py = GET_Y_LPARAM(data_param);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((DWORD)window_param == HTTOP)
|
|
||||||
{
|
|
||||||
Ecore_Win32_Window *w;
|
|
||||||
|
|
||||||
w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA);
|
|
||||||
if (w->drag.dragging)
|
|
||||||
{
|
|
||||||
int dh;
|
|
||||||
dh = GET_Y_LPARAM(data_param) - w->drag.py;
|
|
||||||
ecore_win32_window_move_resize(w, w->drag.x, w->drag.y + dh, w->drag.w, w->drag.h - dh);
|
|
||||||
w->drag.y += dh;
|
|
||||||
w->drag.h -= dh;
|
|
||||||
w->drag.px = GET_X_LPARAM(data_param);
|
|
||||||
w->drag.py = GET_Y_LPARAM(data_param);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((DWORD)window_param == HTBOTTOM)
|
|
||||||
{
|
|
||||||
Ecore_Win32_Window *w;
|
|
||||||
|
|
||||||
w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA);
|
|
||||||
if (w->drag.dragging)
|
|
||||||
{
|
|
||||||
int dh;
|
|
||||||
dh = GET_Y_LPARAM(data_param) - w->drag.py;
|
|
||||||
ecore_win32_window_resize(w, w->drag.w, w->drag.h + dh);
|
|
||||||
w->drag.h += dh;
|
|
||||||
w->drag.px = GET_X_LPARAM(data_param);
|
|
||||||
w->drag.py = GET_Y_LPARAM(data_param);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return DefWindowProc(window, message, window_param, data_param);
|
|
||||||
case WM_NCLBUTTONUP:
|
|
||||||
INF("non client left button up window message");
|
|
||||||
if (((DWORD)window_param == HTCAPTION) ||
|
|
||||||
((DWORD)window_param == HTBOTTOM) ||
|
|
||||||
((DWORD)window_param == HTBOTTOMLEFT) ||
|
|
||||||
((DWORD)window_param == HTBOTTOMRIGHT) ||
|
|
||||||
((DWORD)window_param == HTLEFT) ||
|
|
||||||
((DWORD)window_param == HTRIGHT) ||
|
|
||||||
((DWORD)window_param == HTTOP) ||
|
|
||||||
((DWORD)window_param == HTTOPLEFT) ||
|
|
||||||
((DWORD)window_param == HTTOPRIGHT))
|
|
||||||
{
|
|
||||||
Ecore_Win32_Window *w;
|
|
||||||
|
|
||||||
w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA);
|
|
||||||
if (w->drag.dragging)
|
|
||||||
{
|
|
||||||
w->drag.dragging = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return DefWindowProc(window, message, window_param, data_param);
|
|
||||||
/* GDI notifications */
|
/* GDI notifications */
|
||||||
|
case WM_ERASEBKGND:
|
||||||
|
return 1;
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
{
|
{
|
||||||
RECT rect;
|
RECT rect;
|
||||||
|
|
|
@ -802,6 +802,7 @@ _ecore_win32_event_keystroke_get(int key,
|
||||||
kn = "space";
|
kn = "space";
|
||||||
ks = "space";
|
ks = "space";
|
||||||
kc = "space";
|
kc = "space";
|
||||||
|
break;
|
||||||
case VK_F1:
|
case VK_F1:
|
||||||
kn = "F1";
|
kn = "F1";
|
||||||
ks = "F1";
|
ks = "F1";
|
||||||
|
|
|
@ -6,6 +6,15 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MIN
|
||||||
|
# undef MIN
|
||||||
|
#endif
|
||||||
|
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
|
|
||||||
|
#ifdef MAX
|
||||||
|
# undef MAX
|
||||||
|
#endif
|
||||||
|
#define MAX(a,b) (((a) < (b)) ? (b) : (a))
|
||||||
|
|
||||||
/* logging messages macros */
|
/* logging messages macros */
|
||||||
extern int _ecore_win32_log_dom_global;
|
extern int _ecore_win32_log_dom_global;
|
||||||
|
@ -29,6 +38,11 @@ extern int _ecore_win32_log_dom_global;
|
||||||
#endif
|
#endif
|
||||||
#define INF(...) EINA_LOG_DOM_INFO(_ecore_win32_log_dom_global , __VA_ARGS__)
|
#define INF(...) EINA_LOG_DOM_INFO(_ecore_win32_log_dom_global , __VA_ARGS__)
|
||||||
|
|
||||||
|
#ifdef WRN
|
||||||
|
# undef WRN
|
||||||
|
#endif
|
||||||
|
#define WRN(...) EINA_LOG_DOM_WARN(_ecore_win32_log_dom_global, __VA_ARGS__)
|
||||||
|
|
||||||
#define ECORE_WIN32_WINDOW_CLASS "Ecore_Win32_Window_Class"
|
#define ECORE_WIN32_WINDOW_CLASS "Ecore_Win32_Window_Class"
|
||||||
|
|
||||||
typedef struct _Ecore_Win32_Callback_Data Ecore_Win32_Callback_Data;
|
typedef struct _Ecore_Win32_Callback_Data Ecore_Win32_Callback_Data;
|
||||||
|
@ -100,12 +114,13 @@ struct _Ecore_Win32_Window
|
||||||
} shape;
|
} shape;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
unsigned int x;
|
DWORD type;
|
||||||
unsigned int y;
|
int x;
|
||||||
unsigned int w;
|
int y;
|
||||||
unsigned int h;
|
int w;
|
||||||
unsigned int px;
|
int h;
|
||||||
unsigned int py;
|
int px;
|
||||||
|
int py;
|
||||||
unsigned int dragging : 1;
|
unsigned int dragging : 1;
|
||||||
} drag;
|
} drag;
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
|
||||||
rect.top = 0;
|
rect.top = 0;
|
||||||
rect.right = width;
|
rect.right = width;
|
||||||
rect.bottom = height;
|
rect.bottom = height;
|
||||||
if (!AdjustWindowRect(&rect, style, FALSE))
|
if (!AdjustWindowRectEx(&rect, style, FALSE, 0))
|
||||||
{
|
{
|
||||||
ERR("AdjustWindowRect() failed");
|
ERR("AdjustWindowRect() failed");
|
||||||
free(w);
|
free(w);
|
||||||
|
@ -352,6 +352,8 @@ ecore_win32_window_resize(Ecore_Win32_Window *window,
|
||||||
DWORD style;
|
DWORD style;
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
|
int minimal_width;
|
||||||
|
int minimal_height;
|
||||||
|
|
||||||
/* FIXME: on fullscreen, should not resize it */
|
/* FIXME: on fullscreen, should not resize it */
|
||||||
if (!window) return;
|
if (!window) return;
|
||||||
|
@ -359,6 +361,10 @@ ecore_win32_window_resize(Ecore_Win32_Window *window,
|
||||||
INF("resizing window (%dx%d)", width, height);
|
INF("resizing window (%dx%d)", width, height);
|
||||||
|
|
||||||
w = (struct _Ecore_Win32_Window *)window;
|
w = (struct _Ecore_Win32_Window *)window;
|
||||||
|
|
||||||
|
minimal_width = MAX(GetSystemMetrics(SM_CXMIN), (int)w->min_width);
|
||||||
|
minimal_height = MAX(GetSystemMetrics(SM_CYMIN), (int)w->min_height);
|
||||||
|
|
||||||
if (!GetWindowRect(w->window, &rect))
|
if (!GetWindowRect(w->window, &rect))
|
||||||
{
|
{
|
||||||
ERR("GetWindowRect() failed");
|
ERR("GetWindowRect() failed");
|
||||||
|
@ -369,13 +375,10 @@ ecore_win32_window_resize(Ecore_Win32_Window *window,
|
||||||
y = rect.top;
|
y = rect.top;
|
||||||
rect.left = 0;
|
rect.left = 0;
|
||||||
rect.top = 0;
|
rect.top = 0;
|
||||||
/* if (width < w->min_width) width = w->min_width; */
|
if (width < minimal_width) width = minimal_width;
|
||||||
/* if (width > w->max_width) width = w->max_width; */
|
if (width > (int)w->max_width) width = w->max_width;
|
||||||
/* printf ("ecore_win32_window_resize 1 : %d %d %d\n", w->min_height, w->max_height, height); */
|
if (height < minimal_height) height = minimal_height;
|
||||||
/* if (height < w->min_height) height = w->min_height; */
|
if (height > (int)w->max_height) height = w->max_height;
|
||||||
/* printf ("ecore_win32_window_resize 2 : %d %d\n", w->max_height, height); */
|
|
||||||
/* if (height > w->max_height) height = w->max_height; */
|
|
||||||
/* printf ("ecore_win32_window_resize 3 : %d %d\n", w->max_height, height); */
|
|
||||||
rect.right = width;
|
rect.right = width;
|
||||||
rect.bottom = height;
|
rect.bottom = height;
|
||||||
if (!(style = GetWindowLong(w->window, GWL_STYLE)))
|
if (!(style = GetWindowLong(w->window, GWL_STYLE)))
|
||||||
|
@ -421,6 +424,8 @@ ecore_win32_window_move_resize(Ecore_Win32_Window *window,
|
||||||
RECT rect;
|
RECT rect;
|
||||||
struct _Ecore_Win32_Window *w;
|
struct _Ecore_Win32_Window *w;
|
||||||
DWORD style;
|
DWORD style;
|
||||||
|
int minimal_width;
|
||||||
|
int minimal_height;
|
||||||
|
|
||||||
/* FIXME: on fullscreen, should not move/resize it */
|
/* FIXME: on fullscreen, should not move/resize it */
|
||||||
if (!window) return;
|
if (!window) return;
|
||||||
|
@ -428,12 +433,16 @@ ecore_win32_window_move_resize(Ecore_Win32_Window *window,
|
||||||
INF("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);
|
w = ((struct _Ecore_Win32_Window *)window);
|
||||||
|
|
||||||
|
minimal_width = MAX(GetSystemMetrics(SM_CXMIN), (int)w->min_width);
|
||||||
|
minimal_height = MAX(GetSystemMetrics(SM_CYMIN), (int)w->min_height);
|
||||||
|
|
||||||
rect.left = 0;
|
rect.left = 0;
|
||||||
rect.top = 0;
|
rect.top = 0;
|
||||||
if ((unsigned int)width < w->min_width) width = w->min_width;
|
if (width < minimal_width) width = minimal_width;
|
||||||
if ((unsigned int)width > w->max_width) width = w->max_width;
|
if (width > (int)w->max_width) width = w->max_width;
|
||||||
if ((unsigned int)height < w->min_height) height = w->min_height;
|
if (height < minimal_height) height = minimal_height;
|
||||||
if ((unsigned int)height > w->max_height) height = w->max_height;
|
if (height > (int)w->max_height) height = w->max_height;
|
||||||
rect.right = width;
|
rect.right = width;
|
||||||
rect.bottom = height;
|
rect.bottom = height;
|
||||||
if (!(style = GetWindowLong(w->window, GWL_STYLE)))
|
if (!(style = GetWindowLong(w->window, GWL_STYLE)))
|
||||||
|
|
Loading…
Reference in New Issue