aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/lib/ecore_win32
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ecore/src/lib/ecore_win32')
-rw-r--r--libraries/ecore/src/lib/ecore_win32/Ecore_Win32.h526
-rw-r--r--libraries/ecore/src/lib/ecore_win32/Makefile.am42
-rw-r--r--libraries/ecore/src/lib/ecore_win32/Makefile.in901
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32.c841
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32_cursor.c306
-rwxr-xr-xlibraries/ecore/src/lib/ecore_win32/ecore_win32_dnd.c221
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_data_object.cpp209
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_data_object.h49
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_drop_source.cpp92
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_drop_source.h36
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_drop_target.cpp232
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_drop_target.h47
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_enumformatetc.cpp157
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_enumformatetc.h50
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32_event.c1295
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32_private.h170
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32_window.c1418
17 files changed, 0 insertions, 6592 deletions
diff --git a/libraries/ecore/src/lib/ecore_win32/Ecore_Win32.h b/libraries/ecore/src/lib/ecore_win32/Ecore_Win32.h
deleted file mode 100644
index 5df3346..0000000
--- a/libraries/ecore/src/lib/ecore_win32/Ecore_Win32.h
+++ /dev/null
@@ -1,526 +0,0 @@
1#ifndef __ECORE_WIN32_H__
2#define __ECORE_WIN32_H__
3
4/*
5 * DO NOT USE THIS HEADER. IT IS WORK IN PROGRESS. IT IS NOT FINAL AND
6 * THE API MAY CHANGE.
7 */
8
9#ifndef ECORE_WIN32_WIP_POZEFLKSD
10# ifdef _MSC_VER
11# pragma message ("You are using a work in progress API. This API is not stable")
12# pragma message ("and is subject to change. You use this at your own risk.")
13# else
14# warning "You are using a work in progress API. This API is not stable"
15# warning "and is subject to change. You use this at your own risk."
16# endif
17#endif
18
19#include <Eina.h>
20
21#ifdef EAPI
22# undef EAPI
23#endif
24
25#ifdef _WIN32
26# ifdef EFL_ECORE_WIN32_BUILD
27# ifdef DLL_EXPORT
28# define EAPI __declspec(dllexport)
29# else
30# define EAPI
31# endif /* ! DLL_EXPORT */
32# else
33# define EAPI __declspec(dllimport)
34# endif /* ! EFL_ECORE_WIN32_BUILD */
35#else
36# ifdef __GNUC__
37# if __GNUC__ >= 4
38# define EAPI __attribute__ ((visibility("default")))
39# else
40# define EAPI
41# endif
42# else
43# define EAPI
44# endif
45#endif /* ! _WIN32 */
46
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52/**
53 * @defgroup Ecore_Win32_Group Ecore_Win32 library
54 *
55 * @{
56 */
57
58/**
59 * @typedef Ecore_Win32_Window_State
60 * State of a window.
61 */
62typedef enum
63{
64 ECORE_WIN32_WINDOW_STATE_ICONIFIED, /**< iconified window */
65 ECORE_WIN32_WINDOW_STATE_MODAL, /**< modal dialog box */
66 ECORE_WIN32_WINDOW_STATE_STICKY, /**< sticky window */
67 ECORE_WIN32_WINDOW_STATE_MAXIMIZED_VERT, /**< maximum vertical sized window */
68 ECORE_WIN32_WINDOW_STATE_MAXIMIZED_HORZ, /**< maximum horizontal sized window */
69 ECORE_WIN32_WINDOW_STATE_MAXIMIZED, /**< maximum sized window */
70 ECORE_WIN32_WINDOW_STATE_SHADED, /**< shaded window */
71 ECORE_WIN32_WINDOW_STATE_HIDDEN, /**< hidden (minimized or iconified) window */
72 ECORE_WIN32_WINDOW_STATE_FULLSCREEN, /**< fullscreen window */
73 ECORE_WIN32_WINDOW_STATE_ABOVE, /**< above window */
74 ECORE_WIN32_WINDOW_STATE_BELOW, /**< below window */
75 ECORE_WIN32_WINDOW_STATE_DEMANDS_ATTENTION, /**< To document */
76 ECORE_WIN32_WINDOW_STATE_UNKNOWN /**< Unknown state */
77} Ecore_Win32_Window_State;
78
79/**
80 * @typedef Ecore_Win32_Window_Type
81 * Type of a window.
82 */
83typedef enum
84{
85 ECORE_WIN32_WINDOW_TYPE_DESKTOP, /**< Desktop feature */
86 ECORE_WIN32_WINDOW_TYPE_DOCK, /**< Dock window (should be on top of other windows) */
87 ECORE_WIN32_WINDOW_TYPE_TOOLBAR, /**< Toolbar window */
88 ECORE_WIN32_WINDOW_TYPE_MENU, /**< Menu window */
89 ECORE_WIN32_WINDOW_TYPE_UTILITY, /**< Small persistent utility window, such as a palette or toolbox */
90 ECORE_WIN32_WINDOW_TYPE_SPLASH, /**< Splash screen window displayed as an application is starting up */
91 ECORE_WIN32_WINDOW_TYPE_DIALOG, /**< Dialog window */
92 ECORE_WIN32_WINDOW_TYPE_NORMAL, /**< Normal top-level window */
93 ECORE_WIN32_WINDOW_TYPE_UNKNOWN /**< Unknown type */
94} Ecore_Win32_Window_Type;
95
96/**
97 * @typedef Ecore_Win32_Cursor_Shape
98 * Shape of a cursor.
99 */
100typedef enum
101{
102 ECORE_WIN32_CURSOR_SHAPE_APP_STARTING, /**< Standard arrow and small hourglass */
103 ECORE_WIN32_CURSOR_SHAPE_ARROW, /**< Standard arrow */
104 ECORE_WIN32_CURSOR_SHAPE_CROSS, /**< Crosshair */
105 ECORE_WIN32_CURSOR_SHAPE_HAND, /**< Hand */
106 ECORE_WIN32_CURSOR_SHAPE_HELP, /**< Arrow and question mark */
107 ECORE_WIN32_CURSOR_SHAPE_I_BEAM, /**< I-beam */
108 ECORE_WIN32_CURSOR_SHAPE_NO, /**< Slashed circle */
109 ECORE_WIN32_CURSOR_SHAPE_SIZE_ALL, /**< Four-pointed arrow pointing north, south, east, and west */
110 ECORE_WIN32_CURSOR_SHAPE_SIZE_NESW, /**< Double-pointed arrow pointing northeast and southwest */
111 ECORE_WIN32_CURSOR_SHAPE_SIZE_NS, /**< Double-pointed arrow pointing north and south */
112 ECORE_WIN32_CURSOR_SHAPE_SIZE_NWSE, /**< Double-pointed arrow pointing northwest and southeast */
113 ECORE_WIN32_CURSOR_SHAPE_SIZE_WE, /**< Double-pointed arrow pointing west and east */
114 ECORE_WIN32_CURSOR_SHAPE_UP_ARROW, /**< Vertical arrow */
115 ECORE_WIN32_CURSOR_SHAPE_WAIT /**< Hourglass */
116} Ecore_Win32_Cursor_Shape;
117
118/**
119 * @typedef Ecore_Win32_DnD_State
120 * State of a DnD operation.
121 */
122typedef enum
123{
124 ECORE_WIN32_DND_EVENT_DRAG_ENTER = 1, /**< Drag enter */
125 ECORE_WIN32_DND_EVENT_DRAG_OVER = 2, /**< Drag over */
126 ECORE_WIN32_DND_EVENT_DRAG_LEAVE = 3, /**< Drag leave */
127 ECORE_WIN32_DND_EVENT_DROP = 4 /**< Drop */
128} Ecore_Win32_DnD_State;
129
130/**
131 * @typedef Ecore_Win32_Window
132 * Abstract type for a window.
133 */
134typedef struct _Ecore_Win32_Window Ecore_Win32_Window;
135
136/**
137 * @typedef Ecore_Win32_Cursor
138 * Abstract type for a cursor.
139 */
140typedef void Ecore_Win32_Cursor;
141
142
143/**
144 * @typedef Ecore_Win32_Event_Mouse_In
145 * Event sent when the mouse enters the window.
146 */
147typedef struct _Ecore_Win32_Event_Mouse_In Ecore_Win32_Event_Mouse_In;
148
149/**
150 * @typedef Ecore_Win32_Event_Mouse_Out
151 * Event sent when the mouse leaves the window.
152 */
153typedef struct _Ecore_Win32_Event_Mouse_Out Ecore_Win32_Event_Mouse_Out;
154
155/**
156 * @typedef Ecore_Win32_Event_Window_Focus_In
157 * Event sent when the window gets the focus.
158 */
159typedef struct _Ecore_Win32_Event_Window_Focus_In Ecore_Win32_Event_Window_Focus_In;
160
161/**
162 * @typedef Ecore_Win32_Event_Window_Focus_Out
163 * Event sent when the window looses the focus.
164 */
165typedef struct _Ecore_Win32_Event_Window_Focus_Out Ecore_Win32_Event_Window_Focus_Out;
166
167/**
168 * @typedef Ecore_Win32_Event_Window_Damage
169 * Event sent when the window is damaged.
170 */
171typedef struct _Ecore_Win32_Event_Window_Damage Ecore_Win32_Event_Window_Damage;
172
173/**
174 * @typedef Ecore_Win32_Event_Window_Create
175 * Event sent when the window is created.
176 */
177typedef struct _Ecore_Win32_Event_Window_Create Ecore_Win32_Event_Window_Create;
178
179/**
180 * @typedef Ecore_Win32_Event_Window_Destroy
181 * Event sent when the window is destroyed.
182 */
183typedef struct _Ecore_Win32_Event_Window_Destroy Ecore_Win32_Event_Window_Destroy;
184
185/**
186 * @typedef Ecore_Win32_Event_Window_Hide
187 * Event sent when the window is hidden.
188 */
189typedef struct _Ecore_Win32_Event_Window_Hide Ecore_Win32_Event_Window_Hide;
190
191/**
192 * @typedef Ecore_Win32_Event_Window_Show
193 * Event sent when the window is shown.
194 */
195typedef struct _Ecore_Win32_Event_Window_Show Ecore_Win32_Event_Window_Show;
196
197/**
198 * @typedef Ecore_Win32_Event_Window_Configure
199 * Event sent when the window is configured.
200 */
201typedef struct _Ecore_Win32_Event_Window_Configure Ecore_Win32_Event_Window_Configure;
202
203/**
204 * @typedef Ecore_Win32_Event_Window_Resize
205 * Event sent when the window is resized.
206 */
207typedef struct _Ecore_Win32_Event_Window_Resize Ecore_Win32_Event_Window_Resize;
208
209/**
210 * @typedef Ecore_Win32_Event_Window_Delete_Request
211 * Event sent when the window is deleted.
212 */
213typedef struct _Ecore_Win32_Event_Window_Delete_Request Ecore_Win32_Event_Window_Delete_Request;
214
215/**
216 * @struct _Ecore_Win32_Event_Mouse_In
217 * Event sent when the mouse enters the window.
218 */
219struct _Ecore_Win32_Event_Mouse_In
220{
221 Ecore_Win32_Window *window; /**< The window that received the event */
222 int x; /**< The x coordinate where the mouse leaved */
223 int y; /**< The y coordinate where the mouse entered */
224 unsigned long timestamp; /**< The time the event occurred */
225};
226
227/**
228 * @struct _Ecore_Win32_Event_Mouse_Out
229 * Event sent when the mouse leaves the window.
230 */
231struct _Ecore_Win32_Event_Mouse_Out
232{
233 Ecore_Win32_Window *window; /**< The window that received the event */
234 int x; /**< The x coordinate where the mouse leaved */
235 int y; /**< The y coordinate where the mouse leaved */
236 unsigned long timestamp; /**< The time the event occurred */
237};
238
239/**
240 * @struct _Ecore_Win32_Event_Window_Focus_In
241 * Event sent when the window gets the focus.
242 */
243struct _Ecore_Win32_Event_Window_Focus_In
244{
245 Ecore_Win32_Window *window; /**< The window that received the event */
246 unsigned long timestamp; /**< The time the event occurred */
247};
248
249/**
250 * @struct _Ecore_Win32_Event_Window_Focus_Out
251 * Event sent when the window looses the focus.
252 */
253struct _Ecore_Win32_Event_Window_Focus_Out
254{
255 Ecore_Win32_Window *window; /**< The window that received the event */
256 unsigned long timestamp; /**< The time the event occurred */
257};
258
259/**
260 * @struct _Ecore_Win32_Event_Window_Damage
261 * Event sent when the window is damaged.
262 */
263struct _Ecore_Win32_Event_Window_Damage
264{
265 Ecore_Win32_Window *window; /**< The window that received the event */
266 int x; /**< The x coordinate of the top left corner of the damaged region */
267 int y; /**< The y coordinate of the top left corner of the damaged region */
268 int width; /**< The width of the damaged region */
269 int height; /**< The time the event occurred */
270 unsigned long timestamp; /**< The time the event occurred */
271};
272
273/**
274 * @struct _Ecore_Win32_Event_Window_Create
275 * Event sent when the window is created.
276 */
277struct _Ecore_Win32_Event_Window_Create
278{
279 Ecore_Win32_Window *window; /**< The window that received the event */
280 unsigned long timestamp; /**< The time the event occurred */
281};
282
283/**
284 * @struct _Ecore_Win32_Event_Window_Destroy
285 * Event sent when the window is destroyed.
286 */
287struct _Ecore_Win32_Event_Window_Destroy
288{
289 Ecore_Win32_Window *window; /**< The window that received the event */
290 unsigned long timestamp; /**< The time the event occurred */
291};
292
293/**
294 * @struct _Ecore_Win32_Event_Window_Hide
295 * Event sent when the window is hidden.
296 */
297struct _Ecore_Win32_Event_Window_Hide
298{
299 Ecore_Win32_Window *window; /**< The window that received the event */
300 unsigned long timestamp; /**< The time the event occurred */
301};
302
303/**
304 * @struct _Ecore_Win32_Event_Window_Show
305 * Event sent when the window is shown.
306 */
307struct _Ecore_Win32_Event_Window_Show
308{
309 Ecore_Win32_Window *window; /**< The window that received the event */
310 unsigned long timestamp; /**< The time the event occurred */
311};
312
313/**
314 * @struct _Ecore_Win32_Event_Window_Configure
315 * Event sent when the window is configured.
316 */
317struct _Ecore_Win32_Event_Window_Configure
318{
319 Ecore_Win32_Window *window; /**< The window that received the event */
320 Ecore_Win32_Window *abovewin;
321 int x; /**< The new x coordinate of the top left corner */
322 int y; /**< The new y coordinate of the top left corner */
323 int width; /**< The new width */
324 int height; /**< The new height */
325 unsigned long timestamp; /**< The time the event occurred */
326};
327
328/**
329 * @struct _Ecore_Win32_Event_Window_Resize
330 * Event sent when the window is resized.
331 */
332struct _Ecore_Win32_Event_Window_Resize
333{
334 Ecore_Win32_Window *window; /**< The window that received the event */
335 int width; /**< The new width */
336 int height; /**< The new height */
337 unsigned long timestamp; /**< The time the event occurred */
338};
339
340/**
341 * @struct _Ecore_Win32_Event_Window_Delete_Request
342 * Event sent when the window is deleted.
343 */
344struct _Ecore_Win32_Event_Window_Delete_Request
345{
346 Ecore_Win32_Window *window; /**< The window that received the event */
347 unsigned long timestamp; /**< The time the event occurred */
348};
349
350/**
351 * @typedef Ecore_Win32_Dnd_DropTarget_Callback
352 * Callback type for Drop operations. See ecore_win32_dnd_register_drop_target().
353 */
354typedef int (*Ecore_Win32_Dnd_DropTarget_Callback)(void *window, int event, int pt_x, int pt_y, void *data, int size);
355
356EAPI extern int ECORE_WIN32_EVENT_MOUSE_IN; /**< Ecore_Event for the #Ecore_Win32_Event_Mouse_In event */
357EAPI extern int ECORE_WIN32_EVENT_MOUSE_OUT; /**< Ecore_Event for the #Ecore_Win32_Event_Mouse_Out event */
358EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_IN; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Focus_In event */
359EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Focus_Out event */
360EAPI extern int ECORE_WIN32_EVENT_WINDOW_DAMAGE; /**< Ecore_Event for the #Ecore_Win32_Event_Damage event */
361EAPI extern int ECORE_WIN32_EVENT_WINDOW_CREATE; /**< Ecore_Event for the #Ecore_Win32_Event_Create event */
362EAPI extern int ECORE_WIN32_EVENT_WINDOW_DESTROY; /**< Ecore_Event for the #Ecore_Win32_Event_Destroy event */
363EAPI extern int ECORE_WIN32_EVENT_WINDOW_HIDE; /**< Ecore_Event for the #Ecore_Win32_Event_Hide event */
364EAPI extern int ECORE_WIN32_EVENT_WINDOW_SHOW; /**< Ecore_Event for the #Ecore_Win32_Event_Show event */
365EAPI extern int ECORE_WIN32_EVENT_WINDOW_CONFIGURE; /**< Ecore_Event for the #Ecore_Win32_Event_Configure event */
366EAPI extern int ECORE_WIN32_EVENT_WINDOW_RESIZE; /**< Ecore_Event for the #Ecore_Win32_Event_Resize event */
367EAPI extern int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Delete_Request event */
368
369
370/* Core */
371
372EAPI int ecore_win32_init();
373EAPI int ecore_win32_shutdown();
374EAPI int ecore_win32_screen_depth_get();
375EAPI void ecore_win32_double_click_time_set(double t);
376EAPI double ecore_win32_double_click_time_get(void);
377EAPI unsigned long ecore_win32_current_time_get(void);
378
379/* Window */
380
381EAPI Ecore_Win32_Window *ecore_win32_window_new(Ecore_Win32_Window *parent,
382 int x,
383 int y,
384 int width,
385 int height);
386EAPI Ecore_Win32_Window *ecore_win32_window_override_new(Ecore_Win32_Window *parent,
387 int x,
388 int y,
389 int width,
390 int height);
391
392EAPI void ecore_win32_window_free(Ecore_Win32_Window *window);
393
394EAPI void *ecore_win32_window_hwnd_get(Ecore_Win32_Window *window);
395
396EAPI void ecore_win32_window_move(Ecore_Win32_Window *window,
397 int x,
398 int y);
399
400EAPI void ecore_win32_window_resize(Ecore_Win32_Window *window,
401 int width,
402 int height);
403
404EAPI void ecore_win32_window_move_resize(Ecore_Win32_Window *window,
405 int x,
406 int y,
407 int width,
408 int height);
409
410EAPI void ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
411 int *x,
412 int *y,
413 int *width,
414 int *height);
415
416EAPI void ecore_win32_window_size_get(Ecore_Win32_Window *window,
417 int *width,
418 int *height);
419
420EAPI void ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
421 unsigned int min_width,
422 unsigned int min_height);
423
424EAPI void ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
425 unsigned int *min_width,
426 unsigned int *min_height);
427
428EAPI void ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
429 unsigned int max_width,
430 unsigned int max_height);
431
432EAPI void ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
433 unsigned int *max_width,
434 unsigned int *max_height);
435
436EAPI void ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
437 unsigned int base_width,
438 unsigned int base_height);
439
440EAPI void ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
441 unsigned int *base_width,
442 unsigned int *base_height);
443
444EAPI void ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
445 unsigned int step_width,
446 unsigned int step_height);
447
448EAPI void ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
449 unsigned int *step_width,
450 unsigned int *step_height);
451
452EAPI void ecore_win32_window_show(Ecore_Win32_Window *window);
453
454EAPI void ecore_win32_window_hide(Ecore_Win32_Window *window);
455
456EAPI void ecore_win32_window_raise(Ecore_Win32_Window *window);
457
458EAPI void ecore_win32_window_lower(Ecore_Win32_Window *window);
459
460EAPI void ecore_win32_window_title_set(Ecore_Win32_Window *window,
461 const char *title);
462
463EAPI void ecore_win32_window_focus(Ecore_Win32_Window *window);
464
465EAPI void *ecore_win32_window_focus_get(void);
466
467EAPI void ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
468 Eina_Bool on);
469
470EAPI void ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
471 Eina_Bool on);
472
473EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
474 Eina_Bool on);
475
476EAPI void ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
477 Ecore_Win32_Cursor *cursor);
478
479EAPI void ecore_win32_window_state_set(Ecore_Win32_Window *window,
480 Ecore_Win32_Window_State *state,
481 unsigned int num);
482
483EAPI void ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
484 Ecore_Win32_Window_State state,
485 unsigned int set);
486
487EAPI void ecore_win32_window_type_set(Ecore_Win32_Window *window,
488 Ecore_Win32_Window_Type type);
489
490/* Cursor */
491
492EAPI Ecore_Win32_Cursor *ecore_win32_cursor_new(const void *pixels_and,
493 const void *pixels_xor,
494 int width,
495 int height,
496 int hot_x,
497 int hot_y);
498
499EAPI void ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor);
500
501EAPI Ecore_Win32_Cursor *ecore_win32_cursor_shaped_new(Ecore_Win32_Cursor_Shape shape);
502
503EAPI void ecore_win32_cursor_size_get(int *width, int *height);
504
505
506
507/* Drag and drop */
508EAPI int ecore_win32_dnd_init();
509EAPI int ecore_win32_dnd_shutdown();
510EAPI Eina_Bool ecore_win32_dnd_begin(const char *data,
511 int size);
512EAPI Eina_Bool ecore_win32_dnd_register_drop_target(Ecore_Win32_Window *window,
513 Ecore_Win32_Dnd_DropTarget_Callback callback);
514EAPI void ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window);
515
516/**
517 * @}
518 */
519
520
521#ifdef __cplusplus
522}
523#endif
524
525
526#endif /* __ECORE_WIN32_H__ */
diff --git a/libraries/ecore/src/lib/ecore_win32/Makefile.am b/libraries/ecore/src/lib/ecore_win32/Makefile.am
deleted file mode 100644
index ce317c7..0000000
--- a/libraries/ecore/src/lib/ecore_win32/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3AM_CPPFLAGS = \
4-I$(top_srcdir)/src/lib/ecore \
5-I$(top_srcdir)/src/lib/ecore_input \
6-I$(top_builddir)/src/lib/ecore \
7-I$(top_builddir)/src/lib/ecore_input \
8@EFL_ECORE_WIN32_BUILD@ \
9@EINA_CFLAGS@ \
10@WIN32_CPPFLAGS@
11
12lib_LTLIBRARIES = libecore_win32.la
13
14includes_HEADERS = Ecore_Win32.h
15includesdir = $(includedir)/ecore-@VMAJ@
16
17libecore_win32_la_SOURCES = \
18ecore_win32.c \
19ecore_win32_cursor.c \
20ecore_win32_dnd.c \
21ecore_win32_dnd_enumformatetc.cpp \
22ecore_win32_dnd_data_object.cpp \
23ecore_win32_dnd_drop_source.cpp \
24ecore_win32_dnd_drop_target.cpp \
25ecore_win32_event.c \
26ecore_win32_window.c
27
28libecore_win32_la_LIBADD = \
29@ecore_win32_libs@ \
30@WIN32_LIBS@ \
31$(top_builddir)/src/lib/ecore/libecore.la \
32$(top_builddir)/src/lib/ecore_input/libecore_input.la \
33@EINA_LIBS@
34
35libecore_win32_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
36
37EXTRA_DIST = \
38ecore_win32_private.h \
39ecore_win32_dnd_enumformatetc.h \
40ecore_win32_dnd_data_object.h \
41ecore_win32_dnd_drop_source.h \
42ecore_win32_dnd_drop_target.h
diff --git a/libraries/ecore/src/lib/ecore_win32/Makefile.in b/libraries/ecore/src/lib/ecore_win32/Makefile.in
deleted file mode 100644
index b512021..0000000
--- a/libraries/ecore/src/lib/ecore_win32/Makefile.in
+++ /dev/null
@@ -1,901 +0,0 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18
19VPATH = @srcdir@
20pkgdatadir = $(datadir)/@PACKAGE@
21pkgincludedir = $(includedir)/@PACKAGE@
22pkglibdir = $(libdir)/@PACKAGE@
23pkglibexecdir = $(libexecdir)/@PACKAGE@
24am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
25install_sh_DATA = $(install_sh) -c -m 644
26install_sh_PROGRAM = $(install_sh) -c
27install_sh_SCRIPT = $(install_sh) -c
28INSTALL_HEADER = $(INSTALL_DATA)
29transform = $(program_transform_name)
30NORMAL_INSTALL = :
31PRE_INSTALL = :
32POST_INSTALL = :
33NORMAL_UNINSTALL = :
34PRE_UNINSTALL = :
35POST_UNINSTALL = :
36build_triplet = @build@
37host_triplet = @host@
38subdir = src/lib/ecore_win32
39DIST_COMMON = $(includes_HEADERS) $(srcdir)/Makefile.am \
40 $(srcdir)/Makefile.in
41ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
42am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \
43 $(top_srcdir)/m4/ac_path_generic.m4 \
44 $(top_srcdir)/m4/check_x_extension.m4 \
45 $(top_srcdir)/m4/ecore_check_module.m4 \
46 $(top_srcdir)/m4/ecore_check_options.m4 \
47 $(top_srcdir)/m4/efl_compiler_flag.m4 \
48 $(top_srcdir)/m4/efl_doxygen.m4 \
49 $(top_srcdir)/m4/efl_examples.m4 \
50 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
51 $(top_srcdir)/m4/efl_threads.m4 $(top_srcdir)/m4/gettext.m4 \
52 $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
53 $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
54 $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
55 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
56 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
57 $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
58 $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac
59am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
60 $(ACLOCAL_M4)
61mkinstalldirs = $(install_sh) -d
62CONFIG_HEADER = $(top_builddir)/config.h
63CONFIG_CLEAN_FILES =
64CONFIG_CLEAN_VPATH_FILES =
65am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
66am__vpath_adj = case $$p in \
67 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
68 *) f=$$p;; \
69 esac;
70am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
71am__install_max = 40
72am__nobase_strip_setup = \
73 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
74am__nobase_strip = \
75 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
76am__nobase_list = $(am__nobase_strip_setup); \
77 for p in $$list; do echo "$$p $$p"; done | \
78 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
79 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
80 if (++n[$$2] == $(am__install_max)) \
81 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
82 END { for (dir in files) print dir, files[dir] }'
83am__base_list = \
84 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
85 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
86am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)"
87LTLIBRARIES = $(lib_LTLIBRARIES)
88libecore_win32_la_DEPENDENCIES = \
89 $(top_builddir)/src/lib/ecore/libecore.la \
90 $(top_builddir)/src/lib/ecore_input/libecore_input.la
91am_libecore_win32_la_OBJECTS = ecore_win32.lo ecore_win32_cursor.lo \
92 ecore_win32_dnd.lo ecore_win32_dnd_enumformatetc.lo \
93 ecore_win32_dnd_data_object.lo ecore_win32_dnd_drop_source.lo \
94 ecore_win32_dnd_drop_target.lo ecore_win32_event.lo \
95 ecore_win32_window.lo
96libecore_win32_la_OBJECTS = $(am_libecore_win32_la_OBJECTS)
97AM_V_lt = $(am__v_lt_$(V))
98am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
99am__v_lt_0 = --silent
100libecore_win32_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
101 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
102 $(AM_CXXFLAGS) $(CXXFLAGS) $(libecore_win32_la_LDFLAGS) \
103 $(LDFLAGS) -o $@
104DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
105depcomp = $(SHELL) $(top_srcdir)/depcomp
106am__depfiles_maybe = depfiles
107am__mv = mv -f
108COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
109 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
110LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
111 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
112 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
113 $(AM_CFLAGS) $(CFLAGS)
114AM_V_CC = $(am__v_CC_$(V))
115am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
116am__v_CC_0 = @echo " CC " $@;
117AM_V_at = $(am__v_at_$(V))
118am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
119am__v_at_0 = @
120CCLD = $(CC)
121LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
122 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
123 $(AM_LDFLAGS) $(LDFLAGS) -o $@
124AM_V_CCLD = $(am__v_CCLD_$(V))
125am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
126am__v_CCLD_0 = @echo " CCLD " $@;
127CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
128 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
129LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
130 $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
131 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
132 $(AM_CXXFLAGS) $(CXXFLAGS)
133AM_V_CXX = $(am__v_CXX_$(V))
134am__v_CXX_ = $(am__v_CXX_$(AM_DEFAULT_VERBOSITY))
135am__v_CXX_0 = @echo " CXX " $@;
136CXXLD = $(CXX)
137CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
138 $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
139 $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
140AM_V_CXXLD = $(am__v_CXXLD_$(V))
141am__v_CXXLD_ = $(am__v_CXXLD_$(AM_DEFAULT_VERBOSITY))
142am__v_CXXLD_0 = @echo " CXXLD " $@;
143AM_V_GEN = $(am__v_GEN_$(V))
144am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
145am__v_GEN_0 = @echo " GEN " $@;
146SOURCES = $(libecore_win32_la_SOURCES)
147DIST_SOURCES = $(libecore_win32_la_SOURCES)
148HEADERS = $(includes_HEADERS)
149ETAGS = etags
150CTAGS = ctags
151DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
152ACLOCAL = @ACLOCAL@
153ALLOCA = @ALLOCA@
154AMTAR = @AMTAR@
155AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
156AR = @AR@
157AS = @AS@
158AUTOCONF = @AUTOCONF@
159AUTOHEADER = @AUTOHEADER@
160AUTOMAKE = @AUTOMAKE@
161AWK = @AWK@
162CARES_CFLAGS = @CARES_CFLAGS@
163CARES_LIBS = @CARES_LIBS@
164CC = @CC@
165CCDEPMODE = @CCDEPMODE@
166CFLAGS = @CFLAGS@
167CHECK_CFLAGS = @CHECK_CFLAGS@
168CHECK_LIBS = @CHECK_LIBS@
169CPP = @CPP@
170CPPFLAGS = @CPPFLAGS@
171CURL_CFLAGS = @CURL_CFLAGS@
172CURL_LIBS = @CURL_LIBS@
173CXX = @CXX@
174CXXCPP = @CXXCPP@
175CXXDEPMODE = @CXXDEPMODE@
176CXXFLAGS = @CXXFLAGS@
177CYGPATH_W = @CYGPATH_W@
178DEFS = @DEFS@
179DEPDIR = @DEPDIR@
180DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
181DIRECTFB_LIBS = @DIRECTFB_LIBS@
182DLLTOOL = @DLLTOOL@
183DSYMUTIL = @DSYMUTIL@
184DUMPBIN = @DUMPBIN@
185ECHO_C = @ECHO_C@
186ECHO_N = @ECHO_N@
187ECHO_T = @ECHO_T@
188ECORE_XCB_CFLAGS = @ECORE_XCB_CFLAGS@
189ECORE_XCB_LIBS = @ECORE_XCB_LIBS@
190EFL_ECORE_BUILD = @EFL_ECORE_BUILD@
191EFL_ECORE_CON_BUILD = @EFL_ECORE_CON_BUILD@
192EFL_ECORE_EVAS_BUILD = @EFL_ECORE_EVAS_BUILD@
193EFL_ECORE_FILE_BUILD = @EFL_ECORE_FILE_BUILD@
194EFL_ECORE_IMF_BUILD = @EFL_ECORE_IMF_BUILD@
195EFL_ECORE_IMF_EVAS_BUILD = @EFL_ECORE_IMF_EVAS_BUILD@
196EFL_ECORE_INPUT_BUILD = @EFL_ECORE_INPUT_BUILD@
197EFL_ECORE_INPUT_EVAS_BUILD = @EFL_ECORE_INPUT_EVAS_BUILD@
198EFL_ECORE_IPC_BUILD = @EFL_ECORE_IPC_BUILD@
199EFL_ECORE_PSL1GHT_BUILD = @EFL_ECORE_PSL1GHT_BUILD@
200EFL_ECORE_SDL_BUILD = @EFL_ECORE_SDL_BUILD@
201EFL_ECORE_WIN32_BUILD = @EFL_ECORE_WIN32_BUILD@
202EFL_ECORE_WINCE_BUILD = @EFL_ECORE_WINCE_BUILD@
203EFL_PTHREAD_CFLAGS = @EFL_PTHREAD_CFLAGS@
204EFL_PTHREAD_LIBS = @EFL_PTHREAD_LIBS@
205EGREP = @EGREP@
206EINA_CFLAGS = @EINA_CFLAGS@
207EINA_LIBS = @EINA_LIBS@
208ESCAPE_CFLAGS = @ESCAPE_CFLAGS@
209ESCAPE_LIBS = @ESCAPE_LIBS@
210EVAS_CFLAGS = @EVAS_CFLAGS@
211EVAS_LIBS = @EVAS_LIBS@
212EVIL_CFLAGS = @EVIL_CFLAGS@
213EVIL_LIBS = @EVIL_LIBS@
214EXEEXT = @EXEEXT@
215EXOTIC_CFLAGS = @EXOTIC_CFLAGS@
216EXOTIC_LIBS = @EXOTIC_LIBS@
217FGREP = @FGREP@
218GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
219GLIB_CFLAGS = @GLIB_CFLAGS@
220GLIB_LIBS = @GLIB_LIBS@
221GMSGFMT = @GMSGFMT@
222GMSGFMT_015 = @GMSGFMT_015@
223GREP = @GREP@
224INSTALL = @INSTALL@
225INSTALL_DATA = @INSTALL_DATA@
226INSTALL_PROGRAM = @INSTALL_PROGRAM@
227INSTALL_SCRIPT = @INSTALL_SCRIPT@
228INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
229INTLLIBS = @INTLLIBS@
230INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
231KEYSYMDEFS = @KEYSYMDEFS@
232LD = @LD@
233LDFLAGS = @LDFLAGS@
234LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
235LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
236LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
237LIBICONV = @LIBICONV@
238LIBINTL = @LIBINTL@
239LIBOBJS = @LIBOBJS@
240LIBS = @LIBS@
241LIBTOOL = @LIBTOOL@
242LIPO = @LIPO@
243LN_S = @LN_S@
244LTLIBICONV = @LTLIBICONV@
245LTLIBINTL = @LTLIBINTL@
246LTLIBOBJS = @LTLIBOBJS@
247MAKEINFO = @MAKEINFO@
248MKDIR_P = @MKDIR_P@
249MSGFMT = @MSGFMT@
250MSGFMT_015 = @MSGFMT_015@
251MSGMERGE = @MSGMERGE@
252NM = @NM@
253NMEDIT = @NMEDIT@
254OBJC = @OBJC@
255OBJCDEPMODE = @OBJCDEPMODE@
256OBJCFLAGS = @OBJCFLAGS@
257OBJDUMP = @OBJDUMP@
258OBJEXT = @OBJEXT@
259OTOOL = @OTOOL@
260OTOOL64 = @OTOOL64@
261PACKAGE = @PACKAGE@
262PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
263PACKAGE_NAME = @PACKAGE_NAME@
264PACKAGE_STRING = @PACKAGE_STRING@
265PACKAGE_TARNAME = @PACKAGE_TARNAME@
266PACKAGE_URL = @PACKAGE_URL@
267PACKAGE_VERSION = @PACKAGE_VERSION@
268PATH_SEPARATOR = @PATH_SEPARATOR@
269PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
270PIXMAN_LIBS = @PIXMAN_LIBS@
271PKG_CONFIG = @PKG_CONFIG@
272PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
273PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
274POSUB = @POSUB@
275RANLIB = @RANLIB@
276SCIM_CFLAGS = @SCIM_CFLAGS@
277SCIM_LIBS = @SCIM_LIBS@
278SDL_CFLAGS = @SDL_CFLAGS@
279SDL_CONFIG = @SDL_CONFIG@
280SDL_LIBS = @SDL_LIBS@
281SED = @SED@
282SET_MAKE = @SET_MAKE@
283SHELL = @SHELL@
284SHM_OPEN_LIBS = @SHM_OPEN_LIBS@
285SSL_CFLAGS = @SSL_CFLAGS@
286SSL_LIBS = @SSL_LIBS@
287STRIP = @STRIP@
288TLS2_CFLAGS = @TLS2_CFLAGS@
289TLS2_LIBS = @TLS2_LIBS@
290TLS_CFLAGS = @TLS_CFLAGS@
291TLS_LIBS = @TLS_LIBS@
292TSLIB_CFLAGS = @TSLIB_CFLAGS@
293TSLIB_LIBS = @TSLIB_LIBS@
294USE_NLS = @USE_NLS@
295VERSION = @VERSION@
296VMAJ = @VMAJ@
297WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
298WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
299WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
300WAYLAND_LIBS = @WAYLAND_LIBS@
301WIN32_CFLAGS = @WIN32_CFLAGS@
302WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
303WIN32_LIBS = @WIN32_LIBS@
304XCB_COMPOSITE_CFLAGS = @XCB_COMPOSITE_CFLAGS@
305XCB_COMPOSITE_LIBS = @XCB_COMPOSITE_LIBS@
306XCB_CURSOR_CFLAGS = @XCB_CURSOR_CFLAGS@
307XCB_CURSOR_LIBS = @XCB_CURSOR_LIBS@
308XCB_DAMAGE_CFLAGS = @XCB_DAMAGE_CFLAGS@
309XCB_DAMAGE_LIBS = @XCB_DAMAGE_LIBS@
310XCB_DPMS_CFLAGS = @XCB_DPMS_CFLAGS@
311XCB_DPMS_LIBS = @XCB_DPMS_LIBS@
312XCB_RANDR_CFLAGS = @XCB_RANDR_CFLAGS@
313XCB_RANDR_LIBS = @XCB_RANDR_LIBS@
314XCB_RENDER_CFLAGS = @XCB_RENDER_CFLAGS@
315XCB_RENDER_LIBS = @XCB_RENDER_LIBS@
316XCB_SCREENSAVER_CFLAGS = @XCB_SCREENSAVER_CFLAGS@
317XCB_SCREENSAVER_LIBS = @XCB_SCREENSAVER_LIBS@
318XCB_SHAPE_CFLAGS = @XCB_SHAPE_CFLAGS@
319XCB_SHAPE_LIBS = @XCB_SHAPE_LIBS@
320XCB_SYNC_CFLAGS = @XCB_SYNC_CFLAGS@
321XCB_SYNC_LIBS = @XCB_SYNC_LIBS@
322XCB_X11_CFLAGS = @XCB_X11_CFLAGS@
323XCB_X11_LIBS = @XCB_X11_LIBS@
324XCB_XFIXES_CFLAGS = @XCB_XFIXES_CFLAGS@
325XCB_XFIXES_LIBS = @XCB_XFIXES_LIBS@
326XCB_XGESTURE_CFLAGS = @XCB_XGESTURE_CFLAGS@
327XCB_XGESTURE_LIBS = @XCB_XGESTURE_LIBS@
328XCB_XINERAMA_CFLAGS = @XCB_XINERAMA_CFLAGS@
329XCB_XINERAMA_LIBS = @XCB_XINERAMA_LIBS@
330XCB_XINPUT_CFLAGS = @XCB_XINPUT_CFLAGS@
331XCB_XINPUT_LIBS = @XCB_XINPUT_LIBS@
332XCB_XPRINT_CFLAGS = @XCB_XPRINT_CFLAGS@
333XCB_XPRINT_LIBS = @XCB_XPRINT_LIBS@
334XCB_XTEST_CFLAGS = @XCB_XTEST_CFLAGS@
335XCB_XTEST_LIBS = @XCB_XTEST_LIBS@
336XCOMPOSITE_CFLAGS = @XCOMPOSITE_CFLAGS@
337XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@
338XDAMAGE_CFLAGS = @XDAMAGE_CFLAGS@
339XDAMAGE_LIBS = @XDAMAGE_LIBS@
340XDPMS_CFLAGS = @XDPMS_CFLAGS@
341XDPMS_LIBS = @XDPMS_LIBS@
342XFIXES_CFLAGS = @XFIXES_CFLAGS@
343XFIXES_LIBS = @XFIXES_LIBS@
344XGESTURE_CFLAGS = @XGESTURE_CFLAGS@
345XGESTURE_LIBS = @XGESTURE_LIBS@
346XGETTEXT = @XGETTEXT@
347XGETTEXT_015 = @XGETTEXT_015@
348XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
349XI2_CFLAGS = @XI2_CFLAGS@
350XI2_LIBS = @XI2_LIBS@
351XINERAMA_CFLAGS = @XINERAMA_CFLAGS@
352XINERAMA_LIBS = @XINERAMA_LIBS@
353XKB_CFLAGS = @XKB_CFLAGS@
354XKB_LIBS = @XKB_LIBS@
355XMKMF = @XMKMF@
356XPRINT_CFLAGS = @XPRINT_CFLAGS@
357XPRINT_LIBS = @XPRINT_LIBS@
358XRANDR_CFLAGS = @XRANDR_CFLAGS@
359XRANDR_LIBS = @XRANDR_LIBS@
360XRENDER_CFLAGS = @XRENDER_CFLAGS@
361XRENDER_LIBS = @XRENDER_LIBS@
362XSS_CFLAGS = @XSS_CFLAGS@
363XSS_LIBS = @XSS_LIBS@
364XTEST_CFLAGS = @XTEST_CFLAGS@
365XTEST_LIBS = @XTEST_LIBS@
366X_CFLAGS = @X_CFLAGS@
367X_EXTRA_LIBS = @X_EXTRA_LIBS@
368X_LIBS = @X_LIBS@
369X_PRE_LIBS = @X_PRE_LIBS@
370Xcursor_cflags = @Xcursor_cflags@
371Xcursor_libs = @Xcursor_libs@
372abs_builddir = @abs_builddir@
373abs_srcdir = @abs_srcdir@
374abs_top_builddir = @abs_top_builddir@
375abs_top_srcdir = @abs_top_srcdir@
376ac_ct_CC = @ac_ct_CC@
377ac_ct_CXX = @ac_ct_CXX@
378ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
379ac_ct_OBJC = @ac_ct_OBJC@
380am__include = @am__include@
381am__leading_dot = @am__leading_dot@
382am__quote = @am__quote@
383am__tar = @am__tar@
384am__untar = @am__untar@
385bindir = @bindir@
386build = @build@
387build_alias = @build_alias@
388build_cpu = @build_cpu@
389build_os = @build_os@
390build_vendor = @build_vendor@
391builddir = @builddir@
392cocoa_ldflags = @cocoa_ldflags@
393datadir = @datadir@
394datarootdir = @datarootdir@
395dlopen_libs = @dlopen_libs@
396docdir = @docdir@
397dvidir = @dvidir@
398ecore_cocoa_cflags = @ecore_cocoa_cflags@
399ecore_cocoa_libs = @ecore_cocoa_libs@
400ecore_con_cflags = @ecore_con_cflags@
401ecore_con_libs = @ecore_con_libs@
402ecore_directfb_cflags = @ecore_directfb_cflags@
403ecore_directfb_libs = @ecore_directfb_libs@
404ecore_evas_cflags = @ecore_evas_cflags@
405ecore_evas_libs = @ecore_evas_libs@
406ecore_fb_cflags = @ecore_fb_cflags@
407ecore_fb_libs = @ecore_fb_libs@
408ecore_file_cflags = @ecore_file_cflags@
409ecore_file_libs = @ecore_file_libs@
410ecore_imf_cflags = @ecore_imf_cflags@
411ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
412ecore_imf_evas_libs = @ecore_imf_evas_libs@
413ecore_imf_libs = @ecore_imf_libs@
414ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
415ecore_imf_scim_libs = @ecore_imf_scim_libs@
416ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
417ecore_imf_xim_libs = @ecore_imf_xim_libs@
418ecore_input_cflags = @ecore_input_cflags@
419ecore_input_evas_cflags = @ecore_input_evas_cflags@
420ecore_input_evas_libs = @ecore_input_evas_libs@
421ecore_input_libs = @ecore_input_libs@
422ecore_ipc_cflags = @ecore_ipc_cflags@
423ecore_ipc_libs = @ecore_ipc_libs@
424ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
425ecore_psl1ght_libs = @ecore_psl1ght_libs@
426ecore_sdl_cflags = @ecore_sdl_cflags@
427ecore_sdl_libs = @ecore_sdl_libs@
428ecore_wayland_cflags = @ecore_wayland_cflags@
429ecore_wayland_libs = @ecore_wayland_libs@
430ecore_win32_cflags = @ecore_win32_cflags@
431ecore_win32_libs = @ecore_win32_libs@
432ecore_wince_cflags = @ecore_wince_cflags@
433ecore_wince_libs = @ecore_wince_libs@
434ecore_x_cflags = @ecore_x_cflags@
435ecore_x_libs = @ecore_x_libs@
436ecore_x_libs_private = @ecore_x_libs_private@
437efl_doxygen = @efl_doxygen@
438efl_have_doxygen = @efl_have_doxygen@
439exec_prefix = @exec_prefix@
440have_ecore_x_xcb_define = @have_ecore_x_xcb_define@
441host = @host@
442host_alias = @host_alias@
443host_cpu = @host_cpu@
444host_os = @host_os@
445host_vendor = @host_vendor@
446htmldir = @htmldir@
447includedir = @includedir@
448infodir = @infodir@
449install_sh = @install_sh@
450libdir = @libdir@
451libexecdir = @libexecdir@
452localedir = @localedir@
453localstatedir = @localstatedir@
454lt_ECHO = @lt_ECHO@
455lt_enable_auto_import = @lt_enable_auto_import@
456mandir = @mandir@
457mkdir_p = @mkdir_p@
458oldincludedir = @oldincludedir@
459pdfdir = @pdfdir@
460pkgconfig_requires_private = @pkgconfig_requires_private@
461prefix = @prefix@
462program_transform_name = @program_transform_name@
463psdir = @psdir@
464release_info = @release_info@
465requirements_ecore = @requirements_ecore@
466requirements_ecore_cocoa = @requirements_ecore_cocoa@
467requirements_ecore_con = @requirements_ecore_con@
468requirements_ecore_directfb = @requirements_ecore_directfb@
469requirements_ecore_evas = @requirements_ecore_evas@
470requirements_ecore_fb = @requirements_ecore_fb@
471requirements_ecore_file = @requirements_ecore_file@
472requirements_ecore_imf = @requirements_ecore_imf@
473requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
474requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
475requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
476requirements_ecore_input = @requirements_ecore_input@
477requirements_ecore_input_evas = @requirements_ecore_input_evas@
478requirements_ecore_ipc = @requirements_ecore_ipc@
479requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
480requirements_ecore_sdl = @requirements_ecore_sdl@
481requirements_ecore_wayland = @requirements_ecore_wayland@
482requirements_ecore_win32 = @requirements_ecore_win32@
483requirements_ecore_wince = @requirements_ecore_wince@
484requirements_ecore_x = @requirements_ecore_x@
485rt_libs = @rt_libs@
486sbindir = @sbindir@
487sharedstatedir = @sharedstatedir@
488srcdir = @srcdir@
489sysconfdir = @sysconfdir@
490target_alias = @target_alias@
491top_build_prefix = @top_build_prefix@
492top_builddir = @top_builddir@
493top_srcdir = @top_srcdir@
494version_info = @version_info@
495x_cflags = @x_cflags@
496x_includes = @x_includes@
497x_libs = @x_libs@
498MAINTAINERCLEANFILES = Makefile.in
499AM_CPPFLAGS = \
500-I$(top_srcdir)/src/lib/ecore \
501-I$(top_srcdir)/src/lib/ecore_input \
502-I$(top_builddir)/src/lib/ecore \
503-I$(top_builddir)/src/lib/ecore_input \
504@EFL_ECORE_WIN32_BUILD@ \
505@EINA_CFLAGS@ \
506@WIN32_CPPFLAGS@
507
508lib_LTLIBRARIES = libecore_win32.la
509includes_HEADERS = Ecore_Win32.h
510includesdir = $(includedir)/ecore-@VMAJ@
511libecore_win32_la_SOURCES = \
512ecore_win32.c \
513ecore_win32_cursor.c \
514ecore_win32_dnd.c \
515ecore_win32_dnd_enumformatetc.cpp \
516ecore_win32_dnd_data_object.cpp \
517ecore_win32_dnd_drop_source.cpp \
518ecore_win32_dnd_drop_target.cpp \
519ecore_win32_event.c \
520ecore_win32_window.c
521
522libecore_win32_la_LIBADD = \
523@ecore_win32_libs@ \
524@WIN32_LIBS@ \
525$(top_builddir)/src/lib/ecore/libecore.la \
526$(top_builddir)/src/lib/ecore_input/libecore_input.la \
527@EINA_LIBS@
528
529libecore_win32_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
530EXTRA_DIST = \
531ecore_win32_private.h \
532ecore_win32_dnd_enumformatetc.h \
533ecore_win32_dnd_data_object.h \
534ecore_win32_dnd_drop_source.h \
535ecore_win32_dnd_drop_target.h
536
537all: all-am
538
539.SUFFIXES:
540.SUFFIXES: .c .cpp .lo .o .obj
541$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
542 @for dep in $?; do \
543 case '$(am__configure_deps)' in \
544 *$$dep*) \
545 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
546 && { if test -f $@; then exit 0; else break; fi; }; \
547 exit 1;; \
548 esac; \
549 done; \
550 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/ecore_win32/Makefile'; \
551 $(am__cd) $(top_srcdir) && \
552 $(AUTOMAKE) --gnu src/lib/ecore_win32/Makefile
553.PRECIOUS: Makefile
554Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
555 @case '$?' in \
556 *config.status*) \
557 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
558 *) \
559 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
560 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
561 esac;
562
563$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
564 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
565
566$(top_srcdir)/configure: $(am__configure_deps)
567 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
568$(ACLOCAL_M4): $(am__aclocal_m4_deps)
569 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
570$(am__aclocal_m4_deps):
571install-libLTLIBRARIES: $(lib_LTLIBRARIES)
572 @$(NORMAL_INSTALL)
573 test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
574 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
575 list2=; for p in $$list; do \
576 if test -f $$p; then \
577 list2="$$list2 $$p"; \
578 else :; fi; \
579 done; \
580 test -z "$$list2" || { \
581 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
582 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
583 }
584
585uninstall-libLTLIBRARIES:
586 @$(NORMAL_UNINSTALL)
587 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
588 for p in $$list; do \
589 $(am__strip_dir) \
590 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
591 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
592 done
593
594clean-libLTLIBRARIES:
595 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
596 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
597 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
598 test "$$dir" != "$$p" || dir=.; \
599 echo "rm -f \"$${dir}/so_locations\""; \
600 rm -f "$${dir}/so_locations"; \
601 done
602libecore_win32.la: $(libecore_win32_la_OBJECTS) $(libecore_win32_la_DEPENDENCIES)
603 $(AM_V_CXXLD)$(libecore_win32_la_LINK) -rpath $(libdir) $(libecore_win32_la_OBJECTS) $(libecore_win32_la_LIBADD) $(LIBS)
604
605mostlyclean-compile:
606 -rm -f *.$(OBJEXT)
607
608distclean-compile:
609 -rm -f *.tab.c
610
611@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_win32.Plo@am__quote@
612@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_win32_cursor.Plo@am__quote@
613@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_win32_dnd.Plo@am__quote@
614@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_win32_dnd_data_object.Plo@am__quote@
615@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_win32_dnd_drop_source.Plo@am__quote@
616@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_win32_dnd_drop_target.Plo@am__quote@
617@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_win32_dnd_enumformatetc.Plo@am__quote@
618@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_win32_event.Plo@am__quote@
619@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_win32_window.Plo@am__quote@
620
621.c.o:
622@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
623@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
624@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
625@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
626@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
627@am__fastdepCC_FALSE@ $(COMPILE) -c $<
628
629.c.obj:
630@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
631@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
632@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
633@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
634@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
635@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
636
637.c.lo:
638@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
639@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
640@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
641@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
642@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
643@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
644
645.cpp.o:
646@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
647@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
648@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
649@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
650@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
651@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
652
653.cpp.obj:
654@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
655@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
656@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
657@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
658@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
659@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
660
661.cpp.lo:
662@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
663@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
664@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
665@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
666@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
667@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
668
669mostlyclean-libtool:
670 -rm -f *.lo
671
672clean-libtool:
673 -rm -rf .libs _libs
674install-includesHEADERS: $(includes_HEADERS)
675 @$(NORMAL_INSTALL)
676 test -z "$(includesdir)" || $(MKDIR_P) "$(DESTDIR)$(includesdir)"
677 @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \
678 for p in $$list; do \
679 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
680 echo "$$d$$p"; \
681 done | $(am__base_list) | \
682 while read files; do \
683 echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includesdir)'"; \
684 $(INSTALL_HEADER) $$files "$(DESTDIR)$(includesdir)" || exit $$?; \
685 done
686
687uninstall-includesHEADERS:
688 @$(NORMAL_UNINSTALL)
689 @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \
690 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
691 test -n "$$files" || exit 0; \
692 echo " ( cd '$(DESTDIR)$(includesdir)' && rm -f" $$files ")"; \
693 cd "$(DESTDIR)$(includesdir)" && rm -f $$files
694
695ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
696 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
697 unique=`for i in $$list; do \
698 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
699 done | \
700 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
701 END { if (nonempty) { for (i in files) print i; }; }'`; \
702 mkid -fID $$unique
703tags: TAGS
704
705TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
706 $(TAGS_FILES) $(LISP)
707 set x; \
708 here=`pwd`; \
709 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
710 unique=`for i in $$list; do \
711 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
712 done | \
713 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
714 END { if (nonempty) { for (i in files) print i; }; }'`; \
715 shift; \
716 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
717 test -n "$$unique" || unique=$$empty_fix; \
718 if test $$# -gt 0; then \
719 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
720 "$$@" $$unique; \
721 else \
722 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
723 $$unique; \
724 fi; \
725 fi
726ctags: CTAGS
727CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
728 $(TAGS_FILES) $(LISP)
729 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
730 unique=`for i in $$list; do \
731 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
732 done | \
733 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
734 END { if (nonempty) { for (i in files) print i; }; }'`; \
735 test -z "$(CTAGS_ARGS)$$unique" \
736 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
737 $$unique
738
739GTAGS:
740 here=`$(am__cd) $(top_builddir) && pwd` \
741 && $(am__cd) $(top_srcdir) \
742 && gtags -i $(GTAGS_ARGS) "$$here"
743
744distclean-tags:
745 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
746
747distdir: $(DISTFILES)
748 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
749 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
750 list='$(DISTFILES)'; \
751 dist_files=`for file in $$list; do echo $$file; done | \
752 sed -e "s|^$$srcdirstrip/||;t" \
753 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
754 case $$dist_files in \
755 */*) $(MKDIR_P) `echo "$$dist_files" | \
756 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
757 sort -u` ;; \
758 esac; \
759 for file in $$dist_files; do \
760 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
761 if test -d $$d/$$file; then \
762 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
763 if test -d "$(distdir)/$$file"; then \
764 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
765 fi; \
766 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
767 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
768 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
769 fi; \
770 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
771 else \
772 test -f "$(distdir)/$$file" \
773 || cp -p $$d/$$file "$(distdir)/$$file" \
774 || exit 1; \
775 fi; \
776 done
777check-am: all-am
778check: check-am
779all-am: Makefile $(LTLIBRARIES) $(HEADERS)
780installdirs:
781 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)"; do \
782 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
783 done
784install: install-am
785install-exec: install-exec-am
786install-data: install-data-am
787uninstall: uninstall-am
788
789install-am: all-am
790 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
791
792installcheck: installcheck-am
793install-strip:
794 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
795 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
796 `test -z '$(STRIP)' || \
797 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
798mostlyclean-generic:
799
800clean-generic:
801
802distclean-generic:
803 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
804 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
805
806maintainer-clean-generic:
807 @echo "This command is intended for maintainers to use"
808 @echo "it deletes files that may require special tools to rebuild."
809 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
810clean: clean-am
811
812clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
813 mostlyclean-am
814
815distclean: distclean-am
816 -rm -rf ./$(DEPDIR)
817 -rm -f Makefile
818distclean-am: clean-am distclean-compile distclean-generic \
819 distclean-tags
820
821dvi: dvi-am
822
823dvi-am:
824
825html: html-am
826
827html-am:
828
829info: info-am
830
831info-am:
832
833install-data-am: install-includesHEADERS
834
835install-dvi: install-dvi-am
836
837install-dvi-am:
838
839install-exec-am: install-libLTLIBRARIES
840
841install-html: install-html-am
842
843install-html-am:
844
845install-info: install-info-am
846
847install-info-am:
848
849install-man:
850
851install-pdf: install-pdf-am
852
853install-pdf-am:
854
855install-ps: install-ps-am
856
857install-ps-am:
858
859installcheck-am:
860
861maintainer-clean: maintainer-clean-am
862 -rm -rf ./$(DEPDIR)
863 -rm -f Makefile
864maintainer-clean-am: distclean-am maintainer-clean-generic
865
866mostlyclean: mostlyclean-am
867
868mostlyclean-am: mostlyclean-compile mostlyclean-generic \
869 mostlyclean-libtool
870
871pdf: pdf-am
872
873pdf-am:
874
875ps: ps-am
876
877ps-am:
878
879uninstall-am: uninstall-includesHEADERS uninstall-libLTLIBRARIES
880
881.MAKE: install-am install-strip
882
883.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
884 clean-libLTLIBRARIES clean-libtool ctags distclean \
885 distclean-compile distclean-generic distclean-libtool \
886 distclean-tags distdir dvi dvi-am html html-am info info-am \
887 install install-am install-data install-data-am install-dvi \
888 install-dvi-am install-exec install-exec-am install-html \
889 install-html-am install-includesHEADERS install-info \
890 install-info-am install-libLTLIBRARIES install-man install-pdf \
891 install-pdf-am install-ps install-ps-am install-strip \
892 installcheck installcheck-am installdirs maintainer-clean \
893 maintainer-clean-generic mostlyclean mostlyclean-compile \
894 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
895 tags uninstall uninstall-am uninstall-includesHEADERS \
896 uninstall-libLTLIBRARIES
897
898
899# Tell versions [3.59,3.63) of GNU make to not export all variables.
900# Otherwise a system limit (for SysV at least) may be exceeded.
901.NOEXPORT:
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32.c b/libraries/ecore/src/lib/ecore_win32/ecore_win32.c
deleted file mode 100644
index b571d74..0000000
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32.c
+++ /dev/null
@@ -1,841 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdlib.h>
6
7#define WIN32_LEAN_AND_MEAN
8#include <windows.h>
9#undef WIN32_LEAN_AND_MEAN
10#include <windowsx.h>
11
12#include <Eina.h>
13#include <Ecore.h>
14#include <Ecore_Input.h>
15
16#include "Ecore_Win32.h"
17#include "ecore_win32_private.h"
18
19/*============================================================================*
20 * Local *
21 *============================================================================*/
22
23/**
24 * @cond LOCAL
25 */
26
27/* OLE IID for Drag'n Drop */
28
29# define INITGUID
30# include <basetyps.h>
31DEFINE_OLEGUID(IID_IEnumFORMATETC, 0x00000103L, 0, 0);
32DEFINE_OLEGUID(IID_IDataObject, 0x0000010EL, 0, 0);
33DEFINE_OLEGUID(IID_IDropSource, 0x00000121L, 0, 0);
34DEFINE_OLEGUID(IID_IDropTarget, 0x00000122L, 0, 0);
35DEFINE_OLEGUID(IID_IUnknown, 0x00000000L, 0, 0);
36
37#define IDI_ICON 101
38
39static int _ecore_win32_init_count = 0;
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
60_ecore_win32_window_procedure(HWND window,
61 UINT message,
62 WPARAM window_param,
63 LPARAM data_param)
64{
65 Ecore_Win32_Callback_Data *data;
66 POINTS point;
67 DWORD coord;
68
69 data = (Ecore_Win32_Callback_Data *)malloc(sizeof(Ecore_Win32_Callback_Data));
70 if (!data) return DefWindowProc(window, message, window_param, data_param);
71
72 data->window = window;
73 data->message = message;
74 data->window_param = window_param;
75 data->data_param = data_param;
76 data->timestamp = GetMessageTime();
77 coord = GetMessagePos();
78 point = MAKEPOINTS(coord);
79 data->x = point.x;
80 data->y = point.y;
81 data->discard_ctrl = EINA_FALSE;
82
83 switch (data->message)
84 {
85 /* Keyboard input notifications */
86 case WM_KEYDOWN:
87 case WM_SYSKEYDOWN:
88 if ((data->message == WM_KEYDOWN) &&
89 (data->window_param == VK_CONTROL) &&
90 ((HIWORD(data->data_param) & KF_EXTENDED) == 0))
91 {
92 /* Ctrl left key is pressed */
93 BOOL res;
94 MSG next_msg;
95
96 /*
97 * we check if the next message
98 * - is a WM_KEYDOWN
99 * - has the same timestamp than the Ctrl one
100 * - is the key press of the right Alt key
101 */
102 res = PeekMessage(&next_msg, data->window,
103 WM_KEYDOWN, WM_KEYDOWN,
104 PM_NOREMOVE);
105 if (res &&
106 (next_msg.wParam == VK_MENU) &&
107 (next_msg.time == data->timestamp) &&
108 (HIWORD(next_msg.lParam) & KF_EXTENDED))
109 {
110 INF("discard left Ctrl key press (sent by AltGr key press)");
111 data->discard_ctrl = EINA_TRUE;
112 }
113 }
114 _ecore_win32_event_handle_key_press(data, 1);
115 return 0;
116 case WM_CHAR:
117 case WM_SYSCHAR:
118 INF("char message");
119 _ecore_win32_event_handle_key_press(data, 0);
120 return 0;
121 case WM_KEYUP:
122 case WM_SYSKEYUP:
123 INF("keyup message");
124 if ((data->window_param == VK_CONTROL) &&
125 ((HIWORD(data->data_param) & KF_EXTENDED) == 0))
126 {
127 /* Ctrl left key is pressed */
128 BOOL res;
129 MSG next_msg;
130
131 /*
132 * we check if the next message
133 * - is a WM_KEYUP or WM_SYSKEYUP
134 * - has the same timestamp than the Ctrl one
135 * - is the key release of the right Alt key
136 */
137 res = PeekMessage(&next_msg, data->window,
138 WM_KEYUP, WM_SYSKEYUP,
139 PM_NOREMOVE);
140 if (res &&
141 ((next_msg.message == WM_KEYUP) ||
142 (next_msg.message == WM_SYSKEYUP)) &&
143 (next_msg.wParam == VK_MENU) &&
144 (next_msg.time == data->timestamp) &&
145 (HIWORD(next_msg.lParam) & KF_EXTENDED))
146 {
147 INF("discard left Ctrl key release (sent by AltGr key release)");
148 data->discard_ctrl = EINA_TRUE;
149 }
150 }
151 _ecore_win32_event_handle_key_release(data);
152 return 0;
153 case WM_SETFOCUS:
154 INF("setfocus message");
155 _ecore_win32_event_handle_focus_in(data);
156 return 0;
157 case WM_KILLFOCUS:
158 INF("kill focus message");
159 _ecore_win32_event_handle_focus_out(data);
160 return 0;
161 /* Mouse input notifications */
162 case WM_LBUTTONDOWN:
163 INF("left button down message");
164 SetCapture(window);
165 _ecore_win32_event_handle_button_press(data, 1);
166 return 0;
167 case WM_MBUTTONDOWN:
168 INF("middle button down message");
169 _ecore_win32_event_handle_button_press(data, 2);
170 return 0;
171 case WM_RBUTTONDOWN:
172 INF("right button down message");
173 _ecore_win32_event_handle_button_press(data, 3);
174 return 0;
175 case WM_LBUTTONUP:
176 {
177 Ecore_Win32_Window *w = NULL;
178
179 INF("left button up message");
180
181 ReleaseCapture();
182 w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWLP_USERDATA);
183 if (w->drag.dragging)
184 {
185 w->drag.dragging = 0;
186 return 0;
187 }
188
189 _ecore_win32_event_handle_button_release(data, 1);
190 return 0;
191 }
192 case WM_MBUTTONUP:
193 INF("middle button up message");
194 _ecore_win32_event_handle_button_release(data, 2);
195 return 0;
196 case WM_RBUTTONUP:
197 INF("right button up message");
198 _ecore_win32_event_handle_button_release(data, 3);
199 return 0;
200 case WM_MOUSEMOVE:
201 {
202 RECT rect;
203 Ecore_Win32_Window *w = NULL;
204
205 INF("moue move message");
206
207 w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWLP_USERDATA);
208
209 if (w->drag.dragging)
210 {
211 POINT pt;
212
213 pt.x = GET_X_LPARAM(data_param);
214 pt.y = GET_Y_LPARAM(data_param);
215 if (ClientToScreen(window, &pt))
216 {
217 if (w->drag.type == HTCAPTION)
218 {
219 int dx;
220 int dy;
221
222 dx = pt.x - w->drag.px;
223 dy = pt.y - w->drag.py;
224 ecore_win32_window_move(w, w->drag.x + dx, w->drag.y + dy);
225 w->drag.x += dx;
226 w->drag.y += dy;
227 w->drag.px = pt.x;
228 w->drag.py = pt.y;
229 return 0;
230 }
231 if (w->drag.type == HTLEFT)
232 {
233 int dw;
234
235 dw = pt.x - w->drag.px;
236 ecore_win32_window_move_resize(w, w->drag.x + dw, w->drag.y, w->drag.w - dw, w->drag.h);
237 w->drag.x += dw;
238 w->drag.w -= dw;
239 w->drag.px = pt.x;
240 w->drag.py = pt.y;
241 return 0;
242 }
243 if (w->drag.type == HTRIGHT)
244 {
245 int dw;
246
247 dw = pt.x - w->drag.px;
248 ecore_win32_window_resize(w, w->drag.w + dw, w->drag.h);
249 w->drag.w += dw;
250 w->drag.px = pt.x;
251 w->drag.py = pt.y;
252 return 0;
253 }
254 if (w->drag.type == HTTOP)
255 {
256 int dh;
257
258 dh = pt.y - w->drag.py;
259 ecore_win32_window_move_resize(w, w->drag.x, w->drag.y + dh, w->drag.w, w->drag.h - dh);
260 w->drag.y += dh;
261 w->drag.h -= dh;
262 w->drag.px = pt.x;
263 w->drag.py = pt.y;
264 return 0;
265 }
266 if (w->drag.type == HTBOTTOM)
267 {
268 int dh;
269
270 dh = pt.y - w->drag.py;
271 ecore_win32_window_resize(w, w->drag.w, w->drag.h + dh);
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 == HTTOPLEFT)
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
292 ecore_win32_window_move_resize(w, w->drag.x + dx, w->drag.y + dy, w->drag.w - dw, w->drag.h - dh);
293 w->drag.x += dx;
294 w->drag.y += dy;
295 w->drag.w -= dw;
296 w->drag.h -= dh;
297 w->drag.px = pt.x;
298 w->drag.py = pt.y;
299 return 0;
300 }
301 if (w->drag.type == HTTOPRIGHT)
302 {
303 int dx;
304 int dy;
305 int dh;
306 int dw;
307
308 dw = pt.x - w->drag.px;
309 dh = pt.y - w->drag.py;
310 dx = dw;
311 dy = dh;
312 _ecore_win32_size_check(w,
313 w->drag.w, w->drag.h - dh,
314 &dx, &dy);
315 ecore_win32_window_move_resize(w, w->drag.x, w->drag.y + dy, w->drag.w, w->drag.h - dh);
316 w->drag.y += dy;
317 w->drag.w += dw;
318 w->drag.h -= dh;
319 w->drag.px = pt.x;
320 w->drag.py = pt.y;
321 return 0;
322 }
323 if (w->drag.type == HTBOTTOMLEFT)
324 {
325 int dx;
326 int dy;
327 int dh;
328 int dw;
329
330 dw = pt.x - w->drag.px;
331 dh = pt.y - w->drag.py;
332 dx = dw;
333 dy = dh;
334 _ecore_win32_size_check(w,
335 w->drag.w - dw, w->drag.h + dh,
336 &dx, &dy);
337 ecore_win32_window_move_resize(w, w->drag.x + dx, w->drag.y, w->drag.w - dw, w->drag.h + dh);
338 w->drag.x += dx;
339 w->drag.w -= dw;
340 w->drag.h += dh;
341 w->drag.px = pt.x;
342 w->drag.py = pt.y;
343 return 0;
344 }
345 if (w->drag.type == HTBOTTOMRIGHT)
346 {
347 int dh;
348 int dw;
349
350 dw = pt.x - w->drag.px;
351 dh = pt.y - w->drag.py;
352 ecore_win32_window_resize(w, w->drag.w + dw, w->drag.h + dh);
353 w->drag.w += dw;
354 w->drag.h += dh;
355 w->drag.px = pt.x;
356 w->drag.py = pt.y;
357 return 0;
358 }
359 }
360 }
361
362 if (GetClientRect(window, &rect))
363 {
364 POINT pt;
365
366 INF("mouse in window");
367
368 pt.x = GET_X_LPARAM(data_param);
369 pt.y = GET_Y_LPARAM(data_param);
370 if (!PtInRect(&rect, pt))
371 {
372 if (w->pointer_is_in)
373 {
374 w->pointer_is_in = 0;
375 _ecore_win32_event_handle_leave_notify(data);
376 }
377 }
378 else
379 {
380 if (!w->pointer_is_in)
381 {
382 w->pointer_is_in = 1;
383 _ecore_win32_event_handle_enter_notify(data);
384 }
385 }
386 }
387 else
388 {
389 ERR("GetClientRect() failed");
390 }
391 _ecore_win32_event_handle_motion_notify(data);
392
393 return 0;
394 }
395 case WM_MOUSEWHEEL:
396 INF("mouse wheel message");
397 _ecore_win32_event_handle_button_press(data, 4);
398 return 0;
399 /* Window notifications */
400 case WM_CREATE:
401 INF("create window message");
402 _ecore_win32_event_handle_create_notify(data);
403 return 0;
404 case WM_DESTROY:
405 INF("destroy window message");
406 _ecore_win32_event_handle_destroy_notify(data);
407 return 0;
408 case WM_SHOWWINDOW:
409 INF("show window message");
410 if ((data->data_param == SW_OTHERUNZOOM) ||
411 (data->data_param == SW_OTHERZOOM))
412 return 0;
413
414 if (data->window_param)
415 _ecore_win32_event_handle_map_notify(data);
416 else
417 _ecore_win32_event_handle_unmap_notify(data);
418
419 return 0;
420 case WM_CLOSE:
421 INF("close window message");
422 _ecore_win32_event_handle_delete_request(data);
423 return 0;
424 case WM_GETMINMAXINFO:
425 INF("get min max info window message");
426 return TRUE;
427 case WM_MOVING:
428 INF("moving window message");
429 _ecore_win32_event_handle_configure_notify(data);
430 return TRUE;
431 case WM_MOVE:
432 INF("move window message");
433 return 0;
434 case WM_SIZING:
435 INF("sizing window message");
436 _ecore_win32_event_handle_resize(data);
437 _ecore_win32_event_handle_configure_notify(data);
438 return TRUE;
439 case WM_SIZE:
440 INF("size window message");
441 return 0;
442/* case WM_WINDOWPOSCHANGING: */
443/* { */
444/* RECT rect; */
445/* GetClientRect(window, &rect); */
446/* printf (" *** ecore message : WINDOWPOSCHANGING %ld %ld\n", */
447/* rect.right - rect.left, rect.bottom - rect.top); */
448/* } */
449/* _ecore_win32_event_handle_configure_notify(data); */
450/* return 0; */
451 case WM_WINDOWPOSCHANGED:
452 INF("position changed window message");
453 _ecore_win32_event_handle_configure_notify(data);
454 _ecore_win32_event_handle_expose(data);
455 return 0;
456 case WM_ENTERSIZEMOVE:
457 INF("enter size move window message");
458 return 0;
459 case WM_EXITSIZEMOVE:
460 INF("exit size move window message");
461 return 0;
462 case WM_NCLBUTTONDOWN:
463 INF("non client left button down window message");
464
465 if (((DWORD)window_param == HTCAPTION) ||
466 ((DWORD)window_param == HTBOTTOM) ||
467 ((DWORD)window_param == HTBOTTOMLEFT) ||
468 ((DWORD)window_param == HTBOTTOMRIGHT) ||
469 ((DWORD)window_param == HTLEFT) ||
470 ((DWORD)window_param == HTRIGHT) ||
471 ((DWORD)window_param == HTTOP) ||
472 ((DWORD)window_param == HTTOPLEFT) ||
473 ((DWORD)window_param == HTTOPRIGHT))
474 {
475 Ecore_Win32_Window *w;
476
477 w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWLP_USERDATA);
478 ecore_win32_window_geometry_get(w,
479 NULL, NULL,
480 &w->drag.w, &w->drag.h);
481 SetCapture(window);
482 w->drag.type = (DWORD)window_param;
483 w->drag.px = GET_X_LPARAM(data_param);
484 w->drag.py = GET_Y_LPARAM(data_param);
485 w->drag.dragging = 1;
486 return 0;
487 }
488 return DefWindowProc(window, message, window_param, data_param);
489 case WM_SYSCOMMAND:
490 INF("sys command window message %d", (int)window_param);
491
492 if ((((DWORD)window_param & 0xfff0) == SC_MOVE) ||
493 (((DWORD)window_param & 0xfff0) == SC_SIZE))
494 {
495 Ecore_Win32_Window *w;
496
497 INF("sys command MOVE or SIZE window message : %dx%d", GET_X_LPARAM(data_param), GET_Y_LPARAM(data_param));
498
499 w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWLP_USERDATA);
500 w->drag.dragging = 1;
501 return 0;
502 }
503 return DefWindowProc(window, message, window_param, data_param);
504 /* GDI notifications */
505 case WM_ERASEBKGND:
506 return 1;
507 case WM_PAINT:
508 {
509 RECT rect;
510
511 INF("paint message");
512
513 if (GetUpdateRect(window, &rect, FALSE))
514 {
515 PAINTSTRUCT ps;
516 HDC hdc;
517
518 hdc = BeginPaint(window, &ps);
519 data->update = rect;
520 _ecore_win32_event_handle_expose(data);
521 EndPaint(window, &ps);
522 }
523 return 0;
524 }
525 case WM_SETREDRAW:
526 INF("set redraw message");
527 return 0;
528 case WM_SYNCPAINT:
529 INF("sync paint message");
530 return 0;
531 default:
532 return DefWindowProc(window, message, window_param, data_param);
533 }
534}
535
536/**
537 * @endcond
538 */
539
540
541/*============================================================================*
542 * Global *
543 *============================================================================*/
544
545
546HINSTANCE _ecore_win32_instance = NULL;
547double _ecore_win32_double_click_time = 0.25;
548unsigned long _ecore_win32_event_last_time = 0;
549Ecore_Win32_Window *_ecore_win32_event_last_window = NULL;
550int _ecore_win32_log_dom_global = -1;
551
552int ECORE_WIN32_EVENT_MOUSE_IN = 0;
553int ECORE_WIN32_EVENT_MOUSE_OUT = 0;
554int ECORE_WIN32_EVENT_WINDOW_FOCUS_IN = 0;
555int ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT = 0;
556int ECORE_WIN32_EVENT_WINDOW_DAMAGE = 0;
557int ECORE_WIN32_EVENT_WINDOW_CREATE = 0;
558int ECORE_WIN32_EVENT_WINDOW_DESTROY = 0;
559int ECORE_WIN32_EVENT_WINDOW_SHOW = 0;
560int ECORE_WIN32_EVENT_WINDOW_HIDE = 0;
561int ECORE_WIN32_EVENT_WINDOW_CONFIGURE = 0;
562int ECORE_WIN32_EVENT_WINDOW_RESIZE = 0;
563int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST = 0;
564
565/*============================================================================*
566 * API *
567 *============================================================================*/
568
569/**
570 * @addtogroup Ecore_Win32_Group Ecore_Win32 library
571 *
572 * Ecore_Win32 is a library that wraps Windows graphic functions
573 * and integrate them nicely into the Ecore main loop.
574 *
575 * @section Ecore_Win32_Sec_Init Initialisation / Shutdown
576 *
577 * To fill...
578 *
579 * @section Ecore_Win32_Sec_Icons How to set icons to an application
580 *
581 * It is possible to also sets the icon of the application easily:
582 *
583 * @li Create an icon with your favorite image creator. The Gimp is a
584 * good choice. Create several images of size 16, 32 and 48. You can
585 * also create images of size 24, 64, 128 and 256. Paste all of them
586 * in the image of size 16 as a layer. Save the image of size 16 with
587 * the name my_icon.ico. Put it where the source code of the
588 * application is located.
589 * @li Create my_icon_rc.rc file with your code editor and add in it:
590 * @code
591 * 101 ICON DISCARDABLE "my_icon.ico"
592 * @endcode
593 * @li With Visual Studio, put that file in the 'Resource file' part
594 * of the project.
595 * @li With MinGW, you have to compile it with windres:
596 * @code
597 * windres my_icon_rc.rc my_icon_rc.o
598 * @endcode
599 * and add my_icon_rc.o to the object files of the application.
600 *
601 * @note The value 101 must not be changed, it's the ID used
602 * internally by Ecore_Win32 to get the icons.
603 *
604 * @{
605 */
606
607/**
608 * @brief Initialize the Ecore_Win32 library.
609 *
610 * @return 1 or greater on success, 0 on error.
611 *
612 * This function sets up the Windows graphic system. It returns 0 on
613 * failure, otherwise it returns the number of times it has already been
614 * called.
615 *
616 * When Ecore_Win32 is not used anymore, call ecore_win32_shutdown()
617 * to shut down the Ecore_Win32 library.
618 */
619EAPI int
620ecore_win32_init()
621{
622 WNDCLASSEX wc;
623 HICON icon;
624 HICON icon_sm;
625
626 if (++_ecore_win32_init_count != 1)
627 return _ecore_win32_init_count;
628
629 if (!eina_init())
630 return --_ecore_win32_init_count;
631
632 _ecore_win32_log_dom_global = eina_log_domain_register
633 ("ecore_win32", ECORE_WIN32_DEFAULT_LOG_COLOR);
634 if (_ecore_win32_log_dom_global < 0)
635 {
636 EINA_LOG_ERR("Ecore_Win32: Could not register log domain");
637 goto shutdown_eina;
638 }
639
640 if (!ecore_event_init())
641 {
642 ERR("Ecore_Win32: Could not init ecore_event");
643 goto unregister_log_domain;
644 }
645
646 _ecore_win32_instance = GetModuleHandle(NULL);
647 if (!_ecore_win32_instance)
648 {
649 ERR("GetModuleHandle() failed");
650 goto shutdown_ecore_event;
651 }
652
653 icon = LoadImage(_ecore_win32_instance,
654 MAKEINTRESOURCE(IDI_ICON),
655 IMAGE_ICON,
656 GetSystemMetrics(SM_CXICON),
657 GetSystemMetrics(SM_CYICON),
658 LR_DEFAULTCOLOR);
659 icon_sm = LoadImage(_ecore_win32_instance,
660 MAKEINTRESOURCE(IDI_ICON),
661 IMAGE_ICON,
662 GetSystemMetrics(SM_CXSMICON),
663 GetSystemMetrics(SM_CYSMICON),
664 LR_DEFAULTCOLOR);
665 if (!icon)
666 icon = LoadIcon (NULL, IDI_APPLICATION);
667 if (!icon_sm)
668 icon_sm = LoadIcon (NULL, IDI_APPLICATION);
669
670 memset (&wc, 0, sizeof (WNDCLASSEX));
671 wc.cbSize = sizeof (WNDCLASSEX);
672 wc.style = CS_HREDRAW | CS_VREDRAW;
673 wc.lpfnWndProc = _ecore_win32_window_procedure;
674 wc.cbClsExtra = 0;
675 wc.cbWndExtra = 0;
676 wc.hInstance = _ecore_win32_instance;
677 wc.hIcon = icon;
678 wc.hCursor = LoadCursor (NULL, IDC_ARROW);
679 wc.hbrBackground = (HBRUSH)(1 + COLOR_BTNFACE);
680 wc.lpszMenuName = NULL;
681 wc.lpszClassName = ECORE_WIN32_WINDOW_CLASS;
682 wc.hIconSm = icon_sm;
683
684 if(!RegisterClassEx(&wc))
685 {
686 ERR("RegisterClass() failed");
687 goto free_library;
688 }
689
690 if (!ecore_win32_dnd_init())
691 {
692 ERR("ecore_win32_dnd_init() failed");
693 goto unregister_class;
694 }
695
696 if (!ECORE_WIN32_EVENT_MOUSE_IN)
697 {
698 ECORE_WIN32_EVENT_MOUSE_IN = ecore_event_type_new();
699 ECORE_WIN32_EVENT_MOUSE_OUT = ecore_event_type_new();
700 ECORE_WIN32_EVENT_WINDOW_FOCUS_IN = ecore_event_type_new();
701 ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT = ecore_event_type_new();
702 ECORE_WIN32_EVENT_WINDOW_DAMAGE = ecore_event_type_new();
703 ECORE_WIN32_EVENT_WINDOW_CREATE = ecore_event_type_new();
704 ECORE_WIN32_EVENT_WINDOW_DESTROY = ecore_event_type_new();
705 ECORE_WIN32_EVENT_WINDOW_SHOW = ecore_event_type_new();
706 ECORE_WIN32_EVENT_WINDOW_HIDE = ecore_event_type_new();
707 ECORE_WIN32_EVENT_WINDOW_CONFIGURE = ecore_event_type_new();
708 ECORE_WIN32_EVENT_WINDOW_RESIZE = ecore_event_type_new();
709 ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST = ecore_event_type_new();
710 }
711
712 return _ecore_win32_init_count;
713
714 unregister_class:
715 UnregisterClass(ECORE_WIN32_WINDOW_CLASS, _ecore_win32_instance);
716 free_library:
717 FreeLibrary(_ecore_win32_instance);
718 shutdown_ecore_event:
719 ecore_event_shutdown();
720 unregister_log_domain:
721 eina_log_domain_unregister(_ecore_win32_log_dom_global);
722 shutdown_eina:
723 eina_shutdown();
724
725 return --_ecore_win32_init_count;
726}
727
728/**
729 * @brief Shut down the Ecore_Win32 library.
730 *
731 * @return 0 when the library is completely shut down, 1 or
732 * greater otherwise.
733 *
734 * This function shuts down the Ecore_Win32 library. It returns 0 when it has
735 * been called the same number of times than ecore_win32_init(). In that case
736 * it shuts down all the Windows graphic system.
737 */
738EAPI int
739ecore_win32_shutdown()
740{
741 if (--_ecore_win32_init_count != 0)
742 return _ecore_win32_init_count;
743
744 ecore_win32_dnd_shutdown();
745
746 if (!UnregisterClass(ECORE_WIN32_WINDOW_CLASS, _ecore_win32_instance))
747 INF("UnregisterClass() failed");
748
749 if (!FreeLibrary(_ecore_win32_instance))
750 INF("FreeLibrary() failed");
751
752 _ecore_win32_instance = NULL;
753
754 ecore_event_shutdown();
755 eina_log_domain_unregister(_ecore_win32_log_dom_global);
756 _ecore_win32_log_dom_global = -1;
757 eina_shutdown();
758
759 return _ecore_win32_init_count;
760}
761
762/**
763 * @brief Retrieve the depth of the screen.
764 *
765 * @return The depth of the screen.
766 *
767 * This function returns the depth of the screen. If an error occurs,
768 * it returns 0.
769 */
770EAPI int
771ecore_win32_screen_depth_get()
772{
773 HDC dc;
774 int depth;
775
776 INF("getting screen depth");
777
778 dc = GetDC(NULL);
779 if (!dc)
780 {
781 ERR("GetDC() failed");
782 return 0;
783 }
784
785 depth = GetDeviceCaps(dc, BITSPIXEL);
786 if (!ReleaseDC(NULL, dc))
787 {
788 ERR("ReleaseDC() failed (device context not released)");
789 }
790
791 return depth;
792}
793
794/**
795 * @brief Sets the timeout for a double and triple clicks to be flagged.
796 *
797 * @param t The time in seconds.
798 *
799 * This function sets the time @p t between clicks before the
800 * double_click flag is set in a button down event. If 3 clicks occur
801 * within double this time, the triple_click flag is also set.
802 */
803EAPI void
804ecore_win32_double_click_time_set(double t)
805{
806 if (t < 0.0) t = 0.0;
807 _ecore_win32_double_click_time = t;
808}
809
810/**
811 * @brief Retrieve the double and triple click flag timeout.
812 *
813 * @return The timeout for double clicks in seconds.
814 *
815 * This function returns the double clicks in seconds. If
816 * ecore_win32_double_click_time_set() has not been called, the
817 * default value is returned. See ecore_win32_double_click_time_set()
818 * for more informations.
819 */
820EAPI double
821ecore_win32_double_click_time_get(void)
822{
823 return _ecore_win32_double_click_time;
824}
825
826/**
827 * @brief Return the last event time.
828 *
829 * @return The last envent time.
830 *
831 * This function returns the last event time.
832 */
833EAPI unsigned long
834ecore_win32_current_time_get(void)
835{
836 return _ecore_win32_event_last_time;
837}
838
839/**
840 * @}
841 */
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_cursor.c b/libraries/ecore/src/lib/ecore_win32/ecore_win32_cursor.c
deleted file mode 100644
index 9a5a7eb..0000000
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_cursor.c
+++ /dev/null
@@ -1,306 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#define WIN32_LEAN_AND_MEAN
6#include <windows.h>
7#undef WIN32_LEAN_AND_MEAN
8
9#include <Eina.h>
10
11#include "Ecore_Win32.h"
12#include "ecore_win32_private.h"
13
14/*============================================================================*
15 * Local *
16 *============================================================================*/
17
18
19/*============================================================================*
20 * Global *
21 *============================================================================*/
22
23
24/*============================================================================*
25 * API *
26 *============================================================================*/
27
28/**
29 * @addtogroup Ecore_Win32_Group Ecore_Win32 library
30 *
31 * @{
32 */
33
34/**
35 * @brief Create a new cursor.
36 *
37 * @param pixels_and The array of bytes containing the bit values for
38 * the AND mask of the cursor.
39 * @param pixels_xor The array of bytes containing the bit values for
40 * the XOR mask of the cursor.
41 * @param width The width of the cursor.
42 * @param height The height of the cursor.
43 * @param hot_x The horizontal position of the cursor's hot spot.
44 * @param hot_y The vertical position of the cursor's hot spot.
45 * @return A newly user-defined cursor.
46 *
47 * This function creates a new cursor of size @p width and @p
48 * height. They must be valid size. To determine the valid size of a
49 * cursor, useecore_win32_cursor_size_get(). @p pixels_and is an array
50 * of bytes (unsigned char) containing the bits of the cursor that
51 * will be visible. @p pixels_xor is similar but will allow the cursor
52 * to have a shape. Here is the truth table for the masks:
53 *
54 * <table border=1>
55 * <tr><td>AND mask</td><td>XOR mask</td><td>Display</td></tr>
56 * <tr><td>0</td> <td>0</td> <td>Black</td></tr>
57 * <tr><td>0</td> <td>1</td> <td>White</td></tr>
58 * <tr><td>1</td> <td>0</td> <td>Screen</td></tr>
59 * <tr><td>1</td> <td>1</td> <td>Reverse screen</td></tr>
60 * </table>
61 *
62 * @p hot_x and @p hot_y are the position of the hot spot of the
63 * cursor. If @p pixels_and or @p pixels_xor are @c NULL, the function
64 * returns NULL. If @p width or @p height does not match the valid
65 * size of a cursor, the function returns @c NULL. On success, the
66 * function creates a user-defined cursor, otherwise it returns
67 * @c NULL.
68 *
69 * Once the cursor is not used anymore, use ecore_win32_cursor_free()
70 * to free the ressources.
71 *
72 * Example of use:
73 *
74 * @code
75 * unsigned char pixels_and[] ={
76 * 0xFF, 0xFC, 0x3F, 0xFF, // line 1
77 * 0xFF, 0xC0, 0x1F, 0xFF, // line 2
78 * 0xFF, 0x00, 0x3F, 0xFF, // line 3
79 * 0xFE, 0x00, 0xFF, 0xFF, // line 4
80 *
81 * 0xF7, 0x01, 0xFF, 0xFF, // line 5
82 * 0xF0, 0x03, 0xFF, 0xFF, // line 6
83 * 0xF0, 0x03, 0xFF, 0xFF, // line 7
84 * 0xE0, 0x07, 0xFF, 0xFF, // line 8
85 *
86 * 0xC0, 0x07, 0xFF, 0xFF, // line 9
87 * 0xC0, 0x0F, 0xFF, 0xFF, // line 10
88 * 0x80, 0x0F, 0xFF, 0xFF, // line 11
89 * 0x80, 0x0F, 0xFF, 0xFF, // line 12
90 *
91 * 0x80, 0x07, 0xFF, 0xFF, // line 13
92 * 0x00, 0x07, 0xFF, 0xFF, // line 14
93 * 0x00, 0x03, 0xFF, 0xFF, // line 15
94 * 0x00, 0x00, 0xFF, 0xFF, // line 16
95 *
96 * 0x00, 0x00, 0x7F, 0xFF, // line 17
97 * 0x00, 0x00, 0x1F, 0xFF, // line 18
98 * 0x00, 0x00, 0x0F, 0xFF, // line 19
99 * 0x80, 0x00, 0x0F, 0xFF, // line 20
100 *
101 * 0x80, 0x00, 0x07, 0xFF, // line 21
102 * 0x80, 0x00, 0x07, 0xFF, // line 22
103 * 0xC0, 0x00, 0x07, 0xFF, // line 23
104 * 0xC0, 0x00, 0x0F, 0xFF, // line 24
105 *
106 * 0xE0, 0x00, 0x0F, 0xFF, // line 25
107 * 0xF0, 0x00, 0x1F, 0xFF, // line 26
108 * 0xF0, 0x00, 0x1F, 0xFF, // line 27
109 * 0xF8, 0x00, 0x3F, 0xFF, // line 28
110 *
111 * 0xFE, 0x00, 0x7F, 0xFF, // line 29
112 * 0xFF, 0x00, 0xFF, 0xFF, // line 30
113 * 0xFF, 0xC3, 0xFF, 0xFF, // line 31
114 * 0xFF, 0xFF, 0xFF, 0xFF // line 32
115 * };
116 *
117 * unsigned char pixels_xor[] =
118 * {
119 * 0x00, 0x00, 0x00, 0x00, // line 1
120 * 0x00, 0x03, 0xC0, 0x00, // line 2
121 * 0x00, 0x3F, 0x00, 0x00, // line 3
122 * 0x00, 0xFE, 0x00, 0x00, // line 4
123 *
124 * 0x0E, 0xFC, 0x00, 0x00, // line 5
125 * 0x07, 0xF8, 0x00, 0x00, // line 6
126 * 0x07, 0xF8, 0x00, 0x00, // line 7
127 * 0x0F, 0xF0, 0x00, 0x00, // line 8
128 *
129 * 0x1F, 0xF0, 0x00, 0x00, // line 9
130 * 0x1F, 0xE0, 0x00, 0x00, // line 10
131 * 0x3F, 0xE0, 0x00, 0x00, // line 11
132 * 0x3F, 0xE0, 0x00, 0x00, // line 12
133 *
134 * 0x3F, 0xF0, 0x00, 0x00, // line 13
135 * 0x7F, 0xF0, 0x00, 0x00, // line 14
136 * 0x7F, 0xF8, 0x00, 0x00, // line 15
137 * 0x7F, 0xFC, 0x00, 0x00, // line 16
138 *
139 * 0x7F, 0xFF, 0x00, 0x00, // line 17
140 * 0x7F, 0xFF, 0x80, 0x00, // line 18
141 * 0x7F, 0xFF, 0xE0, 0x00, // line 19
142 * 0x3F, 0xFF, 0xE0, 0x00, // line 20
143 *
144 * 0x3F, 0xC7, 0xF0, 0x00, // line 21
145 * 0x3F, 0x83, 0xF0, 0x00, // line 22
146 * 0x1F, 0x83, 0xF0, 0x00, // line 23
147 * 0x1F, 0x83, 0xE0, 0x00, // line 24
148 *
149 * 0x0F, 0xC7, 0xE0, 0x00, // line 25
150 * 0x07, 0xFF, 0xC0, 0x00, // line 26
151 * 0x07, 0xFF, 0xC0, 0x00, // line 27
152 * 0x01, 0xFF, 0x80, 0x00, // line 28
153 *
154 * 0x00, 0xFF, 0x00, 0x00, // line 29
155 * 0x00, 0x3C, 0x00, 0x00, // line 30
156 * 0x00, 0x00, 0x00, 0x00, // line 31
157 * 0x00, 0x00, 0x00, 0x00 // line 32
158 * };
159 *
160 * Ecore_Win32_Cursor cursor = ecore_win32_cursor_new(pixels_and, pixels_xor, 32, 32, 19, 2);
161 * @endcode
162 */
163EAPI Ecore_Win32_Cursor *
164ecore_win32_cursor_new(const void *pixels_and,
165 const void *pixels_xor,
166 int width,
167 int height,
168 int hot_x,
169 int hot_y)
170{
171 Ecore_Win32_Cursor *cursor = NULL;
172 int cursor_width;
173 int cursor_height;
174
175 INF("creating cursor");
176
177 if (!pixels_and || !pixels_xor)
178 return NULL;
179
180 cursor_width = GetSystemMetrics(SM_CXCURSOR);
181 cursor_height = GetSystemMetrics(SM_CYCURSOR);
182
183 if ((cursor_width != width) ||
184 (cursor_height != height))
185 return NULL;
186
187 if (!(cursor = CreateCursor(_ecore_win32_instance,
188 hot_x, hot_y,
189 width, height,
190 pixels_and,
191 pixels_xor)))
192 return NULL;
193
194 return cursor;
195}
196
197/**
198 * @brief Free the given cursor.
199 *
200 * @param cursor The cursor to free.
201 *
202 * This function free @p cursor. @p cursor must have been obtained
203 * with ecore_win32_cursor_new().
204 */
205EAPI void
206ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor)
207{
208 INF("destroying cursor");
209
210 DestroyCursor(cursor);
211}
212
213/**
214 * @brief Create a cursor from a Windows ressource.
215 *
216 * @param shape The pre-defined shape of the cursor.
217 * @return The new cursor.
218 *
219 * This function returns a pre-defined cursor with a specified
220 * @p shape. This cursor does not need to be freed, as it is loaded
221 * from an existing resource.
222 */
223EAPI Ecore_Win32_Cursor *
224ecore_win32_cursor_shaped_new(Ecore_Win32_Cursor_Shape shape)
225{
226 Ecore_Win32_Cursor *cursor = NULL;
227 const char *cursor_name;
228
229 INF("geting shape cursor");
230
231 switch (shape)
232 {
233 case ECORE_WIN32_CURSOR_SHAPE_APP_STARTING:
234 cursor_name = IDC_APPSTARTING;
235 break;
236 case ECORE_WIN32_CURSOR_SHAPE_ARROW:
237 cursor_name = IDC_ARROW;
238 break;
239 case ECORE_WIN32_CURSOR_SHAPE_CROSS:
240 cursor_name = IDC_CROSS;
241 break;
242 case ECORE_WIN32_CURSOR_SHAPE_HAND:
243 cursor_name = IDC_HAND;
244 break;
245 case ECORE_WIN32_CURSOR_SHAPE_HELP:
246 cursor_name = IDC_HELP;
247 break;
248 case ECORE_WIN32_CURSOR_SHAPE_I_BEAM:
249 cursor_name = IDC_IBEAM;
250 break;
251 case ECORE_WIN32_CURSOR_SHAPE_NO:
252 cursor_name = IDC_NO;
253 break;
254 case ECORE_WIN32_CURSOR_SHAPE_SIZE_ALL:
255 cursor_name = IDC_SIZEALL;
256 break;
257 case ECORE_WIN32_CURSOR_SHAPE_SIZE_NESW:
258 cursor_name = IDC_SIZENESW;
259 break;
260 case ECORE_WIN32_CURSOR_SHAPE_SIZE_NS:
261 cursor_name = IDC_SIZENS;
262 break;
263 case ECORE_WIN32_CURSOR_SHAPE_SIZE_NWSE:
264 cursor_name = IDC_SIZENWSE;
265 break;
266 case ECORE_WIN32_CURSOR_SHAPE_SIZE_WE:
267 cursor_name = IDC_SIZEWE;
268 break;
269 case ECORE_WIN32_CURSOR_SHAPE_UP_ARROW:
270 cursor_name = IDC_UPARROW;
271 break;
272 case ECORE_WIN32_CURSOR_SHAPE_WAIT:
273 cursor_name = IDC_WAIT;
274 break;
275 default:
276 return NULL;
277 }
278
279 if (!(cursor = LoadCursor(NULL, cursor_name)))
280 return NULL;
281
282 return cursor;
283}
284
285/**
286 * @brief Retrieve the size of a valid cursor.
287 *
288 * @param width The width of a valid cursor.
289 * @param height The height of a valid cursor.
290 *
291 * This function returns the size of a cursor that must be passed to
292 * ecore_win32_cursor_new(). @p width and @p height are buffers that
293 * will be filled with the correct size. They can be @c NULL.
294 */
295EAPI void
296ecore_win32_cursor_size_get(int *width, int *height)
297{
298 INF("geting size cursor");
299
300 if (*width) *width = GetSystemMetrics(SM_CXCURSOR);
301 if (*height) *height = GetSystemMetrics(SM_CYCURSOR);
302}
303
304/**
305 * @}
306 */
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd.c b/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd.c
deleted file mode 100755
index a629c8b..0000000
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd.c
+++ /dev/null
@@ -1,221 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <windows.h>
6
7#include "Ecore_Win32.h"
8#include "ecore_win32_private.h"
9
10/*============================================================================*
11 * Local *
12 *============================================================================*/
13
14/**
15 * @cond LOCAL
16 */
17
18
19static int _ecore_win32_dnd_init_count = 0;
20
21static HANDLE DataToHandle(const char *data, int size)
22{
23 char *ptr;
24 ptr = (char *)GlobalAlloc(GMEM_FIXED, size);
25 memcpy(ptr, data, size);
26 return ptr;
27}
28
29/**
30 * @endcond
31 */
32
33
34/*============================================================================*
35 * Global *
36 *============================================================================*/
37
38
39/*============================================================================*
40 * API *
41 *============================================================================*/
42
43/**
44 * @addtogroup Ecore_Win32_Group Ecore_Win32 library
45 *
46 * @{
47 */
48
49/**
50 * @brief Initialize the Ecore_Win32 Drag and Drop module.
51 *
52 * @return 1 or greater on success, 0 on error.
53 *
54 * This function initialize the Drag and Drop module. It returns 0 on
55 * failure, otherwise it returns the number of times it has already
56 * been called.
57 *
58 * When the Drag and Drop module is not used anymore, call
59 * ecore_win32_dnd_shutdown() to shut down the module.
60 */
61EAPI int
62ecore_win32_dnd_init()
63{
64 if (_ecore_win32_dnd_init_count > 0)
65 {
66 _ecore_win32_dnd_init_count++;
67 return _ecore_win32_dnd_init_count;
68 }
69
70 if (OleInitialize(NULL) != S_OK)
71 return 0;
72
73 _ecore_win32_dnd_init_count++;
74
75 return _ecore_win32_dnd_init_count;
76}
77
78/**
79 * @brief Shut down the Ecore_Win32 Drag and Drop module.
80 *
81 * @return 0 when the module is completely shut down, 1 or
82 * greater otherwise.
83 *
84 * This function shuts down the Drag and Drop module. It returns 0 when it has
85 * been called the same number of times than ecore_win32_dnd_init(). In that case
86 * it shut down the module.
87 */
88EAPI int
89ecore_win32_dnd_shutdown()
90{
91 _ecore_win32_dnd_init_count--;
92 if (_ecore_win32_dnd_init_count > 0) return _ecore_win32_dnd_init_count;
93
94 OleUninitialize();
95
96 if (_ecore_win32_dnd_init_count < 0) _ecore_win32_dnd_init_count = 0;
97
98 return _ecore_win32_dnd_init_count;
99}
100
101/**
102 * @brief Begin a DnD operation.
103 *
104 * @param data The name pf the Drag operation.
105 * @param size The size of the name.
106 * @return EINA_TRUE on success, EINA_FALSE otherwise.
107 *
108 * This function start a Drag operation with the name @p data. If
109 * @p data is @c NULL, EINA_FALSE is returned. if @p size is less than
110 * 0, it is set to the length (as strlen()) of @p data. On success the
111 * function returns EINA_TRUE, otherwise it returns EINA_FALSE.
112 */
113EAPI Eina_Bool
114ecore_win32_dnd_begin(const char *data,
115 int size)
116{
117 IDataObject *pDataObject = NULL;
118 IDropSource *pDropSource = NULL;
119 FORMATETC fmtetc = { CF_TEXT, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
120 STGMEDIUM stgmed = { TYMED_HGLOBAL, { 0 }, 0 };
121 Eina_Bool res = EINA_FALSE;
122
123 if (!data)
124 return EINA_FALSE;
125
126 if (size < 0)
127 size = strlen(data) + 1;
128
129 stgmed.hGlobal = DataToHandle(data, size);
130
131 // create the data object
132 pDataObject = (IDataObject *)_ecore_win32_dnd_data_object_new((void *)&fmtetc,
133 (void *)&stgmed,
134 1);
135 pDropSource = (IDropSource *)_ecore_win32_dnd_drop_source_new();
136
137 if (pDataObject && pDropSource)
138 {
139 DWORD dwResult;
140 DWORD dwEffect = DROPEFFECT_COPY;
141
142 // do the drag-drop!
143 dwResult = DoDragDrop(pDataObject, pDropSource, DROPEFFECT_COPY, &dwEffect);
144
145 // finished. Check the return values to see if we need to do anything else
146 if (dwResult == DRAGDROP_S_DROP)
147 {
148 //printf(">>> \"%s\" Dropped <<<\n", str);
149 if(dwEffect == DROPEFFECT_MOVE)
150 {
151 // remove the data we just dropped from active document
152 }
153 }
154 //else if (dwResult == DRAGDROP_S_CANCEL)
155 // printf("DND cancelled\n");
156 //else
157 // printf("DND error\n");
158
159 res = EINA_TRUE;
160 }
161
162 _ecore_win32_dnd_data_object_free(pDataObject);
163 _ecore_win32_dnd_drop_source_free(pDropSource);
164
165 // cleanup
166 ReleaseStgMedium(&stgmed);
167
168 return res;
169}
170
171/**
172 * @brief Register a Drop operation.
173 *
174 * @param window The destination of the Drop operation.
175 * @param callback The callback called when the Drop operation
176 * finishes.
177 * @return EINA_TRUE on success, EINA_FALSE otherwise.
178 *
179 * This function register a Drop operation on @p window. Once the Drop
180 * operation finishes, @p callback is called. If @p window is @c NULL,
181 * the function returns EINA_FALSE. On success, it returns EINA_TRUE,
182 * otherwise it returns EINA_FALSE.
183 */
184EAPI Eina_Bool
185ecore_win32_dnd_register_drop_target(Ecore_Win32_Window *window,
186 Ecore_Win32_Dnd_DropTarget_Callback callback)
187{
188 Ecore_Win32_Window *wnd = (Ecore_Win32_Window *)window;
189
190 if (!window)
191 return EINA_FALSE;
192
193 wnd->dnd_drop_target = _ecore_win32_dnd_register_drop_window(wnd->window,
194 callback,
195 (void *)wnd);
196 return wnd->dnd_drop_target ? EINA_TRUE : EINA_FALSE;
197}
198
199/**
200 * @brief Unregister a Drop operation.
201 *
202 * @param window The destination of the Drop operation.
203 *
204 * This function unregister a Drop operation on @p window. If
205 * @p window is @c NULL, the function does nothing.
206 */
207EAPI void
208ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window)
209{
210 Ecore_Win32_Window *wnd = (Ecore_Win32_Window *)window;
211
212 if (!window)
213 return;
214
215 if (wnd->dnd_drop_target)
216 _ecore_win32_dnd_unregister_drop_window(wnd->window, wnd->dnd_drop_target);
217}
218
219/**
220 * @}
221 */
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_data_object.cpp b/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_data_object.cpp
deleted file mode 100644
index 75e26f5..0000000
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_data_object.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
1/*
2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
3 */
4
5#ifdef HAVE_CONFIG_H
6# include <config.h>
7#endif
8
9#include <assert.h>
10
11#define WIN32_LEAN_AND_MEAN
12#include <windows.h>
13#undef WIN32_LEAN_AND_MEAN
14#include <ole2.h>
15
16#include "Ecore_Win32.h"
17#include "ecore_win32_private.h"
18
19#include "ecore_win32_dnd_enumformatetc.h"
20#include "ecore_win32_dnd_data_object.h"
21
22
23static HGLOBAL DupGlobalMem(HGLOBAL hMem)
24{
25 DWORD len = (DWORD)GlobalSize(hMem);
26 PVOID source = GlobalLock(hMem);
27 PVOID dest = GlobalAlloc(GMEM_FIXED, len);
28 memcpy(dest, source, len);
29 GlobalUnlock(hMem);
30 return dest;
31}
32
33// structors
34
35DataObject::DataObject(FORMATETC *fmtetc, STGMEDIUM *stgmed, int count)
36{
37 assert(fmtetc != NULL);
38 assert(stgmed != NULL);
39 assert(count > 0);
40
41 // reference count must ALWAYS start at 1
42 ref_count_ = 1;
43 formats_num_ = count;
44
45 format_etc_ = new FORMATETC[count];
46 stg_medium_ = new STGMEDIUM[count];
47
48 for(int i = 0; i < count; i++)
49 {
50 format_etc_[i] = fmtetc[i];
51 stg_medium_[i] = stgmed[i];
52 }
53}
54
55DataObject::~DataObject()
56{
57 delete[] format_etc_;
58 delete[] stg_medium_;
59}
60
61
62// IUnknown
63
64HRESULT DataObject::QueryInterface(REFIID iid, void **ppvObject)
65{
66 // check to see what interface has been requested
67 if ((iid == IID_IDataObject) || (iid == IID_IUnknown))
68 {
69 AddRef();
70 *ppvObject = this;
71 return S_OK;
72 }
73 *ppvObject = 0;
74 return E_NOINTERFACE;
75}
76
77ULONG DataObject::AddRef()
78{
79 return InterlockedIncrement(&ref_count_);
80}
81
82ULONG DataObject::Release()
83{
84 LONG count = InterlockedDecrement(&ref_count_);
85 if(count == 0)
86 {
87 delete this;
88 return 0;
89 }
90 return count;
91}
92
93// IDataObject
94
95HRESULT DataObject::GetData(FORMATETC *pFormatEtc, STGMEDIUM *pMedium)
96{
97 assert(pMedium != NULL);
98 int idx;
99
100 // try to match the specified FORMATETC with one of our supported formats
101 if((idx = lookup_format_etc(pFormatEtc)) == -1)
102 return DV_E_FORMATETC;
103
104 // found a match - transfer data into supplied storage medium
105 pMedium->tymed = format_etc_[idx].tymed;
106 pMedium->pUnkForRelease = 0;
107
108 // copy the data into the caller's storage medium
109 switch(format_etc_[idx].tymed)
110 {
111 case TYMED_HGLOBAL:
112 pMedium->hGlobal = DupGlobalMem(stg_medium_[idx].hGlobal);
113 break;
114
115 default:
116 return DV_E_FORMATETC;
117 }
118
119 return S_OK;
120}
121
122HRESULT DataObject::GetDataHere(FORMATETC *pFormatEtc __UNUSED__, STGMEDIUM *pmedium __UNUSED__)
123{
124 return DATA_E_FORMATETC;
125}
126
127HRESULT DataObject::QueryGetData(FORMATETC *pFormatEtc)
128{
129 return (lookup_format_etc(pFormatEtc) == -1) ? DV_E_FORMATETC : S_OK;
130}
131
132HRESULT DataObject::GetCanonicalFormatEtc(FORMATETC *pFormatEct __UNUSED__, FORMATETC *pFormatEtcOut)
133{
134 // Apparently we have to set this field to NULL even though we don't do anything else
135 pFormatEtcOut->ptd = NULL;
136 return E_NOTIMPL;
137}
138
139HRESULT DataObject::SetData(FORMATETC *pFormatEtc __UNUSED__, STGMEDIUM *pMedium __UNUSED__, BOOL fRelease __UNUSED__)
140{
141 return E_NOTIMPL;
142}
143
144HRESULT DataObject::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppEnumFormatEtc)
145{
146 // only the get direction is supported for OLE
147 if(dwDirection == DATADIR_GET)
148 {
149 // for Win2k+ you can use the SHCreateStdEnumFmtEtc API call, however
150 // to support all Windows platforms we need to implement IEnumFormatEtc ourselves.
151 return CreateEnumFormatEtc(formats_num_, format_etc_, ppEnumFormatEtc);
152 }
153 else
154 {
155 // the direction specified is not supported for drag+drop
156 return E_NOTIMPL;
157 }
158}
159
160HRESULT DataObject::DAdvise(FORMATETC *pFormatEtc __UNUSED__, DWORD advf __UNUSED__, IAdviseSink *, DWORD *)
161{
162 return OLE_E_ADVISENOTSUPPORTED;
163}
164
165HRESULT DataObject::DUnadvise(DWORD dwConnection __UNUSED__)
166{
167 return OLE_E_ADVISENOTSUPPORTED;
168}
169
170HRESULT DataObject::EnumDAdvise(IEnumSTATDATA **ppEnumAdvise __UNUSED__)
171{
172 return OLE_E_ADVISENOTSUPPORTED;
173}
174
175// internal helper function
176
177int DataObject::lookup_format_etc(FORMATETC *pFormatEtc)
178{
179 // check each of our formats in turn to see if one matches
180 for(int i = 0; i < formats_num_; i++)
181 {
182 if((format_etc_[i].tymed & pFormatEtc->tymed) &&
183 (format_etc_[i].cfFormat == pFormatEtc->cfFormat) &&
184 (format_etc_[i].dwAspect == pFormatEtc->dwAspect))
185 {
186 // return index of stored format
187 return i;
188 }
189 }
190
191 // error, format not found
192 return -1;
193}
194
195void *_ecore_win32_dnd_data_object_new(void *fmtetc, void *stgmeds, int count)
196{
197 IDataObject *object = new DataObject((FORMATETC *)fmtetc, (STGMEDIUM *)stgmeds, (UINT)count);
198 assert(object != NULL);
199 return object;
200}
201
202void _ecore_win32_dnd_data_object_free(void *data_object)
203{
204 if (!data_object)
205 return;
206
207 IDataObject *object = (IDataObject *)data_object;
208 object->Release();
209}
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_data_object.h b/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_data_object.h
deleted file mode 100644
index 3d289cf..0000000
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_data_object.h
+++ /dev/null
@@ -1,49 +0,0 @@
1#ifndef __ECORE_WIN32_DND_DATA_OBJECT_H__
2#define __ECORE_WIN32_DND_DATA_OBJECT_H__
3
4
5#define WIN32_LEAN_AND_MEAN
6#include <windows.h>
7#undef WIN32_LEAN_AND_MEAN
8#include <objbase.h>
9
10
11class DataObject : public IDataObject
12{
13 private:
14
15 LONG ref_count_;
16 int formats_num_;
17 FORMATETC *format_etc_;
18 STGMEDIUM *stg_medium_;
19
20 private: // internal helper function
21
22 int lookup_format_etc(FORMATETC *format_etc);
23
24 public: // structors
25
26 DataObject(FORMATETC *fmtetc, STGMEDIUM *stgmed, int count);
27 ~DataObject();
28
29 public: // IUnknown
30
31 HRESULT __stdcall QueryInterface(REFIID iid, void **ppvObject);
32 ULONG __stdcall AddRef();
33 ULONG __stdcall Release();
34
35 public: // IDataObject
36
37 HRESULT __stdcall GetData(FORMATETC *pFormatEtc, STGMEDIUM *pmedium);
38 HRESULT __stdcall GetDataHere(FORMATETC *pFormatEtc, STGMEDIUM *pmedium);
39 HRESULT __stdcall QueryGetData(FORMATETC *pFormatEtc);
40 HRESULT __stdcall GetCanonicalFormatEtc(FORMATETC *pFormatEct, FORMATETC *pFormatEtcOut);
41 HRESULT __stdcall SetData(FORMATETC *pFormatEtc, STGMEDIUM *pMedium, BOOL fRelease);
42 HRESULT __stdcall EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppEnumFormatEtc);
43 HRESULT __stdcall DAdvise(FORMATETC *pFormatEtc, DWORD advf, IAdviseSink *, DWORD *);
44 HRESULT __stdcall DUnadvise(DWORD dwConnection);
45 HRESULT __stdcall EnumDAdvise(IEnumSTATDATA **ppEnumAdvise);
46};
47
48
49#endif /* __ECORE_WIN32_DND_DATA_OBJECT_H__ */
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_drop_source.cpp b/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_drop_source.cpp
deleted file mode 100644
index bea7736..0000000
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_drop_source.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
1/*
2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
3 */
4
5#ifdef HAVE_CONFIG_H
6# include <config.h>
7#endif
8
9#include <assert.h>
10
11#include "ecore_win32_dnd_drop_source.h"
12
13#include "ecore_win32_private.h"
14
15// structors
16
17// reference count must ALWAYS start at 1
18DropSource::DropSource() : ref_count_(1)
19{ }
20
21
22// IUnknown
23
24HRESULT DropSource::QueryInterface(REFIID iid, void **ppvObject)
25{
26 // check to see what interface has been requested
27 if (iid == IID_IDropSource || iid == IID_IUnknown)
28 {
29 AddRef();
30 *ppvObject = this;
31 return S_OK;
32 }
33 *ppvObject = 0;
34 return E_NOINTERFACE;
35}
36
37ULONG DropSource::AddRef()
38{
39 return InterlockedIncrement(&ref_count_);
40}
41
42ULONG DropSource::Release()
43{
44 LONG count = InterlockedDecrement(&ref_count_);
45 if(count == 0)
46 {
47 delete this;
48 return 0;
49 }
50 return count;
51}
52
53
54// IDropSource
55
56HRESULT DropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState)
57{
58 // if the Escape key has been pressed since the last call, cancel the drop
59 if(fEscapePressed == TRUE)
60 return DRAGDROP_S_CANCEL;
61
62 // if the LeftMouse button has been released, then do the drop!
63 if((grfKeyState & MK_LBUTTON) == 0)
64 return DRAGDROP_S_DROP;
65
66 // continue with the drag-drop
67 return S_OK;
68}
69
70HRESULT DropSource::GiveFeedback(DWORD dwEffect __UNUSED__)
71{
72 return DRAGDROP_S_USEDEFAULTCURSORS;
73}
74
75
76// ecore_win32 private functions
77
78void *_ecore_win32_dnd_drop_source_new()
79{
80 IDropSource *object = new DropSource();
81 assert(object != NULL);
82 return object;
83}
84
85void _ecore_win32_dnd_drop_source_free(void *drop_source)
86{
87 if (!drop_source)
88 return;
89
90 IDropSource *object = (IDropSource *)drop_source;
91 object->Release();
92}
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_drop_source.h b/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_drop_source.h
deleted file mode 100644
index 9081f46..0000000
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_drop_source.h
+++ /dev/null
@@ -1,36 +0,0 @@
1#ifndef __ECORE_WIN32_DND_DROP_SOURCE_H__
2#define __ECORE_WIN32_DND_DROP_SOURCE_H__
3
4
5#define WIN32_LEAN_AND_MEAN
6#include <windows.h>
7#undef WIN32_LEAN_AND_MEAN
8#include <ole2.h>
9
10#include "Ecore_Win32.h"
11
12
13class DropSource : public IDropSource
14{
15 private:
16
17 LONG ref_count_;
18
19 public: // structors
20
21 DropSource();
22
23 public: // IUnknown
24
25 HRESULT __stdcall QueryInterface(REFIID iid, void ** ppvObject);
26 ULONG __stdcall AddRef();
27 ULONG __stdcall Release();
28
29 public: // IDropSource
30
31 HRESULT __stdcall QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState);
32 HRESULT __stdcall GiveFeedback(DWORD dwEffect);
33};
34
35
36#endif /* __ECORE_WIN32_DND_DROP_SOURCE_H__ */
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_drop_target.cpp b/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_drop_target.cpp
deleted file mode 100644
index e19fb5d..0000000
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_drop_target.cpp
+++ /dev/null
@@ -1,232 +0,0 @@
1/*
2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
3 */
4
5#ifdef HAVE_CONFIG_H
6# include <config.h>
7#endif
8
9#include "ecore_win32_dnd_drop_target.h"
10
11#include "ecore_win32_private.h"
12
13
14// structors
15
16DropTarget::DropTarget(HWND window, Ecore_Win32_Dnd_DropTarget_Callback callback, void *window_obj_ptr)
17 : ref_count_(1)
18 , window_(window)
19 , allow_drop_(false)
20 , drop_callback_(callback)
21 ,drop_callback_ptr_(window_obj_ptr)
22{ }
23
24
25// IUnknown
26
27HRESULT DropTarget::QueryInterface(REFIID iid, void **ppvObject)
28{
29 // check to see what interface has been requested
30 if (iid == IID_IDropTarget || iid == IID_IUnknown)
31 {
32 AddRef();
33 *ppvObject = this;
34 return S_OK;
35 }
36 *ppvObject = 0;
37
38 return E_NOINTERFACE;
39}
40
41ULONG DropTarget::AddRef()
42{
43 return InterlockedIncrement(&ref_count_);
44}
45
46ULONG DropTarget::Release()
47{
48 LONG count = InterlockedDecrement(&ref_count_);
49 if (count == 0)
50 {
51 delete this;
52 return 0;
53 }
54
55 return count;
56}
57
58
59// IDropTarget
60
61HRESULT DropTarget::DragEnter(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
62{
63 // does the dataobject contain data we want?
64 allow_drop_ = QueryDataObject(pDataObject) &&
65 (drop_callback_ == NULL ||
66 (drop_callback_(drop_callback_ptr_, ECORE_WIN32_DND_EVENT_DRAG_ENTER, pt.x, pt.y, NULL, 0) != 0));
67
68 if (allow_drop_)
69 {
70 // get the dropeffect based on keyboard state
71 *pdwEffect = DropEffect(grfKeyState, pt, *pdwEffect);
72 SetFocus(window_);
73 //PositionCursor(_hwnd, pt);
74 }
75 else
76 *pdwEffect = DROPEFFECT_NONE;
77 return S_OK;
78}
79
80HRESULT DropTarget::DragOver(DWORD grfKeyState, POINTL pt, DWORD * pdwEffect)
81{
82 allow_drop_ =
83 (drop_callback_ == NULL) ||
84 (drop_callback_(drop_callback_ptr_, ECORE_WIN32_DND_EVENT_DRAG_OVER, pt.x, pt.y, NULL, 0) != 0);
85
86 if (allow_drop_)
87 {
88 *pdwEffect = DropEffect(grfKeyState, pt, *pdwEffect);
89 //PositionCursor(m_hWnd, pt);
90 }
91 else
92 {
93 *pdwEffect = DROPEFFECT_NONE;
94 }
95
96 return S_OK;
97}
98
99HRESULT DropTarget::DragLeave()
100{
101 POINT pt;
102
103 GetCursorPos(&pt);
104 if (drop_callback_ != NULL)
105 drop_callback_(drop_callback_ptr_, ECORE_WIN32_DND_EVENT_DRAG_LEAVE, pt.x, pt.y, NULL, 0);
106
107 return S_OK;
108}
109
110HRESULT DropTarget::Drop(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
111{
112 if (allow_drop_)
113 {
114 // construct a FORMATETC object
115 FORMATETC fmtetc = { CF_TEXT, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
116 STGMEDIUM stgmed;
117
118 // See if the dataobject contains any TEXT stored as a HGLOBAL
119 if (pDataObject->QueryGetData(&fmtetc) == S_OK)
120 {
121 // Yippie! the data is there, so go get it!
122 if (pDataObject->GetData(&fmtetc, &stgmed) == S_OK)
123 {
124 // we asked for the data as a HGLOBAL, so access it appropriately
125 PVOID data = GlobalLock(stgmed.hGlobal);
126 UINT size = GlobalSize(stgmed.hGlobal);
127
128 if (drop_callback_ != NULL)
129 {
130 drop_callback_(drop_callback_ptr_,
131 ECORE_WIN32_DND_EVENT_DROP,
132 pt.x, pt.y,
133 data, size);
134 }
135
136 GlobalUnlock(stgmed.hGlobal);
137
138 // release the data using the COM API
139 ReleaseStgMedium(&stgmed);
140 }
141 }
142 *pdwEffect = DropEffect(grfKeyState, pt, *pdwEffect);
143 }
144 else
145 {
146 *pdwEffect = DROPEFFECT_NONE;
147 }
148
149 return S_OK;
150}
151
152
153// internal helper function
154
155DWORD DropTarget::DropEffect(DWORD grfKeyState, POINTL pt __UNUSED__, DWORD dwAllowed)
156{
157 DWORD dwEffect = 0;
158
159 // 1. check "pt" -> do we allow a drop at the specified coordinates?
160
161 // 2. work out that the drop-effect should be based on grfKeyState
162 if (grfKeyState & MK_CONTROL)
163 {
164 dwEffect = dwAllowed & DROPEFFECT_COPY;
165 }
166 else if (grfKeyState & MK_SHIFT)
167 {
168 dwEffect = dwAllowed & DROPEFFECT_MOVE;
169 }
170
171 // 3. no key-modifiers were specified (or drop effect not allowed), so
172 // base the effect on those allowed by the dropsource
173 if (dwEffect == 0)
174 {
175 if (dwAllowed & DROPEFFECT_COPY) dwEffect = DROPEFFECT_COPY;
176 if (dwAllowed & DROPEFFECT_MOVE) dwEffect = DROPEFFECT_MOVE;
177 }
178
179 return dwEffect;
180}
181
182bool DropTarget::QueryDataObject(IDataObject *pDataObject)
183{
184 FORMATETC fmtetc = { CF_TEXT, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
185
186 // does the data object support CF_TEXT using a HGLOBAL?
187 return pDataObject->QueryGetData(&fmtetc) == S_OK;
188}
189
190
191// ecore_win32 private functions
192
193void *_ecore_win32_dnd_register_drop_window(HWND hwnd, Ecore_Win32_Dnd_DropTarget_Callback callback, void *ptr)
194{
195 DropTarget *pDropTarget = new DropTarget(hwnd, callback, ptr);
196
197 if (pDropTarget == NULL)
198 return NULL;
199
200 // acquire a strong lock
201 if (FAILED(CoLockObjectExternal(pDropTarget, TRUE, FALSE)))
202 {
203 delete pDropTarget;
204 return NULL;
205 }
206
207 // tell OLE that the window is a drop target
208 if (FAILED(RegisterDragDrop(hwnd, pDropTarget)))
209 {
210 delete pDropTarget;
211 return NULL;
212 }
213
214 return pDropTarget;
215}
216
217void _ecore_win32_dnd_unregister_drop_window(HWND hwnd, void *drop_target)
218{
219 IDropTarget *pDropTarget = (IDropTarget *)drop_target;
220
221 if (drop_target == NULL)
222 return;
223
224 // remove drag+drop
225 RevokeDragDrop(hwnd);
226
227 // remove the strong lock
228 CoLockObjectExternal(pDropTarget, FALSE, TRUE);
229
230 // release our own reference
231 pDropTarget->Release();
232}
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_drop_target.h b/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_drop_target.h
deleted file mode 100644
index 24c3de3..0000000
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_drop_target.h
+++ /dev/null
@@ -1,47 +0,0 @@
1#ifndef __ECORE_WIN32_DND_DROP_TARGET_H__
2#define __ECORE_WIN32_DND_DROP_TARGET_H__
3
4
5#define WIN32_LEAN_AND_MEAN
6#include <windows.h>
7#undef WIN32_LEAN_AND_MEAN
8#include <ole2.h>
9
10#include "Ecore_Win32.h"
11
12
13class DropTarget : public IDropTarget
14{
15 private:
16
17 LONG ref_count_;
18 HWND window_;
19 bool allow_drop_;
20 Ecore_Win32_Dnd_DropTarget_Callback drop_callback_;
21 void *drop_callback_ptr_;
22
23 private: // internal helper function
24
25 DWORD DropEffect(DWORD grfKeyState, POINTL pt, DWORD dwAllowed);
26 bool QueryDataObject(IDataObject *pDataObject);
27
28 public: // structors
29
30 DropTarget(HWND hwnd, Ecore_Win32_Dnd_DropTarget_Callback callback, void *window_obj_ptr);
31
32public: // IUnknown
33
34 HRESULT __stdcall QueryInterface(REFIID iid, void ** ppvObject);
35 ULONG __stdcall AddRef();
36 ULONG __stdcall Release();
37
38 public: // IDropTarget
39
40 HRESULT __stdcall DragEnter(IDataObject * pDataObject, DWORD grfKeyState, POINTL pt, DWORD * pdwEffect);
41 HRESULT __stdcall DragOver(DWORD grfKeyState, POINTL pt, DWORD * pdwEffect);
42 HRESULT __stdcall DragLeave();
43 HRESULT __stdcall Drop(IDataObject * pDataObject, DWORD grfKeyState, POINTL pt, DWORD * pdwEffect);
44};
45
46
47#endif /* __ECORE_WIN32_DND_DROP_TARGET_H__ */
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_enumformatetc.cpp b/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_enumformatetc.cpp
deleted file mode 100644
index a3858bc..0000000
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_enumformatetc.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
1
2#include <ole2.h>
3
4#include "ecore_win32_dnd_enumformatetc.h"
5
6
7// structors
8
9CEnumFormatEtc::CEnumFormatEtc(FORMATETC *format_etc, int formats_num)
10 : ref_count_(1)
11 , index_(0)
12 , formats_num_(formats_num)
13 , format_etc_(new FORMATETC[formats_num])
14{
15 // make a new copy of each FORMATETC structure
16 for (unsigned int i = 0; i < formats_num_; i++)
17 {
18 DeepCopyFormatEtc(&format_etc_[i], &format_etc[i]);
19 }
20}
21
22CEnumFormatEtc::~CEnumFormatEtc()
23{
24 if (format_etc_)
25 {
26 // first free any DVTARGETDEVICE structures
27 for (ULONG i = 0; i < formats_num_; i++)
28 {
29 if (format_etc_[i].ptd)
30 CoTaskMemFree(format_etc_[i].ptd);
31 }
32
33 // now free the main array
34 delete[] format_etc_;
35 }
36}
37
38// IUnknown
39
40ULONG __stdcall CEnumFormatEtc::AddRef(void)
41{
42 // increment object reference count
43 return InterlockedIncrement(&ref_count_);
44}
45
46ULONG __stdcall CEnumFormatEtc::Release(void)
47{
48 // decrement object reference count
49 LONG count = InterlockedDecrement(&ref_count_);
50
51 if (count == 0)
52 {
53 delete this;
54 return 0;
55 }
56 else
57 {
58 return count;
59 }
60}
61
62HRESULT __stdcall CEnumFormatEtc::QueryInterface(REFIID iid, void **ppvObject)
63{
64 // check to see what interface has been requested
65 if ((iid == IID_IEnumFORMATETC) || (iid == IID_IUnknown))
66 {
67 AddRef();
68 *ppvObject = this;
69 return S_OK;
70 }
71 else
72 {
73 *ppvObject = 0;
74 return E_NOINTERFACE;
75 }
76}
77
78// IEnumFormatEtc
79
80HRESULT CEnumFormatEtc::Reset(void)
81{
82 index_ = 0;
83 return S_OK;
84}
85
86HRESULT CEnumFormatEtc::Skip(ULONG celt)
87{
88 index_ += celt;
89 return (index_ <= formats_num_) ? S_OK : S_FALSE;
90}
91
92HRESULT CEnumFormatEtc::Clone(IEnumFORMATETC **ppEnumFormatEtc)
93{
94 HRESULT hResult;
95
96 // make a duplicate enumerator
97 hResult = CreateEnumFormatEtc(formats_num_, format_etc_, ppEnumFormatEtc);
98
99 if (hResult == S_OK)
100 {
101 // manually set the index state
102 ((CEnumFormatEtc *)*ppEnumFormatEtc)->index_ = index_;
103 }
104
105 return hResult;
106}
107
108HRESULT CEnumFormatEtc::Next(ULONG celt, FORMATETC *pFormatEtc, ULONG *pceltFetched)
109{
110 ULONG copied = 0;
111
112 // validate arguments
113 if ((celt == 0) || (pFormatEtc == 0))
114 return E_INVALIDARG;
115
116 // copy the FORMATETC structures into the caller's buffer
117 while (index_ < formats_num_ && copied < celt)
118 {
119 DeepCopyFormatEtc(&pFormatEtc[copied], &format_etc_[index_]);
120 copied++;
121 index_++;
122 }
123
124 // store result
125 if (pceltFetched != 0)
126 *pceltFetched = copied;
127
128 // did we copy all that was requested?
129 return (copied == celt) ? S_OK : S_FALSE;
130}
131
132// external functions
133
134void DeepCopyFormatEtc(FORMATETC *dest, FORMATETC *source)
135{
136 // copy the source FORMATETC into dest
137 *dest = *source;
138
139 if (source->ptd)
140 {
141 // allocate memory for the DVTARGETDEVICE if necessary
142 dest->ptd = (DVTARGETDEVICE*)CoTaskMemAlloc(sizeof(DVTARGETDEVICE));
143
144 // copy the contents of the source DVTARGETDEVICE into dest->ptd
145 *(dest->ptd) = *(source->ptd);
146 }
147}
148
149HRESULT CreateEnumFormatEtc(UINT cfmt, FORMATETC *afmt, IEnumFORMATETC **ppEnumFormatEtc)
150{
151 if((cfmt == 0) || (afmt == 0) || (ppEnumFormatEtc == 0))
152 return E_INVALIDARG;
153
154 *ppEnumFormatEtc = new CEnumFormatEtc(afmt, cfmt);
155
156 return (*ppEnumFormatEtc) ? S_OK : E_OUTOFMEMORY;
157}
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_enumformatetc.h b/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_enumformatetc.h
deleted file mode 100644
index 9f17f56..0000000
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_dnd_enumformatetc.h
+++ /dev/null
@@ -1,50 +0,0 @@
1#ifndef __ECORE_WIN32_DND_ENUMFORMATETC_H__
2#define __ECORE_WIN32_DND_ENUMFORMATETC_H__
3
4
5#define WIN32_LEAN_AND_MEAN
6#include <windows.h>
7#undef WIN32_LEAN_AND_MEAN
8#include <objbase.h>
9
10
11class CEnumFormatEtc : public IEnumFORMATETC
12{
13 private:
14
15 LONG ref_count_; // Reference count for this COM interface
16 ULONG index_; // current enumerator index
17 ULONG formats_num_; // number of FORMATETC members
18 FORMATETC *format_etc_; // array of FORMATETC objects
19
20 public: // structors
21
22 CEnumFormatEtc(FORMATETC *pFormatEtc, int nNumFormats);
23
24 ~CEnumFormatEtc();
25
26 public: // IUnknown
27
28 HRESULT __stdcall QueryInterface (REFIID iid, void ** ppvObject);
29
30 ULONG __stdcall AddRef (void);
31
32 ULONG __stdcall Release (void);
33
34 public: // IEnumFormatEtc
35
36 HRESULT __stdcall Next (ULONG celt, FORMATETC * rgelt, ULONG * pceltFetched);
37
38 HRESULT __stdcall Skip (ULONG celt);
39
40 HRESULT __stdcall Reset (void);
41
42 HRESULT __stdcall Clone (IEnumFORMATETC ** ppEnumFormatEtc);
43};
44
45void DeepCopyFormatEtc(FORMATETC *dest, FORMATETC *source);
46
47HRESULT CreateEnumFormatEtc(UINT cfmt, FORMATETC *afmt, IEnumFORMATETC **ppEnumFormatEtc);
48
49
50#endif /* __ECORE_WIN32_DND_ENUMFORMATETC_H__ */
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_event.c b/libraries/ecore/src/lib/ecore_win32/ecore_win32_event.c
deleted file mode 100644
index 388776c..0000000
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_event.c
+++ /dev/null
@@ -1,1295 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdlib.h>
6#include <stdio.h> /* for printf */
7
8#define WIN32_LEAN_AND_MEAN
9#include <windows.h>
10#undef WIN32_LEAN_AND_MEAN
11#include <windowsx.h>
12
13#include <Eina.h>
14#include <Ecore.h>
15#include <Ecore_Input.h>
16
17#include "Ecore_Win32.h"
18#include "ecore_win32_private.h"
19
20
21typedef enum
22{
23 ECORE_WIN32_KEY_MASK_LSHIFT = 1 << 0,
24 ECORE_WIN32_KEY_MASK_RSHIFT = 1 << 1,
25 ECORE_WIN32_KEY_MASK_LCONTROL = 1 << 2,
26 ECORE_WIN32_KEY_MASK_RCONTROL = 1 << 3,
27 ECORE_WIN32_KEY_MASK_LMENU = 1 << 4,
28 ECORE_WIN32_KEY_MASK_RMENU = 1 << 5
29} Ecore_Win32_Key_Mask;
30
31/***** Private declarations *****/
32
33
34static Ecore_Win32_Window *_ecore_win32_mouse_down_last_window = NULL;
35static Ecore_Win32_Window *_ecore_win32_mouse_down_last_last_window = NULL;
36static long _ecore_win32_mouse_down_last_time = 0 ;
37static long _ecore_win32_mouse_down_last_last_time = 0 ;
38static int _ecore_win32_mouse_down_did_triple = 0;
39static int _ecore_win32_mouse_up_count = 0;
40static Ecore_Win32_Key_Mask _ecore_win32_key_mask = 0;
41
42static void _ecore_win32_event_free_key_down(void *data,
43 void *ev);
44
45static void _ecore_win32_event_free_key_up(void *data,
46 void *ev);
47
48static int _ecore_win32_event_keystroke_get(Ecore_Win32_Callback_Data *msg,
49 Eina_Bool is_down,
50 char **keyname,
51 char **keysymbol,
52 char **keycompose,
53 unsigned int *modifiers);
54
55static int _ecore_win32_event_char_get(int key,
56 char **keyname,
57 char **keysymbol,
58 char **keycompose,
59 unsigned int *modifiers);
60
61
62/***** Global functions definitions *****/
63
64void
65_ecore_win32_event_handle_key_press(Ecore_Win32_Callback_Data *msg,
66 int is_keystroke)
67{
68 Ecore_Event_Key *e;
69
70 INF("key pressed");
71
72 e = (Ecore_Event_Key *)calloc(1, sizeof(Ecore_Event_Key));
73 if (!e) return;
74
75 if (is_keystroke)
76 {
77 if (!_ecore_win32_event_keystroke_get(msg,
78 EINA_TRUE,
79 (char **)&e->keyname,
80 (char **)&e->key,
81 (char **)&e->string,
82 &e->modifiers))
83 {
84 free(e);
85 return;
86 }
87 }
88 else
89 {
90 if (!_ecore_win32_event_char_get(LOWORD(msg->window_param),
91 (char **)&e->keyname,
92 (char **)&e->key,
93 (char **)&e->string,
94 &e->modifiers))
95 {
96 free(e);
97 return;
98 }
99 }
100
101 e->window = (Ecore_Window)GetWindowLongPtr(msg->window, GWLP_USERDATA);
102 if (!e->window)
103 {
104 free(e);
105 return;
106 }
107 e->event_window = e->window;
108 e->timestamp = msg->timestamp;
109
110 _ecore_win32_event_last_time = e->timestamp;
111
112 ecore_event_add(ECORE_EVENT_KEY_DOWN, e, _ecore_win32_event_free_key_down, NULL);
113}
114
115void
116_ecore_win32_event_handle_key_release(Ecore_Win32_Callback_Data *msg)
117{
118 Ecore_Event_Key *e;
119
120 INF("key released");
121
122 e = (Ecore_Event_Key *)calloc(1, sizeof(Ecore_Event_Key));
123 if (!e) return;
124
125 if (!_ecore_win32_event_keystroke_get(msg,
126 EINA_FALSE,
127 (char **)&e->keyname,
128 (char **)&e->key,
129 (char **)&e->string,
130 &e->modifiers))
131 {
132 if (msg->discard_ctrl ||
133 !_ecore_win32_event_char_get(LOWORD(msg->window_param),
134 (char **)&e->keyname,
135 (char **)&e->key,
136 (char **)&e->string,
137 &e->modifiers))
138 {
139 free(e);
140 return;
141 }
142 }
143
144 e->window = (Ecore_Window)GetWindowLongPtr(msg->window, GWLP_USERDATA);
145 if (!e->window)
146 {
147 free(e);
148 return;
149 }
150 e->event_window = e->window;
151 e->timestamp = msg->timestamp;
152
153 _ecore_win32_event_last_time = e->timestamp;
154
155 ecore_event_add(ECORE_EVENT_KEY_UP, e, _ecore_win32_event_free_key_up, NULL);
156}
157
158void
159_ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg,
160 int button)
161{
162 Ecore_Win32_Window *window;
163
164 INF("mouse button pressed");
165
166 window = (Ecore_Win32_Window *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
167
168 if (button > 3)
169 {
170 Ecore_Event_Mouse_Wheel *e;
171
172 e = (Ecore_Event_Mouse_Wheel *)calloc(1, sizeof(Ecore_Event_Mouse_Wheel));
173 if (!e) return;
174
175 e->window = (Ecore_Window)window;
176 e->event_window = e->window;
177 e->direction = 0;
178 /* wheel delta is positive or negative, never 0 */
179 e->z = GET_WHEEL_DELTA_WPARAM(msg->window_param) > 0 ? -1 : 1;
180 e->x = GET_X_LPARAM(msg->data_param);
181 e->y = GET_Y_LPARAM(msg->data_param);
182 e->timestamp = msg->timestamp;
183
184 _ecore_win32_event_last_time = e->timestamp;
185 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
186
187 ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, e, NULL, NULL);
188 }
189 else
190 {
191 {
192 Ecore_Event_Mouse_Move *e;
193
194 e = (Ecore_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Event_Mouse_Move));
195 if (!e) return;
196
197 e->window = (Ecore_Window)window;
198 e->event_window = e->window;
199 e->x = GET_X_LPARAM(msg->data_param);
200 e->y = GET_Y_LPARAM(msg->data_param);
201 e->timestamp = msg->timestamp;
202
203 _ecore_win32_event_last_time = e->timestamp;
204 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
205
206 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
207 }
208
209 {
210 Ecore_Event_Mouse_Button *e;
211
212 if (_ecore_win32_mouse_down_did_triple)
213 {
214 _ecore_win32_mouse_down_last_window = NULL;
215 _ecore_win32_mouse_down_last_last_window = NULL;
216 _ecore_win32_mouse_down_last_time = 0;
217 _ecore_win32_mouse_down_last_last_time = 0;
218 }
219
220 e = (Ecore_Event_Mouse_Button *)calloc(1, sizeof(Ecore_Event_Mouse_Button));
221 if (!e) return;
222
223 e->window = (Ecore_Window)window;
224 e->event_window = e->window;
225 e->buttons = button;
226 e->x = GET_X_LPARAM(msg->data_param);
227 e->y = GET_Y_LPARAM(msg->data_param);
228 e->timestamp = msg->timestamp;
229
230 if (((e->timestamp - _ecore_win32_mouse_down_last_time) <= (unsigned long)(1000 * _ecore_win32_double_click_time)) &&
231 (e->window == (Ecore_Window)_ecore_win32_mouse_down_last_window))
232 e->double_click = 1;
233
234 if (((e->timestamp - _ecore_win32_mouse_down_last_last_time) <= (unsigned long)(2 * 1000 * _ecore_win32_double_click_time)) &&
235 (e->window == (Ecore_Window)_ecore_win32_mouse_down_last_window) &&
236 (e->window == (Ecore_Window)_ecore_win32_mouse_down_last_last_window))
237 {
238 e->triple_click = 1;
239 _ecore_win32_mouse_down_did_triple = 1;
240 }
241 else
242 _ecore_win32_mouse_down_did_triple = 0;
243
244 if (!e->double_click && !e->triple_click)
245 _ecore_win32_mouse_up_count = 0;
246
247 _ecore_win32_event_last_time = e->timestamp;
248 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
249
250 if (!_ecore_win32_mouse_down_did_triple)
251 {
252 _ecore_win32_mouse_down_last_last_window = _ecore_win32_mouse_down_last_window;
253 _ecore_win32_mouse_down_last_window = (Ecore_Win32_Window *)e->window;
254 _ecore_win32_mouse_down_last_last_time = _ecore_win32_mouse_down_last_time;
255 _ecore_win32_mouse_down_last_time = e->timestamp;
256 }
257
258 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL);
259 }
260 }
261}
262
263void
264_ecore_win32_event_handle_button_release(Ecore_Win32_Callback_Data *msg,
265 int button)
266{
267 Ecore_Win32_Window *window;
268
269 INF("mouse button released");
270
271 window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
272
273 {
274 Ecore_Event_Mouse_Move *e;
275
276 e = (Ecore_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Event_Mouse_Move));
277 if (!e) return;
278
279 e->window = (Ecore_Window)window;
280 e->event_window = e->window;
281 e->x = GET_X_LPARAM(msg->data_param);
282 e->y = GET_Y_LPARAM(msg->data_param);
283 e->timestamp = msg->timestamp;
284
285 _ecore_win32_event_last_time = e->timestamp;
286 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
287
288 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
289 }
290
291 {
292 Ecore_Event_Mouse_Button *e;
293
294 e = (Ecore_Event_Mouse_Button *)calloc(1, sizeof(Ecore_Event_Mouse_Button));
295 if (!e) return;
296
297 e->window = (Ecore_Window)window;
298 e->event_window = e->window;
299 e->buttons = button;
300 e->x = GET_X_LPARAM(msg->data_param);
301 e->y = GET_Y_LPARAM(msg->data_param);
302 e->timestamp = msg->timestamp;
303
304 _ecore_win32_mouse_up_count++;
305
306 if ((_ecore_win32_mouse_up_count >= 2) &&
307 ((e->timestamp - _ecore_win32_mouse_down_last_time) <= (unsigned long)(1000 * _ecore_win32_double_click_time)) &&
308 (e->window == (Ecore_Window)_ecore_win32_mouse_down_last_window))
309 e->double_click = 1;
310
311 if ((_ecore_win32_mouse_up_count >= 3) &&
312 ((e->timestamp - _ecore_win32_mouse_down_last_last_time) <= (unsigned long)(2 * 1000 * _ecore_win32_double_click_time)) &&
313 (e->window == (Ecore_Window)_ecore_win32_mouse_down_last_window) &&
314 (e->window == (Ecore_Window)_ecore_win32_mouse_down_last_last_window))
315 e->triple_click = 1;
316
317 _ecore_win32_event_last_time = e->timestamp;
318 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
319
320 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL);
321 }
322}
323
324void
325_ecore_win32_event_handle_motion_notify(Ecore_Win32_Callback_Data *msg)
326{
327 Ecore_Event_Mouse_Move *e;
328
329 INF("mouse moved");
330
331 e = (Ecore_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Event_Mouse_Move));
332 if (!e) return;
333
334 e->window = (Ecore_Window)GetWindowLongPtr(msg->window, GWLP_USERDATA);
335 e->event_window = e->window;
336 e->x = GET_X_LPARAM(msg->data_param);
337 e->y = GET_Y_LPARAM(msg->data_param);
338 e->timestamp = msg->timestamp;
339
340 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
341}
342
343void
344_ecore_win32_event_handle_enter_notify(Ecore_Win32_Callback_Data *msg)
345{
346 {
347 Ecore_Event_Mouse_Move *e;
348
349 INF("mouse in");
350
351 e = (Ecore_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Event_Mouse_Move));
352 if (!e) return;
353
354 e->window = (Ecore_Window)GetWindowLongPtr(msg->window, GWLP_USERDATA);
355 e->event_window = e->window;
356 e->x = msg->x;
357 e->y = msg->y;
358 e->timestamp = msg->timestamp;
359
360 _ecore_win32_event_last_time = e->timestamp;
361 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
362
363 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
364 }
365
366 {
367 Ecore_Win32_Event_Mouse_In *e;
368
369 e = (Ecore_Win32_Event_Mouse_In *)calloc(1, sizeof(Ecore_Win32_Event_Mouse_In));
370 if (!e) return;
371
372 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
373 e->x = msg->x;
374 e->y = msg->y;
375 e->timestamp = msg->timestamp ;
376
377 _ecore_win32_event_last_time = e->timestamp;
378
379 ecore_event_add(ECORE_WIN32_EVENT_MOUSE_IN, e, NULL, NULL);
380 }
381}
382
383void
384_ecore_win32_event_handle_leave_notify(Ecore_Win32_Callback_Data *msg)
385{
386 {
387 Ecore_Event_Mouse_Move *e;
388
389 INF("mouse out");
390
391 e = (Ecore_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Event_Mouse_Move));
392 if (!e) return;
393
394 e->window = (Ecore_Window)GetWindowLongPtr(msg->window, GWLP_USERDATA);
395 e->event_window = e->window;
396 e->x = msg->x;
397 e->y = msg->y;
398 e->timestamp = msg->timestamp;
399
400 _ecore_win32_event_last_time = e->timestamp;
401 _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
402
403 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
404 }
405
406 {
407 Ecore_Win32_Event_Mouse_Out *e;
408
409 e = (Ecore_Win32_Event_Mouse_Out *)calloc(1, sizeof(Ecore_Win32_Event_Mouse_Out));
410 if (!e) return;
411
412 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
413 e->x = msg->x;
414 e->y = msg->y;
415 e->timestamp = msg->timestamp;
416
417 _ecore_win32_event_last_time = e->timestamp;
418
419 ecore_event_add(ECORE_WIN32_EVENT_MOUSE_OUT, e, NULL, NULL);
420 }
421}
422
423void
424_ecore_win32_event_handle_focus_in(Ecore_Win32_Callback_Data *msg)
425{
426 Ecore_Win32_Event_Window_Focus_In *e;
427
428 INF("focus in");
429
430 e = (Ecore_Win32_Event_Window_Focus_In *)calloc(1, sizeof(Ecore_Win32_Event_Window_Focus_In));
431 if (!e) return;
432
433 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
434
435 e->timestamp = _ecore_win32_event_last_time;
436 _ecore_win32_event_last_time = e->timestamp;
437
438 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_FOCUS_IN, e, NULL, NULL);
439}
440
441void
442_ecore_win32_event_handle_focus_out(Ecore_Win32_Callback_Data *msg)
443{
444 Ecore_Win32_Event_Window_Focus_Out *e;
445
446 INF("focus out");
447
448 e = (Ecore_Win32_Event_Window_Focus_Out *)calloc(1, sizeof(Ecore_Win32_Event_Window_Focus_Out));
449 if (!e) return;
450
451 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
452
453 e->timestamp = _ecore_win32_event_last_time;
454 _ecore_win32_event_last_time = e->timestamp;
455
456 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT, e, NULL, NULL);
457}
458
459void
460_ecore_win32_event_handle_expose(Ecore_Win32_Callback_Data *msg)
461{
462 Ecore_Win32_Event_Window_Damage *e;
463
464 INF("window expose");
465
466 e = (Ecore_Win32_Event_Window_Damage *)calloc(1, sizeof(Ecore_Win32_Event_Window_Damage));
467 if (!e) return;
468
469 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
470
471 e->x = msg->update.left;
472 e->y = msg->update.top;
473 e->width = msg->update.right - msg->update.left;
474 e->height = msg->update.bottom - msg->update.top;
475
476 e->timestamp = _ecore_win32_event_last_time;
477
478 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_DAMAGE, e, NULL, NULL);
479}
480
481void
482_ecore_win32_event_handle_create_notify(Ecore_Win32_Callback_Data *msg)
483{
484 Ecore_Win32_Event_Window_Create *e;
485
486 INF("window create notify");
487
488 e = calloc(1, sizeof(Ecore_Win32_Event_Window_Create));
489 if (!e) return;
490
491 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
492
493 e->timestamp = _ecore_win32_event_last_time;
494
495 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_CREATE, e, NULL, NULL);
496}
497
498void
499_ecore_win32_event_handle_destroy_notify(Ecore_Win32_Callback_Data *msg)
500{
501 Ecore_Win32_Event_Window_Destroy *e;
502
503 INF("window destroy notify");
504
505 e = calloc(1, sizeof(Ecore_Win32_Event_Window_Destroy));
506 if (!e) return;
507
508 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
509
510 e->timestamp = _ecore_win32_event_last_time;
511 if (e->window == _ecore_win32_event_last_window) _ecore_win32_event_last_window = NULL;
512
513 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_DESTROY, e, NULL, NULL);
514}
515
516void
517_ecore_win32_event_handle_map_notify(Ecore_Win32_Callback_Data *msg)
518{
519 Ecore_Win32_Event_Window_Show *e;
520
521 INF("window map notify");
522
523 e = calloc(1, sizeof(Ecore_Win32_Event_Window_Show));
524 if (!e) return;
525
526 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
527
528 e->timestamp = _ecore_win32_event_last_time;
529
530 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_SHOW, e, NULL, NULL);
531}
532
533void
534_ecore_win32_event_handle_unmap_notify(Ecore_Win32_Callback_Data *msg)
535{
536 Ecore_Win32_Event_Window_Hide *e;
537
538 INF("window unmap notify");
539
540 e = calloc(1, sizeof(Ecore_Win32_Event_Window_Hide));
541 if (!e) return;
542
543 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
544
545 e->timestamp = _ecore_win32_event_last_time;
546
547 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_HIDE, e, NULL, NULL);
548}
549
550void
551_ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg)
552{
553 WINDOWINFO wi;
554 Ecore_Win32_Event_Window_Configure *e;
555 WINDOWPOS *window_pos;
556
557 INF("window configure notify");
558
559 e = calloc(1, sizeof(Ecore_Win32_Event_Window_Configure));
560 if (!e) return;
561
562 window_pos = (WINDOWPOS *)msg->data_param;
563 wi.cbSize = sizeof(WINDOWINFO);
564 if (!GetWindowInfo(window_pos->hwnd, &wi))
565 {
566 free(e);
567 return;
568 }
569
570 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
571 e->abovewin = (void *)GetWindowLongPtr(window_pos->hwndInsertAfter, GWLP_USERDATA);
572 e->x = wi.rcClient.left;
573 e->y = wi.rcClient.top;
574 e->width = wi.rcClient.right - wi.rcClient.left;
575 e->height = wi.rcClient.bottom - wi.rcClient.top;
576 e->timestamp = _ecore_win32_event_last_time;
577
578 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_CONFIGURE, e, NULL, NULL);
579}
580
581void
582_ecore_win32_event_handle_resize(Ecore_Win32_Callback_Data *msg)
583{
584 RECT rect;
585 Ecore_Win32_Event_Window_Resize *e;
586
587 INF("window resize");
588
589 if (!GetClientRect(msg->window, &rect))
590 return;
591
592 e = calloc(1, sizeof(Ecore_Win32_Event_Window_Resize));
593 if (!e) return;
594
595 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
596 e->width = rect.right - rect.left;
597 e->height = rect.bottom - rect.top;
598 e->timestamp = _ecore_win32_event_last_time;
599
600 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_RESIZE, e, NULL, NULL);
601}
602
603void
604_ecore_win32_event_handle_delete_request(Ecore_Win32_Callback_Data *msg)
605{
606 Ecore_Win32_Event_Window_Delete_Request *e;
607
608 INF("window delete request");
609
610 e = calloc(1, sizeof(Ecore_Win32_Event_Window_Delete_Request));
611 if (!e) return;
612
613 e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
614 e->timestamp = _ecore_win32_event_last_time;
615
616 ecore_event_add(ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST, e, NULL, NULL);
617}
618
619
620/***** Private functions definitions *****/
621
622static void
623_ecore_win32_event_free_key_down(void *data __UNUSED__,
624 void *ev)
625{
626 Ecore_Event_Key *e;
627
628 e = ev;
629 if (e->keyname) free((char *)e->keyname);
630 if (e->key) free((char *)e->key);
631 if (e->string) free((char *)e->string);
632 free(e);
633}
634
635static void
636_ecore_win32_event_free_key_up(void *data __UNUSED__,
637 void *ev)
638{
639 Ecore_Event_Key *e;
640
641 e = ev;
642 if (e->keyname) free((char *)e->keyname);
643 if (e->key) free((char *)e->key);
644 if (e->string) free((char *)e->string);
645 free(e);
646}
647
648static int
649_ecore_win32_event_keystroke_get(Ecore_Win32_Callback_Data *msg,
650 Eina_Bool is_down,
651 char **keyname,
652 char **keysymbol,
653 char **keycompose,
654 unsigned int *modifiers)
655{
656 WCHAR buf[3];
657 char delete_string[2] = { 0x7f, 0 };
658 char *kn = NULL;
659 char *ks = NULL;
660 char *kc = NULL;
661 int key;
662 int is_extended;
663
664 key = msg->window_param;
665 is_extended = msg->data_param & 0x01000000;
666
667 *keyname = NULL;
668 *keysymbol = NULL;
669 *keycompose = NULL;
670
671 switch (key)
672 {
673 /* Keystroke */
674 case VK_PRIOR:
675 if (is_extended)
676 {
677 kn = "Prior";
678 ks = "Prior";
679 kc = NULL;
680 }
681 else
682 {
683 kn = "KP_Prior";
684 ks = "KP_9";
685 kc = "KP_Prior";
686 }
687 break;
688 case VK_NEXT:
689 if (is_extended)
690 {
691 kn = "Next";
692 ks = "Next";
693 kc = NULL;
694 }
695 else
696 {
697 kn = "KP_Next";
698 ks = "KP_3";
699 kc = "KP_Next";
700 }
701 break;
702 case VK_END:
703 if (is_extended)
704 {
705 kn = "End";
706 ks = "End";
707 kc = NULL;
708 }
709 else
710 {
711 kn = "KP_End";
712 ks = "KP_1";
713 kc = "KP_End";
714 }
715 break;
716 case VK_HOME:
717 if (is_extended)
718 {
719 kn = "Home";
720 ks = "Home";
721 kc = NULL;
722 }
723 else
724 {
725 kn = "KP_Home";
726 ks = "KP_7";
727 kc = "KP_Home";
728 }
729 break;
730 case VK_LEFT:
731 if (is_extended)
732 {
733 kn = "Left";
734 ks = "Left";
735 kc = NULL;
736 }
737 else
738 {
739 kn = "KP_Left";
740 ks = "KP_4";
741 kc = "KP_Left";
742 }
743 break;
744 case VK_UP:
745 if (is_extended)
746 {
747 kn = "Up";
748 ks = "Up";
749 kc = NULL;
750 }
751 else
752 {
753 kn = "KP_Up";
754 ks = "KP_8";
755 kc = "KP_Up";
756 }
757 break;
758 case VK_RIGHT:
759 if (is_extended)
760 {
761 kn = "Right";
762 ks = "Right";
763 kc = NULL;
764 }
765 else
766 {
767 kn = "KP_Right";
768 ks = "KP_6";
769 kc = "KP_Right";
770 }
771 break;
772 case VK_DOWN:
773 if (is_extended)
774 {
775 kn = "Down";
776 ks = "Down";
777 kc = NULL;
778 }
779 else
780 {
781 kn = "KP_Down";
782 ks = "KP_2";
783 kc = "KP_Down";
784 }
785 break;
786 case VK_INSERT:
787 if (is_extended)
788 {
789 kn = "Insert";
790 ks = "Insert";
791 kc = NULL;
792 }
793 else
794 {
795 kn = "KP_Insert";
796 ks = "KP_0";
797 kc = "KP_Insert";
798 }
799 break;
800 case VK_DELETE:
801 if (is_extended)
802 {
803 kn = "Delete";
804 ks = "Delete";
805 kc = delete_string;
806 }
807 else
808 {
809 kn = "KP_Delete";
810 ks = "KP_Decimal";
811 kc = "KP_Delete";
812 }
813 break;
814 case VK_SHIFT:
815 {
816 SHORT res;
817
818 if (is_down)
819 {
820 res = GetKeyState(VK_LSHIFT);
821 if (res & 0x8000)
822 {
823 _ecore_win32_key_mask |= ECORE_WIN32_KEY_MASK_LSHIFT;
824 kn = "Shift_L";
825 ks = "Shift_L";
826 kc = "";
827 }
828 res = GetKeyState(VK_RSHIFT);
829 if (res & 0x8000)
830 {
831 _ecore_win32_key_mask |= ECORE_WIN32_KEY_MASK_RSHIFT;
832 kn = "Shift_R";
833 ks = "Shift_R";
834 kc = "";
835 }
836 *modifiers &= ~ECORE_EVENT_MODIFIER_SHIFT;
837 }
838 else /* is_up */
839 {
840 res = GetKeyState(VK_LSHIFT);
841 if (!(res & 0x8000) &&
842 (_ecore_win32_key_mask & ECORE_WIN32_KEY_MASK_LSHIFT))
843 {
844 kn = "Shift_L";
845 ks = "Shift_L";
846 kc = "";
847 _ecore_win32_key_mask &= ~ECORE_WIN32_KEY_MASK_LSHIFT;
848 }
849 res = GetKeyState(VK_RSHIFT);
850 if (!(res & 0x8000) &&
851 (_ecore_win32_key_mask & ECORE_WIN32_KEY_MASK_RSHIFT))
852 {
853 kn = "Shift_R";
854 ks = "Shift_R";
855 kc = "";
856 _ecore_win32_key_mask &= ~ECORE_WIN32_KEY_MASK_RSHIFT;
857 }
858 *modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
859 }
860 break;
861 }
862 case VK_CONTROL:
863 {
864 SHORT res;
865
866 if (msg->discard_ctrl)
867 return 0;
868
869 if (is_down)
870 {
871 res = GetKeyState(VK_LCONTROL);
872 if (res & 0x8000)
873 {
874 _ecore_win32_key_mask |= ECORE_WIN32_KEY_MASK_LCONTROL;
875 kn = "Control_L";
876 ks = "Control_L";
877 kc = "";
878 break;
879 }
880 res = GetKeyState(VK_RCONTROL);
881 if (res & 0x8000)
882 {
883 _ecore_win32_key_mask |= ECORE_WIN32_KEY_MASK_RCONTROL;
884 kn = "Control_R";
885 ks = "Control_R";
886 kc = "";
887 break;
888 }
889 *modifiers |= ECORE_EVENT_MODIFIER_CTRL;
890 }
891 else /* is_up */
892 {
893 res = GetKeyState(VK_LCONTROL);
894 if (!(res & 0x8000) &&
895 (_ecore_win32_key_mask & ECORE_WIN32_KEY_MASK_LCONTROL))
896 {
897 kn = "Control_L";
898 ks = "Control_L";
899 kc = "";
900 _ecore_win32_key_mask &= ~ECORE_WIN32_KEY_MASK_LCONTROL;
901 break;
902 }
903 res = GetKeyState(VK_RCONTROL);
904 if (!(res & 0x8000) &&
905 (_ecore_win32_key_mask & ECORE_WIN32_KEY_MASK_RCONTROL))
906 {
907 kn = "Control_R";
908 ks = "Control_R";
909 kc = "";
910 _ecore_win32_key_mask &= ~ECORE_WIN32_KEY_MASK_RCONTROL;
911 break;
912 }
913 *modifiers &= ~ECORE_EVENT_MODIFIER_CTRL;
914 }
915 break;
916 }
917 case VK_MENU:
918 {
919 SHORT res;
920
921 if (is_down)
922 {
923 res = GetKeyState(VK_LMENU);
924 if (res & 0x8000)
925 {
926 _ecore_win32_key_mask |= ECORE_WIN32_KEY_MASK_LMENU;
927 kn = "Alt_L";
928 ks = "Alt_L";
929 kc = "";
930 }
931 res = GetKeyState(VK_RMENU);
932 if (res & 0x8000)
933 {
934 _ecore_win32_key_mask |= ECORE_WIN32_KEY_MASK_RMENU;
935 kn = "Alt_R";
936 ks = "Alt_R";
937 kc = "";
938 }
939 *modifiers |= ECORE_EVENT_MODIFIER_ALT;
940 }
941 else /* is_up */
942 {
943 res = GetKeyState(VK_LMENU);
944 if (!(res & 0x8000) &&
945 (_ecore_win32_key_mask & ECORE_WIN32_KEY_MASK_LMENU))
946 {
947 kn = "Alt_L";
948 ks = "Alt_L";
949 kc = "";
950 _ecore_win32_key_mask &= ~ECORE_WIN32_KEY_MASK_LMENU;
951 }
952 res = GetKeyState(VK_RMENU);
953 if (!(res & 0x8000) &&
954 (_ecore_win32_key_mask & ECORE_WIN32_KEY_MASK_RMENU))
955 {
956 kn = "Alt_R";
957 ks = "Alt_R";
958 kc = "";
959 _ecore_win32_key_mask &= ~ECORE_WIN32_KEY_MASK_RMENU;
960 }
961 *modifiers &= ~ECORE_EVENT_MODIFIER_ALT;
962 }
963 break;
964 }
965 case VK_LWIN:
966 {
967 if (is_down)
968 {
969 kn = "Super_L";
970 ks = "Super_L";
971 kc = "";
972 *modifiers |= ECORE_EVENT_MODIFIER_WIN;
973 }
974 else /* is_up */
975 {
976 kn = "Super_L";
977 ks = "Super_L";
978 kc = "";
979 *modifiers &= ~ECORE_EVENT_MODIFIER_WIN;
980 }
981 break;
982 }
983 case VK_RWIN:
984 {
985 if (is_down)
986 {
987 kn = "Super_R";
988 ks = "Super_R";
989 kc = "";
990 *modifiers |= ECORE_EVENT_MODIFIER_WIN;
991 }
992 else /* is_up */
993 {
994 kn = "Super_R";
995 ks = "Super_R";
996 kc = "";
997 *modifiers &= ~ECORE_EVENT_MODIFIER_WIN;
998 }
999 break;
1000 }
1001 case VK_F1:
1002 kn = "F1";
1003 ks = "F1";
1004 kc = "";
1005 break;
1006 case VK_F2:
1007 kn = "F2";
1008 ks = "F2";
1009 kc = "";
1010 break;
1011 case VK_F3:
1012 kn = "F3";
1013 ks = "F3";
1014 kc = "";
1015 break;
1016 case VK_F4:
1017 kn = "F4";
1018 ks = "F4";
1019 kc = "";
1020 break;
1021 case VK_F5:
1022 kn = "F5";
1023 ks = "F5";
1024 kc = "";
1025 break;
1026 case VK_F6:
1027 kn = "F6";
1028 ks = "F6";
1029 kc = "";
1030 break;
1031 case VK_F7:
1032 kn = "F7";
1033 ks = "F7";
1034 kc = "";
1035 break;
1036 case VK_F8:
1037 kn = "F8";
1038 ks = "F8";
1039 kc = "";
1040 break;
1041 case VK_F9:
1042 kn = "F9";
1043 ks = "F9";
1044 kc = "";
1045 break;
1046 case VK_F10:
1047 kn = "F10";
1048 ks = "F10";
1049 kc = "";
1050 break;
1051 case VK_F11:
1052 kn = "F11";
1053 ks = "F11";
1054 kc = "";
1055 break;
1056 case VK_F12:
1057 kn = "F12";
1058 ks = "F12";
1059 kc = "";
1060 break;
1061 case VK_F13:
1062 kn = "F13";
1063 ks = "F13";
1064 kc = "";
1065 break;
1066 case VK_F14:
1067 kn = "F14";
1068 ks = "F14";
1069 kc = "";
1070 break;
1071 case VK_F15:
1072 kn = "F15";
1073 ks = "F15";
1074 kc = "";
1075 break;
1076 case VK_F16:
1077 kn = "F16";
1078 ks = "F16";
1079 kc = "";
1080 break;
1081 case VK_F17:
1082 kn = "F17";
1083 ks = "F17";
1084 kc = "";
1085 break;
1086 case VK_F18:
1087 kn = "F18";
1088 ks = "F18";
1089 kc = "";
1090 break;
1091 case VK_F19:
1092 kn = "F19";
1093 ks = "F19";
1094 kc = "";
1095 break;
1096 case VK_F20:
1097 kn = "F20";
1098 ks = "F20";
1099 kc = "";
1100 break;
1101 case VK_F21:
1102 kn = "F21";
1103 ks = "F21";
1104 kc = "";
1105 break;
1106 case VK_F22:
1107 kn = "F22";
1108 ks = "F22";
1109 kc = "";
1110 break;
1111 case VK_F23:
1112 kn = "F23";
1113 ks = "F23";
1114 kc = "";
1115 break;
1116 case VK_F24:
1117 kn = "F24";
1118 ks = "F24";
1119 kc = "";
1120 break;
1121 default:
1122 {
1123 /* other non keystroke characters */
1124 BYTE kbd_state[256];
1125 int res;
1126
1127 if (is_down)
1128 return 0;
1129
1130 if (!GetKeyboardState(kbd_state))
1131 return 0;
1132
1133 res = ToUnicode(msg->window_param,
1134 MapVirtualKey(msg->window_param, 2),
1135 kbd_state, buf, 3, 0);
1136 if (res == 1)
1137 {
1138 /* FIXME: might be troublesome for non european languages */
1139 /* in that case, UNICODE should be used, I guess */
1140 buf[1] = '\0';
1141 kn = (char *)buf;
1142 ks = (char *)buf;
1143 kc = (char *)buf;
1144
1145 res = GetAsyncKeyState(VK_SHIFT);
1146 if (res & 0x8000)
1147 *modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
1148 else
1149 *modifiers &= ~ECORE_EVENT_MODIFIER_SHIFT;
1150
1151 res = GetKeyState(VK_CONTROL);
1152 if (res & 0x8000)
1153 *modifiers |= ECORE_EVENT_MODIFIER_CTRL;
1154 else
1155 *modifiers &= ~ECORE_EVENT_MODIFIER_CTRL;
1156
1157 res = GetKeyState(VK_MENU);
1158 if (res & 0x8000)
1159 *modifiers |= ECORE_EVENT_MODIFIER_ALT;
1160 else
1161 *modifiers &= ~ECORE_EVENT_MODIFIER_ALT;
1162
1163 break;
1164 }
1165 return 0;
1166 }
1167 }
1168
1169 *keyname = strdup(kn);
1170 if (!*keyname) return 0;
1171 *keysymbol = strdup(ks);
1172 if (!*keysymbol)
1173 {
1174 free(*keyname);
1175 *keyname = NULL;
1176 return 0;
1177 }
1178 if (!kc)
1179 *keycompose = NULL;
1180 else
1181 {
1182 *keycompose = strdup(kc);
1183 if (!*keycompose)
1184 {
1185 free(*keyname);
1186 free(*keysymbol);
1187 *keyname = NULL;
1188 *keysymbol = NULL;
1189 return 0;
1190 }
1191 }
1192
1193 return 1;
1194}
1195
1196static int
1197_ecore_win32_event_char_get(int key,
1198 char **keyname,
1199 char **keysymbol,
1200 char **keycompose,
1201 unsigned int *modifiers)
1202{
1203 char *kn = NULL;
1204 char *ks = NULL;
1205 char *kc = NULL;
1206 char buf[2];
1207 SHORT res;
1208
1209 *keyname = NULL;
1210 *keysymbol = NULL;
1211 *keycompose = NULL;
1212
1213 switch (key)
1214 {
1215 case VK_PROCESSKEY:
1216 break;
1217 case VK_BACK:
1218 kn = "BackSpace";
1219 ks = "BackSpace";
1220 kc = "\b";
1221 break;
1222 case VK_TAB:
1223 kn = "Tab";
1224 ks = "Tab";
1225 kc = "\t";
1226 break;
1227 case 0x0a:
1228 /* Line feed (Shift + Enter) */
1229 kn = "LineFeed";
1230 ks = "LineFeed";
1231 kc = "LineFeed";
1232 break;
1233 case VK_RETURN:
1234 kn = "Return";
1235 ks = "Return";
1236 kc = "\n";
1237 break;
1238 case VK_ESCAPE:
1239 kn = "Escape";
1240 ks = "Escape";
1241 kc = "\e";
1242 break;
1243 case VK_SPACE:
1244 kn = "space";
1245 ks = "space";
1246 kc = " ";
1247 break;
1248 default:
1249 /* displayable characters */
1250 buf[0] = key;
1251 buf[1] = '\0';
1252 kn = buf;
1253 ks = buf;
1254 kc = buf;
1255 break;
1256 }
1257 *keyname = strdup(kn);
1258 if (!*keyname) return 0;
1259 *keysymbol = strdup(ks);
1260 if (!*keysymbol)
1261 {
1262 free(*keyname);
1263 *keyname = NULL;
1264 return 0;
1265 }
1266 *keycompose = strdup(kc);
1267 if (!*keycompose)
1268 {
1269 free(*keyname);
1270 free(*keysymbol);
1271 *keyname = NULL;
1272 *keysymbol = NULL;
1273 return 0;
1274 }
1275
1276 res = GetAsyncKeyState(VK_SHIFT);
1277 if (res & 0x8000)
1278 *modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
1279 else
1280 *modifiers &= ~ECORE_EVENT_MODIFIER_SHIFT;
1281
1282 res = GetKeyState(VK_CONTROL);
1283 if (res & 0x8000)
1284 *modifiers |= ECORE_EVENT_MODIFIER_CTRL;
1285 else
1286 *modifiers &= ~ECORE_EVENT_MODIFIER_CTRL;
1287
1288 res = GetKeyState(VK_MENU);
1289 if (res & 0x8000)
1290 *modifiers |= ECORE_EVENT_MODIFIER_ALT;
1291 else
1292 *modifiers &= ~ECORE_EVENT_MODIFIER_ALT;
1293
1294 return 1;
1295}
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_private.h b/libraries/ecore/src/lib/ecore_win32/ecore_win32_private.h
deleted file mode 100644
index e3e4426..0000000
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_private.h
+++ /dev/null
@@ -1,170 +0,0 @@
1#ifndef __ECORE_WIN32_PRIVATE_H__
2#define __ECORE_WIN32_PRIVATE_H__
3
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9#ifdef MIN
10# undef MIN
11#endif
12#define MIN(a,b) (((a) < (b)) ? (a) : (b))
13
14#ifdef MAX
15# undef MAX
16#endif
17#define MAX(a,b) (((a) < (b)) ? (b) : (a))
18
19/* logging messages macros */
20extern int _ecore_win32_log_dom_global;
21
22#ifdef ECORE_WIN32_DEFAULT_LOG_COLOR
23# undef ECORE_WIN32_DEFAULT_LOG_COLOR
24#endif
25#define ECORE_WIN32_DEFAULT_LOG_COLOR EINA_COLOR_LIGHTBLUE
26
27#ifdef ERR
28# undef ERR
29#endif
30#define ERR(...) EINA_LOG_DOM_ERR(_ecore_win32_log_dom_global , __VA_ARGS__)
31#ifdef DBG
32#undef DBG
33#endif
34#define DBG(...) EINA_LOG_DOM_DBG(_ecore_win32_log_dom_global , __VA_ARGS__)
35
36#ifdef INF
37#undef INF
38#endif
39#define INF(...) EINA_LOG_DOM_INFO(_ecore_win32_log_dom_global , __VA_ARGS__)
40
41#ifdef WRN
42# undef WRN
43#endif
44#define WRN(...) EINA_LOG_DOM_WARN(_ecore_win32_log_dom_global, __VA_ARGS__)
45
46#define ECORE_WIN32_WINDOW_CLASS "Ecore_Win32_Window_Class"
47
48typedef struct _Ecore_Win32_Callback_Data Ecore_Win32_Callback_Data;
49
50struct _Ecore_Win32_Callback_Data
51{
52 RECT update;
53 HWND window;
54 unsigned int message;
55 WPARAM window_param;
56 LPARAM data_param;
57 unsigned long timestamp;
58 int x;
59 int y;
60 Eina_Bool discard_ctrl;
61};
62
63struct _Ecore_Win32_Window
64{
65 HWND window;
66
67 DWORD style; /* used to go fullscreen to normal */
68 RECT rect; /* used to go fullscreen to normal */
69
70 unsigned int min_width;
71 unsigned int min_height;
72 unsigned int max_width;
73 unsigned int max_height;
74 int base_width;
75 int base_height;
76 unsigned int step_width;
77 unsigned int step_height;
78
79 struct {
80 unsigned int iconified : 1;
81 unsigned int modal : 1;
82 unsigned int sticky : 1;
83 unsigned int maximized_vert : 1;
84 unsigned int maximized_horz : 1;
85 unsigned int shaded : 1;
86 unsigned int hidden : 1;
87 unsigned int fullscreen : 1;
88 unsigned int above : 1;
89 unsigned int below : 1;
90 unsigned int demands_attention : 1;
91 } state;
92
93 struct {
94 unsigned int desktop : 1;
95 unsigned int dock : 1;
96 unsigned int toolbar : 1;
97 unsigned int menu : 1;
98 unsigned int utility : 1;
99 unsigned int splash : 1;
100 unsigned int dialog : 1;
101 unsigned int normal : 1;
102 } type;
103
104 unsigned int pointer_is_in : 1;
105 unsigned int borderless : 1;
106 unsigned int iconified : 1;
107 unsigned int fullscreen : 1;
108
109 struct {
110 unsigned short width;
111 unsigned short height;
112 unsigned char *mask;
113 unsigned int enabled : 1;
114 unsigned int layered : 1;
115 } shape;
116
117 struct {
118 DWORD type;
119 int x;
120 int y;
121 int w;
122 int h;
123 int px;
124 int py;
125 unsigned int dragging : 1;
126 } drag;
127
128 void *dnd_drop_target;
129};
130
131
132extern HINSTANCE _ecore_win32_instance;
133extern double _ecore_win32_double_click_time;
134extern unsigned long _ecore_win32_event_last_time;
135extern Ecore_Win32_Window *_ecore_win32_event_last_window;
136
137
138void _ecore_win32_event_handle_key_press(Ecore_Win32_Callback_Data *msg, int is_keystroke);
139void _ecore_win32_event_handle_key_release(Ecore_Win32_Callback_Data *msg);
140void _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg, int button);
141void _ecore_win32_event_handle_button_release(Ecore_Win32_Callback_Data *msg, int button);
142void _ecore_win32_event_handle_motion_notify(Ecore_Win32_Callback_Data *msg);
143void _ecore_win32_event_handle_enter_notify(Ecore_Win32_Callback_Data *msg);
144void _ecore_win32_event_handle_leave_notify(Ecore_Win32_Callback_Data *msg);
145void _ecore_win32_event_handle_focus_in(Ecore_Win32_Callback_Data *msg);
146void _ecore_win32_event_handle_focus_out(Ecore_Win32_Callback_Data *msg);
147void _ecore_win32_event_handle_expose(Ecore_Win32_Callback_Data *msg);
148void _ecore_win32_event_handle_create_notify(Ecore_Win32_Callback_Data *msg);
149void _ecore_win32_event_handle_destroy_notify(Ecore_Win32_Callback_Data *msg);
150void _ecore_win32_event_handle_map_notify(Ecore_Win32_Callback_Data *msg);
151void _ecore_win32_event_handle_unmap_notify(Ecore_Win32_Callback_Data *msg);
152void _ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg);
153void _ecore_win32_event_handle_resize(Ecore_Win32_Callback_Data *msg);
154void _ecore_win32_event_handle_delete_request(Ecore_Win32_Callback_Data *msg);
155
156void *_ecore_win32_dnd_data_object_new(void *fmtetc, void *stgmeds, int count);
157void _ecore_win32_dnd_data_object_free(void *data_object);
158void *_ecore_win32_dnd_drop_source_new();
159void _ecore_win32_dnd_drop_source_free(void *drop_source);
160void *_ecore_win32_dnd_register_drop_window(HWND hwnd,
161 Ecore_Win32_Dnd_DropTarget_Callback callback, void *ptr);
162void _ecore_win32_dnd_unregister_drop_window(HWND hwnd, void *drop_target);
163
164
165#ifdef __cplusplus
166}
167#endif
168
169
170#endif /* __ECORE_WIN32_PRIVATE_H__ */
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_window.c b/libraries/ecore/src/lib/ecore_win32/ecore_win32_window.c
deleted file mode 100644
index 058aef0..0000000
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_window.c
+++ /dev/null
@@ -1,1418 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdlib.h>
6#include <stdio.h> /* for printf */
7
8#define WIN32_LEAN_AND_MEAN
9#include <windows.h>
10#undef WIN32_LEAN_AND_MEAN
11
12#include <Eina.h>
13
14#include "Ecore_Win32.h"
15#include "ecore_win32_private.h"
16
17/*============================================================================*
18 * Local *
19 *============================================================================*/
20
21/**
22 * @cond LOCAL
23 */
24
25
26typedef enum _Ecore_Win32_Window_Z_Order Ecore_Win32_Window_Z_Order;
27enum _Ecore_Win32_Window_Z_Order
28{
29 ECORE_WIN32_WINDOW_Z_ORDER_BOTTOM,
30 ECORE_WIN32_WINDOW_Z_ORDER_NOTOPMOST,
31 ECORE_WIN32_WINDOW_Z_ORDER_TOP,
32 ECORE_WIN32_WINDOW_Z_ORDER_TOPMOST
33};
34
35static Ecore_Win32_Window *
36ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
37 int x,
38 int y,
39 int width,
40 int height,
41 DWORD style)
42{
43 RECT rect;
44 Ecore_Win32_Window *w;
45 int minimal_width;
46 int minimal_height;
47
48 w = (Ecore_Win32_Window *)calloc(1, sizeof(Ecore_Win32_Window));
49 if (!w)
50 {
51 ERR("malloc() failed");
52 return NULL;
53 }
54
55 rect.left = 0;
56 rect.top = 0;
57 rect.right = width;
58 rect.bottom = height;
59 if (!AdjustWindowRectEx(&rect, style, FALSE, 0))
60 {
61 ERR("AdjustWindowRect() failed");
62 free(w);
63 return NULL;
64 }
65
66 minimal_width = GetSystemMetrics(SM_CXMIN);
67 minimal_height = GetSystemMetrics(SM_CYMIN);
68/* if (((rect.right - rect.left) < minimal_width) || */
69/* ((rect.bottom - rect.top) < minimal_height)) */
70/* { */
71/* fprintf (stderr, "[Ecore] [Win32] ERROR !!\n"); */
72/* fprintf (stderr, " Wrong size %ld\n", rect.right - rect.left); */
73/* free(w); */
74/* return NULL; */
75/* } */
76 if ((rect.right - rect.left) < minimal_width)
77 {
78 rect.right = rect.left + minimal_width;
79 }
80
81 w->window = CreateWindowEx(0,
82 ECORE_WIN32_WINDOW_CLASS, "",
83 style,
84 x, y,
85 rect.right - rect.left,
86 rect.bottom - rect.top,
87 parent ? parent->window : NULL,
88 NULL, _ecore_win32_instance, NULL);
89 if (!w->window)
90 {
91 ERR("CreateWindowEx() failed");
92 free(w);
93 return NULL;
94 }
95
96 SetLastError(0);
97 if (!SetWindowLongPtr(w->window, GWLP_USERDATA, (LONG_PTR)w) &&
98 (GetLastError() != 0))
99 {
100 ERR("SetWindowLongPtr() failed");
101 DestroyWindow(w->window);
102 free(w);
103 return NULL;
104 }
105
106 w->min_width = 0;
107 w->min_height = 0;
108 w->max_width = 32767;
109 w->max_height = 32767;
110 w->base_width = -1;
111 w->base_height = -1;
112 w->step_width = 1;
113 w->step_height = 1;
114
115 w->state.iconified = 0;
116 w->state.modal = 0;
117 w->state.sticky = 0;
118 w->state.maximized_vert = 0;
119 w->state.maximized_horz = 0;
120 w->state.shaded = 0;
121 w->state.hidden = 0;
122 w->state.fullscreen = 0;
123 w->state.above = 0;
124 w->state.below = 0;
125 w->state.demands_attention = 0;
126
127 w->type.desktop = 0;
128 w->type.dock = 0;
129 w->type.toolbar = 0;
130 w->type.menu = 0;
131 w->type.utility = 0;
132 w->type.splash = 0;
133 w->type.dialog = 0;
134 w->type.normal = 0;
135
136 w->pointer_is_in = 0;
137 w->borderless = 0;
138 w->iconified = 0;
139 w->fullscreen = 0;
140
141 return w;
142}
143
144/**
145 * @endcond
146 */
147
148
149/*============================================================================*
150 * Global *
151 *============================================================================*/
152
153/*============================================================================*
154 * API *
155 *============================================================================*/
156
157/**
158 * @addtogroup Ecore_Win32_Group Ecore_Win32 library
159 *
160 * @{
161 */
162
163/**
164 * @brief Creates a new window.
165 *
166 * @param parent The parent window.
167 * @param x The x coordinate of the top-left corner of the window.
168 * @param y The y coordinate of the top-left corner of the window.
169 * @param width The width of the window.
170 * @param height The height of hte window.
171 * @return A newly allocated window.
172 *
173 * This function creates a new window which parent is @p parent. @p width and
174 * @p height are the size of the window content (the client part),
175 * without the border and title bar. @p x and @p y are the system
176 * coordinates of the top left cerner of the window (that is, of the
177 * title bar). This function returns a newly created window on
178 * success, and @c NULL on failure.
179 */
180EAPI Ecore_Win32_Window *
181ecore_win32_window_new(Ecore_Win32_Window *parent,
182 int x,
183 int y,
184 int width,
185 int height)
186{
187 INF("creating window with border");
188
189 return ecore_win32_window_internal_new(parent,
190 x, y,
191 width, height,
192 WS_OVERLAPPEDWINDOW | WS_SIZEBOX);
193}
194
195/**
196 * @brief Creates a new borderless window.
197 *
198 * @param parent The parent window.
199 * @param x The x coordinate of the top-left corner of the window.
200 * @param y The y coordinate of the top-left corner of the window.
201 * @param width The width of the window.
202 * @param height The height of hte window.
203 * @return A newly allocated window.
204 *
205 * This function is the same than ecore_win32_window_override_new()
206 * but the returned window is borderless.
207 */
208EAPI Ecore_Win32_Window *
209ecore_win32_window_override_new(Ecore_Win32_Window *parent,
210 int x,
211 int y,
212 int width,
213 int height)
214{
215 INF("creating window without border");
216
217 return ecore_win32_window_internal_new(parent,
218 x, y,
219 width, height,
220 WS_POPUP);
221}
222
223/**
224 * @brief Free the given window.
225 *
226 * @param window The window to free.
227 *
228 * This function frees @p window. If @p window is @c NULL, this
229 * function does nothing.
230 */
231EAPI void
232ecore_win32_window_free(Ecore_Win32_Window *window)
233{
234 if (!window) return;
235
236 INF("destroying window");
237
238 if (window->shape.mask)
239 free(window->shape.mask);
240
241 DestroyWindow(window->window);
242 free(window);
243}
244
245/**
246 * @brief Return the window HANDLE associated to the given window.
247 *
248 * @param window The window to retrieve the HANDLE from.
249 *
250 * This function returns the window HANDLE associated to @p window. If
251 * @p window is @c NULL, this function returns @c NULL.
252 *
253 * @note The returned value is of type HWND.
254 */
255EAPI void *
256ecore_win32_window_hwnd_get(Ecore_Win32_Window *window)
257{
258 if (!window) return NULL;
259
260 return window->window;
261}
262
263/*
264void
265ecore_win32_window_configure(Ecore_Win32_Window *window,
266 Ecore_Win32_Window_Z_Order order,
267 int x,
268 int y,
269 int width,
270 int height)
271{
272 HWND w;
273
274 switch (order)
275 {
276 case ECORE_WIN32_WINDOW_Z_ORDER_BOTTOM:
277 w = HWND_BOTTOM;
278 break;
279 case ECORE_WIN32_WINDOW_Z_ORDER_NOTOPMOST:
280 w = HWND_NOTOPMOST;
281 break;
282 case ECORE_WIN32_WINDOW_Z_ORDER_TOP:
283 w = HWND_TOP;
284 break;
285 case ECORE_WIN32_WINDOW_Z_ORDER_TOPMOST:
286 w = HWND_TOPMOST;
287 break;
288 default:
289 return;
290 }
291 SetWindowPos((Ecore_Win32_Window *)window->window, w, x, y, width, height, ???);
292}
293*/
294
295/**
296 * @brief Move the given window to a given position.
297 *
298 * @param window The window to move.
299 * @param x The x coordinate of the destination position.
300 * @param y The y coordinate of the destination position.
301 *
302 * This function move @p window to the new position of coordinates @p x
303 * and @p y. If @p window is @c NULL, or if it is fullscreen, or on
304 * error, this function does nothing.
305 */
306EAPI void
307ecore_win32_window_move(Ecore_Win32_Window *window,
308 int x,
309 int y)
310{
311 RECT rect;
312
313 /* FIXME: on fullscreen, should not move it */
314 if (!window) return;
315
316 INF("moving window (%dx%d)", x, y);
317
318 if (!GetWindowRect(window->window, &rect))
319 {
320 ERR("GetWindowRect() failed");
321 return;
322 }
323
324 if (!MoveWindow(window->window, x, y,
325 rect.right - rect.left,
326 rect.bottom - rect.top,
327 TRUE))
328 {
329 ERR("MoveWindow() failed");
330 }
331}
332
333/**
334 * @brief Resize the given window to a given size.
335 *
336 * @param window The window to resize.
337 * @param width The new width.
338 * @param height The new height.
339 *
340 * This function resize @p window to the new @p width and @p height.
341 * If @p window is @c NULL, or if it is fullscreen, or on error, this
342 * function does nothing.
343 */
344EAPI void
345ecore_win32_window_resize(Ecore_Win32_Window *window,
346 int width,
347 int height)
348{
349 RECT rect;
350 DWORD style;
351 int x;
352 int y;
353 int minimal_width;
354 int minimal_height;
355
356 /* FIXME: on fullscreen, should not resize it */
357 if (!window) return;
358
359 INF("resizing window (%dx%d)", width, height);
360
361 minimal_width = MAX(GetSystemMetrics(SM_CXMIN), (int)window->min_width);
362 minimal_height = MAX(GetSystemMetrics(SM_CYMIN), (int)window->min_height);
363
364 if (!GetWindowRect(window->window, &rect))
365 {
366 ERR("GetWindowRect() failed");
367 return;
368 }
369
370 x = rect.left;
371 y = rect.top;
372 rect.left = 0;
373 rect.top = 0;
374 if (width < minimal_width) width = minimal_width;
375 if (width > (int)window->max_width) width = window->max_width;
376 if (height < minimal_height) height = minimal_height;
377 if (height > (int)window->max_height) height = window->max_height;
378 rect.right = width;
379 rect.bottom = height;
380 if (!(style = GetWindowLong(window->window, GWL_STYLE)))
381 {
382 ERR("GetWindowLong() failed");
383 return;
384 }
385 if (!AdjustWindowRect(&rect, style, FALSE))
386 {
387 ERR("AdjustWindowRect() failed");
388 return;
389 }
390
391 if (!MoveWindow(window->window, x, y,
392 rect.right - rect.left,
393 rect.bottom - rect.top,
394 TRUE))
395 {
396 ERR("MoveWindow() failed");
397 }
398}
399
400/**
401 * @brief Move and resize the given window to a given position and size.
402 *
403 * @param window The window to move and resize.
404 * @param x The x coordinate of the destination position.
405 * @param y The x coordinate of the destination position.
406 * @param width The new width.
407 * @param height The new height.
408 *
409 * This function resize @p window to the new position of coordinates @p x
410 * and @p y and the new @p width and @p height. If @p window is @c NULL,
411 * or if it is fullscreen, or on error, this function does nothing.
412 */
413EAPI void
414ecore_win32_window_move_resize(Ecore_Win32_Window *window,
415 int x,
416 int y,
417 int width,
418 int height)
419{
420 RECT rect;
421 DWORD style;
422 int minimal_width;
423 int minimal_height;
424
425 /* FIXME: on fullscreen, should not move/resize it */
426 if (!window) return;
427
428 INF("moving and resizing window (%dx%d %dx%d)", x, y, width, height);
429
430 minimal_width = MAX(GetSystemMetrics(SM_CXMIN), (int)window->min_width);
431 minimal_height = MAX(GetSystemMetrics(SM_CYMIN), (int)window->min_height);
432
433 rect.left = 0;
434 rect.top = 0;
435 if (width < minimal_width) width = minimal_width;
436 if (width > (int)window->max_width) width = window->max_width;
437 if (height < minimal_height) height = minimal_height;
438 if (height > (int)window->max_height) height = window->max_height;
439 rect.right = width;
440 rect.bottom = height;
441 if (!(style = GetWindowLong(window->window, GWL_STYLE)))
442 {
443 ERR("GetWindowLong() failed");
444 return;
445 }
446 if (!AdjustWindowRect(&rect, style, FALSE))
447 {
448 ERR("AdjustWindowRect() failed");
449 return;
450 }
451
452 if (!MoveWindow(window->window, x, y,
453 rect.right - rect.left,
454 rect.bottom - rect.top,
455 TRUE))
456 {
457 ERR("MoveWindow() failed");
458 }
459}
460
461/**
462 * @brief Get the geometry of the given window.
463 *
464 * @param window The window to retrieve the geometry from.
465 * @param x The x coordinate of the position.
466 * @param y The x coordinate of the position.
467 * @param width The width.
468 * @param height The height.
469 *
470 * This function retrieves the position and size of @p window. @p x,
471 * @p y, @p width and @p height can be buffers that will be filled with
472 * the corresponding values. If one of them is @c NULL, nothing will
473 * be done for that parameter. If @p window is @c NULL, and if the
474 * buffers are not @c NULL, they will be filled with respectively 0,
475 * 0, the size of the screen and the height of the screen.
476 */
477EAPI void
478ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
479 int *x,
480 int *y,
481 int *width,
482 int *height)
483{
484 RECT rect;
485 int w;
486 int h;
487
488 INF("getting window geometry");
489
490 if (!window)
491 {
492 if (x) *x = 0;
493 if (y) *y = 0;
494 if (width) *width = GetSystemMetrics(SM_CXSCREEN);
495 if (height) *height = GetSystemMetrics(SM_CYSCREEN);
496
497 return;
498 }
499
500 if (!GetClientRect(window->window, &rect))
501 {
502 ERR("GetClientRect() failed");
503
504 if (x) *x = 0;
505 if (y) *y = 0;
506 if (width) *width = 0;
507 if (height) *height = 0;
508
509 return;
510 }
511
512 w = rect.right - rect.left;
513 h = rect.bottom - rect.top;
514
515 if (!GetWindowRect(window->window, &rect))
516 {
517 ERR("GetWindowRect() failed");
518
519 if (x) *x = 0;
520 if (y) *y = 0;
521 if (width) *width = 0;
522 if (height) *height = 0;
523
524 return;
525 }
526
527 if (x) *x = rect.left;
528 if (y) *y = rect.top;
529 if (width) *width = w;
530 if (height) *height = h;
531}
532
533/**
534 * @brief Get the size of the given window.
535 *
536 * @param window The window to retrieve the size from.
537 * @param width The width.
538 * @param height The height.
539 *
540 * This function retrieves the size of @p window. @p width and
541 * @p height can be buffers that will be filled with the corresponding
542 * values. If one of them is @c NULL, nothing will be done for that
543 * parameter. If @p window is @c NULL, and if the buffers are not
544 * @c NULL, they will be filled with respectively the size of the screen
545 * and the height of the screen.
546 */
547EAPI void
548ecore_win32_window_size_get(Ecore_Win32_Window *window,
549 int *width,
550 int *height)
551{
552 RECT rect;
553
554 INF("getting window size");
555
556 if (!window)
557 {
558 if (width) *width = GetSystemMetrics(SM_CXSCREEN);
559 if (height) *height = GetSystemMetrics(SM_CYSCREEN);
560
561 return;
562 }
563
564 if (!GetClientRect(window->window, &rect))
565 {
566 ERR("GetClientRect() failed");
567
568 if (width) *width = 0;
569 if (height) *height = 0;
570 }
571
572 if (width) *width = rect.right - rect.left;
573 if (height) *height = rect.bottom - rect.top;
574}
575
576/**
577 * @brief Set the minimum size of the given window.
578 *
579 * @param window The window.
580 * @param min_width The minimal width.
581 * @param min_height The minimal height.
582 *
583 * This function sets the minimum size of @p window to @p min_width
584 * and *p min_height. If @p window is @c NULL, this functions does
585 * nothing.
586 */
587EAPI void
588ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
589 unsigned int min_width,
590 unsigned int min_height)
591{
592 if (!window) return;
593
594 printf ("ecore_win32_window_size_min_set : %p %d %d\n", window, min_width, min_height);
595 window->min_width = min_width;
596 window->min_height = min_height;
597}
598
599/**
600 * @brief Get the minimum size of the given window.
601 *
602 * @param window The window.
603 * @param min_width The minimal width.
604 * @param min_height The minimal height.
605 *
606 * This function fills the minimum size of @p window in the buffers
607 * @p min_width and *p min_height. They both can be @c NULL. If
608 * @p window is @c NULL, this functions does nothing.
609 */
610EAPI void
611ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
612 unsigned int *min_width,
613 unsigned int *min_height)
614{
615 if (!window) return;
616
617 printf ("ecore_win32_window_size_min_get : %p %d %d\n", window, window->min_width, window->min_height);
618 if (min_width) *min_width = window->min_width;
619 if (min_height) *min_height = window->min_height;
620}
621
622/**
623 * @brief Set the maximum size of the given window.
624 *
625 * @param window The window.
626 * @param max_width The maximal width.
627 * @param max_height The maximal height.
628 *
629 * This function sets the maximum size of @p window to @p max_width
630 * and *p max_height. If @p window is @c NULL, this functions does
631 * nothing.
632 */
633EAPI void
634ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
635 unsigned int max_width,
636 unsigned int max_height)
637{
638 if (!window) return;
639
640 printf ("ecore_win32_window_size_max_set : %p %d %d\n", window, max_width, max_height);
641 window->max_width = max_width;
642 window->max_height = max_height;
643}
644
645/**
646 * @brief Get the maximum size of the given window.
647 *
648 * @param window The window.
649 * @param max_width The maximal width.
650 * @param max_height The maximal height.
651 *
652 * This function fills the maximum size of @p window in the buffers
653 * @p max_width and *p max_height. They both can be @c NULL. If
654 * @p window is @c NULL, this functions does nothing.
655 */
656EAPI void
657ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
658 unsigned int *max_width,
659 unsigned int *max_height)
660{
661 if (!window) return;
662
663 printf ("ecore_win32_window_size_max_get : %p %d %d\n", window, window->max_width, window->max_height);
664 if (max_width) *max_width = window->max_width;
665 if (max_height) *max_height = window->max_height;
666}
667
668/**
669 * @brief Set the base size of the given window.
670 *
671 * @param window The window.
672 * @param base_width The base width.
673 * @param base_height The base height.
674 *
675 * This function sets the base size of @p window to @p base_width
676 * and *p base_height. If @p window is @c NULL, this functions does
677 * nothing.
678 */
679EAPI void
680ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
681 unsigned int base_width,
682 unsigned int base_height)
683{
684 printf ("ecore_win32_window_size_base_set : %p %d %d\n", window, base_width, base_height);
685 if (!window) return;
686
687 window->base_width = base_width;
688 window->base_height = base_height;
689}
690
691/**
692 * @brief Get the base size of the given window.
693 *
694 * @param window The window.
695 * @param base_width The base width.
696 * @param base_height The bas height.
697 *
698 * This function fills the base size of @p window in the buffers
699 * @p base_width and *p base_height. They both can be @c NULL. If
700 * @p window is @c NULL, this functions does nothing.
701 */
702EAPI void
703ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
704 unsigned int *base_width,
705 unsigned int *base_height)
706{
707 if (!window) return;
708
709 printf ("ecore_win32_window_size_base_get : %p %d %d\n", window, window->base_width, window->base_height);
710 if (base_width) *base_width = window->base_width;
711 if (base_height) *base_height = window->base_height;
712}
713
714/**
715 * @brief Set the step size of the given window.
716 *
717 * @param window The window.
718 * @param step_width The step width.
719 * @param step_height The step height.
720 *
721 * This function sets the step size of @p window to @p step_width
722 * and *p step_height. If @p window is @c NULL, this functions does
723 * nothing.
724 */
725EAPI void
726ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
727 unsigned int step_width,
728 unsigned int step_height)
729{
730 printf ("ecore_win32_window_size_step_set : %p %d %d\n", window, step_width, step_height);
731 if (!window) return;
732
733 window->step_width = step_width;
734 window->step_height = step_height;
735}
736
737/**
738 * @brief Get the step size of the given window.
739 *
740 * @param window The window.
741 * @param step_width The step width.
742 * @param step_height The bas height.
743 *
744 * This function fills the step size of @p window in the buffers
745 * @p step_width and *p step_height. They both can be @c NULL. If
746 * @p window is @c NULL, this functions does nothing.
747 */
748EAPI void
749ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
750 unsigned int *step_width,
751 unsigned int *step_height)
752{
753 if (!window) return;
754
755 printf ("ecore_win32_window_size_step_get : %p %d %d\n", window, window->step_width, window->step_height);
756 if (step_width) *step_width = window->step_width;
757 if (step_height) *step_height = window->step_height;
758}
759
760/**
761 * @brief Show the given window.
762 *
763 * @param window The window to show.
764 *
765 * This function shows @p window. If @p window is @c NULL, or on
766 * error, this function does nothing.
767 */
768EAPI void
769ecore_win32_window_show(Ecore_Win32_Window *window)
770{
771 if (!window) return;
772
773 INF("showing window");
774
775 ShowWindow(window->window, SW_SHOWNORMAL);
776 if (!UpdateWindow(window->window))
777 {
778 ERR("UpdateWindow() failed");
779 }
780}
781
782/* FIXME: seems to block the taskbar */
783/**
784 * @brief Hide the given window.
785 *
786 * @param window The window to show.
787 *
788 * This function hides @p window. If @p window is @c NULL, or on
789 * error, this function does nothing.
790 */
791EAPI void
792ecore_win32_window_hide(Ecore_Win32_Window *window)
793{
794 if (!window) return;
795
796 INF("hiding window");
797
798 ShowWindow(window->window, SW_HIDE);
799}
800
801/**
802 * @brief Place the given window at the top of the Z order.
803 *
804 * @param window The window to place at the top.
805 *
806 * This function places @p window at the top of the Z order. If
807 * @p window is @c NULL, this function does nothing.
808 */
809EAPI void
810ecore_win32_window_raise(Ecore_Win32_Window *window)
811{
812 if (!window) return;
813
814 INF("raising window");
815
816 if (!SetWindowPos(window->window,
817 HWND_TOP, 0, 0, 0, 0,
818 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE))
819 {
820 ERR("SetWindowPos() failed");
821 }
822}
823
824/**
825 * @brief Place the given window at the bottom of the Z order.
826 *
827 * @param window The window to place at the bottom.
828 *
829 * This function places @p window at the bottom of the Z order. If
830 * @p window is @c NULL, this function does nothing.
831 */
832EAPI void
833ecore_win32_window_lower(Ecore_Win32_Window *window)
834{
835 if (!window) return;
836
837 INF("lowering window");
838
839 if (!SetWindowPos(window->window,
840 HWND_BOTTOM, 0, 0, 0, 0,
841 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE))
842 {
843 ERR("SetWindowPos() failed");
844 }
845}
846
847/**
848 * @brief Set the title of the given window.
849 *
850 * @param window The window to set the title.
851 * @param title The new title.
852 *
853 * This function sets the title of @p window to @p title. If @p window
854 * is @c NULL, or if @p title is @c NULL or empty, or on error, this
855 * function does nothing.
856 */
857EAPI void
858ecore_win32_window_title_set(Ecore_Win32_Window *window,
859 const char *title)
860{
861 if (!window) return;
862
863 if (!title || !title[0]) return;
864
865 INF("setting window title");
866
867 if (!SetWindowText(window->window, title))
868 {
869 ERR("SetWindowText() failed");
870 }
871}
872
873/**
874 * @brief Set the focus to the given window.
875 *
876 * @param window The window to give focus to.
877 *
878 * This function gives the focus to @p window. If @p window is
879 * @c NULL, this function does nothing.
880 */
881EAPI void
882ecore_win32_window_focus(Ecore_Win32_Window *window)
883{
884 if (!window) return;
885
886 INF("focusing window");
887
888 if (!SetFocus(window->window))
889 {
890 ERR("SetFocus() failed");
891 }
892}
893
894/**
895 * @brief Get the current focused window.
896 *
897 * @return The window that has focus.
898 *
899 * This function returns the window that has focus. If the calling
900 * thread's message queue does not have an associated window with the
901 * keyboard focus, the return value is @c NULL.
902 *
903 * @note Even if the returned value is @c NULL, another thread's queue
904 * may be associated with a window that has the keyboard focus.
905 *
906 * @note The returned value is of type HWND.
907 */
908EAPI void *
909ecore_win32_window_focus_get(void)
910{
911 HWND focused;
912
913 INF("getting focused window");
914
915 focused = GetFocus();
916 if (!focused)
917 {
918 ERR("GetFocus() failed");
919 return NULL;
920 }
921
922 return focused;
923}
924
925/**
926 * @brief Iconify or restore the given window.
927 *
928 * @param window The window.
929 * @param on EINA_TRUE to iconify the window, EINA_FALSE to restore it.
930 *
931 * This function iconify or restore @p window. If @p on
932 * is set to EINA_TRUE, the window will be iconified, if it is set to
933 * EINA_FALSE, it will be restored. If @p window is @c NULL or if the
934 * state does not change (like iconifying the window while it is
935 * already iconified), this function does nothing.
936 */
937EAPI void
938ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
939 Eina_Bool on)
940{
941 if (!window) return;
942
943 if (((window->iconified) && (on)) ||
944 ((!window->iconified) && (!on)))
945 return;
946
947 INF("iconifying window: %s", on ? "yes" : "no");
948
949 ShowWindow(window->window, on ? SW_MINIMIZE : SW_RESTORE);
950 window->iconified = on;
951}
952
953/**
954 * @brief Remove or restore the border of the given window.
955 *
956 * @param window The window.
957 * @param on EINA_TRUE to remove the border, EINA_FALSE to restore it.
958 *
959 * This function remove or restore the border of @p window. If @p on
960 * is set to EINA_TRUE, the window will have no border, if it is set to
961 * EINA_FALSE, it will have a border. If @p window is @c NULL or if the
962 * state does not change (like setting to borderless while the window
963 * has no border), this function does nothing.
964 */
965EAPI void
966ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
967 Eina_Bool on)
968{
969 RECT rect;
970 DWORD style;
971
972 if (!window) return;
973
974 if (((window->borderless) && (on)) ||
975 ((!window->borderless) && (!on)))
976 return;
977
978 INF("setting window without border: %s", on ? "yes" : "no");
979
980 style = GetWindowLong(window->window, GWL_STYLE);
981 if (on)
982 {
983 if (!GetClientRect(window->window, &rect))
984 {
985 ERR("GetClientRect() failed");
986 return;
987 }
988 SetLastError(0);
989 if (!SetWindowLongPtr(window->window, GWL_STYLE, style & ~(WS_CAPTION | WS_THICKFRAME)) &&
990 (GetLastError() != 0))
991 {
992 ERR("SetWindowLongPtr() failed");
993 return;
994 }
995 }
996 else
997 {
998 if (!GetWindowRect(window->window, &rect))
999 {
1000 ERR("GetWindowRect() failed");
1001 return;
1002 }
1003 style |= WS_CAPTION | WS_THICKFRAME;
1004 if (!AdjustWindowRect (&rect, style, FALSE))
1005 {
1006 ERR("AdjustWindowRect() failed");
1007 return;
1008 }
1009 SetLastError(0);
1010 if (!SetWindowLongPtr(window->window, GWL_STYLE, style) &&
1011 (GetLastError() != 0))
1012 {
1013 ERR("SetWindowLongPtr() failed");
1014 return;
1015 }
1016 }
1017 if (!SetWindowPos(window->window, HWND_TOPMOST,
1018 rect.left, rect.top,
1019 rect.right - rect.left, rect.bottom - rect.top,
1020 SWP_NOMOVE | SWP_FRAMECHANGED))
1021 {
1022 ERR("SetWindowPos() failed");
1023 return;
1024 }
1025
1026 window->borderless = on;
1027}
1028
1029/**
1030 * @brief Set the given window to fullscreen.
1031 *
1032 * @param window The window.
1033 * @param on EINA_TRUE for fullscreen mode, EINA_FALSE for windowed mode.
1034 *
1035 * This function set @p window to fullscreen or windowed mode. If @p on
1036 * is set to EINA_TRUE, the window will be fullscreen, if it is set to
1037 * EINA_FALSE, it will be windowed. If @p window is @c NULL or if the
1038 * state does not change (like setting to fullscreen while the window
1039 * is already fullscreen), this function does nothing.
1040 */
1041EAPI void
1042ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
1043 Eina_Bool on)
1044{
1045 if (!window) return;
1046
1047 if (((window->fullscreen) && (on)) ||
1048 ((!window->fullscreen) && (!on)))
1049 return;
1050
1051 INF("setting fullscreen: %s", on ? "yes" : "no");
1052
1053 window->fullscreen = !!on;
1054
1055 if (on)
1056 {
1057 DWORD style;
1058
1059 if (!GetWindowRect(window->window, &window->rect))
1060 {
1061 ERR("GetWindowRect() failed");
1062 return;
1063 }
1064 if (!(window->style = GetWindowLong(window->window, GWL_STYLE)))
1065 {
1066 ERR("GetWindowLong() failed");
1067 return;
1068 }
1069 style = window->style & ~WS_OVERLAPPEDWINDOW & ~WS_SIZEBOX;
1070 style |= WS_VISIBLE | WS_POPUP;
1071 SetLastError(0);
1072 if (!SetWindowLongPtr(window->window, GWL_STYLE, style) &&
1073 (GetLastError() != 0))
1074 {
1075 ERR("SetWindowLongPtr() failed");
1076 return;
1077 }
1078 SetLastError(0);
1079 if (!SetWindowLongPtr(window->window, GWL_EXSTYLE, WS_EX_TOPMOST) &&
1080 (GetLastError() != 0))
1081 {
1082 ERR("SetWindowLongPtr() failed");
1083 return;
1084 }
1085 if (!SetWindowPos(window->window, HWND_TOPMOST, 0, 0,
1086 GetSystemMetrics (SM_CXSCREEN),
1087 GetSystemMetrics (SM_CYSCREEN),
1088 SWP_NOCOPYBITS | SWP_SHOWWINDOW))
1089 {
1090 ERR("SetWindowPos() failed");
1091 return;
1092 }
1093 }
1094 else
1095 {
1096 SetLastError(0);
1097 if (!SetWindowLongPtr(window->window, GWL_STYLE, window->style) &&
1098 (GetLastError() != 0))
1099 {
1100 ERR("SetWindowLongPtr() failed");
1101 return;
1102 }
1103 SetLastError(0);
1104 if (!SetWindowLongPtr(window->window, GWL_EXSTYLE, 0) &&
1105 (GetLastError() != 0))
1106 {
1107 ERR("SetWindowLongPtr() failed");
1108 return;
1109 }
1110 if (!SetWindowPos(window->window, HWND_NOTOPMOST,
1111 window->rect.left,
1112 window->rect.top,
1113 window->rect.right - window->rect.left,
1114 window->rect.bottom - window->rect.top,
1115 SWP_NOCOPYBITS | SWP_SHOWWINDOW))
1116 {
1117 ERR("SetWindowPos() failed");
1118 return;
1119 }
1120 }
1121}
1122
1123/**
1124 * @brief Set the given cursor to the given window.
1125 *
1126 * @param window The window to modify the cursor.
1127 * @param cursor The new cursor.
1128 *
1129 * This function sets @p cursor to @p window. @p cursor must have been
1130 * obtained by ecore_win32_cursor_new() or
1131 * ecore_win32_cursor_shaped_new(). If @p window or @p cursor is
1132 * @c NULL, the function does nothing.
1133 */
1134EAPI void
1135ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
1136 Ecore_Win32_Cursor *cursor)
1137{
1138 INF("setting cursor");
1139
1140 if (!window || !cursor)
1141 return;
1142
1143 if (!SetClassLongPtr(window->window,
1144 GCLP_HCURSOR, (LONG_PTR)cursor))
1145 {
1146 ERR("SetClassLong() failed");
1147 }
1148}
1149
1150/**
1151 * @brief Set the state of the given window.
1152 *
1153 * @param window The window to modify the state.
1154 * @param state An array of the new states.
1155 * @param num The number of states in the array.
1156 *
1157 * This function set the state of @p window. @p state is an array of
1158 * states of size @p num. If @p window or @p state are @c NULL, or if
1159 * @p num is less or equal than 0, the function does nothing.
1160 */
1161EAPI void
1162ecore_win32_window_state_set(Ecore_Win32_Window *window,
1163 Ecore_Win32_Window_State *state,
1164 unsigned int num)
1165{
1166 unsigned int i;
1167
1168 if (!window || !state || (num <= 0))
1169 return;
1170
1171 INF("setting cursor state");
1172
1173 for (i = 0; i < num; i++)
1174 {
1175 switch (state[i])
1176 {
1177 case ECORE_WIN32_WINDOW_STATE_ICONIFIED:
1178 window->state.iconified = 1;
1179 break;
1180 case ECORE_WIN32_WINDOW_STATE_MODAL:
1181 window->state.modal = 1;
1182 break;
1183 case ECORE_WIN32_WINDOW_STATE_STICKY:
1184 window->state.sticky = 1;
1185 break;
1186 case ECORE_WIN32_WINDOW_STATE_MAXIMIZED_VERT:
1187 window->state.maximized_vert = 1;
1188 break;
1189 case ECORE_WIN32_WINDOW_STATE_MAXIMIZED_HORZ:
1190 window->state.maximized_horz = 1;
1191 break;
1192 case ECORE_WIN32_WINDOW_STATE_MAXIMIZED:
1193 window->state.maximized_horz = 1;
1194 window->state.maximized_vert = 1;
1195 break;
1196 case ECORE_WIN32_WINDOW_STATE_SHADED:
1197 window->state.shaded = 1;
1198 break;
1199 case ECORE_WIN32_WINDOW_STATE_HIDDEN:
1200 window->state.hidden = 1;
1201 break;
1202 case ECORE_WIN32_WINDOW_STATE_FULLSCREEN:
1203 window->state.fullscreen = 1;
1204 break;
1205 case ECORE_WIN32_WINDOW_STATE_ABOVE:
1206 window->state.above = 1;
1207 break;
1208 case ECORE_WIN32_WINDOW_STATE_BELOW:
1209 window->state.below = 1;
1210 break;
1211 case ECORE_WIN32_WINDOW_STATE_DEMANDS_ATTENTION:
1212 window->state.demands_attention = 1;
1213 break;
1214 case ECORE_WIN32_WINDOW_STATE_UNKNOWN:
1215 /* nothing to be done */
1216 break;
1217 }
1218 }
1219}
1220
1221/**
1222 * @brief Apply the modification of the state to the given window.
1223 *
1224 * @param window The window.
1225 * @param state The state to apply changes.
1226 * @param set The value of the state change.
1227 *
1228 * This function applies the modification of the state @p state of
1229 * @p window. @p set is used only for
1230 * #ECORE_WIN32_WINDOW_STATE_ICONIFIED and
1231 * #ECORE_WIN32_WINDOW_STATE_FULLSCREEN. If @p window is @c NULL, the
1232 * function does nothing.
1233 */
1234EAPI void
1235ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
1236 Ecore_Win32_Window_State state,
1237 unsigned int set)
1238{
1239 if (!window) return;
1240
1241 INF("sending cursor state");
1242
1243 switch (state)
1244 {
1245 case ECORE_WIN32_WINDOW_STATE_ICONIFIED:
1246 if (window->state.iconified)
1247 ecore_win32_window_iconified_set(window, set);
1248 break;
1249 case ECORE_WIN32_WINDOW_STATE_MODAL:
1250 window->state.modal = 1;
1251 break;
1252 case ECORE_WIN32_WINDOW_STATE_STICKY:
1253 window->state.sticky = 1;
1254 break;
1255 case ECORE_WIN32_WINDOW_STATE_MAXIMIZED_VERT:
1256 if (window->state.maximized_vert)
1257 {
1258 RECT rect;
1259 int y;
1260 int height;
1261
1262 if (!SystemParametersInfo(SPI_GETWORKAREA, 0,
1263 &rect, 0))
1264 {
1265 ERR("SystemParametersInfo() failed");
1266 break;
1267 }
1268 y = rect.top;
1269 height = rect.bottom - rect.top;
1270
1271 if (!GetClientRect(window->window, &rect))
1272 {
1273 ERR("GetClientRect() failed");
1274 break;
1275 }
1276
1277 if (!MoveWindow(window->window, rect.left, y,
1278 rect.right - rect.left,
1279 height,
1280 TRUE))
1281 {
1282 ERR("MoveWindow() failed");
1283 }
1284 }
1285 break;
1286 case ECORE_WIN32_WINDOW_STATE_MAXIMIZED_HORZ:
1287 if (window->state.maximized_horz)
1288 {
1289 RECT rect;
1290
1291 if (!GetClientRect(window->window, &rect))
1292 {
1293 ERR("GetClientRect() failed");
1294 break;
1295 }
1296
1297 if (!MoveWindow(window->window, 0, rect.top,
1298 GetSystemMetrics(SM_CXSCREEN),
1299 rect.bottom - rect.top,
1300 TRUE))
1301 {
1302 ERR("MoveWindow() failed");
1303 }
1304 }
1305 break;
1306 case ECORE_WIN32_WINDOW_STATE_MAXIMIZED:
1307 if (window->state.maximized_vert && window->state.maximized_horz)
1308 {
1309 RECT rect;
1310
1311 if (!SystemParametersInfo(SPI_GETWORKAREA, 0,
1312 &rect, 0))
1313 {
1314 ERR("SystemParametersInfo() failed");
1315 break;
1316 }
1317
1318 if (!MoveWindow(window->window, 0, 0,
1319 GetSystemMetrics(SM_CXSCREEN),
1320 rect.bottom - rect.top,
1321 TRUE))
1322 {
1323 ERR("MoveWindow() failed");
1324 }
1325 }
1326 break;
1327 case ECORE_WIN32_WINDOW_STATE_SHADED:
1328 window->state.shaded = 1;
1329 break;
1330 case ECORE_WIN32_WINDOW_STATE_HIDDEN:
1331 window->state.hidden = 1;
1332 break;
1333 case ECORE_WIN32_WINDOW_STATE_FULLSCREEN:
1334 if (window->state.fullscreen)
1335 ecore_win32_window_fullscreen_set(window, set);
1336 break;
1337 case ECORE_WIN32_WINDOW_STATE_ABOVE:
1338 if (window->state.above)
1339 if (!SetWindowPos(window->window, HWND_TOP,
1340 0, 0,
1341 0, 0,
1342 SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW))
1343 {
1344 ERR("SetWindowPos() failed");
1345 }
1346 break;
1347 case ECORE_WIN32_WINDOW_STATE_BELOW:
1348 if (window->state.below)
1349 if (!SetWindowPos(window->window, HWND_BOTTOM,
1350 0, 0,
1351 0, 0,
1352 SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW))
1353 {
1354 ERR("SetWindowPos() failed");
1355 }
1356 break;
1357 case ECORE_WIN32_WINDOW_STATE_DEMANDS_ATTENTION:
1358 window->state.demands_attention = 1;
1359 break;
1360 case ECORE_WIN32_WINDOW_STATE_UNKNOWN:
1361 /* nothing to be done */
1362 break;
1363 }
1364}
1365
1366/**
1367 * @brief Set the type of the given window.
1368 *
1369 * @param window The window to modify the type.
1370 * @param type The nwindow types.
1371 *
1372 * This function set the type of @p window to @p type. If
1373 * @p window is @c NULL, the function does nothing.
1374 */
1375EAPI void
1376ecore_win32_window_type_set(Ecore_Win32_Window *window,
1377 Ecore_Win32_Window_Type type)
1378{
1379 if (!window)
1380 return;
1381
1382 INF("setting window type");
1383
1384 switch (type)
1385 {
1386 case ECORE_WIN32_WINDOW_TYPE_DESKTOP:
1387 window->type.desktop = 1;
1388 break;
1389 case ECORE_WIN32_WINDOW_TYPE_DOCK:
1390 window->type.dock = 1;
1391 break;
1392 case ECORE_WIN32_WINDOW_TYPE_TOOLBAR:
1393 window->type.toolbar = 1;
1394 break;
1395 case ECORE_WIN32_WINDOW_TYPE_MENU:
1396 window->type.menu = 1;
1397 break;
1398 case ECORE_WIN32_WINDOW_TYPE_UTILITY:
1399 window->type.utility = 1;
1400 break;
1401 case ECORE_WIN32_WINDOW_TYPE_SPLASH:
1402 window->type.splash = 1;
1403 break;
1404 case ECORE_WIN32_WINDOW_TYPE_DIALOG:
1405 window->type.dialog = 1;
1406 break;
1407 case ECORE_WIN32_WINDOW_TYPE_NORMAL:
1408 window->type.normal = 1;
1409 break;
1410 case ECORE_WIN32_WINDOW_TYPE_UNKNOWN:
1411 window->type.normal = 1;
1412 break;
1413 }
1414}
1415
1416/**
1417 * @}
1418 */