ecore_cocoa: add functions to allow min/max window size

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
pierre lamot 2015-03-11 15:31:36 +01:00 committed by Cedric BAIL
parent be98af31bf
commit ca3bd69485
2 changed files with 54 additions and 3 deletions

View File

@ -292,6 +292,39 @@ ecore_cocoa_window_free(Ecore_Cocoa_Window *window)
free(window);
}
void
ecore_cocoa_window_size_min_set(Ecore_Cocoa_Window *window,
unsigned int w,
unsigned int h)
{
if (!window)
return;
NSSize size = {w,h};
window->window.contentMinSize = size;
}
void
ecore_cocoa_window_size_max_set(Ecore_Cocoa_Window *window,
unsigned int w,
unsigned int h)
{
if (!window)
return;
NSSize size = {w,h};
window->window.contentMaxSize = size;
}
void
ecore_cocoa_window_size_step_set(Ecore_Cocoa_Window *window,
unsigned int w,
unsigned int h)
{
if (!window)
return;
NSSize size = {w,h};
window->window.contentResizeIncrements = size;
}
void
ecore_cocoa_window_move(Ecore_Cocoa_Window *window,
int x,

View File

@ -302,6 +302,24 @@ _ecore_evas_cocoa_free(Ecore_Evas *ee)
ecore_cocoa_shutdown();
}
static void
_ecore_evas_size_min_set(Ecore_Evas *ee, int w, int h)
{
ecore_cocoa_window_size_min_set((Ecore_Cocoa_Window *)ee->prop.window, w, h);
}
static void
_ecore_evas_size_max_set(Ecore_Evas *ee, int w, int h)
{
ecore_cocoa_window_size_max_set((Ecore_Cocoa_Window *)ee->prop.window, w, h);
}
static void
_ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h)
{
ecore_cocoa_window_size_step_set((Ecore_Cocoa_Window *)ee->prop.window, w, h);
}
static void
_ecore_evas_resize(Ecore_Evas *ee, int w, int h)
{
@ -524,10 +542,10 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
NULL, //activate
_ecore_evas_title_set,
NULL,
_ecore_evas_size_min_set,
_ecore_evas_size_max_set,
NULL,
NULL,
NULL,
NULL,
_ecore_evas_size_step_set,
_ecore_evas_object_cursor_set,
_ecore_evas_object_cursor_unset,
NULL,