ecore-evas: add function for unsetting a specific seat's cursor

@feature
This commit is contained in:
Mike Blumenkrantz 2017-05-12 12:08:32 -04:00
parent 34999448c2
commit 2fabed3255
2 changed files with 29 additions and 5 deletions

View File

@ -2423,6 +2423,23 @@ EAPI void ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj,
*/ */
EAPI Evas_Object* ecore_evas_cursor_unset(Ecore_Evas *ee); EAPI Evas_Object* ecore_evas_cursor_unset(Ecore_Evas *ee);
/**
* @brief Unsets the cursor of the specified pointer device.
*
* @param ee The Ecore_Evas to unset the cursor.
* @param pointer A pointer device to set the cursor. Use @c NULL for the default.
*
* This function unsets the cursor from the Ecore_Evas, and returns the cursor
* object. If the cursor was set from ecore_evas_cursor_set(), this function
* returns the image. In this case, the image should be deleted when it is
* no longer needed.
*
* @see ecore_evas_cursor_device_set()
* @see ecore_evas_object_cursor_device_set()
* @since 1.20
*/
EAPI Evas_Object *ecore_evas_cursor_device_unset(Ecore_Evas *ee, Efl_Input_Device *pointer);
/** /**
* @brief Sets the cursor of an Ecore_Evas specified pointer device. * @brief Sets the cursor of an Ecore_Evas specified pointer device.
* *

View File

@ -1858,15 +1858,16 @@ ecore_evas_cursor_get(const Ecore_Evas *ee, Evas_Object **obj, int *layer, int *
} }
EAPI Evas_Object * EAPI Evas_Object *
ecore_evas_cursor_unset(Ecore_Evas *ee) ecore_evas_cursor_device_unset(Ecore_Evas *ee, Efl_Input_Device *pointer)
{ {
Ecore_Evas_Cursor *cursor; Ecore_Evas_Cursor *cursor = NULL;
Efl_Input_Device *pointer;
Evas_Object *obj; Evas_Object *obj;
ECORE_EVAS_CHECK(ee, NULL); ECORE_EVAS_CHECK(ee, NULL);
if (!pointer)
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE); pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
if (pointer)
cursor = eina_hash_find(ee->prop.cursors, &pointer); cursor = eina_hash_find(ee->prop.cursors, &pointer);
EINA_SAFETY_ON_NULL_RETURN_VAL(cursor, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(cursor, NULL);
obj = cursor->object; obj = cursor->object;
@ -1880,6 +1881,12 @@ ecore_evas_cursor_unset(Ecore_Evas *ee)
return obj; return obj;
} }
EAPI Evas_Object *
ecore_evas_cursor_unset(Ecore_Evas *ee)
{
return ecore_evas_cursor_device_unset(ee, NULL);
}
EAPI void EAPI void
ecore_evas_layer_set(Ecore_Evas *ee, int layer) ecore_evas_layer_set(Ecore_Evas *ee, int layer)
{ {