tizen 2.3.1 release
[framework/uifw/ecore.git] / src / lib / ecore_win32 / Ecore_Win32.h
1 #ifndef __ECORE_WIN32_H__
2 #define __ECORE_WIN32_H__
3
4 /*
5  * DO NOT USE THIS HEADER. IT IS A WORK IN PROGRESS API. 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 can 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 can 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
49 extern "C" {
50 #endif
51
52 /**
53  * @internal
54  * @defgroup Ecore_Win32_Group Ecore_Win32 library
55  * @ingroup Ecore_Group
56  *
57  * @{
58  */
59
60 /**
61  * @typedef Ecore_Win32_Window_State
62  * @brief Enumeration for state of a window.
63  */
64 typedef enum
65 {
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;
80
81 /**
82  * @typedef Ecore_Win32_Window_Type
83  * @brief Enumeration for type of a window.
84  */
85 typedef enum
86 {
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;
97
98 /**
99  * @typedef Ecore_Win32_Cursor_Shape
100  * @brief Enumeration for shape of a cursor.
101  */
102 typedef enum
103 {
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;
119
120 /**
121  * @typedef Ecore_Win32_DnD_State
122  * @brief Enumeration for state of a DnD operation.
123  */
124 typedef enum
125 {
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;
131
132 /**
133  * @typedef Ecore_Win32_Window
134  * @brief The structure type containing the abstract type for a window.
135  */
136 typedef struct _Ecore_Win32_Window Ecore_Win32_Window;
137
138 /**
139  * @typedef Ecore_Win32_Cursor
140  * @brief The structure type containing the abstract type for a cursor.
141  */
142 typedef void Ecore_Win32_Cursor;
143
144
145 /**
146  * @typedef Ecore_Win32_Event_Mouse_In
147  * @brief The structure type containing the event sent when the mouse enters the window.
148  */
149 typedef struct _Ecore_Win32_Event_Mouse_In              Ecore_Win32_Event_Mouse_In;
150
151 /**
152  * @typedef Ecore_Win32_Event_Mouse_Out
153  * @brief The structure type containing the event sent when the mouse leaves the window.
154  */
155 typedef struct _Ecore_Win32_Event_Mouse_Out             Ecore_Win32_Event_Mouse_Out;
156
157 /**
158  * @typedef Ecore_Win32_Event_Window_Focus_In
159  * @brief The structure type containing the event sent when the window gets focus.
160  */
161 typedef struct _Ecore_Win32_Event_Window_Focus_In       Ecore_Win32_Event_Window_Focus_In;
162
163 /**
164  * @typedef Ecore_Win32_Event_Window_Focus_Out
165  * @brief The structure type containing the event sent when the window loses focus.
166  */
167 typedef struct _Ecore_Win32_Event_Window_Focus_Out      Ecore_Win32_Event_Window_Focus_Out;
168
169 /**
170  * @typedef Ecore_Win32_Event_Window_Damage
171  * @brief The structure type containing the event sent when the window is damaged.
172  */
173 typedef struct _Ecore_Win32_Event_Window_Damage         Ecore_Win32_Event_Window_Damage;
174
175 /**
176  * @typedef Ecore_Win32_Event_Window_Create
177  * @brief The structure type containing the event sent when the window is created.
178  */
179 typedef struct _Ecore_Win32_Event_Window_Create         Ecore_Win32_Event_Window_Create;
180
181 /**
182  * @typedef Ecore_Win32_Event_Window_Destroy
183  * @brief The structure type containing the event sent when the window is destroyed.
184  */
185 typedef struct _Ecore_Win32_Event_Window_Destroy        Ecore_Win32_Event_Window_Destroy;
186
187 /**
188  * @typedef Ecore_Win32_Event_Window_Hide
189  * @brief The structure type containing the event sent when the window is hidden.
190  */
191 typedef struct _Ecore_Win32_Event_Window_Hide           Ecore_Win32_Event_Window_Hide;
192
193 /**
194  * @typedef Ecore_Win32_Event_Window_Show
195  * @brief The structure type containing the event sent when the window is shown.
196  */
197 typedef struct _Ecore_Win32_Event_Window_Show           Ecore_Win32_Event_Window_Show;
198
199 /**
200  * @typedef Ecore_Win32_Event_Window_Configure
201  * @brief The structure type containing the event sent when the window is configured.
202  */
203 typedef struct _Ecore_Win32_Event_Window_Configure      Ecore_Win32_Event_Window_Configure;
204
205 /**
206  * @typedef Ecore_Win32_Event_Window_Resize
207  * @brief The structure type containing the event sent when the window is resized.
208  */
209 typedef struct _Ecore_Win32_Event_Window_Resize         Ecore_Win32_Event_Window_Resize;
210
211 /**
212  * @typedef Ecore_Win32_Event_Window_Delete_Request
213  * @brief The structure type containing the event sent when the window is deleted.
214  */
215 typedef struct _Ecore_Win32_Event_Window_Delete_Request Ecore_Win32_Event_Window_Delete_Request;
216
217 /**
218  * @struct _Ecore_Win32_Event_Mouse_In
219  * @brief The structure type containing the event sent when the mouse enters the window.
220  */
221 struct _Ecore_Win32_Event_Mouse_In
222 {
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 */
227 };
228
229 /**
230  * @struct _Ecore_Win32_Event_Mouse_Out
231  * @brief The structure type containing the event sent when the mouse leaves the window.
232  */
233 struct _Ecore_Win32_Event_Mouse_Out
234 {
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 */
239 };
240
241 /**
242  * @struct _Ecore_Win32_Event_Window_Focus_In
243  * @brief The structure type containing the event sent when the window gets focus.
244  */
245 struct _Ecore_Win32_Event_Window_Focus_In
246 {
247    Ecore_Win32_Window *window; /**< The window that received the event */
248    unsigned long       timestamp; /**< The time when the event occurred */
249 };
250
251 /**
252  * @struct _Ecore_Win32_Event_Window_Focus_Out
253  * @brief The structure type containing the event sent when the window loses focus.
254  */
255 struct _Ecore_Win32_Event_Window_Focus_Out
256 {
257    Ecore_Win32_Window *window; /**< The window that received the event */
258    unsigned long       timestamp; /**< The time when the event occurred */
259 };
260
261 /**
262  * @struct _Ecore_Win32_Event_Window_Damage
263  * @brief The structure type containing the event sent when the window is damaged.
264  */
265 struct _Ecore_Win32_Event_Window_Damage
266 {
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 */
273 };
274
275 /**
276  * @struct _Ecore_Win32_Event_Window_Create
277  * @brief The structure type containing the event sent when the window is created.
278  */
279 struct _Ecore_Win32_Event_Window_Create
280 {
281    Ecore_Win32_Window *window; /**< The window that received the event */
282    unsigned long       timestamp; /**< The time when the event occurred */
283 };
284
285 /**
286  * @struct _Ecore_Win32_Event_Window_Destroy
287  * @brief The structure type containing the event sent when the window is destroyed.
288  */
289 struct _Ecore_Win32_Event_Window_Destroy
290 {
291    Ecore_Win32_Window *window; /**< The window that received the event */
292    unsigned long       timestamp; /**< The time when the event occurred */
293 };
294
295 /**
296  * @struct _Ecore_Win32_Event_Window_Hide
297  * @brief The structure type containing the event sent when the window is hidden.
298  */
299 struct _Ecore_Win32_Event_Window_Hide
300 {
301    Ecore_Win32_Window *window; /**< The window that received the event */
302    unsigned long       timestamp; /**< The time when the event occurred */
303 };
304
305 /**
306  * @struct _Ecore_Win32_Event_Window_Show
307  * @brief The structure type containing the event sent when the window is shown.
308  */
309 struct _Ecore_Win32_Event_Window_Show
310 {
311    Ecore_Win32_Window *window; /**< The window that received the event */
312    unsigned long       timestamp; /**< The time when the event occurred */
313 };
314
315 /**
316  * @struct _Ecore_Win32_Event_Window_Configure
317  * @brief The structure type containing the event sent when the window is configured.
318  */
319 struct _Ecore_Win32_Event_Window_Configure
320 {
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 */
328 };
329
330 /**
331  * @struct _Ecore_Win32_Event_Window_Resize
332  * @brief The structure type containing the event sent when the window is resized.
333  */
334 struct _Ecore_Win32_Event_Window_Resize
335 {
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 */
340 };
341
342 /**
343  * @struct _Ecore_Win32_Event_Window_Delete_Request
344  * @brief The structure type containing the event sent when the window is deleted.
345  */
346 struct _Ecore_Win32_Event_Window_Delete_Request
347 {
348    Ecore_Win32_Window *window; /**< The window that received the event */
349    unsigned long       timestamp; /**< The time when the event occurred */
350 };
351
352 /**
353  * @typedef Ecore_Win32_Dnd_DropTarget_Callback
354  * @brief The integer callback type for Drop operations. See ecore_win32_dnd_register_drop_target().
355  */
356 typedef int (*Ecore_Win32_Dnd_DropTarget_Callback)(void *window, int event, int pt_x, int pt_y, void *data, int size);
357
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 */
370
371
372 /* Core */
373
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);
380
381 /* Window */
382
383 EAPI Ecore_Win32_Window *ecore_win32_window_new(Ecore_Win32_Window *parent,
384                                                 int                 x,
385                                                 int                 y,
386                                                 int                 width,
387                                                 int                 height);
388 EAPI Ecore_Win32_Window *ecore_win32_window_override_new(Ecore_Win32_Window *parent,
389                                                          int                 x,
390                                                          int                 y,
391                                                          int                 width,
392                                                          int                 height);
393
394 EAPI void ecore_win32_window_free(Ecore_Win32_Window *window);
395
396 EAPI void *ecore_win32_window_hwnd_get(Ecore_Win32_Window *window);
397
398 EAPI void ecore_win32_window_move(Ecore_Win32_Window *window,
399                                   int                 x,
400                                   int                 y);
401
402 EAPI void ecore_win32_window_resize(Ecore_Win32_Window *window,
403                                     int                 width,
404                                     int                 height);
405
406 EAPI void ecore_win32_window_move_resize(Ecore_Win32_Window *window,
407                                          int                 x,
408                                          int                 y,
409                                          int                 width,
410                                          int                 height);
411
412 EAPI void ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
413                                           int                *x,
414                                           int                *y,
415                                           int                *width,
416                                           int                *height);
417
418 EAPI void ecore_win32_window_size_get(Ecore_Win32_Window *window,
419                                       int                *width,
420                                       int                *height);
421
422 EAPI void ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
423                                           unsigned int        min_width,
424                                           unsigned int        min_height);
425
426 EAPI void ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
427                                           unsigned int       *min_width,
428                                           unsigned int       *min_height);
429
430 EAPI void ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
431                                           unsigned int        max_width,
432                                           unsigned int        max_height);
433
434 EAPI void ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
435                                           unsigned int       *max_width,
436                                           unsigned int       *max_height);
437
438 EAPI void ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
439                                            unsigned int        base_width,
440                                            unsigned int        base_height);
441
442 EAPI void ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
443                                            unsigned int       *base_width,
444                                            unsigned int       *base_height);
445
446 EAPI void ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
447                                            unsigned int        step_width,
448                                            unsigned int        step_height);
449
450 EAPI void ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
451                                            unsigned int       *step_width,
452                                            unsigned int       *step_height);
453
454 EAPI void ecore_win32_window_show(Ecore_Win32_Window *window);
455
456 EAPI void ecore_win32_window_hide(Ecore_Win32_Window *window);
457
458 EAPI void ecore_win32_window_raise(Ecore_Win32_Window *window);
459
460 EAPI void ecore_win32_window_lower(Ecore_Win32_Window *window);
461
462 EAPI void ecore_win32_window_title_set(Ecore_Win32_Window *window,
463                                        const char         *title);
464
465 EAPI void ecore_win32_window_focus(Ecore_Win32_Window *window);
466
467 EAPI void *ecore_win32_window_focus_get(void);
468
469 EAPI void ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
470                                            Eina_Bool           on);
471
472 EAPI void ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
473                                             Eina_Bool           on);
474
475 EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
476                                             Eina_Bool           on);
477
478 EAPI void ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
479                                         Ecore_Win32_Cursor *cursor);
480
481 EAPI void ecore_win32_window_state_set(Ecore_Win32_Window       *window,
482                                        Ecore_Win32_Window_State *state,
483                                        unsigned int              num);
484
485 EAPI void ecore_win32_window_state_request_send(Ecore_Win32_Window      *window,
486                                                 Ecore_Win32_Window_State state,
487                                                 unsigned int             set);
488
489 EAPI void ecore_win32_window_type_set(Ecore_Win32_Window      *window,
490                                       Ecore_Win32_Window_Type  type);
491
492 /* Cursor */
493
494 EAPI Ecore_Win32_Cursor *ecore_win32_cursor_new(const void *pixels_and,
495                                                 const void *pixels_xor,
496                                                 int         width,
497                                                 int         height,
498                                                 int         hot_x,
499                                                 int         hot_y);
500
501 EAPI void                ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor);
502
503 EAPI Ecore_Win32_Cursor *ecore_win32_cursor_shaped_new(Ecore_Win32_Cursor_Shape shape);
504
505 EAPI void                ecore_win32_cursor_size_get(int *width, int *height);
506
507
508
509 /* Drag and drop */
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,
513                                      int         size);
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);
517
518 /**
519  * @}
520  */
521
522
523 #ifdef __cplusplus
524 }
525 #endif
526
527
528 #endif /* __ECORE_WIN32_H__ */