evas_object_main.c | evas_object_main.c | |||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
if ((!l) || (!l->objects)) return NULL; | if ((!l) || (!l->objects)) return NULL; | |||
return (EINA_INLIST_GET(l->objects)); | return (EINA_INLIST_GET(l->objects)); | |||
} | } | |||
/* evas internal stuff */ | /* evas internal stuff */ | |||
Evas_Object * | Evas_Object * | |||
evas_object_new(Evas *e __UNUSED__) | evas_object_new(Evas *e __UNUSED__) | |||
{ | { | |||
Evas_Object *obj; | Evas_Object *obj; | |||
EVAS_MEMPOOL_INIT(_mp_obj, "evas_object", Evas_Object, 512, NULL); | EVAS_MEMPOOL_INIT(_mp_obj, "evas_object", Evas_Object, 32, NULL); | |||
obj = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object); | obj = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object); | |||
if (!obj) return NULL; | if (!obj) return NULL; | |||
EVAS_MEMPOOL_PREP(_mp_obj, obj, Evas_Object); | EVAS_MEMPOOL_PREP(_mp_obj, obj, Evas_Object); | |||
obj->magic = MAGIC_OBJ; | obj->magic = MAGIC_OBJ; | |||
obj->cur.scale = 1.0; | obj->cur.scale = 1.0; | |||
obj->prev.scale = 1.0; | obj->prev.scale = 1.0; | |||
obj->is_frame = EINA_FALSE; | obj->is_frame = EINA_FALSE; | |||
return obj; | return obj; | |||
skipping to change at line 44 | skipping to change at line 44 | |||
evas_object_change_reset(Evas_Object *obj) | evas_object_change_reset(Evas_Object *obj) | |||
{ | { | |||
obj->changed = EINA_FALSE; | obj->changed = EINA_FALSE; | |||
obj->changed_move = EINA_FALSE; | obj->changed_move = EINA_FALSE; | |||
obj->changed_color = EINA_FALSE; | obj->changed_color = EINA_FALSE; | |||
obj->changed_map = EINA_FALSE; | obj->changed_map = EINA_FALSE; | |||
obj->changed_pchange = EINA_FALSE; | obj->changed_pchange = EINA_FALSE; | |||
} | } | |||
void | void | |||
evas_object_cur_prev(Evas_Object *obj) | ||||
{ | ||||
if (!obj->prev.valid_map && (obj->prev.map == obj->cur.map)) | ||||
obj->prev.map = NULL; | ||||
if (obj->cur.map != obj->prev.map) | ||||
{ | ||||
if (obj->cache_map) evas_map_free(obj->cache_map); | ||||
obj->cache_map = obj->prev.map; | ||||
} | ||||
obj->prev = obj->cur; | ||||
} | ||||
void | ||||
evas_object_free(Evas_Object *obj, int clean_layer) | evas_object_free(Evas_Object *obj, int clean_layer) | |||
{ | { | |||
int was_smart_child = 0; | int was_smart_child = 0; | |||
#if 0 // filtering disabled | #if 0 // filtering disabled | |||
evas_filter_free(obj); | evas_filter_free(obj); | |||
#endif | #endif | |||
if (!strcmp(obj->type, "image")) evas_object_image_video_surface_set(obj , NULL); | if (!strcmp(obj->type, "image")) evas_object_image_video_surface_set(obj , NULL); | |||
evas_object_map_set(obj, NULL); | evas_object_map_set(obj, NULL); | |||
if (obj->prev.map) evas_map_free(obj->prev.map); | ||||
if (obj->cache_map) evas_map_free(obj->cache_map); | ||||
evas_object_grabs_cleanup(obj); | evas_object_grabs_cleanup(obj); | |||
evas_object_intercept_cleanup(obj); | evas_object_intercept_cleanup(obj); | |||
if (obj->smart.parent) was_smart_child = 1; | if (obj->smart.parent) was_smart_child = 1; | |||
evas_object_smart_cleanup(obj); | evas_object_smart_cleanup(obj); | |||
obj->func->free(obj); | obj->func->free(obj); | |||
if (!was_smart_child) evas_object_release(obj, clean_layer); | if (!was_smart_child) evas_object_release(obj, clean_layer); | |||
if (obj->clip.clipees) | if (obj->clip.clipees) | |||
eina_list_free(obj->clip.clipees); | eina_list_free(obj->clip.clipees); | |||
evas_object_clip_changes_clean(obj); | evas_object_clip_changes_clean(obj); | |||
evas_object_event_callback_all_del(obj); | evas_object_event_callback_all_del(obj); | |||
evas_object_event_callback_cleanup(obj); | evas_object_event_callback_cleanup(obj); | |||
if (obj->spans) | ||||
{ | ||||
free(obj->spans); | ||||
obj->spans = NULL; | ||||
} | ||||
while (obj->data.elements) | while (obj->data.elements) | |||
{ | { | |||
Evas_Data_Node *node; | Evas_Data_Node *node; | |||
node = obj->data.elements->data; | node = obj->data.elements->data; | |||
obj->data.elements = eina_list_remove(obj->data.elements, node); | obj->data.elements = eina_list_remove(obj->data.elements, node); | |||
free(node); | free(node); | |||
} | } | |||
obj->magic = 0; | obj->magic = 0; | |||
if (obj->size_hints) | if (obj->size_hints) | |||
skipping to change at line 96 | skipping to change at line 117 | |||
if (obj->layer->evas->nochange) return; | if (obj->layer->evas->nochange) return; | |||
obj->layer->evas->changed = EINA_TRUE; | obj->layer->evas->changed = EINA_TRUE; | |||
if (obj->changed_move) | if (obj->changed_move) | |||
{ | { | |||
movch = EINA_TRUE; | movch = EINA_TRUE; | |||
obj->changed_move = EINA_FALSE; | obj->changed_move = EINA_FALSE; | |||
} | } | |||
if (obj->changed) return; | if (obj->changed) return; | |||
evas_render_object_recalc(obj); | evas_render_object_recalc(obj); | |||
/* set changed flag on all objects this one clips too */ | /* set changed flag on all objects this one clips too */ | |||
if (!((movch) && (obj->is_static_clip))) | if (!((movch) && (obj->is_static_clip))) | |||
{ | { | |||
EINA_LIST_FOREACH(obj->clip.clipees, l, obj2) | EINA_LIST_FOREACH(obj->clip.clipees, l, obj2) | |||
evas_object_change(obj2); | evas_object_change(obj2); | |||
} | } | |||
EINA_LIST_FOREACH(obj->proxy.proxies, l, obj2) | EINA_LIST_FOREACH(obj->proxy.proxies, l, obj2) | |||
{ | { | |||
skipping to change at line 324 | skipping to change at line 345 | |||
end: | end: | |||
EINA_ARRAY_ITER_NEXT(rects, i, r, it) | EINA_ARRAY_ITER_NEXT(rects, i, r, it) | |||
eina_rectangle_free(r); | eina_rectangle_free(r); | |||
eina_array_clean(rects); | eina_array_clean(rects); | |||
} | } | |||
int | int | |||
evas_object_was_in_output_rect(Evas_Object *obj, int x, int y, int w, int h ) | evas_object_was_in_output_rect(Evas_Object *obj, int x, int y, int w, int h ) | |||
{ | { | |||
if (obj->smart.smart) return 0; | if (obj->smart.smart && !obj->prev.map && !obj->prev.usemap) return 0; | |||
/* assumes coords have been recalced */ | /* assumes coords have been recalced */ | |||
if ((RECTS_INTERSECT(x, y, w, h, | if ((RECTS_INTERSECT(x, y, w, h, | |||
obj->prev.cache.clip.x, | obj->prev.cache.clip.x, | |||
obj->prev.cache.clip.y, | obj->prev.cache.clip.y, | |||
obj->prev.cache.clip.w, | obj->prev.cache.clip.w, | |||
obj->prev.cache.clip.h))) | obj->prev.cache.clip.h))) | |||
return 1; | return 1; | |||
return 0; | return 0; | |||
} | } | |||
skipping to change at line 410 | skipping to change at line 431 | |||
return; | return; | |||
MAGIC_CHECK_END(); | MAGIC_CHECK_END(); | |||
if (obj->delete_me) return; | if (obj->delete_me) return; | |||
if (obj->ref > 0) | if (obj->ref > 0) | |||
{ | { | |||
obj->del_ref = EINA_TRUE; | obj->del_ref = EINA_TRUE; | |||
return; | return; | |||
} | } | |||
#ifdef EVAS_FRAME_QUEUING | ||||
evas_common_frameq_flush(); | ||||
#endif | ||||
evas_object_hide(obj); | evas_object_hide(obj); | |||
if (obj->focused) | if (obj->focused) | |||
{ | { | |||
obj->focused = EINA_FALSE; | obj->focused = EINA_FALSE; | |||
obj->layer->evas->focused = NULL; | obj->layer->evas->focused = NULL; | |||
_evas_object_event_new(); | _evas_object_event_new(); | |||
evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_OUT, NULL, _evas_event_counter); | evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_OUT, NULL, _evas_event_counter); | |||
_evas_post_event_callback_call(obj->layer->evas); | _evas_post_event_callback_call(obj->layer->evas); | |||
} | } | |||
skipping to change at line 444 | skipping to change at line 462 | |||
{ | { | |||
evas_object_free(obj, 1); | evas_object_free(obj, 1); | |||
return; | return; | |||
} | } | |||
evas_object_grabs_cleanup(obj); | evas_object_grabs_cleanup(obj); | |||
while (obj->clip.clipees) | while (obj->clip.clipees) | |||
evas_object_clip_unset(obj->clip.clipees->data); | evas_object_clip_unset(obj->clip.clipees->data); | |||
while (obj->proxy.proxies) | while (obj->proxy.proxies) | |||
evas_object_image_source_unset(obj->proxy.proxies->data); | evas_object_image_source_unset(obj->proxy.proxies->data); | |||
if (obj->cur.clipper) evas_object_clip_unset(obj); | if (obj->cur.clipper) evas_object_clip_unset(obj); | |||
if (obj->smart.smart) evas_object_smart_del(obj); | ||||
evas_object_map_set(obj, NULL); | evas_object_map_set(obj, NULL); | |||
if (obj->smart.smart) evas_object_smart_del(obj); | ||||
_evas_object_event_new(); | _evas_object_event_new(); | |||
evas_object_event_callback_call(obj, EVAS_CALLBACK_FREE, NULL, _evas_eve nt_counter); | evas_object_event_callback_call(obj, EVAS_CALLBACK_FREE, NULL, _evas_eve nt_counter); | |||
_evas_post_event_callback_call(obj->layer->evas); | _evas_post_event_callback_call(obj->layer->evas); | |||
evas_object_smart_cleanup(obj); | evas_object_smart_cleanup(obj); | |||
obj->delete_me = 1; | obj->delete_me = 1; | |||
evas_object_change(obj); | evas_object_change(obj); | |||
} | } | |||
void | ||||
evas_object_update_bounding_box(Evas_Object *obj) | ||||
{ | ||||
Eina_Bool propagate = EINA_FALSE; | ||||
Eina_Bool computeminmax = EINA_FALSE; | ||||
Evas_Coord x, y, w, h; | ||||
Evas_Coord px, py, pw, ph; | ||||
Eina_Bool noclip; | ||||
if (!obj->smart.parent) return ; | ||||
if (obj->child_has_map) return ; /* Disable bounding box computation for | ||||
this object and its parent */ | ||||
/* We could also remove object that are not visible from the bounding bo | ||||
x, use the clipping information | ||||
to reduce the bounding of the object they are clipping, but for the m | ||||
oment this will do it's jobs */ | ||||
noclip = !(obj->clip.clipees || obj->is_static_clip); | ||||
if (obj->smart.smart) | ||||
{ | ||||
x = obj->cur.bounding_box.x; | ||||
y = obj->cur.bounding_box.y; | ||||
w = obj->cur.bounding_box.w; | ||||
h = obj->cur.bounding_box.h; | ||||
px = obj->prev.bounding_box.x; | ||||
py = obj->prev.bounding_box.y; | ||||
pw = obj->prev.bounding_box.w; | ||||
ph = obj->prev.bounding_box.h; | ||||
} | ||||
else | ||||
{ | ||||
x = obj->cur.geometry.x; | ||||
y = obj->cur.geometry.y; | ||||
w = obj->cur.geometry.w; | ||||
h = obj->cur.geometry.h; | ||||
px = obj->prev.geometry.x; | ||||
py = obj->prev.geometry.y; | ||||
pw = obj->prev.geometry.w; | ||||
ph = obj->prev.geometry.h; | ||||
} | ||||
/* We are not yet trying to find the smallest bounding box, but we want | ||||
to find a good approximation quickly. | ||||
* That's why we initialiaze min and max search to geometry of the paren | ||||
t object. | ||||
*/ | ||||
if (obj->smart.parent->cur.valid_bounding_box) | ||||
{ | ||||
/* Update left limit */ | ||||
if (noclip && x < obj->smart.parent->cur.bounding_box.x) | ||||
{ | ||||
obj->smart.parent->cur.bounding_box.w += obj->smart.parent->cu | ||||
r.bounding_box.x - x; | ||||
obj->smart.parent->cur.bounding_box.x = x; | ||||
propagate = EINA_TRUE; | ||||
} | ||||
else if ((px == obj->smart.parent->prev.bounding_box.x && x > obj-> | ||||
smart.parent->cur.bounding_box.x) | ||||
|| (!noclip && x == obj->smart.parent->cur.bounding_box.x) | ||||
) | ||||
{ | ||||
computeminmax = EINA_TRUE; | ||||
} | ||||
/* Update top limit */ | ||||
if (noclip && y < obj->smart.parent->cur.bounding_box.y) | ||||
{ | ||||
obj->smart.parent->cur.bounding_box.h += obj->smart.parent->cu | ||||
r.bounding_box.x - x; | ||||
obj->smart.parent->cur.bounding_box.y = y; | ||||
propagate = EINA_TRUE; | ||||
} | ||||
else if ((py == obj->smart.parent->prev.bounding_box.y && y > obj- | ||||
>smart.parent->cur.bounding_box.y) | ||||
|| (!noclip && y == obj->smart.parent->cur.bounding_box.y) | ||||
) | ||||
{ | ||||
computeminmax = EINA_TRUE; | ||||
} | ||||
/* Update right limit */ | ||||
if (noclip && x + w > obj->smart.parent->cur.bounding_box.x + obj-> | ||||
smart.parent->cur.bounding_box.w) | ||||
{ | ||||
obj->smart.parent->cur.bounding_box.w = x + w - obj->smart.par | ||||
ent->cur.bounding_box.x; | ||||
propagate = EINA_TRUE; | ||||
} | ||||
else if ((px + pw == obj->smart.parent->prev.bounding_box.x + obj-> | ||||
smart.parent->prev.bounding_box.w && | ||||
x + w < obj->smart.parent->cur.bounding_box.x + obj->smar | ||||
t.parent->cur.bounding_box.w) | ||||
|| (!noclip && x + w == obj->smart.parent->cur.bounding_bo | ||||
x.x + obj->smart.parent->cur.bounding_box.w)) | ||||
{ | ||||
computeminmax = EINA_TRUE; | ||||
} | ||||
/* Update bottom limit */ | ||||
if (noclip && y + h > obj->smart.parent->cur.bounding_box.y + obj-> | ||||
smart.parent->cur.bounding_box.h) | ||||
{ | ||||
obj->smart.parent->cur.bounding_box.h = y + h - obj->smart.par | ||||
ent->cur.bounding_box.y; | ||||
propagate = EINA_TRUE; | ||||
} | ||||
else if ((py + ph == obj->smart.parent->prev.bounding_box.y + obj-> | ||||
smart.parent->prev.bounding_box.h && | ||||
y + h < obj->smart.parent->cur.bounding_box.y + obj->smar | ||||
t.parent->cur.bounding_box.h) || | ||||
(!noclip && y + h == obj->smart.parent->cur.bounding_box.y | ||||
+ obj->smart.parent->cur.bounding_box.h)) | ||||
{ | ||||
computeminmax = EINA_TRUE; | ||||
} | ||||
if (computeminmax) | ||||
{ | ||||
evas_object_smart_need_bounding_box_update(obj->smart.parent); | ||||
} | ||||
} | ||||
else | ||||
{ | ||||
if (noclip) | ||||
{ | ||||
obj->smart.parent->cur.bounding_box.x = x; | ||||
obj->smart.parent->cur.bounding_box.y = y; | ||||
obj->smart.parent->cur.bounding_box.w = w; | ||||
obj->smart.parent->cur.bounding_box.h = h; | ||||
obj->smart.parent->cur.valid_bounding_box = EINA_TRUE; | ||||
propagate = EINA_TRUE; | ||||
} | ||||
} | ||||
if (propagate) | ||||
evas_object_update_bounding_box(obj->smart.parent); | ||||
} | ||||
EAPI void | EAPI void | |||
evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) | evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) | |||
{ | { | |||
int is, was = 0, pass = 0, freeze = 0; | int is, was = 0, pass = 0, freeze = 0; | |||
int nx = 0, ny = 0; | int nx = 0, ny = 0; | |||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | |||
return; | return; | |||
MAGIC_CHECK_END(); | MAGIC_CHECK_END(); | |||
if (obj->delete_me) return; | if (obj->delete_me) return; | |||
nx = x; | nx = x; | |||
ny = y; | ny = y; | |||
if (!obj->is_frame) | if (!obj->is_frame) | |||
{ | { | |||
int fx, fy; | if ((!obj->smart.parent) && (obj->smart.smart)) | |||
evas_output_framespace_get(obj->layer->evas, &fx, &fy, NULL, NULL); | ||||
if (!obj->smart.parent) | ||||
{ | { | |||
int fx, fy; | ||||
evas_output_framespace_get(obj->layer->evas, | ||||
&fx, &fy, NULL, NULL); | ||||
nx += fx; | nx += fx; | |||
ny += fy; | ny += fy; | |||
} | } | |||
} | } | |||
if (evas_object_intercept_call_move(obj, nx, ny)) return; | if (evas_object_intercept_call_move(obj, nx, ny)) return; | |||
if (obj->doing.in_move > 0) | if (obj->doing.in_move > 0) | |||
{ | { | |||
WRN("evas_object_move() called on object %p when in the middle of m oving the same object", obj); | WRN("evas_object_move() called on object %p when in the middle of m oving the same object", obj); | |||
skipping to change at line 510 | skipping to change at line 647 | |||
if (obj->smart.smart) | if (obj->smart.smart) | |||
{ | { | |||
if (obj->smart.smart->smart_class->move) | if (obj->smart.smart->smart_class->move) | |||
obj->smart.smart->smart_class->move(obj, nx, ny); | obj->smart.smart->smart_class->move(obj, nx, ny); | |||
} | } | |||
obj->cur.geometry.x = nx; | obj->cur.geometry.x = nx; | |||
obj->cur.geometry.y = ny; | obj->cur.geometry.y = ny; | |||
evas_object_update_bounding_box(obj); | ||||
//// obj->cur.cache.geometry.validity = 0; | //// obj->cur.cache.geometry.validity = 0; | |||
obj->changed_move = EINA_TRUE; | obj->changed_move = EINA_TRUE; | |||
evas_object_change(obj); | evas_object_change(obj); | |||
evas_object_clip_dirty(obj); | evas_object_clip_dirty(obj); | |||
obj->doing.in_move--; | obj->doing.in_move--; | |||
if (obj->layer->evas->events_frozen <= 0) | if (obj->layer->evas->events_frozen <= 0) | |||
{ | { | |||
evas_object_recalc_clippees(obj); | evas_object_recalc_clippees(obj); | |||
if (!pass) | if (!pass) | |||
{ | { | |||
skipping to change at line 541 | skipping to change at line 680 | |||
} | } | |||
} | } | |||
} | } | |||
evas_object_inform_call_move(obj); | evas_object_inform_call_move(obj); | |||
} | } | |||
EAPI void | EAPI void | |||
evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) | evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) | |||
{ | { | |||
int is, was = 0, pass = 0, freeze =0; | int is, was = 0, pass = 0, freeze =0; | |||
int nw = 0, nh = 0; | ||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | |||
return; | return; | |||
MAGIC_CHECK_END(); | MAGIC_CHECK_END(); | |||
if (obj->delete_me) return; | if (obj->delete_me) return; | |||
if (w < 0) w = 0; if (h < 0) h = 0; | if (w < 0) w = 0; if (h < 0) h = 0; | |||
nw = w; | if (evas_object_intercept_call_resize(obj, w, h)) return; | |||
nh = h; | ||||
if (!obj->is_frame) | ||||
{ | ||||
int fw, fh; | ||||
evas_output_framespace_get(obj->layer->evas, NULL, NULL, &fw, &fh); | ||||
if (!obj->smart.parent) | ||||
{ | ||||
nw = w - fw; | ||||
nh = h - fh; | ||||
if (nw < 0) nw = 0; | ||||
if (nh < 0) nh = 0; | ||||
} | ||||
} | ||||
if (evas_object_intercept_call_resize(obj, nw, nh)) return; | ||||
if (obj->doing.in_resize > 0) | if (obj->doing.in_resize > 0) | |||
{ | { | |||
WRN("evas_object_resize() called on object %p when in the middle of resizing the same object", obj); | WRN("evas_object_resize() called on object %p when in the middle of resizing the same object", obj); | |||
return; | return; | |||
} | } | |||
if ((obj->cur.geometry.w == nw) && (obj->cur.geometry.h == nh)) return; | if ((obj->cur.geometry.w == w) && (obj->cur.geometry.h == h)) return; | |||
if (obj->layer->evas->events_frozen <= 0) | if (obj->layer->evas->events_frozen <= 0) | |||
{ | { | |||
pass = evas_event_passes_through(obj); | pass = evas_event_passes_through(obj); | |||
freeze = evas_event_freezes_through(obj); | freeze = evas_event_freezes_through(obj); | |||
if ((!pass) && (!freeze)) | if ((!pass) && (!freeze)) | |||
was = evas_object_is_in_output_rect(obj, | was = evas_object_is_in_output_rect(obj, | |||
obj->layer->evas->pointer.x, | obj->layer->evas->pointer.x, | |||
obj->layer->evas->pointer.y, 1, 1); | obj->layer->evas->pointer.y, 1, 1); | |||
} | } | |||
obj->doing.in_resize++; | obj->doing.in_resize++; | |||
if (obj->smart.smart) | if (obj->smart.smart) | |||
{ | { | |||
if (obj->smart.smart->smart_class->resize) | if (obj->smart.smart->smart_class->resize) | |||
obj->smart.smart->smart_class->resize(obj, nw, nh); | obj->smart.smart->smart_class->resize(obj, w, h); | |||
} | } | |||
obj->cur.geometry.w = nw; | obj->cur.geometry.w = w; | |||
obj->cur.geometry.h = nh; | obj->cur.geometry.h = h; | |||
evas_object_update_bounding_box(obj); | ||||
//// obj->cur.cache.geometry.validity = 0; | //// obj->cur.cache.geometry.validity = 0; | |||
evas_object_change(obj); | evas_object_change(obj); | |||
evas_object_clip_dirty(obj); | evas_object_clip_dirty(obj); | |||
obj->doing.in_resize--; | obj->doing.in_resize--; | |||
/* NB: evas_object_recalc_clippees was here previously ( < 08/07/2009) * / | /* NB: evas_object_recalc_clippees was here previously ( < 08/07/2009) * / | |||
if (obj->layer->evas->events_frozen <= 0) | if (obj->layer->evas->events_frozen <= 0) | |||
{ | { | |||
/* NB: If this creates glitches on screen then move to above positi on */ | /* NB: If this creates glitches on screen then move to above positi on */ | |||
evas_object_recalc_clippees(obj); | evas_object_recalc_clippees(obj); | |||
skipping to change at line 628 | skipping to change at line 752 | |||
NULL); | NULL); | |||
} | } | |||
} | } | |||
} | } | |||
evas_object_inform_call_resize(obj); | evas_object_inform_call_resize(obj); | |||
} | } | |||
EAPI void | EAPI void | |||
evas_object_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) | evas_object_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) | |||
{ | { | |||
int nx = 0, ny = 0; | ||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | |||
if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0; | if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0; | |||
return; | return; | |||
MAGIC_CHECK_END(); | MAGIC_CHECK_END(); | |||
if (obj->delete_me) | if (obj->delete_me) | |||
{ | { | |||
if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0; | if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0; | |||
return; | return; | |||
} | } | |||
if (x) *x = obj->cur.geometry.x; | nx = obj->cur.geometry.x; | |||
if (y) *y = obj->cur.geometry.y; | ny = obj->cur.geometry.y; | |||
if (!obj->is_frame) | ||||
{ | ||||
if ((!obj->smart.parent) && (obj->smart.smart)) | ||||
{ | ||||
int fx, fy; | ||||
evas_output_framespace_get(obj->layer->evas, | ||||
&fx, &fy, NULL, NULL); | ||||
if (nx > 0) nx -= fx; | ||||
if (ny > 0) ny -= fy; | ||||
} | ||||
} | ||||
if (x) *x = nx; | ||||
if (y) *y = ny; | ||||
if (w) *w = obj->cur.geometry.w; | if (w) *w = obj->cur.geometry.w; | |||
if (h) *h = obj->cur.geometry.h; | if (h) *h = obj->cur.geometry.h; | |||
} | } | |||
static void | static void | |||
_evas_object_size_hint_alloc(Evas_Object *obj) | _evas_object_size_hint_alloc(Evas_Object *obj) | |||
{ | { | |||
if (obj->size_hints) return; | if (obj->size_hints) return; | |||
EVAS_MEMPOOL_INIT(_mp_sh, "evas_size_hints", Evas_Size_Hints, 512, ); | EVAS_MEMPOOL_INIT(_mp_sh, "evas_size_hints", Evas_Size_Hints, 32, ); | |||
obj->size_hints = EVAS_MEMPOOL_ALLOC(_mp_sh, Evas_Size_Hints); | obj->size_hints = EVAS_MEMPOOL_ALLOC(_mp_sh, Evas_Size_Hints); | |||
if (!obj->size_hints) return; | if (!obj->size_hints) return; | |||
EVAS_MEMPOOL_PREP(_mp_sh, obj->size_hints, Evas_Size_Hints); | EVAS_MEMPOOL_PREP(_mp_sh, obj->size_hints, Evas_Size_Hints); | |||
obj->size_hints->max.w = -1; | obj->size_hints->max.w = -1; | |||
obj->size_hints->max.h = -1; | obj->size_hints->max.h = -1; | |||
obj->size_hints->align.x = 0.5; | obj->size_hints->align.x = 0.5; | |||
obj->size_hints->align.y = 0.5; | obj->size_hints->align.y = 0.5; | |||
} | } | |||
EAPI void | EAPI void | |||
End of changes. 21 change blocks. | ||||
36 lines changed or deleted | 199 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |