[Pkg-e-commits] [SCM] Enlightenment DR17 graphical layout and animation library branch, upstream-vcs, updated. f5b4e4555670cc3b4a24802eb44d7d47c379bee4
raster
raster at alioth.debian.org
Fri May 23 22:08:35 UTC 2008
The following commit has been merged in the upstream-vcs branch:
commit 652adcf86c0db22d33c38a5902458330f8d11e60
Author: raster <raster>
Date: Thu Apr 17 10:22:57 2008 +0000
add another constraint-aware min calc
diff --git a/src/lib/Edje.h b/src/lib/Edje.h
index e21e55a..deba12c 100644
--- a/src/lib/Edje.h
+++ b/src/lib/Edje.h
@@ -221,6 +221,7 @@ extern "C" {
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);
diff --git a/src/lib/edje_util.c b/src/lib/edje_util.c
index 2f29c73..3a715a3 100644
--- a/src/lib/edje_util.c
+++ b/src/lib/edje_util.c
@@ -1141,6 +1141,21 @@ edje_object_calc_force(Evas_Object *obj)
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 @@ edje_object_size_min_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh)
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 @@ edje_object_size_min_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh)
ph = ed->h;
again:
- ed->w = 0;
- ed->h = 0;
+ ed->w = restrictedw;
+ ed->h = restrictedh;
maxw = 0;
maxh = 0;
@@ -1226,6 +1241,8 @@ edje_object_size_min_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh)
{
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))
{
--
Enlightenment DR17 graphical layout and animation library
More information about the Pkg-e-commits
mailing list