forked from enlightenment/efl
ecore-wl2: Add API to return window available rotations
@feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
b1584c9054
commit
9930929dbb
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue