Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/edje
Dir : e17/libs/edje/src/lib
Modified Files:
Edje.h edje_util.c
Log Message:
add another constraint-aware min calc
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/Edje.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- Edje.h 26 Aug 2007 12:54:51 -0000 1.52
+++ Edje.h 17 Apr 2008 10:22:57 -0000 1.53
@@ -221,6 +221,7 @@
EAPI void edje_object_size_max_get (Evas_Object *obj,
Evas_Coord *maxw, Evas_Coord *maxh);
EAPI void edje_object_calc_force (Evas_Object *obj);
EAPI void edje_object_size_min_calc (Evas_Object *obj,
Evas_Coord *minw, Evas_Coord *minh);
+ EAPI void edje_object_size_min_restricted_calc(Evas_Object *obj,
Evas_Coord *minw, Evas_Coord *minh, Evas_Coord restrictedw, Evas_Coord
restrictedh);
EAPI int edje_object_part_exists (Evas_Object *obj, const
char *part);
EAPI Evas_Object *edje_object_part_object_get (Evas_Object *obj, const
char *part);
EAPI void edje_object_part_geometry_get (Evas_Object *obj, const
char *part, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_util.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -3 -r1.106 -r1.107
--- edje_util.c 31 Mar 2008 21:38:51 -0000 1.106
+++ edje_util.c 17 Apr 2008 10:22:57 -0000 1.107
@@ -1141,6 +1141,21 @@
EAPI void
edje_object_size_min_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh)
{
+ edje_object_size_min_restricted_calc(obj, minw, minh, 0, 0);
+}
+
+/** Calculate minimum size
+ * @param obj A valid Evas_Object handle
+ * @param minw Minimum width pointer
+ * @param minh Minimum height pointer
+ * @param restrictedw Do not allow object min width calc to be less than this
+ * @param restrictedh Do not allow object min height calc to be less than this
+ *
+ * Calculates the object's minimum size ?!
+ */
+EAPI void
+edje_object_size_min_restricted_calc(Evas_Object *obj, Evas_Coord *minw,
Evas_Coord *minh, Evas_Coord restrictedw, Evas_Coord restrictedh)
+{
Edje *ed;
Evas_Coord pw, ph;
int maxw, maxh;
@@ -1151,8 +1166,8 @@
ed = _edje_fetch(obj);
if ((!ed) || (!ed->collection))
{
- if (minw) *minw = 0;
- if (minh) *minh = 0;
+ if (minw) *minw = restrictedw;
+ if (minh) *minh = restrictedh;
return;
}
reset_maxwh = 1;
@@ -1161,8 +1176,8 @@
ph = ed->h;
again:
- ed->w = 0;
- ed->h = 0;
+ ed->w = restrictedw;
+ ed->h = restrictedh;
maxw = 0;
maxh = 0;
@@ -1226,6 +1241,8 @@
{
ed->w += maxw;
ed->h += maxh;
+ if (ed->w < restrictedw) ed->w = restrictedw;
+ if (ed->h < restrictedh) ed->h = restrictedh;
}
if ((ed->w > 4000) || (ed->h > 4000))
{
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs