Enlightenment CVS committal Author : rephorm Project : e17 Module : apps/elicit
Dir : e17/apps/elicit/src Modified Files: Elicit.h Makefile.am callbacks.c callbacks.h conf.c conf.h elicit.c shots.c util.c Added Files: zoom.c zoom.h Log Message: Rework zooming into a smart object. * You can now zoom in and out of an already taken shot * Resizing doesn't change the scale of the shot * Added an optional pixel grid (right click on the shot -- winter only atm). =================================================================== RCS file: /cvs/e/e17/apps/elicit/src/Elicit.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- Elicit.h 30 Dec 2005 04:12:51 -0000 1.16 +++ Elicit.h 11 Jul 2006 05:23:00 -0000 1.17 @@ -37,6 +37,7 @@ #include "swatches.h" #include "shots.h" #include "themes.h" +#include "zoom.h" struct _Elicit =================================================================== RCS file: /cvs/e/e17/apps/elicit/src/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- Makefile.am 30 Dec 2005 04:12:51 -0000 1.7 +++ Makefile.am 11 Jul 2006 05:23:00 -0000 1.8 @@ -12,7 +12,8 @@ conf.c conf.h \ swatches.c swatches.h \ shots.c shots.h \ - themes.c themes.h + themes.c themes.h \ + zoom.c zoom.h elicit_LDADD = @edje_libs@ @ecore_libs@ @edb_libs@ @evas_libs@ \ @esmart_libs@ @imlib2_libs@ @eet_libs@ -lesmart_draggies -lesmart_container =================================================================== RCS file: /cvs/e/e17/apps/elicit/src/callbacks.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- callbacks.c 10 Jul 2006 22:15:54 -0000 1.20 +++ callbacks.c 11 Jul 2006 05:23:00 -0000 1.21 @@ -93,17 +93,7 @@ if (el->flags.shooting == 1) { - Evas_Coord sw, sh; - double w, h; - - evas_object_geometry_get(el->shot, NULL, NULL, &sw, &sh); - - if (el->zoom < 1.0) el->zoom = 1.0; - - w = sw * (1 / el->zoom); - h = sh * (1 / el->zoom); - - elicit_util_shoot(el->shot, (int)w, (int)h); + elicit_zoom(el->shot); } } @@ -342,11 +332,8 @@ ecore_exe_run(buf, NULL); } } - - } - void elicit_cb_freeze(void *data, Evas_Object *o, const char *sig, const char *src) { @@ -361,6 +348,22 @@ edje_object_thaw(el->gui); } +void +elicit_cb_grid(void *data, Evas_Object *o, const char *sig, const char *src) +{ + Elicit *el = data; + + if (!strcmp(sig, "elicit,grid,toggle")) { + elicit_zoom_grid_visible_set(el->shot, !elicit_config_grid_visible_get()); + } + else if (!strcmp(sig, "elicit,grid,show")) { + elicit_zoom_grid_visible_set(el->shot, 1); + } + else if (!strcmp(sig, "elicit,grid,show")) { + elicit_zoom_grid_visible_set(el->shot, 0); + } +} + static int elicit_timer_color(void *data) { @@ -465,7 +468,7 @@ else if (elicit_glob_match(el->change_sig, "*,zoom,*")) { - el->zoom += dir * .1; + el->zoom += dir * 1; if (el->zoom < 1) el->zoom = 1; } =================================================================== RCS file: /cvs/e/e17/apps/elicit/src/callbacks.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- callbacks.h 8 Mar 2005 05:02:13 -0000 1.9 +++ callbacks.h 11 Jul 2006 05:23:00 -0000 1.10 @@ -22,5 +22,6 @@ void elicit_cb_size_min(void *data, Evas_Object *o, const char *sig, const char *src); void elicit_cb_colorclass(void *data, Evas_Object *o, const char *sig, const char *src); void elicit_cb_edit(void *data, Evas_Object *o, const char *sig, const char *src); +void elicit_cb_grid(void *data, Evas_Object *o, const char *sig, const char *src); #endif =================================================================== RCS file: /cvs/e/e17/apps/elicit/src/conf.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- conf.c 30 Dec 2005 02:51:08 -0000 1.13 +++ conf.c 11 Jul 2006 05:23:00 -0000 1.14 @@ -133,6 +133,18 @@ ecore_config_string_set("/editor", ed); } +int +elicit_config_grid_visible_get(void) +{ + return ecore_config_int_get("/show_grid"); +} + +void +elicit_config_grid_visible_set(int visible) +{ + ecore_config_int_set("/show_grid", visible); +} + static int elicit_config_listener(const char *key, const Ecore_Config_Type type, const int tag, void *data) { =================================================================== RCS file: /cvs/e/e17/apps/elicit/src/conf.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- conf.h 8 Mar 2005 05:02:13 -0000 1.5 +++ conf.h 11 Jul 2006 05:23:00 -0000 1.6 @@ -32,5 +32,7 @@ char *elicit_config_editor_get(void); void elicit_config_editor_set(char *ed); -#endif +int elicit_config_grid_visible_get(void); +void elicit_config_grid_visible_set(int visible); +#endif =================================================================== RCS file: /cvs/e/e17/apps/elicit/src/elicit.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- elicit.c 18 Dec 2005 06:53:46 -0000 1.26 +++ elicit.c 11 Jul 2006 05:23:00 -0000 1.27 @@ -129,7 +129,8 @@ el->zoom_max = elicit_config_zoom_max_get(); /* create the swatch and shot objects */ - el->shot = evas_object_image_add(el->evas); + //el->shot = evas_object_image_add(el->evas); + el->shot = elicit_zoom_add(el->evas); evas_object_name_set(el->shot, "shot"); evas_object_show(el->shot); @@ -200,6 +201,7 @@ edje_object_signal_callback_add(el->gui, "elicit,size,min,*", "*", elicit_cb_size_min, el); edje_object_signal_callback_add(el->gui, "elicit,colorclass", "*", elicit_cb_colorclass, el); edje_object_signal_callback_add(el->gui, "elicit,shot,edit", "*", elicit_cb_edit, el); + edje_object_signal_callback_add(el->gui, "elicit,grid,*", "*", elicit_cb_grid, el); edje_object_signal_callback_add(el->gui, "elicit,swatch,save", "*", elicit_swatch_save_cb, el); edje_object_signal_callback_add(el->gui, "elicit,shot,save", "*", elicit_shot_save_cb, el); @@ -257,7 +259,7 @@ edje_object_part_text_set(el->gui, "hex-val", buf); edje_object_part_text_set(el->gui, "hex-val2", buf); - snprintf(buf, sizeof(buf)-1, "%.2f", el->zoom); + snprintf(buf, sizeof(buf)-1, "%d", (int)el->zoom); edje_object_part_text_set(el->gui, "zoom-val", buf); edje_object_part_text_set(el->gui, "zoom-val2", buf); @@ -292,6 +294,7 @@ { elicit_ui_update_text(el); elicit_ui_update_sliders(el); + elicit_zoom_zoom_set(el->shot, el->zoom); evas_object_color_set(el->swatch, el->color.r, el->color.g, el->color.b, 255); } =================================================================== RCS file: /cvs/e/e17/apps/elicit/src/shots.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- shots.c 30 Dec 2005 02:51:08 -0000 1.13 +++ shots.c 11 Jul 2006 05:23:00 -0000 1.14 @@ -392,6 +392,7 @@ double length; Evas_Coord w, h; char *theme; + void *imdata; /* don't save an empty shot */ if (!el->flags.shot_taken) return; @@ -422,9 +423,9 @@ edje_object_signal_callback_add(sh->obj, "elicit,shot,del", "", elicit_shot_del_cb, sh); edje_object_signal_callback_add(sh->obj, "elicit,shot,name,show", "", elicit_shot_name_show_cb, sh); - evas_object_image_size_get(el->shot, &iw, &ih); + elicit_zoom_data_get(el->shot, &imdata, &iw, &ih); evas_object_image_size_set(sh->shot, iw, ih); - evas_object_image_data_copy_set(sh->shot, evas_object_image_data_get(el->shot, 1)); + evas_object_image_data_copy_set(sh->shot, imdata); evas_object_pass_events_set(sh->shot, 1); evas_object_show(sh->shot); edje_object_part_swallow(sh->obj, "shot", sh->shot); @@ -462,12 +463,8 @@ sh = evas_object_data_get(o, "shot"); evas_object_image_size_get(sh->shot, &iw, &ih); - evas_object_image_size_set(el->shot, iw, ih); - evas_object_image_data_copy_set(el->shot, evas_object_image_data_get(sh->shot, 1)); - evas_object_image_smooth_scale_set(el->shot, 0); - evas_object_image_data_update_add(el->shot, 0, 0, iw, ih); - /* FIXME: does the image data need to be deleted somehow with all this copying? */ + elicit_zoom_data_set(el->shot, evas_object_image_data_get(sh->shot, 1), iw, ih); elicit_ui_update(el); } =================================================================== RCS file: /cvs/e/e17/apps/elicit/src/util.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- util.c 18 Dec 2005 06:53:46 -0000 1.11 +++ util.c 11 Jul 2006 05:23:00 -0000 1.12 @@ -294,8 +294,7 @@ int iw, ih; DATA32 *data; - evas_object_image_size_get(el->shot, &iw, &ih); - data = evas_object_image_data_get(el->shot, 1); + elicit_zoom_data_get(el->shot, (void **)&data, &iw, &ih); im = imlib_create_image_using_copied_data(iw, ih, data); imlib_context_set_image(im); ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs