forked from enlightenment/efl
From: 이상진 <lsj119@samsung.com>
Patch for rotate with resize (some formatting fixed too like ecore patch) SVN revision: 46047
This commit is contained in:
parent
ceb6345b7f
commit
957fc1e3e2
|
@ -6,6 +6,8 @@ typedef struct _Testitem
|
|||
int mode, onoff;
|
||||
} Testitem;
|
||||
|
||||
static int rotate_with_resize = 0;
|
||||
|
||||
static void
|
||||
my_bt_38_alpha_on(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
|
@ -24,12 +26,22 @@ my_bt_38_alpha_off(void *data, Evas_Object *obj, void *event_info)
|
|||
elm_win_alpha_set(win, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
my_ck_38_resize(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Evas_Object *win = data;
|
||||
rotate_with_resize = elm_check_state_get(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
my_bt_38_rot_0(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Evas_Object *win = data;
|
||||
Evas_Object *bg = evas_object_data_get(win, "bg");
|
||||
elm_win_rotation_set(win, 0);
|
||||
if (rotate_with_resize)
|
||||
elm_win_rotation_with_resize_set(win, 0);
|
||||
else
|
||||
elm_win_rotation_set(win, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -37,7 +49,10 @@ my_bt_38_rot_90(void *data, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
Evas_Object *win = data;
|
||||
Evas_Object *bg = evas_object_data_get(win, "bg");
|
||||
elm_win_rotation_set(win, 90);
|
||||
if (rotate_with_resize)
|
||||
elm_win_rotation_with_resize_set(win, 90);
|
||||
else
|
||||
elm_win_rotation_set(win, 90);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -45,7 +60,10 @@ my_bt_38_rot_180(void *data, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
Evas_Object *win = data;
|
||||
Evas_Object *bg = evas_object_data_get(win, "bg");
|
||||
elm_win_rotation_set(win, 180);
|
||||
if (rotate_with_resize)
|
||||
elm_win_rotation_with_resize_set(win, 180);
|
||||
else
|
||||
elm_win_rotation_set(win, 180);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -53,7 +71,10 @@ my_bt_38_rot_270(void *data, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
Evas_Object *win = data;
|
||||
Evas_Object *bg = evas_object_data_get(win, "bg");
|
||||
elm_win_rotation_set(win, 270);
|
||||
if (rotate_with_resize)
|
||||
elm_win_rotation_with_resize_set(win, 270);
|
||||
else
|
||||
elm_win_rotation_set(win, 270);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -87,7 +108,7 @@ _win_foc_out(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
void
|
||||
test_win_state(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Evas_Object *win, *bg, *sl, *bx, *bx2, *bt;
|
||||
Evas_Object *win, *bg, *sl, *bx, *bx2, *bt, *ck;
|
||||
static Testitem tit[3];
|
||||
int i;
|
||||
|
||||
|
@ -156,6 +177,15 @@ test_win_state(void *data, Evas_Object *obj, void *event_info)
|
|||
elm_box_pack_end(bx, bx2);
|
||||
evas_object_show(bx2);
|
||||
|
||||
ck = elm_check_add(win);
|
||||
elm_check_label_set(ck, "resize");
|
||||
elm_check_state_set(ck, rotate_with_resize);
|
||||
evas_object_smart_callback_add(ck, "changed", my_ck_38_resize, win);
|
||||
evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(ck, 0.02, 0.99);
|
||||
evas_object_show(ck);
|
||||
elm_box_pack_end(bx, ck);
|
||||
|
||||
bx2 = elm_box_add(win);
|
||||
elm_box_horizontal_set(bx2, 1);
|
||||
elm_box_homogenous_set(bx2, 1);
|
||||
|
|
|
@ -269,6 +269,7 @@ extern "C" {
|
|||
EAPI void elm_win_layer_set(Evas_Object *obj, int layer);
|
||||
EAPI int elm_win_layer_get(Evas_Object *obj);
|
||||
EAPI void elm_win_rotation_set(Evas_Object *obj, int rotation);
|
||||
EAPI void elm_win_rotation_with_resize_set(Evas_Object *obj, int rotation);
|
||||
EAPI int elm_win_rotation_get(Evas_Object *obj);
|
||||
EAPI void elm_win_sticky_set(Evas_Object *obj, Eina_Bool sticky);
|
||||
EAPI Eina_Bool elm_win_sticky_get(Evas_Object *obj);
|
||||
|
|
|
@ -775,6 +775,22 @@ elm_win_rotation_set(Evas_Object *obj, int rotation)
|
|||
_elm_win_xwin_update(win);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_win_rotation_with_resize_set(Evas_Object *obj, int rotation)
|
||||
{
|
||||
Elm_Win *win;
|
||||
if (strcmp(elm_widget_type_get(obj), "win")) return;
|
||||
win = elm_widget_data_get(obj);
|
||||
if (!win) return;
|
||||
if (win->rot == rotation) return;
|
||||
win->rot = rotation;
|
||||
ecore_evas_rotation_with_resize_set(win->ee, rotation);
|
||||
evas_object_size_hint_min_set(obj, -1, -1);
|
||||
evas_object_size_hint_max_set(obj, -1, -1);
|
||||
_elm_win_eval_subobjs(obj);
|
||||
_elm_win_xwin_update(win);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
elm_win_rotation_get(Evas_Object *obj)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue