2003-06-23 19:33:04 -07:00
|
|
|
#include "Edje.h"
|
|
|
|
#include "edje_private.h"
|
|
|
|
|
2003-07-15 22:15:15 -07:00
|
|
|
void
|
|
|
|
edje_freeze(void)
|
|
|
|
{
|
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
for (l = _edje_edjes; l; l = l->next)
|
|
|
|
edje_object_freeze((Evas_Object *)(l->data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
edje_thaw(void)
|
|
|
|
{
|
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
for (l = _edje_edjes; l; l = l->next)
|
|
|
|
edje_object_thaw((Evas_Object *)(l->data));
|
|
|
|
}
|
|
|
|
|
2003-08-05 07:33:35 -07:00
|
|
|
const char *
|
|
|
|
edje_object_data_get(Evas_Object *obj, const char *key)
|
|
|
|
{
|
|
|
|
Edje *ed;
|
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
ed = _edje_fetch(obj);
|
|
|
|
if ((!ed) || (!key))
|
|
|
|
return NULL;
|
|
|
|
if (!ed->collection) return NULL;
|
|
|
|
for (l = ed->collection->data; l; l = l->next)
|
|
|
|
{
|
|
|
|
Edje_Data *di;
|
|
|
|
|
|
|
|
di = l->data;
|
|
|
|
if (!strcmp(di->key, key)) return (const char *)di->value;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-07-12 19:06:46 -07:00
|
|
|
int
|
|
|
|
edje_object_freeze(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Edje *ed;
|
|
|
|
|
|
|
|
ed = _edje_fetch(obj);
|
|
|
|
if (!ed) return 0;
|
|
|
|
return _edje_freeze(ed);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
edje_object_thaw(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Edje *ed;
|
|
|
|
|
|
|
|
ed = _edje_fetch(obj);
|
|
|
|
if (!ed) return 0;
|
|
|
|
return _edje_thaw(ed);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
edje_object_color_class_set(Evas_Object *obj, const char *color_class, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3)
|
|
|
|
{
|
|
|
|
Edje *ed;
|
|
|
|
Evas_List *l;
|
|
|
|
Ejde_Color_Class *cc;
|
|
|
|
|
|
|
|
ed = _edje_fetch(obj);
|
|
|
|
if ((!ed) || (!color_class)) return;
|
|
|
|
if (r < 0) r = 0;
|
|
|
|
if (r > 255) r = 255;
|
|
|
|
if (g < 0) g = 0;
|
|
|
|
if (g > 255) g = 255;
|
|
|
|
if (b < 0) b = 0;
|
|
|
|
if (b > 255) b = 255;
|
|
|
|
if (a < 0) a = 0;
|
|
|
|
if (a > 255) a = 255;
|
|
|
|
for (l = ed->color_classes; l; l = l->next)
|
|
|
|
{
|
|
|
|
cc = l->data;
|
|
|
|
if (!strcmp(cc->name, color_class))
|
|
|
|
{
|
|
|
|
if ((cc->r == r) && (cc->g == g) &&
|
|
|
|
(cc->b == b) && (cc->a == a) &&
|
|
|
|
(cc->r2 == r2) && (cc->g2 == g2) &&
|
|
|
|
(cc->b2 == b2) && (cc->a2 == a2) &&
|
|
|
|
(cc->r3 == r3) && (cc->g3 == g3) &&
|
|
|
|
(cc->b3 == b3) && (cc->a3 == a3))
|
|
|
|
return;
|
|
|
|
cc->r = r;
|
|
|
|
cc->g = g;
|
|
|
|
cc->b = b;
|
|
|
|
cc->a = a;
|
|
|
|
cc->r2 = r2;
|
|
|
|
cc->g2 = g2;
|
|
|
|
cc->b2 = b2;
|
|
|
|
cc->a2 = a2;
|
|
|
|
cc->r3 = r3;
|
|
|
|
cc->g3 = g3;
|
|
|
|
cc->b3 = b3;
|
|
|
|
cc->a3 = a3;
|
|
|
|
ed->dirty = 1;
|
|
|
|
_edje_recalc(ed);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cc = malloc(sizeof(Ejde_Color_Class));
|
|
|
|
cc->name = strdup(color_class);
|
|
|
|
if (!cc->name)
|
|
|
|
{
|
|
|
|
free(cc);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
cc->r = r;
|
|
|
|
cc->g = g;
|
|
|
|
cc->b = b;
|
|
|
|
cc->a = a;
|
|
|
|
cc->r2 = r2;
|
|
|
|
cc->g2 = g2;
|
|
|
|
cc->b2 = b2;
|
|
|
|
cc->a2 = a2;
|
|
|
|
cc->r3 = r3;
|
|
|
|
cc->g3 = g3;
|
|
|
|
cc->b3 = b3;
|
|
|
|
cc->a3 = a3;
|
|
|
|
ed->color_classes = evas_list_append(ed->color_classes, cc);
|
|
|
|
ed->dirty = 1;
|
|
|
|
_edje_recalc(ed);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
edje_object_text_class_set(Evas_Object *obj, const char *text_class, const char *font, double size)
|
|
|
|
{
|
|
|
|
Edje *ed;
|
|
|
|
Evas_List *l;
|
|
|
|
Ejde_Text_Class *tc;
|
|
|
|
|
|
|
|
ed = _edje_fetch(obj);
|
|
|
|
if ((!ed) || (!text_class)) return;
|
|
|
|
if (size < 0.0) size = 0.0;
|
|
|
|
for (l = ed->text_classes; l; l = l->next)
|
|
|
|
{
|
|
|
|
tc = l->data;
|
|
|
|
if (!strcmp(tc->name, text_class))
|
|
|
|
{
|
|
|
|
if ((tc->font) && (font) &&
|
|
|
|
(!strcmp(tc->font, font)) &&
|
|
|
|
(tc->size == size))
|
|
|
|
return;
|
|
|
|
if ((!tc->font) && (!font) &&
|
|
|
|
(tc->size == size))
|
|
|
|
return;
|
|
|
|
if (tc->font) free(tc->font);
|
|
|
|
if (font) tc->font = strdup(font);
|
|
|
|
else tc->font = NULL;
|
|
|
|
tc->size = size;
|
|
|
|
ed->dirty = 1;
|
|
|
|
_edje_recalc(ed);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tc = malloc(sizeof(Ejde_Text_Class));
|
|
|
|
tc->name = strdup(text_class);
|
|
|
|
if (!tc->name)
|
|
|
|
{
|
|
|
|
free(tc);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (font) tc->font = strdup(font);
|
|
|
|
else tc->font = NULL;
|
|
|
|
tc->size = size;
|
|
|
|
ed->text_classes = evas_list_append(ed->text_classes, tc);
|
|
|
|
ed->dirty = 1;
|
|
|
|
_edje_recalc(ed);
|
|
|
|
}
|
|
|
|
|
2003-07-12 23:19:09 -07:00
|
|
|
int
|
|
|
|
edje_object_part_exists(Evas_Object *obj, const char *part)
|
|
|
|
{
|
|
|
|
Edje *ed;
|
|
|
|
Edje_Real_Part *rp;
|
|
|
|
|
|
|
|
ed = _edje_fetch(obj);
|
|
|
|
if ((!ed) || (!part)) return 0;
|
|
|
|
rp = _edje_real_part_get(ed, (char *)part);
|
|
|
|
if (!rp) return 0;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
edje_object_part_geometry_get(Evas_Object *obj, const char *part, double *x, double *y, double *w, double *h )
|
|
|
|
{
|
|
|
|
Evas_List *l;
|
|
|
|
Edje *ed;
|
|
|
|
Edje_Real_Part *rp;
|
|
|
|
|
|
|
|
ed = _edje_fetch(obj);
|
|
|
|
if ((!ed) || (!part))
|
|
|
|
{
|
|
|
|
if (x) *x = 0;
|
|
|
|
if (y) *y = 0;
|
|
|
|
if (w) *w = 0;
|
|
|
|
if (h) *h = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rp = _edje_real_part_get(ed, (char *)part);
|
|
|
|
if (!rp)
|
|
|
|
{
|
|
|
|
if (x) *x = 0;
|
|
|
|
if (y) *y = 0;
|
|
|
|
if (w) *w = 0;
|
|
|
|
if (h) *h = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (x) *x = rp->x;
|
|
|
|
if (y) *y = rp->y;
|
|
|
|
if (w) *w = rp->w;
|
|
|
|
if (h) *h = rp->h;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
edje_object_part_text_set(Evas_Object *obj, const char *part, const char *text)
|
|
|
|
{
|
|
|
|
Edje *ed;
|
|
|
|
Edje_Real_Part *rp;
|
|
|
|
|
|
|
|
ed = _edje_fetch(obj);
|
|
|
|
if ((!ed) || (!part)) return;
|
|
|
|
rp = _edje_real_part_get(ed, (char *)part);
|
|
|
|
if (!rp) return;
|
|
|
|
if (rp->part->type != EDJE_PART_TYPE_TEXT) return;
|
|
|
|
if ((!rp->text.text) && (!text))
|
|
|
|
return;
|
|
|
|
if ((rp->text.text) && (text) &&
|
|
|
|
(!strcmp(rp->text.text, text)))
|
|
|
|
return;
|
|
|
|
if (rp->text.text) free(rp->text.text);
|
|
|
|
rp->text.text = strdup(text);
|
|
|
|
ed->dirty = 1;
|
|
|
|
_edje_recalc(ed);
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
|
|
|
edje_object_part_text_get(Evas_Object *obj, const char *part)
|
|
|
|
{
|
|
|
|
Edje *ed;
|
|
|
|
Edje_Real_Part *rp;
|
|
|
|
|
|
|
|
ed = _edje_fetch(obj);
|
|
|
|
if ((!ed) || (!part)) return NULL;
|
|
|
|
rp = _edje_real_part_get(ed, (char *)part);
|
|
|
|
if (!rp) return NULL;
|
|
|
|
if (rp->part->type == EDJE_PART_TYPE_TEXT)
|
|
|
|
return evas_object_text_text_get(rp->object);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_swallow)
|
|
|
|
{
|
|
|
|
Edje *ed;
|
|
|
|
Edje_Real_Part *rp;
|
2003-07-20 05:37:49 -07:00
|
|
|
char *type;
|
2003-07-12 23:19:09 -07:00
|
|
|
|
|
|
|
ed = _edje_fetch(obj);
|
|
|
|
if ((!ed) || (!part)) return;
|
|
|
|
rp = _edje_real_part_get(ed, (char *)part);
|
|
|
|
if (!rp) return;
|
|
|
|
if (rp->swallowed_object)
|
|
|
|
{
|
2003-07-29 19:58:22 -07:00
|
|
|
evas_object_smart_member_del(rp->swallowed_object);
|
2003-07-20 05:37:49 -07:00
|
|
|
evas_object_event_callback_del(rp->swallowed_object,
|
|
|
|
EVAS_CALLBACK_FREE,
|
|
|
|
_edje_object_part_swallow_free_cb);
|
2003-07-12 23:19:09 -07:00
|
|
|
evas_object_clip_unset(rp->swallowed_object);
|
|
|
|
rp->swallowed_object = NULL;
|
|
|
|
}
|
|
|
|
if (!obj_swallow) return;
|
|
|
|
rp->swallowed_object = obj_swallow;
|
2003-07-29 19:58:22 -07:00
|
|
|
evas_object_smart_member_add(rp->swallowed_object, ed->obj);
|
2003-08-14 01:19:42 -07:00
|
|
|
if (rp->clip_to) evas_object_clip_set(rp->object, rp->clip_to->object);
|
|
|
|
else evas_object_clip_set(rp->swallowed_object, ed->clipper);
|
2003-07-27 06:16:51 -07:00
|
|
|
if (evas_object_layer_get(rp->swallowed_object) != ed->layer)
|
|
|
|
evas_object_layer_set(rp->swallowed_object, ed->layer);
|
2003-07-12 23:19:09 -07:00
|
|
|
evas_object_stack_above(rp->swallowed_object, rp->object);
|
2003-07-20 05:37:49 -07:00
|
|
|
evas_object_event_callback_add(rp->swallowed_object,
|
|
|
|
EVAS_CALLBACK_FREE,
|
|
|
|
_edje_object_part_swallow_free_cb,
|
|
|
|
obj);
|
|
|
|
type = (char *)evas_object_type_get(obj_swallow);
|
|
|
|
if ((type) && (!strcmp(type, "edje")))
|
|
|
|
{
|
|
|
|
double w, h;
|
|
|
|
|
|
|
|
edje_object_size_min_get(obj_swallow, &w, &h);
|
|
|
|
rp->swallow_params.min.w = w;
|
|
|
|
rp->swallow_params.min.h = h;
|
|
|
|
edje_object_size_max_get(obj_swallow, &w, &h);
|
|
|
|
rp->swallow_params.max.w = w;
|
|
|
|
rp->swallow_params.max.h = h;
|
|
|
|
}
|
2003-07-22 22:19:50 -07:00
|
|
|
else if ((type) && ((!strcmp(type, "text")) ||
|
|
|
|
(!strcmp(type, "polygon")) ||
|
|
|
|
(!strcmp(type, "line"))))
|
|
|
|
{
|
|
|
|
double w, h;
|
|
|
|
|
|
|
|
evas_object_geometry_get(obj_swallow, NULL, NULL, &w, &h);
|
|
|
|
rp->swallow_params.min.w = w;
|
|
|
|
rp->swallow_params.min.h = h;
|
|
|
|
rp->swallow_params.max.w = w;
|
|
|
|
rp->swallow_params.max.h = h;
|
|
|
|
}
|
2003-07-20 05:37:49 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
rp->swallow_params.min.w =
|
|
|
|
(int)evas_object_data_get(obj_swallow, "\377 edje.minw");
|
|
|
|
rp->swallow_params.min.h =
|
|
|
|
(int)evas_object_data_get(obj_swallow, "\377 edje.minh");
|
|
|
|
rp->swallow_params.max.w =
|
|
|
|
(int)evas_object_data_get(obj_swallow, "\377 edje.maxw");
|
|
|
|
rp->swallow_params.max.h =
|
|
|
|
(int)evas_object_data_get(obj_swallow, "\377 edje.maxh");
|
|
|
|
}
|
2003-07-12 23:19:09 -07:00
|
|
|
ed->dirty = 1;
|
|
|
|
_edje_recalc(ed);
|
|
|
|
}
|
|
|
|
|
2003-07-20 05:37:49 -07:00
|
|
|
void
|
|
|
|
edje_extern_object_min_size_set(Evas_Object *obj, double minw, double minh)
|
|
|
|
{
|
|
|
|
int mw, mh;
|
|
|
|
|
|
|
|
mw = minw;
|
|
|
|
if (mw < 0) mw = 0;
|
|
|
|
mh = minh;
|
|
|
|
if (mh < 0) mh = 0;
|
|
|
|
if (mw > 0)
|
|
|
|
evas_object_data_set(obj, "\377 edje.minw", (void *)mw);
|
|
|
|
else
|
|
|
|
evas_object_data_del(obj, "\377 edje.minw");
|
|
|
|
if (mh > 0)
|
|
|
|
evas_object_data_set(obj, "\377 edje.minh", (void *)mh);
|
|
|
|
else
|
|
|
|
evas_object_data_del(obj, "\377 edje.maxw");
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
edje_extern_object_max_size_set(Evas_Object *obj, double maxw, double maxh)
|
|
|
|
{
|
|
|
|
int mw, mh;
|
|
|
|
|
|
|
|
mw = maxw;
|
|
|
|
if (mw < 0) mw = 0;
|
|
|
|
mh = maxh;
|
|
|
|
if (mh < 0) mh = 0;
|
|
|
|
if (mw > 0)
|
|
|
|
evas_object_data_set(obj, "\377 edje.maxw", (void *)mw);
|
|
|
|
else
|
|
|
|
evas_object_data_del(obj, "\377 edje.maxw");
|
|
|
|
if (mh > 0)
|
|
|
|
evas_object_data_set(obj, "\377 edje.maxh", (void *)mh);
|
|
|
|
else
|
|
|
|
evas_object_data_del(obj, "\377 edje.maxh");
|
|
|
|
}
|
|
|
|
|
2003-07-12 23:19:09 -07:00
|
|
|
void
|
|
|
|
edje_object_part_unswallow(Evas_Object *obj, Evas_Object *obj_swallow)
|
|
|
|
{
|
|
|
|
Edje *ed;
|
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
ed = _edje_fetch(obj);
|
|
|
|
if ((!ed) || (!obj_swallow)) return;
|
|
|
|
for (l = ed->parts; l; l = l->next)
|
|
|
|
{
|
|
|
|
Edje_Real_Part *rp;
|
|
|
|
|
|
|
|
rp = l->data;
|
|
|
|
if (rp->swallowed_object == obj_swallow)
|
|
|
|
{
|
2003-07-29 19:58:22 -07:00
|
|
|
evas_object_smart_member_del(rp->swallowed_object);
|
2003-07-12 23:19:09 -07:00
|
|
|
evas_object_clip_unset(rp->swallowed_object);
|
|
|
|
rp->swallowed_object = NULL;
|
2003-07-20 05:37:49 -07:00
|
|
|
rp->swallow_params.min.w = 0;
|
|
|
|
rp->swallow_params.min.h = 0;
|
|
|
|
rp->swallow_params.max.w = 0;
|
|
|
|
rp->swallow_params.max.h = 0;
|
2003-07-12 23:19:09 -07:00
|
|
|
ed->dirty = 1;
|
|
|
|
_edje_recalc(ed);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Evas_Object *
|
|
|
|
edje_object_part_swallow_get(Evas_Object *obj, const char *part)
|
|
|
|
{
|
|
|
|
Edje *ed;
|
|
|
|
Edje_Real_Part *rp;
|
|
|
|
|
|
|
|
ed = _edje_fetch(obj);
|
|
|
|
if ((!ed) || (!part)) return NULL;
|
|
|
|
rp = _edje_real_part_get(ed, (char *)part);
|
|
|
|
if (!rp) return NULL;
|
|
|
|
return rp->swallowed_object;
|
|
|
|
}
|
|
|
|
|
2003-07-15 01:26:06 -07:00
|
|
|
void
|
|
|
|
edje_object_size_min_get(Evas_Object *obj, double *minw, double *minh)
|
2003-07-20 05:37:49 -07:00
|
|
|
{
|
|
|
|
Edje *ed;
|
|
|
|
|
|
|
|
ed = _edje_fetch(obj);
|
2003-07-27 06:16:51 -07:00
|
|
|
if ((!ed) || (!ed->collection))
|
2003-07-20 05:37:49 -07:00
|
|
|
{
|
|
|
|
if (minw) *minw = 0;
|
|
|
|
if (minh) *minh = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (minw) *minw = ed->collection->prop.min.w;
|
|
|
|
if (minh) *minh = ed->collection->prop.min.h;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
edje_object_size_max_get(Evas_Object *obj, double *maxw, double *maxh)
|
|
|
|
{
|
|
|
|
Edje *ed;
|
|
|
|
|
|
|
|
ed = _edje_fetch(obj);
|
2003-07-27 06:16:51 -07:00
|
|
|
if ((!ed) || (!ed->collection))
|
2003-07-20 05:37:49 -07:00
|
|
|
{
|
|
|
|
if (maxw) *maxw = 0;
|
|
|
|
if (maxh) *maxh = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (ed->collection->prop.max.w == 0)
|
|
|
|
{
|
|
|
|
if (maxw) *maxw = 1e+37;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (maxw) *maxw = ed->collection->prop.max.w;
|
|
|
|
}
|
|
|
|
if (ed->collection->prop.max.h == 0)
|
|
|
|
{
|
|
|
|
if (maxh) *maxh = 1e+37;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (maxh) *maxh = ed->collection->prop.max.h;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
edje_object_size_min_calc(Evas_Object *obj, double *minw, double *minh)
|
2003-07-15 01:26:06 -07:00
|
|
|
{
|
|
|
|
Edje *ed;
|
|
|
|
double pw, ph;
|
|
|
|
int maxw, maxh;
|
|
|
|
int ok;
|
|
|
|
|
|
|
|
ed = _edje_fetch(obj);
|
2003-07-27 06:16:51 -07:00
|
|
|
if ((!ed) || (!ed->collection))
|
2003-07-20 05:37:49 -07:00
|
|
|
{
|
|
|
|
if (minw) *minw = 0;
|
|
|
|
if (minh) *minh = 0;
|
|
|
|
return;
|
|
|
|
}
|
2003-07-15 01:26:06 -07:00
|
|
|
ed->calc_only = 1;
|
|
|
|
pw = ed->w;
|
|
|
|
ph = ed->h;
|
|
|
|
ed->w = 0;
|
|
|
|
ed->h = 0;
|
|
|
|
|
|
|
|
maxw = 0;
|
|
|
|
maxh = 0;
|
|
|
|
|
|
|
|
ok = 1;
|
|
|
|
while (ok)
|
|
|
|
{
|
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
ok = 0;
|
|
|
|
ed->dirty = 1;
|
|
|
|
_edje_recalc(ed);
|
|
|
|
for (l = ed->parts; l; l = l->next)
|
|
|
|
{
|
|
|
|
Edje_Real_Part *ep;
|
|
|
|
int w, h;
|
|
|
|
|
|
|
|
ep = l->data;
|
|
|
|
w = ep->w - ep->req.w;
|
|
|
|
h = ep->h - ep->req.h;
|
|
|
|
if (w > maxw)
|
|
|
|
{
|
|
|
|
maxw = w;
|
|
|
|
ok = 1;
|
|
|
|
}
|
|
|
|
if (h > maxh)
|
|
|
|
{
|
|
|
|
maxh = h;
|
|
|
|
ok = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ok)
|
|
|
|
{
|
|
|
|
ed->w += maxw;
|
|
|
|
ed->h += maxh;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ed->min.w = ed->w;
|
|
|
|
ed->min.h = ed->h;
|
|
|
|
|
|
|
|
if (minw) *minw = ed->min.w;
|
|
|
|
if (minh) *minh = ed->min.h;
|
|
|
|
|
|
|
|
ed->w = pw;
|
|
|
|
ed->h = ph;
|
|
|
|
ed->dirty = 1;
|
|
|
|
_edje_recalc(ed);
|
|
|
|
ed->calc_only = 0;
|
|
|
|
}
|
2003-07-12 23:19:09 -07:00
|
|
|
|
2003-07-16 06:50:28 -07:00
|
|
|
const char *
|
|
|
|
edje_object_part_state_get(Evas_Object *obj, const char *part, double *val_ret)
|
|
|
|
{
|
|
|
|
Edje *ed;
|
|
|
|
Edje_Real_Part *rp;
|
|
|
|
|
|
|
|
ed = _edje_fetch(obj);
|
|
|
|
if ((!ed) || (!part))
|
|
|
|
{
|
|
|
|
if (val_ret) *val_ret = 0;
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
rp = _edje_real_part_get(ed, (char *)part);
|
|
|
|
if (!rp)
|
|
|
|
{
|
|
|
|
if (val_ret) *val_ret = 0;
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
if (!rp->chosen_description)
|
|
|
|
{
|
|
|
|
if (val_ret) *val_ret = rp->chosen_description->state.value;
|
|
|
|
if (rp->chosen_description->state.name)
|
|
|
|
return rp->chosen_description->state.name;
|
|
|
|
return "default";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (rp->param1.description)
|
|
|
|
{
|
|
|
|
if (val_ret) *val_ret = rp->param1.description->state.value;
|
|
|
|
if (rp->param1.description->state.name)
|
|
|
|
return rp->param1.description->state.name;
|
|
|
|
return "default";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (val_ret) *val_ret = 0;
|
|
|
|
return "";
|
|
|
|
}
|
2003-07-12 23:19:09 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Edje_Real_Part *
|
|
|
|
_edje_real_part_get(Edje *ed, char *part)
|
|
|
|
{
|
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
for (l = ed->parts; l; l = l->next)
|
|
|
|
{
|
|
|
|
Edje_Real_Part *rp;
|
|
|
|
|
|
|
|
rp = l->data;
|
|
|
|
if (!strcmp(rp->part->name, part)) return rp;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-07-12 19:06:46 -07:00
|
|
|
Ejde_Color_Class *
|
|
|
|
_edje_color_class_find(Edje *ed, char *color_class)
|
|
|
|
{
|
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
if (!color_class) return NULL;
|
|
|
|
for (l = ed->color_classes; l; l = l->next)
|
|
|
|
{
|
|
|
|
Ejde_Color_Class *cc;
|
|
|
|
|
|
|
|
cc = l->data;
|
|
|
|
if (!strcmp(color_class, cc->name)) return cc;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
Ejde_Text_Class *
|
|
|
|
_edje_text_class_find(Edje *ed, char *text_class)
|
|
|
|
{
|
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
if (!text_class) return NULL;
|
|
|
|
for (l = ed->text_classes; l; l = l->next)
|
|
|
|
{
|
|
|
|
Ejde_Text_Class *tc;
|
|
|
|
|
|
|
|
tc = l->data;
|
|
|
|
if (!strcmp(text_class, tc->name)) return tc;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-06-23 19:33:04 -07:00
|
|
|
Edje *
|
|
|
|
_edje_fetch(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Edje *ed;
|
|
|
|
char *type;
|
|
|
|
|
|
|
|
type = (char *)evas_object_type_get(obj);
|
|
|
|
if (!type) return NULL;
|
|
|
|
if (strcmp(type, "edje")) return NULL;
|
|
|
|
ed = evas_object_smart_data_get(obj);
|
|
|
|
return ed;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
_edje_glob_match(char *str, char *glob)
|
|
|
|
{
|
|
|
|
if (!fnmatch(glob, str, 0)) return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
_edje_freeze(Edje *ed)
|
|
|
|
{
|
|
|
|
ed->freeze++;
|
|
|
|
return ed->freeze;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
_edje_thaw(Edje *ed)
|
|
|
|
{
|
|
|
|
ed->freeze--;
|
2003-07-15 22:15:15 -07:00
|
|
|
if (ed->freeze < 0) ed->freeze = 0;
|
|
|
|
if ((ed->freeze == 0) && (ed->recalc))
|
2003-06-23 19:33:04 -07:00
|
|
|
_edje_recalc(ed);
|
|
|
|
return ed->freeze;
|
|
|
|
}
|
2003-07-20 05:37:49 -07:00
|
|
|
|
|
|
|
void
|
|
|
|
_edje_object_part_swallow_free_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Evas_Object *edje_obj;
|
|
|
|
|
|
|
|
edje_obj = data;
|
|
|
|
edje_object_part_unswallow(edje_obj, obj);
|
|
|
|
}
|
|
|
|
|