Add GROUP Parts to edje.
These can be used to automatically swallow in another group from the same file. Parts within child groups can be referred to by a ':' separated 'full path' of part names. Any API functions that take a part name will now accept a full path also. Signals emitted by child objects will be repeated up to the parents with the source changed to be the path relative to the receiving object. E.g in the example below, a mouse moving over the lower light green rectangle would result in the parent object recieving a "mouse,move" signal with source "bot:inner". **** NEW RESTRICTION **** part names should no longer include a ':' character. This is not yet enforced by edje_cc, but will cause the part to be inaccessible from the API. Example EDC: collections { group { name: "parent"; parts { part { name: "top"; type: GROUP; source: "child"; description { state: "default" 0.0; rel2.relative: 1 0.5; } } part { name: "bot"; type: GROUP; source: "child"; description { state: "default" 0.0; rel1.relative: 0 0.5; } } } } group { name: "child"; parts { part { name: "base"; type: RECT; description { state: "default" 0.0; color: 160 208 8 255; } } part { name: "inner"; type: RECT; description { state: "default" 0.0; rel1.offset: 10 10; rel2.offset: -11 -11; color: 210 228 76 255; } } } } } SVN revision: 30087
This commit is contained in:
parent
e954849ee1
commit
d4a055585b
|
@ -45,6 +45,7 @@ static void st_collections_group_parts_part_mouse_events(void);
|
|||
static void st_collections_group_parts_part_repeat_events(void);
|
||||
static void st_collections_group_parts_part_use_alternate_font_metrics(void);
|
||||
static void st_collections_group_parts_part_clip_to_id(void);
|
||||
static void st_collections_group_parts_part_source(void);
|
||||
static void st_collections_group_parts_part_dragable_x(void);
|
||||
static void st_collections_group_parts_part_dragable_y(void);
|
||||
static void st_collections_group_parts_part_dragable_confine(void);
|
||||
|
@ -179,6 +180,7 @@ New_Statement_Handler statement_handlers[] =
|
|||
{"collections.group.parts.part.repeat_events", st_collections_group_parts_part_repeat_events},
|
||||
{"collections.group.parts.part.use_alternate_font_metrics", st_collections_group_parts_part_use_alternate_font_metrics},
|
||||
{"collections.group.parts.part.clip_to", st_collections_group_parts_part_clip_to_id},
|
||||
{"collections.group.parts.part.source", st_collections_group_parts_part_source},
|
||||
{"collections.group.parts.part.dragable.x", st_collections_group_parts_part_dragable_x},
|
||||
{"collections.group.parts.part.dragable.y", st_collections_group_parts_part_dragable_y},
|
||||
{"collections.group.parts.part.dragable.confine", st_collections_group_parts_part_dragable_confine},
|
||||
|
@ -949,6 +951,7 @@ st_collections_group_parts_part_type(void)
|
|||
"SWALLOW", EDJE_PART_TYPE_SWALLOW,
|
||||
"TEXTBLOCK", EDJE_PART_TYPE_TEXTBLOCK,
|
||||
"GRADIENT", EDJE_PART_TYPE_GRADIENT,
|
||||
"GROUP", EDJE_PART_TYPE_GROUP,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
@ -1010,6 +1013,29 @@ st_collections_group_parts_part_clip_to_id(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_parts_part_source(void)
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
Edje_Part *ep;
|
||||
|
||||
check_arg_count(1);
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->parts));
|
||||
|
||||
if (ep->type != EDJE_PART_TYPE_GROUP)
|
||||
{
|
||||
fprintf(stderr, "%s: Error. parse error %s:%i. "
|
||||
"source attribute in non-GROUP part.\n",
|
||||
progname, file_in, line - 1);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
//XXX validate this somehow (need to decide on the format also)
|
||||
ep->source = parse_str(0);
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_parts_part_dragable_x(void)
|
||||
{
|
||||
|
|
|
@ -145,7 +145,8 @@ enum
|
|||
EDJE_LOAD_ERROR_CORRUPT_FILE = 5,
|
||||
EDJE_LOAD_ERROR_UNKNOWN_FORMAT = 6,
|
||||
EDJE_LOAD_ERROR_INCOMPATIBLE_FILE = 7,
|
||||
EDJE_LOAD_ERROR_UNKNOWN_COLLECTION = 8
|
||||
EDJE_LOAD_ERROR_UNKNOWN_COLLECTION = 8,
|
||||
EDJE_LOAD_ERROR_RECURSIVE_REFERENCE = 9
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -1310,7 +1310,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
|||
if (p3.visible) evas_object_show(ep->object);
|
||||
else evas_object_hide(ep->object);
|
||||
}
|
||||
else if (ep->part->type == EDJE_PART_TYPE_SWALLOW)
|
||||
else if (ep->part->type == EDJE_PART_TYPE_SWALLOW || ep->part->type == EDJE_PART_TYPE_GROUP)
|
||||
{
|
||||
evas_object_move(ep->object, ed->x + p3.x, ed->y + p3.y);
|
||||
evas_object_resize(ep->object, p3.w, p3.h);
|
||||
|
|
|
@ -356,6 +356,7 @@ _edje_edd_setup(void)
|
|||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.count_y", dragable.count_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.counfine_id", dragable.confine_id, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.events_id", dragable.events_id, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "source", source, EET_T_STRING);
|
||||
|
||||
NEWD("Edje_Part_Collection",
|
||||
Edje_Part_Collection);
|
||||
|
|
|
@ -10,6 +10,8 @@ static Evas_Bool _edje_file_collection_hash_foreach(Evas_Hash *hash, const char
|
|||
#ifdef EDJE_PROGRAM_CACHE
|
||||
static int _edje_collection_free_prog_cache_matches_free_cb(Evas_Hash *hash, const char *key, void *data, void *fdata);
|
||||
#endif
|
||||
static int _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *part, Evas_List *group_path);
|
||||
static void _cb_signal_repeat(void *data, Evas_Object *obj, const char *signal, const char *source);
|
||||
|
||||
static Evas_List *_edje_swallows_collect(Edje *ed);
|
||||
|
||||
|
@ -30,261 +32,7 @@ static Evas_List *_edje_swallows_collect(Edje *ed);
|
|||
EAPI int
|
||||
edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
||||
{
|
||||
Edje *ed;
|
||||
int n;
|
||||
Evas_List *parts = NULL;
|
||||
Evas_List *old_swallows;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return 0;
|
||||
if (!file) file = "";
|
||||
if (!part) part = "";
|
||||
if (((ed->path) && (!strcmp(file, ed->path))) &&
|
||||
(ed->part) && (!strcmp(part, ed->part)))
|
||||
return 1;
|
||||
|
||||
old_swallows = _edje_swallows_collect(ed);
|
||||
|
||||
_edje_file_del(ed);
|
||||
|
||||
if (ed->path) evas_stringshare_del(ed->path);
|
||||
if (ed->part) evas_stringshare_del(ed->part);
|
||||
ed->path = evas_stringshare_add(file);
|
||||
ed->part = evas_stringshare_add(part);
|
||||
|
||||
ed->load_error = EDJE_LOAD_ERROR_NONE;
|
||||
_edje_file_add(ed);
|
||||
|
||||
_edje_textblock_styles_add(ed);
|
||||
_edje_textblock_style_all_update(ed);
|
||||
|
||||
if (ed->collection)
|
||||
{
|
||||
Evas_List *l;
|
||||
int i;
|
||||
int errors = 0;
|
||||
|
||||
/* colorclass stuff */
|
||||
for (l = ed->collection->parts; (l && ! errors); l = l->next)
|
||||
{
|
||||
Edje_Part *ep;
|
||||
Evas_List *hist = NULL;
|
||||
|
||||
/* Register any color classes in this parts descriptions. */
|
||||
ep = l->data;
|
||||
if ((ep->default_desc) && (ep->default_desc->color_class))
|
||||
_edje_color_class_member_add(ed, ep->default_desc->color_class);
|
||||
for (hist = ep->other_desc; hist; hist = hist->next)
|
||||
{
|
||||
Edje_Part_Description *desc;
|
||||
|
||||
desc = hist->data;
|
||||
if (desc->color_class) _edje_color_class_member_add(ed, desc->color_class);
|
||||
}
|
||||
}
|
||||
/* build real parts */
|
||||
for (n = 0, l = ed->collection->parts; l; l = l->next, n++)
|
||||
{
|
||||
Edje_Part *ep;
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
ep = l->data;
|
||||
rp = calloc(1, sizeof(Edje_Real_Part));
|
||||
if (!rp)
|
||||
{
|
||||
ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
||||
return 0;
|
||||
}
|
||||
rp->part = ep;
|
||||
parts = evas_list_append(parts, rp);
|
||||
rp->param1.description = ep->default_desc;
|
||||
rp->chosen_description = rp->param1.description;
|
||||
if (!rp->param1.description)
|
||||
{
|
||||
printf("EDJE ERROR: no default part description!\n");
|
||||
}
|
||||
if (ep->type == EDJE_PART_TYPE_RECTANGLE)
|
||||
rp->object = evas_object_rectangle_add(ed->evas);
|
||||
else if (ep->type == EDJE_PART_TYPE_IMAGE)
|
||||
rp->object = evas_object_image_add(ed->evas);
|
||||
else if (ep->type == EDJE_PART_TYPE_TEXT)
|
||||
{
|
||||
_edje_text_part_on_add(ed, rp);
|
||||
rp->object = evas_object_text_add(ed->evas);
|
||||
evas_object_text_font_source_set(rp->object, ed->path);
|
||||
}
|
||||
else if (ep->type == EDJE_PART_TYPE_SWALLOW)
|
||||
{
|
||||
rp->object = evas_object_rectangle_add(ed->evas);
|
||||
evas_object_color_set(rp->object, 0, 0, 0, 0);
|
||||
evas_object_pass_events_set(rp->object, 1);
|
||||
}
|
||||
else if (ep->type == EDJE_PART_TYPE_TEXTBLOCK)
|
||||
rp->object = evas_object_textblock_add(ed->evas);
|
||||
else if (ep->type == EDJE_PART_TYPE_GRADIENT)
|
||||
rp->object = evas_object_gradient_add(ed->evas);
|
||||
else
|
||||
{
|
||||
printf("EDJE ERROR: wrong part type %i!\n", ep->type);
|
||||
}
|
||||
if (rp->object)
|
||||
{
|
||||
evas_object_smart_member_add(rp->object, ed->obj);
|
||||
evas_object_layer_set(rp->object, evas_object_layer_get(ed->obj));
|
||||
if (ep->type != EDJE_PART_TYPE_SWALLOW)
|
||||
{
|
||||
if (ep->mouse_events)
|
||||
{
|
||||
_edje_callbacks_add(rp->object, ed, rp);
|
||||
if (ep->repeat_events)
|
||||
evas_object_repeat_events_set(rp->object, 1);
|
||||
}
|
||||
else
|
||||
evas_object_pass_events_set(rp->object, 1);
|
||||
}
|
||||
if (rp->part->clip_to_id < 0)
|
||||
evas_object_clip_set(rp->object, ed->clipper);
|
||||
}
|
||||
rp->drag.step.x = ep->dragable.step_x;
|
||||
rp->drag.step.y = ep->dragable.step_y;
|
||||
rp->gradient_id = -1;
|
||||
}
|
||||
if (n > 0)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
ed->table_parts = malloc(sizeof(Edje_Real_Part *) * n);
|
||||
ed->table_parts_size = n;
|
||||
/* FIXME: check malloc return */
|
||||
n = 0;
|
||||
for (l = parts; l; l = l->next)
|
||||
{
|
||||
rp = l->data;
|
||||
ed->table_parts[n] = rp;
|
||||
n++;
|
||||
}
|
||||
evas_list_free(parts);
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
rp = ed->table_parts[i];
|
||||
if (rp->param1.description->rel1.id_x >= 0)
|
||||
rp->param1.rel1_to_x = ed->table_parts[rp->param1.description->rel1.id_x % ed->table_parts_size];
|
||||
if (rp->param1.description->rel1.id_y >= 0)
|
||||
rp->param1.rel1_to_y = ed->table_parts[rp->param1.description->rel1.id_y % ed->table_parts_size];
|
||||
if (rp->param1.description->rel2.id_x >= 0)
|
||||
rp->param1.rel2_to_x = ed->table_parts[rp->param1.description->rel2.id_x % ed->table_parts_size];
|
||||
if (rp->param1.description->rel2.id_y >= 0)
|
||||
rp->param1.rel2_to_y = ed->table_parts[rp->param1.description->rel2.id_y % ed->table_parts_size];
|
||||
_edje_text_part_on_add_clippers(ed, rp);
|
||||
if (rp->part->clip_to_id >= 0)
|
||||
{
|
||||
rp->clip_to = ed->table_parts[rp->part->clip_to_id % ed->table_parts_size];
|
||||
if (rp->clip_to)
|
||||
{
|
||||
evas_object_pass_events_set(rp->clip_to->object, 1);
|
||||
evas_object_clip_set(rp->object, rp->clip_to->object);
|
||||
}
|
||||
}
|
||||
if (rp->part->dragable.confine_id >= 0)
|
||||
rp->confine_to = ed->table_parts[rp->part->dragable.confine_id % ed->table_parts_size];
|
||||
|
||||
/* replay events for dragable */
|
||||
if (rp->part->dragable.events_id >= 0)
|
||||
{
|
||||
rp->events_to =
|
||||
ed->table_parts[rp->part->dragable.events_id % ed->table_parts_size];
|
||||
/* events_to may be used only with dragable */
|
||||
if (!rp->events_to->part->dragable.x &&
|
||||
!rp->events_to->part->dragable.y)
|
||||
rp->events_to = NULL;
|
||||
}
|
||||
|
||||
rp->swallow_params.min.w = 0;
|
||||
rp->swallow_params.min.w = 0;
|
||||
rp->swallow_params.max.w = -1;
|
||||
rp->swallow_params.max.h = -1;
|
||||
|
||||
if (ed->file->feature_ver < 1)
|
||||
{
|
||||
rp->param1.description->text.id_source = -1;
|
||||
rp->param1.description->text.id_text_source = -1;
|
||||
}
|
||||
if (rp->param1.description->text.id_source >= 0)
|
||||
rp->text.source = ed->table_parts[rp->param1.description->text.id_source % ed->table_parts_size];
|
||||
if (rp->param1.description->text.id_text_source >= 0)
|
||||
rp->text.text_source = ed->table_parts[rp->param1.description->text.id_text_source % ed->table_parts_size];
|
||||
}
|
||||
}
|
||||
n = evas_list_count(ed->collection->programs);
|
||||
if (n > 0)
|
||||
{
|
||||
/* FIXME: keeping a table AND a list is just bad - nuke list */
|
||||
ed->table_programs = malloc(sizeof(Edje_Program *) * n);
|
||||
ed->table_programs_size = n;
|
||||
/* FIXME: check malloc return */
|
||||
n = 0;
|
||||
for (l = ed->collection->programs; l; l = l->next)
|
||||
{
|
||||
Edje_Program *pr;
|
||||
|
||||
pr = l->data;
|
||||
ed->table_programs[n] = pr;
|
||||
n++;
|
||||
}
|
||||
}
|
||||
_edje_ref(ed);
|
||||
_edje_block(ed);
|
||||
_edje_freeze(ed);
|
||||
if (ed->collection->script) _edje_embryo_script_init(ed);
|
||||
_edje_var_init(ed);
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
rp = ed->table_parts[i];
|
||||
evas_object_show(rp->object);
|
||||
if (_edje_block_break(ed)) break;
|
||||
if (rp->part->dragable.x < 0) rp->drag.val.x = 1.0;
|
||||
if (rp->part->dragable.y < 0) rp->drag.val.x = 1.0;
|
||||
_edje_dragable_pos_set(ed, rp, rp->drag.val.x, rp->drag.val.y);
|
||||
}
|
||||
ed->dirty = 1;
|
||||
if ((evas_object_clipees_get(ed->clipper)) &&
|
||||
(evas_object_visible_get(obj)))
|
||||
evas_object_show(ed->clipper);
|
||||
|
||||
/* reswallow any swallows that existed before setting the file */
|
||||
if (old_swallows)
|
||||
{
|
||||
while (old_swallows)
|
||||
{
|
||||
const char *name;
|
||||
Evas_Object *swallow;
|
||||
|
||||
name = old_swallows->data;
|
||||
old_swallows = evas_list_remove_list(old_swallows, old_swallows);
|
||||
|
||||
swallow = old_swallows->data;
|
||||
old_swallows = evas_list_remove_list(old_swallows, old_swallows);
|
||||
|
||||
edje_object_part_swallow(obj, name, swallow);
|
||||
evas_stringshare_del(name);
|
||||
}
|
||||
}
|
||||
|
||||
_edje_recalc(ed);
|
||||
_edje_thaw(ed);
|
||||
_edje_unblock(ed);
|
||||
_edje_unref(ed);
|
||||
ed->load_error = EDJE_LOAD_ERROR_NONE;
|
||||
_edje_emit(ed, "load", NULL);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
ed->load_error = EDJE_LOAD_ERROR_NONE;
|
||||
return 1;
|
||||
return _edje_object_file_set_internal(obj, file, part, NULL);
|
||||
}
|
||||
|
||||
/* FIXDOC: Verify/expand doc. */
|
||||
|
@ -461,6 +209,348 @@ edje_file_data_get(const char *file, const char *key)
|
|||
return str;
|
||||
}
|
||||
|
||||
static int
|
||||
_edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *part, Evas_List *group_path)
|
||||
{
|
||||
Edje *ed;
|
||||
int n;
|
||||
Evas_List *parts = NULL;
|
||||
Evas_List *old_swallows;
|
||||
int group_path_started = 0;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return 0;
|
||||
if (!file) file = "";
|
||||
if (!part) part = "";
|
||||
if (((ed->path) && (!strcmp(file, ed->path))) &&
|
||||
(ed->part) && (!strcmp(part, ed->part)))
|
||||
return 1;
|
||||
|
||||
old_swallows = _edje_swallows_collect(ed);
|
||||
|
||||
_edje_file_del(ed);
|
||||
|
||||
if (ed->path) evas_stringshare_del(ed->path);
|
||||
if (ed->part) evas_stringshare_del(ed->part);
|
||||
ed->path = evas_stringshare_add(file);
|
||||
ed->part = evas_stringshare_add(part);
|
||||
|
||||
ed->load_error = EDJE_LOAD_ERROR_NONE;
|
||||
_edje_file_add(ed);
|
||||
|
||||
_edje_textblock_styles_add(ed);
|
||||
_edje_textblock_style_all_update(ed);
|
||||
|
||||
if (ed->collection)
|
||||
{
|
||||
Evas_List *l;
|
||||
int i;
|
||||
int errors = 0;
|
||||
|
||||
/* colorclass stuff */
|
||||
for (l = ed->collection->parts; (l && ! errors); l = l->next)
|
||||
{
|
||||
Edje_Part *ep;
|
||||
Evas_List *hist = NULL;
|
||||
|
||||
/* Register any color classes in this parts descriptions. */
|
||||
ep = l->data;
|
||||
if ((ep->default_desc) && (ep->default_desc->color_class))
|
||||
_edje_color_class_member_add(ed, ep->default_desc->color_class);
|
||||
for (hist = ep->other_desc; hist; hist = hist->next)
|
||||
{
|
||||
Edje_Part_Description *desc;
|
||||
|
||||
desc = hist->data;
|
||||
if (desc->color_class) _edje_color_class_member_add(ed, desc->color_class);
|
||||
}
|
||||
}
|
||||
/* build real parts */
|
||||
for (n = 0, l = ed->collection->parts; l; l = l->next, n++)
|
||||
{
|
||||
Edje_Part *ep;
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
ep = l->data;
|
||||
rp = calloc(1, sizeof(Edje_Real_Part));
|
||||
if (!rp)
|
||||
{
|
||||
ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
||||
return 0;
|
||||
}
|
||||
rp->edje = ed;
|
||||
_edje_ref(rp->edje);
|
||||
rp->part = ep;
|
||||
parts = evas_list_append(parts, rp);
|
||||
rp->param1.description = ep->default_desc;
|
||||
rp->chosen_description = rp->param1.description;
|
||||
if (!rp->param1.description)
|
||||
{
|
||||
printf("EDJE ERROR: no default part description!\n");
|
||||
}
|
||||
if (ep->type == EDJE_PART_TYPE_RECTANGLE)
|
||||
rp->object = evas_object_rectangle_add(ed->evas);
|
||||
else if (ep->type == EDJE_PART_TYPE_IMAGE)
|
||||
rp->object = evas_object_image_add(ed->evas);
|
||||
else if (ep->type == EDJE_PART_TYPE_TEXT)
|
||||
{
|
||||
_edje_text_part_on_add(ed, rp);
|
||||
rp->object = evas_object_text_add(ed->evas);
|
||||
evas_object_text_font_source_set(rp->object, ed->path);
|
||||
}
|
||||
else if (ep->type == EDJE_PART_TYPE_SWALLOW || ep->type == EDJE_PART_TYPE_GROUP)
|
||||
{
|
||||
rp->object = evas_object_rectangle_add(ed->evas);
|
||||
evas_object_color_set(rp->object, 0, 0, 0, 0);
|
||||
evas_object_pass_events_set(rp->object, 1);
|
||||
}
|
||||
else if (ep->type == EDJE_PART_TYPE_TEXTBLOCK)
|
||||
rp->object = evas_object_textblock_add(ed->evas);
|
||||
else if (ep->type == EDJE_PART_TYPE_GRADIENT)
|
||||
rp->object = evas_object_gradient_add(ed->evas);
|
||||
else
|
||||
{
|
||||
printf("EDJE ERROR: wrong part type %i!\n", ep->type);
|
||||
}
|
||||
if (rp->object)
|
||||
{
|
||||
evas_object_smart_member_add(rp->object, ed->obj);
|
||||
evas_object_layer_set(rp->object, evas_object_layer_get(ed->obj));
|
||||
if (ep->type != EDJE_PART_TYPE_SWALLOW && ep->type != EDJE_PART_TYPE_GROUP)
|
||||
{
|
||||
if (ep->mouse_events)
|
||||
{
|
||||
_edje_callbacks_add(rp->object, ed, rp);
|
||||
if (ep->repeat_events)
|
||||
evas_object_repeat_events_set(rp->object, 1);
|
||||
}
|
||||
else
|
||||
evas_object_pass_events_set(rp->object, 1);
|
||||
}
|
||||
if (rp->part->clip_to_id < 0)
|
||||
evas_object_clip_set(rp->object, ed->clipper);
|
||||
}
|
||||
rp->drag.step.x = ep->dragable.step_x;
|
||||
rp->drag.step.y = ep->dragable.step_y;
|
||||
rp->gradient_id = -1;
|
||||
}
|
||||
if (n > 0)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
ed->table_parts = malloc(sizeof(Edje_Real_Part *) * n);
|
||||
ed->table_parts_size = n;
|
||||
/* FIXME: check malloc return */
|
||||
n = 0;
|
||||
for (l = parts; l; l = l->next)
|
||||
{
|
||||
rp = l->data;
|
||||
ed->table_parts[n] = rp;
|
||||
n++;
|
||||
}
|
||||
evas_list_free(parts);
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
rp = ed->table_parts[i];
|
||||
if (rp->param1.description->rel1.id_x >= 0)
|
||||
rp->param1.rel1_to_x = ed->table_parts[rp->param1.description->rel1.id_x % ed->table_parts_size];
|
||||
if (rp->param1.description->rel1.id_y >= 0)
|
||||
rp->param1.rel1_to_y = ed->table_parts[rp->param1.description->rel1.id_y % ed->table_parts_size];
|
||||
if (rp->param1.description->rel2.id_x >= 0)
|
||||
rp->param1.rel2_to_x = ed->table_parts[rp->param1.description->rel2.id_x % ed->table_parts_size];
|
||||
if (rp->param1.description->rel2.id_y >= 0)
|
||||
rp->param1.rel2_to_y = ed->table_parts[rp->param1.description->rel2.id_y % ed->table_parts_size];
|
||||
_edje_text_part_on_add_clippers(ed, rp);
|
||||
if (rp->part->clip_to_id >= 0)
|
||||
{
|
||||
rp->clip_to = ed->table_parts[rp->part->clip_to_id % ed->table_parts_size];
|
||||
if (rp->clip_to)
|
||||
{
|
||||
evas_object_pass_events_set(rp->clip_to->object, 1);
|
||||
evas_object_clip_set(rp->object, rp->clip_to->object);
|
||||
}
|
||||
}
|
||||
if (rp->part->dragable.confine_id >= 0)
|
||||
rp->confine_to = ed->table_parts[rp->part->dragable.confine_id % ed->table_parts_size];
|
||||
|
||||
/* replay events for dragable */
|
||||
if (rp->part->dragable.events_id >= 0)
|
||||
{
|
||||
rp->events_to =
|
||||
ed->table_parts[rp->part->dragable.events_id % ed->table_parts_size];
|
||||
/* events_to may be used only with dragable */
|
||||
if (!rp->events_to->part->dragable.x &&
|
||||
!rp->events_to->part->dragable.y)
|
||||
rp->events_to = NULL;
|
||||
}
|
||||
|
||||
rp->swallow_params.min.w = 0;
|
||||
rp->swallow_params.min.w = 0;
|
||||
rp->swallow_params.max.w = -1;
|
||||
rp->swallow_params.max.h = -1;
|
||||
|
||||
if (ed->file->feature_ver < 1)
|
||||
{
|
||||
rp->param1.description->text.id_source = -1;
|
||||
rp->param1.description->text.id_text_source = -1;
|
||||
}
|
||||
if (rp->param1.description->text.id_source >= 0)
|
||||
rp->text.source = ed->table_parts[rp->param1.description->text.id_source % ed->table_parts_size];
|
||||
if (rp->param1.description->text.id_text_source >= 0)
|
||||
rp->text.text_source = ed->table_parts[rp->param1.description->text.id_text_source % ed->table_parts_size];
|
||||
}
|
||||
}
|
||||
n = evas_list_count(ed->collection->programs);
|
||||
if (n > 0)
|
||||
{
|
||||
/* FIXME: keeping a table AND a list is just bad - nuke list */
|
||||
ed->table_programs = malloc(sizeof(Edje_Program *) * n);
|
||||
ed->table_programs_size = n;
|
||||
/* FIXME: check malloc return */
|
||||
n = 0;
|
||||
for (l = ed->collection->programs; l; l = l->next)
|
||||
{
|
||||
Edje_Program *pr;
|
||||
|
||||
pr = l->data;
|
||||
ed->table_programs[n] = pr;
|
||||
n++;
|
||||
}
|
||||
}
|
||||
_edje_ref(ed);
|
||||
_edje_block(ed);
|
||||
_edje_freeze(ed);
|
||||
if (ed->collection->script) _edje_embryo_script_init(ed);
|
||||
_edje_var_init(ed);
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
rp = ed->table_parts[i];
|
||||
evas_object_show(rp->object);
|
||||
if (_edje_block_break(ed)) break;
|
||||
if (rp->part->dragable.x < 0) rp->drag.val.x = 1.0;
|
||||
if (rp->part->dragable.y < 0) rp->drag.val.x = 1.0;
|
||||
_edje_dragable_pos_set(ed, rp, rp->drag.val.x, rp->drag.val.y);
|
||||
}
|
||||
ed->dirty = 1;
|
||||
if ((evas_object_clipees_get(ed->clipper)) &&
|
||||
(evas_object_visible_get(obj)))
|
||||
evas_object_show(ed->clipper);
|
||||
|
||||
/* instantiate 'internal swallows' */
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
rp = ed->table_parts[i];
|
||||
if (!rp->part->type == EDJE_PART_TYPE_GROUP) continue;
|
||||
if (rp->part->source)
|
||||
{
|
||||
Evas_List *l;
|
||||
Evas_Object *child_obj;
|
||||
Edje *child_ed;
|
||||
const char *group_path_entry = evas_stringshare_add(rp->part->source);
|
||||
if (!group_path)
|
||||
{
|
||||
group_path = evas_list_append(NULL, evas_stringshare_add(part));
|
||||
group_path_started = 1;
|
||||
}
|
||||
/* make sure that this group isn't already in the tree of parents */
|
||||
for (l = group_path; l; l = l->next)
|
||||
{
|
||||
if (l->data == group_path_entry)
|
||||
{
|
||||
_edje_thaw(ed);
|
||||
_edje_unblock(ed);
|
||||
_edje_unref(ed);
|
||||
_edje_file_del(ed);
|
||||
evas_stringshare_del(group_path_entry);
|
||||
if (group_path_started)
|
||||
{
|
||||
evas_stringshare_del(group_path->data);
|
||||
evas_list_free(group_path);
|
||||
}
|
||||
|
||||
ed->load_error = EDJE_LOAD_ERROR_RECURSIVE_REFERENCE;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
child_obj = edje_object_add(ed->evas);
|
||||
group_path = evas_list_append(group_path, group_path_entry);
|
||||
if (!_edje_object_file_set_internal(child_obj, file, rp->part->source, group_path))
|
||||
{
|
||||
_edje_thaw(ed);
|
||||
_edje_unblock(ed);
|
||||
_edje_unref(ed);
|
||||
_edje_file_del(ed);
|
||||
|
||||
if (group_path_started)
|
||||
{
|
||||
while (group_path)
|
||||
{
|
||||
evas_stringshare_del(group_path->data);
|
||||
group_path = evas_list_remove_list(group_path, group_path);
|
||||
}
|
||||
}
|
||||
ed->load_error = edje_object_load_error_get(child_obj);
|
||||
return 0;
|
||||
}
|
||||
child_ed = _edje_fetch(child_obj);
|
||||
child_ed->parent = evas_stringshare_add(rp->part->name);
|
||||
|
||||
group_path = evas_list_remove(group_path, group_path_entry);
|
||||
evas_stringshare_del(group_path_entry);
|
||||
|
||||
edje_object_signal_callback_add(child_obj, "*", "*", _cb_signal_repeat, obj);
|
||||
_edje_real_part_swallow(rp, child_obj);
|
||||
}
|
||||
}
|
||||
|
||||
if (group_path_started)
|
||||
{
|
||||
while (group_path)
|
||||
{
|
||||
evas_stringshare_del(group_path->data);
|
||||
group_path = evas_list_remove_list(group_path, group_path);
|
||||
}
|
||||
}
|
||||
|
||||
/* reswallow any swallows that existed before setting the file */
|
||||
if (old_swallows)
|
||||
{
|
||||
while (old_swallows)
|
||||
{
|
||||
const char *name;
|
||||
Evas_Object *swallow;
|
||||
|
||||
name = old_swallows->data;
|
||||
old_swallows = evas_list_remove_list(old_swallows, old_swallows);
|
||||
|
||||
swallow = old_swallows->data;
|
||||
old_swallows = evas_list_remove_list(old_swallows, old_swallows);
|
||||
|
||||
edje_object_part_swallow(obj, name, swallow);
|
||||
evas_stringshare_del(name);
|
||||
}
|
||||
}
|
||||
|
||||
_edje_recalc(ed);
|
||||
_edje_thaw(ed);
|
||||
_edje_unblock(ed);
|
||||
_edje_unref(ed);
|
||||
ed->load_error = EDJE_LOAD_ERROR_NONE;
|
||||
_edje_emit(ed, "load", NULL);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
ed->load_error = EDJE_LOAD_ERROR_NONE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
_edje_file_add(Edje *ed)
|
||||
{
|
||||
|
@ -491,7 +581,7 @@ _edje_swallows_collect(Edje *ed)
|
|||
Edje_Real_Part *rp;
|
||||
|
||||
rp = ed->table_parts[i];
|
||||
if (!rp->swallowed_object) continue;
|
||||
if (rp->part->type != EDJE_PART_TYPE_SWALLOW || !rp->swallowed_object) continue;
|
||||
swallows = evas_list_append(swallows, evas_stringshare_add(rp->part->name));
|
||||
swallows = evas_list_append(swallows, rp->swallowed_object);
|
||||
}
|
||||
|
@ -551,8 +641,10 @@ _edje_file_del(Edje *ed)
|
|||
if (rp->part->mouse_events)
|
||||
_edje_callbacks_del(rp->swallowed_object);
|
||||
rp->swallowed_object = NULL;
|
||||
/* I think it would be better swallowed objects dont get deleted */
|
||||
/* evas_object_del(rp->swallowed_object);*/
|
||||
|
||||
/* Objects swallowed by the app do not get deleted, but those internally swallowed (GROUP type) do. */
|
||||
if (rp->part->type == EDJE_PART_TYPE_GROUP)
|
||||
evas_object_del(rp->swallowed_object);
|
||||
}
|
||||
if (rp->text.text) evas_stringshare_del(rp->text.text);
|
||||
if (rp->text.font) evas_stringshare_del(rp->text.font);
|
||||
|
@ -564,6 +656,7 @@ _edje_file_del(Edje *ed)
|
|||
_edje_collection_free_part_description_free(rp->custom.description);
|
||||
}
|
||||
|
||||
_edje_unref(rp->edje);
|
||||
free(rp);
|
||||
}
|
||||
}
|
||||
|
@ -859,3 +952,18 @@ _edje_collection_free_prog_cache_matches_free_cb(Evas_Hash *hash, const char *ke
|
|||
fdata = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
_cb_signal_repeat(void *data, Evas_Object *obj, const char *signal, const char *source)
|
||||
{
|
||||
Evas_Object *parent;
|
||||
Edje *ed;
|
||||
char new_src[4096]; /* XXX is this max reasonable? */
|
||||
|
||||
parent = data;
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return;
|
||||
snprintf(new_src, sizeof(new_src), "%s%c%s", ed->parent, EDJE_PART_PATH_SEPARATOR, source);
|
||||
|
||||
edje_object_signal_emit(parent, signal, new_src);
|
||||
}
|
||||
|
|
|
@ -85,6 +85,7 @@ _edje_del(Edje *ed)
|
|||
_edje_file_del(ed);
|
||||
if (ed->path) evas_stringshare_del(ed->path);
|
||||
if (ed->part) evas_stringshare_del(ed->part);
|
||||
if (ed->parent) evas_stringshare_del(ed->parent);
|
||||
ed->path = NULL;
|
||||
ed->part = NULL;
|
||||
if ((ed->actions) || (ed->pending_actions))
|
||||
|
|
|
@ -8,6 +8,7 @@ static Ecore_Timer *job_loss_timer = NULL;
|
|||
static Evas_List *msgq = NULL;
|
||||
static Evas_List *tmp_msgq = NULL;
|
||||
|
||||
/* FIXME pass messages on to children? */
|
||||
EAPI void
|
||||
edje_object_message_send(Evas_Object *obj, Edje_Message_Type type, int id, void *msg)
|
||||
{
|
||||
|
|
|
@ -132,7 +132,8 @@ typedef struct _Edje_Spectrum_Color Edje_Spectrum_Color;
|
|||
#define EDJE_PART_TYPE_SWALLOW 4
|
||||
#define EDJE_PART_TYPE_TEXTBLOCK 5
|
||||
#define EDJE_PART_TYPE_GRADIENT 6
|
||||
#define EDJE_PART_TYPE_LAST 7
|
||||
#define EDJE_PART_TYPE_GROUP 7
|
||||
#define EDJE_PART_TYPE_LAST 8
|
||||
|
||||
#define EDJE_TEXT_EFFECT_NONE 0
|
||||
#define EDJE_TEXT_EFFECT_PLAIN 1
|
||||
|
@ -208,6 +209,8 @@ typedef struct _Edje_Spectrum_Color Edje_Spectrum_Color;
|
|||
#define EDJE_STATE_PARAM_VISIBLE 31
|
||||
#define EDJE_STATE_PARAM_LAST 32
|
||||
|
||||
#define EDJE_PART_PATH_SEPARATOR ':'
|
||||
#define EDJE_PART_PATH_SEPARATOR_STRING ":"
|
||||
/*----------*/
|
||||
|
||||
struct _Edje_File
|
||||
|
@ -421,6 +424,7 @@ struct _Edje_Part
|
|||
/* davinchi */
|
||||
int events_id; /* If it is used as scrollbar */
|
||||
} dragable;
|
||||
char *source;
|
||||
};
|
||||
|
||||
struct _Edje_Part_Image_Id
|
||||
|
@ -562,6 +566,7 @@ struct _Edje
|
|||
{
|
||||
const char *path;
|
||||
const char *part;
|
||||
const char *parent;
|
||||
|
||||
Evas_Coord x, y, w, h;
|
||||
struct {
|
||||
|
@ -617,6 +622,7 @@ struct _Edje
|
|||
|
||||
struct _Edje_Real_Part
|
||||
{
|
||||
Edje *edje;
|
||||
int x, y, w, h;
|
||||
struct {
|
||||
int x, y, w, h;
|
||||
|
@ -951,6 +957,7 @@ void _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_P
|
|||
Evas_Font_Size _edje_text_size_calc(Evas_Font_Size size, Edje_Text_Class *tc);
|
||||
|
||||
Edje_Real_Part *_edje_real_part_get(Edje *ed, const char *part);
|
||||
Edje_Real_Part *_edje_real_part_recursive_get(Edje *ed, const char *part);
|
||||
Edje_Color_Class *_edje_color_class_find(Edje *ed, const char *color_class);
|
||||
void _edje_color_class_member_add(Edje *ed, const char *color_class);
|
||||
void _edje_color_class_member_del(Edje *ed, const char *color_class);
|
||||
|
@ -973,6 +980,7 @@ int _edje_unblock(Edje *ed);
|
|||
int _edje_block_break(Edje *ed);
|
||||
void _edje_block_violate(Edje *ed);
|
||||
void _edje_object_part_swallow_free_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
void _edje_real_part_swallow(Edje_Real_Part *rp, Evas_Object *obj_swallow);
|
||||
|
||||
void _edje_embryo_script_init (Edje *ed);
|
||||
void _edje_embryo_script_shutdown (Edje *ed);
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
#include "Edje.h"
|
||||
#include "edje_private.h"
|
||||
|
||||
|
@ -185,6 +188,8 @@ edje_object_signal_callback_del(Evas_Object *obj, const char *emission, const ch
|
|||
* action: ...
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* FIXME should this signal be sent to children also?
|
||||
*/
|
||||
EAPI void
|
||||
edje_object_signal_emit(Evas_Object *obj, const char *emission, const char *source)
|
||||
|
@ -212,6 +217,7 @@ edje_object_play_set(Evas_Object *obj, int play)
|
|||
Edje *ed;
|
||||
double t;
|
||||
Evas_List *l;
|
||||
int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return;
|
||||
|
@ -235,6 +241,14 @@ edje_object_play_set(Evas_Object *obj, int play)
|
|||
ed->paused = 1;
|
||||
ed->paused_at = ecore_time_get();
|
||||
}
|
||||
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
rp = ed->table_parts[i];
|
||||
if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
|
||||
edje_object_play_set(rp->swallowed_object, play);
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXDOC: Verify/Expand */
|
||||
|
@ -267,6 +281,7 @@ edje_object_animation_set(Evas_Object *obj, int on)
|
|||
{
|
||||
Edje *ed;
|
||||
Evas_List *l;
|
||||
int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return;
|
||||
|
@ -304,6 +319,15 @@ edje_object_animation_set(Evas_Object *obj, int on)
|
|||
}
|
||||
}
|
||||
break_prog:
|
||||
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
rp = ed->table_parts[i];
|
||||
if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
|
||||
edje_object_animation_set(rp->swallowed_object, on);
|
||||
}
|
||||
|
||||
_edje_thaw(ed);
|
||||
_edje_unblock(ed);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <Ecore_Str.h>
|
||||
#include "Edje.h"
|
||||
#include "edje_private.h"
|
||||
|
||||
|
@ -22,6 +24,8 @@ struct _Edje_List_Foreach_Data
|
|||
static Evas_Bool _edje_color_class_list_foreach(Evas_Hash *hash, const char *key, void *data, void *fdata);
|
||||
static Evas_Bool _edje_text_class_list_foreach(Evas_Hash *hash, const char *key, void *data, void *fdata);
|
||||
|
||||
Edje_Real_Part *_edje_real_part_recursive_get_helper(Edje *ed, char **path);
|
||||
|
||||
/************************** API Routines **************************/
|
||||
|
||||
/* FIXDOC: These all need to be looked over, Verified/Expanded upon. I just got lazy and stopped putting FIXDOC next to each function in this file. */
|
||||
|
@ -125,9 +129,17 @@ EAPI int
|
|||
edje_object_freeze(Evas_Object *obj)
|
||||
{
|
||||
Edje *ed;
|
||||
int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return 0;
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
rp = ed->table_parts[i];
|
||||
if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
|
||||
edje_object_freeze(rp->swallowed_object);
|
||||
}
|
||||
return _edje_freeze(ed);
|
||||
}
|
||||
|
||||
|
@ -142,9 +154,17 @@ EAPI int
|
|||
edje_object_thaw(Evas_Object *obj)
|
||||
{
|
||||
Edje *ed;
|
||||
int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return 0;
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
rp = ed->table_parts[i];
|
||||
if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
|
||||
edje_object_thaw(rp->swallowed_object);
|
||||
}
|
||||
return _edje_thaw(ed);
|
||||
}
|
||||
|
||||
|
@ -329,6 +349,7 @@ edje_object_color_class_set(Evas_Object *obj, const char *color_class, int r, in
|
|||
Edje *ed;
|
||||
Evas_List *l;
|
||||
Edje_Color_Class *cc;
|
||||
int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!color_class)) return;
|
||||
|
@ -391,6 +412,15 @@ edje_object_color_class_set(Evas_Object *obj, const char *color_class, int r, in
|
|||
cc->a3 = a3;
|
||||
ed->color_classes = evas_list_append(ed->color_classes, cc);
|
||||
ed->dirty = 1;
|
||||
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
rp = ed->table_parts[i];
|
||||
if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
|
||||
edje_object_color_class_set(rp->swallowed_object, color_class, r, g, b, a, r2, g2, b2, a2, r3, g3, b3, a3);
|
||||
}
|
||||
|
||||
_edje_recalc(ed);
|
||||
}
|
||||
|
||||
|
@ -406,6 +436,7 @@ edje_object_color_class_del(Evas_Object *obj, const char *color_class)
|
|||
Edje *ed;
|
||||
Evas_List *l;
|
||||
Edje_Color_Class *cc = NULL;
|
||||
int i;
|
||||
|
||||
if (!color_class) return;
|
||||
|
||||
|
@ -422,7 +453,14 @@ edje_object_color_class_del(Evas_Object *obj, const char *color_class)
|
|||
}
|
||||
}
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
rp = ed->table_parts[i];
|
||||
if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
|
||||
edje_object_color_class_del(rp->swallowed_object, color_class);
|
||||
}
|
||||
|
||||
ed->dirty = 1;
|
||||
_edje_recalc(ed);
|
||||
}
|
||||
|
@ -573,6 +611,7 @@ edje_object_text_class_set(Evas_Object *obj, const char *text_class, const char
|
|||
Edje *ed;
|
||||
Evas_List *l;
|
||||
Edje_Text_Class *tc;
|
||||
int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!text_class)) return;
|
||||
|
@ -620,6 +659,14 @@ edje_object_text_class_set(Evas_Object *obj, const char *text_class, const char
|
|||
else tc->font = NULL;
|
||||
tc->size = size;
|
||||
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
rp = ed->table_parts[i];
|
||||
if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
|
||||
edje_object_text_class_set(rp->swallowed_object, text_class, font, size);
|
||||
}
|
||||
|
||||
/* Add to edje's text class list */
|
||||
ed->text_classes = evas_list_append(ed->text_classes, tc);
|
||||
ed->dirty = 1;
|
||||
|
@ -641,7 +688,7 @@ edje_object_part_exists(Evas_Object *obj, const char *part)
|
|||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!part)) return 0;
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
@ -666,7 +713,7 @@ edje_object_part_object_get(Evas_Object *obj, const char *part)
|
|||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!part)) return NULL;
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp) return NULL;
|
||||
return rp->object;
|
||||
}
|
||||
|
@ -699,7 +746,7 @@ edje_object_part_geometry_get(Evas_Object *obj, const char *part, Evas_Coord *x,
|
|||
if (h) *h = 0;
|
||||
return;
|
||||
}
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp)
|
||||
{
|
||||
if (x) *x = 0;
|
||||
|
@ -719,11 +766,20 @@ EAPI void
|
|||
edje_object_text_change_cb_set(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, const char *part), void *data)
|
||||
{
|
||||
Edje *ed;
|
||||
int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return;
|
||||
ed->text_change.func = func;
|
||||
ed->text_change.data = data;
|
||||
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
rp = ed->table_parts[i];
|
||||
if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object)
|
||||
edje_object_text_change_cb_set(rp->swallowed_object, func, data);
|
||||
}
|
||||
}
|
||||
|
||||
/** Sets the text for an object part
|
||||
|
@ -739,7 +795,7 @@ edje_object_part_text_set(Evas_Object *obj, const char *part, const char *text)
|
|||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!part)) return;
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp) return;
|
||||
if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
|
||||
(rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return;
|
||||
|
@ -751,9 +807,9 @@ edje_object_part_text_set(Evas_Object *obj, const char *part, const char *text)
|
|||
if (rp->text.text) evas_stringshare_del(rp->text.text);
|
||||
if (text) rp->text.text = evas_stringshare_add(text);
|
||||
else rp->text.text = NULL;
|
||||
ed->dirty = 1;
|
||||
_edje_recalc(ed);
|
||||
if (ed->text_change.func) ed->text_change.func(ed->text_change.data, obj, part);
|
||||
rp->edje->dirty = 1;
|
||||
_edje_recalc(rp->edje);
|
||||
if (rp->edje->text_change.func) rp->edje->text_change.func(rp->edje->text_change.data, obj, part);
|
||||
}
|
||||
|
||||
/** Returns the text of the object part
|
||||
|
@ -769,7 +825,7 @@ edje_object_part_text_get(Evas_Object *obj, const char *part)
|
|||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!part)) return NULL;
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp) return NULL;
|
||||
if (rp->part->type == EDJE_PART_TYPE_TEXT)
|
||||
return rp->text.text;
|
||||
|
@ -793,95 +849,13 @@ edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_sw
|
|||
{
|
||||
Edje *ed;
|
||||
Edje_Real_Part *rp;
|
||||
char *type;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!part)) return;
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp) return;
|
||||
if (rp->swallowed_object)
|
||||
{
|
||||
evas_object_smart_member_del(rp->swallowed_object);
|
||||
evas_object_event_callback_del(rp->swallowed_object,
|
||||
EVAS_CALLBACK_FREE,
|
||||
_edje_object_part_swallow_free_cb);
|
||||
evas_object_clip_unset(rp->swallowed_object);
|
||||
evas_object_data_del(rp->swallowed_object, "\377 edje.swallowing_part");
|
||||
if (rp->part->mouse_events)
|
||||
_edje_callbacks_del(rp->swallowed_object);
|
||||
rp->swallowed_object = NULL;
|
||||
}
|
||||
if (!obj_swallow) return;
|
||||
rp->swallowed_object = obj_swallow;
|
||||
evas_object_smart_member_add(rp->swallowed_object, ed->obj);
|
||||
if (rp->clip_to)
|
||||
evas_object_clip_set(rp->swallowed_object, rp->clip_to->object);
|
||||
else evas_object_clip_set(rp->swallowed_object, ed->clipper);
|
||||
evas_object_stack_above(rp->swallowed_object, rp->object);
|
||||
evas_object_event_callback_add(rp->swallowed_object,
|
||||
EVAS_CALLBACK_FREE,
|
||||
_edje_object_part_swallow_free_cb,
|
||||
obj);
|
||||
type = (char *)evas_object_type_get(obj_swallow);
|
||||
rp->swallow_params.min.w = 0;
|
||||
rp->swallow_params.min.w = 0;
|
||||
rp->swallow_params.max.w = -1;
|
||||
rp->swallow_params.max.h = -1;
|
||||
if ((type) && (!strcmp(type, "edje")))
|
||||
{
|
||||
Evas_Coord w, h;
|
||||
|
||||
edje_object_size_min_get(obj_swallow, &w, &h);
|
||||
rp->swallow_params.min.w = w;
|
||||
rp->swallow_params.min.h = h;
|
||||
edje_object_size_max_get(obj_swallow, &w, &h);
|
||||
rp->swallow_params.max.w = w;
|
||||
rp->swallow_params.max.h = h;
|
||||
}
|
||||
else if ((type) && ((!strcmp(type, "text")) ||
|
||||
(!strcmp(type, "polygon")) ||
|
||||
(!strcmp(type, "line"))))
|
||||
{
|
||||
Evas_Coord w, h;
|
||||
|
||||
evas_object_geometry_get(obj_swallow, NULL, NULL, &w, &h);
|
||||
rp->swallow_params.min.w = w;
|
||||
rp->swallow_params.min.h = h;
|
||||
rp->swallow_params.max.w = w;
|
||||
rp->swallow_params.max.h = h;
|
||||
}
|
||||
{
|
||||
int w1, h1, w2, h2, am, aw, ah;
|
||||
|
||||
w1 = (int)evas_object_data_get(obj_swallow, "\377 edje.minw");
|
||||
h1 = (int)evas_object_data_get(obj_swallow, "\377 edje.minh");
|
||||
w2 = (int)evas_object_data_get(obj_swallow, "\377 edje.maxw");
|
||||
h2 = (int)evas_object_data_get(obj_swallow, "\377 edje.maxh");
|
||||
am = (int)evas_object_data_get(obj_swallow, "\377 edje.aspm");
|
||||
aw = (int)evas_object_data_get(obj_swallow, "\377 edje.aspw");
|
||||
ah = (int)evas_object_data_get(obj_swallow, "\377 edje.asph");
|
||||
rp->swallow_params.min.w = w1;
|
||||
rp->swallow_params.min.h = h1;
|
||||
if (w2 > 0) rp->swallow_params.max.w = w2;
|
||||
if (h2 > 0) rp->swallow_params.max.h = h2;
|
||||
rp->swallow_params.aspect.mode = am;
|
||||
rp->swallow_params.aspect.w = aw;
|
||||
rp->swallow_params.aspect.h = ah;
|
||||
evas_object_data_set(rp->swallowed_object, "\377 edje.swallowing_part", rp);
|
||||
}
|
||||
|
||||
if (rp->part->mouse_events)
|
||||
{
|
||||
_edje_callbacks_add(obj_swallow, ed, rp);
|
||||
if (rp->part->repeat_events)
|
||||
evas_object_repeat_events_set(obj_swallow, 1);
|
||||
}
|
||||
else
|
||||
evas_object_pass_events_set(obj_swallow, 1);
|
||||
|
||||
|
||||
ed->dirty = 1;
|
||||
_edje_recalc(ed);
|
||||
if (rp->part->type != EDJE_PART_TYPE_SWALLOW) return;
|
||||
_edje_real_part_swallow(rp, obj_swallow);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1022,36 +996,31 @@ EAPI void
|
|||
edje_object_part_unswallow(Evas_Object *obj, Evas_Object *obj_swallow)
|
||||
{
|
||||
Edje *ed;
|
||||
int i;
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!obj_swallow)) return;
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
if (!obj_swallow) return;
|
||||
|
||||
rp = (Edje_Real_Part *)evas_object_data_get(obj_swallow, "\377 edje.swallowing_part");
|
||||
if (rp && rp->swallowed_object == obj_swallow)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
rp = ed->table_parts[i];
|
||||
if (rp->swallowed_object == obj_swallow)
|
||||
{
|
||||
evas_object_smart_member_del(rp->swallowed_object);
|
||||
evas_object_event_callback_del(rp->swallowed_object,
|
||||
EVAS_CALLBACK_FREE,
|
||||
_edje_object_part_swallow_free_cb);
|
||||
evas_object_clip_unset(rp->swallowed_object);
|
||||
evas_object_data_del(rp->swallowed_object, "\377 edje.swallowing_part");
|
||||
evas_object_smart_member_del(rp->swallowed_object);
|
||||
evas_object_event_callback_del(rp->swallowed_object,
|
||||
EVAS_CALLBACK_FREE,
|
||||
_edje_object_part_swallow_free_cb);
|
||||
evas_object_clip_unset(rp->swallowed_object);
|
||||
evas_object_data_del(rp->swallowed_object, "\377 edje.swallowing_part");
|
||||
|
||||
if (rp->part->mouse_events)
|
||||
_edje_callbacks_del(rp->swallowed_object);
|
||||
if (rp->part->mouse_events)
|
||||
_edje_callbacks_del(rp->swallowed_object);
|
||||
|
||||
rp->swallowed_object = NULL;
|
||||
rp->swallow_params.min.w = 0;
|
||||
rp->swallow_params.min.h = 0;
|
||||
rp->swallow_params.max.w = 0;
|
||||
rp->swallow_params.max.h = 0;
|
||||
ed->dirty = 1;
|
||||
_edje_recalc(ed);
|
||||
return;
|
||||
}
|
||||
rp->swallowed_object = NULL;
|
||||
rp->swallow_params.min.w = 0;
|
||||
rp->swallow_params.min.h = 0;
|
||||
rp->swallow_params.max.w = 0;
|
||||
rp->swallow_params.max.h = 0;
|
||||
rp->edje->dirty = 1;
|
||||
_edje_recalc(rp->edje);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1068,7 +1037,7 @@ edje_object_part_swallow_get(Evas_Object *obj, const char *part)
|
|||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!part)) return NULL;
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp) return NULL;
|
||||
return rp->swallowed_object;
|
||||
}
|
||||
|
@ -1297,7 +1266,7 @@ edje_object_part_state_get(Evas_Object *obj, const char *part, double *val_ret)
|
|||
if (val_ret) *val_ret = 0;
|
||||
return "";
|
||||
}
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp)
|
||||
{
|
||||
if (val_ret) *val_ret = 0;
|
||||
|
@ -1344,7 +1313,7 @@ edje_object_part_drag_dir_get(Evas_Object *obj, const char *part)
|
|||
{
|
||||
return EDJE_DRAG_DIR_NONE;
|
||||
}
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp)
|
||||
{
|
||||
return EDJE_DRAG_DIR_NONE;
|
||||
|
@ -1374,7 +1343,7 @@ edje_object_part_drag_value_set(Evas_Object *obj, const char *part, double dx, d
|
|||
{
|
||||
return;
|
||||
}
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp)
|
||||
{
|
||||
return;
|
||||
|
@ -1390,8 +1359,8 @@ edje_object_part_drag_value_set(Evas_Object *obj, const char *part, double dx, d
|
|||
if ((rp->drag.val.x == dx) && (rp->drag.val.y == dy)) return;
|
||||
rp->drag.val.x = dx;
|
||||
rp->drag.val.y = dy;
|
||||
_edje_dragable_pos_set(ed, rp, dx, dy);
|
||||
_edje_emit(ed, "drag,set", rp->part->name);
|
||||
_edje_dragable_pos_set(rp->edje, rp, dx, dy);
|
||||
_edje_emit(rp->edje, "drag,set", rp->part->name);
|
||||
}
|
||||
|
||||
/** Get the dragable object location
|
||||
|
@ -1417,7 +1386,7 @@ edje_object_part_drag_value_get(Evas_Object *obj, const char *part, double *dx,
|
|||
if (dy) *dy = 0;
|
||||
return;
|
||||
}
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp)
|
||||
{
|
||||
if (dx) *dx = 0;
|
||||
|
@ -1451,7 +1420,7 @@ edje_object_part_drag_size_set(Evas_Object *obj, const char *part, double dw, do
|
|||
{
|
||||
return;
|
||||
}
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp)
|
||||
{
|
||||
return;
|
||||
|
@ -1463,8 +1432,8 @@ edje_object_part_drag_size_set(Evas_Object *obj, const char *part, double dw, do
|
|||
if ((rp->drag.size.x == dw) && (rp->drag.size.y == dh)) return;
|
||||
rp->drag.size.x = dw;
|
||||
rp->drag.size.y = dh;
|
||||
ed->dirty = 1;
|
||||
_edje_recalc(ed);
|
||||
rp->edje->dirty = 1;
|
||||
_edje_recalc(rp->edje);
|
||||
}
|
||||
|
||||
/** Get the dragable object size
|
||||
|
@ -1488,7 +1457,7 @@ edje_object_part_drag_size_get(Evas_Object *obj, const char *part, double *dw, d
|
|||
if (dh) *dh = 0;
|
||||
return;
|
||||
}
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp)
|
||||
{
|
||||
if (dw) *dw = 0;
|
||||
|
@ -1518,7 +1487,7 @@ edje_object_part_drag_step_set(Evas_Object *obj, const char *part, double dx, do
|
|||
{
|
||||
return;
|
||||
}
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp)
|
||||
{
|
||||
return;
|
||||
|
@ -1552,7 +1521,7 @@ edje_object_part_drag_step_get(Evas_Object *obj, const char *part, double *dx, d
|
|||
if (dy) *dy = 0;
|
||||
return;
|
||||
}
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp)
|
||||
{
|
||||
if (dx) *dx = 0;
|
||||
|
@ -1582,7 +1551,7 @@ edje_object_part_drag_page_set(Evas_Object *obj, const char *part, double dx, do
|
|||
{
|
||||
return;
|
||||
}
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp)
|
||||
{
|
||||
return;
|
||||
|
@ -1616,7 +1585,7 @@ edje_object_part_drag_page_get(Evas_Object *obj, const char *part, double *dx, d
|
|||
if (dy) *dy = 0;
|
||||
return;
|
||||
}
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp)
|
||||
{
|
||||
if (dx) *dx = 0;
|
||||
|
@ -1648,7 +1617,7 @@ edje_object_part_drag_step(Evas_Object *obj, const char *part, double dx, double
|
|||
{
|
||||
return;
|
||||
}
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp)
|
||||
{
|
||||
return;
|
||||
|
@ -1661,8 +1630,8 @@ edje_object_part_drag_step(Evas_Object *obj, const char *part, double dx, double
|
|||
rp->drag.val.x = CLAMP (rp->drag.val.x, 0.0, 1.0);
|
||||
rp->drag.val.y = CLAMP (rp->drag.val.y, 0.0, 1.0);
|
||||
if ((px == rp->drag.val.x) && (py == rp->drag.val.y)) return;
|
||||
_edje_dragable_pos_set(ed, rp, rp->drag.val.x, rp->drag.val.y);
|
||||
_edje_emit(ed, "drag,step", rp->part->name);
|
||||
_edje_dragable_pos_set(rp->edje, rp, rp->drag.val.x, rp->drag.val.y);
|
||||
_edje_emit(rp->edje, "drag,step", rp->part->name);
|
||||
}
|
||||
|
||||
/** Pages x,y steps
|
||||
|
@ -1686,7 +1655,7 @@ edje_object_part_drag_page(Evas_Object *obj, const char *part, double dx, double
|
|||
{
|
||||
return;
|
||||
}
|
||||
rp = _edje_real_part_get(ed, (char *)part);
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp)
|
||||
{
|
||||
return;
|
||||
|
@ -1699,10 +1668,43 @@ edje_object_part_drag_page(Evas_Object *obj, const char *part, double dx, double
|
|||
rp->drag.val.x = CLAMP (rp->drag.val.x, 0.0, 1.0);
|
||||
rp->drag.val.y = CLAMP (rp->drag.val.y, 0.0, 1.0);
|
||||
if ((px == rp->drag.val.x) && (py == rp->drag.val.y)) return;
|
||||
_edje_dragable_pos_set(ed, rp, rp->drag.val.x, rp->drag.val.y);
|
||||
_edje_emit(ed, "drag,page", rp->part->name);
|
||||
_edje_dragable_pos_set(rp->edje, rp, rp->drag.val.x, rp->drag.val.y);
|
||||
_edje_emit(rp->edje, "drag,page", rp->part->name);
|
||||
}
|
||||
|
||||
Edje_Real_Part *
|
||||
_edje_real_part_recursive_get(Edje *ed, const char *part)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
char **path;
|
||||
path = ecore_str_split(part, EDJE_PART_PATH_SEPARATOR_STRING, 0);
|
||||
if (!path) return NULL;
|
||||
|
||||
//printf("recursive get: %s\n", part);
|
||||
rp = _edje_real_part_recursive_get_helper(ed, path);
|
||||
|
||||
free(*path);
|
||||
free(path);
|
||||
return rp;
|
||||
}
|
||||
|
||||
Edje_Real_Part *
|
||||
_edje_real_part_recursive_get_helper(Edje *ed, char **path)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
//printf(" lookup: %s on %s\n", path[0], ed->parent ? ed->parent : "-");
|
||||
rp = _edje_real_part_get(ed, path[0]);
|
||||
if (path[1] == NULL)
|
||||
return rp;
|
||||
|
||||
if (!rp || rp->part->type != EDJE_PART_TYPE_GROUP || !rp->swallowed_object) return NULL;
|
||||
|
||||
ed = _edje_fetch(rp->swallowed_object);
|
||||
if (!ed) return NULL;
|
||||
|
||||
path++;
|
||||
return _edje_real_part_recursive_get_helper(ed, path);
|
||||
}
|
||||
|
||||
|
||||
/* Private Routines */
|
||||
|
@ -2034,3 +2036,94 @@ _edje_object_part_swallow_free_cb(void *data, Evas *e, Evas_Object *obj, void *e
|
|||
e = NULL;
|
||||
event_info = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
_edje_real_part_swallow(Edje_Real_Part *rp, Evas_Object *obj_swallow)
|
||||
{
|
||||
char *type;
|
||||
|
||||
if (rp->swallowed_object)
|
||||
{
|
||||
evas_object_smart_member_del(rp->swallowed_object);
|
||||
evas_object_event_callback_del(rp->swallowed_object,
|
||||
EVAS_CALLBACK_FREE,
|
||||
_edje_object_part_swallow_free_cb);
|
||||
evas_object_clip_unset(rp->swallowed_object);
|
||||
evas_object_data_del(rp->swallowed_object, "\377 edje.swallowing_part");
|
||||
if (rp->part->mouse_events)
|
||||
_edje_callbacks_del(rp->swallowed_object);
|
||||
rp->swallowed_object = NULL;
|
||||
}
|
||||
if (!obj_swallow) return;
|
||||
rp->swallowed_object = obj_swallow;
|
||||
evas_object_smart_member_add(rp->swallowed_object, rp->edje->obj);
|
||||
if (rp->clip_to)
|
||||
evas_object_clip_set(rp->swallowed_object, rp->clip_to->object);
|
||||
else evas_object_clip_set(rp->swallowed_object, rp->edje->clipper);
|
||||
evas_object_stack_above(rp->swallowed_object, rp->object);
|
||||
evas_object_event_callback_add(rp->swallowed_object,
|
||||
EVAS_CALLBACK_FREE,
|
||||
_edje_object_part_swallow_free_cb,
|
||||
rp->edje->obj);
|
||||
type = (char *)evas_object_type_get(obj_swallow);
|
||||
rp->swallow_params.min.w = 0;
|
||||
rp->swallow_params.min.w = 0;
|
||||
rp->swallow_params.max.w = -1;
|
||||
rp->swallow_params.max.h = -1;
|
||||
if ((type) && (!strcmp(type, "edje")))
|
||||
{
|
||||
Evas_Coord w, h;
|
||||
|
||||
edje_object_size_min_get(obj_swallow, &w, &h);
|
||||
rp->swallow_params.min.w = w;
|
||||
rp->swallow_params.min.h = h;
|
||||
edje_object_size_max_get(obj_swallow, &w, &h);
|
||||
rp->swallow_params.max.w = w;
|
||||
rp->swallow_params.max.h = h;
|
||||
}
|
||||
else if ((type) && ((!strcmp(type, "text")) ||
|
||||
(!strcmp(type, "polygon")) ||
|
||||
(!strcmp(type, "line"))))
|
||||
{
|
||||
Evas_Coord w, h;
|
||||
|
||||
evas_object_geometry_get(obj_swallow, NULL, NULL, &w, &h);
|
||||
rp->swallow_params.min.w = w;
|
||||
rp->swallow_params.min.h = h;
|
||||
rp->swallow_params.max.w = w;
|
||||
rp->swallow_params.max.h = h;
|
||||
}
|
||||
{
|
||||
int w1, h1, w2, h2, am, aw, ah;
|
||||
|
||||
w1 = (int)evas_object_data_get(obj_swallow, "\377 edje.minw");
|
||||
h1 = (int)evas_object_data_get(obj_swallow, "\377 edje.minh");
|
||||
w2 = (int)evas_object_data_get(obj_swallow, "\377 edje.maxw");
|
||||
h2 = (int)evas_object_data_get(obj_swallow, "\377 edje.maxh");
|
||||
am = (int)evas_object_data_get(obj_swallow, "\377 edje.aspm");
|
||||
aw = (int)evas_object_data_get(obj_swallow, "\377 edje.aspw");
|
||||
ah = (int)evas_object_data_get(obj_swallow, "\377 edje.asph");
|
||||
rp->swallow_params.min.w = w1;
|
||||
rp->swallow_params.min.h = h1;
|
||||
if (w2 > 0) rp->swallow_params.max.w = w2;
|
||||
if (h2 > 0) rp->swallow_params.max.h = h2;
|
||||
rp->swallow_params.aspect.mode = am;
|
||||
rp->swallow_params.aspect.w = aw;
|
||||
rp->swallow_params.aspect.h = ah;
|
||||
evas_object_data_set(rp->swallowed_object, "\377 edje.swallowing_part", rp);
|
||||
}
|
||||
|
||||
if (rp->part->mouse_events)
|
||||
{
|
||||
_edje_callbacks_add(obj_swallow, rp->edje, rp);
|
||||
if (rp->part->repeat_events)
|
||||
evas_object_repeat_events_set(obj_swallow, 1);
|
||||
}
|
||||
else
|
||||
evas_object_pass_events_set(obj_swallow, 1);
|
||||
|
||||
|
||||
rp->edje->dirty = 1;
|
||||
_edje_recalc(rp->edje);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue