Merge "[datetime_input_ctxpopup.c] Default AM/PM strings are added to display, incase...
[framework/uifw/elementary.git] / src / lib / els_cursor.c
1 #include <Elementary.h>
2 #include <Elementary_Cursor.h>
3 #include "elm_priv.h"
4
5 #ifdef HAVE_ELEMENTARY_X
6 #include <Ecore_X.h>
7 #include <Ecore_X_Cursor.h>
8 #endif
9
10 #define _cursor_key "_elm_cursor"
11
12 struct _Cursor_Id
13 {
14    const char *name;
15 #ifdef HAVE_ELEMENTARY_X
16    int id;
17 #endif
18 };
19
20 #ifdef HAVE_ELEMENTARY_X
21 #define CURSOR(_name, _xid) \
22    {_name , _xid}
23 # else
24 #define CURSOR(_name, _xid) \
25    {_name}
26 #endif
27
28 /* Please keep order in sync with Ecore_X_Cursor.h values! */
29 struct _Cursor_Id _cursors[] =
30 {
31    CURSOR(ELM_CURSOR_X                  , ECORE_X_CURSOR_X                  ),
32    CURSOR(ELM_CURSOR_ARROW              , ECORE_X_CURSOR_ARROW              ),
33    CURSOR(ELM_CURSOR_BASED_ARROW_DOWN   , ECORE_X_CURSOR_BASED_ARROW_DOWN   ),
34    CURSOR(ELM_CURSOR_BASED_ARROW_UP     , ECORE_X_CURSOR_UP                 ),
35    CURSOR(ELM_CURSOR_BOAT               , ECORE_X_CURSOR_BOAT               ),
36    CURSOR(ELM_CURSOR_BOGOSITY           , ECORE_X_CURSOR_BOGOSITY           ),
37    CURSOR(ELM_CURSOR_BOTTOM_LEFT_CORNER , ECORE_X_CURSOR_BOTTOM_LEFT_CORNER ),
38    CURSOR(ELM_CURSOR_BOTTOM_RIGHT_CORNER, ECORE_X_CURSOR_BOTTOM_RIGHT_CORNER),
39    CURSOR(ELM_CURSOR_BOTTOM_SIDE        , ECORE_X_CURSOR_BOTTOM_SIDE        ),
40    CURSOR(ELM_CURSOR_BOTTOM_TEE         , ECORE_X_CURSOR_BOTTOM_TEE         ),
41    CURSOR(ELM_CURSOR_BOX_SPIRAL         , ECORE_X_CURSOR_BOX_SPIRAL         ),
42    CURSOR(ELM_CURSOR_CENTER_PTR         , ECORE_X_CURSOR_CENTER_PTR         ),
43    CURSOR(ELM_CURSOR_CIRCLE             , ECORE_X_CURSOR_CIRCLE             ),
44    CURSOR(ELM_CURSOR_CLOCK              , ECORE_X_CURSOR_CLOCK              ),
45    CURSOR(ELM_CURSOR_COFFEE_MUG         , ECORE_X_CURSOR_COFFEE_MUG         ),
46    CURSOR(ELM_CURSOR_CROSS              , ECORE_X_CURSOR_CROSS              ),
47    CURSOR(ELM_CURSOR_CROSS_REVERSE      , ECORE_X_CURSOR_CROSS_REVERSE      ),
48    CURSOR(ELM_CURSOR_CROSSHAIR          , ECORE_X_CURSOR_CROSSHAIR          ),
49    CURSOR(ELM_CURSOR_DIAMOND_CROSS      , ECORE_X_CURSOR_DIAMOND_CROSS      ),
50    CURSOR(ELM_CURSOR_DOT                , ECORE_X_CURSOR_DOT                ),
51    CURSOR(ELM_CURSOR_DOT_BOX_MASK       , ECORE_X_CURSOR_DOT_BOX_MASK       ),
52    CURSOR(ELM_CURSOR_DOUBLE_ARROW       , ECORE_X_CURSOR_DOUBLE_ARROW       ),
53    CURSOR(ELM_CURSOR_DRAFT_LARGE        , ECORE_X_CURSOR_DRAFT_LARGE        ),
54    CURSOR(ELM_CURSOR_DRAFT_SMALL        , ECORE_X_CURSOR_DRAFT_SMALL        ),
55    CURSOR(ELM_CURSOR_DRAPED_BOX         , ECORE_X_CURSOR_DRAPED_BOX         ),
56    CURSOR(ELM_CURSOR_EXCHANGE           , ECORE_X_CURSOR_EXCHANGE           ),
57    CURSOR(ELM_CURSOR_FLEUR              , ECORE_X_CURSOR_FLEUR              ),
58    CURSOR(ELM_CURSOR_GOBBLER            , ECORE_X_CURSOR_GOBBLER            ),
59    CURSOR(ELM_CURSOR_GUMBY              , ECORE_X_CURSOR_GUMBY              ),
60    CURSOR(ELM_CURSOR_HAND1              , ECORE_X_CURSOR_HAND1              ),
61    CURSOR(ELM_CURSOR_HAND2              , ECORE_X_CURSOR_HAND2              ),
62    CURSOR(ELM_CURSOR_HEART              , ECORE_X_CURSOR_HEART              ),
63    CURSOR(ELM_CURSOR_ICON               , ECORE_X_CURSOR_ICON               ),
64    CURSOR(ELM_CURSOR_IRON_CROSS         , ECORE_X_CURSOR_IRON_CROSS         ),
65    CURSOR(ELM_CURSOR_LEFT_PTR           , ECORE_X_CURSOR_LEFT_PTR           ),
66    CURSOR(ELM_CURSOR_LEFT_SIDE          , ECORE_X_CURSOR_LEFT_SIDE          ),
67    CURSOR(ELM_CURSOR_LEFT_TEE           , ECORE_X_CURSOR_LEFT_TEE           ),
68    CURSOR(ELM_CURSOR_LEFTBUTTON         , ECORE_X_CURSOR_LEFTBUTTON         ),
69    CURSOR(ELM_CURSOR_LL_ANGLE           , ECORE_X_CURSOR_LL_ANGLE           ),
70    CURSOR(ELM_CURSOR_LR_ANGLE           , ECORE_X_CURSOR_LR_ANGLE           ),
71    CURSOR(ELM_CURSOR_MAN                , ECORE_X_CURSOR_MAN                ),
72    CURSOR(ELM_CURSOR_MIDDLEBUTTON       , ECORE_X_CURSOR_MIDDLEBUTTON       ),
73    CURSOR(ELM_CURSOR_MOUSE              , ECORE_X_CURSOR_MOUSE              ),
74    CURSOR(ELM_CURSOR_PENCIL             , ECORE_X_CURSOR_PENCIL             ),
75    CURSOR(ELM_CURSOR_PIRATE             , ECORE_X_CURSOR_PIRATE             ),
76    CURSOR(ELM_CURSOR_PLUS               , ECORE_X_CURSOR_PLUS               ),
77    CURSOR(ELM_CURSOR_QUESTION_ARROW     , ECORE_X_CURSOR_QUESTION_ARROW     ),
78    CURSOR(ELM_CURSOR_RIGHT_PTR          , ECORE_X_CURSOR_RIGHT_PTR          ),
79    CURSOR(ELM_CURSOR_RIGHT_SIDE         , ECORE_X_CURSOR_RIGHT_SIDE         ),
80    CURSOR(ELM_CURSOR_RIGHT_TEE          , ECORE_X_CURSOR_RIGHT_TEE          ),
81    CURSOR(ELM_CURSOR_RIGHTBUTTON        , ECORE_X_CURSOR_RIGHTBUTTON        ),
82    CURSOR(ELM_CURSOR_RTL_LOGO           , ECORE_X_CURSOR_RTL_LOGO           ),
83    CURSOR(ELM_CURSOR_SAILBOAT           , ECORE_X_CURSOR_SAILBOAT           ),
84    CURSOR(ELM_CURSOR_SB_DOWN_ARROW      , ECORE_X_CURSOR_SB_DOWN_ARROW      ),
85    CURSOR(ELM_CURSOR_SB_H_DOUBLE_ARROW  , ECORE_X_CURSOR_SB_H_DOUBLE_ARROW  ),
86    CURSOR(ELM_CURSOR_SB_LEFT_ARROW      , ECORE_X_CURSOR_SB_LEFT_ARROW      ),
87    CURSOR(ELM_CURSOR_SB_RIGHT_ARROW     , ECORE_X_CURSOR_SB_RIGHT_ARROW     ),
88    CURSOR(ELM_CURSOR_SB_UP_ARROW        , ECORE_X_CURSOR_SB_UP_ARROW        ),
89    CURSOR(ELM_CURSOR_SB_V_DOUBLE_ARROW  , ECORE_X_CURSOR_SB_V_DOUBLE_ARROW  ),
90    CURSOR(ELM_CURSOR_SHUTTLE            , ECORE_X_CURSOR_SHUTTLE            ),
91    CURSOR(ELM_CURSOR_SIZING             , ECORE_X_CURSOR_SIZING             ),
92    CURSOR(ELM_CURSOR_SPIDER             , ECORE_X_CURSOR_SPIDER             ),
93    CURSOR(ELM_CURSOR_SPRAYCAN           , ECORE_X_CURSOR_SPRAYCAN           ),
94    CURSOR(ELM_CURSOR_STAR               , ECORE_X_CURSOR_STAR               ),
95    CURSOR(ELM_CURSOR_TARGET             , ECORE_X_CURSOR_TARGET             ),
96    CURSOR(ELM_CURSOR_TCROSS             , ECORE_X_CURSOR_TCROSS             ),
97    CURSOR(ELM_CURSOR_TOP_LEFT_ARROW     , ECORE_X_CURSOR_TOP_LEFT_ARROW     ),
98    CURSOR(ELM_CURSOR_TOP_LEFT_CORNER    , ECORE_X_CURSOR_TOP_LEFT_CORNER    ),
99    CURSOR(ELM_CURSOR_TOP_RIGHT_CORNER   , ECORE_X_CURSOR_TOP_RIGHT_CORNER   ),
100    CURSOR(ELM_CURSOR_TOP_SIDE           , ECORE_X_CURSOR_TOP_SIDE           ),
101    CURSOR(ELM_CURSOR_TOP_TEE            , ECORE_X_CURSOR_TOP_TEE            ),
102    CURSOR(ELM_CURSOR_TREK               , ECORE_X_CURSOR_TREK               ),
103    CURSOR(ELM_CURSOR_UL_ANGLE           , ECORE_X_CURSOR_UL_ANGLE           ),
104    CURSOR(ELM_CURSOR_UMBRELLA           , ECORE_X_CURSOR_UMBRELLA           ),
105    CURSOR(ELM_CURSOR_UR_ANGLE           , ECORE_X_CURSOR_UR_ANGLE           ),
106    CURSOR(ELM_CURSOR_WATCH              , ECORE_X_CURSOR_WATCH              ),
107    CURSOR(ELM_CURSOR_XTERM              , ECORE_X_CURSOR_XTERM              )
108 };
109 static const int _cursors_count = sizeof(_cursors)/sizeof(struct _Cursor_Id);
110
111 #define ELM_CURSOR_GET_OR_RETURN(cur, obj, ...)         \
112   Elm_Cursor *cur;                                      \
113   do                                                    \
114     {                                                   \
115        if (!(obj))                                      \
116          {                                              \
117             CRITICAL("Null pointer: " #obj);            \
118             return __VA_ARGS__;                         \
119          }                                              \
120        cur = evas_object_data_get((obj), _cursor_key);  \
121        if (!cur)                                        \
122          {                                              \
123             ERR("Object does not have cursor: " #obj);  \
124             return __VA_ARGS__;                         \
125          }                                              \
126     }                                                   \
127   while (0)
128
129 struct _Elm_Cursor
130 {
131    Evas_Object *obj;
132    Evas_Object *eventarea, *owner;
133    const char *style, *cursor_name;
134    int hot_x, hot_y;
135    Ecore_Evas *ee;
136    Evas *evas;
137 #ifdef HAVE_ELEMENTARY_X
138    Ecore_X_Cursor cursor;
139    Ecore_X_Window win;
140 #endif
141    Eina_Bool visible:1;
142    Eina_Bool use_engine:1;
143    Eina_Bool engine_only:1;
144 };
145
146 static void
147 _elm_cursor_obj_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
148 {
149    Elm_Cursor *cur = data;
150    
151    if (cur)
152      {
153         evas_object_event_callback_del_full(cur->obj, EVAS_CALLBACK_DEL,
154                                             _elm_cursor_obj_del, cur);
155         cur->obj = NULL;
156      }
157 }
158
159 static Eina_Bool
160 _elm_cursor_obj_add(Evas_Object *obj, Elm_Cursor *cur)
161 {
162    int x, y;
163
164    cur->obj = edje_object_add(cur->evas);
165
166    if (!cur->obj)
167      return EINA_FALSE;
168
169    if (!_elm_theme_object_set(obj, cur->obj, "cursor", cur->cursor_name,
170                               cur->style ? cur->style : "default"))
171      {
172         evas_object_del(cur->obj);
173         cur->obj = NULL;
174         return EINA_FALSE;
175      }
176
177    evas_object_event_callback_add(cur->obj, EVAS_CALLBACK_DEL,
178                                   _elm_cursor_obj_del, cur);
179
180    edje_object_size_min_get(cur->obj, &x, &y);
181    evas_object_resize(cur->obj, x, y);
182    return EINA_TRUE;
183 }
184
185 static void
186 _elm_cursor_set_hot_spots(Elm_Cursor *cur)
187 {
188    const char *str;
189
190    str = edje_object_data_get(cur->obj, "hot_x");
191    if (str) cur->hot_x = atoi(str);
192    else cur->hot_x = 0;
193
194    str = edje_object_data_get(cur->obj, "hot_y");
195    if (str) cur->hot_y = atoi(str);
196    else cur->hot_y = 0;
197 }
198
199 static void
200 _elm_cursor_mouse_in(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
201 {
202    Elm_Cursor *cur = data;
203
204    if (cur->visible) return;
205    evas_event_freeze(cur->evas);
206    cur->visible = EINA_TRUE;
207    if ((!cur->engine_only) && (!cur->use_engine))
208      {
209         if (!cur->obj)
210           _elm_cursor_obj_add(cur->eventarea, cur);
211         ecore_evas_object_cursor_set(cur->ee, cur->obj,
212                                      ELM_OBJECT_LAYER_CURSOR, cur->hot_x,
213                                      cur->hot_y);
214      }
215    else
216      {
217 #ifdef HAVE_ELEMENTARY_X
218         if (cur->win)
219           ecore_x_window_cursor_set(cur->win, cur->cursor);
220 #endif
221      }
222    evas_event_thaw(cur->evas);
223 }
224
225 static void
226 _elm_cursor_mouse_out(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
227 {
228    Evas_Object *sobj_parent;
229    Elm_Cursor *pcur = NULL;
230    Elm_Cursor *cur = data;
231
232    if (!cur->visible) return;
233    evas_event_freeze(cur->evas);
234    cur->visible = EINA_FALSE;
235
236    sobj_parent = evas_object_data_get(cur->eventarea, "elm-parent");
237    while (sobj_parent)
238      {
239         pcur = evas_object_data_get((sobj_parent), _cursor_key);
240         if ((pcur) && (pcur->visible)) break;
241         sobj_parent = evas_object_data_get(sobj_parent, "elm-parent");
242      }
243
244    if (pcur)
245      {
246         pcur->visible = EINA_FALSE;
247         evas_event_thaw(cur->evas);
248         _elm_cursor_mouse_in(pcur, NULL, NULL, NULL);
249         return;
250      }
251
252    if ((!cur->engine_only) || (!cur->use_engine))
253      ecore_evas_object_cursor_set(cur->ee, NULL, ELM_OBJECT_LAYER_CURSOR,
254                                   cur->hot_x, cur->hot_y);
255    else
256      {
257 #ifdef HAVE_ELEMENTARY_X
258         if (cur->win)
259           ecore_x_window_cursor_set(cur->win, ECORE_X_CURSOR_X);
260 #endif
261      }
262    evas_event_thaw(cur->evas);
263 }
264
265 static void
266 _elm_cursor_del(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
267 {
268    elm_object_cursor_unset(obj);
269 }
270
271 #ifdef HAVE_ELEMENTARY_X
272 static int
273 _elm_cursor_strcmp(const void *data1, const void *data2)
274 {
275    const struct _Cursor_Id *c1 = data1;
276    const struct _Cursor_Id *c2 = data2;
277    return strcmp (c1->name, c2->name);
278 }
279 #endif
280
281 static void
282 _elm_cursor_cur_set(Elm_Cursor *cur)
283 {
284    if (cur->engine_only)
285      {
286         INF("Using only engine cursors");
287         cur->use_engine = EINA_TRUE;
288      }
289    else if (_elm_cursor_obj_add(cur->eventarea, cur))
290      {
291         _elm_cursor_set_hot_spots(cur);
292         cur->use_engine = EINA_FALSE;
293         elm_widget_cursor_add(cur->owner, cur);
294      }
295    else
296      {
297         INF("Cursor couldn't be found on theme: %s", cur->cursor_name);
298         cur->use_engine = EINA_TRUE;
299      }
300
301    if (cur->use_engine)
302      {
303 #ifdef HAVE_ELEMENTARY_X
304         struct _Cursor_Id *cur_id;
305
306         cur_id = bsearch(&(cur->cursor_name), _cursors, _cursors_count,
307                          sizeof(struct _Cursor_Id), _elm_cursor_strcmp);
308
309         cur->win = elm_win_xwindow_get(cur->eventarea);
310         if (cur->win)
311           {
312              if (!cur_id)
313                {
314                   INF("X cursor couldn't be found: %s. Using default.",
315                       cur->cursor_name);
316                   cur->cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_X);
317                }
318              else
319                 cur->cursor = ecore_x_cursor_shape_get(cur_id->id);
320           }
321 #endif
322      }
323 }
324
325 /**
326  * Set the cursor to be shown when mouse is over the object
327  *
328  * Set the cursor that will be displayed when mouse is over the
329  * object. The object can have only one cursor set to it, so if
330  * this function is called twice for an object, the previous set
331  * will be unset.
332  * If using X cursors, a definition of all the valid cursor names
333  * is listed on Elementary_Cursors.h. If an invalid name is set
334  * the default cursor will be used.
335  *
336  * This is an internal function that is used by objects with sub-items
337  * that want to provide different cursors for each of them. The @a
338  * owner object should be an elm_widget and will be used to track
339  * theme changes and to feed @a func and @a del_cb. The @a eventarea
340  * may be any object and is the one that should be used later on with
341  * elm_object_cursor apis, such as elm_object_cursor_unset().
342  *
343  * @param eventarea the object being attached a cursor.
344  * @param owner the elm_widget that owns this object, will be used to
345  *        track theme changes and to be used in @a func or @a del_cb.
346  * @param cursor the cursor name to be used.
347  *
348  * @internal
349  * @ingroup Cursors
350  */
351 void
352 elm_object_sub_cursor_set(Evas_Object *eventarea, Evas_Object *owner, const char *cursor)
353 {
354    Elm_Cursor *cur = NULL;
355
356    cur = evas_object_data_get(eventarea, _cursor_key);
357    if (cur)
358      elm_object_cursor_unset(eventarea);
359
360    if (!cursor) return;
361
362    cur = ELM_NEW(Elm_Cursor);
363    if (!cur) return;
364
365    cur->owner = owner;
366    cur->eventarea = eventarea;
367    cur->engine_only = _elm_config->cursor_engine_only;
368    cur->visible = EINA_FALSE;
369
370    cur->cursor_name = eina_stringshare_add(cursor);
371    if (!cur->cursor_name)
372      ERR("Could not store cursor name %s", cursor);
373
374    cur->evas = evas_object_evas_get(eventarea);
375    cur->ee = ecore_evas_ecore_evas_get(cur->evas);
376
377    _elm_cursor_cur_set(cur);
378
379    evas_object_data_set(eventarea, _cursor_key, cur);
380
381    evas_object_event_callback_add(eventarea, EVAS_CALLBACK_MOUSE_IN,
382                                   _elm_cursor_mouse_in, cur);
383    evas_object_event_callback_add(eventarea, EVAS_CALLBACK_MOUSE_OUT,
384                                   _elm_cursor_mouse_out, cur);
385    evas_object_event_callback_add(eventarea, EVAS_CALLBACK_DEL,
386                                   _elm_cursor_del, cur);
387 }
388
389 EAPI void
390 elm_object_cursor_set(Evas_Object *obj, const char *cursor)
391 {
392    EINA_SAFETY_ON_NULL_RETURN(obj);
393    elm_object_sub_cursor_set(obj, obj, cursor);
394 }
395
396 EAPI const char *
397 elm_object_cursor_get(const Evas_Object *obj)
398 {
399    ELM_CURSOR_GET_OR_RETURN(cur, obj, NULL);
400    return cur->cursor_name;
401 }
402
403 EAPI void
404 elm_object_cursor_unset(Evas_Object *obj)
405 {
406    ELM_CURSOR_GET_OR_RETURN(cur, obj);
407
408    eina_stringshare_del(cur->cursor_name);
409    eina_stringshare_del(cur->style);
410
411    if (cur->owner)
412      elm_widget_cursor_del(cur->owner, cur);
413
414    if (cur->obj)
415      {
416         evas_object_event_callback_del_full(cur->obj, EVAS_CALLBACK_DEL,
417                                             _elm_cursor_obj_del, cur);
418         evas_object_del(cur->obj);
419         cur->obj = NULL;
420      }
421
422    if (cur->visible)
423      {
424         if (!cur->use_engine)
425           ecore_evas_object_cursor_set(cur->ee, NULL, ELM_OBJECT_LAYER_CURSOR,
426                                        cur->hot_x, cur->hot_y);
427 #ifdef HAVE_ELEMENTARY_X
428         else if (cur->win)
429           ecore_x_window_cursor_set(cur->win, ECORE_X_CURSOR_X);
430 #endif
431      }
432
433    evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOUSE_IN,
434                                   _elm_cursor_mouse_in, cur);
435    evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOUSE_OUT,
436                                   _elm_cursor_mouse_out, cur);
437    evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL,
438                                        _elm_cursor_del, cur);
439    evas_object_data_del(obj, _cursor_key);
440    free(cur);
441 }
442
443 EAPI void
444 elm_object_cursor_style_set(Evas_Object *obj, const char *style)
445 {
446    ELM_CURSOR_GET_OR_RETURN(cur, obj);
447
448    if (!eina_stringshare_replace(&cur->style, style))
449      ERR("Could not set current style=%s", style);
450
451    if (cur->use_engine) return;
452
453    if (!cur->obj)
454      {
455         if (!_elm_cursor_obj_add(obj, cur))
456           ERR("Could not create cursor object");
457         else
458           _elm_cursor_set_hot_spots(cur);
459      }
460    else
461      {
462         if (!_elm_theme_object_set(obj, cur->obj, "cursor", cur->cursor_name,
463                                    style))
464           ERR("Could not apply the theme to the cursor style=%s", style);
465         else
466           _elm_cursor_set_hot_spots(cur);
467      }
468 }
469
470 EAPI const char *
471 elm_object_cursor_style_get(const Evas_Object *obj)
472 {
473    ELM_CURSOR_GET_OR_RETURN(cur, obj, NULL);
474    return cur->style ? cur->style : "default";
475 }
476
477 /**
478  * Notify cursor should recalculate its theme.
479  * @internal
480  */
481 void
482 elm_cursor_theme(Elm_Cursor *cur)
483 {
484    if ((!cur) || (!cur->obj)) return;
485    if (!_elm_theme_object_set(cur->eventarea, cur->obj, "cursor",
486                               cur->cursor_name, cur->style))
487      ERR("Could not apply the theme to the cursor style=%s", cur->style);
488    else
489      _elm_cursor_set_hot_spots(cur);
490 }
491
492 EAPI void
493 elm_object_cursor_theme_search_enabled_set(Evas_Object *obj, Eina_Bool theme_search)
494 {
495    ELM_CURSOR_GET_OR_RETURN(cur, obj);
496    cur->engine_only = theme_search;
497    if (cur->obj)
498      {
499         evas_object_del(cur->obj);
500         cur->obj = NULL;
501      }
502    _elm_cursor_cur_set(cur);
503 }
504
505
506 EAPI Eina_Bool
507 elm_object_cursor_theme_search_enabled_get(const Evas_Object *obj)
508 {
509    ELM_CURSOR_GET_OR_RETURN(cur, obj, EINA_FALSE);
510    return cur->engine_only;
511 }