{
int i;
- if (!ed->dirty) return;
- if (ed->freeze)
+ if (!ed->dirty)
{
+ return;
+ }
+ if ((ed->freeze > 0) || (_edje_freeze_val > 0))
+ {
+ _edje_freeze_calc_count++;
ed->recalc = 1;
if (!ed->calc_only) return;
}
// if (flags & FLAG_X)
{
minw = desc->min.w;
- if (ep->swallow_params.min.w > desc->min.w) minw = ep->swallow_params.min.w;
+ if (ep->part->scale) minw = (int)(((double)minw) * _edje_scale);
+ if (ep->swallow_params.min.w > desc->min.w)
+ minw = ep->swallow_params.min.w;
/* XXX TODO: remove need of EDJE_INF_MAX_W, see edje_util.c */
if ((ep->swallow_params.max.w <= 0) ||
(ep->swallow_params.max.w == EDJE_INF_MAX_W))
- maxw = desc->max.w;
+ {
+ maxw = desc->max.w;
+ if (maxw > 0)
+ {
+ if (ep->part->scale) maxw = (int)(((double)maxw) * _edje_scale);
+ if (maxw < 1) maxw = 1;
+ }
+ }
else
{
if (desc->max.w <= 0)
maxw = ep->swallow_params.max.w;
else
- maxw = MIN(ep->swallow_params.max.w, desc->max.w);
+ {
+ maxw = desc->max.w;
+ if (maxw > 0)
+ {
+ if (ep->part->scale) maxw = (int)(((double)maxw) * _edje_scale);
+ if (maxw < 1) maxw = 1;
+ }
+ if (ep->swallow_params.max.w < maxw)
+ maxw = ep->swallow_params.max.w;
+ }
}
- if (ep->part->scale)
+ if (maxw >= 0)
{
- minw *= _edje_scale;
- maxw *= _edje_scale;
+ if (maxw < minw) maxw = minw;
}
}
// if (flags & FLAG_Y)
{
minh = desc->min.h;
- if (ep->swallow_params.min.h > desc->min.h) minh = ep->swallow_params.min.h;
+ if (ep->part->scale) minh = (int)(((double)minh) * _edje_scale);
+ if (ep->swallow_params.min.h > desc->min.h)
+ minh = ep->swallow_params.min.h;
/* XXX TODO: remove need of EDJE_INF_MAX_H, see edje_util.c */
if ((ep->swallow_params.max.h <= 0) ||
(ep->swallow_params.max.h == EDJE_INF_MAX_H))
- maxh = desc->max.h;
+ {
+ maxh = desc->max.h;
+ if (maxh > 0)
+ {
+ if (ep->part->scale) maxh = (int)(((double)maxh) * _edje_scale);
+ if (maxh < 1) maxh = 1;
+ }
+ }
else
{
if (desc->max.h <= 0)
maxh = ep->swallow_params.max.h;
else
- maxh = MIN(ep->swallow_params.max.h, desc->max.h);
+ {
+ maxh = desc->max.h;
+ if (maxh > 0)
+ {
+ if (ep->part->scale) maxh = (int)(((double)maxh) * _edje_scale);
+ if (maxh < 1) maxh = 1;
+ }
+ if (ep->swallow_params.max.h < maxh)
+ maxh = ep->swallow_params.max.h;
+ }
}
- if (ep->part->scale)
+ if (maxh >= 0)
{
- minh *= _edje_scale;
- maxh *= _edje_scale;
+ if (maxh < minh) maxh = minh;
}
}
/* relative coords of top left & bottom right */
extern char *_edje_fontset_append;
extern double _edje_scale;
+extern int _edje_freeze_val;
+extern int _edje_freeze_calc_count;
void _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, double pos);
Edje_Part_Description *_edje_part_description_find(Edje *ed, Edje_Real_Part *rp, const char *name, double val);
char *_edje_fontset_append = NULL;
double _edje_scale = 1.0;
+int _edje_freeze_val = 0;
+int _edje_freeze_calc_count = 0;
typedef struct _Edje_List_Foreach_Data Edje_List_Foreach_Data;
/* FIXDOC: These all need to be looked over, Verified/Expanded upon. I just got lazy and stopped putting FIXDOC next to each function in this file. */
+//#define FASTFREEZE 1
+
/** Freeze all Edje objects in the current process.
*
* See edje_object_freeze() for more.
EAPI void
edje_freeze(void)
{
+#ifdef FASTFREEZE
+ _edje_freeze_val++;
+ printf("fr ++ ->%i\n", _edje_freeze_val);
+#else
+// FIXME: could just have a global freeze instead of per object
+// above i tried.. but this broke some things. notable e17's menus. why?
Evas_List *l;
- // FIXME: could just have a global freeze instead of per object
for (l = _edje_edjes; l; l = l->next)
edje_object_freeze((Evas_Object *)(l->data));
+#endif
}
/** Thaw all Edje objects in the current process.
EAPI void
edje_thaw(void)
{
+#ifdef FASTFREEZE
+ _edje_freeze_val--;
+ printf("fr -- ->%i\n", _edje_freeze_val);
+ if ((_edje_freeze_val == 0) && (_edje_freeze_calc_count > 0))
+ {
+ Evas_List *l;
+
+ _edje_freeze_calc_count = 0;
+ for (l = _edje_edjes; l; l = l->next)
+ {
+ Edje *ed;
+
+ ed = _edje_fetch(l->data);
+ if (ed->recalc)
+ {
+ if (ed->freeze == 0)
+ {
+ printf(" CALC %p\n", l->data);
+ _edje_recalc(ed);
+ }
+ else
+ printf(" !CALC %p\n", l->data);
+ }
+ }
+ }
+#else
+// FIXME: could just have a global freeze instead of per object
+// comment as above.. why?
Evas_List *l;
- // FIXME: could just have a global freeze instead of per object
for (l = _edje_edjes; l; l = l->next)
edje_object_thaw((Evas_Object *)(l->data));
+#endif
}
/* FIXDOC: Expand */
edje_object_calc_force(Evas_Object *obj)
{
Edje *ed;
- int pf;
+ int pf, pf2;
ed = _edje_fetch(obj);
if (!ed) return;
ed->dirty = 1;
+
+ pf2 = _edje_freeze_val;
pf = ed->freeze;
+
+ _edje_freeze_val = 0;
ed->freeze = 0;
+
_edje_recalc(ed);
+
ed->freeze = pf;
+ _edje_freeze_val = pf2;
}
/** Calculate minimum size