ecore-wl2: Add API to return window available rotations

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2017-06-09 10:08:06 -04:00
parent b1584c9054
commit 9930929dbb
2 changed files with 39 additions and 0 deletions

View File

@ -1053,6 +1053,20 @@ EAPI int ecore_wl2_window_preferred_rotation_get(Ecore_Wl2_Window *window);
*/
EAPI void ecore_wl2_window_available_rotations_set(Ecore_Wl2_Window *window, const int *rots, unsigned int count);
/**
* Get a windows available rotations
*
* @param window
* @param rots
* @param count
*
* @return EINA_TRUE on success, EINA_FALSE otherwise
*
* @ingroup Ecore_Wl2_Window_Group
* @since 1.20
*/
EAPI Eina_Bool ecore_wl2_window_available_rotations_get(Ecore_Wl2_Window *window, int **rots, unsigned int count);
/**
* @defgroup Ecore_Wl2_Input_Group Wayland Library Input Functions
* @ingroup Ecore_Wl2_Group

View File

@ -1263,3 +1263,28 @@ ecore_wl2_window_available_rotations_set(Ecore_Wl2_Window *window, const int *ro
window->wm_rot.count = count;
window->wm_rot.available_rots = rots;
}
EAPI Eina_Bool
ecore_wl2_window_available_rotations_get(Ecore_Wl2_Window *window, int **rots, unsigned int count)
{
int i = 0;
int *val = NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE);
*count = window->wm_rot.count;
if (window->wm_rot.count >= 1)
{
val = calloc(window->wm_rot.count, sizeof(int));
if (!val) return EINA_FALSE;
for (; i < window->wm_rot.count; i++)
val[i] = ((int *)window->wm_rot.available_rots)[i];
*rots = val;
return EINA_TRUE;
}
return EINA_FALSE;
}