parent
b1b9700881
commit
b48c1d7415
|
@ -21,6 +21,7 @@ struct _Ephoto_Flow_Browser
|
||||||
Evas_Object *images[5];
|
Evas_Object *images[5];
|
||||||
Evas_Object *toolbar;
|
Evas_Object *toolbar;
|
||||||
Ephoto_Flow_State efs;
|
Ephoto_Flow_State efs;
|
||||||
|
char *swallows[5];
|
||||||
int flow_direct;
|
int flow_direct;
|
||||||
struct {
|
struct {
|
||||||
Elm_Toolbar_Item *go_back;
|
Elm_Toolbar_Item *go_back;
|
||||||
|
@ -35,9 +36,16 @@ Ephoto_Flow_Browser *efb;
|
||||||
Evas_Object *
|
Evas_Object *
|
||||||
ephoto_flow_browser_add(void)
|
ephoto_flow_browser_add(void)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
efb = calloc(1, sizeof(Ephoto_Flow_Browser));
|
efb = calloc(1, sizeof(Ephoto_Flow_Browser));
|
||||||
|
|
||||||
efb->efs = EPHOTO_FLOW_STATE_FLOW;
|
efb->efs = EPHOTO_FLOW_STATE_FLOW;
|
||||||
|
efb->swallows[0] = "offscreen_left";
|
||||||
|
efb->swallows[1] = "left";
|
||||||
|
efb->swallows[2] = "center";
|
||||||
|
efb->swallows[3] = "right";
|
||||||
|
efb->swallows[4] = "offscreen_right";
|
||||||
|
|
||||||
efb->box = elm_box_add(ephoto->win);
|
efb->box = elm_box_add(ephoto->win);
|
||||||
elm_box_horizontal_set(efb->box, EINA_FALSE);
|
elm_box_horizontal_set(efb->box, EINA_FALSE);
|
||||||
|
@ -84,14 +92,13 @@ ephoto_flow_browser_add(void)
|
||||||
edje_object_signal_callback_add
|
edje_object_signal_callback_add
|
||||||
(elm_layout_edje_get(efb->layout), "done", "ephoto", _ephoto_flow_done, NULL);
|
(elm_layout_edje_get(efb->layout), "done", "ephoto", _ephoto_flow_done, NULL);
|
||||||
|
|
||||||
efb->images[0] = _ephoto_add_image("offscreen_left");
|
for (i = 0; i < 5; i++)
|
||||||
efb->images[1] = _ephoto_add_image("left");
|
{
|
||||||
efb->images[2] = _ephoto_add_image("center");
|
efb->images[i] = _ephoto_add_image(efb->swallows[i]);
|
||||||
evas_object_event_callback_add
|
if (i == 2)
|
||||||
(efb->images[2], EVAS_CALLBACK_MOUSE_DOWN, _ephoto_center_image_clicked, NULL);
|
evas_object_event_callback_add
|
||||||
efb->images[3] = _ephoto_add_image("right");
|
(efb->images[2], EVAS_CALLBACK_MOUSE_DOWN, _ephoto_center_image_clicked, NULL);
|
||||||
efb->images[4] = _ephoto_add_image("offscreen_right");
|
}
|
||||||
|
|
||||||
return efb->box;
|
return efb->box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,6 +130,14 @@ ephoto_flow_browser_image_set(void)
|
||||||
void
|
void
|
||||||
ephoto_flow_browser_del(void)
|
ephoto_flow_browser_del(void)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < 5; i++)
|
||||||
|
{
|
||||||
|
elm_layout_content_unset(efb->layout, efb->swallows[i]);
|
||||||
|
evas_object_del(efb->images[i]);
|
||||||
|
}
|
||||||
|
evas_object_del(efb->layout);
|
||||||
evas_object_del(efb->box);
|
evas_object_del(efb->box);
|
||||||
free(efb);
|
free(efb);
|
||||||
}
|
}
|
||||||
|
@ -155,6 +170,7 @@ _ephoto_flow_done(void *data __UNUSED__, Evas_Object *o __UNUSED__, const char *
|
||||||
{
|
{
|
||||||
Evas_Object *edje, *image;
|
Evas_Object *edje, *image;
|
||||||
Eina_List *prevv, *prev, *next, *nextt;
|
Eina_List *prevv, *prev, *next, *nextt;
|
||||||
|
int i;
|
||||||
|
|
||||||
prev = eina_list_prev(ephoto->current_index);
|
prev = eina_list_prev(ephoto->current_index);
|
||||||
if (!eina_list_data_get(prev))
|
if (!eina_list_data_get(prev))
|
||||||
|
@ -172,11 +188,11 @@ _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);
|
||||||
|
|
||||||
elm_layout_content_unset(efb->layout, "offscreen_right");
|
evas_object_event_callback_del
|
||||||
elm_layout_content_unset(efb->layout, "right");
|
(efb->images[2], EVAS_CALLBACK_MOUSE_DOWN, _ephoto_center_image_clicked);
|
||||||
elm_layout_content_unset(efb->layout, "center");
|
|
||||||
elm_layout_content_unset(efb->layout, "left");
|
for (i = 0; i < 5; i++)
|
||||||
elm_layout_content_unset(efb->layout, "offscreen_left");
|
elm_layout_content_unset(efb->layout, efb->swallows[i]);
|
||||||
|
|
||||||
if (efb->flow_direct == 0)
|
if (efb->flow_direct == 0)
|
||||||
{
|
{
|
||||||
|
@ -187,13 +203,13 @@ _ephoto_flow_done(void *data __UNUSED__, Evas_Object *o __UNUSED__, const char *
|
||||||
efb->images[1] = efb->images[0];
|
efb->images[1] = efb->images[0];
|
||||||
efb->images[0] = image;
|
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_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, "offscreen_right", efb->images[4]);
|
||||||
// elm_image_file_set(efb->images[3], eina_list_data_get(next), NULL);
|
|
||||||
elm_layout_content_set(efb->layout, "right", efb->images[3]);
|
elm_layout_content_set(efb->layout, "right", efb->images[3]);
|
||||||
// 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_layout_content_set(efb->layout, "center", efb->images[2]);
|
||||||
// elm_image_file_set(efb->images[1], eina_list_data_get(prev), NULL);
|
|
||||||
elm_layout_content_set(efb->layout, "left", efb->images[1]);
|
elm_layout_content_set(efb->layout, "left", efb->images[1]);
|
||||||
elm_image_file_set(efb->images[0], eina_list_data_get(prevv), 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, "offscreen_left", efb->images[0]);
|
||||||
|
@ -207,13 +223,13 @@ _ephoto_flow_done(void *data __UNUSED__, Evas_Object *o __UNUSED__, const char *
|
||||||
efb->images[3] = efb->images[4];
|
efb->images[3] = efb->images[4];
|
||||||
efb->images[4] = image;
|
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_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, "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_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_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_layout_content_set(efb->layout, "right", efb->images[3]);
|
||||||
elm_image_file_set(efb->images[4], eina_list_data_get(nextt), 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, "offscreen_right", efb->images[4]);
|
||||||
|
|
Loading…
Reference in New Issue