int bytes;
/* Try to load the file */
- im = evas_object_image_add(ed->evas);
+ im = evas_object_image_add(ed->base.evas);
if (!im) return EINA_FALSE;
evas_object_image_file_set(im, path, NULL);
// pc = ed->collection;
- part_obj = edje_edit_object_add(ed->evas);
+ part_obj = edje_edit_object_add(ed->base.evas);
old = eina_stringshare_add(old_group_name);
rp->part = ep;
if (ep->type == EDJE_PART_TYPE_RECTANGLE)
- rp->object = evas_object_rectangle_add(ed->evas);
+ rp->object = evas_object_rectangle_add(ed->base.evas);
else if (ep->type == EDJE_PART_TYPE_IMAGE || ep->type == EDJE_PART_TYPE_PROXY)
- rp->object = evas_object_image_add(ed->evas);
+ rp->object = evas_object_image_add(ed->base.evas);
else if (ep->type == EDJE_PART_TYPE_TEXT)
{
_edje_text_part_on_add(ed, rp);
- rp->object = evas_object_text_add(ed->evas);
+ rp->object = evas_object_text_add(ed->base.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 ||
ep->type == EDJE_PART_TYPE_EXTERNAL)
{
- rp->object = evas_object_rectangle_add(ed->evas);
+ rp->object = evas_object_rectangle_add(ed->base.evas);
evas_object_color_set(rp->object, 0, 0, 0, 0);
evas_object_pass_events_set(rp->object, 1);
evas_object_pointer_mode_set(rp->object, EVAS_OBJECT_POINTER_MODE_NOGRAB);
}
else if (ep->type == EDJE_PART_TYPE_TEXTBLOCK)
- rp->object = evas_object_textblock_add(ed->evas);
+ rp->object = evas_object_textblock_add(ed->base.evas);
else
ERR("wrong part type %i!", ep->type);
if (rp->object)
if (child)
_edje_real_part_swallow(rp, child);
}
- evas_object_clip_set(rp->object, ed->clipper);
- evas_object_show(ed->clipper);
+ evas_object_clip_set(rp->object, ed->base.clipper);
+ evas_object_show(ed->base.clipper);
}
/* Update table_parts */
if (real->clip_to == rp)
{
- evas_object_clip_set(real->object, ed->clipper);
+ evas_object_clip_set(real->object, ed->base.clipper);
real->clip_to = NULL;
}
if (real->drag && real->drag->confine_to == rp)
/* if all parts are gone, hide the clipper */
if (ed->table_parts_size == 0)
- evas_object_hide(ed->clipper);
+ evas_object_hide(ed->base.clipper);
edje_object_calc_force(obj);
evas_object_clip_unset(rp->object);
}
- evas_object_clip_set(rp->object, ed->clipper);
+ evas_object_clip_set(rp->object, ed->base.clipper);
if (rp->swallowed_object)
- evas_object_clip_set(rp->swallowed_object, ed->clipper);
+ evas_object_clip_set(rp->swallowed_object, ed->base.clipper);
rp->part->clip_to_id = -1;
rp->clip_to = NULL;
if (source)
{
rp->part->source = eina_stringshare_add(source);
- child_obj = edje_object_add(ed->evas);
+ child_obj = edje_object_add(ed->base.evas);
edje_object_file_set(child_obj, ed->file->path, source);
_edje_real_part_swallow(rp, child_obj);
}
Edje_Part_Collection *pc;
Eina_Bool ret = EINA_TRUE;
- obj = edje_edit_object_add(ed->evas);
+ obj = edje_edit_object_add(ed->base.evas);
if (!edje_object_file_set(obj, ed->file->path, group)) return EINA_FALSE;
ef = eet_open(ed->file->path, EET_FILE_MODE_READ);
CHKPARAM(2);
ed = embryo_program_data_get(ep);
- evas_pointer_canvas_xy_get(ed->evas, &x, &y);
+ evas_pointer_canvas_xy_get(ed->base.evas, &x, &y);
x -= ed->x;
y -= ed->y;
SETINT((int)x, params[1]);
CHKPARAM(0);
ed = embryo_program_data_get(ep);
- return evas_pointer_button_down_mask_get(ed->evas);
+ return evas_pointer_button_down_mask_get(ed->base.evas);
}
/* emit(sig[], src[]) */
rp = ed->table_parts[part_id % ed->table_parts_size];
if (!rp) return 0;
- new_obj = edje_object_add(ed->evas);
+ new_obj = edje_object_add(ed->base.evas);
if (!new_obj) return 0;
if (!edje_object_file_set(new_obj, ed->file->path, group_name))
sel = calloc(1, sizeof(Sel));
en->sel = eina_list_append(en->sel, sel);
- ob = edje_object_add(en->rp->edje->evas);
+ ob = edje_object_add(en->rp->edje->base.evas);
edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source);
evas_object_smart_member_add(ob, smart);
evas_object_stack_below(ob, o);
sel->obj_bg = ob;
en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, sel->obj_bg);
- ob = edje_object_add(en->rp->edje->evas);
+ ob = edje_object_add(en->rp->edje->base.evas);
edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source2);
evas_object_smart_member_add(ob, smart);
evas_object_stack_above(ob, o);
sel = calloc(1, sizeof(Sel));
an->sel = eina_list_append(an->sel, sel);
- ob = edje_object_add(en->rp->edje->evas);
+ ob = edje_object_add(en->rp->edje->base.evas);
edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source5);
evas_object_smart_member_add(ob, smart);
evas_object_stack_below(ob, o);
sel->obj_bg = ob;
en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, sel->obj_bg);
- ob = edje_object_add(en->rp->edje->evas);
+ ob = edje_object_add(en->rp->edje->base.evas);
edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source6);
evas_object_smart_member_add(ob, smart);
evas_object_stack_above(ob, o);
sel->obj_fg = ob;
en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, sel->obj_fg);
- ob = evas_object_rectangle_add(en->rp->edje->evas);
+ ob = evas_object_rectangle_add(en->rp->edje->base.evas);
evas_object_color_set(ob, 0, 0, 0, 0);
evas_object_smart_member_add(ob, smart);
evas_object_stack_above(ob, o);
evas_object_event_callback_add(ed->obj, EVAS_CALLBACK_FOCUS_OUT, _edje_focus_out_cb, ed);
evas_object_event_callback_add(ed->obj, EVAS_CALLBACK_KEY_DOWN, _edje_key_down_cb, ed);
evas_object_event_callback_add(ed->obj, EVAS_CALLBACK_KEY_UP, _edje_key_up_cb, ed);
- evas_event_callback_add(ed->evas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _evas_focus_in_cb, ed);
- evas_event_callback_add(ed->evas, EVAS_CALLBACK_CANVAS_FOCUS_OUT, _evas_focus_out_cb, ed);
+ evas_event_callback_add(ed->base.evas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _evas_focus_in_cb, ed);
+ evas_event_callback_add(ed->base.evas, EVAS_CALLBACK_CANVAS_FOCUS_OUT, _evas_focus_out_cb, ed);
}
void
evas_object_event_callback_del(ed->obj, EVAS_CALLBACK_FOCUS_OUT, _edje_focus_out_cb);
evas_object_event_callback_del(ed->obj, EVAS_CALLBACK_KEY_DOWN, _edje_key_down_cb);
evas_object_event_callback_del(ed->obj, EVAS_CALLBACK_KEY_UP, _edje_key_up_cb);
- if (evas_event_callback_del_full(ed->evas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _evas_focus_in_cb, ed) != ed)
+ if (evas_event_callback_del_full(ed->base.evas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _evas_focus_in_cb, ed) != ed)
ERR("could not unregister EVAS_CALLBACK_FOCUS_IN");
- if (evas_event_callback_del_full(ed->evas, EVAS_CALLBACK_CANVAS_FOCUS_OUT, _evas_focus_out_cb, ed) != ed)
+ if (evas_event_callback_del_full(ed->base.evas, EVAS_CALLBACK_CANVAS_FOCUS_OUT, _evas_focus_out_cb, ed) != ed)
ERR("could not unregister EVAS_CALLBACK_FOCUS_OUT");
}
evas_object_textblock_replace_char_set(rp->object, "*");
}
- en->cursor_bg = edje_object_add(rp->edje->evas);
+ en->cursor_bg = edje_object_add(rp->edje->base.evas);
edje_object_file_set(en->cursor_bg, rp->edje->path, rp->part->source3);
evas_object_smart_member_add(en->cursor_bg, rp->edje->obj);
evas_object_stack_below(en->cursor_bg, rp->object);
evas_object_pass_events_set(en->cursor_bg, EINA_TRUE);
rp->edje->subobjs = eina_list_append(rp->edje->subobjs, en->cursor_bg);
- en->cursor_fg = edje_object_add(rp->edje->evas);
+ en->cursor_fg = edje_object_add(rp->edje->base.evas);
edje_object_file_set(en->cursor_fg, rp->edje->path, rp->part->source4);
evas_object_smart_member_add(en->cursor_fg, rp->edje->obj);
evas_object_stack_above(en->cursor_fg, rp->object);
if (!en->imf_context) goto done;
ecore_imf_context_client_window_set(en->imf_context, rp->object);
- ecore_imf_context_client_canvas_set(en->imf_context, rp->edje->evas);
+ ecore_imf_context_client_canvas_set(en->imf_context, rp->edje->base.evas);
ecore_imf_context_retrieve_surrounding_callback_set(en->imf_context,
_edje_entry_imf_retrieve_surrounding_cb, rp->edje);
switch (ep->type)
{
case EDJE_PART_TYPE_RECTANGLE:
- rp->object = evas_object_rectangle_add(ed->evas);
+ rp->object = evas_object_rectangle_add(ed->base.evas);
break;
case EDJE_PART_TYPE_PROXY:
case EDJE_PART_TYPE_IMAGE:
- rp->object = evas_object_image_add(ed->evas);
+ rp->object = evas_object_image_add(ed->base.evas);
break;
case EDJE_PART_TYPE_TEXT:
_edje_text_part_on_add(ed, rp);
- rp->object = evas_object_text_add(ed->evas);
+ rp->object = evas_object_text_add(ed->base.evas);
evas_object_text_font_source_set(rp->object, ed->path);
break;
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_GROUP:
case EDJE_PART_TYPE_EXTERNAL:
- rp->object = evas_object_rectangle_add(ed->evas);
+ rp->object = evas_object_rectangle_add(ed->base.evas);
evas_object_color_set(rp->object, 0, 0, 0, 0);
evas_object_pass_events_set(rp->object, 1);
evas_object_pointer_mode_set(rp->object, EVAS_OBJECT_POINTER_MODE_NOGRAB);
_edje_callbacks_focus_add(rp->object, ed, rp);
break;
case EDJE_PART_TYPE_TEXTBLOCK:
- rp->object = evas_object_textblock_add(ed->evas);
+ rp->object = evas_object_textblock_add(ed->base.evas);
break;
case EDJE_PART_TYPE_BOX:
- rp->object = evas_object_box_add(ed->evas);
+ rp->object = evas_object_box_add(ed->base.evas);
rp->anim = _edje_box_layout_anim_new(rp->object);
break;
case EDJE_PART_TYPE_TABLE:
- rp->object = evas_object_table_add(ed->evas);
+ rp->object = evas_object_table_add(ed->base.evas);
break;
case EDJE_PART_TYPE_GRADIENT:
ERR("SPANK ! SPANK ! SPANK ! YOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !! THEY ARE NOW REMOVED !",
evas_object_precise_is_inside_set(rp->object, 1);
}
if (rp->part->clip_to_id < 0)
- evas_object_clip_set(rp->object, ed->clipper);
+ evas_object_clip_set(rp->object, ed->base.clipper);
}
}
if (n > 0)
#ifdef EDJE_CALC_CACHE
ed->all_part_change = 1;
#endif
- if ((evas_object_clipees_get(ed->clipper)) &&
+ if ((evas_object_clipees_get(ed->base.clipper)) &&
(evas_object_visible_get(obj)))
- evas_object_show(ed->clipper);
+ evas_object_show(ed->base.clipper);
/* instantiate 'internal swallows' */
for (i = 0; i < ed->table_parts_size; i++)
}
}
- child_obj = edje_object_add(ed->evas);
+ child_obj = edje_object_add(ed->base.evas);
group_path = eina_list_append(group_path, group_path_entry);
if (!_edje_object_file_set_internal(child_obj, file, source, group_path))
{
elo->obj.is_evas_obj = 1;
elo->evas_obj = evas_object_rectangle_add(evas_object_evas_get(ed->obj));
evas_object_smart_member_add(elo->evas_obj, ed->obj);
- evas_object_clip_set(elo->evas_obj, ed->clipper);
+ evas_object_clip_set(elo->evas_obj, ed->base.clipper);
evas_object_move(elo->evas_obj, ed->x, ed->y);
evas_object_resize(elo->evas_obj, 0, 0);
evas_object_data_set(elo->evas_obj, ELO, elo);
void
_edje_clean_objects(Edje *ed)
{
- evas_object_del(ed->clipper);
- ed->evas = NULL;
+ evas_object_del(ed->base.clipper);
+ ed->base.evas = NULL;
ed->obj = NULL;
- ed->clipper = NULL;
+ ed->base.clipper = NULL;
}
void
struct _Edje
{
- Evas_Object *clipper; /* a big rect to clip this Edje to */
- Evas *evas; /* the Evas this Edje belongs to */
+ Evas_Object_Smart_Clipped_Data base;
+ /* This contains (or should):
+ Evas_Object *clipper; // a big rect to clip this Edje to
+ Evas *evas; // the Evas this Edje belongs to
+ */
const Edje_Smart_Api *api;
const char *path;
const char *group;
oi->ed = ed;
oi->obj = o;
evas_object_smart_member_add(oi->obj, oi->ed->obj);
- evas_object_clip_set(oi->obj, oi->ed->clipper);
+ evas_object_clip_set(oi->obj, oi->ed->base.clipper);
evas_object_geometry_get(oi->obj, &(oi->x), &(oi->y), &(oi->w), &(oi->h));
snprintf(buf, sizeof(buf), "%i", oi->oid);
if (!si->oid.hash)
evas_object_smart_data_set(obj, ed);
}
- ed->evas = evas_object_evas_get(obj);
- ed->clipper = evas_object_rectangle_add(ed->evas);
- evas_object_static_clip_set(ed->clipper, 1);
- evas_object_smart_member_add(ed->clipper, obj);
- evas_object_color_set(ed->clipper, 255, 255, 255, 255);
- evas_object_move(ed->clipper, -10000, -10000);
- evas_object_resize(ed->clipper, 20000, 20000);
- evas_object_pass_events_set(ed->clipper, 1);
+ ed->base.evas = evas_object_evas_get(obj);
+ ed->base.clipper = evas_object_rectangle_add(ed->base.evas);
+ evas_object_static_clip_set(ed->base.clipper, 1);
+ evas_object_smart_member_add(ed->base.clipper, obj);
+ evas_object_color_set(ed->base.clipper, 255, 255, 255, 255);
+ evas_object_move(ed->base.clipper, -10000, -10000);
+ evas_object_resize(ed->base.clipper, 20000, 20000);
+ evas_object_pass_events_set(ed->base.clipper, 1);
ed->is_rtl = EINA_FALSE;
ed->have_objects = 1;
ed->references = 1;
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);
+ else evas_object_clip_set(rp->swallowed_object, rp->edje->base.clipper);
evas_object_stack_above(rp->swallowed_object, rp->object);
evas_object_event_callback_add(rp->swallowed_object,
EVAS_CALLBACK_FREE,