Remove the mapping for now.. I will get it very nice outside of svn before committing next time.. For now a very nice elegant flow is being committed with border and shadows and it looks good.

SVN revision: 56955
This commit is contained in:
titan 2011-02-11 17:58:58 +00:00 committed by titan
parent 1c4ea07b1e
commit 4f3ecf243d
2 changed files with 218 additions and 180 deletions

View File

@ -1,24 +1,121 @@
collections { collections {
group
{
name: "flow_image";
image: "thumb_shadow.png" COMP;
parts
{
part
{
name: "event";
type: RECT;
repeat_events: 1;
description
{
state: "default" 0.0;
color: 0 0 0 0;
}
}
part
{
name: "border-shadow";
type: IMAGE;
mouse_events: 0;
description
{
state: "default" 0.0;
rel1
{
to: "image";
offset: -18 -18;
}
rel2
{
to: "image";
offset: 17 17;
}
image
{
normal: "thumb_shadow.png";
border: 17 17 17 17;
middle: NONE;
}
}
}
part
{
name: "border";
type: RECT;
mouse_events: 0;
description
{
state: "default" 0.0;
rel1
{
to: "border-shadow";
offset: 16 16;
}
rel2
{
to: "border-shadow";
offset: -15 -15;
}
}
}
part
{
name: "image";
type: SWALLOW;
mouse_events: 0;
description
{
state: "default" 0.0;
aspect_preference: BOTH;
aspect: 1.0 1.0;
rel1.offset: 0 8;
rel2.offset: -1 -2;
}
}
// part
// {
// name: "text";
// type: TEXT;
// effect: SOFT_SHADOW;
// mouse_events: 0;
// scale: 1;
// description
// {
// state: "default" 0.0;
// color: 0 0 0 255;
// color3: 0 0 0 0;
// align: 0.5 1.0;
// rel1
// {
// relative: 0.0 1.0;
// offset: 20 -30;
// }
// rel2
// {
// relative: 1.0 1.0;
// offset: -21 -15;
// }
// text
// {
// font: "Sans";
// size: 10;
// min: 0 1;
// align: 0.5 0.0;
// text_class: "image";
// }
// }
// }
}
}
group group
{ {
name: "flow"; name: "flow";
parts parts
{ {
part
{
name: "flow";
type: RECT;
mouse_events: 1;
description
{
state: default 0.0;
rel1.relative: 0.0 0.0;
rel1.offset: 0 0;
rel2.relative: 1.0 1.0;
rel2.offset: -1 -1;
color: 0 0 0 255;
}
}
part part
{ {
name: "offscreen_left"; name: "offscreen_left";
@ -27,44 +124,31 @@ collections {
description description
{ {
state: default 0.0; state: default 0.0;
fixed: 1 1;
visible: 0; visible: 0;
map.on: 1; rel1.relative: 0.0 0.3;
rel1.relative: 0.0 0.2;
rel1.offset: 0 0; rel1.offset: 0 0;
rel2.relative: 0.0 0.8; rel2.relative: 0.0 0.7;
rel2.offset: 0 0; rel2.offset: 0 0;
color: 255 255 255 255;
} }
description description
{ {
state: right 0.0; state: right 0.0;
visible: 1; visible: 1;
rel1.relative: 0.0 0.2; rel1.relative: 0.0 0.3;
rel1.offset: 0 0; rel1.offset: 0 0;
rel2.relative: 0.2 0.8; rel2.relative: 0.2 0.7;
rel2.offset: 0 0; rel2.offset: 0 0;
map {
on: 1;
perspective_on: 1;
rotation.y: 75.0;
}
perspective {
zplane: 0;
focal: 1000;
}
color: 255 255 255 255;
} }
description description
{ {
state: left 0.0; state: left 0.0;
visible: 0; visible: 0;
map.on: 1; rel1.relative: 1.0 0.3;
rel1.relative: 1.0 0.2;
rel1.offset: 0 0; rel1.offset: 0 0;
rel2.relative: 1.0 0.8; rel2.relative: 1.0 0.7;
rel2.offset: 0 0; rel2.offset: 0 0;
color: 255 255 255 255; }
}
} }
part part
{ {
@ -75,40 +159,26 @@ collections {
{ {
state: default 0.0; state: default 0.0;
visible: 1; visible: 1;
rel1.relative: 0.0 0.2; rel1.relative: 0.0 0.3;
rel1.offset: 0 0; rel1.offset: 0 0;
rel2.relative: 0.2 0.8; rel2.relative: 0.2 0.7;
rel2.offset: 0 0; rel2.offset: 0 0;
map {
on: 1;
perspective_on: 1;
rotation.y: 75.0;
}
perspective {
zplane: 0;
focal: 1000;
}
color: 255 255 255 255;
} }
description description
{ {
state: right 0.0; state: right 0.0;
map.on: 1;
rel1.relative: 0.2 0.2; rel1.relative: 0.2 0.2;
rel1.offset: 0 0; rel1.offset: 0 0;
rel2.relative: 0.8 0.8; rel2.relative: 0.8 0.8;
rel2.offset: 0 0; rel2.offset: 0 0;
color: 255 255 255 255;
} }
description description
{ {
state: left 0.0; state: left 0.0;
map.on: 1; rel1.relative: 0.0 0.3;
rel1.relative: 0.0 0.2;
rel1.offset: 0 0; rel1.offset: 0 0;
rel2.relative: 0.0 0.8; rel2.relative: 0.0 0.7;
rel2.offset: 0 0; rel2.offset: 0 0;
color: 255 255 255 255;
} }
description description
{ {
@ -116,7 +186,6 @@ collections {
map.on: 1; map.on: 1;
inherit: default 0.0; inherit: default 0.0;
visible: 0; visible: 0;
color: 255 255 255 0;
} }
} }
part part
@ -128,40 +197,26 @@ collections {
{ {
state: default 0.0; state: default 0.0;
visible: 1; visible: 1;
rel1.relative: 0.8 0.2; rel1.relative: 0.8 0.3;
rel1.offset: 0 0; rel1.offset: 0 0;
rel2.relative: 1.0 0.8; rel2.relative: 1.0 0.7;
rel2.offset: 0 0; rel2.offset: 0 0;
map {
on: 1;
perspective_on: 1;
rotation.y: -75.0;
}
perspective {
zplane: 0;
focal: 1000;
}
color: 255 255 255 255;
} }
description description
{ {
state: right 0.0; state: right 0.0;
map.on: 1; rel1.relative: 1.0 0.3;
rel1.relative: 1.0 0.2;
rel1.offset: 0 0; rel1.offset: 0 0;
rel2.relative: 1.0 0.8; rel2.relative: 1.0 0.7;
rel2.offset: 0 0; rel2.offset: 0 0;
color: 255 255 255 255;
} }
description description
{ {
state: left 0.0; state: left 0.0;
map.on: 1;
rel1.relative: 0.2 0.2; rel1.relative: 0.2 0.2;
rel1.offset: 0 0; rel1.offset: 0 0;
rel2.relative: 0.8 0.8; rel2.relative: 0.8 0.8;
rel2.offset: 0 0; rel2.offset: 0 0;
color: 255 255 255 255;
} }
description description
{ {
@ -169,7 +224,6 @@ collections {
map.on: 1; map.on: 1;
inherit: default 0.0; inherit: default 0.0;
visible: 0; visible: 0;
color: 255 255 255 0;
} }
} }
part part
@ -180,53 +234,30 @@ collections {
description description
{ {
state: default 0.0; state: default 0.0;
map.on :1;
rel1.relative: 0.2 0.2; rel1.relative: 0.2 0.2;
rel1.offset: 0 0; rel1.offset: 0 0;
rel2.relative: 0.8 0.8; rel2.relative: 0.8 0.8;
rel2.offset: 0 0; rel2.offset: 0 0;
color: 255 255 255 255;
} }
description description
{ {
state: right 0.0; state: right 0.0;
rel1.relative: 0.8 0.2; rel1.relative: 0.8 0.3;
rel1.offset: 0 0; rel1.offset: 0 0;
rel2.relative: 1.0 0.8; rel2.relative: 1.0 0.7;
rel2.offset: 0 0; rel2.offset: 0 0;
map {
on: 1;
perspective_on: 1;
rotation.y: -75.0;
}
perspective {
zplane: 0;
focal: 1000;
}
color: 255 255 255 255;
} }
description description
{ {
state: left 0.0; state: left 0.0;
rel1.relative: 0.0 0.2; rel1.relative: 0.0 0.3;
rel1.offset: 0 0; rel1.offset: 0 0;
rel2.relative: 0.2 0.8; rel2.relative: 0.2 0.7;
rel2.offset: 0 0; rel2.offset: 0 0;
map {
on: 1;
perspective_on: 1;
rotation.y: 75.0;
}
perspective {
zplane: 0;
focal: 1000;
}
color: 255 255 255 255;
} }
description description
{ {
state: full 0.0; state: full 0.0;
map.on: 1;
rel1.relative: 0.0 0.0; rel1.relative: 0.0 0.0;
rel1.offset: 0 0; rel1.offset: 0 0;
rel2.relative: 1.0 1.0; rel2.relative: 1.0 1.0;
@ -238,46 +269,33 @@ collections {
name: "offscreen_right"; name: "offscreen_right";
type: SWALLOW; type: SWALLOW;
mouse_events: 1; mouse_events: 1;
description description
{ {
state: default 0.0; state: default 0.0;
fixed: 1 1;
visible: 0; visible: 0;
map.on: 1; rel1.relative: 1.0 0.3;
rel1.relative: 1.0 0.2;
rel1.offset: 0 0; rel1.offset: 0 0;
rel2.relative: 1.0 0.8; rel2.relative: 1.0 0.7;
rel2.offset: 0 0; rel2.offset: 0 0;
color: 255 255 255 255;
} }
description description
{ {
state: right 0.0; state: right 0.0;
visible: 0; visible: 0;
map.on: 1; rel1.relative: 0.0 0.3;
rel1.relative: 0.0 0.2;
rel1.offset: 0 0; rel1.offset: 0 0;
rel2.relative: 0.0 0.8; rel2.relative: 0.0 0.7;
rel2.offset: 0 0; rel2.offset: 0 0;
color: 255 255 255 255;
} }
description description
{ {
state: left 0.0; state: left 0.0;
visible: 1; visible: 1;
rel1.relative: 0.8 0.2; rel1.relative: 0.8 0.3;
rel1.offset: 0 0; rel1.offset: 0 0;
rel2.relative: 1.0 0.8; rel2.relative: 1.0 0.7;
rel2.offset: 0 0; rel2.offset: 0 0;
map {
on: 1;
perspective_on: 1;
rotation.y: -75.0;
}
perspective {
zplane: 0;
focal: 1000;
}
color: 255 255 255 255;
} }
} }
} }

View File

@ -1,6 +1,7 @@
#include "ephoto.h" #include "ephoto.h"
static Evas_Object *_ephoto_add_image(const char *swallow); static Evas_Object *_ephoto_add_image_edje(const char *swallow);
static Evas_Object *_ephoto_add_image(Evas_Object *swallow);
static void _ephoto_flow_done(void *data __UNUSED__, Evas_Object *o __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__); static void _ephoto_flow_done(void *data __UNUSED__, Evas_Object *o __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__);
static void _ephoto_flow_back(void *data __UNUSED__, Evas_Object *o __UNUSED__, void *event_info __UNUSED__); static void _ephoto_flow_back(void *data __UNUSED__, Evas_Object *o __UNUSED__, void *event_info __UNUSED__);
static void _ephoto_flow_prev(void *data __UNUSED__, Evas_Object *o __UNUSED__, void *event_info __UNUSED__); static void _ephoto_flow_prev(void *data __UNUSED__, Evas_Object *o __UNUSED__, void *event_info __UNUSED__);
@ -19,6 +20,7 @@ struct _Ephoto_Flow_Browser
Evas_Object *box; Evas_Object *box;
Evas_Object *layout; Evas_Object *layout;
Evas_Object *images[5]; Evas_Object *images[5];
Evas_Object *img_edje[5];
Evas_Object *toolbar; Evas_Object *toolbar;
Ephoto_Flow_State efs; Ephoto_Flow_State efs;
char *swallows[5]; char *swallows[5];
@ -94,10 +96,11 @@ ephoto_flow_browser_add(void)
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
{ {
efb->images[i] = _ephoto_add_image(efb->swallows[i]); efb->img_edje[i] = _ephoto_add_image_edje(efb->swallows[i]);
efb->images[i] = _ephoto_add_image(efb->img_edje[i]);
if (i == 2) if (i == 2)
evas_object_event_callback_add evas_object_event_callback_add
(efb->images[2], EVAS_CALLBACK_MOUSE_DOWN, _ephoto_center_image_clicked, NULL); (efb->img_edje[2], EVAS_CALLBACK_MOUSE_DOWN, _ephoto_center_image_clicked, NULL);
} }
return efb->box; return efb->box;
@ -123,18 +126,26 @@ ephoto_flow_browser_image_set(void)
nextt = eina_list_nth_list(ephoto->images, 0); nextt = eina_list_nth_list(ephoto->images, 0);
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
elm_layout_content_unset(efb->layout, efb->swallows[i]); {
elm_layout_content_unset(efb->layout, efb->swallows[i]);
elm_layout_content_unset(efb->img_edje[i], "image");
}
elm_image_file_set(efb->images[0], eina_list_data_get(prevv), NULL); elm_thumb_file_set(efb->images[0], eina_list_data_get(prevv), NULL);
elm_layout_content_set(efb->layout, "offscreen_left", efb->images[0]); elm_layout_content_set(efb->img_edje[0], "image", efb->images[0]);
elm_image_file_set(efb->images[1], eina_list_data_get(prev), NULL); elm_layout_content_set(efb->layout, "offscreen_left", efb->img_edje[0]);
elm_layout_content_set(efb->layout, "left", efb->images[1]); elm_thumb_file_set(efb->images[1], eina_list_data_get(prev), NULL);
elm_image_file_set(efb->images[2], eina_list_data_get(ephoto->current_index), NULL); elm_layout_content_set(efb->img_edje[1], "image", efb->images[1]);
elm_layout_content_set(efb->layout, "center", efb->images[2]); elm_layout_content_set(efb->layout, "left", efb->img_edje[1]);
elm_image_file_set(efb->images[3], eina_list_data_get(next), NULL); elm_thumb_file_set(efb->images[2], eina_list_data_get(ephoto->current_index), NULL);
elm_layout_content_set(efb->layout, "right", efb->images[3]); elm_layout_content_set(efb->img_edje[2], "image", efb->images[2]);
elm_image_file_set(efb->images[4], eina_list_data_get(nextt), NULL); elm_layout_content_set(efb->layout, "center", efb->img_edje[2]);
elm_layout_content_set(efb->layout, "offscreen_right", efb->images[4]); elm_thumb_file_set(efb->images[3], eina_list_data_get(next), NULL);
elm_layout_content_set(efb->img_edje[3], "image", efb->images[3]);
elm_layout_content_set(efb->layout, "right", efb->img_edje[3]);
elm_thumb_file_set(efb->images[4], eina_list_data_get(nextt), NULL);
elm_layout_content_set(efb->img_edje[4], "image", efb->images[4]);
elm_layout_content_set(efb->layout, "offscreen_right", efb->img_edje[4]);
} }
void void
@ -161,22 +172,36 @@ ephoto_flow_browser_show(void)
} }
static Evas_Object * static Evas_Object *
_ephoto_add_image(const char *swallow) _ephoto_add_image_edje(const char *swallow)
{ {
Evas_Object *o; Evas_Object *o;
o = elm_image_add(efb->box); o = elm_layout_add(efb->box);
elm_image_prescale_set(o, 800); elm_layout_file_set
(o, PACKAGE_DATA_DIR "/themes/default/ephoto.edj", "flow_image");
elm_layout_content_set(efb->layout, swallow, o); elm_layout_content_set(efb->layout, swallow, o);
evas_object_show(o); evas_object_show(o);
return o; return o;
} }
static Evas_Object *
_ephoto_add_image(Evas_Object *swallow)
{
Evas_Object *o;
o = elm_thumb_add(efb->box);
elm_object_style_set(o, "noframe");
elm_layout_content_set(swallow, "image", o);
evas_object_show(o);
return o;
}
static void static void
_ephoto_flow_done(void *data __UNUSED__, Evas_Object *o __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) _ephoto_flow_done(void *data __UNUSED__, Evas_Object *o __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{ {
Evas_Object *edje, *image; Evas_Object *edje;
Eina_List *prevv, *prev, *next, *nextt; Eina_List *prevv, *prev, *next, *nextt;
int i; int i;
@ -196,51 +221,46 @@ _ephoto_flow_done(void *data __UNUSED__, Evas_Object *o __UNUSED__, const char *
edje = elm_layout_edje_get(efb->layout); edje = elm_layout_edje_get(efb->layout);
edje_object_freeze(edje); edje_object_freeze(edje);
evas_object_event_callback_del
(efb->images[2], EVAS_CALLBACK_MOUSE_DOWN, _ephoto_center_image_clicked);
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
elm_layout_content_unset(efb->layout, efb->swallows[i]); {
elm_layout_content_unset(efb->layout, efb->swallows[i]);
elm_layout_content_unset(efb->img_edje[i], "image");
}
if (efb->flow_direct == 0) if (efb->flow_direct == 0)
{ {
image = efb->images[4]; elm_thumb_file_set(efb->images[4], eina_list_data_get(nextt), NULL);
efb->images[4] = efb->images[3]; elm_layout_content_set(efb->img_edje[4], "image", efb->images[4]);
efb->images[3] = efb->images[2]; elm_layout_content_set(efb->layout, "offscreen_right", efb->img_edje[4]);
efb->images[2] = efb->images[1]; elm_thumb_file_set(efb->images[3], eina_list_data_get(next), NULL);
efb->images[1] = efb->images[0]; elm_layout_content_set(efb->img_edje[3], "image", efb->images[3]);
efb->images[0] = image; elm_layout_content_set(efb->layout, "right", efb->img_edje[3]);
elm_thumb_file_set(efb->images[2], eina_list_data_get(ephoto->current_index), NULL);
evas_object_event_callback_add elm_layout_content_set(efb->img_edje[2], "image", efb->images[2]);
(efb->images[2], EVAS_CALLBACK_MOUSE_DOWN, _ephoto_center_image_clicked, NULL); elm_layout_content_set(efb->layout, "center", efb->img_edje[2]);
elm_thumb_file_set(efb->images[1], eina_list_data_get(prev), NULL);
elm_image_file_set(efb->images[4], eina_list_data_get(nextt), NULL); elm_layout_content_set(efb->img_edje[1], "image", efb->images[1]);
elm_layout_content_set(efb->layout, "offscreen_right", efb->images[4]); elm_layout_content_set(efb->layout, "left", efb->img_edje[1]);
elm_layout_content_set(efb->layout, "right", efb->images[3]); elm_thumb_file_set(efb->images[0], eina_list_data_get(prevv), NULL);
elm_layout_content_set(efb->layout, "center", efb->images[2]); elm_layout_content_set(efb->img_edje[0], "image", efb->images[0]);
elm_layout_content_set(efb->layout, "left", efb->images[1]); elm_layout_content_set(efb->layout, "offscreen_left", efb->img_edje[0]);
elm_image_file_set(efb->images[0], eina_list_data_get(prevv), NULL);
elm_layout_content_set(efb->layout, "offscreen_left", efb->images[0]);
} }
else else
{ {
image = efb->images[0]; elm_thumb_file_set(efb->images[0], eina_list_data_get(prevv), NULL);
efb->images[0] = efb->images[1]; elm_layout_content_set(efb->img_edje[0], "image", efb->images[0]);
efb->images[1] = efb->images[2]; elm_layout_content_set(efb->layout, "offscreen_left", efb->img_edje[0]);
efb->images[2] = efb->images[3]; elm_thumb_file_set(efb->images[1], eina_list_data_get(prev), NULL);
efb->images[3] = efb->images[4]; elm_layout_content_set(efb->img_edje[1], "image", efb->images[1]);
efb->images[4] = image; elm_layout_content_set(efb->layout, "left", efb->img_edje[1]);
elm_thumb_file_set(efb->images[2], eina_list_data_get(ephoto->current_index), NULL);
evas_object_event_callback_add elm_layout_content_set(efb->img_edje[2], "image", efb->images[2]);
(efb->images[2], EVAS_CALLBACK_MOUSE_DOWN, _ephoto_center_image_clicked, NULL); elm_layout_content_set(efb->layout, "center", efb->img_edje[2]);
elm_thumb_file_set(efb->images[3], eina_list_data_get(next), NULL);
elm_image_file_set(efb->images[0], eina_list_data_get(prevv), NULL); elm_layout_content_set(efb->img_edje[3], "image", efb->images[3]);
elm_layout_content_set(efb->layout, "offscreen_left", efb->images[0]); elm_layout_content_set(efb->layout, "right", efb->img_edje[3]);
elm_layout_content_set(efb->layout, "left", efb->images[1]); elm_thumb_file_set(efb->images[4], eina_list_data_get(nextt), NULL);
elm_layout_content_set(efb->layout, "center", efb->images[2]); elm_layout_content_set(efb->img_edje[4], "image", efb->images[4]);
elm_layout_content_set(efb->layout, "right", efb->images[3]); elm_layout_content_set(efb->layout, "offscreen_right", efb->img_edje[4]);
elm_image_file_set(efb->images[4], eina_list_data_get(nextt), NULL);
elm_layout_content_set(efb->layout, "offscreen_right", efb->images[4]);
} }
edje_object_signal_emit(edje, "reset", "ephoto"); edje_object_signal_emit(edje, "reset", "ephoto");
edje_object_thaw(edje); edje_object_thaw(edje);