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 * Creates a Cocoa window * @param x The origin (X) where the window must be created * @param y The origin (Y) where the window must be created - * @param width The width of the window - * @param height The height of the window + * @param w The width of the window + * @param h The height of the window * @return A handler on the window. NULL on failure */ EAPI Ecore_Cocoa_Window *ecore_cocoa_window_new(int x, int y, - int width, - int height); + int w, + int h); /** * Releases a Cocoa window @@ -175,28 +175,28 @@ EAPI void ecore_cocoa_window_move(Ecore_Cocoa_Window *window, /** * Resizes a Cocoa window to a given size * @param window The window to be moved - * @param width The new width of the window - * @param height The new height of the window + * @param w The new width of the window + * @param h The new height of the window */ EAPI void ecore_cocoa_window_resize(Ecore_Cocoa_Window *window, - int width, - int height); + int w, + int h); /** * Moves and resizes a Cocoa window to a given point and size * @param window The window to be moved * @param x The new origin of the window (X) * @param y The new origin of the window (Y) - * @param width The new width of the window - * @param height The new height of the window + * @param w The new width of the window + * @param h The new height of the window * @see ecore_cocoa_window_resize() * @see ecore_cocoa_window_move() */ EAPI void ecore_cocoa_window_move_resize(Ecore_Cocoa_Window *window, int x, int y, - int width, - int height); + int w, + int h); EAPI void ecore_cocoa_window_geometry_get(const Ecore_Cocoa_Window *window, 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]; EAPI Ecore_Cocoa_Window * ecore_cocoa_window_new(int x, int y, - int width, - int height) + int w, + int h) { - Ecore_Cocoa_Window *w; + Ecore_Cocoa_Window *win; EcoreCocoaWindow *window; - NSRect frame = NSMakeRect(x, y, width, height); NSUInteger style = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask; - window = [[EcoreCocoaWindow alloc] initWithContentRect:frame + window = [[EcoreCocoaWindow alloc] initWithContentRect:NSMakeRect(x, y, w, h) styleMask:style backing:NSBackingStoreBuffered defer:NO]; @@ -314,19 +313,19 @@ ecore_cocoa_window_new(int x, return NULL; } - w = calloc(1, sizeof(Ecore_Cocoa_Window)); - if (EINA_UNLIKELY(w == NULL)) + win = calloc(1, sizeof(*win)); + if (EINA_UNLIKELY(win == NULL)) { CRI("Failed to allocate Ecore_Cocoa_Window"); [window release]; return NULL; } - w->window = window; - w->borderless = 0; + win->window = window; + win->borderless = 0; - window.ecore_window_data = w; + window.ecore_window_data = win; - return w; + return win; } EAPI void @@ -423,17 +422,17 @@ ecore_cocoa_window_move(Ecore_Cocoa_Window *window, EAPI void ecore_cocoa_window_resize(Ecore_Cocoa_Window *window, - int width, - int height) + int w, + int h) { EINA_SAFETY_ON_NULL_RETURN(window); NSRect win_frame; win_frame = [window->window frame]; - win_frame.size.height = height + + win_frame.size.height = h + (([window->window isFullScreen] == YES) ? 0 : ecore_cocoa_titlebar_height_get()); - win_frame.size.width = width; + win_frame.size.width = w; [window->window setFrame:win_frame display:YES]; }