summaryrefslogtreecommitdiff
path: root/src/lib/ecore_cocoa
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean.guyomarch@gmail.com>2016-01-06 22:01:41 +0100
committerCedric BAIL <cedric@osg.samsung.com>2016-03-02 13:56:24 -0800
commite7dc1491a2a93e274c122b6a7236e0278980f5e2 (patch)
tree831c271ded8de0dd3adb1ca2660147ca5667c195 /src/lib/ecore_cocoa
parent3b61c2e07c1ea354cf1255c3d83c14e2bc71e194 (diff)
ecore_cocoa: rename width and height parameters
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.h24
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa_window.m29
2 files changed, 26 insertions, 27 deletions
diff --git a/src/lib/ecore_cocoa/Ecore_Cocoa.h b/src/lib/ecore_cocoa/Ecore_Cocoa.h
index bd39b2e8b8..079500a355 100644
--- a/src/lib/ecore_cocoa/Ecore_Cocoa.h
+++ b/src/lib/ecore_cocoa/Ecore_Cocoa.h
@@ -147,14 +147,14 @@ EAPI void ecore_cocoa_screen_size_get(Ecore_Cocoa_Screen *screen, int *w, int *h
147 * Creates a Cocoa window 147 * Creates a Cocoa window
148 * @param x The origin (X) where the window must be created 148 * @param x The origin (X) where the window must be created
149 * @param y The origin (Y) where the window must be created 149 * @param y The origin (Y) where the window must be created
150 * @param width The width of the window 150 * @param w The width of the window
151 * @param height The height of the window 151 * @param h The height of the window
152 * @return A handler on the window. NULL on failure 152 * @return A handler on the window. NULL on failure
153 */ 153 */
154EAPI Ecore_Cocoa_Window *ecore_cocoa_window_new(int x, 154EAPI Ecore_Cocoa_Window *ecore_cocoa_window_new(int x,
155 int y, 155 int y,
156 int width, 156 int w,
157 int height); 157 int h);
158 158
159/** 159/**
160 * Releases a Cocoa window 160 * Releases a Cocoa window
@@ -175,28 +175,28 @@ EAPI void ecore_cocoa_window_move(Ecore_Cocoa_Window *window,
175/** 175/**
176 * Resizes a Cocoa window to a given size 176 * Resizes a Cocoa window to a given size
177 * @param window The window to be moved 177 * @param window The window to be moved
178 * @param width The new width of the window 178 * @param w The new width of the window
179 * @param height The new height of the window 179 * @param h The new height of the window
180 */ 180 */
181EAPI void ecore_cocoa_window_resize(Ecore_Cocoa_Window *window, 181EAPI void ecore_cocoa_window_resize(Ecore_Cocoa_Window *window,
182 int width, 182 int w,
183 int height); 183 int h);
184 184
185/** 185/**
186 * Moves and resizes a Cocoa window to a given point and size 186 * Moves and resizes a Cocoa window to a given point and size
187 * @param window The window to be moved 187 * @param window The window to be moved
188 * @param x The new origin of the window (X) 188 * @param x The new origin of the window (X)
189 * @param y The new origin of the window (Y) 189 * @param y The new origin of the window (Y)
190 * @param width The new width of the window 190 * @param w The new width of the window
191 * @param height The new height of the window 191 * @param h The new height of the window
192 * @see ecore_cocoa_window_resize() 192 * @see ecore_cocoa_window_resize()
193 * @see ecore_cocoa_window_move() 193 * @see ecore_cocoa_window_move()
194 */ 194 */
195EAPI void ecore_cocoa_window_move_resize(Ecore_Cocoa_Window *window, 195EAPI void ecore_cocoa_window_move_resize(Ecore_Cocoa_Window *window,
196 int x, 196 int x,
197 int y, 197 int y,
198 int width, 198 int w,
199 int height); 199 int h);
200 200
201EAPI void ecore_cocoa_window_geometry_get(const Ecore_Cocoa_Window *window, 201EAPI void ecore_cocoa_window_geometry_get(const Ecore_Cocoa_Window *window,
202 int *x, 202 int *x,
diff --git a/src/lib/ecore_cocoa/ecore_cocoa_window.m b/src/lib/ecore_cocoa/ecore_cocoa_window.m
index 37d9173a8a..b57df81448 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa_window.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa_window.m
@@ -292,19 +292,18 @@ static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST];
292EAPI Ecore_Cocoa_Window * 292EAPI Ecore_Cocoa_Window *
293ecore_cocoa_window_new(int x, 293ecore_cocoa_window_new(int x,
294 int y, 294 int y,
295 int width, 295 int w,
296 int height) 296 int h)
297{ 297{
298 Ecore_Cocoa_Window *w; 298 Ecore_Cocoa_Window *win;
299 EcoreCocoaWindow *window; 299 EcoreCocoaWindow *window;
300 NSRect frame = NSMakeRect(x, y, width, height);
301 NSUInteger style = 300 NSUInteger style =
302 NSTitledWindowMask | 301 NSTitledWindowMask |
303 NSClosableWindowMask | 302 NSClosableWindowMask |
304 NSResizableWindowMask | 303 NSResizableWindowMask |
305 NSMiniaturizableWindowMask; 304 NSMiniaturizableWindowMask;
306 305
307 window = [[EcoreCocoaWindow alloc] initWithContentRect:frame 306 window = [[EcoreCocoaWindow alloc] initWithContentRect:NSMakeRect(x, y, w, h)
308 styleMask:style 307 styleMask:style
309 backing:NSBackingStoreBuffered 308 backing:NSBackingStoreBuffered
310 defer:NO]; 309 defer:NO];
@@ -314,19 +313,19 @@ ecore_cocoa_window_new(int x,
314 return NULL; 313 return NULL;
315 } 314 }
316 315
317 w = calloc(1, sizeof(Ecore_Cocoa_Window)); 316 win = calloc(1, sizeof(*win));
318 if (EINA_UNLIKELY(w == NULL)) 317 if (EINA_UNLIKELY(win == NULL))
319 { 318 {
320 CRI("Failed to allocate Ecore_Cocoa_Window"); 319 CRI("Failed to allocate Ecore_Cocoa_Window");
321 [window release]; 320 [window release];
322 return NULL; 321 return NULL;
323 } 322 }
324 w->window = window; 323 win->window = window;
325 w->borderless = 0; 324 win->borderless = 0;
326 325
327 window.ecore_window_data = w; 326 window.ecore_window_data = win;
328 327
329 return w; 328 return win;
330} 329}
331 330
332EAPI void 331EAPI void
@@ -423,17 +422,17 @@ ecore_cocoa_window_move(Ecore_Cocoa_Window *window,
423 422
424EAPI void 423EAPI void
425ecore_cocoa_window_resize(Ecore_Cocoa_Window *window, 424ecore_cocoa_window_resize(Ecore_Cocoa_Window *window,
426 int width, 425 int w,
427 int height) 426 int h)
428{ 427{
429 EINA_SAFETY_ON_NULL_RETURN(window); 428 EINA_SAFETY_ON_NULL_RETURN(window);
430 429
431 NSRect win_frame; 430 NSRect win_frame;
432 431
433 win_frame = [window->window frame]; 432 win_frame = [window->window frame];
434 win_frame.size.height = height + 433 win_frame.size.height = h +
435 (([window->window isFullScreen] == YES) ? 0 : ecore_cocoa_titlebar_height_get()); 434 (([window->window isFullScreen] == YES) ? 0 : ecore_cocoa_titlebar_height_get());
436 win_frame.size.width = width; 435 win_frame.size.width = w;
437 436
438 [window->window setFrame:win_frame display:YES]; 437 [window->window setFrame:win_frame display:YES];
439} 438}