Cursors

- Main Page
- Related Pages
- Data Structures
- Files
- Examples

Functions
Cursors

The Elementary cursor is an internal smart object used to customize the mouse cursor displayed over objects (or widgets). More...

## Functions
Eina_Bool | elm_config_cursor_engine_only_get (void)
| Get the configured cursor engine only usage. More...
void | elm_config_cursor_engine_only_set (Eina_Bool engine_only)
| Set the configured cursor engine only usage. More...
void | elm_object_cursor_set (Evas_Object *obj, const char *cursor)
| Set the cursor to be shown when mouse is over the object. More...
const char * | elm_object_cursor_get (const Evas_Object *obj)
| Get the cursor to be shown when mouse is over the object. More...
void | elm_object_cursor_unset (Evas_Object *obj)
| Unset cursor for object. More...
void | elm_object_cursor_style_set (Evas_Object *obj, const char *style)
| Sets a different style for this object cursor. More...
const char * | elm_object_cursor_style_get (const Evas_Object *obj)
| Get the style for this object cursor. More...
void | elm_object_cursor_theme_search_enabled_set (Evas_Object *obj, Eina_Bool theme_search)
| Set if the cursor set should be searched on the theme or should use the provided by the engine, only. More...
Eina_Bool | elm_object_cursor_theme_search_enabled_get (const Evas_Object *obj)
| Get if the cursor set should be searched on the theme for this object cursor. More...

## Detailed Description

The Elementary cursor is an internal smart object used to customize the mouse cursor displayed over objects (or widgets).

In the most common scenario, the cursor decoration comes from the graphical engine Elementary is running on. Those engines may provide different decorations for cursors, and Elementary provides functions to choose them (think of X11 cursors, as an example).

By default, Elementary searches cursors only from engine. There's also the possibility of, besides using engine provided cursors, also use the ones coming from Edje theme files. Both globally and per widget, Elementary makes it possible for one to make the cursors lookup to be held on engines only or on Elementary's theme file, too. To set cursor's hot spot, two data items should be added to cursor's theme: "hot_x" and "hot_y", that are the offset from upper-left corner of the cursor (coordinates 0,0).

## Function Documentation

Eina_Bool elm_config_cursor_engine_only_get | ( | void |  | ) |

Get the configured cursor engine only usage.

This gets the globally configured exclusive usage of engine cursors.

Returns
  1 if only engine cursors should be used

void elm_config_cursor_engine_only_set | ( | Eina_Bool | engine_only | ) |

Set the configured cursor engine only usage.

This sets the globally configured exclusive usage of engine cursors. It won't affect cursors set before changing this value.

Parameters

  engine_only | If 1 only engine cursors will be enabled, if 0 will look for them on theme before.

const char* elm_object_cursor_get | ( | const Evas_Object * | obj | ) |

Get the cursor to be shown when mouse is over the object.

Parameters

  obj | an object with cursor already set.

Returns
  the cursor name.

void elm_object_cursor_set | ( | Evas_Object * | obj,
|  | const char * | cursor
| ) |  |

Set the cursor to be shown when mouse is over the object.

Set the cursor that will be displayed when mouse is over the object. The object can have only one cursor set to it, so if this function is called twice for an object, the previous set will be unset. If using X cursors, a definition of all the valid cursor names is listed on Elementary_Cursors.h. If an invalid name is set the default cursor will be used.

Parameters

  obj | the object being set a cursor.
  cursor | the cursor name to be used.

const char* elm_object_cursor_style_get | ( | const Evas_Object * | obj | ) |

Get the style for this object cursor.

Parameters

  obj | an object with cursor already set.

Returns
  style the theme style in use, defaults to "default". If the object does not have a cursor set, then NULL is returned.

void elm_object_cursor_style_set | ( | Evas_Object * | obj,
|  | const char * | style
| ) |  |

Sets a different style for this object cursor.

Note
  before you set a style you should define a cursor with elm_object_cursor_set()

Parameters

  obj | an object with cursor already set.
  style | the theme style to use (default, transparent, ...)

Eina_Bool elm_object_cursor_theme_search_enabled_get | ( | const Evas_Object * | obj | ) |

Get if the cursor set should be searched on the theme for this object cursor.

Parameters

  obj | an object with cursor already set.

Returns
  `EINA_TRUE` if the cursor set should be searched on widget's theme, `EINA_FALSE` otherwise.

void elm_object_cursor_theme_search_enabled_set | ( | Evas_Object * | obj,
|  | Eina_Bool | theme_search
| ) |  |

Set if the cursor set should be searched on the theme or should use the provided by the engine, only.

Note
  before you set theme_search you should define a cursor with elm_object_cursor_set(). By default it will only look for cursors provided by the engine.

Parameters

  obj | an object with cursor already set.
  theme_search | boolean to define if cursors should be searched on widget's theme.

void elm_object_cursor_unset | ( | Evas_Object * | obj | ) |

Unset cursor for object.

Unset cursor for object, and set the cursor to default if the mouse was over this object.

Parameters

  obj | Target object

See also
  elm_object_cursor_set()

References ELM_OBJECT_LAYER_CURSOR.