move around - flatter.
[profile/ivi/evas.git] / src / lib / canvas / evas_object_main.c
1 #include "evas_common.h"
2 #include "evas_private.h"
3
4 /* FIXME: this broken e17's mouse cursor - need to figure out why */
5
6 /* uncomment the next line if smart objects should be informed
7  * if they are moved to the position they are already in
8  * (e.g. if they are in 0,0 and you call evas_object_move(o, 0, 0)
9  */
10 //#define FORWARD_NOOP_MOVES_TO_SMART_OBJS
11
12 /* likewise, for resizes
13  */
14 //#define FORWARD_NOOP_RESIZES_TO_SMART_OBJS
15
16 static Evas_Object_List *
17 get_layer_objects_last(Evas_Layer *l)
18 {
19    if( !l || !l->objects ) return NULL;
20
21    return ((Evas_Object_List *)(l->objects))->last;
22 }
23
24 /* evas internal stuff */
25 Evas_Object *
26 evas_object_new(void)
27 {
28    Evas_Object *obj;
29
30    obj = calloc(1, sizeof(Evas_Object));
31    if (!obj) return NULL;
32
33    obj->magic = MAGIC_OBJ;
34
35    return obj;
36 }
37
38 void
39 evas_object_free(Evas_Object *obj, int clean_layer)
40 {
41    int was_smart_child = 0;
42
43    evas_object_grabs_cleanup(obj);
44    evas_object_intercept_cleanup(obj);
45    if (obj->smart.parent) was_smart_child = 1;
46    evas_object_smart_cleanup(obj);
47    obj->func->free(obj);
48    if (!was_smart_child) evas_object_release(obj, clean_layer);
49    if (obj->clip.clipees)
50      evas_list_free(obj->clip.clipees);
51    while (obj->clip.changes)
52      {
53         Evas_Rectangle *r;
54
55         r = (Evas_Rectangle *)obj->clip.changes->data;
56         obj->clip.changes = evas_list_remove(obj->clip.changes, r);
57         free(r);
58      }
59    evas_object_event_callback_all_del(obj);
60    evas_object_event_callback_cleanup(obj);
61    while (obj->data.elements)
62      {
63         Evas_Data_Node *node;
64
65         node = obj->data.elements->data;
66         obj->data.elements = evas_list_remove(obj->data.elements, node);
67         free(node);
68      }
69    obj->magic = 0;
70    if (obj->size_hints) free(obj->size_hints);
71    free(obj);
72 }
73
74 void
75 evas_object_change(Evas_Object *obj)
76 {
77    Evas_List *l;
78
79    obj->layer->evas->changed = 1;
80    if (obj->changed) return;
81    evas_render_object_recalc(obj);
82    /* set changed flag on all objects this one clips too */
83    for (l = obj->clip.clipees; l; l = l->next)
84      evas_object_change((Evas_Object *)l->data);
85    if (obj->smart.parent) evas_object_change(obj->smart.parent);
86 }
87
88 void
89 evas_object_render_pre_visible_change(Evas_Rectangles *rects, Evas_Object *obj, int is_v, int was_v)
90 {
91    if (obj->smart.smart) return ;
92    if (is_v == was_v) return ;
93    if (is_v)
94      {
95         evas_add_rect(rects,
96                       obj->cur.cache.clip.x,
97                       obj->cur.cache.clip.y,
98                       obj->cur.cache.clip.w,
99                       obj->cur.cache.clip.h);
100      }
101    else
102      {
103         evas_add_rect(rects,
104                       obj->prev.cache.clip.x,
105                       obj->prev.cache.clip.y,
106                       obj->prev.cache.clip.w,
107                       obj->prev.cache.clip.h);
108      }
109 }
110
111 void
112 evas_object_render_pre_clipper_change(Evas_Rectangles *rects, Evas_Object *obj)
113 {
114    if (obj->smart.smart) return ;
115    if (obj->cur.clipper == obj->prev.clipper) return ;
116    if ((obj->cur.clipper) && (obj->prev.clipper))
117      {
118         /* get difference rects between clippers */
119         evas_rects_return_difference_rects(rects,
120                                            obj->cur.clipper->cur.cache.clip.x,
121                                            obj->cur.clipper->cur.cache.clip.y,
122                                            obj->cur.clipper->cur.cache.clip.w,
123                                            obj->cur.clipper->cur.cache.clip.h,
124                                            obj->prev.clipper->prev.cache.clip.x,
125                                            obj->prev.clipper->prev.cache.clip.y,
126                                            obj->prev.clipper->prev.cache.clip.w,
127                                            obj->prev.clipper->prev.cache.clip.h);
128      }
129    else if (obj->cur.clipper)
130      {
131         evas_rects_return_difference_rects(rects,
132                                            obj->cur.geometry.x,
133                                            obj->cur.geometry.y,
134                                            obj->cur.geometry.w,
135                                            obj->cur.geometry.h,
136 ////    rl = evas_rects_return_difference_rects(obj->cur.cache.geometry.x,
137 ////                                            obj->cur.cache.geometry.y,
138 ////                                            obj->cur.cache.geometry.w,
139 ////                                            obj->cur.cache.geometry.h,
140                                            obj->cur.clipper->cur.cache.clip.x,
141                                            obj->cur.clipper->cur.cache.clip.y,
142                                            obj->cur.clipper->cur.cache.clip.w,
143                                            obj->cur.clipper->cur.cache.clip.h);
144      }
145    else if (obj->prev.clipper)
146      {
147         evas_rects_return_difference_rects(rects,
148                                            obj->prev.geometry.x,
149                                            obj->prev.geometry.y,
150                                            obj->prev.geometry.w,
151                                            obj->prev.geometry.h,
152 ////    rl = evas_rects_return_difference_rects(obj->prev.cache.geometry.x,
153 ////                                            obj->prev.cache.geometry.y,
154 ////                                            obj->prev.cache.geometry.w,
155 ////                                            obj->prev.cache.geometry.h,
156                                            obj->prev.clipper->prev.cache.clip.x,
157                                            obj->prev.clipper->prev.cache.clip.y,
158                                            obj->prev.clipper->prev.cache.clip.w,
159                                            obj->prev.clipper->prev.cache.clip.h);
160      }
161 }
162
163 void
164 evas_object_render_pre_prev_cur_add(Evas_Rectangles *rects, Evas_Object *obj)
165 {
166    evas_add_rect(rects,
167                  obj->cur.geometry.x,
168                  obj->cur.geometry.y,
169                  obj->cur.geometry.w,
170                  obj->cur.geometry.h);
171 ////        obj->cur.cache.geometry.x,
172 ////        obj->cur.cache.geometry.y,
173 ////        obj->cur.cache.geometry.w,
174 ////        obj->cur.cache.geometry.h);
175    evas_add_rect(rects,
176                  obj->prev.geometry.x,
177                  obj->prev.geometry.y,
178                  obj->prev.geometry.w,
179                  obj->prev.geometry.h);
180 ////        obj->prev.cache.geometry.x,
181 ////        obj->prev.cache.geometry.y,
182 ////        obj->prev.cache.geometry.w,
183 ////        obj->prev.cache.geometry.h);
184 }
185
186 void
187 evas_object_render_pre_effect_updates(Evas_Rectangles *rects, Evas_Object *obj, int is_v, int was_v)
188 {
189    Evas_Rectangle *r;
190    Evas_Object *clipper;
191    Evas_List *l;
192    unsigned int i;
193    int x, y, w, h;
194
195    if (obj->smart.smart) goto end;
196    /* FIXME: was_v isn't used... why? */
197    was_v = 0;
198    if (!obj->clip.clipees)
199      {
200         for (i = 0; i < rects->count; ++i)
201           {
202              /* get updates and clip to current clip */
203              x = rects->array[i].x;
204              y = rects->array[i].y;
205              w = rects->array[i].w;
206              h = rects->array[i].h;
207              RECTS_CLIP_TO_RECT(x, y, w, h,
208                                 obj->cur.cache.clip.x,
209                                 obj->cur.cache.clip.y,
210                                 obj->cur.cache.clip.w,
211                                 obj->cur.cache.clip.h);
212              if ((w > 0) && (h > 0))
213                obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
214                                                                       x, y, w, h);
215              /* get updates and clip to previous clip */
216              x = rects->array[i].x;
217              y = rects->array[i].y;
218              w = rects->array[i].w;
219              h = rects->array[i].h;
220              RECTS_CLIP_TO_RECT(x, y, w, h,
221                                 obj->prev.cache.clip.x,
222                                 obj->prev.cache.clip.y,
223                                 obj->prev.cache.clip.w,
224                                 obj->prev.cache.clip.h);
225              if ((w > 0) && (h > 0))
226                obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
227                                                                       x, y, w, h);
228           }
229         /* if the object is actually visible, take any parent clip changes */
230         if (is_v)
231           {
232              clipper = obj->cur.clipper;
233              while (clipper)
234                {
235                   for (l = clipper->clip.changes; l; l = l->next)
236                     {
237                        r = (Evas_Rectangle *)(l->data);
238                        /* get updates and clip to current clip */
239                        x = r->x; y = r->y; w = r->w; h = r->h;
240                        RECTS_CLIP_TO_RECT(x, y, w, h,
241                                           obj->cur.cache.clip.x,
242                                           obj->cur.cache.clip.y,
243                                           obj->cur.cache.clip.w,
244                                           obj->cur.cache.clip.h);
245                        if ((w > 0) && (h > 0))
246                          obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
247                                                                                 x, y, w, h);
248                        /* get updates and clip to previous clip */
249                        x = r->x; y = r->y; w = r->w; h = r->h;
250                        RECTS_CLIP_TO_RECT(x, y, w, h,
251                                           obj->prev.cache.clip.x,
252                                           obj->prev.cache.clip.y,
253                                           obj->prev.cache.clip.w,
254                                           obj->prev.cache.clip.h);
255                        if ((w > 0) && (h > 0))
256                          obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
257                                                                                 x, y, w, h);
258                     }
259                   clipper = clipper->cur.clipper;
260                }
261           }
262      }
263    else
264      {
265         while (obj->clip.changes)
266           {
267              free(obj->clip.changes->data);
268              obj->clip.changes = evas_list_remove(obj->clip.changes, obj->clip.changes->data);
269           }
270         for (i = 0; i < rects->count; ++i)
271           {
272              r = malloc(sizeof(Evas_Rectangle));
273              if (!r) goto end;
274
275              *r = rects->array[i];
276              obj->clip.changes = evas_list_append(obj->clip.changes, r);
277           }
278      }
279
280  end:
281    free(rects->array);
282    rects->array = NULL;
283    rects->count = 0;
284    rects->total = 0;
285 }
286
287 int
288 evas_object_was_in_output_rect(Evas_Object *obj, int x, int y, int w, int h)
289 {
290    if (obj->smart.smart) return 0;
291    /* assumes coords have been recalced */
292    if ((RECTS_INTERSECT(x, y, w, h,
293                         obj->prev.cache.clip.x,
294                         obj->prev.cache.clip.y,
295                         obj->prev.cache.clip.w,
296                         obj->prev.cache.clip.h)))
297      return 1;
298    return 0;
299 }
300
301 int
302 evas_object_was_visible(Evas_Object *obj)
303 {
304    if (obj->smart.smart) return 0;
305    if ((obj->prev.visible) &&
306        (obj->prev.cache.clip.visible) &&
307        (obj->prev.cache.clip.a > 0))
308      {
309         if (obj->func->was_visible)
310           return obj->func->was_visible(obj);
311         return 1;
312      }
313    return 0;
314 }
315
316 int
317 evas_object_was_opaque(Evas_Object *obj)
318 {
319    if (obj->smart.smart) return 0;
320    if (obj->prev.cache.clip.a == 255)
321      {
322         if (obj->func->was_opaque)
323           return obj->func->was_opaque(obj);
324         return 1;
325      }
326    return 0;
327 }
328
329 int
330 evas_object_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
331 {
332    if (obj->smart.smart) return 0;
333    if (obj->func->is_inside)
334      return obj->func->is_inside(obj, x, y);
335    return 0;
336 }
337
338 int
339 evas_object_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
340 {
341    if (obj->smart.smart) return 0;
342    if (obj->func->was_inside)
343      return obj->func->was_inside(obj, x, y);
344    return 0;
345 }
346 /* routines apps will call */
347
348 /**
349  * @defgroup Evas_Object_Group Generic Object Functions
350  *
351  * Functions that manipulate generic evas objects.
352  */
353
354 /**
355  * Deletes the given evas object and frees its memory.
356  *
357  * The object's 'free' callback is called when this function is called.
358  * If the object currently has the focus, its 'focus out' callback is
359  * also called.
360  *
361  * @param   obj The given evas object.
362  * @ingroup Evas_Object_Group
363  */
364 EAPI void
365 evas_object_del(Evas_Object *obj)
366 {
367    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
368    return;
369    MAGIC_CHECK_END();
370
371    if (obj->delete_me) return;
372
373    evas_object_event_callback_call(obj, EVAS_CALLBACK_DEL, NULL);
374    if (obj->name) evas_object_name_set(obj, NULL);
375    if (!obj->layer)
376      {
377         evas_object_free(obj, 1);
378         return;
379      }
380    if (obj->focused)
381      {
382         obj->focused = 0;
383         obj->layer->evas->focused = NULL;
384         evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_OUT, NULL);
385      }
386    obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
387    obj->mouse_grabbed = 0;
388    evas_object_hide(obj);
389    evas_object_grabs_cleanup(obj);
390    while (obj->clip.clipees) evas_object_clip_unset(obj->clip.clipees->data);
391    if (obj->cur.clipper) evas_object_clip_unset(obj);
392    if (obj->smart.smart) evas_object_smart_del(obj);
393    evas_object_event_callback_call(obj, EVAS_CALLBACK_FREE, NULL);
394    evas_object_smart_cleanup(obj);
395    obj->delete_me = 1;
396    evas_object_change(obj);
397 }
398
399 /**
400  * Moves the given evas object to the given location.
401  * @param   obj The given evas object.
402  * @param   x   X position to move the object to, in canvas units.
403  * @param   y   Y position to move the object to, in canvas units.
404  * @ingroup Evas_Object_Group
405  */
406 EAPI void
407 evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
408 {
409    int is, was = 0, pass = 0;
410
411    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
412    return;
413    MAGIC_CHECK_END();
414    if (obj->delete_me) return;
415    if (evas_object_intercept_call_move(obj, x, y)) return;
416 #ifdef FORWARD_NOOP_MOVES_TO_SMART_OBJS
417    if (obj->smart.smart)
418      {
419        if (obj->smart.smart->smart_class->move)
420           obj->smart.smart->smart_class->move(obj, x, y);
421      }
422 #endif
423    if ((obj->cur.geometry.x == x) &&
424        (obj->cur.geometry.y == y))
425      {
426         evas_object_inform_call_move(obj);
427         return;
428      }
429 #ifndef FORWARD_NOOP_MOVES_TO_SMART_OBJS
430    if (obj->smart.smart)
431      {
432        if (obj->smart.smart->smart_class->move)
433           obj->smart.smart->smart_class->move(obj, x, y);
434      }
435 #endif
436    if (obj->layer->evas->events_frozen <= 0)
437      {
438         pass = evas_event_passes_through(obj);
439         if (!pass)
440           was = evas_object_is_in_output_rect(obj,
441                                               obj->layer->evas->pointer.x,
442                                               obj->layer->evas->pointer.y, 1, 1);
443      }
444    obj->cur.geometry.x = x;
445    obj->cur.geometry.y = y;
446 ////   obj->cur.cache.geometry.validity = 0;
447    evas_object_change(obj);
448    evas_object_clip_dirty(obj);
449    if (obj->layer->evas->events_frozen <= 0)
450      {
451         evas_object_recalc_clippees(obj);
452         if (!pass)
453           {
454              if (!obj->smart.smart)
455                {
456                   is = evas_object_is_in_output_rect(obj,
457                                                      obj->layer->evas->pointer.x,
458                                                      obj->layer->evas->pointer.y, 1, 1);
459                   if ((is ^ was) && obj->cur.visible)
460                     evas_event_feed_mouse_move(obj->layer->evas,
461                                                obj->layer->evas->pointer.x,
462                                                obj->layer->evas->pointer.y,
463                                                obj->layer->evas->last_timestamp,
464                                                NULL);
465                }
466           }
467      }
468    evas_object_inform_call_move(obj);
469 }
470
471 /**
472  * Changes the size of the given evas object.
473  * @param   obj The given evas object.
474  * @param   w   The new width of the evas object.
475  * @param   h   The new height of the evas object.
476  * @ingroup Evas_Object_Group
477  */
478 EAPI void
479 evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
480 {
481    int is, was = 0, pass = 0;
482
483    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
484    return;
485    MAGIC_CHECK_END();
486    if (obj->delete_me) return;
487    if (w < 0.0) w = 0.0; if (h < 0.0) h = 0.0;
488    if (evas_object_intercept_call_resize(obj, w, h)) return;
489 #ifdef FORWARD_NOOP_RESIZES_TO_SMART_OBJS
490    if (obj->smart.smart)
491      {
492        if (obj->smart.smart->smart_class->resize)
493           obj->smart.smart->smart_class->resize(obj, w, h);
494      }
495 #endif
496    if ((obj->cur.geometry.w == w) &&
497        (obj->cur.geometry.h == h))
498      {
499         evas_object_inform_call_resize(obj);
500         return;
501      }
502 #ifndef FORWARD_NOOP_RESIZES_TO_SMART_OBJS
503    if (obj->smart.smart)
504      {
505        if (obj->smart.smart->smart_class->resize)
506           obj->smart.smart->smart_class->resize(obj, w, h);
507      }
508 #endif
509    if (obj->layer->evas->events_frozen <= 0)
510      {
511         pass = evas_event_passes_through(obj);
512         if (!pass)
513           was = evas_object_is_in_output_rect(obj,
514                                               obj->layer->evas->pointer.x,
515                                               obj->layer->evas->pointer.y, 1, 1);
516      }
517    obj->cur.geometry.w = w;
518    obj->cur.geometry.h = h;
519 ////   obj->cur.cache.geometry.validity = 0;
520    evas_object_change(obj);
521    evas_object_clip_dirty(obj);
522    evas_object_recalc_clippees(obj);
523    if (obj->layer->evas->events_frozen <= 0)
524      {
525         //   if (obj->func->coords_recalc) obj->func->coords_recalc(obj);
526         if (!pass)
527           {
528              if (!obj->smart.smart)
529                {
530                   is = evas_object_is_in_output_rect(obj,
531                                                      obj->layer->evas->pointer.x,
532                                                      obj->layer->evas->pointer.y, 1, 1);
533                   if ((is ^ was) && (obj->cur.visible))
534                     evas_event_feed_mouse_move(obj->layer->evas,
535                                                obj->layer->evas->pointer.x,
536                                                obj->layer->evas->pointer.y,
537                                                obj->layer->evas->last_timestamp,
538                                                NULL);
539                }
540           }
541      }
542    evas_object_inform_call_resize(obj);
543 }
544
545 /**
546  * Retrieves the position and rectangular size of the given evas object.
547  *
548  * Note that if any of @p x, @p y, @p w or @p h are @c NULL, the @c NULL
549  * parameters are ignored.
550  *
551  * @param obj The given evas object.
552  * @param   x   Pointer to an integer in which to store the X coordinate of
553  *              the object.
554  * @param   y   Pointer to an integer in which to store the Y coordinate of
555  *              the object.
556  * @param   w   Pointer to an integer in which to store the width of the
557  *              object.
558  * @param   h   Pointer to an integer in which to store the height of the
559  *              object.
560  * @ingroup Evas_Object_Group
561  */
562 EAPI void
563 evas_object_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
564 {
565    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
566    if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0;
567    return;
568    MAGIC_CHECK_END();
569    if (obj->delete_me)
570      {
571         if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0;
572         return;
573      }
574    if (x) *x = obj->cur.geometry.x;
575    if (y) *y = obj->cur.geometry.y;
576    if (w) *w = obj->cur.geometry.w;
577    if (h) *h = obj->cur.geometry.h;
578 }
579
580 /**
581  * @defgroup Evas_Object_Size_Hints_Group Generic Object Size Hints Functions
582  *
583  * Functions that deals with hints about object size.
584  */
585
586 /**
587  * Retrieves the size hint for the minimum size.
588  *
589  * This is not a size enforcement in any way, it's just a hint that should
590  * be used whenever appropriate.
591  *
592  * Note that if any of @p w or @p h are @c NULL, the @c NULL
593  * parameters are ignored.
594  *
595  * @param obj The given evas object.
596  * @param   w Pointer to an integer in which to store the minimum width.
597  * @param   h Pointer to an integer in which to store the minimum height.
598  * @ingroup Evas_Object_Size_Hints_Group
599  */
600 EAPI void
601 evas_object_size_hint_min_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
602 {
603    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
604    if (w) *w = 0; if (h) *h = 0;
605    return;
606    MAGIC_CHECK_END();
607    if ((!obj->size_hints) || obj->delete_me)
608      {
609         if (w) *w = 0; if (h) *h = 0;
610         return;
611      }
612    if (w) *w = obj->size_hints->min.w;
613    if (h) *h = obj->size_hints->min.h;
614 }
615
616 /**
617  * Sets the size hint for the minimum size.
618  *
619  * This is not a size enforcement in any way, it's just a hint that should
620  * be used whenever appropriate.
621  *
622  * @param obj The given evas object.
623  * @param   w Integer to use as the minimum width hint.
624  * @param   h Integer to use as the minimum height hint.
625  * @ingroup Evas_Object_Size_Hints_Group
626  */
627 EAPI void
628 evas_object_size_hint_min_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
629 {
630    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
631    return;
632    MAGIC_CHECK_END();
633    if (obj->delete_me)
634      return;
635    if (!obj->size_hints)
636      obj->size_hints = calloc(1, sizeof(Evas_Size_Hints));
637
638    obj->size_hints->min.w = w;
639    obj->size_hints->min.h = h;
640
641    evas_object_inform_call_changed_size_hints(obj);
642 }
643
644 /**
645  * Retrieves the size hint for the maximum size.
646  *
647  * This is not a size enforcement in any way, it's just a hint that should
648  * be used whenever appropriate.
649  *
650  * Note that if any of @p w or @p h are @c NULL, the @c NULL
651  * parameters are ignored.
652  *
653  * @param obj The given evas object.
654  * @param   w Pointer to an integer in which to store the maximum width.
655  * @param   h Pointer to an integer in which to store the maximum height.
656  * @ingroup Evas_Object_Size_Hints_Group
657  */
658 EAPI void
659 evas_object_size_hint_max_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
660 {
661    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
662    if (w) *w = 0; if (h) *h = 0;
663    return;
664    MAGIC_CHECK_END();
665    if ((!obj->size_hints) || obj->delete_me)
666      {
667         if (w) *w = 0; if (h) *h = 0;
668         return;
669      }
670    if (w) *w = obj->size_hints->max.w;
671    if (h) *h = obj->size_hints->max.h;
672 }
673
674 /**
675  * Sets the size hint for the maximum size.
676  *
677  * This is not a size enforcement in any way, it's just a hint that should
678  * be used whenever appropriate.
679  *
680  * @param obj The given evas object.
681  * @param   w Integer to use as the maximum width hint.
682  * @param   h Integer to use as the maximum height hint.
683  * @ingroup Evas_Object_Size_Hints_Group
684  */
685 EAPI void
686 evas_object_size_hint_max_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
687 {
688    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
689    return;
690    MAGIC_CHECK_END();
691    if (obj->delete_me)
692      return;
693    if (!obj->size_hints)
694      obj->size_hints = calloc(1, sizeof(Evas_Size_Hints));
695
696    obj->size_hints->max.w = w;
697    obj->size_hints->max.h = h;
698
699    evas_object_inform_call_changed_size_hints(obj);
700 }
701
702 /**
703  * Retrieves the size request hint.
704  *
705  * This is not a size enforcement in any way, it's just a hint that should
706  * be used whenever appropriate.
707  *
708  * Note that if any of @p w or @p h are @c NULL, the @c NULL
709  * parameters are ignored.
710  *
711  * @param obj The given evas object.
712  * @param   w Pointer to an integer in which to store the requested width.
713  * @param   h Pointer to an integer in which to store the requested height.
714  * @ingroup Evas_Object_Size_Hints_Group
715  */
716 EAPI void
717 evas_object_size_hint_request_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
718 {
719    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
720    if (w) *w = 0; if (h) *h = 0;
721    return;
722    MAGIC_CHECK_END();
723    if ((!obj->size_hints) || obj->delete_me)
724      {
725         if (w) *w = 0; if (h) *h = 0;
726         return;
727      }
728    if (w) *w = obj->size_hints->request.w;
729    if (h) *h = obj->size_hints->request.h;
730 }
731
732 /**
733  * Sets the requested size hint.
734  *
735  * This is not a size enforcement in any way, it's just a hint that should
736  * be used whenever appropriate.
737  *
738  * @param obj The given evas object.
739  * @param   w Integer to use as the preferred width hint.
740  * @param   h Integer to use as the preferred height hint.
741  * @ingroup Evas_Object_Size_Hints_Group
742  */
743 EAPI void
744 evas_object_size_hint_request_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
745 {
746    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
747    return;
748    MAGIC_CHECK_END();
749    if (obj->delete_me)
750      return;
751    if (!obj->size_hints)
752      obj->size_hints = calloc(1, sizeof(Evas_Size_Hints));
753
754    obj->size_hints->request.w = w;
755    obj->size_hints->request.h = h;
756
757    evas_object_inform_call_changed_size_hints(obj);
758 }
759
760 /**
761  * Retrieves the size aspect control hint.
762  *
763  * This is not a size enforcement in any way, it's just a hint that should
764  * be used whenever appropriate.
765  *
766  * Note that if any of @p aspect, @p w or @p h are @c NULL, the @c NULL
767  * parameters are ignored.
768  *
769  * @param    obj The given evas object.
770  * @param aspect Returns the hint on how size should be calculated.
771  * @param      w Pointer to an integer in which to store the aspect width.
772  * @param      h Pointer to an integer in which to store the aspect height.
773  * @ingroup Evas_Object_Size_Hints_Group
774  */
775 EAPI void
776 evas_object_size_hint_aspect_get(const Evas_Object *obj, Evas_Aspect_Control *aspect, Evas_Coord *w, Evas_Coord *h)
777 {
778    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
779    if (aspect) *aspect = EVAS_ASPECT_CONTROL_NONE;
780    if (w) *w = 0; if (h) *h = 0;
781    return;
782    MAGIC_CHECK_END();
783    if ((!obj->size_hints) || obj->delete_me)
784      {
785         if (aspect) *aspect = EVAS_ASPECT_CONTROL_NONE;
786         if (w) *w = 0; if (h) *h = 0;
787         return;
788      }
789    if (aspect) *aspect = obj->size_hints->aspect.mode;
790    if (w) *w = obj->size_hints->aspect.size.w;
791    if (h) *h = obj->size_hints->aspect.size.h;
792 }
793
794 /**
795  * Sets the size aspect control hint.
796  *
797  * This is not a size enforcement in any way, it's just a hint that should
798  * be used whenever appropriate.
799  *
800  * @param    obj The given evas object.
801  * @param aspect Hint on how to calculate size.
802  * @param      w Integer to use as aspect width hint.
803  * @param      h Integer to use as aspect height hint.
804  * @ingroup Evas_Object_Size_Hints_Group
805  */
806 EAPI void
807 evas_object_size_hint_aspect_set(Evas_Object *obj, Evas_Aspect_Control aspect, Evas_Coord w, Evas_Coord h)
808 {
809    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
810    return;
811    MAGIC_CHECK_END();
812    if (obj->delete_me)
813      return;
814    if (!obj->size_hints)
815      obj->size_hints = calloc(1, sizeof(Evas_Size_Hints));
816
817    obj->size_hints->aspect.mode = aspect;
818    obj->size_hints->aspect.size.w = w;
819    obj->size_hints->aspect.size.h = h;
820
821    evas_object_inform_call_changed_size_hints(obj);
822 }
823
824
825 /**
826  * @defgroup Evas_Object_Visibility_Group Generic Object Visibility Functions
827  *
828  * Functions that deal with the visibility of evas objects.
829  */
830
831 /**
832  * Makes the given evas object visible.
833  * @param   obj The given evas object.
834  * @ingroup Evas_Object_Visibility_Group
835  */
836 EAPI void
837 evas_object_show(Evas_Object *obj)
838 {
839    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
840    return;
841    MAGIC_CHECK_END();
842    if (obj->delete_me) return;
843    if (evas_object_intercept_call_show(obj)) return;
844    if (obj->smart.smart)
845      {
846        if (obj->smart.smart->smart_class->show)
847           obj->smart.smart->smart_class->show(obj);
848      }
849    if (obj->cur.visible)
850      {
851         evas_object_inform_call_show(obj);
852         return;
853      }
854    obj->cur.visible = 1;
855    evas_object_change(obj);
856    evas_object_clip_dirty(obj);
857    if (obj->layer->evas->events_frozen <= 0)
858      {
859         evas_object_recalc_clippees(obj);
860         if (!evas_event_passes_through(obj))
861           {
862              if (!obj->smart.smart)
863                {
864                   if (evas_object_is_in_output_rect(obj,
865                                                     obj->layer->evas->pointer.x,
866                                                     obj->layer->evas->pointer.y, 1, 1))
867                     evas_event_feed_mouse_move(obj->layer->evas,
868                                                obj->layer->evas->pointer.x,
869                                                obj->layer->evas->pointer.y,
870                                                obj->layer->evas->last_timestamp,
871                                                NULL);
872                }
873           }
874      }
875    evas_object_inform_call_show(obj);
876 }
877
878 /**
879  * Makes the given evas object invisible.
880  * @param   obj The given evas object.
881  * @ingroup Evas_Object_Visibility_Group
882  */
883 EAPI void
884 evas_object_hide(Evas_Object *obj)
885 {
886    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
887    return;
888    MAGIC_CHECK_END();
889    if (obj->delete_me) return;
890    if (evas_object_intercept_call_hide(obj)) return;
891    if (obj->smart.smart)
892      {
893        if (obj->smart.smart->smart_class->hide)
894           obj->smart.smart->smart_class->hide(obj);
895      }
896    if (!obj->cur.visible)
897      {
898         evas_object_inform_call_hide(obj);
899         return;
900      }
901    obj->cur.visible = 0;
902    evas_object_change(obj);
903    evas_object_clip_dirty(obj);
904    if (obj->layer->evas->events_frozen <= 0)
905      {
906         evas_object_recalc_clippees(obj);
907         if (!evas_event_passes_through(obj))
908           {
909              if (!obj->smart.smart)
910                {
911                   if (evas_object_is_in_output_rect(obj,
912                                                     obj->layer->evas->pointer.x,
913                                                     obj->layer->evas->pointer.y, 1, 1))
914                     evas_event_feed_mouse_move(obj->layer->evas,
915                                                obj->layer->evas->pointer.x,
916                                                obj->layer->evas->pointer.y,
917                                                obj->layer->evas->last_timestamp,
918                                                NULL);
919                   if (obj->delete_me) return;
920                   if (obj->mouse_grabbed > 0)
921                     {
922 //                     if (obj->layer->evas->pointer.mouse_grabbed >= obj->mouse_grabbed)
923                          obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
924                     }
925                     {
926                        if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
927                          {
928                             obj->layer->evas->pointer.object.in = evas_list_remove(obj->layer->evas->pointer.object.in, obj);
929                          }
930                        obj->mouse_grabbed = 0;
931                        if (obj->layer->evas->events_frozen > 0)
932                          {
933                             obj->mouse_in = 0;
934                             return;
935                          }
936                        if (obj->mouse_in)
937                          {
938                             Evas_Event_Mouse_Out ev;
939                             
940                             obj->mouse_in = 0;
941                             ev.buttons = obj->layer->evas->pointer.button;
942                             ev.output.x = obj->layer->evas->pointer.x;
943                             ev.output.y = obj->layer->evas->pointer.y;
944                             ev.canvas.x = obj->layer->evas->pointer.x;
945                             ev.canvas.y = obj->layer->evas->pointer.y;
946                             ev.data = NULL;
947                             ev.modifiers = &(obj->layer->evas->modifiers);
948                             ev.locks = &(obj->layer->evas->locks);
949                             evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
950                          }
951                     }
952                }
953           }
954      }
955    else
956      {
957         if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
958           obj->layer->evas->pointer.object.in = evas_list_remove(obj->layer->evas->pointer.object.in, obj);
959         obj->mouse_grabbed = 0;
960         obj->mouse_in = 0;
961      }
962    evas_object_inform_call_hide(obj);
963 }
964
965 /**
966  * Retrieves whether or not the given evas object is visible.
967  * @param   obj The given evas object.
968  * @return  @c 1 if the object is visible.  @c 0 otherwise.
969  * @ingroup Evas_Object_Visibility_Group
970  */
971 EAPI Evas_Bool
972 evas_object_visible_get(const Evas_Object *obj)
973 {
974    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
975    return 0;
976    MAGIC_CHECK_END();
977    if (obj->delete_me) return 0;
978    return obj->cur.visible;
979 }
980
981 /**
982  * Sets the general colour of the given evas object to the given colour.
983  * @param obj The given evas object.
984  * @param r   The red component of the given colour.
985  * @param g   The green component of the given colour.
986  * @param b   The blue component of the given colour.
987  * @param a   The alpha component of the given colour.
988  * @ingroup Evas_Object_Group
989  */
990 EAPI void
991 evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a)
992 {
993    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
994    return;
995    MAGIC_CHECK_END();
996    if (obj->delete_me) return;
997    if (r > 255) r = 255; if (r < 0) r = 0;
998    if (g > 255) g = 255; if (g < 0) g = 0;
999    if (b > 255) b = 255; if (b < 0) b = 0;
1000    if (a > 255) a = 255; if (a < 0) a = 0;
1001    if (evas_object_intercept_call_color_set(obj, r, g, b, a)) return;
1002    if (obj->smart.smart)
1003      {
1004        if (obj->smart.smart->smart_class->color_set)
1005           obj->smart.smart->smart_class->color_set(obj, r, g, b, a);
1006      }
1007    if ((obj->cur.color.r == r) &&
1008        (obj->cur.color.g == g) &&
1009        (obj->cur.color.b == b) &&
1010        (obj->cur.color.a == a)) return;
1011    obj->cur.color.r = r;
1012    obj->cur.color.g = g;
1013    obj->cur.color.b = b;
1014    if ((obj->cur.color.a == 0) && (a == 0)) return;
1015    obj->cur.color.a = a;
1016    evas_object_change(obj);
1017 }
1018
1019 /**
1020  * Retrieves the general colour of the given evas object.
1021  *
1022  * Note that if any of @p r, @p g, @p b or @p a are @c NULL, then the
1023  * @c NULL parameters are ignored.
1024  *
1025  * @param   obj The given evas object.
1026  * @param   r   Pointer to an integer in which to store the red component of
1027  *              the colour.
1028  * @param   g   Pointer to an integer in which to store the green component of
1029  *              the colour.
1030  * @param   b   Pointer to an integer in which to store the blue component of
1031  *              the colour.
1032  * @param   a   Pointer to an integer in which to store the alpha component of
1033  *              the colour.
1034  * @ingroup Evas_Object_Group
1035  */
1036 EAPI void
1037 evas_object_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
1038 {
1039    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1040    if (r) *r = 0; if (g) *g = 0; if (b) *b = 0; if (a) *a = 0;
1041    return;
1042    MAGIC_CHECK_END();
1043    if (obj->delete_me)
1044      {
1045         if (r) *r = 0; if (g) *g = 0; if (b) *b = 0; if (a) *a = 0;
1046         return;
1047      }
1048    if (r) *r = obj->cur.color.r;
1049    if (g) *g = obj->cur.color.g;
1050    if (b) *b = obj->cur.color.b;
1051    if (a) *a = obj->cur.color.a;
1052 }
1053
1054 /**
1055  * Sets whether or not the given evas object is to be drawn anti_aliased.
1056  * @param   obj The given evas object.
1057  * @param   anti_alias. 1 if the object is to be anti_aliased, 0 otherwise.
1058  * @ingroup Evas_Object_Group
1059  */
1060 EAPI void
1061 evas_object_anti_alias_set(Evas_Object *obj, Evas_Bool anti_alias)
1062 {
1063    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1064    return;
1065    MAGIC_CHECK_END();
1066    if (obj->delete_me) return;
1067    if (obj->cur.anti_alias == !!anti_alias)
1068         return;
1069    obj->cur.anti_alias = !!anti_alias;
1070    evas_object_change(obj);
1071 }
1072
1073
1074 /**
1075  * Retrieves whether or not the given evas object is to be drawn anti_aliased.
1076  * @param   obj The given evas object.
1077  * @return  @c 1 if the object is to be anti_aliased.  @c 0 otherwise.
1078  * @ingroup Evas_Object_Group
1079  */
1080 EAPI Evas_Bool
1081 evas_object_anti_alias_get(const Evas_Object *obj)
1082 {
1083    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1084    return 0;
1085    MAGIC_CHECK_END();
1086    if (obj->delete_me) return 0;
1087    return obj->cur.anti_alias;
1088 }
1089
1090 /**
1091  * Sets the color_space to be used for linear interpolation of colors.
1092  * @param   obj The given evas object.
1093  * @param   color_space, one of EVAS_COLOR_SPACE_ARGB or EVAS_COLOR_SPACE_AHSV.
1094  * @ingroup Evas_Object_Group
1095  */
1096 EAPI void
1097 evas_object_color_interpolation_set(Evas_Object *obj, int color_space)
1098 {
1099    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1100    return;
1101    MAGIC_CHECK_END();
1102    if (obj->delete_me) return;
1103    if (obj->cur.interpolation_color_space == color_space)
1104         return;
1105    obj->cur.interpolation_color_space = color_space;
1106    evas_object_change(obj);
1107 }
1108
1109
1110 /**
1111  * Retrieves the current value of the color space used for linear interpolation.
1112  * @param   obj The given evas object.
1113  * @return  @c EVAS_COLOR_SPACE_ARGB or EVAS_COLOR_SPACE_AHSV.
1114  * @ingroup Evas_Object_Group
1115  */
1116 EAPI int
1117 evas_object_color_interpolation_get(const Evas_Object *obj)
1118 {
1119    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1120    return 0;
1121    MAGIC_CHECK_END();
1122    if (obj->delete_me) return 0;
1123    return obj->cur.interpolation_color_space;
1124 }
1125
1126 /**
1127  * Sets the render_op to be used for rendering the evas object.
1128  * @param   obj The given evas object.
1129  * @param   render_op one of the Evas_Render_Op values.
1130  * @ingroup Evas_Object_Group
1131  */
1132 EAPI void
1133 evas_object_render_op_set(Evas_Object *obj, Evas_Render_Op render_op)
1134 {
1135    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1136    return;
1137    MAGIC_CHECK_END();
1138    if (obj->delete_me) return;
1139    if ((Evas_Render_Op)obj->cur.render_op == render_op)
1140         return;
1141    obj->cur.render_op = render_op;
1142    evas_object_change(obj);
1143 }
1144
1145
1146 /**
1147  * Retrieves the current value of the operation used for rendering the evas object.
1148  * @param   obj The given evas object.
1149  * @return  one of the enumerated values in Evas_Render_Op.
1150  * @ingroup Evas_Object_Group
1151  */
1152 EAPI Evas_Render_Op
1153 evas_object_render_op_get(const Evas_Object *obj)
1154 {
1155    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1156    return 0;
1157    MAGIC_CHECK_END();
1158    if (obj->delete_me) return EVAS_RENDER_BLEND;
1159    return obj->cur.render_op;
1160 }
1161
1162 /**
1163  * Retrieves the evas that the given evas object is on.
1164  * @param   obj The given evas object.
1165  * @return  The evas that the object is on.
1166  * @ingroup Evas_Object_Group
1167  */
1168 EAPI Evas *
1169 evas_object_evas_get(const Evas_Object *obj)
1170 {
1171    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1172    return NULL;
1173    MAGIC_CHECK_END();
1174    if (obj->delete_me) return 0;
1175    return obj->layer->evas;
1176 }
1177
1178 /**
1179  * @defgroup Evas_Object_Finders Object Finder Functions
1180  *
1181  * Functions that determine what evas objects are at a given location
1182  * or within a given region of an evas.
1183  */
1184
1185 /**
1186  * To be documented.
1187  *
1188  * FIXME: To be fixed.
1189  * @ingroup Evas_Object_Finders
1190  */
1191 EAPI Evas_Object *
1192 evas_object_top_at_xy_get(const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects)
1193 {
1194    Evas_Object_List *l;
1195    int xx, yy;
1196
1197    MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1198    return NULL;
1199    MAGIC_CHECK_END();
1200    xx = x;
1201    yy = y;
1202 ////   xx = evas_coord_world_x_to_screen(e, x);
1203 ////   yy = evas_coord_world_y_to_screen(e, y);
1204    for (l = ((Evas_Object_List *)(e->layers))->last; l; l = l->prev)
1205      {
1206         Evas_Object_List *l2;
1207         Evas_Layer *lay;
1208
1209         lay = (Evas_Layer *)l;
1210         for (l2 = get_layer_objects_last(lay); l2; l2 = l2->prev)
1211           {
1212              Evas_Object *obj;
1213
1214              obj = (Evas_Object *)l2;
1215              if (obj->delete_me) continue;
1216              if ((!include_pass_events_objects) && (evas_event_passes_through(obj))) continue;
1217              if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
1218              evas_object_clip_recalc(obj);
1219              if ((evas_object_is_in_output_rect(obj, xx, yy, 1, 1)) &&
1220                  (!obj->clip.clipees))
1221                return obj;
1222           }
1223      }
1224    return NULL;
1225 }
1226
1227 /**
1228  * To be documented.
1229  *
1230  * FIXME: To be fixed.
1231  * @ingroup Evas_Object_Finders
1232  */
1233 EAPI Evas_Object *
1234 evas_object_top_at_pointer_get(const Evas *e)
1235 {
1236 ////   return evas_object_top_at_xy_get(e, e->pointer.canvas_x, e->pointer.canvas_y, 0, 0);
1237    return evas_object_top_at_xy_get(e, e->pointer.x, e->pointer.y, 1, 1);
1238 }
1239
1240 /**
1241  * To be documented.
1242  *
1243  * FIXME: To be fixed.
1244  * @ingroup Evas_Object_Finders
1245  */
1246 EAPI Evas_Object *
1247 evas_object_top_in_rectangle_get(const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects)
1248 {
1249    Evas_Object_List *l;
1250    int xx, yy, ww, hh;
1251
1252    MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1253    return NULL;
1254    MAGIC_CHECK_END();
1255    xx = x;
1256    yy = y;
1257    ww = w;
1258    hh = h;
1259 ////   xx = evas_coord_world_x_to_screen(e, x);
1260 ////   yy = evas_coord_world_y_to_screen(e, y);
1261 ////   ww = evas_coord_world_x_to_screen(e, w);
1262 ////   hh = evas_coord_world_y_to_screen(e, h);
1263    if (ww < 1) ww = 1;
1264    if (hh < 1) hh = 1;
1265    for (l = ((Evas_Object_List *)(e->layers))->last; l; l = l->prev)
1266      {
1267         Evas_Object_List *l2;
1268         Evas_Layer *lay;
1269
1270         lay = (Evas_Layer *)l;
1271         for (l2 = get_layer_objects_last(lay); l2; l2 = l2->prev)
1272           {
1273              Evas_Object *obj;
1274
1275              obj = (Evas_Object *)l2;
1276              if (obj->delete_me) continue;
1277              if ((!include_pass_events_objects) && (evas_event_passes_through(obj))) continue;
1278              if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
1279              evas_object_clip_recalc(obj);
1280              if ((evas_object_is_in_output_rect(obj, xx, yy, ww, hh)) &&
1281                  (!obj->clip.clipees))
1282                return obj;
1283           }
1284      }
1285    return NULL;
1286 }
1287
1288 /**
1289  * To be documented.
1290  *
1291  * FIXME: To be fixed.
1292  * @ingroup Evas_Object_Finders
1293  */
1294 EAPI Evas_List *
1295 evas_objects_at_xy_get(const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects)
1296 {
1297    Evas_List *in = NULL;
1298    Evas_Object_List *l;
1299    int xx, yy;
1300
1301    MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1302    return NULL;
1303    MAGIC_CHECK_END();
1304    xx = x;
1305    yy = y;
1306 ////   xx = evas_coord_world_x_to_screen(e, x);
1307 ////   yy = evas_coord_world_y_to_screen(e, y);
1308    for (l = ((Evas_Object_List *)(e->layers))->last; l; l = l->prev)
1309      {
1310         Evas_Object_List *l2;
1311         Evas_Layer *lay;
1312
1313         lay = (Evas_Layer *)l;
1314         for (l2 = get_layer_objects_last(lay); l2; l2 = l2->prev)
1315           {
1316              Evas_Object *obj;
1317
1318              obj = (Evas_Object *)l2;
1319              if (obj->delete_me) continue;
1320              if ((!include_pass_events_objects) && (evas_event_passes_through(obj))) continue;
1321              if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
1322              evas_object_clip_recalc(obj);
1323              if ((evas_object_is_in_output_rect(obj, xx, yy, 1, 1)) &&
1324                  (!obj->clip.clipees))
1325                in = evas_list_prepend(in, obj);
1326           }
1327      }
1328    return in;
1329 }
1330
1331 /**
1332  * To be documented.
1333  *
1334  * FIXME: To be fixed.
1335  * @ingroup Evas_Object_Finders
1336  */
1337 EAPI Evas_List *
1338 evas_objects_in_rectangle_get(const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects)
1339 {
1340    Evas_List *in = NULL;
1341    Evas_Object_List *l;
1342    int xx, yy, ww, hh;
1343
1344    MAGIC_CHECK(e, Evas, MAGIC_EVAS);
1345    return NULL;
1346    MAGIC_CHECK_END();
1347    xx = x;
1348    yy = y;
1349    ww = w;                                
1350    hh = h;
1351 ////   xx = evas_coord_world_x_to_screen(e, x);
1352 ////   yy = evas_coord_world_y_to_screen(e, y);
1353 ////   ww = evas_coord_world_x_to_screen(e, w);
1354 ////   hh = evas_coord_world_y_to_screen(e, h);
1355    if (ww < 1) ww = 1;
1356    if (hh < 1) hh = 1;
1357    for (l = ((Evas_Object_List *)(e->layers))->last; l; l = l->prev)
1358      {
1359         Evas_Object_List *l2;
1360         Evas_Layer *lay;
1361
1362         lay = (Evas_Layer *)l;
1363         for (l2 = get_layer_objects_last(lay); l2; l2 = l2->prev)
1364           {
1365              Evas_Object *obj;
1366
1367              obj = (Evas_Object *)l2;
1368              if (obj->delete_me) continue;
1369              if ((!include_pass_events_objects) && (evas_event_passes_through(obj))) continue;
1370              if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
1371              evas_object_clip_recalc(obj);
1372              if ((evas_object_is_in_output_rect(obj, xx, yy, ww, hh)) &&
1373                  (!obj->clip.clipees))
1374                in = evas_list_prepend(in, obj);
1375           }
1376      }
1377    return in;
1378 }
1379
1380 /**
1381  * Retrieves the name of the type of the given evas object.
1382  * @param   obj The given object.
1383  * @return  The name.
1384  * @ingroup Evas_Object_Group
1385  */
1386 EAPI const char *
1387 evas_object_type_get(const Evas_Object *obj)
1388 {
1389    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1390    return NULL;
1391    MAGIC_CHECK_END();
1392    if (obj->delete_me) return "";
1393    return obj->type;
1394 }
1395
1396 /**
1397  * Set whether to use a precise (usually expensive) point collision detection.
1398  * @param obj The given object.
1399  * @param precise wheter to use a precise point collision detection or not
1400  * The default value is false.
1401  * @ingroup Evas_Object_Group
1402  */
1403 EAPI void
1404 evas_object_precise_is_inside_set(Evas_Object *obj, Evas_Bool precise)
1405 {
1406    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1407    return;
1408    MAGIC_CHECK_END();
1409    obj->precise_is_inside = precise;
1410 }
1411
1412 /**
1413  * Determine whether an object is set to use a precise point collision detection.
1414  * @param obj The given object.
1415  * @ingroup Evas_Object_Group
1416  */
1417 EAPI Evas_Bool
1418 evas_object_precise_is_inside_get(const Evas_Object *obj)
1419 {
1420    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1421    return 0;
1422    MAGIC_CHECK_END();
1423    return obj->precise_is_inside;
1424 }