summaryrefslogtreecommitdiff
path: root/src/lib/ecore_cocoa
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean.guyomarch@gmail.com>2016-01-06 22:54:46 +0100
committerCedric BAIL <cedric@osg.samsung.com>2016-03-02 13:56:32 -0800
commite8c17ce341e55a10a74bd01e0ab2e11dc200da74 (patch)
tree5f3dc12f03349cd606fa43bedf4a728da9c1afc5 /src/lib/ecore_cocoa
parentdeb553d55e8b1964709ef8923f6bcdfbe848471f (diff)
ecore_cocoa: full documentation of Ecore_Cocoa.h
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/ecore_cocoa')
-rw-r--r--src/lib/ecore_cocoa/Ecore_Cocoa.h149
1 files changed, 142 insertions, 7 deletions
diff --git a/src/lib/ecore_cocoa/Ecore_Cocoa.h b/src/lib/ecore_cocoa/Ecore_Cocoa.h
index f479e3d3c6..b9a534a31e 100644
--- a/src/lib/ecore_cocoa/Ecore_Cocoa.h
+++ b/src/lib/ecore_cocoa/Ecore_Cocoa.h
@@ -107,19 +107,31 @@ struct _Ecore_Cocoa_Event_Window_Resize_Request
107 Ecore_Cocoa_Object *cocoa_window; /**< Handler of the Cocoa window */ 107 Ecore_Cocoa_Object *cocoa_window; /**< Handler of the Cocoa window */
108}; 108};
109 109
110/**
111 * @struct _Ecore_Cocoa_Event_Window_Focused
112 * Data available when a Cocoa window receives focus
113 */
110struct _Ecore_Cocoa_Event_Window_Focused 114struct _Ecore_Cocoa_Event_Window_Focused
111{ 115{
112 Ecore_Cocoa_Object *cocoa_window; 116 Ecore_Cocoa_Object *cocoa_window; /**< Handler of the Cocoa window */
113}; 117};
114 118
119/**
120 * @struct _Ecore_Cocoa_Event_Window_Unfocused
121 * Data available when a Cocoa window losrs focus
122 */
115struct _Ecore_Cocoa_Event_Window_Unfocused 123struct _Ecore_Cocoa_Event_Window_Unfocused
116{ 124{
117 Ecore_Cocoa_Object *cocoa_window; 125 Ecore_Cocoa_Object *cocoa_window; /**< Handler of the Cocoa window */
118}; 126};
119 127
128/**
129 * @struct _Ecore_Cocoa_Event_Window_Destroy
130 * Data available when a Cocoa window is destroyed
131 */
120struct _Ecore_Cocoa_Event_Window_Destroy 132struct _Ecore_Cocoa_Event_Window_Destroy
121{ 133{
122 Ecore_Cocoa_Object *cocoa_window; 134 Ecore_Cocoa_Object *cocoa_window; /**< Handler of the Cocoa window */
123}; 135};
124 136
125/** 137/**
@@ -191,7 +203,7 @@ EAPI Ecore_Cocoa_Window *ecore_cocoa_window_new(int x,
191EAPI void ecore_cocoa_window_free(Ecore_Cocoa_Window *window); 203EAPI void ecore_cocoa_window_free(Ecore_Cocoa_Window *window);
192 204
193/** 205/**
194 * Moves a Cocoa window to a given point 206 * Moves a Cocoa window at a given point
195 * @param window The window to be moved 207 * @param window The window to be moved
196 * @param x The new origin of the window (X) 208 * @param x The new origin of the window (X)
197 * @param y The new origin of the window (Y) 209 * @param y The new origin of the window (Y)
@@ -217,6 +229,7 @@ EAPI void ecore_cocoa_window_resize(Ecore_Cocoa_Window *window,
217 * @param y The new origin of the window (Y) 229 * @param y The new origin of the window (Y)
218 * @param w The new width of the window 230 * @param w The new width of the window
219 * @param h The new height of the window 231 * @param h The new height of the window
232 *
220 * @see ecore_cocoa_window_resize() 233 * @see ecore_cocoa_window_resize()
221 * @see ecore_cocoa_window_move() 234 * @see ecore_cocoa_window_move()
222 */ 235 */
@@ -226,28 +239,66 @@ EAPI void ecore_cocoa_window_move_resize(Ecore_Cocoa_Window *window,
226 int w, 239 int w,
227 int h); 240 int h);
228 241
242/**
243 * Gets the geometry of a Cocoa window
244 * @param window The window which geometry is queried
245 * @param x Pointer used to retrieve its origin in X
246 * @param y Pointer used to retrieve its origin in Y
247 * @param w Pointer used to retrieve its width
248 * @param h Pointer used to retrieve its height
249 */
229EAPI void ecore_cocoa_window_geometry_get(const Ecore_Cocoa_Window *window, 250EAPI void ecore_cocoa_window_geometry_get(const Ecore_Cocoa_Window *window,
230 int *x, 251 int *x,
231 int *y, 252 int *y,
232 int *w, 253 int *w,
233 int *h); 254 int *h);
234 255
256/**
257 * Gets the size of a Cocoa window
258 * @param window The window which size is queried
259 * @param w Pointer used to retrieve its width
260 * @param h Pointer used to retrieve its height
261 */
235EAPI void ecore_cocoa_window_size_get(const Ecore_Cocoa_Window *window, 262EAPI void ecore_cocoa_window_size_get(const Ecore_Cocoa_Window *window,
236 int *w, 263 int *w,
237 int *h); 264 int *h);
238 265
266/**
267 * Sets the minimum size of a Cocoa window
268 * @param window The window which minimum size is to be altered
269 * @param w The new minimum width of the window
270 * @param h The new minimum height of the window
271 */
239EAPI void ecore_cocoa_window_size_min_set(Ecore_Cocoa_Window *window, 272EAPI void ecore_cocoa_window_size_min_set(Ecore_Cocoa_Window *window,
240 int w, 273 int w,
241 int h); 274 int h);
242 275
276/**
277 * Gets the minimum size size of a Cocoa window
278 * @param window The window which minimum size is queried
279 * @param w Pointer used to retrieve its minimum width
280 * @param h Pointer used to retrieve its minimum height
281 */
243EAPI void ecore_cocoa_window_size_min_get(const Ecore_Cocoa_Window *window, 282EAPI void ecore_cocoa_window_size_min_get(const Ecore_Cocoa_Window *window,
244 int *w, 283 int *w,
245 int *h); 284 int *h);
246 285
286/**
287 * Sets the maximum size of a Cocoa window
288 * @param window The window which maximum size is to be altered
289 * @param w The new maximum width of the window
290 * @param h The new maximum height of the window
291 */
247EAPI void ecore_cocoa_window_size_max_set(Ecore_Cocoa_Window *window, 292EAPI void ecore_cocoa_window_size_max_set(Ecore_Cocoa_Window *window,
248 int w, 293 int w,
249 int h); 294 int h);
250 295
296/**
297 * Gets the maximum size size of a Cocoa window
298 * @param window The window which maximum size is queried
299 * @param w Pointer used to retrieve its maximum width
300 * @param h Pointer used to retrieve its maximum height
301 */
251EAPI void ecore_cocoa_window_size_max_get(const Ecore_Cocoa_Window *window, 302EAPI void ecore_cocoa_window_size_max_get(const Ecore_Cocoa_Window *window,
252 int *w, 303 int *w,
253 int *h); 304 int *h);
@@ -260,41 +311,125 @@ EAPI void ecore_cocoa_window_size_step_get(const Ecore_Cocoa_Window *window,
260 int *w, 311 int *w,
261 int *h); 312 int *h);
262 313
314/**
315 * Display a Cocoa window
316 * @param window The Cocoa window to be displayed
317 */
263EAPI void ecore_cocoa_window_show(Ecore_Cocoa_Window *window); 318EAPI void ecore_cocoa_window_show(Ecore_Cocoa_Window *window);
264 319
320/**
321 * Hide a Cocoa window
322 * @param window The Cocoa window to be hid
323 */
265EAPI void ecore_cocoa_window_hide(Ecore_Cocoa_Window *window); 324EAPI void ecore_cocoa_window_hide(Ecore_Cocoa_Window *window);
266 325
326/**
327 * Brings a Cocoa window to front
328 * @param window The Cocoa window to be raised
329 */
267EAPI void ecore_cocoa_window_raise(Ecore_Cocoa_Window *window); 330EAPI void ecore_cocoa_window_raise(Ecore_Cocoa_Window *window);
268 331
332/**
333 * Brings a Cocoa window back
334 * @param window The Cocoa window to be lowered
335 */
269EAPI void ecore_cocoa_window_lower(Ecore_Cocoa_Window *window); 336EAPI void ecore_cocoa_window_lower(Ecore_Cocoa_Window *window);
270 337
338/**
339 * Makes a Cocoa window the current key window by raising it
340 * @param window The Cocoa window to be activated
341 */
271EAPI void ecore_cocoa_window_activate(Ecore_Cocoa_Window *window); 342EAPI void ecore_cocoa_window_activate(Ecore_Cocoa_Window *window);
272 343
344/**
345 * Changes the title of a Cocoa window
346 * @param window The Cocoa window which title is to be changed
347 * @param title The new title of the Cocoa window
348 */
273EAPI void ecore_cocoa_window_title_set(Ecore_Cocoa_Window *window, 349EAPI void ecore_cocoa_window_title_set(Ecore_Cocoa_Window *window,
274 const char *title); 350 const char *title);
275 351
352/**
353 * Miniaturize or deminiaturize a Cocoa window
354 * @param window The Cocoa window which iconify status is to be changed
355 * @param on If #EINA_TRUE, will miniaturize the window. Will deminiaturize it if #EINA_FALSE
356 */
276EAPI void ecore_cocoa_window_iconified_set(Ecore_Cocoa_Window *window, 357EAPI void ecore_cocoa_window_iconified_set(Ecore_Cocoa_Window *window,
277 Eina_Bool on); 358 Eina_Bool on);
278 359
360/**
361 * Manage the borders of a Cocoa window
362 * @param window The Cocoa window which borders are to be changed
363 * @param on If #EINA_TRUE, will remove borders. Will restore them if #EINA_FALSE
364 */
279EAPI void ecore_cocoa_window_borderless_set(Ecore_Cocoa_Window *window, 365EAPI void ecore_cocoa_window_borderless_set(Ecore_Cocoa_Window *window,
280 Eina_Bool on); 366 Eina_Bool on);
281 367
368/**
369 * Set the content view of a Cocoa window
370 * @param window The Cocoa window which internal view is to be set
371 * @param view The NSView to be set as @c window content view
372 */
282EAPI void ecore_cocoa_window_view_set(Ecore_Cocoa_Window *window, 373EAPI void ecore_cocoa_window_view_set(Ecore_Cocoa_Window *window,
283 Ecore_Cocoa_Object *view); 374 Ecore_Cocoa_Object *view);
284 375
376/**
377 * Get the height of the title bar of Cocoa windows
378 * @return The height of the title bar of Cocoa windows
379 */
285EAPI int ecore_cocoa_titlebar_height_get(void); 380EAPI int ecore_cocoa_titlebar_height_get(void);
286 381
382/**
383 * Retrieves the actual NSWindow behind the Ecore_Cocoa wrapper
384 * @param window The Ecore_Cocoa wrapper which window is to be retrieved
385 * @return The Cocoa NSWindow manipulated by @c window
386 */
287EAPI Ecore_Cocoa_Object *ecore_cocoa_window_get(const Ecore_Cocoa_Window *window); 387EAPI Ecore_Cocoa_Object *ecore_cocoa_window_get(const Ecore_Cocoa_Window *window);
288 388
389/**
390 * Set the clipboard of Cocoa (NSPasteboard)
391 * @param data The contents to be set in the clipboard
392 * @param size The size in bytes of @c data
393 * @param type
394 * @return EINA_TRUE on success, EINA_FALSE on failure
395 */
396EAPI Eina_Bool ecore_cocoa_selection_clipboard_set(const void *data,
397 int size,
398 Ecore_Cocoa_Cnp_Type type);
289 399
290EAPI Eina_Bool ecore_cocoa_selection_clipboard_set(const void *data, int size, Ecore_Cocoa_Cnp_Type type); 400/**
291 401 * Get the contents of the Cocoa clipboard
292EAPI void *ecore_cocoa_selection_clipboard_get(int *size, Ecore_Cocoa_Cnp_Type type, 402 * @param size Pointer used to retrieve the size of the received contents
403 * @param type The type of object to retrieve from the clipboard
404 * @param retrieved_types The types of objects retrieved from the clipboard
405 * @return The data retrieved from the clipboard. NULL on failure
406 *
407 * If @c type was ECORE_COCOA_CNP_TYPE_STRING or ECORE_COCOA_CNP_TYPE_MARKUP,
408 * @c retrieved_types will contain ECORE_COCOA_CNP_TYPE_STRING and the data
409 * will be a C string (char*) that must be freed after use.
410 */
411EAPI void *ecore_cocoa_selection_clipboard_get(int *size,
412 Ecore_Cocoa_Cnp_Type type,
293 Ecore_Cocoa_Cnp_Type *retrieved_types); 413 Ecore_Cocoa_Cnp_Type *retrieved_types);
294 414
415/**
416 * Deletes the contents of the Cocoa clipboard
417 */
295EAPI void ecore_cocoa_selection_clipboard_clear(void); 418EAPI void ecore_cocoa_selection_clipboard_clear(void);
296 419
420/**
421 * Set the Cocoa cursor for a given Cocoa window
422 * @param win The Cocoa window on which the cursor is to be changed.
423 * @param c The cursor to be set
424 */
297EAPI void ecore_cocoa_window_cursor_set(Ecore_Cocoa_Window *win, Ecore_Cocoa_Cursor c); 425EAPI void ecore_cocoa_window_cursor_set(Ecore_Cocoa_Window *win, Ecore_Cocoa_Cursor c);
426
427/**
428 * Hide or show the Cocoa cursor for a given Cocoa window
429 * @param win The Cocoa window on which the cursor is to be hid
430 * @param show Shows the cursor if EINA_TRUE. Hides it if EINA_FALSE
431 *
432 */
298EAPI void ecore_cocoa_window_cursor_show(Ecore_Cocoa_Window *win, Eina_Bool show); 433EAPI void ecore_cocoa_window_cursor_show(Ecore_Cocoa_Window *win, Eina_Bool show);
299 434
300#ifdef __cplusplus 435#ifdef __cplusplus