forked from enlightenment/efl
parent
9355b9cf8c
commit
001bc61602
|
@ -94,7 +94,8 @@ Edje_Edit_Image *edje_edit_iamge_get_by_id(int id);
|
|||
#define EDJE_PART_TYPE_RECTANGLE 1
|
||||
#define EDJE_PART_TYPE_TEXT 2
|
||||
#define EDJE_PART_TYPE_IMAGE 3
|
||||
#define EDJE_PART_TYPE_LAST 4
|
||||
#define EDJE_PART_TYPE_SWALLOW 4
|
||||
#define EDJE_PART_TYPE_LAST 5
|
||||
|
||||
#define EDJE_TEXT_EFFECT_NONE 0
|
||||
#define EDJE_TEXT_EFFECT_PLAIN 1
|
||||
|
|
|
@ -901,6 +901,12 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep)
|
|||
if (p3.visible) evas_object_show(ep->object);
|
||||
else evas_object_hide(ep->object);
|
||||
}
|
||||
else if (ep->part->type == EDJE_PART_TYPE_SWALLOW)
|
||||
{
|
||||
evas_object_move(ep->object, ed->x + p3.x, ed->y + p3.y);
|
||||
evas_object_resize(ep->object, p3.w, p3.h);
|
||||
}
|
||||
|
||||
if (ep->swallowed_object)
|
||||
{
|
||||
evas_object_move(ep->swallowed_object, ed->x + p3.x, ed->y + p3.y);
|
||||
|
|
|
@ -29,9 +29,98 @@ struct _Edje_Item
|
|||
Edje_Item_Class *class;
|
||||
void *class_data;
|
||||
|
||||
unsigned char accessible : 1;
|
||||
unsigned char accessible : 1;
|
||||
Evas_Object *object;
|
||||
Evas_Object *underlay_object;
|
||||
};
|
||||
|
||||
/* here is an item for a vertical list - with 1 or more columns. this has 3 */
|
||||
/* just rotate for a horizontal list */
|
||||
|
||||
/*
|
||||
* COL 0 COL 1 COL 2
|
||||
*
|
||||
* +-----------------------------+ +-------+ +----------------+
|
||||
* | pad_top | | | | |
|
||||
* | pad_left OBJECT pad_right | | OBJ | | OBJECT | ROW 0
|
||||
* | pad_bottom | | | | |
|
||||
* +-----------------------------+ +-------+ +----------------+
|
||||
* /\ /|\
|
||||
* space_row || +-- space_col
|
||||
* \/
|
||||
* +-----------------------------+ +-------+ +----------------+
|
||||
* | | | | | |
|
||||
* | | | | | | ROW 1
|
||||
* | | | | | |
|
||||
* +-----------------------------+ +-------+ +----------------+
|
||||
*
|
||||
* spacer object:
|
||||
* 1 edje object goes inbetween each row as a spacer object (opt)
|
||||
* 1 edje object goes inbetween each column as a spacer object (opt)
|
||||
*
|
||||
* surround object:
|
||||
* 1 edje object goes around each item - item swallowed into "item" part (opt)
|
||||
* if no "item" part then just underlay it
|
||||
* on select send "select" "" signal
|
||||
* on unselect send "unselect" "" signal
|
||||
* on focus send "focus" "" signal
|
||||
* on unfocus send "unfocus" signal
|
||||
*
|
||||
* if any list item/cell is an edje object emit this to them too.
|
||||
*
|
||||
* also call callbacks.
|
||||
* if a surround object emits such a signal itself then call callbacks too
|
||||
*
|
||||
* only 1 or 0 items can be focused
|
||||
* disabled items cannot be focused or selected/deselected
|
||||
*
|
||||
* container accepts:
|
||||
* { theme sets these effectively }
|
||||
* set edje it is part of
|
||||
* set collection id for col spacer
|
||||
* set collection id for row spacer
|
||||
* set row space
|
||||
* set col space
|
||||
* set item padding
|
||||
* set collection id for surround object
|
||||
*
|
||||
* { theme and app can both do this. theme has to do via embryo }
|
||||
* clear list
|
||||
* append item
|
||||
* prepend item
|
||||
* insert item before item
|
||||
* insert item after item
|
||||
* get item count
|
||||
* get first item
|
||||
* get last item
|
||||
* get item N
|
||||
* get item before item
|
||||
* get item after item
|
||||
* select item
|
||||
* unselect item
|
||||
* unselect all items
|
||||
* select all items
|
||||
* get selected item list
|
||||
* focus item
|
||||
* unfocus item
|
||||
* focus next item
|
||||
* focus prev item
|
||||
* get focused item
|
||||
* enable item
|
||||
* disable item
|
||||
* get item pos (along list) (0.0 - 1.0 1.0 = end of list)
|
||||
* get item span (0.0 - 1.0 1.0 == whole list height)
|
||||
* jump to pos
|
||||
* get list min width
|
||||
* get list min height
|
||||
* get view percentage
|
||||
*
|
||||
* notes:
|
||||
*
|
||||
* dnd of list items within lthe list and outside of it ???
|
||||
*
|
||||
*/
|
||||
|
||||
/* create and destroy virtual items */
|
||||
|
||||
Edje_Item *
|
||||
|
@ -67,6 +156,17 @@ edje_item_object_get(Edje_Item *ei)
|
|||
{
|
||||
}
|
||||
|
||||
/* this object goes under entire item */
|
||||
void
|
||||
edje_item_underlay_object_set(Edje_Item *ei, Evas_Object *obj)
|
||||
{
|
||||
}
|
||||
|
||||
Evas_Object *
|
||||
edje_item_underlay_object_get(Edje_Item *ei)
|
||||
{
|
||||
}
|
||||
|
||||
/* optionally you can manage each column's object yourself OR let edje do it */
|
||||
void
|
||||
edje_item_object_column_set(Edje_Item *ei, int col, Evas_Object *obj)
|
||||
|
|
|
@ -122,45 +122,57 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
|||
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
|
||||
{
|
||||
printf("EDJE ERROR: wrong part type %i!\n", ep->type);
|
||||
}
|
||||
evas_object_smart_member_add(rp->object, ed->obj);
|
||||
if (ep->mouse_events)
|
||||
if (rp->object)
|
||||
{
|
||||
evas_object_event_callback_add(rp->object,
|
||||
EVAS_CALLBACK_MOUSE_IN,
|
||||
_edje_mouse_in_cb,
|
||||
ed);
|
||||
evas_object_event_callback_add(rp->object,
|
||||
EVAS_CALLBACK_MOUSE_OUT,
|
||||
_edje_mouse_out_cb,
|
||||
ed);
|
||||
evas_object_event_callback_add(rp->object,
|
||||
EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_edje_mouse_down_cb,
|
||||
ed);
|
||||
evas_object_event_callback_add(rp->object,
|
||||
EVAS_CALLBACK_MOUSE_UP,
|
||||
_edje_mouse_up_cb,
|
||||
ed);
|
||||
evas_object_event_callback_add(rp->object,
|
||||
EVAS_CALLBACK_MOUSE_MOVE,
|
||||
_edje_mouse_move_cb,
|
||||
ed);
|
||||
evas_object_event_callback_add(rp->object,
|
||||
EVAS_CALLBACK_MOUSE_WHEEL,
|
||||
_edje_mouse_wheel_cb,
|
||||
ed);
|
||||
evas_object_data_set(rp->object, "real_part", rp);
|
||||
if (ep->repeat_events)
|
||||
evas_object_repeat_events_set(rp->object, 1);
|
||||
evas_object_smart_member_add(rp->object, ed->obj);
|
||||
if (ep->type != EDJE_PART_TYPE_SWALLOW)
|
||||
{
|
||||
if (ep->mouse_events)
|
||||
{
|
||||
evas_object_event_callback_add(rp->object,
|
||||
EVAS_CALLBACK_MOUSE_IN,
|
||||
_edje_mouse_in_cb,
|
||||
ed);
|
||||
evas_object_event_callback_add(rp->object,
|
||||
EVAS_CALLBACK_MOUSE_OUT,
|
||||
_edje_mouse_out_cb,
|
||||
ed);
|
||||
evas_object_event_callback_add(rp->object,
|
||||
EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_edje_mouse_down_cb,
|
||||
ed);
|
||||
evas_object_event_callback_add(rp->object,
|
||||
EVAS_CALLBACK_MOUSE_UP,
|
||||
_edje_mouse_up_cb,
|
||||
ed);
|
||||
evas_object_event_callback_add(rp->object,
|
||||
EVAS_CALLBACK_MOUSE_MOVE,
|
||||
_edje_mouse_move_cb,
|
||||
ed);
|
||||
evas_object_event_callback_add(rp->object,
|
||||
EVAS_CALLBACK_MOUSE_WHEEL,
|
||||
_edje_mouse_wheel_cb,
|
||||
ed);
|
||||
evas_object_data_set(rp->object, "real_part", 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);
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
@ -225,7 +237,6 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
|||
_edje_freeze(ed);
|
||||
if (ed->collection->script) _edje_embryo_script_init(ed);
|
||||
_edje_var_init(ed);
|
||||
_edje_emit(ed, "load", "");
|
||||
for (l = ed->parts; l; l = l->next)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
|
@ -238,13 +249,15 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
|||
_edje_dragable_pos_set(ed, rp, 1.0, 1.0);
|
||||
}
|
||||
ed->dirty = 1;
|
||||
if ((ed->parts) && (evas_object_visible_get(obj)))
|
||||
if ((evas_object_clipees_get(ed->clipper)) &&
|
||||
(evas_object_visible_get(obj)))
|
||||
evas_object_show(ed->clipper);
|
||||
_edje_recalc(ed);
|
||||
_edje_thaw(ed);
|
||||
_edje_unblock(ed);
|
||||
_edje_unref(ed);
|
||||
ed->load_error = EDJE_LOAD_ERROR_NONE;
|
||||
_edje_emit(ed, "load", "");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -311,7 +311,7 @@ _edje_smart_show(Evas_Object * obj)
|
|||
ed = evas_object_smart_data_get(obj);
|
||||
if (!ed) return;
|
||||
if (evas_object_visible_get(obj)) return;
|
||||
if ((ed->collection) && (ed->parts))
|
||||
if ((ed->collection) && (evas_object_clipees_get(ed->clipper)))
|
||||
evas_object_show(ed->clipper);
|
||||
_edje_emit(ed, "show", "");
|
||||
}
|
||||
|
@ -324,7 +324,7 @@ _edje_smart_hide(Evas_Object * obj)
|
|||
ed = evas_object_smart_data_get(obj);
|
||||
if (!ed) return;
|
||||
if (!evas_object_visible_get(obj)) return;
|
||||
if ((ed->collection) && (ed->parts))
|
||||
if ((ed->collection) && (evas_object_clipees_get(ed->clipper)))
|
||||
evas_object_hide(ed->clipper);
|
||||
_edje_emit(ed, "hide", "");
|
||||
}
|
||||
|
|
|
@ -541,7 +541,8 @@ edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_sw
|
|||
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);
|
||||
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);
|
||||
if (evas_object_layer_get(rp->swallowed_object) != ed->layer)
|
||||
evas_object_layer_set(rp->swallowed_object, ed->layer);
|
||||
|
|
Loading…
Reference in New Issue