ecore_cocoa: introduce Ecore_Cocoa_Object
authorJean Guyomarc'h <jean.guyomarch@gmail.com>
Tue, 5 Jan 2016 23:03:57 +0000 (00:03 +0100)
committerCedric BAIL <cedric@osg.samsung.com>
Wed, 2 Mar 2016 21:56:08 +0000 (13:56 -0800)
This type is used as a bridge between objective-c objects (which are
ALWAYS pointed to) and the C interface.
Ecore_Cocoa_Object* is a less ugly substitute for void*.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/ecore_cocoa/Ecore_Cocoa.h
src/lib/ecore_cocoa/ecore_cocoa_window.m

index 5e3ab87..a794495 100644 (file)
@@ -61,6 +61,12 @@ typedef struct _Ecore_Cocoa_Screen Ecore_Cocoa_Screen;
 typedef void * Ecore_Cocoa_Window_Id;
 
 /**
+ * @typedef Ecore_Cocoa_Object
+ * Opaque handler to refer to an objective-c object (aka id)
+ */
+typedef void Ecore_Cocoa_Object;
+
+/**
  * @typedef Ecore_Cocoa_Event_Video_Resize
  * Type of event thrown when a window is resized
  */
@@ -252,7 +258,7 @@ EAPI void ecore_cocoa_window_borderless_set(Ecore_Cocoa_Window *window,
                                             Eina_Bool           on);
 
 EAPI void ecore_cocoa_window_view_set(Ecore_Cocoa_Window *window,
-                                      void *view);
+                                      Ecore_Cocoa_Object *view);
 
 EAPI int ecore_cocoa_titlebar_height_get(void);
 
index 38c167c..e50f7d1 100644 (file)
@@ -568,7 +568,7 @@ ecore_cocoa_window_borderless_set(Ecore_Cocoa_Window *window,
 
 EAPI void
 ecore_cocoa_window_view_set(Ecore_Cocoa_Window *window,
-                            void *view)
+                            Ecore_Cocoa_Object *view)
 {
    EINA_SAFETY_ON_NULL_RETURN(window);
    EINA_SAFETY_ON_NULL_RETURN(view);