From 51c87a5c303b675c3fff1902097d0892fe49dd65 Mon Sep 17 00:00:00 2001 From: tsauerbeck Date: Mon, 26 Sep 2005 16:14:31 +0000 Subject: [PATCH] use default x cursor optionally. doesn't have an immediate effect when changed with enlightenment_remote. need to support cursors for hotspots like resize handles etc SVN revision: 16967 --- src/bin/e.h | 1 + src/bin/e_config.c | 3 +++ src/bin/e_config.h | 1 + src/bin/e_container.c | 8 ++++++- src/bin/e_init.c | 20 ++++++++++++++--- src/bin/e_ipc_handlers.h | 42 +++++++++++++++++++++++++++++++++++ src/bin/e_ipc_handlers_list.h | 4 ++++ 7 files changed, 75 insertions(+), 4 deletions(-) diff --git a/src/bin/e.h b/src/bin/e.h index 75ea5f5eb..83d773986 100644 --- a/src/bin/e.h +++ b/src/bin/e.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include diff --git a/src/bin/e_config.c b/src/bin/e_config.c index 084853831..dbe983d80 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -329,6 +329,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, resize_info_follows, INT); /**/ E_CONFIG_VAL(D, T, focus_last_focused_per_desktop, INT); /**/ E_CONFIG_VAL(D, T, focus_revert_on_hide_or_close, INT); /**/ + E_CONFIG_VAL(D, T, use_e_cursor, INT); /**/ E_CONFIG_VAL(D, T, cursor_size, INT); /**/ E_CONFIG_VAL(D, T, menu_autoscroll_margin, INT); /**/ E_CONFIG_VAL(D, T, menu_autoscroll_cursor_margin, INT); /**/ @@ -446,6 +447,7 @@ e_config_init(void) e_config->resize_info_follows = 1; e_config->focus_last_focused_per_desktop = 1; e_config->focus_revert_on_hide_or_close = 1; + e_config->use_e_cursor = 1; e_config->cursor_size = 32; e_config->menu_autoscroll_margin = 0; e_config->menu_autoscroll_cursor_margin = 1; @@ -1393,6 +1395,7 @@ e_config_init(void) E_CONFIG_LIMIT(e_config->resize_info_follows, 0, 1); E_CONFIG_LIMIT(e_config->focus_last_focused_per_desktop, 0, 1); E_CONFIG_LIMIT(e_config->focus_revert_on_hide_or_close, 0, 1); + E_CONFIG_LIMIT(e_config->use_e_cursor, 0, 1); E_CONFIG_LIMIT(e_config->cursor_size, 0, 1024); E_CONFIG_LIMIT(e_config->menu_autoscroll_margin, 0, 50); E_CONFIG_LIMIT(e_config->menu_autoscroll_cursor_margin, 0, 50); diff --git a/src/bin/e_config.h b/src/bin/e_config.h index cbf62d496..d78691f30 100644 --- a/src/bin/e_config.h +++ b/src/bin/e_config.h @@ -147,6 +147,7 @@ struct _E_Config int resize_info_follows; int focus_last_focused_per_desktop; int focus_revert_on_hide_or_close; + int use_e_cursor; int cursor_size; int menu_autoscroll_margin; int menu_autoscroll_cursor_margin; diff --git a/src/bin/e_container.c b/src/bin/e_container.c index 9ef689a9b..6e846395b 100644 --- a/src/bin/e_container.c +++ b/src/bin/e_container.c @@ -122,7 +122,13 @@ e_container_new(E_Manager *man) evas_object_data_set(o, "e_container", con); evas_object_show(o); - con->pointer.root = e_pointer_window_set(con->manager->root); + if (e_config->use_e_cursor) + con->pointer.root = e_pointer_window_set(con->manager->root); + else + { + ecore_x_window_cursor_set (con->manager->root, + ecore_x_cursor_shape_get (ECORE_X_CURSOR_LEFT_PTR)); + } con->num = container_num; container_num++; diff --git a/src/bin/e_init.c b/src/bin/e_init.c index 3e30d945f..f7ede9bc6 100644 --- a/src/bin/e_init.c +++ b/src/bin/e_init.c @@ -61,7 +61,16 @@ e_init_init(void) _e_init_evas = ecore_evas_get(_e_init_ecore_evas); ecore_evas_name_class_set(_e_init_ecore_evas, "E", "Init_Window"); ecore_evas_title_set(_e_init_ecore_evas, "Enlightenment Init"); - _e_init_pointer = e_pointer_window_set(_e_init_win); + + if (e_config->use_e_cursor) + _e_init_pointer = e_pointer_window_set(_e_init_win); + else + { + _e_init_pointer = NULL; + ecore_x_window_cursor_set (_e_init_win, + ecore_x_cursor_shape_get (ECORE_X_CURSOR_LEFT_PTR)); + } + ecore_evas_raise(_e_init_ecore_evas); ecore_evas_show(_e_init_ecore_evas); @@ -145,12 +154,17 @@ e_init_hide(void) evas_object_del(_e_init_object); e_canvas_del(_e_init_ecore_evas); ecore_evas_free(_e_init_ecore_evas); - e_object_del(E_OBJECT(_e_init_pointer)); + + if (_e_init_pointer) + { + e_object_del(E_OBJECT(_e_init_pointer)); + _e_init_pointer = NULL; + } + _e_init_ecore_evas = NULL; _e_init_evas = NULL; _e_init_win = 0; _e_init_object = NULL; - _e_init_pointer = NULL; e_canvas_cache_flush(); } diff --git a/src/bin/e_ipc_handlers.h b/src/bin/e_ipc_handlers.h index 0d7e02c0e..49404b8e3 100644 --- a/src/bin/e_ipc_handlers.h +++ b/src/bin/e_ipc_handlers.h @@ -4818,6 +4818,48 @@ break; #undef HDL /****************************************************************************/ + +#define HDL E_IPC_OP_USE_E_CURSOR_SET +#if (TYPE == E_REMOTE_OPTIONS) + OP("-use-e-cursor-set", 1, "Set whether E's cursor should be used", 0, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_INT(atoi(params[0]), HDL); +#elif (TYPE == E_WM_IN) + START_INT(val, HDL); + e_config->use_e_cursor = val; + E_CONFIG_LIMIT(e_config->use_e_cursor, 0, 1); + SAVE; + END_INT; +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_USE_E_CURSOR_GET +#if (TYPE == E_REMOTE_OPTIONS) + OP("-use-e-cursor-get", 0, "Get whether E's cursor should be used", 1, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_NULL(HDL); +#elif (TYPE == E_WM_IN) + SEND_INT(e_config->use_e_cursor, E_IPC_OP_CURSOR_SIZE_GET_REPLY, HDL); +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_USE_E_CURSOR_GET_REPLY +#if (TYPE == E_REMOTE_OPTIONS) +#elif (TYPE == E_REMOTE_OUT) +#elif (TYPE == E_WM_IN) +#elif (TYPE == E_REMOTE_IN) + START_INT(val, HDL); + printf("REPLY: %d\n", val); + END_INT; +#endif +#undef HDL + +/****************************************************************************/ + #define HDL E_IPC_OP_MENU_AUTOSCROLL_MARGIN_SET #if (TYPE == E_REMOTE_OPTIONS) OP("-menu-autoscroll-margin-set", 1, "Set the distance from the edge of the screen the menu will autoscroll to", 0, HDL) diff --git a/src/bin/e_ipc_handlers_list.h b/src/bin/e_ipc_handlers_list.h index 2d9aa1553..d479a8e84 100644 --- a/src/bin/e_ipc_handlers_list.h +++ b/src/bin/e_ipc_handlers_list.h @@ -272,3 +272,7 @@ #define E_IPC_OP_BINDING_WHEEL_LIST_REPLY 267 #define E_IPC_OP_BINDING_WHEEL_ADD 268 #define E_IPC_OP_BINDING_WHEEL_DEL 269 + +#define E_IPC_OP_USE_E_CURSOR_SET 270 +#define E_IPC_OP_USE_E_CURSOR_GET 271 +#define E_IPC_OP_USE_E_CURSOR_GET_REPLY 272