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>
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"
/* TODO List:
@ -286,13 +289,13 @@ e_app_window_name_class_find(char *name, char *class)
{
Evas_List *l;
if (!name && !class)
return NULL;
for (l = _e_apps_list; l; l = l->next)
{
E_App *a;
if (!name && !class)
return NULL;
a = l->data;
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
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"
/* Atoms */

View File

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

View File

@ -1,7 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
#define RESIZE_NONE 0
@ -19,7 +18,7 @@ static void _e_border_free(E_Border *bd);
static void _e_border_del(E_Border *bd);
/* FIXME: these likely belong in a separate icccm/client handler */
/* and the border needs to be come a dumb object that just does what its */
/* and the border needs to become a dumb object that just does what its */
/* told to do */
static int _e_border_cb_window_show_request(void *data, int ev_type, void *ev);
static int _e_border_cb_window_destroy(void *data, int ev_type, void *ev);
@ -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_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 */
static Evas_List *handlers = NULL;
static Evas_List *borders = NULL;
static E_Border *focused = NULL;
static Ecore_Evas *resize_ee = NULL;
static Evas_Object *resize_obj = NULL;
extern int _e_desk_current_changing;
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;
Ecore_X_Window_Attributes *att;
Evas_List *list;
E_Config_Binding *eb;
unsigned int managed, desk[2];
int deskx, desky;
@ -167,19 +175,16 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map)
bd->w = 1;
bd->h = 1;
bd->win = ecore_x_window_override_new(bd->container->win, 0, 0, bd->w, bd->h);
/* FIXME: use config list of bindings */
ecore_x_window_button_grab(bd->win,
1,
ECORE_X_EVENT_MASK_MOUSE_DOWN |
ECORE_X_EVENT_MASK_MOUSE_UP |
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);
/* Bindings */
for (list = e_config->bindings; list; list = list->next)
{
eb = list->data;
ecore_x_window_button_grab(bd->win,
eb->button,
eb->mask,
eb->modifiers,
0);
}
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);
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->client.w,
bd->client.h);
_e_border_resize_update(bd);
_e_border_zone_update(bd);
mev = calloc(1, sizeof(E_Event_Border_Move));
mev->border = bd;
@ -638,6 +644,8 @@ e_border_shade(E_Border *bd, E_Direction dir)
bd->shade.y = bd->y;
bd->shade.dir = dir;
e_hints_window_shaded_set(bd->client.win, 1);
if (e_config->border_shade_animate)
{
bd->shade.start = ecore_time_get();
@ -709,6 +717,8 @@ e_border_unshade(E_Border *bd, E_Direction dir)
bd->shade.dir = dir;
e_hints_window_shaded_set(bd->client.win, 0);
if (bd->shade.dir == E_DIRECTION_UP ||
bd->shade.dir == E_DIRECTION_LEFT)
{
@ -791,6 +801,8 @@ e_border_maximize(E_Border *bd)
bd->saved.w = bd->w;
bd->saved.h = bd->h;
e_hints_window_maximized_set(bd->client.win, 1);
/* FIXME maximize intelligently */
e_border_raise(bd);
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)
{
// 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);
bd->maximized = 0;
@ -871,6 +885,7 @@ e_border_stick(E_Border *bd)
E_OBJECT_CHECK(bd);
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
bd->sticky = 1;
e_hints_window_sticky_set(bd->client.win, 1);
}
void
@ -879,6 +894,7 @@ e_border_unstick(E_Border *bd)
E_OBJECT_CHECK(bd);
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
bd->sticky = 0;
e_hints_window_sticky_set(bd->client.win, 0);
e_border_desk_set(bd, e_desk_current_get(bd->zone));
}
@ -922,6 +938,9 @@ e_border_idler_before(void)
static void
_e_border_free(E_Border *bd)
{
Evas_List *list;
E_Config_Binding *eb;
while (bd->pending_move_resize)
{
free(bd->pending_move_resize->data);
@ -955,15 +974,15 @@ _e_border_free(E_Border *bd)
e_canvas_del(bd->bg_ecore_evas);
ecore_evas_free(bd->bg_ecore_evas);
ecore_x_window_del(bd->client.shell_win);
/* FIXME: use config list of bindings */
ecore_x_window_button_ungrab(bd->win,
1,
ECORE_X_MODIFIER_ALT,
0);
ecore_x_window_button_ungrab(bd->win,
3,
ECORE_X_MODIFIER_ALT,
0);
/* Bindings */
for (list = e_config->bindings; list; list = list->next)
{
eb = list->data;
ecore_x_window_button_ungrab(bd->win,
eb->button,
eb->modifiers,
0);
}
ecore_x_window_del(bd->win);
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;
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_Y,
bd->client.win, x, y);
x, y);
if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_X)
x = e->x;
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;
if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_H)
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_H,
bd->client.win, e->w, e->h);
e->w, e->h);
e_border_move_resize(bd, x, y, w, h);
}
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;
if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_H)
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_H,
bd->client.win, e->w, e->h);
e->w, e->h);
e_border_resize(bd, w, h);
}
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);
return 1;
}
printf("##- RESIZE REQ 0x%0x\n");
printf("##- RESIZE REQ 0x%x\n", bd->client.win);
{
int w, h;
@ -1388,7 +1410,6 @@ _e_border_cb_client_message(void *data, int ev_type, void *ev)
e = ev;
bd = e_border_find_by_client_window(e->win);
if (!bd) return 1;
// printf("client message for %0x\n", e->win);
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;
bd->resize_mode = RESIZE_TL;
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source);
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;
bd->resize_mode = RESIZE_T;
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source);
GRAV_SET(bd, ECORE_X_GRAVITY_S);
ecore_x_window_gravity_set(bd->bg_win, ECORE_X_GRAVITY_S);
}
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;
bd->resize_mode = RESIZE_TR;
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source);
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;
bd->resize_mode = RESIZE_R;
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source);
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;
bd->resize_mode = RESIZE_BR;
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source);
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;
bd->resize_mode = RESIZE_B;
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source);
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;
bd->resize_mode = RESIZE_BL;
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source);
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;
bd->resize_mode = RESIZE_L;
_e_border_resize_begin(bd);
_e_border_moveinfo_gather(bd, source);
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);
bd->resize_mode = RESIZE_NONE;
_e_border_resize_end(bd);
bd->changes.reset_gravity = 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;
E_Border *bd;
Evas_List *list;
E_Config_Binding *eb;
int x, y, w, h;
char source[16];
ev = event;
bd = data;
if (ev->event_win == bd->win)
{
// printf("GRABPRESS!\n");
if ((ev->button >= 1) && (ev->button <= 3))
{
bd->mouse.last_down[ev->button - 1].mx = ev->root.x;
@ -1742,20 +1774,65 @@ _e_border_cb_mouse_down(void *data, int type, void *event)
}
bd->mouse.current.mx = ev->root.x;
bd->mouse.current.my = ev->root.y;
/* FIXME: decide that this is a button binding and what to do */
if (ev->button == 1)
/* Bindings */
for (list = e_config->bindings; list; list = list->next)
{
if (!bd->moving)
eb = list->data;
if ((ev->button == eb->button) && (ev->modifiers == eb->modifiers))
{
bd->moving = 1;
_e_border_moveinfo_gather(bd, "mouse,1");
e_border_raise(bd);
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)
{
bd->moving = 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);
}
}
/* We only want one action */
break;
}
}
else if(ev->button == 3)
{
_e_border_menu_show(bd, bd->x + ev->x, bd->y + ev->y);
}
}
if (ev->win != bd->event_win) return 1;
if ((ev->button >= 1) && (ev->button <= 3))
@ -1772,6 +1849,9 @@ _e_border_cb_mouse_down(void *data, int type, void *event)
if (bd->moving)
{
}
else if (bd->resize_mode != RESIZE_NONE)
{
}
else
{
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;
E_Border *bd;
Evas_List *list;
E_Config_Binding *eb;
ev = event;
bd = data;
if (ev->event_win == bd->win)
{
// printf("GRABRELEASE!\n");
if ((ev->button >= 1) && (ev->button <= 3))
{
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.my = ev->root.y;
/* FIXME: decide that this is a button binding and what to do */
if (ev->button == 1)
/* Bindings */
for (list = e_config->bindings; list; list = list->next)
{
if (bd->moving)
eb = list->data;
if (ev->button == eb->button)
{
bd->moving = 0;
switch (eb->action)
{
case E_BINDING_ACTION_MOVE:
if (bd->moving)
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)
{
int x, y, new_x, new_y;
int new_w, new_h;
Evas_List *skiplist = NULL;
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,
bd->x, bd->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);
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,
bd->client.icccm.class);
fprintf(stderr, "client: name = %s, class = %s\n",
bd->client.icccm.name,
bd->client.icccm.class);
if (a)
{
bd->icon_object = edje_object_add(bd->bg_evas);
@ -2094,7 +2193,7 @@ _e_border_eval(E_Border *bd)
bd->client.mwm.borderless = 0;
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)) &&
(!(bd->client.mwm.decor & ECORE_X_MWM_HINT_DECOR_TITLE)) &&
(!(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.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->border = bd;
/* SUSPICION: does the unref for this actually sometimes not get */
@ -2581,7 +2688,9 @@ static void
_e_border_resize_handle(E_Border *bd)
{
int x, y, w, h;
int new_x, new_y, new_w, new_h;
int tw, th;
Evas_List *skiplist = NULL;
x = bd->x;
y = bd->y;
@ -2647,7 +2756,14 @@ _e_border_resize_handle(E_Border *bd)
(bd->resize_mode == RESIZE_TR))
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
@ -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,19 +1,22 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
typedef enum _E_Direction
{
E_DIRECTION_UP,
E_DIRECTION_DOWN,
E_DIRECTION_LEFT,
E_DIRECTION_RIGHT
E_DIRECTION_UP,
E_DIRECTION_DOWN,
E_DIRECTION_LEFT,
E_DIRECTION_RIGHT
} E_Direction;
typedef enum _E_Transition
{
E_TRANSITION_LINEAR,
E_TRANSITION_SINUSOIDAL,
E_TRANSITION_ACCELERATE,
E_TRANSITION_DECELERATE
E_TRANSITION_LINEAR,
E_TRANSITION_SINUSOIDAL,
E_TRANSITION_ACCELERATE,
E_TRANSITION_DECELERATE
} E_Transition;
typedef struct _E_Border E_Border;
@ -37,18 +40,18 @@ struct _E_Border
E_Object e_obj_inherit;
struct {
struct {
int x, y, w, h;
int mx, my;
} current, last_down[3], last_up[3];
struct {
int x, y, w, h;
int mx, my;
} current, last_down[3], last_up[3];
} mouse;
struct {
struct {
int x, y, w, h;
int mx, my;
int button;
} down;
struct {
int x, y, w, h;
int mx, my;
int button;
} down;
} moveinfo;
Ecore_X_Window win;
@ -60,7 +63,7 @@ struct _E_Border
Evas_List *handlers;
struct {
int l, r, t, b;
int l, r, t, b;
} client_inset;
Ecore_Evas *bg_ecore_evas;
@ -71,82 +74,82 @@ struct _E_Border
Ecore_X_Window event_win;
struct {
Ecore_X_Window shell_win;
Ecore_X_Window win;
Ecore_X_Window shell_win;
Ecore_X_Window win;
int x, y, w, h;
int x, y, w, h;
struct {
unsigned char changed : 1;
char *name;
} border;
struct {
unsigned char changed : 1;
char *name;
} border;
struct {
char *title;
char *name;
char *class;
char *icon_name;
char *machine;
int min_w, min_h;
int max_w, max_h;
int base_w, base_h;
int step_w, step_h;
int start_x, start_y;
double min_aspect, max_aspect;
Ecore_X_Window_State_Hint initial_state;
Ecore_X_Pixmap icon_pixmap;
Ecore_X_Pixmap icon_mask;
Ecore_X_Window icon_window;
Ecore_X_Window window_group;
Ecore_X_Gravity gravity;
unsigned char take_focus : 1;
unsigned char accepts_focus : 1;
unsigned char urgent : 1;
unsigned char delete_request : 1;
unsigned char withdrawn : 1;
unsigned char iconic : 1;
unsigned char request_pos : 1;
struct {
unsigned int title : 1;
unsigned int name_class : 1;
unsigned int icon_name : 1;
unsigned int machine : 1;
unsigned int hints : 1;
unsigned int size_pos_hints : 1;
unsigned int protocol : 1;
} fetch;
} icccm;
struct {
Ecore_X_MWM_Hint_Func func;
Ecore_X_MWM_Hint_Decor decor;
Ecore_X_MWM_Hint_Input input;
unsigned char exists : 1;
unsigned char borderless : 1;
struct {
unsigned int hints : 1;
} fetch;
} mwm;
struct {
pid_t pid;
int desktop;
struct {
unsigned int pid : 1;
unsigned int desktop : 1;
} fetch;
struct {
char *title;
char *name;
char *class;
char *icon_name;
char *machine;
int min_w, min_h;
int max_w, max_h;
int base_w, base_h;
int step_w, step_h;
int start_x, start_y;
double min_aspect, max_aspect;
Ecore_X_Window_State_Hint initial_state;
Ecore_X_Pixmap icon_pixmap;
Ecore_X_Pixmap icon_mask;
Ecore_X_Window icon_window;
Ecore_X_Window window_group;
Ecore_X_Gravity gravity;
unsigned char take_focus : 1;
unsigned char accepts_focus : 1;
unsigned char urgent : 1;
unsigned char delete_request : 1;
unsigned char withdrawn : 1;
unsigned char iconic : 1;
unsigned char request_pos : 1;
struct {
unsigned int title : 1;
unsigned int name_class : 1;
unsigned int icon_name : 1;
unsigned int machine : 1;
unsigned int hints : 1;
unsigned int size_pos_hints : 1;
unsigned int protocol : 1;
} fetch;
} icccm;
struct {
Ecore_X_MWM_Hint_Func func;
Ecore_X_MWM_Hint_Decor decor;
Ecore_X_MWM_Hint_Input input;
unsigned char exists : 1;
unsigned char borderless : 1;
struct {
unsigned int hints : 1;
} fetch;
} mwm;
struct {
pid_t pid;
int desktop;
struct {
unsigned int pid : 1;
unsigned int desktop : 1;
} fetch;
/* NetWM Window state */
struct {
unsigned char modal : 1;
unsigned char maximized_v : 1;
unsigned char maximized_h : 1;
unsigned char skip_taskbar : 1;
unsigned char skip_pager : 1;
unsigned char fullscreen : 1;
unsigned char stacking : 2; /* 0 = None, 1 = Above, 2 = Below */
} state;
/* NetWM Window state */
struct {
unsigned char modal : 1;
unsigned char maximized_v : 1;
unsigned char maximized_h : 1;
unsigned char skip_taskbar : 1;
unsigned char skip_pager : 1;
unsigned char fullscreen : 1;
unsigned char stacking : 2; /* 0 = None, 1 = Above, 2 = Below */
} state;
} netwm;
Ecore_X_Window_Attributes initial_attributes;
} netwm;
Ecore_X_Window_Attributes initial_attributes;
} client;
E_Container_Shape *shape;
@ -168,15 +171,15 @@ struct _E_Border
unsigned char resize_mode;
struct {
int x, y, w, h;
int x, y, w, h;
} saved;
struct {
double start;
double val;
int x, y;
E_Direction dir;
Ecore_Animator *anim;
double start;
double val;
int x, y;
E_Direction dir;
Ecore_Animator *anim;
} shade;
Evas_List *stick_desks;
@ -184,15 +187,15 @@ struct _E_Border
Evas_List *pending_move_resize;
struct {
unsigned int visible : 1;
unsigned int pos : 1;
unsigned int size : 1;
unsigned int stack : 1;
unsigned int prop : 1;
unsigned int border : 1;
unsigned int reset_gravity : 1;
unsigned int shading : 1;
unsigned int shaded : 1;
unsigned int visible : 1;
unsigned int pos : 1;
unsigned int size : 1;
unsigned int stack : 1;
unsigned int prop : 1;
unsigned int border : 1;
unsigned int reset_gravity : 1;
unsigned int shading : 1;
unsigned int shaded : 1;
} changes;
};

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
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
#else
#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"
/* 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
#else
#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_module_edd = NULL;
static E_Config_DD *_e_config_binding_edd = NULL;
/* externally accessible functions */
int
@ -38,6 +39,16 @@ e_config_init(void)
E_CONFIG_VAL(D, T, name, STR);
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);
#undef T
#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_y_count, INT);
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);
if (!e_config)
@ -102,6 +114,34 @@ e_config_init(void)
em->enabled = 1;
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);
@ -130,11 +170,20 @@ e_config_shutdown(void)
E_FREE(em->name);
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);
}
E_CONFIG_DD_FREE(_e_config_edd);
E_CONFIG_DD_FREE(_e_config_module_edd);
E_CONFIG_DD_FREE(_e_config_binding_edd);
return 1;
}

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#define E_CONFIG_DD_NEW(str, typ) \
@ -30,8 +33,16 @@
typedef struct _E_Config E_Config;
typedef struct _E_Config_Module E_Config_Module;
typedef struct _E_Config_Binding E_Config_Binding;
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
#ifndef E_CONFIG_H
#define E_CONFIG_H
@ -51,6 +62,7 @@ struct _E_Config
int zone_desks_x_count;
int zone_desks_y_count;
Evas_List *modules;
Evas_List *bindings;
};
struct _E_Config_Module
@ -59,6 +71,15 @@ struct _E_Config_Module
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_shutdown(void);

View File

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

View File

@ -175,8 +175,6 @@ e_desk_xy_get(E_Desk *desk, int *x, int *y)
void
e_desk_next(E_Zone *zone)
{
Evas_List *l;
E_Desk *desk;
int x, y;
E_OBJECT_CHECK(zone);
@ -203,8 +201,6 @@ e_desk_next(E_Zone *zone)
void
e_desk_prev(E_Zone *zone)
{
Evas_List *l;
E_Desk *desk;
int x, y;
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
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"
/* 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"
/* TODO List:

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#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 <dirent.h>

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#else
#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"
/* 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
#else
#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
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
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->changed = 1;
}

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#else
#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_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

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
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
#else
#ifndef E_ICON_H

View File

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

View File

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

View File

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

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
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"
/* TODO List:
@ -253,7 +256,7 @@ e_menu_post_deactivate_callback_set(E_Menu *m, void (*func) (void *data, E_Menu
m->post_deactivate_cb.data = data;
}
E_Menu *
E_Menu *
e_menu_root_get(E_Menu *m)
{
E_Menu *ret;

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#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 "config.h"

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#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"
/* TODO List:

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
/* 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"
/* 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
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"
int

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#else
#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"
/* 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
#else
#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"
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"
typedef struct _E_Resist_Rect E_Resist_Rect;
@ -13,14 +16,15 @@ 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 *rx, int *ry, int *rw, int *rh)
{
int resist = 1;
int desk_resist = 32;
int win_resist = 12;
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_w = 0, resist_h = 0;
Evas_List *l, *ll, *rects = NULL;
E_Resist_Rect *r;
@ -30,10 +34,14 @@ e_resist_container_border_position(E_Container *con, Evas_List *skiplist,
{
*rx = x;
*ry = y;
*rw = w;
*rw = h;
return 0;
}
dx = x - px;
dy = y - py;
dw = w - pw;
dh = h - ph;
/* edges of screen */
#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 (resist_x < d)
resist_x = d;
{
resist_x = d;
resist_w = -d;
}
}
}
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 (-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 (resist_y < d)
resist_y = d;
{
resist_y = d;
resist_h = -d;
}
}
}
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 (-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;
else
*ry = y;
if (dh != 0)
*rh = h + resist_h;
else
*rh = h;
if (dw != 0)
*rw = w + resist_w;
else
*rw = w;
return 1;
}

View File

@ -1,9 +1,12 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#else
#ifndef 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);
#endif

View File

@ -2,6 +2,7 @@
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
#include <execinfo.h>
/* 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.
@ -10,11 +11,9 @@ void e_sigseg_act(int x, siginfo_t *info, void *data){
void *array[255];
size_t size;
char **strings;
size_t i;
write(2, "**** SEGMENTATION FAULT ****\n", 29);
write(2, "**** Printing Backtrace... *****\n\n", 34);
size = backtrace (array, 255);
size = backtrace(array, 255);
backtrace_symbols_fd(array, size, 2);
exit(-11);
}

View File

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifndef 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"
/* 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
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"
/* 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
#else
#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"
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
#else
#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
typedef struct _E_Zone E_Zone;