1 #ifndef __ECORE_WIN32_H__
2 #define __ECORE_WIN32_H__
5 * DO NOT USE THIS HEADER. IT IS A WORK IN PROGRESS API. 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 can 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 can 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")))
54 * @defgroup Ecore_Win32_Group Ecore_Win32 library
55 * @ingroup Ecore_Group
61 * @typedef Ecore_Win32_Window_State
62 * @brief Enumeration for state of a window.
66 ECORE_WIN32_WINDOW_STATE_ICONIFIED, /**< Iconified window */
67 ECORE_WIN32_WINDOW_STATE_MODAL, /**< Modal dialog box */
68 ECORE_WIN32_WINDOW_STATE_STICKY, /**< Sticky window */
69 ECORE_WIN32_WINDOW_STATE_MAXIMIZED_VERT, /**< Maximum vertical sized window */
70 ECORE_WIN32_WINDOW_STATE_MAXIMIZED_HORZ, /**< Maximum horizontal sized window */
71 ECORE_WIN32_WINDOW_STATE_MAXIMIZED, /**< Maximum sized window */
72 ECORE_WIN32_WINDOW_STATE_SHADED, /**< Shaded window */
73 ECORE_WIN32_WINDOW_STATE_HIDDEN, /**< Hidden (minimized or iconified) window */
74 ECORE_WIN32_WINDOW_STATE_FULLSCREEN, /**< Fullscreen window */
75 ECORE_WIN32_WINDOW_STATE_ABOVE, /**< Above window */
76 ECORE_WIN32_WINDOW_STATE_BELOW, /**< Below window */
77 ECORE_WIN32_WINDOW_STATE_DEMANDS_ATTENTION, /**< To document */
78 ECORE_WIN32_WINDOW_STATE_UNKNOWN /**< Unknown state */
79 } Ecore_Win32_Window_State;
82 * @typedef Ecore_Win32_Window_Type
83 * @brief Enumeration for type of a window.
87 ECORE_WIN32_WINDOW_TYPE_DESKTOP, /**< Desktop feature */
88 ECORE_WIN32_WINDOW_TYPE_DOCK, /**< Dock window (should be on top of other windows) */
89 ECORE_WIN32_WINDOW_TYPE_TOOLBAR, /**< Toolbar window */
90 ECORE_WIN32_WINDOW_TYPE_MENU, /**< Menu window */
91 ECORE_WIN32_WINDOW_TYPE_UTILITY, /**< Small persistent utility window, such as a palette or toolbox */
92 ECORE_WIN32_WINDOW_TYPE_SPLASH, /**< Splash screen window displayed as an application is starting up */
93 ECORE_WIN32_WINDOW_TYPE_DIALOG, /**< Dialog window */
94 ECORE_WIN32_WINDOW_TYPE_NORMAL, /**< Normal top-level window */
95 ECORE_WIN32_WINDOW_TYPE_UNKNOWN /**< Unknown type */
96 } Ecore_Win32_Window_Type;
99 * @typedef Ecore_Win32_Cursor_Shape
100 * @brief Enumeration for shape of a cursor.
104 ECORE_WIN32_CURSOR_SHAPE_APP_STARTING, /**< Standard arrow and small hourglass */
105 ECORE_WIN32_CURSOR_SHAPE_ARROW, /**< Standard arrow */
106 ECORE_WIN32_CURSOR_SHAPE_CROSS, /**< Crosshair */
107 ECORE_WIN32_CURSOR_SHAPE_HAND, /**< Hand */
108 ECORE_WIN32_CURSOR_SHAPE_HELP, /**< Arrow and question mark */
109 ECORE_WIN32_CURSOR_SHAPE_I_BEAM, /**< I-beam */
110 ECORE_WIN32_CURSOR_SHAPE_NO, /**< Slashed circle */
111 ECORE_WIN32_CURSOR_SHAPE_SIZE_ALL, /**< Four-pointed arrow pointing north, south, east, and west */
112 ECORE_WIN32_CURSOR_SHAPE_SIZE_NESW, /**< Double-pointed arrow pointing northeast and southwest */
113 ECORE_WIN32_CURSOR_SHAPE_SIZE_NS, /**< Double-pointed arrow pointing north and south */
114 ECORE_WIN32_CURSOR_SHAPE_SIZE_NWSE, /**< Double-pointed arrow pointing northwest and southeast */
115 ECORE_WIN32_CURSOR_SHAPE_SIZE_WE, /**< Double-pointed arrow pointing west and east */
116 ECORE_WIN32_CURSOR_SHAPE_UP_ARROW, /**< Vertical arrow */
117 ECORE_WIN32_CURSOR_SHAPE_WAIT /**< Hourglass */
118 } Ecore_Win32_Cursor_Shape;
121 * @typedef Ecore_Win32_DnD_State
122 * @brief Enumeration for state of a DnD operation.
126 ECORE_WIN32_DND_EVENT_DRAG_ENTER = 1, /**< Drag enter */
127 ECORE_WIN32_DND_EVENT_DRAG_OVER = 2, /**< Drag over */
128 ECORE_WIN32_DND_EVENT_DRAG_LEAVE = 3, /**< Drag leave */
129 ECORE_WIN32_DND_EVENT_DROP = 4 /**< Drop */
130 } Ecore_Win32_DnD_State;
133 * @typedef Ecore_Win32_Window
134 * @brief The structure type containing the abstract type for a window.
136 typedef struct _Ecore_Win32_Window Ecore_Win32_Window;
139 * @typedef Ecore_Win32_Cursor
140 * @brief The structure type containing the abstract type for a cursor.
142 typedef void Ecore_Win32_Cursor;
146 * @typedef Ecore_Win32_Event_Mouse_In
147 * @brief The structure type containing the event sent when the mouse enters the window.
149 typedef struct _Ecore_Win32_Event_Mouse_In Ecore_Win32_Event_Mouse_In;
152 * @typedef Ecore_Win32_Event_Mouse_Out
153 * @brief The structure type containing the event sent when the mouse leaves the window.
155 typedef struct _Ecore_Win32_Event_Mouse_Out Ecore_Win32_Event_Mouse_Out;
158 * @typedef Ecore_Win32_Event_Window_Focus_In
159 * @brief The structure type containing the event sent when the window gets focus.
161 typedef struct _Ecore_Win32_Event_Window_Focus_In Ecore_Win32_Event_Window_Focus_In;
164 * @typedef Ecore_Win32_Event_Window_Focus_Out
165 * @brief The structure type containing the event sent when the window loses focus.
167 typedef struct _Ecore_Win32_Event_Window_Focus_Out Ecore_Win32_Event_Window_Focus_Out;
170 * @typedef Ecore_Win32_Event_Window_Damage
171 * @brief The structure type containing the event sent when the window is damaged.
173 typedef struct _Ecore_Win32_Event_Window_Damage Ecore_Win32_Event_Window_Damage;
176 * @typedef Ecore_Win32_Event_Window_Create
177 * @brief The structure type containing the event sent when the window is created.
179 typedef struct _Ecore_Win32_Event_Window_Create Ecore_Win32_Event_Window_Create;
182 * @typedef Ecore_Win32_Event_Window_Destroy
183 * @brief The structure type containing the event sent when the window is destroyed.
185 typedef struct _Ecore_Win32_Event_Window_Destroy Ecore_Win32_Event_Window_Destroy;
188 * @typedef Ecore_Win32_Event_Window_Hide
189 * @brief The structure type containing the event sent when the window is hidden.
191 typedef struct _Ecore_Win32_Event_Window_Hide Ecore_Win32_Event_Window_Hide;
194 * @typedef Ecore_Win32_Event_Window_Show
195 * @brief The structure type containing the event sent when the window is shown.
197 typedef struct _Ecore_Win32_Event_Window_Show Ecore_Win32_Event_Window_Show;
200 * @typedef Ecore_Win32_Event_Window_Configure
201 * @brief The structure type containing the event sent when the window is configured.
203 typedef struct _Ecore_Win32_Event_Window_Configure Ecore_Win32_Event_Window_Configure;
206 * @typedef Ecore_Win32_Event_Window_Resize
207 * @brief The structure type containing the event sent when the window is resized.
209 typedef struct _Ecore_Win32_Event_Window_Resize Ecore_Win32_Event_Window_Resize;
212 * @typedef Ecore_Win32_Event_Window_Delete_Request
213 * @brief The structure type containing the event sent when the window is deleted.
215 typedef struct _Ecore_Win32_Event_Window_Delete_Request Ecore_Win32_Event_Window_Delete_Request;
218 * @struct _Ecore_Win32_Event_Mouse_In
219 * @brief The structure type containing the event sent when the mouse enters the window.
221 struct _Ecore_Win32_Event_Mouse_In
223 Ecore_Win32_Window *window; /**< The window that received the event */
224 int x; /**< The x coordinate where the mouse left */
225 int y; /**< The y coordinate where the mouse entered */
226 unsigned long timestamp; /**< The time when the event occurred */
230 * @struct _Ecore_Win32_Event_Mouse_Out
231 * @brief The structure type containing the event sent when the mouse leaves the window.
233 struct _Ecore_Win32_Event_Mouse_Out
235 Ecore_Win32_Window *window; /**< The window that received the event */
236 int x; /**< The x coordinate where the mouse left */
237 int y; /**< The y coordinate where the mouse left */
238 unsigned long timestamp; /**< The time when the event occurred */
242 * @struct _Ecore_Win32_Event_Window_Focus_In
243 * @brief The structure type containing the event sent when the window gets focus.
245 struct _Ecore_Win32_Event_Window_Focus_In
247 Ecore_Win32_Window *window; /**< The window that received the event */
248 unsigned long timestamp; /**< The time when the event occurred */
252 * @struct _Ecore_Win32_Event_Window_Focus_Out
253 * @brief The structure type containing the event sent when the window loses focus.
255 struct _Ecore_Win32_Event_Window_Focus_Out
257 Ecore_Win32_Window *window; /**< The window that received the event */
258 unsigned long timestamp; /**< The time when the event occurred */
262 * @struct _Ecore_Win32_Event_Window_Damage
263 * @brief The structure type containing the event sent when the window is damaged.
265 struct _Ecore_Win32_Event_Window_Damage
267 Ecore_Win32_Window *window; /**< The window that received the event */
268 int x; /**< The x coordinate of the top left corner of the damaged region */
269 int y; /**< The y coordinate of the top left corner of the damaged region */
270 int width; /**< The width of the damaged region */
271 int height; /**< The time when the event occurred */
272 unsigned long timestamp; /**< The time when the event occurred */
276 * @struct _Ecore_Win32_Event_Window_Create
277 * @brief The structure type containing the event sent when the window is created.
279 struct _Ecore_Win32_Event_Window_Create
281 Ecore_Win32_Window *window; /**< The window that received the event */
282 unsigned long timestamp; /**< The time when the event occurred */
286 * @struct _Ecore_Win32_Event_Window_Destroy
287 * @brief The structure type containing the event sent when the window is destroyed.
289 struct _Ecore_Win32_Event_Window_Destroy
291 Ecore_Win32_Window *window; /**< The window that received the event */
292 unsigned long timestamp; /**< The time when the event occurred */
296 * @struct _Ecore_Win32_Event_Window_Hide
297 * @brief The structure type containing the event sent when the window is hidden.
299 struct _Ecore_Win32_Event_Window_Hide
301 Ecore_Win32_Window *window; /**< The window that received the event */
302 unsigned long timestamp; /**< The time when the event occurred */
306 * @struct _Ecore_Win32_Event_Window_Show
307 * @brief The structure type containing the event sent when the window is shown.
309 struct _Ecore_Win32_Event_Window_Show
311 Ecore_Win32_Window *window; /**< The window that received the event */
312 unsigned long timestamp; /**< The time when the event occurred */
316 * @struct _Ecore_Win32_Event_Window_Configure
317 * @brief The structure type containing the event sent when the window is configured.
319 struct _Ecore_Win32_Event_Window_Configure
321 Ecore_Win32_Window *window; /**< The window that received the event */
322 Ecore_Win32_Window *abovewin;
323 int x; /**< The new x coordinate of the top left corner */
324 int y; /**< The new y coordinate of the top left corner */
325 int width; /**< The new width */
326 int height; /**< The new height */
327 unsigned long timestamp; /**< The time when the event occurred */
331 * @struct _Ecore_Win32_Event_Window_Resize
332 * @brief The structure type containing the event sent when the window is resized.
334 struct _Ecore_Win32_Event_Window_Resize
336 Ecore_Win32_Window *window; /**< The window that received the event */
337 int width; /**< The new width */
338 int height; /**< The new height */
339 unsigned long timestamp; /**< The time when the event occurred */
343 * @struct _Ecore_Win32_Event_Window_Delete_Request
344 * @brief The structure type containing the event sent when the window is deleted.
346 struct _Ecore_Win32_Event_Window_Delete_Request
348 Ecore_Win32_Window *window; /**< The window that received the event */
349 unsigned long timestamp; /**< The time when the event occurred */
353 * @typedef Ecore_Win32_Dnd_DropTarget_Callback
354 * @brief The integer callback type for Drop operations. See ecore_win32_dnd_register_drop_target().
356 typedef int (*Ecore_Win32_Dnd_DropTarget_Callback)(void *window, int event, int pt_x, int pt_y, void *data, int size);
358 EAPI extern int ECORE_WIN32_EVENT_MOUSE_IN; /**< Ecore_Event for the #Ecore_Win32_Event_Mouse_In event */
359 EAPI extern int ECORE_WIN32_EVENT_MOUSE_OUT; /**< Ecore_Event for the #Ecore_Win32_Event_Mouse_Out event */
360 EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_IN; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Focus_In event */
361 EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Focus_Out event */
362 EAPI extern int ECORE_WIN32_EVENT_WINDOW_DAMAGE; /**< Ecore_Event for the #Ecore_Win32_Event_Damage event */
363 EAPI extern int ECORE_WIN32_EVENT_WINDOW_CREATE; /**< Ecore_Event for the #Ecore_Win32_Event_Create event */
364 EAPI extern int ECORE_WIN32_EVENT_WINDOW_DESTROY; /**< Ecore_Event for the #Ecore_Win32_Event_Destroy event */
365 EAPI extern int ECORE_WIN32_EVENT_WINDOW_HIDE; /**< Ecore_Event for the #Ecore_Win32_Event_Hide event */
366 EAPI extern int ECORE_WIN32_EVENT_WINDOW_SHOW; /**< Ecore_Event for the #Ecore_Win32_Event_Show event */
367 EAPI extern int ECORE_WIN32_EVENT_WINDOW_CONFIGURE; /**< Ecore_Event for the #Ecore_Win32_Event_Configure event */
368 EAPI extern int ECORE_WIN32_EVENT_WINDOW_RESIZE; /**< Ecore_Event for the #Ecore_Win32_Event_Resize event */
369 EAPI extern int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Delete_Request event */
374 EAPI int ecore_win32_init();
375 EAPI int ecore_win32_shutdown();
376 EAPI int ecore_win32_screen_depth_get();
377 EAPI void ecore_win32_double_click_time_set(double t);
378 EAPI double ecore_win32_double_click_time_get(void);
379 EAPI unsigned long ecore_win32_current_time_get(void);
383 EAPI Ecore_Win32_Window *ecore_win32_window_new(Ecore_Win32_Window *parent,
388 EAPI Ecore_Win32_Window *ecore_win32_window_override_new(Ecore_Win32_Window *parent,
394 EAPI void ecore_win32_window_free(Ecore_Win32_Window *window);
396 EAPI void *ecore_win32_window_hwnd_get(Ecore_Win32_Window *window);
398 EAPI void ecore_win32_window_move(Ecore_Win32_Window *window,
402 EAPI void ecore_win32_window_resize(Ecore_Win32_Window *window,
406 EAPI void ecore_win32_window_move_resize(Ecore_Win32_Window *window,
412 EAPI void ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
418 EAPI void ecore_win32_window_size_get(Ecore_Win32_Window *window,
422 EAPI void ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
423 unsigned int min_width,
424 unsigned int min_height);
426 EAPI void ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
427 unsigned int *min_width,
428 unsigned int *min_height);
430 EAPI void ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
431 unsigned int max_width,
432 unsigned int max_height);
434 EAPI void ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
435 unsigned int *max_width,
436 unsigned int *max_height);
438 EAPI void ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
439 unsigned int base_width,
440 unsigned int base_height);
442 EAPI void ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
443 unsigned int *base_width,
444 unsigned int *base_height);
446 EAPI void ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
447 unsigned int step_width,
448 unsigned int step_height);
450 EAPI void ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
451 unsigned int *step_width,
452 unsigned int *step_height);
454 EAPI void ecore_win32_window_show(Ecore_Win32_Window *window);
456 EAPI void ecore_win32_window_hide(Ecore_Win32_Window *window);
458 EAPI void ecore_win32_window_raise(Ecore_Win32_Window *window);
460 EAPI void ecore_win32_window_lower(Ecore_Win32_Window *window);
462 EAPI void ecore_win32_window_title_set(Ecore_Win32_Window *window,
465 EAPI void ecore_win32_window_focus(Ecore_Win32_Window *window);
467 EAPI void *ecore_win32_window_focus_get(void);
469 EAPI void ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
472 EAPI void ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
475 EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
478 EAPI void ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
479 Ecore_Win32_Cursor *cursor);
481 EAPI void ecore_win32_window_state_set(Ecore_Win32_Window *window,
482 Ecore_Win32_Window_State *state,
485 EAPI void ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
486 Ecore_Win32_Window_State state,
489 EAPI void ecore_win32_window_type_set(Ecore_Win32_Window *window,
490 Ecore_Win32_Window_Type type);
494 EAPI Ecore_Win32_Cursor *ecore_win32_cursor_new(const void *pixels_and,
495 const void *pixels_xor,
501 EAPI void ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor);
503 EAPI Ecore_Win32_Cursor *ecore_win32_cursor_shaped_new(Ecore_Win32_Cursor_Shape shape);
505 EAPI void ecore_win32_cursor_size_get(int *width, int *height);
510 EAPI int ecore_win32_dnd_init();
511 EAPI int ecore_win32_dnd_shutdown();
512 EAPI Eina_Bool ecore_win32_dnd_begin(const char *data,
514 EAPI Eina_Bool ecore_win32_dnd_register_drop_target(Ecore_Win32_Window *window,
515 Ecore_Win32_Dnd_DropTarget_Callback callback);
516 EAPI void ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window);
528 #endif /* __ECORE_WIN32_H__ */