2005-02-07 05:51:09 -08:00
|
|
|
/*
|
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
|
|
|
*/
|
2004-11-24 19:37:45 -08:00
|
|
|
#include "e.h"
|
|
|
|
|
2005-10-09 01:54:24 -07:00
|
|
|
/*
|
|
|
|
* TODO
|
|
|
|
* - Make fallback user controlable.
|
2005-10-09 11:02:17 -07:00
|
|
|
* - Define the allowed signals?
|
2005-10-09 01:54:24 -07:00
|
|
|
*/
|
|
|
|
|
2005-10-09 11:02:17 -07:00
|
|
|
typedef struct _E_Pointer_Stack E_Pointer_Stack;
|
|
|
|
|
|
|
|
struct _E_Pointer_Stack
|
|
|
|
{
|
|
|
|
void *obj;
|
2006-03-02 04:03:48 -08:00
|
|
|
const char *type;
|
2005-10-09 11:02:17 -07:00
|
|
|
};
|
|
|
|
|
2005-08-16 18:35:48 -07:00
|
|
|
static Evas_List *_e_pointers = NULL;
|
|
|
|
|
2006-08-19 21:48:27 -07:00
|
|
|
static void _e_pointer_canvas_add(E_Pointer *p);
|
|
|
|
static void _e_pointer_canvas_del(E_Pointer *p);
|
2005-08-21 16:37:28 -07:00
|
|
|
static void _e_pointer_cb_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info);
|
2005-08-16 18:35:48 -07:00
|
|
|
static void _e_pointer_free(E_Pointer *p);
|
2006-02-24 22:28:50 -08:00
|
|
|
static void _e_pointer_stack_free(E_Pointer_Stack *elem);
|
2005-10-09 11:11:10 -07:00
|
|
|
static int _e_pointer_type_set(E_Pointer *p, const char *type);
|
2005-08-16 18:35:48 -07:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
/* externally accessible functions */
|
2006-01-07 02:39:46 -08:00
|
|
|
EAPI E_Pointer *
|
2006-08-19 21:48:27 -07:00
|
|
|
e_pointer_window_new(Ecore_X_Window win, int filled)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-09-27 03:18:52 -07:00
|
|
|
E_Pointer *p = NULL;
|
2005-08-16 18:35:48 -07:00
|
|
|
|
2006-08-19 21:48:27 -07:00
|
|
|
p = E_OBJECT_ALLOC(E_Pointer, E_POINTER_TYPE, _e_pointer_free);
|
|
|
|
if (!p) return NULL;
|
|
|
|
|
2005-09-27 03:18:52 -07:00
|
|
|
if (e_config->use_e_cursor)
|
|
|
|
{
|
2005-10-09 01:54:24 -07:00
|
|
|
p->e_cursor = 1;
|
2005-09-27 03:18:52 -07:00
|
|
|
p->win = win;
|
2005-10-09 11:02:17 -07:00
|
|
|
/* Init the cursor object */
|
2006-08-19 21:48:27 -07:00
|
|
|
if (ecore_x_cursor_color_supported_get()) p->color = 1;
|
|
|
|
else p->color = 0;
|
2005-05-25 01:08:44 -07:00
|
|
|
}
|
2005-01-04 06:07:59 -08:00
|
|
|
else
|
2005-05-25 01:08:44 -07:00
|
|
|
{
|
2005-10-09 01:54:24 -07:00
|
|
|
p->e_cursor = 0;
|
|
|
|
p->win = win;
|
2005-05-25 01:08:44 -07:00
|
|
|
}
|
2006-08-19 21:48:27 -07:00
|
|
|
ecore_x_cursor_size_set(e_config->cursor_size * 3 / 4);
|
|
|
|
if (filled) e_pointer_type_push(p, p, "default");
|
|
|
|
_e_pointers = evas_list_append(_e_pointers, p);
|
2005-08-16 18:35:48 -07:00
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
2006-01-07 02:39:46 -08:00
|
|
|
EAPI void
|
2005-09-02 01:28:12 -07:00
|
|
|
e_pointers_size_set(int size)
|
|
|
|
{
|
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
for (l = _e_pointers; l; l = l->next)
|
|
|
|
{
|
|
|
|
E_Pointer *p;
|
|
|
|
Evas_Engine_Info_Buffer *einfo;
|
|
|
|
|
|
|
|
p = l->data;
|
2006-08-19 23:42:20 -07:00
|
|
|
if (p->evas)
|
2005-09-02 01:28:12 -07:00
|
|
|
{
|
2005-10-10 00:58:24 -07:00
|
|
|
p->w = p->h = size;
|
|
|
|
evas_output_size_set(p->evas, p->w, p->h);
|
|
|
|
evas_output_viewport_set(p->evas, 0, 0, p->w, p->h);
|
|
|
|
|
|
|
|
p->pixels = realloc(p->pixels, p->w * p->h * sizeof(int));
|
|
|
|
|
|
|
|
einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(p->evas);
|
|
|
|
if (einfo)
|
|
|
|
{
|
|
|
|
einfo->info.dest_buffer = p->pixels;
|
|
|
|
einfo->info.dest_buffer_row_bytes = p->w * sizeof(int);
|
|
|
|
evas_engine_info_set(p->evas, (Evas_Engine_Info *)einfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
evas_object_move(p->pointer_object, 0, 0);
|
|
|
|
evas_object_resize(p->pointer_object, p->w, p->h);
|
2005-09-02 01:28:12 -07:00
|
|
|
}
|
2005-10-10 00:58:24 -07:00
|
|
|
else
|
|
|
|
{
|
2006-03-02 04:03:48 -08:00
|
|
|
const char *type;
|
2006-08-19 23:42:20 -07:00
|
|
|
|
2005-10-10 01:18:35 -07:00
|
|
|
ecore_x_cursor_size_set(e_config->cursor_size * 3 / 4);
|
2005-10-10 00:58:24 -07:00
|
|
|
type = p->type;
|
2006-08-19 23:42:20 -07:00
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
p->type = NULL;
|
|
|
|
_e_pointer_type_set(p, type);
|
|
|
|
evas_stringshare_del(type);
|
|
|
|
}
|
2005-10-10 00:58:24 -07:00
|
|
|
}
|
2005-09-02 01:28:12 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-01-07 02:39:46 -08:00
|
|
|
EAPI void
|
2005-10-09 11:02:17 -07:00
|
|
|
e_pointer_type_push(E_Pointer *p, void *obj, const char *type)
|
2005-10-09 01:54:24 -07:00
|
|
|
{
|
2005-10-09 11:02:17 -07:00
|
|
|
E_Pointer_Stack *stack;
|
2005-10-09 01:54:24 -07:00
|
|
|
|
2006-01-06 05:56:46 -08:00
|
|
|
p->e_cursor = e_config->use_e_cursor;
|
2006-08-19 21:48:27 -07:00
|
|
|
|
2006-08-19 23:42:20 -07:00
|
|
|
_e_pointer_type_set(p, type);
|
|
|
|
|
2005-10-09 11:11:10 -07:00
|
|
|
p->obj = obj;
|
|
|
|
|
2005-10-09 11:02:17 -07:00
|
|
|
stack = E_NEW(E_Pointer_Stack, 1);
|
|
|
|
if (stack)
|
2005-10-09 01:54:24 -07:00
|
|
|
{
|
2005-12-04 04:03:59 -08:00
|
|
|
stack->type = evas_stringshare_add(p->type);
|
2006-08-19 23:42:20 -07:00
|
|
|
stack->obj = p->obj;
|
2005-10-09 11:02:17 -07:00
|
|
|
p->stack = evas_list_prepend(p->stack, stack);
|
|
|
|
}
|
2006-08-19 23:42:20 -07:00
|
|
|
|
2005-10-09 11:02:17 -07:00
|
|
|
}
|
|
|
|
|
2006-01-07 02:39:46 -08:00
|
|
|
EAPI void
|
2005-10-09 11:02:17 -07:00
|
|
|
e_pointer_type_pop(E_Pointer *p, void *obj, const char *type)
|
|
|
|
{
|
|
|
|
Evas_List *l;
|
|
|
|
E_Pointer_Stack *stack;
|
|
|
|
|
2006-02-24 22:28:50 -08:00
|
|
|
for (l = p->stack; l; l = l->next)
|
2005-10-09 11:02:17 -07:00
|
|
|
{
|
|
|
|
stack = l->data;
|
|
|
|
|
|
|
|
if ((stack->obj == obj) &&
|
|
|
|
((!type) || (!strcmp(stack->type, type))))
|
2005-10-09 01:54:24 -07:00
|
|
|
{
|
2006-02-24 22:28:50 -08:00
|
|
|
_e_pointer_stack_free(stack);
|
|
|
|
p->stack = evas_list_remove_list(p->stack, l);
|
2005-10-10 22:51:03 -07:00
|
|
|
if (type) break;
|
2005-10-09 01:54:24 -07:00
|
|
|
}
|
2005-10-09 11:02:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!p->stack)
|
|
|
|
{
|
2006-08-19 23:42:20 -07:00
|
|
|
if (p->evas) _e_pointer_canvas_del(p);
|
2006-08-19 21:48:27 -07:00
|
|
|
ecore_x_window_cursor_set(p->win, 0);
|
2006-08-19 23:42:20 -07:00
|
|
|
if (p->type) evas_stringshare_del(p->type);
|
|
|
|
p->type = NULL;
|
2005-10-09 11:02:17 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
stack = p->stack->data;
|
2006-08-19 23:42:20 -07:00
|
|
|
_e_pointer_type_set(p, stack->type);
|
2005-10-09 11:02:17 -07:00
|
|
|
|
2005-12-04 04:03:59 -08:00
|
|
|
if (p->type) evas_stringshare_del(p->type);
|
|
|
|
p->type = evas_stringshare_add(stack->type);
|
2005-10-09 11:11:10 -07:00
|
|
|
p->obj = stack->obj;
|
|
|
|
|
2005-10-09 01:54:24 -07:00
|
|
|
/* try the default cursor next time */
|
|
|
|
p->e_cursor = e_config->use_e_cursor;
|
|
|
|
}
|
|
|
|
|
2006-01-07 02:39:46 -08:00
|
|
|
EAPI void
|
2005-08-16 18:35:48 -07:00
|
|
|
e_pointer_idler_before(void)
|
|
|
|
{
|
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
for (l = _e_pointers; l; l = l->next)
|
2005-05-25 01:08:44 -07:00
|
|
|
{
|
2005-08-16 18:35:48 -07:00
|
|
|
E_Pointer *p;
|
|
|
|
Evas_List *updates;
|
|
|
|
|
|
|
|
p = l->data;
|
2005-10-09 01:54:24 -07:00
|
|
|
if (!p->e_cursor) continue;
|
2006-08-19 21:48:27 -07:00
|
|
|
if (!p->evas) continue;
|
2005-10-08 13:38:07 -07:00
|
|
|
|
2005-08-16 18:35:48 -07:00
|
|
|
updates = evas_render_updates(p->evas);
|
2005-08-23 21:22:52 -07:00
|
|
|
if ((updates) || (p->hot.update))
|
2005-08-16 18:35:48 -07:00
|
|
|
{
|
|
|
|
Ecore_X_Cursor cur;
|
|
|
|
|
2005-08-21 16:37:28 -07:00
|
|
|
cur = ecore_x_cursor_new(p->win, p->pixels, p->w, p->h, p->hot.x, p->hot.y);
|
2005-08-16 18:35:48 -07:00
|
|
|
ecore_x_window_cursor_set(p->win, cur);
|
|
|
|
ecore_x_cursor_free(cur);
|
2005-08-21 16:37:28 -07:00
|
|
|
evas_render_updates_free(updates);
|
2005-08-23 21:22:52 -07:00
|
|
|
p->hot.update = 0;
|
2005-08-16 18:35:48 -07:00
|
|
|
}
|
2005-05-25 01:08:44 -07:00
|
|
|
}
|
2005-08-16 18:35:48 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* local subsystem functions */
|
2006-08-19 21:48:27 -07:00
|
|
|
static void
|
|
|
|
_e_pointer_canvas_add(E_Pointer *p)
|
|
|
|
{
|
|
|
|
Evas_Engine_Info_Buffer *einfo;
|
|
|
|
Evas_Object *o;
|
|
|
|
int rmethod;
|
|
|
|
|
|
|
|
p->w = e_config->cursor_size;
|
|
|
|
p->h = e_config->cursor_size;
|
|
|
|
|
|
|
|
/* create evas */
|
|
|
|
p->evas = evas_new();
|
|
|
|
if (!p->evas)
|
|
|
|
{
|
|
|
|
e_object_del(E_OBJECT(p));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rmethod = evas_render_method_lookup("buffer");
|
|
|
|
evas_output_method_set(p->evas, rmethod);
|
|
|
|
evas_output_size_set(p->evas, p->w, p->h);
|
|
|
|
evas_output_viewport_set(p->evas, 0, 0, p->w, p->h);
|
|
|
|
|
|
|
|
p->pixels = malloc(p->w * p->h * sizeof(int));
|
|
|
|
if (!p->pixels)
|
|
|
|
{
|
|
|
|
evas_free(p->evas);
|
|
|
|
p->evas = NULL;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(p->evas);
|
|
|
|
if (!einfo)
|
|
|
|
{
|
|
|
|
free(p->pixels);
|
|
|
|
p->pixels = NULL;
|
|
|
|
evas_free(p->evas);
|
|
|
|
p->evas = NULL;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32;
|
|
|
|
einfo->info.dest_buffer = p->pixels;
|
|
|
|
einfo->info.dest_buffer_row_bytes = p->w * sizeof(int);
|
|
|
|
einfo->info.use_color_key = 0;
|
|
|
|
einfo->info.alpha_threshold = 0;
|
|
|
|
einfo->info.func.new_update_region = NULL;
|
|
|
|
einfo->info.func.free_update_region = NULL;
|
|
|
|
evas_engine_info_set(p->evas, (Evas_Engine_Info *)einfo);
|
|
|
|
|
|
|
|
/* set the pointer edje */
|
|
|
|
o = edje_object_add(p->evas);
|
|
|
|
p->pointer_object = o;
|
|
|
|
/* Create the hotspot object */
|
|
|
|
o = evas_object_rectangle_add(p->evas);
|
|
|
|
p->hot_object = o;
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE,
|
|
|
|
_e_pointer_cb_move, p);
|
|
|
|
/* init edje */
|
|
|
|
evas_object_move(p->pointer_object, 0, 0);
|
|
|
|
evas_object_resize(p->pointer_object, p->w, p->h);
|
|
|
|
evas_object_show(p->pointer_object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_pointer_canvas_del(E_Pointer *p)
|
|
|
|
{
|
|
|
|
if (p->pointer_object) evas_object_del(p->pointer_object);
|
|
|
|
if (p->hot_object) evas_object_del(p->hot_object);
|
|
|
|
if (p->evas) evas_free(p->evas);
|
|
|
|
if (p->pixels) free(p->pixels);
|
|
|
|
p->pointer_object = NULL;
|
|
|
|
p->hot_object = NULL;
|
|
|
|
p->evas = NULL;
|
|
|
|
p->pixels = NULL;
|
|
|
|
}
|
|
|
|
|
2005-08-21 16:37:28 -07:00
|
|
|
static void
|
|
|
|
_e_pointer_cb_move(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
E_Pointer *p;
|
|
|
|
Evas_Coord x, y;
|
|
|
|
|
|
|
|
p = data;
|
2005-10-09 01:54:24 -07:00
|
|
|
if (!p->e_cursor) return;
|
2005-08-21 16:37:28 -07:00
|
|
|
evas_object_geometry_get(p->hot_object, &x, &y, NULL, NULL);
|
2005-08-23 21:22:52 -07:00
|
|
|
if ((p->hot.x != x) || (p->hot.y != y))
|
|
|
|
{
|
|
|
|
p->hot.x = x;
|
|
|
|
p->hot.y = y;
|
|
|
|
p->hot.update = 1;
|
|
|
|
}
|
2005-08-21 16:37:28 -07:00
|
|
|
}
|
|
|
|
|
2005-08-16 18:35:48 -07:00
|
|
|
static void
|
|
|
|
_e_pointer_free(E_Pointer *p)
|
|
|
|
{
|
|
|
|
_e_pointers = evas_list_remove(_e_pointers, p);
|
|
|
|
|
2006-08-19 21:48:27 -07:00
|
|
|
_e_pointer_canvas_del(p);
|
|
|
|
|
2005-10-08 13:38:07 -07:00
|
|
|
while (p->stack)
|
|
|
|
{
|
2006-02-24 22:28:50 -08:00
|
|
|
_e_pointer_stack_free(p->stack->data);
|
2005-10-08 13:38:07 -07:00
|
|
|
p->stack = evas_list_remove_list(p->stack, p->stack);
|
|
|
|
}
|
2005-08-16 18:35:48 -07:00
|
|
|
|
2005-12-04 04:03:59 -08:00
|
|
|
if (p->type) evas_stringshare_del(p->type);
|
2005-08-16 18:35:48 -07:00
|
|
|
free(p);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
2005-10-09 11:02:17 -07:00
|
|
|
|
2006-02-24 22:28:50 -08:00
|
|
|
static void
|
|
|
|
_e_pointer_stack_free(E_Pointer_Stack *elem)
|
|
|
|
{
|
2006-08-19 21:48:27 -07:00
|
|
|
if (elem->type) evas_stringshare_del(elem->type);
|
2006-02-24 22:28:50 -08:00
|
|
|
free(elem);
|
|
|
|
}
|
|
|
|
|
2005-10-09 11:02:17 -07:00
|
|
|
static int
|
2005-10-09 11:11:10 -07:00
|
|
|
_e_pointer_type_set(E_Pointer *p, const char *type)
|
2005-10-09 11:02:17 -07:00
|
|
|
{
|
2005-10-09 11:11:10 -07:00
|
|
|
/* Check if this pointer is already set */
|
|
|
|
if ((p->type) && (!strcmp(p->type, type))) return 1;
|
|
|
|
|
2006-08-19 23:42:20 -07:00
|
|
|
if (p->type) evas_stringshare_del(p->type);
|
|
|
|
p->type = evas_stringshare_add(type);
|
|
|
|
|
2005-10-09 11:02:17 -07:00
|
|
|
if (p->e_cursor)
|
|
|
|
{
|
|
|
|
Evas_Object *o;
|
2006-01-06 05:56:46 -08:00
|
|
|
char cursor[1024];
|
2005-10-09 11:02:17 -07:00
|
|
|
|
2006-08-19 23:42:20 -07:00
|
|
|
if (!p->evas) _e_pointer_canvas_add(p);
|
2005-10-09 11:02:17 -07:00
|
|
|
o = p->pointer_object;
|
|
|
|
if (p->color)
|
|
|
|
{
|
2006-08-22 20:39:02 -07:00
|
|
|
snprintf(cursor, sizeof(cursor), "e/pointer/enlightenment/%s/color", type);
|
2006-01-06 05:56:46 -08:00
|
|
|
if (!e_theme_edje_object_set(o, "base/theme/pointer", cursor))
|
2006-08-19 23:42:20 -07:00
|
|
|
goto fallback;
|
2005-10-09 11:02:17 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-08-22 20:39:02 -07:00
|
|
|
snprintf(cursor, sizeof(cursor), "e/pointer/enlightenment/%s/mono", type);
|
2006-01-06 05:56:46 -08:00
|
|
|
if (!e_theme_edje_object_set(o, "base/theme/pointer", cursor))
|
2006-08-19 23:42:20 -07:00
|
|
|
goto fallback;
|
2005-10-09 11:02:17 -07:00
|
|
|
}
|
2006-08-22 00:39:11 -07:00
|
|
|
edje_object_part_swallow(p->pointer_object, "e.swallow.hotspot", p->hot_object);
|
2005-10-09 11:02:17 -07:00
|
|
|
p->hot.update = 1;
|
2006-08-21 08:11:07 -07:00
|
|
|
return 1;
|
2005-10-09 11:02:17 -07:00
|
|
|
}
|
2006-08-19 23:42:20 -07:00
|
|
|
fallback:
|
2005-10-09 11:02:17 -07:00
|
|
|
{
|
2006-01-06 05:56:46 -08:00
|
|
|
Ecore_X_Cursor cursor = 0;
|
|
|
|
|
2006-08-19 23:42:20 -07:00
|
|
|
if (p->evas) _e_pointer_canvas_del(p);
|
2005-10-09 11:14:05 -07:00
|
|
|
if (!strcmp(type, "move"))
|
2005-10-09 11:02:17 -07:00
|
|
|
{
|
|
|
|
cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_FLEUR);
|
2005-10-09 11:14:05 -07:00
|
|
|
if (!cursor) printf("X Cursor for %s is missing\n", type);
|
2005-10-09 11:02:17 -07:00
|
|
|
ecore_x_window_cursor_set(p->win, cursor);
|
|
|
|
}
|
2005-10-10 22:51:03 -07:00
|
|
|
#if 0
|
2005-10-09 11:14:05 -07:00
|
|
|
else if (!strcmp(type, "resize"))
|
2005-10-09 11:02:17 -07:00
|
|
|
{
|
|
|
|
cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_SIZING);
|
2005-10-09 11:14:05 -07:00
|
|
|
if (!cursor) printf("X Cursor for %s is missing\n", type);
|
2005-10-09 11:02:17 -07:00
|
|
|
ecore_x_window_cursor_set(p->win, cursor);
|
|
|
|
}
|
2005-10-10 22:51:03 -07:00
|
|
|
#endif
|
2005-10-09 11:14:05 -07:00
|
|
|
else if (!strcmp(type, "resize_tl"))
|
2005-10-09 11:02:17 -07:00
|
|
|
{
|
|
|
|
cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_TOP_LEFT_CORNER);
|
2005-10-09 11:14:05 -07:00
|
|
|
if (!cursor) printf("X Cursor for %s is missing\n", type);
|
2005-10-09 11:02:17 -07:00
|
|
|
ecore_x_window_cursor_set(p->win, cursor);
|
|
|
|
}
|
2005-10-09 11:14:05 -07:00
|
|
|
else if (!strcmp(type, "resize_t"))
|
2005-10-09 11:02:17 -07:00
|
|
|
{
|
|
|
|
cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_TOP_SIDE);
|
2005-10-09 11:14:05 -07:00
|
|
|
if (!cursor) printf("X Cursor for %s is missing\n", type);
|
2005-10-09 11:02:17 -07:00
|
|
|
ecore_x_window_cursor_set(p->win, cursor);
|
|
|
|
}
|
2005-10-09 11:14:05 -07:00
|
|
|
else if (!strcmp(type, "resize_tr"))
|
2005-10-09 11:02:17 -07:00
|
|
|
{
|
|
|
|
cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_TOP_RIGHT_CORNER);
|
2005-10-09 11:14:05 -07:00
|
|
|
if (!cursor) printf("X Cursor for %s is missing\n", type);
|
2005-10-09 11:02:17 -07:00
|
|
|
ecore_x_window_cursor_set(p->win, cursor);
|
|
|
|
}
|
2005-10-09 11:14:05 -07:00
|
|
|
else if (!strcmp(type, "resize_r"))
|
2005-10-09 11:02:17 -07:00
|
|
|
{
|
|
|
|
cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_RIGHT_SIDE);
|
2005-10-09 11:14:05 -07:00
|
|
|
if (!cursor) printf("X Cursor for %s is missing\n", type);
|
2005-10-09 11:02:17 -07:00
|
|
|
ecore_x_window_cursor_set(p->win, cursor);
|
|
|
|
}
|
2005-10-09 11:14:05 -07:00
|
|
|
else if (!strcmp(type, "resize_br"))
|
2005-10-09 11:02:17 -07:00
|
|
|
{
|
|
|
|
cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_BOTTOM_RIGHT_CORNER);
|
2005-10-09 11:14:05 -07:00
|
|
|
if (!cursor) printf("X Cursor for %s is missing\n", type);
|
2005-10-09 11:02:17 -07:00
|
|
|
ecore_x_window_cursor_set(p->win, cursor);
|
|
|
|
}
|
2005-10-09 11:14:05 -07:00
|
|
|
else if (!strcmp(type, "resize_b"))
|
2005-10-09 11:02:17 -07:00
|
|
|
{
|
|
|
|
cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_BOTTOM_SIDE);
|
2005-10-09 11:14:05 -07:00
|
|
|
if (!cursor) printf("X Cursor for %s is missing\n", type);
|
2005-10-09 11:02:17 -07:00
|
|
|
ecore_x_window_cursor_set(p->win, cursor);
|
|
|
|
}
|
2005-10-09 11:14:05 -07:00
|
|
|
else if (!strcmp(type, "resize_bl"))
|
2005-10-09 11:02:17 -07:00
|
|
|
{
|
|
|
|
cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_BOTTOM_LEFT_CORNER);
|
2005-10-09 11:14:05 -07:00
|
|
|
if (!cursor) printf("X Cursor for %s is missing\n", type);
|
2005-10-09 11:02:17 -07:00
|
|
|
ecore_x_window_cursor_set(p->win, cursor);
|
|
|
|
}
|
2005-10-09 11:14:05 -07:00
|
|
|
else if (!strcmp(type, "resize_l"))
|
2005-10-09 11:02:17 -07:00
|
|
|
{
|
|
|
|
cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_LEFT_SIDE);
|
2005-10-09 11:14:05 -07:00
|
|
|
if (!cursor) printf("X Cursor for %s is missing\n", type);
|
2005-10-09 11:02:17 -07:00
|
|
|
ecore_x_window_cursor_set(p->win, cursor);
|
|
|
|
}
|
2006-08-19 23:42:20 -07:00
|
|
|
else if (!strcmp(type, "entry"))
|
|
|
|
{
|
|
|
|
cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_XTERM);
|
|
|
|
if (!cursor) printf("X Cursor for %s is missing\n", type);
|
|
|
|
ecore_x_window_cursor_set(p->win, cursor);
|
|
|
|
}
|
2005-10-09 11:14:05 -07:00
|
|
|
else if (!strcmp(type, "default"))
|
2005-10-09 11:02:17 -07:00
|
|
|
{
|
|
|
|
cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_LEFT_PTR);
|
2005-10-09 11:14:05 -07:00
|
|
|
if (!cursor) printf("X Cursor for %s is missing\n", type);
|
2005-10-09 11:02:17 -07:00
|
|
|
ecore_x_window_cursor_set(p->win, cursor);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-10-09 11:14:05 -07:00
|
|
|
printf("Unknown pointer type: %s\n", type);
|
2005-10-09 11:20:20 -07:00
|
|
|
cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_ARROW);
|
2005-10-09 11:02:17 -07:00
|
|
|
if (!cursor) printf("X Cursor for default is missing\n");
|
|
|
|
ecore_x_window_cursor_set(p->win, cursor);
|
|
|
|
}
|
2006-01-06 05:56:46 -08:00
|
|
|
if (cursor) ecore_x_cursor_free(cursor);
|
2005-10-09 11:02:17 -07:00
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|