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