use less memory at runtime with real part structs. actual savings are
about 25%. SVN revision: 76460
This commit is contained in:
parent
2ad877574e
commit
a00b9084ea
|
@ -612,3 +612,9 @@
|
||||||
* O(1) lookup when generating alias of group.
|
* O(1) lookup when generating alias of group.
|
||||||
* O(1) access time for parameters in edje_cc_handler.
|
* O(1) access time for parameters in edje_cc_handler.
|
||||||
* Recycle and use less memory during load time.
|
* 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.
|
||||||
|
|
|
@ -11,6 +11,7 @@ Additions:
|
||||||
|
|
||||||
Improvements:
|
Improvements:
|
||||||
* Check the number of parameter for image in edc.
|
* 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 used when searching Part_Lookup in edje_cc.
|
||||||
* O(1) lookup when generating alias of group.
|
* O(1) lookup when generating alias of group.
|
||||||
* O(1) access time for parameters in edje_cc_handler.
|
* O(1) access time for parameters in edje_cc_handler.
|
||||||
|
|
|
@ -155,45 +155,48 @@ _edje_box_recalc_apply(Edje *ed __UNUSED__, Edje_Real_Part *ep, Edje_Calc_Params
|
||||||
#if 0
|
#if 0
|
||||||
int min_w, min_h;
|
int min_w, min_h;
|
||||||
#endif
|
#endif
|
||||||
|
if ((ep->type != EDJE_RP_TYPE_CONTAINER) ||
|
||||||
|
(!ep->typedata.container)) return;
|
||||||
|
|
||||||
if ((ep->param2) && (ep->description_pos != ZERO))
|
if ((ep->param2) && (ep->description_pos != ZERO))
|
||||||
{
|
{
|
||||||
Edje_Part_Description_Box *param2_desc = (Edje_Part_Description_Box *)ep->param2->description;
|
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);
|
_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->anim->end.padding.x = param2_desc->box.padding.x;
|
ep->typedata.container->anim->end.padding.x = param2_desc->box.padding.x;
|
||||||
ep->anim->end.padding.y = param2_desc->box.padding.y;
|
ep->typedata.container->anim->end.padding.y = param2_desc->box.padding.y;
|
||||||
ep->anim->end.align.x = param2_desc->box.align.x;
|
ep->typedata.container->anim->end.align.x = param2_desc->box.align.x;
|
||||||
ep->anim->end.align.y = param2_desc->box.align.y;
|
ep->typedata.container->anim->end.align.y = param2_desc->box.align.y;
|
||||||
|
|
||||||
priv = evas_object_smart_data_get(ep->object);
|
priv = evas_object_smart_data_get(ep->object);
|
||||||
if (priv == NULL)
|
if (priv == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
evas_object_box_padding_set(ep->object, ep->anim->start.padding.x, ep->anim->start.padding.y);
|
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->anim->start.align.x), TO_DOUBLE(ep->anim->start.align.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->anim->start.layout(ep->object, priv, ep->anim->start.data);
|
ep->typedata.container->anim->start.layout(ep->object, priv, ep->typedata.container->anim->start.data);
|
||||||
_edje_box_layout_calculate_coords(ep->object, priv, ep->anim);
|
_edje_box_layout_calculate_coords(ep->object, priv, ep->typedata.container->anim);
|
||||||
ep->anim->start_progress = 0.0;
|
ep->typedata.container->anim->start_progress = 0.0;
|
||||||
}
|
}
|
||||||
evas_object_smart_changed(ep->object);
|
evas_object_smart_changed(ep->object);
|
||||||
}
|
}
|
||||||
else
|
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);
|
_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->anim->start.padding.x = chosen_desc->box.padding.x;
|
ep->typedata.container->anim->start.padding.x = chosen_desc->box.padding.x;
|
||||||
ep->anim->start.padding.y = chosen_desc->box.padding.y;
|
ep->typedata.container->anim->start.padding.y = chosen_desc->box.padding.y;
|
||||||
ep->anim->start.align.x = chosen_desc->box.align.x;
|
ep->typedata.container->anim->start.align.x = chosen_desc->box.align.x;
|
||||||
ep->anim->start.align.y = chosen_desc->box.align.y;
|
ep->typedata.container->anim->start.align.y = chosen_desc->box.align.y;
|
||||||
evas_object_smart_changed(ep->object);
|
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))
|
if (evas_object_smart_need_recalculate_get(ep->object))
|
||||||
{
|
{
|
||||||
|
@ -213,12 +216,14 @@ Eina_Bool
|
||||||
_edje_box_layout_add_child(Edje_Real_Part *rp, Evas_Object *child_obj)
|
_edje_box_layout_add_child(Edje_Real_Part *rp, Evas_Object *child_obj)
|
||||||
{
|
{
|
||||||
Edje_Transition_Animation_Data *tad;
|
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));
|
tad = calloc(1, sizeof(Edje_Transition_Animation_Data));
|
||||||
if (!tad)
|
if (!tad) return EINA_FALSE;
|
||||||
return EINA_FALSE;
|
|
||||||
tad->obj = child_obj;
|
tad->obj = child_obj;
|
||||||
rp->anim->objs = eina_list_append(rp->anim->objs, tad);
|
rp->typedata.container->anim->objs = eina_list_append(rp->typedata.container->anim->objs, tad);
|
||||||
rp->anim->recalculate = EINA_TRUE;
|
rp->typedata.container->anim->recalculate = EINA_TRUE;
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,15 +233,17 @@ _edje_box_layout_remove_child(Edje_Real_Part *rp, Evas_Object *child_obj)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
Edje_Transition_Animation_Data *tad;
|
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)
|
if (tad->obj == child_obj)
|
||||||
{
|
{
|
||||||
free(eina_list_data_get(l));
|
free(eina_list_data_get(l));
|
||||||
rp->anim->objs = eina_list_remove_list(rp->anim->objs, l);
|
rp->typedata.container->anim->objs = eina_list_remove_list(rp->typedata.container->anim->objs, l);
|
||||||
rp->anim->recalculate = EINA_TRUE;
|
rp->typedata.container->anim->recalculate = EINA_TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rp->anim->recalculate = EINA_TRUE;
|
rp->typedata.container->anim->recalculate = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -510,11 +510,14 @@ _edje_real_part_rel_to_apply(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part_State
|
||||||
{
|
{
|
||||||
Edje_Part_Description_External *external;
|
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)
|
if (state->external_params)
|
||||||
_edje_external_parsed_params_free(ep->swallowed_object, state->external_params);
|
_edje_external_parsed_params_free(ep->typedata.swallow->swallowed_object, state->external_params);
|
||||||
state->external_params = _edje_external_params_parse(ep->swallowed_object, external->external_params);
|
state->external_params = _edje_external_params_parse(ep->typedata.swallow->swallowed_object, external->external_params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -549,16 +552,24 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl
|
||||||
memset(ep->param2, 0, sizeof(Edje_Real_Part_State));
|
memset(ep->param2, 0, sizeof(Edje_Real_Part_State));
|
||||||
}
|
}
|
||||||
else if (ep->part->type == EDJE_PART_TYPE_EXTERNAL)
|
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;
|
ep->param2->external_params = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (ep->param2)
|
if (ep->param2)
|
||||||
{
|
{
|
||||||
if (ep->part->type == EDJE_PART_TYPE_EXTERNAL)
|
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)
|
if (ep->param2)
|
||||||
free(ep->param2->set);
|
free(ep->param2->set);
|
||||||
eina_mempool_free(_edje_real_part_state_mp, ep->param2);
|
eina_mempool_free(_edje_real_part_state_mp, ep->param2);
|
||||||
|
@ -912,11 +923,15 @@ _edje_part_recalc_single_aspect(Edje *ed,
|
||||||
evas_object_image_size_get(ep->object, &w, &h);
|
evas_object_image_size_get(ep->object, &w, &h);
|
||||||
amin = amax = DIV(FROM_INT(w), FROM_INT(h));
|
amin = amax = DIV(FROM_INT(w), FROM_INT(h));
|
||||||
}
|
}
|
||||||
if ((ep->swallow_params.aspect.w > 0) &&
|
if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
|
||||||
(ep->swallow_params.aspect.h > 0))
|
(ep->typedata.swallow))
|
||||||
amin = amax =
|
{
|
||||||
DIV(FROM_INT(ep->swallow_params.aspect.w),
|
if ((ep->typedata.swallow->swallow_params.aspect.w > 0) &&
|
||||||
FROM_INT(ep->swallow_params.aspect.h));
|
(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_x = FROM_INT(params->x);
|
||||||
want_w = new_w = FROM_INT(params->w);
|
want_w = new_w = FROM_INT(params->w);
|
||||||
|
|
||||||
|
@ -926,24 +941,28 @@ _edje_part_recalc_single_aspect(Edje *ed,
|
||||||
if ((amin > ZERO) && (amax > ZERO))
|
if ((amin > ZERO) && (amax > ZERO))
|
||||||
{
|
{
|
||||||
apref = desc->aspect.prefer;
|
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:
|
switch (ep->typedata.swallow->swallow_params.aspect.mode)
|
||||||
apref = EDJE_ASPECT_PREFER_NONE;
|
{
|
||||||
break;
|
case EDJE_ASPECT_CONTROL_NEITHER:
|
||||||
case EDJE_ASPECT_CONTROL_HORIZONTAL:
|
apref = EDJE_ASPECT_PREFER_NONE;
|
||||||
apref = EDJE_ASPECT_PREFER_HORIZONTAL;
|
break;
|
||||||
break;
|
case EDJE_ASPECT_CONTROL_HORIZONTAL:
|
||||||
case EDJE_ASPECT_CONTROL_VERTICAL:
|
apref = EDJE_ASPECT_PREFER_HORIZONTAL;
|
||||||
apref = EDJE_ASPECT_PREFER_VERTICAL;
|
break;
|
||||||
break;
|
case EDJE_ASPECT_CONTROL_VERTICAL:
|
||||||
case EDJE_ASPECT_CONTROL_BOTH:
|
apref = EDJE_ASPECT_PREFER_VERTICAL;
|
||||||
apref = EDJE_ASPECT_PREFER_BOTH;
|
break;
|
||||||
break;
|
case EDJE_ASPECT_CONTROL_BOTH:
|
||||||
default:
|
apref = EDJE_ASPECT_PREFER_BOTH;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch (apref)
|
switch (apref)
|
||||||
|
@ -1141,6 +1160,9 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
|
||||||
int *minw, int *minh,
|
int *minw, int *minh,
|
||||||
int *maxw, int *maxh)
|
int *maxw, int *maxh)
|
||||||
{
|
{
|
||||||
|
if ((ep->type != EDJE_RP_TYPE_TEXT) ||
|
||||||
|
(!ep->typedata.text))
|
||||||
|
return;
|
||||||
if (chosen_desc)
|
if (chosen_desc)
|
||||||
{
|
{
|
||||||
Evas_Coord tw, th, ins_l, ins_r, ins_t, ins_b;
|
Evas_Coord tw, th, ins_l, ins_r, ins_t, ins_b;
|
||||||
|
@ -1152,14 +1174,14 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
|
||||||
|
|
||||||
if (chosen_desc->text.id_source >= 0)
|
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;
|
if (tmp) style = tmp;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ep->text.source = NULL;
|
ep->typedata.text->source = NULL;
|
||||||
|
|
||||||
tmp = edje_string_get(&chosen_desc->text.style);
|
tmp = edje_string_get(&chosen_desc->text.style);
|
||||||
if (tmp) style = tmp;
|
if (tmp) style = tmp;
|
||||||
|
@ -1167,16 +1189,16 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
|
||||||
|
|
||||||
if (chosen_desc->text.id_text_source >= 0)
|
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];
|
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->text.text_source->chosen_description)->text.text);
|
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
|
else
|
||||||
{
|
{
|
||||||
ep->text.text_source = NULL;
|
ep->typedata.text->text_source = NULL;
|
||||||
text = edje_string_get(&chosen_desc->text.text);
|
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)
|
EINA_LIST_FOREACH(ed->file->styles, l, stl)
|
||||||
|
@ -1829,8 +1851,12 @@ _edje_part_recalc_single_min_max(FLOAT_T sc,
|
||||||
{
|
{
|
||||||
*minw = desc->min.w;
|
*minw = desc->min.w;
|
||||||
if (ep->part->scale) *minw = TO_INT(SCALE(sc, *minw));
|
if (ep->part->scale) *minw = TO_INT(SCALE(sc, *minw));
|
||||||
if (ep->swallow_params.min.w > desc->min.w)
|
if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
|
||||||
*minw = ep->swallow_params.min.w;
|
(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)
|
if (ep->edje->calc_only)
|
||||||
{
|
{
|
||||||
|
@ -1841,22 +1867,12 @@ _edje_part_recalc_single_min_max(FLOAT_T sc,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX TODO: remove need of EDJE_INF_MAX_W, see edje_util.c */
|
if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
|
||||||
if ((ep->swallow_params.max.w <= 0) ||
|
(ep->typedata.swallow))
|
||||||
(ep->swallow_params.max.w == EDJE_INF_MAX_W))
|
|
||||||
{
|
{
|
||||||
*maxw = desc->max.w;
|
/* XXX TODO: remove need of EDJE_INF_MAX_W, see edje_util.c */
|
||||||
if (*maxw > 0)
|
if ((ep->typedata.swallow->swallow_params.max.w <= 0) ||
|
||||||
{
|
(ep->typedata.swallow->swallow_params.max.w == EDJE_INF_MAX_W))
|
||||||
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
|
|
||||||
{
|
{
|
||||||
*maxw = desc->max.w;
|
*maxw = desc->max.w;
|
||||||
if (*maxw > 0)
|
if (*maxw > 0)
|
||||||
|
@ -1864,8 +1880,31 @@ _edje_part_recalc_single_min_max(FLOAT_T sc,
|
||||||
if (ep->part->scale) *maxw = TO_INT(SCALE(sc, *maxw));
|
if (ep->part->scale) *maxw = TO_INT(SCALE(sc, *maxw));
|
||||||
if (*maxw < 1) *maxw = 1;
|
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) &&
|
if ((ep->edje->calc_only) && (desc->minmul.have) &&
|
||||||
|
@ -1877,8 +1916,12 @@ _edje_part_recalc_single_min_max(FLOAT_T sc,
|
||||||
|
|
||||||
*minh = desc->min.h;
|
*minh = desc->min.h;
|
||||||
if (ep->part->scale) *minh = TO_INT(SCALE(sc, *minh));
|
if (ep->part->scale) *minh = TO_INT(SCALE(sc, *minh));
|
||||||
if (ep->swallow_params.min.h > desc->min.h)
|
if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
|
||||||
*minh = ep->swallow_params.min.h;
|
(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)
|
if (ep->edje->calc_only)
|
||||||
{
|
{
|
||||||
|
@ -1889,22 +1932,12 @@ _edje_part_recalc_single_min_max(FLOAT_T sc,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX TODO: remove need of EDJE_INF_MAX_H, see edje_util.c */
|
if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
|
||||||
if ((ep->swallow_params.max.h <= 0) ||
|
(ep->typedata.swallow))
|
||||||
(ep->swallow_params.max.h == EDJE_INF_MAX_H))
|
|
||||||
{
|
{
|
||||||
*maxh = desc->max.h;
|
/* XXX TODO: remove need of EDJE_INF_MAX_H, see edje_util.c */
|
||||||
if (*maxh > 0)
|
if ((ep->typedata.swallow->swallow_params.max.h <= 0) ||
|
||||||
{
|
(ep->typedata.swallow->swallow_params.max.h == EDJE_INF_MAX_H))
|
||||||
if (ep->part->scale) *maxh = TO_INT(SCALE(sc, *maxh));
|
|
||||||
if (*maxh < 1) *maxh = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (desc->max.h <= 0)
|
|
||||||
*maxh = ep->swallow_params.max.h;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
*maxh = desc->max.h;
|
*maxh = desc->max.h;
|
||||||
if (*maxh > 0)
|
if (*maxh > 0)
|
||||||
|
@ -1912,8 +1945,31 @@ _edje_part_recalc_single_min_max(FLOAT_T sc,
|
||||||
if (ep->part->scale) *maxh = TO_INT(SCALE(sc, *maxh));
|
if (ep->part->scale) *maxh = TO_INT(SCALE(sc, *maxh));
|
||||||
if (*maxh < 1) *maxh = 1;
|
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) &&
|
if ((ep->edje->calc_only) && (desc->minmul.have) &&
|
||||||
|
@ -2300,7 +2356,11 @@ _edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj
|
||||||
case EDJE_PART_TYPE_GROUP:
|
case EDJE_PART_TYPE_GROUP:
|
||||||
case EDJE_PART_TYPE_SWALLOW:
|
case EDJE_PART_TYPE_SWALLOW:
|
||||||
case EDJE_PART_TYPE_EXTERNAL:
|
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;
|
break;
|
||||||
case EDJE_PART_TYPE_SPACER:
|
case EDJE_PART_TYPE_SPACER:
|
||||||
/* FIXME: detect that at compile time and prevent it */
|
/* FIXME: detect that at compile time and prevent it */
|
||||||
|
@ -2443,23 +2503,25 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
|
||||||
|
|
||||||
if (ep->part->scale &&
|
if (ep->part->scale &&
|
||||||
ep->part->type == EDJE_PART_TYPE_GROUP &&
|
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)
|
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
|
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;
|
Edje *ted;
|
||||||
|
|
||||||
ted = _edje_fetch(ep->swallowed_object);
|
ted = _edje_fetch(ep->typedata.swallow->swallowed_object);
|
||||||
_edje_recalc_do(ted);
|
_edje_recalc_do(ted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2631,7 +2693,6 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
|
||||||
ep->param1.rel1_to_x, ep->param1.rel1_to_y, ep->param1.rel2_to_x, ep->param1.rel2_to_y,
|
ep->param1.rel1_to_x, ep->param1.rel1_to_y, ep->param1.rel2_to_x, ep->param1.rel2_to_y,
|
||||||
confine_to,
|
confine_to,
|
||||||
p1, pos);
|
p1, pos);
|
||||||
|
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
if (flags == FLAG_XY)
|
if (flags == FLAG_XY)
|
||||||
ep->param1.state = ed->state;
|
ep->param1.state = ed->state;
|
||||||
|
@ -2990,25 +3051,27 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
|
||||||
break;
|
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
|
//// 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
|
//// 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
|
//// done via the clipper anyway. this created bugs when objects had their
|
||||||
//// colro set and were swallowed - then had their color changed.
|
//// 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.r * pf->color.a) / 255,
|
||||||
// (pf->color.g * pf->color.a) / 255,
|
// (pf->color.g * pf->color.a) / 255,
|
||||||
// (pf->color.b * pf->color.a) / 255,
|
// (pf->color.b * pf->color.a) / 255,
|
||||||
// pf->color.a);
|
// pf->color.a);
|
||||||
if (pf->visible)
|
if (pf->visible)
|
||||||
{
|
{
|
||||||
evas_object_move(ep->swallowed_object, ed->x + pf->x, ed->y + pf->y);
|
evas_object_move(ep->typedata.swallow->swallowed_object, ed->x + pf->x, ed->y + pf->y);
|
||||||
evas_object_resize(ep->swallowed_object, pf->w, pf->h);
|
evas_object_resize(ep->typedata.swallow->swallowed_object, pf->w, pf->h);
|
||||||
evas_object_show(ep->swallowed_object);
|
evas_object_show(ep->typedata.swallow->swallowed_object);
|
||||||
}
|
}
|
||||||
else evas_object_hide(ep->swallowed_object);
|
else evas_object_hide(ep->typedata.swallow->swallowed_object);
|
||||||
mo = ep->swallowed_object;
|
mo = ep->typedata.swallow->swallowed_object;
|
||||||
}
|
}
|
||||||
else mo = ep->object;
|
else mo = ep->object;
|
||||||
if (chosen_desc->map.on && ep->part->type != EDJE_PART_TYPE_SPACER)
|
if (chosen_desc->map.on && ep->part->type != EDJE_PART_TYPE_SPACER)
|
||||||
|
|
|
@ -351,28 +351,28 @@ _edje_real_part_free(Edje_Real_Part *rp)
|
||||||
evas_object_del(rp->object);
|
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_smart_member_del(rp->typedata.swallow->swallowed_object);
|
||||||
evas_object_event_callback_del(rp->swallowed_object,
|
evas_object_event_callback_del(rp->typedata.swallow->swallowed_object,
|
||||||
EVAS_CALLBACK_FREE,
|
EVAS_CALLBACK_FREE,
|
||||||
_edje_object_part_swallow_free_cb);
|
_edje_object_part_swallow_free_cb);
|
||||||
evas_object_clip_unset(rp->swallowed_object);
|
evas_object_clip_unset(rp->typedata.swallow->swallowed_object);
|
||||||
evas_object_data_del(rp->swallowed_object, "\377 edje.swallowing_part");
|
evas_object_data_del(rp->typedata.swallow->swallowed_object, "\377 edje.swallowing_part");
|
||||||
if (rp->part->mouse_events)
|
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 ||
|
if (rp->part->type == EDJE_PART_TYPE_GROUP ||
|
||||||
rp->part->type == EDJE_PART_TYPE_EXTERNAL)
|
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->typedata.text->text) eina_stringshare_del(rp->typedata.text->text);
|
||||||
if (rp->text.font) eina_stringshare_del(rp->text.font);
|
if (rp->typedata.text->font) eina_stringshare_del(rp->typedata.text->font);
|
||||||
if (rp->text.cache.in_str) eina_stringshare_del(rp->text.cache.in_str);
|
if (rp->typedata.text->cache.in_str) eina_stringshare_del(rp->typedata.text->cache.in_str);
|
||||||
if (rp->text.cache.out_str) eina_stringshare_del(rp->text.cache.out_str);
|
if (rp->typedata.text->cache.out_str) eina_stringshare_del(rp->typedata.text->cache.out_str);
|
||||||
|
|
||||||
if (rp->custom)
|
if (rp->custom)
|
||||||
{
|
{
|
||||||
|
@ -2230,8 +2230,8 @@ edje_edit_part_del(Evas_Object *obj, const char* part)
|
||||||
if (i == id) continue; //don't check the deleted id
|
if (i == id) continue; //don't check the deleted id
|
||||||
real = ed->table_parts[i];
|
real = ed->table_parts[i];
|
||||||
|
|
||||||
if (real->text.source == rp) real->text.source = NULL;
|
if (real->typedata.text->source == rp) real->typedata.text->source = NULL;
|
||||||
if (real->text.text_source == rp) real->text.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_x == rp) real->param1.rel1_to_x = NULL;
|
||||||
if (real->param1.rel1_to_y == rp) real->param1.rel1_to_y = NULL;
|
if (real->param1.rel1_to_y == rp) real->param1.rel1_to_y = NULL;
|
||||||
|
@ -2376,8 +2376,8 @@ edje_edit_part_restack_below(Evas_Object *obj, const char* part)
|
||||||
_edje_parts_id_switch(ed, rp, prev);
|
_edje_parts_id_switch(ed, rp, prev);
|
||||||
|
|
||||||
evas_object_stack_below(rp->object, prev->object);
|
evas_object_stack_below(rp->object, prev->object);
|
||||||
if (rp->swallowed_object)
|
if (rp->typedata.swallow->swallowed_object)
|
||||||
evas_object_stack_above(rp->swallowed_object, rp->object);
|
evas_object_stack_above(rp->typedata.swallow->swallowed_object, rp->object);
|
||||||
|
|
||||||
_edje_edit_flag_script_dirty(eed, EINA_TRUE);
|
_edje_edit_flag_script_dirty(eed, EINA_TRUE);
|
||||||
|
|
||||||
|
@ -2412,8 +2412,8 @@ edje_edit_part_restack_above(Evas_Object *obj, const char* part)
|
||||||
_edje_parts_id_switch(ed, rp, next);
|
_edje_parts_id_switch(ed, rp, next);
|
||||||
|
|
||||||
evas_object_stack_above(rp->object, next->object);
|
evas_object_stack_above(rp->object, next->object);
|
||||||
if (rp->swallowed_object)
|
if (rp->typedata.swallow->swallowed_object)
|
||||||
evas_object_stack_above(rp->swallowed_object, rp->object);
|
evas_object_stack_above(rp->typedata.swallow->swallowed_object, rp->object);
|
||||||
|
|
||||||
_edje_edit_flag_script_dirty(eed, EINA_TRUE);
|
_edje_edit_flag_script_dirty(eed, EINA_TRUE);
|
||||||
|
|
||||||
|
@ -2508,8 +2508,8 @@ edje_edit_part_clip_to_set(Evas_Object *obj, const char *part, const char *clip_
|
||||||
}
|
}
|
||||||
|
|
||||||
evas_object_clip_set(rp->object, ed->base.clipper);
|
evas_object_clip_set(rp->object, ed->base.clipper);
|
||||||
if (rp->swallowed_object)
|
if (rp->typedata.swallow->swallowed_object)
|
||||||
evas_object_clip_set(rp->swallowed_object, ed->base.clipper);
|
evas_object_clip_set(rp->typedata.swallow->swallowed_object, ed->base.clipper);
|
||||||
|
|
||||||
rp->part->clip_to_id = -1;
|
rp->part->clip_to_id = -1;
|
||||||
rp->clip_to = NULL;
|
rp->clip_to = NULL;
|
||||||
|
@ -2537,8 +2537,8 @@ edje_edit_part_clip_to_set(Evas_Object *obj, const char *part, const char *clip_
|
||||||
evas_object_pass_events_set(rp->clip_to->object, 1);
|
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_pointer_mode_set(rp->clip_to->object, EVAS_OBJECT_POINTER_MODE_NOGRAB);
|
||||||
evas_object_clip_set(rp->object, rp->clip_to->object);
|
evas_object_clip_set(rp->object, rp->clip_to->object);
|
||||||
if (rp->swallowed_object)
|
if (rp->typedata.swallow->swallowed_object)
|
||||||
evas_object_clip_set(rp->swallowed_object, rp->clip_to->object);
|
evas_object_clip_set(rp->typedata.swallow->swallowed_object, rp->clip_to->object);
|
||||||
|
|
||||||
edje_object_calc_force(obj);
|
edje_object_calc_force(obj);
|
||||||
|
|
||||||
|
@ -2683,11 +2683,11 @@ edje_edit_part_source_set(Evas_Object *obj, const char *part, const char *source
|
||||||
|
|
||||||
_edje_if_string_free(ed, rp->part->source);
|
_edje_if_string_free(ed, rp->part->source);
|
||||||
|
|
||||||
if (rp->swallowed_object)
|
if (rp->typedata.swallow->swallowed_object)
|
||||||
{
|
{
|
||||||
_edje_real_part_swallow_clear(rp);
|
_edje_real_part_swallow_clear(rp);
|
||||||
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 (source)
|
if (source)
|
||||||
{
|
{
|
||||||
|
@ -3197,7 +3197,7 @@ edje_edit_state_add(Evas_Object *obj, const char *part, const char *name, double
|
||||||
pi++;
|
pi++;
|
||||||
}
|
}
|
||||||
if (external->external_params)
|
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)
|
else if (rp->part->type == EDJE_PART_TYPE_BOX)
|
||||||
|
@ -4126,10 +4126,10 @@ edje_edit_state_external_param_set(Evas_Object *obj, const char *part, const cha
|
||||||
if (!found)
|
if (!found)
|
||||||
external->external_params = eina_list_append(external->external_params, p);
|
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);
|
||||||
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);
|
external->external_params);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -98,9 +98,11 @@ _edje_entry_focus_in_cb(void *data, Evas_Object *o __UNUSED__, const char *emiss
|
||||||
Entry *en;
|
Entry *en;
|
||||||
|
|
||||||
rp = data;
|
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 (!en || !en->imf_context) return;
|
||||||
|
|
||||||
if (evas_object_focus_get(rp->edje->obj))
|
if (evas_object_focus_get(rp->edje->obj))
|
||||||
|
@ -118,9 +120,11 @@ _edje_entry_focus_out_cb(void *data, Evas_Object *o __UNUSED__, const char *emis
|
||||||
Entry *en;
|
Entry *en;
|
||||||
|
|
||||||
rp = data;
|
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;
|
if (!en || !en->imf_context) return;
|
||||||
|
|
||||||
ecore_imf_context_reset(en->imf_context);
|
ecore_imf_context_reset(en->imf_context);
|
||||||
|
@ -142,8 +146,9 @@ _edje_focus_in_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
rp = ed->focused_part;
|
rp = ed->focused_part;
|
||||||
if (!rp) return;
|
if (!rp) return;
|
||||||
|
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
||||||
en = rp->entry_data;
|
(!rp->typedata.text)) return;
|
||||||
|
en = rp->typedata.text->entry_data;
|
||||||
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
|
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
|
||||||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
|
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
|
||||||
return;
|
return;
|
||||||
|
@ -169,7 +174,9 @@ _edje_focus_out_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
|
||||||
|
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
if (!rp) return;
|
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) ||
|
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
|
||||||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
|
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
|
||||||
return;
|
return;
|
||||||
|
@ -635,7 +642,9 @@ _edje_anchor_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UN
|
||||||
int ignored;
|
int ignored;
|
||||||
Entry *en;
|
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) &&
|
if ((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) &&
|
||||||
(en->select_allow))
|
(en->select_allow))
|
||||||
return;
|
return;
|
||||||
|
@ -667,7 +676,9 @@ _edje_anchor_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
|
||||||
int ignored;
|
int ignored;
|
||||||
Entry *en;
|
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;
|
ignored = rp->part->ignore_flags & ev->event_flags;
|
||||||
if ((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) &&
|
if ((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) &&
|
||||||
(en->select_allow))
|
(en->select_allow))
|
||||||
|
@ -699,7 +710,9 @@ _edje_anchor_mouse_move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UN
|
||||||
int ignored;
|
int ignored;
|
||||||
Entry *en;
|
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) &&
|
if ((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) &&
|
||||||
(en->select_allow))
|
(en->select_allow))
|
||||||
return;
|
return;
|
||||||
|
@ -1182,7 +1195,9 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v
|
||||||
Eina_Bool cursor_changed;
|
Eina_Bool cursor_changed;
|
||||||
int old_cur_pos;
|
int old_cur_pos;
|
||||||
if (!rp) return;
|
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) ||
|
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
|
||||||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
|
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
|
||||||
return;
|
return;
|
||||||
|
@ -1693,7 +1708,9 @@ _edje_key_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, voi
|
||||||
Entry *en;
|
Entry *en;
|
||||||
|
|
||||||
if (!rp) return;
|
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) ||
|
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
|
||||||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
|
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
|
||||||
return;
|
return;
|
||||||
|
@ -1721,7 +1738,9 @@ _edje_part_move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
|
||||||
Edje_Real_Part *rp = data;
|
Edje_Real_Part *rp = data;
|
||||||
Entry *en;
|
Entry *en;
|
||||||
if (!rp) return;
|
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;
|
if (!en) return;
|
||||||
_edje_entry_imf_cursor_info_set(en);
|
_edje_entry_imf_cursor_info_set(en);
|
||||||
}
|
}
|
||||||
|
@ -1740,7 +1759,9 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
|
||||||
Eina_Bool shift;
|
Eina_Bool shift;
|
||||||
if (!rp) return;
|
if (!rp) return;
|
||||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) 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) ||
|
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
|
||||||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
|
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
|
||||||
return;
|
return;
|
||||||
|
@ -1971,7 +1992,9 @@ _edje_part_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED
|
||||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
|
||||||
if (ev->flags & EVAS_BUTTON_TRIPLE_CLICK) return;
|
if (ev->flags & EVAS_BUTTON_TRIPLE_CLICK) return;
|
||||||
if (ev->flags & EVAS_BUTTON_DOUBLE_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) ||
|
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
|
||||||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
|
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
|
||||||
return;
|
return;
|
||||||
|
@ -2076,7 +2099,9 @@ _edje_part_mouse_move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
|
||||||
Evas_Coord x, y, w, h;
|
Evas_Coord x, y, w, h;
|
||||||
Evas_Textblock_Cursor *tc;
|
Evas_Textblock_Cursor *tc;
|
||||||
if (!rp) return;
|
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) ||
|
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
|
||||||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
|
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
|
||||||
return;
|
return;
|
||||||
|
@ -2233,9 +2258,11 @@ _edje_entry_real_part_init(Edje_Real_Part *rp)
|
||||||
const Ecore_IMF_Context_Info *ctx_info;
|
const Ecore_IMF_Context_Info *ctx_info;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
||||||
|
(!rp->typedata.text)) return;
|
||||||
en = calloc(1, sizeof(Entry));
|
en = calloc(1, sizeof(Entry));
|
||||||
if (!en) return;
|
if (!en) return;
|
||||||
rp->entry_data = en;
|
rp->typedata.text->entry_data = en;
|
||||||
en->rp = rp;
|
en->rp = rp;
|
||||||
|
|
||||||
evas_object_event_callback_add(rp->object, EVAS_CALLBACK_MOVE, _edje_part_move_cb, rp);
|
evas_object_event_callback_add(rp->object, EVAS_CALLBACK_MOVE, _edje_part_move_cb, rp);
|
||||||
|
@ -2341,9 +2368,13 @@ done:
|
||||||
void
|
void
|
||||||
_edje_entry_real_part_shutdown(Edje_Real_Part *rp)
|
_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;
|
if (!en) return;
|
||||||
rp->entry_data = NULL;
|
rp->typedata.text->entry_data = NULL;
|
||||||
_sel_clear(en->cursor, rp->object, en);
|
_sel_clear(en->cursor, rp->object, en);
|
||||||
_anchors_clear(en->cursor, rp->object, en);
|
_anchors_clear(en->cursor, rp->object, en);
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
|
@ -2385,8 +2416,12 @@ void
|
||||||
_edje_entry_real_part_configure(Edje_Real_Part *rp)
|
_edje_entry_real_part_configure(Edje_Real_Part *rp)
|
||||||
{
|
{
|
||||||
Evas_Coord x, y, w, h, xx, yy, ww, hh;
|
Evas_Coord x, y, w, h, xx, yy, ww, hh;
|
||||||
Entry *en = rp->entry_data;
|
Entry *en;
|
||||||
Evas_Textblock_Cursor_Type cur_type;
|
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;
|
if (!en) return;
|
||||||
switch (rp->part->cursor_mode)
|
switch (rp->part->cursor_mode)
|
||||||
{
|
{
|
||||||
|
@ -2422,7 +2457,11 @@ _edje_entry_real_part_configure(Edje_Real_Part *rp)
|
||||||
const char *
|
const char *
|
||||||
_edje_entry_selection_get(Edje_Real_Part *rp)
|
_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;
|
if (!en) return NULL;
|
||||||
// get selection - convert to markup
|
// get selection - convert to markup
|
||||||
if ((!en->selection) && (en->have_selection))
|
if ((!en->selection) && (en->have_selection))
|
||||||
|
@ -2434,7 +2473,11 @@ _edje_entry_selection_get(Edje_Real_Part *rp)
|
||||||
const char *
|
const char *
|
||||||
_edje_entry_text_get(Edje_Real_Part *rp)
|
_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;
|
if (!en) return NULL;
|
||||||
// get text - convert to markup
|
// get text - convert to markup
|
||||||
return evas_object_textblock_text_markup_get(rp->object);
|
return evas_object_textblock_text_markup_get(rp->object);
|
||||||
|
@ -2443,7 +2486,11 @@ _edje_entry_text_get(Edje_Real_Part *rp)
|
||||||
void
|
void
|
||||||
_edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text)
|
_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;
|
if (!en) return;
|
||||||
_edje_entry_imf_context_reset(rp);
|
_edje_entry_imf_context_reset(rp);
|
||||||
// set text as markup
|
// set text as markup
|
||||||
|
@ -2465,7 +2512,11 @@ _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text)
|
||||||
void
|
void
|
||||||
_edje_entry_text_markup_append(Edje_Real_Part *rp, const char *text)
|
_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;
|
Evas_Textblock_Cursor *end_cur;
|
||||||
if (!en) return;
|
if (!en) return;
|
||||||
end_cur = evas_object_textblock_cursor_new(rp->object);
|
end_cur = evas_object_textblock_cursor_new(rp->object);
|
||||||
|
@ -2484,7 +2535,11 @@ _edje_entry_text_markup_append(Edje_Real_Part *rp, const char *text)
|
||||||
void
|
void
|
||||||
_edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text)
|
_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;
|
if (!en) return;
|
||||||
_edje_entry_imf_context_reset(rp);
|
_edje_entry_imf_context_reset(rp);
|
||||||
|
|
||||||
|
@ -2505,7 +2560,11 @@ _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text)
|
||||||
void
|
void
|
||||||
_edje_entry_set_cursor_start(Edje_Real_Part *rp)
|
_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;
|
if (!en) return;
|
||||||
_curs_start(en->cursor, rp->object, en);
|
_curs_start(en->cursor, rp->object, en);
|
||||||
|
|
||||||
|
@ -2515,7 +2574,11 @@ _edje_entry_set_cursor_start(Edje_Real_Part *rp)
|
||||||
void
|
void
|
||||||
_edje_entry_set_cursor_end(Edje_Real_Part *rp)
|
_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;
|
if (!en) return;
|
||||||
_curs_end(en->cursor, rp->object, en);
|
_curs_end(en->cursor, rp->object, en);
|
||||||
|
|
||||||
|
@ -2525,7 +2588,11 @@ _edje_entry_set_cursor_end(Edje_Real_Part *rp)
|
||||||
void
|
void
|
||||||
_edje_entry_select_none(Edje_Real_Part *rp)
|
_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;
|
if (!en) return;
|
||||||
_sel_clear(en->cursor, rp->object, en);
|
_sel_clear(en->cursor, rp->object, en);
|
||||||
}
|
}
|
||||||
|
@ -2533,7 +2600,11 @@ _edje_entry_select_none(Edje_Real_Part *rp)
|
||||||
void
|
void
|
||||||
_edje_entry_select_all(Edje_Real_Part *rp)
|
_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;
|
if (!en) return;
|
||||||
|
|
||||||
_edje_entry_imf_context_reset(rp);
|
_edje_entry_imf_context_reset(rp);
|
||||||
|
@ -2552,7 +2623,11 @@ _edje_entry_select_all(Edje_Real_Part *rp)
|
||||||
void
|
void
|
||||||
_edje_entry_select_begin(Edje_Real_Part *rp)
|
_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;
|
if (!en) return;
|
||||||
|
|
||||||
_edje_entry_imf_context_reset(rp);
|
_edje_entry_imf_context_reset(rp);
|
||||||
|
@ -2570,7 +2645,11 @@ _edje_entry_select_begin(Edje_Real_Part *rp)
|
||||||
void
|
void
|
||||||
_edje_entry_select_extend(Edje_Real_Part *rp)
|
_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;
|
if (!en) return;
|
||||||
_edje_entry_imf_context_reset(rp);
|
_edje_entry_imf_context_reset(rp);
|
||||||
_sel_extend(en->cursor, rp->object, en);
|
_sel_extend(en->cursor, rp->object, en);
|
||||||
|
@ -2583,10 +2662,13 @@ _edje_entry_select_extend(Edje_Real_Part *rp)
|
||||||
const Eina_List *
|
const Eina_List *
|
||||||
_edje_entry_anchor_geometry_get(Edje_Real_Part *rp, const char *anchor)
|
_edje_entry_anchor_geometry_get(Edje_Real_Part *rp, const char *anchor)
|
||||||
{
|
{
|
||||||
Entry *en = rp->entry_data;
|
Entry *en;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
Anchor *an;
|
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) return NULL;
|
||||||
EINA_LIST_FOREACH(en->anchors, l, an)
|
EINA_LIST_FOREACH(en->anchors, l, an)
|
||||||
{
|
{
|
||||||
|
@ -2600,10 +2682,13 @@ _edje_entry_anchor_geometry_get(Edje_Real_Part *rp, const char *anchor)
|
||||||
const Eina_List *
|
const Eina_List *
|
||||||
_edje_entry_anchors_list(Edje_Real_Part *rp)
|
_edje_entry_anchors_list(Edje_Real_Part *rp)
|
||||||
{
|
{
|
||||||
Entry *en = rp->entry_data;
|
Entry *en;
|
||||||
Eina_List *l, *anchors = NULL;
|
Eina_List *l, *anchors = NULL;
|
||||||
Anchor *an;
|
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) return NULL;
|
||||||
if (!en->anchorlist)
|
if (!en->anchorlist)
|
||||||
{
|
{
|
||||||
|
@ -2622,10 +2707,13 @@ _edje_entry_anchors_list(Edje_Real_Part *rp)
|
||||||
Eina_Bool
|
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)
|
_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;
|
Eina_List *l;
|
||||||
Anchor *an;
|
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;
|
if (!en) return EINA_FALSE;
|
||||||
EINA_LIST_FOREACH(en->anchors, l, an)
|
EINA_LIST_FOREACH(en->anchors, l, an)
|
||||||
{
|
{
|
||||||
|
@ -2642,10 +2730,13 @@ _edje_entry_item_geometry_get(Edje_Real_Part *rp, const char *item, Evas_Coord *
|
||||||
const Eina_List *
|
const Eina_List *
|
||||||
_edje_entry_items_list(Edje_Real_Part *rp)
|
_edje_entry_items_list(Edje_Real_Part *rp)
|
||||||
{
|
{
|
||||||
Entry *en = rp->entry_data;
|
Entry *en;
|
||||||
Eina_List *l, *items = NULL;
|
Eina_List *l, *items = NULL;
|
||||||
Anchor *an;
|
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) return NULL;
|
||||||
if (!en->itemlist)
|
if (!en->itemlist)
|
||||||
{
|
{
|
||||||
|
@ -2665,8 +2756,12 @@ void
|
||||||
_edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
|
_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;
|
Evas_Coord x, y, w, h, xx, yy, ww, hh;
|
||||||
Entry *en = rp->entry_data;
|
Entry *en;
|
||||||
Evas_Textblock_Cursor_Type cur_type;
|
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;
|
if (!en) return;
|
||||||
switch (rp->part->cursor_mode)
|
switch (rp->part->cursor_mode)
|
||||||
{
|
{
|
||||||
|
@ -2696,8 +2791,15 @@ _edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Coord *
|
||||||
void
|
void
|
||||||
_edje_entry_user_insert(Edje_Real_Part *rp, const char *text)
|
_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));
|
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->insert = EINA_TRUE;
|
||||||
info->change.insert.plain_length = 1;
|
info->change.insert.plain_length = 1;
|
||||||
info->change.insert.content = eina_stringshare_add(text);
|
info->change.insert.content = eina_stringshare_add(text);
|
||||||
|
@ -2726,7 +2828,12 @@ _edje_entry_user_insert(Edje_Real_Part *rp, const char *text)
|
||||||
void
|
void
|
||||||
_edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow)
|
_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)
|
if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_DEFAULT)
|
||||||
return;
|
return;
|
||||||
en->select_allow = allow;
|
en->select_allow = allow;
|
||||||
|
@ -2735,14 +2842,24 @@ _edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow)
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
_edje_entry_select_allow_get(const Edje_Real_Part *rp)
|
_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;
|
return en->select_allow;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_edje_entry_select_abort(Edje_Real_Part *rp)
|
_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)
|
if (en->selecting)
|
||||||
{
|
{
|
||||||
en->selecting = EINA_FALSE;
|
en->selecting = EINA_FALSE;
|
||||||
|
@ -2756,7 +2873,11 @@ _edje_entry_select_abort(Edje_Real_Part *rp)
|
||||||
void *
|
void *
|
||||||
_edje_entry_imf_context_get(Edje_Real_Part *rp)
|
_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;
|
if (!en) return NULL;
|
||||||
|
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
|
@ -2769,7 +2890,11 @@ _edje_entry_imf_context_get(Edje_Real_Part *rp)
|
||||||
void
|
void
|
||||||
_edje_entry_autocapital_type_set(Edje_Real_Part *rp, Edje_Text_Autocapital_Type autocapital_type)
|
_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 (!en) return;
|
||||||
|
|
||||||
if (rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD)
|
if (rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD)
|
||||||
|
@ -2784,7 +2909,11 @@ _edje_entry_autocapital_type_set(Edje_Real_Part *rp, Edje_Text_Autocapital_Type
|
||||||
Edje_Text_Autocapital_Type
|
Edje_Text_Autocapital_Type
|
||||||
_edje_entry_autocapital_type_get(Edje_Real_Part *rp)
|
_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;
|
if (!en) return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE;
|
||||||
|
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
|
@ -2798,8 +2927,11 @@ _edje_entry_autocapital_type_get(Edje_Real_Part *rp)
|
||||||
void
|
void
|
||||||
_edje_entry_prediction_allow_set(Edje_Real_Part *rp, Eina_Bool prediction)
|
_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;
|
if (!en) return;
|
||||||
en->prediction_allow = prediction;
|
en->prediction_allow = prediction;
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
|
@ -2811,17 +2943,23 @@ _edje_entry_prediction_allow_set(Edje_Real_Part *rp, Eina_Bool prediction)
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
_edje_entry_prediction_allow_get(Edje_Real_Part *rp)
|
_edje_entry_prediction_allow_get(Edje_Real_Part *rp)
|
||||||
{
|
{
|
||||||
Entry *en = rp->entry_data;
|
Entry *en;
|
||||||
if (!en) return EINA_FALSE;
|
|
||||||
|
|
||||||
|
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;
|
return en->prediction_allow;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled)
|
_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;
|
if (!en) return;
|
||||||
en->input_panel_enable = enabled;
|
en->input_panel_enable = enabled;
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
|
@ -2833,17 +2971,23 @@ _edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled)
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
_edje_entry_input_panel_enabled_get(Edje_Real_Part *rp)
|
_edje_entry_input_panel_enabled_get(Edje_Real_Part *rp)
|
||||||
{
|
{
|
||||||
Entry *en = rp->entry_data;
|
Entry *en;
|
||||||
if (!en) return EINA_FALSE;
|
|
||||||
|
|
||||||
|
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;
|
return en->input_panel_enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_edje_entry_input_panel_show(Edje_Real_Part *rp)
|
_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;
|
if (!en) return;
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
if (en->imf_context)
|
if (en->imf_context)
|
||||||
|
@ -2854,8 +2998,11 @@ _edje_entry_input_panel_show(Edje_Real_Part *rp)
|
||||||
void
|
void
|
||||||
_edje_entry_input_panel_hide(Edje_Real_Part *rp)
|
_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;
|
if (!en) return;
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
if (en->imf_context)
|
if (en->imf_context)
|
||||||
|
@ -2866,8 +3013,11 @@ _edje_entry_input_panel_hide(Edje_Real_Part *rp)
|
||||||
void
|
void
|
||||||
_edje_entry_input_panel_language_set(Edje_Real_Part *rp, Edje_Input_Panel_Lang lang)
|
_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;
|
if (!en) return;
|
||||||
en->input_panel_lang = lang;
|
en->input_panel_lang = lang;
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
|
@ -2879,9 +3029,12 @@ _edje_entry_input_panel_language_set(Edje_Real_Part *rp, Edje_Input_Panel_Lang l
|
||||||
Edje_Input_Panel_Lang
|
Edje_Input_Panel_Lang
|
||||||
_edje_entry_input_panel_language_get(Edje_Real_Part *rp)
|
_edje_entry_input_panel_language_get(Edje_Real_Part *rp)
|
||||||
{
|
{
|
||||||
Entry *en = rp->entry_data;
|
Entry *en;
|
||||||
if (!en) return EDJE_INPUT_PANEL_LANG_AUTOMATIC;
|
|
||||||
|
|
||||||
|
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;
|
return en->input_panel_lang;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2893,7 +3046,11 @@ void
|
||||||
_edje_entry_input_panel_imdata_set(Edje_Real_Part *rp, const void *data __UNUSED__, int len __UNUSED__)
|
_edje_entry_input_panel_imdata_set(Edje_Real_Part *rp, const void *data __UNUSED__, int len __UNUSED__)
|
||||||
#endif
|
#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;
|
if (!en) return;
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
if (en->imf_context)
|
if (en->imf_context)
|
||||||
|
@ -2909,7 +3066,11 @@ void
|
||||||
_edje_entry_input_panel_imdata_get(Edje_Real_Part *rp, void *data __UNUSED__, int *len __UNUSED__)
|
_edje_entry_input_panel_imdata_get(Edje_Real_Part *rp, void *data __UNUSED__, int *len __UNUSED__)
|
||||||
#endif
|
#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;
|
if (!en) return;
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
if (en->imf_context)
|
if (en->imf_context)
|
||||||
|
@ -2925,7 +3086,11 @@ void
|
||||||
_edje_entry_input_panel_return_key_type_set(Edje_Real_Part *rp, Edje_Input_Panel_Return_Key_Type return_key_type __UNUSED__)
|
_edje_entry_input_panel_return_key_type_set(Edje_Real_Part *rp, Edje_Input_Panel_Return_Key_Type return_key_type __UNUSED__)
|
||||||
#endif
|
#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;
|
if (!en) return;
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
if (en->imf_context)
|
if (en->imf_context)
|
||||||
|
@ -2936,7 +3101,11 @@ _edje_entry_input_panel_return_key_type_set(Edje_Real_Part *rp, Edje_Input_Panel
|
||||||
Edje_Input_Panel_Return_Key_Type
|
Edje_Input_Panel_Return_Key_Type
|
||||||
_edje_entry_input_panel_return_key_type_get(Edje_Real_Part *rp)
|
_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;
|
if (!en) return EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
if (en->imf_context)
|
if (en->imf_context)
|
||||||
|
@ -2953,7 +3122,11 @@ void
|
||||||
_edje_entry_input_panel_return_key_disabled_set(Edje_Real_Part *rp, Eina_Bool disabled __UNUSED__)
|
_edje_entry_input_panel_return_key_disabled_set(Edje_Real_Part *rp, Eina_Bool disabled __UNUSED__)
|
||||||
#endif
|
#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;
|
if (!en) return;
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
if (en->imf_context)
|
if (en->imf_context)
|
||||||
|
@ -2964,7 +3137,11 @@ _edje_entry_input_panel_return_key_disabled_set(Edje_Real_Part *rp, Eina_Bool di
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
_edje_entry_input_panel_return_key_disabled_get(Edje_Real_Part *rp)
|
_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;
|
if (!en) return EINA_FALSE;
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
if (en->imf_context)
|
if (en->imf_context)
|
||||||
|
@ -2976,9 +3153,12 @@ _edje_entry_input_panel_return_key_disabled_get(Edje_Real_Part *rp)
|
||||||
static Evas_Textblock_Cursor *
|
static Evas_Textblock_Cursor *
|
||||||
_cursor_get(Edje_Real_Part *rp, Edje_Cursor cur)
|
_cursor_get(Edje_Real_Part *rp, Edje_Cursor cur)
|
||||||
{
|
{
|
||||||
Entry *en = rp->entry_data;
|
Entry *en;
|
||||||
if (!en) return NULL;
|
|
||||||
|
|
||||||
|
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
||||||
|
(!rp->typedata.text)) return NULL;
|
||||||
|
en = rp->typedata.text->entry_data;
|
||||||
|
if (!en) return NULL;
|
||||||
switch (cur)
|
switch (cur)
|
||||||
{
|
{
|
||||||
case EDJE_CURSOR_MAIN:
|
case EDJE_CURSOR_MAIN:
|
||||||
|
@ -3012,8 +3192,14 @@ _cursor_get(Edje_Real_Part *rp, Edje_Cursor cur)
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
_edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur)
|
_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);
|
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;
|
if (!c) return EINA_FALSE;
|
||||||
|
|
||||||
_edje_entry_imf_context_reset(rp);
|
_edje_entry_imf_context_reset(rp);
|
||||||
|
@ -3022,7 +3208,7 @@ _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur)
|
||||||
{
|
{
|
||||||
return EINA_FALSE;
|
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_entry_imf_cursor_info_set(en);
|
||||||
|
|
||||||
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
|
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
|
||||||
|
@ -3033,8 +3219,13 @@ _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur)
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
_edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur)
|
_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);
|
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;
|
if (!c) return EINA_FALSE;
|
||||||
|
|
||||||
_edje_entry_imf_context_reset(rp);
|
_edje_entry_imf_context_reset(rp);
|
||||||
|
@ -3045,7 +3236,7 @@ _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur)
|
||||||
else return EINA_FALSE;
|
else return EINA_FALSE;
|
||||||
}
|
}
|
||||||
ok:
|
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);
|
_edje_entry_imf_cursor_info_set(en);
|
||||||
|
|
||||||
|
@ -3057,10 +3248,15 @@ ok:
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
_edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur)
|
_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_Textblock_Cursor *c = _cursor_get(rp, cur);
|
||||||
Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch;
|
Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch;
|
||||||
int ln;
|
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;
|
if (!c) return EINA_FALSE;
|
||||||
|
|
||||||
_edje_entry_imf_context_reset(rp);
|
_edje_entry_imf_context_reset(rp);
|
||||||
|
@ -3079,7 +3275,7 @@ _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur)
|
||||||
else
|
else
|
||||||
evas_textblock_cursor_line_char_last(c);
|
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_entry_imf_cursor_info_set(en);
|
||||||
|
|
||||||
|
@ -3091,10 +3287,15 @@ _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur)
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
_edje_entry_cursor_down(Edje_Real_Part *rp, Edje_Cursor cur)
|
_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_Textblock_Cursor *c = _cursor_get(rp, cur);
|
||||||
Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch;
|
Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch;
|
||||||
int ln;
|
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;
|
if (!c) return EINA_FALSE;
|
||||||
|
|
||||||
_edje_entry_imf_context_reset(rp);
|
_edje_entry_imf_context_reset(rp);
|
||||||
|
@ -3112,7 +3313,7 @@ _edje_entry_cursor_down(Edje_Real_Part *rp, Edje_Cursor cur)
|
||||||
else
|
else
|
||||||
evas_textblock_cursor_line_char_last(c);
|
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_entry_imf_cursor_info_set(en);
|
||||||
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
|
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
|
||||||
|
@ -3123,14 +3324,19 @@ _edje_entry_cursor_down(Edje_Real_Part *rp, Edje_Cursor cur)
|
||||||
void
|
void
|
||||||
_edje_entry_cursor_begin(Edje_Real_Part *rp, Edje_Cursor cur)
|
_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);
|
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;
|
if (!c) return;
|
||||||
|
|
||||||
_edje_entry_imf_context_reset(rp);
|
_edje_entry_imf_context_reset(rp);
|
||||||
|
|
||||||
evas_textblock_cursor_paragraph_first(c);
|
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_entry_imf_cursor_info_set(en);
|
||||||
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
|
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
|
||||||
|
@ -3140,14 +3346,19 @@ _edje_entry_cursor_begin(Edje_Real_Part *rp, Edje_Cursor cur)
|
||||||
void
|
void
|
||||||
_edje_entry_cursor_end(Edje_Real_Part *rp, Edje_Cursor cur)
|
_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);
|
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;
|
if (!c) return;
|
||||||
|
|
||||||
_edje_entry_imf_context_reset(rp);
|
_edje_entry_imf_context_reset(rp);
|
||||||
|
|
||||||
_curs_end(c, rp->object, rp->entry_data);
|
_curs_end(c, rp->object, rp->typedata.text->entry_data);
|
||||||
_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_entry_imf_cursor_info_set(en);
|
||||||
|
|
||||||
|
@ -3158,16 +3369,20 @@ _edje_entry_cursor_end(Edje_Real_Part *rp, Edje_Cursor cur)
|
||||||
void
|
void
|
||||||
_edje_entry_cursor_copy(Edje_Real_Part *rp, Edje_Cursor cur, Edje_Cursor dst)
|
_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 *c;
|
||||||
Evas_Textblock_Cursor *d;
|
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);
|
c = _cursor_get(rp, cur);
|
||||||
if (!c) return;
|
if (!c) return;
|
||||||
d = _cursor_get(rp, dst);
|
d = _cursor_get(rp, dst);
|
||||||
if (!d) return;
|
if (!d) return;
|
||||||
evas_textblock_cursor_copy(c, d);
|
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_context_reset(rp);
|
||||||
_edje_entry_imf_cursor_info_set(en);
|
_edje_entry_imf_cursor_info_set(en);
|
||||||
|
@ -3178,13 +3393,18 @@ _edje_entry_cursor_copy(Edje_Real_Part *rp, Edje_Cursor cur, Edje_Cursor dst)
|
||||||
void
|
void
|
||||||
_edje_entry_cursor_line_begin(Edje_Real_Part *rp, Edje_Cursor cur)
|
_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);
|
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;
|
if (!c) return;
|
||||||
_edje_entry_imf_context_reset(rp);
|
_edje_entry_imf_context_reset(rp);
|
||||||
|
|
||||||
evas_textblock_cursor_line_char_first(c);
|
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);
|
_edje_entry_imf_cursor_info_set(en);
|
||||||
|
|
||||||
|
@ -3195,12 +3415,17 @@ _edje_entry_cursor_line_begin(Edje_Real_Part *rp, Edje_Cursor cur)
|
||||||
void
|
void
|
||||||
_edje_entry_cursor_line_end(Edje_Real_Part *rp, Edje_Cursor cur)
|
_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);
|
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;
|
if (!c) return;
|
||||||
_edje_entry_imf_context_reset(rp);
|
_edje_entry_imf_context_reset(rp);
|
||||||
evas_textblock_cursor_line_char_last(c);
|
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_entry_imf_cursor_info_set(en);
|
||||||
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
|
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
|
||||||
|
@ -3253,8 +3478,13 @@ _edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur)
|
||||||
void
|
void
|
||||||
_edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos)
|
_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);
|
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;
|
if (!c) return;
|
||||||
/* Abort if cursor position didn't really change */
|
/* Abort if cursor position didn't really change */
|
||||||
if (evas_textblock_cursor_pos_get(c) == pos)
|
if (evas_textblock_cursor_pos_get(c) == pos)
|
||||||
|
@ -3262,7 +3492,7 @@ _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos)
|
||||||
|
|
||||||
_edje_entry_imf_context_reset(rp);
|
_edje_entry_imf_context_reset(rp);
|
||||||
evas_textblock_cursor_pos_set(c, pos);
|
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_entry_imf_cursor_info_set(en);
|
||||||
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
|
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
|
||||||
|
@ -3280,7 +3510,11 @@ _edje_entry_cursor_pos_get(Edje_Real_Part *rp, Edje_Cursor cur)
|
||||||
void
|
void
|
||||||
_edje_entry_input_panel_layout_set(Edje_Real_Part *rp, Edje_Input_Panel_Layout layout)
|
_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;
|
if (!en) return;
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
if (en->imf_context)
|
if (en->imf_context)
|
||||||
|
@ -3293,7 +3527,11 @@ _edje_entry_input_panel_layout_set(Edje_Real_Part *rp, Edje_Input_Panel_Layout l
|
||||||
Edje_Input_Panel_Layout
|
Edje_Input_Panel_Layout
|
||||||
_edje_entry_input_panel_layout_get(Edje_Real_Part *rp)
|
_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;
|
if (!en) return EDJE_INPUT_PANEL_LAYOUT_INVALID;
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
if (en->imf_context)
|
if (en->imf_context)
|
||||||
|
@ -3306,7 +3544,11 @@ _edje_entry_input_panel_layout_get(Edje_Real_Part *rp)
|
||||||
void
|
void
|
||||||
_edje_entry_imf_context_reset(Edje_Real_Part *rp)
|
_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;
|
if (!en) return;
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
if (en->imf_context)
|
if (en->imf_context)
|
||||||
|
@ -3337,11 +3579,14 @@ _edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx __UNU
|
||||||
{
|
{
|
||||||
Edje *ed = data;
|
Edje *ed = data;
|
||||||
Edje_Real_Part *rp = ed->focused_part;
|
Edje_Real_Part *rp = ed->focused_part;
|
||||||
Entry *en;
|
Entry *en = NULL;
|
||||||
const char *str;
|
const char *str;
|
||||||
|
|
||||||
if (!rp) return EINA_FALSE;
|
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) ||
|
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
|
||||||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
|
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
@ -3363,13 +3608,15 @@ _edje_entry_imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx __UNUSED__, v
|
||||||
{
|
{
|
||||||
Edje *ed = data;
|
Edje *ed = data;
|
||||||
Edje_Real_Part *rp = ed->focused_part;
|
Edje_Real_Part *rp = ed->focused_part;
|
||||||
Entry *en;
|
Entry *en = NULL;
|
||||||
char *commit_str = event_info;
|
char *commit_str = event_info;
|
||||||
int start_pos;
|
int start_pos;
|
||||||
|
|
||||||
if ((!rp)) return;
|
if ((!rp)) return;
|
||||||
|
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
||||||
en = rp->entry_data;
|
(!rp->typedata.text)) return;
|
||||||
|
else
|
||||||
|
en = rp->typedata.text->entry_data;
|
||||||
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
|
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
|
||||||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
|
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
|
||||||
return;
|
return;
|
||||||
|
@ -3436,7 +3683,7 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx __UN
|
||||||
{
|
{
|
||||||
Edje *ed = data;
|
Edje *ed = data;
|
||||||
Edje_Real_Part *rp = ed->focused_part;
|
Edje_Real_Part *rp = ed->focused_part;
|
||||||
Entry *en;
|
Entry *en = NULL;
|
||||||
int cursor_pos;
|
int cursor_pos;
|
||||||
int preedit_start_pos, preedit_end_pos;
|
int preedit_start_pos, preedit_end_pos;
|
||||||
char *preedit_string;
|
char *preedit_string;
|
||||||
|
@ -3448,7 +3695,10 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx __UN
|
||||||
|
|
||||||
if ((!rp)) return;
|
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) ||
|
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
|
||||||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
|
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
|
||||||
return;
|
return;
|
||||||
|
@ -3570,13 +3820,16 @@ _edje_entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx _
|
||||||
{
|
{
|
||||||
Edje *ed = data;
|
Edje *ed = data;
|
||||||
Edje_Real_Part *rp = ed->focused_part;
|
Edje_Real_Part *rp = ed->focused_part;
|
||||||
Entry *en;
|
Entry *en = NULL;
|
||||||
Ecore_IMF_Event_Delete_Surrounding *ev = event_info;
|
Ecore_IMF_Event_Delete_Surrounding *ev = event_info;
|
||||||
Evas_Textblock_Cursor *del_start, *del_end;
|
Evas_Textblock_Cursor *del_start, *del_end;
|
||||||
int cursor_pos;
|
int cursor_pos;
|
||||||
|
|
||||||
if ((!rp) || (!ev)) return;
|
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) ||
|
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
|
||||||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
|
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -47,7 +47,9 @@ edje_object_part_external_object_get(const Evas_Object *obj, const char *part)
|
||||||
rp->part->name);
|
rp->part->name);
|
||||||
return NULL;
|
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
|
EAPI Eina_Bool
|
||||||
|
@ -111,8 +113,9 @@ edje_object_part_external_content_get(const Evas_Object *obj, const char *part,
|
||||||
ERR("no part '%s'", part);
|
ERR("no part '%s'", part);
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
|
||||||
return _edje_external_content_get(rp->swallowed_object, content);
|
(!rp->typedata.swallow)) return NULL;
|
||||||
|
return _edje_external_content_get(rp->typedata.swallow->swallowed_object, content);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Edje_External_Param_Type
|
EAPI Edje_External_Param_Type
|
||||||
|
@ -132,7 +135,9 @@ edje_object_part_external_param_type_get(const Evas_Object *obj, const char *par
|
||||||
ERR("no part '%s'", part);
|
ERR("no part '%s'", part);
|
||||||
return EDJE_EXTERNAL_PARAM_TYPE_MAX;
|
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)
|
if (!type)
|
||||||
{
|
{
|
||||||
ERR("no external type for object %p", obj);
|
ERR("no external type for object %p", obj);
|
||||||
|
@ -409,7 +414,11 @@ _edje_external_signal_emit(Evas_Object *obj, const char *emission, const char *s
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
_edje_external_param_set(Evas_Object *obj, Edje_Real_Part *rp, const Edje_External_Param *param)
|
_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");
|
Edje_External_Type *type = evas_object_data_get(swallowed_object, "Edje_External_Type");
|
||||||
if (!type)
|
if (!type)
|
||||||
{
|
{
|
||||||
|
@ -438,7 +447,11 @@ _edje_external_param_set(Evas_Object *obj, Edje_Real_Part *rp, const Edje_Extern
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
_edje_external_param_get(const Evas_Object *obj, Edje_Real_Part *rp, Edje_External_Param *param)
|
_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");
|
Edje_External_Type *type = evas_object_data_get(swallowed_object, "Edje_External_Type");
|
||||||
if (!type)
|
if (!type)
|
||||||
{
|
{
|
||||||
|
@ -508,8 +521,10 @@ _edje_external_recalc_apply(Edje *ed __UNUSED__, Edje_Real_Part *ep,
|
||||||
Edje_Part_Description_External *ext;
|
Edje_Part_Description_External *ext;
|
||||||
void *params1, *params2 = NULL;
|
void *params1, *params2 = NULL;
|
||||||
|
|
||||||
if (!ep->swallowed_object) return;
|
if ((ep->type != EDJE_RP_TYPE_SWALLOW) ||
|
||||||
type = evas_object_data_get(ep->swallowed_object, "Edje_External_Type");
|
(!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;
|
if ((!type) || (!type->state_set)) return;
|
||||||
|
|
||||||
|
@ -526,7 +541,7 @@ _edje_external_recalc_apply(Edje *ed __UNUSED__, Edje_Real_Part *ep,
|
||||||
ep->param2->external_params : ext->external_params;
|
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);
|
params1, params2, ep->description_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -454,6 +454,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
for (n = 0; n < ed->collection->parts_count; n++)
|
for (n = 0; n < ed->collection->parts_count; n++)
|
||||||
{
|
{
|
||||||
Edje_Part *ep;
|
Edje_Part *ep;
|
||||||
|
Eina_Bool memerr = EINA_FALSE;
|
||||||
|
|
||||||
ep = ed->collection->parts[n];
|
ep = ed->collection->parts[n];
|
||||||
|
|
||||||
|
@ -494,6 +495,41 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
rp->drag->step.x = FROM_INT(ep->dragable.step_x);
|
rp->drag->step.x = FROM_INT(ep->dragable.step_x);
|
||||||
rp->drag->step.y = FROM_INT(ep->dragable.step_y);
|
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;
|
rp->edje = ed;
|
||||||
_edje_ref(rp->edje);
|
_edje_ref(rp->edje);
|
||||||
|
@ -539,7 +575,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
case EDJE_PART_TYPE_BOX:
|
case EDJE_PART_TYPE_BOX:
|
||||||
sources = eina_list_append(sources, rp);
|
sources = eina_list_append(sources, rp);
|
||||||
rp->object = evas_object_box_add(ed->base.evas);
|
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;
|
break;
|
||||||
case EDJE_PART_TYPE_TABLE:
|
case EDJE_PART_TYPE_TABLE:
|
||||||
sources = eina_list_append(sources, rp);
|
sources = eina_list_append(sources, rp);
|
||||||
|
@ -679,10 +715,14 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
rp->events_to = NULL;
|
rp->events_to = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
rp->swallow_params.min.w = 0;
|
if ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
|
||||||
rp->swallow_params.min.h = 0;
|
(rp->typedata.swallow))
|
||||||
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 (rp->part->type == EDJE_PART_TYPE_TEXT
|
if (rp->part->type == EDJE_PART_TYPE_TEXT
|
||||||
|| rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)
|
|| rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)
|
||||||
|
@ -697,10 +737,14 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
text->text.id_text_source = -1;
|
text->text.id_text_source = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (text->text.id_source >= 0)
|
if ((rp->type == EDJE_RP_TYPE_TEXT) &&
|
||||||
rp->text.source = ed->table_parts[text->text.id_source % ed->table_parts_size];
|
(rp->typedata.text))
|
||||||
if (text->text.id_text_source >= 0)
|
{
|
||||||
rp->text.text_source = ed->table_parts[text->text.id_text_source % ed->table_parts_size];
|
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)
|
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
|
||||||
{
|
{
|
||||||
_edje_entry_real_part_init(rp);
|
_edje_entry_real_part_init(rp);
|
||||||
|
@ -881,39 +925,43 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pack_it->parent = rp;
|
if ((rp->type == EDJE_RP_TYPE_CONTAINER) &&
|
||||||
|
(rp->typedata.container))
|
||||||
|
{
|
||||||
|
pack_it->parent = rp;
|
||||||
|
|
||||||
_edje_object_pack_item_hints_set(child_obj, pack_it);
|
_edje_object_pack_item_hints_set(child_obj, pack_it);
|
||||||
if (pack_it->name)
|
if (pack_it->name)
|
||||||
evas_object_name_set(child_obj, pack_it->name);
|
evas_object_name_set(child_obj, pack_it->name);
|
||||||
|
|
||||||
if (rp->part->type == EDJE_PART_TYPE_BOX)
|
if (rp->part->type == EDJE_PART_TYPE_BOX)
|
||||||
{
|
{
|
||||||
_edje_real_part_box_append(rp, child_obj);
|
_edje_real_part_box_append(rp, child_obj);
|
||||||
evas_object_data_set(child_obj, "\377 edje.box_item", pack_it);
|
evas_object_data_set(child_obj, "\377 edje.box_item", pack_it);
|
||||||
}
|
}
|
||||||
else if (rp->part->type == EDJE_PART_TYPE_TABLE)
|
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);
|
_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);
|
evas_object_data_set(child_obj, "\377 edje.table_item", pack_it);
|
||||||
}
|
}
|
||||||
_edje_subobj_register(ed, child_obj);
|
_edje_subobj_register(ed, child_obj);
|
||||||
evas_object_show(child_obj);
|
evas_object_show(child_obj);
|
||||||
rp->items = eina_list_append(rp->items, child_obj);
|
rp->typedata.container->items = eina_list_append(rp->typedata.container->items, child_obj);
|
||||||
|
|
||||||
if (item_count > 0)
|
if (item_count > 0)
|
||||||
{
|
{
|
||||||
pack_it = *curr_item;
|
pack_it = *curr_item;
|
||||||
source = pack_it->source;
|
source = pack_it->source;
|
||||||
curr_item++;
|
curr_item++;
|
||||||
item_count--;
|
item_count--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
source = NULL;
|
source = NULL;
|
||||||
curr_item = NULL;
|
curr_item = NULL;
|
||||||
pack_it = NULL;
|
pack_it = NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1227,38 +1275,53 @@ _edje_file_del(Edje *ed)
|
||||||
_edje_callbacks_focus_del(rp->object, ed);
|
_edje_callbacks_focus_del(rp->object, ed);
|
||||||
evas_object_del(rp->object);
|
evas_object_del(rp->object);
|
||||||
}
|
}
|
||||||
if (rp->swallowed_object)
|
if ((rp->type == EDJE_RP_TYPE_CONTAINER) &&
|
||||||
{
|
(rp->typedata.container))
|
||||||
/* 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)
|
|
||||||
{
|
{
|
||||||
_edje_box_layout_free_data(rp->anim);
|
if (rp->typedata.container->items)
|
||||||
rp->anim = NULL;
|
{
|
||||||
|
/* 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))
|
||||||
|
{
|
||||||
|
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)
|
||||||
{
|
{
|
||||||
|
|
|
@ -325,6 +325,9 @@ typedef struct _Edje_Part_Box_Animation Edje_Part_Box_Animation;
|
||||||
typedef struct _Edje_Part_Limit Edje_Part_Limit;
|
typedef struct _Edje_Part_Limit Edje_Part_Limit;
|
||||||
|
|
||||||
typedef struct _Edje Edje;
|
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_State Edje_Real_Part_State;
|
||||||
typedef struct _Edje_Real_Part_Drag Edje_Real_Part_Drag;
|
typedef struct _Edje_Real_Part_Drag Edje_Real_Part_Drag;
|
||||||
typedef struct _Edje_Real_Part_Set Edje_Real_Part_Set;
|
typedef struct _Edje_Real_Part_Set Edje_Real_Part_Set;
|
||||||
|
@ -1308,75 +1311,86 @@ struct _Edje_Real_Part_Drag
|
||||||
Edje_Real_Part *confine_to; // 4
|
Edje_Real_Part *confine_to; // 4
|
||||||
}; // 104
|
}; // 104
|
||||||
|
|
||||||
struct _Edje_Real_Part
|
#define EDJE_RP_TYPE_NONE 0
|
||||||
{
|
#define EDJE_RP_TYPE_TEXT 1
|
||||||
Edje *edje; // 4
|
#define EDJE_RP_TYPE_CONTAINER 2
|
||||||
Edje_Part *part; // 4
|
#define EDJE_RP_TYPE_SWALLOW 3
|
||||||
Evas_Object *object; // 4
|
|
||||||
Evas_Object *nested_smart; // 4
|
|
||||||
int x, y, w, h; // 16
|
|
||||||
Edje_Rectangle req; // 16
|
|
||||||
|
|
||||||
|
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
|
||||||
|
{
|
||||||
Eina_List *items; // 4 //FIXME: only if table/box
|
Eina_List *items; // 4 //FIXME: only if table/box
|
||||||
Edje_Part_Box_Animation *anim; // 4 //FIXME: Used only if 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 {
|
struct {
|
||||||
Edje_Size min, max; // 16
|
Edje_Size min, max; // 16
|
||||||
Edje_Aspect aspect; // 12
|
Edje_Aspect aspect; // 12
|
||||||
} swallow_params; // 28 // FIXME: only if type SWALLOW
|
} 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_Drag *drag; // 4
|
||||||
Edje_Real_Part *events_to; // 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
|
FLOAT_T description_pos; // 8
|
||||||
Edje_Part_Description_Common *chosen_description; // 4
|
Edje_Part_Description_Common *chosen_description; // 4
|
||||||
Edje_Real_Part_State param1; // 20
|
Edje_Real_Part_State param1; // 32
|
||||||
// WITH EDJE_CALC_CACHE: 140
|
// WITH EDJE_CALC_CACHE: 140
|
||||||
Edje_Real_Part_State *param2, *custom; // 8
|
Edje_Real_Part_State *param2, *custom; // 8
|
||||||
Edje_Calc_Params *current; // 4
|
Edje_Calc_Params *current; // 4
|
||||||
|
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
|
#ifdef EDJE_CALC_CACHE
|
||||||
int state; // 4
|
int state; // 4
|
||||||
#endif
|
#endif
|
||||||
|
unsigned char type; // 1
|
||||||
Edje_Real_Part *clip_to; // 4
|
|
||||||
|
|
||||||
Edje_Running_Program *program; // 4
|
|
||||||
|
|
||||||
int clicked_button; // 4
|
|
||||||
|
|
||||||
unsigned char calculated; // 1
|
unsigned char calculated; // 1
|
||||||
unsigned char calculating; // 1
|
unsigned char calculating; // 1
|
||||||
|
|
||||||
unsigned char still_in : 1; // 1
|
unsigned char still_in : 1; // 1
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
unsigned char invalidate : 1; // 0
|
unsigned char invalidate : 1; // 0
|
||||||
#endif
|
#endif
|
||||||
}; // 268
|
}; // 287 -> 126
|
||||||
// WITH EDJE_CALC_CACHE: 404
|
// WITH EDJE_CALC_CACHE: 404
|
||||||
|
|
||||||
struct _Edje_Running_Program
|
struct _Edje_Running_Program
|
||||||
|
|
|
@ -205,8 +205,11 @@ edje_object_play_set(Evas_Object *obj, Eina_Bool play)
|
||||||
{
|
{
|
||||||
Edje_Real_Part *rp;
|
Edje_Real_Part *rp;
|
||||||
rp = ed->table_parts[i];
|
rp = ed->table_parts[i];
|
||||||
if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
|
if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
|
||||||
edje_object_play_set(rp->swallowed_object, play);
|
((rp->type == EDJE_RP_TYPE_SWALLOW) &&
|
||||||
|
(rp->typedata.swallow)) &&
|
||||||
|
(rp->typedata.swallow->swallowed_object))
|
||||||
|
edje_object_play_set(rp->typedata.swallow->swallowed_object, play);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,8 +275,11 @@ edje_object_animation_set(Evas_Object *obj, Eina_Bool on)
|
||||||
{
|
{
|
||||||
Edje_Real_Part *rp;
|
Edje_Real_Part *rp;
|
||||||
rp = ed->table_parts[i];
|
rp = ed->table_parts[i];
|
||||||
if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
|
if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
|
||||||
edje_object_animation_set(rp->swallowed_object, on);
|
((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);
|
_edje_thaw(ed);
|
||||||
|
@ -771,7 +777,10 @@ _edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig,
|
||||||
for (i = 0; i < ed->table_parts_size; ++i)
|
for (i = 0; i < ed->table_parts_size; ++i)
|
||||||
{
|
{
|
||||||
rp = ed->table_parts[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);
|
evas_object_focus_set(focused, EINA_FALSE);
|
||||||
break;
|
break;
|
||||||
|
@ -786,8 +795,11 @@ _edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig,
|
||||||
if (pt->id >= 0)
|
if (pt->id >= 0)
|
||||||
{
|
{
|
||||||
rp = ed->table_parts[pt->id % ed->table_parts_size];
|
rp = ed->table_parts[pt->id % ed->table_parts_size];
|
||||||
if (rp && rp->swallowed_object)
|
if (rp &&
|
||||||
evas_object_focus_set(rp->swallowed_object, EINA_TRUE);
|
((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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -956,8 +968,11 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f
|
||||||
switch (rp->part->type)
|
switch (rp->part->type)
|
||||||
{
|
{
|
||||||
case EDJE_PART_TYPE_GROUP:
|
case EDJE_PART_TYPE_GROUP:
|
||||||
if (!rp->swallowed_object) goto end;
|
if (((rp->type != EDJE_RP_TYPE_SWALLOW) ||
|
||||||
ed2 = _edje_fetch(rp->swallowed_object);
|
(!rp->typedata.swallow)) ||
|
||||||
|
(!rp->typedata.swallow->swallowed_object))
|
||||||
|
goto end;
|
||||||
|
ed2 = _edje_fetch(rp->typedata.swallow->swallowed_object);
|
||||||
if (!ed2) goto end;
|
if (!ed2) goto end;
|
||||||
|
|
||||||
_edje_emit(ed2, newsig, src);
|
_edje_emit(ed2, newsig, src);
|
||||||
|
@ -965,11 +980,14 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_PART_TYPE_EXTERNAL:
|
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)
|
if (!idx)
|
||||||
{
|
{
|
||||||
_edje_external_signal_emit(rp->swallowed_object, newsig, src);
|
_edje_external_signal_emit(rp->typedata.swallow->swallowed_object, newsig, src);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1370,9 +1388,13 @@ _edje_external_param_info_get(const Evas_Object *obj, const char *name)
|
||||||
static Edje_External_Param *
|
static Edje_External_Param *
|
||||||
_edje_param_external_get(Edje_Real_Part *rp, const char *name, Edje_External_Param *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;
|
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);
|
info = _edje_external_param_info_get(swallowed_object, name);
|
||||||
if (!info) return NULL;
|
if (!info) return NULL;
|
||||||
|
|
||||||
|
@ -1399,8 +1421,10 @@ _edje_param_native_get(Edje_Real_Part *rp, const char *name, Edje_External_Param
|
||||||
_edje_recalc_do(rp->edje);
|
_edje_recalc_do(rp->edje);
|
||||||
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
|
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
|
||||||
param->s = _edje_entry_text_get(rp);
|
param->s = _edje_entry_text_get(rp);
|
||||||
else if (rp->part->type == EDJE_PART_TYPE_TEXT)
|
else if ((rp->part->type == EDJE_PART_TYPE_TEXT) &&
|
||||||
param->s = rp->text.text;
|
((rp->type == EDJE_RP_TYPE_TEXT) &&
|
||||||
|
(rp->typedata.text)))
|
||||||
|
param->s = rp->typedata.text->text;
|
||||||
else
|
else
|
||||||
param->s = evas_object_textblock_text_markup_get(rp->object);
|
param->s = evas_object_textblock_text_markup_get(rp->object);
|
||||||
return param;
|
return param;
|
||||||
|
@ -1420,8 +1444,10 @@ _edje_param_native_get(Edje_Real_Part *rp, const char *name, Edje_External_Param
|
||||||
*free_ptr = unescaped;
|
*free_ptr = unescaped;
|
||||||
param->s = unescaped;
|
param->s = unescaped;
|
||||||
}
|
}
|
||||||
else if (rp->part->type == EDJE_PART_TYPE_TEXT)
|
else if ((rp->part->type == EDJE_PART_TYPE_TEXT) &&
|
||||||
param->s = rp->text.text;
|
((rp->type == EDJE_RP_TYPE_TEXT) &&
|
||||||
|
(rp->typedata.text)))
|
||||||
|
param->s = rp->typedata.text->text;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const char *tmp;
|
const char *tmp;
|
||||||
|
@ -1436,9 +1462,11 @@ _edje_param_native_get(Edje_Real_Part *rp, const char *name, Edje_External_Param
|
||||||
return param;
|
return param;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((rp->entry_data) &&
|
if (((rp->type == EDJE_RP_TYPE_TEXT) &&
|
||||||
(rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) &&
|
(rp->typedata.text)) &&
|
||||||
(!strcmp(name, "select_allow")))
|
((rp->typedata.text->entry_data) &&
|
||||||
|
(rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) &&
|
||||||
|
(!strcmp(name, "select_allow"))))
|
||||||
{
|
{
|
||||||
param->name = name;
|
param->name = name;
|
||||||
param->type = EDJE_EXTERNAL_PARAM_TYPE_BOOL;
|
param->type = EDJE_EXTERNAL_PARAM_TYPE_BOOL;
|
||||||
|
@ -1572,9 +1600,11 @@ _edje_param_native_set(Edje_Real_Part *rp, const char *name, const Edje_External
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((rp->entry_data) &&
|
if (((rp->type == EDJE_RP_TYPE_TEXT) &&
|
||||||
(rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) &&
|
(rp->typedata.text)) &&
|
||||||
(!strcmp(name, "select_allow")))
|
((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)
|
if (param->type != EDJE_EXTERNAL_PARAM_TYPE_BOOL)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
@ -1967,9 +1997,11 @@ _edje_param_copy(Edje_Real_Part *src_part, const char *src_param, Edje_Real_Part
|
||||||
if ((!src_part) || (!src_param) || (!dst_part) || (!dst_param))
|
if ((!src_part) || (!src_param) || (!dst_part) || (!dst_param))
|
||||||
return;
|
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_info = _edje_external_param_info_get
|
||||||
(dst_part->swallowed_object, dst_param);
|
(dst_part->typedata.swallow->swallowed_object, dst_param);
|
||||||
else
|
else
|
||||||
dst_info = _edje_native_param_info_get(dst_part, dst_param);
|
dst_info = _edje_native_param_info_get(dst_part, dst_param);
|
||||||
|
|
||||||
|
@ -2050,8 +2082,10 @@ _edje_param_set(Edje_Real_Part *part, const char *param, const char *value)
|
||||||
if ((!part) || (!param) || (!value))
|
if ((!part) || (!param) || (!value))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (part->part->type == EDJE_PART_TYPE_EXTERNAL)
|
if ((part->part->type == EDJE_PART_TYPE_EXTERNAL) &&
|
||||||
info = _edje_external_param_info_get(part->swallowed_object, param);
|
(part->type == EDJE_RP_TYPE_SWALLOW) &&
|
||||||
|
(part->typedata.swallow))
|
||||||
|
info = _edje_external_param_info_get(part->typedata.swallow->swallowed_object, param);
|
||||||
else
|
else
|
||||||
info = _edje_native_param_info_get(part, param);
|
info = _edje_native_param_info_get(part, param);
|
||||||
|
|
||||||
|
|
|
@ -202,17 +202,27 @@ _edje_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y)
|
||||||
for (i = 0; i < ed->table_parts_size; i++)
|
for (i = 0; i < ed->table_parts_size; i++)
|
||||||
{
|
{
|
||||||
Edje_Real_Part *ep;
|
Edje_Real_Part *ep;
|
||||||
Evas_Coord ox, oy;
|
|
||||||
|
|
||||||
ep = ed->table_parts[i];
|
ep = ed->table_parts[i];
|
||||||
evas_object_geometry_get(ep->object, &ox, &oy, NULL, NULL);
|
if ((ep->type == EDJE_RP_TYPE_TEXT) &&
|
||||||
evas_object_move(ep->object, ed->x + ep->x + ep->text.offset.x, ed->y + ep->y + ep->text.offset.y);
|
(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)
|
if (ep->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
|
||||||
_edje_entry_real_part_configure(ep);
|
_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);
|
if (ep->typedata.swallow->swallowed_object)
|
||||||
evas_object_move(ep->swallowed_object, ed->x + ep->x + ep->text.offset.x, ed->y + ep->y + ep->text.offset.y);
|
evas_object_move
|
||||||
|
(ep->typedata.swallow->swallowed_object,
|
||||||
|
ed->x + ep->x,
|
||||||
|
ed->y + ep->y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -347,26 +347,28 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
||||||
Eina_Bool same_text = EINA_FALSE;
|
Eina_Bool same_text = EINA_FALSE;
|
||||||
FLOAT_T sc;
|
FLOAT_T sc;
|
||||||
|
|
||||||
|
if ((ep->type != EDJE_RP_TYPE_TEXT) ||
|
||||||
|
(!ep->typedata.text)) return;
|
||||||
sc = ed->scale;
|
sc = ed->scale;
|
||||||
if (sc == 0.0) sc = _edje_scale;
|
if (sc == 0.0) sc = _edje_scale;
|
||||||
text = edje_string_get(&chosen_desc->text.text);
|
text = edje_string_get(&chosen_desc->text.text);
|
||||||
font = _edje_text_class_font_get(ed, chosen_desc, &size, &sfont);
|
font = _edje_text_class_font_get(ed, chosen_desc, &size, &sfont);
|
||||||
|
|
||||||
if (ep->text.text) text = ep->text.text;
|
if (ep->typedata.text->text) text = ep->typedata.text->text;
|
||||||
if (ep->text.font) font = ep->text.font;
|
if (ep->typedata.text->font) font = ep->typedata.text->font;
|
||||||
if (ep->text.size > 0) size = ep->text.size;
|
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));
|
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;
|
||||||
}
|
}
|
||||||
if (ep->text.source)
|
if (ep->typedata.text->source)
|
||||||
{
|
{
|
||||||
font = edje_string_get(&(((Edje_Part_Description_Text *)ep->text.source->chosen_description)->text.font));
|
font = edje_string_get(&(((Edje_Part_Description_Text *)ep->typedata.text->source->chosen_description)->text.font));
|
||||||
size = ((Edje_Part_Description_Text *)ep->text.source->chosen_description)->text.size;
|
size = ((Edje_Part_Description_Text *)ep->typedata.text->source->chosen_description)->text.size;
|
||||||
if (ep->text.source->text.font) font = ep->text.source->text.font;
|
if (ep->typedata.text->source->typedata.text->font) font = ep->typedata.text->source->typedata.text->font;
|
||||||
if (ep->text.source->text.size > 0) size = ep->text.source->text.size;
|
if (ep->typedata.text->source->typedata.text->size > 0) size = ep->typedata.text->source->typedata.text->size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!text) text = "";
|
if (!text) text = "";
|
||||||
|
@ -410,35 +412,35 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
||||||
size = params->type.text.size;
|
size = params->type.text.size;
|
||||||
if (!text) text = "";
|
if (!text) text = "";
|
||||||
|
|
||||||
if ((text == ep->text.cache.in_str)
|
if ((text == ep->typedata.text->cache.in_str)
|
||||||
|| (text && ep->text.cache.in_str && !strcmp(ep->text.cache.in_str, text)))
|
|| (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;
|
same_text = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ep->text.cache.in_size == size) &&
|
if ((ep->typedata.text->cache.in_size == size) &&
|
||||||
(ep->text.cache.in_w == sw) &&
|
(ep->typedata.text->cache.in_w == sw) &&
|
||||||
(ep->text.cache.in_h == sh) &&
|
(ep->typedata.text->cache.in_h == sh) &&
|
||||||
(ep->text.cache.in_str) &&
|
(ep->typedata.text->cache.in_str) &&
|
||||||
same_text &&
|
same_text &&
|
||||||
(ep->text.cache.align_x == params->type.text.align.x) &&
|
(ep->typedata.text->cache.align_x == params->type.text.align.x) &&
|
||||||
(ep->text.cache.align_y == params->type.text.align.y) &&
|
(ep->typedata.text->cache.align_y == params->type.text.align.y) &&
|
||||||
(ep->text.cache.elipsis == params->type.text.elipsis) &&
|
(ep->typedata.text->cache.elipsis == params->type.text.elipsis) &&
|
||||||
(ep->text.cache.fit_x == chosen_desc->text.fit_x) &&
|
(ep->typedata.text->cache.fit_x == chosen_desc->text.fit_x) &&
|
||||||
(ep->text.cache.fit_y == chosen_desc->text.fit_y))
|
(ep->typedata.text->cache.fit_y == chosen_desc->text.fit_y))
|
||||||
{
|
{
|
||||||
text = ep->text.cache.out_str;
|
text = ep->typedata.text->cache.out_str;
|
||||||
size = ep->text.cache.out_size;
|
size = ep->typedata.text->cache.out_size;
|
||||||
|
|
||||||
goto arrange_text;
|
goto arrange_text;
|
||||||
}
|
}
|
||||||
if (!same_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;
|
ep->typedata.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))
|
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);
|
if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
|
||||||
else evas_object_text_font_source_set(ep->object, NULL);
|
else evas_object_text_font_source_set(ep->object, NULL);
|
||||||
|
@ -464,7 +466,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
||||||
* but it's still way better than what was here before. */
|
* but it's still way better than what was here before. */
|
||||||
if (tw > sw) size--;
|
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
|
/* if we fit in the x axis, too, size already has a somewhat
|
||||||
* meaningful value, so don't overwrite it with the starting
|
* meaningful value, so don't overwrite it with the starting
|
||||||
|
@ -567,15 +569,15 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
||||||
text = _edje_text_fit_x(ed, ep, params, text, font, size, sw, &free_text);
|
text = _edje_text_fit_x(ed, ep, params, text, font, size, sw, &free_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
eina_stringshare_replace(&ep->text.cache.out_str, text);
|
eina_stringshare_replace(&ep->typedata.text->cache.out_str, text);
|
||||||
ep->text.cache.in_w = sw;
|
ep->typedata.text->cache.in_w = sw;
|
||||||
ep->text.cache.in_h = sh;
|
ep->typedata.text->cache.in_h = sh;
|
||||||
ep->text.cache.out_size = size;
|
ep->typedata.text->cache.out_size = size;
|
||||||
ep->text.cache.align_x = params->type.text.align.x;
|
ep->typedata.text->cache.align_x = params->type.text.align.x;
|
||||||
ep->text.cache.align_y = params->type.text.align.y;
|
ep->typedata.text->cache.align_y = params->type.text.align.y;
|
||||||
ep->text.cache.elipsis = params->type.text.elipsis;
|
ep->typedata.text->cache.elipsis = params->type.text.elipsis;
|
||||||
ep->text.cache.fit_x = chosen_desc->text.fit_x;
|
ep->typedata.text->cache.fit_x = chosen_desc->text.fit_x;
|
||||||
ep->text.cache.fit_y = chosen_desc->text.fit_y;
|
ep->typedata.text->cache.fit_y = chosen_desc->text.fit_y;
|
||||||
arrange_text:
|
arrange_text:
|
||||||
|
|
||||||
if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
|
if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
|
||||||
|
@ -604,13 +606,13 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
||||||
{
|
{
|
||||||
align_x = params->type.text.align.x;
|
align_x = params->type.text.align.x;
|
||||||
}
|
}
|
||||||
ep->text.offset.x = TO_INT(SCALE(align_x, (sw - tw)));
|
ep->typedata.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.y = TO_INT(SCALE(params->type.text.align.y, (sh - th)));
|
||||||
}
|
}
|
||||||
|
|
||||||
evas_object_move(ep->object,
|
evas_object_move(ep->object,
|
||||||
ed->x + params->x + ep->text.offset.x,
|
ed->x + params->x + ep->typedata.text->offset.x,
|
||||||
ed->y + params->y + ep->text.offset.y);
|
ed->y + params->y + ep->typedata.text->offset.y);
|
||||||
|
|
||||||
if (params->visible) evas_object_show(ep->object);
|
if (params->visible) evas_object_show(ep->object);
|
||||||
else evas_object_hide(ep->object);
|
else evas_object_hide(ep->object);
|
||||||
|
|
|
@ -94,11 +94,15 @@ _edje_user_definition_free(Edje_User_Defined *eud)
|
||||||
if (rp)
|
if (rp)
|
||||||
{
|
{
|
||||||
_edje_real_part_swallow_clear(rp);
|
_edje_real_part_swallow_clear(rp);
|
||||||
rp->swallowed_object = NULL;
|
if ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
|
||||||
rp->swallow_params.min.w = 0;
|
(rp->typedata.swallow))
|
||||||
rp->swallow_params.min.h = 0;
|
{
|
||||||
rp->swallow_params.max.w = 0;
|
rp->typedata.swallow->swallowed_object = NULL;
|
||||||
rp->swallow_params.max.h = 0;
|
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->dirty = EINA_TRUE;
|
||||||
rp->edje->recalc_call = EINA_TRUE;
|
rp->edje->recalc_call = EINA_TRUE;
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
|
@ -253,11 +257,14 @@ _edje_thaw_edje(Edje *ed)
|
||||||
Edje_Real_Part *rp;
|
Edje_Real_Part *rp;
|
||||||
|
|
||||||
rp = ed->table_parts[i];
|
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;
|
Edje *ed2;
|
||||||
|
|
||||||
ed2 = _edje_fetch(rp->swallowed_object);
|
ed2 = _edje_fetch(rp->typedata.swallow->swallowed_object);
|
||||||
if (ed2) _edje_thaw_edje(ed2);
|
if (ed2) _edje_thaw_edje(ed2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -438,8 +445,11 @@ edje_object_freeze(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Edje_Real_Part *rp;
|
Edje_Real_Part *rp;
|
||||||
rp = ed->table_parts[i];
|
rp = ed->table_parts[i];
|
||||||
if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
|
if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
|
||||||
edje_object_freeze(rp->swallowed_object);
|
((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);
|
return _edje_freeze(ed);
|
||||||
}
|
}
|
||||||
|
@ -457,8 +467,11 @@ edje_object_thaw(Evas_Object *obj)
|
||||||
Edje_Real_Part *rp;
|
Edje_Real_Part *rp;
|
||||||
|
|
||||||
rp = ed->table_parts[i];
|
rp = ed->table_parts[i];
|
||||||
if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
|
if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
|
||||||
edje_object_thaw(rp->swallowed_object);
|
((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);
|
return _edje_thaw(ed);
|
||||||
}
|
}
|
||||||
|
@ -704,8 +717,12 @@ edje_object_color_class_set(Evas_Object *obj, const char *color_class, int r, in
|
||||||
Edje_Real_Part *rp;
|
Edje_Real_Part *rp;
|
||||||
|
|
||||||
rp = ed->table_parts[i];
|
rp = ed->table_parts[i];
|
||||||
if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
|
if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
|
||||||
edje_object_color_class_set(rp->swallowed_object, color_class,
|
((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,
|
r, g, b, a, r2, g2, b2, a2, r3, g3, b3,
|
||||||
a3);
|
a3);
|
||||||
}
|
}
|
||||||
|
@ -763,8 +780,11 @@ edje_object_color_class_del(Evas_Object *obj, const char *color_class)
|
||||||
Edje_Real_Part *rp;
|
Edje_Real_Part *rp;
|
||||||
|
|
||||||
rp = ed->table_parts[i];
|
rp = ed->table_parts[i];
|
||||||
if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
|
if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
|
||||||
edje_object_color_class_del(rp->swallowed_object, color_class);
|
((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;
|
ed->dirty = EINA_TRUE;
|
||||||
|
@ -939,9 +959,12 @@ edje_object_text_class_set(Evas_Object *obj, const char *text_class, const char
|
||||||
Edje_Real_Part *rp;
|
Edje_Real_Part *rp;
|
||||||
|
|
||||||
rp = ed->table_parts[i];
|
rp = ed->table_parts[i];
|
||||||
if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
|
if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
|
||||||
edje_object_text_class_set(rp->swallowed_object, text_class,
|
((rp->type == EDJE_RP_TYPE_SWALLOW) &&
|
||||||
font, size);
|
(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;
|
ed->dirty = EINA_TRUE;
|
||||||
|
@ -1047,28 +1070,33 @@ edje_object_text_change_cb_set(Evas_Object *obj, Edje_Text_Change_Cb func, void
|
||||||
Edje_Real_Part *rp;
|
Edje_Real_Part *rp;
|
||||||
|
|
||||||
rp = ed->table_parts[i];
|
rp = ed->table_parts[i];
|
||||||
if ((rp->part->type == EDJE_PART_TYPE_GROUP) && (rp->swallowed_object))
|
if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
|
||||||
edje_object_text_change_cb_set(rp->swallowed_object, func, data);
|
((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
|
Eina_Bool
|
||||||
_edje_object_part_text_raw_set(Evas_Object *obj, Edje_Real_Part *rp, const char *part, const char *text)
|
_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 */
|
return EINA_TRUE; /* nothing to do, no error */
|
||||||
if ((rp->text.text) && (text) &&
|
if ((rp->typedata.text->text) && (text) &&
|
||||||
(!strcmp(rp->text.text, text)))
|
(!strcmp(rp->typedata.text->text, text)))
|
||||||
return EINA_TRUE; /* nothing to do, no error */
|
return EINA_TRUE; /* nothing to do, no error */
|
||||||
if (rp->text.text)
|
if (rp->typedata.text->text)
|
||||||
{
|
{
|
||||||
eina_stringshare_del(rp->text.text);
|
eina_stringshare_del(rp->typedata.text->text);
|
||||||
rp->text.text = NULL;
|
rp->typedata.text->text = NULL;
|
||||||
}
|
}
|
||||||
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
|
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
|
||||||
_edje_entry_text_markup_set(rp, text);
|
_edje_entry_text_markup_set(rp, text);
|
||||||
else
|
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->dirty = EINA_TRUE;
|
||||||
rp->edje->recalc_call = EINA_TRUE;
|
rp->edje->recalc_call = EINA_TRUE;
|
||||||
rp->edje->recalc_hints = EINA_TRUE;
|
rp->edje->recalc_hints = EINA_TRUE;
|
||||||
|
@ -1084,25 +1112,27 @@ _edje_object_part_text_raw_set(Evas_Object *obj, Edje_Real_Part *rp, const char
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
_edje_object_part_text_raw_append(Evas_Object *obj, Edje_Real_Part *rp, const char *part, const char *text)
|
_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)
|
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
|
||||||
_edje_entry_text_markup_append(rp, text);
|
_edje_entry_text_markup_append(rp, text);
|
||||||
else if (text)
|
else if (text)
|
||||||
{
|
{
|
||||||
if (rp->text.text)
|
if (rp->typedata.text->text)
|
||||||
{
|
{
|
||||||
char *new = NULL;
|
char *new = NULL;
|
||||||
int len_added = strlen(text);
|
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);
|
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);
|
memcpy(new + len_old, text, len_added);
|
||||||
new[len_old + len_added] = '\0';
|
new[len_old + len_added] = '\0';
|
||||||
eina_stringshare_replace(&rp->text.text, new);
|
eina_stringshare_replace(&rp->typedata.text->text, new);
|
||||||
free(new);
|
free(new);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
eina_stringshare_replace(&rp->text.text, text);
|
eina_stringshare_replace(&rp->typedata.text->text, text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rp->edje->dirty = EINA_TRUE;
|
rp->edje->dirty = EINA_TRUE;
|
||||||
|
@ -1184,7 +1214,7 @@ edje_object_part_text_style_user_peek(const Evas_Object *obj, const char *part)
|
||||||
static void
|
static void
|
||||||
_edje_user_define_string(Edje *ed, const char *part, const char *raw_text)
|
_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
|
rp. So on edje_object_file_set, we should first ref it, before destroying the old
|
||||||
layout. */
|
layout. */
|
||||||
Edje_User_Defined *eud;
|
Edje_User_Defined *eud;
|
||||||
|
@ -1220,8 +1250,10 @@ edje_object_part_text_set(Evas_Object *obj, const char *part, const char *text)
|
||||||
if (!rp) return EINA_FALSE;
|
if (!rp) return EINA_FALSE;
|
||||||
if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
|
if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
|
||||||
(rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return EINA_FALSE;
|
(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);
|
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;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1239,11 +1271,14 @@ edje_object_part_text_get(const Evas_Object *obj, const char *part)
|
||||||
|
|
||||||
rp = _edje_real_part_recursive_get(ed, part);
|
rp = _edje_real_part_recursive_get(ed, part);
|
||||||
if (!rp) return NULL;
|
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)
|
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
|
||||||
return _edje_entry_text_get(rp);
|
return _edje_entry_text_get(rp);
|
||||||
else
|
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)
|
if (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)
|
||||||
return evas_object_textblock_text_markup_get(rp->object);
|
return evas_object_textblock_text_markup_get(rp->object);
|
||||||
}
|
}
|
||||||
|
@ -1261,6 +1296,8 @@ edje_object_part_text_escaped_set(Evas_Object *obj, const char *part, const char
|
||||||
if ((!ed) || (!part)) return EINA_FALSE;
|
if ((!ed) || (!part)) return EINA_FALSE;
|
||||||
rp = _edje_real_part_recursive_get(ed, part);
|
rp = _edje_real_part_recursive_get(ed, part);
|
||||||
if (!rp) return EINA_FALSE;
|
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))
|
if ((rp->part->type == EDJE_PART_TYPE_TEXT) && (text))
|
||||||
{
|
{
|
||||||
Eina_Strbuf *sbuf;
|
Eina_Strbuf *sbuf;
|
||||||
|
@ -1313,13 +1350,13 @@ edje_object_part_text_escaped_set(Evas_Object *obj, const char *part, const char
|
||||||
}
|
}
|
||||||
ret = _edje_object_part_text_raw_set
|
ret = _edje_object_part_text_raw_set
|
||||||
(obj, rp, part, eina_strbuf_string_get(sbuf));
|
(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);
|
eina_strbuf_free(sbuf);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return EINA_FALSE;
|
if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return EINA_FALSE;
|
||||||
ret = _edje_object_part_text_raw_set(obj, rp, part, text);
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1443,6 +1480,8 @@ edje_object_part_text_unescaped_set(Evas_Object *obj, const char *part, const ch
|
||||||
if ((!ed) || (!part)) return ret;
|
if ((!ed) || (!part)) return ret;
|
||||||
rp = _edje_real_part_recursive_get(ed, part);
|
rp = _edje_real_part_recursive_get(ed, part);
|
||||||
if (!rp) return ret;
|
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)
|
if (rp->part->type == EDJE_PART_TYPE_TEXT)
|
||||||
ret = _edje_object_part_text_raw_set(obj, rp, part, text_to_escape);
|
ret = _edje_object_part_text_raw_set(obj, rp, part, text_to_escape);
|
||||||
else if (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)
|
else if (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)
|
||||||
|
@ -1452,7 +1491,7 @@ edje_object_part_text_unescaped_set(Evas_Object *obj, const char *part, const ch
|
||||||
ret = _edje_object_part_text_raw_set(obj, rp, part, text);
|
ret = _edje_object_part_text_raw_set(obj, rp, part, text);
|
||||||
free(text);
|
free(text);
|
||||||
}
|
}
|
||||||
_edje_user_define_string(ed, part, rp->text.text);
|
_edje_user_define_string(ed, part, rp->typedata.text->text);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1470,6 +1509,8 @@ edje_object_part_text_unescaped_get(const Evas_Object *obj, const char *part)
|
||||||
|
|
||||||
rp = _edje_real_part_recursive_get(ed, part);
|
rp = _edje_real_part_recursive_get(ed, part);
|
||||||
if (!rp) return NULL;
|
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)
|
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
|
||||||
{
|
{
|
||||||
const char *t = _edje_entry_text_get(rp);
|
const char *t = _edje_entry_text_get(rp);
|
||||||
|
@ -1477,7 +1518,7 @@ edje_object_part_text_unescaped_get(const Evas_Object *obj, const char *part)
|
||||||
}
|
}
|
||||||
else
|
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)
|
if (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)
|
||||||
{
|
{
|
||||||
const char *t = evas_object_textblock_text_markup_get(rp->object);
|
const char *t = evas_object_textblock_text_markup_get(rp->object);
|
||||||
|
@ -2472,9 +2513,11 @@ edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_sw
|
||||||
ERR("cannot swallow part %s: not swallow type!", rp->part->name);
|
ERR("cannot swallow part %s: not swallow type!", rp->part->name);
|
||||||
return EINA_FALSE;
|
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);
|
_edje_real_part_swallow(rp, obj_swallow, EINA_TRUE);
|
||||||
|
|
||||||
if (rp->swallowed_object)
|
if (rp->typedata.swallow->swallowed_object)
|
||||||
{
|
{
|
||||||
if (!eud)
|
if (!eud)
|
||||||
{
|
{
|
||||||
|
@ -2515,8 +2558,10 @@ edje_extern_object_min_size_set(Evas_Object *obj, Evas_Coord minw, Evas_Coord mi
|
||||||
rp = evas_object_data_get(obj, "\377 edje.swallowing_part");
|
rp = evas_object_data_get(obj, "\377 edje.swallowing_part");
|
||||||
if (rp)
|
if (rp)
|
||||||
{
|
{
|
||||||
rp->swallow_params.min.w = minw;
|
if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
|
||||||
rp->swallow_params.min.h = minh;
|
(!rp->typedata.swallow)) return;
|
||||||
|
rp->typedata.swallow->swallow_params.min.w = minw;
|
||||||
|
rp->typedata.swallow->swallow_params.min.h = minh;
|
||||||
|
|
||||||
_recalc_extern_parent(obj);
|
_recalc_extern_parent(obj);
|
||||||
}
|
}
|
||||||
|
@ -2531,8 +2576,10 @@ edje_extern_object_max_size_set(Evas_Object *obj, Evas_Coord maxw, Evas_Coord ma
|
||||||
rp = evas_object_data_get(obj, "\377 edje.swallowing_part");
|
rp = evas_object_data_get(obj, "\377 edje.swallowing_part");
|
||||||
if (rp)
|
if (rp)
|
||||||
{
|
{
|
||||||
rp->swallow_params.max.w = maxw;
|
if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
|
||||||
rp->swallow_params.max.h = maxh;
|
(!rp->typedata.swallow)) return;
|
||||||
|
rp->typedata.swallow->swallow_params.max.w = maxw;
|
||||||
|
rp->typedata.swallow->swallow_params.max.h = maxh;
|
||||||
|
|
||||||
_recalc_extern_parent(obj);
|
_recalc_extern_parent(obj);
|
||||||
}
|
}
|
||||||
|
@ -2560,9 +2607,11 @@ edje_extern_object_aspect_set(Evas_Object *obj, Edje_Aspect_Control aspect, Evas
|
||||||
rp = evas_object_data_get(obj, "\377 edje.swallowing_part");
|
rp = evas_object_data_get(obj, "\377 edje.swallowing_part");
|
||||||
if (rp)
|
if (rp)
|
||||||
{
|
{
|
||||||
rp->swallow_params.aspect.mode = aspect;
|
if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
|
||||||
rp->swallow_params.aspect.w = aw;
|
(!rp->typedata.swallow)) return;
|
||||||
rp->swallow_params.aspect.h = ah;
|
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);
|
_recalc_extern_parent(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2771,7 +2820,10 @@ edje_object_part_unswallow(Evas_Object *obj, Evas_Object *obj_swallow)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rp->swallowed_object == obj_swallow)
|
if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
|
||||||
|
(!rp->typedata.swallow)) return;
|
||||||
|
|
||||||
|
if (rp->typedata.swallow->swallowed_object == obj_swallow)
|
||||||
{
|
{
|
||||||
Edje_User_Defined *eud;
|
Edje_User_Defined *eud;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
|
@ -2798,11 +2850,11 @@ edje_object_part_unswallow(Evas_Object *obj, Evas_Object *obj_swallow)
|
||||||
}
|
}
|
||||||
|
|
||||||
_edje_real_part_swallow_clear(rp);
|
_edje_real_part_swallow_clear(rp);
|
||||||
rp->swallowed_object = NULL;
|
rp->typedata.swallow->swallowed_object = NULL;
|
||||||
rp->swallow_params.min.w = 0;
|
rp->typedata.swallow->swallow_params.min.w = 0;
|
||||||
rp->swallow_params.min.h = 0;
|
rp->typedata.swallow->swallow_params.min.h = 0;
|
||||||
rp->swallow_params.max.w = 0;
|
rp->typedata.swallow->swallow_params.max.w = 0;
|
||||||
rp->swallow_params.max.h = 0;
|
rp->typedata.swallow->swallow_params.max.h = 0;
|
||||||
rp->edje->dirty = EINA_TRUE;
|
rp->edje->dirty = EINA_TRUE;
|
||||||
rp->edje->recalc_call = EINA_TRUE;
|
rp->edje->recalc_call = EINA_TRUE;
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
|
@ -2827,7 +2879,9 @@ edje_object_part_swallow_get(const Evas_Object *obj, const char *part)
|
||||||
|
|
||||||
rp = _edje_real_part_recursive_get(ed, part);
|
rp = _edje_real_part_recursive_get(ed, part);
|
||||||
if (!rp) return NULL;
|
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
|
EAPI void
|
||||||
|
@ -4378,8 +4432,11 @@ edje_object_preload(Evas_Object *obj, Eina_Bool cancel)
|
||||||
rp = ed->table_parts[i];
|
rp = ed->table_parts[i];
|
||||||
ep = rp->part;
|
ep = rp->part;
|
||||||
|
|
||||||
if (ep->type == EDJE_PART_TYPE_IMAGE ||
|
if ((ep->type == EDJE_PART_TYPE_IMAGE) ||
|
||||||
(ep->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object))
|
((ep->type == EDJE_PART_TYPE_GROUP) &&
|
||||||
|
((rp->type == EDJE_RP_TYPE_SWALLOW) &&
|
||||||
|
(rp->typedata.swallow)) &&
|
||||||
|
(rp->typedata.swallow->swallowed_object)))
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4416,23 +4473,25 @@ edje_object_preload(Evas_Object *obj, Eina_Bool cancel)
|
||||||
}
|
}
|
||||||
else if (ep->type == EDJE_PART_TYPE_GROUP)
|
else if (ep->type == EDJE_PART_TYPE_GROUP)
|
||||||
{
|
{
|
||||||
if (rp->swallowed_object) {
|
if (((rp->type == EDJE_RP_TYPE_SWALLOW) &&
|
||||||
char *tmp;
|
(rp->typedata.swallow)) &&
|
||||||
|
(rp->typedata.swallow->swallowed_object))
|
||||||
|
{
|
||||||
|
char *tmp;
|
||||||
|
|
||||||
if (rp->part->name)
|
if (rp->part->name)
|
||||||
{
|
{
|
||||||
tmp = alloca(strlen(rp->part->name) + 2);
|
tmp = alloca(strlen(rp->part->name) + 2);
|
||||||
sprintf(tmp, "%s:", rp->part->name);
|
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--;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
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--;
|
count--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4546,7 +4605,10 @@ _edje_children_get(Edje_Real_Part *rp, const char *partid)
|
||||||
switch (rp->part->type)
|
switch (rp->part->type)
|
||||||
{
|
{
|
||||||
case EDJE_PART_TYPE_EXTERNAL:
|
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:
|
case EDJE_PART_TYPE_BOX:
|
||||||
l = evas_object_box_children_get(rp->object);
|
l = evas_object_box_children_get(rp->object);
|
||||||
break;
|
break;
|
||||||
|
@ -4655,8 +4717,10 @@ _edje_real_part_recursive_get_helper(const Edje *ed, char **path)
|
||||||
switch (rp->part->type)
|
switch (rp->part->type)
|
||||||
{
|
{
|
||||||
case EDJE_PART_TYPE_GROUP:
|
case EDJE_PART_TYPE_GROUP:
|
||||||
if (!rp->swallowed_object) return NULL;
|
if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
|
||||||
ed = _edje_fetch(rp->swallowed_object);
|
(!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;
|
if (!ed) return NULL;
|
||||||
path++;
|
path++;
|
||||||
return _edje_real_part_recursive_get_helper(ed, path);
|
return _edje_real_part_recursive_get_helper(ed, path);
|
||||||
|
@ -4935,72 +4999,74 @@ _edje_real_part_swallow_hints_update(Edje_Real_Part *rp)
|
||||||
{
|
{
|
||||||
const char *type;
|
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->typedata.swallow->swallow_params.min.w = 0;
|
||||||
rp->swallow_params.min.h = 0;
|
rp->typedata.swallow->swallow_params.min.h = 0;
|
||||||
rp->swallow_params.max.w = -1;
|
rp->typedata.swallow->swallow_params.max.w = -1;
|
||||||
rp->swallow_params.max.h = -1;
|
rp->typedata.swallow->swallow_params.max.h = -1;
|
||||||
if ((type) && (!strcmp(type, "edje")))
|
if ((type) && (!strcmp(type, "edje")))
|
||||||
{
|
{
|
||||||
Evas_Coord w, h;
|
Evas_Coord w, h;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
edje_object_size_min_get(rp->swallowed_object, &w, &h);
|
edje_object_size_min_get(rp->typedata.swallow->swallowed_object, &w, &h);
|
||||||
rp->swallow_params.min.w = w;
|
rp->typedata.swallow->swallow_params.min.w = w;
|
||||||
rp->swallow_params.min.h = h;
|
rp->typedata.swallow->swallow_params.min.h = h;
|
||||||
#endif
|
#endif
|
||||||
edje_object_size_max_get(rp->swallowed_object, &w, &h);
|
edje_object_size_max_get(rp->typedata.swallow->swallowed_object, &w, &h);
|
||||||
rp->swallow_params.max.w = w;
|
rp->typedata.swallow->swallow_params.max.w = w;
|
||||||
rp->swallow_params.max.h = h;
|
rp->typedata.swallow->swallow_params.max.h = h;
|
||||||
}
|
}
|
||||||
else if ((type) && ((!strcmp(type, "text")) || (!strcmp(type, "polygon")) ||
|
else if ((type) && ((!strcmp(type, "text")) || (!strcmp(type, "polygon")) ||
|
||||||
(!strcmp(type, "line"))))
|
(!strcmp(type, "line"))))
|
||||||
{
|
{
|
||||||
Evas_Coord w, h;
|
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
|
#if 0
|
||||||
rp->swallow_params.min.w = w;
|
rp->typedata.swallow->swallow_params.min.w = w;
|
||||||
rp->swallow_params.min.h = h;
|
rp->typedata.swallow->swallow_params.min.h = h;
|
||||||
#endif
|
#endif
|
||||||
rp->swallow_params.max.w = w;
|
rp->typedata.swallow->swallow_params.max.w = w;
|
||||||
rp->swallow_params.max.h = h;
|
rp->typedata.swallow->swallow_params.max.h = h;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Evas_Coord w1, h1, w2, h2, aw, ah;
|
Evas_Coord w1, h1, w2, h2, aw, ah;
|
||||||
Evas_Aspect_Control am;
|
Evas_Aspect_Control am;
|
||||||
|
|
||||||
evas_object_size_hint_min_get(rp->swallowed_object, &w1, &h1);
|
evas_object_size_hint_min_get(rp->typedata.swallow->swallowed_object, &w1, &h1);
|
||||||
evas_object_size_hint_max_get(rp->swallowed_object, &w2, &h2);
|
evas_object_size_hint_max_get(rp->typedata.swallow->swallowed_object, &w2, &h2);
|
||||||
evas_object_size_hint_aspect_get(rp->swallowed_object, &am, &aw, &ah);
|
evas_object_size_hint_aspect_get(rp->typedata.swallow->swallowed_object, &am, &aw, &ah);
|
||||||
rp->swallow_params.min.w = w1;
|
rp->typedata.swallow->swallow_params.min.w = w1;
|
||||||
rp->swallow_params.min.h = h1;
|
rp->typedata.swallow->swallow_params.min.h = h1;
|
||||||
if (w2 > 0) rp->swallow_params.max.w = w2;
|
if (w2 > 0) rp->typedata.swallow->swallow_params.max.w = w2;
|
||||||
if (h2 > 0) rp->swallow_params.max.h = h2;
|
if (h2 > 0) rp->typedata.swallow->swallow_params.max.h = h2;
|
||||||
switch (am)
|
switch (am)
|
||||||
{
|
{
|
||||||
case EVAS_ASPECT_CONTROL_NONE:
|
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;
|
break;
|
||||||
case EVAS_ASPECT_CONTROL_NEITHER:
|
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;
|
break;
|
||||||
case EVAS_ASPECT_CONTROL_HORIZONTAL:
|
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;
|
break;
|
||||||
case EVAS_ASPECT_CONTROL_VERTICAL:
|
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;
|
break;
|
||||||
case EVAS_ASPECT_CONTROL_BOTH:
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
rp->swallow_params.aspect.w = aw;
|
rp->typedata.swallow->swallow_params.aspect.w = aw;
|
||||||
rp->swallow_params.aspect.h = ah;
|
rp->typedata.swallow->swallow_params.aspect.h = ah;
|
||||||
evas_object_data_set(rp->swallowed_object, "\377 edje.swallowing_part", rp);
|
evas_object_data_set(rp->typedata.swallow->swallowed_object, "\377 edje.swallowing_part", rp);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
|
@ -5026,19 +5092,22 @@ _edje_object_part_swallow_image_resize_cb(void *data, Evas *e __UNUSED__, Evas_O
|
||||||
{
|
{
|
||||||
Edje_Real_Part *rp = data;
|
Edje_Real_Part *rp = data;
|
||||||
Evas_Coord w, h;
|
Evas_Coord w, h;
|
||||||
|
Evas_Map *map;
|
||||||
|
|
||||||
if (!rp->chosen_description->map.on) return;
|
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;
|
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, 0, 0, 0);
|
||||||
evas_map_point_image_uv_set(map, 1, w, 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, 2, w, h);
|
||||||
evas_map_point_image_uv_set(map, 3, 0, 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
|
void
|
||||||
|
@ -5046,11 +5115,13 @@ _edje_real_part_swallow(Edje_Real_Part *rp,
|
||||||
Evas_Object *obj_swallow,
|
Evas_Object *obj_swallow,
|
||||||
Eina_Bool hints_update)
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -5067,23 +5138,23 @@ _edje_real_part_swallow(Edje_Real_Part *rp,
|
||||||
rp->invalidate = 1;
|
rp->invalidate = 1;
|
||||||
#endif
|
#endif
|
||||||
if (!obj_swallow) return;
|
if (!obj_swallow) return;
|
||||||
rp->swallowed_object = obj_swallow;
|
rp->typedata.swallow->swallowed_object = obj_swallow;
|
||||||
evas_object_smart_member_add(rp->swallowed_object, rp->edje->obj);
|
evas_object_smart_member_add(rp->typedata.swallow->swallowed_object, rp->edje->obj);
|
||||||
if (rp->clip_to)
|
if (rp->clip_to)
|
||||||
evas_object_clip_set(rp->swallowed_object, rp->clip_to->object);
|
evas_object_clip_set(rp->typedata.swallow->swallowed_object, rp->clip_to->object);
|
||||||
else evas_object_clip_set(rp->swallowed_object, rp->edje->base.clipper);
|
else evas_object_clip_set(rp->typedata.swallow->swallowed_object, rp->edje->base.clipper);
|
||||||
evas_object_stack_above(rp->swallowed_object, rp->object);
|
evas_object_stack_above(rp->typedata.swallow->swallowed_object, rp->object);
|
||||||
evas_object_event_callback_add(rp->swallowed_object,
|
evas_object_event_callback_add(rp->typedata.swallow->swallowed_object,
|
||||||
EVAS_CALLBACK_DEL,
|
EVAS_CALLBACK_DEL,
|
||||||
_edje_object_part_swallow_free_cb,
|
_edje_object_part_swallow_free_cb,
|
||||||
rp);
|
rp);
|
||||||
evas_object_event_callback_add(rp->swallowed_object,
|
evas_object_event_callback_add(rp->typedata.swallow->swallowed_object,
|
||||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_edje_object_part_swallow_changed_hints_cb,
|
_edje_object_part_swallow_changed_hints_cb,
|
||||||
rp);
|
rp);
|
||||||
|
|
||||||
//If the map is enabled, uv should be updated when image size is changed.
|
//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,
|
evas_object_event_callback_add(obj_swallow, EVAS_CALLBACK_IMAGE_RESIZE,
|
||||||
_edje_object_part_swallow_image_resize_cb,
|
_edje_object_part_swallow_image_resize_cb,
|
||||||
rp);
|
rp);
|
||||||
|
@ -5102,7 +5173,7 @@ _edje_real_part_swallow(Edje_Real_Part *rp,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
evas_object_pass_events_set(obj_swallow, 1);
|
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)
|
if (rp->part->precise_is_inside)
|
||||||
evas_object_precise_is_inside_set(obj_swallow, 1);
|
evas_object_precise_is_inside_set(obj_swallow, 1);
|
||||||
|
@ -5116,27 +5187,29 @@ _edje_real_part_swallow(Edje_Real_Part *rp,
|
||||||
void
|
void
|
||||||
_edje_real_part_swallow_clear(Edje_Real_Part *rp)
|
_edje_real_part_swallow_clear(Edje_Real_Part *rp)
|
||||||
{
|
{
|
||||||
if (!rp->swallowed_object) return ;
|
if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
|
||||||
evas_object_smart_member_del(rp->swallowed_object);
|
(!rp->typedata.swallow)) return NULL;
|
||||||
evas_object_event_callback_del_full(rp->swallowed_object,
|
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,
|
EVAS_CALLBACK_DEL,
|
||||||
_edje_object_part_swallow_free_cb,
|
_edje_object_part_swallow_free_cb,
|
||||||
rp);
|
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,
|
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_edje_object_part_swallow_changed_hints_cb,
|
_edje_object_part_swallow_changed_hints_cb,
|
||||||
rp);
|
rp);
|
||||||
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_del_full(rp->swallowed_object,
|
evas_object_event_callback_del_full(rp->typedata.swallow->swallowed_object,
|
||||||
EVAS_CALLBACK_IMAGE_RESIZE,
|
EVAS_CALLBACK_IMAGE_RESIZE,
|
||||||
_edje_object_part_swallow_image_resize_cb,
|
_edje_object_part_swallow_image_resize_cb,
|
||||||
rp);
|
rp);
|
||||||
evas_object_clip_unset(rp->swallowed_object);
|
evas_object_clip_unset(rp->typedata.swallow->swallowed_object);
|
||||||
evas_object_data_del(rp->swallowed_object, "\377 edje.swallowing_part");
|
evas_object_data_del(rp->typedata.swallow->swallowed_object, "\377 edje.swallowing_part");
|
||||||
if (rp->part->mouse_events)
|
if (rp->part->mouse_events)
|
||||||
_edje_callbacks_del(rp->swallowed_object, rp->edje);
|
_edje_callbacks_del(rp->typedata.swallow->swallowed_object, rp->edje);
|
||||||
_edje_callbacks_focus_del(rp->swallowed_object, rp->edje);
|
_edje_callbacks_focus_del(rp->typedata.swallow->swallowed_object, rp->edje);
|
||||||
rp->swallowed_object = NULL;
|
rp->typedata.swallow->swallowed_object = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue