summaryrefslogtreecommitdiff
path: root/src/lib/ecore_cocoa
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean.guyomarch@gmail.com>2016-01-06 21:56:09 +0100
committerCedric BAIL <cedric@osg.samsung.com>2016-03-02 13:56:20 -0800
commit3b61c2e07c1ea354cf1255c3d83c14e2bc71e194 (patch)
tree8a73786fbb05fbdeda4f81978164d0ad4afef5c7 /src/lib/ecore_cocoa
parent84bbe500c5441e52b78453d469a183ea15e230db (diff)
ecore_cocoa: better naming of events
Lost and got focused have been renamed FOCUSED and UNFOCUSED to mirror the focus API in Elementary. Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/ecore_cocoa')
-rw-r--r--src/lib/ecore_cocoa/Ecore_Cocoa.h16
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa.m12
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa_window.m10
3 files changed, 19 insertions, 19 deletions
diff --git a/src/lib/ecore_cocoa/Ecore_Cocoa.h b/src/lib/ecore_cocoa/Ecore_Cocoa.h
index f97bd20d27..bd39b2e8b8 100644
--- a/src/lib/ecore_cocoa/Ecore_Cocoa.h
+++ b/src/lib/ecore_cocoa/Ecore_Cocoa.h
@@ -61,27 +61,27 @@ typedef struct _Ecore_Cocoa_Screen Ecore_Cocoa_Screen;
61typedef void Ecore_Cocoa_Object; 61typedef void Ecore_Cocoa_Object;
62 62
63/** 63/**
64 * @typedef Ecore_Cocoa_Event_Video_Resize 64 * @typedef Ecore_Cocoa_Event_Window_Resize_Request
65 * Type of event thrown when a window is resized 65 * Type of event thrown when a Cocoa window is resized
66 */ 66 */
67typedef struct _Ecore_Cocoa_Event_Video_Resize Ecore_Cocoa_Event_Video_Resize; 67typedef struct _Ecore_Cocoa_Event_Window_Resize_Request Ecore_Cocoa_Event_Window_Resize_Request;
68 68
69/** Event triggered when a window receives focus */ 69/** Event triggered when a window receives focus */
70EAPI extern int ECORE_COCOA_EVENT_GOT_FOCUS; 70EAPI extern int ECORE_COCOA_EVENT_WINDOW_FOCUSED;
71 71
72/** Event triggered when a window loses focus */ 72/** Event triggered when a window loses focus */
73EAPI extern int ECORE_COCOA_EVENT_LOST_FOCUS; 73EAPI extern int ECORE_COCOA_EVENT_WINDOW_UNFOCUSED;
74 74
75/** Event triggered when a window is resized */ 75/** Event triggered when a window is resized */
76EAPI extern int ECORE_COCOA_EVENT_RESIZE; 76EAPI extern int ECORE_COCOA_EVENT_WINDOW_RESIZE_REQUEST;
77 77
78EAPI extern int ECORE_COCOA_EVENT_WINDOW_DESTROY; 78EAPI extern int ECORE_COCOA_EVENT_WINDOW_DESTROY;
79 79
80/** 80/**
81 * @struct _Ecore_Cocoa_Event_Video_Resize 81 * @struct _Ecore_Cocoa_Event_Window_Resize_Request
82 * Data available when a window is resized 82 * Data available when a window is resized
83 */ 83 */
84struct _Ecore_Cocoa_Event_Video_Resize 84struct _Ecore_Cocoa_Event_Window_Resize_Request
85{ 85{
86 int w; /**< Current width of the window */ 86 int w; /**< Current width of the window */
87 int h; /**< Current height of the window */ 87 int h; /**< Current height of the window */
diff --git a/src/lib/ecore_cocoa/ecore_cocoa.m b/src/lib/ecore_cocoa/ecore_cocoa.m
index 65960f2782..012fd11fe4 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa.m
@@ -19,9 +19,9 @@
19 19
20#include "ecore_cocoa_private.h" 20#include "ecore_cocoa_private.h"
21 21
22EAPI int ECORE_COCOA_EVENT_GOT_FOCUS = 0; 22EAPI int ECORE_COCOA_EVENT_WINDOW_UNFOCUSED = 0;
23EAPI int ECORE_COCOA_EVENT_LOST_FOCUS = 0; 23EAPI int ECORE_COCOA_EVENT_WINDOW_FOCUSED = 0;
24EAPI int ECORE_COCOA_EVENT_RESIZE = 0; 24EAPI int ECORE_COCOA_EVENT_WINDOW_RESIZE_REQUEST = 0;
25EAPI int ECORE_COCOA_EVENT_WINDOW_DESTROY = 0; 25EAPI int ECORE_COCOA_EVENT_WINDOW_DESTROY = 0;
26 26
27static int _ecore_cocoa_init_count = 0; 27static int _ecore_cocoa_init_count = 0;
@@ -51,9 +51,9 @@ ecore_cocoa_init(void)
51 51
52 DBG(""); 52 DBG("");
53 53
54 ECORE_COCOA_EVENT_GOT_FOCUS = ecore_event_type_new(); 54 ECORE_COCOA_EVENT_WINDOW_UNFOCUSED = ecore_event_type_new();
55 ECORE_COCOA_EVENT_LOST_FOCUS = ecore_event_type_new(); 55 ECORE_COCOA_EVENT_WINDOW_FOCUSED = ecore_event_type_new();
56 ECORE_COCOA_EVENT_RESIZE = ecore_event_type_new(); 56 ECORE_COCOA_EVENT_WINDOW_RESIZE_REQUEST = ecore_event_type_new();
57 ECORE_COCOA_EVENT_WINDOW_DESTROY = ecore_event_type_new(); 57 ECORE_COCOA_EVENT_WINDOW_DESTROY = ecore_event_type_new();
58 58
59 59
diff --git a/src/lib/ecore_cocoa/ecore_cocoa_window.m b/src/lib/ecore_cocoa/ecore_cocoa_window.m
index b1d7d6e59f..37d9173a8a 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa_window.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa_window.m
@@ -70,20 +70,20 @@ static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST];
70 70
71- (void)windowDidResize:(NSNotification *) notif 71- (void)windowDidResize:(NSNotification *) notif
72{ 72{
73 Ecore_Cocoa_Event_Video_Resize *event; 73 Ecore_Cocoa_Event_Window_Resize_Request *event;
74 NSSize size = self.frame.size; 74 NSSize size = self.frame.size;
75 75
76 event = malloc(sizeof(*event)); 76 event = malloc(sizeof(*event));
77 if (EINA_UNLIKELY(event == NULL)) 77 if (EINA_UNLIKELY(event == NULL))
78 { 78 {
79 CRI("Failed to allocate Ecore_Cocoa_Event_Video_Resize"); 79 CRI("Failed to allocate Ecore_Cocoa_Event_Window_Resize_Request");
80 return; 80 return;
81 } 81 }
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->cocoa_window = [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_WINDOW_RESIZE_REQUEST, event, NULL, NULL);
87 87
88 /* 88 /*
89 * During live resize, NSRunLoop blocks, and prevent the ecore_main_loop 89 * During live resize, NSRunLoop blocks, and prevent the ecore_main_loop
@@ -108,7 +108,7 @@ static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST];
108 return; 108 return;
109 } 109 }
110 e->cocoa_window = [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_WINDOW_FOCUSED, e, NULL, NULL);
112} 112}
113 113
114- (void) windowWillStartLiveResize:(NSNotification *) EINA_UNUSED notification 114- (void) windowWillStartLiveResize:(NSNotification *) EINA_UNUSED notification
@@ -132,7 +132,7 @@ static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST];
132 return; 132 return;
133 } 133 }
134 e->cocoa_window = [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_WINDOW_UNFOCUSED, e, NULL, NULL);
136} 136}
137 137
138- (void) mouseDown:(NSEvent*) event 138- (void) mouseDown:(NSEvent*) event