diff options
author | Jean Guyomarc'h <jean.guyomarch@gmail.com> | 2016-01-06 21:38:10 +0100 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2016-03-02 13:56:16 -0800 |
commit | 84bbe500c5441e52b78453d469a183ea15e230db (patch) | |
tree | 77e74d15e7dd15b30b323971c19abfc9d0a7b1ed /src | |
parent | 71199709db61fb63c2a6766f2cde2b2108fa75a7 (diff) |
ecore_cocoa: replace Ecore_Cocoa_Window_Id by Ecore_Cocoa_Object
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/ecore_cocoa/Ecore_Cocoa.h | 12 | ||||
-rw-r--r-- | src/lib/ecore_cocoa/ecore_cocoa_window.m | 12 | ||||
-rw-r--r-- | src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c | 18 |
3 files changed, 18 insertions, 24 deletions
diff --git a/src/lib/ecore_cocoa/Ecore_Cocoa.h b/src/lib/ecore_cocoa/Ecore_Cocoa.h index 8d0e1bb8b2..f97bd20d27 100644 --- a/src/lib/ecore_cocoa/Ecore_Cocoa.h +++ b/src/lib/ecore_cocoa/Ecore_Cocoa.h | |||
@@ -55,12 +55,6 @@ typedef struct _Ecore_Cocoa_Window Ecore_Cocoa_Window; | |||
55 | typedef struct _Ecore_Cocoa_Screen Ecore_Cocoa_Screen; | 55 | typedef struct _Ecore_Cocoa_Screen Ecore_Cocoa_Screen; |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * @typedef Ecore_Cocoa_Window_Id | ||
59 | * Opaque handler to reference the actual Cocoa window | ||
60 | */ | ||
61 | typedef void * Ecore_Cocoa_Window_Id; | ||
62 | |||
63 | /** | ||
64 | * @typedef Ecore_Cocoa_Object | 58 | * @typedef Ecore_Cocoa_Object |
65 | * Opaque handler to refer to an objective-c object (aka id) | 59 | * Opaque handler to refer to an objective-c object (aka id) |
66 | */ | 60 | */ |
@@ -91,13 +85,13 @@ struct _Ecore_Cocoa_Event_Video_Resize | |||
91 | { | 85 | { |
92 | int w; /**< Current width of the window */ | 86 | int w; /**< Current width of the window */ |
93 | int h; /**< Current height of the window */ | 87 | int h; /**< Current height of the window */ |
94 | Ecore_Cocoa_Window_Id wid; /**< Handler of the Cocoa window */ | 88 | Ecore_Cocoa_Object *cocoa_window; /**< Handler of the Cocoa window */ |
95 | }; | 89 | }; |
96 | 90 | ||
97 | typedef struct _Ecore_Cocoa_Event_Window Ecore_Cocoa_Event_Window; | 91 | typedef struct _Ecore_Cocoa_Event_Window Ecore_Cocoa_Event_Window; |
98 | struct _Ecore_Cocoa_Event_Window | 92 | struct _Ecore_Cocoa_Event_Window |
99 | { | 93 | { |
100 | Ecore_Cocoa_Window_Id wid; | 94 | Ecore_Cocoa_Object *cocoa_window; |
101 | }; | 95 | }; |
102 | 96 | ||
103 | /** | 97 | /** |
@@ -262,7 +256,7 @@ EAPI void ecore_cocoa_window_view_set(Ecore_Cocoa_Window *window, | |||
262 | 256 | ||
263 | EAPI int ecore_cocoa_titlebar_height_get(void); | 257 | EAPI int ecore_cocoa_titlebar_height_get(void); |
264 | 258 | ||
265 | EAPI Ecore_Cocoa_Window_Id ecore_cocoa_window_get_window_id(const Ecore_Cocoa_Window *window); | 259 | EAPI Ecore_Cocoa_Object *ecore_cocoa_window_get(const Ecore_Cocoa_Window *window); |
266 | 260 | ||
267 | 261 | ||
268 | EAPI Eina_Bool ecore_cocoa_selection_clipboard_set(const void *data, int size, Ecore_Cocoa_Cnp_Type type); | 262 | EAPI Eina_Bool ecore_cocoa_selection_clipboard_set(const void *data, int size, Ecore_Cocoa_Cnp_Type type); |
diff --git a/src/lib/ecore_cocoa/ecore_cocoa_window.m b/src/lib/ecore_cocoa/ecore_cocoa_window.m index e50e9c334a..b1d7d6e59f 100644 --- a/src/lib/ecore_cocoa/ecore_cocoa_window.m +++ b/src/lib/ecore_cocoa/ecore_cocoa_window.m | |||
@@ -64,7 +64,7 @@ static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST]; | |||
64 | CRI("Failed to allocate Ecore_Cocoa_Event_Window"); | 64 | CRI("Failed to allocate Ecore_Cocoa_Event_Window"); |
65 | return; | 65 | return; |
66 | } | 66 | } |
67 | event->wid = [notification object]; | 67 | event->cocoa_window = [notification object]; |
68 | ecore_event_add(ECORE_COCOA_EVENT_WINDOW_DESTROY, event, NULL, NULL); | 68 | ecore_event_add(ECORE_COCOA_EVENT_WINDOW_DESTROY, event, NULL, NULL); |
69 | } | 69 | } |
70 | 70 | ||
@@ -82,7 +82,7 @@ static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST]; | |||
82 | event->w = size.width; | 82 | event->w = size.width; |
83 | event->h = size.height - | 83 | event->h = size.height - |
84 | (([self isFullScreen] == YES) ? 0 : ecore_cocoa_titlebar_height_get()); | 84 | (([self isFullScreen] == YES) ? 0 : ecore_cocoa_titlebar_height_get()); |
85 | event->wid = [notif object]; | 85 | event->cocoa_window = [notif object]; |
86 | ecore_event_add(ECORE_COCOA_EVENT_RESIZE, event, NULL, NULL); | 86 | ecore_event_add(ECORE_COCOA_EVENT_RESIZE, event, NULL, NULL); |
87 | 87 | ||
88 | /* | 88 | /* |
@@ -107,7 +107,7 @@ static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST]; | |||
107 | CRI("Failed to allocate Ecore_Cocoa_Event_Window"); | 107 | CRI("Failed to allocate Ecore_Cocoa_Event_Window"); |
108 | return; | 108 | return; |
109 | } | 109 | } |
110 | e->wid = [notification object]; | 110 | e->cocoa_window = [notification object]; |
111 | ecore_event_add(ECORE_COCOA_EVENT_GOT_FOCUS, e, NULL, NULL); | 111 | ecore_event_add(ECORE_COCOA_EVENT_GOT_FOCUS, e, NULL, NULL); |
112 | } | 112 | } |
113 | 113 | ||
@@ -131,7 +131,7 @@ static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST]; | |||
131 | CRI("Failed to allocate Ecore_Cocoa_Event_Window"); | 131 | CRI("Failed to allocate Ecore_Cocoa_Event_Window"); |
132 | return; | 132 | return; |
133 | } | 133 | } |
134 | e->wid = [notification object]; | 134 | e->cocoa_window = [notification object]; |
135 | ecore_event_add(ECORE_COCOA_EVENT_LOST_FOCUS, e, NULL, NULL); | 135 | ecore_event_add(ECORE_COCOA_EVENT_LOST_FOCUS, e, NULL, NULL); |
136 | } | 136 | } |
137 | 137 | ||
@@ -588,8 +588,8 @@ ecore_cocoa_window_view_set(Ecore_Cocoa_Window *window, | |||
588 | [area release]; | 588 | [area release]; |
589 | } | 589 | } |
590 | 590 | ||
591 | EAPI Ecore_Cocoa_Window_Id | 591 | EAPI Ecore_Cocoa_Object * |
592 | ecore_cocoa_window_get_window_id(const Ecore_Cocoa_Window *window) | 592 | ecore_cocoa_window_get(const Ecore_Cocoa_Window *window) |
593 | { | 593 | { |
594 | EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL); | 594 | EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL); |
595 | return window->window; | 595 | return window->window; |
diff --git a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c index 054a1e2337..b57a804848 100644 --- a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c +++ b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c | |||
@@ -162,7 +162,7 @@ _ecore_evas_cocoa_render(Ecore_Evas *ee) | |||
162 | 162 | ||
163 | 163 | ||
164 | static Ecore_Evas * | 164 | static Ecore_Evas * |
165 | _ecore_evas_cocoa_match(Ecore_Cocoa_Window_Id wid) | 165 | _ecore_evas_cocoa_match(Ecore_Cocoa_Object *cocoa_win) |
166 | { | 166 | { |
167 | Eina_List *it; | 167 | Eina_List *it; |
168 | Ecore_Evas *ee; | 168 | Ecore_Evas *ee; |
@@ -170,7 +170,7 @@ _ecore_evas_cocoa_match(Ecore_Cocoa_Window_Id wid) | |||
170 | DBG(""); | 170 | DBG(""); |
171 | EINA_LIST_FOREACH(ecore_evases, it, ee) | 171 | EINA_LIST_FOREACH(ecore_evases, it, ee) |
172 | { | 172 | { |
173 | if (ecore_cocoa_window_get_window_id((Ecore_Cocoa_Window *)ee->prop.window) == wid) | 173 | if (ecore_cocoa_window_get((Ecore_Cocoa_Window *)ee->prop.window) == cocoa_win) |
174 | return ee; | 174 | return ee; |
175 | } | 175 | } |
176 | return NULL; | 176 | return NULL; |
@@ -183,7 +183,7 @@ _ecore_evas_cocoa_event_got_focus(void *data EINA_UNUSED, int type EINA_UNUSED, | |||
183 | Ecore_Cocoa_Event_Window *e = event; | 183 | Ecore_Cocoa_Event_Window *e = event; |
184 | Ecore_Evas *ee; | 184 | Ecore_Evas *ee; |
185 | 185 | ||
186 | ee = _ecore_evas_cocoa_match(e->wid); | 186 | ee = _ecore_evas_cocoa_match(e->cocoa_window); |
187 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | 187 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; |
188 | 188 | ||
189 | ee->prop.focused = EINA_TRUE; | 189 | ee->prop.focused = EINA_TRUE; |
@@ -199,7 +199,7 @@ _ecore_evas_cocoa_event_lost_focus(void *data EINA_UNUSED, int type EINA_UNUSED, | |||
199 | Ecore_Cocoa_Event_Window *e = event; | 199 | Ecore_Cocoa_Event_Window *e = event; |
200 | Ecore_Evas *ee; | 200 | Ecore_Evas *ee; |
201 | 201 | ||
202 | ee = _ecore_evas_cocoa_match(e->wid); | 202 | ee = _ecore_evas_cocoa_match(e->cocoa_window); |
203 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | 203 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; |
204 | 204 | ||
205 | evas_focus_out(ee->evas); | 205 | evas_focus_out(ee->evas); |
@@ -241,10 +241,10 @@ _ecore_evas_cocoa_event_video_resize(void *data EINA_UNUSED, int type EINA_UNUSE | |||
241 | 241 | ||
242 | DBG(""); | 242 | DBG(""); |
243 | 243 | ||
244 | ee = _ecore_evas_cocoa_match(e->wid); | 244 | ee = _ecore_evas_cocoa_match(e->cocoa_window); |
245 | if (EINA_UNLIKELY(!ee)) | 245 | if (EINA_UNLIKELY(!ee)) |
246 | { | 246 | { |
247 | ERR("Unregistered Ecore_Evas for window Id %p", e->wid); | 247 | ERR("Unregistered Ecore_Evas for Cocoa window %p", e->cocoa_window); |
248 | return ECORE_CALLBACK_PASS_ON; | 248 | return ECORE_CALLBACK_PASS_ON; |
249 | } | 249 | } |
250 | 250 | ||
@@ -262,13 +262,13 @@ _ecore_evas_cocoa_event_window_destroy(void *data EINA_UNUSED, int type EINA_UNU | |||
262 | 262 | ||
263 | DBG(""); | 263 | DBG(""); |
264 | 264 | ||
265 | if (!e->wid) | 265 | if (!e->cocoa_window) |
266 | return ECORE_CALLBACK_PASS_ON; | 266 | return ECORE_CALLBACK_PASS_ON; |
267 | 267 | ||
268 | ee = _ecore_evas_cocoa_match(e->wid); | 268 | ee = _ecore_evas_cocoa_match(e->cocoa_window); |
269 | if (!ee) | 269 | if (!ee) |
270 | { | 270 | { |
271 | ERR("Unregistered Ecore_Evas for window Id %p", e->wid); | 271 | ERR("Unregistered Ecore_Evas for Cocoa window %p", e->cocoa_window); |
272 | return ECORE_CALLBACK_PASS_ON; | 272 | return ECORE_CALLBACK_PASS_ON; |
273 | } | 273 | } |
274 | 274 | ||