signal bindings.!!!! this means you can completely rebind every event and

action on a window border theme/design to do what you want. the theme doesnt
determine this anymore. as with wheel bindings it still isnt exported to
config fiels and ipc yet, but the functionality is done.


SVN revision: 16848
This commit is contained in:
Carsten Haitzler 2005-09-22 16:36:59 +00:00
parent 00616d3fec
commit 3c9e205fdb
6 changed files with 516 additions and 540 deletions

View File

@ -349,7 +349,7 @@ group {
rel1 {
relative: 0.0 0.0;
offset: 0 0;
to_x: "button_2";
to_x: "minimize";
}
rel2 {
relative: 1.0 1.0;
@ -1110,9 +1110,9 @@ group {
}
}
BORDER_BUTTON_ADV("button_0","close",0.0,0.0, 0,0,"whole", "whole",1.0,1.0,-1,5,"whole", "title2")
BORDER_BUTTON("button_1","maximize",0.0,0.0,3,0,"button_0",0.0,1.0,3,-1,"button_0")
BORDER_BUTTON("button_2","minimize",0.0,0.0,3,0,"button_1",0.0,1.0,3,-1,"button_1")
BORDER_BUTTON_ADV("close","close",0.0,0.0, 0,0,"whole", "whole",1.0,1.0,-1,5,"whole", "title2")
BORDER_BUTTON("maximize","maximize",0.0,0.0,3,0,"close",0.0,1.0,3,-1,"close")
BORDER_BUTTON("minimize","minimize",0.0,0.0,3,0,"maximize",0.0,1.0,3,-1,"maximize")
part {
name: "icon";
@ -1144,177 +1144,6 @@ group {
}
}
programs {
/*
program {
name: "TESTIES";
signal: "show";
source: "";
action: SIGNAL_EMIT "active" "";
}
*/
program {
name: "move_window1";
signal: "mouse,down,1";
source: "title";
action: SIGNAL_EMIT "move_start" "mouse,1";
}
program {
name: "move_window2";
signal: "mouse,up,1";
source: "title";
action: SIGNAL_EMIT "move_stop" "mouse,1";
}
program {
name: "resize_window_tl1";
signal: "mouse,down,1";
source: "resize_tl";
action: SIGNAL_EMIT "resize_tl_start" "mouse,1";
}
program {
name: "resize_window_tl2";
signal: "mouse,up,1";
source: "resize_tl";
action: SIGNAL_EMIT "resize_stop" "mouse,1";
}
program {
name: "resize_window_t1";
signal: "mouse,down,1";
source: "resize_t";
action: SIGNAL_EMIT "resize_t_start" "mouse,1";
}
program {
name: "resize_window_t2";
signal: "mouse,up,1";
source: "resize_t";
action: SIGNAL_EMIT "resize_stop" "mouse,1";
}
program {
name: "resize_window_tr1";
signal: "mouse,down,1";
source: "resize_tr";
action: SIGNAL_EMIT "resize_tr_start" "mouse,1";
}
program {
name: "resize_window_tr2";
signal: "mouse,up,1";
source: "resize_tr";
action: SIGNAL_EMIT "resize_stop" "mouse,1";
}
program {
name: "resize_window_r1";
signal: "mouse,down,1";
source: "resize_r";
action: SIGNAL_EMIT "resize_r_start" "mouse,1";
}
program {
name: "resize_window_r2";
signal: "mouse,up,1";
source: "resize_r";
action: SIGNAL_EMIT "resize_stop" "mouse,1";
}
program {
name: "resize_window_br1";
signal: "mouse,down,1";
source: "resize_br";
action: SIGNAL_EMIT "resize_br_start" "mouse,1";
}
program {
name: "resize_window_br2";
signal: "mouse,up,1";
source: "resize_br";
action: SIGNAL_EMIT "resize_stop" "mouse,1";
}
program {
name: "resize_window_b1";
signal: "mouse,down,1";
source: "resize_b";
action: SIGNAL_EMIT "resize_b_start" "mouse,1";
}
program {
name: "resize_window_b2";
signal: "mouse,up,1";
source: "resize_b";
action: SIGNAL_EMIT "resize_stop" "mouse,1";
}
program {
name: "resize_window_bl1";
signal: "mouse,down,1";
source: "resize_bl";
action: SIGNAL_EMIT "resize_bl_start" "mouse,1";
}
program {
name: "resize_window_bl2";
signal: "mouse,up,1";
source: "resize_bl";
action: SIGNAL_EMIT "resize_stop" "mouse,1";
}
program {
name: "resize_window_l1";
signal: "mouse,down,1";
source: "resize_l";
action: SIGNAL_EMIT "resize_l_start" "mouse,1";
}
program {
name: "resize_window_l2";
signal: "mouse,up,1";
source: "resize_l";
action: SIGNAL_EMIT "resize_stop" "mouse,1";
}
program {
name: "menu_action_icon1";
signal: "mouse,clicked,1";
source: "icon";
action: SIGNAL_EMIT "action" "menu";
}
program {
name: "menu_action_icon3";
signal: "mouse,clicked,3";
source: "icon";
action: SIGNAL_EMIT "action" "menu";
}
program {
name: "menu_action_icon4";
signal: "mouse,down,1";
source: "icon";
action: SIGNAL_EMIT "drag" "icon";
}
program {
name: "menu_action_title3";
signal: "mouse,clicked,3";
source: "title";
action: SIGNAL_EMIT "action" "menu";
}
program {
name: "menu_action_title4";
signal: "mouse,clicked,2";
source: "title";
action: SIGNAL_EMIT "action" "lower";
}
program {
name: "close_action";
signal: "mouse,clicked,1";
source: "button_0";
action: SIGNAL_EMIT "action" "close";
}
program {
name: "maximize_action";
signal: "mouse,clicked,1";
source: "button_1";
action: SIGNAL_EMIT "action" "maximize";
}
program {
name: "iconify_action";
signal: "mouse,clicked,1";
source: "button_2";
action: SIGNAL_EMIT "action" "iconify";
}
program {
name: "shade_action";
signal: "mouse,down,1,double";
source: "title";
action: SIGNAL_EMIT "action" "shade";
}
program {
name: "go_active_pre";
signal: "active";
@ -1426,197 +1255,197 @@ group {
}
program {
name: "button_0_active_pre";
name: "close_active_pre";
signal: "mouse,down,1";
source: "button_0";
source: "close";
action: STATE_SET "default" 0.0;
target: "button_0_shadow1";
target: "button_0_shadow2";
target: "button_0_bg";
target: "button_0_detail";
after: "button_0_active";
after: "button_0_active_p";
target: "close_shadow1";
target: "close_shadow2";
target: "close_bg";
target: "close_detail";
after: "close_active";
after: "close_active_p";
}
program {
name: "button_0_active";
name: "close_active";
action: STATE_SET "active" 0.0;
target: "button_0_shadow2";
target: "close_shadow2";
transition: LINEAR 0.05;
after: "button_0_active2";
after: "close_active2";
}
program {
name: "button_0_active2";
name: "close_active2";
action: STATE_SET "active" 0.0;
target: "button_0_shadow1";
target: "close_shadow1";
transition: LINEAR 0.05;
}
program {
name: "button_0_active_p";
name: "close_active_p";
action: STATE_SET "active" 0.0;
target: "button_0_bg";
target: "button_0_detail";
target: "close_bg";
target: "close_detail";
transition: LINEAR 0.1;
}
program {
name: "button_0_passive_pre";
name: "close_passive_pre";
signal: "mouse,up,1";
source: "button_0";
source: "close";
action: STATE_SET "active" 0.0;
target: "button_0_shadow1";
target: "button_0_shadow2";
target: "button_0_bg";
target: "button_0_detail";
after: "button_0_passive";
after: "button_0_passive_p";
target: "close_shadow1";
target: "close_shadow2";
target: "close_bg";
target: "close_detail";
after: "close_passive";
after: "close_passive_p";
}
program {
name: "button_0_passive";
name: "close_passive";
action: STATE_SET "default" 0.0;
target: "button_0_shadow2";
target: "close_shadow2";
transition: LINEAR 0.1;
after: "button_0_passive2";
after: "close_passive2";
}
program {
name: "button_0_passive2";
name: "close_passive2";
action: STATE_SET "default" 0.0;
target: "button_0_shadow1";
target: "close_shadow1";
transition: LINEAR 0.1;
}
program {
name: "button_0_passive_p";
name: "close_passive_p";
action: STATE_SET "default" 0.0;
target: "button_0_bg";
target: "button_0_detail";
target: "close_bg";
target: "close_detail";
transition: LINEAR 0.2;
}
program {
name: "button_1_active_pre";
name: "maximize_active_pre";
signal: "mouse,down,1";
source: "button_1";
source: "maximize";
action: STATE_SET "default" 0.0;
target: "button_1_shadow1";
target: "button_1_shadow2";
target: "button_1_bg";
target: "button_1_detail";
after: "button_1_active";
after: "button_1_active_p";
target: "maximize_shadow1";
target: "maximize_shadow2";
target: "maximize_bg";
target: "maximize_detail";
after: "maximize_active";
after: "maximize_active_p";
}
program {
name: "button_1_active";
name: "maximize_active";
action: STATE_SET "active" 0.0;
target: "button_1_shadow2";
target: "maximize_shadow2";
transition: LINEAR 0.05;
after: "button_1_active2";
after: "maximize_active2";
}
program {
name: "button_1_active2";
name: "maximize_active2";
action: STATE_SET "active" 0.0;
target: "button_1_shadow1";
target: "maximize_shadow1";
transition: LINEAR 0.05;
}
program {
name: "button_1_active_p";
name: "maximize_active_p";
action: STATE_SET "active" 0.0;
target: "button_1_bg";
target: "button_1_detail";
target: "maximize_bg";
target: "maximize_detail";
transition: LINEAR 0.1;
}
program {
name: "button_1_passive_pre";
name: "maximize_passive_pre";
signal: "mouse,up,1";
source: "button_1";
source: "maximize";
action: STATE_SET "active" 0.0;
target: "button_1_shadow1";
target: "button_1_shadow2";
target: "button_1_bg";
target: "button_1_detail";
after: "button_1_passive";
after: "button_1_passive_p";
target: "maximize_shadow1";
target: "maximize_shadow2";
target: "maximize_bg";
target: "maximize_detail";
after: "maximize_passive";
after: "maximize_passive_p";
}
program {
name: "button_1_passive";
name: "maximize_passive";
action: STATE_SET "default" 0.0;
target: "button_1_shadow2";
target: "maximize_shadow2";
transition: LINEAR 0.1;
after: "button_1_passive2";
after: "maximize_passive2";
}
program {
name: "button_1_passive2";
name: "maximize_passive2";
action: STATE_SET "default" 0.0;
target: "button_1_shadow1";
target: "maximize_shadow1";
transition: LINEAR 0.1;
}
program {
name: "button_1_passive_p";
name: "maximize_passive_p";
action: STATE_SET "default" 0.0;
target: "button_1_bg";
target: "button_1_detail";
target: "maximize_bg";
target: "maximize_detail";
transition: LINEAR 0.2;
}
program {
name: "button_2_active_pre";
name: "minimize_active_pre";
signal: "mouse,down,1";
source: "button_2";
source: "minimize";
action: STATE_SET "default" 0.0;
target: "button_2_shadow1";
target: "button_2_shadow2";
target: "button_2_bg";
target: "button_2_detail";
after: "button_2_active";
after: "button_2_active_p";
target: "minimize_shadow1";
target: "minimize_shadow2";
target: "minimize_bg";
target: "minimize_detail";
after: "minimize_active";
after: "minimize_active_p";
}
program {
name: "button_2_active";
name: "minimize_active";
action: STATE_SET "active" 0.0;
target: "button_2_shadow2";
target: "minimize_shadow2";
transition: LINEAR 0.05;
after: "button_2_active2";
after: "minimize_active2";
}
program {
name: "button_2_active2";
name: "minimize_active2";
action: STATE_SET "active" 0.0;
target: "button_2_shadow1";
target: "minimize_shadow1";
transition: LINEAR 0.05;
}
program {
name: "button_2_active_p";
name: "minimize_active_p";
action: STATE_SET "active" 0.0;
target: "button_2_bg";
target: "button_2_detail";
target: "minimize_bg";
target: "minimize_detail";
transition: LINEAR 0.1;
}
program {
name: "button_2_passive_pre";
name: "minimize_passive_pre";
signal: "mouse,up,1";
source: "button_2";
source: "minimize";
action: STATE_SET "active" 0.0;
target: "button_2_shadow1";
target: "button_2_shadow2";
target: "button_2_bg";
target: "button_2_detail";
after: "button_2_passive";
after: "button_2_passive_p";
target: "minimize_shadow1";
target: "minimize_shadow2";
target: "minimize_bg";
target: "minimize_detail";
after: "minimize_passive";
after: "minimize_passive_p";
}
program {
name: "button_2_passive";
name: "minimize_passive";
action: STATE_SET "default" 0.0;
target: "button_2_shadow2";
target: "minimize_shadow2";
transition: LINEAR 0.1;
after: "button_2_passive2";
after: "minimize_passive2";
}
program {
name: "button_2_passive2";
name: "minimize_passive2";
action: STATE_SET "default" 0.0;
target: "button_2_shadow1";
target: "minimize_shadow1";
transition: LINEAR 0.1;
}
program {
name: "button_2_passive_p";
name: "minimize_passive_p";
action: STATE_SET "default" 0.0;
target: "button_2_bg";
target: "button_2_detail";
target: "minimize_bg";
target: "minimize_detail";
transition: LINEAR 0.2;
}
program {

View File

@ -25,6 +25,13 @@
}
#define ACT_FN_GO_WHEEL(act) \
static void _e_actions_act_##act##_go_wheel(E_Object *obj, char *params, Ecore_X_Event_Mouse_Wheel *ev)
#define ACT_GO_SIGNAL(name) \
{ \
act = e_action_add(#name); \
if (act) act->func.go_signal = _e_actions_act_##name##_go_signal; \
}
#define ACT_FN_GO_SIGNAL(act) \
static void _e_actions_act_##act##_go_signal(E_Object *obj, char *params, char *sig, char *src)
#define ACT_GO_KEY(name) \
{ \
act = e_action_add(#name); \
@ -76,6 +83,26 @@ ACT_FN_GO_MOUSE(window_move)
if (!((E_Border *)obj)->lock_user_location)
e_border_act_move_begin((E_Border *)obj, ev);
}
ACT_FN_GO_SIGNAL(window_move)
{
if (!obj) obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
if (obj->type != E_BORDER_TYPE) return;
if (!((E_Border *)obj)->lock_user_location)
{
if ((params) && (!strcmp(params, "end")))
{
e_border_signal_move_end((E_Border *)obj, sig, src);
}
else
{
if (((E_Border *)obj)->moving)
e_border_signal_move_end((E_Border *)obj, sig, src);
else
e_border_signal_move_begin((E_Border *)obj, sig, src);
}
}
}
ACT_FN_END(window_move)
{
if (!obj) obj = E_OBJECT(e_border_focused_get());
@ -108,6 +135,25 @@ ACT_FN_GO_MOUSE(window_resize)
if (!((E_Border *)obj)->lock_user_size)
e_border_act_resize_begin((E_Border *)obj, ev);
}
ACT_FN_GO_SIGNAL(window_resize)
{
if (!obj) obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
if (obj->type != E_BORDER_TYPE) return;
if (!((E_Border *)obj)->lock_user_size)
{
if ((params) && (!strcmp(params, "end")))
e_border_signal_resize_end((E_Border *)obj, params, sig, src);
else
{
if (!params) params = "";
if (e_border_resizing_get((E_Border *)obj))
e_border_signal_resize_end((E_Border *)obj, params, sig, src);
else
e_border_signal_resize_begin((E_Border *)obj, params, sig, src);
}
}
}
ACT_FN_END(window_resize)
{
if (!obj) obj = E_OBJECT(e_border_focused_get());
@ -234,6 +280,31 @@ ACT_FN_GO(window_sticky_toggle)
}
}
/***************************************************************************/
ACT_FN_GO(window_sticky)
{
if (!obj) obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
if (obj->type != E_BORDER_TYPE)
{
obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
}
if (!((E_Border *)obj)->lock_user_sticky)
{
E_Border *bd;
bd = (E_Border *)obj;
if (params)
{
if (atoi(params) == 1)
e_border_stick(bd);
else if (atoi(params) == 1)
e_border_unstick(bd);
}
}
}
/***************************************************************************/
ACT_FN_GO(window_iconic_toggle)
{
@ -254,6 +325,31 @@ ACT_FN_GO(window_iconic_toggle)
}
}
/***************************************************************************/
ACT_FN_GO(window_iconic)
{
if (!obj) obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
if (obj->type != E_BORDER_TYPE)
{
obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
}
if (!((E_Border *)obj)->lock_user_iconify)
{
E_Border *bd;
bd = (E_Border *)obj;
if (params)
{
if (atoi(params) == 1)
e_border_iconify(bd);
else if (atoi(params) == 0)
e_border_uniconify(bd);
}
}
}
/***************************************************************************/
ACT_FN_GO(window_maximized_toggle)
{
@ -270,7 +366,55 @@ ACT_FN_GO(window_maximized_toggle)
bd = (E_Border *)obj;
if (bd->maximized) e_border_unmaximize(bd);
else e_border_maximize(bd, e_config->maximize_policy);
else
{
if (!params)
e_border_maximize(bd, e_config->maximize_policy);
else
{
if (!strcmp(params, "fullscreen")) e_border_maximize(bd, E_MAXIMIZE_FULLSCREEN);
else if (!strcmp(params, "smart")) e_border_maximize(bd, E_MAXIMIZE_SMART);
else if (!strcmp(params, "expand")) e_border_maximize(bd, E_MAXIMIZE_EXPAND);
else if (!strcmp(params, "fill")) e_border_maximize(bd, E_MAXIMIZE_FILL);
else e_border_maximize(bd, e_config->maximize_policy);
}
}
}
}
/***************************************************************************/
ACT_FN_GO(window_maximized)
{
if (!obj) obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
if (obj->type != E_BORDER_TYPE)
{
obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
}
if (!((E_Border *)obj)->lock_user_maximize)
{
E_Border *bd;
bd = (E_Border *)obj;
if (params)
{
int v;
char buf[32];
if (sscanf(params, "%i %20s", &v, buf) == 2)
{
if (v == 1)
{
if (!strcmp(buf, "fullscreen")) e_border_maximize(bd, E_MAXIMIZE_FULLSCREEN);
else if (!strcmp(buf, "smart")) e_border_maximize(bd, E_MAXIMIZE_SMART);
else if (!strcmp(buf, "expand")) e_border_maximize(bd, E_MAXIMIZE_EXPAND);
else if (!strcmp(buf, "fill")) e_border_maximize(bd, E_MAXIMIZE_FILL);
}
else if (v == 0)
e_border_unmaximize(bd);
}
}
}
}
@ -289,13 +433,78 @@ ACT_FN_GO(window_shaded_toggle)
E_Border *bd;
bd = (E_Border *)obj;
if (bd->shaded) e_border_unshade(bd, E_DIRECTION_UP);
else e_border_shade(bd, E_DIRECTION_UP);
if (bd->shaded)
{
if (!params)
e_border_unshade(bd, E_DIRECTION_UP);
else
{
if (!strcmp(params, "up")) e_border_unshade(bd, E_DIRECTION_UP);
else if (!strcmp(params, "down")) e_border_unshade(bd, E_DIRECTION_DOWN);
else if (!strcmp(params, "left")) e_border_unshade(bd, E_DIRECTION_LEFT);
else if (!strcmp(params, "right")) e_border_unshade(bd, E_DIRECTION_RIGHT);
else e_border_unshade(bd, E_DIRECTION_UP);
}
}
else
{
if (!params)
e_border_shade(bd, E_DIRECTION_UP);
else
{
if (!strcmp(params, "up")) e_border_shade(bd, E_DIRECTION_UP);
else if (!strcmp(params, "down")) e_border_shade(bd, E_DIRECTION_DOWN);
else if (!strcmp(params, "left")) e_border_shade(bd, E_DIRECTION_LEFT);
else if (!strcmp(params, "right")) e_border_shade(bd, E_DIRECTION_RIGHT);
else e_border_shade(bd, E_DIRECTION_UP);
}
}
}
}
/***************************************************************************/
ACT_FN_GO(move_relative)
ACT_FN_GO(window_shaded)
{
if (!obj) obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
if (obj->type != E_BORDER_TYPE)
{
obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
}
if (!((E_Border *)obj)->lock_user_shade)
{
E_Border *bd;
bd = (E_Border *)obj;
if (params)
{
int v;
char buf[32];
if (sscanf(params, "%i %20s", &v, buf) == 2)
{
if (v == 1)
{
if (!strcmp(buf, "up")) e_border_shade(bd, E_DIRECTION_UP);
else if (!strcmp(buf, "down")) e_border_shade(bd, E_DIRECTION_DOWN);
else if (!strcmp(buf, "left")) e_border_shade(bd, E_DIRECTION_LEFT);
else if (!strcmp(buf, "right")) e_border_shade(bd, E_DIRECTION_RIGHT);
}
else if (v == 0)
{
if (!strcmp(buf, "up")) e_border_unshade(bd, E_DIRECTION_UP);
else if (!strcmp(buf, "down")) e_border_unshade(bd, E_DIRECTION_DOWN);
else if (!strcmp(buf, "left")) e_border_unshade(bd, E_DIRECTION_LEFT);
else if (!strcmp(buf, "right")) e_border_unshade(bd, E_DIRECTION_RIGHT);
}
}
}
}
}
/***************************************************************************/
ACT_FN_GO(window_move_by)
{
if (!obj) obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
@ -325,7 +534,7 @@ ACT_FN_GO(move_relative)
}
/***************************************************************************/
ACT_FN_GO(move_absolute)
ACT_FN_GO(window_move_to)
{
if (!obj) obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
@ -373,7 +582,7 @@ ACT_FN_GO(move_absolute)
}
/***************************************************************************/
ACT_FN_GO(resize)
ACT_FN_GO(window_resize_by)
{
if (!obj) obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
@ -401,6 +610,26 @@ ACT_FN_GO(resize)
}
}
/***************************************************************************/
ACT_FN_GO(window_drag_icon)
{
if (!obj) obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
if (obj->type != E_BORDER_TYPE)
{
obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
}
{
E_Border *bd;
bd = (E_Border *)obj;
bd->drag.start = 1;
bd->drag.x = -1;
bd->drag.y = -1;
}
}
/***************************************************************************/
static E_Zone *
_e_actions_zone_get(E_Object *obj)
@ -921,11 +1150,13 @@ e_actions_init(void)
ACT_GO(window_move);
ACT_GO_MOUSE(window_move);
ACT_GO_SIGNAL(window_move);
ACT_END(window_move);
ACT_END_MOUSE(window_move);
ACT_GO(window_resize);
ACT_GO_MOUSE(window_resize);
ACT_GO_SIGNAL(window_resize);
ACT_END(window_resize);
ACT_END_MOUSE(window_resize);
@ -943,12 +1174,20 @@ e_actions_init(void)
ACT_GO(window_sticky_toggle);
ACT_GO(window_sticky);
ACT_GO(window_iconic_toggle);
ACT_GO(window_iconic);
ACT_GO(window_maximized_toggle);
ACT_GO(window_maximized);
ACT_GO(window_shaded_toggle);
ACT_GO(window_shaded);
ACT_GO(desk_flip_by);
ACT_GO(desk_flip_to);
@ -957,11 +1196,13 @@ e_actions_init(void)
ACT_GO(desk_linear_flip_to);
ACT_GO(move_absolute);
ACT_GO(window_move_to);
ACT_GO(move_relative);
ACT_GO(window_move_by);
ACT_GO(resize);
ACT_GO(window_resize_by);
ACT_GO(window_drag_icon);
ACT_GO(menu_show);
ACT_GO_MOUSE(menu_show);

View File

@ -21,6 +21,7 @@ struct _E_Action
void (*go_mouse) (E_Object *obj, char *params, Ecore_X_Event_Mouse_Button_Down *ev);
void (*go_wheel) (E_Object *obj, char *params, Ecore_X_Event_Mouse_Wheel *ev);
void (*go_key) (E_Object *obj, char *params, Ecore_X_Event_Key_Down *ev);
void (*go_signal) (E_Object *obj, char *params, char *sig, char *src);
void (*end) (E_Object *obj, char *params);
void (*end_mouse) (E_Object *obj, char *params, Ecore_X_Event_Mouse_Button_Up *ev);
void (*end_key) (E_Object *obj, char *params, Ecore_X_Event_Key_Up *ev);

View File

@ -46,6 +46,7 @@ e_bindings_init(void)
/* FIXME: these need to be come normal e_config bindings that you can
* modify via ipc and are saved/loaded to/from the user's config
*/
/* wheel events.. anywhere! :) */
e_bindings_wheel_add(E_BINDING_CONTEXT_CONTAINER,
0, -1, E_BINDING_MODIFIER_NONE, 1,
"desk_linear_flip_by", "-1");
@ -82,7 +83,88 @@ e_bindings_init(void)
e_bindings_wheel_add(E_BINDING_CONTEXT_BORDER,
1, 1, E_BINDING_MODIFIER_ALT, 0,
"desk_linear_flip_by", "1");
/* these now let you bind your own actions to a border */
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,down,1,double", "title", E_BINDING_MODIFIER_NONE, 1,
"window_shaded_toggle", "up");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,down,2", "title", E_BINDING_MODIFIER_NONE, 1,
"window_shaded_toggle", "up");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,wheel,?,1", "title", E_BINDING_MODIFIER_NONE, 1,
"window_shaded", "0 up");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,wheel,?,-1", "title", E_BINDING_MODIFIER_NONE, 1,
"window_shaded", "1 up");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,clicked,3", "title", E_BINDING_MODIFIER_NONE, 1,
"window_menu", "");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,clicked,?", "icon", E_BINDING_MODIFIER_NONE, 1,
"window_menu", "");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,clicked,[12]", "close", E_BINDING_MODIFIER_NONE, 1,
"window_close", "");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,clicked,3", "close", E_BINDING_MODIFIER_NONE, 1,
"window_kill", "");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,clicked,1", "maximize", E_BINDING_MODIFIER_NONE, 1,
"window_maximized_toggle", "");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,clicked,2", "maximize", E_BINDING_MODIFIER_NONE, 1,
"window_maximized_toggle", "smart");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,clicked,3", "maximize", E_BINDING_MODIFIER_NONE, 1,
"window_maximized_toggle", "expand");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,clicked,?", "minimize", E_BINDING_MODIFIER_NONE, 1,
"window_iconic_toggle", "");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,down,1", "icon", E_BINDING_MODIFIER_NONE, 1,
"window_drag_icon", "");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,down,1", "title", E_BINDING_MODIFIER_NONE, 1,
"window_move", "");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,up,1", "title", E_BINDING_MODIFIER_NONE, 1,
"window_move", "end");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,down,1", "resize_tl", E_BINDING_MODIFIER_NONE, 1,
"window_resize", "tl");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,down,1", "resize_t", E_BINDING_MODIFIER_NONE, 1,
"window_resize", "t");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,down,1", "resize_tr", E_BINDING_MODIFIER_NONE, 1,
"window_resize", "tr");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,down,1", "resize_r", E_BINDING_MODIFIER_NONE, 1,
"window_resize", "r");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,down,1", "resize_br", E_BINDING_MODIFIER_NONE, 1,
"window_resize", "br");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,down,1", "resize_b", E_BINDING_MODIFIER_NONE, 1,
"window_resize", "b");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,down,1", "resize_bl", E_BINDING_MODIFIER_NONE, 1,
"window_resize", "bl");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,down,1", "resize_l", E_BINDING_MODIFIER_NONE, 1,
"window_resize", "l");
e_bindings_signal_add(E_BINDING_CONTEXT_BORDER,
"mouse,up,1", "resize_*", E_BINDING_MODIFIER_NONE, 1,
"window_resize", "end");
return 1;
}
@ -562,7 +644,9 @@ e_bindings_signal_handle(E_Binding_Context ctxt, E_Object *obj, char *sig, char
act = e_bindings_signal_find(ctxt, obj, sig, src, &bind);
if (act)
{
if (act->func.go)
if (act->func.go_signal)
act->func.go_signal(obj, bind->params, sig, src);
else if (act->func.go)
act->func.go(obj, bind->params);
return act;
}

View File

@ -46,21 +46,8 @@ static int _e_border_cb_window_move_resize_request(void *data, int ev_type, void
static int _e_border_cb_desktop_change(void *data, int ev_type, void *ev);
static int _e_border_cb_sync_alarm(void *data, int ev_type, void *ev);
static int _e_border_cb_pointer_warp(void *data, int ev_type, void *ev);
static void _e_border_cb_signal_move_start(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_border_cb_signal_move_stop(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_border_cb_signal_resize_tl_start(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_border_cb_signal_resize_t_start(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_border_cb_signal_resize_tr_start(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_border_cb_signal_resize_r_start(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_border_cb_signal_resize_br_start(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_border_cb_signal_resize_b_start(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_border_cb_signal_resize_bl_start(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_border_cb_signal_resize_l_start(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_border_cb_signal_resize_stop(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_border_cb_signal_action(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_border_cb_signal_drag(void *data, Evas_Object *obj, const char *emission, const char *source);
static int _e_border_cb_pointer_warp(void *data, int ev_type, void *ev);
static void _e_border_cb_signal_bind(void *data, Evas_Object *obj, const char *emission, const char *source);
static int _e_border_cb_mouse_in(void *data, int type, void *event);
static int _e_border_cb_mouse_out(void *data, int type, void *event);
static int _e_border_cb_mouse_wheel(void *data, int type, void *event);
@ -1954,7 +1941,7 @@ e_border_act_move_begin(E_Border *bd, Ecore_X_Event_Mouse_Button_Down *ev)
{
char source[256];
snprintf(source, sizeof(source) - 1, "mouse,%i", ev->button);
snprintf(source, sizeof(source) - 1, "mouse,down,%i", ev->button);
_e_border_moveinfo_gather(bd, source);
}
}
@ -2008,7 +1995,7 @@ e_border_act_resize_begin(E_Border *bd, Ecore_X_Event_Mouse_Button_Down *ev)
{
char source[256];
snprintf(source, sizeof(source) - 1, "mouse,%i", ev->button);
snprintf(source, sizeof(source) - 1, "mouse,down,%i", ev->button);
_e_border_moveinfo_gather(bd, source);
}
}
@ -3511,26 +3498,18 @@ _e_border_cb_pointer_warp(void *data, int ev_type, void *ev)
return 1;
}
static void
_e_border_cb_signal_move_start(void *data, Evas_Object *obj, const char *emission, const char *source)
void
e_border_signal_move_begin(E_Border *bd, char *sig, char *src)
{
E_Border *bd;
bd = data;
if (!_e_border_move_begin(bd))
return;
if (!_e_border_move_begin(bd)) return;
bd->moving = 1;
e_zone_flip_win_disable();
_e_border_moveinfo_gather(bd, source);
_e_border_moveinfo_gather(bd, sig);
}
static void
_e_border_cb_signal_move_stop(void *data, Evas_Object *obj, const char *emission, const char *source)
void
e_border_signal_move_end(E_Border *bd, char *sig, char *src)
{
E_Border *bd;
bd = data;
if (!bd->moving) return;
bd->moving = 0;
e_zone_flip_win_restore();
@ -3538,124 +3517,69 @@ _e_border_cb_signal_move_stop(void *data, Evas_Object *obj, const char *emission
e_zone_flip_coords_handle(bd->zone, -1, -1);
}
static void
_e_border_cb_signal_resize_tl_start(void *data, Evas_Object *obj, const char *emission, const char *source)
int
e_border_resizing_get(E_Border *bd)
{
E_Border *bd;
if (bd->resize_mode == RESIZE_NONE) return 0;
return 1;
}
bd = data;
void
e_border_signal_resize_begin(E_Border *bd, char *dir, char *sig, char *src)
{
Ecore_X_Gravity grav = ECORE_X_GRAVITY_NW;
int resize_mode = RESIZE_BR;
if (!_e_border_resize_begin(bd))
return;
bd->resize_mode = RESIZE_TL;
_e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_SE);
if (!strcmp(dir, "tl"))
{
resize_mode = RESIZE_TL;
grav = ECORE_X_GRAVITY_SE;
}
else if (!strcmp(dir, "t"))
{
resize_mode = RESIZE_T;
grav = ECORE_X_GRAVITY_S;
}
else if (!strcmp(dir, "tr"))
{
resize_mode = RESIZE_TR;
grav = ECORE_X_GRAVITY_SW;
}
else if (!strcmp(dir, "r"))
{
resize_mode = RESIZE_R;
grav = ECORE_X_GRAVITY_W;
}
else if (!strcmp(dir, "br"))
{
resize_mode = RESIZE_BR;
grav = ECORE_X_GRAVITY_NW;
}
else if (!strcmp(dir, "b"))
{
resize_mode = RESIZE_B;
grav = ECORE_X_GRAVITY_N;
}
else if (!strcmp(dir, "bl"))
{
resize_mode = RESIZE_BL;
grav = ECORE_X_GRAVITY_NE;
}
else if (!strcmp(dir, "l"))
{
resize_mode = RESIZE_L;
grav = ECORE_X_GRAVITY_E;
}
bd->resize_mode = resize_mode;
_e_border_moveinfo_gather(bd, sig);
GRAV_SET(bd, grav);
}
static void
_e_border_cb_signal_resize_t_start(void *data, Evas_Object *obj, const char *emission, const char *source)
void
e_border_signal_resize_end(E_Border *bd, char *dir, char *sig, char *src)
{
E_Border *bd;
bd = data;
if (!_e_border_resize_begin(bd))
return;
bd->resize_mode = RESIZE_T;
_e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_S);
}
static void
_e_border_cb_signal_resize_tr_start(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Border *bd;
bd = data;
if (!_e_border_resize_begin(bd))
return;
bd->resize_mode = RESIZE_TR;
_e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_SW);
}
static void
_e_border_cb_signal_resize_r_start(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Border *bd;
bd = data;
if (!_e_border_resize_begin(bd))
return;
bd->resize_mode = RESIZE_R;
_e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_W);
}
static void
_e_border_cb_signal_resize_br_start(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Border *bd;
bd = data;
if (!_e_border_resize_begin(bd))
return;
bd->resize_mode = RESIZE_BR;
_e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_NW);
}
static void
_e_border_cb_signal_resize_b_start(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Border *bd;
bd = data;
if (!_e_border_resize_begin(bd))
return;
bd->resize_mode = RESIZE_B;
_e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_N);
}
static void
_e_border_cb_signal_resize_bl_start(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Border *bd;
bd = data;
if (!_e_border_resize_begin(bd))
return;
bd->resize_mode = RESIZE_BL;
_e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_NE);
}
static void
_e_border_cb_signal_resize_l_start(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Border *bd;
bd = data;
if (!_e_border_resize_begin(bd))
return;
bd->resize_mode = RESIZE_L;
_e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_E);
}
static void
_e_border_cb_signal_resize_stop(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Border *bd;
bd = data;
if (bd->resize_mode == RESIZE_NONE) return;
_e_border_resize_handle(bd);
bd->resize_mode = RESIZE_NONE;
@ -3665,98 +3589,14 @@ _e_border_cb_signal_resize_stop(void *data, Evas_Object *obj, const char *emissi
}
static void
_e_border_cb_signal_action(void *data, Evas_Object *obj, const char *emission, const char *source)
_e_border_cb_signal_bind(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Border *bd;
bd = data;
if (e_dnd_active()) return;
if (!strcmp(source, "close"))
{
if (!bd->lock_close)
e_border_act_close_begin(bd);
}
else if (!strcmp(source, "shade_up") || !strcmp(source, "shade"))
{
if (!bd->lock_user_shade)
{
if (bd->shaded) e_border_unshade(bd, E_DIRECTION_UP);
else e_border_shade(bd, E_DIRECTION_UP);
}
}
else if (!strcmp(source, "shade_down"))
{
if (!bd->lock_user_shade)
{
if (bd->shaded) e_border_unshade(bd, E_DIRECTION_DOWN);
else e_border_shade(bd, E_DIRECTION_DOWN);
}
}
else if (!strcmp(source, "shade_left"))
{
if (!bd->lock_user_shade)
{
if (bd->shaded) e_border_unshade(bd, E_DIRECTION_LEFT);
else e_border_shade(bd, E_DIRECTION_LEFT);
}
}
else if (!strcmp(source, "shade_right"))
{
if (!bd->lock_user_shade)
{
if (bd->shaded) e_border_unshade(bd, E_DIRECTION_RIGHT);
else e_border_shade(bd, E_DIRECTION_RIGHT);
}
}
else if (!strcmp(source, "maximize"))
{
if (!bd->lock_user_maximize)
{
if (bd->maximized) e_border_unmaximize(bd);
else e_border_maximize(bd, e_config->maximize_policy);
}
}
else if (!strcmp(source, "iconify"))
{
if (!bd->lock_user_iconify)
{
if (bd->iconic) e_border_uniconify(bd);
else e_border_iconify(bd);
}
}
else if (!strcmp(source, "menu"))
{
Evas_Coord x, y;
evas_pointer_canvas_xy_get(bd->bg_evas , &x, &y);
_e_border_menu_show(bd, x + bd->x, y + bd->y, 0, 0);
}
else if (!strcmp(source, "raise"))
{
if (!bd->lock_user_stacking)
e_border_raise(bd);
}
else if (!strcmp(source, "lower"))
{
if (!bd->lock_user_stacking)
e_border_lower(bd);
}
}
static void
_e_border_cb_signal_drag(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Border *bd;
if (!strcmp(source, "icon"))
{
bd = data;
bd->drag.start = 1;
bd->drag.x = -1;
bd->drag.y = -1;
}
e_bindings_signal_handle(E_BINDING_CONTEXT_BORDER, E_OBJECT(bd),
(char *)emission, (char *)source);
}
static int
@ -4829,32 +4669,8 @@ _e_border_eval(E_Border *bd)
ecore_x_window_move(bd->client.shell_win, l, t);
if (bd->bg_object)
{
edje_object_signal_callback_add(bd->bg_object, "move_start", "*",
_e_border_cb_signal_move_start, bd);
edje_object_signal_callback_add(bd->bg_object, "move_stop", "*",
_e_border_cb_signal_move_stop, bd);
edje_object_signal_callback_add(bd->bg_object, "resize_tl_start", "*",
_e_border_cb_signal_resize_tl_start, bd);
edje_object_signal_callback_add(bd->bg_object, "resize_t_start", "*",
_e_border_cb_signal_resize_t_start, bd);
edje_object_signal_callback_add(bd->bg_object, "resize_tr_start", "*",
_e_border_cb_signal_resize_tr_start, bd);
edje_object_signal_callback_add(bd->bg_object, "resize_r_start", "*",
_e_border_cb_signal_resize_r_start, bd);
edje_object_signal_callback_add(bd->bg_object, "resize_br_start", "*",
_e_border_cb_signal_resize_br_start, bd);
edje_object_signal_callback_add(bd->bg_object, "resize_b_start", "*",
_e_border_cb_signal_resize_b_start, bd);
edje_object_signal_callback_add(bd->bg_object, "resize_bl_start", "*",
_e_border_cb_signal_resize_bl_start, bd);
edje_object_signal_callback_add(bd->bg_object, "resize_l_start", "*",
_e_border_cb_signal_resize_l_start, bd);
edje_object_signal_callback_add(bd->bg_object, "resize_stop", "*",
_e_border_cb_signal_resize_stop, bd);
edje_object_signal_callback_add(bd->bg_object, "action", "*",
_e_border_cb_signal_action, bd);
edje_object_signal_callback_add(bd->bg_object, "drag", "*",
_e_border_cb_signal_drag, bd);
edje_object_signal_callback_add(bd->bg_object, "*", "*",
_e_border_cb_signal_bind, bd);
if (bd->focused)
edje_object_signal_emit(bd->bg_object, "active", "");
if (bd->shaded)
@ -5518,9 +5334,9 @@ _e_border_resize_limit(E_Border *bd, int *w, int *h)
static void
_e_border_moveinfo_gather(E_Border *bd, const char *source)
{
if (!strcmp(source, "mouse,1")) bd->moveinfo.down.button = 1;
else if (!strcmp(source, "mouse,2")) bd->moveinfo.down.button = 2;
else if (!strcmp(source, "mouse,3")) bd->moveinfo.down.button = 3;
if (e_util_glob_match(source, "mouse,*,1")) bd->moveinfo.down.button = 1;
else if (e_util_glob_match(source, "mouse,*,2")) bd->moveinfo.down.button = 2;
else if (e_util_glob_match(source, "mouse,*,3")) bd->moveinfo.down.button = 3;
else bd->moveinfo.down.button = 0;
if ((bd->moveinfo.down.button >= 1) && (bd->moveinfo.down.button <= 3))
{

View File

@ -64,7 +64,6 @@ typedef enum _E_Window_Placement
E_WINDOW_PLACEMENT_CURSOR
} E_Window_Placement;
typedef struct _E_Border E_Border;
typedef struct _E_Border_Pending_Move_Resize E_Border_Pending_Move_Resize;
typedef struct _E_Event_Border_Resize E_Event_Border_Resize;
@ -545,8 +544,14 @@ EAPI void e_border_resize_cancel(void);
EAPI void e_border_frame_recalc(E_Border *bd);
EAPI Evas_List *e_border_immortal_windows_get(void);
const char *e_border_name_get(E_Border *bd);
EAPI const char *e_border_name_get(E_Border *bd);
EAPI void e_border_signal_move_begin(E_Border *bd, char *sig, char *src);
EAPI void e_border_signal_move_end(E_Border *bd, char *sig, char *src);
EAPI int e_border_resizing_get(E_Border *bd);
EAPI void e_border_signal_resize_begin(E_Border *bd, char *dir, char *sig, char *src);
EAPI void e_border_signal_resize_end(E_Border *bd, char *dir, char *sig, char *src);
extern EAPI int E_EVENT_BORDER_RESIZE;
extern EAPI int E_EVENT_BORDER_MOVE;
extern EAPI int E_EVENT_BORDER_ADD;