Allow ephoto's large view to show all image types, not just jpeg... bit of a hack I know.. better ideas, let me know.

SVN revision: 50057
v-1.6.0
titan 13 years ago committed by titan
parent fa09a70bf8
commit 9e69452b80
  1. 134
      src/bin/ephoto_flow_browser.c

@ -9,7 +9,7 @@ static void _ephoto_go_previous(void *data, Evas_Object *obj, void *event_info);
/*Inline variables*/
static Eina_List *iter;
static Evas_Object *image, *toolbar;
static Evas_Object *image, *image2, *toolbar;
/*Create the flow browser*/
void
@ -23,11 +23,15 @@ ephoto_create_flow_browser(void)
evas_object_size_hint_align_set(em->flow_browser, EVAS_HINT_FILL, EVAS_HINT_FILL);
image = elm_photocam_add(em->win);
elm_photocam_zoom_mode_set(image, ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT);
evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_photocam_zoom_mode_set(image, ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT);
evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(image, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(em->flow_browser, image);
image2 = elm_image_add(em->win);
elm_image_smooth_set(image2, EINA_TRUE);
evas_object_size_hint_weight_set(image2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(image2, EVAS_HINT_FILL, EVAS_HINT_FILL);
toolbar = elm_toolbar_add(em->win);
elm_toolbar_icon_size_set(toolbar, 24);
elm_toolbar_homogenous_set(toolbar, EINA_TRUE);
@ -65,13 +69,31 @@ ephoto_create_flow_browser(void)
void
ephoto_show_flow_browser(const char *current_image)
{
const char *file_type;
iter = eina_list_data_find_list(em->images, current_image);
if (iter == NULL)
iter = eina_list_nth_list(em->images, 0);
elm_photocam_file_set(image, current_image);
evas_object_show(image);
elm_box_unpack(em->flow_browser, image);
elm_box_unpack(em->flow_browser, image2);
elm_box_unpack(em->flow_browser, toolbar);
file_type = strrchr(current_image, '.');
if (strncasecmp(file_type, ".jpg", 4) && strncasecmp(file_type, ".jpeg", 5))
{
elm_image_file_set(image2, current_image, NULL);
elm_box_pack_end(em->flow_browser, image2);
evas_object_show(image2);
}
else
{
elm_photocam_file_set(image, current_image);
elm_box_pack_end(em->flow_browser, image);
evas_object_show(image);
}
elm_box_pack_end(em->flow_browser, toolbar);
evas_object_show(toolbar);
evas_object_show(em->flow_browser);
}
@ -81,6 +103,7 @@ void
ephoto_hide_flow_browser(void)
{
evas_object_hide(image);
evas_object_hide(image2);
evas_object_hide(toolbar);
evas_object_hide(em->flow_browser);
}
@ -99,6 +122,7 @@ ephoto_delete_flow_browser(void)
}
evas_object_del(image);
evas_object_del(image2);
evas_object_del(toolbar);
evas_object_del(em->flow_browser);
}
@ -117,9 +141,31 @@ _ephoto_go_back(void *data, Evas_Object *obj, void *event_info)
static void
_ephoto_go_first(void *data, Evas_Object *obj, void *event_info)
{
const char *file_type;
iter = eina_list_nth_list(em->images, 0);
elm_photocam_file_set(image, eina_list_data_get(iter));
elm_box_unpack(em->flow_browser, image);
elm_box_unpack(em->flow_browser, image2);
elm_box_unpack(em->flow_browser, toolbar);
evas_object_hide(image);
evas_object_hide(image2);
file_type = strrchr(eina_list_data_get(iter), '.');
if (strncasecmp(file_type, ".jpg", 4) && strncasecmp(file_type, ".jpeg", 5))
{
elm_image_file_set(image2, eina_list_data_get(iter), NULL);
elm_box_pack_end(em->flow_browser, image2);
evas_object_show(image2);
}
else
{
elm_photocam_file_set(image, eina_list_data_get(iter));
elm_box_pack_end(em->flow_browser, image);
evas_object_show(image);
}
elm_box_pack_end(em->flow_browser, toolbar);
elm_toolbar_item_unselect_all(toolbar);
}
@ -128,9 +174,31 @@ _ephoto_go_first(void *data, Evas_Object *obj, void *event_info)
static void
_ephoto_go_last(void *data, Evas_Object *obj, void *event_info)
{
const char *file_type;
iter = eina_list_last(em->images);
elm_photocam_file_set(image, eina_list_data_get(iter));
elm_box_unpack(em->flow_browser, image);
elm_box_unpack(em->flow_browser, image2);
elm_box_unpack(em->flow_browser, toolbar);
evas_object_hide(image);
evas_object_hide(image2);
file_type = strrchr(eina_list_data_get(iter), '.');
if (strncasecmp(file_type, ".jpg", 4) && strncasecmp(file_type, ".jpeg", 5))
{
elm_image_file_set(image2, eina_list_data_get(iter), NULL);
elm_box_pack_end(em->flow_browser, image2);
evas_object_show(image2);
}
else
{
elm_photocam_file_set(image, eina_list_data_get(iter));
elm_box_pack_end(em->flow_browser, image);
evas_object_show(image);
}
elm_box_pack_end(em->flow_browser, toolbar);
elm_toolbar_item_unselect_all(toolbar);
}
@ -139,11 +207,33 @@ _ephoto_go_last(void *data, Evas_Object *obj, void *event_info)
static void
_ephoto_go_next(void *data, Evas_Object *obj, void *event_info)
{
const char *file_type;
iter = iter->next;
if (!iter)
iter = eina_list_nth_list(em->images, 0);
elm_photocam_file_set(image, eina_list_data_get(iter));
elm_box_unpack(em->flow_browser, image);
elm_box_unpack(em->flow_browser, image2);
elm_box_unpack(em->flow_browser, toolbar);
evas_object_hide(image);
evas_object_hide(image2);
file_type = strrchr(eina_list_data_get(iter), '.');
if (strncasecmp(file_type, ".jpg", 4) && strncasecmp(file_type, ".jpeg", 5))
{
elm_image_file_set(image2, eina_list_data_get(iter), NULL);
elm_box_pack_end(em->flow_browser, image2);
evas_object_show(image2);
}
else
{
elm_photocam_file_set(image, eina_list_data_get(iter));
elm_box_pack_end(em->flow_browser, image);
evas_object_show(image);
}
elm_box_pack_end(em->flow_browser, toolbar);
elm_toolbar_item_unselect_all(toolbar);
}
@ -152,11 +242,33 @@ _ephoto_go_next(void *data, Evas_Object *obj, void *event_info)
static void
_ephoto_go_previous(void *data, Evas_Object *obj, void *event_info)
{
const char *file_type;
iter = iter->prev;
if (!iter)
iter = eina_list_last(em->images);
elm_photocam_file_set(image, eina_list_data_get(iter));
elm_box_unpack(em->flow_browser, image);
elm_box_unpack(em->flow_browser, image2);
elm_box_unpack(em->flow_browser, toolbar);
evas_object_hide(image);
evas_object_hide(image2);
file_type = strrchr(eina_list_data_get(iter), '.');
if (strncasecmp(file_type, ".jpg", 4) && strncasecmp(file_type, ".jpeg", 5))
{
elm_image_file_set(image2, eina_list_data_get(iter), NULL);
elm_box_pack_end(em->flow_browser, image2);
evas_object_show(image2);
}
else
{
elm_photocam_file_set(image, eina_list_data_get(iter));
elm_box_pack_end(em->flow_browser, image);
evas_object_show(image);
}
elm_box_pack_end(em->flow_browser, toolbar);
elm_toolbar_item_unselect_all(toolbar);
}

Loading…
Cancel
Save