Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_bindings.c e_bindings.h e_border.c e_config.c e_config.h
e_focus.c e_ipc.c e_zone.c
Log Message:
and now it shoudl be able to change click to focs <-> mouse focus dynamically
and it all shoudl work - i hope.
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_bindings.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- e_bindings.c 20 May 2005 06:30:25 -0000 1.12
+++ e_bindings.c 20 May 2005 10:14:51 -0000 1.13
@@ -4,38 +4,6 @@
#include "e.h"
/* local subsystem functions */
-typedef struct _E_Binding_Mouse E_Binding_Mouse;
-typedef struct _E_Binding_Key E_Binding_Key;
-typedef struct _E_Binding_Signal E_Binding_Signal;
-
-struct _E_Binding_Mouse
-{
- E_Binding_Context ctxt;
- int button;
- E_Binding_Modifier mod;
- unsigned char any_mod : 1;
- char *action;
- char *params;
-};
-
-struct _E_Binding_Key
-{
- E_Binding_Context ctxt;
- char *key;
- E_Binding_Modifier mod;
- unsigned char any_mod : 1;
- char *action;
- char *params;
-};
-
-struct _E_Binding_Signal
-{
- E_Binding_Context ctxt;
- char *sig;
- char *src;
- char *action;
- char *params;
-};
static void _e_bindings_mouse_free(E_Binding_Mouse *bind);
static void _e_bindings_key_free(E_Binding_Key *bind);
@@ -195,7 +163,7 @@
}
E_Action *
-e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj,
Ecore_X_Event_Mouse_Button_Down *ev)
+e_bindings_mouse_down_find(E_Binding_Context ctxt, E_Object *obj,
Ecore_X_Event_Mouse_Button_Down *ev, E_Binding_Mouse **bind_ret)
{
E_Binding_Modifier mod = 0;
Evas_List *l;
@@ -217,15 +185,8 @@
E_Action *act;
act = e_action_find(bind->action);
- if (act)
- {
- if (act->func.go_mouse)
- act->func.go_mouse(obj, bind->params, ev);
- else if (act->func.go)
- act->func.go(obj, bind->params);
- return act;
- }
- return NULL;
+ if (bind_ret) *bind_ret = bind;
+ return act;
}
}
}
@@ -233,7 +194,25 @@
}
E_Action *
-e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj,
Ecore_X_Event_Mouse_Button_Up *ev)
+e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj,
Ecore_X_Event_Mouse_Button_Down *ev)
+{
+ E_Action *act;
+ E_Binding_Mouse *bind;
+
+ act = e_bindings_mouse_down_find(ctxt, obj, ev, &bind);
+ if (act)
+ {
+ if (act->func.go_mouse)
+ act->func.go_mouse(obj, bind->params, ev);
+ else if (act->func.go)
+ act->func.go(obj, bind->params);
+ return act;
+ }
+ return act;
+}
+
+E_Action *
+e_bindings_mouse_up_find(E_Binding_Context ctxt, E_Object *obj,
Ecore_X_Event_Mouse_Button_Up *ev, E_Binding_Mouse **bind_ret)
{
E_Binding_Modifier mod = 0;
Evas_List *l;
@@ -255,21 +234,32 @@
E_Action *act;
act = e_action_find(bind->action);
- if (act)
- {
- if (act->func.end_mouse)
- act->func.end_mouse(obj, bind->params, ev);
- else if (act->func.end)
- act->func.end(obj, bind->params);
- return act;
- }
- return NULL;
+ if (bind_ret) *bind_ret = bind;
+ return act;
}
}
}
return NULL;
}
+E_Action *
+e_bindings_mouse_up_event_handle(E_Binding_Context ctxt, E_Object *obj,
Ecore_X_Event_Mouse_Button_Up *ev)
+{
+ E_Action *act;
+ E_Binding_Mouse *bind;
+
+ act = e_bindings_mouse_up_find(ctxt, obj, ev, &bind);
+ if (act)
+ {
+ if (act->func.end_mouse)
+ act->func.end_mouse(obj, bind->params, ev);
+ else if (act->func.end)
+ act->func.end(obj, bind->params);
+ return act;
+ }
+ return act;
+}
+
/* FIXME: finish off key bindings */
void
e_bindings_key_add(E_Binding_Context ctxt, char *key, E_Binding_Modifier mod,
int any_mod, char *action, char *params)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_bindings.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- e_bindings.h 18 May 2005 05:06:04 -0000 1.8
+++ e_bindings.h 20 May 2005 10:14:51 -0000 1.9
@@ -26,10 +26,43 @@
E_BINDING_MODIFIER_WIN = (1 << 3)
} E_Binding_Modifier;
+typedef struct _E_Binding_Mouse E_Binding_Mouse;
+typedef struct _E_Binding_Key E_Binding_Key;
+typedef struct _E_Binding_Signal E_Binding_Signal;
+
#else
#ifndef E_BINDINGS_H
#define E_BINDINGS_H
+struct _E_Binding_Mouse
+{
+ E_Binding_Context ctxt;
+ int button;
+ E_Binding_Modifier mod;
+ unsigned char any_mod : 1;
+ char *action;
+ char *params;
+};
+
+struct _E_Binding_Key
+{
+ E_Binding_Context ctxt;
+ char *key;
+ E_Binding_Modifier mod;
+ unsigned char any_mod : 1;
+ char *action;
+ char *params;
+};
+
+struct _E_Binding_Signal
+{
+ E_Binding_Context ctxt;
+ char *sig;
+ char *src;
+ char *action;
+ char *params;
+};
+
EAPI int e_bindings_init(void);
EAPI int e_bindings_shutdown(void);
@@ -37,7 +70,9 @@
EAPI void e_bindings_mouse_del(E_Binding_Context ctxt, int button,
E_Binding_Modifier mod, int any_mod, char *action, char *params);
EAPI void e_bindings_mouse_grab(E_Binding_Context ctxt, Ecore_X_Window
win);
EAPI void e_bindings_mouse_ungrab(E_Binding_Context ctxt,
Ecore_X_Window win);
+EAPI E_Action *e_bindings_mouse_down_find(E_Binding_Context ctxt, E_Object
*obj, Ecore_X_Event_Mouse_Button_Down *ev, E_Binding_Mouse **bind_ret);
EAPI E_Action *e_bindings_mouse_down_event_handle(E_Binding_Context ctxt,
E_Object *obj, Ecore_X_Event_Mouse_Button_Down *ev);
+EAPI E_Action *e_bindings_mouse_up_find(E_Binding_Context ctxt, E_Object
*obj, Ecore_X_Event_Mouse_Button_Up *ev, E_Binding_Mouse **bind_ret);
EAPI E_Action *e_bindings_mouse_up_event_handle(E_Binding_Context ctxt,
E_Object *obj, Ecore_X_Event_Mouse_Button_Up *ev);
EAPI void e_bindings_key_add(E_Binding_Context ctxt, char *key,
E_Binding_Modifier mod, int any_mod, char *action, char *params);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v
retrieving revision 1.218
retrieving revision 1.219
diff -u -3 -r1.218 -r1.219
--- e_border.c 20 May 2005 09:27:05 -0000 1.218
+++ e_border.c 20 May 2005 10:14:51 -0000 1.219
@@ -1379,6 +1379,7 @@
E_Border *bd;
bd = l->data;
+ e_focus_setdown(bd);
e_bindings_mouse_ungrab(E_BINDING_CONTEXT_BORDER, bd->win);
}
}
@@ -1394,6 +1395,7 @@
bd = l->data;
e_bindings_mouse_grab(E_BINDING_CONTEXT_BORDER, bd->win);
+ e_focus_setup(bd);
}
}
@@ -2448,8 +2450,7 @@
e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_BORDER,
E_OBJECT(bd), ev);
}
- if (!bd->cur_mouse_action)
- e_focus_event_mouse_down(bd);
+ e_focus_event_mouse_down(bd);
}
if (ev->win != bd->event_win) return 1;
if ((ev->button >= 1) && (ev->button <= 3))
@@ -2504,6 +2505,7 @@
/* ... VERY unlikely though... VERY */
/* also we dont pass the same params that went in - then again that */
/* should be ok as we are just ending the action if it has an end */
+ printf("mouse up after grab!\n");
if (bd->cur_mouse_action)
{
if (bd->cur_mouse_action->func.end_mouse)
@@ -2655,17 +2657,25 @@
static int
_e_border_cb_grab_replay(void *data, int type, void *event)
-{
- if (type == ECORE_X_EVENT_MOUSE_BUTTON_DOWN)
+{
+ Ecore_X_Event_Mouse_Button_Down *ev;
+ if (type != ECORE_X_EVENT_MOUSE_BUTTON_DOWN) return 0;
+
+ ev = event;
+ if ((e_config->pass_click_on) || (e_config->always_click_to_raise))
{
- Ecore_X_Event_Mouse_Button_Down *e;
-
- e = event;
- if ((e_config->pass_click_on) ||
- (e_config->always_click_to_raise))
+ E_Border *bd;
+
+ bd = e_border_find_by_window(ev->event_win);
+ if (bd)
{
- printf("ALLOW PRESS\n");
- return 1;
+ if (bd->cur_mouse_action) return 0;
+ if (ev->event_win == bd->win)
+ {
+ if (!e_bindings_mouse_down_find(E_BINDING_CONTEXT_BORDER,
+ E_OBJECT(bd), ev, NULL))
+ return 1;
+ }
}
}
return 0;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- e_config.c 20 May 2005 09:27:05 -0000 1.52
+++ e_config.c 20 May 2005 10:14:51 -0000 1.53
@@ -207,7 +207,7 @@
e_config->language = strdup("");
e_config->focus_policy = E_FOCUS_MOUSE;
e_config->pass_click_on = 1;
- e_config->always_click_to_raise = 1;
+ e_config->always_click_to_raise = 0;
e_config->use_auto_raise = 0;
e_config->auto_raise_delay = 0.5;
{
@@ -670,7 +670,6 @@
e_config_save_queue();
}
// e_config->evas_engine_container = E_EVAS_ENGINE_GL_X11;
- e_config->focus_policy = E_FOCUS_MOUSE;
E_CONFIG_LIMIT(e_config->menus_scroll_speed, 1.0, 20000.0);
E_CONFIG_LIMIT(e_config->menus_fast_mouse_move_threshhold, 1.0, 2000.0);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- e_config.h 20 May 2005 09:27:06 -0000 1.25
+++ e_config.h 20 May 2005 10:14:51 -0000 1.26
@@ -100,6 +100,7 @@
double auto_raise_delay;
};
+/* FIXME: all of thsie needs to become eet lumps for enmcode/decode */
struct _E_Config_Module
{
char *name;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_focus.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- e_focus.c 20 May 2005 09:27:06 -0000 1.9
+++ e_focus.c 20 May 2005 10:14:51 -0000 1.10
@@ -30,7 +30,6 @@
void
e_focus_event_mouse_in(E_Border* bd)
{
- /* If focus follows mouse */
if (e_config->focus_policy == E_FOCUS_MOUSE)
e_border_focus_set(bd, 1, 1);
@@ -47,7 +46,6 @@
void
e_focus_event_mouse_out(E_Border* bd)
{
- /* If focus follows mouse */
if (e_config->focus_policy == E_FOCUS_MOUSE)
e_border_focus_set(bd, 0, 1);
@@ -66,6 +64,10 @@
e_border_focus_set(bd, 1, 1);
e_border_raise(bd);
}
+ else if (e_config->always_click_to_raise)
+ {
+ e_border_raise(bd);
+ }
}
void
@@ -80,7 +82,9 @@
(!e_config->always_click_to_raise))
{
if (!bd->button_grabbed) return;
+ e_bindings_mouse_ungrab(E_BINDING_CONTEXT_BORDER, bd->win);
ecore_x_window_button_ungrab(bd->win, 1, 0, 1);
+ e_bindings_mouse_grab(E_BINDING_CONTEXT_BORDER, bd->win);
bd->button_grabbed = 0;
}
}
@@ -92,7 +96,10 @@
(!e_config->always_click_to_raise))
{
if (bd->button_grabbed) return;
- ecore_x_window_button_grab(bd->win, 1, ECORE_X_EVENT_MASK_MOUSE_DOWN,
0, 1);
+ ecore_x_window_button_grab(bd->win, 0,
+ ECORE_X_EVENT_MASK_MOUSE_DOWN |
+ ECORE_X_EVENT_MASK_MOUSE_UP |
+ ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1);
bd->button_grabbed = 1;
}
}
@@ -104,7 +111,10 @@
(e_config->always_click_to_raise))
{
if (bd->button_grabbed) return;
- ecore_x_window_button_grab(bd->win, 1, ECORE_X_EVENT_MASK_MOUSE_DOWN,
0, 1);
+ ecore_x_window_button_grab(bd->win, 0,
+ ECORE_X_EVENT_MASK_MOUSE_DOWN |
+ ECORE_X_EVENT_MASK_MOUSE_UP |
+ ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1);
bd->button_grabbed = 1;
}
}
@@ -113,7 +123,9 @@
e_focus_setdown(E_Border *bd)
{
if (!bd->button_grabbed) return;
+ e_bindings_mouse_ungrab(E_BINDING_CONTEXT_BORDER, bd->win);
ecore_x_window_button_ungrab(bd->win, 1, 0, 1);
+ e_bindings_mouse_grab(E_BINDING_CONTEXT_BORDER, bd->win);
bd->button_grabbed = 0;
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- e_ipc.c 20 May 2005 09:27:06 -0000 1.29
+++ e_ipc.c 20 May 2005 10:14:51 -0000 1.30
@@ -736,12 +736,13 @@
E_IPC_OP_DESKS_GET_REPLY);
break;
case E_IPC_OP_FOCUS_POLICY_SET:
+ e_border_button_bindings_ungrab_all();
if (e_ipc_codec_int_dec(e->data, e->size,
&(e_config->focus_policy)))
{
- /* FIXME: if going to/from click to focus grab/ungrab */
e_config_save_queue();
}
+ e_border_button_bindings_grab_all();
break;
case E_IPC_OP_FOCUS_POLICY_GET:
_e_ipc_reply_int_send(e->client,
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_zone.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- e_zone.c 20 May 2005 06:30:26 -0000 1.52
+++ e_zone.c 20 May 2005 10:14:51 -0000 1.53
@@ -88,6 +88,7 @@
evas_object_move(o, x, y);
evas_object_resize(o, w, h);
evas_object_color_set(o, 255, 255, 255, 255);
+ evas_object_repeat_events_set(o, 1);
evas_object_show(o);
o = edje_object_add(con->bg_evas);
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs