ooof flippidy-do-da... working much better.
SVN revision: 51831
This commit is contained in:
parent
5f220d5f76
commit
cda4f422b1
|
@ -43,6 +43,20 @@ my_fl_6(void *data, Evas_Object *obj, void *event_info)
|
||||||
elm_flip_go(fl, ELM_FLIP_CUBE_RIGHT);
|
elm_flip_go(fl, ELM_FLIP_CUBE_RIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
my_fl_7(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Evas_Object *fl = data;
|
||||||
|
elm_flip_go(fl, ELM_FLIP_CUBE_UP);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
my_fl_8(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Evas_Object *fl = data;
|
||||||
|
elm_flip_go(fl, ELM_FLIP_CUBE_DOWN);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
test_flip(void *data, Evas_Object *obj, void *event_info)
|
test_flip(void *data, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
|
@ -138,6 +152,14 @@ test_flip(void *data, Evas_Object *obj, void *event_info)
|
||||||
elm_box_pack_end(bx2, bt);
|
elm_box_pack_end(bx2, bt);
|
||||||
evas_object_show(bt);
|
evas_object_show(bt);
|
||||||
|
|
||||||
|
elm_box_pack_end(bx, bx2);
|
||||||
|
evas_object_show(bx2);
|
||||||
|
|
||||||
|
bx2 = elm_box_add(win);
|
||||||
|
elm_box_horizontal_set(bx2, 1);
|
||||||
|
evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
|
||||||
|
|
||||||
bt = elm_button_add(win);
|
bt = elm_button_add(win);
|
||||||
elm_button_label_set(bt, "5");
|
elm_button_label_set(bt, "5");
|
||||||
evas_object_smart_callback_add(bt, "clicked", my_fl_5, fl);
|
evas_object_smart_callback_add(bt, "clicked", my_fl_5, fl);
|
||||||
|
@ -154,6 +176,22 @@ test_flip(void *data, Evas_Object *obj, void *event_info)
|
||||||
elm_box_pack_end(bx2, bt);
|
elm_box_pack_end(bx2, bt);
|
||||||
evas_object_show(bt);
|
evas_object_show(bt);
|
||||||
|
|
||||||
|
bt = elm_button_add(win);
|
||||||
|
elm_button_label_set(bt, "7");
|
||||||
|
evas_object_smart_callback_add(bt, "clicked", my_fl_7, fl);
|
||||||
|
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
|
||||||
|
elm_box_pack_end(bx2, bt);
|
||||||
|
evas_object_show(bt);
|
||||||
|
|
||||||
|
bt = elm_button_add(win);
|
||||||
|
elm_button_label_set(bt, "8");
|
||||||
|
evas_object_smart_callback_add(bt, "clicked", my_fl_8, fl);
|
||||||
|
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
|
||||||
|
elm_box_pack_end(bx2, bt);
|
||||||
|
evas_object_show(bt);
|
||||||
|
|
||||||
elm_box_pack_end(bx, bx2);
|
elm_box_pack_end(bx, bx2);
|
||||||
evas_object_show(bx2);
|
evas_object_show(bx2);
|
||||||
|
|
||||||
|
|
|
@ -1525,7 +1525,9 @@ extern "C" {
|
||||||
ELM_FLIP_ROTATE_XZ_CENTER_AXIS,
|
ELM_FLIP_ROTATE_XZ_CENTER_AXIS,
|
||||||
ELM_FLIP_ROTATE_YZ_CENTER_AXIS,
|
ELM_FLIP_ROTATE_YZ_CENTER_AXIS,
|
||||||
ELM_FLIP_CUBE_LEFT,
|
ELM_FLIP_CUBE_LEFT,
|
||||||
ELM_FLIP_CUBE_RIGHT
|
ELM_FLIP_CUBE_RIGHT,
|
||||||
|
ELM_FLIP_CUBE_UP,
|
||||||
|
ELM_FLIP_CUBE_DOWN
|
||||||
} Elm_Flip_Mode;
|
} Elm_Flip_Mode;
|
||||||
|
|
||||||
EAPI Evas_Object *elm_flip_add(Evas_Object *parent);
|
EAPI Evas_Object *elm_flip_add(Evas_Object *parent);
|
||||||
|
|
|
@ -114,6 +114,34 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
flip_show_hide(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
|
if (elm_flip_front_get(obj))
|
||||||
|
{
|
||||||
|
if (wd->front.content)
|
||||||
|
evas_object_show(wd->front.clip);
|
||||||
|
else
|
||||||
|
evas_object_hide(wd->front.clip);
|
||||||
|
if (wd->back.content)
|
||||||
|
evas_object_hide(wd->back.clip);
|
||||||
|
else
|
||||||
|
evas_object_hide(wd->back.clip);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (wd->front.content)
|
||||||
|
evas_object_hide(wd->front.clip);
|
||||||
|
else
|
||||||
|
evas_object_hide(wd->front.clip);
|
||||||
|
if (wd->back.content)
|
||||||
|
evas_object_show(wd->back.clip);
|
||||||
|
else
|
||||||
|
evas_object_hide(wd->back.clip);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_flip(Evas_Object *obj)
|
_flip(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
@ -222,7 +250,36 @@ _flip(Evas_Object *obj)
|
||||||
evas_map_util_3d_rotate(mb, 0.0, deg, 0.0, cx, cy, w / 2);
|
evas_map_util_3d_rotate(mb, 0.0, deg, 0.0, cx, cy, w / 2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ELM_FLIP_CUBE_UP:
|
||||||
|
p = 1.0 - t;
|
||||||
|
p = 1.0 - (p * p);
|
||||||
|
deg = -90.0 * p;
|
||||||
|
if (wd->state)
|
||||||
|
{
|
||||||
|
evas_map_util_3d_rotate(mf, deg, 0.0, 0.0, cx, cy, h / 2);
|
||||||
|
evas_map_util_3d_rotate(mb, deg + 90, 0.0, 0.0, cx, cy, h / 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
evas_map_util_3d_rotate(mf, deg + 90, 0.0, 0.0, cx, cy, h / 2);
|
||||||
|
evas_map_util_3d_rotate(mb, deg, 0.0, 0.0, cx, cy, h / 2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ELM_FLIP_CUBE_DOWN:
|
||||||
|
p = 1.0 - t;
|
||||||
|
p = 1.0 - (p * p);
|
||||||
|
deg = 90.0 * p;
|
||||||
|
if (wd->state)
|
||||||
|
{
|
||||||
|
evas_map_util_3d_rotate(mf, deg, 0.0, 0.0, cx, cy, h / 2);
|
||||||
|
evas_map_util_3d_rotate(mb, deg - 90, 0.0, 0.0, cx, cy, h / 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
evas_map_util_3d_rotate(mf, deg - 90, 0.0, 0.0, cx, cy, h / 2);
|
||||||
|
evas_map_util_3d_rotate(mb, deg, 0.0, 0.0, cx, cy, h / 2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -333,7 +390,7 @@ elm_flip_add(Evas_Object *parent)
|
||||||
evas_object_color_set(wd->front.clip, 255, 255, 255, 255);
|
evas_object_color_set(wd->front.clip, 255, 255, 255, 255);
|
||||||
evas_object_move(wd->front.clip, -49999, -49999);
|
evas_object_move(wd->front.clip, -49999, -49999);
|
||||||
evas_object_resize(wd->front.clip, 99999, 99999);
|
evas_object_resize(wd->front.clip, 99999, 99999);
|
||||||
elm_widget_sub_object_add(wd->front.clip, obj);
|
elm_widget_sub_object_add(obj, wd->front.clip);
|
||||||
evas_object_smart_member_add(wd->front.clip, obj);
|
evas_object_smart_member_add(wd->front.clip, obj);
|
||||||
evas_object_clip_set(wd->front.clip, evas_object_clip_get(obj));
|
evas_object_clip_set(wd->front.clip, evas_object_clip_get(obj));
|
||||||
|
|
||||||
|
@ -342,7 +399,7 @@ elm_flip_add(Evas_Object *parent)
|
||||||
evas_object_move(wd->back.clip, -49999, -49999);
|
evas_object_move(wd->back.clip, -49999, -49999);
|
||||||
evas_object_resize(wd->back.clip, 99999, 99999);
|
evas_object_resize(wd->back.clip, 99999, 99999);
|
||||||
elm_widget_sub_object_add(wd->back.clip, obj);
|
elm_widget_sub_object_add(wd->back.clip, obj);
|
||||||
evas_object_smart_member_add(wd->back.clip, obj);
|
evas_object_smart_member_add(obj, wd->back.clip);
|
||||||
evas_object_clip_set(wd->back.clip, evas_object_clip_get(obj));
|
evas_object_clip_set(wd->back.clip, evas_object_clip_get(obj));
|
||||||
|
|
||||||
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
|
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
|
||||||
|
@ -386,11 +443,8 @@ elm_flip_content_front_set(Evas_Object *obj, Evas_Object *content)
|
||||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_changed_size_hints, obj);
|
_changed_size_hints, obj);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
if (!elm_flip_front_get(obj)) evas_object_hide(wd->front.clip);
|
|
||||||
else evas_object_show(wd->front.clip);
|
|
||||||
}
|
}
|
||||||
else
|
flip_show_hide(obj);
|
||||||
evas_object_hide(wd->front.clip);
|
|
||||||
_configure(obj);
|
_configure(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -425,11 +479,8 @@ elm_flip_content_back_set(Evas_Object *obj, Evas_Object *content)
|
||||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_changed_size_hints, obj);
|
_changed_size_hints, obj);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
if (elm_flip_front_get(obj)) evas_object_hide(wd->back.clip);
|
|
||||||
else evas_object_show(wd->back.clip);
|
|
||||||
}
|
}
|
||||||
else
|
flip_show_hide(obj);
|
||||||
evas_object_hide(wd->back.clip);
|
|
||||||
_configure(obj);
|
_configure(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -514,6 +565,9 @@ elm_flip_perspective_set(Evas_Object *obj, Evas_Coord foc __UNUSED__, Evas_Coord
|
||||||
* ELM_FLIP_ROTATE_YZ_CENTER_AXIS
|
* ELM_FLIP_ROTATE_YZ_CENTER_AXIS
|
||||||
* ELM_FLIP_CUBE_LEFT
|
* ELM_FLIP_CUBE_LEFT
|
||||||
* ELM_FLIP_CUBE_RIGHT
|
* ELM_FLIP_CUBE_RIGHT
|
||||||
|
*
|
||||||
|
* FIXME: add - ELM_FLIP_CUBE_UP
|
||||||
|
* FIXMEL add - ELM_FLIP_CUBE_DOWN
|
||||||
*
|
*
|
||||||
* @ingroup Flip
|
* @ingroup Flip
|
||||||
*/
|
*/
|
||||||
|
@ -524,7 +578,9 @@ elm_flip_go(Evas_Object *obj, Elm_Flip_Mode mode)
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (!wd->animator) wd->animator = ecore_animator_add(_animate, obj);
|
if (!wd->animator) wd->animator = ecore_animator_add(_animate, obj);
|
||||||
|
flip_show_hide(obj);
|
||||||
wd->mode = mode;
|
wd->mode = mode;
|
||||||
wd->start = ecore_loop_time_get();
|
wd->start = ecore_loop_time_get();
|
||||||
wd->len = 0.5;
|
wd->len = 0.5;
|
||||||
|
_flip(obj);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1256,6 +1256,14 @@ _smart_show(Evas_Object *obj)
|
||||||
list = evas_object_smart_members_get(obj);
|
list = evas_object_smart_members_get(obj);
|
||||||
EINA_LIST_FOREACH(list, l, o)
|
EINA_LIST_FOREACH(list, l, o)
|
||||||
{
|
{
|
||||||
|
Evas_Object *obj2;
|
||||||
|
|
||||||
|
obj2 = evas_object_clip_get(o);
|
||||||
|
if (obj2)
|
||||||
|
{
|
||||||
|
obj2 = evas_object_smart_parent_get(obj2);
|
||||||
|
if (obj2 == obj) continue;
|
||||||
|
}
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1269,6 +1277,14 @@ _smart_hide(Evas_Object *obj)
|
||||||
list = evas_object_smart_members_get(obj);
|
list = evas_object_smart_members_get(obj);
|
||||||
EINA_LIST_FOREACH(list, l, o)
|
EINA_LIST_FOREACH(list, l, o)
|
||||||
{
|
{
|
||||||
|
Evas_Object *obj2;
|
||||||
|
|
||||||
|
obj2 = evas_object_clip_get(o);
|
||||||
|
if (obj2)
|
||||||
|
{
|
||||||
|
obj2 = evas_object_smart_parent_get(obj2);
|
||||||
|
if (obj2 == obj) continue;
|
||||||
|
}
|
||||||
evas_object_hide(o);
|
evas_object_hide(o);
|
||||||
}
|
}
|
||||||
_if_focused_revert(obj);
|
_if_focused_revert(obj);
|
||||||
|
@ -1283,6 +1299,14 @@ _smart_color_set(Evas_Object *obj, int r, int g, int b, int a)
|
||||||
list = evas_object_smart_members_get(obj);
|
list = evas_object_smart_members_get(obj);
|
||||||
EINA_LIST_FOREACH(list, l, o)
|
EINA_LIST_FOREACH(list, l, o)
|
||||||
{
|
{
|
||||||
|
Evas_Object *obj2;
|
||||||
|
|
||||||
|
obj2 = evas_object_clip_get(o);
|
||||||
|
if (obj2)
|
||||||
|
{
|
||||||
|
obj2 = evas_object_smart_parent_get(obj2);
|
||||||
|
if (obj2 == obj) continue;
|
||||||
|
}
|
||||||
evas_object_color_set(o, r, g, b, a);
|
evas_object_color_set(o, r, g, b, a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1296,6 +1320,14 @@ _smart_clip_set(Evas_Object *obj, Evas_Object *clip)
|
||||||
list = evas_object_smart_members_get(obj);
|
list = evas_object_smart_members_get(obj);
|
||||||
EINA_LIST_FOREACH(list, l, o)
|
EINA_LIST_FOREACH(list, l, o)
|
||||||
{
|
{
|
||||||
|
Evas_Object *obj2;
|
||||||
|
|
||||||
|
obj2 = evas_object_clip_get(o);
|
||||||
|
if (obj2)
|
||||||
|
{
|
||||||
|
obj2 = evas_object_smart_parent_get(obj2);
|
||||||
|
if (obj2 == obj) continue;
|
||||||
|
}
|
||||||
evas_object_clip_set(o, clip);
|
evas_object_clip_set(o, clip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1309,6 +1341,14 @@ _smart_clip_unset(Evas_Object *obj)
|
||||||
list = evas_object_smart_members_get(obj);
|
list = evas_object_smart_members_get(obj);
|
||||||
EINA_LIST_FOREACH(list, l, o)
|
EINA_LIST_FOREACH(list, l, o)
|
||||||
{
|
{
|
||||||
|
Evas_Object *obj2;
|
||||||
|
|
||||||
|
obj2 = evas_object_clip_get(o);
|
||||||
|
if (obj2)
|
||||||
|
{
|
||||||
|
obj2 = evas_object_smart_parent_get(obj2);
|
||||||
|
if (obj2 == obj) continue;
|
||||||
|
}
|
||||||
evas_object_clip_unset(o);
|
evas_object_clip_unset(o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue