* O(1) lookup when generating alias of group.
* O(1) access time for parameters in edje_cc_handler.
* Recycle and use less memory during load time.
+
+2012-09-11 Carsten Haitzler (The Rasterman)
+
+ * Improve memory footrpint by cutting core edje real part
+ struct down by less than half its size and making some parts allocated
+ extra only if the type needs it.
Improvements:
* Check the number of parameter for image in edc.
+ * Less memory used per part in an edje file (about 25% less).
* O(1) lookup used when searching Part_Lookup in edje_cc.
* O(1) lookup when generating alias of group.
* O(1) access time for parameters in edje_cc_handler.
#include <fcntl.h>
#include <locale.h>
#include <unistd.h>
+#include <errno.h>
#include <Eina.h>
#include <Ecore.h>
#if 0
int min_w, min_h;
#endif
+ if ((ep->type != EDJE_RP_TYPE_CONTAINER) ||
+ (!ep->typedata.container)) return;
+
if ((ep->param2) && (ep->description_pos != ZERO))
{
Edje_Part_Description_Box *param2_desc = (Edje_Part_Description_Box *)ep->param2->description;
- if (ep->anim->end.layout == NULL)
+ if (ep->typedata.container->anim->end.layout == NULL)
{
- _edje_box_layout_find_all(param2_desc->box.layout, param2_desc->box.alt_layout, &ep->anim->end.layout, &ep->anim->end.data, &ep->anim->end.free_data);
- ep->anim->end.padding.x = param2_desc->box.padding.x;
- ep->anim->end.padding.y = param2_desc->box.padding.y;
- ep->anim->end.align.x = param2_desc->box.align.x;
- ep->anim->end.align.y = param2_desc->box.align.y;
+ _edje_box_layout_find_all(param2_desc->box.layout, param2_desc->box.alt_layout, &ep->typedata.container->anim->end.layout, &ep->typedata.container->anim->end.data, &ep->typedata.container->anim->end.free_data);
+ ep->typedata.container->anim->end.padding.x = param2_desc->box.padding.x;
+ ep->typedata.container->anim->end.padding.y = param2_desc->box.padding.y;
+ ep->typedata.container->anim->end.align.x = param2_desc->box.align.x;
+ ep->typedata.container->anim->end.align.y = param2_desc->box.align.y;
priv = evas_object_smart_data_get(ep->object);
if (priv == NULL)
return;
- evas_object_box_padding_set(ep->object, ep->anim->start.padding.x, ep->anim->start.padding.y);
- evas_object_box_align_set(ep->object, TO_DOUBLE(ep->anim->start.align.x), TO_DOUBLE(ep->anim->start.align.y));
- ep->anim->start.layout(ep->object, priv, ep->anim->start.data);
- _edje_box_layout_calculate_coords(ep->object, priv, ep->anim);
- ep->anim->start_progress = 0.0;
+ evas_object_box_padding_set(ep->object, ep->typedata.container->anim->start.padding.x, ep->typedata.container->anim->start.padding.y);
+ evas_object_box_align_set(ep->object, TO_DOUBLE(ep->typedata.container->anim->start.align.x), TO_DOUBLE(ep->typedata.container->anim->start.align.y));
+ ep->typedata.container->anim->start.layout(ep->object, priv, ep->typedata.container->anim->start.data);
+ _edje_box_layout_calculate_coords(ep->object, priv, ep->typedata.container->anim);
+ ep->typedata.container->anim->start_progress = 0.0;
}
evas_object_smart_changed(ep->object);
}
else
{
- ep->anim->end.layout = NULL;
+ ep->typedata.container->anim->end.layout = NULL;
}
- if (ep->description_pos < 0.01 || !ep->anim->start.layout)
+ if (ep->description_pos < 0.01 || !ep->typedata.container->anim->start.layout)
{
- _edje_box_layout_find_all(chosen_desc->box.layout, chosen_desc->box.alt_layout, &ep->anim->start.layout, &ep->anim->start.data, &ep->anim->start.free_data);
- ep->anim->start.padding.x = chosen_desc->box.padding.x;
- ep->anim->start.padding.y = chosen_desc->box.padding.y;
- ep->anim->start.align.x = chosen_desc->box.align.x;
- ep->anim->start.align.y = chosen_desc->box.align.y;
+ _edje_box_layout_find_all(chosen_desc->box.layout, chosen_desc->box.alt_layout, &ep->typedata.container->anim->start.layout, &ep->typedata.container->anim->start.data, &ep->typedata.container->anim->start.free_data);
+ ep->typedata.container->anim->start.padding.x = chosen_desc->box.padding.x;
+ ep->typedata.container->anim->start.padding.y = chosen_desc->box.padding.y;
+ ep->typedata.container->anim->start.align.x = chosen_desc->box.align.x;
+ ep->typedata.container->anim->start.align.y = chosen_desc->box.align.y;
evas_object_smart_changed(ep->object);
}
- ep->anim->progress = ep->description_pos;
+ ep->typedata.container->anim->progress = ep->description_pos;
if (evas_object_smart_need_recalculate_get(ep->object))
{
_edje_box_layout_add_child(Edje_Real_Part *rp, Evas_Object *child_obj)
{
Edje_Transition_Animation_Data *tad;
+
+ if ((rp->type != EDJE_RP_TYPE_CONTAINER) ||
+ (!rp->typedata.container)) return EINA_FALSE;
tad = calloc(1, sizeof(Edje_Transition_Animation_Data));
- if (!tad)
- return EINA_FALSE;
+ if (!tad) return EINA_FALSE;
tad->obj = child_obj;
- rp->anim->objs = eina_list_append(rp->anim->objs, tad);
- rp->anim->recalculate = EINA_TRUE;
+ rp->typedata.container->anim->objs = eina_list_append(rp->typedata.container->anim->objs, tad);
+ rp->typedata.container->anim->recalculate = EINA_TRUE;
return EINA_TRUE;
}
Eina_List *l;
Edje_Transition_Animation_Data *tad;
- EINA_LIST_FOREACH(rp->anim->objs, l, tad)
+ if ((rp->type != EDJE_RP_TYPE_CONTAINER) ||
+ (!rp->typedata.container)) return;
+ EINA_LIST_FOREACH(rp->typedata.container->anim->objs, l, tad)
{
if (tad->obj == child_obj)
{
free(eina_list_data_get(l));
- rp->anim->objs = eina_list_remove_list(rp->anim->objs, l);
- rp->anim->recalculate = EINA_TRUE;
+ rp->typedata.container->anim->objs = eina_list_remove_list(rp->typedata.container->anim->objs, l);
+ rp->typedata.container->anim->recalculate = EINA_TRUE;
break;
}
}
- rp->anim->recalculate = EINA_TRUE;
+ rp->typedata.container->anim->recalculate = EINA_TRUE;
}
{
Edje_Part_Description_External *external;
- external = (Edje_Part_Description_External*) state->description;
-
+ if ((ep->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!ep->typedata.swallow)) return;
+
+ external = (Edje_Part_Description_External*)state->description;
+
if (state->external_params)
- _edje_external_parsed_params_free(ep->swallowed_object, state->external_params);
- state->external_params = _edje_external_params_parse(ep->swallowed_object, external->external_params);
+ _edje_external_parsed_params_free(ep->typedata.swallow->swallowed_object, state->external_params);
+ state->external_params = _edje_external_params_parse(ep->typedata.swallow->swallowed_object, external->external_params);
}
}
}
memset(ep->param2, 0, sizeof(Edje_Real_Part_State));
}
else if (ep->part->type == EDJE_PART_TYPE_EXTERNAL)
- _edje_external_parsed_params_free(ep->swallowed_object,
- ep->param2->external_params);
+ {
+ if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
+ (ep->typedata.swallow))
+ _edje_external_parsed_params_free(ep->typedata.swallow->swallowed_object,
+ ep->param2->external_params);
+ }
ep->param2->external_params = NULL;
}
else
if (ep->param2)
{
if (ep->part->type == EDJE_PART_TYPE_EXTERNAL)
- _edje_external_parsed_params_free(ep->swallowed_object,
- ep->param2->external_params);
+ {
+ if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
+ (ep->typedata.swallow))
+ _edje_external_parsed_params_free(ep->typedata.swallow->swallowed_object,
+ ep->param2->external_params);
+ }
if (ep->param2)
free(ep->param2->set);
eina_mempool_free(_edje_real_part_state_mp, ep->param2);
evas_object_image_size_get(ep->object, &w, &h);
amin = amax = DIV(FROM_INT(w), FROM_INT(h));
}
- if ((ep->swallow_params.aspect.w > 0) &&
- (ep->swallow_params.aspect.h > 0))
- amin = amax =
- DIV(FROM_INT(ep->swallow_params.aspect.w),
- FROM_INT(ep->swallow_params.aspect.h));
+ if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
+ (ep->typedata.swallow))
+ {
+ if ((ep->typedata.swallow->swallow_params.aspect.w > 0) &&
+ (ep->typedata.swallow->swallow_params.aspect.h > 0))
+ amin = amax =
+ DIV(FROM_INT(ep->typedata.swallow->swallow_params.aspect.w),
+ FROM_INT(ep->typedata.swallow->swallow_params.aspect.h));
+ }
want_x = FROM_INT(params->x);
want_w = new_w = FROM_INT(params->w);
if ((amin > ZERO) && (amax > ZERO))
{
apref = desc->aspect.prefer;
- if (ep->swallow_params.aspect.mode > EDJE_ASPECT_CONTROL_NONE)
+ if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
+ (ep->typedata.swallow))
{
- switch (ep->swallow_params.aspect.mode)
+ if (ep->typedata.swallow->swallow_params.aspect.mode > EDJE_ASPECT_CONTROL_NONE)
{
- case EDJE_ASPECT_CONTROL_NEITHER:
- apref = EDJE_ASPECT_PREFER_NONE;
- break;
- case EDJE_ASPECT_CONTROL_HORIZONTAL:
- apref = EDJE_ASPECT_PREFER_HORIZONTAL;
- break;
- case EDJE_ASPECT_CONTROL_VERTICAL:
- apref = EDJE_ASPECT_PREFER_VERTICAL;
- break;
- case EDJE_ASPECT_CONTROL_BOTH:
- apref = EDJE_ASPECT_PREFER_BOTH;
- break;
- default:
- break;
+ switch (ep->typedata.swallow->swallow_params.aspect.mode)
+ {
+ case EDJE_ASPECT_CONTROL_NEITHER:
+ apref = EDJE_ASPECT_PREFER_NONE;
+ break;
+ case EDJE_ASPECT_CONTROL_HORIZONTAL:
+ apref = EDJE_ASPECT_PREFER_HORIZONTAL;
+ break;
+ case EDJE_ASPECT_CONTROL_VERTICAL:
+ apref = EDJE_ASPECT_PREFER_VERTICAL;
+ break;
+ case EDJE_ASPECT_CONTROL_BOTH:
+ apref = EDJE_ASPECT_PREFER_BOTH;
+ break;
+ default:
+ break;
+ }
}
}
switch (apref)
int *minw, int *minh,
int *maxw, int *maxh)
{
+ if ((ep->type != EDJE_RP_TYPE_TEXT) ||
+ (!ep->typedata.text))
+ return;
if (chosen_desc)
{
Evas_Coord tw, th, ins_l, ins_r, ins_t, ins_b;
if (chosen_desc->text.id_source >= 0)
{
- ep->text.source = ed->table_parts[chosen_desc->text.id_source % ed->table_parts_size];
+ ep->typedata.text->source = ed->table_parts[chosen_desc->text.id_source % ed->table_parts_size];
- tmp = edje_string_get(&((Edje_Part_Description_Text *)ep->text.source->chosen_description)->text.style);
+ tmp = edje_string_get(&((Edje_Part_Description_Text *)ep->typedata.text->source->chosen_description)->text.style);
if (tmp) style = tmp;
}
else
{
- ep->text.source = NULL;
+ ep->typedata.text->source = NULL;
tmp = edje_string_get(&chosen_desc->text.style);
if (tmp) style = tmp;
if (chosen_desc->text.id_text_source >= 0)
{
- ep->text.text_source = ed->table_parts[chosen_desc->text.id_text_source % ed->table_parts_size];
- text = edje_string_get(&((Edje_Part_Description_Text*)ep->text.text_source->chosen_description)->text.text);
+ ep->typedata.text->text_source = ed->table_parts[chosen_desc->text.id_text_source % ed->table_parts_size];
+ text = edje_string_get(&((Edje_Part_Description_Text*)ep->typedata.text->text_source->chosen_description)->text.text);
- if (ep->text.text_source->text.text) text = ep->text.text_source->text.text;
+ if (ep->typedata.text->text_source->typedata.text->text) text = ep->typedata.text->text_source->typedata.text->text;
}
else
{
- ep->text.text_source = NULL;
+ ep->typedata.text->text_source = NULL;
text = edje_string_get(&chosen_desc->text.text);
- if (ep->text.text) text = ep->text.text;
+ if (ep->typedata.text->text) text = ep->typedata.text->text;
}
EINA_LIST_FOREACH(ed->file->styles, l, stl)
{
*minw = desc->min.w;
if (ep->part->scale) *minw = TO_INT(SCALE(sc, *minw));
- if (ep->swallow_params.min.w > desc->min.w)
- *minw = ep->swallow_params.min.w;
+ if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
+ (ep->typedata.swallow))
+ {
+ if (ep->typedata.swallow->swallow_params.min.w > desc->min.w)
+ *minw = ep->typedata.swallow->swallow_params.min.w;
+ }
if (ep->edje->calc_only)
{
}
}
- /* 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))
+ if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
+ (ep->typedata.swallow))
{
- *maxw = desc->max.w;
- if (*maxw > 0)
- {
- if (ep->part->scale) *maxw = TO_INT(SCALE(sc, *maxw));
- if (*maxw < 1) *maxw = 1;
- }
- }
- else
- {
- if (desc->max.w <= 0)
- *maxw = ep->swallow_params.max.w;
- else
+ /* XXX TODO: remove need of EDJE_INF_MAX_W, see edje_util.c */
+ if ((ep->typedata.swallow->swallow_params.max.w <= 0) ||
+ (ep->typedata.swallow->swallow_params.max.w == EDJE_INF_MAX_W))
{
*maxw = desc->max.w;
if (*maxw > 0)
if (ep->part->scale) *maxw = TO_INT(SCALE(sc, *maxw));
if (*maxw < 1) *maxw = 1;
}
- if (ep->swallow_params.max.w < *maxw)
- *maxw = ep->swallow_params.max.w;
+ }
+ else
+ {
+ if (desc->max.w <= 0)
+ *maxw = ep->typedata.swallow->swallow_params.max.w;
+ else
+ {
+ *maxw = desc->max.w;
+ if (*maxw > 0)
+ {
+ if (ep->part->scale) *maxw = TO_INT(SCALE(sc, *maxw));
+ if (*maxw < 1) *maxw = 1;
+ }
+ if (ep->typedata.swallow->swallow_params.max.w < *maxw)
+ *maxw = ep->typedata.swallow->swallow_params.max.w;
+ }
+ }
+ }
+ else
+ {
+ *maxw = desc->max.w;
+ if (*maxw > 0)
+ {
+ if (ep->part->scale) *maxw = TO_INT(SCALE(sc, *maxw));
+ if (*maxw < 1) *maxw = 1;
}
}
if ((ep->edje->calc_only) && (desc->minmul.have) &&
*minh = desc->min.h;
if (ep->part->scale) *minh = TO_INT(SCALE(sc, *minh));
- if (ep->swallow_params.min.h > desc->min.h)
- *minh = ep->swallow_params.min.h;
+ if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
+ (ep->typedata.swallow))
+ {
+ if (ep->typedata.swallow->swallow_params.min.h > desc->min.h)
+ *minh = ep->typedata.swallow->swallow_params.min.h;
+ }
if (ep->edje->calc_only)
{
}
}
- /* 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;
- if (*maxh > 0)
- {
- if (ep->part->scale) *maxh = TO_INT(SCALE(sc, *maxh));
- if (*maxh < 1) *maxh = 1;
- }
- }
- else
+ if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
+ (ep->typedata.swallow))
{
- if (desc->max.h <= 0)
- *maxh = ep->swallow_params.max.h;
- else
+ /* XXX TODO: remove need of EDJE_INF_MAX_H, see edje_util.c */
+ if ((ep->typedata.swallow->swallow_params.max.h <= 0) ||
+ (ep->typedata.swallow->swallow_params.max.h == EDJE_INF_MAX_H))
{
*maxh = desc->max.h;
if (*maxh > 0)
if (ep->part->scale) *maxh = TO_INT(SCALE(sc, *maxh));
if (*maxh < 1) *maxh = 1;
}
- if (ep->swallow_params.max.h < *maxh)
- *maxh = ep->swallow_params.max.h;
+ }
+ else
+ {
+ if (desc->max.h <= 0)
+ *maxh = ep->typedata.swallow->swallow_params.max.h;
+ else
+ {
+ *maxh = desc->max.h;
+ if (*maxh > 0)
+ {
+ if (ep->part->scale) *maxh = TO_INT(SCALE(sc, *maxh));
+ if (*maxh < 1) *maxh = 1;
+ }
+ if (ep->typedata.swallow->swallow_params.max.h < *maxh)
+ *maxh = ep->typedata.swallow->swallow_params.max.h;
+ }
+ }
+ }
+ else
+ {
+ *maxh = desc->max.h;
+ if (*maxh > 0)
+ {
+ if (ep->part->scale) *maxh = TO_INT(SCALE(sc, *maxh));
+ if (*maxh < 1) *maxh = 1;
}
}
if ((ep->edje->calc_only) && (desc->minmul.have) &&
case EDJE_PART_TYPE_GROUP:
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_EXTERNAL:
- evas_object_image_source_set(ep->object, pp->swallowed_object);
+ if ((pp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (pp->typedata.swallow))
+ {
+ evas_object_image_source_set(ep->object, pp->typedata.swallow->swallowed_object);
+ }
break;
case EDJE_PART_TYPE_SPACER:
/* FIXME: detect that at compile time and prevent it */
if (ep->part->scale &&
ep->part->type == EDJE_PART_TYPE_GROUP &&
- ep->swallowed_object)
+ ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
+ (ep->typedata.swallow)) &&
+ ep->typedata.swallow->swallowed_object)
{
- edje_object_scale_set(ep->swallowed_object, TO_DOUBLE(ed->scale));
+ edje_object_scale_set(ep->typedata.swallow->swallowed_object, TO_DOUBLE(ed->scale));
if (ep->description_pos > FROM_DOUBLE(0.5) && ep->param2)
{
- edje_object_update_hints_set(ep->swallowed_object, ep->param2->description->min.limit);
+ edje_object_update_hints_set(ep->typedata.swallow->swallowed_object, ep->param2->description->min.limit);
}
else
{
- edje_object_update_hints_set(ep->swallowed_object, ep->param1.description->min.limit);
+ edje_object_update_hints_set(ep->typedata.swallow->swallowed_object, ep->param1.description->min.limit);
}
- if (edje_object_update_hints_get(ep->swallowed_object))
+ if (edje_object_update_hints_get(ep->typedata.swallow->swallowed_object))
{
Edje *ted;
- ted = _edje_fetch(ep->swallowed_object);
+ ted = _edje_fetch(ep->typedata.swallow->swallowed_object);
_edje_recalc_do(ted);
}
}
ep->param1.rel1_to_x, ep->param1.rel1_to_y, ep->param1.rel2_to_x, ep->param1.rel2_to_y,
confine_to,
p1, pos);
-
#ifdef EDJE_CALC_CACHE
if (flags == FLAG_XY)
ep->param1.state = ed->state;
/* visibility and color have no meaning on SWALLOW and GROUP part. */
evas_object_move(ep->object, ed->x + pf->x, ed->y + pf->y);
evas_object_resize(ep->object, pf->w, pf->h);
-
+
if (ep->nested_smart)
{ /* Move, Resize all nested parts */
/* Not really needed but will improve the bounding box evaluation done by Evas */
break;
}
- if (ep->swallowed_object)
+ if (((ep->type == EDJE_RP_TYPE_SWALLOW) &&
+ (ep->typedata.swallow)) &&
+ (ep->typedata.swallow->swallowed_object))
{
//// the below really is wrong - swallow color shouldn't affect swallowed object
//// color - the edje color as a WHOLE should though - and that should be
//// done via the clipper anyway. this created bugs when objects had their
//// colro set and were swallowed - then had their color changed.
- // evas_object_color_set(ep->swallowed_object,
+ // evas_object_color_set(ep->typedata.swallow->swallowed_object,
// (pf->color.r * pf->color.a) / 255,
// (pf->color.g * pf->color.a) / 255,
// (pf->color.b * pf->color.a) / 255,
// pf->color.a);
if (pf->visible)
{
- evas_object_move(ep->swallowed_object, ed->x + pf->x, ed->y + pf->y);
- evas_object_resize(ep->swallowed_object, pf->w, pf->h);
- evas_object_show(ep->swallowed_object);
+ evas_object_move(ep->typedata.swallow->swallowed_object, ed->x + pf->x, ed->y + pf->y);
+ evas_object_resize(ep->typedata.swallow->swallowed_object, pf->w, pf->h);
+ evas_object_show(ep->typedata.swallow->swallowed_object);
}
- else evas_object_hide(ep->swallowed_object);
- mo = ep->swallowed_object;
+ else evas_object_hide(ep->typedata.swallow->swallowed_object);
+ mo = ep->typedata.swallow->swallowed_object;
}
else mo = ep->object;
if (chosen_desc->map.on && ep->part->type != EDJE_PART_TYPE_SPACER)
evas_object_del(rp->object);
}
- if (rp->swallowed_object)
+ if (rp->typedata.swallow->swallowed_object)
{
- evas_object_smart_member_del(rp->swallowed_object);
- evas_object_event_callback_del(rp->swallowed_object,
+ evas_object_smart_member_del(rp->typedata.swallow->swallowed_object);
+ evas_object_event_callback_del(rp->typedata.swallow->swallowed_object,
EVAS_CALLBACK_FREE,
_edje_object_part_swallow_free_cb);
- evas_object_clip_unset(rp->swallowed_object);
- evas_object_data_del(rp->swallowed_object, "\377 edje.swallowing_part");
+ evas_object_clip_unset(rp->typedata.swallow->swallowed_object);
+ evas_object_data_del(rp->typedata.swallow->swallowed_object, "\377 edje.swallowing_part");
if (rp->part->mouse_events)
- _edje_callbacks_del(rp->swallowed_object, rp->edje);
+ _edje_callbacks_del(rp->typedata.swallow->swallowed_object, rp->edje);
if (rp->part->type == EDJE_PART_TYPE_GROUP ||
rp->part->type == EDJE_PART_TYPE_EXTERNAL)
- evas_object_del(rp->swallowed_object);
+ evas_object_del(rp->typedata.swallow->swallowed_object);
- rp->swallowed_object = NULL;
+ rp->typedata.swallow->swallowed_object = NULL;
}
- if (rp->text.text) eina_stringshare_del(rp->text.text);
- if (rp->text.font) eina_stringshare_del(rp->text.font);
- if (rp->text.cache.in_str) eina_stringshare_del(rp->text.cache.in_str);
- if (rp->text.cache.out_str) eina_stringshare_del(rp->text.cache.out_str);
+ if (rp->typedata.text->text) eina_stringshare_del(rp->typedata.text->text);
+ if (rp->typedata.text->font) eina_stringshare_del(rp->typedata.text->font);
+ if (rp->typedata.text->cache.in_str) eina_stringshare_del(rp->typedata.text->cache.in_str);
+ if (rp->typedata.text->cache.out_str) eina_stringshare_del(rp->typedata.text->cache.out_str);
if (rp->custom)
{
if (i == id) continue; //don't check the deleted id
real = ed->table_parts[i];
- if (real->text.source == rp) real->text.source = NULL;
- if (real->text.text_source == rp) real->text.text_source = NULL;
+ if (real->typedata.text->source == rp) real->typedata.text->source = NULL;
+ if (real->typedata.text->text_source == rp) real->typedata.text->text_source = NULL;
if (real->param1.rel1_to_x == rp) real->param1.rel1_to_x = NULL;
if (real->param1.rel1_to_y == rp) real->param1.rel1_to_y = NULL;
_edje_parts_id_switch(ed, rp, prev);
evas_object_stack_below(rp->object, prev->object);
- if (rp->swallowed_object)
- evas_object_stack_above(rp->swallowed_object, rp->object);
+ if (rp->typedata.swallow->swallowed_object)
+ evas_object_stack_above(rp->typedata.swallow->swallowed_object, rp->object);
_edje_edit_flag_script_dirty(eed, EINA_TRUE);
_edje_parts_id_switch(ed, rp, next);
evas_object_stack_above(rp->object, next->object);
- if (rp->swallowed_object)
- evas_object_stack_above(rp->swallowed_object, rp->object);
+ if (rp->typedata.swallow->swallowed_object)
+ evas_object_stack_above(rp->typedata.swallow->swallowed_object, rp->object);
_edje_edit_flag_script_dirty(eed, EINA_TRUE);
}
evas_object_clip_set(rp->object, ed->base.clipper);
- if (rp->swallowed_object)
- evas_object_clip_set(rp->swallowed_object, ed->base.clipper);
+ if (rp->typedata.swallow->swallowed_object)
+ evas_object_clip_set(rp->typedata.swallow->swallowed_object, ed->base.clipper);
rp->part->clip_to_id = -1;
rp->clip_to = NULL;
evas_object_pass_events_set(rp->clip_to->object, 1);
evas_object_pointer_mode_set(rp->clip_to->object, EVAS_OBJECT_POINTER_MODE_NOGRAB);
evas_object_clip_set(rp->object, rp->clip_to->object);
- if (rp->swallowed_object)
- evas_object_clip_set(rp->swallowed_object, rp->clip_to->object);
+ if (rp->typedata.swallow->swallowed_object)
+ evas_object_clip_set(rp->typedata.swallow->swallowed_object, rp->clip_to->object);
edje_object_calc_force(obj);
_edje_if_string_free(ed, rp->part->source);
- if (rp->swallowed_object)
+ if (rp->typedata.swallow->swallowed_object)
{
_edje_real_part_swallow_clear(rp);
- evas_object_del(rp->swallowed_object);
- rp->swallowed_object = NULL;
+ evas_object_del(rp->typedata.swallow->swallowed_object);
+ rp->typedata.swallow->swallowed_object = NULL;
}
if (source)
{
pi++;
}
if (external->external_params)
- rp->param1.external_params = _edje_external_params_parse(rp->swallowed_object, external->external_params);
+ rp->param1.external_params = _edje_external_params_parse(rp->typedata.swallow->swallowed_object, external->external_params);
}
}
else if (rp->part->type == EDJE_PART_TYPE_BOX)
if (!found)
external->external_params = eina_list_append(external->external_params, p);
- _edje_external_parsed_params_free(rp->swallowed_object,
+ _edje_external_parsed_params_free(rp->typedata.swallow->swallowed_object,
rp->param1.external_params);
rp->param1.external_params = \
- _edje_external_params_parse(rp->swallowed_object,
+ _edje_external_params_parse(rp->typedata.swallow->swallowed_object,
external->external_params);
Entry *en;
rp = data;
- if (!rp || !rp->entry_data || !rp->edje || !rp->edje->obj) return;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ if (!rp || !rp->typedata.text->entry_data || !rp->edje || !rp->edje->obj) return;
- en = rp->entry_data;
+ en = rp->typedata.text->entry_data;
if (!en || !en->imf_context) return;
if (evas_object_focus_get(rp->edje->obj))
Entry *en;
rp = data;
- if (!rp || !rp->entry_data) return;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ if (!rp || !rp->typedata.text->entry_data) return;
- en = rp->entry_data;
+ en = rp->typedata.text->entry_data;
if (!en || !en->imf_context) return;
ecore_imf_context_reset(en->imf_context);
#ifdef HAVE_ECORE_IMF
rp = ed->focused_part;
if (!rp) return;
-
- en = rp->entry_data;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
return;
#ifdef HAVE_ECORE_IMF
if (!rp) return;
- en = rp->entry_data;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
return;
int ignored;
Entry *en;
- en = rp->entry_data;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if ((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) &&
(en->select_allow))
return;
int ignored;
Entry *en;
- en = rp->entry_data;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
ignored = rp->part->ignore_flags & ev->event_flags;
if ((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) &&
(en->select_allow))
int ignored;
Entry *en;
- en = rp->entry_data;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if ((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) &&
(en->select_allow))
return;
Eina_Bool cursor_changed;
int old_cur_pos;
if (!rp) return;
- en = rp->entry_data;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
return;
Entry *en;
if (!rp) return;
- en = rp->entry_data;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
return;
Edje_Real_Part *rp = data;
Entry *en;
if (!rp) return;
- en = rp->entry_data;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
_edje_entry_imf_cursor_info_set(en);
}
Eina_Bool shift;
if (!rp) return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
- en = rp->entry_data;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
if (ev->flags & EVAS_BUTTON_TRIPLE_CLICK) return;
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) return;
- en = rp->entry_data;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
return;
Evas_Coord x, y, w, h;
Evas_Textblock_Cursor *tc;
if (!rp) return;
- en = rp->entry_data;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
return;
const Ecore_IMF_Context_Info *ctx_info;
#endif
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
en = calloc(1, sizeof(Entry));
if (!en) return;
- rp->entry_data = en;
+ rp->typedata.text->entry_data = en;
en->rp = rp;
evas_object_event_callback_add(rp->object, EVAS_CALLBACK_MOVE, _edje_part_move_cb, rp);
void
_edje_entry_real_part_shutdown(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
- rp->entry_data = NULL;
+ rp->typedata.text->entry_data = NULL;
_sel_clear(en->cursor, rp->object, en);
_anchors_clear(en->cursor, rp->object, en);
#ifdef HAVE_ECORE_IMF
_edje_entry_real_part_configure(Edje_Real_Part *rp)
{
Evas_Coord x, y, w, h, xx, yy, ww, hh;
- Entry *en = rp->entry_data;
+ Entry *en;
Evas_Textblock_Cursor_Type cur_type;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
switch (rp->part->cursor_mode)
{
const char *
_edje_entry_selection_get(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return NULL;
+ en = rp->typedata.text->entry_data;
if (!en) return NULL;
// get selection - convert to markup
if ((!en->selection) && (en->have_selection))
const char *
_edje_entry_text_get(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return NULL;
+ en = rp->typedata.text->entry_data;
if (!en) return NULL;
// get text - convert to markup
return evas_object_textblock_text_markup_get(rp->object);
void
_edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
_edje_entry_imf_context_reset(rp);
// set text as markup
void
_edje_entry_text_markup_append(Edje_Real_Part *rp, const char *text)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
Evas_Textblock_Cursor *end_cur;
if (!en) return;
end_cur = evas_object_textblock_cursor_new(rp->object);
void
_edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
_edje_entry_imf_context_reset(rp);
void
_edje_entry_set_cursor_start(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
_curs_start(en->cursor, rp->object, en);
void
_edje_entry_set_cursor_end(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
_curs_end(en->cursor, rp->object, en);
void
_edje_entry_select_none(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
_sel_clear(en->cursor, rp->object, en);
}
void
_edje_entry_select_all(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
_edje_entry_imf_context_reset(rp);
void
_edje_entry_select_begin(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
_edje_entry_imf_context_reset(rp);
void
_edje_entry_select_extend(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
_edje_entry_imf_context_reset(rp);
_sel_extend(en->cursor, rp->object, en);
const Eina_List *
_edje_entry_anchor_geometry_get(Edje_Real_Part *rp, const char *anchor)
{
- Entry *en = rp->entry_data;
+ Entry *en;
Eina_List *l;
Anchor *an;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return NULL;
+ en = rp->typedata.text->entry_data;
if (!en) return NULL;
EINA_LIST_FOREACH(en->anchors, l, an)
{
const Eina_List *
_edje_entry_anchors_list(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
Eina_List *l, *anchors = NULL;
Anchor *an;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return NULL;
+ en = rp->typedata.text->entry_data;
if (!en) return NULL;
if (!en->anchorlist)
{
Eina_Bool
_edje_entry_item_geometry_get(Edje_Real_Part *rp, const char *item, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
{
- Entry *en = rp->entry_data;
+ Entry *en;
Eina_List *l;
Anchor *an;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_FALSE;
+ en = rp->typedata.text->entry_data;
if (!en) return EINA_FALSE;
EINA_LIST_FOREACH(en->anchors, l, an)
{
const Eina_List *
_edje_entry_items_list(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
Eina_List *l, *items = NULL;
Anchor *an;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return NULL;
+ en = rp->typedata.text->entry_data;
if (!en) return NULL;
if (!en->itemlist)
{
_edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
{
Evas_Coord x, y, w, h, xx, yy, ww, hh;
- Entry *en = rp->entry_data;
+ Entry *en;
Evas_Textblock_Cursor_Type cur_type;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
switch (rp->part->cursor_mode)
{
void
_edje_entry_user_insert(Edje_Real_Part *rp, const char *text)
{
- Entry *en = rp->entry_data;
+ Entry *en;
Edje_Entry_Change_Info *info = calloc(1, sizeof(*info));
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
+ if (!en) return;
+ info = calloc(1, sizeof(*info));
+ if (!info) return;
info->insert = EINA_TRUE;
info->change.insert.plain_length = 1;
info->change.insert.content = eina_stringshare_add(text);
void
_edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
+ if (!en) return;
if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_DEFAULT)
return;
en->select_allow = allow;
Eina_Bool
_edje_entry_select_allow_get(const Edje_Real_Part *rp)
{
- const Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_FALSE;
+ en = rp->typedata.text->entry_data;
+ if (!en) return EINA_FALSE;
return en->select_allow;
}
void
_edje_entry_select_abort(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
+ if (!en) return;
if (en->selecting)
{
en->selecting = EINA_FALSE;
void *
_edje_entry_imf_context_get(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return NULL;
+ en = rp->typedata.text->entry_data;
if (!en) return NULL;
#ifdef HAVE_ECORE_IMF
void
_edje_entry_autocapital_type_set(Edje_Real_Part *rp, Edje_Text_Autocapital_Type autocapital_type)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
if (rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD)
Edje_Text_Autocapital_Type
_edje_entry_autocapital_type_get(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE;
+ en = rp->typedata.text->entry_data;
if (!en) return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE;
#ifdef HAVE_ECORE_IMF
void
_edje_entry_prediction_allow_set(Edje_Real_Part *rp, Eina_Bool prediction)
{
- Entry *en = rp->entry_data;
-
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
en->prediction_allow = prediction;
#ifdef HAVE_ECORE_IMF
Eina_Bool
_edje_entry_prediction_allow_get(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_FALSE;
+ en = rp->typedata.text->entry_data;
if (!en) return EINA_FALSE;
-
return en->prediction_allow;
}
void
_edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled)
{
- Entry *en = rp->entry_data;
-
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
en->input_panel_enable = enabled;
#ifdef HAVE_ECORE_IMF
Eina_Bool
_edje_entry_input_panel_enabled_get(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_FALSE;
+ en = rp->typedata.text->entry_data;
if (!en) return EINA_FALSE;
-
return en->input_panel_enable;
}
void
_edje_entry_input_panel_show(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
-
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
void
_edje_entry_input_panel_hide(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
-
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
void
_edje_entry_input_panel_language_set(Edje_Real_Part *rp, Edje_Input_Panel_Lang lang)
{
- Entry *en = rp->entry_data;
-
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
en->input_panel_lang = lang;
#ifdef HAVE_ECORE_IMF
Edje_Input_Panel_Lang
_edje_entry_input_panel_language_get(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EDJE_INPUT_PANEL_LANG_AUTOMATIC;
+ en = rp->typedata.text->entry_data;
if (!en) return EDJE_INPUT_PANEL_LANG_AUTOMATIC;
-
return en->input_panel_lang;
}
_edje_entry_input_panel_imdata_set(Edje_Real_Part *rp, const void *data __UNUSED__, int len __UNUSED__)
#endif
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
_edje_entry_input_panel_imdata_get(Edje_Real_Part *rp, void *data __UNUSED__, int *len __UNUSED__)
#endif
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
_edje_entry_input_panel_return_key_type_set(Edje_Real_Part *rp, Edje_Input_Panel_Return_Key_Type return_key_type __UNUSED__)
#endif
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
Edje_Input_Panel_Return_Key_Type
_edje_entry_input_panel_return_key_type_get(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
+ en = rp->typedata.text->entry_data;
if (!en) return EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
_edje_entry_input_panel_return_key_disabled_set(Edje_Real_Part *rp, Eina_Bool disabled __UNUSED__)
#endif
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
Eina_Bool
_edje_entry_input_panel_return_key_disabled_get(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_FALSE;
+ en = rp->typedata.text->entry_data;
if (!en) return EINA_FALSE;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
static Evas_Textblock_Cursor *
_cursor_get(Edje_Real_Part *rp, Edje_Cursor cur)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return NULL;
+ en = rp->typedata.text->entry_data;
if (!en) return NULL;
-
switch (cur)
{
case EDJE_CURSOR_MAIN:
Eina_Bool
_edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur)
{
- Entry *en = rp->entry_data;
+ Entry *en;
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_FALSE;
+ en = rp->typedata.text->entry_data;
+ if (!en) return EINA_FALSE;
+
if (!c) return EINA_FALSE;
_edje_entry_imf_context_reset(rp);
{
return EINA_FALSE;
}
- _sel_update(c, rp->object, rp->entry_data);
+ _sel_update(c, rp->object, rp->typedata.text->entry_data);
_edje_entry_imf_cursor_info_set(en);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
Eina_Bool
_edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur)
{
- Entry *en = rp->entry_data;
+ Entry *en;
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_FALSE;
+ en = rp->typedata.text->entry_data;
+ if (!en) return EINA_FALSE;
if (!c) return EINA_FALSE;
_edje_entry_imf_context_reset(rp);
else return EINA_FALSE;
}
ok:
- _sel_update(c, rp->object, rp->entry_data);
+ _sel_update(c, rp->object, rp->typedata.text->entry_data);
_edje_entry_imf_cursor_info_set(en);
Eina_Bool
_edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur)
{
- Entry *en = rp->entry_data;
+ Entry *en;
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch;
int ln;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_FALSE;
+ en = rp->typedata.text->entry_data;
+ if (!en) return EINA_FALSE;
if (!c) return EINA_FALSE;
_edje_entry_imf_context_reset(rp);
else
evas_textblock_cursor_line_char_last(c);
}
- _sel_update(c, rp->object, rp->entry_data);
+ _sel_update(c, rp->object, rp->typedata.text->entry_data);
_edje_entry_imf_cursor_info_set(en);
Eina_Bool
_edje_entry_cursor_down(Edje_Real_Part *rp, Edje_Cursor cur)
{
- Entry *en = rp->entry_data;
+ Entry *en;
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch;
int ln;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_FALSE;
+ en = rp->typedata.text->entry_data;
+ if (!en) return EINA_FALSE;
if (!c) return EINA_FALSE;
_edje_entry_imf_context_reset(rp);
else
evas_textblock_cursor_line_char_last(c);
}
- _sel_update(c, rp->object, rp->entry_data);
+ _sel_update(c, rp->object, rp->typedata.text->entry_data);
_edje_entry_imf_cursor_info_set(en);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
void
_edje_entry_cursor_begin(Edje_Real_Part *rp, Edje_Cursor cur)
{
- Entry *en = rp->entry_data;
+ Entry *en;
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
+ if (!en) return;
if (!c) return;
_edje_entry_imf_context_reset(rp);
evas_textblock_cursor_paragraph_first(c);
- _sel_update(c, rp->object, rp->entry_data);
+ _sel_update(c, rp->object, rp->typedata.text->entry_data);
_edje_entry_imf_cursor_info_set(en);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
void
_edje_entry_cursor_end(Edje_Real_Part *rp, Edje_Cursor cur)
{
- Entry *en = rp->entry_data;
+ Entry *en;
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
+ if (!en) return;
if (!c) return;
_edje_entry_imf_context_reset(rp);
- _curs_end(c, rp->object, rp->entry_data);
- _sel_update(c, rp->object, rp->entry_data);
+ _curs_end(c, rp->object, rp->typedata.text->entry_data);
+ _sel_update(c, rp->object, rp->typedata.text->entry_data);
_edje_entry_imf_cursor_info_set(en);
void
_edje_entry_cursor_copy(Edje_Real_Part *rp, Edje_Cursor cur, Edje_Cursor dst)
{
- Entry *en = rp->entry_data;
+ Entry *en;
Evas_Textblock_Cursor *c;
Evas_Textblock_Cursor *d;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
+ if (!en) return;
c = _cursor_get(rp, cur);
if (!c) return;
d = _cursor_get(rp, dst);
if (!d) return;
evas_textblock_cursor_copy(c, d);
- _sel_update(c, rp->object, rp->entry_data);
+ _sel_update(c, rp->object, rp->typedata.text->entry_data);
_edje_entry_imf_context_reset(rp);
_edje_entry_imf_cursor_info_set(en);
void
_edje_entry_cursor_line_begin(Edje_Real_Part *rp, Edje_Cursor cur)
{
- Entry *en = rp->entry_data;
+ Entry *en;
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
+ if (!en) return;
if (!c) return;
_edje_entry_imf_context_reset(rp);
evas_textblock_cursor_line_char_first(c);
- _sel_update(c, rp->object, rp->entry_data);
+ _sel_update(c, rp->object, rp->typedata.text->entry_data);
_edje_entry_imf_cursor_info_set(en);
void
_edje_entry_cursor_line_end(Edje_Real_Part *rp, Edje_Cursor cur)
{
- Entry *en = rp->entry_data;
+ Entry *en;
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
+ if (!en) return;
if (!c) return;
_edje_entry_imf_context_reset(rp);
evas_textblock_cursor_line_char_last(c);
- _sel_update(c, rp->object, rp->entry_data);
+ _sel_update(c, rp->object, rp->typedata.text->entry_data);
_edje_entry_imf_cursor_info_set(en);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
void
_edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos)
{
- Entry *en = rp->entry_data;
+ Entry *en;
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
+ if (!en) return;
if (!c) return;
/* Abort if cursor position didn't really change */
if (evas_textblock_cursor_pos_get(c) == pos)
_edje_entry_imf_context_reset(rp);
evas_textblock_cursor_pos_set(c, pos);
- _sel_update(c, rp->object, rp->entry_data);
+ _sel_update(c, rp->object, rp->typedata.text->entry_data);
_edje_entry_imf_cursor_info_set(en);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
void
_edje_entry_input_panel_layout_set(Edje_Real_Part *rp, Edje_Input_Panel_Layout layout)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
Edje_Input_Panel_Layout
_edje_entry_input_panel_layout_get(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EDJE_INPUT_PANEL_LAYOUT_INVALID;
+ en = rp->typedata.text->entry_data;
if (!en) return EDJE_INPUT_PANEL_LAYOUT_INVALID;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
void
_edje_entry_imf_context_reset(Edje_Real_Part *rp)
{
- Entry *en = rp->entry_data;
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
if (!en) return;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
{
Edje *ed = data;
Edje_Real_Part *rp = ed->focused_part;
- Entry *en;
+ Entry *en = NULL;
const char *str;
if (!rp) return EINA_FALSE;
- en = rp->entry_data;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_FALSE;
+ else
+ en = rp->typedata.text->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
return EINA_FALSE;
{
Edje *ed = data;
Edje_Real_Part *rp = ed->focused_part;
- Entry *en;
+ Entry *en = NULL;
char *commit_str = event_info;
int start_pos;
if ((!rp)) return;
-
- en = rp->entry_data;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ else
+ en = rp->typedata.text->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
return;
{
Edje *ed = data;
Edje_Real_Part *rp = ed->focused_part;
- Entry *en;
+ Entry *en = NULL;
int cursor_pos;
int preedit_start_pos, preedit_end_pos;
char *preedit_string;
if ((!rp)) return;
- en = rp->entry_data;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ else
+ en = rp->typedata.text->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
return;
{
Edje *ed = data;
Edje_Real_Part *rp = ed->focused_part;
- Entry *en;
+ Entry *en = NULL;
Ecore_IMF_Event_Delete_Surrounding *ev = event_info;
Evas_Textblock_Cursor *del_start, *del_end;
int cursor_pos;
if ((!rp) || (!ev)) return;
- en = rp->entry_data;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ else
+ en = rp->typedata.text->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
return;
rp->part->name);
return NULL;
}
- return rp->swallowed_object;
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return NULL;
+ return rp->typedata.swallow->swallowed_object;
}
EAPI Eina_Bool
ERR("no part '%s'", part);
return EINA_FALSE;
}
-
- return _edje_external_content_get(rp->swallowed_object, content);
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return NULL;
+ return _edje_external_content_get(rp->typedata.swallow->swallowed_object, content);
}
EAPI Edje_External_Param_Type
ERR("no part '%s'", part);
return EDJE_EXTERNAL_PARAM_TYPE_MAX;
}
- type = evas_object_data_get(rp->swallowed_object, "Edje_External_Type");
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return EDJE_EXTERNAL_PARAM_TYPE_MAX;
+ type = evas_object_data_get(rp->typedata.swallow->swallowed_object, "Edje_External_Type");
if (!type)
{
ERR("no external type for object %p", obj);
Eina_Bool
_edje_external_param_set(Evas_Object *obj, Edje_Real_Part *rp, const Edje_External_Param *param)
{
- Evas_Object *swallowed_object = rp->swallowed_object;
+ Evas_Object *swallowed_object;
+
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return EINA_FALSE;
+ swallowed_object = rp->typedata.swallow->swallowed_object;
Edje_External_Type *type = evas_object_data_get(swallowed_object, "Edje_External_Type");
if (!type)
{
Eina_Bool
_edje_external_param_get(const Evas_Object *obj, Edje_Real_Part *rp, Edje_External_Param *param)
{
- Evas_Object *swallowed_object = rp->swallowed_object;
+ Evas_Object *swallowed_object;
+
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return EINA_FALSE;
+ swallowed_object = rp->typedata.swallow->swallowed_object;
Edje_External_Type *type = evas_object_data_get(swallowed_object, "Edje_External_Type");
if (!type)
{
Edje_Part_Description_External *ext;
void *params1, *params2 = NULL;
- if (!ep->swallowed_object) return;
- type = evas_object_data_get(ep->swallowed_object, "Edje_External_Type");
+ if ((ep->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!ep->typedata.swallow)) return;
+ if (!ep->typedata.swallow->swallowed_object) return;
+ type = evas_object_data_get(ep->typedata.swallow->swallowed_object, "Edje_External_Type");
if ((!type) || (!type->state_set)) return;
ep->param2->external_params : ext->external_params;
}
- type->state_set(type->data, ep->swallowed_object,
+ type->state_set(type->data, ep->typedata.swallow->swallowed_object,
params1, params2, ep->description_pos);
}
for (n = 0; n < ed->collection->parts_count; n++)
{
Edje_Part *ep;
+ Eina_Bool memerr = EINA_FALSE;
ep = ed->collection->parts[n];
rp->drag->step.x = FROM_INT(ep->dragable.step_x);
rp->drag->step.y = FROM_INT(ep->dragable.step_y);
}
+ // allow part type specific data - this keeps real_part smaller
+ switch (ep->type)
+ {
+ case EDJE_PART_TYPE_TEXT:
+ case EDJE_PART_TYPE_TEXTBLOCK:
+ rp->type = EDJE_RP_TYPE_TEXT;
+ rp->typedata.text = calloc(1, sizeof(Edje_Real_Part_Text));
+ if (!rp->typedata.text) memerr = EINA_TRUE;
+ break;
+ case EDJE_PART_TYPE_GROUP:
+ case EDJE_PART_TYPE_SWALLOW:
+ case EDJE_PART_TYPE_EXTERNAL:
+ rp->type = EDJE_RP_TYPE_SWALLOW;
+ rp->typedata.swallow = calloc(1, sizeof(Edje_Real_Part_Swallow));
+ if (!rp->typedata.swallow) memerr = EINA_TRUE;
+ break;
+ case EDJE_PART_TYPE_BOX:
+ case EDJE_PART_TYPE_TABLE:
+ rp->type = EDJE_RP_TYPE_CONTAINER;
+ rp->typedata.container = calloc(1, sizeof(Edje_Real_Part_Container));
+ if (!rp->typedata.container) memerr = EINA_TRUE;
+ break;
+ default:
+ break;
+ }
+
+ if (memerr)
+ {
+ if (rp->drag) free(rp->drag);
+ ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
+ eina_mempool_free(_edje_real_part_mp, rp);
+ evas_event_thaw(tev);
+ evas_event_thaw_eval(tev);
+ return 0;
+ }
rp->edje = ed;
_edje_ref(rp->edje);
case EDJE_PART_TYPE_BOX:
sources = eina_list_append(sources, rp);
rp->object = evas_object_box_add(ed->base.evas);
- rp->anim = _edje_box_layout_anim_new(rp->object);
+ rp->typedata.container->anim = _edje_box_layout_anim_new(rp->object);
break;
case EDJE_PART_TYPE_TABLE:
sources = eina_list_append(sources, rp);
rp->events_to = NULL;
}
- rp->swallow_params.min.w = 0;
- rp->swallow_params.min.h = 0;
- rp->swallow_params.max.w = -1;
- rp->swallow_params.max.h = -1;
+ if ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (rp->typedata.swallow))
+ {
+ rp->typedata.swallow->swallow_params.min.w = 0;
+ rp->typedata.swallow->swallow_params.min.h = 0;
+ rp->typedata.swallow->swallow_params.max.w = -1;
+ rp->typedata.swallow->swallow_params.max.h = -1;
+ }
if (rp->part->type == EDJE_PART_TYPE_TEXT
|| rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)
text->text.id_text_source = -1;
}
- if (text->text.id_source >= 0)
- rp->text.source = ed->table_parts[text->text.id_source % ed->table_parts_size];
- if (text->text.id_text_source >= 0)
- rp->text.text_source = ed->table_parts[text->text.id_text_source % ed->table_parts_size];
+ if ((rp->type == EDJE_RP_TYPE_TEXT) &&
+ (rp->typedata.text))
+ {
+ if (text->text.id_source >= 0)
+ rp->typedata.text->source = ed->table_parts[text->text.id_source % ed->table_parts_size];
+ if (text->text.id_text_source >= 0)
+ rp->typedata.text->text_source = ed->table_parts[text->text.id_text_source % ed->table_parts_size];
+ }
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
{
_edje_entry_real_part_init(rp);
}
else
{
- pack_it->parent = rp;
-
- _edje_object_pack_item_hints_set(child_obj, pack_it);
- if (pack_it->name)
- evas_object_name_set(child_obj, pack_it->name);
-
- if (rp->part->type == EDJE_PART_TYPE_BOX)
- {
- _edje_real_part_box_append(rp, child_obj);
- evas_object_data_set(child_obj, "\377 edje.box_item", pack_it);
- }
- else if (rp->part->type == EDJE_PART_TYPE_TABLE)
- {
- _edje_real_part_table_pack(rp, child_obj, pack_it->col, pack_it->row, pack_it->colspan, pack_it->rowspan);
- evas_object_data_set(child_obj, "\377 edje.table_item", pack_it);
- }
- _edje_subobj_register(ed, child_obj);
- evas_object_show(child_obj);
- rp->items = eina_list_append(rp->items, child_obj);
-
- if (item_count > 0)
- {
- pack_it = *curr_item;
- source = pack_it->source;
- curr_item++;
- item_count--;
- }
- else
- {
- source = NULL;
- curr_item = NULL;
- pack_it = NULL;
- }
+ if ((rp->type == EDJE_RP_TYPE_CONTAINER) &&
+ (rp->typedata.container))
+ {
+ pack_it->parent = rp;
+
+ _edje_object_pack_item_hints_set(child_obj, pack_it);
+ if (pack_it->name)
+ evas_object_name_set(child_obj, pack_it->name);
+
+ if (rp->part->type == EDJE_PART_TYPE_BOX)
+ {
+ _edje_real_part_box_append(rp, child_obj);
+ evas_object_data_set(child_obj, "\377 edje.box_item", pack_it);
+ }
+ else if (rp->part->type == EDJE_PART_TYPE_TABLE)
+ {
+ _edje_real_part_table_pack(rp, child_obj, pack_it->col, pack_it->row, pack_it->colspan, pack_it->rowspan);
+ evas_object_data_set(child_obj, "\377 edje.table_item", pack_it);
+ }
+ _edje_subobj_register(ed, child_obj);
+ evas_object_show(child_obj);
+ rp->typedata.container->items = eina_list_append(rp->typedata.container->items, child_obj);
+
+ if (item_count > 0)
+ {
+ pack_it = *curr_item;
+ source = pack_it->source;
+ curr_item++;
+ item_count--;
+ }
+ else
+ {
+ source = NULL;
+ curr_item = NULL;
+ pack_it = NULL;
+ }
+ }
}
}
}
_edje_callbacks_focus_del(rp->object, ed);
evas_object_del(rp->object);
}
- if (rp->swallowed_object)
- {
- /* Objects swallowed by the app do not get deleted,
- but those internally swallowed (GROUP type) do. */
- switch (rp->part->type)
- {
- case EDJE_PART_TYPE_EXTERNAL:
- _edje_external_parsed_params_free(rp->swallowed_object, rp->param1.external_params);
- if (rp->param2)
- _edje_external_parsed_params_free(rp->swallowed_object, rp->param2->external_params);
- case EDJE_PART_TYPE_GROUP:
- evas_object_del(rp->swallowed_object);
- default:
- break;
- }
- _edje_real_part_swallow_clear(rp);
- rp->swallowed_object = NULL;
- }
- if (rp->items)
- {
- /* evas_box/table handles deletion of objects */
- rp->items = eina_list_free(rp->items);
- }
- if (rp->anim)
+ if ((rp->type == EDJE_RP_TYPE_CONTAINER) &&
+ (rp->typedata.container))
+ {
+ if (rp->typedata.container->items)
+ {
+ /* evas_box/table handles deletion of objects */
+ rp->typedata.container->items = eina_list_free(rp->typedata.container->items);
+ }
+ if (rp->typedata.container->anim)
+ {
+ _edje_box_layout_free_data(rp->typedata.container->anim);
+ rp->typedata.container->anim = NULL;
+ }
+ free(rp->typedata.container);
+ }
+ else if ((rp->type == EDJE_RP_TYPE_TEXT) &&
+ (rp->typedata.text))
+ {
+ if (rp->typedata.text->text) eina_stringshare_del(rp->typedata.text->text);
+ if (rp->typedata.text->font) eina_stringshare_del(rp->typedata.text->font);
+ if (rp->typedata.text->cache.in_str) eina_stringshare_del(rp->typedata.text->cache.in_str);
+ if (rp->typedata.text->cache.out_str) eina_stringshare_del(rp->typedata.text->cache.out_str);
+ free(rp->typedata.text);
+ }
+ else if ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (rp->typedata.swallow))
{
- _edje_box_layout_free_data(rp->anim);
- rp->anim = NULL;
+ if (rp->typedata.swallow->swallowed_object)
+ {
+ /* Objects swallowed by the app do not get deleted,
+ but those internally swallowed (GROUP type) do. */
+ switch (rp->part->type)
+ {
+ case EDJE_PART_TYPE_EXTERNAL:
+ _edje_external_parsed_params_free(rp->typedata.swallow->swallowed_object, rp->param1.external_params);
+ if (rp->param2)
+ _edje_external_parsed_params_free(rp->typedata.swallow->swallowed_object, rp->param2->external_params);
+ case EDJE_PART_TYPE_GROUP:
+ evas_object_del(rp->typedata.swallow->swallowed_object);
+ default:
+ break;
+ }
+ _edje_real_part_swallow_clear(rp);
+ rp->typedata.swallow->swallowed_object = NULL;
+ }
+ free(rp->typedata.swallow);
}
- if (rp->text.text) eina_stringshare_del(rp->text.text);
- if (rp->text.font) eina_stringshare_del(rp->text.font);
- if (rp->text.cache.in_str) eina_stringshare_del(rp->text.cache.in_str);
- if (rp->text.cache.out_str) eina_stringshare_del(rp->text.cache.out_str);
if (rp->custom)
{
if (rp->custom)
free(rp->custom->set);
eina_mempool_free(_edje_real_part_state_mp, rp->custom);
-
+
_edje_unref(rp->edje);
eina_mempool_free(_edje_real_part_mp, rp);
}
typedef struct _Edje_Part_Limit Edje_Part_Limit;
typedef struct _Edje Edje;
+typedef struct _Edje_Real_Part_Text Edje_Real_Part_Text;
+typedef struct _Edje_Real_Part_Swallow Edje_Real_Part_Swallow;
+typedef struct _Edje_Real_Part_Container Edje_Real_Part_Container;
typedef struct _Edje_Real_Part_State Edje_Real_Part_State;
typedef struct _Edje_Real_Part_Drag Edje_Real_Part_Drag;
typedef struct _Edje_Real_Part_Set Edje_Real_Part_Set;
Edje_Real_Part *confine_to; // 4
}; // 104
-struct _Edje_Real_Part
+#define EDJE_RP_TYPE_NONE 0
+#define EDJE_RP_TYPE_TEXT 1
+#define EDJE_RP_TYPE_CONTAINER 2
+#define EDJE_RP_TYPE_SWALLOW 3
+
+struct _Edje_Real_Part_Text
+{
+ void *entry_data; // 4
+ Edje_Real_Part *source; // 4
+ Edje_Real_Part *text_source; // 4
+ const char *text; // 4
+ const char *font; // 4
+ const char *style; // 4
+ Edje_Position offset; // 8
+ short size; // 2
+ struct {
+ unsigned char fit_x, fit_y; // 2
+ short in_size; // 2
+ short out_size; // 2
+ float elipsis; // 4
+ Evas_Coord in_w, in_h; // 8
+ const char *in_str; // 4
+ const char *out_str; // 4
+ FLOAT_T align_x, align_y; // 16
+ } cache;
+}; // 76
+// FIXME make text a potiner to struct and alloc at end
+// if part type is TEXT move common members textblock +
+// text to front and have smaller struct for textblock
+
+struct _Edje_Real_Part_Container
{
- Edje *edje; // 4
- Edje_Part *part; // 4
- Evas_Object *object; // 4
- Evas_Object *nested_smart; // 4
- int x, y, w, h; // 16
- Edje_Rectangle req; // 16
-
Eina_List *items; // 4 //FIXME: only if table/box
Edje_Part_Box_Animation *anim; // 4 //FIXME: Used only if box
- void *entry_data; // 4 // FIXME: move to entry section
+};
- Evas_Object *swallowed_object; // 4 // FIXME: move with swallow_params data
+struct _Edje_Real_Part_Swallow
+{
+ Evas_Object *swallowed_object; // 4 // FIXME: move with swallow_params data
struct {
Edje_Size min, max; // 16
Edje_Aspect aspect; // 12
} swallow_params; // 28 // FIXME: only if type SWALLOW
+};
+struct _Edje_Real_Part
+{
+ Edje *edje; // 4
+ Edje_Part *part; // 4
+ int x, y, w, h; // 16
+ Edje_Rectangle req; // 16
+ Evas_Object *object; // 4
+ Evas_Object *nested_smart; // 4
Edje_Real_Part_Drag *drag; // 4
Edje_Real_Part *events_to; // 4
-
- struct {
- Edje_Real_Part *source; // 4
- Edje_Real_Part *text_source; // 4
- const char *text; // 4
- Edje_Position offset; // 8 text only
- const char *font; // 4 text only
- const char *style; // 4 text only
- int size; // 4 text only
- struct {
- double in_w, in_h; // 16 text only
- int in_size; // 4 text only
- const char *in_str; // 4 text only
- const char *out_str; // 4 text only
- int out_size; // 4 text only
- FLOAT_T align_x, align_y; // 16 text only
- double elipsis; // 8 text only
- int fit_x, fit_y; // 8 text only
- } cache; // 64
- } text; // 86 // FIXME make text a potiner to struct and alloc at end
- // if part type is TEXT move common members textblock +
- // text to front and have smaller struct for textblock
-
FLOAT_T description_pos; // 8
Edje_Part_Description_Common *chosen_description; // 4
- Edje_Real_Part_State param1; // 20
+ Edje_Real_Part_State param1; // 32
// WITH EDJE_CALC_CACHE: 140
Edje_Real_Part_State *param2, *custom; // 8
Edje_Calc_Params *current; // 4
-
-#ifdef EDJE_CALC_CACHE
- int state; // 4
-#endif
-
Edje_Real_Part *clip_to; // 4
-
Edje_Running_Program *program; // 4
-
+ union {
+ Edje_Real_Part_Text *text;
+ Edje_Real_Part_Container *container;
+ Edje_Real_Part_Swallow *swallow;
+ } typedata; // 4
int clicked_button; // 4
-
+#ifdef EDJE_CALC_CACHE
+ int state; // 4
+#endif
+ unsigned char type; // 1
unsigned char calculated; // 1
unsigned char calculating; // 1
-
unsigned char still_in : 1; // 1
#ifdef EDJE_CALC_CACHE
unsigned char invalidate : 1; // 0
#endif
-}; // 268
+}; // 287 -> 126
// WITH EDJE_CALC_CACHE: 404
struct _Edje_Running_Program
{
Edje_Real_Part *rp;
rp = ed->table_parts[i];
- if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
- edje_object_play_set(rp->swallowed_object, play);
+ if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
+ ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (rp->typedata.swallow)) &&
+ (rp->typedata.swallow->swallowed_object))
+ edje_object_play_set(rp->typedata.swallow->swallowed_object, play);
}
}
{
Edje_Real_Part *rp;
rp = ed->table_parts[i];
- if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
- edje_object_animation_set(rp->swallowed_object, on);
+ if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
+ ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (rp->typedata.swallow)) &&
+ (rp->typedata.swallow->swallowed_object))
+ edje_object_animation_set(rp->typedata.swallow->swallowed_object, on);
}
_edje_thaw(ed);
for (i = 0; i < ed->table_parts_size; ++i)
{
rp = ed->table_parts[i];
- if (rp && rp->swallowed_object == focused)
+ if ((rp) &&
+ ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (rp->typedata.swallow)) &&
+ (rp->typedata.swallow->swallowed_object == focused))
{
evas_object_focus_set(focused, EINA_FALSE);
break;
if (pt->id >= 0)
{
rp = ed->table_parts[pt->id % ed->table_parts_size];
- if (rp && rp->swallowed_object)
- evas_object_focus_set(rp->swallowed_object, EINA_TRUE);
+ if (rp &&
+ ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (rp->typedata.swallow)) &&
+ (rp->typedata.swallow->swallowed_object))
+ evas_object_focus_set(rp->typedata.swallow->swallowed_object, EINA_TRUE);
}
}
}
switch (rp->part->type)
{
case EDJE_PART_TYPE_GROUP:
- if (!rp->swallowed_object) goto end;
- ed2 = _edje_fetch(rp->swallowed_object);
+ if (((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) ||
+ (!rp->typedata.swallow->swallowed_object))
+ goto end;
+ ed2 = _edje_fetch(rp->typedata.swallow->swallowed_object);
if (!ed2) goto end;
_edje_emit(ed2, newsig, src);
break;
case EDJE_PART_TYPE_EXTERNAL:
- if (!rp->swallowed_object) break ;
+ if (((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) ||
+ (!rp->typedata.swallow->swallowed_object))
+ break;
if (!idx)
{
- _edje_external_signal_emit(rp->swallowed_object, newsig, src);
+ _edje_external_signal_emit(rp->typedata.swallow->swallowed_object, newsig, src);
}
else
{
static Edje_External_Param *
_edje_param_external_get(Edje_Real_Part *rp, const char *name, Edje_External_Param *param)
{
- Evas_Object *swallowed_object = rp->swallowed_object;
+ Evas_Object *swallowed_object;
const Edje_External_Param_Info *info;
+
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return NULL;
+ swallowed_object = rp->typedata.swallow->swallowed_object;
info = _edje_external_param_info_get(swallowed_object, name);
if (!info) return NULL;
_edje_recalc_do(rp->edje);
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
param->s = _edje_entry_text_get(rp);
- else if (rp->part->type == EDJE_PART_TYPE_TEXT)
- param->s = rp->text.text;
+ else if ((rp->part->type == EDJE_PART_TYPE_TEXT) &&
+ ((rp->type == EDJE_RP_TYPE_TEXT) &&
+ (rp->typedata.text)))
+ param->s = rp->typedata.text->text;
else
param->s = evas_object_textblock_text_markup_get(rp->object);
return param;
*free_ptr = unescaped;
param->s = unescaped;
}
- else if (rp->part->type == EDJE_PART_TYPE_TEXT)
- param->s = rp->text.text;
+ else if ((rp->part->type == EDJE_PART_TYPE_TEXT) &&
+ ((rp->type == EDJE_RP_TYPE_TEXT) &&
+ (rp->typedata.text)))
+ param->s = rp->typedata.text->text;
else
{
const char *tmp;
return param;
}
- if ((rp->entry_data) &&
- (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) &&
- (!strcmp(name, "select_allow")))
+ if (((rp->type == EDJE_RP_TYPE_TEXT) &&
+ (rp->typedata.text)) &&
+ ((rp->typedata.text->entry_data) &&
+ (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) &&
+ (!strcmp(name, "select_allow"))))
{
param->name = name;
param->type = EDJE_EXTERNAL_PARAM_TYPE_BOOL;
return EINA_TRUE;
}
- if ((rp->entry_data) &&
- (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) &&
- (!strcmp(name, "select_allow")))
+ if (((rp->type == EDJE_RP_TYPE_TEXT) &&
+ (rp->typedata.text)) &&
+ ((rp->typedata.text->entry_data) &&
+ (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) &&
+ (!strcmp(name, "select_allow"))))
{
if (param->type != EDJE_EXTERNAL_PARAM_TYPE_BOOL)
return EINA_FALSE;
if ((!src_part) || (!src_param) || (!dst_part) || (!dst_param))
return;
- if (dst_part->part->type == EDJE_PART_TYPE_EXTERNAL)
+ if ((dst_part->part->type == EDJE_PART_TYPE_EXTERNAL) &&
+ (dst_part->type == EDJE_RP_TYPE_SWALLOW) &&
+ (dst_part->typedata.swallow))
dst_info = _edje_external_param_info_get
- (dst_part->swallowed_object, dst_param);
+ (dst_part->typedata.swallow->swallowed_object, dst_param);
else
dst_info = _edje_native_param_info_get(dst_part, dst_param);
if ((!part) || (!param) || (!value))
return;
- if (part->part->type == EDJE_PART_TYPE_EXTERNAL)
- info = _edje_external_param_info_get(part->swallowed_object, param);
+ if ((part->part->type == EDJE_PART_TYPE_EXTERNAL) &&
+ (part->type == EDJE_RP_TYPE_SWALLOW) &&
+ (part->typedata.swallow))
+ info = _edje_external_param_info_get(part->typedata.swallow->swallowed_object, param);
else
info = _edje_native_param_info_get(part, param);
for (i = 0; i < ed->table_parts_size; i++)
{
Edje_Real_Part *ep;
- Evas_Coord ox, oy;
ep = ed->table_parts[i];
- evas_object_geometry_get(ep->object, &ox, &oy, NULL, NULL);
- evas_object_move(ep->object, ed->x + ep->x + ep->text.offset.x, ed->y + ep->y + ep->text.offset.y);
+ if ((ep->type == EDJE_RP_TYPE_TEXT) &&
+ (ep->typedata.text))
+ evas_object_move(ep->object,
+ ed->x + ep->x + ep->typedata.text->offset.x,
+ ed->y + ep->y + ep->typedata.text->offset.y);
+ else
+ evas_object_move(ep->object,
+ ed->x + ep->x,
+ ed->y + ep->y);
if (ep->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
_edje_entry_real_part_configure(ep);
- if (ep->swallowed_object)
+ if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
+ (ep->typedata.swallow))
{
- evas_object_geometry_get(ep->swallowed_object, &ox, &oy, NULL, NULL);
- evas_object_move(ep->swallowed_object, ed->x + ep->x + ep->text.offset.x, ed->y + ep->y + ep->text.offset.y);
+ if (ep->typedata.swallow->swallowed_object)
+ evas_object_move
+ (ep->typedata.swallow->swallowed_object,
+ ed->x + ep->x,
+ ed->y + ep->y);
}
}
}
int inlined_font = 0, free_text = 0;
Eina_Bool same_text = EINA_FALSE;
FLOAT_T sc;
-
+
+ if ((ep->type != EDJE_RP_TYPE_TEXT) ||
+ (!ep->typedata.text)) return;
sc = ed->scale;
if (sc == 0.0) sc = _edje_scale;
text = edje_string_get(&chosen_desc->text.text);
font = _edje_text_class_font_get(ed, chosen_desc, &size, &sfont);
- if (ep->text.text) text = ep->text.text;
- if (ep->text.font) font = ep->text.font;
- if (ep->text.size > 0) size = ep->text.size;
+ if (ep->typedata.text->text) text = ep->typedata.text->text;
+ if (ep->typedata.text->font) font = ep->typedata.text->font;
+ if (ep->typedata.text->size > 0) size = ep->typedata.text->size;
- if (ep->text.text_source)
+ if (ep->typedata.text->text_source)
{
- text = edje_string_get(&(((Edje_Part_Description_Text *)ep->text.text_source->chosen_description)->text.text));
- if (ep->text.text_source->text.text) text = ep->text.text_source->text.text;
+ text = edje_string_get(&(((Edje_Part_Description_Text *)ep->typedata.text->text_source->chosen_description)->text.text));
+ if (ep->typedata.text->text_source->typedata.text->text) text = ep->typedata.text->text_source->typedata.text->text;
}
- if (ep->text.source)
+ if (ep->typedata.text->source)
{
- font = edje_string_get(&(((Edje_Part_Description_Text *)ep->text.source->chosen_description)->text.font));
- size = ((Edje_Part_Description_Text *)ep->text.source->chosen_description)->text.size;
- if (ep->text.source->text.font) font = ep->text.source->text.font;
- if (ep->text.source->text.size > 0) size = ep->text.source->text.size;
+ font = edje_string_get(&(((Edje_Part_Description_Text *)ep->typedata.text->source->chosen_description)->text.font));
+ size = ((Edje_Part_Description_Text *)ep->typedata.text->source->chosen_description)->text.size;
+ if (ep->typedata.text->source->typedata.text->font) font = ep->typedata.text->source->typedata.text->font;
+ if (ep->typedata.text->source->typedata.text->size > 0) size = ep->typedata.text->source->typedata.text->size;
}
if (!text) text = "";
size = params->type.text.size;
if (!text) text = "";
- if ((text == ep->text.cache.in_str)
- || (text && ep->text.cache.in_str && !strcmp(ep->text.cache.in_str, text)))
+ if ((text == ep->typedata.text->cache.in_str)
+ || (text && ep->typedata.text->cache.in_str && !strcmp(ep->typedata.text->cache.in_str, text)))
{
- text = ep->text.cache.in_str;
+ text = ep->typedata.text->cache.in_str;
same_text = EINA_TRUE;
}
- if ((ep->text.cache.in_size == size) &&
- (ep->text.cache.in_w == sw) &&
- (ep->text.cache.in_h == sh) &&
- (ep->text.cache.in_str) &&
+ if ((ep->typedata.text->cache.in_size == size) &&
+ (ep->typedata.text->cache.in_w == sw) &&
+ (ep->typedata.text->cache.in_h == sh) &&
+ (ep->typedata.text->cache.in_str) &&
same_text &&
- (ep->text.cache.align_x == params->type.text.align.x) &&
- (ep->text.cache.align_y == params->type.text.align.y) &&
- (ep->text.cache.elipsis == params->type.text.elipsis) &&
- (ep->text.cache.fit_x == chosen_desc->text.fit_x) &&
- (ep->text.cache.fit_y == chosen_desc->text.fit_y))
+ (ep->typedata.text->cache.align_x == params->type.text.align.x) &&
+ (ep->typedata.text->cache.align_y == params->type.text.align.y) &&
+ (ep->typedata.text->cache.elipsis == params->type.text.elipsis) &&
+ (ep->typedata.text->cache.fit_x == chosen_desc->text.fit_x) &&
+ (ep->typedata.text->cache.fit_y == chosen_desc->text.fit_y))
{
- text = ep->text.cache.out_str;
- size = ep->text.cache.out_size;
+ text = ep->typedata.text->cache.out_str;
+ size = ep->typedata.text->cache.out_size;
goto arrange_text;
}
if (!same_text)
{
- eina_stringshare_replace(&ep->text.cache.in_str, text);
+ eina_stringshare_replace(&ep->typedata.text->cache.in_str, text);
}
- ep->text.cache.in_size = size;
- if (chosen_desc->text.fit_x && (ep->text.cache.in_str && eina_stringshare_strlen(ep->text.cache.in_str) > 0))
+ ep->typedata.text->cache.in_size = size;
+ if (chosen_desc->text.fit_x && (ep->typedata.text->cache.in_str && eina_stringshare_strlen(ep->typedata.text->cache.in_str) > 0))
{
if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
else evas_object_text_font_source_set(ep->object, NULL);
* but it's still way better than what was here before. */
if (tw > sw) size--;
}
- if (chosen_desc->text.fit_y && (ep->text.cache.in_str && eina_stringshare_strlen(ep->text.cache.in_str) > 0))
+ if (chosen_desc->text.fit_y && (ep->typedata.text->cache.in_str && eina_stringshare_strlen(ep->typedata.text->cache.in_str) > 0))
{
/* if we fit in the x axis, too, size already has a somewhat
* meaningful value, so don't overwrite it with the starting
text = _edje_text_fit_x(ed, ep, params, text, font, size, sw, &free_text);
}
- eina_stringshare_replace(&ep->text.cache.out_str, text);
- ep->text.cache.in_w = sw;
- ep->text.cache.in_h = sh;
- ep->text.cache.out_size = size;
- ep->text.cache.align_x = params->type.text.align.x;
- ep->text.cache.align_y = params->type.text.align.y;
- ep->text.cache.elipsis = params->type.text.elipsis;
- ep->text.cache.fit_x = chosen_desc->text.fit_x;
- ep->text.cache.fit_y = chosen_desc->text.fit_y;
+ eina_stringshare_replace(&ep->typedata.text->cache.out_str, text);
+ ep->typedata.text->cache.in_w = sw;
+ ep->typedata.text->cache.in_h = sh;
+ ep->typedata.text->cache.out_size = size;
+ ep->typedata.text->cache.align_x = params->type.text.align.x;
+ ep->typedata.text->cache.align_y = params->type.text.align.y;
+ ep->typedata.text->cache.elipsis = params->type.text.elipsis;
+ ep->typedata.text->cache.fit_x = chosen_desc->text.fit_x;
+ ep->typedata.text->cache.fit_y = chosen_desc->text.fit_y;
arrange_text:
if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
{
align_x = params->type.text.align.x;
}
- ep->text.offset.x = TO_INT(SCALE(align_x, (sw - tw)));
- ep->text.offset.y = TO_INT(SCALE(params->type.text.align.y, (sh - th)));
+ ep->typedata.text->offset.x = TO_INT(SCALE(align_x, (sw - tw)));
+ ep->typedata.text->offset.y = TO_INT(SCALE(params->type.text.align.y, (sh - th)));
}
evas_object_move(ep->object,
- ed->x + params->x + ep->text.offset.x,
- ed->y + params->y + ep->text.offset.y);
+ ed->x + params->x + ep->typedata.text->offset.x,
+ ed->y + params->y + ep->typedata.text->offset.y);
if (params->visible) evas_object_show(ep->object);
else evas_object_hide(ep->object);
if (rp)
{
_edje_real_part_swallow_clear(rp);
- rp->swallowed_object = NULL;
- rp->swallow_params.min.w = 0;
- rp->swallow_params.min.h = 0;
- rp->swallow_params.max.w = 0;
- rp->swallow_params.max.h = 0;
+ if ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (rp->typedata.swallow))
+ {
+ rp->typedata.swallow->swallowed_object = NULL;
+ rp->typedata.swallow->swallow_params.min.w = 0;
+ rp->typedata.swallow->swallow_params.min.h = 0;
+ rp->typedata.swallow->swallow_params.max.w = 0;
+ rp->typedata.swallow->swallow_params.max.h = 0;
+ }
rp->edje->dirty = EINA_TRUE;
rp->edje->recalc_call = EINA_TRUE;
#ifdef EDJE_CALC_CACHE
Edje_Real_Part *rp;
rp = ed->table_parts[i];
- if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
+ if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
+ ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (rp->typedata.swallow)) &&
+ (rp->typedata.swallow->swallowed_object))
{
Edje *ed2;
- ed2 = _edje_fetch(rp->swallowed_object);
+ ed2 = _edje_fetch(rp->typedata.swallow->swallowed_object);
if (ed2) _edje_thaw_edje(ed2);
}
}
{
Edje_Real_Part *rp;
rp = ed->table_parts[i];
- if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
- edje_object_freeze(rp->swallowed_object);
+ if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
+ ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (rp->typedata.swallow)) &&
+ (rp->typedata.swallow->swallowed_object))
+ edje_object_freeze(rp->typedata.swallow->swallowed_object);
}
return _edje_freeze(ed);
}
Edje_Real_Part *rp;
rp = ed->table_parts[i];
- if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
- edje_object_thaw(rp->swallowed_object);
+ if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
+ ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (rp->typedata.swallow)) &&
+ (rp->typedata.swallow->swallowed_object))
+ edje_object_thaw(rp->typedata.swallow->swallowed_object);
}
return _edje_thaw(ed);
}
Edje_Real_Part *rp;
rp = ed->table_parts[i];
- if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
- edje_object_color_class_set(rp->swallowed_object, color_class,
+ if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
+ ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (rp->typedata.swallow)) &&
+ (rp->typedata.swallow->swallowed_object))
+ edje_object_color_class_set(rp->typedata.swallow->swallowed_object,
+ color_class,
r, g, b, a, r2, g2, b2, a2, r3, g3, b3,
a3);
}
Edje_Real_Part *rp;
rp = ed->table_parts[i];
- if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
- edje_object_color_class_del(rp->swallowed_object, color_class);
+ if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
+ ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (rp->typedata.swallow)) &&
+ (rp->typedata.swallow->swallowed_object))
+ edje_object_color_class_del(rp->typedata.swallow->swallowed_object, color_class);
}
ed->dirty = EINA_TRUE;
Edje_Real_Part *rp;
rp = ed->table_parts[i];
- if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
- edje_object_text_class_set(rp->swallowed_object, text_class,
- font, size);
+ if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
+ ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (rp->typedata.swallow)) &&
+ (rp->typedata.swallow->swallowed_object))
+ edje_object_text_class_set(rp->typedata.swallow->swallowed_object,
+ text_class, font, size);
}
ed->dirty = EINA_TRUE;
Edje_Real_Part *rp;
rp = ed->table_parts[i];
- if ((rp->part->type == EDJE_PART_TYPE_GROUP) && (rp->swallowed_object))
- edje_object_text_change_cb_set(rp->swallowed_object, func, data);
+ if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
+ ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (rp->typedata.swallow)) &&
+ (rp->typedata.swallow->swallowed_object))
+ edje_object_text_change_cb_set(rp->typedata.swallow->swallowed_object, func, data);
}
}
Eina_Bool
_edje_object_part_text_raw_set(Evas_Object *obj, Edje_Real_Part *rp, const char *part, const char *text)
{
- if ((!rp->text.text) && (!text))
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_TRUE;
+ if ((!rp->typedata.text->text) && (!text))
return EINA_TRUE; /* nothing to do, no error */
- if ((rp->text.text) && (text) &&
- (!strcmp(rp->text.text, text)))
+ if ((rp->typedata.text->text) && (text) &&
+ (!strcmp(rp->typedata.text->text, text)))
return EINA_TRUE; /* nothing to do, no error */
- if (rp->text.text)
+ if (rp->typedata.text->text)
{
- eina_stringshare_del(rp->text.text);
- rp->text.text = NULL;
+ eina_stringshare_del(rp->typedata.text->text);
+ rp->typedata.text->text = NULL;
}
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
_edje_entry_text_markup_set(rp, text);
else
- if (text) rp->text.text = eina_stringshare_add(text);
+ if (text) rp->typedata.text->text = eina_stringshare_add(text);
rp->edje->dirty = EINA_TRUE;
rp->edje->recalc_call = EINA_TRUE;
rp->edje->recalc_hints = EINA_TRUE;
Eina_Bool
_edje_object_part_text_raw_append(Evas_Object *obj, Edje_Real_Part *rp, const char *part, const char *text)
{
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_TRUE;
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
_edje_entry_text_markup_append(rp, text);
else if (text)
{
- if (rp->text.text)
+ if (rp->typedata.text->text)
{
char *new = NULL;
int len_added = strlen(text);
- int len_old = strlen(rp->text.text);
+ int len_old = strlen(rp->typedata.text->text);
new = malloc(len_old + len_added + 1);
- memcpy(new, rp->text.text, len_old);
+ memcpy(new, rp->typedata.text->text, len_old);
memcpy(new + len_old, text, len_added);
new[len_old + len_added] = '\0';
- eina_stringshare_replace(&rp->text.text, new);
+ eina_stringshare_replace(&rp->typedata.text->text, new);
free(new);
}
else
{
- eina_stringshare_replace(&rp->text.text, text);
+ eina_stringshare_replace(&rp->typedata.text->text, text);
}
}
rp->edje->dirty = EINA_TRUE;
static void
_edje_user_define_string(Edje *ed, const char *part, const char *raw_text)
{
- /* NOTE: This one is tricky, text is referenced in rp->text.text for the life of the
+ /* NOTE: This one is tricky, text is referenced in rp->typedata.text->text for the life of the
rp. So on edje_object_file_set, we should first ref it, before destroying the old
layout. */
Edje_User_Defined *eud;
if (!rp) return EINA_FALSE;
if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
(rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return EINA_FALSE;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_TRUE;
r = _edje_object_part_text_raw_set(obj, rp, part, text);
- _edje_user_define_string(ed, part, rp->text.text);
+ _edje_user_define_string(ed, part, rp->typedata.text->text);
return r;
}
rp = _edje_real_part_recursive_get(ed, part);
if (!rp) return NULL;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return NULL;
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
return _edje_entry_text_get(rp);
else
{
- if (rp->part->type == EDJE_PART_TYPE_TEXT) return rp->text.text;
+ if (rp->part->type == EDJE_PART_TYPE_TEXT)
+ return rp->typedata.text->text;
if (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)
return evas_object_textblock_text_markup_get(rp->object);
}
if ((!ed) || (!part)) return EINA_FALSE;
rp = _edje_real_part_recursive_get(ed, part);
if (!rp) return EINA_FALSE;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_FALSE;
if ((rp->part->type == EDJE_PART_TYPE_TEXT) && (text))
{
Eina_Strbuf *sbuf;
}
ret = _edje_object_part_text_raw_set
(obj, rp, part, eina_strbuf_string_get(sbuf));
- _edje_user_define_string(ed, part, rp->text.text);
+ _edje_user_define_string(ed, part, rp->typedata.text->text);
eina_strbuf_free(sbuf);
return ret;
}
if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return EINA_FALSE;
ret = _edje_object_part_text_raw_set(obj, rp, part, text);
- _edje_user_define_string(ed, part, rp->text.text);
+ _edje_user_define_string(ed, part, rp->typedata.text->text);
return ret;
}
if ((!ed) || (!part)) return ret;
rp = _edje_real_part_recursive_get(ed, part);
if (!rp) return ret;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return EINA_FALSE;
if (rp->part->type == EDJE_PART_TYPE_TEXT)
ret = _edje_object_part_text_raw_set(obj, rp, part, text_to_escape);
else if (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)
ret = _edje_object_part_text_raw_set(obj, rp, part, text);
free(text);
}
- _edje_user_define_string(ed, part, rp->text.text);
+ _edje_user_define_string(ed, part, rp->typedata.text->text);
return ret;
}
rp = _edje_real_part_recursive_get(ed, part);
if (!rp) return NULL;
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return NULL;
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
{
const char *t = _edje_entry_text_get(rp);
}
else
{
- if (rp->part->type == EDJE_PART_TYPE_TEXT) return strdup(rp->text.text);
+ if (rp->part->type == EDJE_PART_TYPE_TEXT) return strdup(rp->typedata.text->text);
if (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)
{
const char *t = evas_object_textblock_text_markup_get(rp->object);
ERR("cannot swallow part %s: not swallow type!", rp->part->name);
return EINA_FALSE;
}
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return EINA_FALSE;
_edje_real_part_swallow(rp, obj_swallow, EINA_TRUE);
- if (rp->swallowed_object)
+ if (rp->typedata.swallow->swallowed_object)
{
if (!eud)
{
rp = evas_object_data_get(obj, "\377 edje.swallowing_part");
if (rp)
{
- rp->swallow_params.min.w = minw;
- rp->swallow_params.min.h = minh;
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return;
+ rp->typedata.swallow->swallow_params.min.w = minw;
+ rp->typedata.swallow->swallow_params.min.h = minh;
_recalc_extern_parent(obj);
}
rp = evas_object_data_get(obj, "\377 edje.swallowing_part");
if (rp)
{
- rp->swallow_params.max.w = maxw;
- rp->swallow_params.max.h = maxh;
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return;
+ rp->typedata.swallow->swallow_params.max.w = maxw;
+ rp->typedata.swallow->swallow_params.max.h = maxh;
_recalc_extern_parent(obj);
}
rp = evas_object_data_get(obj, "\377 edje.swallowing_part");
if (rp)
{
- rp->swallow_params.aspect.mode = aspect;
- rp->swallow_params.aspect.w = aw;
- rp->swallow_params.aspect.h = ah;
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return;
+ rp->typedata.swallow->swallow_params.aspect.mode = aspect;
+ rp->typedata.swallow->swallow_params.aspect.w = aw;
+ rp->typedata.swallow->swallow_params.aspect.h = ah;
_recalc_extern_parent(obj);
}
}
ERR("cannot unswallow part %s: not swallow type!", rp->part->name);
return;
}
+
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return;
- if (rp->swallowed_object == obj_swallow)
+ if (rp->typedata.swallow->swallowed_object == obj_swallow)
{
Edje_User_Defined *eud;
Eina_List *l;
}
_edje_real_part_swallow_clear(rp);
- rp->swallowed_object = NULL;
- rp->swallow_params.min.w = 0;
- rp->swallow_params.min.h = 0;
- rp->swallow_params.max.w = 0;
- rp->swallow_params.max.h = 0;
+ rp->typedata.swallow->swallowed_object = NULL;
+ rp->typedata.swallow->swallow_params.min.w = 0;
+ rp->typedata.swallow->swallow_params.min.h = 0;
+ rp->typedata.swallow->swallow_params.max.w = 0;
+ rp->typedata.swallow->swallow_params.max.h = 0;
rp->edje->dirty = EINA_TRUE;
rp->edje->recalc_call = EINA_TRUE;
#ifdef EDJE_CALC_CACHE
rp = _edje_real_part_recursive_get(ed, part);
if (!rp) return NULL;
- return rp->swallowed_object;
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return NULL;
+ return rp->typedata.swallow->swallowed_object;
}
EAPI void
rp = ed->table_parts[i];
ep = rp->part;
- if (ep->type == EDJE_PART_TYPE_IMAGE ||
- (ep->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object))
+ if ((ep->type == EDJE_PART_TYPE_IMAGE) ||
+ ((ep->type == EDJE_PART_TYPE_GROUP) &&
+ ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (rp->typedata.swallow)) &&
+ (rp->typedata.swallow->swallowed_object)))
count++;
}
}
else if (ep->type == EDJE_PART_TYPE_GROUP)
{
- if (rp->swallowed_object) {
- char *tmp;
-
- if (rp->part->name)
- {
- tmp = alloca(strlen(rp->part->name) + 2);
- sprintf(tmp, "%s:", rp->part->name);
-
- edje_object_signal_callback_del(obj, EDJE_PRELOAD_EMISSION, tmp, _edje_object_signal_preload_cb);
- edje_object_signal_callback_add(obj, EDJE_PRELOAD_EMISSION, tmp, _edje_object_signal_preload_cb, ed);
- edje_object_preload(rp->swallowed_object, cancel);
- }
- else
- {
- ed->preload_count--;
- }
-
+ if (((rp->type == EDJE_RP_TYPE_SWALLOW) &&
+ (rp->typedata.swallow)) &&
+ (rp->typedata.swallow->swallowed_object))
+ {
+ char *tmp;
+
+ if (rp->part->name)
+ {
+ tmp = alloca(strlen(rp->part->name) + 2);
+ sprintf(tmp, "%s:", rp->part->name);
+
+ edje_object_signal_callback_del(obj, EDJE_PRELOAD_EMISSION, tmp, _edje_object_signal_preload_cb);
+ edje_object_signal_callback_add(obj, EDJE_PRELOAD_EMISSION, tmp, _edje_object_signal_preload_cb, ed);
+ edje_object_preload(rp->typedata.swallow->swallowed_object, cancel);
+ }
+ else
+ {
+ ed->preload_count--;
+ }
count--;
}
}
switch (rp->part->type)
{
case EDJE_PART_TYPE_EXTERNAL:
- return _edje_external_content_get(rp->swallowed_object, partid);
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return NULL;
+ return _edje_external_content_get
+ (rp->typedata.swallow->swallowed_object, partid);
case EDJE_PART_TYPE_BOX:
l = evas_object_box_children_get(rp->object);
break;
switch (rp->part->type)
{
case EDJE_PART_TYPE_GROUP:
- if (!rp->swallowed_object) return NULL;
- ed = _edje_fetch(rp->swallowed_object);
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return NULL;
+ if (!rp->typedata.swallow->swallowed_object) return NULL;
+ ed = _edje_fetch(rp->typedata.swallow->swallowed_object);
if (!ed) return NULL;
path++;
return _edje_real_part_recursive_get_helper(ed, path);
{
const char *type;
- type = evas_object_type_get(rp->swallowed_object);
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return;
+ type = evas_object_type_get(rp->typedata.swallow->swallowed_object);
- rp->swallow_params.min.w = 0;
- rp->swallow_params.min.h = 0;
- rp->swallow_params.max.w = -1;
- rp->swallow_params.max.h = -1;
+ rp->typedata.swallow->swallow_params.min.w = 0;
+ rp->typedata.swallow->swallow_params.min.h = 0;
+ rp->typedata.swallow->swallow_params.max.w = -1;
+ rp->typedata.swallow->swallow_params.max.h = -1;
if ((type) && (!strcmp(type, "edje")))
{
Evas_Coord w, h;
#if 0
- edje_object_size_min_get(rp->swallowed_object, &w, &h);
- rp->swallow_params.min.w = w;
- rp->swallow_params.min.h = h;
+ edje_object_size_min_get(rp->typedata.swallow->swallowed_object, &w, &h);
+ rp->typedata.swallow->swallow_params.min.w = w;
+ rp->typedata.swallow->swallow_params.min.h = h;
#endif
- edje_object_size_max_get(rp->swallowed_object, &w, &h);
- rp->swallow_params.max.w = w;
- rp->swallow_params.max.h = h;
+ edje_object_size_max_get(rp->typedata.swallow->swallowed_object, &w, &h);
+ rp->typedata.swallow->swallow_params.max.w = w;
+ rp->typedata.swallow->swallow_params.max.h = h;
}
else if ((type) && ((!strcmp(type, "text")) || (!strcmp(type, "polygon")) ||
(!strcmp(type, "line"))))
{
Evas_Coord w, h;
- evas_object_geometry_get(rp->swallowed_object, NULL, NULL, &w, &h);
+ evas_object_geometry_get(rp->typedata.swallow->swallowed_object, NULL, NULL, &w, &h);
#if 0
- rp->swallow_params.min.w = w;
- rp->swallow_params.min.h = h;
+ rp->typedata.swallow->swallow_params.min.w = w;
+ rp->typedata.swallow->swallow_params.min.h = h;
#endif
- rp->swallow_params.max.w = w;
- rp->swallow_params.max.h = h;
+ rp->typedata.swallow->swallow_params.max.w = w;
+ rp->typedata.swallow->swallow_params.max.h = h;
}
{
Evas_Coord w1, h1, w2, h2, aw, ah;
Evas_Aspect_Control am;
- evas_object_size_hint_min_get(rp->swallowed_object, &w1, &h1);
- evas_object_size_hint_max_get(rp->swallowed_object, &w2, &h2);
- evas_object_size_hint_aspect_get(rp->swallowed_object, &am, &aw, &ah);
- rp->swallow_params.min.w = w1;
- rp->swallow_params.min.h = h1;
- if (w2 > 0) rp->swallow_params.max.w = w2;
- if (h2 > 0) rp->swallow_params.max.h = h2;
+ evas_object_size_hint_min_get(rp->typedata.swallow->swallowed_object, &w1, &h1);
+ evas_object_size_hint_max_get(rp->typedata.swallow->swallowed_object, &w2, &h2);
+ evas_object_size_hint_aspect_get(rp->typedata.swallow->swallowed_object, &am, &aw, &ah);
+ rp->typedata.swallow->swallow_params.min.w = w1;
+ rp->typedata.swallow->swallow_params.min.h = h1;
+ if (w2 > 0) rp->typedata.swallow->swallow_params.max.w = w2;
+ if (h2 > 0) rp->typedata.swallow->swallow_params.max.h = h2;
switch (am)
{
case EVAS_ASPECT_CONTROL_NONE:
- rp->swallow_params.aspect.mode = EDJE_ASPECT_CONTROL_NONE;
+ rp->typedata.swallow->swallow_params.aspect.mode = EDJE_ASPECT_CONTROL_NONE;
break;
case EVAS_ASPECT_CONTROL_NEITHER:
- rp->swallow_params.aspect.mode = EDJE_ASPECT_CONTROL_NEITHER;
+ rp->typedata.swallow->swallow_params.aspect.mode = EDJE_ASPECT_CONTROL_NEITHER;
break;
case EVAS_ASPECT_CONTROL_HORIZONTAL:
- rp->swallow_params.aspect.mode = EDJE_ASPECT_CONTROL_HORIZONTAL;
+ rp->typedata.swallow->swallow_params.aspect.mode = EDJE_ASPECT_CONTROL_HORIZONTAL;
break;
case EVAS_ASPECT_CONTROL_VERTICAL:
- rp->swallow_params.aspect.mode = EDJE_ASPECT_CONTROL_VERTICAL;
+ rp->typedata.swallow->swallow_params.aspect.mode = EDJE_ASPECT_CONTROL_VERTICAL;
break;
case EVAS_ASPECT_CONTROL_BOTH:
- rp->swallow_params.aspect.mode = EDJE_ASPECT_CONTROL_BOTH;
+ rp->typedata.swallow->swallow_params.aspect.mode = EDJE_ASPECT_CONTROL_BOTH;
break;
default:
break;
}
- rp->swallow_params.aspect.w = aw;
- rp->swallow_params.aspect.h = ah;
- evas_object_data_set(rp->swallowed_object, "\377 edje.swallowing_part", rp);
+ rp->typedata.swallow->swallow_params.aspect.w = aw;
+ rp->typedata.swallow->swallow_params.aspect.h = ah;
+ evas_object_data_set(rp->typedata.swallow->swallowed_object, "\377 edje.swallowing_part", rp);
}
#ifdef EDJE_CALC_CACHE
{
Edje_Real_Part *rp = data;
Evas_Coord w, h;
+ Evas_Map *map;
if (!rp->chosen_description->map.on) return;
- Evas_Map *map = (Evas_Map *) evas_object_map_get(rp->swallowed_object);
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return;
+ map = (Evas_Map *)evas_object_map_get(rp->typedata.swallow->swallowed_object);
if (!map) return;
- evas_object_image_size_get(rp->swallowed_object, &w, &h);
+ evas_object_image_size_get(rp->typedata.swallow->swallowed_object, &w, &h);
evas_map_point_image_uv_set(map, 0, 0, 0);
evas_map_point_image_uv_set(map, 1, w, 0);
evas_map_point_image_uv_set(map, 2, w, h);
evas_map_point_image_uv_set(map, 3, 0, h);
- evas_object_map_set(rp->swallowed_object, map);
+ evas_object_map_set(rp->typedata.swallow->swallowed_object, map);
}
void
Evas_Object *obj_swallow,
Eina_Bool hints_update)
{
- if (rp->swallowed_object)
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return;
+ if (rp->typedata.swallow->swallowed_object)
{
- if (rp->swallowed_object != obj_swallow)
+ if (rp->typedata.swallow->swallowed_object != obj_swallow)
{
- edje_object_part_unswallow(rp->edje->obj, rp->swallowed_object);
+ edje_object_part_unswallow(rp->edje->obj, rp->typedata.swallow->swallowed_object);
}
else
{
rp->invalidate = 1;
#endif
if (!obj_swallow) return;
- rp->swallowed_object = obj_swallow;
- evas_object_smart_member_add(rp->swallowed_object, rp->edje->obj);
+ rp->typedata.swallow->swallowed_object = obj_swallow;
+ evas_object_smart_member_add(rp->typedata.swallow->swallowed_object, rp->edje->obj);
if (rp->clip_to)
- evas_object_clip_set(rp->swallowed_object, rp->clip_to->object);
- else evas_object_clip_set(rp->swallowed_object, rp->edje->base.clipper);
- evas_object_stack_above(rp->swallowed_object, rp->object);
- evas_object_event_callback_add(rp->swallowed_object,
+ evas_object_clip_set(rp->typedata.swallow->swallowed_object, rp->clip_to->object);
+ else evas_object_clip_set(rp->typedata.swallow->swallowed_object, rp->edje->base.clipper);
+ evas_object_stack_above(rp->typedata.swallow->swallowed_object, rp->object);
+ evas_object_event_callback_add(rp->typedata.swallow->swallowed_object,
EVAS_CALLBACK_DEL,
_edje_object_part_swallow_free_cb,
rp);
- evas_object_event_callback_add(rp->swallowed_object,
+ evas_object_event_callback_add(rp->typedata.swallow->swallowed_object,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_edje_object_part_swallow_changed_hints_cb,
rp);
//If the map is enabled, uv should be updated when image size is changed.
- if (!strcmp(evas_object_type_get(rp->swallowed_object), "image"))
+ if (!strcmp(evas_object_type_get(rp->typedata.swallow->swallowed_object), "image"))
evas_object_event_callback_add(obj_swallow, EVAS_CALLBACK_IMAGE_RESIZE,
_edje_object_part_swallow_image_resize_cb,
rp);
}
else
evas_object_pass_events_set(obj_swallow, 1);
- _edje_callbacks_focus_add(rp->swallowed_object, rp->edje, rp);
+ _edje_callbacks_focus_add(rp->typedata.swallow->swallowed_object, rp->edje, rp);
if (rp->part->precise_is_inside)
evas_object_precise_is_inside_set(obj_swallow, 1);
void
_edje_real_part_swallow_clear(Edje_Real_Part *rp)
{
- if (!rp->swallowed_object) return ;
- evas_object_smart_member_del(rp->swallowed_object);
- evas_object_event_callback_del_full(rp->swallowed_object,
+ if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
+ (!rp->typedata.swallow)) return NULL;
+ if (!rp->typedata.swallow->swallowed_object) return;
+ evas_object_smart_member_del(rp->typedata.swallow->swallowed_object);
+ evas_object_event_callback_del_full(rp->typedata.swallow->swallowed_object,
EVAS_CALLBACK_DEL,
_edje_object_part_swallow_free_cb,
rp);
- evas_object_event_callback_del_full(rp->swallowed_object,
+ evas_object_event_callback_del_full(rp->typedata.swallow->swallowed_object,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_edje_object_part_swallow_changed_hints_cb,
rp);
- if (!strcmp(evas_object_type_get(rp->swallowed_object), "image"))
- evas_object_event_callback_del_full(rp->swallowed_object,
+ if (!strcmp(evas_object_type_get(rp->typedata.swallow->swallowed_object), "image"))
+ evas_object_event_callback_del_full(rp->typedata.swallow->swallowed_object,
EVAS_CALLBACK_IMAGE_RESIZE,
_edje_object_part_swallow_image_resize_cb,
rp);
- evas_object_clip_unset(rp->swallowed_object);
- evas_object_data_del(rp->swallowed_object, "\377 edje.swallowing_part");
+ evas_object_clip_unset(rp->typedata.swallow->swallowed_object);
+ evas_object_data_del(rp->typedata.swallow->swallowed_object, "\377 edje.swallowing_part");
if (rp->part->mouse_events)
- _edje_callbacks_del(rp->swallowed_object, rp->edje);
- _edje_callbacks_focus_del(rp->swallowed_object, rp->edje);
- rp->swallowed_object = NULL;
+ _edje_callbacks_del(rp->typedata.swallow->swallowed_object, rp->edje);
+ _edje_callbacks_focus_del(rp->typedata.swallow->swallowed_object, rp->edje);
+ rp->typedata.swallow->swallowed_object = NULL;
}
static void