1 #ifndef __ECORE_WIN32_H__
2 #define __ECORE_WIN32_H__
5 * DO NOT USE THIS HEADER. IT IS WORK IN PROGRESS. IT IS NOT FINAL AND
9 #ifndef ECORE_WIN32_WIP_POZEFLKSD
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.")
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."
26 # ifdef EFL_ECORE_WIN32_BUILD
28 # define EAPI __declspec(dllexport)
31 # endif /* ! DLL_EXPORT */
33 # define EAPI __declspec(dllimport)
34 # endif /* ! EFL_ECORE_WIN32_BUILD */
38 # define EAPI __attribute__ ((visibility("default")))
53 * @defgroup Ecore_Win32_Group Ecore_Win32 library
59 * @typedef Ecore_Win32_Window_State
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;
80 * @typedef Ecore_Win32_Window_Type
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;
97 * @typedef Ecore_Win32_Cursor_Shape
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;
119 * @typedef Ecore_Win32_DnD_State
120 * State of a DnD operation.
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;
131 * @typedef Ecore_Win32_Window
132 * Abstract type for a window.
134 typedef struct _Ecore_Win32_Window Ecore_Win32_Window;
137 * @typedef Ecore_Win32_Cursor
138 * Abstract type for a cursor.
140 typedef void Ecore_Win32_Cursor;
144 * @typedef Ecore_Win32_Event_Mouse_In
145 * Event sent when the mouse enters the window.
147 typedef struct _Ecore_Win32_Event_Mouse_In Ecore_Win32_Event_Mouse_In;
150 * @typedef Ecore_Win32_Event_Mouse_Out
151 * Event sent when the mouse leaves the window.
153 typedef struct _Ecore_Win32_Event_Mouse_Out Ecore_Win32_Event_Mouse_Out;
156 * @typedef Ecore_Win32_Event_Window_Focus_In
157 * Event sent when the window gets the focus.
159 typedef struct _Ecore_Win32_Event_Window_Focus_In Ecore_Win32_Event_Window_Focus_In;
162 * @typedef Ecore_Win32_Event_Window_Focus_Out
163 * Event sent when the window looses the focus.
165 typedef struct _Ecore_Win32_Event_Window_Focus_Out Ecore_Win32_Event_Window_Focus_Out;
168 * @typedef Ecore_Win32_Event_Window_Damage
169 * Event sent when the window is damaged.
171 typedef struct _Ecore_Win32_Event_Window_Damage Ecore_Win32_Event_Window_Damage;
174 * @typedef Ecore_Win32_Event_Window_Create
175 * Event sent when the window is created.
177 typedef struct _Ecore_Win32_Event_Window_Create Ecore_Win32_Event_Window_Create;
180 * @typedef Ecore_Win32_Event_Window_Destroy
181 * Event sent when the window is destroyed.
183 typedef struct _Ecore_Win32_Event_Window_Destroy Ecore_Win32_Event_Window_Destroy;
186 * @typedef Ecore_Win32_Event_Window_Hide
187 * Event sent when the window is hidden.
189 typedef struct _Ecore_Win32_Event_Window_Hide Ecore_Win32_Event_Window_Hide;
192 * @typedef Ecore_Win32_Event_Window_Show
193 * Event sent when the window is shown.
195 typedef struct _Ecore_Win32_Event_Window_Show Ecore_Win32_Event_Window_Show;
198 * @typedef Ecore_Win32_Event_Window_Configure
199 * Event sent when the window is configured.
201 typedef struct _Ecore_Win32_Event_Window_Configure Ecore_Win32_Event_Window_Configure;
204 * @typedef Ecore_Win32_Event_Window_Resize
205 * Event sent when the window is resized.
207 typedef struct _Ecore_Win32_Event_Window_Resize Ecore_Win32_Event_Window_Resize;
210 * @typedef Ecore_Win32_Event_Window_Delete_Request
211 * Event sent when the window is deleted.
213 typedef struct _Ecore_Win32_Event_Window_Delete_Request Ecore_Win32_Event_Window_Delete_Request;
216 * @struct _Ecore_Win32_Event_Mouse_In
217 * Event sent when the mouse enters the window.
219 struct _Ecore_Win32_Event_Mouse_In
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 */
228 * @struct _Ecore_Win32_Event_Mouse_Out
229 * Event sent when the mouse leaves the window.
231 struct _Ecore_Win32_Event_Mouse_Out
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 */
240 * @struct _Ecore_Win32_Event_Window_Focus_In
241 * Event sent when the window gets the focus.
243 struct _Ecore_Win32_Event_Window_Focus_In
245 Ecore_Win32_Window *window; /**< The window that received the event */
246 unsigned long timestamp; /**< The time the event occurred */
250 * @struct _Ecore_Win32_Event_Window_Focus_Out
251 * Event sent when the window looses the focus.
253 struct _Ecore_Win32_Event_Window_Focus_Out
255 Ecore_Win32_Window *window; /**< The window that received the event */
256 unsigned long timestamp; /**< The time the event occurred */
260 * @struct _Ecore_Win32_Event_Window_Damage
261 * Event sent when the window is damaged.
263 struct _Ecore_Win32_Event_Window_Damage
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 */
274 * @struct _Ecore_Win32_Event_Window_Create
275 * Event sent when the window is created.
277 struct _Ecore_Win32_Event_Window_Create
279 Ecore_Win32_Window *window; /**< The window that received the event */
280 unsigned long timestamp; /**< The time the event occurred */
284 * @struct _Ecore_Win32_Event_Window_Destroy
285 * Event sent when the window is destroyed.
287 struct _Ecore_Win32_Event_Window_Destroy
289 Ecore_Win32_Window *window; /**< The window that received the event */
290 unsigned long timestamp; /**< The time the event occurred */
294 * @struct _Ecore_Win32_Event_Window_Hide
295 * Event sent when the window is hidden.
297 struct _Ecore_Win32_Event_Window_Hide
299 Ecore_Win32_Window *window; /**< The window that received the event */
300 unsigned long timestamp; /**< The time the event occurred */
304 * @struct _Ecore_Win32_Event_Window_Show
305 * Event sent when the window is shown.
307 struct _Ecore_Win32_Event_Window_Show
309 Ecore_Win32_Window *window; /**< The window that received the event */
310 unsigned long timestamp; /**< The time the event occurred */
314 * @struct _Ecore_Win32_Event_Window_Configure
315 * Event sent when the window is configured.
317 struct _Ecore_Win32_Event_Window_Configure
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 */
329 * @struct _Ecore_Win32_Event_Window_Resize
330 * Event sent when the window is resized.
332 struct _Ecore_Win32_Event_Window_Resize
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 */
341 * @struct _Ecore_Win32_Event_Window_Delete_Request
342 * Event sent when the window is deleted.
344 struct _Ecore_Win32_Event_Window_Delete_Request
346 Ecore_Win32_Window *window; /**< The window that received the event */
347 unsigned long timestamp; /**< The time the event occurred */
351 * @typedef Ecore_Win32_Dnd_DropTarget_Callback
352 * Callback type for Drop operations. See ecore_win32_dnd_register_drop_target().
354 typedef int (*Ecore_Win32_Dnd_DropTarget_Callback)(void *window, int event, int pt_x, int pt_y, void *data, int size);
356 EAPI extern int ECORE_WIN32_EVENT_MOUSE_IN; /**< Ecore_Event for the #Ecore_Win32_Event_Mouse_In event */
357 EAPI extern int ECORE_WIN32_EVENT_MOUSE_OUT; /**< Ecore_Event for the #Ecore_Win32_Event_Mouse_Out event */
358 EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_IN; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Focus_In event */
359 EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Focus_Out event */
360 EAPI extern int ECORE_WIN32_EVENT_WINDOW_DAMAGE; /**< Ecore_Event for the Ecore_Win32_Event_Damage event */
361 EAPI extern int ECORE_WIN32_EVENT_WINDOW_CREATE; /**< Ecore_Event for the Ecore_Win32_Event_Create event */
362 EAPI extern int ECORE_WIN32_EVENT_WINDOW_DESTROY; /**< Ecore_Event for the Ecore_Win32_Event_Destroy event */
363 EAPI extern int ECORE_WIN32_EVENT_WINDOW_HIDE; /**< Ecore_Event for the Ecore_Win32_Event_Hide event */
364 EAPI extern int ECORE_WIN32_EVENT_WINDOW_SHOW; /**< Ecore_Event for the Ecore_Win32_Event_Show event */
365 EAPI extern int ECORE_WIN32_EVENT_WINDOW_CONFIGURE; /**< Ecore_Event for the Ecore_Win32_Event_Configure event */
366 EAPI extern int ECORE_WIN32_EVENT_WINDOW_RESIZE; /**< Ecore_Event for the Ecore_Win32_Event_Resize event */
367 EAPI extern int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Delete_Request event */
372 EAPI int ecore_win32_init();
373 EAPI int ecore_win32_shutdown();
374 EAPI int ecore_win32_screen_depth_get();
375 EAPI void ecore_win32_double_click_time_set(double t);
376 EAPI double ecore_win32_double_click_time_get(void);
377 EAPI unsigned long ecore_win32_current_time_get(void);
381 EAPI Ecore_Win32_Window *ecore_win32_window_new(Ecore_Win32_Window *parent,
386 EAPI Ecore_Win32_Window *ecore_win32_window_override_new(Ecore_Win32_Window *parent,
392 EAPI void ecore_win32_window_free(Ecore_Win32_Window *window);
394 EAPI void *ecore_win32_window_hwnd_get(Ecore_Win32_Window *window);
396 EAPI void ecore_win32_window_move(Ecore_Win32_Window *window,
400 EAPI void ecore_win32_window_resize(Ecore_Win32_Window *window,
404 EAPI void ecore_win32_window_move_resize(Ecore_Win32_Window *window,
410 EAPI void ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
416 EAPI void ecore_win32_window_size_get(Ecore_Win32_Window *window,
420 EAPI void ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
421 unsigned int min_width,
422 unsigned int min_height);
424 EAPI void ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
425 unsigned int *min_width,
426 unsigned int *min_height);
428 EAPI void ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
429 unsigned int max_width,
430 unsigned int max_height);
432 EAPI void ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
433 unsigned int *max_width,
434 unsigned int *max_height);
436 EAPI void ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
437 unsigned int base_width,
438 unsigned int base_height);
440 EAPI void ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
441 unsigned int *base_width,
442 unsigned int *base_height);
444 EAPI void ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
445 unsigned int step_width,
446 unsigned int step_height);
448 EAPI void ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
449 unsigned int *step_width,
450 unsigned int *step_height);
452 EAPI void ecore_win32_window_show(Ecore_Win32_Window *window);
454 EAPI void ecore_win32_window_hide(Ecore_Win32_Window *window);
456 EAPI void ecore_win32_window_raise(Ecore_Win32_Window *window);
458 EAPI void ecore_win32_window_lower(Ecore_Win32_Window *window);
460 EAPI void ecore_win32_window_title_set(Ecore_Win32_Window *window,
463 EAPI void ecore_win32_window_focus(Ecore_Win32_Window *window);
465 EAPI void *ecore_win32_window_focus_get(void);
467 EAPI void ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
470 EAPI void ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
473 EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
476 EAPI void ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
477 Ecore_Win32_Cursor *cursor);
479 EAPI void ecore_win32_window_state_set(Ecore_Win32_Window *window,
480 Ecore_Win32_Window_State *state,
483 EAPI void ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
484 Ecore_Win32_Window_State state,
487 EAPI void ecore_win32_window_type_set(Ecore_Win32_Window *window,
488 Ecore_Win32_Window_Type type);
492 EAPI Ecore_Win32_Cursor *ecore_win32_cursor_new(const void *pixels_and,
493 const void *pixels_xor,
499 EAPI void ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor);
501 EAPI Ecore_Win32_Cursor *ecore_win32_cursor_shaped_new(Ecore_Win32_Cursor_Shape shape);
503 EAPI void ecore_win32_cursor_size_get(int *width, int *height);
508 EAPI int ecore_win32_dnd_init();
509 EAPI int ecore_win32_dnd_shutdown();
510 EAPI Eina_Bool ecore_win32_dnd_begin(const char *data,
512 EAPI Eina_Bool ecore_win32_dnd_register_drop_target(Ecore_Win32_Window *window,
513 Ecore_Win32_Dnd_DropTarget_Callback callback);
514 EAPI void ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window);
526 #endif /* __ECORE_WIN32_H__ */