summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRomain Perier <romain.perier@openwide.fr>2015-01-15 16:45:32 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-02-05 16:38:07 +0100
commitff9eb2e8e7e33cf12688df5ce7221a32582f1f58 (patch)
tree1f4bc299f71d9264f29aa6087ea9a92c2e68805f
parentc6945c075ec108509a187d7ee1df735afa4bf0ff (diff)
ecore_cocoa: add new events type for multiple window support.
This commit adds a method in Ecore_Cocoa_Window to be able to retrieve an unique identifier for each window. It adds new events type and modify existing ones to pass these windows identifiers through the event call chain. Resize, GotFocus and LotFocus events are also updated to pass these identifiers to event handlers. Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/ecore_cocoa/Ecore_Cocoa.h10
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa_window.m8
2 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/ecore_cocoa/Ecore_Cocoa.h b/src/lib/ecore_cocoa/Ecore_Cocoa.h
index 4f76f39882..50796f15ad 100644
--- a/src/lib/ecore_cocoa/Ecore_Cocoa.h
+++ b/src/lib/ecore_cocoa/Ecore_Cocoa.h
@@ -39,11 +39,19 @@ EAPI extern int ECORE_COCOA_EVENT_LOST_FOCUS;
39EAPI extern int ECORE_COCOA_EVENT_RESIZE; 39EAPI extern int ECORE_COCOA_EVENT_RESIZE;
40EAPI extern int ECORE_COCOA_EVENT_EXPOSE; 40EAPI extern int ECORE_COCOA_EVENT_EXPOSE;
41 41
42typedef void * Ecore_Cocoa_Window_Id;
42typedef struct _Ecore_Cocoa_Event_Video_Resize Ecore_Cocoa_Event_Video_Resize; 43typedef struct _Ecore_Cocoa_Event_Video_Resize Ecore_Cocoa_Event_Video_Resize;
43struct _Ecore_Cocoa_Event_Video_Resize 44struct _Ecore_Cocoa_Event_Video_Resize
44{ 45{
45 int w; 46 int w;
46 int h; 47 int h;
48 Ecore_Cocoa_Window_Id wid;
49};
50
51typedef struct _Ecore_Cocoa_Event_Window Ecore_Cocoa_Event_Window;
52struct _Ecore_Cocoa_Event_Window
53{
54 Ecore_Cocoa_Window_Id wid;
47}; 55};
48 56
49struct _Ecore_Cocoa_Screen 57struct _Ecore_Cocoa_Screen
@@ -152,6 +160,8 @@ EAPI void ecore_cocoa_window_view_set(Ecore_Cocoa_Window *window,
152 160
153EAPI int ecore_cocoa_titlebar_height_get(void); 161EAPI int ecore_cocoa_titlebar_height_get(void);
154 162
163EAPI Ecore_Cocoa_Window_Id ecore_cocoa_window_get_window_id(Ecore_Cocoa_Window *window);
164
155 165
156#ifdef __cplusplus 166#ifdef __cplusplus
157} 167}
diff --git a/src/lib/ecore_cocoa/ecore_cocoa_window.m b/src/lib/ecore_cocoa/ecore_cocoa_window.m
index 9739220b60..8300fbba3a 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa_window.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa_window.m
@@ -65,6 +65,7 @@
65 event->w = size.width; 65 event->w = size.width;
66 event->h = size.height - 66 event->h = size.height -
67 (([self isFullScreen] == YES) ? 0 : ecore_cocoa_titlebar_height_get()); 67 (([self isFullScreen] == YES) ? 0 : ecore_cocoa_titlebar_height_get());
68 event->wid = [notif object];
68 ecore_event_add(ECORE_COCOA_EVENT_RESIZE, event, NULL, NULL); 69 ecore_event_add(ECORE_COCOA_EVENT_RESIZE, event, NULL, NULL);
69 ecore_main_loop_iterate(); 70 ecore_main_loop_iterate();
70} 71}
@@ -270,3 +271,10 @@ ecore_cocoa_window_view_set(Ecore_Cocoa_Window *window,
270 271
271 [area release]; 272 [area release];
272} 273}
274
275Ecore_Cocoa_Window_Id ecore_cocoa_window_get_window_id(Ecore_Cocoa_Window *window)
276{
277 if (!window)
278 return 0;
279 return window->window;
280}