summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean.guyomarch@openwide.fr>2015-10-13 18:14:13 +0200
committerNicolas Aguirre <aguirre.nicolas@gmail.com>2015-11-10 08:32:49 +0100
commit358165b41f30187dc51664ae1a91c69d27118af6 (patch)
treeb3e37e546bb19be36e2df806d7995b5a1815038b
parenta439f71965db5eb8af558086d8f38a430709c94f (diff)
ecore_cocoa: start doxygen
-rw-r--r--src/lib/ecore_cocoa/Ecore_Cocoa.h145
1 files changed, 116 insertions, 29 deletions
diff --git a/src/lib/ecore_cocoa/Ecore_Cocoa.h b/src/lib/ecore_cocoa/Ecore_Cocoa.h
index caae2d0741..bd0e50246a 100644
--- a/src/lib/ecore_cocoa/Ecore_Cocoa.h
+++ b/src/lib/ecore_cocoa/Ecore_Cocoa.h
@@ -1,3 +1,10 @@
1/**
2 * @file Ecore_Cocoa.h
3 *
4 * @brief Ecore_Cocoa Wrapper Library to interact with the Cocoa
5 * envirnement (Mac OS X) from the E environment
6 *
7 */
1#ifndef __ECORE_COCOA_H__ 8#ifndef __ECORE_COCOA_H__
2#define __ECORE_COCOA_H__ 9#define __ECORE_COCOA_H__
3 10
@@ -32,24 +39,53 @@
32extern "C" { 39extern "C" {
33#endif 40#endif
34 41
42/**
43 * @typedef Ecore_Cocoa_Window
44 * Opaque handler to manipulate a Cocoa Window through Ecore
45 */
35typedef struct _Ecore_Cocoa_Window Ecore_Cocoa_Window; 46typedef struct _Ecore_Cocoa_Window Ecore_Cocoa_Window;
47
48/**
49 * @typedef Ecore_Cocoa_Screen
50 * Opaque handler to manipulate a Cocoa Screen through Ecore
51 */
36typedef struct _Ecore_Cocoa_Screen Ecore_Cocoa_Screen; 52typedef struct _Ecore_Cocoa_Screen Ecore_Cocoa_Screen;
37 53
54/**
55 * @typedef Ecore_Cocoa_Window_Id
56 * Opaque handler to reference the actual Cocoa window
57 */
58typedef void * Ecore_Cocoa_Window_Id;
59
60/**
61 * @typedef Ecore_Cocoa_Event_Video_Resize
62 * Type of event thrown when a window is resized
63 */
64typedef struct _Ecore_Cocoa_Event_Video_Resize Ecore_Cocoa_Event_Video_Resize;
65
66/** Event triggered when a window receives focus */
38EAPI extern int ECORE_COCOA_EVENT_GOT_FOCUS; 67EAPI extern int ECORE_COCOA_EVENT_GOT_FOCUS;
68
69/** Event triggered when a window loses focus */
39EAPI extern int ECORE_COCOA_EVENT_LOST_FOCUS; 70EAPI extern int ECORE_COCOA_EVENT_LOST_FOCUS;
71
72/** Event triggered when a window is resized */
40EAPI extern int ECORE_COCOA_EVENT_RESIZE; 73EAPI extern int ECORE_COCOA_EVENT_RESIZE;
74
41EAPI extern int ECORE_COCOA_EVENT_EXPOSE; 75EAPI extern int ECORE_COCOA_EVENT_EXPOSE;
42EAPI extern int ECORE_COCOA_EVENT_WINDOW_DESTROY; 76EAPI extern int ECORE_COCOA_EVENT_WINDOW_DESTROY;
43EAPI extern int ECORE_COCOA_EVENT_DATA_SOURCE_SEND; 77EAPI extern int ECORE_COCOA_EVENT_DATA_SOURCE_SEND;
44EAPI extern int ECORE_COCOA_EVENT_SELECTION_DATA_READY; 78EAPI extern int ECORE_COCOA_EVENT_SELECTION_DATA_READY;
45 79
46typedef void * Ecore_Cocoa_Window_Id; 80/**
47typedef struct _Ecore_Cocoa_Event_Video_Resize Ecore_Cocoa_Event_Video_Resize; 81 * @struct _Ecore_Cocoa_Event_Video_Resize
82 * Data available when a window is resized
83 */
48struct _Ecore_Cocoa_Event_Video_Resize 84struct _Ecore_Cocoa_Event_Video_Resize
49{ 85{
50 int w; 86 int w; /**< Current width of the window */
51 int h; 87 int h; /**< Current height of the window */
52 Ecore_Cocoa_Window_Id wid; 88 Ecore_Cocoa_Window_Id wid; /**< Handler of the Cocoa window */
53}; 89};
54 90
55typedef struct _Ecore_Cocoa_Event_Window Ecore_Cocoa_Event_Window; 91typedef struct _Ecore_Cocoa_Event_Window Ecore_Cocoa_Event_Window;
@@ -63,44 +99,109 @@ struct _Ecore_Cocoa_Screen
63 int dummy; 99 int dummy;
64}; 100};
65 101
102/**
103 * @typedef Ecore_Cocoa_Cnp_Type
104 * Type used to interact with the Cocoa pasteboard.
105 * It hold types that can apply to a context.
106 */
66typedef enum 107typedef enum
67{ 108{
68 ECORE_COCOA_CNP_TYPE_UNKNOWN = 0, 109 ECORE_COCOA_CNP_TYPE_UNKNOWN = 0, /**< Undefined type */
69 ECORE_COCOA_CNP_TYPE_STRING = (1 << 0), 110 ECORE_COCOA_CNP_TYPE_STRING = (1 << 0), /**< String type (pure text) */
70 ECORE_COCOA_CNP_TYPE_MARKUP = (1 << 1), 111 ECORE_COCOA_CNP_TYPE_MARKUP = (1 << 1), /**< Elementary markup */
71 ECORE_COCOA_CNP_TYPE_IMAGE = (1 << 2), 112 ECORE_COCOA_CNP_TYPE_IMAGE = (1 << 2), /**< Image (all formats) */
72 ECORE_COCOA_CNP_TYPE_HTML = (1 << 3) 113 ECORE_COCOA_CNP_TYPE_HTML = (1 << 3) /**< HTML */
73} Ecore_Cocoa_Cnp_Type; 114} Ecore_Cocoa_Cnp_Type;
74 115
75/* Core */
76 116
77EAPI int ecore_cocoa_init(void); 117/*============================================================================*
78EAPI int ecore_cocoa_shutdown(void); 118 * Core *
119 *============================================================================*/
120
121/**
122 * Inits the Ecore_Cocoa library
123 * @return How many times Ecore_Cocoa has been initted
124 */
125EAPI int ecore_cocoa_init(void);
126
127/**
128 * Shuts the Ecore_Cocoa library down
129 * @return How many times Ecore_Cocoa has been initted
130 */
131EAPI int ecore_cocoa_shutdown(void);
132
133// XXX Why is this public?
79EAPI Eina_Bool ecore_cocoa_feed_events(void *anEvent); 134EAPI Eina_Bool ecore_cocoa_feed_events(void *anEvent);
80 135
81/* Screen */
82 136
137/*============================================================================*
138 * Screen *
139 *============================================================================*/
140
141/**
142 * Retrieves the size of a Cocoa screen
143 * @param screen The screen which size must be retrieved
144 * @param [out] w The width of the screen
145 * @param [out] h The height of the screen
146 */
83EAPI void ecore_cocoa_screen_size_get(Ecore_Cocoa_Screen *screen, int *w, int *h); 147EAPI void ecore_cocoa_screen_size_get(Ecore_Cocoa_Screen *screen, int *w, int *h);
84 148
85/* Window */
86 149
150/*============================================================================*
151 * Window *
152 *============================================================================*/
153
154/**
155 * Creates a Cocoa window
156 * @param x The origin (X) where the window must be created
157 * @param y The origin (Y) where the window must be created
158 * @param width The width of the window
159 * @param height The height of the window
160 * @return A handler on the window. NULL on failure
161 */
87EAPI Ecore_Cocoa_Window *ecore_cocoa_window_new(int x, 162EAPI Ecore_Cocoa_Window *ecore_cocoa_window_new(int x,
88 int y, 163 int y,
89 int width, 164 int width,
90 int height); 165 int height);
91 166
167/**
168 * Releases a Cocoa window
169 * @param window The window to be released
170 */
92EAPI void ecore_cocoa_window_free(Ecore_Cocoa_Window *window); 171EAPI void ecore_cocoa_window_free(Ecore_Cocoa_Window *window);
93 172
94EAPI void *ecore_cocoa_window_hwnd_get(Ecore_Cocoa_Window *window); 173EAPI void *ecore_cocoa_window_hwnd_get(Ecore_Cocoa_Window *window);
95 174
175/**
176 * Moves a Cocoa window to a given point
177 * @param window The window to be moved
178 * @param x The new origin of the window (X)
179 * @param y The new origin of the window (Y)
180 */
96EAPI void ecore_cocoa_window_move(Ecore_Cocoa_Window *window, 181EAPI void ecore_cocoa_window_move(Ecore_Cocoa_Window *window,
97 int x, 182 int x,
98 int y); 183 int y);
99 184
185/**
186 * Resizes a Cocoa window to a given size
187 * @param window The window to be moved
188 * @param width The new width of the window
189 * @param height The new height of the window
190 */
100EAPI void ecore_cocoa_window_resize(Ecore_Cocoa_Window *window, 191EAPI void ecore_cocoa_window_resize(Ecore_Cocoa_Window *window,
101 int width, 192 int width,
102 int height); 193 int height);
103 194
195/**
196 * Moves and resizes a Cocoa window to a given point and size
197 * @param window The window to be moved
198 * @param x The new origin of the window (X)
199 * @param y The new origin of the window (Y)
200 * @param width The new width of the window
201 * @param height The new height of the window
202 * @see ecore_cocoa_window_resize()
203 * @see ecore_cocoa_window_move()
204 */
104EAPI void ecore_cocoa_window_move_resize(Ecore_Cocoa_Window *window, 205EAPI void ecore_cocoa_window_move_resize(Ecore_Cocoa_Window *window,
105 int x, 206 int x,
106 int y, 207 int y,
@@ -178,25 +279,11 @@ EAPI int ecore_cocoa_titlebar_height_get(void);
178EAPI Ecore_Cocoa_Window_Id ecore_cocoa_window_get_window_id(const Ecore_Cocoa_Window *window); 279EAPI Ecore_Cocoa_Window_Id ecore_cocoa_window_get_window_id(const Ecore_Cocoa_Window *window);
179 280
180 281
181
182/**
183 * @return false on error, true otherwise
184 *
185 * @ingroup Ecore_Cocoa_Cpn_Group
186 */
187EAPI Eina_Bool ecore_cocoa_selection_clipboard_set(const void *data, int size, Ecore_Cocoa_Cnp_Type type); 282EAPI Eina_Bool ecore_cocoa_selection_clipboard_set(const void *data, int size, Ecore_Cocoa_Cnp_Type type);
188 283
189/**
190 * @return false if type not found or on error, true otherwise
191 *
192 * @ingroup Ecore_Cocoa_Cnp_Group
193 */
194EAPI void *ecore_cocoa_selection_clipboard_get(int *size, Ecore_Cocoa_Cnp_Type type, 284EAPI void *ecore_cocoa_selection_clipboard_get(int *size, Ecore_Cocoa_Cnp_Type type,
195 Ecore_Cocoa_Cnp_Type *retrieved_types); 285 Ecore_Cocoa_Cnp_Type *retrieved_types);
196 286
197/**
198 * @ingroup Ecore_Cocoa_Cnp_Group
199 */
200EAPI void ecore_cocoa_selection_clipboard_clear(void); 287EAPI void ecore_cocoa_selection_clipboard_clear(void);
201 288
202EAPI void ecore_cocoa_window_cursor_set(Ecore_Cocoa_Window *win, Ecore_Cocoa_Cursor c); 289EAPI void ecore_cocoa_window_cursor_set(Ecore_Cocoa_Window *win, Ecore_Cocoa_Cursor c);