Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h actions.c borders.c config.c desktops.c evhandlers.c
slideout.c x.c
Log Message:
Slideout code and namespace shuffle.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.173
retrieving revision 1.174
diff -u -3 -r1.173 -r1.174
--- E.h 4 Jan 2004 18:07:18 -0000 1.173
+++ E.h 9 Jan 2004 09:11:33 -0000 1.174
@@ -628,6 +628,7 @@
typedef struct _group Group;
typedef struct _button Button;
typedef struct _buttoncontainer Container;
+typedef struct _slideout Slideout;
typedef struct _soundclass SoundClass;
typedef struct _efont Efont;
@@ -1170,19 +1171,6 @@
}
WindowMatch;
-typedef struct
-{
- char *name;
- char direction;
- int num_buttons;
- Button **button;
- int w, h;
- Window win;
- Window from_win;
- unsigned int ref_count;
-}
-Slideout;
-
typedef struct _emode
{
int mode;
@@ -2301,13 +2289,17 @@
void SlideWindowSizeTo(Window win, int fx, int fy, int tx,
int ty, int fw, int fh, int tw, int th,
int speed);
-Slideout *CreateSlideout(char *name, char dir);
-void ShowSlideout(Slideout * s, Window win);
-void HideSlideout(Slideout * s, Window w);
-void CalcSlideoutSize(Slideout * s);
-void AddButtonToSlideout(Slideout * s, Button * b);
-void RemoveButtonFromSlideout(Slideout * s, Button * b);
+Slideout *SlideoutCreate(char *name, char dir);
+void SlideoutShow(Slideout * s, Window win);
+void SlideoutHide(Slideout * s);
+void SlideoutAddButton(Slideout * s, Button * b);
+void SlideoutRemoveButton(Slideout * s, Button * b);
+const char *SlideoutGetName(Slideout * s);
+EWin *SlideoutsGetContextEwin(void);
+void SlideoutsHide(void);
+void SlideoutsHideIfContextWin(Window win);
+/* text.c functions */
TextState *TextGetState(TextClass * tclass, int active, int sticky,
int state);
char **TextGetLines(char *text, int *count);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/actions.c,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -3 -r1.125 -r1.126
--- actions.c 3 Jan 2004 12:55:08 -0000 1.125
+++ actions.c 9 Jan 2004 09:11:33 -0000 1.126
@@ -861,8 +861,7 @@
if ((mode.mode == MODE_MOVE) || (mode.mode == MODE_RESIZE_H)
|| (mode.mode == MODE_RESIZE_V) || (mode.mode == MODE_RESIZE))
EDBUG_RETURN(0);
- if (mode.slideout)
- HideSlideout(mode.slideout, mode.context_win);
+ SlideoutsHide();
ewin = mode.ewin = GetFocusEwin();
if (!ewin)
EDBUG_RETURN(0);
@@ -916,8 +915,7 @@
if ((mode.mode == MODE_MOVE) || (mode.mode == MODE_RESIZE_H)
|| (mode.mode == MODE_RESIZE_V) || (mode.mode == MODE_RESIZE))
EDBUG_RETURN(0);
- if (mode.slideout)
- HideSlideout(mode.slideout, mode.context_win);
+ SlideoutsHide();
ewin = mode.ewin = GetFocusEwin();
if (!ewin)
EDBUG_RETURN(0);
@@ -965,8 +963,7 @@
if ((mode.mode == MODE_MOVE) || (mode.mode == MODE_RESIZE_H)
|| (mode.mode == MODE_RESIZE_V) || (mode.mode == MODE_RESIZE))
EDBUG_RETURN(0);
- if (mode.slideout)
- HideSlideout(mode.slideout, mode.context_win);
+ SlideoutsHide();
ewin = mode.ewin = GetFocusEwin();
if (!ewin)
EDBUG_RETURN(0);
@@ -1062,8 +1059,7 @@
if ((mode.mode == MODE_MOVE) || (mode.mode == MODE_RESIZE_H)
|| (mode.mode == MODE_RESIZE_V) || (mode.mode == MODE_RESIZE))
EDBUG_RETURN(0);
- if (mode.slideout)
- HideSlideout(mode.slideout, mode.context_win);
+ SlideoutsHide();
ewin = mode.ewin = GetFocusEwin();
if (!ewin)
EDBUG_RETURN(0);
@@ -2554,8 +2550,7 @@
if (s)
{
SoundPlay("SOUND_SLIDEOUT_SHOW");
- ShowSlideout(s, mode.context_win);
- s->ref_count++;
+ SlideoutShow(s, mode.context_win);
}
EDBUG_RETURN(0);
}
@@ -2573,8 +2568,7 @@
if (!params)
EDBUG_RETURN(0);
- if (mode.slideout)
- HideSlideout(mode.slideout, mode.context_win);
+ SlideoutsHide();
x = 0;
y = 0;
@@ -2795,8 +2789,7 @@
if (!params)
EDBUG_RETURN(0);
- if (mode.slideout)
- HideSlideout(mode.slideout, mode.context_win);
+ SlideoutsHide();
EDBUG_RETURN(0);
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -3 -r1.117 -r1.118
--- borders.c 3 Jan 2004 12:29:58 -0000 1.117
+++ borders.c 9 Jan 2004 09:11:33 -0000 1.118
@@ -1471,8 +1471,6 @@
int i, num_groups;
EDBUG(5, "FreeEwin");
- if ((mode.slideout) && (FindEwinByChildren(mode.slideout->from_win)))
- HideSlideout(mode.slideout, 0);
if (!ewin)
EDBUG_RETURN_;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/config.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -3 -r1.80 -r1.81
--- config.c 3 Jan 2004 12:55:08 -0000 1.80
+++ config.c 9 Jan 2004 09:11:33 -0000 1.81
@@ -509,7 +509,8 @@
{
case CONFIG_CLOSE:
if (slideout)
- AddItem(slideout, slideout->name, 0, LIST_TYPE_SLIDEOUT);
+ AddItem(slideout, SlideoutGetName(slideout), 0,
+ LIST_TYPE_SLIDEOUT);
return;
case CONFIG_CLASSNAME:
if (name)
@@ -517,7 +518,7 @@
name = duplicate(s2);
break;
case SLIDEOUT_DIRECTION:
- slideout = CreateSlideout(name, (char)atoi(s2));
+ slideout = SlideoutCreate(name, (char)atoi(s2));
if (name)
Efree(name);
break;
@@ -528,7 +529,7 @@
b = (Button *) FindItem(s2, 0, LIST_FINDBY_NAME,
LIST_TYPE_BUTTON);
if (b)
- AddButtonToSlideout(slideout, b);
+ SlideoutAddButton(slideout, b);
}
break;
default:
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -3 -r1.51 -r1.52
--- desktops.c 3 Jan 2004 12:21:51 -0000 1.51
+++ desktops.c 9 Jan 2004 09:11:33 -0000 1.52
@@ -1228,8 +1228,7 @@
EDBUG_RETURN_;
pdesk = desks.current;
- if (mode.slideout)
- HideSlideout(mode.slideout, mode.context_win);
+ SlideoutsHide();
{
ToolTip **lst;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/evhandlers.c,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -3 -r1.134 -r1.135
--- evhandlers.c 6 Jan 2004 19:37:04 -0000 1.134
+++ evhandlers.c 9 Jan 2004 09:11:33 -0000 1.135
@@ -848,20 +848,18 @@
void
HandleDestroy(XEvent * ev)
{
- Window win;
+ Window win = ev->xdestroywindow.window;
EWin *ewin;
Client *c;
EDBUG(5, "HandleDestroy");
- win = ev->xdestroywindow.window;
+
EForgetWindow(disp, win);
- ewin = RemoveItem(NULL, win, LIST_FINDBY_ID, LIST_TYPE_EWIN);
- if (ewin)
- if (ewin->iconified > 0)
- RemoveMiniIcon(ewin);
- mode.context_win = win;
+ if (win == mode.context_win)
+ mode.context_win = 0;
+ ewin = RemoveItem(NULL, win, LIST_FINDBY_ID, LIST_TYPE_EWIN);
if (ewin)
{
Pager *p;
@@ -874,10 +872,13 @@
mode.context_pager = NULL;
}
+ if (ewin->iconified > 0)
+ RemoveMiniIcon(ewin);
+
if (ewin == mode.ewin)
{
- if (mode.slideout)
- HideSlideout(mode.slideout, mode.context_win);
+ SlideoutsHide();
+
switch (mode.mode)
{
case MODE_RESIZE:
@@ -1164,6 +1165,8 @@
if (ewin == mode.ewin)
{
+ SlideoutsHide();
+
switch (mode.mode)
{
case MODE_RESIZE:
@@ -1178,11 +1181,6 @@
break;
}
}
- if (!ewin->iconified)
- {
- if ((mode.slideout) && (ewin == mode.ewin))
- HideSlideout(mode.slideout, mode.context_win);
- }
if (ewin == mode.focuswin)
FocusToEWin(NULL);
if (ewin == mode.mouse_over_win)
@@ -1569,13 +1567,12 @@
XSendEvent(disp, bpress_win, False, SubstructureNotifyMask, ev);
}
mode.context_win = click_was_in;
+
pslideout = mode.slideout;
- if (mode.slideout)
- {
- ewin = FindEwinByChildren(mode.slideout->from_win);
- if (ewin)
- mode.ewin = ewin;
- }
+ ewin = SlideoutsGetContextEwin();
+ if (ewin)
+ mode.ewin = ewin;
+
if (mode.mode == MODE_DESKDRAG)
mode.mode = MODE_NONE;
if (mode.mode == MODE_BUTTONDRAG)
@@ -1635,13 +1632,10 @@
&& (!wasmovres))
EventAclass(ev, ewins[i]->border->part[j].aclass);
mode.borderpartpress = 0;
- if ((mode.slideout) && (pslideout))
- HideSlideout(mode.slideout, mode.context_win);
}
Efree(ewins);
- click_was_in = 0;
last_bpress = 0;
- EDBUG_RETURN_;
+ goto exit;
}
}
}
@@ -1667,10 +1661,7 @@
if (EventAclass(ev, ac))
{
mode.borderpartpress = 0;
- if ((mode.slideout) && (pslideout))
- HideSlideout(mode.slideout, mode.context_win);
- click_was_in = 0;
- EDBUG_RETURN_;
+ goto exit;
}
mode.borderpartpress = 0;
}
@@ -1681,7 +1672,7 @@
exit:
if ((mode.slideout) && (pslideout))
- HideSlideout(mode.slideout, mode.context_win);
+ SlideoutHide(mode.slideout);
click_was_in = 0;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/slideout.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- slideout.c 7 Dec 2003 09:18:55 -0000 1.13
+++ slideout.c 9 Jan 2004 09:11:33 -0000 1.14
@@ -24,6 +24,20 @@
#include "E.h"
#include <sys/time.h>
+struct _slideout
+{
+ char *name;
+ char direction;
+ int num_buttons;
+ Button **button;
+ int w, h;
+ Window win;
+ Window from_win;
+ unsigned int ref_count;
+};
+
+static void SlideoutCalcSize(Slideout * s);
+
void
SlideWindowSizeTo(Window win, int fx, int fy, int tx, int ty, int fw, int fh,
int tw, int th, int speed)
@@ -65,11 +79,11 @@
}
Slideout *
-CreateSlideout(char *name, char dir)
+SlideoutCreate(char *name, char dir)
{
Slideout *s;
- EDBUG(5, "CreateSlideout");
+ EDBUG(5, "SlideoutCreate");
s = Emalloc(sizeof(Slideout));
if (!s)
@@ -89,7 +103,7 @@
}
void
-ShowSlideout(Slideout * s, Window win)
+SlideoutShow(Slideout * s, Window win)
{
int x, y, i, xx, yy, di;
Window dw;
@@ -97,12 +111,12 @@
XSetWindowAttributes att;
unsigned int w, h, d;
- EDBUG(5, "ShowSlideout");
+ EDBUG(5, "SlideoutShow");
if (mode.slideout)
EDBUG_RETURN_;
- CalcSlideoutSize(s);
+ SlideoutCalcSize(s);
EGetGeometry(disp, win, &dw, &di, &di, &w, &h, &d, &d);
XTranslateCoordinates(disp, win, root.win, 0, 0, &x, &y, &dw);
@@ -117,7 +131,7 @@
{
pdir = s->direction;
s->direction = 1;
- ShowSlideout(s, win);
+ SlideoutShow(s, win);
s->direction = pdir;
EDBUG_RETURN_;
}
@@ -129,7 +143,7 @@
{
pdir = s->direction;
s->direction = 0;
- ShowSlideout(s, win);
+ SlideoutShow(s, win);
s->direction = pdir;
EDBUG_RETURN_;
}
@@ -141,7 +155,7 @@
{
pdir = s->direction;
s->direction = 1;
- ShowSlideout(s, win);
+ SlideoutShow(s, win);
s->direction = pdir;
EDBUG_RETURN_;
}
@@ -153,7 +167,7 @@
{
pdir = s->direction;
s->direction = 0;
- ShowSlideout(s, win);
+ SlideoutShow(s, win);
s->direction = pdir;
EDBUG_RETURN_;
}
@@ -226,15 +240,17 @@
break;
}
s->from_win = win;
+ s->ref_count++;
+
mode.slideout = s;
EDBUG_RETURN_;
}
void
-HideSlideout(Slideout * s, Window w)
+SlideoutHide(Slideout * s)
{
- EDBUG(5, "HideSlideout");
+ EDBUG(5, "SlideoutHide");
if (!s)
EDBUG_RETURN_;
@@ -243,18 +259,17 @@
s->from_win = 0;
s->ref_count--;
mode.slideout = NULL;
- w = 0;
EDBUG_RETURN_;
}
-void
-CalcSlideoutSize(Slideout * s)
+static void
+SlideoutCalcSize(Slideout * s)
{
int i;
int mx, my, x, y;
- EDBUG(5, "CalcSlideoutSize");
+ EDBUG(5, "SlideoutCalcSize");
if (!s)
EDBUG_RETURN_;
@@ -321,9 +336,9 @@
}
void
-AddButtonToSlideout(Slideout * s, Button * b)
+SlideoutAddButton(Slideout * s, Button * b)
{
- EDBUG(5, "AddButtonToSlideout");
+ EDBUG(5, "SlideoutAddButton");
if (!b)
EDBUG_RETURN_;
@@ -340,18 +355,47 @@
b->used = 1;
b->ref_count++;
ButtonShow(b);
- CalcSlideoutSize(s);
+ SlideoutCalcSize(s);
EDBUG_RETURN_;
}
void
-RemoveButtonFromSlideout(Slideout * s, Button * b)
+SlideoutRemoveButton(Slideout * s, Button * b)
{
- EDBUG(5, "RemoveButtonFromSlideout");
+ EDBUG(5, "SlideoutRemoveButton");
s = NULL;
b = NULL;
EDBUG_RETURN_;
+}
+
+const char *
+SlideoutGetName(Slideout * s)
+{
+ return s->name;
+}
+
+EWin *
+SlideoutsGetContextEwin(void)
+{
+ if (mode.slideout)
+ return FindEwinByChildren(mode.slideout->from_win);
+
+ return NULL;
+}
+
+void
+SlideoutsHide(void)
+{
+ if (mode.slideout)
+ SlideoutHide(mode.slideout);
+}
+
+void
+SlideoutsHideIfContextWin(Window win)
+{
+ if ((mode.slideout) && (mode.slideout->from_win == win))
+ SlideoutHide(mode.slideout);
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/x.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -3 -r1.60 -r1.61
--- x.c 28 Dec 2003 17:57:30 -0000 1.60
+++ x.c 9 Jan 2004 09:11:33 -0000 1.61
@@ -230,8 +230,8 @@
{
EXID *xid;
- if ((mode.slideout) && (mode.slideout->from_win == win))
- HideSlideout(mode.slideout, 0);
+ SlideoutsHideIfContextWin(win);
+
xid = FindXID(win);
if (xid)
{
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs