Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_icon.c e_icon.h Log Message: add scale_up flag to limit upscaling beyond icon native size =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_icon.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- e_icon.c 8 Feb 2008 23:03:28 -0000 1.20 +++ e_icon.c 19 Jul 2008 14:09:46 -0000 1.21 @@ -10,7 +10,8 @@ Evas_Coord x, y, w, h; Evas_Object *obj; int size; - char fill_inside : 1; + unsigned char fill_inside : 1; + unsigned char scale_up : 1; }; /* local subsystem functions */ @@ -193,6 +194,29 @@ _e_icon_smart_reconfigure(sd); } +EAPI int +e_icon_scale_up_get(Evas_Object *obj) +{ + E_Smart_Data *sd; + + sd = evas_object_smart_data_get(obj); + if (sd->scale_up) return 1; + return 0; +} + +EAPI void +e_icon_scale_up_set(Evas_Object *obj, int scale_up) +{ + E_Smart_Data *sd; + + sd = evas_object_smart_data_get(obj); + if (!sd) return; + if (((sd->scale_up) && (scale_up)) || + ((!sd->scale_up) && (!scale_up))) return; + sd->scale_up = scale_up; + _e_icon_smart_reconfigure(sd); +} + EAPI void e_icon_data_set(Evas_Object *obj, void *data, int w, int h) { @@ -287,6 +311,14 @@ w = ((double)iw * h) / (double)ih; } } + if (!sd->scale_up) + { + if ((w > iw) || (h > ih)) + { + w = iw; + h = ih; + } + } x = sd->x + ((sd->w - w) / 2); y = sd->y + ((sd->h - h) / 2); evas_object_move(sd->obj, x, y); @@ -332,6 +364,7 @@ sd->w = 0; sd->h = 0; sd->fill_inside = 1; + sd->scale_up = 1; sd->size = 64; evas_object_smart_member_add(sd->obj, obj); evas_object_smart_data_set(obj, sd); =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_icon.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- e_icon.h 5 Feb 2008 12:00:19 -0000 1.11 +++ e_icon.h 19 Jul 2008 14:09:46 -0000 1.12 @@ -19,6 +19,8 @@ EAPI void e_icon_size_get (Evas_Object *obj, int *w, int *h); EAPI int e_icon_fill_inside_get (Evas_Object *obj); EAPI void e_icon_fill_inside_set (Evas_Object *obj, int fill_inside); +EAPI int e_icon_scale_up_get (Evas_Object *obj); +EAPI void e_icon_scale_up_set (Evas_Object *obj, int scale_up); EAPI void e_icon_data_set (Evas_Object *obj, void *data, int w, int h); EAPI void *e_icon_data_get (Evas_Object *obj, int *w, int *h); EAPI void e_icon_scale_size_set (Evas_Object *obj, int size); ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs