diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/add_window.c | 144 | ||||
-rw-r--r-- | src/cursor.c | 8 | ||||
-rw-r--r-- | src/events.c | 345 | ||||
-rw-r--r-- | src/gc.c | 57 | ||||
-rw-r--r-- | src/gram.y | 25 | ||||
-rw-r--r-- | src/iconmgr.c | 184 | ||||
-rw-r--r-- | src/icons.c | 43 | ||||
-rw-r--r-- | src/list.c | 100 | ||||
-rw-r--r-- | src/menus.c | 387 | ||||
-rw-r--r-- | src/parse.c | 138 | ||||
-rw-r--r-- | src/resize.c | 206 | ||||
-rw-r--r-- | src/twm.c | 45 | ||||
-rw-r--r-- | src/util.c | 203 |
13 files changed, 557 insertions, 1328 deletions
diff --git a/src/add_window.c b/src/add_window.c index b9dd3ba..47610a6 100644 --- a/src/add_window.c +++ b/src/add_window.c @@ -97,18 +97,16 @@ static void CreateWindowTitlebarButtons ( TwmWindow *tmp_win ); char NoName[] = "Untitled"; /* name if no name is specified */ -/************************************************************************ +/** + * map gravity to (x,y) offset signs for adding to x and y when window is + * mapped to get proper placement. * - * Procedure: - * GetGravityOffsets - map gravity to (x,y) offset signs for adding - * to x and y when window is mapped to get proper placement. + * \param tmp window from which to get gravity + * \param xp,yp return values * - ************************************************************************ */ void -GetGravityOffsets (tmp, xp, yp) - TwmWindow *tmp; /* window from which to get gravity */ - int *xp, *yp; /* return values */ +GetGravityOffsets (TwmWindow *tmp, int *xp, int *yp) { static struct _gravity_offset { int x, y; @@ -139,27 +137,17 @@ GetGravityOffsets (tmp, xp, yp) -/*********************************************************************** +/** + * add a new window to the twm list. * - * Procedure: - * AddWindow - add a new window to the twm list + * \return pointer to the TwmWindow structure * - * Returned Value: - * (TwmWindow *) - pointer to the TwmWindow structure - * - * Inputs: - * w - the window id of the window to add - * iconm - flag to tell if this is an icon manager window - * iconp - pointer to icon manager struct - * - *********************************************************************** + * \param w the window id of the window to add + * \param iconm flag to tell if this is an icon manager window + * \param iconp pointer to icon manager struct */ - TwmWindow * -AddWindow(w, iconm, iconp) -Window w; -int iconm; -IconMgr *iconp; +AddWindow(Window w, int iconm, IconMgr *iconp) { TwmWindow *tmp_win; /* new twm window structure */ int stat; @@ -964,25 +952,15 @@ IconMgr *iconp; } -/*********************************************************************** - * - * Procedure: - * MappedNotOverride - checks to see if we should really - * put a twm frame on the window - * - * Returned Value: - * TRUE - go ahead and frame the window - * FALSE - don't frame the window +/** + * checks to see if we should really put a twm frame on the window * - * Inputs: - * w - the window to check - * - *********************************************************************** + * \return TRUE - go ahead and place the window + * \return FALSE - don't frame the window + * \param w the window to check */ - int -MappedNotOverride(w) - Window w; +MappedNotOverride(Window w) { XWindowAttributes wa; @@ -991,15 +969,11 @@ MappedNotOverride(w) } -/*********************************************************************** - * - * Procedure: - * AddDefaultBindings - attach default bindings so that naive users - * don't get messed up if they provide a minimal twmrc. +/** + * attach default bindings so that naive users don't get messed up if they + * provide a minimal twmrc. */ -static void do_add_binding (button, context, modifier, func) - int button, context, modifier; - int func; +static void do_add_binding (int button, int context, int modifier, int func) { MouseButton *mb = &Scr->Mouse[button][context][modifier]; @@ -1033,20 +1007,13 @@ AddDefaultBindings () -/*********************************************************************** +/** + * grab needed buttons for the window * - * Procedure: - * GrabButtons - grab needed buttons for the window - * - * Inputs: - * tmp_win - the twm window structure to use - * - *********************************************************************** + * \param[in] tmp_win the twm window structure to use */ - void -GrabButtons(tmp_win) -TwmWindow *tmp_win; +GrabButtons(TwmWindow *tmp_win) { int i, j; @@ -1068,20 +1035,13 @@ TwmWindow *tmp_win; } } -/*********************************************************************** - * - * Procedure: - * GrabKeys - grab needed keys for the window +/** + * grab needed keys for the window * - * Inputs: - * tmp_win - the twm window structure to use - * - *********************************************************************** + * \param[in] tmp_win the twm window structure to use */ - void -GrabKeys(tmp_win) -TwmWindow *tmp_win; +GrabKeys(TwmWindow *tmp_win) { FuncKey *tmp; IconMgr *p; @@ -1136,8 +1096,7 @@ TwmWindow *tmp_win; } } -static Window CreateHighlightWindow (tmp_win) - TwmWindow *tmp_win; +static Window CreateHighlightWindow (TwmWindow *tmp_win) { XSetWindowAttributes attributes; /* attributes for create windows */ Pixmap pm = None; @@ -1222,10 +1181,7 @@ void ComputeCommonTitleOffsets () return; } -void ComputeWindowTitleOffsets (tmp_win, width, squeeze) - TwmWindow *tmp_win; - int width; - Bool squeeze; +void ComputeWindowTitleOffsets (TwmWindow *tmp_win, int width, Bool squeeze) { tmp_win->highlightx = (Scr->TBInfo.titlex + tmp_win->name_width); if (tmp_win->hilite_w || Scr->TBInfo.nright > 0) @@ -1243,13 +1199,12 @@ void ComputeWindowTitleOffsets (tmp_win, width, squeeze) } -/* - * ComputeTitleLocation - calculate the position of the title window; we need - * to take the frame_bw into account since we want (0,0) of the title window - * to line up with (0,0) of the frame window. +/** + * calculate the position of the title window. We need to take the frame_bw + * into account since we want (0,0) of the title window to line up with (0,0) + * of the frame window. */ -void ComputeTitleLocation (tmp) - register TwmWindow *tmp; +void ComputeTitleLocation (register TwmWindow *tmp) { tmp->title_x = -tmp->frame_bw; tmp->title_y = -tmp->frame_bw; @@ -1299,8 +1254,7 @@ void ComputeTitleLocation (tmp) } -static void CreateWindowTitlebarButtons (tmp_win) - TwmWindow *tmp_win; +static void CreateWindowTitlebarButtons (TwmWindow *tmp_win) { unsigned long valuemask; /* mask for create windows */ XSetWindowAttributes attributes; /* attributes for create windows */ @@ -1378,8 +1332,7 @@ static void CreateWindowTitlebarButtons (tmp_win) void -SetHighlightPixmap (filename) - char *filename; +SetHighlightPixmap (char *filename) { Pixmap pm = GetBitmap (filename); @@ -1395,8 +1348,7 @@ SetHighlightPixmap (filename) void -FetchWmProtocols (tmp) - TwmWindow *tmp; +FetchWmProtocols (TwmWindow *tmp) { unsigned long flags = 0L; Atom *protocols = NULL; @@ -1417,8 +1369,7 @@ FetchWmProtocols (tmp) } TwmColormap * -CreateTwmColormap(c) - Colormap c; +CreateTwmColormap(Colormap c) { TwmColormap *cmap; cmap = (TwmColormap *) malloc(sizeof(TwmColormap)); @@ -1436,10 +1387,7 @@ CreateTwmColormap(c) } ColormapWindow * -CreateColormapWindow(w, creating_parent, property_window) - Window w; - Bool creating_parent; - Bool property_window; +CreateColormapWindow(Window w, Bool creating_parent, Bool property_window) { ColormapWindow *cwin; TwmColormap *cmap; @@ -1493,8 +1441,7 @@ CreateColormapWindow(w, creating_parent, property_window) } void -FetchWmColormapWindows (tmp) - TwmWindow *tmp; +FetchWmColormapWindows (TwmWindow *tmp) { register int i, j; Window *cmap_windows = NULL; @@ -1622,8 +1569,7 @@ FetchWmColormapWindows (tmp) } -void GetWindowSizeHints (tmp) - TwmWindow *tmp; +void GetWindowSizeHints (TwmWindow *tmp) { long supplied = 0; diff --git a/src/cursor.c b/src/cursor.c index be0c2e6..3c15bd4 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -126,9 +126,7 @@ static struct _CursorName { }; void -NewFontCursor (cp, str) - Cursor *cp; - char *str; +NewFontCursor (Cursor *cp, char *str) { int i; @@ -148,9 +146,7 @@ NewFontCursor (cp, str) } void -NewBitmapCursor(cp, source, mask) - Cursor *cp; - char *source, *mask; +NewBitmapCursor(Cursor *cp, char *source, char *mask) { int hotx, hoty; int sx, sy, mx, my; diff --git a/src/events.c b/src/events.c index e9e7efc..57399a1 100644 --- a/src/events.c +++ b/src/events.c @@ -86,7 +86,7 @@ XEvent ButtonEvent; /* button press event */ XEvent Event; /* the current event */ TwmWindow *Tmp_win; /* the current twm window */ -/* Used in HandleEnterNotify to remove border highlight from a window +/** Used in HandleEnterNotify to remove border highlight from a window * that has not recieved a LeaveNotify event because of a pointer grab */ TwmWindow *UnHighLight_win = NULL; @@ -117,8 +117,7 @@ int ButtonPressed = -1; int Cancel = FALSE; -void AutoRaiseWindow (tmp) - TwmWindow *tmp; +void AutoRaiseWindow (TwmWindow *tmp) { XRaiseWindow (dpy, tmp->frame); XSync (dpy, 0); @@ -127,8 +126,7 @@ void AutoRaiseWindow (tmp) raise_win = tmp; } -void SetRaiseWindow (tmp) - TwmWindow *tmp; +void SetRaiseWindow (TwmWindow *tmp) { enter_flag = TRUE; enter_win = NULL; @@ -138,14 +136,9 @@ void SetRaiseWindow (tmp) -/*********************************************************************** - * - * Procedure: - * InitEvents - initialize the event jump table - * - *********************************************************************** +/** + * initialize the event jump table. */ - void InitEvents() { @@ -186,8 +179,7 @@ InitEvents() Time lastTimestamp = CurrentTime; /* until Xlib does this for us */ -Bool StashEventTime (ev) - register XEvent *ev; +Bool StashEventTime (XEvent *ev) { switch (ev->type) { case KeyPress: @@ -223,13 +215,12 @@ Bool StashEventTime (ev) -/* - * WindowOfEvent - return the window about which this event is concerned; this +/** + * return the window about which this event is concerned; this * window may not be the same as XEvent.xany.window (the first window listed * in the structure). */ -Window WindowOfEvent (e) - XEvent *e; +Window WindowOfEvent (XEvent *e) { /* * Each window subfield is marked with whether or not it is the same as @@ -276,14 +267,9 @@ Window WindowOfEvent (e) -/*********************************************************************** - * - * Procedure: - * DispatchEvent2 - +/** * handle a single X event stored in global var Event - * this rouitine for is for a call during an f.move - * - *********************************************************************** + * this routine for is for a call during an f.move */ Bool DispatchEvent2 () { @@ -309,12 +295,8 @@ Bool DispatchEvent2 () return True; } -/*********************************************************************** - * - * Procedure: - * DispatchEvent - handle a single X event stored in global var Event - * - *********************************************************************** +/** + * handle a single X event stored in global var Event */ Bool DispatchEvent () { @@ -339,14 +321,9 @@ Bool DispatchEvent () -/*********************************************************************** - * - * Procedure: - * HandleEvents - handle X events - * - *********************************************************************** +/** + * handle X events */ - void HandleEvents() { @@ -373,18 +350,14 @@ HandleEvents() -/*********************************************************************** - * - * Procedure: - * HandleColormapNotify - colormap notify event handler +/** + * colormap notify event handler. * * This procedure handles both a client changing its own colormap, and * a client explicitly installing its colormap itself (only the window * manager should do that, so we must set it correctly). * - *********************************************************************** */ - void HandleColormapNotify() { @@ -530,18 +503,14 @@ HandleColormapNotify() -/*********************************************************************** - * - * Procedure: - * HandleVisibilityNotify - visibility notify event handler +/** + * visibility notify event handler. * * This routine keeps track of visibility events so that colormap * installation can keep the maximum number of useful colormaps * installed at one time. * - *********************************************************************** */ - void HandleVisibilityNotify() { @@ -570,16 +539,12 @@ HandleVisibilityNotify() -/*********************************************************************** - * - * Procedure: - * HandleKeyPress - key press event handler - * - *********************************************************************** - */ int MovedFromKeyPress = False; +/** + * key press event handler + */ void HandleKeyPress() { @@ -704,9 +669,7 @@ HandleKeyPress() static void -free_window_names (tmp, nukefull, nukename, nukeicon) - TwmWindow *tmp; - Bool nukefull, nukename, nukeicon; +free_window_names (TwmWindow *tmp, Bool nukefull, Bool nukename, Bool nukeicon) { /* * XXX - are we sure that nobody ever sets these to another constant (check @@ -724,8 +687,7 @@ free_window_names (tmp, nukefull, nukename, nukeicon) void -free_cwins (tmp) - TwmWindow *tmp; +free_cwins (TwmWindow *tmp) { int i; TwmColormap *cmap; @@ -753,14 +715,9 @@ free_cwins (tmp) -/*********************************************************************** - * - * Procedure: - * HandlePropertyNotify - property notify event handler - * - *********************************************************************** +/** + * property notify event handler */ - void HandlePropertyNotify() { @@ -967,12 +924,8 @@ HandlePropertyNotify() -/*********************************************************************** - * - * Procedure: - * RedoIconName - procedure to re-position the icon window and name - * - *********************************************************************** +/** + * procedure to re-position the icon window and name */ void RedoIconName() @@ -1034,14 +987,9 @@ RedoIconName() -/*********************************************************************** - * - * Procedure: - * HandleClientMessage - client message event handler - * - *********************************************************************** +/** + *client message event handler */ - void HandleClientMessage() { @@ -1068,12 +1016,8 @@ HandleClientMessage() -/*********************************************************************** - * - * Procedure: - * HandleExpose - expose event handler - * - *********************************************************************** +/** + * expose event handler */ void HandleExpose() @@ -1174,8 +1118,7 @@ HandleExpose() -static void remove_window_from_ring (tmp) - TwmWindow *tmp; +static void remove_window_from_ring (TwmWindow *tmp) { TwmWindow *prev = tmp->ring.prev, *next = tmp->ring.next; @@ -1200,14 +1143,9 @@ static void remove_window_from_ring (tmp) -/*********************************************************************** - * - * Procedure: - * HandleDestroyNotify - DestroyNotify event handler - * - *********************************************************************** +/** + * DestroyNotify event handler */ - void HandleDestroyNotify() { @@ -1319,14 +1257,9 @@ HandleCreateNotify() -/*********************************************************************** - * - * Procedure: +/** * HandleMapRequest - MapRequest event handler - * - *********************************************************************** */ - void HandleMapRequest() { @@ -1407,14 +1340,9 @@ void SimulateMapRequest (w) -/*********************************************************************** - * - * Procedure: - * HandleMapNotify - MapNotify event handler - * - *********************************************************************** +/** + * MapNotify event handler */ - void HandleMapNotify() { @@ -1446,14 +1374,9 @@ HandleMapNotify() -/*********************************************************************** - * - * Procedure: - * HandleUnmapNotify - UnmapNotify event handler - * - *********************************************************************** +/** + * UnmapNotify event handler */ - void HandleUnmapNotify() { @@ -1516,14 +1439,9 @@ HandleUnmapNotify() -/*********************************************************************** - * - * Procedure: - * HandleMotionNotify - MotionNotify event handler - * - *********************************************************************** +/** + * MotionNotify event handler */ - void HandleMotionNotify() { @@ -1548,12 +1466,8 @@ HandleMotionNotify() -/*********************************************************************** - * - * Procedure: - * HandleButtonRelease - ButtonRelease event handler - * - *********************************************************************** +/** + * ButtonRelease event handler */ void HandleButtonRelease() @@ -1729,10 +1643,13 @@ HandleButtonRelease() +/** + * + * \param menu menu to pop up + * \param w invoking window, or None + */ static void -do_menu (menu, w) - MenuRoot *menu; /* menu to pop up */ - Window w; /* invoking window or None */ +do_menu (MenuRoot *menu, Window w) { int x = Event.xbutton.x_root; int y = Event.xbutton.y_root; @@ -1758,12 +1675,8 @@ do_menu (menu, w) -/*********************************************************************** - * - * Procedure: - * HandleButtonPress - ButtonPress event handler - * - *********************************************************************** +/** + * ButtonPress event handler */ void HandleButtonPress() @@ -1998,32 +1911,23 @@ HandleButtonPress() -/*********************************************************************** - * - * Procedure: - * HENQueueScanner - EnterNotify event q scanner +/** \fn HENQueueScanner + * EnterNotify event q scanner. * * Looks at the queued events and determines if any matching * LeaveNotify events or EnterEvents deriving from the * termination of a grab are behind this event to allow * skipping of unnecessary processing. - * - *********************************************************************** */ - typedef struct HENScanArgs { - Window w; /* Window we are currently entering */ - Bool leaves; /* Any LeaveNotifies found for this window */ - Bool inferior; /* Was NotifyInferior the mode for LeaveNotify */ - Bool enters; /* Any EnterNotify events with NotifyUngrab */ + Window w; /**< Window we are currently entering */ + Bool leaves; /**< Any LeaveNotifies found for this window */ + Bool inferior; /**< Was NotifyInferior the mode for LeaveNotify */ + Bool enters; /**< Any EnterNotify events with NotifyUngrab */ } HENScanArgs; -/* ARGSUSED*/ static Bool -HENQueueScanner(dpy, ev, args) - Display *dpy; - XEvent *ev; - char *args; +HENQueueScanner(Display *dpy, XEvent *ev, char *args) { if (ev->type == LeaveNotify) { if (ev->xcrossing.window == ((HENScanArgs *) args)->w && @@ -2045,14 +1949,9 @@ HENQueueScanner(dpy, ev, args) -/*********************************************************************** - * - * Procedure: - * HandleEnterNotify - EnterNotify event handler - * - *********************************************************************** +/** + * EnterNotify event handler */ - void HandleEnterNotify() { @@ -2206,30 +2105,22 @@ HandleEnterNotify() -/*********************************************************************** - * - * Procedure: - * HLNQueueScanner - LeaveNotify event q scanner +/** \fn HLNQueueScanner + * LeaveNotify event q scanner. * * Looks at the queued events and determines if any * EnterNotify events are behind this event to allow * skipping of unnecessary processing. - * - *********************************************************************** */ typedef struct HLNScanArgs { - Window w; /* The window getting the LeaveNotify */ - Bool enters; /* Any EnterNotify event at all */ - Bool matches; /* Any matching EnterNotify events */ + Window w; /**< The window getting the LeaveNotify */ + Bool enters; /**< Any EnterNotify event at all */ + Bool matches; /**< Any matching EnterNotify events */ } HLNScanArgs; -/* ARGSUSED*/ static Bool -HLNQueueScanner(dpy, ev, args) - Display *dpy; - XEvent *ev; - char *args; +HLNQueueScanner(Display *dpy, XEvent *ev, char *args) { if (ev->type == EnterNotify && ev->xcrossing.mode != NotifyGrab) { ((HLNScanArgs *) args)->enters = True; @@ -2242,14 +2133,9 @@ HLNQueueScanner(dpy, ev, args) -/*********************************************************************** - * - * Procedure: - * HandleLeaveNotify - LeaveNotify event handler - * - *********************************************************************** +/** + * LeaveNotify event handler */ - void HandleLeaveNotify() { @@ -2322,14 +2208,9 @@ HandleLeaveNotify() -/*********************************************************************** - * - * Procedure: +/** * HandleConfigureRequest - ConfigureRequest event handler - * - *********************************************************************** */ - void HandleConfigureRequest() { @@ -2457,12 +2338,8 @@ HandleConfigureRequest() -/*********************************************************************** - * - * Procedure: - * HandleShapeNotify - shape notification event handler - * - *********************************************************************** +/** + * shape notification event handler */ void HandleShapeNotify () @@ -2483,14 +2360,9 @@ HandleShapeNotify () -/*********************************************************************** - * - * Procedure: - * HandleUnknown - unknown event handler - * - *********************************************************************** +/** + * unknown event handler */ - void HandleUnknown() { @@ -2501,44 +2373,28 @@ HandleUnknown() -/*********************************************************************** - * - * Procedure: - * Transient - checks to see if the window is a transient +/** + * checks to see if the window is a transient. * - * Returned Value: - * TRUE - window is a transient - * FALSE - window is not a transient + * \return TRUE if window is a transient + * \return FALSE if window is not a transient * - * Inputs: - * w - the window to check - * - *********************************************************************** + * \param w the window to check */ - int -Transient(w, propw) - Window w, *propw; +Transient(Window w, Window *propw) { return (XGetTransientForHint(dpy, w, propw)); } -/*********************************************************************** - * - * Procedure: - * FindScreenInfo - get ScreenInfo struct associated with a given window - * - * Returned Value: - * ScreenInfo struct +/** + * get ScreenInfo struct associated with a given window * - * Inputs: - * w - the window - * - *********************************************************************** + * \return ScreenInfo struct + * \param w the window */ - ScreenInfo * FindScreenInfo(w) Window w; @@ -2572,22 +2428,15 @@ static void flush_expose (w) -/*********************************************************************** - * - * Procedure: - * InstallWindowColormaps - install the colormaps for one twm window +/** + * install the colormaps for one twm window. * - * Inputs: - * type - type of event that caused the installation - * tmp - for a subset of event types, the address of the + * \param type type of event that caused the installation + * \param tmp for a subset of event types, the address of the * window structure, whose colormaps are to be installed. - * - *********************************************************************** */ void -InstallWindowColormaps (type, tmp) - int type; - TwmWindow *tmp; +InstallWindowColormaps (int type, TwmWindow *tmp) { int i, j, n, number_cwins, state; ColormapWindow **cwins, *cwin, **maxcwin = NULL; @@ -2676,10 +2525,10 @@ InstallWindowColormaps (type, tmp) -/*********************************************************************** +/** \fn InstallRootColormap + * \fn UninstallRootColormap * - * Procedures: - * <Uni/I>nstallRootColormap - Force (un)loads root colormap(s) + * Force (un)loads root colormap(s) * * These matching routines provide a mechanism to insure that * the root colormap(s) is installed during operations like @@ -2692,7 +2541,6 @@ InstallWindowColormaps (type, tmp) * which would otherwise have be loaded to be loaded, unless * Enter or Leave Notify events are queued, indicating some * other colormap list would potentially be loaded anyway. - *********************************************************************** */ void InstallRootColormap() @@ -2713,12 +2561,8 @@ InstallRootColormap() -/* ARGSUSED*/ static Bool -UninstallRootColormapQScanner(dpy, ev, args) - Display *dpy; - XEvent *ev; - char *args; +UninstallRootColormapQScanner(Display *dpy, XEvent *ev, char *args) { if (!*args) { if (ev->type == EnterNotify) { @@ -2759,8 +2603,7 @@ UninstallRootColormap() #ifdef TRACE void -dumpevent (e) - XEvent *e; +dumpevent (XEvent *e) { char *name = NULL; @@ -24,30 +24,30 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ -/** Salt Lake City, Utah **/ -/** Cambridge, Massachusetts **/ -/** **/ -/** All Rights Reserved **/ -/** **/ -/** Permission to use, copy, modify, and distribute this software and **/ -/** its documentation for any purpose and without fee is hereby **/ -/** granted, provided that the above copyright notice appear in all **/ -/** copies and that both that copyright notice and this permis- **/ -/** sion notice appear in supporting documentation, and that the **/ -/** name of Evans & Sutherland not be used in advertising **/ -/** in publicity pertaining to distribution of the software without **/ -/** specific, written prior permission. **/ -/** **/ -/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ -/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ -/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ -/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ -/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ -/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ -/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ -/** OR PERFORMANCE OF THIS SOFTWARE. **/ -/*****************************************************************************/ +/* Copyright 1988 by Evans & Sutherland Computer Corporation, */ +/* Salt Lake City, Utah */ +/* Cambridge, Massachusetts */ +/* */ +/* All Rights Reserved */ +/* */ +/* Permission to use, copy, modify, and distribute this software and */ +/* its documentation for any purpose and without fee is hereby */ +/* granted, provided that the above copyright notice appear in all */ +/* copies and that both that copyright notice and this permis- */ +/* sion notice appear in supporting documentation, and that the */ +/* name of Evans & Sutherland not be used in advertising */ +/* in publicity pertaining to distribution of the software without */ +/* specific, written prior permission. */ +/* */ +/* EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD */ +/* TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- */ +/* ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND */ +/* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- */ +/* AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA */ +/* OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER */ +/* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE */ +/* OR PERFORMANCE OF THIS SOFTWARE. */ +/*********************************************************************(*****/ /* $XFree86: xc/programs/twm/gc.c,v 1.5 2001/01/17 23:45:06 dawes Exp $ */ @@ -67,15 +67,10 @@ in this Software without prior written authorization from The Open Group. #include "screen.h" #include "gc.h" -/*********************************************************************** - * - * Procedure: - * CreateGCs - open fonts and create all the needed GC's. I only +/** \fn CreateGCs + * open fonts and create all the needed GC's. I only * want to do this once, hence the first_time flag. - * - *********************************************************************** */ - void CreateGCs() { @@ -751,9 +751,7 @@ RemoveDQuote(char *str) *o = '\0'; } -static MenuRoot *GetRoot(name, fore, back) -char *name; -char *fore, *back; +static MenuRoot *GetRoot(char *name, char* fore, char *back) { MenuRoot *tmp; @@ -775,8 +773,7 @@ char *fore, *back; return tmp; } -static void GotButton(butt, func) -int butt, func; +static void GotButton(int butt, int func) { int i; @@ -805,9 +802,7 @@ int butt, func; mods = 0; } -static void GotKey(key, func) -char *key; -int func; +static void GotKey(char *key, int func) { int i; @@ -827,10 +822,7 @@ int func; } -static void GotTitleButton (bitmapname, func, rightside) - char *bitmapname; - int func; - Bool rightside; +static void GotTitleButton (char *bitmapname, int func, Bool rightside) { if (!CreateTitleButton (bitmapname, func, Action, pull, rightside, True)) { twmrc_error_prefix(); @@ -842,8 +834,7 @@ static void GotTitleButton (bitmapname, func, rightside) pull = NULL; } -static Bool CheckWarpScreenArg (s) - register char *s; +static Bool CheckWarpScreenArg (char *s) { XmuCopyISOLatin1Lowered (s, s); @@ -857,8 +848,7 @@ static Bool CheckWarpScreenArg (s) } -static Bool CheckWarpRingArg (s) - register char *s; +static Bool CheckWarpRingArg (char *s) { XmuCopyISOLatin1Lowered (s, s); @@ -870,8 +860,7 @@ static Bool CheckWarpRingArg (s) } -static Bool CheckColormapArg (s) - register char *s; +static Bool CheckColormapArg (char *s) { XmuCopyISOLatin1Lowered (s, s); diff --git a/src/iconmgr.c b/src/iconmgr.c index edb5489..b90b665 100644 --- a/src/iconmgr.c +++ b/src/iconmgr.c @@ -55,21 +55,9 @@ WList *DownIconManager = NULL; int iconifybox_width = siconify_width; int iconifybox_height = siconify_height; -/*********************************************************************** - * - * Procedure: - * CreateIconManagers - creat all the icon manager windows - * for this screen. - * - * Returned Value: - * none - * - * Inputs: - * none - * - *********************************************************************** +/** + * create all the icon manager windows for this screen. */ - void CreateIconManagers() { IconMgr *p; @@ -128,25 +116,15 @@ void CreateIconManagers() } } -/*********************************************************************** - * - * Procedure: - * AllocateIconManager - allocate a new icon manager - * - * Inputs: - * name - the name of this icon manager - * icon_name - the name of the associated icon - * geom - a geometry string to eventually parse - * columns - the number of columns this icon manager has +/** + * allocate a new icon manager * - *********************************************************************** + * \param name the name of this icon manager + * \param con_name the name of the associated icon + * \param geom a geometry string to eventually parse + * \param columns the number of columns this icon manager has */ - -IconMgr *AllocateIconManager(name, icon_name, geom, columns) - char *name; - char *geom; - char *icon_name; - int columns; +IconMgr *AllocateIconManager(char *name, char *icon_name, char *geom, int columns) { IconMgr *p; @@ -182,28 +160,18 @@ IconMgr *AllocateIconManager(name, icon_name, geom, columns) return(p); } -/*********************************************************************** +/** + * move the pointer around in an icon manager * - * Procedure: - * MoveIconManager - move the pointer around in an icon manager - * - * Inputs: - * dir - one of the following: - * F_FORWICONMGR - forward in the window list - * F_BACKICONMGR - backward in the window list - * F_UPICONMGR - up one row - * F_DOWNICONMGR - down one row - * F_LEFTICONMGR - left one column - * F_RIGHTICONMGR - right one column - * - * Special Considerations: - * none - * - *********************************************************************** + * \param dir one of the following: + * - F_FORWICONMGR: forward in the window list + * - F_BACKICONMGR: backward in the window list + * - F_UPICONMGR: up one row + * - F_DOWNICONMG: down one row + * - F_LEFTICONMGR: left one column + * - F_RIGHTICONMGR: right one column */ - -void MoveIconManager(dir) - int dir; +void MoveIconManager(int dir) { IconMgr *ip; WList *tmp = NULL; @@ -313,22 +281,14 @@ void MoveIconManager(dir) } } -/*********************************************************************** - * - * Procedure: - * JumpIconManager - jump from one icon manager to another, - * possibly even on another screen - * - * Inputs: - * dir - one of the following: - * F_NEXTICONMGR - go to the next icon manager - * F_PREVICONMGR - go to the previous one - * - *********************************************************************** +/** + * jump from one icon manager to another, possibly even on another screen + * \param dir one of the following: + * - F_NEXTICONMGR - go to the next icon manager + * - F_PREVICONMGR - go to the previous one */ -void JumpIconManager(dir) - register int dir; +void JumpIconManager(int dir) { IconMgr *ip, *tmp_ip = NULL; int got_it = FALSE; @@ -385,19 +345,12 @@ void JumpIconManager(dir) XWarpPointer(dpy, None, tmp_ip->w, 0,0,0,0, 5, 5); } -/*********************************************************************** +/** + * add a window to an icon manager * - * Procedure: - * AddIconManager - add a window to an icon manager - * - * Inputs: - * tmp_win - the TwmWindow structure - * - *********************************************************************** + * \param tmp_win the TwmWindow structure */ - -WList *AddIconManager(tmp_win) - TwmWindow *tmp_win; +WList *AddIconManager(TwmWindow *tmp_win) { WList *tmp; int h; @@ -498,23 +451,13 @@ WList *AddIconManager(tmp_win) return (tmp); } -/*********************************************************************** - * - * Procedure: - * InsertInIconManager - put an allocated entry into an icon - * manager - * - * Inputs: - * ip - the icon manager pointer - * tmp - the entry to insert +/** + * put an allocated entry into an icon manager * - *********************************************************************** + * \param ip the icon manager pointer + * \param tmp the entry to insert */ - -void InsertInIconManager(ip, tmp, tmp_win) - IconMgr *ip; - WList *tmp; - TwmWindow *tmp_win; +void InsertInIconManager(IconMgr *ip, WList *tmp, TwmWindow *tmp_win) { WList *tmp1; int added; @@ -556,9 +499,7 @@ void InsertInIconManager(ip, tmp, tmp_win) } } -void RemoveFromIconManager(ip, tmp) - IconMgr *ip; - WList *tmp; +void RemoveFromIconManager(IconMgr *ip, WList *tmp) { if (tmp->prev == NULL) ip->first = tmp->next; @@ -571,19 +512,11 @@ void RemoveFromIconManager(ip, tmp) tmp->next->prev = tmp->prev; } -/*********************************************************************** - * - * Procedure: - * RemoveIconManager - remove a window from the icon manager - * - * Inputs: - * tmp_win - the TwmWindow structure - * - *********************************************************************** +/** + * remove a window from the icon manager + * \param tmp_win the TwmWindow structure */ - -void RemoveIconManager(tmp_win) - TwmWindow *tmp_win; +void RemoveIconManager(TwmWindow *tmp_win) { IconMgr *ip; WList *tmp; @@ -616,8 +549,7 @@ void RemoveIconManager(tmp_win) } -void ActiveIconManager(active) - WList *active; +void ActiveIconManager(WList *active) { active->active = TRUE; Active = active; @@ -625,15 +557,13 @@ void ActiveIconManager(active) DrawIconManagerBorder(active); } -void NotActiveIconManager(active) - WList *active; +void NotActiveIconManager(WList *active) { active->active = FALSE; DrawIconManagerBorder(active); } -void DrawIconManagerBorder(tmp) - WList *tmp; +void DrawIconManagerBorder(WList *tmp) { { XSetForeground(dpy, Scr->NormalGC, tmp->fore); @@ -652,19 +582,12 @@ void DrawIconManagerBorder(tmp) } } -/*********************************************************************** +/** + * sort The Dude * - * Procedure: - * SortIconManager - sort the dude - * - * Inputs: - * ip - a pointer to the icon manager struture - * - *********************************************************************** + * \param ip a pointer to the icon manager struture */ - -void SortIconManager(ip) - IconMgr *ip; +void SortIconManager(IconMgr *ip) { WList *tmp1, *tmp2; int done; @@ -697,20 +620,13 @@ void SortIconManager(ip) PackIconManager(ip); } -/*********************************************************************** - * - * Procedure: - * PackIconManager - pack the icon manager windows following +/** + * pack the icon manager windows following * an addition or deletion * - * Inputs: - * ip - a pointer to the icon manager struture - * - *********************************************************************** + * \param ip a pointer to the icon manager struture */ - -void PackIconManager(ip) - IconMgr *ip; +void PackIconManager(IconMgr *ip) { int newwidth, i, row, col, maxcol, colinc, rowinc, wheight, wwidth; int new_x, new_y; diff --git a/src/icons.c b/src/icons.c index 95c786f..be0410d 100644 --- a/src/icons.c +++ b/src/icons.c @@ -51,10 +51,7 @@ static IconEntry * prevIconEntry ( IconEntry *ie, IconRegion *ir ); static void mergeEntries ( IconEntry *old, IconEntry *ie ); static void -splitEntry (ie, grav1, grav2, w, h) - IconEntry *ie; - int grav1, grav2; - int w, h; +splitEntry (IconEntry *ie, int grav1, int grav2, int w, int h) { IconEntry *new; @@ -111,10 +108,7 @@ roundUp (int v, int multiple) } void -PlaceIcon(tmp_win, def_x, def_y, final_x, final_y) - TwmWindow *tmp_win; - int def_x, def_y; - int *final_x, *final_y; +PlaceIcon(TwmWindow *tmp_win, int def_x, int def_y, int *final_x, int *final_y) { IconRegion *ir; IconEntry *ie; @@ -147,9 +141,7 @@ PlaceIcon(tmp_win, def_x, def_y, final_x, final_y) } static IconEntry * -FindIconEntry (tmp_win, irp) - TwmWindow *tmp_win; - IconRegion **irp; +FindIconEntry (TwmWindow *tmp_win, IconRegion **irp) { IconRegion *ir; IconEntry *ie; @@ -166,8 +158,7 @@ FindIconEntry (tmp_win, irp) } void -IconUp (tmp_win) - TwmWindow *tmp_win; +IconUp (TwmWindow *tmp_win) { int x, y; int defx, defy; @@ -207,9 +198,7 @@ IconUp (tmp_win) } static IconEntry * -prevIconEntry (ie, ir) - IconEntry *ie; - IconRegion *ir; +prevIconEntry (IconEntry *ie, IconRegion *ir) { IconEntry *ip; @@ -220,13 +209,12 @@ prevIconEntry (ie, ir) return ip; } -/* old is being freed; and is adjacent to ie. Merge +/** + * old is being freed; and is adjacent to ie. Merge * regions together */ - static void -mergeEntries (old, ie) - IconEntry *old, *ie; +mergeEntries (IconEntry *old, IconEntry *ie) { if (old->y == ie->y) { ie->w = old->w + ie->w; @@ -240,8 +228,7 @@ mergeEntries (old, ie) } void -IconDown (tmp_win) - TwmWindow *tmp_win; +IconDown (TwmWindow *tmp_win) { IconEntry *ie, *ip, *in; IconRegion *ir; @@ -277,10 +264,7 @@ IconDown (tmp_win) } void -AddIconRegion(geom, grav1, grav2, stepx, stepy) -char *geom; -int grav1, grav2; -int stepx, stepy; +AddIconRegion(char *geom, int grav1, int grav2, int stepx, int stepy) { IconRegion *ir; int mask; @@ -323,8 +307,7 @@ int stepx, stepy; #ifdef comment void -FreeIconEntries (ir) - IconRegion *ir; +FreeIconEntries (IconRegion *ir) { IconEntry *ie, *tmp; @@ -353,9 +336,7 @@ FreeIconRegions() #endif void -CreateIconWindow(tmp_win, def_x, def_y) - TwmWindow *tmp_win; - int def_x, def_y; +CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y) { unsigned long event_mask; unsigned long valuemask; /* mask for create windows */ @@ -70,35 +70,25 @@ in this Software without prior written authorization from The Open Group. struct name_list_struct { - name_list *next; /* pointer to the next name */ - char *name; /* the name of the window */ - char *ptr; /* list dependent data */ + name_list *next; /**< pointer to the next name */ + char *name; /**< the name of the window */ + char *ptr; /**< list dependent data */ }; -/*********************************************************************** +/** + * add a window name to the appropriate list. * - * Procedure: - * AddToList - add a window name to the appropriate list - * - * Inputs: - * list - the address of the pointer to the head of a list - * name - a pointer to the name of the window - * ptr - pointer to list dependent data - * - * Special Considerations * If the list does not use the ptr value, a non-null value * should be placed in it. LookInList returns this ptr value * and procedures calling LookInList will check for a non-null * return value as an indication of success. * - *********************************************************************** + * \param list the address of the pointer to the head of a list + * \param name a pointer to the name of the window + * \param ptr pointer to list dependent data */ - void -AddToList(list_head, name, ptr) -name_list **list_head; -char *name; -char *ptr; +AddToList(name_list **list_head, char *name, char *ptr) { name_list *nptr; @@ -119,28 +109,18 @@ char *ptr; *list_head = nptr; } -/*********************************************************************** - * - * Procedure: - * LookInList - look through a list for a window name, or class +/** + * look through a list for a window name, or class * - * Returned Value: - * the ptr field of the list structure or NULL if the name + * \return the ptr field of the list structure or NULL if the name * or class was not found in the list * - * Inputs: - * list - a pointer to the head of a list - * name - a pointer to the name to look for - * class - a pointer to the class to look for - * - *********************************************************************** + * \param list a pointer to the head of a list + * \param name a pointer to the name to look for + * \param class a pointer to the class to look for */ - char * -LookInList(list_head, name, class) -name_list *list_head; -char *name; -XClassHint *class; +LookInList(name_list *list_head, char *name, XClassHint *class) { name_list *nptr; @@ -165,38 +145,24 @@ XClassHint *class; } char * -LookInNameList(list_head, name) -name_list *list_head; -char *name; +LookInNameList(name_list *list_head, char *name) { return (LookInList(list_head, name, NULL)); } -/*********************************************************************** - * - * Procedure: - * GetColorFromList - look through a list for a window name, or class +/** + * look through a list for a window name, or class * - * Returned Value: - * TRUE if the name was found - * FALSE if the name was not found + * \return TRUE if the name was found + * \return FALSE if the name was not found * - * Inputs: - * list - a pointer to the head of a list - * name - a pointer to the name to look for - * class - a pointer to the class to look for - * - * Outputs: - * ptr - fill in the list value if the name was found - * - *********************************************************************** + * \param list a pointer to the head of a list + * \param name a pointer to the name to look for + * \param class a pointer to the class to look for + * \param[out] ptr fill in the list value if the name was found */ - -int GetColorFromList(list_head, name, class, ptr) -name_list *list_head; -char *name; -XClassHint *class; -Pixel *ptr; +int GetColorFromList(name_list *list_head, char *name, XClassHint *class, + Pixel *ptr) { int save; name_list *nptr; @@ -236,16 +202,10 @@ Pixel *ptr; return (FALSE); } -/*********************************************************************** - * - * Procedure: - * FreeList - free up a list - * - *********************************************************************** +/** + * free up a list */ - -void FreeList(list) -name_list **list; +void FreeList(name_list **list) { name_list *nptr; name_list *tmp; diff --git a/src/menus.c b/src/menus.c index 0073976..20c9b86 100644 --- a/src/menus.c +++ b/src/menus.c @@ -83,13 +83,13 @@ in this Software without prior written authorization from The Open Group. #include <X11/SM/SMlib.h> int RootFunction = 0; -MenuRoot *ActiveMenu = NULL; /* the active menu */ -MenuItem *ActiveItem = NULL; /* the active menu item */ -int MoveFunction; /* either F_MOVE or F_FORCEMOVE */ +MenuRoot *ActiveMenu = NULL; /**< the active menu */ +MenuItem *ActiveItem = NULL; /**< the active menu item */ +int MoveFunction; /**< either F_MOVE or F_FORCEMOVE */ int WindowMoved = FALSE; int menuFromFrameOrWindowOrTitlebar = FALSE; -int ConstMove = FALSE; /* constrained move variables */ +int ConstMove = FALSE; /**< constrained move variables */ int ConstMoveDir; int ConstMoveX; int ConstMoveY; @@ -103,7 +103,7 @@ int ConstMoveYB; int ResizeOrigX; int ResizeOrigY; -int MenuDepth = 0; /* number of menus up */ +int MenuDepth = 0; /**< number of menus up */ static struct { int x; int y; @@ -119,14 +119,9 @@ static void send_clientmessage ( Window w, Atom a, Time timestamp ); -/*********************************************************************** - * - * Procedure: - * InitMenus - initialize menu roots - * - *********************************************************************** +/** + * initialize menu roots */ - void InitMenus() { @@ -160,27 +155,18 @@ InitMenus() -/*********************************************************************** +/** + * add a function key to the list * - * Procedure: - * AddFuncKey - add a function key to the list - * - * Inputs: - * name - the name of the key - * cont - the context to look for the key press in - * mods - modifier keys that need to be pressed - * func - the function to perform - * win_name- the window name (if any) - * action - the action string associated with the function (if any) - * - *********************************************************************** + * \param name the name of the key + * \param cont the context to look for the key press in + * \param mods modifier keys that need to be pressed + * \param func the function to perform + * \param win_name the window name (if any) + * \param action the action string associated with the function (if any) */ - -Bool AddFuncKey (name, cont, mods, func, win_name, action) - char *name; - int cont, mods, func; - char *win_name; - char *action; +Bool AddFuncKey (char *name, int cont, int mods, int func, char *win_name, + char *action) { FuncKey *tmp; KeySym keysym; @@ -226,13 +212,8 @@ Bool AddFuncKey (name, cont, mods, func, win_name, action) -int CreateTitleButton (name, func, action, menuroot, rightside, append) - char *name; - int func; - char *action; - MenuRoot *menuroot; - Bool rightside; - Bool append; +int CreateTitleButton (char *name, int func, char *action, MenuRoot *menuroot, + Bool rightside, Bool append) { TitleButton *tb = (TitleButton *) malloc (sizeof(TitleButton)); @@ -296,11 +277,10 @@ int CreateTitleButton (name, func, action, menuroot, rightside, append) -/* - * InitTitlebarButtons - Do all the necessary stuff to load in a titlebar - * button. If we can't find the button, then put in a question; if we can't - * find the question mark, something is wrong and we are probably going to be - * in trouble later on. +/** + * Do all the necessary stuff to load in a titlebar button. If we can't find + * the button, then put in a question; if we can't find the question mark, + * something is wrong and we are probably going to be in trouble later on. */ void InitTitlebarButtons () { @@ -371,11 +351,9 @@ void InitTitlebarButtons () } + void -PaintEntry(mr, mi, exposure) -MenuRoot *mr; -MenuItem *mi; -int exposure; +PaintEntry(MenuRoot *mr, MenuItem *mi, int exposure) { int y_offset; int text_y; @@ -468,9 +446,7 @@ int exposure; void -PaintMenu(mr, e) -MenuRoot *mr; -XEvent *e; +PaintMenu(MenuRoot *mr, XEvent *e) { MenuItem *mi; @@ -629,23 +605,13 @@ UpdateMenu() -/*********************************************************************** - * - * Procedure: - * NewMenuRoot - create a new menu root - * - * Returned Value: - * (MenuRoot *) - * - * Inputs: - * name - the name of the menu root +/** + * create a new menu root * - *********************************************************************** + * \param name the name of the menu root */ - MenuRoot * -NewMenuRoot(name) - char *name; +NewMenuRoot(char *name) { MenuRoot *tmp; @@ -692,33 +658,20 @@ NewMenuRoot(name) -/*********************************************************************** - * - * Procedure: - * AddToMenu - add an item to a root menu - * - * Returned Value: - * (MenuItem *) +/** + * add an item to a root menu * - * Inputs: - * menu - pointer to the root menu to add the item - * item - the text to appear in the menu - * action - the string to possibly execute - * sub - the menu root if it is a pull-right entry - * func - the numeric function - * fore - foreground color string - * back - background color string - * - *********************************************************************** + * \param menu pointer to the root menu to add the item + * \param item the text to appear in the menu + * \param action the string to possibly execute + * \param sub the menu root if it is a pull-right entry + * \param func the numeric function + * \param fore foreground color string + * \param back background color string */ - MenuItem * -AddToMenu(menu, item, action, sub, func, fore, back) - MenuRoot *menu; - char *item, *action; - MenuRoot *sub; - int func; - char *fore, *back; +AddToMenu(MenuRoot *menu, char *item, char *action, MenuRoot *sub, int func, + char *fore, char *back) { MenuItem *tmp; int width; @@ -797,8 +750,7 @@ MakeMenus() void -MakeMenu(mr) -MenuRoot *mr; +MakeMenu(MenuRoot *mr) { MenuItem *start, *end, *cur, *tmp; XColor f1, f2, f3; @@ -989,24 +941,15 @@ MenuRoot *mr; -/*********************************************************************** - * - * Procedure: - * PopUpMenu - pop up a pull down menu - * - * Inputs: - * menu - the root pointer of the menu to pop up - * x, y - location of upper left of menu - * center - whether or not to center horizontally over position +/** + * pop up a pull down menu. * - *********************************************************************** + * \param menu the root pointer of the menu to pop up + * \param x,y location of upper left of menu + * \param center whether or not to center horizontally over position */ - Bool -PopUpMenu (menu, x, y, center) - MenuRoot *menu; - int x, y; - Bool center; +PopUpMenu (MenuRoot *menu, int x, int y, Bool center) { int WindowNameCount; TwmWindow **WindowNames; @@ -1129,13 +1072,8 @@ PopUpMenu (menu, x, y, center) -/*********************************************************************** - * - * Procedure: - * PopDownMenu - unhighlight the current menu selection and - * take down the menus - * - *********************************************************************** +/** + * unhighlight the current menu selection and take down the menus */ void PopDownMenu() @@ -1171,23 +1109,15 @@ PopDownMenu() -/*********************************************************************** - * - * Procedure: - * FindMenuRoot - look for a menu root - * - * Returned Value: - * (MenuRoot *) - a pointer to the menu root structure +/** + * look for a menu root * - * Inputs: - * name - the name of the menu root + * \return a pointer to the menu root structure * - *********************************************************************** + * \param name the name of the menu root */ - MenuRoot * -FindMenuRoot(name) - char *name; +FindMenuRoot(char *name) { MenuRoot *tmp; @@ -1202,9 +1132,7 @@ FindMenuRoot(name) static Bool -belongs_to_twm_window (t, w) - register TwmWindow *t; - register Window w; +belongs_to_twm_window (TwmWindow *t, Window w) { if (!t) return False; @@ -1223,20 +1151,8 @@ belongs_to_twm_window (t, w) - -/*********************************************************************** - * - * Procedure: - * resizeFromCenter - - * - *********************************************************************** - */ - - void -resizeFromCenter(w, tmp_win) - Window w; - TwmWindow *tmp_win; +resizeFromCenter(Window w, TwmWindow *tmp_win) { int lastx, lasty, bw2; XEvent event; @@ -1328,52 +1244,37 @@ resizeFromCenter(w, tmp_win) -/*********************************************************************** +/** \fn ExecureFunction + * execute a twm root function. * - * Procedure: - * ExecuteFunction - execute a twm root function + * \param func the function to execute + * \param action the menu action to execute + * \param w the window to execute this function on + * \param tmp_win the twm window structure + * \param event the event that caused the function + * \param context the context in which the button was pressed + * \param pulldown flag indicating execution from pull down menu * - * Inputs: - * func - the function to execute - * action - the menu action to execute - * w - the window to execute this function on - * tmp_win - the twm window structure - * event - the event that caused the function - * context - the context in which the button was pressed - * pulldown- flag indicating execution from pull down menu - * - * Returns: - * TRUE if should continue with remaining actions else FALSE to abort - * - *********************************************************************** + * \return TRUE if should continue with remaining actions, + * else FALSE to abort */ -/* for F_WARPTO */ -#define true 1 -#define false 0 int -WarpThere(t) - TwmWindow* t; +WarpThere(TwmWindow *t) { if (Scr->WarpUnmapped || t->mapped) { if (!t->mapped) DeIconify (t); if (!Scr->NoRaiseWarp) XRaiseWindow (dpy, t->frame); WarpToWindow (t); - return true; + return 1; } - return false; + return 0; } int -ExecuteFunction(func, action, w, tmp_win, eventp, context, pulldown) - int func; - char *action; - Window w; - TwmWindow *tmp_win; - XEvent *eventp; - int context; - int pulldown; +ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, + XEvent *eventp, int context, int pulldown) { static Time last_time = 0; char tmp[200]; @@ -2334,24 +2235,16 @@ ExecuteFunction(func, action, w, tmp_win, eventp, context, pulldown) -/*********************************************************************** - * - * Procedure: - * DeferExecution - defer the execution of a function to the - * next button press if the context is C_ROOT +/** + * defer the execution of a function to the next button press if the context + * is C_ROOT * - * Inputs: - * context - the context in which the mouse button was pressed - * func - the function to defer - * cursor - the cursor to display while waiting - * - *********************************************************************** + * \param context the context in which the mouse button was pressed + * \param func the function to defer + * \param cursor cursor the cursor to display while waiting */ - int -DeferExecution(context, func, cursor) -int context, func; -Cursor cursor; +DeferExecution(int context, int func, Cursor cursor) { if (context == C_ROOT) { @@ -2371,12 +2264,8 @@ Cursor cursor; -/*********************************************************************** - * - * Procedure: - * ReGrab - regrab the pointer with the LastCursor; - * - *********************************************************************** +/** + *regrab the pointer with the LastCursor; */ void ReGrab() @@ -2389,20 +2278,14 @@ ReGrab() -/*********************************************************************** - * - * Procedure: - * NeedToDefer - checks each function in the list to see if it - * is one that needs to be defered. +/** + * checks each function in the list to see if it is one that needs + * to be deferred. * - * Inputs: - * root - the menu root to check - * - *********************************************************************** + * \param root the menu root to check */ Bool -NeedToDefer(root) -MenuRoot *root; +NeedToDefer(MenuRoot *root) { MenuItem *mitem; @@ -2438,21 +2321,14 @@ MenuRoot *root; -/*********************************************************************** - * - * Procedure: - * Execute - execute the string by /bin/sh - * - * Inputs: - * s - the string containing the command - * - *********************************************************************** - */ - #if defined(sun) && defined(SVR4) + +/** + * execute the string by /bin/sh + * \param s the string containing the command + */ static int -System (s) - char *s; +System (char *s) { int pid, status; if ((pid = fork ()) == 0) { @@ -2463,12 +2339,13 @@ System (s) return status; } #define system(s) System(s) + #endif void -Execute(s) - char *s; +Execute(char *s) { + /* FIXME: is all this stuff needed? There could be security problems here. */ static char buf[256]; char *ds = DisplayString (dpy); char *colon, *dot1; @@ -2509,14 +2386,9 @@ Execute(s) -/*********************************************************************** - * - * Procedure: - * FocusOnRoot - put input focus on the root window - * - *********************************************************************** +/** + * put input focus on the root window. */ - void FocusOnRoot() { @@ -2532,8 +2404,7 @@ FocusOnRoot() } void -DeIconify(tmp_win) -TwmWindow *tmp_win; +DeIconify(TwmWindow *tmp_win) { TwmWindow *t; @@ -2609,10 +2480,9 @@ TwmWindow *tmp_win; } + void -Iconify(tmp_win, def_x, def_y) -TwmWindow *tmp_win; -int def_x, def_y; +Iconify(TwmWindow *tmp_win, int def_x, int def_y) { TwmWindow *t; int iconify; @@ -2704,8 +2574,7 @@ int def_x, def_y; static void -Identify (t) - TwmWindow *t; +Identify (TwmWindow *t) { int i, n, twidth, width, height; int x, y; @@ -2775,9 +2644,7 @@ Identify (t) void -SetMapStateProp(tmp_win, state) - TwmWindow *tmp_win; - int state; +SetMapStateProp(TwmWindow *tmp_win, int state) { unsigned long data[2]; /* "suggested" by ICCCM version 1 */ @@ -2792,10 +2659,7 @@ SetMapStateProp(tmp_win, state) Bool -GetWMState (w, statep, iwp) - Window w; - int *statep; - Window *iwp; +GetWMState (Window w, int *statep, Window *iwp) { Atom actual_type; int actual_format; @@ -2820,8 +2684,7 @@ GetWMState (w, statep, iwp) void -WarpToScreen (n, inc) - int n, inc; +WarpToScreen (int n, int inc) { Window dumwin; int x, y, dumint; @@ -2861,13 +2724,11 @@ WarpToScreen (n, inc) -/* - * BumpWindowColormap - rotate our internal copy of WM_COLORMAP_WINDOWS +/** + * rotate our internal copy of WM_COLORMAP_WINDOWS */ void -BumpWindowColormap (tmp, inc) - TwmWindow *tmp; - int inc; +BumpWindowColormap (TwmWindow *tmp, int inc) { int i, j, previously_installed; ColormapWindow **cwins; @@ -2924,9 +2785,7 @@ HideIconManager () void -SetBorder (tmp, onoroff) - TwmWindow *tmp; - Bool onoroff; +SetBorder (TwmWindow *tmp, Bool onoroff) { if (tmp->highlight) { if (onoroff) { @@ -2943,8 +2802,7 @@ SetBorder (tmp, onoroff) void -DestroyMenu (menu) - MenuRoot *menu; +DestroyMenu (MenuRoot *menu) { MenuItem *item; @@ -2967,10 +2825,9 @@ DestroyMenu (menu) /* * warping routines */ + void -WarpAlongRing (ev, forward) - XButtonEvent *ev; - Bool forward; +WarpAlongRing (XButtonEvent *ev, Bool forward) { TwmWindow *r, *head; @@ -3016,8 +2873,7 @@ WarpAlongRing (ev, forward) void -WarpToWindow (t) - TwmWindow *t; +WarpToWindow (TwmWindow *t) { int x, y; @@ -3047,10 +2903,7 @@ WarpToWindow (t) * data[1] time stamp */ static void -send_clientmessage (w, a, timestamp) - Window w; - Atom a; - Time timestamp; +send_clientmessage (Window w, Atom a, Time timestamp) { XClientMessageEvent ev; @@ -3064,25 +2917,19 @@ send_clientmessage (w, a, timestamp) } void -SendDeleteWindowMessage (tmp, timestamp) - TwmWindow *tmp; - Time timestamp; +SendDeleteWindowMessage (TwmWindow *tmp, Time timestamp) { send_clientmessage (tmp->w, _XA_WM_DELETE_WINDOW, timestamp); } void -SendSaveYourselfMessage (tmp, timestamp) - TwmWindow *tmp; - Time timestamp; +SendSaveYourselfMessage (TwmWindow *tmp, Time timestamp) { send_clientmessage (tmp->w, _XA_WM_SAVE_YOURSELF, timestamp); } void -SendTakeFocusMessage (tmp, timestamp) - TwmWindow *tmp; - Time timestamp; +SendTakeFocusMessage (TwmWindow *tmp, Time timestamp) { send_clientmessage (tmp->w, _XA_WM_TAKE_FOCUS, timestamp); } diff --git a/src/parse.c b/src/parse.c index 6e6915e..3f8d801 100644 --- a/src/parse.c +++ b/src/parse.c @@ -98,21 +98,11 @@ int ConstrainedMoveTime = 400; /* milliseconds, event times */ int (*twmInputFunc)(void); -/*********************************************************************** - * - * Procedure: - * ParseTwmrc - parse the .twmrc file - * - * Inputs: - * filename - the filename to parse. A NULL indicates $HOME/.twmrc - * - *********************************************************************** +/** + * parse the .twmrc file + * \param filename the filename to parse. NULL indicates $HOME/.twmrc */ - -static int doparse (ifunc, srctypename, srcname) - int (*ifunc)(void); - char *srctypename; - char *srcname; +static int doparse (int (*ifunc)(void), char *srctypename, char*srcname) { mods = 0; ptr = 0; @@ -168,8 +158,7 @@ static int doparse (ifunc, srctypename, srcname) } -int ParseTwmrc (filename) - char *filename; +int ParseTwmrc (char *filename) { int i; char *home = NULL; @@ -235,8 +224,7 @@ int ParseTwmrc (filename) } } -int ParseStringList (sl) - char **sl; +int ParseStringList (char **sl) { stringListSource = sl; currentString = *sl; @@ -244,17 +232,11 @@ int ParseStringList (sl) } -/*********************************************************************** +/** + * redefinition of the lex input routine for file input * - * Procedure: - * twmFileInput - redefinition of the lex input routine for file input - * - * Returned Value: - * the next input character - * - *********************************************************************** + * \return the next input character */ - static int twmFileInput() { if (overflowlen) return (int) overflowbuff[--overflowlen]; @@ -288,19 +270,12 @@ static int twmStringListInput() } -/*********************************************************************** - * - * Procedure: - * twmUnput - redefinition of the lex unput routine - * - * Inputs: - * c - the character to push back onto the input stream +/* + * redefinition of the lex unput routine * - *********************************************************************** + * \param c the character to push back onto the input stream */ - -void twmUnput (c) - int c; +void twmUnput (int c) { if (overflowlen < sizeof overflowbuff) { overflowbuff[overflowlen++] = (unsigned char) c; @@ -312,29 +287,21 @@ void twmUnput (c) } -/*********************************************************************** - * - * Procedure: - * TwmOutput - redefinition of the lex output routine - * - * Inputs: - * c - the character to print +/** + * redefinition of the lex output routine * - *********************************************************************** + * \param c the character to print */ void -TwmOutput(c) - int c; +TwmOutput(int c) { putchar(c); } /********************************************************************** - * * Parsing table and routines - * ***********************************************************************/ typedef struct _TwmKeyword { @@ -625,9 +592,7 @@ static TwmKeyword keytable[] = { static int numkeywords = (sizeof(keytable)/sizeof(keytable[0])); -int parse_keyword (s, nump) - char *s; - int *nump; +int parse_keyword (char *s, int *nump) { register int lower = 0, upper = numkeywords - 1; @@ -655,8 +620,7 @@ int parse_keyword (s, nump) * action routines called by grammar */ -int do_single_keyword (keyword) - int keyword; +int do_single_keyword (int keyword) { switch (keyword) { case kw0_NoDefaults: @@ -764,9 +728,7 @@ int do_single_keyword (keyword) } -int do_string_keyword (keyword, s) - int keyword; - char *s; +int do_string_keyword (int keyword, char *s) { switch (keyword) { case kws_UsePPosition: @@ -832,9 +794,7 @@ int do_string_keyword (keyword, s) } -int do_number_keyword (keyword, num) - int keyword; - int num; +int do_number_keyword (int keyword, int num) { switch (keyword) { case kwn_ConstrainedMoveTime: @@ -885,10 +845,7 @@ int do_number_keyword (keyword, num) return 0; } -name_list **do_colorlist_keyword (keyword, colormode, s) - int keyword; - int colormode; - char *s; +name_list **do_colorlist_keyword (int keyword, int colormode, char *s) { switch (keyword) { case kwcl_BorderColor: @@ -938,10 +895,7 @@ name_list **do_colorlist_keyword (keyword, colormode, s) return NULL; } -int do_color_keyword (keyword, colormode, s) - int keyword; - int colormode; - char *s; +int do_color_keyword (int keyword, int colormode, char *s) { switch (keyword) { case kwc_DefaultForeground: @@ -988,12 +942,11 @@ int do_color_keyword (keyword, colormode, s) return 0; } -/* - * put_pixel_on_root() Save a pixel value in twm root window color property. +/** + * Save a pixel value in twm root window color property. */ void -put_pixel_on_root(pixel) - Pixel pixel; +put_pixel_on_root(Pixel pixel) { int i, addPixel = 1; Atom pixelAtom, retAtom; @@ -1015,28 +968,25 @@ put_pixel_on_root(pixel) (unsigned char *)&pixel, 1); } -/* - * do_string_savecolor() save a color from a string in the twmrc file. +/** + * save a color from a string in the twmrc file. */ void -do_string_savecolor(colormode, s) - int colormode; - char *s; +do_string_savecolor(int colormode, char *s) { Pixel p; GetColor(colormode, &p, s); put_pixel_on_root(p); } -/* - * do_var_savecolor() save a color from a var in the twmrc file. - */ typedef struct _cnode {int i; struct _cnode *next;} Cnode, *Cptr; Cptr chead = NULL; +/** + * save a color from a var in the twmrc file + */ void -do_var_savecolor(key) -int key; +do_var_savecolor(int key) { Cptr cptrav, cpnew; if (!chead) { @@ -1051,8 +1001,8 @@ int key; } } -/* - * assign_var_savecolor() traverse the var save color list placeing the pixels +/** + * traverse the var save color list placeing the pixels * in the root window property. */ void @@ -1104,8 +1054,7 @@ assign_var_savecolor() } static int -ParseUsePPosition (s) - register char *s; +ParseUsePPosition (char *s) { XmuCopyISOLatin1Lowered (s, s); @@ -1122,13 +1071,16 @@ ParseUsePPosition (s) } +/** + * + * \param list squeeze or dont-squeeze list + * \param name window name + * \param justify left, center, or right + * \param num signed num + * \param denom 0 or indicates fraction denom + */ void -do_squeeze_entry (list, name, justify, num, denom) - name_list **list; /* squeeze or dont-squeeze list */ - char *name; /* window name */ - int justify; /* left, center, right */ - int num; /* signed num */ - int denom; /* 0 or indicates fraction denom */ +do_squeeze_entry (name_list **list, char *name, int justify, int num, int denom) { int absnum = (num < 0 ? -num : num); diff --git a/src/resize.c b/src/resize.c index 905dea5..bed9a49 100644 --- a/src/resize.c +++ b/src/resize.c @@ -140,24 +140,14 @@ do_auto_clamp (TwmWindow *tmp_win, XEvent *evp) } -/*********************************************************************** - * - * Procedure: - * StartResize - begin a window resize operation - * - * Inputs: - * ev - the event structure (button press) - * tmp_win - the TwmWindow pointer - * fromtitlebar - action invoked from titlebar button - * - *********************************************************************** +/** + * begin a window resize operation + * \param ev the event structure (button press) + * \param tmp_win the TwmWindow pointer + * \param fromtitlebar action invoked from titlebar button */ - void -StartResize(evp, tmp_win, fromtitlebar) -XEvent *evp; -TwmWindow *tmp_win; -Bool fromtitlebar; +StartResize(XEvent *evp, TwmWindow *tmp_win, Bool fromtitlebar) { Window junkRoot; unsigned int junkbw, junkDepth; @@ -202,9 +192,7 @@ Bool fromtitlebar; void -MenuStartResize(tmp_win, x, y, w, h) -TwmWindow *tmp_win; -int x, y, w, h; +MenuStartResize(TwmWindow *tmp_win, int x, int y, int w, int h) { XGrabServer(dpy); XGrabPointer(dpy, Scr->Root, True, @@ -233,21 +221,12 @@ int x, y, w, h; tmp_win->frame_bw, tmp_win->title_height); } -/*********************************************************************** - * - * Procedure: - * AddStartResize - begin a windorew resize operation from AddWindow - * - * Inputs: - * tmp_win - the TwmWindow pointer - * - *********************************************************************** +/** + * begin a windorew resize operation from AddWindow + * \param tmp_win the TwmWindow pointer */ - void -AddStartResize(tmp_win, x, y, w, h) -TwmWindow *tmp_win; -int x, y, w, h; +AddStartResize(TwmWindow *tmp_win, int x, int y, int w, int h) { XGrabServer(dpy); XGrabPointer(dpy, Scr->Root, True, @@ -275,10 +254,7 @@ int x, y, w, h; void -MenuDoResize(x_root, y_root, tmp_win) -int x_root; -int y_root; -TwmWindow *tmp_win; +MenuDoResize(int x_root, int y_root, TwmWindow *tmp_win) { int action; @@ -379,25 +355,17 @@ TwmWindow *tmp_win; DisplaySize(tmp_win, dragWidth, dragHeight); } -/*********************************************************************** - * - * Procedure: - * DoResize - move the rubberband around. This is called for - * each motion event when we are resizing - * - * Inputs: - * x_root - the X corrdinate in the root window - * y_root - the Y corrdinate in the root window - * tmp_win - the current twm window + +/** + * move the rubberband around. This is called for each motion event when + * we are resizing * - *********************************************************************** + * \param x_root the X corrdinate in the root window + * \param y_root the Y corrdinate in the root window + * \param tmp_win the current twm window */ - void -DoResize(x_root, y_root, tmp_win) -int x_root; -int y_root; -TwmWindow *tmp_win; +DoResize(int x_root, int y_root, TwmWindow *tmp_win) { int action; @@ -502,24 +470,15 @@ TwmWindow *tmp_win; DisplaySize(tmp_win, dragWidth, dragHeight); } -/*********************************************************************** - * - * Procedure: - * DisplaySize - display the size in the dimensions window +/** + * display the size in the dimensions window. * - * Inputs: - * tmp_win - the current twm window - * width - the width of the rubber band - * height - the height of the rubber band - * - *********************************************************************** + * \param tmp_win the current twm window + * \param width the width of the rubber band + * \param height the height of the rubber band */ - void -DisplaySize(tmp_win, width, height) -TwmWindow *tmp_win; -int width; -int height; +DisplaySize(TwmWindow *tmp_win, int width, int height) { char str[100]; int dwidth; @@ -564,14 +523,9 @@ int height; str, 13); } -/*********************************************************************** - * - * Procedure: - * EndResize - finish the resize operation - * - *********************************************************************** +/** + * finish the resize operation */ - void EndResize() { @@ -615,8 +569,7 @@ EndResize() } void -MenuEndResize(tmp_win) -TwmWindow *tmp_win; +MenuEndResize(TwmWindow *tmp_win) { MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0); XUnmapWindow(dpy, Scr->SizeWindow); @@ -630,17 +583,11 @@ TwmWindow *tmp_win; -/*********************************************************************** - * - * Procedure: - * AddEndResize - finish the resize operation for AddWindo<w - * - *********************************************************************** +/** + * finish the resize operation for AddWindo<w */ - void -AddEndResize(tmp_win) -TwmWindow *tmp_win; +AddEndResize(TwmWindow *tmp_win) { #ifdef DEBUG @@ -654,20 +601,15 @@ TwmWindow *tmp_win; AddingH = dragHeight + (2 * tmp_win->frame_bw); } -/*********************************************************************** - * - * Procedure: - * ConstrainSize - adjust the given width and height to account for the - * constraints imposed by size hints +/** + * adjust the given width and height to account for the constraints imposed + * by size hints. * * The general algorithm, especially the aspect ratio stuff, is * borrowed from uwm's CheckConsistency routine. - * - ***********************************************************************/ + */ void -ConstrainSize (tmp_win, widthp, heightp) - TwmWindow *tmp_win; - int *widthp, *heightp; +ConstrainSize (TwmWindow *tmp_win, int *widthp, int *heightp) { #define makemult(a,b) ((b==1) ? (a) : (((int)((a)/(b))) * (b)) ) #define _min(a,b) (((a) < (b)) ? (a) : (b)) @@ -789,44 +731,35 @@ ConstrainSize (tmp_win, widthp, heightp) } -/*********************************************************************** - * - * Procedure: - * SetupWindow - set window sizes, this was called from either - * AddWindow, EndResize, or HandleConfigureNotify. - * - * Inputs: - * tmp_win - the TwmWindow pointer - * x - the x coordinate of the upper-left outer corner of the frame - * y - the y coordinate of the upper-left outer corner of the frame - * w - the width of the frame window w/o border - * h - the height of the frame window w/o border - * bw - the border width of the frame window or -1 not to change +/** + * set window sizes, this was called from either AddWindow, EndResize, or + * HandleConfigureNotify. * * Special Considerations: - * This routine will check to make sure the window is not completely - * off the display, if it is, it'll bring some of it back on. + * This routine will check to make sure the window is not completely off the + * display, if it is, it'll bring some of it back on. * - * The tmp_win->frame_XXX variables should NOT be updated with the - * values of x,y,w,h prior to calling this routine, since the new - * values are compared against the old to see whether a synthetic - * ConfigureNotify event should be sent. (It should be sent if the - * window was moved but not resized.) + * The tmp_win->frame_XXX variables should NOT be updated with the values of + * x,y,w,h prior to calling this routine, since the new values are compared + * against the old to see whether a synthetic ConfigureNotify event should be + * sent. (It should be sent if the window was moved but not resized.) * - *********************************************************************** + * \param tmp_win the TwmWindow pointer + * \param x the x coordinate of the upper-left outer corner of the frame + * \param y the y coordinate of the upper-left outer corner of the frame + * \param w the width of the frame window w/o border + * \param h the height of the frame window w/o border + * \param bw the border width of the frame window or -1 not to change */ - -void SetupWindow (tmp_win, x, y, w, h, bw) - TwmWindow *tmp_win; - int x, y, w, h, bw; +void SetupWindow (TwmWindow *tmp_win, int x, int y, int w, int h, int bw) { SetupFrame (tmp_win, x, y, w, h, bw, False); } -void SetupFrame (tmp_win, x, y, w, h, bw, sendEvent) - TwmWindow *tmp_win; - int x, y, w, h, bw; - Bool sendEvent; /* whether or not to force a send */ +/** + * \param sendEvent whether or not to force a send + */ +void SetupFrame (TwmWindow *tmp_win, int x, int y, int w, int h, int bw, Bool sendEvent) { XEvent client_event; XWindowChanges frame_wc, xwc; @@ -972,25 +905,15 @@ void SetupFrame (tmp_win, x, y, w, h, bw, sendEvent) } -/********************************************************************** - * Rutgers mod #1 - rocky. - * Procedure: - * fullzoom - zooms window to full height of screen or - * to full height and width of screen. (Toggles - * so that it can undo the zoom - even when switching - * between fullzoom and vertical zoom.) - * - * Inputs: - * tmp_win - the TwmWindow pointer +/** + * zooms window to full height of screen or to full height and width of screen. + * (Toggles so that it can undo the zoom - even when switching between fullzoom + * and vertical zoom.) * - * - ********************************************************************** + * \param tmp_win the TwmWindow pointer */ - void -fullzoom(tmp_win,flag) -TwmWindow *tmp_win; -int flag; +fullzoom(TwmWindow *tmp_win, int flag) { Window junkRoot; unsigned int junkbw, junkDepth; @@ -1084,8 +1007,7 @@ int flag; } void -SetFrameShape (tmp) - TwmWindow *tmp; +SetFrameShape (TwmWindow *tmp) { /* * see if the titlebar needs to move @@ -613,14 +613,9 @@ main(int argc, char *argv[]) exit(0); } -/*********************************************************************** - * - * Procedure: - * InitVariables - initialize twm variables - * - *********************************************************************** +/** + * initialize twm variables */ - void InitVariables() { @@ -783,8 +778,7 @@ CreateFonts () } void -RestoreWithdrawnLocation (tmp) - TwmWindow *tmp; +RestoreWithdrawnLocation (TwmWindow *tmp) { int gravx, gravy; unsigned int bw, mask; @@ -832,8 +826,7 @@ RestoreWithdrawnLocation (tmp) void -Reborder (time) -Time time; +Reborder (Time time) { TwmWindow *tmp; /* temp twm window structure */ int scrnum; @@ -865,24 +858,8 @@ sigHandler(int sig) SIGNAL_RETURN; } -/*********************************************************************** - * - * Procedure: - * Done - cleanup and exit twm - * - * Returned Value: - * none - * - * Inputs: - * none - * - * Outputs: - * none - * - * Special Considerations: - * none - * - *********************************************************************** +/** + * cleanup and exit twm */ void Done(XtPointer client_data, XtSignalId *si) @@ -895,6 +872,7 @@ Done(XtPointer client_data, XtSignalId *si) exit(0); } + /* * Error Handlers. If a client dies, we'll get a BadWindow error (except for * GetGeometry which returns BadDrawable) for most operations that we do before @@ -905,9 +883,7 @@ Bool ErrorOccurred = False; XErrorEvent LastErrorEvent; static int -TwmErrorHandler(dpy, event) - Display *dpy; - XErrorEvent *event; +TwmErrorHandler(Display *dpy, XErrorEvent *event) { LastErrorEvent = *event; ErrorOccurred = True; @@ -921,11 +897,8 @@ TwmErrorHandler(dpy, event) } -/* ARGSUSED*/ static int -CatchRedirectError(dpy, event) - Display *dpy; - XErrorEvent *event; +CatchRedirectError(Display *dpy, XErrorEvent *event) { RedirectError = TRUE; LastErrorEvent = *event; @@ -84,27 +84,16 @@ static Pixmap CreateMenuPixmap ( unsigned int *widthp, int HotX, HotY; -/*********************************************************************** - * - * Procedure: - * MoveOutline - move a window outline - * - * Inputs: - * root - the window we are outlining - * x - upper left x coordinate - * y - upper left y coordinate - * width - the width of the rectangle - * height - the height of the rectangle - * bw - the border width of the frame - * th - title height +/** + * move a window outline * - *********************************************************************** + * \param root window we are outlining + * \param x,y upper left coordinate + * \param width,height size of the rectangle + * \param bw border width of the frame + * \param th title height */ - -/* ARGSUSED */ -void MoveOutline(root, x, y, width, height, bw, th) - Window root; - int x, y, width, height, bw, th; +void MoveOutline(Window root, int x, int y, int width, int height, int bw, int th) { static int lastx = 0; static int lasty = 0; @@ -216,21 +205,14 @@ void MoveOutline(root, x, y, width, height, bw, th) } } -/*********************************************************************** - * - * Procedure: - * Zoom - zoom in or out of an icon +/** + * zoom in or out of an icon * - * Inputs: - * wf - window to zoom from - * wt - window to zoom to - * - *********************************************************************** + * \param wf window to zoom from + * \param wt window to zoom to */ - void -Zoom(wf, wt) - Window wf, wt; +Zoom(Window wf, Window wt) { int fx, fy, tx, ty; /* from, to */ unsigned int fw, fh, tw, th; /* from, to */ @@ -268,25 +250,16 @@ Zoom(wf, wt) } } - -/*********************************************************************** - * - * Procedure: - * ExpandFilename - expand the tilde character to HOME - * if it is the first character of the filename - * - * Returned Value: - * a pointer to the new name +/** + * expand the tilde character to HOME if it is the first + * character of the filename * - * Inputs: - * name - the filename to expand + * \return a pointer to the new name * - *********************************************************************** + * \param name the filename to expand */ - char * -ExpandFilename(name) -char *name; +ExpandFilename(char *name) { char *newname; @@ -305,20 +278,13 @@ char *name; return newname; } -/*********************************************************************** - * - * Procedure: - * GetUnknownIcon - read in the bitmap file for the unknown icon +/** + * read in the bitmap file for the unknown icon * - * Inputs: - * name - the filename to read - * - *********************************************************************** + * \param name the filename to read */ - void -GetUnknownIcon(name) -char *name; +GetUnknownIcon(char *name) { if ((Scr->UnknownPm = GetBitmap(name)) != None) { @@ -327,26 +293,17 @@ char *name; } } -/*********************************************************************** - * - * Procedure: +/** * FindBitmap - read in a bitmap file and return size * - * Returned Value: - * the pixmap associated with the bitmap - * widthp - pointer to width of bitmap - * heightp - pointer to height of bitmap - * - * Inputs: - * name - the filename to read + * \return pixmap associated with bitmap * - *********************************************************************** + * \param name filename to read + * \param[out] widthp pointer to width of bitmap + * \param[out] heightp pointer to height of bitmap */ - Pixmap -FindBitmap (name, widthp, heightp) - char *name; - unsigned int *widthp, *heightp; +FindBitmap (char *name, unsigned *widthp, unsigned *heightp) { char *bigname; Pixmap pm; @@ -424,18 +381,13 @@ FindBitmap (name, widthp, heightp) } Pixmap -GetBitmap (name) - char *name; +GetBitmap (char *name) { return FindBitmap (name, &JunkWidth, &JunkHeight); } void -InsertRGBColormap (a, maps, nmaps, replace) - Atom a; - XStandardColormap *maps; - int nmaps; - Bool replace; +InsertRGBColormap (Atom a, XStandardColormap *maps, int nmaps, Bool replace) { StdCmap *sc = NULL; @@ -474,8 +426,7 @@ InsertRGBColormap (a, maps, nmaps, replace) } void -RemoveRGBColormap (a) - Atom a; +RemoveRGBColormap (Atom a) { StdCmap *sc, *prev; @@ -516,10 +467,7 @@ LocateStandardColormaps() } void -GetColor(kind, what, name) -int kind; -Pixel *what; -char *name; +GetColor(int kind, Pixel *what, char *name) { XColor color, junkcolor; Status stat = 0; @@ -597,10 +545,7 @@ char *name; } void -GetColorValue(kind, what, name) -int kind; -XColor *what; -char *name; +GetColorValue(int kind, XColor *what, char *name) { XColor junkcolor; Colormap cmap = Scr->TwmRoot.cmaps.cwins[0]->colormap->c; @@ -635,8 +580,7 @@ char *name; * locale is not set properly. */ void -GetFont(font) -MyFont *font; +GetFont(MyFont *font) { char *deffontname = "fixed"; char **missing_charset_list_return; @@ -710,10 +654,7 @@ MyFont *font; } int -MyFont_TextWidth(font, string, len) - MyFont *font; - char *string; - int len; +MyFont_TextWidth(MyFont *font, char *string, int len) { XRectangle ink_rect; XRectangle logical_rect; @@ -727,14 +668,8 @@ MyFont_TextWidth(font, string, len) } void -MyFont_DrawImageString(dpy, d, font, gc, x, y, string, len) - Display *dpy; - Drawable d; - MyFont *font; - GC gc; - int x,y; - char *string; - int len; +MyFont_DrawImageString(Display *dpy, Drawable d, MyFont *font, GC gc, + int x, int y, char *string, int len) { if (use_fontset) { XmbDrawImageString(dpy, d, font->fontset, gc, x, y, string, len); @@ -744,14 +679,8 @@ MyFont_DrawImageString(dpy, d, font, gc, x, y, string, len) } void -MyFont_DrawString(dpy, d, font, gc, x, y, string, len) - Display *dpy; - Drawable d; - MyFont *font; - GC gc; - int x,y; - char *string; - int len; +MyFont_DrawString(Display *dpy, Drawable d, MyFont *font, GC gc, + int x, int y, char *string, int len) { if (use_fontset) { XmbDrawString(dpy, d, font->fontset, gc, x, y, string, len); @@ -761,9 +690,8 @@ MyFont_DrawString(dpy, d, font, gc, x, y, string, len) } void -MyFont_ChangeGC(fix_fore, fix_back, fix_font) - unsigned long fix_fore, fix_back; - MyFont *fix_font; +MyFont_ChangeGC(unsigned long fix_fore, unsigned long fix_back, + MyFont *fix_font) { Gcv.foreground = fix_fore; Gcv.background = fix_back; @@ -784,10 +712,7 @@ MyFont_ChangeGC(fix_fore, fix_back, fix_font) * not XFree(). */ Status -I18N_FetchName(dpy, w, winname) - Display *dpy; - Window w; - char ** winname; +I18N_FetchName(Display *dpy, Window w, char **winname) { int status; XTextProperty text_prop; @@ -811,10 +736,7 @@ I18N_FetchName(dpy, w, winname) } Status -I18N_GetIconName(dpy, w, iconname) - Display *dpy; - Window w; - char ** iconname; +I18N_GetIconName(Display *dpy, Window w, char **iconname) { int status; XTextProperty text_prop; @@ -831,14 +753,12 @@ I18N_GetIconName(dpy, w, iconname) return 1; } -/* - * SetFocus - separate routine to set focus to make things more understandable +/** + * separate routine to set focus to make things more understandable * and easier to debug */ void -SetFocus (tmp_win, time) - TwmWindow *tmp_win; - Time time; +SetFocus (TwmWindow *tmp_win, Time time) { Window w = (tmp_win ? tmp_win->w : PointerRoot); @@ -856,7 +776,7 @@ SetFocus (tmp_win, time) #ifdef NOPUTENV -/* +/** * define our own putenv() if the system doesn't have one. * putenv(s): place s (a string of the form "NAME=value") in * the environment; replacing any existing NAME. s is placed in @@ -865,8 +785,7 @@ SetFocus (tmp_win, time) * called NAME. */ int -putenv(s) - char *s; +putenv(char *s) { char *v; int varlen, idx; @@ -922,8 +841,7 @@ putenv(s) static Pixmap -CreateXLogoPixmap (widthp, heightp) - unsigned int *widthp, *heightp; +CreateXLogoPixmap (unsigned *widthp, unsigned *heightp) { int h = Scr->TBInfo.width - Scr->TBInfo.border * 2; if (h < 0) h = 0; @@ -958,8 +876,7 @@ CreateXLogoPixmap (widthp, heightp) static Pixmap -CreateResizePixmap (widthp, heightp) - unsigned int *widthp, *heightp; +CreateResizePixmap (unsigned *widthp, unsigned *heightp) { int h = Scr->TBInfo.width - Scr->TBInfo.border * 2; if (h < 1) h = 1; @@ -1014,8 +931,7 @@ CreateResizePixmap (widthp, heightp) static Pixmap -CreateDotPixmap (widthp, heightp) - unsigned int *widthp, *heightp; +CreateDotPixmap (unsigned *widthp, unsigned *heightp) { int h = Scr->TBInfo.width - Scr->TBInfo.border * 2; @@ -1046,8 +962,7 @@ static char questionmark_bits[] = { 0x38, 0x7c, 0x64, 0x30, 0x18, 0x00, 0x18, 0x18}; static Pixmap -CreateQuestionPixmap (widthp, heightp) - unsigned int *widthp, *heightp; +CreateQuestionPixmap (unsigned *widthp, unsigned *heightp) { *widthp = questionmark_width; *heightp = questionmark_height; @@ -1065,17 +980,14 @@ CreateQuestionPixmap (widthp, heightp) static Pixmap -CreateMenuPixmap (widthp, heightp) - unsigned int *widthp, *heightp; +CreateMenuPixmap (unsigned *widthp, unsigned *heightp) { return CreateMenuIcon (Scr->TBInfo.width - Scr->TBInfo.border * 2, widthp,heightp); } Pixmap -CreateMenuIcon (height, widthp, heightp) - int height; - unsigned int *widthp, *heightp; +CreateMenuIcon (int height, unsigned *widthp, unsigned *heightp) { int h, w; int ih, iw; @@ -1149,10 +1061,7 @@ CreateMenuIcon (height, widthp, heightp) } void -Bell(type,percent,win) - int type; - int percent; - Window win; +Bell(int type, int percent, Window win) { #ifdef XKB XkbStdBell(dpy, win, percent, type); |