Add current rotation to smart_data structure.
Fill in current rotation on crtc set. Update current rotation when we get a rotation event. Signed-off-by: Christopher Michael <cp.michael@samsung.com> SVN revision: 84183
This commit is contained in:
parent
35855135a1
commit
c2b2be5be7
|
@ -80,6 +80,9 @@ struct _E_Smart_Data
|
||||||
|
|
||||||
/* rotating flag */
|
/* rotating flag */
|
||||||
Eina_Bool rotating : 1;
|
Eina_Bool rotating : 1;
|
||||||
|
|
||||||
|
/* current rotation */
|
||||||
|
int rotation;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* smart function prototypes */
|
/* smart function prototypes */
|
||||||
|
@ -223,6 +226,9 @@ e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord c
|
||||||
sd->crtc.mode = ecore_x_randr_crtc_mode_get(root, crtc);
|
sd->crtc.mode = ecore_x_randr_crtc_mode_get(root, crtc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* get the degree of rotation */
|
||||||
|
sd->rotation = _e_smart_monitor_rotation_get(sd->crtc.orient);
|
||||||
|
|
||||||
/* check crtc current mode to determine if enabled */
|
/* check crtc current mode to determine if enabled */
|
||||||
if (sd->crtc.mode != 0)
|
if (sd->crtc.mode != 0)
|
||||||
{
|
{
|
||||||
|
@ -1059,6 +1065,9 @@ _e_smart_monitor_frame_cb_rotate_start(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
/* try to get the monitor smart data */
|
/* try to get the monitor smart data */
|
||||||
if (!(sd = evas_object_smart_data_get(mon))) return;
|
if (!(sd = evas_object_smart_data_get(mon))) return;
|
||||||
|
|
||||||
|
/* get the degree of rotation */
|
||||||
|
sd->rotation = _e_smart_monitor_rotation_get(sd->crtc.orient);
|
||||||
|
|
||||||
/* record current size of monitor */
|
/* record current size of monitor */
|
||||||
/* evas_object_grid_pack_get(sd->grid.obj, mon, NULL, NULL, &sd->cw, &sd->ch); */
|
/* evas_object_grid_pack_get(sd->grid.obj, mon, NULL, NULL, &sd->cw, &sd->ch); */
|
||||||
|
|
||||||
|
@ -1168,10 +1177,11 @@ _e_smart_monitor_rotate_event(E_Smart_Data *sd, Evas_Object *mon, void *event)
|
||||||
if (rotation == 0) return;
|
if (rotation == 0) return;
|
||||||
|
|
||||||
/* factor in any existing rotation */
|
/* factor in any existing rotation */
|
||||||
/* rotation += ; */
|
rotation += sd->rotation;
|
||||||
rotation %= 360;
|
rotation %= 360;
|
||||||
|
|
||||||
/* update current rotation value */
|
/* update current rotation value */
|
||||||
|
sd->rotation = rotation;
|
||||||
|
|
||||||
/* apply rotation map */
|
/* apply rotation map */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue