090dff53d8eb3704d5d38745a6a746993df610f7
[profile/ivi/ecore.git] / src / lib / ecore_win32 / Ecore_Win32.h
1 #ifndef __ECORE_WIN32_H__
2 #define __ECORE_WIN32_H__
3
4
5 #ifdef EAPI
6 # undef EAPI
7 #endif
8
9 #ifdef _WIN32
10 # ifdef EFL_ECORE_WIN32_BUILD
11 #  ifdef DLL_EXPORT
12 #   define EAPI __declspec(dllexport)
13 #  else
14 #   define EAPI
15 #  endif /* ! DLL_EXPORT */
16 # else
17 #  define EAPI __declspec(dllimport)
18 # endif /* ! EFL_ECORE_WIN32_BUILD */
19 #else
20 # ifdef __GNUC__
21 #  if __GNUC__ >= 4
22 #   define EAPI __attribute__ ((visibility("default")))
23 #  else
24 #   define EAPI
25 #  endif
26 # else
27 #  define EAPI
28 # endif
29 #endif /* ! _WIN32 */
30
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36
37 typedef struct _Ecore_Win32_Window Ecore_Win32_Window;
38 typedef void Ecore_Win32_Cursor;
39
40 /* Window state */
41
42 typedef enum
43 {
44    /* The window is iconified. */
45    ECORE_WIN32_WINDOW_STATE_ICONIFIED,
46    /* The window is a modal dialog box. */
47    ECORE_WIN32_WINDOW_STATE_MODAL,
48    /* The window manager should keep the window's position fixed
49     * even if the virtual desktop scrolls. */
50    ECORE_WIN32_WINDOW_STATE_STICKY,
51    /* The window has the maximum vertical size. */
52    ECORE_WIN32_WINDOW_STATE_MAXIMIZED_VERT,
53    /* The window has the maximum horizontal size. */
54    ECORE_WIN32_WINDOW_STATE_MAXIMIZED_HORZ,
55    /* The window has the maximum horizontal and vertical size. */
56    ECORE_WIN32_WINDOW_STATE_MAXIMIZED,
57    /* The window is shaded. */
58    ECORE_WIN32_WINDOW_STATE_SHADED,
59    /* The window is invisible (i.e. minimized/iconified) */
60    ECORE_WIN32_WINDOW_STATE_HIDDEN,
61    /* The window should fill the entire screen and have no
62     * window border/decorations */
63    ECORE_WIN32_WINDOW_STATE_FULLSCREEN,
64    /* The following are not documented because they are not
65     * intended for use in applications. */
66    ECORE_WIN32_WINDOW_STATE_ABOVE,
67    ECORE_WIN32_WINDOW_STATE_BELOW,
68    /* FIXME: Documentation */
69    ECORE_WIN32_WINDOW_STATE_DEMANDS_ATTENTION,
70    /* Unknown state */
71    ECORE_WIN32_WINDOW_STATE_UNKNOWN
72 } Ecore_Win32_Window_State;
73
74 /* Window type */
75
76 typedef enum
77 {
78    /* Desktop feature*/
79    ECORE_WIN32_WINDOW_TYPE_DESKTOP,
80    /* Dock window (should be on top of other windows */
81    ECORE_WIN32_WINDOW_TYPE_DOCK,
82    /* Toolbar window */
83    ECORE_WIN32_WINDOW_TYPE_TOOLBAR,
84    /* Menu window */
85    ECORE_WIN32_WINDOW_TYPE_MENU,
86    /* Small persistent utility window, such as a palette or toolbox */
87    ECORE_WIN32_WINDOW_TYPE_UTILITY,
88    /* Splash screen window displayed as an application is starting up */
89    ECORE_WIN32_WINDOW_TYPE_SPLASH,
90    /* Dialog window */
91    ECORE_WIN32_WINDOW_TYPE_DIALOG,
92    /* Normal top-level window */
93    ECORE_WIN32_WINDOW_TYPE_NORMAL,
94    /* Unknown type */
95    ECORE_WIN32_WINDOW_TYPE_UNKNOWN
96 } Ecore_Win32_Window_Type;
97
98 /*cursor shapes */
99
100 typedef 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 /* Events */
119
120 typedef struct _Ecore_Win32_Event_Mouse_In              Ecore_Win32_Event_Mouse_In;
121 typedef struct _Ecore_Win32_Event_Mouse_Out             Ecore_Win32_Event_Mouse_Out;
122 typedef struct _Ecore_Win32_Event_Window_Focus_In       Ecore_Win32_Event_Window_Focus_In;
123 typedef struct _Ecore_Win32_Event_Window_Focus_Out      Ecore_Win32_Event_Window_Focus_Out;
124 typedef struct _Ecore_Win32_Event_Window_Damage         Ecore_Win32_Event_Window_Damage;
125 typedef struct _Ecore_Win32_Event_Window_Create         Ecore_Win32_Event_Window_Create;
126 typedef struct _Ecore_Win32_Event_Window_Destroy        Ecore_Win32_Event_Window_Destroy;
127 typedef struct _Ecore_Win32_Event_Window_Hide           Ecore_Win32_Event_Window_Hide;
128 typedef struct _Ecore_Win32_Event_Window_Show           Ecore_Win32_Event_Window_Show;
129 typedef struct _Ecore_Win32_Event_Window_Configure      Ecore_Win32_Event_Window_Configure;
130 typedef struct _Ecore_Win32_Event_Window_Resize         Ecore_Win32_Event_Window_Resize;
131 typedef struct _Ecore_Win32_Event_Window_Delete_Request Ecore_Win32_Event_Window_Delete_Request;
132
133 struct _Ecore_Win32_Event_Mouse_In
134 {
135    Ecore_Win32_Window *window;
136    int                 x;
137    int                 y;
138    long                time;
139 };
140
141 struct _Ecore_Win32_Event_Mouse_Out
142 {
143    Ecore_Win32_Window *window;
144    int                 x;
145    int                 y;
146    long                time;
147 };
148
149 struct _Ecore_Win32_Event_Window_Focus_In
150 {
151    Ecore_Win32_Window *window;
152    long  long          time;
153 };
154
155 struct _Ecore_Win32_Event_Window_Focus_Out
156 {
157    Ecore_Win32_Window *window;
158    long                time;
159 };
160
161 struct _Ecore_Win32_Event_Window_Damage
162 {
163    Ecore_Win32_Window *window;
164    int                 x;
165    int                 y;
166    int                 width;
167    int                 height;
168    long                time;
169 };
170
171 struct _Ecore_Win32_Event_Window_Create
172 {
173    Ecore_Win32_Window *window;
174    long                time;
175 };
176
177 struct _Ecore_Win32_Event_Window_Destroy
178 {
179    Ecore_Win32_Window *window;
180    long                time;
181 };
182
183 struct _Ecore_Win32_Event_Window_Hide
184 {
185    Ecore_Win32_Window *window;
186    long                time;
187 };
188
189 struct _Ecore_Win32_Event_Window_Show
190 {
191    Ecore_Win32_Window *window;
192    long                time;
193 };
194
195 struct _Ecore_Win32_Event_Window_Configure
196 {
197    Ecore_Win32_Window *window;
198    Ecore_Win32_Window *abovewin;
199    int                 x;
200    int                 y;
201    int                 width;
202    int                 height;
203    long                time;
204 };
205
206 struct _Ecore_Win32_Event_Window_Resize
207 {
208    Ecore_Win32_Window *window;
209    int                 width;
210    int                 height;
211    long                time;
212 };
213
214 struct _Ecore_Win32_Event_Window_Delete_Request
215 {
216    Ecore_Win32_Window *window;
217    long                time;
218 };
219
220 #define ECORE_WIN32_DND_EVENT_DRAG_ENTER     1
221 #define ECORE_WIN32_DND_EVENT_DRAG_OVER      2
222 #define ECORE_WIN32_DND_EVENT_DRAG_LEAVE     3
223 #define ECORE_WIN32_DND_EVENT_DROP           4
224
225
226 typedef int (*Ecore_Win32_Dnd_DropTarget_Callback)(void *window, int event, int pt_x, int pt_y, void *data, int size);
227
228 EAPI extern int ECORE_WIN32_EVENT_MOUSE_IN;
229 EAPI extern int ECORE_WIN32_EVENT_MOUSE_OUT;
230 EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_IN;
231 EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT;
232 EAPI extern int ECORE_WIN32_EVENT_WINDOW_DAMAGE;
233 EAPI extern int ECORE_WIN32_EVENT_WINDOW_CREATE;
234 EAPI extern int ECORE_WIN32_EVENT_WINDOW_DESTROY;
235 EAPI extern int ECORE_WIN32_EVENT_WINDOW_HIDE;
236 EAPI extern int ECORE_WIN32_EVENT_WINDOW_SHOW;
237 EAPI extern int ECORE_WIN32_EVENT_WINDOW_CONFIGURE;
238 EAPI extern int ECORE_WIN32_EVENT_WINDOW_RESIZE;
239 EAPI extern int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST;
240
241
242 /* Core */
243
244 EAPI int    ecore_win32_init();
245 EAPI int    ecore_win32_shutdown();
246 EAPI int    ecore_win32_screen_depth_get();
247 EAPI long   ecore_win32_current_time_get(void);
248 EAPI void   ecore_win32_message_loop_begin (void);
249
250 /* Window */
251
252 EAPI Ecore_Win32_Window *ecore_win32_window_new(Ecore_Win32_Window *parent,
253                                                 int                 x,
254                                                 int                 y,
255                                                 int                 width,
256                                                 int                 height);
257 EAPI Ecore_Win32_Window *ecore_win32_window_override_new(Ecore_Win32_Window *parent,
258                                                          int                 x,
259                                                          int                 y,
260                                                          int                 width,
261                                                          int                 height);
262
263 EAPI void ecore_win32_window_free(Ecore_Win32_Window *window);
264
265 EAPI void *ecore_win32_window_hwnd_get(Ecore_Win32_Window *window);
266
267 EAPI void ecore_win32_window_move(Ecore_Win32_Window *window,
268                                   int                 x,
269                                   int                 y);
270
271 EAPI void ecore_win32_window_resize(Ecore_Win32_Window *window,
272                                     int                 width,
273                                     int                 height);
274
275 EAPI void ecore_win32_window_move_resize(Ecore_Win32_Window *window,
276                                          int                 x,
277                                          int                 y,
278                                          int                 width,
279                                          int                 height);
280
281 EAPI void ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
282                                           int                *x,
283                                           int                *y,
284                                           int                *width,
285                                           int                *height);
286
287 EAPI void ecore_win32_window_size_get(Ecore_Win32_Window *window,
288                                       int                *width,
289                                       int                *height);
290
291 EAPI void ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
292                                           unsigned int        min_width,
293                                           unsigned int        min_height);
294
295 EAPI void ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
296                                           unsigned int       *min_width,
297                                           unsigned int       *min_height);
298
299 EAPI void ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
300                                           unsigned int        max_width,
301                                           unsigned int        max_height);
302
303 EAPI void ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
304                                           unsigned int       *max_width,
305                                           unsigned int       *max_height);
306
307 EAPI void ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
308                                            unsigned int        base_width,
309                                            unsigned int        base_height);
310
311 EAPI void ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
312                                            unsigned int       *base_width,
313                                            unsigned int       *base_height);
314
315 EAPI void ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
316                                            unsigned int        step_width,
317                                            unsigned int        step_height);
318
319 EAPI void ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
320                                            unsigned int       *step_width,
321                                            unsigned int       *step_height);
322
323 EAPI void ecore_win32_window_show(Ecore_Win32_Window *window);
324
325 EAPI void ecore_win32_window_hide(Ecore_Win32_Window *window);
326
327 EAPI void ecore_win32_window_raise(Ecore_Win32_Window *window);
328
329 EAPI void ecore_win32_window_lower(Ecore_Win32_Window *window);
330
331 EAPI void ecore_win32_window_title_set(Ecore_Win32_Window *window,
332                                        const char         *title);
333
334 EAPI void ecore_win32_window_focus_set(Ecore_Win32_Window *window);
335
336 EAPI void ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
337                                            int                 on);
338
339 EAPI void ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
340                                             int                 on);
341
342 EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
343                                             int                 on);
344
345 EAPI void ecore_win32_window_shape_set(Ecore_Win32_Window *window,
346                                        unsigned short      width,
347                                        unsigned short      height,
348                                        unsigned char      *mask);
349
350 EAPI void ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
351                                         Ecore_Win32_Cursor *cursor);
352
353 EAPI void ecore_win32_window_state_set(Ecore_Win32_Window       *window,
354                                        Ecore_Win32_Window_State *state,
355                                        unsigned int              num);
356
357 EAPI void ecore_win32_window_state_request_send(Ecore_Win32_Window      *window,
358                                                 Ecore_Win32_Window_State state,
359                                                 unsigned int             set);
360
361 EAPI void ecore_win32_window_type_set(Ecore_Win32_Window      *window,
362                                       Ecore_Win32_Window_Type  type);
363
364 /* Cursor */
365
366 EAPI Ecore_Win32_Cursor *ecore_win32_cursor_new(const void *pixels_and,
367                                                 const void *pixels_xor,
368                                                 int         width,
369                                                 int         height,
370                                                 int         hot_x,
371                                                 int         hot_y);
372
373 EAPI void                ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor);
374
375 EAPI Ecore_Win32_Cursor *ecore_win32_cursor_shape_get(Ecore_Win32_Cursor_Shape shape);
376
377 EAPI int                 ecore_win32_cursor_size_get(void);
378
379
380
381 /* Drag and drop */
382 EAPI int ecore_win32_dnd_init();
383 EAPI int ecore_win32_dnd_shutdown();
384 EAPI int ecore_win32_dnd_begin(const char *data,
385                                int         size);
386 EAPI int ecore_win32_dnd_register_drop_target(Ecore_Win32_Window                 *window,
387                                               Ecore_Win32_Dnd_DropTarget_Callback callback);
388 EAPI void ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window);
389
390
391 #ifdef __cplusplus
392 }
393 #endif
394
395
396 #endif /* __ECORE_WIN32_H__ */