2 * @defgroup Cursors Cursors
4 * The Elementary cursor is an internal smart object used to
5 * customize the mouse cursor displayed over objects (or
6 * widgets). In the most common scenario, the cursor decoration
7 * comes from the graphical @b engine Elementary is running
8 * on. Those engines may provide different decorations for cursors,
9 * and Elementary provides functions to choose them (think of X11
10 * cursors, as an example).
12 * There's also the possibility of, besides using engine provided
13 * cursors, also use ones coming from Edje theming files. Both
14 * globally and per widget, Elementary makes it possible for one to
15 * make the cursors lookup to be held on engines only or on
16 * Elementary's theme file, too. To set cursor's hot spot,
17 * two data items should be added to cursor's theme: "hot_x" and
18 * "hot_y", that are the offset from upper-left corner of the cursor
25 * Set the cursor to be shown when mouse is over the object
27 * Set the cursor that will be displayed when mouse is over the
28 * object. The object can have only one cursor set to it, so if
29 * this function is called twice for an object, the previous set
31 * If using X cursors, a definition of all the valid cursor names
32 * is listed on Elementary_Cursors.h. If an invalid name is set
33 * the default cursor will be used.
35 * @param obj the object being set a cursor.
36 * @param cursor the cursor name to be used.
41 elm_object_cursor_set(Evas_Object *obj, const char *cursor)
45 * Get the cursor to be shown when mouse is over the object
47 * @param obj an object with cursor already set.
48 * @return the cursor name.
52 EAPI const char *elm_object_cursor_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
55 * Unset cursor for object
57 * Unset cursor for object, and set the cursor to default if the mouse
58 * was over this object.
60 * @param obj Target object
61 * @see elm_object_cursor_set()
65 EAPI void elm_object_cursor_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
68 * Sets a different style for this object cursor.
70 * @note before you set a style you should define a cursor with
71 * elm_object_cursor_set()
73 * @param obj an object with cursor already set.
74 * @param style the theme style to use (default, transparent, ...)
78 EAPI void elm_object_cursor_style_set(Evas_Object *obj, const char *style) EINA_ARG_NONNULL(1);
81 * Get the style for this object cursor.
83 * @param obj an object with cursor already set.
84 * @return style the theme style in use, defaults to "default". If the
85 * object does not have a cursor set, then NULL is returned.
89 EAPI const char *elm_object_cursor_style_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
92 * Set if the cursor set should be searched on the theme or should use
93 * the provided by the engine, only.
95 * @note before you set if should look on theme you should define a cursor
96 * with elm_object_cursor_set(). By default it will only look for cursors
97 * provided by the engine.
99 * @param obj an object with cursor already set.
100 * @param engine_only boolean to define it cursors should be looked only
101 * between the provided by the engine or searched on widget's theme as well.
105 EAPI void elm_object_cursor_engine_only_set(Evas_Object *obj, Eina_Bool engine_only) EINA_ARG_NONNULL(1);
108 * Get the cursor engine only usage for this object cursor.
110 * @param obj an object with cursor already set.
111 * @return engine_only boolean to define it cursors should be
112 * looked only between the provided by the engine or searched on
113 * widget's theme as well. If the object does not have a cursor
114 * set, then EINA_FALSE is returned.
118 EAPI Eina_Bool elm_object_cursor_engine_only_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
121 * Get the configured cursor engine only usage
123 * This gets the globally configured exclusive usage of engine cursors.
125 * @return 1 if only engine cursors should be used
128 EAPI int elm_cursor_engine_only_get(void);
131 * Set the configured cursor engine only usage
133 * This sets the globally configured exclusive usage of engine cursors.
134 * It won't affect cursors set before changing this value.
136 * @param engine_only If 1 only engine cursors will be enabled, if 0 will
137 * look for them on theme before.
138 * @return EINA_TRUE if value is valid and setted (0 or 1)
141 EAPI Eina_Bool elm_cursor_engine_only_set(int engine_only);