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>
This commit is contained in:
Romain Perier 2015-01-15 16:45:32 +01:00 committed by Cedric BAIL
parent c6945c075e
commit ff9eb2e8e7
2 changed files with 18 additions and 0 deletions

View File

@ -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
}

View File

@ -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;
}