seb's patch...

SVN revision: 13222
This commit is contained in:
Carsten Haitzler 2005-02-07 13:51:09 +00:00
parent f8e536b96e
commit 4f54c588e1
61 changed files with 904 additions and 352 deletions

View File

@ -1,3 +1,3 @@
The Rasterman (Carsten Haitzler) <raster@rasterman.com> The Rasterman (Carsten Haitzler) <raster@rasterman.com>
Ibukun Olumuyiwa <ibukun@computer.org> Ibukun Olumuyiwa <ibukun@computer.org>
Sebastian Dransfeld <sebastid@tango.flipp.net>

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
/* TODO List: /* TODO List:
@ -286,13 +289,13 @@ e_app_window_name_class_find(char *name, char *class)
{ {
Evas_List *l; Evas_List *l;
if (!name && !class)
return NULL;
for (l = _e_apps_list; l; l = l->next) for (l = _e_apps_list; l; l = l->next)
{ {
E_App *a; E_App *a;
if (!name && !class)
return NULL;
a = l->data; a = l->data;
if ((a->win_name) || (a->win_class)) if ((a->win_name) || (a->win_class))
{ {

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
typedef enum _E_App_Change typedef enum _E_App_Change

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
/* Atoms */ /* Atoms */

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#else #else
#ifndef E_ATOMS_H #ifndef E_ATOMS_H

View File

@ -1,7 +1,6 @@
/* /*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/ */
#include "e.h" #include "e.h"
#define RESIZE_NONE 0 #define RESIZE_NONE 0
@ -82,11 +81,18 @@ static void _e_border_event_border_hide_free(void *data, void *ev);
static void _e_border_zone_update(E_Border *bd); static void _e_border_zone_update(E_Border *bd);
static void _e_border_resize_begin(E_Border *bd);
static void _e_border_resize_end(E_Border *bd);
static void _e_border_resize_update(E_Border *bd);
/* local subsystem globals */ /* local subsystem globals */
static Evas_List *handlers = NULL; static Evas_List *handlers = NULL;
static Evas_List *borders = NULL; static Evas_List *borders = NULL;
static E_Border *focused = NULL; static E_Border *focused = NULL;
static Ecore_Evas *resize_ee = NULL;
static Evas_Object *resize_obj = NULL;
extern int _e_desk_current_changing; extern int _e_desk_current_changing;
int E_EVENT_BORDER_ADD = 0; int E_EVENT_BORDER_ADD = 0;
@ -155,6 +161,8 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map)
{ {
E_Border *bd; E_Border *bd;
Ecore_X_Window_Attributes *att; Ecore_X_Window_Attributes *att;
Evas_List *list;
E_Config_Binding *eb;
unsigned int managed, desk[2]; unsigned int managed, desk[2];
int deskx, desky; int deskx, desky;
@ -167,19 +175,16 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map)
bd->w = 1; bd->w = 1;
bd->h = 1; bd->h = 1;
bd->win = ecore_x_window_override_new(bd->container->win, 0, 0, bd->w, bd->h); bd->win = ecore_x_window_override_new(bd->container->win, 0, 0, bd->w, bd->h);
/* FIXME: use config list of bindings */ /* Bindings */
for (list = e_config->bindings; list; list = list->next)
{
eb = list->data;
ecore_x_window_button_grab(bd->win, ecore_x_window_button_grab(bd->win,
1, eb->button,
ECORE_X_EVENT_MASK_MOUSE_DOWN | eb->mask,
ECORE_X_EVENT_MASK_MOUSE_UP | eb->modifiers,
ECORE_X_EVENT_MASK_MOUSE_MOVE,
ECORE_X_MODIFIER_ALT,
0);
ecore_x_window_button_grab(bd->win,
3,
ECORE_X_EVENT_MASK_MOUSE_DOWN,
ECORE_X_MODIFIER_ALT,
0); 0);
}
bd->bg_ecore_evas = ecore_evas_software_x11_new(NULL, bd->win, 0, 0, bd->w, bd->h); bd->bg_ecore_evas = ecore_evas_software_x11_new(NULL, bd->win, 0, 0, bd->w, bd->h);
ecore_evas_software_x11_direct_resize_set(bd->bg_ecore_evas, 1); ecore_evas_software_x11_direct_resize_set(bd->bg_ecore_evas, 1);
e_canvas_add(bd->bg_ecore_evas); e_canvas_add(bd->bg_ecore_evas);
@ -501,6 +506,7 @@ e_border_move_resize(E_Border *bd, int x, int y, int w, int h)
bd->y + bd->client_inset.t, bd->y + bd->client_inset.t,
bd->client.w, bd->client.w,
bd->client.h); bd->client.h);
_e_border_resize_update(bd);
_e_border_zone_update(bd); _e_border_zone_update(bd);
mev = calloc(1, sizeof(E_Event_Border_Move)); mev = calloc(1, sizeof(E_Event_Border_Move));
mev->border = bd; mev->border = bd;
@ -638,6 +644,8 @@ e_border_shade(E_Border *bd, E_Direction dir)
bd->shade.y = bd->y; bd->shade.y = bd->y;
bd->shade.dir = dir; bd->shade.dir = dir;
e_hints_window_shaded_set(bd->client.win, 1);
if (e_config->border_shade_animate) if (e_config->border_shade_animate)
{ {
bd->shade.start = ecore_time_get(); bd->shade.start = ecore_time_get();
@ -709,6 +717,8 @@ e_border_unshade(E_Border *bd, E_Direction dir)
bd->shade.dir = dir; bd->shade.dir = dir;
e_hints_window_shaded_set(bd->client.win, 0);
if (bd->shade.dir == E_DIRECTION_UP || if (bd->shade.dir == E_DIRECTION_UP ||
bd->shade.dir == E_DIRECTION_LEFT) bd->shade.dir == E_DIRECTION_LEFT)
{ {
@ -791,6 +801,8 @@ e_border_maximize(E_Border *bd)
bd->saved.w = bd->w; bd->saved.w = bd->w;
bd->saved.h = bd->h; bd->saved.h = bd->h;
e_hints_window_maximized_set(bd->client.win, 1);
/* FIXME maximize intelligently */ /* FIXME maximize intelligently */
e_border_raise(bd); e_border_raise(bd);
e_border_move_resize(bd, 0, 0, bd->zone->w, bd->zone->h); e_border_move_resize(bd, 0, 0, bd->zone->w, bd->zone->h);
@ -812,6 +824,8 @@ e_border_unmaximize(E_Border *bd)
if (bd->maximized) if (bd->maximized)
{ {
// printf("UNMAXIMIZE!!\n"); // printf("UNMAXIMIZE!!\n");
e_hints_window_maximized_set(bd->client.win, 0);
e_border_move_resize(bd, bd->saved.x, bd->saved.y, bd->saved.w, bd->saved.h); e_border_move_resize(bd, bd->saved.x, bd->saved.y, bd->saved.w, bd->saved.h);
bd->maximized = 0; bd->maximized = 0;
@ -871,6 +885,7 @@ e_border_stick(E_Border *bd)
E_OBJECT_CHECK(bd); E_OBJECT_CHECK(bd);
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
bd->sticky = 1; bd->sticky = 1;
e_hints_window_sticky_set(bd->client.win, 1);
} }
void void
@ -879,6 +894,7 @@ e_border_unstick(E_Border *bd)
E_OBJECT_CHECK(bd); E_OBJECT_CHECK(bd);
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
bd->sticky = 0; bd->sticky = 0;
e_hints_window_sticky_set(bd->client.win, 0);
e_border_desk_set(bd, e_desk_current_get(bd->zone)); e_border_desk_set(bd, e_desk_current_get(bd->zone));
} }
@ -922,6 +938,9 @@ e_border_idler_before(void)
static void static void
_e_border_free(E_Border *bd) _e_border_free(E_Border *bd)
{ {
Evas_List *list;
E_Config_Binding *eb;
while (bd->pending_move_resize) while (bd->pending_move_resize)
{ {
free(bd->pending_move_resize->data); free(bd->pending_move_resize->data);
@ -955,15 +974,15 @@ _e_border_free(E_Border *bd)
e_canvas_del(bd->bg_ecore_evas); e_canvas_del(bd->bg_ecore_evas);
ecore_evas_free(bd->bg_ecore_evas); ecore_evas_free(bd->bg_ecore_evas);
ecore_x_window_del(bd->client.shell_win); ecore_x_window_del(bd->client.shell_win);
/* FIXME: use config list of bindings */ /* Bindings */
for (list = e_config->bindings; list; list = list->next)
{
eb = list->data;
ecore_x_window_button_ungrab(bd->win, ecore_x_window_button_ungrab(bd->win,
1, eb->button,
ECORE_X_MODIFIER_ALT, eb->modifiers,
0);
ecore_x_window_button_ungrab(bd->win,
3,
ECORE_X_MODIFIER_ALT,
0); 0);
}
ecore_x_window_del(bd->win); ecore_x_window_del(bd->win);
bd->container->clients = evas_list_remove(bd->container->clients, bd); bd->container->clients = evas_list_remove(bd->container->clients, bd);
@ -1091,10 +1110,11 @@ _e_border_cb_window_configure_request(void *data, int ev_type, void *ev)
y = bd->y; y = bd->y;
x = bd->x; x = bd->x;
printf("##- ASK FOR 0x%x TO MOVE TO [FLG X%iY%i] %i,%i\n", printf("##- ASK FOR 0x%x TO MOVE TO [FLG X%liY%li] %i,%i\n",
bd->client.win,
e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_X, e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_X,
e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_Y, e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_Y,
bd->client.win, x, y); x, y);
if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_X) if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_X)
x = e->x; x = e->x;
if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_Y) if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_Y)
@ -1110,10 +1130,11 @@ _e_border_cb_window_configure_request(void *data, int ev_type, void *ev)
w = e->w + bd->client_inset.l + bd->client_inset.r; w = e->w + bd->client_inset.l + bd->client_inset.r;
if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_H) if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_H)
h = e->h + bd->client_inset.t + bd->client_inset.b; h = e->h + bd->client_inset.t + bd->client_inset.b;
printf("##- ASK FOR 0x%x TO RESIZE TO [FLG W%iH%i] %i,%i\n", printf("##- ASK FOR 0x%x TO RESIZE TO [FLG W%liH%li] %i,%i\n",
bd->client.win,
e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_W, e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_W,
e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_H, e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_H,
bd->client.win, e->w, e->h); e->w, e->h);
e_border_move_resize(bd, x, y, w, h); e_border_move_resize(bd, x, y, w, h);
} }
else else
@ -1130,10 +1151,11 @@ _e_border_cb_window_configure_request(void *data, int ev_type, void *ev)
w = e->w + bd->client_inset.l + bd->client_inset.r; w = e->w + bd->client_inset.l + bd->client_inset.r;
if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_H) if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_H)
h = e->h + bd->client_inset.t + bd->client_inset.b; h = e->h + bd->client_inset.t + bd->client_inset.b;
printf("##- ASK FOR 0x%x TO RESIZE TO [FLG W%iH%i] %i,%i\n", printf("##- ASK FOR 0x%x TO RESIZE TO [FLG W%liH%li] %i,%i\n",
bd->client.win,
e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_W, e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_W,
e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_H, e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_H,
bd->client.win, e->w, e->h); e->w, e->h);
e_border_resize(bd, w, h); e_border_resize(bd, w, h);
} }
if ((e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE) && if ((e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE) &&
@ -1211,7 +1233,7 @@ _e_border_cb_window_resize_request(void *data, int ev_type, void *ev)
ecore_x_window_resize(e->win, e->w, e->h); ecore_x_window_resize(e->win, e->w, e->h);
return 1; return 1;
} }
printf("##- RESIZE REQ 0x%0x\n"); printf("##- RESIZE REQ 0x%x\n", bd->client.win);
{ {
int w, h; int w, h;
@ -1388,7 +1410,6 @@ _e_border_cb_client_message(void *data, int ev_type, void *ev)
e = ev; e = ev;
bd = e_border_find_by_client_window(e->win); bd = e_border_find_by_client_window(e->win);
if (!bd) return 1; if (!bd) return 1;
// printf("client message for %0x\n", e->win);
return 1; return 1;
} }
@ -1422,6 +1443,7 @@ _e_border_cb_signal_resize_tl_start(void *data, Evas_Object *obj, const char *em
if ((bd->shaded) || (bd->shading) || (bd->maximized)) return; if ((bd->shaded) || (bd->shading) || (bd->maximized)) return;
bd->resize_mode = RESIZE_TL; bd->resize_mode = RESIZE_TL;
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source); _e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_SE); GRAV_SET(bd, ECORE_X_GRAVITY_SE);
} }
@ -1436,9 +1458,9 @@ _e_border_cb_signal_resize_t_start(void *data, Evas_Object *obj, const char *emi
if ((bd->shaded) || (bd->shading) || (bd->maximized)) return; if ((bd->shaded) || (bd->shading) || (bd->maximized)) return;
bd->resize_mode = RESIZE_T; bd->resize_mode = RESIZE_T;
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source); _e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_S); GRAV_SET(bd, ECORE_X_GRAVITY_S);
ecore_x_window_gravity_set(bd->bg_win, ECORE_X_GRAVITY_S);
} }
static void static void
@ -1451,6 +1473,7 @@ _e_border_cb_signal_resize_tr_start(void *data, Evas_Object *obj, const char *em
if ((bd->shaded) || (bd->shading) || (bd->maximized)) return; if ((bd->shaded) || (bd->shading) || (bd->maximized)) return;
bd->resize_mode = RESIZE_TR; bd->resize_mode = RESIZE_TR;
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source); _e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_SW); GRAV_SET(bd, ECORE_X_GRAVITY_SW);
} }
@ -1465,6 +1488,7 @@ _e_border_cb_signal_resize_r_start(void *data, Evas_Object *obj, const char *emi
if ((bd->shaded) || (bd->shading) || (bd->maximized)) return; if ((bd->shaded) || (bd->shading) || (bd->maximized)) return;
bd->resize_mode = RESIZE_R; bd->resize_mode = RESIZE_R;
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source); _e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_W); GRAV_SET(bd, ECORE_X_GRAVITY_W);
} }
@ -1479,6 +1503,7 @@ _e_border_cb_signal_resize_br_start(void *data, Evas_Object *obj, const char *em
if ((bd->shaded) || (bd->shading) || (bd->maximized)) return; if ((bd->shaded) || (bd->shading) || (bd->maximized)) return;
bd->resize_mode = RESIZE_BR; bd->resize_mode = RESIZE_BR;
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source); _e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_NW); GRAV_SET(bd, ECORE_X_GRAVITY_NW);
} }
@ -1493,6 +1518,7 @@ _e_border_cb_signal_resize_b_start(void *data, Evas_Object *obj, const char *emi
if ((bd->shaded) || (bd->shading) || (bd->maximized)) return; if ((bd->shaded) || (bd->shading) || (bd->maximized)) return;
bd->resize_mode = RESIZE_B; bd->resize_mode = RESIZE_B;
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source); _e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_N); GRAV_SET(bd, ECORE_X_GRAVITY_N);
} }
@ -1507,6 +1533,7 @@ _e_border_cb_signal_resize_bl_start(void *data, Evas_Object *obj, const char *em
if ((bd->shaded) || (bd->shading) || (bd->maximized)) return; if ((bd->shaded) || (bd->shading) || (bd->maximized)) return;
bd->resize_mode = RESIZE_BL; bd->resize_mode = RESIZE_BL;
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source); _e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_NE); GRAV_SET(bd, ECORE_X_GRAVITY_NE);
} }
@ -1521,6 +1548,7 @@ _e_border_cb_signal_resize_l_start(void *data, Evas_Object *obj, const char *emi
if ((bd->shaded) || (bd->shading) || (bd->maximized)) return; if ((bd->shaded) || (bd->shading) || (bd->maximized)) return;
bd->resize_mode = RESIZE_L; bd->resize_mode = RESIZE_L;
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source); _e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_E); GRAV_SET(bd, ECORE_X_GRAVITY_E);
} }
@ -1536,6 +1564,7 @@ _e_border_cb_signal_resize_stop(void *data, Evas_Object *obj, const char *emissi
_e_border_resize_handle(bd); _e_border_resize_handle(bd);
bd->resize_mode = RESIZE_NONE; bd->resize_mode = RESIZE_NONE;
_e_border_resize_end(bd);
bd->changes.reset_gravity = 1; bd->changes.reset_gravity = 1;
bd->changed = 1; bd->changed = 1;
} }
@ -1725,12 +1754,15 @@ _e_border_cb_mouse_down(void *data, int type, void *event)
{ {
Ecore_X_Event_Mouse_Button_Down *ev; Ecore_X_Event_Mouse_Button_Down *ev;
E_Border *bd; E_Border *bd;
Evas_List *list;
E_Config_Binding *eb;
int x, y, w, h;
char source[16];
ev = event; ev = event;
bd = data; bd = data;
if (ev->event_win == bd->win) if (ev->event_win == bd->win)
{ {
// printf("GRABPRESS!\n");
if ((ev->button >= 1) && (ev->button <= 3)) if ((ev->button >= 1) && (ev->button <= 3))
{ {
bd->mouse.last_down[ev->button - 1].mx = ev->root.x; bd->mouse.last_down[ev->button - 1].mx = ev->root.x;
@ -1742,19 +1774,64 @@ _e_border_cb_mouse_down(void *data, int type, void *event)
} }
bd->mouse.current.mx = ev->root.x; bd->mouse.current.mx = ev->root.x;
bd->mouse.current.my = ev->root.y; bd->mouse.current.my = ev->root.y;
/* FIXME: decide that this is a button binding and what to do */ /* Bindings */
if (ev->button == 1) for (list = e_config->bindings; list; list = list->next)
{ {
eb = list->data;
if ((ev->button == eb->button) && (ev->modifiers == eb->modifiers))
{
snprintf(source, sizeof(source) - 1, "mouse,%d", eb->button);
switch (eb->action)
{
case E_BINDING_ACTION_MENU:
_e_border_menu_show(bd, bd->x + ev->x, bd->y + ev->y);
break;
case E_BINDING_ACTION_MOVE:
if (!bd->moving) if (!bd->moving)
{ {
bd->moving = 1; bd->moving = 1;
_e_border_moveinfo_gather(bd, "mouse,1"); _e_border_moveinfo_gather(bd, source);
e_border_raise(bd);
}
break;
case E_BINDING_ACTION_RESIZE:
if (bd->resize_mode == RESIZE_NONE)
{
ecore_x_window_geometry_get(bd->win, &x, &y, &w, &h);
if (bd->mouse.current.mx < (x + w/2))
{
if (bd->mouse.current.my < (y + h/2))
{
bd->resize_mode = RESIZE_TL;
GRAV_SET(bd, ECORE_X_GRAVITY_SE);
}
else
{
bd->resize_mode = RESIZE_BL;
GRAV_SET(bd, ECORE_X_GRAVITY_NE);
}
}
else
{
if (bd->mouse.current.my < (y + h/2))
{
bd->resize_mode = RESIZE_TR;
GRAV_SET(bd, ECORE_X_GRAVITY_SW);
}
else
{
bd->resize_mode = RESIZE_BR;
GRAV_SET(bd, ECORE_X_GRAVITY_NW);
}
}
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source);
e_border_raise(bd); e_border_raise(bd);
} }
} }
else if(ev->button == 3) /* We only want one action */
{ break;
_e_border_menu_show(bd, bd->x + ev->x, bd->y + ev->y); }
} }
} }
if (ev->win != bd->event_win) return 1; if (ev->win != bd->event_win) return 1;
@ -1772,6 +1849,9 @@ _e_border_cb_mouse_down(void *data, int type, void *event)
if (bd->moving) if (bd->moving)
{ {
} }
else if (bd->resize_mode != RESIZE_NONE)
{
}
else else
{ {
Evas_Button_Flags flags = EVAS_BUTTON_NONE; Evas_Button_Flags flags = EVAS_BUTTON_NONE;
@ -1789,12 +1869,13 @@ _e_border_cb_mouse_up(void *data, int type, void *event)
{ {
Ecore_X_Event_Mouse_Button_Up *ev; Ecore_X_Event_Mouse_Button_Up *ev;
E_Border *bd; E_Border *bd;
Evas_List *list;
E_Config_Binding *eb;
ev = event; ev = event;
bd = data; bd = data;
if (ev->event_win == bd->win) if (ev->event_win == bd->win)
{ {
// printf("GRABRELEASE!\n");
if ((ev->button >= 1) && (ev->button <= 3)) if ((ev->button >= 1) && (ev->button <= 3))
{ {
bd->mouse.last_up[ev->button - 1].mx = ev->root.x; bd->mouse.last_up[ev->button - 1].mx = ev->root.x;
@ -1804,12 +1885,26 @@ _e_border_cb_mouse_up(void *data, int type, void *event)
} }
bd->mouse.current.mx = ev->root.x; bd->mouse.current.mx = ev->root.x;
bd->mouse.current.my = ev->root.y; bd->mouse.current.my = ev->root.y;
/* FIXME: decide that this is a button binding and what to do */ /* Bindings */
if (ev->button == 1) for (list = e_config->bindings; list; list = list->next)
{ {
eb = list->data;
if (ev->button == eb->button)
{
switch (eb->action)
{
case E_BINDING_ACTION_MOVE:
if (bd->moving) if (bd->moving)
{
bd->moving = 0; bd->moving = 0;
break;
case E_BINDING_ACTION_RESIZE:
if (bd->resize_mode != RESIZE_NONE)
{
bd->resize_mode = RESIZE_NONE;
_e_border_resize_end(bd);
}
break;
}
} }
} }
} }
@ -1847,6 +1942,7 @@ _e_border_cb_mouse_move(void *data, int type, void *event)
if (bd->moving) if (bd->moving)
{ {
int x, y, new_x, new_y; int x, y, new_x, new_y;
int new_w, new_h;
Evas_List *skiplist = NULL; Evas_List *skiplist = NULL;
if ((bd->moveinfo.down.button >= 1) && (bd->moveinfo.down.button <= 3)) if ((bd->moveinfo.down.button >= 1) && (bd->moveinfo.down.button <= 3))
@ -1869,7 +1965,7 @@ _e_border_cb_mouse_move(void *data, int type, void *event)
e_resist_container_border_position(bd->container, skiplist, e_resist_container_border_position(bd->container, skiplist,
bd->x, bd->y, bd->w, bd->h, bd->x, bd->y, bd->w, bd->h,
x, y, bd->w, bd->h, x, y, bd->w, bd->h,
&new_x, &new_y); &new_x, &new_y, &new_w, &new_h);
evas_list_free(skiplist); evas_list_free(skiplist);
e_border_move(bd, new_x, new_y); e_border_move(bd, new_x, new_y);
@ -1974,6 +2070,9 @@ _e_border_eval(E_Border *bd)
{ {
a = e_app_window_name_class_find(bd->client.icccm.name, a = e_app_window_name_class_find(bd->client.icccm.name,
bd->client.icccm.class); bd->client.icccm.class);
fprintf(stderr, "client: name = %s, class = %s\n",
bd->client.icccm.name,
bd->client.icccm.class);
if (a) if (a)
{ {
bd->icon_object = edje_object_add(bd->bg_evas); bd->icon_object = edje_object_add(bd->bg_evas);
@ -2094,7 +2193,7 @@ _e_border_eval(E_Border *bd)
bd->client.mwm.borderless = 0; bd->client.mwm.borderless = 0;
if (bd->client.mwm.exists) if (bd->client.mwm.exists)
{ {
printf("##- MWM HINTS SET 0x%x!\n"); printf("##- MWM HINTS SET 0x%x!\n", bd->client.win);
if ((!(bd->client.mwm.decor & ECORE_X_MWM_HINT_DECOR_ALL)) && if ((!(bd->client.mwm.decor & ECORE_X_MWM_HINT_DECOR_ALL)) &&
(!(bd->client.mwm.decor & ECORE_X_MWM_HINT_DECOR_TITLE)) && (!(bd->client.mwm.decor & ECORE_X_MWM_HINT_DECOR_TITLE)) &&
(!(bd->client.mwm.decor & ECORE_X_MWM_HINT_DECOR_BORDER))) (!(bd->client.mwm.decor & ECORE_X_MWM_HINT_DECOR_BORDER)))
@ -2343,6 +2442,14 @@ _e_border_eval(E_Border *bd)
bd->client.w, bd->client.w,
bd->client.h); bd->client.h);
/* Recreate state */
if (e_hints_window_sticky_isset(bd->client.win))
e_border_stick(bd);
if (e_hints_window_shaded_isset(bd->client.win))
e_border_shade(bd, E_DIRECTION_UP);
if (e_hints_window_maximized_isset(bd->client.win))
e_border_maximize(bd);
ev = calloc(1, sizeof(E_Event_Border_Add)); ev = calloc(1, sizeof(E_Event_Border_Add));
ev->border = bd; ev->border = bd;
/* SUSPICION: does the unref for this actually sometimes not get */ /* SUSPICION: does the unref for this actually sometimes not get */
@ -2581,7 +2688,9 @@ static void
_e_border_resize_handle(E_Border *bd) _e_border_resize_handle(E_Border *bd)
{ {
int x, y, w, h; int x, y, w, h;
int new_x, new_y, new_w, new_h;
int tw, th; int tw, th;
Evas_List *skiplist = NULL;
x = bd->x; x = bd->x;
y = bd->y; y = bd->y;
@ -2647,7 +2756,14 @@ _e_border_resize_handle(E_Border *bd)
(bd->resize_mode == RESIZE_TR)) (bd->resize_mode == RESIZE_TR))
y += (th - h); y += (th - h);
e_border_move_resize(bd, x, y, w, h); skiplist = evas_list_append(skiplist, bd);
e_resist_container_border_position(bd->container, skiplist,
bd->x, bd->y, bd->w, bd->h,
x, y, w, h,
&new_x, &new_y, &new_w, &new_h);
evas_list_free(skiplist);
e_border_move_resize(bd, new_x, new_y, new_w, new_h);
} }
static int static int
@ -3024,3 +3140,48 @@ _e_border_zone_update(E_Border *bd)
} }
} }
} }
static void
_e_border_resize_begin(E_Border *bd)
{
int w, h;
char buf[40];
resize_ee = ecore_evas_software_x11_new(NULL, bd->zone->container->manager->win,
0, 0, 10, 10);
ecore_evas_borderless_set(resize_ee, 1);
ecore_evas_layer_set(resize_ee, 999);
ecore_evas_show(resize_ee);
resize_obj = edje_object_add(ecore_evas_get(resize_ee));
edje_object_file_set(resize_obj, e_path_find(path_themes, "default.eet"),
"widgets/border/default/resize");
snprintf(buf, sizeof(buf) - 1, "%dx%d", bd->w, bd->h);
edje_object_part_text_set(resize_obj, "text", buf);
edje_object_size_min_calc(resize_obj, &w, &h);
evas_object_move(resize_obj, 0, 0);
evas_object_resize(resize_obj, w, h);
evas_object_show(resize_obj);
ecore_evas_move(resize_ee, (bd->zone->w - w) / 2, (bd->zone->h - h) / 2);
ecore_evas_resize(resize_ee, w, h);
ecore_evas_show(resize_ee);
}
static void
_e_border_resize_end(E_Border *bd)
{
evas_object_del(resize_obj);
ecore_evas_free(resize_ee);
}
static void
_e_border_resize_update(E_Border *bd)
{
char buf[40];
snprintf(buf, sizeof(buf) - 1, "%dx%d", bd->w, bd->h);
edje_object_part_text_set(resize_obj, "text", buf);
}

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
typedef enum _E_Direction typedef enum _E_Direction

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
typedef struct _E_Smart_Data E_Smart_Data; typedef struct _E_Smart_Data E_Smart_Data;

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#else #else
#ifndef E_BOX_H #ifndef E_BOX_H

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
/* local subsystem functions */ /* local subsystem functions */

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#else #else
#ifndef E_CANVAS_H #ifndef E_CANVAS_H

View File

@ -25,6 +25,7 @@ static Ecore_Job *_e_config_save_job = NULL;
static E_Config_DD *_e_config_edd = NULL; static E_Config_DD *_e_config_edd = NULL;
static E_Config_DD *_e_config_module_edd = NULL; static E_Config_DD *_e_config_module_edd = NULL;
static E_Config_DD *_e_config_binding_edd = NULL;
/* externally accessible functions */ /* externally accessible functions */
int int
@ -38,6 +39,16 @@ e_config_init(void)
E_CONFIG_VAL(D, T, name, STR); E_CONFIG_VAL(D, T, name, STR);
E_CONFIG_VAL(D, T, enabled, UCHAR); E_CONFIG_VAL(D, T, enabled, UCHAR);
_e_config_binding_edd = E_CONFIG_DD_NEW("E_Config_Binding", E_Config_Binding);
#undef T
#undef D
#define T E_Config_Binding
#define D _e_config_binding_edd
E_CONFIG_VAL(D, T, button, INT);
E_CONFIG_VAL(D, T, mask, INT);
E_CONFIG_VAL(D, T, modifiers, INT);
E_CONFIG_VAL(D, T, action, INT);
_e_config_edd = E_CONFIG_DD_NEW("E_Config", E_Config); _e_config_edd = E_CONFIG_DD_NEW("E_Config", E_Config);
#undef T #undef T
#undef D #undef D
@ -56,6 +67,7 @@ e_config_init(void)
E_CONFIG_VAL(D, T, zone_desks_x_count, INT); E_CONFIG_VAL(D, T, zone_desks_x_count, INT);
E_CONFIG_VAL(D, T, zone_desks_y_count, INT); E_CONFIG_VAL(D, T, zone_desks_y_count, INT);
E_CONFIG_LIST(D, T, modules, _e_config_module_edd); E_CONFIG_LIST(D, T, modules, _e_config_module_edd);
E_CONFIG_LIST(D, T, bindings, _e_config_binding_edd);
e_config = e_config_domain_load("e", _e_config_edd); e_config = e_config_domain_load("e", _e_config_edd);
if (!e_config) if (!e_config)
@ -102,6 +114,34 @@ e_config_init(void)
em->enabled = 1; em->enabled = 1;
e_config->modules = evas_list_append(e_config->modules, em); e_config->modules = evas_list_append(e_config->modules, em);
} }
{
E_Config_Binding *eb;
eb = E_NEW(E_Config_Binding, 1);
eb->button = 1;
eb->mask = ECORE_X_EVENT_MASK_MOUSE_DOWN |
ECORE_X_EVENT_MASK_MOUSE_UP |
ECORE_X_EVENT_MASK_MOUSE_MOVE;
eb->modifiers = ECORE_X_MODIFIER_ALT;
eb->action = E_BINDING_ACTION_MOVE;
e_config->bindings = evas_list_append(e_config->bindings, eb);
eb = E_NEW(E_Config_Binding, 1);
eb->button = 3;
eb->mask = ECORE_X_EVENT_MASK_MOUSE_DOWN |
ECORE_X_EVENT_MASK_MOUSE_UP |
ECORE_X_EVENT_MASK_MOUSE_MOVE;
eb->modifiers = ECORE_X_MODIFIER_ALT;
eb->action = E_BINDING_ACTION_RESIZE;
e_config->bindings = evas_list_append(e_config->bindings, eb);
eb = E_NEW(E_Config_Binding, 1);
eb->button = 2;
eb->mask = ECORE_X_EVENT_MASK_MOUSE_DOWN;
eb->modifiers = ECORE_X_MODIFIER_ALT;
eb->action = E_BINDING_ACTION_MENU;
e_config->bindings = evas_list_append(e_config->bindings, eb);
}
} }
E_CONFIG_LIMIT(e_config->menus_scroll_speed, 1.0, 20000.0); E_CONFIG_LIMIT(e_config->menus_scroll_speed, 1.0, 20000.0);
@ -130,11 +170,20 @@ e_config_shutdown(void)
E_FREE(em->name); E_FREE(em->name);
E_FREE(em); E_FREE(em);
} }
while (e_config->bindings)
{
E_Config_Binding *eb;
eb = e_config->bindings->data;
e_config->bindings = evas_list_remove(e_config->bindings, eb);
E_FREE(eb);
}
E_FREE(e_config->desktop_default_background); E_FREE(e_config->desktop_default_background);
E_FREE(e_config); E_FREE(e_config);
} }
E_CONFIG_DD_FREE(_e_config_edd); E_CONFIG_DD_FREE(_e_config_edd);
E_CONFIG_DD_FREE(_e_config_module_edd); E_CONFIG_DD_FREE(_e_config_module_edd);
E_CONFIG_DD_FREE(_e_config_binding_edd);
return 1; return 1;
} }

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#define E_CONFIG_DD_NEW(str, typ) \ #define E_CONFIG_DD_NEW(str, typ) \
@ -30,8 +33,16 @@
typedef struct _E_Config E_Config; typedef struct _E_Config E_Config;
typedef struct _E_Config_Module E_Config_Module; typedef struct _E_Config_Module E_Config_Module;
typedef struct _E_Config_Binding E_Config_Binding;
typedef Eet_Data_Descriptor E_Config_DD; typedef Eet_Data_Descriptor E_Config_DD;
typedef enum _E_Binding_Action
{
E_BINDING_ACTION_MOVE,
E_BINDING_ACTION_RESIZE,
E_BINDING_ACTION_MENU
} E_Binding_Action;
#else #else
#ifndef E_CONFIG_H #ifndef E_CONFIG_H
#define E_CONFIG_H #define E_CONFIG_H
@ -51,6 +62,7 @@ struct _E_Config
int zone_desks_x_count; int zone_desks_x_count;
int zone_desks_y_count; int zone_desks_y_count;
Evas_List *modules; Evas_List *modules;
Evas_List *bindings;
}; };
struct _E_Config_Module struct _E_Config_Module
@ -59,6 +71,15 @@ struct _E_Config_Module
unsigned char enabled; unsigned char enabled;
}; };
struct _E_Config_Binding
{
int button;
Ecore_X_Event_Mask mask;
int modifiers;
E_Binding_Action action;
};
EAPI int e_config_init(void); EAPI int e_config_init(void);
EAPI int e_config_shutdown(void); EAPI int e_config_shutdown(void);

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
typedef enum _E_Container_Shape_Change typedef enum _E_Container_Shape_Change

View File

@ -175,8 +175,6 @@ e_desk_xy_get(E_Desk *desk, int *x, int *y)
void void
e_desk_next(E_Zone *zone) e_desk_next(E_Zone *zone)
{ {
Evas_List *l;
E_Desk *desk;
int x, y; int x, y;
E_OBJECT_CHECK(zone); E_OBJECT_CHECK(zone);
@ -203,8 +201,6 @@ e_desk_next(E_Zone *zone)
void void
e_desk_prev(E_Zone *zone) e_desk_prev(E_Zone *zone)
{ {
Evas_List *l;
E_Desk *desk;
int x, y; int x, y;
E_OBJECT_CHECK(zone); E_OBJECT_CHECK(zone);

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
typedef struct _E_Desk E_Desk; typedef struct _E_Desk E_Desk;

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
/* FIXME: handle LANG!!!! */ /* FIXME: handle LANG!!!! */

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
/* TODO List: /* TODO List:

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#define print0(x, args...) x ,print1(## args) #define print0(x, args...) x ,print1(## args)

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
#include <dirent.h> #include <dirent.h>

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#else #else
#ifndef E_FILE_H #ifndef E_FILE_H

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
/* local subsystem functions */ /* local subsystem functions */

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#else #else
#ifndef E_FOCUS_H #ifndef E_FOCUS_H

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
typedef enum _E_Gadman_Policy typedef enum _E_Gadman_Policy

View File

@ -256,6 +256,94 @@ e_hints_window_state_set(Ecore_X_Window win)
} }
} }
void
e_hints_window_visible_set(Ecore_X_Window win, int on)
{
int hidden;
hidden = on ? 0 : 1;
ecore_x_netwm_window_state_set(win, ECORE_X_WINDOW_STATE_HIDDEN, hidden);
}
void
e_hints_window_shaded_set(Ecore_X_Window win, int on)
{
ecore_x_netwm_window_state_set(win, ECORE_X_WINDOW_STATE_SHADED, on);
}
int
e_hints_window_shaded_isset(Ecore_X_Window win)
{
return ecore_x_netwm_window_state_isset(win, ECORE_X_WINDOW_STATE_SHADED);
}
void
e_hints_window_maximized_set(Ecore_X_Window win, int on)
{
ecore_x_netwm_window_state_set(win, ECORE_X_WINDOW_STATE_MAXIMIZED_VERT, on);
ecore_x_netwm_window_state_set(win, ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ, on);
}
int
e_hints_window_maximized_isset(Ecore_X_Window win)
{
return ecore_x_netwm_window_state_isset(win, ECORE_X_WINDOW_STATE_MAXIMIZED_VERT)
&& ecore_x_netwm_window_state_isset(win, ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ);
}
void
e_hints_window_sticky_set(Ecore_X_Window win, int on)
{
ecore_x_netwm_window_state_set(win, ECORE_X_WINDOW_STATE_STICKY, on);
}
int
e_hints_window_sticky_isset(Ecore_X_Window win)
{
return ecore_x_netwm_window_state_isset(win, ECORE_X_WINDOW_STATE_STICKY);
}
/*
ecore_x_netwm_window_state_set(win, ECORE_X_WINDOW_STATE_MODAL, on);
ecore_x_netwm_window_state_set(win, ECORE_X_WINDOW_STATE_SKIP_TASKBAR, on);
ecore_x_netwm_window_state_set(win, ECORE_X_WINDOW_STATE_SKIP_PAGER, on);
ecore_x_netwm_window_state_set(win, ECORE_X_WINDOW_STATE_FULLSCREEN, on);
ecore_x_netwm_window_state_set(win, ECORE_X_WINDOW_STATE_ABOVE, on);
ecore_x_netwm_window_state_set(win, ECORE_X_WINDOW_STATE_BELOW, on);
*/
void
e_hints_window_state_get(Ecore_X_Window win)
{
E_Border *bd;
int above, below;
bd = e_border_find_by_client_window(win);
bd->client.netwm.state.modal =
ecore_x_netwm_window_state_isset(win, ECORE_X_WINDOW_STATE_MODAL);
bd->sticky =
ecore_x_netwm_window_state_isset(win, ECORE_X_WINDOW_STATE_STICKY);
bd->client.netwm.state.maximized_v =
ecore_x_netwm_window_state_isset(win, ECORE_X_WINDOW_STATE_MAXIMIZED_VERT);
bd->client.netwm.state.maximized_h =
ecore_x_netwm_window_state_isset(win, ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ);
bd->shaded =
ecore_x_netwm_window_state_isset(win, ECORE_X_WINDOW_STATE_SHADED);
bd->client.netwm.state.skip_taskbar =
ecore_x_netwm_window_state_isset(win, ECORE_X_WINDOW_STATE_SKIP_TASKBAR);
bd->client.netwm.state.skip_pager =
ecore_x_netwm_window_state_isset(win, ECORE_X_WINDOW_STATE_SKIP_PAGER);
bd->visible =
!ecore_x_netwm_window_state_isset(win, ECORE_X_WINDOW_STATE_HIDDEN);
bd->client.netwm.state.fullscreen =
ecore_x_netwm_window_state_isset(win, ECORE_X_WINDOW_STATE_FULLSCREEN);
above = ecore_x_netwm_window_state_isset(win, ECORE_X_WINDOW_STATE_ABOVE);
below = ecore_x_netwm_window_state_isset(win, ECORE_X_WINDOW_STATE_BELOW);
bd->client.netwm.state.stacking = (above << 0) + (below << 1);
}
void void
e_hints_window_name_get(Ecore_X_Window win) e_hints_window_name_get(Ecore_X_Window win)
{ {
@ -283,7 +371,3 @@ e_hints_window_icon_name_get(Ecore_X_Window win)
bd->client.icccm.icon_name = name; bd->client.icccm.icon_name = name;
bd->changed = 1; bd->changed = 1;
} }

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#else #else
#ifndef E_HINTS_H #ifndef E_HINTS_H
@ -12,6 +15,13 @@ EAPI void e_hints_desktop_config_set(void);
EAPI void e_hints_window_state_set(Ecore_X_Window win); EAPI void e_hints_window_state_set(Ecore_X_Window win);
EAPI void e_hints_window_name_get(Ecore_X_Window win); EAPI void e_hints_window_name_get(Ecore_X_Window win);
EAPI void e_hints_window_icon_name_get(Ecore_X_Window win); EAPI void e_hints_window_icon_name_get(Ecore_X_Window win);
EAPI void e_hints_window_visible_set(Ecore_X_Window win, int on);
EAPI void e_hints_window_shaded_set(Ecore_X_Window win, int on);
EAPI int e_hints_window_shaded_isset(Ecore_X_Window win);
EAPI void e_hints_window_maximized_set(Ecore_X_Window win, int on);
EAPI int e_hints_window_maximized_isset(Ecore_X_Window win);
EAPI void e_hints_window_sticky_set(Ecore_X_Window win, int on);
EAPI int e_hints_window_sticky_isset(Ecore_X_Window win);
#endif #endif
#endif #endif

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
typedef struct _E_Smart_Data E_Smart_Data; typedef struct _E_Smart_Data E_Smart_Data;

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#else #else
#ifndef E_ICON_H #ifndef E_ICON_H

View File

@ -1,7 +1,6 @@
/* /*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/ */
#include "e.h" #include "e.h"
static Evas_List *_e_iconic_borders = NULL; static Evas_List *_e_iconic_borders = NULL;

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#else #else
#ifndef E_ICONIFY_H #ifndef E_ICONIFY_H

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e_object.h" #include "e_object.h"
#include "e_file.h" #include "e_file.h"
#include "e_user.h" #include "e_user.h"

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
/* local subsystem globals */ /* local subsystem globals */
@ -13,7 +16,7 @@ e_init_init(void)
int x, y, w, h; int x, y, w, h;
Ecore_X_Window root; Ecore_X_Window root;
Ecore_X_Window *roots; Ecore_X_Window *roots;
int num, i; int num;
Evas_Object *o; Evas_Object *o;
int n; int n;

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#else #else
#ifndef E_INIT_H #ifndef E_INIT_H

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#else #else
#ifndef E_INT_MENUS_H #ifndef E_INT_MENUS_H

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
typedef enum _E_Ipc_Domain { typedef enum _E_Ipc_Domain {

View File

@ -61,7 +61,6 @@ main(int argc, char **argv)
char *s; char *s;
/* install the signal handlers. */ /* install the signal handlers. */
struct sigaction sigsegv_action; struct sigaction sigsegv_action;
struct sigaction sighup_action;
sigsegv_action.sa_sigaction=&e_sigseg_act; sigsegv_action.sa_sigaction=&e_sigseg_act;
sigsegv_action.sa_flags=0; sigsegv_action.sa_flags=0;
sigaction(SIGSEGV, &sigsegv_action, NULL); sigaction(SIGSEGV, &sigsegv_action, NULL);
@ -454,6 +453,7 @@ _e_main_dirs_init(void)
} }
/* FIXME: THIS is a hack to get people started!!! */ /* FIXME: THIS is a hack to get people started!!! */
/*
snprintf(buf, sizeof(buf), "%s/.e/e/applications/all/eterm.eapp", homedir); snprintf(buf, sizeof(buf), "%s/.e/e/applications/all/eterm.eapp", homedir);
if (!e_file_exists(buf)) if (!e_file_exists(buf))
{ {
@ -465,6 +465,7 @@ _e_main_dirs_init(void)
homedir); homedir);
system(buf); system(buf);
} }
*/
free(homedir); free(homedir);
return 1; return 1;
@ -800,6 +801,7 @@ _e_main_cb_signal_exit(void *data, int ev_type, void *ev)
ecore_main_loop_quit(); ecore_main_loop_quit();
return 1; return 1;
} }
static int static int
_e_main_cb_signal_hup(void *data, int ev_type, void *ev) _e_main_cb_signal_hup(void *data, int ev_type, void *ev)
{ {
@ -807,6 +809,7 @@ _e_main_cb_signal_hup(void *data, int ev_type, void *ev)
printf("RESTART ON!\n"); printf("RESTART ON!\n");
restart = 1; restart = 1;
ecore_main_loop_quit(); ecore_main_loop_quit();
return 1;
} }
static int static int

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
typedef struct _E_Manager E_Manager; typedef struct _E_Manager E_Manager;

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
/* TODO List: /* TODO List:

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#define E_MENU_POP_DIRECTION_NONE 0 #define E_MENU_POP_DIRECTION_NONE 0

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
#include "config.h" #include "config.h"

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#define E_MODULE_API_VERSION 1 #define E_MODULE_API_VERSION 1

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
/* TODO List: /* TODO List:

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
/* Object safety/debugging checks */ /* Object safety/debugging checks */

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
/* local subsystem functions */ /* local subsystem functions */

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
typedef struct _E_Path E_Path; typedef struct _E_Path E_Path;

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
int int

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#else #else
#ifndef E_PLACE_H #ifndef E_PLACE_H

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
/* externally accessible functions */ /* externally accessible functions */

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#else #else
#ifndef E_POINTER_H #ifndef E_POINTER_H

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
typedef struct _E_IPC_Opt_Handler E_IPC_Opt_Handler; typedef struct _E_IPC_Opt_Handler E_IPC_Opt_Handler;

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
typedef struct _E_Resist_Rect E_Resist_Rect; typedef struct _E_Resist_Rect E_Resist_Rect;
@ -13,14 +16,15 @@ int
e_resist_container_border_position(E_Container *con, Evas_List *skiplist, e_resist_container_border_position(E_Container *con, Evas_List *skiplist,
int px, int py, int pw, int ph, int px, int py, int pw, int ph,
int x, int y, int w, int h, int x, int y, int w, int h,
int *rx, int *ry) int *rx, int *ry, int *rw, int *rh)
{ {
int resist = 1; int resist = 1;
int desk_resist = 32; int desk_resist = 32;
int win_resist = 12; int win_resist = 12;
int gad_resist = 32; int gad_resist = 32;
int dx, dy, d, pd; int dx, dy, dw, dh, d, pd;
int resist_x = 0, resist_y = 0; int resist_x = 0, resist_y = 0;
int resist_w = 0, resist_h = 0;
Evas_List *l, *ll, *rects = NULL; Evas_List *l, *ll, *rects = NULL;
E_Resist_Rect *r; E_Resist_Rect *r;
@ -30,10 +34,14 @@ e_resist_container_border_position(E_Container *con, Evas_List *skiplist,
{ {
*rx = x; *rx = x;
*ry = y; *ry = y;
*rw = w;
*rw = h;
return 0; return 0;
} }
dx = x - px; dx = x - px;
dy = y - py; dy = y - py;
dw = w - pw;
dh = h - ph;
/* edges of screen */ /* edges of screen */
#define OBSTACLE(_x, _y, _w, _h, _resist) \ #define OBSTACLE(_x, _y, _w, _h, _resist) \
@ -136,7 +144,10 @@ e_resist_container_border_position(E_Container *con, Evas_List *skiplist,
if ((d > 0) && (pd <= 0) && (d <= r->v1)) if ((d > 0) && (pd <= 0) && (d <= r->v1))
{ {
if (resist_x < d) if (resist_x < d)
{
resist_x = d; resist_x = d;
resist_w = -d;
}
} }
} }
else else
@ -147,7 +158,36 @@ e_resist_container_border_position(E_Container *con, Evas_List *skiplist,
if ((d < 0) && (pd >= 0) && (d >= -r->v1)) if ((d < 0) && (pd >= 0) && (d >= -r->v1))
{ {
if (-resist_x > d) if (-resist_x > d)
{
resist_x = -d; resist_x = -d;
resist_w = d;
}
}
}
}
if ((dw > 0) && (dx == 0))
{
/* enlarging window by moving lower corner */
if (r->resist_out)
{
/* check right edge of windows against left */
d = x + w - (r->x + r->w);
pd = px + pw - (r->x + r->w);
if ((d > 0) && (pd <= 0) && (d <= r->v1))
{
if (-resist_w < d)
resist_w = -d;
}
}
else
{
/* check left edge of windows against right */
d = r->x - (x + w);
pd = r->x - (px + pw);
if ((d < 0) && (pd >= 0) && (d >= -r->v1))
{
if (resist_w > d)
resist_w = d;
} }
} }
} }
@ -191,7 +231,10 @@ e_resist_container_border_position(E_Container *con, Evas_List *skiplist,
if ((d > 0) && (pd <= 0) && (d <= r->v1)) if ((d > 0) && (pd <= 0) && (d <= r->v1))
{ {
if (resist_y < d) if (resist_y < d)
{
resist_y = d; resist_y = d;
resist_h = -d;
}
} }
} }
else else
@ -202,7 +245,36 @@ e_resist_container_border_position(E_Container *con, Evas_List *skiplist,
if ((d < 0) && (pd >= 0) && (d >= -r->v1)) if ((d < 0) && (pd >= 0) && (d >= -r->v1))
{ {
if (-resist_y > d) if (-resist_y > d)
{
resist_y = -d; resist_y = -d;
resist_h = d;
}
}
}
}
if ((dh > 0) && (dy == 0))
{
/* enlarging window by moving lower corner */
if (r->resist_out)
{
/* check bottom edge of windows against top */
d = y + h - (r->y + r->h);
pd = py + ph - (r->y + r->h);
if ((d > 0) && (pd <= 0) && (d <= r->v1))
{
if (-resist_h < d)
resist_h = -d;
}
}
else
{
/* check top edge of windows against bottom */
d = r->y - (y + h);
pd = r->y - (py + ph);
if ((d < 0) && (pd >= 0) && (d >= -r->v1))
{
if (resist_h > d)
resist_h = d;
} }
} }
} }
@ -224,6 +296,14 @@ e_resist_container_border_position(E_Container *con, Evas_List *skiplist,
*ry = y + resist_y; *ry = y + resist_y;
else else
*ry = y; *ry = y;
if (dh != 0)
*rh = h + resist_h;
else
*rh = h;
if (dw != 0)
*rw = w + resist_w;
else
*rw = w;
return 1; return 1;
} }

View File

@ -1,9 +1,12 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#else #else
#ifndef E_RESIST_H #ifndef E_RESIST_H
#define E_RESIST_H #define E_RESIST_H
EAPI int e_resist_container_border_position(E_Container *con, Evas_List *skiplist, int px, int py, int pw, int ph, int x, int y, int w, int h, int *rx, int *ry); EAPI int e_resist_container_border_position(E_Container *con, Evas_List *skiplist, int px, int py, int pw, int ph, int x, int y, int w, int h, int *rx, int *ry, int *rw, int *rh);
EAPI int e_resist_container_gadman_position(E_Container *con, Evas_List *skiplist, int px, int py, int pw, int ph, int x, int y, int w, int h, int *rx, int *ry); EAPI int e_resist_container_gadman_position(E_Container *con, Evas_List *skiplist, int px, int py, int pw, int ph, int x, int y, int w, int h, int *rx, int *ry);
#endif #endif

View File

@ -2,6 +2,7 @@
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/ */
#include "e.h" #include "e.h"
#include <execinfo.h>
/* a tricky little devil, requires e and it's libs to be built /* a tricky little devil, requires e and it's libs to be built
* with the -rdynamic flag to GCC for any sort of decent output. * with the -rdynamic flag to GCC for any sort of decent output.
@ -10,8 +11,6 @@ void e_sigseg_act(int x, siginfo_t *info, void *data){
void *array[255]; void *array[255];
size_t size; size_t size;
char **strings;
size_t i;
write(2, "**** SEGMENTATION FAULT ****\n", 29); write(2, "**** SEGMENTATION FAULT ****\n", 29);
write(2, "**** Printing Backtrace... *****\n\n", 34); write(2, "**** Printing Backtrace... *****\n\n", 34);
size = backtrace(array, 255); size = backtrace(array, 255);

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifndef E_SIGNALS_H #ifndef E_SIGNALS_H
#define E_SIGNALS_H #define E_SIGNALS_H

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
/* local subsystem functions */ /* local subsystem functions */

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
typedef enum _E_Startup_Mode typedef enum _E_Startup_Mode

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
/* externally accessible functions */ /* externally accessible functions */

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#else #else
#ifndef E_USER_H #ifndef E_USER_H

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h" #include "e.h"
typedef struct _E_Util_Fake_Mouse_Up_Info E_Util_Fake_Mouse_Up_Info; typedef struct _E_Util_Fake_Mouse_Up_Info E_Util_Fake_Mouse_Up_Info;

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#else #else
#ifndef E_UTILS_H #ifndef E_UTILS_H

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
typedef struct _E_Zone E_Zone; typedef struct _E_Zone E_Zone;