ecore_evas_object_example.c
#include <Ecore.h>
#include <Ecore_Evas.h>
Evas_Object *cursor;
static void
_mouse_down_cb(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
static Eina_Bool flag = EINA_FALSE;
if (!flag)
{
ecore_evas_object_cursor_set(data, NULL, 0, 1, 1);
}
else
ecore_evas_object_cursor_set(data, cursor, 0, 1, 1);
flag = !flag;
}
int
main(void)
{
Ecore_Evas *ee;
Evas_Object *bg, *obj;
int layer, x, y;
ee = ecore_evas_new(NULL, 0, 0, 200, 200, NULL);
ecore_evas_title_set(ee, "Ecore Evas Object Example");
evas_object_color_set(bg, 0, 0, 255, 255);
evas_object_resize(bg, 200, 200);
ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);
printf("Association worked!\n");
evas_object_color_set(cursor, 0, 255, 0, 255);
evas_object_resize(cursor, 5, 10);
ecore_evas_object_cursor_set(ee, cursor, 0, 1, 1);
ecore_evas_cursor_get(ee, &obj, &layer, &x, &y);
if (obj == cursor && layer == 0 && x == 1 && y == 1)
printf("Set cursor worked!\n");
return 0;
}