From: <enl...@li...> - 2005-12-14 11:23:19
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/doc Log Message: Directory /cvsroot/enlightenment/e17/proto/exhibit/doc added to the repository |
From: <enl...@li...> - 2005-12-14 11:27:22
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/data/images Log Message: Directory /cvsroot/enlightenment/e17/proto/exhibit/data/images added to the repository |
From: <enl...@li...> - 2005-12-14 11:29:27
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/doc/img Log Message: Directory /cvsroot/enlightenment/e17/proto/exhibit/doc/img added to the repository |
From: <enl...@li...> - 2005-12-14 11:29:52
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Log Message: Directory /cvsroot/enlightenment/e17/proto/exhibit/src/bin added to the repository |
From: <enl...@li...> - 2005-12-14 11:33:34
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit Added Files: AUTHORS COPYING COPYING-PLAIN ChangeLog Doxyfile INSTALL Makefile.am NEWS README TODO acconfig.h autogen.sh configure.in exhibit.c.in exhibit.spec gendoc Log Message: Exhibit - The Etk Image Viewer Exhibit is an image viewer that uses Etk as its toolkit. Exhibit supports image previews for image types supported by Evas and allows for each directory changing using a point and click interface or a text input box with tab autocompletion support. Common operations include zooming in and out, rotation, resizing, and moving around of images on the filesystem. Other features include drag and drop and image sorting. Enjoy! |
From: <enl...@li...> - 2005-12-14 11:33:34
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/data/images Added Files: fit_to_window.png one_to_one.png zoom_in.png zoom_out.png Log Message: Exhibit - The Etk Image Viewer Exhibit is an image viewer that uses Etk as its toolkit. Exhibit supports image previews for image types supported by Evas and allows for each directory changing using a point and click interface or a text input box with tab autocompletion support. Common operations include zooming in and out, rotation, resizing, and moving around of images on the filesystem. Other features include drag and drop and image sorting. Enjoy! |
From: <enl...@li...> - 2005-12-14 11:33:34
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/doc Added Files: exhibit.css foot.html head.html Log Message: Exhibit - The Etk Image Viewer Exhibit is an image viewer that uses Etk as its toolkit. Exhibit supports image previews for image types supported by Evas and allows for each directory changing using a point and click interface or a text input box with tab autocompletion support. Common operations include zooming in and out, rotation, resizing, and moving around of images on the filesystem. Other features include drag and drop and image sorting. Enjoy! |
From: <enl...@li...> - 2005-12-14 11:33:35
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/doc/img Added Files: exhibit.png exhibit_big.png exhibit_mini.png exhibit_small.png hilite.png Log Message: Exhibit - The Etk Image Viewer Exhibit is an image viewer that uses Etk as its toolkit. Exhibit supports image previews for image types supported by Evas and allows for each directory changing using a point and click interface or a text input box with tab autocompletion support. Common operations include zooming in and out, rotation, resizing, and moving around of images on the filesystem. Other features include drag and drop and image sorting. Enjoy! |
From: <enl...@li...> - 2005-12-14 11:33:36
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/data Added Files: Makefile.am images.edc Log Message: Exhibit - The Etk Image Viewer Exhibit is an image viewer that uses Etk as its toolkit. Exhibit supports image previews for image types supported by Evas and allows for each directory changing using a point and click interface or a text input box with tab autocompletion support. Common operations include zooming in and out, rotation, resizing, and moving around of images on the filesystem. Other features include drag and drop and image sorting. Enjoy! |
From: <enl...@li...> - 2005-12-14 11:33:38
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Added Files: Makefile.am exhibit.h exhibit_file.c exhibit_file.h exhibit_image.c exhibit_image.h exhibit_main.c exhibit_main.h exhibit_menus.c exhibit_menus.h exhibit_sort.c exhibit_sort.h exhibit_thumb.c exhibit_thumb.h Log Message: Exhibit - The Etk Image Viewer Exhibit is an image viewer that uses Etk as its toolkit. Exhibit supports image previews for image types supported by Evas and allows for each directory changing using a point and click interface or a text input box with tab autocompletion support. Common operations include zooming in and out, rotation, resizing, and moving around of images on the filesystem. Other features include drag and drop and image sorting. Enjoy! |
From: <enl...@li...> - 2005-12-14 11:33:38
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/src Added Files: Makefile.am Log Message: Exhibit - The Etk Image Viewer Exhibit is an image viewer that uses Etk as its toolkit. Exhibit supports image previews for image types supported by Evas and allows for each directory changing using a point and click interface or a text input box with tab autocompletion support. Common operations include zooming in and out, rotation, resizing, and moving around of images on the filesystem. Other features include drag and drop and image sorting. Enjoy! |
From: <enl...@li...> - 2005-12-14 11:39:48
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit Modified Files: README Log Message: - restructure features and mark incomplete ones. =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/README,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- README 14 Dec 2005 11:33:28 -0000 1.1 +++ README 14 Dec 2005 11:39:40 -0000 1.2 @@ -3,7 +3,14 @@ Exhibit is an image viewer that uses Etk as its toolkit. Exhibit supports image previews for image types supported by Evas and allows for directory changing using a point and click interface or a text input box with -tab autocompletion support. Common operations include zooming in and out, -rotation, resizing, and moving around of images on the filesystem. Other -features include drag and drop, image sorting, blurring, sharpening, and -saving. +tab autocompletion support. + +Common operations include: + +- rotation / flipping +- sharpen / blur +- saving +- resizing (needs implementation) +- zooming in and out (needs implementation) +- drag and drop (needs implementation) +- image sorting (needs implementation) |
From: <enl...@li...> - 2005-12-14 11:51:56
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit_image.c exhibit_main.c Log Message: - less warnings - queue a size recalc after we rotate an image (keep evas image and etk widget in sync) =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_image.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- exhibit_image.c 14 Dec 2005 11:33:30 -0000 1.1 +++ exhibit_image.c 14 Dec 2005 11:51:50 -0000 1.2 @@ -198,6 +198,7 @@ evas_object_image_size_set(im->image_object, iw, ih); evas_object_image_data_set(im->image_object, data); evas_object_image_data_update_add(im->image_object, 0, 0, iw, ih); + etk_widget_size_recalc_queue(im); } void =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- exhibit_main.c 14 Dec 2005 11:33:30 -0000 1.1 +++ exhibit_main.c 14 Dec 2005 11:51:50 -0000 1.2 @@ -498,8 +498,8 @@ } e->statusbar[0] = etk_statusbar_new(); - etk_statusbar_has_resize_grip_set(e->statusbar[0], FALSE); - etk_box_pack_start(ETK_BOX(e->hbox), e->statusbar[0], TRUE, TRUE, 0); + etk_statusbar_has_resize_grip_set(ETK_STATUSBAR(e->statusbar[0]), FALSE); + etk_box_pack_start(ETK_BOX(e->hbox), ETK_STATUSBAR(e->statusbar[0]), TRUE, TRUE, 0); e->statusbar[1] = etk_statusbar_new(); etk_statusbar_has_resize_grip_set(e->statusbar[1], FALSE); |
From: <enl...@li...> - 2005-12-14 12:00:57
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit_menus.c Log Message: - update statusbar display to reflect new image resolution as we rotate it. =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_menus.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- exhibit_menus.c 14 Dec 2005 11:33:30 -0000 1.1 +++ exhibit_menus.c 14 Dec 2005 12:00:43 -0000 1.2 @@ -134,13 +134,19 @@ _ex_menu_rot_clockwise_cb(Etk_Object *obj, void *data) { Exhibit *e; - Etk_Tree_Row *r; + Etk_Tree_Row *r; + int w, h; + char *size[30]; EX_MENU_ITEM_GET_RETURN(obj); e = data; r = etk_tree_selected_row_get(ETK_TREE(e->itree)); if(!r) return; _ex_image_flip_diagonal(ETK_IMAGE(e->image), 1); + etk_image_size_get(ETK_IMAGE(e->image), &w, &h); + snprintf(size, sizeof(size), "( %d x %d )", w, h); + etk_statusbar_pop(ETK_STATUSBAR(e->statusbar[1]), 0); + etk_statusbar_push(ETK_STATUSBAR(e->statusbar[1]), size, 0); } void @@ -148,12 +154,18 @@ { Exhibit *e; Etk_Tree_Row *r; + int w, h; + char *size[30]; EX_MENU_ITEM_GET_RETURN(obj); e = data; r = etk_tree_selected_row_get(ETK_TREE(e->itree)); if(!r) return; _ex_image_flip_diagonal(ETK_IMAGE(e->image), 2); + etk_image_size_get(ETK_IMAGE(e->image), &w, &h); + snprintf(size, sizeof(size), "( %d x %d )", w, h); + etk_statusbar_pop(ETK_STATUSBAR(e->statusbar[1]), 0); + etk_statusbar_push(ETK_STATUSBAR(e->statusbar[1]), size, 0); } void |
From: <enl...@li...> - 2005-12-14 15:02:41
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit.h exhibit_image.c exhibit_image.h exhibit_main.c exhibit_menus.c Log Message: zoom zoooom! - add zoom in / out / 1:1 to buttons and menus. =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- exhibit.h 14 Dec 2005 11:33:30 -0000 1.1 +++ exhibit.h 14 Dec 2005 15:02:33 -0000 1.2 @@ -15,6 +15,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> +#include <math.h> #include "config.h" @@ -62,6 +63,8 @@ char *dir; char cur_path[PATH_MAX]; + + int zoom; struct { int down; @@ -83,6 +86,8 @@ #define WINDOW_WIDTH 700 #define WINDOW_HEIGHT 500 #define VIEWABLES 3 +#define ZOOM_MAX 16 +#define ZOOM_MIN -16 #include "exhibit_menus.h" #include "exhibit_file.h" =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_image.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- exhibit_image.c 14 Dec 2005 11:51:50 -0000 1.2 +++ exhibit_image.c 14 Dec 2005 15:02:33 -0000 1.3 @@ -23,10 +23,10 @@ else if(ev->button == 3) { e->menu = etk_menu_new(); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Zoom in"), EX_IMAGE_ZOOM_IN, ETK_MENU_SHELL(e->menu), NULL, NULL); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Zoom out"), EX_IMAGE_ZOOM_OUT, ETK_MENU_SHELL(e->menu), NULL, NULL); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Zoom 1:1"), EX_IMAGE_ONE_TO_ONE, ETK_MENU_SHELL(e->menu), NULL, NULL); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Fit to window"), EX_IMAGE_FIT_TO_WINDOW, ETK_MENU_SHELL(e->menu), NULL, NULL); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Zoom in"), EX_IMAGE_ZOOM_IN, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_zoom_in_cb), e); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Zoom out"), EX_IMAGE_ZOOM_OUT, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_zoom_out_cb), e); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Zoom 1:1"), EX_IMAGE_ONE_TO_ONE, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_zoom_one_to_one_cb), e); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Fit to window"), EX_IMAGE_FIT_TO_WINDOW, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_fit_to_window_cb), e); etk_menu_popup(e->menu); } } @@ -394,3 +394,32 @@ exit(0); } } + +void +_ex_image_zoom(Etk_Image *im, int zoom) +{ + unsigned int *data; + int w, h; + int x, y; + unsigned int *p1, *p2, *tmp; + + if(im->use_edje) + return; + + etk_image_size_get(im, &w, &h); + if(zoom > 0) + { + w *= zoom; + h *= zoom; + } + else if(zoom < 0) + { + w /= abs(zoom); + h /= abs(zoom); + } + + evas_object_resize(im->image_object, w, h); + evas_object_image_fill_set(im->image_object, 0, 0, w, h); + etk_widget_size_request_set(im, w, h); + etk_widget_redraw_queue(im); +} =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_image.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- exhibit_image.h 14 Dec 2005 11:33:30 -0000 1.1 +++ exhibit_image.h 14 Dec 2005 15:02:33 -0000 1.2 @@ -10,5 +10,6 @@ void _ex_image_blur(Etk_Image *im); void _ex_image_sharpen(Etk_Image *im); void _ex_image_save(Etk_Image *im); +void _ex_image_zoom(Etk_Image *im, int zoom); #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- exhibit_main.c 14 Dec 2005 11:51:50 -0000 1.2 +++ exhibit_main.c 14 Dec 2005 15:02:33 -0000 1.3 @@ -1,5 +1,11 @@ #include "exhibit.h" +#define EX_BUTTON_GET_RETURN(o) \ + Etk_Button *item; \ + if (!(item = ETK_BUTTON(o))) \ + return; + + extern Evas_List *thumb_list; char *viewables[] = @@ -12,6 +18,68 @@ Evas_List *event_handlers; void +_ex_main_button_zoom_in_cb(Etk_Object *obj, void *data) +{ + Exhibit *e; + Etk_Tree_Row *r; + EX_BUTTON_GET_RETURN(obj); + + e = data; + r = etk_tree_selected_row_get(ETK_TREE(e->itree)); + if(!r) return; + + if(e->zoom == ZOOM_MAX) + e->zoom = ZOOM_MAX; + else + e->zoom += 2; + + _ex_image_zoom(ETK_IMAGE(e->image), e->zoom); +} + +void +_ex_main_button_zoom_out_cb(Etk_Object *obj, void *data) +{ + Exhibit *e; + Etk_Tree_Row *r; + EX_BUTTON_GET_RETURN(obj); + + e = data; + r = etk_tree_selected_row_get(ETK_TREE(e->itree)); + if(!r) return; + + if(e->zoom <= ZOOM_MIN) + e->zoom = ZOOM_MIN; + else + e->zoom -= 2; + + _ex_image_zoom(ETK_IMAGE(e->image), e->zoom); +} + +void +_ex_main_button_zoom_one_to_one_cb(Etk_Object *obj, void *data) +{ + Exhibit *e; + Etk_Tree_Row *r; + EX_BUTTON_GET_RETURN(obj); + + e = data; + r = etk_tree_selected_row_get(ETK_TREE(e->itree)); + if(!r) return; + + e->zoom = 0; + + _ex_image_zoom(ETK_IMAGE(e->image), e->zoom); + +} + +void +_ex_main_button_fit_to_window_cb(Etk_Object *obj, void *data) +{ + EX_BUTTON_GET_RETURN(obj); + printf("fit to window\n"); +} + +void _ex_main_itree_item_clicked_cb(Etk_Object *object, Etk_Tree_Row *row, void *data) { Etk_Tree *tree; @@ -24,6 +92,7 @@ Exhibit *e; e = data; + e->zoom = 0; tree = ETK_TREE(object); etk_tree_row_fields_get(row, etk_tree_nth_col_get(tree, 0), NULL, &icol_string, etk_tree_nth_col_get(tree, 1),NULL); @@ -38,14 +107,18 @@ etk_image_set_from_edje(ETK_IMAGE(e->image), icol_string, "desktop/background"); } else - etk_image_set_from_file(ETK_IMAGE(e->image), icol_string); + { + etk_image_set_from_file(ETK_IMAGE(e->image), icol_string); + etk_image_size_get(ETK_IMAGE(e->image), &w, &h); + etk_widget_size_request_set(ETK_WIDGET(e->image), w, h); + } bytes = ecore_file_size(icol_string); snprintf(size, sizeof(size), "%d K", (int)(bytes/1024)); etk_statusbar_pop(ETK_STATUSBAR(e->statusbar[0]), 0); etk_statusbar_push(ETK_STATUSBAR(e->statusbar[0]), size, 0); - etk_image_size_get(ETK_IMAGE(e->image), &w, &h); + etk_image_size_get(ETK_IMAGE(e->image), &w, &h); snprintf(size, sizeof(size), "( %d x %d )", w, h); etk_statusbar_pop(ETK_STATUSBAR(e->statusbar[1]), 0); etk_statusbar_push(ETK_STATUSBAR(e->statusbar[1]), size, 0); @@ -390,36 +463,44 @@ e->zoom_in[0] = etk_button_new(); e->zoom_in[1] = etk_image_new_from_edje(PACKAGE_DATA_DIR"/images/images.edj", "zoom_in"); + etk_widget_pass_events_set(e->zoom_in[1], TRUE); etk_widget_size_request_set(e->zoom_in[1], 33, 27); //etk_button_image_set(ETK_BUTTON(button), ETK_IMAGE(e->zoom_in[1])); etk_container_add(ETK_CONTAINER(e->zoom_in[0]), e->zoom_in[1]); + etk_signal_connect("clicked", ETK_OBJECT(e->zoom_in[0]), ETK_CALLBACK(_ex_main_button_zoom_in_cb), e); etk_table_attach(ETK_TABLE(e->table), e->zoom_in[0], 0, 0, 1, 1, 0, 0, ETK_FILL_POLICY_NONE); e->zoom_out[0] = etk_button_new(); e->zoom_out[1] = etk_image_new_from_edje(PACKAGE_DATA_DIR"/images/images.edj", "zoom_out"); + etk_widget_pass_events_set(e->zoom_out[1], TRUE); etk_widget_size_request_set(e->zoom_out[1], 33, 27); //etk_button_image_set(ETK_BUTTON(e->zoom_out[0]), ETK_IMAGE(e->zoom_out[1])); etk_container_add(ETK_CONTAINER(e->zoom_out[0]), e->zoom_out[1]); + etk_signal_connect("clicked", ETK_OBJECT(e->zoom_out[0]), ETK_CALLBACK(_ex_main_button_zoom_out_cb), e); etk_table_attach(ETK_TABLE(e->table), e->zoom_out[0], 1, 1, 1, 1, 0, 0, ETK_FILL_POLICY_NONE); e->fit[0] = etk_button_new(); e->fit[1] = etk_image_new_from_edje(PACKAGE_DATA_DIR"/images/images.edj", "fit_to_window"); + etk_widget_pass_events_set(e->fit[1], TRUE); etk_widget_size_request_set(e->fit[1], 33, 27); //etk_button_image_set(ETK_BUTTON(button), ETK_IMAGE(e->fit[1])); etk_container_add(ETK_CONTAINER(e->fit[0]), e->fit[1]); + etk_signal_connect("clicked", ETK_OBJECT(e->original[0]), ETK_CALLBACK(_ex_main_button_fit_to_window_cb), e); etk_table_attach(ETK_TABLE(e->table), e->fit[0], 2, 2, 1, 1, 0, 0, ETK_FILL_POLICY_NONE); e->original[0] = etk_button_new(); e->original[1] = etk_image_new_from_edje(PACKAGE_DATA_DIR"/images/images.edj", "one_to_one"); + etk_widget_pass_events_set(e->original[1], TRUE); etk_widget_size_request_set(e->original[1], 33, 27); //etk_button_image_set(ETK_BUTTON(e->original[0]), ETK_IMAGE(e->original[1])); etk_container_add(ETK_CONTAINER(e->original[0]), e->original[1]); + etk_signal_connect("clicked", ETK_OBJECT(e->original[0]), ETK_CALLBACK(_ex_main_button_zoom_one_to_one_cb), e); etk_table_attach(ETK_TABLE(e->table), e->original[0], 3, 3, 1, 1, 0, 0, ETK_FILL_POLICY_NONE); =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_menus.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- exhibit_menus.c 14 Dec 2005 12:00:43 -0000 1.2 +++ exhibit_menus.c 14 Dec 2005 15:02:33 -0000 1.3 @@ -230,22 +230,56 @@ void _ex_menu_zoom_in_cb(Etk_Object *obj, void *data) { + Exhibit *e; + Etk_Tree_Row *r; EX_MENU_ITEM_GET_RETURN(obj); - printf("zoom in\n"); + + e = data; + r = etk_tree_selected_row_get(ETK_TREE(e->itree)); + if(!r) return; + + if(e->zoom == ZOOM_MAX) + e->zoom = ZOOM_MAX; + else + e->zoom += 2; + + _ex_image_zoom(ETK_IMAGE(e->image), e->zoom); } void _ex_menu_zoom_out_cb(Etk_Object *obj, void *data) { + Exhibit *e; + Etk_Tree_Row *r; EX_MENU_ITEM_GET_RETURN(obj); - printf("zoom out\n"); + + e = data; + r = etk_tree_selected_row_get(ETK_TREE(e->itree)); + if(!r) return; + + if(e->zoom <= ZOOM_MIN) + e->zoom = ZOOM_MIN; + else + e->zoom -= 2; + + _ex_image_zoom(ETK_IMAGE(e->image), e->zoom); } void _ex_menu_zoom_one_to_one_cb(Etk_Object *obj, void *data) { + Exhibit *e; + Etk_Tree_Row *r; EX_MENU_ITEM_GET_RETURN(obj); - printf("zoom one to one\n"); + + e = data; + r = etk_tree_selected_row_get(ETK_TREE(e->itree)); + if(!r) return; + + e->zoom = 0; + + _ex_image_zoom(ETK_IMAGE(e->image), e->zoom); + } void |
From: <enl...@li...> - 2005-12-14 15:03:13
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit Modified Files: TODO Log Message: zoom zoooom! - add zoom in / out / 1:1 to buttons and menus. =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/TODO,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- TODO 14 Dec 2005 11:33:28 -0000 1.1 +++ TODO 14 Dec 2005 15:02:33 -0000 1.2 @@ -6,6 +6,7 @@ - dnd - options - fix .spec file +- make argv work with /path/to/image.png and not only /path/to/dir BUGS: |
From: <enl...@li...> - 2005-12-14 15:34:36
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit_main.c exhibit_main.h exhibit_menus.c Log Message: - allow zoom to reflect zoom level in statusbar =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- exhibit_main.c 14 Dec 2005 15:02:33 -0000 1.3 +++ exhibit_main.c 14 Dec 2005 15:34:28 -0000 1.4 @@ -18,6 +18,31 @@ Evas_List *event_handlers; void +_ex_main_statusbar_zoom_update(Exhibit *e) +{ + if(e->zoom > 0) + { + char zoom[6]; + etk_statusbar_pop(ETK_STATUSBAR(e->statusbar[2]), 0); + snprintf(zoom, sizeof(zoom), "%d:1", abs(e->zoom)); + etk_statusbar_push(ETK_STATUSBAR(e->statusbar[2]), zoom, 0); + } + else if(e->zoom < 0) + { + char zoom[6]; + etk_statusbar_pop(ETK_STATUSBAR(e->statusbar[2]), 0); + snprintf(zoom, sizeof(zoom), "1:%d", abs(e->zoom)); + etk_statusbar_push(ETK_STATUSBAR(e->statusbar[2]), zoom, 0);; + } + else + { + etk_statusbar_pop(ETK_STATUSBAR(e->statusbar[2]), 0); + etk_statusbar_push(ETK_STATUSBAR(e->statusbar[2]), "1:1", 0); + } +} + + +void _ex_main_button_zoom_in_cb(Etk_Object *obj, void *data) { Exhibit *e; @@ -34,6 +59,7 @@ e->zoom += 2; _ex_image_zoom(ETK_IMAGE(e->image), e->zoom); + _ex_main_statusbar_zoom_update(e); } void @@ -53,6 +79,7 @@ e->zoom -= 2; _ex_image_zoom(ETK_IMAGE(e->image), e->zoom); + _ex_main_statusbar_zoom_update(e); } void @@ -69,7 +96,7 @@ e->zoom = 0; _ex_image_zoom(ETK_IMAGE(e->image), e->zoom); - + _ex_main_statusbar_zoom_update(e); } void @@ -93,6 +120,9 @@ e = data; e->zoom = 0; + etk_statusbar_pop(ETK_STATUSBAR(e->statusbar[2]), 0); + etk_statusbar_push(ETK_STATUSBAR(e->statusbar[2]), "1:1", 0); + tree = ETK_TREE(object); etk_tree_row_fields_get(row, etk_tree_nth_col_get(tree, 0), NULL, &icol_string, etk_tree_nth_col_get(tree, 1),NULL); @@ -583,8 +613,8 @@ etk_box_pack_start(ETK_BOX(e->hbox), ETK_STATUSBAR(e->statusbar[0]), TRUE, TRUE, 0); e->statusbar[1] = etk_statusbar_new(); - etk_statusbar_has_resize_grip_set(e->statusbar[1], FALSE); - etk_box_pack_start(ETK_BOX(e->hbox), e->statusbar[1], TRUE, TRUE, 0); + etk_statusbar_has_resize_grip_set(ETK_STATUSBAR(e->statusbar[1]), FALSE); + etk_box_pack_start(ETK_BOX(e->hbox), ETK_STATUSBAR(e->statusbar[1]), TRUE, TRUE, 0); e->statusbar[2] = etk_statusbar_new(); etk_statusbar_has_resize_grip_set(ETK_STATUSBAR(e->statusbar[2]), FALSE); =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_main.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- exhibit_main.h 14 Dec 2005 11:33:30 -0000 1.1 +++ exhibit_main.h 14 Dec 2005 15:34:28 -0000 1.2 @@ -1,6 +1,11 @@ #ifndef _EX_MAIN_H #define _EX_MAIN_H +void _ex_main_statusbar_zoom_update(Exhibit *e); +void _ex_main_button_zoom_in_cb(Etk_Object *obj, void *data); +void _ex_main_button_zoom_out_cb(Etk_Object *obj, void *data); +void _ex_main_button_zoom_one_to_one_cb(Etk_Object *obj, void *data); +void _ex_main_button_fit_to_window_cb(Etk_Object *obj, void *data); void _ex_main_itree_item_clicked_cb(Etk_Object *object, Etk_Tree_Row *row, void *data); void _ex_main_itree_key_down_cb(Etk_Object *object, void *event, void *data); void _ex_main_dtree_item_clicked_cb(Etk_Object *object, Etk_Tree_Row *row, void *data); =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_menus.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- exhibit_menus.c 14 Dec 2005 15:02:33 -0000 1.3 +++ exhibit_menus.c 14 Dec 2005 15:34:28 -0000 1.4 @@ -244,6 +244,7 @@ e->zoom += 2; _ex_image_zoom(ETK_IMAGE(e->image), e->zoom); + _ex_main_statusbar_zoom_update(e); } void @@ -263,6 +264,7 @@ e->zoom -= 2; _ex_image_zoom(ETK_IMAGE(e->image), e->zoom); + _ex_main_statusbar_zoom_update(e); } void @@ -279,7 +281,7 @@ e->zoom = 0; _ex_image_zoom(ETK_IMAGE(e->image), e->zoom); - + _ex_main_statusbar_zoom_update(e); } void |
From: <enl...@li...> - 2005-12-14 21:30:58
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit_image.c exhibit_main.c Log Message: - misc - rotation size set fix - more options in right click menu =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_image.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- exhibit_image.c 14 Dec 2005 15:02:33 -0000 1.3 +++ exhibit_image.c 14 Dec 2005 21:30:46 -0000 1.4 @@ -22,11 +22,25 @@ } else if(ev->button == 3) { + if(e->menu) + { + etk_menu_popup(e->menu); + return; + } e->menu = etk_menu_new(); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Zoom in"), EX_IMAGE_ZOOM_IN, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_zoom_in_cb), e); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Zoom out"), EX_IMAGE_ZOOM_OUT, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_zoom_out_cb), e); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Zoom 1:1"), EX_IMAGE_ONE_TO_ONE, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_zoom_one_to_one_cb), e); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Fit to window"), EX_IMAGE_FIT_TO_WINDOW, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_fit_to_window_cb), e); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("in The Gimp"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_run_in_cb), e); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("in XV"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_run_in_cb), e); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("in Xpaint"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_run_in_cb), e); + _ex_menu_item_new(EX_MENU_ITEM_SEPERATOR, NULL, -99, ETK_MENU_SHELL(e->menu), NULL, NULL); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Rotate clockwise"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_rot_clockwise_cb), e); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Rotate counterclockwise"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_rot_counter_clockwise_cb), e); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Flip horizontally"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_flip_horizontal_cb), e); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Flip vertically"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_flip_vertical_cb), e); + _ex_menu_item_new(EX_MENU_ITEM_SEPERATOR, NULL, -99, ETK_MENU_SHELL(e->menu), NULL, NULL); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Blur"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_blur_cb), e); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Sharpen"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_sharpen_cb), e); + _ex_menu_item_new(EX_MENU_ITEM_SEPERATOR, NULL, -99, ETK_MENU_SHELL(e->menu), NULL, NULL); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Set as wallpaper"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_set_wallpaper_cb), e); etk_menu_popup(e->menu); } } @@ -198,7 +212,7 @@ evas_object_image_size_set(im->image_object, iw, ih); evas_object_image_data_set(im->image_object, data); evas_object_image_data_update_add(im->image_object, 0, 0, iw, ih); - etk_widget_size_recalc_queue(im); + etk_widget_size_request_set(ETK_WIDGET(im), iw, ih); } void =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- exhibit_main.c 14 Dec 2005 15:34:28 -0000 1.4 +++ exhibit_main.c 14 Dec 2005 21:30:46 -0000 1.5 @@ -415,6 +415,8 @@ e = calloc(1, sizeof(Exhibit)); e->mouse.down = 0; e->dirs = NULL; + e->menu = NULL; + e->image = NULL; e->win = etk_window_new(); etk_window_title_set(ETK_WINDOW(e->win), WINDOW_TITLE " - Image Viewing the Kewl Way!"); |
From: <enl...@li...> - 2005-12-14 22:05:24
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit_main.c Log Message: - fix from tene to stop menubar from stretching vertically =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- exhibit_main.c 14 Dec 2005 21:30:46 -0000 1.5 +++ exhibit_main.c 14 Dec 2005 22:05:17 -0000 1.6 @@ -437,7 +437,7 @@ etk_paned_add1(ETK_PANED(e->vpaned), e->table); e->menu_bar = etk_menu_bar_new(); - etk_table_attach_defaults(ETK_TABLE(e->table), e->menu_bar, 0, 4, 0, 0); + etk_table_attach(ETK_TABLE(e->table), e->menu_bar, 0, 4, 0, 0, 0, 0, ETK_FILL_POLICY_HFILL | ETK_FILL_POLICY_VFILL | ETK_FILL_POLICY_HEXPAND); { Etk_Widget *menu; |
From: <enl...@li...> - 2005-12-14 23:27:26
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit.h exhibit_image.c exhibit_image.h exhibit_main.c exhibit_menus.c exhibit_menus.h Log Message: Brightness / Contrast - implement brighten function - add stubs for others =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- exhibit.h 14 Dec 2005 15:02:33 -0000 1.2 +++ exhibit.h 14 Dec 2005 23:27:12 -0000 1.3 @@ -65,6 +65,8 @@ char cur_path[PATH_MAX]; int zoom; + int brightness; + int contrast; struct { int down; @@ -89,6 +91,13 @@ #define ZOOM_MAX 16 #define ZOOM_MIN -16 +#ifndef DATA64 +#define DATA64 unsigned long long +#define DATA32 unsigned int +#define DATA16 unsigned short +#define DATA8 unsigned char +#endif + #include "exhibit_menus.h" #include "exhibit_file.h" #include "exhibit.h" =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_image.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- exhibit_image.c 14 Dec 2005 21:30:46 -0000 1.4 +++ exhibit_image.c 14 Dec 2005 23:27:12 -0000 1.5 @@ -1,5 +1,20 @@ #include "exhibit.h" +#define R_CMOD(r) \ + red_mapping[(int)(r)] +#define G_CMOD(g) \ + green_mapping[(int)(g)] +#define B_CMOD(b) \ + blue_mapping[(int)(b)] +#define A_CMOD(a) \ + alpha_mapping[(int)(a)] + +#define A_VAL(p) ((DATA8 *)(p))[3] +#define R_VAL(p) ((DATA8 *)(p))[2] +#define G_VAL(p) ((DATA8 *)(p))[1] +#define B_VAL(p) ((DATA8 *)(p))[0] + + void _ex_image_mouse_down(Etk_Object *object, void *event, void *data) { @@ -39,6 +54,8 @@ _ex_menu_item_new(EX_MENU_ITEM_SEPERATOR, NULL, -99, ETK_MENU_SHELL(e->menu), NULL, NULL); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Blur"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_blur_cb), e); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Sharpen"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_sharpen_cb), e); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Brighten"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_brighten_cb), e); + //_ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Darken"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_darken_cb), e); _ex_menu_item_new(EX_MENU_ITEM_SEPERATOR, NULL, -99, ETK_MENU_SHELL(e->menu), NULL, NULL); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Set as wallpaper"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_set_wallpaper_cb), e); etk_menu_popup(e->menu); @@ -437,3 +454,129 @@ etk_widget_size_request_set(im, w, h); etk_widget_redraw_queue(im); } + +void +_ex_image_brightness(Etk_Image *im, int brightness) +{ + DATA32 *data, *p; + int w, h; + int i, j, x, y; + int val2; + DATA8 a, r, g, b; + DATA8 red_mapping[256]; + DATA8 green_mapping[256]; + DATA8 blue_mapping[256]; + DATA8 alpha_mapping[256]; + + if(im->use_edje) + return; + + for (i = 0; i < 256; i++) + { + red_mapping[i] = (DATA8) i; + green_mapping[i] = (DATA8) i; + blue_mapping[i] = (DATA8) i; + alpha_mapping[i] = (DATA8) i; + } + + etk_image_size_get(im, &w, &h); + data = evas_object_image_data_get(im->image_object, TRUE); + + for (i = 0; i < 256; i++) + { + val2 = (int)red_mapping[i] + brightness; + if (val2 < 0) + val2 = 0; + if (val2 > 255) + val2 = 255; + red_mapping[i] = (DATA8) val2; + + val2 = (int)green_mapping[i] + brightness; + if (val2 < 0) + val2 = 0; + if (val2 > 255) + val2 = 255; + green_mapping[i] = (DATA8) val2; + + val2 = (int)blue_mapping[i] + brightness; + if (val2 < 0) + val2 = 0; + if (val2 > 255) + val2 = 255; + blue_mapping[i] = (DATA8) val2; + + val2 = (int)alpha_mapping[i] + brightness; + if (val2 < 0) + val2 = 0; + if (val2 > 255) + val2 = 255; + alpha_mapping[i] = (DATA8) val2; + } + + for(i = 0; i < w - 1; i++) + { + for(j = 0; j < h - 1; j++) + { + p = &data[i + (w * j)]; + + R_VAL(p) = R_CMOD(R_VAL(p)); + G_VAL(p) = G_CMOD(G_VAL(p)); + B_VAL(p) = B_CMOD(B_VAL(p)); + A_VAL(p) = A_CMOD(A_VAL(p)); + } + } + + evas_object_image_data_set(im->image_object, data); + evas_object_image_data_update_add(im->image_object, 0, 0, w, h); +} + +void +_ex_image_brightness2(Etk_Image *im, int brightness) +{ + DATA32 *data, *data2, *pixel; + int w, h; + int i, j; + DATA8 a, r, g, b; + int light_transform[256]; + + if(im->use_edje) + return; + + printf("brightness = %d\n", brightness); + for(i=0; i<256; i++){ + light_transform[i] = i + brightness; + if(light_transform[i] > 255) + light_transform[i] = 255; + if(light_transform[i] < 0) + light_transform[i] = 0; + } + + etk_image_size_get(im, &w, &h); + data = evas_object_image_data_get(im->image_object, TRUE); + data2 = malloc(w * h * sizeof(DATA32)); + memcpy(data2, data, w * h * sizeof(DATA32)); + + for(i = 0; i < w - 1; i++) { + for(j = 0; j < h - 1; j++) { + pixel = &data[i + (w * j)]; + a = (*pixel >> 24) &0xff; + r = (*pixel >> 16) &0xff; + g = (*pixel >> 8) &0xff; + b = (*pixel) & 0xff; + + pixel = &data2[i + (w * j)]; + *pixel |= (light_transform[r] << 16); + *pixel |= (light_transform[g] << 8); + *pixel |= (light_transform[b]); + } + } + + evas_object_image_data_set(im->image_object, data2); + evas_object_image_data_update_add(im->image_object, 0, 0, w, h); +} + +void +_ex_image_contrast(Etk_Image *im, int contrast) +{ + +} =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_image.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- exhibit_image.h 14 Dec 2005 15:02:33 -0000 1.2 +++ exhibit_image.h 14 Dec 2005 23:27:12 -0000 1.3 @@ -10,6 +10,7 @@ void _ex_image_blur(Etk_Image *im); void _ex_image_sharpen(Etk_Image *im); void _ex_image_save(Etk_Image *im); -void _ex_image_zoom(Etk_Image *im, int zoom); +void _ex_image_zoom(Etk_Image *im, int zoom); +void _ex_image_brightness(Etk_Image *im, int brightness); #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- exhibit_main.c 14 Dec 2005 22:05:17 -0000 1.6 +++ exhibit_main.c 14 Dec 2005 23:27:12 -0000 1.7 @@ -94,6 +94,8 @@ if(!r) return; e->zoom = 0; + e->brightness = 128; + e->contrast = 0; _ex_image_zoom(ETK_IMAGE(e->image), e->zoom); _ex_main_statusbar_zoom_update(e); @@ -472,6 +474,7 @@ _ex_menu_item_new(EX_MENU_ITEM_SEPERATOR, NULL, -99, ETK_MENU_SHELL(menu), NULL, NULL); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Blur"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_blur_cb), e); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Sharpen"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_sharpen_cb), e); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Brighten"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_brighten_cb), e); _ex_menu_item_new(EX_MENU_ITEM_SEPERATOR, NULL, -99, ETK_MENU_SHELL(menu), NULL, NULL); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Set as wallpaper"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_set_wallpaper_cb), e); =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_menus.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- exhibit_menus.c 14 Dec 2005 15:34:28 -0000 1.4 +++ exhibit_menus.c 14 Dec 2005 23:27:12 -0000 1.5 @@ -221,6 +221,40 @@ } void +_ex_menu_brighten_cb(Etk_Object *obj, void *data) +{ + Exhibit *e; + Etk_Tree_Row *r; + EX_MENU_ITEM_GET_RETURN(obj); + + e = data; + r = etk_tree_selected_row_get(ETK_TREE(e->itree)); + if(!r) return; + + e->brightness += 10; + if(e->brightness > 255) + e->brightness = 255; + _ex_image_brightness(ETK_IMAGE(e->image), e->brightness); +} + +void +_ex_menu_darken_cb(Etk_Object *obj, void *data) +{ + Exhibit *e; + Etk_Tree_Row *r; + EX_MENU_ITEM_GET_RETURN(obj); + + e = data; + r = etk_tree_selected_row_get(ETK_TREE(e->itree)); + if(!r) return; + + e->brightness -= 10; + if(e->brightness < 0) + e->brightness = 0; + _ex_image_brightness(ETK_IMAGE(e->image), e->brightness); +} + +void _ex_menu_set_wallpaper_cb(Etk_Object *obj, void *data) { EX_MENU_ITEM_GET_RETURN(obj); =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_menus.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- exhibit_menus.h 14 Dec 2005 11:33:30 -0000 1.1 +++ exhibit_menus.h 14 Dec 2005 23:27:12 -0000 1.2 @@ -23,6 +23,8 @@ void _ex_menu_flip_vertical_cb(Etk_Object *obj, void *data); void _ex_menu_blur_cb(Etk_Object *obj, void *data); void _ex_menu_sharpen_cb(Etk_Object *obj, void *data); +void _ex_menu_brighten_cb(Etk_Object *obj, void *data); +void _ex_menu_darken_cb(Etk_Object *obj, void *data); void _ex_menu_set_wallpaper_cb(Etk_Object *obj, void *data); void _ex_menu_zoom_in_cb(Etk_Object *obj, void *data); void _ex_menu_zoom_out_cb(Etk_Object *obj, void *data); |
From: <enl...@li...> - 2005-12-15 10:04:36
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/m4 Log Message: Directory /cvsroot/enlightenment/e17/proto/exhibit/m4 added to the repository |
From: <enl...@li...> - 2005-12-15 10:07:21
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/m4 Added Files: ac_path_generic.m4 Log Message: - autofoo fixes, eventually remove pkg-config - right click -> set as wallpaper (centered for now, will get more options) |
From: <enl...@li...> - 2005-12-15 10:07:37
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit.h exhibit_file.c exhibit_file.h exhibit_image.c exhibit_menus.c Log Message: - autofoo fixes, eventually remove pkg-config - right click -> set as wallpaper (centered for now, will get more options) =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- exhibit.h 14 Dec 2005 23:27:12 -0000 1.3 +++ exhibit.h 15 Dec 2005 10:07:14 -0000 1.4 @@ -19,6 +19,14 @@ #include "config.h" +#if HAVE_E +#include <E_Lib.h> +#endif + +#if HAVE_ENGRAVE +#include <Engrave.h> +#endif + #define ETK_DEFAULT_ICON_SET_FILE ETK_PACKAGE_DATA_DIR "/stock_icons/default.edj" typedef enum _Ex_Images =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_file.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- exhibit_file.c 14 Dec 2005 11:33:30 -0000 1.1 +++ exhibit_file.c 15 Dec 2005 10:07:14 -0000 1.2 @@ -29,3 +29,25 @@ edje_file_collection_list_free(groups); return val; } + +char * +_ex_file_strip_extention(char *path) { + char *ptr; + char *c; + char *file; + int i; + + i = 0; + ptr = path; + c = strrchr(ptr,'.'); + file = malloc(strlen(path)); + + while(ptr != c) { + file[i] = *ptr; + ptr++; + i++; + } + + file[i] = '\0'; + return file; +} =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_file.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- exhibit_file.h 14 Dec 2005 11:33:30 -0000 1.1 +++ exhibit_file.h 15 Dec 2005 10:07:14 -0000 1.2 @@ -2,5 +2,6 @@ #define _EX_FILE_H int _ex_file_is_viewable(char *file); +char *_ex_file_strip_extention(char *path); #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_image.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- exhibit_image.c 14 Dec 2005 23:27:12 -0000 1.5 +++ exhibit_image.c 15 Dec 2005 10:07:14 -0000 1.6 @@ -580,3 +580,152 @@ { } + +void +_ex_image_wallpaper_set(Etk_Image *im) +{ + pid_t pid; + int w, h; + char *file, *dir, *edj_file, *filenoext, *esetroot; + char esetroot_opt[] = "-c"; +#if HAVE_ENGRAVE + Engrave_File *edj; + Engrave_Image *image; + Engrave_Group *grp; + Engrave_Part *part; + Engrave_Part_State *ps; +#endif + + pid = fork(); + if(!pid) + { +#if HAVE_E + if (!e_lib_init(getenv("DISPLAY"))) + goto PSEUDO; + /* make sure we got a file name */ + if (!im->filename) exit(0); + if(strlen(im->filename) <= 4) exit(0); + + file = ecore_file_get_file(im->filename); + dir = ecore_file_get_dir(im->filename); + + filenoext = _ex_file_strip_extention(im->filename); + filenoext = ecore_file_get_file(filenoext); + + if (strcmp(im->filename + strlen(im->filename) - 4, ".edj") == 0) { + int w, h, num; + char static_bg[PATH_MAX]; + char esetroot_s[PATH_MAX*2]; + char filename_s[PATH_MAX]; + Ecore_X_Window *roots = NULL; + + if (!ecore_x_init(NULL)) + exit(0); + + num = 0; + roots = ecore_x_window_root_list(&num); + ecore_x_window_size_get(roots[0], &w, &h); + snprintf(filename_s, PATH_MAX, "/tmp/%s.png", filenoext); + snprintf(static_bg, PATH_MAX, "edje_thumb %s desktop/background %s -g %dx%d -og %dx%d", im->filename, filename_s, w, h, w, h); + system(static_bg); + e_lib_background_set(im->filename); + + snprintf(esetroot_s, PATH_MAX, "Esetroot %s %s ", esetroot_opt, filename_s); + system(esetroot_s); + exit(0); + } + +#if HAVE_ENGRAVE + /* Set up edj path */ + edj_file = malloc(strlen(getenv("HOME")) + strlen("/.e/e/backgrounds/") + + strlen(filenoext) + strlen(".edj") + 1); + strcpy(edj_file, getenv("HOME")); + strcat(edj_file, "/.e/e/backgrounds/"); + strcat(edj_file, filenoext); + strcat(edj_file, ".edj"); + + /* Determine image width / height */ + { + Evas_Object *o; + Ecore_Evas *ee; + + ee = ecore_evas_buffer_new(0, 0); + o = evas_object_image_add(ecore_evas_get(ee)); + evas_object_image_file_set(o, im->filename, NULL); + evas_object_image_size_get(o, &w, &h); + evas_object_del(o); + ecore_evas_free(ee); + } + + /* create the .edj */ + edj = engrave_file_new(); + engrave_file_image_dir_set(edj, dir); + image = engrave_image_new(file, ENGRAVE_IMAGE_TYPE_COMP, 0); + engrave_file_image_add(edj, image); + + grp = engrave_group_new(); + engrave_group_name_set(grp, "desktop/background"); + engrave_file_group_add(edj, grp); + + part = engrave_part_new(ENGRAVE_PART_TYPE_IMAGE); + engrave_part_name_set(part, "background_image"); + engrave_group_part_add(grp, part); + + ps = engrave_part_state_new(); + engrave_part_state_name_set(ps, "default", 0.0); + engrave_part_state_image_normal_set(ps, image); + + engrave_part_state_max_size_set(ps, w, h); + + /* for now, dont differentiate, just center */ +# if 0 + switch(e_bg_type) { + case E_BG_CENTER: + engrave_part_state_max_size_set(ps, w, h); + break; + + case E_BG_SCALE: + break; + + case E_BG_FIT: + break; + + case E_BG_TILE: + /* FIXME: This is a temp until dj2 fixes engrave */ + //engrave_part_state_max_size_set(ps, w, h); + engrave_part_state_fill_size_relative_set(ps, 0.0, 0.0); + engrave_part_state_fill_size_offset_set(ps, w, h); + break; + + default: + /* FIXME: This is a temp until dj2 fixes engrave */ + //engrave_part_state_max_size_set(ps, w, h); + engrave_part_state_fill_size_relative_set(ps, 0.0, 0.0); + engrave_part_state_fill_size_offset_set(ps, w, h); + break; + } +# endif + + engrave_part_state_add(part, ps); + + engrave_edj_output(edj, edj_file); + engrave_file_free(edj); + + /* set the background */ + e_lib_background_set(edj_file); + +#endif + e_lib_shutdown(); +#endif + +PSEUDO: + + /* If we're using pseudo-trans for eterm, then this will help */ + esetroot = malloc(strlen("Esetroot ") + strlen(esetroot_opt) + strlen(im->filename) + 2); + snprintf(esetroot, strlen("Esetroot ") + strlen(esetroot_opt) + strlen(im->filename) + 2, + "Esetroot %s %s", esetroot_opt, im->filename); + system(esetroot); + free(esetroot); + exit(0); + } +} =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_menus.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- exhibit_menus.c 14 Dec 2005 23:27:12 -0000 1.5 +++ exhibit_menus.c 15 Dec 2005 10:07:14 -0000 1.6 @@ -257,8 +257,14 @@ void _ex_menu_set_wallpaper_cb(Etk_Object *obj, void *data) { + Exhibit *e; + Etk_Tree_Row *r; EX_MENU_ITEM_GET_RETURN(obj); - printf("set as wallpaper\n"); + + e = data; + r = etk_tree_selected_row_get(ETK_TREE(e->itree)); + if(!r) return; + _ex_image_wallpaper_set(e->image); } void |
From: <enl...@li...> - 2005-12-15 10:07:51
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit Modified Files: autogen.sh configure.in Log Message: - autofoo fixes, eventually remove pkg-config - right click -> set as wallpaper (centered for now, will get more options) =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/autogen.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- autogen.sh 14 Dec 2005 11:33:28 -0000 1.1 +++ autogen.sh 15 Dec 2005 10:07:13 -0000 1.2 @@ -124,7 +124,7 @@ libtoolize --force --copy fi echo "Running aclocal $aclocalinclude ..." - aclocal $aclocalinclude + aclocal $aclocalinclude -I m4 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then echo "Running autoheader..." autoheader =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/configure.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- configure.in 14 Dec 2005 11:33:28 -0000 1.1 +++ configure.in 15 Dec 2005 10:07:13 -0000 1.2 @@ -4,7 +4,15 @@ rm -f config.cache AC_INIT(configure.in) + +AC_CANONICAL_BUILD +AC_CANONICAL_HOST +AC_CANONICAL_TARGET + AM_INIT_AUTOMAKE(exhibit, 0.0.1) + +AC_PREREQ(2.52) + AM_CONFIG_HEADER(config.h) AC_ISC_POSIX @@ -101,6 +109,51 @@ EPSILON_REQUIRED_VERSION=0.3.0.004 PKG_CHECK_MODULES(EPSILON, epsilon >= $EPSILON_REQUIRED_VERSION) +#check for E +AC_PATH_EFL( + enlightenment, + 0.16.999.022, + [ + AC_DEFINE(HAVE_E, 1, have E) + e="E " + AM_CONDITIONAL(HAVE_E, true) + have_e="yes" + e_libs=`enlightenment-config --libs` + e_cflags=`enlightenment-config --cflags` + ], + [ + AC_DEFINE(HAVE_E, 0, no E) + AM_CONDITIONAL(HAVE_E, false) + AC_MSG_WARN([No E, can't build E desktop support.]) + have_e="no" + e_libs="" + e_cflags="" + ] +) + +#check for Engrave +AC_PATH_EFL( + engrave, + 0.1.0, + [ + AC_DEFINE(HAVE_ENGRAVE, 1, have Engrave) + engrave="Engrave " + AM_CONDITIONAL(HAVE_ENGRAVE, true) + have_engrave="yes" + engrave_libs=`engrave-config --libs` + engrave_cflags=`engrave-config --cflags` + ], + [ + AC_DEFINE(HAVE_ENGRAVE, 0, no Engrave) + AM_CONDITIONAL(HAVE_ENGRAVE, false) + AC_MSG_WARN([No Engrave, can't build E desktop wallpaper support (non edje).]) + have_engrave="no" + engrave_libs="" + engrave_cflags="" + ] +) + + dnl Set ETK_PACKAGE_DATA_DIR in config.h. etk_prefix="\"`etk-config --prefix`/share/etk\"" AC_DEFINE_UNQUOTED(ETK_PACKAGE_DATA_DIR, $etk_prefix, [Data dir for etk lib.]) @@ -118,8 +171,8 @@ epsilon_cflags=`epsilon-config --cflags` # add your required libs / include here -my_includes="$ecore_cflags $evas_cflags $edje_cflags $etk_cflags $epsilon_cflags" -my_libs="$ecore_libs $evas_libs $edje_libs $etk_libs $epsilon_libs" +my_includes="$ecore_cflags $evas_cflags $edje_cflags $etk_cflags $epsilon_cflags $engrave_cflags $e_cflags" +my_libs="$ecore_libs $evas_libs $edje_libs $etk_libs $epsilon_libs $engrave_libs $e_libs" AC_SUBST(my_includes) AC_SUBST(my_libs) |
From: <enl...@li...> - 2005-12-15 10:15:29
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto Dir : e17/proto/exhibit Modified Files: TODO Log Message: - bg stuff =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/exhibit/TODO,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- TODO 14 Dec 2005 15:02:33 -0000 1.2 +++ TODO 15 Dec 2005 10:15:23 -0000 1.3 @@ -7,6 +7,7 @@ - options - fix .spec file - make argv work with /path/to/image.png and not only /path/to/dir +- wallpaper setting - center, stretch, tile BUGS: |