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)
downloadefl-ff9eb2e8e7e33cf12688df5ce7221a32582f1f58.tar.gz
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;
EAPI extern int ECORE_COCOA_EVENT_RESIZE;
EAPI extern int ECORE_COCOA_EVENT_EXPOSE;
+typedef void * Ecore_Cocoa_Window_Id;
typedef struct _Ecore_Cocoa_Event_Video_Resize Ecore_Cocoa_Event_Video_Resize;
struct _Ecore_Cocoa_Event_Video_Resize
{
int w;
int h;
+ Ecore_Cocoa_Window_Id wid;
+};
+
+typedef struct _Ecore_Cocoa_Event_Window Ecore_Cocoa_Event_Window;
+struct _Ecore_Cocoa_Event_Window
+{
+ Ecore_Cocoa_Window_Id wid;
};
struct _Ecore_Cocoa_Screen
@@ -152,6 +160,8 @@ EAPI void ecore_cocoa_window_view_set(Ecore_Cocoa_Window *window,
EAPI int ecore_cocoa_titlebar_height_get(void);
+EAPI Ecore_Cocoa_Window_Id ecore_cocoa_window_get_window_id(Ecore_Cocoa_Window *window);
+
#ifdef __cplusplus
}
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 @@
event->w = size.width;
event->h = size.height -
(([self isFullScreen] == YES) ? 0 : ecore_cocoa_titlebar_height_get());
+ event->wid = [notif object];
ecore_event_add(ECORE_COCOA_EVENT_RESIZE, event, NULL, NULL);
ecore_main_loop_iterate();
}
@@ -270,3 +271,10 @@ ecore_cocoa_window_view_set(Ecore_Cocoa_Window *window,
[area release];
}
+
+Ecore_Cocoa_Window_Id ecore_cocoa_window_get_window_id(Ecore_Cocoa_Window *window)
+{
+ if (!window)
+ return 0;
+ return window->window;
+}