summaryrefslogtreecommitdiff
path: root/src/lib/ecore_win32
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2014-07-08 23:21:35 +0200
committerCedric BAIL <c.bail@partner.samsung.com>2014-07-09 14:26:26 +0200
commitd1cbf6d080424263a906d43b1bf35f3fb1815cb6 (patch)
tree136d19e610622e49d038e840c4de44097449c2a9 /src/lib/ecore_win32
parent925c258e6b58c8f5a95c2f8fc6ca85ca7856c455 (diff)
Ecore_Win32: fix resize of windows when step and base sizes are set
Diffstat (limited to 'src/lib/ecore_win32')
-rw-r--r--src/lib/ecore_win32/Ecore_Win32.h32
-rw-r--r--src/lib/ecore_win32/ecore_win32.c174
-rw-r--r--src/lib/ecore_win32/ecore_win32_private.h101
-rw-r--r--src/lib/ecore_win32/ecore_win32_window.c510
4 files changed, 486 insertions, 331 deletions
diff --git a/src/lib/ecore_win32/Ecore_Win32.h b/src/lib/ecore_win32/Ecore_Win32.h
index 363fddb690..ba0cc4d141 100644
--- a/src/lib/ecore_win32/Ecore_Win32.h
+++ b/src/lib/ecore_win32/Ecore_Win32.h
@@ -421,36 +421,36 @@ EAPI void ecore_win32_window_size_get(Ecore_Win32_Window *window,
421 int *height); 421 int *height);
422 422
423EAPI void ecore_win32_window_size_min_set(Ecore_Win32_Window *window, 423EAPI void ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
424 unsigned int min_width, 424 int min_width,
425 unsigned int min_height); 425 int min_height);
426 426
427EAPI void ecore_win32_window_size_min_get(Ecore_Win32_Window *window, 427EAPI void ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
428 unsigned int *min_width, 428 int *min_width,
429 unsigned int *min_height); 429 int *min_height);
430 430
431EAPI void ecore_win32_window_size_max_set(Ecore_Win32_Window *window, 431EAPI void ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
432 unsigned int max_width, 432 int max_width,
433 unsigned int max_height); 433 int max_height);
434 434
435EAPI void ecore_win32_window_size_max_get(Ecore_Win32_Window *window, 435EAPI void ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
436 unsigned int *max_width, 436 int *max_width,
437 unsigned int *max_height); 437 int *max_height);
438 438
439EAPI void ecore_win32_window_size_base_set(Ecore_Win32_Window *window, 439EAPI void ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
440 unsigned int base_width, 440 int base_width,
441 unsigned int base_height); 441 int base_height);
442 442
443EAPI void ecore_win32_window_size_base_get(Ecore_Win32_Window *window, 443EAPI void ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
444 unsigned int *base_width, 444 int *base_width,
445 unsigned int *base_height); 445 int *base_height);
446 446
447EAPI void ecore_win32_window_size_step_set(Ecore_Win32_Window *window, 447EAPI void ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
448 unsigned int step_width, 448 int step_width,
449 unsigned int step_height); 449 int step_height);
450 450
451EAPI void ecore_win32_window_size_step_get(Ecore_Win32_Window *window, 451EAPI void ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
452 unsigned int *step_width, 452 int *step_width,
453 unsigned int *step_height); 453 int *step_height);
454 454
455EAPI void ecore_win32_window_show(Ecore_Win32_Window *window); 455EAPI void ecore_win32_window_show(Ecore_Win32_Window *window);
456 456
diff --git a/src/lib/ecore_win32/ecore_win32.c b/src/lib/ecore_win32/ecore_win32.c
index 2c20ae9bdb..411c2f0eb8 100644
--- a/src/lib/ecore_win32/ecore_win32.c
+++ b/src/lib/ecore_win32/ecore_win32.c
@@ -38,24 +38,6 @@ DEFINE_OLEGUID(IID_IUnknown, 0x00000000L, 0, 0);
38 38
39static int _ecore_win32_init_count = 0; 39static int _ecore_win32_init_count = 0;
40 40
41static void
42_ecore_win32_size_check(Ecore_Win32_Window *win, int w, int h, int *dx, int *dy)
43{
44 int minimal_width;
45 int minimal_height;
46
47 minimal_width = GetSystemMetrics(SM_CXMIN);
48 minimal_height = GetSystemMetrics(SM_CYMIN);
49 if ((w) < MAX(minimal_width, (int)win->min_width))
50 *dx = 0;
51 if ((w) > (int)win->max_width)
52 *dx = 0;
53 if ((h) < MAX(minimal_height, (int)win->min_height))
54 *dy = 0;
55 if ((h) > (int)win->max_height)
56 *dy = 0;
57}
58
59LRESULT CALLBACK 41LRESULT CALLBACK
60_ecore_win32_window_procedure(HWND window, 42_ecore_win32_window_procedure(HWND window,
61 UINT message, 43 UINT message,
@@ -124,7 +106,7 @@ _ecore_win32_window_procedure(HWND window,
124 w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWLP_USERDATA); 106 w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWLP_USERDATA);
125 if (w->drag.dragging) 107 if (w->drag.dragging)
126 { 108 {
127 w->drag.dragging = 0; 109 w->drag.dragging = EINA_FALSE;
128 return 0; 110 return 0;
129 } 111 }
130 112
@@ -155,11 +137,11 @@ _ecore_win32_window_procedure(HWND window,
155 (w->drag.current_mouse_y == GET_Y_LPARAM(data_param))) 137 (w->drag.current_mouse_y == GET_Y_LPARAM(data_param)))
156 return 0; 138 return 0;
157 139
140 INF("mouse move message");
141
158 w->drag.current_mouse_x = GET_X_LPARAM(data_param); 142 w->drag.current_mouse_x = GET_X_LPARAM(data_param);
159 w->drag.current_mouse_y = GET_Y_LPARAM(data_param); 143 w->drag.current_mouse_y = GET_Y_LPARAM(data_param);
160 144
161 INF("mouse move message");
162
163 if (w->drag.dragging) 145 if (w->drag.dragging)
164 { 146 {
165 POINT pt; 147 POINT pt;
@@ -168,148 +150,8 @@ _ecore_win32_window_procedure(HWND window,
168 pt.y = GET_Y_LPARAM(data_param); 150 pt.y = GET_Y_LPARAM(data_param);
169 if (ClientToScreen(window, &pt)) 151 if (ClientToScreen(window, &pt))
170 { 152 {
171 if (w->drag.type == HTCAPTION) 153 if (ecore_win32_window_drag(w, pt.x, pt.y))
172 { 154 return 0;
173 int dx;
174 int dy;
175
176 dx = pt.x - w->drag.px;
177 dy = pt.y - w->drag.py;
178 ecore_win32_window_move(w, w->drag.x + dx, w->drag.y + dy);
179 w->drag.x += dx;
180 w->drag.y += dy;
181 w->drag.px = pt.x;
182 w->drag.py = pt.y;
183 return 0;
184 }
185 if (w->drag.type == HTLEFT)
186 {
187 int dw;
188
189 dw = pt.x - w->drag.px;
190 ecore_win32_window_move_resize(w, w->drag.x + dw, w->drag.y, w->drag.w - dw, w->drag.h);
191 w->drag.x += dw;
192 w->drag.w -= dw;
193 w->drag.px = pt.x;
194 w->drag.py = pt.y;
195 return 0;
196 }
197 if (w->drag.type == HTRIGHT)
198 {
199 int dw;
200
201 dw = pt.x - w->drag.px;
202 ecore_win32_window_resize(w, w->drag.w + dw, w->drag.h);
203 w->drag.w += dw;
204 w->drag.px = pt.x;
205 w->drag.py = pt.y;
206 return 0;
207 }
208 if (w->drag.type == HTTOP)
209 {
210 int dh;
211
212 dh = pt.y - w->drag.py;
213 ecore_win32_window_move_resize(w, w->drag.x, w->drag.y + dh, w->drag.w, w->drag.h - dh);
214 w->drag.y += dh;
215 w->drag.h -= dh;
216 w->drag.px = pt.x;
217 w->drag.py = pt.y;
218 return 0;
219 }
220 if (w->drag.type == HTBOTTOM)
221 {
222 int dh;
223
224 dh = pt.y - w->drag.py;
225 ecore_win32_window_resize(w, w->drag.w, w->drag.h + dh);
226 w->drag.h += dh;
227 w->drag.px = pt.x;
228 w->drag.py = pt.y;
229 return 0;
230 }
231 if (w->drag.type == HTTOPLEFT)
232 {
233 int dx;
234 int dy;
235 int dh;
236 int dw;
237
238 dw = pt.x - w->drag.px;
239 dh = pt.y - w->drag.py;
240 dx = dw;
241 dy = dh;
242 _ecore_win32_size_check(w,
243 w->drag.w - dw, w->drag.h - dh,
244 &dx, &dy);
245
246 ecore_win32_window_move_resize(w, w->drag.x + dx, w->drag.y + dy, w->drag.w - dw, w->drag.h - dh);
247 w->drag.x += dx;
248 w->drag.y += dy;
249 w->drag.w -= dw;
250 w->drag.h -= dh;
251 w->drag.px = pt.x;
252 w->drag.py = pt.y;
253 return 0;
254 }
255 if (w->drag.type == HTTOPRIGHT)
256 {
257 int dx;
258 int dy;
259 int dh;
260 int dw;
261
262 dw = pt.x - w->drag.px;
263 dh = pt.y - w->drag.py;
264 dx = dw;
265 dy = dh;
266 _ecore_win32_size_check(w,
267 w->drag.w, w->drag.h - dh,
268 &dx, &dy);
269 ecore_win32_window_move_resize(w, w->drag.x, w->drag.y + dy, w->drag.w, w->drag.h - dh);
270 w->drag.y += dy;
271 w->drag.w += dw;
272 w->drag.h -= dh;
273 w->drag.px = pt.x;
274 w->drag.py = pt.y;
275 return 0;
276 }
277 if (w->drag.type == HTBOTTOMLEFT)
278 {
279 int dx;
280 int dy;
281 int dh;
282 int dw;
283
284 dw = pt.x - w->drag.px;
285 dh = pt.y - w->drag.py;
286 dx = dw;
287 dy = dh;
288 _ecore_win32_size_check(w,
289 w->drag.w - dw, w->drag.h + dh,
290 &dx, &dy);
291 ecore_win32_window_move_resize(w, w->drag.x + dx, w->drag.y, w->drag.w - dw, w->drag.h + dh);
292 w->drag.x += dx;
293 w->drag.w -= dw;
294 w->drag.h += dh;
295 w->drag.px = pt.x;
296 w->drag.py = pt.y;
297 return 0;
298 }
299 if (w->drag.type == HTBOTTOMRIGHT)
300 {
301 int dh;
302 int dw;
303
304 dw = pt.x - w->drag.px;
305 dh = pt.y - w->drag.py;
306 ecore_win32_window_resize(w, w->drag.w + dw, w->drag.h + dh);
307 w->drag.w += dw;
308 w->drag.h += dh;
309 w->drag.px = pt.x;
310 w->drag.py = pt.y;
311 return 0;
312 }
313 } 155 }
314 } 156 }
315 157
@@ -430,13 +272,13 @@ _ecore_win32_window_procedure(HWND window,
430 272
431 w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWLP_USERDATA); 273 w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWLP_USERDATA);
432 ecore_win32_window_geometry_get(w, 274 ecore_win32_window_geometry_get(w,
433 NULL, NULL, 275 &w->drag.x, &w->drag.y,
434 &w->drag.w, &w->drag.h); 276 &w->drag.w, &w->drag.h);
435 SetCapture(window); 277 SetCapture(window);
436 w->drag.type = (DWORD)window_param; 278 w->drag.type = (DWORD)window_param;
437 w->drag.px = GET_X_LPARAM(data_param); 279 w->drag.px = GET_X_LPARAM(data_param);
438 w->drag.py = GET_Y_LPARAM(data_param); 280 w->drag.py = GET_Y_LPARAM(data_param);
439 w->drag.dragging = 1; 281 w->drag.dragging = EINA_TRUE;
440 if ((DWORD)window_param == HTCAPTION) 282 if ((DWORD)window_param == HTCAPTION)
441 ecore_win32_window_raise(w); 283 ecore_win32_window_raise(w);
442 return 0; 284 return 0;
@@ -453,7 +295,7 @@ _ecore_win32_window_procedure(HWND window,
453 INF("sys command MOVE or SIZE window message : %dx%d", GET_X_LPARAM(data_param), GET_Y_LPARAM(data_param)); 295 INF("sys command MOVE or SIZE window message : %dx%d", GET_X_LPARAM(data_param), GET_Y_LPARAM(data_param));
454 296
455 w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWLP_USERDATA); 297 w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWLP_USERDATA);
456 w->drag.dragging = 1; 298 w->drag.dragging = EINA_TRUE;
457 return 0; 299 return 0;
458 } 300 }
459 return DefWindowProc(window, message, window_param, data_param); 301 return DefWindowProc(window, message, window_param, data_param);
diff --git a/src/lib/ecore_win32/ecore_win32_private.h b/src/lib/ecore_win32/ecore_win32_private.h
index af2d86a558..1e2bb1bd19 100644
--- a/src/lib/ecore_win32/ecore_win32_private.h
+++ b/src/lib/ecore_win32/ecore_win32_private.h
@@ -45,6 +45,14 @@ extern int _ecore_win32_log_dom_global;
45 45
46#define ECORE_WIN32_WINDOW_CLASS "Ecore_Win32_Window_Class" 46#define ECORE_WIN32_WINDOW_CLASS "Ecore_Win32_Window_Class"
47 47
48typedef enum
49{
50 ECORE_WIN32_POS_HINTS_MIN_SIZE = 1 << 0,
51 ECORE_WIN32_POS_HINTS_MAX_SIZE = 1 << 1,
52 ECORE_WIN32_POS_HINTS_BASE_SIZE = 1 << 2,
53 ECORE_WIN32_POS_HINTS_STEP_SIZE = 1 << 3
54} Ecore_Win32_Pos_Hints_Flags;
55
48typedef struct _Ecore_Win32_Callback_Data Ecore_Win32_Callback_Data; 56typedef struct _Ecore_Win32_Callback_Data Ecore_Win32_Callback_Data;
49 57
50struct _Ecore_Win32_Callback_Data 58struct _Ecore_Win32_Callback_Data
@@ -61,49 +69,52 @@ struct _Ecore_Win32_Callback_Data
61 69
62struct _Ecore_Win32_Window 70struct _Ecore_Win32_Window
63{ 71{
64 HWND window; 72 HWND window;
65 73 int mininal_window_width;
66 DWORD style; /* used to go fullscreen to normal */ 74 DWORD style; /* used to go fullscreen to normal */
67 RECT rect; /* used to go fullscreen to normal */ 75 RECT rect; /* used to go fullscreen to normal */
68 76
69 unsigned int min_width; 77 struct {
70 unsigned int min_height; 78 Ecore_Win32_Pos_Hints_Flags flags;
71 unsigned int max_width; 79 int min_width;
72 unsigned int max_height; 80 int min_height;
73 int base_width; 81 int max_width;
74 int base_height; 82 int max_height;
75 unsigned int step_width; 83 int base_width;
76 unsigned int step_height; 84 int base_height;
85 int step_width;
86 int step_height;
87 } pos_hints;
77 88
78 struct { 89 struct {
79 unsigned int iconified : 1; 90 unsigned int iconified : 1;
80 unsigned int modal : 1; 91 unsigned int modal : 1;
81 unsigned int sticky : 1; 92 unsigned int sticky : 1;
82 unsigned int maximized_vert : 1; 93 unsigned int maximized_vert : 1;
83 unsigned int maximized_horz : 1; 94 unsigned int maximized_horz : 1;
84 unsigned int shaded : 1; 95 unsigned int shaded : 1;
85 unsigned int hidden : 1; 96 unsigned int hidden : 1;
86 unsigned int fullscreen : 1; 97 unsigned int fullscreen : 1;
87 unsigned int above : 1; 98 unsigned int above : 1;
88 unsigned int below : 1; 99 unsigned int below : 1;
89 unsigned int demands_attention : 1; 100 unsigned int demands_attention : 1;
90 } state; 101 } state;
91 102
92 struct { 103 struct {
93 unsigned int desktop : 1; 104 unsigned int desktop : 1;
94 unsigned int dock : 1; 105 unsigned int dock : 1;
95 unsigned int toolbar : 1; 106 unsigned int toolbar : 1;
96 unsigned int menu : 1; 107 unsigned int menu : 1;
97 unsigned int utility : 1; 108 unsigned int utility : 1;
98 unsigned int splash : 1; 109 unsigned int splash : 1;
99 unsigned int dialog : 1; 110 unsigned int dialog : 1;
100 unsigned int normal : 1; 111 unsigned int normal : 1;
101 } type; 112 } type;
102 113
103 unsigned int pointer_is_in : 1; 114 unsigned int pointer_is_in : 1;
104 unsigned int borderless : 1; 115 unsigned int borderless : 1;
105 unsigned int iconified : 1; 116 unsigned int iconified : 1;
106 unsigned int fullscreen : 1; 117 unsigned int fullscreen : 1;
107 118
108 struct { 119 struct {
109 unsigned short width; 120 unsigned short width;
@@ -114,15 +125,15 @@ struct _Ecore_Win32_Window
114 } shape; 125 } shape;
115 126
116 struct { 127 struct {
117 DWORD type; 128 DWORD type;
118 int x; 129 int x;
119 int y; 130 int y;
120 int w; 131 int w;
121 int h; 132 int h;
122 int px; 133 int px;
123 int py; 134 int py;
124 int current_mouse_x; 135 int current_mouse_x;
125 int current_mouse_y; 136 int current_mouse_y;
126 unsigned int dragging : 1; 137 unsigned int dragging : 1;
127 } drag; 138 } drag;
128 139
@@ -162,6 +173,8 @@ void *_ecore_win32_dnd_register_drop_window(HWND hwnd,
162 Ecore_Win32_Dnd_DropTarget_Callback callback, void *ptr); 173 Ecore_Win32_Dnd_DropTarget_Callback callback, void *ptr);
163void _ecore_win32_dnd_unregister_drop_window(HWND hwnd, void *drop_target); 174void _ecore_win32_dnd_unregister_drop_window(HWND hwnd, void *drop_target);
164 175
176 Eina_Bool ecore_win32_window_drag(Ecore_Win32_Window *w, int ptx, int pty);
177
165 178
166#ifdef __cplusplus 179#ifdef __cplusplus
167} 180}
diff --git a/src/lib/ecore_win32/ecore_win32_window.c b/src/lib/ecore_win32/ecore_win32_window.c
index 239fe9d4e0..792fcb3d44 100644
--- a/src/lib/ecore_win32/ecore_win32_window.c
+++ b/src/lib/ecore_win32/ecore_win32_window.c
@@ -3,7 +3,6 @@
3#endif 3#endif
4 4
5#include <stdlib.h> 5#include <stdlib.h>
6#include <stdio.h> /* for printf */
7 6
8#define WIN32_LEAN_AND_MEAN 7#define WIN32_LEAN_AND_MEAN
9#include <windows.h> 8#include <windows.h>
@@ -33,7 +32,7 @@ enum _Ecore_Win32_Window_Z_Order
33}; 32};
34 33
35static Ecore_Win32_Window * 34static Ecore_Win32_Window *
36ecore_win32_window_internal_new(Ecore_Win32_Window *parent, 35_ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
37 int x, 36 int x,
38 int y, 37 int y,
39 int width, 38 int width,
@@ -42,9 +41,6 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
42{ 41{
43 RECT rect; 42 RECT rect;
44 Ecore_Win32_Window *w; 43 Ecore_Win32_Window *w;
45 int minimal_width;
46#warning "We need to handle minimal_height for window like we do with width."
47 /* int minimal_height; */
48 44
49 w = (Ecore_Win32_Window *)calloc(1, sizeof(Ecore_Win32_Window)); 45 w = (Ecore_Win32_Window *)calloc(1, sizeof(Ecore_Win32_Window));
50 if (!w) 46 if (!w)
@@ -55,6 +51,19 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
55 51
56 rect.left = 0; 52 rect.left = 0;
57 rect.top = 0; 53 rect.top = 0;
54 rect.right = 0;
55 rect.bottom = 0;
56 if (!AdjustWindowRectEx(&rect, style, FALSE, 0))
57 {
58 ERR("AdjustWindowRect() failed");
59 free(w);
60 return NULL;
61 }
62
63 w->mininal_window_width = GetSystemMetrics(SM_CXMIN) - (rect.right - rect.left);
64
65 rect.left = 0;
66 rect.top = 0;
58 rect.right = width; 67 rect.right = width;
59 rect.bottom = height; 68 rect.bottom = height;
60 if (!AdjustWindowRectEx(&rect, style, FALSE, 0)) 69 if (!AdjustWindowRectEx(&rect, style, FALSE, 0))
@@ -64,19 +73,18 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
64 return NULL; 73 return NULL;
65 } 74 }
66 75
67 minimal_width = GetSystemMetrics(SM_CXMIN); 76 if (width < w->mininal_window_width)
68 /* minimal_height = GetSystemMetrics(SM_CYMIN); */ 77 width = w->mininal_window_width;
69/* if (((rect.right - rect.left) < minimal_width) || */ 78
70/* ((rect.bottom - rect.top) < minimal_height)) */ 79 rect.left = 0;
71/* { */ 80 rect.top = 0;
72/* fprintf (stderr, "[Ecore] [Win32] ERROR !!\n"); */ 81 rect.right = width;
73/* fprintf (stderr, " Wrong size %ld\n", rect.right - rect.left); */ 82 rect.bottom = height;
74/* free(w); */ 83 if (!AdjustWindowRectEx(&rect, style, FALSE, 0))
75/* return NULL; */
76/* } */
77 if ((rect.right - rect.left) < minimal_width)
78 { 84 {
79 rect.right = rect.left + minimal_width; 85 ERR("AdjustWindowRect() failed");
86 free(w);
87 return NULL;
80 } 88 }
81 89
82 w->window = CreateWindowEx(0, 90 w->window = CreateWindowEx(0,
@@ -104,14 +112,15 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
104 return NULL; 112 return NULL;
105 } 113 }
106 114
107 w->min_width = 0; 115 w->pos_hints.flags = 0;
108 w->min_height = 0; 116 w->pos_hints.min_width = w->mininal_window_width;
109 w->max_width = 32767; 117 w->pos_hints.min_height = 0;
110 w->max_height = 32767; 118 w->pos_hints.max_width = 32767;
111 w->base_width = -1; 119 w->pos_hints.max_height = 32767;
112 w->base_height = -1; 120 w->pos_hints.base_width = w->mininal_window_width;
113 w->step_width = 1; 121 w->pos_hints.base_height = 0;
114 w->step_height = 1; 122 w->pos_hints.step_width = 0;
123 w->pos_hints.step_height = 0;
115 124
116 w->state.iconified = 0; 125 w->state.iconified = 0;
117 w->state.modal = 0; 126 w->state.modal = 0;
@@ -158,6 +167,255 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
158 * Global * 167 * Global *
159 *============================================================================*/ 168 *============================================================================*/
160 169
170Eina_Bool
171ecore_win32_window_drag(Ecore_Win32_Window *w, int ptx, int pty)
172{
173 if (w->drag.type == HTCAPTION)
174 {
175 int dx;
176 int dy;
177
178 dx = ptx - w->drag.px;
179 dy = pty - w->drag.py;
180 if ((dx == 0) && (dy == 0))
181 return EINA_TRUE;
182
183 ecore_win32_window_move(w, w->drag.x + dx, w->drag.y + dy);
184 return EINA_TRUE;
185 }
186 if (w->drag.type == HTLEFT)
187 {
188 int dw;
189
190 dw = ptx - w->drag.px;
191
192 if (w->pos_hints.flags & ECORE_WIN32_POS_HINTS_STEP_SIZE)
193 {
194 int new_width;
195
196 new_width = w->pos_hints.base_width + ((w->drag.w - w->pos_hints.base_width - dw) / w->pos_hints.step_width) * w->pos_hints.step_width;
197 if ((new_width != w->drag.w) &&
198 (new_width >= w->pos_hints.base_width) &&
199 (new_width <= w->pos_hints.max_width))
200 ecore_win32_window_move_resize(w, w->drag.x - (new_width - w->drag.w), w->drag.y, new_width, w->drag.h);
201 }
202 else
203 {
204 if (((w->drag.w - dw) >= w->pos_hints.min_width) &&
205 ((w->drag.w - dw) <= w->pos_hints.max_width))
206 ecore_win32_window_move_resize(w, w->drag.x + dw, w->drag.y, w->drag.w - dw, w->drag.h);
207 }
208 return EINA_TRUE;
209 }
210 if (w->drag.type == HTRIGHT)
211 {
212 int dw;
213
214 dw = ptx - w->drag.px;
215
216 if (w->pos_hints.flags & ECORE_WIN32_POS_HINTS_STEP_SIZE)
217 {
218 int new_width;
219
220 new_width = w->pos_hints.base_width + ((w->drag.w - w->pos_hints.base_width + dw) / w->pos_hints.step_width) * w->pos_hints.step_width;
221 if ((new_width != w->drag.w) &&
222 (new_width >= w->pos_hints.base_width) &&
223 (new_width <= w->pos_hints.max_width))
224 ecore_win32_window_resize(w, new_width, w->drag.h);
225 }
226 else
227 {
228 if (((w->drag.w + dw) >= w->pos_hints.min_width) &&
229 ((w->drag.w + dw) <= w->pos_hints.max_width))
230 ecore_win32_window_resize(w, w->drag.w + dw, w->drag.h);
231 }
232 return EINA_TRUE;
233 }
234 if (w->drag.type == HTTOP)
235 {
236 int dh;
237
238 dh = pty - w->drag.py;
239
240 if (w->pos_hints.flags & ECORE_WIN32_POS_HINTS_STEP_SIZE)
241 {
242 int new_height;
243
244 new_height = w->pos_hints.base_height + ((w->drag.h - w->pos_hints.base_height - dh) / w->pos_hints.step_height) * w->pos_hints.step_height;
245 if ((new_height != w->drag.h) &&
246 (new_height >= w->pos_hints.base_height) &&
247 (new_height <= w->pos_hints.max_height))
248 ecore_win32_window_move_resize(w, w->drag.x, w->drag.y - (new_height - w->drag.h), w->drag.w, new_height);
249 }
250 else
251 {
252 if ((dh != 0) &&
253 ((w->drag.h - dh) >= w->pos_hints.min_height) &&
254 ((w->drag.h - dh) <= w->pos_hints.max_height))
255 ecore_win32_window_move_resize(w, w->drag.x, w->drag.y + dh, w->drag.w, w->drag.h - dh);
256 }
257 return EINA_TRUE;
258 }
259 if (w->drag.type == HTBOTTOM)
260 {
261 int dh;
262
263 dh = pty - w->drag.py;
264
265 if (w->pos_hints.flags & ECORE_WIN32_POS_HINTS_STEP_SIZE)
266 {
267 int new_height;
268
269 new_height = w->pos_hints.base_height + ((w->drag.h - w->pos_hints.base_height + dh) / w->pos_hints.step_height) * w->pos_hints.step_height;
270 if ((new_height != w->drag.h) &&
271 (new_height >= w->pos_hints.base_height) &&
272 (new_height <= w->pos_hints.max_height))
273 ecore_win32_window_resize(w, w->drag.w, new_height);
274 }
275 else
276 {
277 if (((w->drag.h + dh) >= w->pos_hints.min_height) &&
278 ((w->drag.h + dh) <= w->pos_hints.max_height))
279 ecore_win32_window_resize(w, w->drag.w, w->drag.h + dh);
280 }
281 return EINA_TRUE;
282 }
283 if (w->drag.type == HTTOPLEFT)
284 {
285 int dh;
286 int dw;
287
288 dw = ptx - w->drag.px;
289 dh = pty - w->drag.py;
290
291 if (w->pos_hints.flags & ECORE_WIN32_POS_HINTS_STEP_SIZE)
292 {
293 int new_width;
294 int new_height;
295
296 new_width = w->pos_hints.base_width + ((w->drag.w - w->pos_hints.base_width - dw) / w->pos_hints.step_width) * w->pos_hints.step_width;
297 new_height = w->pos_hints.base_height + ((w->drag.h - w->pos_hints.base_height - dh) / w->pos_hints.step_height) * w->pos_hints.step_height;
298 if ((new_width != w->drag.w) &&
299 (new_width >= w->pos_hints.base_width) &&
300 (new_width <= w->pos_hints.max_width) &&
301 (new_height != w->drag.h) &&
302 (new_height >= w->pos_hints.base_height) &&
303 (new_height <= w->pos_hints.max_height))
304 ecore_win32_window_move_resize(w, w->drag.x - (new_width - w->drag.w), w->drag.y - (new_height - w->drag.h), new_width, new_height);
305 }
306 else
307 {
308 if (((w->drag.w - dw) >= w->pos_hints.min_width) &&
309 ((w->drag.w - dw) <= w->pos_hints.max_width) &&
310 ((w->drag.h - dh) >= w->pos_hints.min_height) &&
311 ((w->drag.h - dh) <= w->pos_hints.max_height))
312 ecore_win32_window_move_resize(w, w->drag.x + dw, w->drag.y + dh, w->drag.w - dw, w->drag.h - dh);
313 }
314 return EINA_TRUE;
315 }
316 if (w->drag.type == HTTOPRIGHT)
317 {
318 int dh;
319 int dw;
320
321 dw = ptx - w->drag.px;
322 dh = pty - w->drag.py;
323
324 if (w->pos_hints.flags & ECORE_WIN32_POS_HINTS_STEP_SIZE)
325 {
326 int new_width;
327 int new_height;
328
329 new_width = w->pos_hints.base_width + ((w->drag.w - w->pos_hints.base_width + dw) / w->pos_hints.step_width) * w->pos_hints.step_width;
330 new_height = w->pos_hints.base_height + ((w->drag.h - w->pos_hints.base_height - dh) / w->pos_hints.step_height) * w->pos_hints.step_height;
331 if ((new_width != w->drag.w) &&
332 (new_width >= w->pos_hints.base_width) &&
333 (new_width <= w->pos_hints.max_width) &&
334 (new_height != w->drag.h) &&
335 (new_height >= w->pos_hints.base_height) &&
336 (new_height <= w->pos_hints.max_height))
337 ecore_win32_window_move_resize(w, w->drag.x, w->drag.y - (new_height - w->drag.h), new_width, new_height);
338 }
339 else
340 {
341 if (((w->drag.w + dw) >= w->pos_hints.min_width) &&
342 ((w->drag.w + dw) <= w->pos_hints.max_width) &&
343 ((w->drag.h - dh) >= w->pos_hints.min_height) &&
344 ((w->drag.h - dh) <= w->pos_hints.max_height))
345 ecore_win32_window_move_resize(w, w->drag.x, w->drag.y + dh, w->drag.w + dw, w->drag.h - dh);
346 }
347 return EINA_TRUE;
348 }
349 if (w->drag.type == HTBOTTOMLEFT)
350 {
351 int dh;
352 int dw;
353
354 dw = ptx - w->drag.px;
355 dh = pty - w->drag.py;
356
357 if (w->pos_hints.flags & ECORE_WIN32_POS_HINTS_STEP_SIZE)
358 {
359 int new_width;
360 int new_height;
361
362 new_width = w->pos_hints.base_width + ((w->drag.w - w->pos_hints.base_width - dw) / w->pos_hints.step_width) * w->pos_hints.step_width;
363 new_height = w->pos_hints.base_height + ((w->drag.h - w->pos_hints.base_height + dh) / w->pos_hints.step_height) * w->pos_hints.step_height;
364 if ((new_width != w->drag.w) &&
365 (new_width >= w->pos_hints.base_width) &&
366 (new_width <= w->pos_hints.max_width) &&
367 (new_height != w->drag.h) &&
368 (new_height >= w->pos_hints.base_height) &&
369 (new_height <= w->pos_hints.max_height))
370 ecore_win32_window_move_resize(w, w->drag.x - (new_width - w->drag.w), w->drag.y, new_width, new_height);
371 }
372 else
373 {
374 if (((w->drag.w - dw) >= w->pos_hints.min_width) &&
375 ((w->drag.w - dw) <= w->pos_hints.max_width) &&
376 ((w->drag.h + dh) >= w->pos_hints.min_height) &&
377 ((w->drag.h + dh) <= w->pos_hints.max_height))
378 ecore_win32_window_move_resize(w, w->drag.x + dw, w->drag.y, w->drag.w - dw, w->drag.h + dh);
379 }
380 return EINA_TRUE;
381 }
382 if (w->drag.type == HTBOTTOMRIGHT)
383 {
384 int dh;
385 int dw;
386
387 dw = ptx - w->drag.px;
388 dh = pty - w->drag.py;
389
390 if (w->pos_hints.flags & ECORE_WIN32_POS_HINTS_STEP_SIZE)
391 {
392 int new_width;
393 int new_height;
394
395 new_width = w->pos_hints.base_width + ((w->drag.w - w->pos_hints.base_width + dw) / w->pos_hints.step_width) * w->pos_hints.step_width;
396 new_height = w->pos_hints.base_height + ((w->drag.h - w->pos_hints.base_height + dh) / w->pos_hints.step_height) * w->pos_hints.step_height;
397 if ((new_width != w->drag.w) &&
398 (new_width >= w->pos_hints.base_width) &&
399 (new_width <= w->pos_hints.max_width) &&
400 (new_height != w->drag.h) &&
401 (new_height >= w->pos_hints.base_height) &&
402 (new_height <= w->pos_hints.max_height))
403 ecore_win32_window_resize(w, new_width, new_height);
404 }
405 else
406 {
407 if (((w->drag.w + dw) >= w->pos_hints.min_width) &&
408 ((w->drag.w + dw) <= w->pos_hints.max_width) &&
409 ((w->drag.h + dh) >= w->pos_hints.min_height) &&
410 ((w->drag.h + dh) <= w->pos_hints.max_height))
411 ecore_win32_window_resize(w, w->drag.w + dw, w->drag.h + dh);
412 }
413 return EINA_TRUE;
414 }
415
416 return EINA_FALSE;
417}
418
161/*============================================================================* 419/*============================================================================*
162 * API * 420 * API *
163 *============================================================================*/ 421 *============================================================================*/
@@ -194,10 +452,10 @@ ecore_win32_window_new(Ecore_Win32_Window *parent,
194{ 452{
195 INF("creating window with border"); 453 INF("creating window with border");
196 454
197 return ecore_win32_window_internal_new(parent, 455 return _ecore_win32_window_internal_new(parent,
198 x, y, 456 x, y,
199 width, height, 457 width, height,
200 WS_OVERLAPPEDWINDOW | WS_SIZEBOX); 458 WS_OVERLAPPEDWINDOW | WS_SIZEBOX);
201} 459}
202 460
203/** 461/**
@@ -222,10 +480,10 @@ ecore_win32_window_override_new(Ecore_Win32_Window *parent,
222{ 480{
223 INF("creating window without border"); 481 INF("creating window without border");
224 482
225 return ecore_win32_window_internal_new(parent, 483 return _ecore_win32_window_internal_new(parent,
226 x, y, 484 x, y,
227 width, height, 485 width, height,
228 WS_POPUP & ~(WS_CAPTION | WS_THICKFRAME)); 486 WS_POPUP & ~(WS_CAPTION | WS_THICKFRAME));
229} 487}
230 488
231/** 489/**
@@ -354,21 +612,16 @@ ecore_win32_window_resize(Ecore_Win32_Window *window,
354 int width, 612 int width,
355 int height) 613 int height)
356{ 614{
357 RECT rect; 615 RECT rect;
358 DWORD style; 616 DWORD style;
359 int x; 617 int x;
360 int y; 618 int y;
361 int minimal_width;
362 int minimal_height;
363 619
364 /* FIXME: on fullscreen, should not resize it */ 620 /* FIXME: on fullscreen, should not resize it */
365 if (!window) return; 621 if (!window) return;
366 622
367 INF("resizing window (%dx%d)", width, height); 623 INF("resizing window (%dx%d)", width, height);
368 624
369 minimal_width = MAX(GetSystemMetrics(SM_CXMIN), (int)window->min_width);
370 minimal_height = MAX(GetSystemMetrics(SM_CYMIN), (int)window->min_height);
371
372 if (!GetWindowRect(window->window, &rect)) 625 if (!GetWindowRect(window->window, &rect))
373 { 626 {
374 ERR("GetWindowRect() failed"); 627 ERR("GetWindowRect() failed");
@@ -379,10 +632,10 @@ ecore_win32_window_resize(Ecore_Win32_Window *window,
379 y = rect.top; 632 y = rect.top;
380 rect.left = 0; 633 rect.left = 0;
381 rect.top = 0; 634 rect.top = 0;
382 if (width < minimal_width) width = minimal_width; 635 if (width < window->pos_hints.min_width) width = window->pos_hints.min_width;
383 if (width > (int)window->max_width) width = window->max_width; 636 if (width > window->pos_hints.max_width) width = window->pos_hints.max_width;
384 if (height < minimal_height) height = minimal_height; 637 if (height < window->pos_hints.min_height) height = window->pos_hints.min_height;
385 if (height > (int)window->max_height) height = window->max_height; 638 if (height > window->pos_hints.max_height) height = window->pos_hints.max_height;
386 rect.right = width; 639 rect.right = width;
387 rect.bottom = height; 640 rect.bottom = height;
388 if (!(style = GetWindowLong(window->window, GWL_STYLE))) 641 if (!(style = GetWindowLong(window->window, GWL_STYLE)))
@@ -425,25 +678,20 @@ ecore_win32_window_move_resize(Ecore_Win32_Window *window,
425 int width, 678 int width,
426 int height) 679 int height)
427{ 680{
428 RECT rect; 681 RECT rect;
429 DWORD style; 682 DWORD style;
430 int minimal_width;
431 int minimal_height;
432 683
433 /* FIXME: on fullscreen, should not move/resize it */ 684 /* FIXME: on fullscreen, should not move/resize it */
434 if (!window) return; 685 if (!window) return;
435 686
436 INF("moving and resizing window (%dx%d %dx%d)", x, y, width, height); 687 INF("moving and resizing window (%dx%d %dx%d)", x, y, width, height);
437 688
438 minimal_width = MAX(GetSystemMetrics(SM_CXMIN), (int)window->min_width);
439 minimal_height = MAX(GetSystemMetrics(SM_CYMIN), (int)window->min_height);
440
441 rect.left = 0; 689 rect.left = 0;
442 rect.top = 0; 690 rect.top = 0;
443 if (width < minimal_width) width = minimal_width; 691 if (width < window->pos_hints.min_width) width = window->pos_hints.min_width;
444 if (width > (int)window->max_width) width = window->max_width; 692 if (width > window->pos_hints.max_width) width = window->pos_hints.max_width;
445 if (height < minimal_height) height = minimal_height; 693 if (height < window->pos_hints.min_height) height = window->pos_hints.min_height;
446 if (height > (int)window->max_height) height = window->max_height; 694 if (height > window->pos_hints.max_height) height = window->pos_hints.max_height;
447 rect.right = width; 695 rect.right = width;
448 rect.bottom = height; 696 rect.bottom = height;
449 if (!(style = GetWindowLong(window->window, GWL_STYLE))) 697 if (!(style = GetWindowLong(window->window, GWL_STYLE)))
@@ -499,8 +747,8 @@ ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
499 { 747 {
500 if (x) *x = 0; 748 if (x) *x = 0;
501 if (y) *y = 0; 749 if (y) *y = 0;
502 if (width) *width = GetSystemMetrics(SM_CXSCREEN); 750 if (width) *width = 0;
503 if (height) *height = GetSystemMetrics(SM_CYSCREEN); 751 if (height) *height = 0;
504 752
505 return; 753 return;
506 } 754 }
@@ -563,8 +811,8 @@ ecore_win32_window_size_get(Ecore_Win32_Window *window,
563 811
564 if (!window) 812 if (!window)
565 { 813 {
566 if (width) *width = GetSystemMetrics(SM_CXSCREEN); 814 if (width) *width = 0;
567 if (height) *height = GetSystemMetrics(SM_CYSCREEN); 815 if (height) *height = 0;
568 816
569 return; 817 return;
570 } 818 }
@@ -594,14 +842,27 @@ ecore_win32_window_size_get(Ecore_Win32_Window *window,
594 */ 842 */
595EAPI void 843EAPI void
596ecore_win32_window_size_min_set(Ecore_Win32_Window *window, 844ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
597 unsigned int min_width, 845 int min_width,
598 unsigned int min_height) 846 int min_height)
599{ 847{
600 if (!window) return; 848 if (!window) return;
601 849
602 printf ("ecore_win32_window_size_min_set : %p %d %d\n", window, min_width, min_height); 850 INF("setting minimum window size to %dx%d", min_width, min_height);
603 window->min_width = min_width; 851
604 window->min_height = min_height; 852 if ((min_width > 0) && (min_height > 0))
853 {
854 if (min_width < window->mininal_window_width)
855 min_width = window->mininal_window_width;
856
857 window->pos_hints.flags |= ECORE_WIN32_POS_HINTS_MIN_SIZE;
858 window->pos_hints.min_width = min_width;
859 window->pos_hints.min_height = min_height;
860 if (!(window->pos_hints.flags & ECORE_WIN32_POS_HINTS_BASE_SIZE))
861 {
862 window->pos_hints.base_width = min_width;
863 window->pos_hints.base_height = min_height;
864 }
865 }
605} 866}
606 867
607/** 868/**
@@ -617,14 +878,20 @@ ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
617 */ 878 */
618EAPI void 879EAPI void
619ecore_win32_window_size_min_get(Ecore_Win32_Window *window, 880ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
620 unsigned int *min_width, 881 int *min_width,
621 unsigned int *min_height) 882 int *min_height)
622{ 883{
623 if (!window) return; 884 if (!window || !(window->pos_hints.flags & ECORE_WIN32_POS_HINTS_MIN_SIZE))
885 {
886 if (min_width) *min_width = 0;
887 if (min_height) *min_height = 0;
888 return;
889 }
890
891 INF("getting minimum window size: %dx%d", window->pos_hints.min_width, window->pos_hints.min_height);
624 892
625 printf ("ecore_win32_window_size_min_get : %p %d %d\n", window, window->min_width, window->min_height); 893 if (min_width) *min_width = window->pos_hints.min_width;
626 if (min_width) *min_width = window->min_width; 894 if (min_height) *min_height = window->pos_hints.min_height;
627 if (min_height) *min_height = window->min_height;
628} 895}
629 896
630/** 897/**
@@ -640,14 +907,19 @@ ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
640 */ 907 */
641EAPI void 908EAPI void
642ecore_win32_window_size_max_set(Ecore_Win32_Window *window, 909ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
643 unsigned int max_width, 910 int max_width,
644 unsigned int max_height) 911 int max_height)
645{ 912{
646 if (!window) return; 913 if (!window) return;
647 914
648 printf ("ecore_win32_window_size_max_set : %p %d %d\n", window, max_width, max_height); 915 INF("setting maximum window size to %dx%d", max_width, max_height);
649 window->max_width = max_width; 916
650 window->max_height = max_height; 917 if ((max_width > 0) && (max_height > 0))
918 {
919 window->pos_hints.flags |= ECORE_WIN32_POS_HINTS_MAX_SIZE;
920 window->pos_hints.max_width = max_width;
921 window->pos_hints.max_height = max_height;
922 }
651} 923}
652 924
653/** 925/**
@@ -663,14 +935,20 @@ ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
663 */ 935 */
664EAPI void 936EAPI void
665ecore_win32_window_size_max_get(Ecore_Win32_Window *window, 937ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
666 unsigned int *max_width, 938 int *max_width,
667 unsigned int *max_height) 939 int *max_height)
668{ 940{
669 if (!window) return; 941 if (!window || !(window->pos_hints.flags & ECORE_WIN32_POS_HINTS_MAX_SIZE))
942 {
943 if (max_width) *max_width = 0;
944 if (max_height) *max_height = 0;
945 return;
946 }
670 947
671 printf ("ecore_win32_window_size_max_get : %p %d %d\n", window, window->max_width, window->max_height); 948 INF("getting maximum window size: %dx%d", window->pos_hints.max_width, window->pos_hints.max_height);
672 if (max_width) *max_width = window->max_width; 949
673 if (max_height) *max_height = window->max_height; 950 if (max_width) *max_width = window->pos_hints.max_width;
951 if (max_height) *max_height = window->pos_hints.max_height;
674} 952}
675 953
676/** 954/**
@@ -686,14 +964,19 @@ ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
686 */ 964 */
687EAPI void 965EAPI void
688ecore_win32_window_size_base_set(Ecore_Win32_Window *window, 966ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
689 unsigned int base_width, 967 int base_width,
690 unsigned int base_height) 968 int base_height)
691{ 969{
692 printf ("ecore_win32_window_size_base_set : %p %d %d\n", window, base_width, base_height);
693 if (!window) return; 970 if (!window) return;
694 971
695 window->base_width = base_width; 972 INF("setting base window size to %dx%d", base_width, base_height);
696 window->base_height = base_height; 973
974 if ((base_width > 0) && (base_height > 0))
975 {
976 window->pos_hints.flags |= ECORE_WIN32_POS_HINTS_BASE_SIZE;
977 window->pos_hints.base_width = base_width;
978 window->pos_hints.base_height = base_height;
979 }
697} 980}
698 981
699/** 982/**
@@ -709,14 +992,20 @@ ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
709 */ 992 */
710EAPI void 993EAPI void
711ecore_win32_window_size_base_get(Ecore_Win32_Window *window, 994ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
712 unsigned int *base_width, 995 int *base_width,
713 unsigned int *base_height) 996 int *base_height)
714{ 997{
715 if (!window) return; 998 if (!window || !(window->pos_hints.flags & ECORE_WIN32_POS_HINTS_BASE_SIZE))
999 {
1000 if (base_width) *base_width = 0;
1001 if (base_height) *base_height = 0;
1002 return;
1003 }
1004
1005 INF("getting base window size: %dx%d", window->pos_hints.base_width, window->pos_hints.base_height);
716 1006
717 printf ("ecore_win32_window_size_base_get : %p %d %d\n", window, window->base_width, window->base_height); 1007 if (base_width) *base_width = window->pos_hints.base_width;
718 if (base_width) *base_width = window->base_width; 1008 if (base_height) *base_height = window->pos_hints.base_height;
719 if (base_height) *base_height = window->base_height;
720} 1009}
721 1010
722/** 1011/**
@@ -732,14 +1021,19 @@ ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
732 */ 1021 */
733EAPI void 1022EAPI void
734ecore_win32_window_size_step_set(Ecore_Win32_Window *window, 1023ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
735 unsigned int step_width, 1024 int step_width,
736 unsigned int step_height) 1025 int step_height)
737{ 1026{
738 printf ("ecore_win32_window_size_step_set : %p %d %d\n", window, step_width, step_height);
739 if (!window) return; 1027 if (!window) return;
740 1028
741 window->step_width = step_width; 1029 INF("setting step window size to %dx%d", step_width, step_height);
742 window->step_height = step_height; 1030
1031 if ((step_width > 0) && (step_height > 0))
1032 {
1033 window->pos_hints.flags |= ECORE_WIN32_POS_HINTS_STEP_SIZE;
1034 window->pos_hints.step_width = step_width;
1035 window->pos_hints.step_height = step_height;
1036 }
743} 1037}
744 1038
745/** 1039/**
@@ -755,14 +1049,20 @@ ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
755 */ 1049 */
756EAPI void 1050EAPI void
757ecore_win32_window_size_step_get(Ecore_Win32_Window *window, 1051ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
758 unsigned int *step_width, 1052 int *step_width,
759 unsigned int *step_height) 1053 int *step_height)
760{ 1054{
761 if (!window) return; 1055 if (!window || !(window->pos_hints.flags & ECORE_WIN32_POS_HINTS_STEP_SIZE))
1056 {
1057 if (step_width) *step_width = 0;
1058 if (step_height) *step_height = 0;
1059 return;
1060 }
1061
1062 INF("getting step window size: %dx%d", window->pos_hints.step_width, window->pos_hints.step_height);
762 1063
763 printf ("ecore_win32_window_size_step_get : %p %d %d\n", window, window->step_width, window->step_height); 1064 if (step_width) *step_width = window->pos_hints.step_width;
764 if (step_width) *step_width = window->step_width; 1065 if (step_height) *step_height = window->pos_hints.step_height;
765 if (step_height) *step_height = window->step_height;
766} 1066}
767 1067
768/** 1068/**