diff --git a/data/themes/default/ephoto.edc b/data/themes/default/ephoto.edc index 049675a..e0625f9 100644 --- a/data/themes/default/ephoto.edc +++ b/data/themes/default/ephoto.edc @@ -1,24 +1,121 @@ 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 { name: "flow"; 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 { name: "offscreen_left"; @@ -27,44 +124,31 @@ collections { description { state: default 0.0; + fixed: 1 1; visible: 0; - map.on: 1; - rel1.relative: 0.0 0.2; + rel1.relative: 0.0 0.3; rel1.offset: 0 0; - rel2.relative: 0.0 0.8; + rel2.relative: 0.0 0.7; rel2.offset: 0 0; - color: 255 255 255 255; } description { state: right 0.0; visible: 1; - rel1.relative: 0.0 0.2; + rel1.relative: 0.0 0.3; rel1.offset: 0 0; - rel2.relative: 0.2 0.8; + rel2.relative: 0.2 0.7; 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 { state: left 0.0; visible: 0; - map.on: 1; - rel1.relative: 1.0 0.2; + rel1.relative: 1.0 0.3; rel1.offset: 0 0; - rel2.relative: 1.0 0.8; + rel2.relative: 1.0 0.7; rel2.offset: 0 0; - color: 255 255 255 255; - } + } } part { @@ -75,40 +159,26 @@ collections { { state: default 0.0; visible: 1; - rel1.relative: 0.0 0.2; + rel1.relative: 0.0 0.3; rel1.offset: 0 0; - rel2.relative: 0.2 0.8; + rel2.relative: 0.2 0.7; 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 { state: right 0.0; - map.on: 1; rel1.relative: 0.2 0.2; rel1.offset: 0 0; rel2.relative: 0.8 0.8; rel2.offset: 0 0; - color: 255 255 255 255; } description { state: left 0.0; - map.on: 1; - rel1.relative: 0.0 0.2; + rel1.relative: 0.0 0.3; rel1.offset: 0 0; - rel2.relative: 0.0 0.8; + rel2.relative: 0.0 0.7; rel2.offset: 0 0; - color: 255 255 255 255; } description { @@ -116,7 +186,6 @@ collections { map.on: 1; inherit: default 0.0; visible: 0; - color: 255 255 255 0; } } part @@ -128,40 +197,26 @@ collections { { state: default 0.0; visible: 1; - rel1.relative: 0.8 0.2; + rel1.relative: 0.8 0.3; rel1.offset: 0 0; - rel2.relative: 1.0 0.8; + rel2.relative: 1.0 0.7; 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 { state: right 0.0; - map.on: 1; - rel1.relative: 1.0 0.2; + rel1.relative: 1.0 0.3; rel1.offset: 0 0; - rel2.relative: 1.0 0.8; + rel2.relative: 1.0 0.7; rel2.offset: 0 0; - color: 255 255 255 255; } description { state: left 0.0; - map.on: 1; rel1.relative: 0.2 0.2; rel1.offset: 0 0; rel2.relative: 0.8 0.8; - rel2.offset: 0 0; - color: 255 255 255 255; + rel2.offset: 0 0; } description { @@ -169,7 +224,6 @@ collections { map.on: 1; inherit: default 0.0; visible: 0; - color: 255 255 255 0; } } part @@ -180,53 +234,30 @@ collections { description { state: default 0.0; - map.on :1; rel1.relative: 0.2 0.2; rel1.offset: 0 0; rel2.relative: 0.8 0.8; rel2.offset: 0 0; - color: 255 255 255 255; } description { state: right 0.0; - rel1.relative: 0.8 0.2; + rel1.relative: 0.8 0.3; rel1.offset: 0 0; - rel2.relative: 1.0 0.8; + rel2.relative: 1.0 0.7; 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 { state: left 0.0; - rel1.relative: 0.0 0.2; + rel1.relative: 0.0 0.3; rel1.offset: 0 0; - rel2.relative: 0.2 0.8; + rel2.relative: 0.2 0.7; 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 { state: full 0.0; - map.on: 1; rel1.relative: 0.0 0.0; rel1.offset: 0 0; rel2.relative: 1.0 1.0; @@ -238,46 +269,33 @@ collections { name: "offscreen_right"; type: SWALLOW; mouse_events: 1; - description + description { state: default 0.0; + fixed: 1 1; visible: 0; - map.on: 1; - rel1.relative: 1.0 0.2; + rel1.relative: 1.0 0.3; rel1.offset: 0 0; - rel2.relative: 1.0 0.8; + rel2.relative: 1.0 0.7; rel2.offset: 0 0; - color: 255 255 255 255; } description { state: right 0.0; visible: 0; - map.on: 1; - rel1.relative: 0.0 0.2; + rel1.relative: 0.0 0.3; rel1.offset: 0 0; - rel2.relative: 0.0 0.8; + rel2.relative: 0.0 0.7; rel2.offset: 0 0; - color: 255 255 255 255; } description { state: left 0.0; visible: 1; - rel1.relative: 0.8 0.2; + rel1.relative: 0.8 0.3; rel1.offset: 0 0; - rel2.relative: 1.0 0.8; + rel2.relative: 1.0 0.7; rel2.offset: 0 0; - map { - on: 1; - perspective_on: 1; - rotation.y: -75.0; - } - perspective { - zplane: 0; - focal: 1000; - } - color: 255 255 255 255; } } } diff --git a/src/bin/ephoto_flow_browser.c b/src/bin/ephoto_flow_browser.c index bd0e4e8..1e7e95a 100644 --- a/src/bin/ephoto_flow_browser.c +++ b/src/bin/ephoto_flow_browser.c @@ -1,6 +1,7 @@ #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_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__); @@ -19,6 +20,7 @@ struct _Ephoto_Flow_Browser Evas_Object *box; Evas_Object *layout; Evas_Object *images[5]; + Evas_Object *img_edje[5]; Evas_Object *toolbar; Ephoto_Flow_State efs; char *swallows[5]; @@ -94,10 +96,11 @@ ephoto_flow_browser_add(void) 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) 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; @@ -123,18 +126,26 @@ ephoto_flow_browser_image_set(void) nextt = eina_list_nth_list(ephoto->images, 0); 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_layout_content_set(efb->layout, "offscreen_left", efb->images[0]); - elm_image_file_set(efb->images[1], eina_list_data_get(prev), NULL); - elm_layout_content_set(efb->layout, "left", efb->images[1]); - elm_image_file_set(efb->images[2], eina_list_data_get(ephoto->current_index), NULL); - elm_layout_content_set(efb->layout, "center", efb->images[2]); - elm_image_file_set(efb->images[3], eina_list_data_get(next), NULL); - elm_layout_content_set(efb->layout, "right", efb->images[3]); - elm_image_file_set(efb->images[4], eina_list_data_get(nextt), NULL); - elm_layout_content_set(efb->layout, "offscreen_right", efb->images[4]); + elm_thumb_file_set(efb->images[0], eina_list_data_get(prevv), NULL); + elm_layout_content_set(efb->img_edje[0], "image", efb->images[0]); + elm_layout_content_set(efb->layout, "offscreen_left", efb->img_edje[0]); + elm_thumb_file_set(efb->images[1], eina_list_data_get(prev), NULL); + elm_layout_content_set(efb->img_edje[1], "image", efb->images[1]); + 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); + elm_layout_content_set(efb->img_edje[2], "image", efb->images[2]); + 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_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 @@ -161,22 +172,36 @@ ephoto_flow_browser_show(void) } static Evas_Object * -_ephoto_add_image(const char *swallow) +_ephoto_add_image_edje(const char *swallow) { Evas_Object *o; - o = elm_image_add(efb->box); - elm_image_prescale_set(o, 800); + o = elm_layout_add(efb->box); + elm_layout_file_set + (o, PACKAGE_DATA_DIR "/themes/default/ephoto.edj", "flow_image"); elm_layout_content_set(efb->layout, swallow, o); evas_object_show(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 _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; 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_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++) - 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) { - image = efb->images[4]; - efb->images[4] = efb->images[3]; - efb->images[3] = efb->images[2]; - efb->images[2] = efb->images[1]; - efb->images[1] = efb->images[0]; - efb->images[0] = image; - - evas_object_event_callback_add - (efb->images[2], EVAS_CALLBACK_MOUSE_DOWN, _ephoto_center_image_clicked, NULL); - - elm_image_file_set(efb->images[4], eina_list_data_get(nextt), NULL); - elm_layout_content_set(efb->layout, "offscreen_right", efb->images[4]); - elm_layout_content_set(efb->layout, "right", efb->images[3]); - elm_layout_content_set(efb->layout, "center", efb->images[2]); - elm_layout_content_set(efb->layout, "left", efb->images[1]); - elm_image_file_set(efb->images[0], eina_list_data_get(prevv), NULL); - elm_layout_content_set(efb->layout, "offscreen_left", efb->images[0]); + 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]); + 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[2], eina_list_data_get(ephoto->current_index), NULL); + elm_layout_content_set(efb->img_edje[2], "image", efb->images[2]); + 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_layout_content_set(efb->img_edje[1], "image", efb->images[1]); + elm_layout_content_set(efb->layout, "left", efb->img_edje[1]); + elm_thumb_file_set(efb->images[0], eina_list_data_get(prevv), NULL); + elm_layout_content_set(efb->img_edje[0], "image", efb->images[0]); + elm_layout_content_set(efb->layout, "offscreen_left", efb->img_edje[0]); } else { - image = efb->images[0]; - efb->images[0] = efb->images[1]; - efb->images[1] = efb->images[2]; - efb->images[2] = efb->images[3]; - efb->images[3] = efb->images[4]; - efb->images[4] = image; - - evas_object_event_callback_add - (efb->images[2], EVAS_CALLBACK_MOUSE_DOWN, _ephoto_center_image_clicked, NULL); - - elm_image_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->layout, "left", efb->images[1]); - elm_layout_content_set(efb->layout, "center", efb->images[2]); - elm_layout_content_set(efb->layout, "right", efb->images[3]); - elm_image_file_set(efb->images[4], eina_list_data_get(nextt), NULL); - elm_layout_content_set(efb->layout, "offscreen_right", efb->images[4]); + elm_thumb_file_set(efb->images[0], eina_list_data_get(prevv), NULL); + elm_layout_content_set(efb->img_edje[0], "image", efb->images[0]); + elm_layout_content_set(efb->layout, "offscreen_left", efb->img_edje[0]); + elm_thumb_file_set(efb->images[1], eina_list_data_get(prev), NULL); + elm_layout_content_set(efb->img_edje[1], "image", efb->images[1]); + 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); + elm_layout_content_set(efb->img_edje[2], "image", efb->images[2]); + 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_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]); } edje_object_signal_emit(edje, "reset", "ephoto"); edje_object_thaw(edje);