sync with private
[profile/ivi/evas.git] / src / lib / canvas / evas_object_main.c
1 #include "evas_common.h"
2 #include "evas_private.h"
3
4 EVAS_MEMPOOL(_mp_obj);
5 EVAS_MEMPOOL(_mp_sh);
6
7 static Eina_Inlist *
8 get_layer_objects(Evas_Layer *l)
9 {
10    if ((!l) || (!l->objects)) return NULL;
11    return (EINA_INLIST_GET(l->objects));
12 }
13
14 /* evas internal stuff */
15 Evas_Object *
16 evas_object_new(Evas *e __UNUSED__)
17 {
18    Evas_Object *obj;
19
20    EVAS_MEMPOOL_INIT(_mp_obj, "evas_object", Evas_Object, 32, NULL);
21    obj = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object);
22    if (!obj) return NULL;
23    EVAS_MEMPOOL_PREP(_mp_obj, obj, Evas_Object);
24
25    obj->magic = MAGIC_OBJ;
26    obj->cur.scale = 1.0;
27    obj->prev.scale = 1.0;
28    obj->is_frame = EINA_FALSE;
29
30    return obj;
31 }
32
33 void
34 evas_object_change_reset(Evas_Object *obj)
35 {
36    obj->changed = EINA_FALSE;
37    obj->changed_move = EINA_FALSE;
38    obj->changed_color = EINA_FALSE;
39    obj->changed_map = EINA_FALSE;
40    obj->changed_pchange = EINA_FALSE;
41 }
42
43 void
44 evas_object_cur_prev(Evas_Object *obj)
45 {
46    if (!obj->prev.valid_map && (obj->prev.map == obj->cur.map))
47      obj->prev.map = NULL;
48
49    if (obj->cur.map != obj->prev.map)
50      {
51         if (obj->cache_map) evas_map_free(obj->cache_map);
52         obj->cache_map = obj->prev.map;
53      }
54    obj->prev = obj->cur;
55 }
56
57 void
58 evas_object_free(Evas_Object *obj, int clean_layer)
59 {
60    int was_smart_child = 0;
61
62 #if 0 // filtering disabled
63    evas_filter_free(obj);
64 #endif
65    if (!strcmp(obj->type, "image")) evas_object_image_video_surface_set(obj, NULL);
66    evas_object_map_set(obj, NULL);
67    if (obj->prev.map) evas_map_free(obj->prev.map);
68    if (obj->cache_map) evas_map_free(obj->cache_map);
69    evas_object_grabs_cleanup(obj);
70    evas_object_intercept_cleanup(obj);
71    if (obj->smart.parent) was_smart_child = 1;
72    evas_object_smart_cleanup(obj);
73    obj->func->free(obj);
74    if (!was_smart_child) evas_object_release(obj, clean_layer);
75    if (obj->clip.clipees)
76      eina_list_free(obj->clip.clipees);
77    evas_object_clip_changes_clean(obj);
78    evas_object_event_callback_all_del(obj);
79    evas_object_event_callback_cleanup(obj);
80    while (obj->data.elements)
81      {
82         Evas_Data_Node *node;
83
84         node = obj->data.elements->data;
85         obj->data.elements = eina_list_remove(obj->data.elements, node);
86         free(node);
87      }
88    obj->magic = 0;
89    if (obj->size_hints)
90      {
91        EVAS_MEMPOOL_FREE(_mp_sh, obj->size_hints);
92      }
93    EVAS_MEMPOOL_FREE(_mp_obj, obj);
94 }
95
96 void
97 evas_object_change(Evas_Object *obj)
98 {
99    Eina_List *l;
100    Evas_Object *obj2;
101    Eina_Bool movch = EINA_FALSE;
102
103    if (obj->layer->evas->nochange) return;
104    obj->layer->evas->changed = EINA_TRUE;
105
106    if (obj->changed_move)
107      {
108         movch = EINA_TRUE;
109         obj->changed_move = EINA_FALSE;
110      }
111
112    if (obj->changed) return;
113
114    evas_render_object_recalc(obj);
115    /* set changed flag on all objects this one clips too */
116    if (!((movch) && (obj->is_static_clip)))
117      {
118         EINA_LIST_FOREACH(obj->clip.clipees, l, obj2)
119           evas_object_change(obj2);
120      }
121    EINA_LIST_FOREACH(obj->proxy.proxies, l, obj2)
122      {
123         evas_object_change(obj2);
124      }
125    if (obj->smart.parent) evas_object_change(obj->smart.parent);
126 }
127
128 void
129 evas_object_render_pre_visible_change(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v)
130 {
131    if (obj->smart.smart) return;
132    if (is_v == was_v) return;
133    if (is_v)
134      {
135         evas_add_rect(rects,
136                       obj->cur.cache.clip.x,
137                       obj->cur.cache.clip.y,
138                       obj->cur.cache.clip.w,
139                       obj->cur.cache.clip.h);
140      }
141    else
142      {
143         evas_add_rect(rects,
144                       obj->prev.cache.clip.x,
145                       obj->prev.cache.clip.y,
146                       obj->prev.cache.clip.w,
147                       obj->prev.cache.clip.h);
148      }
149 }
150
151 void
152 evas_object_render_pre_clipper_change(Eina_Array *rects, Evas_Object *obj)
153 {
154    if (obj->smart.smart) return;
155    if (obj->cur.clipper == obj->prev.clipper) return;
156    if ((obj->cur.clipper) && (obj->prev.clipper))
157      {
158         /* get difference rects between clippers */
159         evas_rects_return_difference_rects(rects,
160                                            obj->cur.clipper->cur.cache.clip.x,
161                                            obj->cur.clipper->cur.cache.clip.y,
162                                            obj->cur.clipper->cur.cache.clip.w,
163                                            obj->cur.clipper->cur.cache.clip.h,
164                                            obj->prev.clipper->prev.cache.clip.x,
165                                            obj->prev.clipper->prev.cache.clip.y,
166                                            obj->prev.clipper->prev.cache.clip.w,
167                                            obj->prev.clipper->prev.cache.clip.h);
168      }
169    else if (obj->cur.clipper)
170      {
171         evas_rects_return_difference_rects(rects,
172                                            obj->cur.geometry.x,
173                                            obj->cur.geometry.y,
174                                            obj->cur.geometry.w,
175                                            obj->cur.geometry.h,
176 ////    rl = evas_rects_return_difference_rects(obj->cur.cache.geometry.x,
177 ////                                            obj->cur.cache.geometry.y,
178 ////                                            obj->cur.cache.geometry.w,
179 ////                                            obj->cur.cache.geometry.h,
180                                            obj->cur.clipper->cur.cache.clip.x,
181                                            obj->cur.clipper->cur.cache.clip.y,
182                                            obj->cur.clipper->cur.cache.clip.w,
183                                            obj->cur.clipper->cur.cache.clip.h);
184      }
185    else if (obj->prev.clipper)
186      {
187      evas_rects_return_difference_rects(rects,
188                                         obj->prev.geometry.x,
189                                         obj->prev.geometry.y,
190                                         obj->prev.geometry.w,
191                                         obj->prev.geometry.h,
192 ////    rl = evas_rects_return_difference_rects(obj->prev.cache.geometry.x,
193 ////                                            obj->prev.cache.geometry.y,
194 ////                                            obj->prev.cache.geometry.w,
195 ////                                            obj->prev.cache.geometry.h,
196                                         obj->prev.clipper->prev.cache.clip.x,
197                                         obj->prev.clipper->prev.cache.clip.y,
198                                         obj->prev.clipper->prev.cache.clip.w,
199                                         obj->prev.clipper->prev.cache.clip.h);
200      }
201 }
202
203 void
204 evas_object_render_pre_prev_cur_add(Eina_Array *rects, Evas_Object *obj)
205 {
206    evas_add_rect(rects,
207                  obj->cur.cache.clip.x,
208                  obj->cur.cache.clip.y,
209                  obj->cur.cache.clip.w,
210                  obj->cur.cache.clip.h);
211    evas_add_rect(rects,
212                  obj->prev.cache.clip.x,
213                  obj->prev.cache.clip.y,
214                  obj->prev.cache.clip.w,
215                  obj->prev.cache.clip.h);
216 /*
217         evas_add_rect(rects,
218                       obj->cur.geometry.x,
219                       obj->cur.geometry.y,
220                       obj->cur.geometry.w,
221                       obj->cur.geometry.h);
222 ////        obj->cur.cache.geometry.x,
223 ////        obj->cur.cache.geometry.y,
224 ////        obj->cur.cache.geometry.w,
225 ////        obj->cur.cache.geometry.h);
226         evas_add_rect(rects,
227                       obj->prev.geometry.x,
228                       obj->prev.geometry.y,
229                       obj->prev.geometry.w,
230                       obj->prev.geometry.h);
231 ////        obj->prev.cache.geometry.x,
232 ////        obj->prev.cache.geometry.y,
233 ////        obj->prev.cache.geometry.w,
234 ////        obj->prev.cache.geometry.h);
235 */
236 }
237
238 void
239 evas_object_clip_changes_clean(Evas_Object *obj)
240 {
241    Eina_Rectangle *r;
242
243    EINA_LIST_FREE(obj->clip.changes, r)
244      eina_rectangle_free(r);
245 }
246
247 void
248 evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v __UNUSED__)
249 {
250    Eina_Rectangle *r;
251    Evas_Object *clipper;
252    Eina_List *l;
253    unsigned int i;
254    Eina_Array_Iterator it;
255    int x, y, w, h;
256
257    if (obj->smart.smart) goto end;
258    /* FIXME: was_v isn't used... why? */
259    if (!obj->clip.clipees)
260      {
261         EINA_ARRAY_ITER_NEXT(rects, i, r, it)
262           {
263              /* get updates and clip to current clip */
264              x = r->x;
265              y = r->y;
266              w = r->w;
267              h = r->h;
268              RECTS_CLIP_TO_RECT(x, y, w, h,
269                                 obj->cur.cache.clip.x,
270                                 obj->cur.cache.clip.y,
271                                 obj->cur.cache.clip.w,
272                                 obj->cur.cache.clip.h);
273              if ((w > 0) && (h > 0))
274                obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
275                                                                       x, y, w, h);
276              /* get updates and clip to previous clip */
277              x = r->x;
278              y = r->y;
279              w = r->w;
280              h = r->h;
281              RECTS_CLIP_TO_RECT(x, y, w, h,
282                                 obj->prev.cache.clip.x,
283                                 obj->prev.cache.clip.y,
284                                 obj->prev.cache.clip.w,
285                                 obj->prev.cache.clip.h);
286              if ((w > 0) && (h > 0))
287                obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
288                                                                       x, y, w, h);
289           }
290         /* if the object is actually visible, take any parent clip changes */
291         if (is_v)
292           {
293              clipper = obj->cur.clipper;
294              while (clipper)
295                {
296                   EINA_LIST_FOREACH(clipper->clip.changes, l, r)
297                     {
298                        /* get updates and clip to current clip */
299                        x = r->x; y = r->y; w = r->w; h = r->h;
300                        RECTS_CLIP_TO_RECT(x, y, w, h,
301                                           obj->cur.cache.clip.x,
302                                           obj->cur.cache.clip.y,
303                                           obj->cur.cache.clip.w,
304                                           obj->cur.cache.clip.h);
305                        if ((w > 0) && (h > 0))
306                          obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
307                                                                                 x, y, w, h);
308                        /* get updates and clip to previous clip */
309                        x = r->x; y = r->y; w = r->w; h = r->h;
310                        RECTS_CLIP_TO_RECT(x, y, w, h,
311                                           obj->prev.cache.clip.x,
312                                           obj->prev.cache.clip.y,
313                                           obj->prev.cache.clip.w,
314                                           obj->prev.cache.clip.h);
315                        if ((w > 0) && (h > 0))
316                          obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
317                                                                                 x, y, w, h);
318                     }
319                   clipper = clipper->cur.clipper;
320                }
321           }
322      }
323    else
324      {
325         evas_object_clip_changes_clean(obj);
326         EINA_ARRAY_ITER_NEXT(rects, i, r, it)
327            obj->clip.changes = eina_list_append(obj->clip.changes, r);
328         eina_array_clean(rects);
329      }
330
331  end:
332    EINA_ARRAY_ITER_NEXT(rects, i, r, it)
333      eina_rectangle_free(r);
334    eina_array_clean(rects);
335 }
336
337 int
338 evas_object_was_in_output_rect(Evas_Object *obj, int x, int y, int w, int h)
339 {
340    if (obj->smart.smart && !obj->prev.map && !obj->prev.usemap) return 0;
341    /* assumes coords have been recalced */
342    if ((RECTS_INTERSECT(x, y, w, h,
343                         obj->prev.cache.clip.x,
344                         obj->prev.cache.clip.y,
345                         obj->prev.cache.clip.w,
346                         obj->prev.cache.clip.h)))
347      return 1;
348    return 0;
349 }
350
351 int
352 evas_object_was_opaque(Evas_Object *obj)
353 {
354    if (obj->smart.smart) return 0;
355    if (obj->prev.cache.clip.a == 255)
356      {
357         if (obj->func->was_opaque)
358           return obj->func->was_opaque(obj);
359         return 1;
360      }
361    return 0;
362 }
363
364 int
365 evas_object_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
366 {
367    if (obj->smart.smart) return 0;
368    if (obj->func->is_inside)
369      return obj->func->is_inside(obj, x, y);
370    return 0;
371 }
372
373 int
374 evas_object_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
375 {
376    if (obj->smart.smart) return 0;
377    if (obj->func->was_inside)
378      return obj->func->was_inside(obj, x, y);
379    return 0;
380 }
381 /* routines apps will call */
382
383 EAPI void
384 evas_object_ref(Evas_Object *obj)
385 {
386    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
387    return;
388    MAGIC_CHECK_END();
389    obj->ref++;
390 }
391
392 EAPI void
393 evas_object_unref(Evas_Object *obj)
394 {
395    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
396    return;
397    MAGIC_CHECK_END();
398    if (obj->ref == 0) return;
399    obj->ref--;
400    if ((obj->del_ref) && (obj->ref == 0)) evas_object_del(obj);
401 }
402
403 EAPI int
404 evas_object_ref_get(const Evas_Object *obj)
405 {
406    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
407    return 0;
408    MAGIC_CHECK_END();
409    return obj->ref;
410 }
411
412 EAPI void
413 evas_object_del(Evas_Object *obj)
414 {
415    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
416    return;
417    MAGIC_CHECK_END();
418
419    if (obj->delete_me) return;
420
421    if (obj->ref > 0)
422      {
423         obj->del_ref = EINA_TRUE;
424         return;
425      }
426
427    evas_object_hide(obj);
428    if (obj->focused)
429      {
430         obj->focused = EINA_FALSE;
431         obj->layer->evas->focused = NULL;
432         _evas_object_event_new();
433         evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_OUT, NULL, _evas_event_counter);
434         _evas_post_event_callback_call(obj->layer->evas);
435      }
436    _evas_object_event_new();
437    evas_object_event_callback_call(obj, EVAS_CALLBACK_DEL, NULL, _evas_event_counter);
438    _evas_post_event_callback_call(obj->layer->evas);
439    if (obj->mouse_grabbed > 0)
440       obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
441    if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
442       obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, obj);
443    obj->mouse_grabbed = 0;
444    obj->mouse_in = 0;
445    if (obj->name) evas_object_name_set(obj, NULL);
446    if (!obj->layer)
447      {
448         evas_object_free(obj, 1);
449         return;
450      }
451    evas_object_grabs_cleanup(obj);
452    while (obj->clip.clipees)
453      evas_object_clip_unset(obj->clip.clipees->data);
454    while (obj->proxy.proxies)
455      evas_object_image_source_unset(obj->proxy.proxies->data);
456    if (obj->cur.clipper) evas_object_clip_unset(obj);
457    evas_object_map_set(obj, NULL);
458    if (obj->smart.smart) evas_object_smart_del(obj);
459    _evas_object_event_new();
460    evas_object_event_callback_call(obj, EVAS_CALLBACK_FREE, NULL, _evas_event_counter);
461    _evas_post_event_callback_call(obj->layer->evas);
462    evas_object_smart_cleanup(obj);
463    obj->delete_me = 1;
464    evas_object_change(obj);
465 }
466
467 void
468 evas_object_update_bounding_box(Evas_Object *obj)
469 {
470    Eina_Bool propagate = EINA_FALSE;
471    Eina_Bool computeminmax = EINA_FALSE;
472    Evas_Coord x, y, w, h;
473    Evas_Coord px, py, pw, ph;
474    Eina_Bool noclip;
475
476    if (!obj->smart.parent) return ;
477    if (obj->child_has_map) return ; /* Disable bounding box computation for this object and its parent */
478    /* We could also remove object that are not visible from the bounding box, use the clipping information
479       to reduce the bounding of the object they are clipping, but for the moment this will do it's jobs */
480    noclip = !(obj->clip.clipees || obj->is_static_clip);
481
482    if (obj->smart.smart)
483      {
484         x = obj->cur.bounding_box.x;
485         y = obj->cur.bounding_box.y;
486         w = obj->cur.bounding_box.w;
487         h = obj->cur.bounding_box.h;
488         px = obj->prev.bounding_box.x;
489         py = obj->prev.bounding_box.y;
490         pw = obj->prev.bounding_box.w;
491         ph = obj->prev.bounding_box.h;
492      }
493    else
494      {
495         x = obj->cur.geometry.x;
496         y = obj->cur.geometry.y;
497         w = obj->cur.geometry.w;
498         h = obj->cur.geometry.h;
499         px = obj->prev.geometry.x;
500         py = obj->prev.geometry.y;
501         pw = obj->prev.geometry.w;
502         ph = obj->prev.geometry.h;
503      }
504
505    /* We are not yet trying to find the smallest bounding box, but we want to find a good approximation quickly.
506     * That's why we initialiaze min and max search to geometry of the parent object.
507     */
508
509    if (obj->smart.parent->cur.valid_bounding_box)
510      {
511         /* Update left limit */
512         if (noclip && x < obj->smart.parent->cur.bounding_box.x)
513           {
514              obj->smart.parent->cur.bounding_box.w += obj->smart.parent->cur.bounding_box.x - x;
515              obj->smart.parent->cur.bounding_box.x = x;
516              propagate = EINA_TRUE;
517           }
518         else if ((px == obj->smart.parent->prev.bounding_box.x && x > obj->smart.parent->cur.bounding_box.x)
519                  || (!noclip && x == obj->smart.parent->cur.bounding_box.x))
520           {
521              computeminmax = EINA_TRUE;
522           }
523
524         /* Update top limit */
525         if (noclip && y < obj->smart.parent->cur.bounding_box.y)
526           {
527              obj->smart.parent->cur.bounding_box.h += obj->smart.parent->cur.bounding_box.x - x;
528              obj->smart.parent->cur.bounding_box.y = y;
529              propagate = EINA_TRUE;
530           }
531         else if ((py == obj->smart.parent->prev.bounding_box.y && y  > obj->smart.parent->cur.bounding_box.y)
532                  || (!noclip && y == obj->smart.parent->cur.bounding_box.y))
533           {
534              computeminmax = EINA_TRUE;
535           }
536
537         /* Update right limit */
538         if (noclip && x + w > obj->smart.parent->cur.bounding_box.x + obj->smart.parent->cur.bounding_box.w)
539           {
540              obj->smart.parent->cur.bounding_box.w = x + w - obj->smart.parent->cur.bounding_box.x;
541              propagate = EINA_TRUE;
542           }
543         else if ((px + pw == obj->smart.parent->prev.bounding_box.x + obj->smart.parent->prev.bounding_box.w &&
544                   x + w < obj->smart.parent->cur.bounding_box.x + obj->smart.parent->cur.bounding_box.w)
545                  || (!noclip && x + w == obj->smart.parent->cur.bounding_box.x + obj->smart.parent->cur.bounding_box.w))
546           {
547              computeminmax = EINA_TRUE;
548           }
549
550         /* Update bottom limit */
551         if (noclip && y + h > obj->smart.parent->cur.bounding_box.y + obj->smart.parent->cur.bounding_box.h)
552           {
553              obj->smart.parent->cur.bounding_box.h = y + h - obj->smart.parent->cur.bounding_box.y;
554              propagate = EINA_TRUE;
555           }
556         else if ((py + ph == obj->smart.parent->prev.bounding_box.y + obj->smart.parent->prev.bounding_box.h &&
557                   y + h < obj->smart.parent->cur.bounding_box.y + obj->smart.parent->cur.bounding_box.h) ||
558                  (!noclip && y + h == obj->smart.parent->cur.bounding_box.y + obj->smart.parent->cur.bounding_box.h))
559           {
560              computeminmax = EINA_TRUE;
561           }
562
563         if (computeminmax)
564           {
565              evas_object_smart_need_bounding_box_update(obj->smart.parent);
566           }
567      }
568    else
569      {
570         if (noclip)
571           {
572              obj->smart.parent->cur.bounding_box.x = x;
573              obj->smart.parent->cur.bounding_box.y = y;
574              obj->smart.parent->cur.bounding_box.w = w;
575              obj->smart.parent->cur.bounding_box.h = h;
576              obj->smart.parent->cur.valid_bounding_box = EINA_TRUE;
577              propagate = EINA_TRUE;
578           }
579      }
580
581    if (propagate)
582      evas_object_update_bounding_box(obj->smart.parent);
583 }
584
585 EAPI void
586 evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
587 {
588    int is, was = 0, pass = 0, freeze = 0;
589    int nx = 0, ny = 0;
590
591    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
592    return;
593    MAGIC_CHECK_END();
594    if (obj->delete_me) return;
595
596    nx = x;
597    ny = y;
598
599    if (!obj->is_frame)
600      {
601         if ((!obj->smart.parent) && (obj->smart.smart))
602           {
603              int fx, fy;
604
605              evas_output_framespace_get(obj->layer->evas, 
606                                         &fx, &fy, NULL, NULL);
607              nx += fx;
608              ny += fy;
609           }
610      }
611
612    if (evas_object_intercept_call_move(obj, nx, ny)) return;
613
614    if (obj->doing.in_move > 0)
615      {
616         WRN("evas_object_move() called on object %p when in the middle of moving the same object", obj);
617         return;
618      }
619
620    if ((obj->cur.geometry.x == nx) && (obj->cur.geometry.y == ny)) return;
621
622    if (obj->layer->evas->events_frozen <= 0)
623      {
624         pass = evas_event_passes_through(obj);
625         freeze = evas_event_freezes_through(obj);
626         if ((!pass) && (!freeze))
627           was = evas_object_is_in_output_rect(obj,
628                                               obj->layer->evas->pointer.x,
629                                               obj->layer->evas->pointer.y, 1, 1);
630      }
631    obj->doing.in_move++;
632
633    if (obj->smart.smart)
634      {
635         if (obj->smart.smart->smart_class->move)
636           obj->smart.smart->smart_class->move(obj, nx, ny);
637      }
638
639    obj->cur.geometry.x = nx;
640    obj->cur.geometry.y = ny;
641
642    evas_object_update_bounding_box(obj);
643
644 ////   obj->cur.cache.geometry.validity = 0;
645    obj->changed_move = EINA_TRUE;
646    evas_object_change(obj);
647    evas_object_clip_dirty(obj);
648    obj->doing.in_move--;
649    if (obj->layer->evas->events_frozen <= 0)
650      {
651         evas_object_recalc_clippees(obj);
652         if (!pass)
653           {
654              if (!obj->smart.smart)
655                {
656                   is = evas_object_is_in_output_rect(obj,
657                                                      obj->layer->evas->pointer.x,
658                                                      obj->layer->evas->pointer.y, 1, 1);
659                   if ((is ^ was) && obj->cur.visible)
660                     evas_event_feed_mouse_move(obj->layer->evas,
661                                                obj->layer->evas->pointer.x,
662                                                obj->layer->evas->pointer.y,
663                                                obj->layer->evas->last_timestamp,
664                                                NULL);
665                }
666           }
667      }
668    evas_object_inform_call_move(obj);
669 }
670
671 EAPI void
672 evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
673 {
674    int is, was = 0, pass = 0, freeze =0;
675
676    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
677    return;
678    MAGIC_CHECK_END();
679    if (obj->delete_me) return;
680    if (w < 0) w = 0; if (h < 0) h = 0;
681
682    if (evas_object_intercept_call_resize(obj, w, h)) return;
683
684    if (obj->doing.in_resize > 0)
685      {
686         WRN("evas_object_resize() called on object %p when in the middle of resizing the same object", obj);
687         return;
688      }
689
690    if ((obj->cur.geometry.w == w) && (obj->cur.geometry.h == h)) return;
691
692    if (obj->layer->evas->events_frozen <= 0)
693      {
694         pass = evas_event_passes_through(obj);
695         freeze = evas_event_freezes_through(obj);
696         if ((!pass) && (!freeze))
697           was = evas_object_is_in_output_rect(obj,
698                                               obj->layer->evas->pointer.x,
699                                               obj->layer->evas->pointer.y, 1, 1);
700      }
701    obj->doing.in_resize++;
702
703    if (obj->smart.smart)
704      {
705        if (obj->smart.smart->smart_class->resize)
706           obj->smart.smart->smart_class->resize(obj, w, h);
707      }
708
709    obj->cur.geometry.w = w;
710    obj->cur.geometry.h = h;
711
712    evas_object_update_bounding_box(obj);
713
714 ////   obj->cur.cache.geometry.validity = 0;
715    evas_object_change(obj);
716    evas_object_clip_dirty(obj);
717    obj->doing.in_resize--;
718    /* NB: evas_object_recalc_clippees was here previously ( < 08/07/2009) */
719    if (obj->layer->evas->events_frozen <= 0)
720      {
721         /* NB: If this creates glitches on screen then move to above position */
722         evas_object_recalc_clippees(obj);
723
724         //   if (obj->func->coords_recalc) obj->func->coords_recalc(obj);
725         if (!pass)
726           {
727              if (!obj->smart.smart)
728                {
729                   is = evas_object_is_in_output_rect(obj,
730                                                      obj->layer->evas->pointer.x,
731                                                      obj->layer->evas->pointer.y, 1, 1);
732                   if ((is ^ was) && (obj->cur.visible))
733                     evas_event_feed_mouse_move(obj->layer->evas,
734                                                obj->layer->evas->pointer.x,
735                                                obj->layer->evas->pointer.y,
736                                                obj->layer->evas->last_timestamp,
737                                                NULL);
738                }
739           }
740      }
741    evas_object_inform_call_resize(obj);
742 }
743
744 EAPI void
745 evas_object_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
746 {
747    int nx = 0, ny = 0;
748
749    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
750    if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0;
751    return;
752    MAGIC_CHECK_END();
753    if (obj->delete_me)
754      {
755         if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0;
756         return;
757      }
758
759    nx = obj->cur.geometry.x;
760    ny = obj->cur.geometry.y;
761
762    if (!obj->is_frame)
763      {
764         int fx, fy;
765
766         evas_output_framespace_get(obj->layer->evas, 
767                                    &fx, &fy, NULL, NULL);
768
769         if ((!obj->smart.parent) && (obj->smart.smart))
770           {
771              if (nx > 0) nx -= fx;
772              if (ny > 0) ny -= fy;
773           }
774         else if ((obj->smart.parent) && (!obj->smart.smart))
775           {
776              if (nx > 0) nx -= fx;
777              if (ny > 0) ny -= fy;
778           }
779      }
780
781    if (x) *x = nx;
782    if (y) *y = ny;
783    if (w) *w = obj->cur.geometry.w;
784    if (h) *h = obj->cur.geometry.h;
785 }
786
787 static void
788 _evas_object_size_hint_alloc(Evas_Object *obj)
789 {
790    if (obj->size_hints) return;
791
792    EVAS_MEMPOOL_INIT(_mp_sh, "evas_size_hints", Evas_Size_Hints, 32, );
793    obj->size_hints = EVAS_MEMPOOL_ALLOC(_mp_sh, Evas_Size_Hints);
794    if (!obj->size_hints) return;
795    EVAS_MEMPOOL_PREP(_mp_sh, obj->size_hints, Evas_Size_Hints);
796    obj->size_hints->max.w = -1;
797    obj->size_hints->max.h = -1;
798    obj->size_hints->align.x = 0.5;
799    obj->size_hints->align.y = 0.5;
800 }
801
802 EAPI void
803 evas_object_size_hint_min_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
804 {
805    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
806    if (w) *w = 0; if (h) *h = 0;
807    return;
808    MAGIC_CHECK_END();
809    if ((!obj->size_hints) || obj->delete_me)
810      {
811         if (w) *w = 0; if (h) *h = 0;
812         return;
813      }
814    if (w) *w = obj->size_hints->min.w;
815    if (h) *h = obj->size_hints->min.h;
816 }
817
818 EAPI void
819 evas_object_size_hint_min_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
820 {
821    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
822    return;
823    MAGIC_CHECK_END();
824    if (obj->delete_me)
825      return;
826    _evas_object_size_hint_alloc(obj);
827    if ((obj->size_hints->min.w == w) && (obj->size_hints->min.h == h)) return;
828    obj->size_hints->min.w = w;
829    obj->size_hints->min.h = h;
830
831    evas_object_inform_call_changed_size_hints(obj);
832 }
833
834 EAPI void
835 evas_object_size_hint_max_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
836 {
837    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
838    if (w) *w = -1; if (h) *h = -1;
839    return;
840    MAGIC_CHECK_END();
841    if ((!obj->size_hints) || obj->delete_me)
842      {
843         if (w) *w = -1; if (h) *h = -1;
844         return;
845      }
846    if (w) *w = obj->size_hints->max.w;
847    if (h) *h = obj->size_hints->max.h;
848 }
849
850 EAPI void
851 evas_object_size_hint_max_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
852 {
853    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
854    return;
855    MAGIC_CHECK_END();
856    if (obj->delete_me)
857      return;
858    _evas_object_size_hint_alloc(obj);
859    if ((obj->size_hints->max.w == w) && (obj->size_hints->max.h == h)) return;
860    obj->size_hints->max.w = w;
861    obj->size_hints->max.h = h;
862
863    evas_object_inform_call_changed_size_hints(obj);
864 }
865
866 EAPI void
867 evas_object_size_hint_request_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
868 {
869    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
870    if (w) *w = 0; if (h) *h = 0;
871    return;
872    MAGIC_CHECK_END();
873    if ((!obj->size_hints) || obj->delete_me)
874      {
875         if (w) *w = 0; if (h) *h = 0;
876         return;
877      }
878    if (w) *w = obj->size_hints->request.w;
879    if (h) *h = obj->size_hints->request.h;
880 }
881
882 EAPI void
883 evas_object_size_hint_request_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
884 {
885    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
886    return;
887    MAGIC_CHECK_END();
888    if (obj->delete_me)
889      return;
890    _evas_object_size_hint_alloc(obj);
891    if ((obj->size_hints->request.w == w) && (obj->size_hints->request.h == h)) return;
892    obj->size_hints->request.w = w;
893    obj->size_hints->request.h = h;
894
895    evas_object_inform_call_changed_size_hints(obj);
896 }
897
898 EAPI void
899 evas_object_size_hint_aspect_get(const Evas_Object *obj, Evas_Aspect_Control *aspect, Evas_Coord *w, Evas_Coord *h)
900 {
901    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
902    if (aspect) *aspect = EVAS_ASPECT_CONTROL_NONE;
903    if (w) *w = 0; if (h) *h = 0;
904    return;
905    MAGIC_CHECK_END();
906    if ((!obj->size_hints) || obj->delete_me)
907      {
908         if (aspect) *aspect = EVAS_ASPECT_CONTROL_NONE;
909         if (w) *w = 0; if (h) *h = 0;
910         return;
911      }
912    if (aspect) *aspect = obj->size_hints->aspect.mode;
913    if (w) *w = obj->size_hints->aspect.size.w;
914    if (h) *h = obj->size_hints->aspect.size.h;
915 }
916
917 EAPI void
918 evas_object_size_hint_aspect_set(Evas_Object *obj, Evas_Aspect_Control aspect, Evas_Coord w, Evas_Coord h)
919 {
920    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
921    return;
922    MAGIC_CHECK_END();
923    if (obj->delete_me)
924      return;
925    _evas_object_size_hint_alloc(obj);
926    if ((obj->size_hints->aspect.mode == aspect) && (obj->size_hints->aspect.size.w == w) && (obj->size_hints->aspect.size.h == h)) return;
927    obj->size_hints->aspect.mode = aspect;
928    obj->size_hints->aspect.size.w = w;
929    obj->size_hints->aspect.size.h = h;
930
931    evas_object_inform_call_changed_size_hints(obj);
932 }
933
934 EAPI void
935 evas_object_size_hint_align_get(const Evas_Object *obj, double *x, double *y)
936 {
937    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
938    if (x) *x = 0.5; if (y) *y = 0.5;
939    return;
940    MAGIC_CHECK_END();
941    if ((!obj->size_hints) || obj->delete_me)
942      {
943         if (x) *x = 0.5; if (y) *y = 0.5;
944         return;
945      }
946    if (x) *x = obj->size_hints->align.x;
947    if (y) *y = obj->size_hints->align.y;
948 }
949
950 EAPI void
951 evas_object_size_hint_align_set(Evas_Object *obj, double x, double y)
952 {
953    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
954    return;
955    MAGIC_CHECK_END();
956    if (obj->delete_me)
957      return;
958    _evas_object_size_hint_alloc(obj);
959    if ((obj->size_hints->align.x == x) && (obj->size_hints->align.y == y)) return;
960    obj->size_hints->align.x = x;
961    obj->size_hints->align.y = y;
962
963    evas_object_inform_call_changed_size_hints(obj);
964 }
965
966 EAPI void
967 evas_object_size_hint_weight_get(const Evas_Object *obj, double *x, double *y)
968 {
969    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
970    if (x) *x = 0.0; if (y) *y = 0.0;
971    return;
972    MAGIC_CHECK_END();
973    if ((!obj->size_hints) || obj->delete_me)
974      {
975         if (x) *x = 0.0; if (y) *y = 0.0;
976         return;
977      }
978    if (x) *x = obj->size_hints->weight.x;
979    if (y) *y = obj->size_hints->weight.y;
980 }
981
982 EAPI void
983 evas_object_size_hint_weight_set(Evas_Object *obj, double x, double y)
984 {
985    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
986    return;
987    MAGIC_CHECK_END();
988    if (obj->delete_me)
989      return;
990    _evas_object_size_hint_alloc(obj);
991    if ((obj->size_hints->weight.x == x) && (obj->size_hints->weight.y == y)) return;
992    obj->size_hints->weight.x = x;
993    obj->size_hints->weight.y = y;
994
995    evas_object_inform_call_changed_size_hints(obj);
996 }
997
998 EAPI void
999 evas_object_size_hint_padding_get(const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b)
1000 {
1001    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1002    if (l) *l = 0; if (r) *r = 0;
1003    if (t) *t = 0; if (b) *b = 0;
1004    return;
1005    MAGIC_CHECK_END();
1006    if ((!obj->size_hints) || obj->delete_me)
1007      {
1008         if (l) *l = 0; if (r) *r = 0;
1009         if (t) *t = 0; if (b) *b = 0;
1010         return;
1011      }
1012    if (l) *l = obj->size_hints->padding.l;
1013    if (r) *r = obj->size_hints->padding.r;
1014    if (t) *t = obj->size_hints->padding.t;
1015    if (b) *b = obj->size_hints->padding.b;
1016 }
1017
1018 EAPI void
1019 evas_object_size_hint_padding_set(Evas_Object *obj, Evas_Coord l, Evas_Coord r, Evas_Coord t, Evas_Coord b)
1020 {
1021    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1022    return;
1023    MAGIC_CHECK_END();
1024    if (obj->delete_me)
1025      return;
1026    _evas_object_size_hint_alloc(obj);
1027    if ((obj->size_hints->padding.l == l) && (obj->size_hints->padding.r == r) && (obj->size_hints->padding.t == t) && (obj->size_hints->padding.b == b)) return;
1028    obj->size_hints->padding.l = l;
1029    obj->size_hints->padding.r = r;
1030    obj->size_hints->padding.t = t;
1031    obj->size_hints->padding.b = b;
1032
1033    evas_object_inform_call_changed_size_hints(obj);
1034 }
1035
1036 EAPI void
1037 evas_object_show(Evas_Object *obj)
1038 {
1039    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1040    return;
1041    MAGIC_CHECK_END();
1042    if (obj->delete_me) return;
1043    if (evas_object_intercept_call_show(obj)) return;
1044    if (obj->smart.smart)
1045      {
1046        if (obj->smart.smart->smart_class->show)
1047          obj->smart.smart->smart_class->show(obj);
1048      }
1049    if (obj->cur.visible)
1050      {
1051         return;
1052      }
1053    obj->cur.visible = 1;
1054    evas_object_change(obj);
1055    evas_object_clip_dirty(obj);
1056    if (obj->layer->evas->events_frozen <= 0)
1057      {
1058         evas_object_clip_across_clippees_check(obj);
1059         evas_object_recalc_clippees(obj);
1060         if ((!evas_event_passes_through(obj)) &&
1061             (!evas_event_freezes_through(obj)))
1062           {
1063              if (!obj->smart.smart)
1064                {
1065                   if (evas_object_is_in_output_rect(obj,
1066                                                     obj->layer->evas->pointer.x,
1067                                                     obj->layer->evas->pointer.y, 1, 1))
1068                     evas_event_feed_mouse_move(obj->layer->evas,
1069                                                obj->layer->evas->pointer.x,
1070                                                obj->layer->evas->pointer.y,
1071                                                obj->layer->evas->last_timestamp,
1072                                                NULL);
1073                }
1074           }
1075      }
1076    evas_object_inform_call_show(obj);
1077 }
1078
1079 EAPI void
1080 evas_object_hide(Evas_Object *obj)
1081 {
1082    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1083    return;
1084    MAGIC_CHECK_END();
1085    if (obj->delete_me) return;
1086    if (evas_object_intercept_call_hide(obj)) return;
1087    if (obj->smart.smart)
1088      {
1089        if (obj->smart.smart->smart_class->hide)
1090          obj->smart.smart->smart_class->hide(obj);
1091      }
1092    if (!obj->cur.visible)
1093      {
1094         return;
1095      }
1096    obj->cur.visible = 0;
1097    evas_object_change(obj);
1098    evas_object_clip_dirty(obj);
1099    if (obj->layer->evas->events_frozen <= 0)
1100      {
1101         evas_object_clip_across_clippees_check(obj);
1102         evas_object_recalc_clippees(obj);
1103         if ((!evas_event_passes_through(obj)) &&
1104             (!evas_event_freezes_through(obj)))
1105           {
1106              if ((!obj->smart.smart) ||
1107                  ((obj->cur.map) && (obj->cur.map->count == 4) && (obj->cur.usemap)))
1108                {
1109                   if (!obj->mouse_grabbed)
1110                     {
1111                        if (evas_object_is_in_output_rect(obj,
1112                                                          obj->layer->evas->pointer.x,
1113                                                          obj->layer->evas->pointer.y, 1, 1))
1114                           evas_event_feed_mouse_move(obj->layer->evas,
1115                                                      obj->layer->evas->pointer.x,
1116                                                      obj->layer->evas->pointer.y,
1117                                                      obj->layer->evas->last_timestamp,
1118                                                      NULL);
1119                     }
1120 /* this is at odds to handling events when an obj is moved out of the mouse
1121  * ore resized out or clipped out. if mouse is grabbed - regardless of
1122  * visibility, mouse move events should keep happening and mouse up.
1123  * for better or worse it's at least consistent.
1124                   if (obj->delete_me) return;
1125                   if (obj->mouse_grabbed > 0)
1126                     obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
1127                   if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
1128                     obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, obj);
1129                   obj->mouse_grabbed = 0;
1130                   if (obj->layer->evas->events_frozen > 0)
1131                     {
1132                        obj->mouse_in = 0;
1133                        return;
1134                     }
1135                   if (obj->mouse_in)
1136                     {
1137                        Evas_Event_Mouse_Out ev;
1138
1139                        _evas_object_event_new();
1140
1141                        obj->mouse_in = 0;
1142                        ev.buttons = obj->layer->evas->pointer.button;
1143                        ev.output.x = obj->layer->evas->pointer.x;
1144                        ev.output.y = obj->layer->evas->pointer.y;
1145                        ev.canvas.x = obj->layer->evas->pointer.x;
1146                        ev.canvas.y = obj->layer->evas->pointer.y;
1147                        ev.data = NULL;
1148                        ev.modifiers = &(obj->layer->evas->modifiers);
1149                        ev.locks = &(obj->layer->evas->locks);
1150                        ev.timestamp = obj->layer->evas->last_timestamp;
1151                        ev.event_flags = EVAS_EVENT_FLAG_NONE;
1152                        evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
1153                        _evas_post_event_callback_call(obj->layer->evas);
1154                     }
1155  */
1156                }
1157           }
1158      }
1159    else
1160      {
1161 /*
1162         if (obj->mouse_grabbed > 0)
1163           obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
1164         if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
1165           obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, obj);
1166         obj->mouse_grabbed = 0;
1167         obj->mouse_in = 0;
1168  */
1169      }
1170    evas_object_inform_call_hide(obj);
1171 }
1172
1173 EAPI Eina_Bool
1174 evas_object_visible_get(const Evas_Object *obj)
1175 {
1176    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1177    return 0;
1178    MAGIC_CHECK_END();
1179    if (obj->delete_me) return 0;
1180    return obj->cur.visible;
1181 }
1182
1183 EAPI void
1184 evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a)
1185 {
1186    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1187    return;
1188    MAGIC_CHECK_END();
1189    if (obj->delete_me) return;
1190    if (r > 255) r = 255; if (r < 0) r = 0;
1191    if (g > 255) g = 255; if (g < 0) g = 0;
1192    if (b > 255) b = 255; if (b < 0) b = 0;
1193    if (a > 255) a = 255; if (a < 0) a = 0;
1194    if (r > a)
1195      {
1196         r = a;
1197         ERR("Evas only handles pre multiplied colors!");
1198      }
1199    if (g > a)
1200      {
1201         g = a;
1202         ERR("Evas only handles pre multiplied colors!");
1203      }
1204    if (b > a)
1205      {
1206         b = a;
1207         ERR("Evas only handles pre multiplied colors!");
1208      }
1209
1210    if (evas_object_intercept_call_color_set(obj, r, g, b, a)) return;
1211    if (obj->smart.smart)
1212      {
1213        if (obj->smart.smart->smart_class->color_set)
1214          obj->smart.smart->smart_class->color_set(obj, r, g, b, a);
1215      }
1216    if ((obj->cur.color.r == r) &&
1217        (obj->cur.color.g == g) &&
1218        (obj->cur.color.b == b) &&
1219        (obj->cur.color.a == a)) return;
1220    obj->cur.color.r = r;
1221    obj->cur.color.g = g;
1222    obj->cur.color.b = b;
1223    evas_object_clip_dirty(obj);
1224
1225    if ((obj->cur.color.a == 0) && (a == 0) && (obj->cur.render_op == EVAS_RENDER_BLEND)) return;
1226    obj->cur.color.a = a;
1227    obj->changed_color = EINA_TRUE;
1228    evas_object_change(obj);
1229 }
1230
1231 EAPI void
1232 evas_object_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
1233 {
1234    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1235    if (r) *r = 0; if (g) *g = 0; if (b) *b = 0; if (a) *a = 0;
1236    return;
1237    MAGIC_CHECK_END();
1238    if (obj->delete_me)
1239      {
1240         if (r) *r = 0; if (g) *g = 0; if (b) *b = 0; if (a) *a = 0;
1241         return;
1242      }
1243    if (r) *r = obj->cur.color.r;
1244    if (g) *g = obj->cur.color.g;
1245    if (b) *b = obj->cur.color.b;
1246    if (a) *a = obj->cur.color.a;
1247 }
1248
1249 EAPI void
1250 evas_object_anti_alias_set(Evas_Object *obj, Eina_Bool anti_alias)
1251 {
1252    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1253    return;
1254    MAGIC_CHECK_END();
1255    if (obj->delete_me) return;
1256    anti_alias = !!anti_alias;
1257    if (obj->cur.anti_alias == anti_alias)return;
1258    obj->cur.anti_alias = anti_alias;
1259    evas_object_change(obj);
1260 }
1261
1262 EAPI Eina_Bool
1263 evas_object_anti_alias_get(const Evas_Object *obj)
1264 {
1265    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1266    return 0;
1267    MAGIC_CHECK_END();
1268    if (obj->delete_me) return 0;
1269    return obj->cur.anti_alias;
1270 }
1271
1272 EAPI void
1273 evas_object_scale_set(Evas_Object *obj, double scale)
1274 {
1275    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1276    return;
1277    MAGIC_CHECK_END();
1278    if (obj->delete_me) return;
1279    if (obj->cur.scale == scale) return;
1280    obj->cur.scale = scale;
1281    evas_object_change(obj);
1282    if (obj->func->scale_update) obj->func->scale_update(obj);
1283 }
1284
1285 EAPI double
1286 evas_object_scale_get(const Evas_Object *obj)
1287 {
1288    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1289    return 0;
1290    MAGIC_CHECK_END();
1291    if (obj->delete_me) return 1.0;
1292    return obj->cur.scale;
1293 }
1294
1295 EAPI void
1296 evas_object_render_op_set(Evas_Object *obj, Evas_Render_Op render_op)
1297 {
1298    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1299    return;
1300    MAGIC_CHECK_END();
1301    if (obj->delete_me) return;
1302    if (obj->cur.render_op == render_op) return;
1303    obj->cur.render_op = render_op;
1304    evas_object_change(obj);
1305 }
1306
1307 EAPI Evas_Render_Op
1308 evas_object_render_op_get(const Evas_Object *obj)
1309 {
1310    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1311    return 0;
1312    MAGIC_CHECK_END();
1313    if (obj->delete_me) return EVAS_RENDER_BLEND;
1314    return obj->cur.render_op;
1315 }
1316
1317 EAPI Evas *
1318 evas_object_evas_get(const Evas_Object *obj)
1319 {
1320    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1321    return NULL;
1322    MAGIC_CHECK_END();
1323    if (obj->delete_me) return NULL;
1324    return obj->layer->evas;
1325 }
1326
1327 EAPI Evas_Object *
1328 evas_object_top_at_xy_get(const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
1329 {
1330    Evas_Layer *lay;
1331    int xx, yy;
1332
1333    MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1334    return NULL;
1335    MAGIC_CHECK_END();
1336    xx = x;
1337    yy = y;
1338 ////   xx = evas_coord_world_x_to_screen(e, x);
1339 ////   yy = evas_coord_world_y_to_screen(e, y);
1340    EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
1341      {
1342         Evas_Object *obj;
1343
1344         EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
1345           {
1346              if (obj->delete_me) continue;
1347              if ((!include_pass_events_objects) &&
1348                  (evas_event_passes_through(obj))) continue;
1349              if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
1350              evas_object_clip_recalc(obj);
1351              if ((evas_object_is_in_output_rect(obj, xx, yy, 1, 1)) &&
1352                  (!obj->clip.clipees))
1353                return obj;
1354           }
1355      }
1356    return NULL;
1357 }
1358
1359 EAPI Evas_Object *
1360 evas_object_top_at_pointer_get(const Evas *e)
1361 {
1362    return evas_object_top_at_xy_get(e, e->pointer.x, e->pointer.y, EINA_TRUE,
1363                                     EINA_TRUE);
1364 }
1365
1366 EAPI Evas_Object *
1367 evas_object_top_in_rectangle_get(const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
1368 {
1369    Evas_Layer *lay;
1370    int xx, yy, ww, hh;
1371
1372    MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1373    return NULL;
1374    MAGIC_CHECK_END();
1375    xx = x;
1376    yy = y;
1377    ww = w;
1378    hh = h;
1379 ////   xx = evas_coord_world_x_to_screen(e, x);
1380 ////   yy = evas_coord_world_y_to_screen(e, y);
1381 ////   ww = evas_coord_world_x_to_screen(e, w);
1382 ////   hh = evas_coord_world_y_to_screen(e, h);
1383    if (ww < 1) ww = 1;
1384    if (hh < 1) hh = 1;
1385    EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
1386      {
1387         Evas_Object *obj;
1388
1389         EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
1390           {
1391              if (obj->delete_me) continue;
1392              if ((!include_pass_events_objects) &&
1393                  (evas_event_passes_through(obj))) continue;
1394              if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
1395              evas_object_clip_recalc(obj);
1396              if ((evas_object_is_in_output_rect(obj, xx, yy, ww, hh)) &&
1397                  (!obj->clip.clipees))
1398                return obj;
1399           }
1400      }
1401    return NULL;
1402 }
1403
1404 EAPI Eina_List *
1405 evas_objects_at_xy_get(const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
1406 {
1407    Eina_List *in = NULL;
1408    Evas_Layer *lay;
1409    int xx, yy;
1410
1411    MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1412    return NULL;
1413    MAGIC_CHECK_END();
1414    xx = x;
1415    yy = y;
1416 ////   xx = evas_coord_world_x_to_screen(e, x);
1417 ////   yy = evas_coord_world_y_to_screen(e, y);
1418    EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
1419      {
1420         Evas_Object *obj;
1421
1422         EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
1423           {
1424              if (obj->delete_me) continue;
1425              if ((!include_pass_events_objects) &&
1426                  (evas_event_passes_through(obj))) continue;
1427              if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
1428              evas_object_clip_recalc(obj);
1429              if ((evas_object_is_in_output_rect(obj, xx, yy, 1, 1)) &&
1430                  (!obj->clip.clipees))
1431                in = eina_list_prepend(in, obj);
1432           }
1433      }
1434    return in;
1435 }
1436
1437 /**
1438  * Retrieves the objects in the given rectangle region
1439  * @param   e The given evas object.
1440  * @param   x The horizontal coordinate.
1441  * @param   y The vertical coordinate.
1442  * @param   w The width size.
1443  * @param   h The height size.
1444  * @param   include_pass_events_objects Boolean Flag to include or not pass events objects
1445  * @param   include_hidden_objects Boolean Flag to include or not hidden objects
1446  * @return  The list of evas object in the rectangle region.
1447  *
1448  */
1449 EAPI Eina_List *
1450 evas_objects_in_rectangle_get(const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
1451 {
1452    Eina_List *in = NULL;
1453    Evas_Layer *lay;
1454    int xx, yy, ww, hh;
1455
1456    MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1457    return NULL;
1458    MAGIC_CHECK_END();
1459    xx = x;
1460    yy = y;
1461    ww = w;
1462    hh = h;
1463 ////   xx = evas_coord_world_x_to_screen(e, x);
1464 ////   yy = evas_coord_world_y_to_screen(e, y);
1465 ////   ww = evas_coord_world_x_to_screen(e, w);
1466 ////   hh = evas_coord_world_y_to_screen(e, h);
1467    if (ww < 1) ww = 1;
1468    if (hh < 1) hh = 1;
1469    EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
1470      {
1471         Evas_Object *obj;
1472
1473         EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
1474           {
1475              if (obj->delete_me) continue;
1476              if ((!include_pass_events_objects) &&
1477                  (evas_event_passes_through(obj))) continue;
1478              if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
1479              evas_object_clip_recalc(obj);
1480              if ((evas_object_is_in_output_rect(obj, xx, yy, ww, hh)) &&
1481                  (!obj->clip.clipees))
1482                in = eina_list_prepend(in, obj);
1483           }
1484      }
1485    return in;
1486 }
1487
1488 EAPI const char *
1489 evas_object_type_get(const Evas_Object *obj)
1490 {
1491    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1492    return NULL;
1493    MAGIC_CHECK_END();
1494    if (obj->delete_me) return "";
1495    return obj->type;
1496 }
1497
1498 EAPI void
1499 evas_object_precise_is_inside_set(Evas_Object *obj, Eina_Bool precise)
1500 {
1501    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1502    return;
1503    MAGIC_CHECK_END();
1504    obj->precise_is_inside = precise;
1505 }
1506
1507 EAPI Eina_Bool
1508 evas_object_precise_is_inside_get(const Evas_Object *obj)
1509 {
1510    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1511    return 0;
1512    MAGIC_CHECK_END();
1513    return obj->precise_is_inside;
1514 }
1515
1516 EAPI void
1517 evas_object_static_clip_set(Evas_Object *obj, Eina_Bool is_static_clip)
1518 {
1519    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1520    return;
1521    MAGIC_CHECK_END();
1522    obj->is_static_clip = is_static_clip;
1523 }
1524
1525 EAPI Eina_Bool
1526 evas_object_static_clip_get(const Evas_Object *obj)
1527 {
1528    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1529    return 0;
1530    MAGIC_CHECK_END();
1531    return obj->is_static_clip;
1532 }
1533
1534 EAPI void
1535 evas_object_is_frame_object_set(Evas_Object *obj, Eina_Bool is_frame)
1536 {
1537    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1538    return;
1539    MAGIC_CHECK_END();
1540    obj->is_frame = is_frame;
1541 }
1542
1543 EAPI Eina_Bool
1544 evas_object_is_frame_object_get(Evas_Object *obj)
1545 {
1546    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1547    return EINA_FALSE;
1548    MAGIC_CHECK_END();
1549    return obj->is_frame;
1550 }