Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h actions.c borders.c config.c
Log Message:
Add border frame action handling (enables things like auto shade/unshade).
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.332
retrieving revision 1.333
diff -u -3 -r1.332 -r1.333
--- E.h 20 Nov 2004 17:55:11 -0000 1.332
+++ E.h 4 Dec 2004 12:38:17 -0000 1.333
@@ -735,6 +735,7 @@
char changes_shape;
char shadedir;
unsigned int ref_count;
+ ActionClass *aclass;
}
Border;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/actions.c,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -3 -r1.179 -r1.180
--- actions.c 17 Nov 2004 19:27:37 -0000 1.179
+++ actions.c 4 Dec 2004 12:38:18 -0000 1.180
@@ -447,6 +447,8 @@
mouse = 1;
break;
case LeaveNotify:
+ if (ev->xcrossing.detail == NotifyNonlinearVirtual)
+ EDBUG_RETURN(0);
type = EVENT_MOUSE_LEAVE;
button = -1;
modifiers = ev->xcrossing.state & mask;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.235
retrieving revision 1.236
diff -u -3 -r1.235 -r1.236
--- borders.c 20 Nov 2004 17:55:11 -0000 1.235
+++ borders.c 4 Dec 2004 12:38:18 -0000 1.236
@@ -2283,21 +2283,12 @@
EDBUG(5, "CreateBorder");
- b = Emalloc(sizeof(Border));
+ b = Ecalloc(1, sizeof(Border));
if (!b)
EDBUG_RETURN(NULL);
b->name = Estrdup(name);
- b->group_border_name = NULL;
- b->border.left = 0;
- b->border.right = 0;
- b->border.top = 0;
- b->border.bottom = 0;
- b->num_winparts = 0;
- b->part = NULL;
- b->changes_shape = 0;
b->shadedir = 2;
- b->ref_count = 0;
EDBUG_RETURN(b);
}
@@ -2927,9 +2918,9 @@
case 0:
att.win_gravity = EastGravity;
XChangeWindowAttributes(disp, ewin->client.win, CWWinGravity, &att);
- a = ewin->border->border.left;
- b = ewin->client.w + ewin->border->border.left +
- ewin->border->border.right;
+ a = ewin->border->border.left + ewin->border->border.right;
+ b = ewin->client.w + a;
+ a++;
ewin->shaded = 0;
EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top,
@@ -2973,12 +2964,11 @@
case 1:
att.win_gravity = WestGravity;
XChangeWindowAttributes(disp, ewin->client.win, CWWinGravity, &att);
- a = ewin->border->border.right;
- b = ewin->client.w + ewin->border->border.left +
- ewin->border->border.right;
+ a = ewin->border->border.left + ewin->border->border.right;
+ b = ewin->client.w + a;
c = ewin->x;
- d = ewin->x + ewin->w - (ewin->border->border.right + ewin->client.w +
- ewin->border->border.left);
+ d = ewin->x + ewin->w - (ewin->client.w + a);
+ a++;
ewin->shaded = 0;
EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top,
@@ -3021,9 +3011,9 @@
case 2:
att.win_gravity = SouthGravity;
XChangeWindowAttributes(disp, ewin->client.win, CWWinGravity, &att);
- a = ewin->border->border.top;
- b = ewin->client.h + ewin->border->border.top +
- ewin->border->border.bottom;
+ a = ewin->border->border.top + ewin->border->border.bottom;
+ b = ewin->client.h + a;
+ a++;
ewin->shaded = 0;
EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top,
@@ -3067,12 +3057,11 @@
case 3:
att.win_gravity = SouthGravity;
XChangeWindowAttributes(disp, ewin->client.win, CWWinGravity, &att);
- a = ewin->border->border.bottom;
- b = ewin->client.h + ewin->border->border.top +
- ewin->border->border.bottom;
+ a = ewin->border->border.top + ewin->border->border.bottom;
+ b = ewin->client.h + a;
c = ewin->y;
- d = ewin->y + ewin->h - (ewin->border->border.bottom +
- ewin->client.h + ewin->border->border.top);
+ d = ewin->y + ewin->h - (ewin->client.h + a);
+ a++;
ewin->shaded = 0;
EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top,
@@ -3593,18 +3582,25 @@
BordersEvent(XEvent * ev, border_event_func_t * func)
{
Window win = ev->xany.window;
- EWin *const *ewins;
+ EWin *const *ewins, *ewin;
int i, j, num, used = 0;
ewins = EwinListGetAll(&num);
for (i = 0; i < num; i++)
{
- for (j = 0; j < ewins[i]->border->num_winparts; j++)
+ ewin = ewins[i];
+ if (win == ewin->win)
{
- if (win == ewins[i]->bits[j].win)
+ if (ewin->border->aclass)
+ EventAclass(ev, ewin, ewin->border->aclass);
+ used = 0;
+ goto done;
+ }
+ for (j = 0; j < ewin->border->num_winparts; j++)
+ {
+ if (win == ewin->bits[j].win)
{
- func(ev, ewins[i], j);
-
+ func(ev, ewin, j);
used = 1;
goto done;
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/config.c,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -3 -r1.118 -r1.119
--- config.c 17 Nov 2004 19:31:09 -0000 1.118
+++ config.c 4 Dec 2004 12:38:18 -0000 1.119
@@ -54,161 +54,6 @@
return 1;
}
-#if 0 /* Remove if happy with the new code */
-static char *
-GetLine(char *s, int size, FILE * f)
-{
-
- /* This function will get a single line from the file */
-
- char *ret, *ss, inquote;
- int i, j, k;
- static int line_stack_size = 0;
- static char **line_stack = NULL;
-
- s[0] = 0;
- if (line_stack_size > 0)
- {
- strncpy(s, line_stack[0], size);
- Efree(line_stack[0]);
- for (i = 0; i < line_stack_size - 1; i++)
- line_stack[i] = line_stack[i + 1];
- line_stack_size--;
- if (line_stack_size > 0)
- {
- line_stack =
- Erealloc(line_stack, line_stack_size * sizeof(char *));
- }
- else
- {
- Efree(line_stack);
- line_stack = NULL;
- }
- return s;
- }
- ret = fgets(s, size, f);
-
- if (strlen(s) > 0)
- s[strlen(s) - 1] = 0;
-
- while (IsWhitespace(s))
- {
- s[0] = 0;
- ret = fgets(s, size, f);
- if (!ret)
- return NULL;
- if (strlen(s) > 0)
- s[strlen(s) - 1] = 0;
- }
-
- i = 0;
- inquote = 0;
- while (s[i])
- {
- if (!inquote)
- {
- if (s[i] == '"')
- {
- j = i;
- while (s[j])
- {
- s[j] = s[j + 1];
- j++;
- }
- inquote = 1;
- i--;
- }
- }
- else
- {
- if (s[i] == '"')
- {
- j = i + 1;
- while (s[j])
- {
- if (s[j] == ';')
- break;
- if ((s[j] == '"') && (j == (i + 1)))
- break;
- if (!isspace(s[j]))
- {
- j--;
- break;
- }
- j++;
- }
- k = j - i;
- j = i;
- while (s[j])
- {
- s[j] = s[j + k];
- j++;
- }
- inquote = 0;
- i--;
- }
- }
- i++;
- }
-
- j = strlen(s);
- if (j > 0)
- {
- if (strchr(s, ';'))
- {
- s[j] = ';';
- s[j + 1] = 0;
- }
- }
- i = 0;
- ss = s;
- while (s[i])
- {
- if (s[i] == ';')
- {
- j = (&(s[i]) - ss);
- if (j > 0)
- {
- line_stack_size++;
- if (!line_stack)
- line_stack = Emalloc(line_stack_size * sizeof(char *));
-
- else
- line_stack =
- Erealloc(line_stack, line_stack_size * sizeof(char *));
-
- line_stack[line_stack_size - 1] = Emalloc(j + 1);
- strncpy(line_stack[line_stack_size - 1], ss, j);
- line_stack[line_stack_size - 1][j] = 0;
- ss = &(s[i + 1]);
- }
- }
- i++;
- }
-
- if (line_stack_size > 0)
- {
- strncpy(s, line_stack[0], size);
- Efree(line_stack[0]);
- for (i = 0; i < line_stack_size - 1; i++)
- line_stack[i] = line_stack[i + 1];
- line_stack_size--;
- if (line_stack_size > 0)
- {
- line_stack =
- Erealloc(line_stack, line_stack_size * sizeof(char *));
-
- }
- else
- {
- Efree(line_stack);
- line_stack = NULL;
- }
- return s;
- }
- return ret;
-}
-#else
#define LINE_BUFFER_SIZE 1024
/*
* This function will get a single line from the file
@@ -307,7 +152,6 @@
bufptr = si;
return s;
}
-#endif
static void
SkipTillEnd(FILE * ConfigFile)
@@ -1582,6 +1426,10 @@
case BORDER_CHANGES_SHAPE:
b->changes_shape = atoi(s2);
break;
+ case CONFIG_ACTIONCLASS:
+ b->aclass =
+ FindItem(s2, 0, LIST_FINDBY_NAME, LIST_TYPE_ACLASS);
+ break;
default:
break;
}
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs