6c9e4a0097c922e6fd1cb4ebd7f8bae2bd692c6a
[framework/uifw/ecore.git] / src / lib / ecore_win32 / Ecore_Win32.h
1 /*
2  * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
3  */
4
5 #ifndef __ECORE_WIN32_H__
6 #define __ECORE_WIN32_H__
7
8
9 #ifdef EAPI
10 # undef EAPI
11 #endif
12
13 #ifdef _WIN32
14 # ifdef EFL_ECORE_WIN32_BUILD
15 #  ifdef DLL_EXPORT
16 #   define EAPI __declspec(dllexport)
17 #  else
18 #   define EAPI
19 #  endif /* ! DLL_EXPORT */
20 # else
21 #  define EAPI __declspec(dllimport)
22 # endif /* ! EFL_ECORE_WIN32_BUILD */
23 #else
24 # ifdef __GNUC__
25 #  if __GNUC__ >= 4
26 #   define EAPI __attribute__ ((visibility("default")))
27 #  else
28 #   define EAPI
29 #  endif
30 # else
31 #  define EAPI
32 # endif
33 #endif /* ! _WIN32 */
34
35
36 typedef void Ecore_Win32_Window;
37 typedef void Ecore_Win32_Cursor;
38
39 /* Window state */
40
41 typedef enum
42 {
43    /* The window is iconified. */
44    ECORE_WIN32_WINDOW_STATE_ICONIFIED,
45    /* The window is a modal dialog box. */
46    ECORE_WIN32_WINDOW_STATE_MODAL,
47    /* The window manager should keep the window's position fixed
48     * even if the virtual desktop scrolls. */
49    ECORE_WIN32_WINDOW_STATE_STICKY,
50    /* The window has the maximum vertical size. */
51    ECORE_WIN32_WINDOW_STATE_MAXIMIZED_VERT,
52    /* The window has the maximum horizontal size. */
53    ECORE_WIN32_WINDOW_STATE_MAXIMIZED_HORZ,
54    /* The window has the maximum horizontal and vertical size. */
55    ECORE_WIN32_WINDOW_STATE_MAXIMIZED,
56    /* The window is shaded. */
57    ECORE_WIN32_WINDOW_STATE_SHADED,
58    /* The window is invisible (i.e. minimized/iconified) */
59    ECORE_WIN32_WINDOW_STATE_HIDDEN,
60    /* The window should fill the entire screen and have no
61     * window border/decorations */
62    ECORE_WIN32_WINDOW_STATE_FULLSCREEN,
63    /* The following are not documented because they are not
64     * intended for use in applications. */
65    ECORE_WIN32_WINDOW_STATE_ABOVE,
66    ECORE_WIN32_WINDOW_STATE_BELOW,
67    /* FIXME: Documentation */
68    ECORE_WIN32_WINDOW_STATE_DEMANDS_ATTENTION,
69    /* Unknown state */
70    ECORE_WIN32_WINDOW_STATE_UNKNOWN
71 } Ecore_Win32_Window_State;
72
73 /* Window type */
74
75 typedef enum
76 {
77    /* Desktop feature*/
78    ECORE_WIN32_WINDOW_TYPE_DESKTOP,
79    /* Dock window (should be on top of other windows */
80    ECORE_WIN32_WINDOW_TYPE_DOCK,
81    /* Toolbar window */
82    ECORE_WIN32_WINDOW_TYPE_TOOLBAR,
83    /* Menu window */
84    ECORE_WIN32_WINDOW_TYPE_MENU,
85    /* Small persistent utility window, such as a palette or toolbox */
86    ECORE_WIN32_WINDOW_TYPE_UTILITY,
87    /* Splash screen window displayed as an application is starting up */
88    ECORE_WIN32_WINDOW_TYPE_SPLASH,
89    /* Dialog window */
90    ECORE_WIN32_WINDOW_TYPE_DIALOG,
91    /* Normal top-level window */
92    ECORE_WIN32_WINDOW_TYPE_NORMAL,
93    /* Unknown type */
94    ECORE_WIN32_WINDOW_TYPE_UNKNOWN
95 } Ecore_Win32_Window_Type;
96
97 /*cursor shapes */
98
99 typedef enum
100 {
101    ECORE_WIN32_CURSOR_SHAPE_APP_STARTING, /* Standard arrow and small hourglass */
102    ECORE_WIN32_CURSOR_SHAPE_ARROW,        /* Standard arrow */
103    ECORE_WIN32_CURSOR_SHAPE_CROSS,        /* Crosshair */
104    ECORE_WIN32_CURSOR_SHAPE_HAND,         /* Hand */
105    ECORE_WIN32_CURSOR_SHAPE_HELP,         /* Arrow and question mark */
106    ECORE_WIN32_CURSOR_SHAPE_I_BEAM,       /* I-beam */
107    ECORE_WIN32_CURSOR_SHAPE_NO,           /* Slashed circle */
108    ECORE_WIN32_CURSOR_SHAPE_SIZE_ALL,     /* Four-pointed arrow pointing north, south, east, and west */
109    ECORE_WIN32_CURSOR_SHAPE_SIZE_NESW,    /* Double-pointed arrow pointing northeast and southwest */
110    ECORE_WIN32_CURSOR_SHAPE_SIZE_NS,      /* Double-pointed arrow pointing north and south */
111    ECORE_WIN32_CURSOR_SHAPE_SIZE_NWSE,    /* Double-pointed arrow pointing northwest and southeast */
112    ECORE_WIN32_CURSOR_SHAPE_SIZE_WE,      /* Double-pointed arrow pointing west and east */
113    ECORE_WIN32_CURSOR_SHAPE_UP_ARROW,     /* Vertical arrow */
114    ECORE_WIN32_CURSOR_SHAPE_WAIT          /* Hourglass */
115 } Ecore_Win32_Cursor_Shape;
116
117 /* Events */
118
119 typedef struct _Ecore_Win32_Event_Key_Down              Ecore_Win32_Event_Key_Down;
120 typedef struct _Ecore_Win32_Event_Key_Up                Ecore_Win32_Event_Key_Up;
121 typedef struct _Ecore_Win32_Event_Mouse_Button_Down     Ecore_Win32_Event_Mouse_Button_Down;
122 typedef struct _Ecore_Win32_Event_Mouse_Button_Up       Ecore_Win32_Event_Mouse_Button_Up;
123 typedef struct _Ecore_Win32_Event_Mouse_Move            Ecore_Win32_Event_Mouse_Move;
124 typedef struct _Ecore_Win32_Event_Mouse_In              Ecore_Win32_Event_Mouse_In;
125 typedef struct _Ecore_Win32_Event_Mouse_Out             Ecore_Win32_Event_Mouse_Out;
126 typedef struct _Ecore_Win32_Event_Mouse_Wheel           Ecore_Win32_Event_Mouse_Wheel;
127 typedef struct _Ecore_Win32_Event_Window_Focus_In       Ecore_Win32_Event_Window_Focus_In;
128 typedef struct _Ecore_Win32_Event_Window_Focus_Out      Ecore_Win32_Event_Window_Focus_Out;
129 typedef struct _Ecore_Win32_Event_Window_Damage         Ecore_Win32_Event_Window_Damage;
130 typedef struct _Ecore_Win32_Event_Window_Create         Ecore_Win32_Event_Window_Create;
131 typedef struct _Ecore_Win32_Event_Window_Destroy        Ecore_Win32_Event_Window_Destroy;
132 typedef struct _Ecore_Win32_Event_Window_Hide           Ecore_Win32_Event_Window_Hide;
133 typedef struct _Ecore_Win32_Event_Window_Show           Ecore_Win32_Event_Window_Show;
134 typedef struct _Ecore_Win32_Event_Window_Configure      Ecore_Win32_Event_Window_Configure;
135 typedef struct _Ecore_Win32_Event_Window_Resize         Ecore_Win32_Event_Window_Resize;
136 typedef struct _Ecore_Win32_Event_Window_Delete_Request Ecore_Win32_Event_Window_Delete_Request;
137
138 struct _Ecore_Win32_Event_Key_Down
139 {
140    Ecore_Win32_Window *window;
141    char               *keyname;
142    char               *keysymbol;
143    char               *keycompose;
144    double              time;
145 };
146
147 struct _Ecore_Win32_Event_Key_Up
148 {
149    Ecore_Win32_Window *window;
150    char               *keyname;
151    char               *keysymbol;
152    char               *keycompose;
153    double              time;
154 };
155
156 struct _Ecore_Win32_Event_Mouse_Button_Down
157 {
158    Ecore_Win32_Window *window;
159    int                 button;
160    int                 x;
161    int                 y;
162    double              time;
163    unsigned int        double_click : 1;
164    unsigned int        triple_click : 1;
165 };
166
167 struct _Ecore_Win32_Event_Mouse_Button_Up
168 {
169    Ecore_Win32_Window *window;
170    int                 button;
171    int                 x;
172    int                 y;
173    double              time;
174    unsigned int        double_click : 1;
175    unsigned int        triple_click : 1;
176 };
177
178 struct _Ecore_Win32_Event_Mouse_Move
179 {
180    Ecore_Win32_Window *window;
181    int                 x;
182    int                 y;
183    double              time;
184 };
185
186 struct _Ecore_Win32_Event_Mouse_In
187 {
188    Ecore_Win32_Window *window;
189    int                 x;
190    int                 y;
191    double              time;
192 };
193
194 struct _Ecore_Win32_Event_Mouse_Out
195 {
196    Ecore_Win32_Window *window;
197    int                 x;
198    int                 y;
199    double              time;
200 };
201
202 struct _Ecore_Win32_Event_Mouse_Wheel
203 {
204    Ecore_Win32_Window *window;
205    int                 direction; /* 0 = default up/down wheel FIXME: more wheel types */
206    int                 z; /* ...,-2,-1 = down, 1,2,... = up */
207    int                 modifiers;
208    int                 x;
209    int                 y;
210    double              time;
211 };
212
213 struct _Ecore_Win32_Event_Window_Focus_In
214 {
215    Ecore_Win32_Window *window;
216    double              time;
217 };
218
219 struct _Ecore_Win32_Event_Window_Focus_Out
220 {
221    Ecore_Win32_Window *window;
222    double              time;
223 };
224
225 struct _Ecore_Win32_Event_Window_Damage
226 {
227    Ecore_Win32_Window *window;
228    int                 x;
229    int                 y;
230    int                 width;
231    int                 height;
232    double              time;
233 };
234
235 struct _Ecore_Win32_Event_Window_Create
236 {
237    Ecore_Win32_Window *window;
238    double              time;
239 };
240
241 struct _Ecore_Win32_Event_Window_Destroy
242 {
243    Ecore_Win32_Window *window;
244    double              time;
245 };
246
247 struct _Ecore_Win32_Event_Window_Hide
248 {
249    Ecore_Win32_Window *window;
250    double              time;
251 };
252
253 struct _Ecore_Win32_Event_Window_Show
254 {
255    Ecore_Win32_Window *window;
256    double              time;
257 };
258
259 struct _Ecore_Win32_Event_Window_Configure
260 {
261    Ecore_Win32_Window *window;
262    Ecore_Win32_Window *abovewin;
263    int                 x;
264    int                 y;
265    int                 width;
266    int                 height;
267    double              time;
268 };
269
270 struct _Ecore_Win32_Event_Window_Resize
271 {
272    Ecore_Win32_Window *window;
273    int                 width;
274    int                 height;
275    double              time;
276 };
277
278 struct _Ecore_Win32_Event_Window_Delete_Request
279 {
280    Ecore_Win32_Window *window;
281    double              time;
282 };
283
284 EAPI extern int ECORE_WIN32_EVENT_KEY_DOWN;
285 EAPI extern int ECORE_WIN32_EVENT_KEY_UP;
286 EAPI extern int ECORE_WIN32_EVENT_MOUSE_BUTTON_DOWN;
287 EAPI extern int ECORE_WIN32_EVENT_MOUSE_BUTTON_UP;
288 EAPI extern int ECORE_WIN32_EVENT_MOUSE_MOVE;
289 EAPI extern int ECORE_WIN32_EVENT_MOUSE_IN;
290 EAPI extern int ECORE_WIN32_EVENT_MOUSE_OUT;
291 EAPI extern int ECORE_WIN32_EVENT_MOUSE_WHEEL;
292 EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_IN;
293 EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT;
294 EAPI extern int ECORE_WIN32_EVENT_WINDOW_DAMAGE;
295 EAPI extern int ECORE_WIN32_EVENT_WINDOW_CREATE;
296 EAPI extern int ECORE_WIN32_EVENT_WINDOW_DESTROY;
297 EAPI extern int ECORE_WIN32_EVENT_WINDOW_HIDE;
298 EAPI extern int ECORE_WIN32_EVENT_WINDOW_SHOW;
299 EAPI extern int ECORE_WIN32_EVENT_WINDOW_CONFIGURE;
300 EAPI extern int ECORE_WIN32_EVENT_WINDOW_RESIZE;
301 EAPI extern int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST;
302
303
304 /* Core */
305
306 EAPI int    ecore_win32_init();
307 EAPI int    ecore_win32_shutdown();
308 EAPI int    ecore_win32_screen_depth_get();
309 EAPI double ecore_win32_current_time_get(void);
310 EAPI void   ecore_win32_message_loop_begin (void);
311
312 /* Window */
313
314 EAPI Ecore_Win32_Window *ecore_win32_window_new(Ecore_Win32_Window *parent,
315                                                 int                 x,
316                                                 int                 y,
317                                                 int                 width,
318                                                 int                 height);
319 EAPI Ecore_Win32_Window *ecore_win32_window_override_new(Ecore_Win32_Window *parent,
320                                                          int                 x,
321                                                          int                 y,
322                                                          int                 width,
323                                                          int                 height);
324
325 EAPI void ecore_win32_window_del(Ecore_Win32_Window *window);
326
327 EAPI void *ecore_win32_window_hwnd_get(Ecore_Win32_Window *window);
328
329 EAPI void ecore_win32_window_move(Ecore_Win32_Window *window,
330                                   int                 x,
331                                   int                 y);
332
333 EAPI void ecore_win32_window_resize(Ecore_Win32_Window *window,
334                                     int                 width,
335                                     int                 height);
336
337 EAPI void ecore_win32_window_move_resize(Ecore_Win32_Window *window,
338                                          int                 x,
339                                          int                 y,
340                                          int                 width,
341                                          int                 height);
342
343 EAPI void ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
344                                           int                *x,
345                                           int                *y,
346                                           int                *width,
347                                           int                *height);
348
349 EAPI void ecore_win32_window_size_get(Ecore_Win32_Window *window,
350                                       int                *width,
351                                       int                *height);
352
353 EAPI void ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
354                                           unsigned int        min_width,
355                                           unsigned int        min_height);
356
357 EAPI void ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
358                                           unsigned int       *min_width,
359                                           unsigned int       *min_height);
360
361 EAPI void ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
362                                           unsigned int        max_width,
363                                           unsigned int        max_height);
364
365 EAPI void ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
366                                           unsigned int       *max_width,
367                                           unsigned int       *max_height);
368
369 EAPI void ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
370                                            unsigned int        base_width,
371                                            unsigned int        base_height);
372
373 EAPI void ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
374                                            unsigned int       *base_width,
375                                            unsigned int       *base_height);
376
377 EAPI void ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
378                                            unsigned int        step_width,
379                                            unsigned int        step_height);
380
381 EAPI void ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
382                                            unsigned int       *step_width,
383                                            unsigned int       *step_height);
384
385 EAPI void ecore_win32_window_show(Ecore_Win32_Window *window);
386
387 EAPI void ecore_win32_window_hide(Ecore_Win32_Window *window);
388
389 EAPI void ecore_win32_window_raise(Ecore_Win32_Window *window);
390
391 EAPI void ecore_win32_window_lower(Ecore_Win32_Window *window);
392
393 EAPI void ecore_win32_window_title_set(Ecore_Win32_Window *window,
394                                        const char         *title);
395
396 EAPI void ecore_win32_window_focus_set(Ecore_Win32_Window *window);
397
398 EAPI void ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
399                                            int                 on);
400
401 EAPI void ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
402                                             int                 on);
403
404 EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
405                                             int                 on);
406
407 EAPI void ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
408                                         Ecore_Win32_Cursor *cursor);
409
410 EAPI void ecore_win32_window_state_set(Ecore_Win32_Window       *window,
411                                        Ecore_Win32_Window_State *state,
412                                        unsigned int              num);
413
414 EAPI void ecore_win32_window_state_request_send(Ecore_Win32_Window      *window,
415                                                 Ecore_Win32_Window_State state,
416                                                 unsigned int             set);
417
418 EAPI void ecore_win32_window_type_set(Ecore_Win32_Window      *window,
419                                       Ecore_Win32_Window_Type  type);
420
421 /* Cursor */
422
423 EAPI Ecore_Win32_Cursor *ecore_win32_cursor_new(const void *pixels_and,
424                                                 const void *pixels_xor,
425                                                 int         width,
426                                                 int         height,
427                                                 int         hot_x,
428                                                 int         hot_y);
429
430 EAPI void                ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor);
431
432 EAPI Ecore_Win32_Cursor *ecore_win32_cursor_shape_get(Ecore_Win32_Cursor_Shape shape);
433
434 EAPI int                 ecore_win32_cursor_size_get(void);
435
436
437 #endif /* __ECORE_WIN32_H__ */