|
|
|
@ -2,12 +2,15 @@ |
|
|
|
|
|
|
|
|
|
/*Ephoto Image Manipulation*/ |
|
|
|
|
static void add_standard_edit_tools(Ewl_Widget *c); |
|
|
|
|
static void add_advanced_edit_tools(Ewl_Widget *c); |
|
|
|
|
static void previous_image(Ewl_Widget *w, void *event, void *data); |
|
|
|
|
static void next_image(Ewl_Widget *w, void *event, void *data); |
|
|
|
|
static void flip_image_horizontal(Ewl_Widget *w, void *event, void *data); |
|
|
|
|
static void flip_image_vertical(Ewl_Widget *w, void *event, void *data); |
|
|
|
|
static void rotate_image_left(Ewl_Widget *w, void *event, void *data); |
|
|
|
|
static void rotate_image_right(Ewl_Widget *w, void *event, void *data); |
|
|
|
|
static void image_blur(Ewl_Widget *w, void *event, void *data); |
|
|
|
|
static void image_sharpen(Ewl_Widget *w, void *event, void *data); |
|
|
|
|
|
|
|
|
|
/*Add the edit view*/ |
|
|
|
|
Ewl_Widget *add_edit_view(Ewl_Widget *c) |
|
|
|
@ -37,6 +40,8 @@ Ewl_Widget *add_edit_view(Ewl_Widget *c) |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(advanced), EWL_FLAG_FILL_VFILL); |
|
|
|
|
ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(nb), advanced, "Advanced Tools"); |
|
|
|
|
|
|
|
|
|
add_advanced_edit_tools(advanced); |
|
|
|
|
|
|
|
|
|
vbox = add_box(hbox, EWL_ORIENTATION_VERTICAL, 0); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(vbox), EWL_FLAG_FILL_ALL); |
|
|
|
|
|
|
|
|
@ -101,6 +106,24 @@ static void add_standard_edit_tools(Ewl_Widget *c) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Add advanced edit tools */ |
|
|
|
|
static void add_advanced_edit_tools(Ewl_Widget *c) |
|
|
|
|
{ |
|
|
|
|
Ewl_Widget *button; |
|
|
|
|
|
|
|
|
|
button = add_button(c, "Blur Image", PACKAGE_DATA_DIR "", image_blur, NULL); |
|
|
|
|
ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); |
|
|
|
|
ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_LEFT); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_HFILL); |
|
|
|
|
|
|
|
|
|
button = add_button(c, "Sharpen Image", PACKAGE_DATA_DIR "", image_sharpen, NULL); |
|
|
|
|
ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); |
|
|
|
|
ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_LEFT); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_HFILL); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*Go to the previous image*/ |
|
|
|
|
static void previous_image(Ewl_Widget *w, void *event, void *data) |
|
|
|
|
{ |
|
|
|
@ -113,9 +136,9 @@ static void previous_image(Ewl_Widget *w, void *event, void *data) |
|
|
|
|
ecore_dlist_goto_last(em->images); |
|
|
|
|
image = ecore_dlist_current(em->images); |
|
|
|
|
} |
|
|
|
|
ewl_image_file_path_set(EWL_IMAGE(em->eimage), image); |
|
|
|
|
ewl_widget_configure(em->eimage->parent); |
|
|
|
|
|
|
|
|
|
ewl_image_file_path_set(EWL_IMAGE(em->eimage), image); |
|
|
|
|
ewl_widget_configure(em->eimage->parent); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -134,17 +157,18 @@ static void next_image(Ewl_Widget *w, void *event, void *data) |
|
|
|
|
} |
|
|
|
|
ewl_image_file_path_set(EWL_IMAGE(em->eimage), image); |
|
|
|
|
ewl_widget_configure(em->eimage->parent); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*Flip the image 180 degrees horizontally*/ |
|
|
|
|
static void flip_image_horizontal(Ewl_Widget *w, void *event, void *data) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
unsigned int *image_data; |
|
|
|
|
int nw, nh; |
|
|
|
|
Ewl_Image *image; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
evas_object_image_size_get(EWL_IMAGE(em->eimage)->image, &nw, &nh); |
|
|
|
|
image_data = flip_horizontal(em->eimage); |
|
|
|
|
update_image(em->eimage, nw, nh, image_data); |
|
|
|
@ -171,7 +195,7 @@ static void flip_image_vertical(Ewl_Widget *w, void *event, void *data) |
|
|
|
|
ewl_image_size_set(EWL_IMAGE(em->eimage), nh, nw); |
|
|
|
|
image = (Ewl_Image *)em->eimage; |
|
|
|
|
image->ow = nw; |
|
|
|
|
image->oh = nh; |
|
|
|
|
image->oh = nh; |
|
|
|
|
ewl_object_preferred_inner_size_set(EWL_OBJECT(em->eimage), nh, nw); |
|
|
|
|
ewl_widget_configure(em->eimage->parent); |
|
|
|
|
|
|
|
|
@ -194,7 +218,7 @@ static void rotate_image_left(Ewl_Widget *w, void *event, void *data) |
|
|
|
|
image->oh = nh; |
|
|
|
|
ewl_object_preferred_inner_size_set(EWL_OBJECT(em->eimage), nw, nh); |
|
|
|
|
ewl_widget_configure(em->eimage->parent); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -204,16 +228,44 @@ static void rotate_image_right(Ewl_Widget *w, void *event, void *data) |
|
|
|
|
unsigned int *image_data; |
|
|
|
|
int nw, nh; |
|
|
|
|
Ewl_Image *image; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
evas_object_image_size_get(EWL_IMAGE(em->eimage)->image, &nh, &nw); |
|
|
|
|
image_data = rotate_right(em->eimage); |
|
|
|
|
update_image(em->eimage, nw, nh, image_data); |
|
|
|
|
image = (Ewl_Image *)em->eimage; |
|
|
|
|
image->ow = nw; |
|
|
|
|
image->oh = nh; |
|
|
|
|
ewl_object_preferred_inner_size_set(EWL_OBJECT(em->eimage), nw, nh); |
|
|
|
|
image->ow = nw; |
|
|
|
|
image->oh = nh; |
|
|
|
|
ewl_object_preferred_inner_size_set(EWL_OBJECT(em->eimage), nw, nh); |
|
|
|
|
ewl_widget_configure(em->eimage->parent); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Blur the image*/ |
|
|
|
|
static void image_blur(Ewl_Widget *w, void *event, void *data) |
|
|
|
|
{ |
|
|
|
|
unsigned int *image_data; |
|
|
|
|
int nw, nh; |
|
|
|
|
|
|
|
|
|
evas_object_image_size_get(EWL_IMAGE(em->eimage)->image, &nw, &nh); |
|
|
|
|
image_data = blur_image(em->eimage); |
|
|
|
|
update_image(em->eimage, nw, nh, image_data); |
|
|
|
|
ewl_widget_configure(em->eimage->parent); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Sharpen the image*/ |
|
|
|
|
static void image_sharpen(Ewl_Widget *w, void *event, void *data) |
|
|
|
|
{ |
|
|
|
|
unsigned int *image_data; |
|
|
|
|
int nw, nh; |
|
|
|
|
|
|
|
|
|
evas_object_image_size_get(EWL_IMAGE(em->eimage)->image, &nw, &nh); |
|
|
|
|
image_data = sharpen_image(em->eimage); |
|
|
|
|
update_image(em->eimage, nw, nh, image_data); |
|
|
|
|
ewl_widget_configure(em->eimage->parent); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|