Ephoto: Ecrustify Formatting

This commit is contained in:
Stephen 'Okra' Houston 2017-08-30 09:01:07 -05:00
parent ab43168f90
commit a705f9a626
20 changed files with 3270 additions and 3180 deletions

View File

@ -73,7 +73,7 @@ elm_main(int argc, char **argv)
elm_run();
end:
end:
e_thumb_shutdown();
efreet_mime_shutdown();
eio_shutdown();

View File

@ -31,7 +31,7 @@
#if HAVE_GETTEXT && ENABLE_NLS
# include <libintl.h>
# define _(string) gettext (string)
# define _(string) gettext(string)
#else
# define _(string) (string)
# define ngettext(String1, String2, Var) Var == 1 ? String1 : String2
@ -337,9 +337,9 @@ Ephoto_Entry *ephoto_entry_new(Ephoto *ephoto, const char *path,
Eina_Bool ephoto_entry_exists(Ephoto *ephoto, const char *path);
void ephoto_entry_free(Ephoto *ephoto, Ephoto_Entry *entry);
void ephoto_entry_free_listener_add(Ephoto_Entry *entry,
void (*cb) (void *data, const Ephoto_Entry *entry), const void *data);
void (*cb)(void *data, const Ephoto_Entry *entry), const void *data);
void ephoto_entry_free_listener_del(Ephoto_Entry *entry,
void (*cb) (void *data, const Ephoto_Entry *entry), const void *data);
void (*cb)(void *data, const Ephoto_Entry *entry), const void *data);
void ephoto_entries_free(Ephoto *ephoto);
int ephoto_entries_cmp(const void *pa, const void *pb);
@ -408,7 +408,7 @@ ephoto_normalize_color(int color)
static inline int
ephoto_mul_color_alpha(int color, int alpha)
{
return (alpha > 0 && alpha <= 255) ? (color * (255 /alpha)) : color;
return (alpha > 0 && alpha <= 255) ? (color * (255 / alpha)) : color;
}
static inline int
@ -427,7 +427,6 @@ extern int EPHOTO_EVENT_EDITOR_APPLY;
extern int EPHOTO_EVENT_EDITOR_CANCEL;
extern int EPHOTO_EVENT_EDITOR_BACK;
#define CRIT(...) EINA_LOG_CRIT(__VA_ARGS__)
#define ERR(...) EINA_LOG_ERR(__VA_ARGS__)
#define WRN(...) EINA_LOG_WARN(__VA_ARGS__)

View File

@ -42,16 +42,16 @@ _ephoto_bcg_adjust_brightness(Ephoto_BCG *ebcg, int brightness,
p2 = im_data_new + (y * ebcg->w);
for (x = 0; x < ebcg->w; x++)
{
b = (int) ((*p1) & 0xff);
g = (int) ((*p1 >> 8) & 0xff);
r = (int) ((*p1 >> 16) & 0xff);
a = (int) ((*p1 >> 24) & 0xff);
b = (int)((*p1) & 0xff);
g = (int)((*p1 >> 8) & 0xff);
r = (int)((*p1 >> 16) & 0xff);
a = (int)((*p1 >> 24) & 0xff);
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
bb = (int) b + ebcg->brightness;
gg = (int) g + ebcg->brightness;
rr = (int) r + ebcg->brightness;
bb = (int)b + ebcg->brightness;
gg = (int)g + ebcg->brightness;
rr = (int)r + ebcg->brightness;
bb = ephoto_normalize_color(bb);
gg = ephoto_normalize_color(gg);
rr = ephoto_normalize_color(rr);
@ -88,7 +88,7 @@ _ephoto_bcg_adjust_contrast(Ephoto_BCG *ebcg, int contrast,
ebcg->contrast = contrast;
top = ((255 + (contrast)) * 259);
bottom = ((259 - (contrast)) * 255);
factor = (float) top / (float) bottom;
factor = (float)top / (float)bottom;
im_data_new = malloc(sizeof(unsigned int) * ebcg->w * ebcg->h);
for (y = 0; y < ebcg->h; y++)
@ -97,16 +97,16 @@ _ephoto_bcg_adjust_contrast(Ephoto_BCG *ebcg, int contrast,
p2 = im_data_new + (y * ebcg->w);
for (x = 0; x < ebcg->w; x++)
{
b = (int) ((*p1) & 0xff);
g = (int) ((*p1 >> 8) & 0xff);
r = (int) ((*p1 >> 16) & 0xff);
a = (int) ((*p1 >> 24) & 0xff);
b = (int)((*p1) & 0xff);
g = (int)((*p1 >> 8) & 0xff);
r = (int)((*p1 >> 16) & 0xff);
a = (int)((*p1 >> 24) & 0xff);
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
bb = (int) ((factor * (b - 128)) + 128);
gg = (int) ((factor * (g - 128)) + 128);
rr = (int) ((factor * (r - 128)) + 128);
bb = (int)((factor * (b - 128)) + 128);
gg = (int)((factor * (g - 128)) + 128);
rr = (int)((factor * (r - 128)) + 128);
bb = ephoto_normalize_color(bb);
gg = ephoto_normalize_color(gg);
rr = ephoto_normalize_color(rr);
@ -148,16 +148,16 @@ _ephoto_bcg_adjust_gamma(Ephoto_BCG *ebcg, double gamma,
p2 = im_data_new + (y * ebcg->w);
for (x = 0; x < ebcg->w; x++)
{
b = (int) ((*p1) & 0xff);
g = (int) ((*p1 >> 8) & 0xff);
r = (int) ((*p1 >> 16) & 0xff);
a = (int) ((*p1 >> 24) & 0xff);
b = (int)((*p1) & 0xff);
g = (int)((*p1 >> 8) & 0xff);
r = (int)((*p1 >> 16) & 0xff);
a = (int)((*p1 >> 24) & 0xff);
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
bb = (int) (pow(((double) b / 255), ebcg->gamma) * 255);
gg = (int) (pow(((double) g / 255), ebcg->gamma) * 255);
rr = (int) (pow(((double) r / 255), ebcg->gamma) * 255);
bb = (int)(pow(((double)b / 255), ebcg->gamma) * 255);
gg = (int)(pow(((double)g / 255), ebcg->gamma) * 255);
rr = (int)(pow(((double)r / 255), ebcg->gamma) * 255);
bb = ephoto_normalize_color(bb);
gg = ephoto_normalize_color(gg);
rr = ephoto_normalize_color(rr);
@ -387,6 +387,7 @@ ephoto_bcg_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent, Evas_Obje
return;
error:
error:
return;
}

View File

@ -48,10 +48,10 @@ _ephoto_apply_color_adjustment(Ephoto_Color *eco, unsigned int *image_data, int
p2 = im_data_new + (y * eco->w);
for (x = 0; x < eco->w; x++)
{
b = (int) ((*p1) & 0xff);
g = (int) ((*p1 >> 8) & 0xff);
r = (int) ((*p1 >> 16) & 0xff);
a = (int) ((*p1 >> 24) & 0xff);
b = (int)((*p1) & 0xff);
g = (int)((*p1 >> 8) & 0xff);
r = (int)((*p1 >> 16) & 0xff);
a = (int)((*p1 >> 24) & 0xff);
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
@ -59,19 +59,22 @@ _ephoto_apply_color_adjustment(Ephoto_Color *eco, unsigned int *image_data, int
{
case EPHOTO_COLOR_ADJUST_RED:
eco->red = adjust;
cc = (int) r + eco->red;
cc = (int)r + eco->red;
r = cc;
break;
case EPHOTO_COLOR_ADJUST_BLUE:
eco->blue = adjust;
cc = (int) b + eco->blue;
cc = (int)b + eco->blue;
b = cc;
break;
case EPHOTO_COLOR_ADJUST_GREEN:
eco->green = adjust;
cc = (int) g + eco->green;
cc = (int)g + eco->green;
g = cc;
break;
default:
break;
}
@ -300,6 +303,7 @@ ephoto_color_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent, Evas_Ob
return;
error:
error:
return;
}

View File

@ -286,7 +286,8 @@ _config_slideshow(Ephoto *ephoto, Evas_Object *parent)
hoversel = elm_hoversel_add(table);
elm_hoversel_hover_parent_set(hoversel, ephoto->win);
EINA_LIST_FOREACH(transitions, l,
transition) elm_hoversel_item_add(hoversel, transition, NULL, 0,
transition)
elm_hoversel_item_add(hoversel, transition, NULL, 0,
_hv_select, transition);
elm_hoversel_item_add(hoversel, "none", NULL, 0, _hv_select, NULL);
elm_object_text_set(hoversel, ephoto->config->slideshow_transition);
@ -297,8 +298,6 @@ _config_slideshow(Ephoto *ephoto, Evas_Object *parent)
ephoto->config->slide_trans = hoversel;
}
static Evas_Object *
_config_settings(Ephoto *ephoto, Evas_Object *parent, Eina_Bool slideshow)
{
@ -662,7 +661,7 @@ _ephoto_on_config_save(void *data)
if (!ecore_file_mv(buf2, buf))
goto save_end;
save_end:
save_end:
ecore_file_unlink(buf2);
return ECORE_CALLBACK_CANCEL;
@ -817,8 +816,8 @@ ephoto_config_init(Ephoto *ephoto)
ephoto->config->config_version = CONFIG_VERSION;
ephoto->config->slideshow_timeout = 4.0;
ephoto->config->slideshow_transition = eina_stringshare_add("fade");
ephoto->config->window_width = 900*elm_config_scale_get();
ephoto->config->window_height = 500*elm_config_scale_get();
ephoto->config->window_width = 900 * elm_config_scale_get();
ephoto->config->window_height = 500 * elm_config_scale_get();
ephoto->config->fsel_hide = 0;
ephoto->config->left_size = .25;
ephoto->config->right_size = .25;

View File

@ -36,8 +36,8 @@ _calculate_cropper_size(void *data, Evas_Object *obj EINA_UNUSED,
"ephoto.swallow.cropper", 0, 0, &cw, &ch);
evas_object_image_size_get(ec->image, &iw, &ih);
scalew = (double) cw / (double) w;
scaleh = (double) ch / (double) h;
scalew = (double)cw / (double)w;
scaleh = (double)ch / (double)h;
nw = iw * scalew;
nh = ih * scaleh;
@ -70,7 +70,7 @@ _cropper_changed_width(void *data, Evas_Object *obj EINA_UNUSED,
edje_object_part_geometry_get(elm_layout_edje_get(ec->layout),
"ephoto.swallow.cropper", &cx, 0, &cw, 0);
evas_object_image_size_get(ec->image, &iw, 0);
scalew = (double) mw / (double) iw;
scalew = (double)mw / (double)iw;
nw = lw * scalew;
left = (nw - cw) / 2;
@ -122,7 +122,7 @@ _cropper_changed_height(void *data, Evas_Object *obj EINA_UNUSED,
"ephoto.swallow.cropper", 0, &cy, 0, &ch);
evas_object_image_size_get(ec->image, 0, &ih);
scaleh = (double) mh / (double) ih;
scaleh = (double)mh / (double)ih;
nh = lh * scaleh;
top = (nh - ch) / 2;
bottom = (nh - ch) / 2;
@ -192,10 +192,10 @@ _apply_crop(void *data, Evas_Object *obj EINA_UNUSED,
idata =
evas_object_image_data_get(ec->image, EINA_FALSE);
scalex = (double) (cx-x) / (double) w;
scaley = (double) (cy-y) / (double) h;
scalew = (double) cw / (double) w;
scaleh = (double) ch / (double) h;
scalex = (double)(cx - x) / (double)w;
scaley = (double)(cy - y) / (double)h;
scalew = (double)cw / (double)w;
scaleh = (double)ch / (double)h;
nx = iw * scalex;
ny = ih * scaley;
@ -541,7 +541,7 @@ _image_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
if (sw > sh)
{
nw = sw;
nh = ih * ((double) sw / (double) iw);
nh = ih * ((double)sw / (double)iw);
if (nh > sh)
{
Evas_Coord onw, onh;
@ -549,13 +549,13 @@ _image_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
onw = nw;
onh = nh;
nh = sh;
nw = onw * ((double) nh / (double) onh);
nw = onw * ((double)nh / (double)onh);
}
}
else
{
nh = sh;
nw = iw * ((double) sh / (double) ih);
nw = iw * ((double)sh / (double)ih);
if (nw > sw)
{
Evas_Coord onw, onh;
@ -563,7 +563,7 @@ _image_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
onw = nw;
onh = nh;
nw = sw;
nh = onh * ((double) nw / (double) onw);
nh = onh * ((double)nw / (double)onw);
}
}
diffw = sw - nw;
@ -743,6 +743,7 @@ ephoto_cropper_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
return;
error:
error:
return;
}

View File

@ -35,14 +35,14 @@ struct _Ephoto_Directory_Browser
int count;
int processed;
} animator;
Eina_Bool main_deleted:1;
Eina_Bool main_deleted : 1;
const char *back_directory;
};
static Elm_Genlist_Item_Class *_ephoto_dir_class;
static Elm_Genlist_Item_Class *_ephoto_dir_tree_class;
static char * _drag_data_extract(char **drag_data);
static char *_drag_data_extract(char **drag_data);
static Eina_Bool _monitor_cb(void *data, int type,
void *event);
@ -474,7 +474,7 @@ _dir_go_trash(void *data, Evas_Object *obj EINA_UNUSED,
elm_genlist_highlight_mode_set(db->fsel, EINA_TRUE);
EPHOTO_EXPAND(db->fsel);
EPHOTO_FILL(db->fsel);
evas_object_size_hint_min_set(db->fsel, 195*elm_config_scale_get(), 0);
evas_object_size_hint_min_set(db->fsel, 195 * elm_config_scale_get(), 0);
evas_object_smart_callback_add(db->fsel, "expand,request",
_on_list_expand_req, db);
evas_object_smart_callback_add(db->fsel, "contract,request",
@ -652,7 +652,6 @@ _fsel_mouse_up_cb(void *data, Evas *e EINA_UNUSED,
if (info->button != 3)
return;
if (item)
elm_genlist_item_selected_set(item, EINA_TRUE);
@ -708,7 +707,7 @@ _ephoto_directory_view_add(Ephoto_Directory_Browser *db)
elm_genlist_highlight_mode_set(db->fsel, EINA_TRUE);
EPHOTO_EXPAND(db->fsel);
EPHOTO_FILL(db->fsel);
evas_object_size_hint_min_set(db->fsel, 195*elm_config_scale_get(), 0);
evas_object_size_hint_min_set(db->fsel, 195 * elm_config_scale_get(), 0);
evas_object_smart_callback_add(db->fsel, "expand,request",
_on_list_expand_req, db);
evas_object_smart_callback_add(db->fsel, "contract,request",
@ -1145,7 +1144,8 @@ _ephoto_main_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
_todo_items_free(db);
elm_drop_item_container_del(db->fsel);
EINA_LIST_FREE(db->handlers, handler) ecore_event_handler_del(handler);
EINA_LIST_FREE(db->handlers, handler)
ecore_event_handler_del(handler);
if (db->animator.todo_items)
{
ecore_animator_del(db->animator.todo_items);
@ -1276,7 +1276,7 @@ ephoto_directory_browser_initialize_structure(Ephoto *ephoto)
if (strncmp(finfo->path + finfo->name_start, ".", 1))
{
Ephoto_Entry *entry = ephoto_entry_new(ephoto, finfo->path,
finfo->path+finfo->name_start, finfo->type);
finfo->path + finfo->name_start, finfo->type);
entry->parent = cur;
if (entry->is_dir && !entry->item)
{
@ -1370,7 +1370,7 @@ ephoto_directory_browser_add(Ephoto *ephoto, Evas_Object *parent)
db->main = box;
elm_box_horizontal_set(db->main, EINA_FALSE);
evas_object_size_hint_min_set(db->main, 195*elm_config_scale_get(), 0);
evas_object_size_hint_min_set(db->main, 195 * elm_config_scale_get(), 0);
evas_object_event_callback_add(db->main, EVAS_CALLBACK_DEL,
_ephoto_main_del, db);
evas_object_data_set(db->main, "directory_browser", db);
@ -1399,7 +1399,8 @@ ephoto_directory_browser_add(Ephoto *ephoto, Evas_Object *parent)
return db->main;
error:
error:
evas_object_del(db->main);
return NULL;
}

View File

@ -45,8 +45,8 @@ ephoto_editor_add(Ephoto *ephoto, Evas_Object *parent, const char *title, const
evas_object_show(box);
ic = elm_icon_add(box);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "edit-undo");
@ -60,8 +60,8 @@ ephoto_editor_add(Ephoto *ephoto, Evas_Object *parent, const char *title, const
evas_object_show(button);
ic = elm_icon_add(box);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "document-save");
@ -75,8 +75,8 @@ ephoto_editor_add(Ephoto *ephoto, Evas_Object *parent, const char *title, const
evas_object_show(button);
ic = elm_icon_add(box);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "window-close");

View File

@ -16,7 +16,6 @@ _complete(Ephoto *ephoto, const char *title, const char *text)
{
Evas_Object *popup, *box, *label, *ic, *button;
popup = elm_popup_add(ephoto->win);
elm_object_part_text_set(popup, "title,text", title);
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
@ -254,7 +253,8 @@ _upload_image_complete_cb(void *data, int ev_type EINA_UNUSED, void *event)
evas_object_show(popup);
EINA_LIST_FREE(ephoto->upload_handlers,
handler) ecore_event_handler_del(handler);
handler)
ecore_event_handler_del(handler);
if (!ephoto->url_ret || ev->status != 200)
{
@ -315,7 +315,7 @@ _upload_image_cb(void *data, int ev_type EINA_UNUSED, void *event)
{
Ephoto *ephoto = data;
Ecore_Con_Event_Url_Data *ev = event;
const char *string = (const char *) ev->data;
const char *string = (const char *)ev->data;
if (ev->url_con != ephoto->url_up)
return EINA_TRUE;
@ -442,7 +442,7 @@ _rename_confirm(void *data, Evas_Object *obj EINA_UNUSED,
snprintf(new_file_name, PATH_MAX, "%s/%s", ecore_file_dir_get(dir), text);
else
snprintf(new_file_name, PATH_MAX, "%s/%s.%s", ecore_file_dir_get(dir), escaped,
strrchr(dir, '.')+1);
strrchr(dir, '.') + 1);
ret = ecore_file_mv(file, new_file_name);
if (!ret)
{
@ -481,7 +481,6 @@ _rename_file(Ephoto *ephoto, const char *file)
Evas_Object *popup, *box, *entry, *button, *ic;
char buf[PATH_MAX], *bn, *string;
popup = elm_popup_add(ephoto->win);
if (ecore_file_is_dir(file))
elm_object_part_text_set(popup, "title, text", _("Rename Directory"));
@ -937,7 +936,7 @@ _prompt_upload_apply(void *data, Evas_Object *obj EINA_UNUSED,
return;
}
rewind(f);
fdata = malloc(fsize+1);
fdata = malloc(fsize + 1);
res = fread(fdata, fsize, 1, f);
if (res < 1) CRIT("fread() failed on file '%s': %s", entry->path, strerror(errno));
fdata[fsize] = '\0';
@ -1019,7 +1018,7 @@ _prompt_save_image_as_apply(void *data, Evas_Object *obj, void *event_info)
}
else
{
ext = eina_stringshare_add((strrchr(selected, '.')+1));
ext = eina_stringshare_add((strrchr(selected, '.') + 1));
if (ext)
{
if (!_ephoto_file_image_can_save(ext))
@ -1043,7 +1042,6 @@ _prompt_save_image_as_apply(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *popup, *ic, *button;
popup = _prompt(ephoto, _("Overwrite Image"),
_("Are you sure you want to overwrite this image?"));
@ -1164,7 +1162,7 @@ ephoto_file_save_image(Ephoto *ephoto, Ephoto_Entry *entry, Evas_Object *image)
{
Evas_Object *popup, *ic, *button;
if (!_ephoto_file_image_can_save(strrchr(entry->label, '.')+1))
if (!_ephoto_file_image_can_save(strrchr(entry->label, '.') + 1))
{
_complete(ephoto, _("Save Failed"),
_("Error: Image could not be saved here!"));

View File

@ -25,7 +25,7 @@ struct _Ephoto_Filter
Ephoto *ephoto;
Evas_Object *image;
Evas_Object *popup;
Ecore_Thread *thread;;
Ecore_Thread *thread;
Eina_List *queue;
Evas_Coord w;
Evas_Coord h;
@ -180,12 +180,12 @@ _thread_finished_cb(void *data, Ecore_Thread *th EINA_UNUSED)
free(ef->cdf);
ef->cdf = NULL;
ef->qpos++;
if (ef->qpos-1 < ef->qcount)
if (ef->qpos - 1 < ef->qcount)
{
free(ef->im_data_new);
ef->im_data_new = NULL;
ef->im_data_new = malloc(sizeof(unsigned int) * ef->w * ef->h);
ef->thread = ecore_thread_run(eina_list_nth(ef->queue, ef->qpos-1),
ef->thread = ecore_thread_run(eina_list_nth(ef->queue, ef->qpos - 1),
_thread_finished_cb, NULL, ef);
}
else
@ -231,7 +231,7 @@ _blur_vertical(Ephoto_Filter *ef, double rad)
as[i] = (ef->im_data[i] >> 24) & 0xff;
}
iarr = (double) 1 / (rad + rad + 1);
iarr = (double)1 / (rad + rad + 1);
for (y = 0; y < h; y++)
{
int t, l, rr;
@ -274,10 +274,10 @@ _blur_vertical(Ephoto_Filter *ef, double rad)
valr += rs[r] - fr;
vala += as[r] - fa;
bt = (int) round(valb * iarr);
gt = (int) round(valg * iarr);
rt = (int) round(valr * iarr);
at = (int) round(vala * iarr);
bt = (int)round(valb * iarr);
gt = (int)round(valg * iarr);
rt = (int)round(valr * iarr);
at = (int)round(vala * iarr);
bt = ephoto_normalize_color(bt);
gt = ephoto_normalize_color(gt);
@ -296,10 +296,10 @@ _blur_vertical(Ephoto_Filter *ef, double rad)
valr += rs[r] - rs[ll];
vala += as[r] - as[ll];
bt = (int) round(valb * iarr);
gt = (int) round(valg * iarr);
rt = (int) round(valr * iarr);
at = (int) round(vala * iarr);
bt = (int)round(valb * iarr);
gt = (int)round(valg * iarr);
rt = (int)round(valr * iarr);
at = (int)round(vala * iarr);
bt = ephoto_normalize_color(bt);
gt = ephoto_normalize_color(gt);
rt = ephoto_normalize_color(rt);
@ -316,10 +316,10 @@ _blur_vertical(Ephoto_Filter *ef, double rad)
valr += lvr - rs[ll];
vala += lva - as[ll];
bt = (int) round(valb * iarr);
gt = (int) round(valg * iarr);
rt = (int) round(valr * iarr);
at = (int) round(vala * iarr);
bt = (int)round(valb * iarr);
gt = (int)round(valg * iarr);
rt = (int)round(valr * iarr);
at = (int)round(vala * iarr);
bt = ephoto_normalize_color(bt);
gt = ephoto_normalize_color(gt);
rt = ephoto_normalize_color(rt);
@ -399,10 +399,10 @@ _blur_horizontal(Ephoto_Filter *ef, double rad)
valr += rs[rr] - fr;
vala += as[rr] - fa;
bt = (int) round(valb * iarr);
gt = (int) round(valg * iarr);
rt = (int) round(valr * iarr);
at = (int) round(vala * iarr);
bt = (int)round(valb * iarr);
gt = (int)round(valg * iarr);
rt = (int)round(valr * iarr);
at = (int)round(vala * iarr);
bt = ephoto_normalize_color(bt);
gt = ephoto_normalize_color(gt);
rt = ephoto_normalize_color(rt);
@ -418,12 +418,12 @@ _blur_horizontal(Ephoto_Filter *ef, double rad)
valb += bs[rr] - bs[l];
valg += gs[rr] - gs[l];
valr += rs[rr] - rs[l];
vala += as[rr] - as[l];;
vala += as[rr] - as[l];
bt = (int) round(valb * iarr);
gt = (int) round(valg * iarr);
rt = (int) round(valr * iarr);
at = (int) round(vala * iarr);
bt = (int)round(valb * iarr);
gt = (int)round(valg * iarr);
rt = (int)round(valr * iarr);
at = (int)round(vala * iarr);
bt = ephoto_normalize_color(bt);
gt = ephoto_normalize_color(gt);
rt = ephoto_normalize_color(rt);
@ -442,10 +442,10 @@ _blur_horizontal(Ephoto_Filter *ef, double rad)
valr += lvr - rs[l];
vala += lva - as[l];
bt = (int) round(valb * iarr);
gt = (int) round(valg * iarr);
rt = (int) round(valr * iarr);
at = (int) round(vala * iarr);
bt = (int)round(valb * iarr);
gt = (int)round(valg * iarr);
rt = (int)round(valr * iarr);
at = (int)round(vala * iarr);
bt = ephoto_normalize_color(bt);
gt = ephoto_normalize_color(gt);
rt = ephoto_normalize_color(rt);
@ -521,19 +521,19 @@ _sharpen(void *data, Ecore_Thread *th EINA_UNUSED)
p3 = ef->im_data_new + (y * w);
for (x = 1; x < (w - 1); x++)
{
b = (int) (*p1 & 0xff);
g = (int) ((*p1 >> 8) & 0xff);
r = (int) ((*p1 >> 16) & 0xff);
a = (int) ((*p1 >> 24) & 0xff);
bb = (int) (*p2 & 0xff);
gg = (int) ((*p2 >> 8) & 0xff);
rr = (int) ((*p2 >> 16) & 0xff);
aa = (int) ((*p2 >> 24) & 0xff);
b = (int)(*p1 & 0xff);
g = (int)((*p1 >> 8) & 0xff);
r = (int)((*p1 >> 16) & 0xff);
a = (int)((*p1 >> 24) & 0xff);
bb = (int)(*p2 & 0xff);
gg = (int)((*p2 >> 8) & 0xff);
rr = (int)((*p2 >> 16) & 0xff);
aa = (int)((*p2 >> 24) & 0xff);
bbb = (int) ((2 * bb) - b);
ggg = (int) ((2 * gg) - g);
rrr = (int) ((2 * rr) - r);
aaa = (int) ((2 * aa) - a);
bbb = (int)((2 * bb) - b);
ggg = (int)((2 * gg) - g);
rrr = (int)((2 * rr) - r);
aaa = (int)((2 * aa) - a);
bbb = ephoto_normalize_color(bbb);
ggg = ephoto_normalize_color(ggg);
@ -588,7 +588,7 @@ _dither(void *data, Ecore_Thread *th EINA_UNUSED)
errg = g - gg;
errr = r - rr;
if ((x+1) < w)
if ((x + 1) < w)
{
index = y * w + x + 1;
b = (ef->im_data_new[index] & 0xff);
@ -610,7 +610,7 @@ _dither(void *data, Ecore_Thread *th EINA_UNUSED)
ef->im_data_new[index] = (a << 24) | (rr << 16) |
(gg << 8) | bb;
}
if (x > 0 && (y+1) < h)
if (x > 0 && (y + 1) < h)
{
index = (y + 1) * w + (x - 1);
b = (ef->im_data_new[index] & 0xff);
@ -632,7 +632,7 @@ _dither(void *data, Ecore_Thread *th EINA_UNUSED)
ef->im_data_new[index] = (a << 24) | (rr << 16) |
(gg << 8) | bb;
}
if ((y+1) < h)
if ((y + 1) < h)
{
index = (y + 1) * w + x;
b = (ef->im_data_new[index] & 0xff);
@ -654,7 +654,7 @@ _dither(void *data, Ecore_Thread *th EINA_UNUSED)
ef->im_data_new[index] = (a << 24) | (rr << 16) |
(gg << 8) | bb;
}
if ((y+1) < h && (x+1) < w)
if ((y + 1) < h && (x + 1) < w)
{
index = (y + 1) * w + (x + 1);
b = (ef->im_data_new[index] & 0xff);
@ -694,14 +694,14 @@ _grayscale(void *data, Ecore_Thread *th EINA_UNUSED)
for (x = 0; x < w; x++)
{
i = y * w + x;
b = (int) ((ef->im_data[i]) & 0xff);
g = (int) ((ef->im_data[i] >> 8) & 0xff);
r = (int) ((ef->im_data[i] >> 16) & 0xff);
a = (int) ((ef->im_data[i] >> 24) & 0xff);
b = (int)((ef->im_data[i]) & 0xff);
g = (int)((ef->im_data[i] >> 8) & 0xff);
r = (int)((ef->im_data[i] >> 16) & 0xff);
a = (int)((ef->im_data[i] >> 24) & 0xff);
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
gray = (int) ((0.3 * r) + (0.59 * g) + (0.11 * b));
gray = (int)((0.3 * r) + (0.59 * g) + (0.11 * b));
if (a >= 0 && a < 255)
gray = (gray * a) / 255;
ef->im_data_new[i] = (a << 24) | (gray << 16) | (gray << 8) | gray;
@ -731,11 +731,11 @@ _sepia(void *data, Ecore_Thread *th EINA_UNUSED)
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
rr = (int) ((r * .393) + (g * .769) + (b * .189));
rr = (int)((r * .393) + (g * .769) + (b * .189));
rr = ephoto_normalize_color(rr);
gg = ((r * .349) + (g * .686) + (b * .168));
gg = ephoto_normalize_color(gg);
bb = (int) ((r * .272) + (g * .534) + (b * .131));
bb = (int)((r * .272) + (g * .534) + (b * .131));
bb = ephoto_normalize_color(bb);
bb = ephoto_demul_color_alpha(bb, a);
gg = ephoto_demul_color_alpha(gg, a);
@ -900,8 +900,8 @@ _sobel(void *data, Ecore_Thread *th EINA_UNUSED)
index = (y + i) * w + x + j;
pix = ef->im_data[index];
hpval += pix * sobx[i+1][j+1];
vpval += pix * soby[i+1][j+1];
hpval += pix * sobx[i + 1][j + 1];
vpval += pix * soby[i + 1][j + 1];
}
}
}
@ -949,14 +949,14 @@ _emboss(void *data, Ecore_Thread *th EINA_UNUSED)
int index, pix;
index = (y + i) * w + x + j;
pix = ef->im_data[index];
bb += (int) ((pix) & 0xff) *
emboss[i+1][j+1];
gg += (int) ((pix >> 8) & 0xff) *
emboss[i+1][j+1];
rr += (int) ((pix >> 16) & 0xff) *
emboss[i+1][j+1];
aa += (int) ((pix >> 24) & 0xff) *
emboss[i+1][j+1];
bb += (int)((pix) & 0xff) *
emboss[i + 1][j + 1];
gg += (int)((pix >> 8) & 0xff) *
emboss[i + 1][j + 1];
rr += (int)((pix >> 16) & 0xff) *
emboss[i + 1][j + 1];
aa += (int)((pix >> 24) & 0xff) *
emboss[i + 1][j + 1];
}
}
}
@ -997,7 +997,7 @@ _histogram_eq(void *data, Ecore_Thread *th EINA_UNUSED)
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
evas_color_rgb_to_hsv(r, g, b, &hh, &s, &v);
norm = (int) round((double) v * (double) 255);
norm = (int)round((double)v * (double)255);
ef->hist[norm] += 1;
p1++;
}
@ -1005,9 +1005,9 @@ _histogram_eq(void *data, Ecore_Thread *th EINA_UNUSED)
sum = 0;
for (i = 0; i < 256; i++)
{
sum += ((double) ef->hist[i] /
(double) total);
ef->cdf[i] = (int) round(sum * 255);
sum += ((double)ef->hist[i] /
(double)total);
ef->cdf[i] = (int)round(sum * 255);
}
for (y = 0; y < h; y++)
{
@ -1023,8 +1023,8 @@ _histogram_eq(void *data, Ecore_Thread *th EINA_UNUSED)
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
evas_color_rgb_to_hsv(r, g, b, &hh, &s, &v);
norm = (int) round((double) v * (double) 255);
nv = (float) ef->cdf[norm] / (float) 255;
norm = (int)round((double)v * (double)255);
nv = (float)ef->cdf[norm] / (float)255;
evas_color_hsv_to_rgb(hh, s, nv, &rr, &gg, &bb);
bb = ephoto_normalize_color(bb);
gg = ephoto_normalize_color(gg);
@ -1132,7 +1132,8 @@ ephoto_filter_painting(Ephoto *ephoto, Evas_Object *image)
NULL, ef);
}
void ephoto_filter_invert(Ephoto *ephoto, Evas_Object *image)
void
ephoto_filter_invert(Ephoto *ephoto, Evas_Object *image)
{
Ephoto_Filter *ef = _initialize_filter(EPHOTO_IMAGE_FILTER_INVERT,
ephoto, image);
@ -1142,7 +1143,8 @@ void ephoto_filter_invert(Ephoto *ephoto, Evas_Object *image)
NULL, ef);
}
void ephoto_filter_sketch(Ephoto *ephoto, Evas_Object *image)
void
ephoto_filter_sketch(Ephoto *ephoto, Evas_Object *image)
{
Ephoto_Filter *ef = _initialize_filter(EPHOTO_IMAGE_FILTER_SKETCH,
ephoto, image);
@ -1158,7 +1160,8 @@ void ephoto_filter_sketch(Ephoto *ephoto, Evas_Object *image)
NULL, ef);
}
void ephoto_filter_edge(Ephoto *ephoto, Evas_Object *image)
void
ephoto_filter_edge(Ephoto *ephoto, Evas_Object *image)
{
Ephoto_Filter *ef = _initialize_filter(EPHOTO_IMAGE_FILTER_SOBEL,
ephoto, image);
@ -1173,7 +1176,8 @@ void ephoto_filter_edge(Ephoto *ephoto, Evas_Object *image)
NULL, ef);
}
void ephoto_filter_emboss(Ephoto *ephoto, Evas_Object *image)
void
ephoto_filter_emboss(Ephoto *ephoto, Evas_Object *image)
{
Ephoto_Filter *ef = _initialize_filter(EPHOTO_IMAGE_FILTER_EMBOSS,
ephoto, image);
@ -1196,3 +1200,4 @@ ephoto_filter_histogram_eq(Ephoto *ephoto, Evas_Object *image)
ef->thread = ecore_thread_run(_histogram_eq, _thread_finished_cb,
NULL, ef);
}

View File

@ -41,10 +41,10 @@ _ephoto_hsv_adjust_hue(Ephoto_HSV *ehsv, double hue, unsigned int *image_data)
p2 = im_data_new + (y * ehsv->w);
for (x = 0; x < ehsv->w; x++)
{
b = (int) ((*p1) & 0xff);
g = (int) ((*p1 >> 8) & 0xff);
r = (int) ((*p1 >> 16) & 0xff);
a = (int) ((*p1 >> 24) & 0xff);
b = (int)((*p1) & 0xff);
g = (int)((*p1 >> 8) & 0xff);
r = (int)((*p1 >> 16) & 0xff);
a = (int)((*p1 >> 24) & 0xff);
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
@ -97,15 +97,15 @@ _ephoto_hsv_adjust_saturation(Ephoto_HSV *ehsv, double saturation,
p2 = im_data_new + (y * ehsv->w);
for (x = 0; x < ehsv->w; x++)
{
b = (int) ((*p1) & 0xff);
g = (int) ((*p1 >> 8) & 0xff);
r = (int) ((*p1 >> 16) & 0xff);
a = (int) ((*p1 >> 24) & 0xff);
b = (int)((*p1) & 0xff);
g = (int)((*p1 >> 8) & 0xff);
r = (int)((*p1 >> 16) & 0xff);
a = (int)((*p1 >> 24) & 0xff);
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
evas_color_rgb_to_hsv(r, g, b, &hh, &s, &v);
s += s * ((float) saturation / 100);
s += s * ((float)saturation / 100);
if (s < 0)
s = 0;
if (s > 1)
@ -153,15 +153,15 @@ _ephoto_hsv_adjust_value(Ephoto_HSV *ehsv, double value,
p2 = im_data_new + (y * ehsv->w);
for (x = 0; x < ehsv->w; x++)
{
b = (int) ((*p1) & 0xff);
g = (int) ((*p1 >> 8) & 0xff);
r = (int) ((*p1 >> 16) & 0xff);
a = (int) ((*p1 >> 24) & 0xff);
b = (int)((*p1) & 0xff);
g = (int)((*p1 >> 8) & 0xff);
r = (int)((*p1 >> 16) & 0xff);
a = (int)((*p1 >> 24) & 0xff);
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
evas_color_rgb_to_hsv(r, g, b, &hh, &s, &v);
v += (v * ((float) value / 100));
v += (v * ((float)value / 100));
if (v < 0)
v = 0;
if (v > 1)
@ -393,6 +393,7 @@ ephoto_hsv_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent, Evas_Obje
_hsv_cancel, ehsv));
return;
error:
error:
return;
}

View File

@ -1,6 +1,6 @@
#include "ephoto.h"
#undef ERR
#define ERR(...) do { printf(__VA_ARGS__); putc('\n', stdout); } while(0)
#define ERR(...) do { printf(__VA_ARGS__); putc('\n', stdout); } while (0)
#ifdef USE_IPC
/* local subsystem functions */

View File

@ -12,7 +12,7 @@ int EPHOTO_EVENT_EDITOR_BACK = 0;
typedef struct _Ephoto_Entry_Free_Listener Ephoto_Entry_Free_Listener;
struct _Ephoto_Entry_Free_Listener
{
void (*cb) (void *data, const Ephoto_Entry *dead);
void (*cb)(void *data, const Ephoto_Entry *dead);
const void *data;
};
@ -302,7 +302,6 @@ _slideshow_icon_clicked(void *data, Evas_Object *obj EINA_UNUSED,
ephoto_single_browser_slideshow(ephoto->single_browser);
}
static void
_settings_icon_clicked(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
@ -459,8 +458,8 @@ ephoto_window_add(const char *path)
evas_object_show(ephoto->dir_browser);
ephoto->statusbar = elm_box_add(ephoto->main);
evas_object_size_hint_min_set(ephoto->statusbar, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ephoto->statusbar, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
elm_box_horizontal_set(ephoto->statusbar, EINA_TRUE);
EPHOTO_WEIGHT(ephoto->statusbar, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
EPHOTO_FILL(ephoto->statusbar);
@ -468,8 +467,8 @@ ephoto_window_add(const char *path)
evas_object_show(ephoto->statusbar);
ic = elm_icon_add(ephoto->statusbar);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
ret = elm_icon_standard_set(ic, "folder");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
ephoto->folders_icon = ic;
@ -511,8 +510,8 @@ ephoto_window_add(const char *path)
evas_object_show(ephoto->controls_right);
ic = elm_icon_add(ephoto->statusbar);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
ret = elm_icon_standard_set(ic, "media-playback-start");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
@ -528,8 +527,8 @@ ephoto_window_add(const char *path)
evas_object_show(but);
ic = elm_icon_add(ephoto->statusbar);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
ret = elm_icon_standard_set(ic, "preferences-other");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
@ -545,8 +544,8 @@ ephoto_window_add(const char *path)
evas_object_show(but);
ic = elm_icon_add(ephoto->statusbar);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
ret = elm_icon_standard_set(ic, "application-exit");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
@ -669,8 +668,10 @@ ephoto_entries_cmp(const void *pa, const void *pb)
{
case EPHOTO_SORT_ALPHABETICAL_ASCENDING:
return i;
case EPHOTO_SORT_ALPHABETICAL_DESCENDING:
return i * -1;
case EPHOTO_SORT_MODTIME_ASCENDING:
if (moda < modb)
return -1;
@ -678,6 +679,7 @@ ephoto_entries_cmp(const void *pa, const void *pb)
return 1;
else
return i;
case EPHOTO_SORT_MODTIME_DESCENDING:
if (moda < modb)
return 1;
@ -685,11 +687,13 @@ ephoto_entries_cmp(const void *pa, const void *pb)
return -1;
else
return i * -1;
case EPHOTO_SORT_SIMILARITY:
if (!a->sort_id || !b->sort_id)
return 0;
else
return strcmp(a->sort_id, b->sort_id);
default:
return i;
}
@ -989,7 +993,7 @@ _thumb_gen_size_changed_timer_cb(void *data)
ephoto->thumb_gen_size);
e_thumb_icon_rethumb(o);
}
end:
end:
ephoto->timer.thumb_regen = NULL;
return EINA_FALSE;
}
@ -1179,7 +1183,7 @@ ephoto_entry_free(Ephoto *ephoto, Ephoto_Entry *entry)
EINA_LIST_FREE(entry->free_listeners, fl)
{
fl->cb((void *) fl->data, entry);
fl->cb((void *)fl->data, entry);
free(fl);
}
if (!entry->is_dir)
@ -1207,7 +1211,7 @@ ephoto_entry_free(Ephoto *ephoto, Ephoto_Entry *entry)
}
void
ephoto_entry_free_listener_add(Ephoto_Entry *entry, void (*cb) (void *data,
ephoto_entry_free_listener_add(Ephoto_Entry *entry, void (*cb)(void *data,
const Ephoto_Entry *entry), const void *data)
{
Ephoto_Entry_Free_Listener *fl;
@ -1219,7 +1223,7 @@ ephoto_entry_free_listener_add(Ephoto_Entry *entry, void (*cb) (void *data,
}
void
ephoto_entry_free_listener_del(Ephoto_Entry *entry, void (*cb) (void *data,
ephoto_entry_free_listener_del(Ephoto_Entry *entry, void (*cb)(void *data,
const Ephoto_Entry *entry), const void *data)
{
Eina_List *l;
@ -1248,3 +1252,4 @@ ephoto_entries_free(Ephoto *ephoto)
ephoto_entry_free(ephoto, entry);
ephoto->entries = NULL;
}

View File

@ -30,14 +30,14 @@ _reye_clicked(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
evas_pointer_canvas_xy_get(evas_object_evas_get(er->image), &xpos, &ypos);
evas_object_geometry_get(er->image, &imx, &imy, &imw, &imh);
xadj = xpos-imx;
yadj = ypos-imy;
xadj = xpos - imx;
yadj = ypos - imy;
if (xadj < 0) xadj = 0;
if (yadj < 0) yadj = 0;
scalex = (double) (xadj) / (double) imw;
scaley = (double) (yadj) / (double) imh;
scalex = (double)(xadj) / (double)imw;
scaley = (double)(yadj) / (double)imh;
nx = er->w * scalex;
ny = er->h * scaley;
@ -63,14 +63,14 @@ _reye_clicked(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
nny = ny + yy;
p1 = im_data + (nny * er->w) + nnx;
b = (int) ((*p1) & 0xff);
g = (int) ((*p1 >> 8) & 0xff);
r = (int) ((*p1 >> 16) & 0xff);
a = (int) ((*p1 >> 24) & 0xff);
b = (int)((*p1) & 0xff);
g = (int)((*p1 >> 8) & 0xff);
r = (int)((*p1 >> 16) & 0xff);
a = (int)((*p1 >> 24) & 0xff);
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
r = (int) ((g+b)/2);
r = (int)((g + b) / 2);
b = ephoto_normalize_color(b);
g = ephoto_normalize_color(g);
r = ephoto_normalize_color(r);
@ -241,6 +241,7 @@ ephoto_red_eye_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent, Evas_
return;
error:
error:
return;
}

View File

@ -196,7 +196,7 @@ ephoto_scale_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
es->image = image;
snprintf(buf, PATH_MAX, "%s/temp.%s", ephoto->config_path,
strrchr(file, '.')+1);
strrchr(file, '.') + 1);
es->tmp_file = eina_stringshare_add(buf);
if (ecore_file_exists(es->tmp_file))
ecore_file_unlink(es->tmp_file);
@ -269,7 +269,7 @@ ephoto_scale_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
return;
error:
error:
return;
}

View File

@ -26,8 +26,8 @@ struct _Ephoto_Single_Browser
Eina_List *entries;
Eina_List *history;
unsigned int history_pos;
Eina_Bool editing:1;
Eina_Bool cropping:1;
Eina_Bool editing : 1;
Eina_Bool cropping : 1;
};
struct _Ephoto_Viewer
@ -39,8 +39,8 @@ struct _Ephoto_Viewer
Evas_Object *table;
Evas_Object *image;
double zoom;
Eina_Bool fit:1;
Eina_Bool zoom_first:1;
Eina_Bool fit : 1;
Eina_Bool zoom_first : 1;
double duration;
int frame_count;
int cur_frame;
@ -64,7 +64,7 @@ static void _ephoto_update_bottom_bar(Ephoto_Single_Browser *sb);
/*Main Callbacks*/
static void _ephoto_main_edit_menu(Ephoto_Single_Browser *sb);
static void _ephoto_main_key_down(void *data, Evas *e EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,void *event_info EINA_UNUSED);
Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED);
static void _ephoto_show_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED);
static void _ephoto_main_back(void *data, Evas_Object *obj EINA_UNUSED,
@ -135,7 +135,7 @@ _ephoto_get_file_size(const char *path)
size_t size = eina_file_size_get(f);
eina_file_close(f);
double dsize = (double) size;
double dsize = (double)size;
if (dsize < 1024.0)
snprintf(isize, sizeof(isize), "%'.0f%s", dsize, ngettext("B", "B",
@ -376,8 +376,8 @@ _viewer_zoom_fit_apply(Ephoto_Viewer *v)
EINA_SAFETY_ON_TRUE_RETURN(iw <= 0);
EINA_SAFETY_ON_TRUE_RETURN(ih <= 0);
zx = (double) (cw-15) / (double) iw;
zy = (double) (ch-15) / (double) ih;
zx = (double)(cw - 15) / (double)iw;
zy = (double)(ch - 15) / (double)ih;
zoom = (zx < zy) ? zx : zy;
_viewer_zoom_apply(v, zoom);
@ -511,7 +511,7 @@ _orient_apply(Ephoto_Single_Browser *sb)
evas_object_size_hint_max_set(v->image, w, h);
elm_table_pack(v->table, v->image, 0, 0, 1, 1);
elm_object_content_set(v->scroller, v->table);
if (sb->history_pos < (eina_list_count(sb->history)-1))
if (sb->history_pos < (eina_list_count(sb->history) - 1))
{
int count;
@ -937,7 +937,7 @@ _redo_image(void *data, Evas_Object *obj EINA_UNUSED,
if (!v)
return;
if (sb->history && sb->history_pos < (eina_list_count(sb->history)-1))
if (sb->history && sb->history_pos < (eina_list_count(sb->history) - 1))
{
sb->history_pos++;
eh = eina_list_nth(sb->history, sb->history_pos);
@ -1539,7 +1539,7 @@ _viewer_add(Evas_Object *parent, const char *path, Ephoto_Single_Browser *sb)
_monitor_cb, sb));
return v->scroller;
error:
error:
evas_object_event_callback_del(v->scroller, EVAS_CALLBACK_DEL, _viewer_del);
evas_object_data_del(v->scroller, "viewer");
free(v);
@ -1609,7 +1609,7 @@ _ephoto_single_browser_recalc(Ephoto_Single_Browser *sb)
_ephoto_update_bottom_bar(sb);
ephoto_title_set(sb->ephoto, bname);
if (!_ephoto_file_image_can_save(strrchr(bname, '.')+1))
if (!_ephoto_file_image_can_save(strrchr(bname, '.') + 1))
elm_object_item_disabled_set(sb->save, EINA_TRUE);
else
elm_object_item_disabled_set(sb->save, EINA_FALSE);
@ -1636,8 +1636,8 @@ _edit_function_item_add(Evas_Object *parent, const char *icon, const char *label
Evas_Object *button, *ic;
ic = elm_icon_add(parent);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, icon);
@ -1646,8 +1646,8 @@ _edit_function_item_add(Evas_Object *parent, const char *icon, const char *label
elm_object_tooltip_orient_set(button, ELM_TOOLTIP_ORIENT_LEFT);
elm_object_tooltip_window_mode_set(button, EINA_TRUE);
elm_object_part_content_set(button, "icon", ic);
evas_object_size_hint_min_set(button, 30*elm_config_scale_get(),
30*elm_config_scale_get());
evas_object_size_hint_min_set(button, 30 * elm_config_scale_get(),
30 * elm_config_scale_get());
evas_object_smart_callback_add(button, "clicked", callback, data);
EPHOTO_WEIGHT(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
EPHOTO_FILL(button);
@ -1725,8 +1725,8 @@ _edit_item_add(Evas_Object *parent, Elm_Object_Item *par, const char *icon, cons
if (icon)
{
ic = elm_icon_add(parent);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, icon);
evas_object_data_set(ic, "label", label);
@ -2318,7 +2318,7 @@ ephoto_single_browser_image_data_done(Evas_Object *main,
evas_object_image_data_set(v->image, image_data);
evas_object_image_data_update_add(v->image, 0, 0, w,
h);
if (sb->history_pos < (eina_list_count(sb->history)-1))
if (sb->history_pos < (eina_list_count(sb->history) - 1))
{
int count;
@ -2388,8 +2388,8 @@ ephoto_single_browser_show_controls(Ephoto *ephoto)
evas_object_del(ephoto->view_button);
ic = elm_icon_add(ephoto->statusbar);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
ret = elm_icon_standard_set(ic, "view-list-icons");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
@ -2406,8 +2406,8 @@ ephoto_single_browser_show_controls(Ephoto *ephoto)
ephoto->view_button = but;
ic = elm_icon_add(ephoto->controls_left);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
ret = elm_icon_standard_set(ic, "zoom-in");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
@ -2422,8 +2422,8 @@ ephoto_single_browser_show_controls(Ephoto *ephoto)
evas_object_show(but);
ic = elm_icon_add(ephoto->controls_left);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
elm_icon_standard_set(ic, "zoom-out");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
@ -2438,8 +2438,8 @@ ephoto_single_browser_show_controls(Ephoto *ephoto)
evas_object_show(but);
ic = elm_icon_add(ephoto->controls_left);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
ret = elm_icon_standard_set(ic, "go-previous");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
@ -2454,8 +2454,8 @@ ephoto_single_browser_show_controls(Ephoto *ephoto)
evas_object_show(but);
ic = elm_icon_add(ephoto->controls_left);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
ret = elm_icon_standard_set(ic, "go-next");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
@ -2470,8 +2470,8 @@ ephoto_single_browser_show_controls(Ephoto *ephoto)
evas_object_show(but);
ic = elm_icon_add(ephoto->controls_right);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
ret = elm_icon_standard_set(ic, "object-rotate-left");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
@ -2486,8 +2486,8 @@ ephoto_single_browser_show_controls(Ephoto *ephoto)
evas_object_show(but);
ic = elm_icon_add(ephoto->controls_right);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
ret = elm_icon_standard_set(ic, "object-rotate-right");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
@ -2502,8 +2502,8 @@ ephoto_single_browser_show_controls(Ephoto *ephoto)
evas_object_show(but);
ic = elm_icon_add(ephoto->controls_right);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
ret = elm_icon_standard_set(ic, "edit-cut");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
@ -2518,8 +2518,8 @@ ephoto_single_browser_show_controls(Ephoto *ephoto)
evas_object_show(but);
ic = elm_icon_add(ephoto->controls_right);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
ret = elm_icon_standard_set(ic, "document-save-as");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
@ -2587,7 +2587,7 @@ ephoto_single_browser_add(Ephoto *ephoto, Evas_Object *parent)
return sb->main;
error:
error:
evas_object_del(sb->main);
return NULL;
}

View File

@ -79,52 +79,76 @@ _slideshow_move_end_get(Ephoto_Slideshow *ss)
{
case EPHOTO_SLIDESHOW_MOVE_LEFT_TO_RIGHT:
return "ephoto,slideshow,move,left,to,right";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_TO_LEFT:
return "ephoto,slideshow,move,right,to,left";
case EPHOTO_SLIDESHOW_MOVE_TOP_TO_BOTTOM:
return "ephoto,slideshow,move,top,to,bottom";
case EPHOTO_SLIDESHOW_MOVE_BOTTOM_TO_TOP:
return "ephoto,slideshow,move,bottom,to,top";
case EPHOTO_SLIDESHOW_MOVE_LEFT_IN:
return "ephoto,slideshow,move,left,in";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_IN:
return "ephoto,slideshow,move,right,in";
case EPHOTO_SLIDESHOW_MOVE_TOP_IN:
return "ephoto,slideshow,move,top,in";
case EPHOTO_SLIDESHOW_MOVE_BOTTOM_IN:
return "ephoto,slideshow,move,bottom,in";
case EPHOTO_SLIDESHOW_MOVE_LEFT_OUT:
return "ephoto,slideshow,move,left,out";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_OUT:
return "ephoto,slideshow,move,right,out";
case EPHOTO_SLIDESHOW_MOVE_TOP_OUT:
return "ephoto,slideshow,move,top,out";
case EPHOTO_SLIDESHOW_MOVE_BOTTOM_OUT:
return "ephoto,slideshow,move,bottom,out";
case EPHOTO_SLIDESHOW_MOVE_LEFT_TOP_CORNER:
return "ephoto,slideshow,move,left,top,corner";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_TOP_CORNER:
return "ephoto,slideshow,move,right,top,corner";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_BOTTOM_CORNER:
return "ephoto,slideshow,move,right,bottom,corner";
case EPHOTO_SLIDESHOW_MOVE_LEFT_BOTTOM_CORNER:
return "ephoto,slideshow,move,left,bottom,corner";
case EPHOTO_SLIDESHOW_MOVE_LEFT_TOP_CORNER_IN:
return "ephoto,slideshow,move,left,top,corner,in";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_TOP_CORNER_IN:
return "ephoto,slideshow,move,right,top,corner,in";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_BOTTOM_CORNER_IN:
return "ephoto,slideshow,move,right,bottom,corner,in";
case EPHOTO_SLIDESHOW_MOVE_LEFT_BOTTOM_CORNER_IN:
return "ephoto,slideshow,move,left,bottom,corner,in";
case EPHOTO_SLIDESHOW_MOVE_LEFT_TOP_CORNER_OUT:
return "ephoto,slideshow,move,left,top,corner,out";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_TOP_CORNER_OUT:
return "ephoto,slideshow,move,right,top,corner,out";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_BOTTOM_CORNER_OUT:
return "ephoto,slideshow,move,right,bottom,corner,out";
case EPHOTO_SLIDESHOW_MOVE_LEFT_BOTTOM_CORNER_OUT:
return "ephoto,slideshow,move,left,bottom,corner,out";
default: return "default";
}
}
@ -136,52 +160,76 @@ _slideshow_move_start_get(Ephoto_Slideshow *ss)
{
case EPHOTO_SLIDESHOW_MOVE_LEFT_TO_RIGHT:
return "ephoto,slideshow,default,left,to,right";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_TO_LEFT:
return "ephoto,slideshow,default,right,to,left";
case EPHOTO_SLIDESHOW_MOVE_TOP_TO_BOTTOM:
return "ephoto,slideshow,default,top,to,bottom";
case EPHOTO_SLIDESHOW_MOVE_BOTTOM_TO_TOP:
return "ephoto,slideshow,default,bottom,to,top";
case EPHOTO_SLIDESHOW_MOVE_LEFT_IN:
return "ephoto,slideshow,default,left,in";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_IN:
return "ephoto,slideshow,default,right,in";
case EPHOTO_SLIDESHOW_MOVE_TOP_IN:
return "ephoto,slideshow,default,top,in";
case EPHOTO_SLIDESHOW_MOVE_BOTTOM_IN:
return "ephoto,slideshow,default,bottom,in";
case EPHOTO_SLIDESHOW_MOVE_LEFT_OUT:
return "ephoto,slideshow,default,left,out";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_OUT:
return "ephoto,slideshow,default,right,out";
case EPHOTO_SLIDESHOW_MOVE_TOP_OUT:
return "ephoto,slideshow,default,top,out";
case EPHOTO_SLIDESHOW_MOVE_BOTTOM_OUT:
return "ephoto,slideshow,default,bottom,out";
case EPHOTO_SLIDESHOW_MOVE_LEFT_TOP_CORNER:
return "ephoto,slideshow,default,left,top,corner";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_TOP_CORNER:
return "ephoto,slideshow,default,right,top,corner";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_BOTTOM_CORNER:
return "ephoto,slideshow,default,right,bottom,corner";
case EPHOTO_SLIDESHOW_MOVE_LEFT_BOTTOM_CORNER:
return "ephoto,slideshow,default,left,bottom,corner";
case EPHOTO_SLIDESHOW_MOVE_LEFT_TOP_CORNER_IN:
return "ephoto,slideshow,default,left,top,corner,in";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_TOP_CORNER_IN:
return "ephoto,slideshow,default,right,top,corner,in";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_BOTTOM_CORNER_IN:
return "ephoto,slideshow,default,right,bottom,corner,in";
case EPHOTO_SLIDESHOW_MOVE_LEFT_BOTTOM_CORNER_IN:
return "ephoto,slideshow,default,left,bottom,corner,in";
case EPHOTO_SLIDESHOW_MOVE_LEFT_TOP_CORNER_OUT:
return "ephoto,slideshow,default,left,top,corner,out";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_TOP_CORNER_OUT:
return "ephoto,slideshow,default,right,top,corner,out";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_BOTTOM_CORNER_OUT:
return "ephoto,slideshow,default,right,bottom,corner,out";
case EPHOTO_SLIDESHOW_MOVE_LEFT_BOTTOM_CORNER_OUT:
return "ephoto,slideshow,default,left,bottom,corner,out";
default: return "default";
}
}
@ -206,75 +254,99 @@ _slideshow_move_randomize(Ephoto_Slideshow *ss)
case 0:
ss->move = EPHOTO_SLIDESHOW_MOVE_LEFT_TO_RIGHT;
break;
case 1:
ss->move = EPHOTO_SLIDESHOW_MOVE_RIGHT_TO_LEFT;
break;
case 2:
ss->move = EPHOTO_SLIDESHOW_MOVE_TOP_TO_BOTTOM;
break;
case 3:
ss->move = EPHOTO_SLIDESHOW_MOVE_BOTTOM_TO_TOP;
break;
case 4:
ss->move = EPHOTO_SLIDESHOW_MOVE_LEFT_IN;
break;
case 5:
ss->move = EPHOTO_SLIDESHOW_MOVE_RIGHT_IN;
break;
case 6:
ss->move = EPHOTO_SLIDESHOW_MOVE_TOP_IN;
break;
case 7:
ss->move = EPHOTO_SLIDESHOW_MOVE_BOTTOM_IN;
break;
case 8:
ss->move = EPHOTO_SLIDESHOW_MOVE_LEFT_OUT;
break;
case 9:
ss->move = EPHOTO_SLIDESHOW_MOVE_RIGHT_OUT;
break;
case 10:
ss->move = EPHOTO_SLIDESHOW_MOVE_TOP_OUT;
break;
case 11:
ss->move = EPHOTO_SLIDESHOW_MOVE_BOTTOM_OUT;
break;
case 12:
ss->move = EPHOTO_SLIDESHOW_MOVE_LEFT_TOP_CORNER;
break;
case 13:
ss->move = EPHOTO_SLIDESHOW_MOVE_RIGHT_TOP_CORNER;
break;
case 14:
ss->move = EPHOTO_SLIDESHOW_MOVE_RIGHT_BOTTOM_CORNER;
break;
case 15:
ss->move = EPHOTO_SLIDESHOW_MOVE_LEFT_BOTTOM_CORNER;
break;
case 16:
ss->move = EPHOTO_SLIDESHOW_MOVE_LEFT_TOP_CORNER_IN;
break;
case 17:
ss->move = EPHOTO_SLIDESHOW_MOVE_RIGHT_TOP_CORNER_IN;
break;
case 18:
ss->move = EPHOTO_SLIDESHOW_MOVE_RIGHT_BOTTOM_CORNER_IN;
break;
case 19:
ss->move = EPHOTO_SLIDESHOW_MOVE_LEFT_BOTTOM_CORNER_IN;
break;
case 20:
ss->move = EPHOTO_SLIDESHOW_MOVE_LEFT_TOP_CORNER_OUT;
break;
case 21:
ss->move = EPHOTO_SLIDESHOW_MOVE_RIGHT_TOP_CORNER_OUT;
break;
case 22:
ss->move = EPHOTO_SLIDESHOW_MOVE_RIGHT_BOTTOM_CORNER_OUT;
break;
case 23:
ss->move = EPHOTO_SLIDESHOW_MOVE_LEFT_BOTTOM_CORNER_OUT;
break;
default: ss->move = EPHOTO_SLIDESHOW_MOVE_LEFT_TO_RIGHT;
}
}
@ -756,8 +828,8 @@ _add_icon(Evas_Object *parent, const char *icon, const char *label, Evas_Object
int ret;
ic = elm_icon_add(parent);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
ret = elm_icon_standard_set(ic, icon);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
@ -903,7 +975,7 @@ ephoto_slideshow_add(Ephoto *ephoto, Evas_Object *parent)
"ephoto,transition,end", "ephoto", _on_transition_end, ss);
return ss->slideshow;
error:
error:
evas_object_del(slideshow);
return NULL;
}
@ -985,3 +1057,4 @@ ephoto_slideshow_entry_set(Evas_Object *obj, Ephoto_Entry *entry)
evas_object_raise(ss->event);
elm_object_focus_set(ss->event, EINA_TRUE);
}

View File

@ -439,3 +439,4 @@ _e_thumb_cb_exe_event_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *ev
}
return ECORE_CALLBACK_PASS_ON;
}

View File

@ -54,7 +54,7 @@ struct _Ephoto_Thumb_Browser
int count;
int processed;
} animator;
Eina_Bool main_deleted:1;
Eina_Bool main_deleted : 1;
};
/*Item Classes*/
@ -78,7 +78,7 @@ static void _ephoto_thumb_search_cancel(void *data, Evas_Object *obj EINA_UNUSED
void *event_info EINA_UNUSED);
static void _ephoto_thumb_search_start(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED);
static char * _drag_data_extract(char **drag_data);
static char *_drag_data_extract(char **drag_data);
/*Common Callbacks*/
static void
@ -169,7 +169,7 @@ _drop_dropcb(void *data EINA_UNUSED, Evas_Object *obj, Elm_Object_Item *it EINA_
static Elm_Object_Item *
_drop_item_getcb(Evas_Object *obj EINA_UNUSED, Evas_Coord x EINA_UNUSED,
Evas_Coord y EINA_UNUSED,int *xposret EINA_UNUSED, int *yposret EINA_UNUSED)
Evas_Coord y EINA_UNUSED, int *xposret EINA_UNUSED, int *yposret EINA_UNUSED)
{
return NULL;
}
@ -303,16 +303,16 @@ _dnd_drag_data_build(Eina_List **items)
drag_data =
malloc(len + eina_list_count(*items) * (FILESEP_LEN + 1) + 1);
strcpy((char *) drag_data, "");
strcpy((char *)drag_data, "");
EINA_LIST_FOREACH(*items, l, it)
{
e = elm_object_item_data_get(it);
if (e->path)
{
strcat((char *) drag_data, FILESEP);
strcat((char *) drag_data, e->path);
strcat((char *) drag_data, "\n");
strcat((char *)drag_data, FILESEP);
strcat((char *)drag_data, e->path);
strcat((char *)drag_data, "\n");
}
}
}
@ -392,7 +392,7 @@ _dnd_item_data_get(Evas_Object *obj, Elm_Object_Item *it,
info->dragstart = _dnd_drag_start;
info->icons = NULL;
info->dragdone = _dnd_drag_done;
info->data = _dnd_get_drag_data(obj, it, (Eina_List **) & info->donecbdata);
info->data = _dnd_get_drag_data(obj, it, (Eina_List **)&info->donecbdata);
info->acceptdata = info->donecbdata;
if (info->data)
return EINA_TRUE;
@ -885,7 +885,7 @@ _grid_mouse_up_cb(void *data, Evas *e EINA_UNUSED,
two = elm_gengrid_item_index_get(item);
if (two < one)
{
for (i = one; i > (two+1); i--)
for (i = one; i > (two + 1); i--)
{
it = elm_gengrid_item_prev_get(cur);
elm_gengrid_item_selected_set(it, EINA_TRUE);
@ -894,7 +894,7 @@ _grid_mouse_up_cb(void *data, Evas *e EINA_UNUSED,
}
else if (two > one)
{
for (i = one; i < (two-1); i++)
for (i = one; i < (two - 1); i++)
{
it = elm_gengrid_item_next_get(cur);
elm_gengrid_item_selected_set(it, EINA_TRUE);
@ -1000,6 +1000,7 @@ _grid_mouse_up_cb(void *data, Evas *e EINA_UNUSED,
tb);
evas_object_show(menu);
}
static void
_grid_mouse_wheel(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info)
@ -1252,7 +1253,7 @@ _ephoto_thumb_search_go(void *data, Evas_Object *obj EINA_UNUSED,
elm_object_item_data_set(e->item, e);
tb->totimages++;
f = eina_file_open(e->path, EINA_FALSE);
tb->totsize += (double) eina_file_size_get(f);
tb->totsize += (double)eina_file_size_get(f);
eina_file_close(f);
tb->searchentries = eina_list_append(tb->searchentries, e);
}
@ -1488,7 +1489,6 @@ _todo_items_process(void *data)
if (entry->item)
{
elm_object_item_data_set(entry->item, entry);
}
else if (tb->sort != EPHOTO_SORT_SIMILARITY)
{
@ -1601,7 +1601,7 @@ _ephoto_thumb_entry_create(void *data, int type EINA_UNUSED, void *event)
tb->totimages += 1;
f = eina_file_open(e->path, EINA_FALSE);
e->size = eina_file_size_get(f);
tb->totsize += (double) e->size;
tb->totsize += (double)e->size;
eina_file_close(f);
tb->todo_items = eina_list_append(tb->todo_items, e);
tb->animator.count++;
@ -1858,7 +1858,8 @@ _ephoto_main_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
_todo_items_free(tb);
elm_drop_item_container_del(tb->grid);
elm_drag_item_container_del(tb->grid);
EINA_LIST_FREE(tb->handlers, handler) ecore_event_handler_del(handler);
EINA_LIST_FREE(tb->handlers, handler)
ecore_event_handler_del(handler);
if (tb->animator.todo_items)
{
ecore_animator_del(tb->animator.todo_items);
@ -1883,7 +1884,6 @@ _ephoto_main_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
free(tb);
}
/*Ephoto Thumb Browser Public Functions*/
void
ephoto_thumb_browser_dirs_only_set(Ephoto *ephoto, Eina_Bool dirs_only)
@ -1955,7 +1955,7 @@ ephoto_thumb_browser_insert(Ephoto *ephoto, Ephoto_Entry *entry)
tb->totimages += 1;
f = eina_file_open(entry->path, EINA_FALSE);
entry->size = eina_file_size_get(f);
tb->totsize += (double) entry->size;
tb->totsize += (double)entry->size;
eina_file_close(f);
entry->gengrid = tb->grid;
@ -2029,7 +2029,7 @@ ephoto_thumb_browser_update(Ephoto *ephoto, Ephoto_Entry *entry)
f = eina_file_open(entry->path, EINA_FALSE);
entry->size = eina_file_size_get(f);
tb->totsize += (double) entry->size;
tb->totsize += (double)entry->size;
eina_file_close(f);
elm_gengrid_item_update(entry->item);
@ -2049,8 +2049,8 @@ ephoto_thumb_browser_show_controls(Ephoto *ephoto)
evas_object_del(ephoto->view_button);
ic = elm_icon_add(ephoto->statusbar);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
ret = elm_icon_standard_set(ic, "document-open");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
@ -2067,8 +2067,8 @@ ephoto_thumb_browser_show_controls(Ephoto *ephoto)
ephoto->view_button = but;
ic = elm_icon_add(ephoto->controls_left);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
ret = elm_icon_standard_set(ic, "zoom-in");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
@ -2083,8 +2083,8 @@ ephoto_thumb_browser_show_controls(Ephoto *ephoto)
evas_object_show(but);
ic = elm_icon_add(ephoto->controls_left);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
elm_icon_standard_set(ic, "zoom-out");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
@ -2112,8 +2112,8 @@ ephoto_thumb_browser_show_controls(Ephoto *ephoto)
"view-sort-ascending", ELM_ICON_STANDARD, _sort_similarity, tb);
elm_object_text_set(hover, _("Sort"));
ic = elm_icon_add(hover);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
evas_object_size_hint_min_set(ic, 20 * elm_config_scale_get(),
20 * elm_config_scale_get());
elm_icon_standard_set(ic, "view-sort-ascending");
elm_object_part_content_set(hover, "icon", ic);
evas_object_show(ic);
@ -2188,7 +2188,7 @@ ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object *parent)
return tb->main;
error:
error:
evas_object_del(tb->main);
return NULL;
}

View File

@ -577,7 +577,8 @@ end:
/* will free all */
if (edje) evas_object_del(edje);
if (ee_im) ecore_evas_free(ee_im);
else if (im) evas_object_del(im);
else if (im)
evas_object_del(im);
if (im2) evas_object_del(im2);
if (bg) evas_object_del(bg);
ecore_evas_free(ee);
@ -621,7 +622,7 @@ e_sha1_sum(unsigned char *data, int size, unsigned char *dst)
buf[63] = (size) & 0xff;
}
buf[idx] = *d;
idx++;;
idx++;
if ((idx == 64) || (left == 1))
{
if ((left == 1) && (idx < 64)) buf[idx] = 0x80;