diff --git a/src/bin/ephoto_directory_browser.c b/src/bin/ephoto_directory_browser.c index 0ffe4ea..1448562 100644 --- a/src/bin/ephoto_directory_browser.c +++ b/src/bin/ephoto_directory_browser.c @@ -612,6 +612,7 @@ _fsel_mouse_up_cb(void *data, Evas *e EINA_UNUSED, if (it) elm_genlist_item_selected_set(it, EINA_FALSE); ephoto_directory_set(db->ephoto, db->ephoto->top_directory, NULL, 0, 1); + ephoto_title_set(db->ephoto, db->ephoto->top_directory); } if (info->button != 3) @@ -1249,6 +1250,7 @@ ephoto_directory_browser_initialize_structure(Ephoto *ephoto) free(dir); } ephoto_directory_set(db->ephoto, db->ephoto->config->directory, next, EINA_FALSE, EINA_TRUE); + ephoto_title_set(db->ephoto, db->ephoto->config->directory); ephoto_directory_browser_top_dir_set(db->ephoto, "/"); db->initializing = EINA_FALSE; } diff --git a/src/bin/ephoto_single_browser.c b/src/bin/ephoto_single_browser.c index acf3868..0062268 100644 --- a/src/bin/ephoto_single_browser.c +++ b/src/bin/ephoto_single_browser.c @@ -55,6 +55,7 @@ struct _Ephoto_History unsigned int *im_data; Evas_Coord w; Evas_Coord h; + Ephoto_Orient orient; }; /*Common Callbacks*/ @@ -319,7 +320,7 @@ _monitor_cb(void *data, int type, if (w > 0 && h > 0) { evas_object_hide(v->image); - elm_image_file_set(v->image, sb->entry->path, group); + evas_object_image_file_set(v->image, sb->entry->path, group); evas_object_show(v->image); } } @@ -435,41 +436,44 @@ _viewer_zoom_fit(Evas_Object *obj) static void _orient_apply(Ephoto_Single_Browser *sb) { + Ephoto_History *eh = NULL; Ephoto_Viewer *v = evas_object_data_get(sb->viewer, "viewer"); Evas_Coord w, h; + Eina_List *l; + char buf[PATH_MAX]; switch (sb->orient) { case EPHOTO_ORIENT_0: - elm_image_orient_set(v->image, ELM_IMAGE_ORIENT_NONE); + evas_object_image_orient_set(v->image, EVAS_IMAGE_ORIENT_NONE); break; case EPHOTO_ORIENT_90: - elm_image_orient_set(v->image, ELM_IMAGE_ROTATE_90); + evas_object_image_orient_set(v->image, EVAS_IMAGE_ORIENT_90); break; case EPHOTO_ORIENT_180: - elm_image_orient_set(v->image, ELM_IMAGE_ROTATE_180); + evas_object_image_orient_set(v->image, EVAS_IMAGE_ORIENT_180); break; case EPHOTO_ORIENT_270: - elm_image_orient_set(v->image, ELM_IMAGE_ROTATE_270); + evas_object_image_orient_set(v->image, EVAS_IMAGE_ORIENT_270); break; case EPHOTO_ORIENT_FLIP_HORIZ: - elm_image_orient_set(v->image, ELM_IMAGE_FLIP_HORIZONTAL); + evas_object_image_orient_set(v->image, EVAS_IMAGE_FLIP_HORIZONTAL); break; case EPHOTO_ORIENT_FLIP_VERT: - elm_image_orient_set(v->image, ELM_IMAGE_FLIP_VERTICAL); + evas_object_image_orient_set(v->image, EVAS_IMAGE_FLIP_VERTICAL); break; case EPHOTO_ORIENT_FLIP_HORIZ_90: - elm_image_orient_set(v->image, ELM_IMAGE_FLIP_TRANSPOSE); + evas_object_image_orient_set(v->image, EVAS_IMAGE_FLIP_TRANSPOSE); break; case EPHOTO_ORIENT_FLIP_VERT_90: - elm_image_orient_set(v->image, ELM_IMAGE_FLIP_TRANSVERSE); + evas_object_image_orient_set(v->image, EVAS_IMAGE_FLIP_TRANSVERSE); break; default: @@ -482,6 +486,34 @@ _orient_apply(Ephoto_Single_Browser *sb) evas_object_image_data_get(v->image, EINA_FALSE); sb->ew = w; sb->eh = h; + if (sb->history_pos < (eina_list_count(sb->history)-1)) + { + int count; + + count = sb->history_pos + 1; + l = eina_list_nth_list(sb->history, count); + while (l) + { + eh = eina_list_data_get(l); + sb->history = eina_list_remove_list(sb->history, l); + free(eh->im_data); + free(eh); + eh = NULL; + l = eina_list_nth_list(sb->history, count); + } + } + eh = calloc(1, sizeof(Ephoto_History)); + eh->im_data = malloc(sizeof(unsigned int) * sb->ew * sb->eh); + eh->im_data = memcpy(eh->im_data, sb->edited_image_data, + sizeof(unsigned int) * sb->ew * sb->eh); + eh->w = sb->ew; + eh->h = sb->eh; + eh->orient = sb->orient; + sb->history = eina_list_append(sb->history, eh); + sb->history_pos = eina_list_count(sb->history) - 1; + snprintf(buf, PATH_MAX, "%s [%s]", sb->entry->basename, _("MODIFIED")); + ephoto_title_set(sb->ephoto, buf); + _ephoto_update_bottom_bar(sb); evas_object_size_hint_min_set(v->image, w, h); evas_object_size_hint_max_set(v->image, w, h); elm_table_pack(v->table, v->image, 0, 0, 1, 1); @@ -853,9 +885,20 @@ _undo_image(void *data, Evas_Object *obj EINA_UNUSED, { sb->history_pos--; eh = eina_list_nth(sb->history, sb->history_pos); + evas_object_image_orient_set(v->image, eh->orient); + elm_table_unpack(v->table, v->image); evas_object_image_size_set(v->image, eh->w, eh->h); evas_object_image_data_set(v->image, eh->im_data); evas_object_image_data_update_add(v->image, 0, 0, eh->w, eh->h); + evas_object_size_hint_min_set(v->image, eh->w, eh->h); + evas_object_size_hint_max_set(v->image, eh->w, eh->h); + elm_table_pack(v->table, v->image, 0, 0, 1, 1); + if (sb->orient != eh->orient) + sb->orient = eh->orient; + if (v->fit) + _viewer_zoom_fit_apply(v); + else + _viewer_zoom_set(sb->viewer, _viewer_zoom_get(sb->viewer)); } } @@ -874,9 +917,21 @@ _redo_image(void *data, Evas_Object *obj EINA_UNUSED, { sb->history_pos++; eh = eina_list_nth(sb->history, sb->history_pos); + evas_object_image_orient_set(v->image, eh->orient); + elm_table_unpack(v->table, v->image); + elm_object_content_unset(v->scroller); evas_object_image_size_set(v->image, eh->w, eh->h); evas_object_image_data_set(v->image, eh->im_data); evas_object_image_data_update_add(v->image, 0, 0, eh->w, eh->h); + evas_object_size_hint_min_set(v->image, eh->w, eh->h); + evas_object_size_hint_max_set(v->image, eh->w, eh->h); + elm_table_pack(v->table, v->image, 0, 0, 1, 1); + if (sb->orient != eh->orient) + sb->orient = eh->orient; + if (v->fit) + _viewer_zoom_fit_apply(v); + else + _viewer_zoom_set(sb->viewer, _viewer_zoom_get(sb->viewer)); } } @@ -2096,6 +2151,7 @@ ephoto_single_browser_entry_set(Evas_Object *obj, Ephoto_Entry *entry) sizeof(unsigned int) * w * h); eh->w = w; eh->h = h; + eh->orient = sb->orient; sb->history = eina_list_append(sb->history, eh); _zoom_fit(sb); } @@ -2183,6 +2239,7 @@ ephoto_single_browser_image_data_done(Evas_Object *main, Ephoto_Single_Browser *sb = evas_object_data_get(main, "single_browser"); Ephoto_History *eh; Eina_List *l; + char buf[PATH_MAX]; if (sb->editing) { @@ -2219,8 +2276,11 @@ ephoto_single_browser_image_data_done(Evas_Object *main, sizeof(unsigned int) * sb->ew * sb->eh); eh->w = sb->ew; eh->h = sb->eh; + eh->orient = sb->orient; sb->history = eina_list_append(sb->history, eh); sb->history_pos = eina_list_count(sb->history) - 1; + snprintf(buf, PATH_MAX, "%s [%s]", sb->entry->basename, _("MODIFIED")); + ephoto_title_set(sb->ephoto, buf); _ephoto_update_bottom_bar(sb); sb->editing = EINA_FALSE; _zoom_fit(sb); diff --git a/src/bin/ephoto_thumb_browser.c b/src/bin/ephoto_thumb_browser.c index 63c5084..22a892d 100644 --- a/src/bin/ephoto_thumb_browser.c +++ b/src/bin/ephoto_thumb_browser.c @@ -407,6 +407,7 @@ _sort_alpha_asc(void *data, Evas_Object *obj, evas_object_show(ic); ephoto_directory_set(tb->ephoto, tb->ephoto->config->directory, NULL, tb->dirs_only, tb->thumbs_only); + ephoto_title_set(tb->ephoto, tb->ephoto->config->directory); } static void @@ -426,6 +427,7 @@ _sort_alpha_desc(void *data, Evas_Object *obj EINA_UNUSED, evas_object_show(ic); ephoto_directory_set(tb->ephoto, tb->ephoto->config->directory, NULL, tb->dirs_only, tb->thumbs_only); + ephoto_title_set(tb->ephoto, tb->ephoto->config->directory); } static void @@ -445,6 +447,7 @@ _sort_mod_asc(void *data, Evas_Object *obj EINA_UNUSED, evas_object_show(ic); ephoto_directory_set(tb->ephoto, tb->ephoto->config->directory, NULL, tb->dirs_only, tb->thumbs_only); + ephoto_title_set(tb->ephoto, tb->ephoto->config->directory); } static void @@ -464,6 +467,7 @@ _sort_mod_desc(void *data, Evas_Object *obj EINA_UNUSED, evas_object_show(ic); ephoto_directory_set(tb->ephoto, tb->ephoto->config->directory, NULL, tb->dirs_only, tb->thumbs_only); + ephoto_title_set(tb->ephoto, tb->ephoto->config->directory); } static void @@ -483,6 +487,7 @@ _sort_similarity(void *data, Evas_Object *obj EINA_UNUSED, evas_object_show(ic); ephoto_directory_set(tb->ephoto, tb->ephoto->config->directory, NULL, tb->dirs_only, tb->thumbs_only); + ephoto_title_set(tb->ephoto, tb->ephoto->config->directory); } static void