Split up, shuffle around, rename.

SVN revision: 27181
This commit is contained in:
Kim Woelders 2006-11-19 21:55:52 +00:00
parent e1d074a76c
commit 63a8acc721
56 changed files with 817 additions and 576 deletions

View File

@ -1,4 +1,5 @@
# List of source files containing translatable strings.
src/about.c
src/aclass.c
src/actions.c
src/alert.c

160
src/E.h
View File

@ -28,6 +28,7 @@
#include "config.h"
#include "alert.h"
#include "edebug.h"
#include "lang.h"
#include "util.h"
@ -547,31 +548,15 @@ EMode;
* Function prototypes
*/
/* actions.c */
int ActionsSuspend(void);
int ActionsResume(void);
void ActionsHandleMotion(void);
int ActionsEnd(EWin * ewin);
/* about.c */
void About(void);
/* actions.c */
#define EXEC_SET_LANG 0x01
int execApplication(const char *params, int flags);
void Espawn(int argc, char **argv);
void EspawnCmd(const char *cmd);
/* arrange.c */
#define ARRANGE_VERBATIM 0
#define ARRANGE_BY_SIZE 1
#define ARRANGE_BY_POSITION 2
void SnapEwin(EWin * ewin, int dx, int dy, int *new_dx,
int *new_dy);
void ArrangeEwin(EWin * ewin);
void ArrangeEwinCentered(EWin * ewin);
void ArrangeEwinXY(EWin * ewin, int *px, int *py);
void ArrangeEwinCenteredXY(EWin * ewin, int *px, int *py);
void ArrangeEwins(const char *params);
/* comms.c */
void CommsInit(void);
void CommsSend(Client * c, const char *s);
@ -595,39 +580,12 @@ int ConfigFileRead(FILE * fs);
int ThemeConfigLoad(void);
void RecoverUserConfig(void);
/* coords.c */
void CoordsShow(EWin * ewin);
void CoordsHide(void);
/* cursors.c */
#define ECSR_NONE 0
#define ECSR_ROOT 1
#define ECSR_GRAB 2
#define ECSR_PGRAB 3
#define ECSR_ACT_MOVE 4
#define ECSR_ACT_RESIZE 5
#define ECSR_COUNT 6
ECursor *ECursorFind(const char *name);
void ECursorApply(ECursor * ec, Win win);
void ECursorIncRefcount(ECursor * ec);
void ECursorDecRefcount(ECursor * ec);
Cursor ECsrGet(int which);
void ECsrApply(int which, Window win);
/* dialog.c */
void DialogOK(const char *title, const char *fmt, ...);
void DialogOKstr(const char *title, const char *txt);
void DialogAlert(const char *fmt, ...);
void DialogAlertOK(const char *fmt, ...);
/* dock.c */
void DockIt(EWin * ewin);
/* draw.c */
void DrawEwinShape(EWin * ewin, int md, int x, int y, int w,
int h, char firstlast);
/* econfig.c */
void ConfigurationLoad(void);
void ConfigurationSave(void);
@ -639,100 +597,17 @@ void EdgeCheckMotion(int x, int y);
void EdgeWindowsShow(void);
void EdgeWindowsHide(void);
/* events.c */
/* Re-mapped X-events */
#define EX_EVENT_CREATE_GONE 64
#define EX_EVENT_UNMAP_GONE 65
#define EX_EVENT_MAP_GONE 66
#define EX_EVENT_MAPREQUEST_GONE 67
#define EX_EVENT_REPARENT_GONE 68
#define EX_EVENT_SHAPE_NOTIFY 72
#define EX_EVENT_SCREEN_CHANGE_NOTIFY 73
#define EX_EVENT_DAMAGE_NOTIFY 74
#define ENABLE_DEBUG_EVENTS 1
#if ENABLE_DEBUG_EVENTS
#define EDBUG_TYPE_EWINS 128
#define EDBUG_TYPE_FOCUS 129
#define EDBUG_TYPE_COMPRESSION 130
#define EDBUG_TYPE_STACKING 131
#define EDBUG_TYPE_RAISELOWER 132
#define EDBUG_TYPE_MOVERESIZE 133
#define EDBUG_TYPE_SESSION 134
#define EDBUG_TYPE_SNAPS 135
#define EDBUG_TYPE_DESKS 136
#define EDBUG_TYPE_GRABS 137
#define EDBUG_TYPE_DISPATCH 138
#define EDBUG_TYPE_MODULES 139
#define EDBUG_TYPE_CONFIG 140
#define EDBUG_TYPE_IPC 141
#define EDBUG_TYPE_EVENTS 142
#define EDBUG_TYPE_ICONBOX 143
#define EDBUG_TYPE_VERBOSE 144
#define EDBUG_TYPE_SYNC 145
#define EDBUG_TYPE_PAGER 146
#define EDBUG_TYPE_SELECTION 147
#define EDBUG_TYPE_FONTS 148
int EventDebug(unsigned int type);
void EventDebugSet(unsigned int type, int value);
#else
#define EventDebug(type) 0
#define EventDebugSet(type, value)
#endif
void EventsInit(void);
void EventsMain(void);
void EventDebugInit(const char *s);
void EventShow(const XEvent * ev);
/* extinitwin.c */
Window ExtInitWinCreate(void);
void ExtInitWinSet(Window win);
Window ExtInitWinGet(void);
void ExtInitWinKill(void);
/* focus.c */
#define FOCUS_NOP 0
#define FOCUS_INIT 1
#define FOCUS_SET 2
#define FOCUS_NONE 3
#define FOCUS_ENTER 4
#define FOCUS_LEAVE 5
#define FOCUS_EWIN_NEW 6
#define FOCUS_EWIN_UNMAP 7
#define FOCUS_DESK_ENTER 8
#define FOCUS_DESK_LEAVE 9
#define FOCUS_NEXT 10
#define FOCUS_PREV 11
#define FOCUS_CLICK 12
void FocusEnable(int on);
void FocusToEWin(EWin * ewin, int why);
void FocusHandleEnter(EWin * ewin, XEvent * ev);
void FocusHandleLeave(EWin * ewin, XEvent * ev);
void FocusHandleChange(EWin * ewin, XEvent * ev);
void FocusHandleClick(EWin * ewin, Win win);
void FocusNewDeskBegin(void);
void FocusNewDesk(void);
void FocusGrabsUpdate(void);
/* fonts.c */
int FontConfigLoad(FILE * fs);
void FontConfigUnload(void);
const char *FontLookup(const char *name);
/* grabs.c */
int GrabKeyboardSet(Win win);
int GrabKeyboardRelease(void);
int GrabPointerSet(Win win, unsigned int csr, int confine);
void GrabPointerRelease(void);
void GrabButtonSet(unsigned int button, unsigned int modifiers,
Win win, unsigned int event_mask,
unsigned int csr, int confine);
void GrabButtonRelease(unsigned int button,
unsigned int modifiers, Win win);
/* handlers.c */
void SignalsSetup(void);
void SignalsRestore(void);
@ -764,26 +639,6 @@ int ETimedLoopNext(void);
/* mod-misc.c */
void autosave(void);
/* moveresize.c */
int ActionMoveStart(EWin * ewin, int grab, char constrained,
int nogroup);
int ActionMoveEnd(EWin * ewin);
int ActionMoveSuspend(void);
int ActionMoveResume(void);
void ActionMoveHandleMotion(void);
int ActionResizeStart(EWin * ewin, int grab, int hv);
int ActionResizeEnd(EWin * ewin);
void ActionResizeHandleMotion(void);
/* progress.c */
typedef struct _progressbar Progressbar;
Progressbar *ProgressbarCreate(const char *name, int width, int height);
void ProgressbarDestroy(Progressbar * p);
void ProgressbarSet(Progressbar * p, int progress);
void ProgressbarShow(Progressbar * p);
void ProgressbarHide(Progressbar * p);
/* regex.c */
int matchregexp(const char *rx, const char *s);
@ -805,15 +660,6 @@ void StartupWindowsOpen(void);
void ThemePathFind(void);
char **ThemesList(int *num);
/* warp.c */
void WarpFocus(int delta);
/* windowmatch.c */
int WindowMatchConfigLoad(FILE * fs);
Border *WindowMatchEwinBorder(const EWin * ewin);
const char *WindowMatchEwinIcon(const EWin * ewin);
void WindowMatchEwinOps(EWin * ewin);
/*
* Global vars
*/

View File

@ -15,80 +15,58 @@ SRCS_ECOMPMGR = ecompmgr.c ecompmgr.h
endif
e16_SOURCES = \
E.h \
aclass.c \
aclass.h \
about.c \
aclass.c aclass.h \
actions.c \
alert.c \
alert.h \
alert.c alert.h \
arrange.c \
backgrounds.c \
backgrounds.h \
borders.c \
borders.h \
buttons.c \
buttons.h \
backgrounds.c backgrounds.h \
borders.c borders.h \
buttons.c buttons.h \
cmclass.c \
comms.c \
conf.h \
config.c \
container.c \
container.h \
container.c container.h \
coords.c \
cursors.c \
desktops.c \
desktops.h \
dialog.c \
dialog.h \
cursors.c cursors.h \
desktops.c desktops.h \
dialog.c dialog.h \
dock.c \
draw.c \
e16-ecore_hints.c \
e16-ecore_hints.h \
e16-ecore_list.c \
e16-ecore_list.h \
econfig.c \
econfig.h \
e16-ecore_hints.c e16-ecore_hints.h \
e16-ecore_list.c e16-ecore_list.h \
econfig.c econfig.h \
edebug.h \
edge.c \
eimage.c \
eimage.h \
emodule.c \
emodule.h \
eobj.c \
eobj.h \
eimage.c eimage.h \
emodule.c emodule.h \
eobj.c eobj.h \
etypes.h \
events.c \
ewins.c \
ewins.h \
ewin-ops.c \
ewin-ops.h \
events.c events.h \
ewins.c ewins.h \
ewin-ops.c ewin-ops.h \
ewmh.c \
extinitwin.c \
file.c \
file.h \
file.c file.h \
finders.c \
focus.c \
focus.c focus.h \
fonts.c \
fx.c \
grabs.c \
groups.c \
groups.h \
grabs.c grabs.h \
groups.c groups.h \
handlers.c \
hints.c \
hints.h \
hiwin.c \
hiwin.h \
hints.c hints.h \
hiwin.c hiwin.h \
icccm.c \
iclass.c \
iclass.h \
iclass.c iclass.h \
iconify.c \
icons.c \
icons.h \
icons.c icons.h \
ipc.c \
lang.c \
lang.h \
lang.c lang.h \
main.c \
memory.c \
menus.c \
menus.h \
menus.c menus.h \
menus-misc.c \
misc.c \
mod-misc.c \
@ -96,41 +74,31 @@ e16_SOURCES = \
moveresize.c \
mwm.c \
pager.c \
parse.c \
parse.h \
progress.c \
parse.c parse.h \
progress.c progress.h \
regex.c \
screen.c \
screen.h \
session.c \
session.h \
settings.c \
settings.h \
screen.c screen.h \
session.c session.h \
settings.c settings.h \
setup.c \
size.c \
slideout.c \
snaps.c \
snaps.h \
snaps.c snaps.h \
sound.c \
stacking.c \
startup.c \
systray.c \
tclass.c \
tclass.h \
tclass.c tclass.h \
text.c \
theme.c \
timers.c \
timers.h \
tooltips.c \
tooltips.h \
user.c \
user.h \
timers.c timers.h \
tooltips.c tooltips.h \
user.c user.h \
util.h \
ttfont.c \
warp.c \
windowmatch.c \
x.c \
xwin.h \
windowmatch.c windowmatch.h \
x.c xwin.h \
zoom.c \
$(SRCS_GNOME) \
$(SRCS_ECOMPMGR) \

77
src/about.c Normal file
View File

@ -0,0 +1,77 @@
/*
* Copyright (C) 2000-2006 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2006 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
#include "dialog.h"
static void
_DlgFillAbout(Dialog * d, DItem * table, void *data __UNUSED__)
{
DItem *di;
char buf[1024];
Esnprintf(buf, sizeof(buf), _("About Enlightenment %s"), e_wm_version);
DialogSetTitle(d, buf);
DialogItemTableSetOptions(table, 2, 0, 0, 0);
di = DialogAddItem(table, DITEM_IMAGE);
DialogItemImageSetFile(di, "pix/about.png");
di = DialogAddItem(table, DITEM_TEXT);
Esnprintf(buf, sizeof(buf),
_("Welcome to the %s version\n"
"of the Enlightenment window manager.\n"
"Enlightenment is still under development, but\n"
"we have tried to iron out all the bugs that\n"
"we can find. If you find a bug in the software,\n"
"please do not hesitate to send in a bug report.\n"
"See \"Help\" for information on joining the\n"
"mailing list.\n" "\n"
"This code was last updated on:\n%s\n" "\n"
"Good luck. We hope you enjoy the software.\n" "\n"
"The Rasterman - raster@rasterman.com\n"
"Mandrake - mandrake@mandrake.net\n"
"Kim Woelders - kim@woelders.dk\n"), e_wm_version, e_wm_date);
DialogItemSetText(di, buf);
DialogBindKey(d, "Return", DialogCallbackClose, 0, NULL);
DialogBindKey(d, "Escape", DialogCallbackClose, 0, NULL);
}
static const DialogDef DlgAbout = {
"ABOUT_ENLIGHTENMENT",
NULL,
NULL,
NULL,
NULL,
NULL,
_DlgFillAbout,
DLG_OK | DLG_NO_SEPARATOR, DialogCallbackClose,
};
void
About(void)
{
DialogShowSimple(&DlgAbout, NULL);
}

View File

@ -24,10 +24,12 @@
#include "E.h"
#include "aclass.h"
#include "conf.h"
#include "cursors.h"
#include "e16-ecore_list.h"
#include "emodule.h"
#include "ewins.h"
#include "file.h"
#include "grabs.h"
#include "parse.h"
#include <ctype.h>

View File

@ -22,7 +22,6 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
#include "dialog.h"
#include "file.h"
#include "user.h"
@ -192,140 +191,6 @@ EspawnCmd(const char *cmd)
StrlistFree(argv, argc);
}
void
ActionsHandleMotion(void)
{
switch (Mode.mode)
{
case MODE_MOVE_PENDING:
case MODE_MOVE:
ActionMoveHandleMotion();
break;
case MODE_RESIZE:
case MODE_RESIZE_H:
case MODE_RESIZE_V:
ActionResizeHandleMotion();
break;
default:
break;
}
}
int
ActionsSuspend(void)
{
switch (Mode.mode)
{
case MODE_MOVE_PENDING:
case MODE_MOVE:
ActionMoveSuspend();
break;
case MODE_RESIZE:
case MODE_RESIZE_H:
case MODE_RESIZE_V:
ActionResizeEnd(NULL);
break;
}
return 0;
}
int
ActionsResume(void)
{
switch (Mode.mode)
{
case MODE_MOVE_PENDING:
case MODE_MOVE:
ActionMoveResume();
break;
}
return 0;
}
int
ActionsEnd(EWin * ewin)
{
int did_end = 1;
switch (Mode.mode)
{
case MODE_RESIZE:
case MODE_RESIZE_H:
case MODE_RESIZE_V:
ActionResizeEnd(ewin);
Mode.action_inhibit = 1;
break;
case MODE_MOVE_PENDING:
case MODE_MOVE:
ActionMoveEnd(ewin);
Mode.action_inhibit = 1;
break;
default:
did_end = 0;
break;
}
return did_end;
}
static void
_DlgFillAbout(Dialog * d, DItem * table, void *data __UNUSED__)
{
DItem *di;
char buf[1024];
Esnprintf(buf, sizeof(buf), _("About Enlightenment %s"), e_wm_version);
DialogSetTitle(d, buf);
DialogItemTableSetOptions(table, 2, 0, 0, 0);
di = DialogAddItem(table, DITEM_IMAGE);
DialogItemImageSetFile(di, "pix/about.png");
di = DialogAddItem(table, DITEM_TEXT);
Esnprintf(buf, sizeof(buf),
_("Welcome to the %s version\n"
"of the Enlightenment window manager.\n"
"Enlightenment is still under development, but\n"
"we have tried to iron out all the bugs that\n"
"we can find. If you find a bug in the software,\n"
"please do not hesitate to send in a bug report.\n"
"See \"Help\" for information on joining the\n"
"mailing list.\n" "\n"
"This code was last updated on:\n%s\n" "\n"
"Good luck. We hope you enjoy the software.\n" "\n"
"The Rasterman - raster@rasterman.com\n"
"Mandrake - mandrake@mandrake.net\n"
"Kim Woelders - kim@woelders.dk\n"), e_wm_version, e_wm_date);
DialogItemSetText(di, buf);
DialogBindKey(d, "Return", DialogCallbackClose, 0, NULL);
DialogBindKey(d, "Escape", DialogCallbackClose, 0, NULL);
}
static const DialogDef DlgAbout = {
"ABOUT_ENLIGHTENMENT",
NULL,
NULL,
NULL,
NULL,
NULL,
_DlgFillAbout,
DLG_OK | DLG_NO_SEPARATOR, DialogCallbackClose,
};
void
About(void)
{
DialogShowSimple(&DlgAbout, NULL);
}
#if 0 /* FIXME - Fix */
struct _keyset
{

View File

@ -24,13 +24,17 @@
#include "E.h"
#include "aclass.h"
#include "borders.h"
#include "cursors.h"
#include "e16-ecore_list.h"
#include "ewins.h"
#include "focus.h"
#include "grabs.h"
#include "hints.h"
#include "iclass.h"
#include "snaps.h"
#include "tclass.h"
#include "tooltips.h"
#include "windowmatch.h"
#include "xwin.h"
#define EWIN_BORDER_PART_EVENT_MASK \

View File

@ -24,11 +24,13 @@
#include "E.h"
#include "aclass.h"
#include "buttons.h"
#include "cursors.h"
#include "desktops.h"
#include "e16-ecore_list.h"
#include "eimage.h"
#include "emodule.h"
#include "file.h"
#include "grabs.h"
#include "iclass.h"
#include "parse.h"
#include "tclass.h"

View File

@ -221,7 +221,7 @@ ClientHandleComms(XClientMessageEvent * ev)
if (!s)
return;
if (EventDebug(EDBUG_TYPE_IPC))
if (EDebug(EDBUG_TYPE_IPC))
Eprintf("ClientHandleComms: %s\n", s);
if (!strncmp(s, "set ", 4))

View File

@ -30,10 +30,12 @@
#include "file.h"
#include "iclass.h"
#include "menus.h"
#include "progress.h"
#include "session.h"
#include "tclass.h"
#include "tooltips.h"
#include "user.h"
#include "windowmatch.h"
void
SkipTillEnd(FILE * ConfigFile)
@ -161,7 +163,7 @@ GetLine(char *s, int size, FILE * f)
if (so != si)
*so = '\0';
if (EventDebug(EDBUG_TYPE_CONFIG) > 1)
if (EDebug(EDBUG_TYPE_CONFIG) > 1)
Eprintf("GetLine %s\n", s);
return s;
@ -182,7 +184,7 @@ ConfigFilePreparse(const char *path, const char *dest)
const char *epp_path = ENLIGHTENMENT_BIN "/epp";
char *def_home, *def_user, *def_shell;
if (EventDebug(EDBUG_TYPE_CONFIG))
if (EDebug(EDBUG_TYPE_CONFIG))
Eprintf("ConfigFilePreparse %s -> %s\n", path, dest);
def_home = homedir(getuid());
@ -501,7 +503,7 @@ ConfigFileLoad(const char *name, const char *themepath,
char *file;
FILE *fs;
if (EventDebug(EDBUG_TYPE_CONFIG))
if (EDebug(EDBUG_TYPE_CONFIG))
Eprintf("ConfigFileLoad %s\n", name);
file = ConfigFileFind(name, themepath, preparse);

View File

@ -24,6 +24,7 @@
#include "E.h"
#include "X11/cursorfont.h"
#include "conf.h"
#include "cursors.h"
#include "e16-ecore_list.h"
#include "emodule.h"
#include "xwin.h"

45
src/cursors.h Normal file
View File

@ -0,0 +1,45 @@
/*
* Copyright (C) 2000-2006 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2006 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _CURSORS_H_
#define _CURSORS_H_
#include "etypes.h"
/* cursors.c */
#define ECSR_NONE 0
#define ECSR_ROOT 1
#define ECSR_GRAB 2
#define ECSR_PGRAB 3
#define ECSR_ACT_MOVE 4
#define ECSR_ACT_RESIZE 5
#define ECSR_COUNT 6
ECursor *ECursorFind(const char *name);
void ECursorApply(ECursor * ec, Win win);
void ECursorIncRefcount(ECursor * ec);
void ECursorDecRefcount(ECursor * ec);
Cursor ECsrGet(int which);
void ECsrApply(int which, Window win);
#endif /* _CURSORS_H_ */

View File

@ -30,7 +30,10 @@
#include "ecompmgr.h"
#include "emodule.h"
#include "eobj.h"
#include "events.h"
#include "ewins.h"
#include "focus.h"
#include "grabs.h"
#include "hints.h"
#include "iclass.h"
#include "timers.h"
@ -515,7 +518,7 @@ DeskBackgroundConfigure(Desk * dsk)
Pixmap pmap = dsk->bg.pmap;
unsigned long pixel = dsk->bg.pixel;
if (EventDebug(EDBUG_TYPE_DESKS))
if (EDebug(EDBUG_TYPE_DESKS))
Eprintf
("DeskBackgroundConfigure %d v=%d %#lx/%#lx: ext=%d pmap=%#lx/%#lx pixel=%#lx/%#lx\n",
dsk->num, dsk->viewable, EoGetXwin(dsk), EobjGetXwin(dsk->bg.o),
@ -587,7 +590,7 @@ DeskBackgroundRefresh(Desk * dsk, int why)
int changed = 0;
int reconfigure = 0;
if (EventDebug(EDBUG_TYPE_DESKS))
if (EDebug(EDBUG_TYPE_DESKS))
Eprintf("DeskBackgroundRefresh %d v=%d why=%d pmap=%#lx pixel=%#lx\n",
dsk->num, dsk->viewable, why, pmap, pixel);
@ -779,7 +782,7 @@ DeskSetDirtyStack(Desk * dsk, EObj * eo)
dsk->stack.latest = eo;
if (EobjGetType(eo) == EOBJ_TYPE_EWIN)
dsk->stack.update_client_list = 1;
if (EventDebug(EDBUG_TYPE_STACKING))
if (EDebug(EDBUG_TYPE_STACKING))
Eprintf("DeskSetDirtyStack %d (%d): %s\n", dsk->num, dsk->stack.dirty,
EobjGetName(eo));
}
@ -1220,7 +1223,7 @@ DeskGoto(Desk * dsk)
if (!dsk || dsk == desks.previous)
return;
if (EventDebug(EDBUG_TYPE_DESKS))
if (EDebug(EDBUG_TYPE_DESKS))
Eprintf("DeskGoto %d\n", dsk->num);
ModulesSignal(ESIGNAL_DESK_SWITCH_START, NULL);
@ -1284,7 +1287,7 @@ DeskGoto(Desk * dsk)
ModulesSignal(ESIGNAL_DESK_SWITCH_DONE, NULL);
if (EventDebug(EDBUG_TYPE_DESKS))
if (EDebug(EDBUG_TYPE_DESKS))
Eprintf("DeskGoto %d done\n", dsk->num);
}
@ -1312,7 +1315,7 @@ DeskRaise(unsigned int desk)
dsk = _DeskGet(desk);
if (EventDebug(EDBUG_TYPE_DESKS))
if (EDebug(EDBUG_TYPE_DESKS))
Eprintf("DeskRaise(%d) current=%d\n", desk, desks.current->num);
DeskSwitchStart();
@ -1337,7 +1340,7 @@ DeskLower(unsigned int desk)
DeskSwitchStart();
MoveToDeskBottom(dsk);
if (EventDebug(EDBUG_TYPE_DESKS))
if (EDebug(EDBUG_TYPE_DESKS))
Eprintf("DeskLower(%d) %d -> %d\n", desk, desks.current->num,
desks.order[0]);
@ -1395,7 +1398,7 @@ DeskRestackSimple(Desk * dsk)
eo = dsk->stack.latest;
eo->stacked = 1;
if (EventDebug(EDBUG_TYPE_STACKING))
if (EDebug(EDBUG_TYPE_STACKING))
Eprintf("DeskRestackSimple %#lx %s\n", EobjGetXwin(eo), EobjGetName(eo));
lst = EobjListStackGetForDesk(&num, dsk);
@ -1419,7 +1422,7 @@ DeskRestackSimple(Desk * dsk)
xwc.sibling = EobjGetXwin(lst[i - 1]);
}
value_mask = CWSibling | CWStackMode;
if (EventDebug(EDBUG_TYPE_STACKING))
if (EDebug(EDBUG_TYPE_STACKING))
Eprintf("DeskRestackSimple %#10lx %s %#10lx\n", EobjGetXwin(eo),
(xwc.stack_mode == Above) ? "Above" : "Below", xwc.sibling);
XConfigureWindow(disp, EobjGetXwin(eo), value_mask, &xwc);
@ -1457,7 +1460,7 @@ DeskRestack(Desk * dsk)
eo->stacked = 1;
}
if (EventDebug(EDBUG_TYPE_STACKING))
if (EDebug(EDBUG_TYPE_STACKING))
{
Eprintf("DeskRestack %d (%d):\n", dsk->num, dsk->stack.dirty);
for (i = 0; i < tot; i++)
@ -1651,7 +1654,7 @@ DeskCurrentGotoArea(int ax, int ay)
if (ax == pax && ay == pay)
return;
if (EventDebug(EDBUG_TYPE_DESKS))
if (EDebug(EDBUG_TYPE_DESKS))
Eprintf("DeskCurrentGotoArea %d,%d\n", ax, ay);
ModulesSignal(ESIGNAL_AREA_SWITCH_START, NULL);
@ -1894,7 +1897,7 @@ DeskRootResize(int root, int w, int h)
{
int ww, hh;
if (EventDebug(EDBUG_TYPE_DESKS))
if (EDebug(EDBUG_TYPE_DESKS))
Eprintf("DeskRootResize %d %dx%d\n", root, w, h);
if (root)
@ -1964,7 +1967,7 @@ DeskPropertyChange(Desk * dsk, XEvent * ev)
{
/* Possible race here? */
pmap = HintsGetRootPixmap(EoGetWin(dsk));
if (EventDebug(EDBUG_TYPE_DESKS))
if (EDebug(EDBUG_TYPE_DESKS))
Eprintf("DeskPropertyChange win=%#lx _XROOTPMAP_ID=%#lx\n",
ev->xany.window, pmap);
if (ev->xany.window != VRoot.xwin)
@ -1980,7 +1983,7 @@ DeskPropertyChange(Desk * dsk, XEvent * ev)
}
else if (ev->xproperty.atom == E_XROOTCOLOR_PIXEL)
{
if (EventDebug(EDBUG_TYPE_DESKS))
if (EDebug(EDBUG_TYPE_DESKS))
Eprintf("DeskPropertyChange win=%#lx _XROOTCOLOR_PIXEL\n",
ev->xany.window);
if (ev->xany.window != VRoot.xwin)

View File

@ -33,6 +33,7 @@
#include "ecompmgr.h"
#include "emodule.h"
#include "eobj.h"
#include "events.h"
#include "hints.h"
#include "settings.h"
#include "timers.h"
@ -62,10 +63,10 @@
#define EDBUG_TYPE_COMPMGR2 162
#define EDBUG_TYPE_COMPMGR3 163
#define EDBUG_TYPE_COMPMGR4 164
#define D1printf(fmt...) if(EventDebug(EDBUG_TYPE_COMPMGR))Eprintf(fmt)
#define D2printf(fmt...) if(EventDebug(EDBUG_TYPE_COMPMGR2))Eprintf(fmt)
#define D3printf(fmt...) if(EventDebug(EDBUG_TYPE_COMPMGR3))Eprintf(fmt)
#define D4printf(fmt...) if(EventDebug(EDBUG_TYPE_COMPMGR4))Eprintf(fmt)
#define D1printf(fmt...) if(EDebug(EDBUG_TYPE_COMPMGR))Eprintf(fmt)
#define D2printf(fmt...) if(EDebug(EDBUG_TYPE_COMPMGR2))Eprintf(fmt)
#define D3printf(fmt...) if(EDebug(EDBUG_TYPE_COMPMGR3))Eprintf(fmt)
#define D4printf(fmt...) if(EDebug(EDBUG_TYPE_COMPMGR4))Eprintf(fmt)
#else
#define D1printf(fmt...)
#define D2printf(fmt...)
@ -601,7 +602,7 @@ ECompMgrDamageMerge(XserverRegion damage, int destroy)
{
if (allDamage != None)
{
if (EventDebug(EDBUG_TYPE_COMPMGR3))
if (EDebug(EDBUG_TYPE_COMPMGR3))
ERegionShow("ECompMgrDamageMerge add:", damage);
ERegionUnion(allDamage, damage);
@ -617,7 +618,7 @@ ECompMgrDamageMerge(XserverRegion damage, int destroy)
allDamage = damage;
}
if (EventDebug(EDBUG_TYPE_COMPMGR3))
if (EDebug(EDBUG_TYPE_COMPMGR3))
ERegionShow("ECompMgrDamageMerge all:", allDamage);
}
@ -1031,7 +1032,7 @@ win_extents(EObj * eo)
rgn = ERegionCreateRect(r.x, r.y, r.width, r.height);
if (EventDebug(EDBUG_TYPE_COMPMGR3))
if (EDebug(EDBUG_TYPE_COMPMGR3))
ERegionShow("extents", rgn);
#if 0 /* FIXME - Set picture clip region */
@ -1073,7 +1074,7 @@ win_shape(EObj * eo)
ERegionTranslate(border, x, y);
D2printf("shape %#lx: %d %d\n", EobjGetXwin(eo), x, y);
if (EventDebug(EDBUG_TYPE_COMPMGR3))
if (EDebug(EDBUG_TYPE_COMPMGR3))
ERegionShow("shape", border);
return border;
@ -1516,7 +1517,7 @@ ECompMgrWinMoveResize(EObj * eo, int change_xy, int change_wh, int change_bw)
/* Invalidate old window region */
damage = cw->extents;
cw->extents = None;
if (EventDebug(EDBUG_TYPE_COMPMGR3))
if (EDebug(EDBUG_TYPE_COMPMGR3))
ERegionShow("old-extents:", damage);
#if 0 /* FIXME - We shouldn't have to update clip if transparent */
@ -1578,7 +1579,7 @@ ECompMgrWinReparent(EObj * eo, Desk * dsk, int change_xy)
EobjGetX(eo), EobjGetY(eo), change_xy);
/* Invalidate old window region */
if (EventDebug(EDBUG_TYPE_COMPMGR3))
if (EDebug(EDBUG_TYPE_COMPMGR3))
ERegionShow("old-extents:", cw->extents);
ECompMgrDamageMergeObject(eo, cw->extents, change_xy);
if (change_xy)
@ -1724,7 +1725,7 @@ ECompMgrWinDumpInfo(const char *txt, EObj * eo, XserverRegion rgn, int force)
return;
}
if (force || EventDebug(EDBUG_TYPE_COMPMGR3))
if (force || EDebug(EDBUG_TYPE_COMPMGR3))
{
Eprintf(" - pict=%#lx pmap=%#lx\n", cw->picture, cw->pixmap);
@ -1964,7 +1965,7 @@ ECompMgrRepaintObj(Picture pbuf, XserverRegion region, EObj * eo, int mode)
case WINDOW_UNREDIR:
case WINDOW_SOLID:
clip = ECompMgrRepaintObjSetClip(rgn_clip, region, cw->clip, x, y);
if (EventDebug(EDBUG_TYPE_COMPMGR2))
if (EDebug(EDBUG_TYPE_COMPMGR2))
ECompMgrWinDumpInfo("ECompMgrRepaintObj solid", eo, clip, 0);
XFixesSetPictureClipRegion(dpy, pbuf, 0, 0, clip);
XRenderComposite(dpy, PictOpSrc, cw->picture, None, pbuf,
@ -1986,7 +1987,7 @@ ECompMgrRepaintObj(Picture pbuf, XserverRegion region, EObj * eo, int mode)
case WINDOW_TRANS:
case WINDOW_ARGB:
clip = ECompMgrRepaintObjSetClip(rgn_clip, region, cw->clip, x, y);
if (EventDebug(EDBUG_TYPE_COMPMGR2))
if (EDebug(EDBUG_TYPE_COMPMGR2))
ECompMgrWinDumpInfo("ECompMgrRepaintObj trans", eo, clip, 0);
XFixesSetPictureClipRegion(dpy, pbuf, 0, 0, clip);
if (cw->opacity != OPAQUE && !cw->pict_alpha)
@ -2065,7 +2066,7 @@ ECompMgrRepaint(void)
D2printf("ECompMgrRepaint rootBuffer=%#lx rootPicture=%#lx\n",
rootBuffer, rootPicture);
if (EventDebug(EDBUG_TYPE_COMPMGR))
if (EDebug(EDBUG_TYPE_COMPMGR))
ERegionShow("allDamage", allDamage);
if (!rootBuffer)
@ -2089,7 +2090,7 @@ ECompMgrRepaint(void)
#if 0 /* FIXME - NoBg? */
Picture pict;
if (EventDebug(EDBUG_TYPE_COMPMGR2))
if (EDebug(EDBUG_TYPE_COMPMGR2))
ERegionShow("after opaque", region);
/* Repaint background, clipped by damage region and opaque windows */

View File

@ -231,7 +231,7 @@ CfgItemLoad(E_DB_File * edf, const char *prefix, const CfgItem * ci)
else
name = ci->name;
if (EventDebug(EDBUG_TYPE_CONFIG))
if (EDebug(EDBUG_TYPE_CONFIG))
Eprintf("CfgItemLoad %s\n", name);
if (!ci->ptr)
@ -274,7 +274,7 @@ CfgItemSave(E_DB_File * edf, const char *prefix, const CfgItem * ci)
else
name = ci->name;
if (EventDebug(EDBUG_TYPE_CONFIG))
if (EDebug(EDBUG_TYPE_CONFIG))
Eprintf("CfgItemSave %s\n", name);
if (!ci->ptr)

64
src/edebug.h Normal file
View File

@ -0,0 +1,64 @@
/*
* Copyright (C) 2006 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _EDEBUG_H_
#define _EDEBUG_H_
#define ENABLE_DEBUG_EVENTS 1
#if ENABLE_DEBUG_EVENTS
#define EDBUG_TYPE_EWINS 128
#define EDBUG_TYPE_FOCUS 129
#define EDBUG_TYPE_COMPRESSION 130
#define EDBUG_TYPE_STACKING 131
#define EDBUG_TYPE_RAISELOWER 132
#define EDBUG_TYPE_MOVERESIZE 133
#define EDBUG_TYPE_SESSION 134
#define EDBUG_TYPE_SNAPS 135
#define EDBUG_TYPE_DESKS 136
#define EDBUG_TYPE_GRABS 137
#define EDBUG_TYPE_DISPATCH 138
#define EDBUG_TYPE_MODULES 139
#define EDBUG_TYPE_CONFIG 140
#define EDBUG_TYPE_IPC 141
#define EDBUG_TYPE_EVENTS 142
#define EDBUG_TYPE_ICONBOX 143
#define EDBUG_TYPE_VERBOSE 144
#define EDBUG_TYPE_SYNC 145
#define EDBUG_TYPE_PAGER 146
#define EDBUG_TYPE_SELECTION 147
#define EDBUG_TYPE_FONTS 148
void EDebugInit(const char *s);
void EDebugSet(unsigned int type, int value);
int EDebug(unsigned int type);
#else
#define EDebugInit(str) do{}while(0)
#define EDebugSet(type, value)
#define EDebug(type) 0
#endif
#endif /* _EDEBUG_H_ */

View File

@ -209,14 +209,14 @@ EobjInit(EObj * eo, int type, Win win, int x, int y, int w, int h,
if (EobjGetXwin(eo) != VRoot.xwin)
EobjListStackAdd(eo, 1);
if (EventDebug(EDBUG_TYPE_EWINS))
if (EDebug(EDBUG_TYPE_EWINS))
Eprintf("EobjInit: %#lx %s\n", EobjGetXwin(eo), eo->name);
}
void
EobjFini(EObj * eo)
{
if (EventDebug(EDBUG_TYPE_EWINS))
if (EDebug(EDBUG_TYPE_EWINS))
Eprintf("EobjFini: %#lx %s\n", EobjGetXwin(eo), eo->name);
EobjListStackDel(eo);
@ -241,7 +241,7 @@ EobjFini(EObj * eo)
void
EobjDestroy(EObj * eo)
{
if (EventDebug(EDBUG_TYPE_EWINS))
if (EDebug(EDBUG_TYPE_EWINS))
Eprintf("EobjDestroy: %#lx %s\n", EobjGetXwin(eo), eo->name);
EobjFini(eo);

View File

@ -24,6 +24,7 @@
#include "E.h"
#include "aclass.h"
#include "emodule.h"
#include "events.h"
#include "session.h"
#include "timers.h"
#include "xwin.h"
@ -99,7 +100,7 @@ ExtInitSync(int available)
{
if (!strcmp(xssc[i].name, "SERVERTIME"))
Mode.display.server_time = xssc[i].counter;
if (EventDebug(EDBUG_TYPE_SYNC))
if (EDebug(EDBUG_TYPE_SYNC))
Eprintf(" Sync counter %2d: %10s %#lx %#x:%#x\n", i,
xssc[i].name, xssc[i].counter,
XSyncValueHigh32(xssc[i].resolution),
@ -119,7 +120,7 @@ ExtInitSS(int available)
if (!available)
return;
if (EventDebug(EDBUG_TYPE_VERBOSE))
if (EDebug(EDBUG_TYPE_VERBOSE))
{
XScreenSaverInfo *xssi = XScreenSaverAllocInfo();
@ -178,7 +179,7 @@ ExtQuery(const EServerExt * ext)
ext->query_ver(disp, &(exd->major), &(exd->minor));
if (EventDebug(EDBUG_TYPE_VERBOSE))
if (EDebug(EDBUG_TYPE_VERBOSE))
Eprintf("Found extension %-10s version %d.%d -"
" Event/error base = %d/%d\n", ext->name,
exd->major, exd->minor, exd->event_base, exd->error_base);
@ -233,7 +234,7 @@ HandleEvent(XEvent * ev)
Win win;
#if ENABLE_DEBUG_EVENTS
if (EventDebug(ev->type))
if (EDebug(ev->type))
EventShow(ev);
#endif
@ -363,7 +364,7 @@ EventsCompress(XEvent * evq, int count)
#if ENABLE_DEBUG_EVENTS
/* Debug - should be taken out */
if (EventDebug(EDBUG_TYPE_COMPRESSION))
if (EDebug(EDBUG_TYPE_COMPRESSION))
for (i = 0; i < count; i++)
if (evq[i].type)
Eprintf("EventsCompress-1 %3d %s w=%#lx\n", i,
@ -395,7 +396,7 @@ EventsCompress(XEvent * evq, int count)
}
}
#if ENABLE_DEBUG_EVENTS
if (n && EventDebug(EDBUG_TYPE_COMPRESSION))
if (n && EDebug(EDBUG_TYPE_COMPRESSION))
Eprintf("EventsCompress n=%4d %s %#lx x,y = %d,%d\n",
n, EventName(ev->type), ev->xmotion.window,
ev->xmotion.x, ev->xmotion.y);
@ -485,7 +486,7 @@ EventsCompress(XEvent * evq, int count)
ev->xexpose.height = yb - ya;
}
#if ENABLE_DEBUG_EVENTS
if (EventDebug(EDBUG_TYPE_COMPRESSION))
if (EDebug(EDBUG_TYPE_COMPRESSION))
Eprintf("EventsCompress n=%4d %s %#lx x=%4d-%4d y=%4d-%4d\n",
n, EventName(ev->type), ev->xexpose.window,
xa, xb, ya, yb);
@ -505,7 +506,7 @@ EventsCompress(XEvent * evq, int count)
}
}
#if ENABLE_DEBUG_EVENTS
if (n && EventDebug(EDBUG_TYPE_COMPRESSION))
if (n && EDebug(EDBUG_TYPE_COMPRESSION))
Eprintf("EventsCompress n=%4d %s %#lx\n",
n, EventName(ev->type), ev->xmotion.window);
#endif
@ -524,7 +525,7 @@ EventsCompress(XEvent * evq, int count)
#if ENABLE_DEBUG_EVENTS
/* Debug - should be taken out */
if (EventDebug(EDBUG_TYPE_COMPRESSION))
if (EDebug(EDBUG_TYPE_COMPRESSION))
for (i = 0; i < count; i++)
if (evq[i].type)
Eprintf("EventsCompress-2 %3d %s w=%#lx\n", i,
@ -585,7 +586,7 @@ EventsProcess(XEvent ** evq_p, int *evq_n, int *evq_f)
n = EventsFetch(evq_p, evq_n);
evq = *evq_p;
if (EventDebug(EDBUG_TYPE_EVENTS))
if (EDebug(EDBUG_TYPE_EVENTS))
Eprintf("EventsProcess-B %d\n", n);
for (i = count = 0; i < n; i++)
@ -593,7 +594,7 @@ EventsProcess(XEvent ** evq_p, int *evq_n, int *evq_f)
if (evq[i].type == 0)
continue;
if (EventDebug(EDBUG_TYPE_EVENTS) > 1)
if (EDebug(EDBUG_TYPE_EVENTS) > 1)
EventShow(evq + i);
count++;
@ -601,7 +602,7 @@ EventsProcess(XEvent ** evq_p, int *evq_n, int *evq_f)
evq[i].type = 0;
}
if (EventDebug(EDBUG_TYPE_EVENTS))
if (EDebug(EDBUG_TYPE_EVENTS))
Eprintf("EventsProcess-E %d/%d\n", count, n);
if (n > *evq_f)
@ -635,7 +636,7 @@ EventsMain(void)
pfetch = 0;
count = EventsProcess(&evq_ptr, &evq_alloc, &pfetch);
if (EventDebug(EDBUG_TYPE_EVENTS))
if (EDebug(EDBUG_TYPE_EVENTS))
Eprintf("EventsMain - Idlers\n");
IdlersRun();
@ -643,7 +644,7 @@ EventsMain(void)
{
evq_fetch =
(pfetch > evq_fetch) ? pfetch : (3 * evq_fetch + pfetch) / 4;
if (EventDebug(EDBUG_TYPE_EVENTS))
if (EDebug(EDBUG_TYPE_EVENTS))
Eprintf("EventsMain - Alloc/fetch/pfetch/peak=%d/%d/%d/%d)\n",
evq_alloc, evq_fetch, pfetch, count);
if ((evq_ptr) && ((evq_alloc - evq_fetch) > 64))
@ -694,7 +695,7 @@ EventsMain(void)
count = select(fdsize, &fdset, NULL, NULL, NULL);
}
if (EventDebug(EDBUG_TYPE_EVENTS))
if (EDebug(EDBUG_TYPE_EVENTS))
Eprintf
("EventsMain - count=%d xfd=%d:%d smfd=%d:%d dt=%lf time2=%lf\n",
count, xfd, FD_ISSET(xfd, &fdset), smfd,
@ -704,7 +705,7 @@ EventsMain(void)
{
if ((smfd >= 0) && (FD_ISSET(smfd, &fdset)))
{
if (EventDebug(EDBUG_TYPE_EVENTS))
if (EDebug(EDBUG_TYPE_EVENTS))
Eprintf("EventsMain - ICE\n");
ProcessICEMSGS();
}
@ -716,61 +717,6 @@ EventsMain(void)
/*
* Event debug stuff
*/
#define N_DEBUG_FLAGS 256
static char ev_debug;
static char ev_debug_flags[N_DEBUG_FLAGS];
/*
* param is <EventNumber>[:<EventNumber> ... ]
*/
void
EventDebugInit(const char *param)
{
const char *s;
int ix, onoff;
if (!param)
return;
for (;;)
{
s = strchr(param, ':');
if (!param[0])
break;
ev_debug = 1;
ix = strtol(param, NULL, 0);
onoff = (ix >= 0);
if (ix < 0)
ix = -ix;
if (ix < N_DEBUG_FLAGS)
{
if (onoff)
ev_debug_flags[ix]++;
else
ev_debug_flags[ix] = 0;
}
if (!s)
break;
param = s + 1;
}
}
int
EventDebug(unsigned int type)
{
return (ev_debug &&
(type < sizeof(ev_debug_flags))) ? ev_debug_flags[type] : 0;
}
void
EventDebugSet(unsigned int type, int value)
{
if (type >= sizeof(ev_debug_flags))
return;
ev_debug = 1;
ev_debug_flags[type] += value;
}
static const char *const TxtEventNames[] = {
"Error", "Reply", "KeyPress", "KeyRelease", "ButtonPress",
@ -983,12 +929,4 @@ EventShow(const XEvent * ev)
break;
}
}
#else
void
EventDebugInit(const char *param __UNUSED__)
{
}
#endif /* ENABLE_DEBUG_EVENTS */

41
src/events.h Normal file
View File

@ -0,0 +1,41 @@
/*
* Copyright (C) 2006 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _EVENTS_H_
#define _EVENTS_H_
/* Re-mapped X-events */
#define EX_EVENT_CREATE_GONE 64
#define EX_EVENT_UNMAP_GONE 65
#define EX_EVENT_MAP_GONE 66
#define EX_EVENT_MAPREQUEST_GONE 67
#define EX_EVENT_REPARENT_GONE 68
#define EX_EVENT_SHAPE_NOTIFY 72
#define EX_EVENT_SCREEN_CHANGE_NOTIFY 73
#define EX_EVENT_DAMAGE_NOTIFY 74
void EventsInit(void);
void EventsMain(void);
void EventShow(const XEvent * ev);
#endif /* _EVENTS_H_ */

View File

@ -28,6 +28,7 @@
#include "eobj.h"
#include "ewins.h"
#include "ewin-ops.h"
#include "focus.h"
#include "groups.h"
#include "hints.h"
#include "iclass.h" /* FIXME - Should not be here */
@ -308,7 +309,7 @@ doEwinMoveResize(EWin * ewin, Desk * dsk, int x, int y, int w, int h, int flags)
return;
call_depth++;
if (EventDebug(EDBUG_TYPE_MOVERESIZE))
if (EDebug(EDBUG_TYPE_MOVERESIZE))
Eprintf("doEwinMoveResize(%d,%d) %#lx f=%x d=%d %d+%d %d*%d %s\n",
call_depth, Mode.mode, EwinGetClientXwin(ewin), flags,
(dsk) ? (int)dsk->num : -1, x, y, w, h, EwinGetName(ewin));

View File

@ -24,15 +24,20 @@
#include "E.h"
#include "aclass.h"
#include "borders.h"
#include "cursors.h"
#include "desktops.h"
#include "ecompmgr.h"
#include "emodule.h"
#include "eobj.h"
#include "events.h"
#include "ewins.h"
#include "focus.h"
#include "grabs.h"
#include "groups.h"
#include "hints.h"
#include "snaps.h"
#include "timers.h"
#include "windowmatch.h"
#include "xwin.h"
#define EWIN_TOP_EVENT_MASK \
@ -162,7 +167,7 @@ EwinGetAttributes(EWin * ewin, Win win, Window xwin)
ewin->client.cmap = xwa.colormap;
ewin->client.grav = NorthWestGravity;
if (EventDebug(EDBUG_TYPE_SNAPS))
if (EDebug(EDBUG_TYPE_SNAPS))
Eprintf("Snap get attr %#lx: %4d+%4d %4dx%4d: %s\n",
EwinGetClientXwin(ewin), ewin->client.x, ewin->client.y,
ewin->client.w, ewin->client.h, EwinGetName(ewin));
@ -173,7 +178,7 @@ EwinGetAttributes(EWin * ewin, Win win, Window xwin)
static void
EwinGetHints(EWin * ewin)
{
if (EventDebug(EDBUG_TYPE_EWINS))
if (EDebug(EDBUG_TYPE_EWINS))
Eprintf("EwinGetHints %#lx\n", EwinGetClientXwin(ewin));
ICCCM_GetTitle(ewin, 0);
@ -244,7 +249,7 @@ EwinManage(EWin * ewin)
ewin->client.event_mask = EWIN_CLIENT_EVENT_MASK;
if (EventDebug(EDBUG_TYPE_EWINS))
if (EDebug(EDBUG_TYPE_EWINS))
Eprintf("EwinManage %#lx frame=%#lx cont=%#lx st=%d\n",
EwinGetClientXwin(ewin), EoGetXwin(ewin),
EwinGetContainerXwin(ewin), ewin->state.state);
@ -329,7 +334,7 @@ EwinConfigure(EWin * ewin)
HintsSetClientList();
if (EventDebug(EDBUG_TYPE_EWINS))
if (EDebug(EDBUG_TYPE_EWINS))
Eprintf("EwinConfigure %#lx st=%d: %s\n", EwinGetClientXwin(ewin),
ewin->state.state, EwinGetName(ewin));
}
@ -349,7 +354,7 @@ EwinDestroy(EWin * ewin)
if (!ewin)
return;
if (EventDebug(EDBUG_TYPE_EWINS))
if (EDebug(EDBUG_TYPE_EWINS))
Eprintf("EwinDestroy %#lx st=%d: %s\n", EwinGetClientXwin(ewin),
ewin->state.state, EwinGetName(ewin));
@ -620,7 +625,7 @@ EwinUpdateShapeInfo(EWin * ewin)
ewin->state.shaped = EShapeCopy(ewin->win_container, EwinGetClientWin(ewin));
EUngrabServer();
if (EventDebug(EX_EVENT_SHAPE_NOTIFY))
if (EDebug(EX_EVENT_SHAPE_NOTIFY))
Eprintf("EwinUpdateShapeInfo %#lx cont=%#lx shaped=%d\n",
EwinGetClientXwin(ewin), EwinGetContainerXwin(ewin),
ewin->state.shaped);
@ -638,7 +643,7 @@ EwinPropagateShapes(EWin * ewin)
if (!ewin->update.shape)
return;
if (EventDebug(EX_EVENT_SHAPE_NOTIFY))
if (EDebug(EX_EVENT_SHAPE_NOTIFY))
Eprintf("EwinPropagateShapes %#lx frame=%#lx shaped=%d\n",
EwinGetClientXwin(ewin), EoGetXwin(ewin), ewin->state.shaped);
@ -1033,7 +1038,7 @@ EwinWithdraw(EWin * ewin, Win to)
/* Only external clients should go here */
if (EventDebug(EDBUG_TYPE_EWINS))
if (EDebug(EDBUG_TYPE_EWINS))
Eprintf("EwinWithdraw %#lx st=%d: %s\n", EwinGetClientXwin(ewin),
ewin->state.state, EwinGetName(ewin));
@ -1096,7 +1101,7 @@ EwinEventMapRequest(EWin * ewin, Window win)
static void
EwinEventDestroy(EWin * ewin)
{
if (EventDebug(EDBUG_TYPE_EWINS))
if (EDebug(EDBUG_TYPE_EWINS))
Eprintf("EwinEventDestroy %#lx st=%d: %s\n", EwinGetClientXwin(ewin),
ewin->state.state, EwinGetName(ewin));
@ -1115,7 +1120,7 @@ EwinEventReparent(EWin * ewin)
parent = None;
else
parent = EXWindowGetParent(EwinGetClientXwin(ewin));
if (EventDebug(EDBUG_TYPE_EWINS))
if (EDebug(EDBUG_TYPE_EWINS))
Eprintf("EwinEventReparent %#lx st=%d parent=%#lx: %s\n",
EwinGetClientXwin(ewin), ewin->state.state, parent,
EwinGetName(ewin));
@ -1137,7 +1142,7 @@ EwinEventMap(EWin * ewin, XEvent * ev)
old_state = ewin->state.state;
ewin->state.state = EWIN_STATE_MAPPED;
if (EventDebug(EDBUG_TYPE_EWINS))
if (EDebug(EDBUG_TYPE_EWINS))
Eprintf("EwinEventMap %#lx st=%d: %s\n", EwinGetClientXwin(ewin),
ewin->state.state, EwinGetName(ewin));
@ -1153,7 +1158,7 @@ EwinEventMap(EWin * ewin, XEvent * ev)
static void
EwinEventUnmap(EWin * ewin, XEvent * ev)
{
if (EventDebug(EDBUG_TYPE_EWINS))
if (EDebug(EDBUG_TYPE_EWINS))
Eprintf("EwinEventUnmap %#lx st=%d: %s\n", EwinGetClientXwin(ewin),
ewin->state.state, EwinGetName(ewin));
@ -1333,7 +1338,7 @@ static void
EwinEventShapeChange(EWin * ewin, XEvent * ev)
{
#define se ((XShapeEvent *)ev)
if (EventDebug(EX_EVENT_SHAPE_NOTIFY))
if (EDebug(EX_EVENT_SHAPE_NOTIFY))
Eprintf("EwinEventShapeChange %#lx %s: state.shaped=%d ev->shaped=%d\n",
EwinGetClientXwin(ewin), EoGetName(ewin), ewin->state.shaped,
se->shaped);
@ -1370,7 +1375,7 @@ EwinRaise(EWin * ewin)
num = EoRaise(ewin);
if (EventDebug(EDBUG_TYPE_RAISELOWER))
if (EDebug(EDBUG_TYPE_RAISELOWER))
Eprintf("EwinRaise(%d) %#lx %s n=%d\n", call_depth,
EwinGetClientXwin(ewin), EwinGetName(ewin), num);
@ -1403,7 +1408,7 @@ EwinLower(EWin * ewin)
num = EoLower(ewin);
if (EventDebug(EDBUG_TYPE_RAISELOWER))
if (EDebug(EDBUG_TYPE_RAISELOWER))
Eprintf("EwinLower(%d) %#lx %s n=%d\n", call_depth,
EwinGetClientXwin(ewin), EwinGetName(ewin), num);
@ -1966,7 +1971,7 @@ EwinsSetFree(void)
int i, num;
EWin *const *lst, *ewin;
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("EwinsSetFree\n");
EHintsSetInfoOnAll();

View File

@ -293,6 +293,31 @@ struct _ewin
#define EwinGetClientWin(ewin) ((ewin)->client.win)
#define EwinGetContainerWin(ewin) ((ewin)->win_container)
/* arrange.c */
#define ARRANGE_VERBATIM 0
#define ARRANGE_BY_SIZE 1
#define ARRANGE_BY_POSITION 2
void SnapEwin(EWin * ewin, int dx, int dy, int *new_dx,
int *new_dy);
void ArrangeEwin(EWin * ewin);
void ArrangeEwinCentered(EWin * ewin);
void ArrangeEwinXY(EWin * ewin, int *px, int *py);
void ArrangeEwinCenteredXY(EWin * ewin, int *px, int *py);
void ArrangeEwins(const char *params);
/* coords.c */
void CoordsShow(EWin * ewin);
void CoordsHide(void);
/* dock.c */
void DockIt(EWin * ewin);
/* draw.c */
void DrawEwinShape(EWin * ewin, int md, int x, int y, int w,
int h, char firstlast);
/* ewins.c */
#define EWIN_CHANGE_NAME (1<<0)
#define EWIN_CHANGE_ICON_NAME (1<<1)
@ -414,6 +439,21 @@ int EwinSyncRequestSend(EWin * ewin);
void EwinSyncRequestWait(EWin * ewin);
#endif
/* moveresize.c */
int ActionMoveStart(EWin * ewin, int grab, char constrained,
int nogroup);
int ActionMoveEnd(EWin * ewin);
int ActionMoveSuspend(void);
int ActionMoveResume(void);
void ActionMoveHandleMotion(void);
int ActionResizeStart(EWin * ewin, int grab, int hv);
int ActionResizeEnd(EWin * ewin);
void ActionResizeHandleMotion(void);
int ActionsSuspend(void);
int ActionsResume(void);
void ActionsHandleMotion(void);
int ActionsEnd(EWin * ewin);
/* session.c */
void SessionGetInfo(EWin * ewin, Atom atom_change);

View File

@ -38,7 +38,7 @@ ExtInitWinMain(void)
int i;
XSetWindowAttributes attr;
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("ExtInitWinMain enter\n");
disp = EDisplayOpen(NULL, -1);
@ -112,7 +112,7 @@ ExtInitWinMain(void)
i = 1;
Esnprintf(s, sizeof(s), "pix/wait%i.png", i);
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("ExtInitWinCreate - child %s\n", s);
im = EImageLoad(s);
@ -137,7 +137,7 @@ ExtInitWinMain(void)
}
}
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("ExtInitWinMain exit\n");
EDisplayClose();
@ -152,7 +152,7 @@ ExtInitWinCreate(void)
Window win;
Atom a;
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("ExtInitWinCreate\n");
a = XInternAtom(disp, "ENLIGHTENMENT_RESTART_SCREEN", False);
@ -165,7 +165,7 @@ ExtInitWinCreate(void)
for (;;)
{
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("ExtInitWinCreate - parent\n");
/* Hack to give the child some space. Not foolproof. */
@ -176,7 +176,7 @@ ExtInitWinCreate(void)
}
win = win_ex;
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("ExtInitWinCreate - parent - %#lx\n", win);
return win;
@ -184,7 +184,7 @@ ExtInitWinCreate(void)
/* Child - Create the init window */
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("ExtInitWinCreate - child\n");
/* Clean up inherited stuff */
@ -220,7 +220,7 @@ ExtInitWinKill(void)
if (!disp || init_win_ext == None)
return;
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("Kill init window %#lx\n", init_win_ext);
XKillClient(disp, init_win_ext);
init_win_ext = None;

View File

@ -22,10 +22,13 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
#include "cursors.h"
#include "desktops.h" /* FIXME - Should not be here */
#include "dialog.h"
#include "emodule.h"
#include "ewins.h"
#include "focus.h"
#include "grabs.h"
#include "hints.h"
#include "timers.h"
#include "xwin.h"
@ -53,7 +56,7 @@ FocusEnable(int on)
focus_inhibit++;
}
if (EventDebug(EDBUG_TYPE_FOCUS))
if (EDebug(EDBUG_TYPE_FOCUS))
Eprintf("FocusEnable inhibit=%d\n", focus_inhibit);
}
@ -219,7 +222,7 @@ FocusEwinSetGrabs(EWin * ewin)
{
GrabButtonSet(AnyButton, AnyModifier, EwinGetContainerWin(ewin),
ButtonPressMask, ECSR_PGRAB, 1);
if (EventDebug(EDBUG_TYPE_GRABS))
if (EDebug(EDBUG_TYPE_GRABS))
Eprintf("FocusEwinSetGrabs: %#lx set %s\n",
EwinGetClientXwin(ewin), EwinGetName(ewin));
ewin->state.click_grab_isset = 1;
@ -231,7 +234,7 @@ FocusEwinSetGrabs(EWin * ewin)
{
GrabButtonRelease(AnyButton, AnyModifier,
EwinGetContainerWin(ewin));
if (EventDebug(EDBUG_TYPE_GRABS))
if (EDebug(EDBUG_TYPE_GRABS))
Eprintf("FocusEwinSetGrabs: %#lx unset %s\n",
EwinGetClientXwin(ewin), EwinGetName(ewin));
ewin->state.click_grab_isset = 0;
@ -288,7 +291,7 @@ doFocusToEwin(EWin * ewin, int why)
if (focus_inhibit)
return;
if (EventDebug(EDBUG_TYPE_FOCUS))
if (EDebug(EDBUG_TYPE_FOCUS))
Eprintf("doFocusToEWin %#lx %s why=%d\n",
(ewin) ? EwinGetClientXwin(ewin) : 0,
(ewin) ? EwinGetName(ewin) : "None", why);
@ -451,7 +454,7 @@ doFocusToEwin(EWin * ewin, int why)
void
FocusToEWin(EWin * ewin, int why)
{
if (EventDebug(EDBUG_TYPE_FOCUS))
if (EDebug(EDBUG_TYPE_FOCUS))
Eprintf("FocusToEWin(%d) %#lx %s why=%d\n", focus_inhibit,
(ewin) ? EwinGetClientXwin(ewin) : 0,
(ewin) ? EwinGetName(ewin) : "None", why);
@ -616,7 +619,7 @@ FocusHandleClick(EWin * ewin, Win win)
FocusToEWin(ewin, FOCUS_CLICK);
/* Allow click to pass thorugh */
if (EventDebug(EDBUG_TYPE_GRABS))
if (EDebug(EDBUG_TYPE_GRABS))
Eprintf("FocusHandleClick %#lx %#lx\n", WinGetXwin(win),
EwinGetContainerXwin(ewin));
if (win == EwinGetContainerWin(ewin))

54
src/focus.h Normal file
View File

@ -0,0 +1,54 @@
/*
* Copyright (C) 2000-2006 Carsten Haitzler, Geoff Harrison and various contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _FOCUS_H_
#define _FOCUS_H_
/* focus.c */
#define FOCUS_NOP 0
#define FOCUS_INIT 1
#define FOCUS_SET 2
#define FOCUS_NONE 3
#define FOCUS_ENTER 4
#define FOCUS_LEAVE 5
#define FOCUS_EWIN_NEW 6
#define FOCUS_EWIN_UNMAP 7
#define FOCUS_DESK_ENTER 8
#define FOCUS_DESK_LEAVE 9
#define FOCUS_NEXT 10
#define FOCUS_PREV 11
#define FOCUS_CLICK 12
void FocusEnable(int on);
void FocusToEWin(EWin * ewin, int why);
void FocusHandleEnter(EWin * ewin, XEvent * ev);
void FocusHandleLeave(EWin * ewin, XEvent * ev);
void FocusHandleChange(EWin * ewin, XEvent * ev);
void FocusHandleClick(EWin * ewin, Win win);
void FocusNewDeskBegin(void);
void FocusNewDesk(void);
void FocusGrabsUpdate(void);
/* warp.c */
void WarpFocus(int delta);
#endif /* _FOCUS_H_ */

View File

@ -22,6 +22,8 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
#include "cursors.h"
#include "grabs.h"
int
GrabKeyboardSet(Win win)
@ -66,7 +68,7 @@ GrabPointerSet(Win win, unsigned int csr, int confine)
Mode.grabs.pointer_grab_window = WinGetXwin(win);
Mode.grabs.pointer_grab_active = 1;
if (EventDebug(EDBUG_TYPE_GRABS))
if (EDebug(EDBUG_TYPE_GRABS))
Eprintf("GrabPointerSet: %#lx, ret=%d\n", Mode.grabs.pointer_grab_window,
ret);
@ -78,7 +80,7 @@ GrabPointerRelease(void)
{
XUngrabPointer(disp, CurrentTime);
if (EventDebug(EDBUG_TYPE_GRABS))
if (EDebug(EDBUG_TYPE_GRABS))
Eprintf("GrabPointerRelease: %#lx\n", Mode.grabs.pointer_grab_window);
Mode.grabs.pointer_grab_active = 0;

39
src/grabs.h Normal file
View File

@ -0,0 +1,39 @@
/*
* Copyright (C) 2000-2006 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2006 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _GRABS_H_
#define _GRABS_H_
#include "xwin.h"
int GrabKeyboardSet(Win win);
int GrabKeyboardRelease(void);
int GrabPointerSet(Win win, unsigned int csr, int confine);
void GrabPointerRelease(void);
void GrabButtonSet(unsigned int button, unsigned int modifiers,
Win win, unsigned int event_mask,
unsigned int csr, int confine);
void GrabButtonRelease(unsigned int button,
unsigned int modifiers, Win win);
#endif /* _GRABS_H_ */

View File

@ -36,7 +36,7 @@ SignalHandler(int sig)
Mode.wm.in_signal_handler = 1;
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("SignalHandler signal=%d\n", sig);
switch (sig)
@ -199,7 +199,7 @@ HandleXError(Display * d __UNUSED__, XErrorEvent * ev)
}
}
if (EventDebug(1))
if (EDebug(1))
{
XGetErrorText(disp, ev->error_code, buf, 63);
Eprintf("*** ERROR: xid=%#lx error=%i req=%i/%i: %s\n",

View File

@ -364,7 +364,7 @@ EHintsSetInfo(const EWin * ewin)
ecore_x_window_prop_string_set(EwinGetClientXwin(ewin), ENL_WIN_BORDER,
ewin->normal_border->name);
if (EventDebug(EDBUG_TYPE_SNAPS))
if (EDebug(EDBUG_TYPE_SNAPS))
Eprintf("Snap set einf %#lx: %4d+%4d %4dx%4d: %s\n",
EwinGetClientXwin(ewin), ewin->client.x, ewin->client.y,
ewin->client.w, ewin->client.h, EwinGetName(ewin));
@ -410,7 +410,7 @@ EHintsGetInfo(EWin * ewin)
EwinSetBorderByName(ewin, str);
Efree(str);
if (EventDebug(EDBUG_TYPE_SNAPS))
if (EDebug(EDBUG_TYPE_SNAPS))
Eprintf("Snap get einf %#lx: %4d+%4d %4dx%4d: %s\n",
EwinGetClientXwin(ewin), ewin->client.x, ewin->client.y,
ewin->client.w, ewin->client.h, EwinGetName(ewin));
@ -495,7 +495,7 @@ EHintsSetInfoOnAll(void)
int i, num;
EWin *const *lst;
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("SetEInfoOnAll\n");
lst = EwinListGetAll(&num);
@ -557,7 +557,7 @@ SelectionAcquire(const char *name, EventCallbackFunc * func, void *data)
StructureNotifyMask, CurrentTime, sel->atom,
WinGetXwin(sel->win), 0, 0);
if (EventDebug(EDBUG_TYPE_SELECTION))
if (EDebug(EDBUG_TYPE_SELECTION))
Eprintf("Window %#lx is now %s owner, time=%lu\n",
WinGetXwin(sel->win), buf, sel->time);
@ -570,7 +570,7 @@ SelectionRelease(ESelection * sel)
if (!sel)
return;
if (EventDebug(EDBUG_TYPE_SELECTION))
if (EDebug(EDBUG_TYPE_SELECTION))
Eprintf("Window %#lx is no longer %s owner\n",
WinGetXwin(sel->win), XGetAtomName(disp, sel->atom));

View File

@ -22,8 +22,11 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
#include "cursors.h"
#include "eobj.h"
#include "events.h"
#include "ewins.h"
#include "grabs.h"
#include "hiwin.h"
#include "iclass.h"
#include "xwin.h"

View File

@ -360,7 +360,7 @@ ICCCM_Cmap(EWin * ewin)
void
ICCCM_Focus(const EWin * ewin)
{
if (EventDebug(EDBUG_TYPE_FOCUS))
if (EDebug(EDBUG_TYPE_FOCUS))
{
if (ewin)
Eprintf("ICCCM_Focus T=%#lx %#lx %s\n", Mode.events.time,
@ -524,7 +524,7 @@ ICCCM_GetGeoms(EWin * ewin, Atom atom_change)
ewin->props.no_resize_h = (ewin->icccm.width.min == ewin->icccm.width.max);
ewin->props.no_resize_v = (ewin->icccm.height.min == ewin->icccm.height.max);
if (EventDebug(EDBUG_TYPE_SNAPS))
if (EDebug(EDBUG_TYPE_SNAPS))
Eprintf("Snap get icccm %#lx: %4d+%4d %4dx%4d: %s\n",
EwinGetClientXwin(ewin), ewin->client.x, ewin->client.y,
ewin->client.w, ewin->client.h, EwinGetName(ewin));
@ -819,7 +819,7 @@ EwinSyncRequestWait(EWin * ewin)
t = GetTime();
XSyncAwait(disp, xswc, 2);
if (EventDebug(EDBUG_TYPE_SYNC))
if (EDebug(EDBUG_TYPE_SYNC))
Eprintf("Sync t=%#lx c=%llx: Delay=%8.6lf us\n",
xswc[0].trigger.counter, ewin->ewmh.sync_request_count,
GetTime() - t);

View File

@ -25,6 +25,7 @@
#include "eimage.h"
#include "ewins.h"
#include "icons.h"
#include "windowmatch.h"
#include "xwin.h"
static int

View File

@ -29,6 +29,7 @@
#include "eobj.h"
#include "ewins.h"
#include "ewin-ops.h"
#include "grabs.h"
#include "hints.h" /* FIXME - Should not be here */
#include "parse.h"
#include "screen.h"
@ -1077,7 +1078,7 @@ IPC_Debug(const char *params, Client * c __UNUSED__)
if (!strncmp(param, "event", 2))
{
EventDebugInit(p);
EDebugInit(p);
}
else if (!strncmp(param, "grab", 2))
{
@ -1582,7 +1583,7 @@ HandleIPC(const char *params, Client * c)
char w[FILEPATH_LEN_MAX];
const IpcItem **lst, *ipc;
if (EventDebug(EDBUG_TYPE_IPC))
if (EDebug(EDBUG_TYPE_IPC))
Eprintf("HandleIPC: %s\n", params);
IpcPrintInit();

View File

@ -364,7 +364,7 @@ LangInit(void)
enc_int = enc_loc;
Mode.locale.lang = setlocale(LC_MESSAGES, NULL);
if (EventDebug(EDBUG_TYPE_VERBOSE))
if (EDebug(EDBUG_TYPE_VERBOSE))
{
Eprintf("Locale: %s\n", setlocale(LC_ALL, NULL));
Eprintf("Character encoding: locale=%s internal=%s MB_CUR_MAX=%d\n",

View File

@ -22,11 +22,14 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
#include "cursors.h"
#include "desktops.h"
#include "dialog.h"
#include "eimage.h"
#include "emodule.h"
#include "events.h"
#include "file.h"
#include "grabs.h"
#include "hints.h"
#include "session.h"
#include "snaps.h"
@ -112,7 +115,7 @@ main(int argc, char **argv)
str = getenv("EDEBUG");
if (str)
EventDebugInit(str);
EDebugInit(str);
str = getenv("EDEBUG_COREDUMP");
if (str)
Mode.wm.coredump = 1;
@ -194,7 +197,7 @@ main(int argc, char **argv)
exit(0);
break;
case 'v':
EventDebugSet(EDBUG_TYPE_VERBOSE, 1);
EDebugSet(EDBUG_TYPE_VERBOSE, 1);
break;
case 'w':
sscanf(eoptarg, "%dx%d", &VRoot.w, &VRoot.h);
@ -309,7 +312,7 @@ EExit(int exitcode)
{
int i;
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("EExit(%d)\n", exitcode);
if (disp)

View File

@ -31,6 +31,7 @@
#include "iclass.h"
#include "menus.h"
#include "parse.h"
#include "progress.h"
#include <errno.h>
#include <sys/stat.h>

View File

@ -31,6 +31,7 @@
#include "eobj.h"
#include "ewins.h"
#include "file.h"
#include "grabs.h"
#include "hints.h"
#include "iclass.h"
#include "menus.h"

View File

@ -232,3 +232,72 @@ Eprintf(const char *fmt, ...)
}
#endif
#if ENABLE_DEBUG_EVENTS
/*
* Event debug stuff
*/
#define N_DEBUG_FLAGS 256
static char ev_debug;
static char ev_debug_flags[N_DEBUG_FLAGS];
/*
* param is <ItemNumber>[:<ItemNumber> ... ]
*
* ItemNumber:
* 0 : Verbose flag
* 1 : X11 errors
* [ 2; 35 [ : X11 event codes, see /usr/include/X11/X.h
* [ 64; ... [ : Remapped X11 events, see events.h
* [ 128; 256 [ : E events, see E.h
*/
void
EDebugInit(const char *param)
{
const char *s;
int ix, onoff;
if (!param)
return;
for (;;)
{
s = strchr(param, ':');
if (!param[0])
break;
ev_debug = 1;
ix = strtol(param, NULL, 0);
onoff = (ix >= 0);
if (ix < 0)
ix = -ix;
if (ix < N_DEBUG_FLAGS)
{
if (onoff)
ev_debug_flags[ix]++;
else
ev_debug_flags[ix] = 0;
}
if (!s)
break;
param = s + 1;
}
}
int
EDebug(unsigned int type)
{
return (ev_debug &&
(type < sizeof(ev_debug_flags))) ? ev_debug_flags[type] : 0;
}
void
EDebugSet(unsigned int type, int value)
{
if (type >= sizeof(ev_debug_flags))
return;
ev_debug = 1;
ev_debug_flags[type] += value;
}
#endif

View File

@ -248,7 +248,7 @@ autosave(void)
if (!Mode.wm.save_ok)
return;
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("autosave\n");
Real_SaveSnapInfo(0, NULL);

View File

@ -22,9 +22,12 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
#include "cursors.h"
#include "desktops.h"
#include "emodule.h"
#include "ewins.h"
#include "focus.h"
#include "grabs.h"
#include "groups.h"
#include "hints.h"
#include "timers.h"
@ -793,3 +796,85 @@ ActionResizeHandleMotion(void)
break;
}
}
void
ActionsHandleMotion(void)
{
switch (Mode.mode)
{
case MODE_MOVE_PENDING:
case MODE_MOVE:
ActionMoveHandleMotion();
break;
case MODE_RESIZE:
case MODE_RESIZE_H:
case MODE_RESIZE_V:
ActionResizeHandleMotion();
break;
default:
break;
}
}
int
ActionsSuspend(void)
{
switch (Mode.mode)
{
case MODE_MOVE_PENDING:
case MODE_MOVE:
ActionMoveSuspend();
break;
case MODE_RESIZE:
case MODE_RESIZE_H:
case MODE_RESIZE_V:
ActionResizeEnd(NULL);
break;
}
return 0;
}
int
ActionsResume(void)
{
switch (Mode.mode)
{
case MODE_MOVE_PENDING:
case MODE_MOVE:
ActionMoveResume();
break;
}
return 0;
}
int
ActionsEnd(EWin * ewin)
{
int did_end = 1;
switch (Mode.mode)
{
case MODE_RESIZE:
case MODE_RESIZE_H:
case MODE_RESIZE_V:
ActionResizeEnd(ewin);
Mode.action_inhibit = 1;
break;
case MODE_MOVE_PENDING:
case MODE_MOVE:
ActionMoveEnd(ewin);
Mode.action_inhibit = 1;
break;
default:
did_end = 0;
break;
}
return did_end;
}

View File

@ -29,6 +29,7 @@
#include "ecompmgr.h"
#include "emodule.h"
#include "ewins.h"
#include "focus.h"
#include "groups.h"
#include "hints.h"
#include "hiwin.h"
@ -40,7 +41,7 @@
#define DEBUG_PAGER 1
#if DEBUG_PAGER
#define Dprintf(fmt...) if(EventDebug(EDBUG_TYPE_PAGER))Eprintf(fmt)
#define Dprintf(fmt...) if(EDebug(EDBUG_TYPE_PAGER))Eprintf(fmt)
#else
#define Dprintf(fmt...)
#endif

View File

@ -23,6 +23,7 @@
#include "E.h"
#include "eobj.h"
#include "iclass.h"
#include "progress.h"
#include "tclass.h"
#include "xwin.h"

35
src/progress.h Normal file
View File

@ -0,0 +1,35 @@
/*
* Copyright (C) 2000-2006 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2006 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _PROGRESS_H_
#define _PROGRESS_H_
typedef struct _progressbar Progressbar;
Progressbar *ProgressbarCreate(const char *name, int width, int height);
void ProgressbarDestroy(Progressbar * p);
void ProgressbarSet(Progressbar * p, int progress);
void ProgressbarShow(Progressbar * p);
void ProgressbarHide(Progressbar * p);
#endif /* _PROGRESS_H_ */

View File

@ -100,7 +100,7 @@ set_save_props(SmcConn smc_conn, int master_flag)
SmProp *props[7];
char bufs[32], bufm[32], bufx[32];
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("set_save_props\n");
programProp.name = (char *)SmProgram;
@ -228,7 +228,7 @@ set_save_props(SmcConn smc_conn, int master_flag)
/* SM specs require SmCloneCommand excludes "--sm-client-id" option */
cloneProp.num_vals = restartProp.num_vals - 2;
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
for (i = 0; i < restartProp.num_vals; i++)
Eprintf("restartVal[i]: %2d: %s\n", restartVal[i].length,
(char *)restartVal[i].value);
@ -257,7 +257,7 @@ set_save_props(SmcConn smc_conn, int master_flag)
static void
callback_save_yourself2(SmcConn smc_conn, SmPointer client_data __UNUSED__)
{
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("callback_save_yourself2\n");
set_save_props(smc_conn, Mode.wm.master);
@ -271,7 +271,7 @@ callback_save_yourself(SmcConn smc_conn, SmPointer client_data __UNUSED__,
int save_style __UNUSED__, Bool shutdown __UNUSED__,
int interact_style __UNUSED__, Bool fast __UNUSED__)
{
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("callback_save_yourself\n");
SmcRequestSaveYourselfPhase2(smc_conn, callback_save_yourself2, NULL);
@ -280,7 +280,7 @@ callback_save_yourself(SmcConn smc_conn, SmPointer client_data __UNUSED__,
static void
callback_die(SmcConn smc_conn __UNUSED__, SmPointer client_data __UNUSED__)
{
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("callback_die\n");
SessionExit(EEXIT_EXIT, NULL);
@ -290,14 +290,14 @@ static void
callback_save_complete(SmcConn smc_conn __UNUSED__,
SmPointer client_data __UNUSED__)
{
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("callback_save_complete\n");
}
static void
callback_shutdown_cancelled(SmcConn smc_conn, SmPointer client_data __UNUSED__)
{
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("callback_shutdown_cancelled\n");
SmcSaveYourselfDone(smc_conn, False);
@ -311,7 +311,7 @@ static IceConn ice_conn;
static void
ice_io_error_handler(IceConn connection __UNUSED__)
{
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("ice_io_error_handler\n");
/* The less we do here the better - the default handler does an
@ -476,7 +476,7 @@ SetSMID(const char *smid)
void
SessionSave(int shutdown)
{
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("SessionSave(%d)\n", shutdown);
/* dont' need anymore */
@ -507,7 +507,7 @@ doSMExit(int mode, const char *params)
char s[1024];
const char *ss;
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("doSMExit: mode=%d prm=%p\n", mode, params);
restarting = True;
@ -543,7 +543,7 @@ doSMExit(int mode, const char *params)
EDisplayClose();
Esnprintf(s, sizeof(s), "exec %s", params);
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("doSMExit: %s\n", s);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
break;
@ -576,7 +576,7 @@ doSMExit(int mode, const char *params)
if (ss)
l += Esnprintf(s + l, sizeof(s) - l, " -t %s", ss);
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("doSMExit: %s\n", s);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
@ -682,7 +682,7 @@ SessionExit(int mode, const char *param)
if (getpid() != Mode.wm.pid)
return;
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("SessionExit: mode=%d(%d) prm=%s\n", mode, Mode.wm.exit_mode,
param);
@ -738,7 +738,7 @@ SessionRunProg(const char *prog, const char *params)
{
s = prog;
}
if (EventDebug(EDBUG_TYPE_SESSION))
if (EDebug(EDBUG_TYPE_SESSION))
Eprintf("SessionRunProg: %s\n", s);
system(s);
}

View File

@ -22,6 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
#include "events.h"
#include "ewins.h"
#include "screen.h"
#include "xwin.h"
@ -232,12 +233,6 @@ SetupX(const char *dstr)
/* Initialise event handling */
EventsInit();
/* just in case - set them up again */
/* set up an error handler for then E would normally have fatal X errors */
XSetErrorHandler((XErrorHandler) HandleXError);
/* set up a handler for when the X Connection goes down */
XSetIOErrorHandler((XIOErrorHandler) HandleXIOError);
/* select all the root window events to start managing */
Mode.wm.xselect = 1;
mask =
@ -245,8 +240,8 @@ SetupX(const char *dstr)
ButtonMotionMask | PropertyChangeMask | SubstructureRedirectMask |
PointerMotionMask | StructureNotifyMask | SubstructureNotifyMask;
ESelectInput(VRoot.win, mask);
ESync();
Mode.wm.xselect = 0;
/* warn, if necessary about X version problems */

View File

@ -25,11 +25,13 @@
#include "aclass.h"
#include "borders.h"
#include "buttons.h"
#include "cursors.h"
#include "desktops.h"
#include "e16-ecore_list.h"
#include "emodule.h"
#include "eobj.h"
#include "ewins.h"
#include "grabs.h"
#include "xwin.h"
#define SLIDEOUT_EVENT_MASK \

View File

@ -1174,7 +1174,7 @@ Real_SaveSnapInfo(int dumval __UNUSED__, void *dumdat __UNUSED__)
Esnprintf(buf, sizeof(buf), "%s.snapshots", EGetSavePrefix());
if (EventDebug(EDBUG_TYPE_SNAPS))
if (EDebug(EDBUG_TYPE_SNAPS))
Eprintf("Real_SaveSnapInfo: %s\n", buf);
E_mv(s, buf);
if (!isfile(buf))
@ -1515,7 +1515,7 @@ SnapshotEwinApply(EWin * ewin)
EoSetShadow(ewin, sn->shadow);
#endif
if (EventDebug(EDBUG_TYPE_SNAPS))
if (EDebug(EDBUG_TYPE_SNAPS))
Eprintf("Snap get snap %#lx: %4d+%4d %4dx%4d: %s\n",
EwinGetClientXwin(ewin), ewin->client.x, ewin->client.y,
ewin->client.w, ewin->client.h, EwinGetName(ewin));

View File

@ -51,7 +51,7 @@ EobjListShow(const char *txt, EobjList * ewl)
int i;
EObj *eo;
if (!EventDebug(EDBUG_TYPE_STACKING))
if (!EDebug(EDBUG_TYPE_STACKING))
return;
Eprintf("%s-%s:\n", ewl->name, txt);

View File

@ -23,6 +23,7 @@
#include "E.h"
#include "container.h"
#include "e16-ecore_hints.h"
#include "events.h"
#include "hints.h"
#include "xwin.h"
@ -169,7 +170,7 @@ SystrayObjAdd(Container * ct, Window xwin)
Eprintf("SystrayObjAdd: Hmm.. No _XEMBED_INFO?\n");
break;
default:
if (EventDebug(EDBUG_TYPE_ICONBOX))
if (EDebug(EDBUG_TYPE_ICONBOX))
Eprintf("SystrayObjAdd: _XEMBED_INFO: %#lx: %d %d\n", xwin,
xembed_info[0], xembed_info[1]);
break;
@ -218,7 +219,7 @@ SystrayObjDel(Container * ct, Win win, int gone)
if (i < 0)
return;
if (EventDebug(EDBUG_TYPE_ICONBOX))
if (EDebug(EDBUG_TYPE_ICONBOX))
Eprintf("SystrayObjDel %#lx\n", WinGetXwin(win));
swin = ct->objs[i].obj;
@ -246,7 +247,7 @@ SystrayObjMapUnmap(Container * ct, Window win)
if (SystrayGetXembedInfo(win, xembed_info) >= 0)
{
if (EventDebug(EDBUG_TYPE_ICONBOX))
if (EDebug(EDBUG_TYPE_ICONBOX))
Eprintf("SystrayObjMapUnmap: _XEMBED_INFO: %#lx: %d %d\n", win,
xembed_info[0], xembed_info[1]);
@ -261,7 +262,7 @@ SystrayObjMapUnmap(Container * ct, Window win)
}
else
{
if (EventDebug(EDBUG_TYPE_ICONBOX))
if (EDebug(EDBUG_TYPE_ICONBOX))
Eprintf("SystrayObjMapUnmap: _XEMBED_INFO: %#lx: gone?\n", win);
map = 0;
@ -278,7 +279,7 @@ SystrayEventClientMessage(Container * ct, XClientMessageEvent * ev)
{
Window win;
if (EventDebug(EDBUG_TYPE_ICONBOX))
if (EDebug(EDBUG_TYPE_ICONBOX))
Eprintf
("SystrayEventClientMessage: ev->type=%ld ev->data.l: %#lx %#lx %#lx %#lx\n",
ev->message_type, ev->data.l[0], ev->data.l[1], ev->data.l[2],
@ -294,7 +295,7 @@ SystrayEventClientMessage(Container * ct, XClientMessageEvent * ev)
}
else if (ev->message_type == _NET_SYSTEM_TRAY_MESSAGE_DATA)
{
if (EventDebug(EDBUG_TYPE_ICONBOX))
if (EDebug(EDBUG_TYPE_ICONBOX))
Eprintf("SystrayEventClientMessage: Got data message\n");
}
done:
@ -304,7 +305,7 @@ SystrayEventClientMessage(Container * ct, XClientMessageEvent * ev)
static void
SystrayEventClientProperty(Container * ct, XPropertyEvent * ev)
{
if (EventDebug(EDBUG_TYPE_ICONBOX))
if (EDebug(EDBUG_TYPE_ICONBOX))
Eprintf("SystrayEventClientProperty %#lx %ld\n", ev->window, ev->atom);
if (ev->atom == E_XA__XEMBED_INFO)
@ -316,7 +317,7 @@ SystrayEventClientProperty(Container * ct, XPropertyEvent * ev)
static void
SystraySelectionEvent(Win win __UNUSED__, XEvent * ev, void *prm)
{
if (EventDebug(EDBUG_TYPE_ICONBOX))
if (EDebug(EDBUG_TYPE_ICONBOX))
Eprintf("SystraySelectionEvent %2d %#lx\n", ev->type, ev->xany.window);
switch (ev->type)
@ -341,7 +342,7 @@ SystraySelectionEvent(Win win __UNUSED__, XEvent * ev, void *prm)
static void
SystrayEvent(Win _win __UNUSED__, XEvent * ev, void *prm __UNUSED__)
{
if (EventDebug(EDBUG_TYPE_ICONBOX))
if (EDebug(EDBUG_TYPE_ICONBOX))
Eprintf("SystrayEvent %2d %#lx\n", ev->type, ev->xany.window);
#if 0 /* FIXME - Need this one at all? ConfigureRequest? */
@ -378,7 +379,7 @@ SystrayItemEvent(Win win, XEvent * ev, void *prm)
{
Container *ct = prm;
if (EventDebug(EDBUG_TYPE_ICONBOX))
if (EDebug(EDBUG_TYPE_ICONBOX))
Eprintf("SystrayItemEvent %2d %#lx\n", ev->type, ev->xany.window);
switch (ev->type)

View File

@ -586,7 +586,7 @@ _xfs_Load(TextState * ts, int fallback)
if (!font)
return -1;
if (EventDebug(EDBUG_TYPE_FONTS))
if (EDebug(EDBUG_TYPE_FONTS))
{
Eprintf("- XBaseFontNameListOfFontSet %s\n",
XBaseFontNameListOfFontSet(font));
@ -855,7 +855,7 @@ TextStateLoadFont(TextState * ts)
done:
if (!ts->ops)
Eprintf("*** Unable to load font \"%s\"\n", ts->fontname);
else if (EventDebug(EDBUG_TYPE_FONTS))
else if (EDebug(EDBUG_TYPE_FONTS))
Eprintf("TextStateLoadFont %s: type=%d\n", ts->fontname, ts->type);
return;
}

View File

@ -58,7 +58,7 @@ DoIn(const char *name, double in_time, void (*func) (int val, void *data),
if (!qe)
return;
if (EventDebug(EDBUG_TYPE_EVENTS))
if (EDebug(EDBUG_TYPE_EVENTS))
Eprintf("DoIn %8.3f: %s\n", in_time, name);
qe->name = Estrdup(name);
@ -120,7 +120,7 @@ TimersRun(void)
if (!q_first)
return;
if (EventDebug(EDBUG_TYPE_EVENTS))
if (EDebug(EDBUG_TYPE_EVENTS))
Eprintf("EventsMain - Timers (%s)\n", qe->name);
/* remove it */

View File

@ -34,6 +34,8 @@
#include "E.h"
#include "emodule.h"
#include "ewins.h"
#include "focus.h"
#include "grabs.h"
#include "iclass.h"
#include "icons.h"
#include "screen.h"

View File

@ -30,6 +30,7 @@
#include "ewins.h"
#include "ewin-ops.h"
#include "parse.h"
#include "windowmatch.h"
typedef struct _windowmatch WindowMatch;

34
src/windowmatch.h Normal file
View File

@ -0,0 +1,34 @@
/*
* Copyright (C) 2000-2006 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2006 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _WINDOWMATCH_H_
#define _WINDOWMATCH_H_
#include "etypes.h"
int WindowMatchConfigLoad(FILE * fs);
Border *WindowMatchEwinBorder(const EWin * ewin);
const char *WindowMatchEwinIcon(const EWin * ewin);
void WindowMatchEwinOps(EWin * ewin);
#endif /* _WINDOWMATCH_H_ */

View File

@ -304,7 +304,7 @@ EventCallbacksProcess(Win win, XEvent * ev)
eci = ecl->lst;
for (i = 0; i < ecl->num; i++, eci++)
{
if (EventDebug(EDBUG_TYPE_DISPATCH))
if (EDebug(EDBUG_TYPE_DISPATCH))
Eprintf("EventDispatch: type=%d win=%#lx func=%p prm=%p\n",
ev->type, ev->xany.window, eci->func, eci->prm);
eci->func(xid, ev, eci->prm);
@ -767,7 +767,7 @@ EUnregisterWindow(Win win)
if (xid->cbl.lst)
{
if (EventDebug(1))
if (EDebug(1))
Eprintf("EUnregisterWindow(%#lx) Ignored (%d callbacks remain)\n",
xid->xwin, xid->cbl.num);
return;
@ -1669,7 +1669,7 @@ EGrabServer(void)
{
if (Mode.grabs.server_grabbed <= 0)
{
if (EventDebug(EDBUG_TYPE_GRABS))
if (EDebug(EDBUG_TYPE_GRABS))
Eprintf("EGrabServer\n");
XGrabServer(disp);
}
@ -1683,7 +1683,7 @@ EUngrabServer(void)
{
XUngrabServer(disp);
XFlush(disp);
if (EventDebug(EDBUG_TYPE_GRABS))
if (EDebug(EDBUG_TYPE_GRABS))
Eprintf("EUngrabServer\n");
}
Mode.grabs.server_grabbed--;

View File

@ -23,6 +23,7 @@
*/
#include "E.h"
#include "ewins.h"
#include "focus.h"
#include "xwin.h"
#ifdef WITH_ZOOM