windows: convert K&R function definitions to ANSI C

Convert the old-style (K&R) function definitions in windows/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.

Updates the windows headers (windows.h, windInt.h) to prototype the
affected declarations.

Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Andreas Wendleder 2026-06-10 03:49:16 +02:00
parent 132155c942
commit 1fb9dd6310
No known key found for this signature in database
GPG Key ID: 588785BFDFB01ABD
14 changed files with 407 additions and 400 deletions

View File

@ -53,30 +53,30 @@ static char rcsid[] __attribute__ ((unused)) ="$Header: /usr/cvsroot/magic-8.0/w
/* our window client ID */ /* our window client ID */
global WindClient windClientID = (WindClient) NULL; global WindClient windClientID = (WindClient) NULL;
extern int windBorderCmd(); extern void windBorderCmd();
extern int windCaptionCmd(), windCrashCmd(), windCursorCmd(); extern void windCaptionCmd(), windCrashCmd(), windCursorCmd();
extern int windFilesCmd(), windCloseCmd(), windOpenCmd(); extern void windFilesCmd(), windCloseCmd(), windOpenCmd();
extern int windQuitCmd(), windRedrawCmd(); extern void windQuitCmd(), windRedrawCmd();
extern int windResetCmd(), windSpecialOpenCmd(); extern void windResetCmd(), windSpecialOpenCmd();
extern int windOverCmd(), windUnderCmd(), windDebugCmd(); extern void windOverCmd(), windUnderCmd(), windDebugCmd();
extern int windDumpCmd(), windHelpCmd(); extern void windDumpCmd(), windHelpCmd();
extern int windMacroCmd(), windIntMacroCmd(); extern void windMacroCmd(), windIntMacroCmd();
extern int windLogCommandsCmd(), windUpdateCmd(), windSleepCmd(); extern void windLogCommandsCmd(), windUpdateCmd(), windSleepCmd();
extern int windSetpointCmd(); extern void windSetpointCmd();
extern int windPushbuttonCmd(); extern void windPushbuttonCmd();
extern int windPauseCmd(), windGrstatsCmd(); extern void windPauseCmd(), windGrstatsCmd();
extern int windGrowCmd(); extern void windGrowCmd();
extern int windUndoCmd(), windRedoCmd(); extern void windUndoCmd(), windRedoCmd();
extern int windCenterCmd(), windScrollCmd(); extern void windCenterCmd(), windScrollCmd();
extern int windVersionCmd(), windViewCmd(), windXviewCmd(), windZoomCmd(); extern void windVersionCmd(), windViewCmd(), windXviewCmd(), windZoomCmd();
extern int windScrollBarsCmd(), windPositionsCmd(); extern void windScrollBarsCmd(), windPositionsCmd();
extern int windNamesCmd(); extern void windNamesCmd();
#ifdef MAGIC_WRAPPER #ifdef MAGIC_WRAPPER
extern int windBypassCmd(); extern void windBypassCmd();
#else #else
extern int windEchoCmd(), windSourceCmd(), windSendCmd(); extern void windEchoCmd(), windSourceCmd(), windSendCmd();
#endif #endif
static Rect windFrameRect; static Rect windFrameRect;
@ -104,9 +104,9 @@ static int windCorner = WIND_ILG; /* Nearest corner when button went
*/ */
void void
windButtonSetCursor(button, corner) windButtonSetCursor(
int button; /* Button that is down. */ int button, /* Button that is down. */
int corner; /* Corner to be displayed in cursor. */ int corner) /* Corner to be displayed in cursor. */
{ {
switch (corner) switch (corner)
{ {
@ -154,10 +154,9 @@ windButtonSetCursor(button, corner)
*/ */
int int
windGetCorner(screenPoint, screenRect) windGetCorner(
Point *screenPoint; Point *screenPoint,
Rect *screenRect; Rect *screenRect)
{ {
Rect r; Rect r;
@ -200,15 +199,15 @@ windGetCorner(screenPoint, screenRect)
*/ */
void void
windMoveRect(wholeRect, corner, p, rect) windMoveRect(
bool wholeRect; /* move the whole thing? or just a corner? */ bool wholeRect, /* move the whole thing? or just a corner? */
int corner; /* Specifies a corner in the format int corner, /* Specifies a corner in the format
* returned by ToolGetCorner. * returned by ToolGetCorner.
*/ */
Point *p; /* New position of corner, in screen Point *p, /* New position of corner, in screen
* coordinates. * coordinates.
*/ */
Rect *rect; Rect *rect)
{ {
int x, y, tmp; int x, y, tmp;
@ -312,9 +311,9 @@ windMoveRect(wholeRect, corner, p, rect)
*/ */
void void
windFrameDown(w, cmd) windFrameDown(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
if (WindOldButtons == 0) if (WindOldButtons == 0)
{ {
@ -341,9 +340,9 @@ windFrameDown(w, cmd)
/*ARGSUSED*/ /*ARGSUSED*/
void void
windFrameUp(w, cmd) windFrameUp(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
if (WindNewButtons == 0) if (WindNewButtons == 0)
{ {
@ -391,9 +390,9 @@ windFrameUp(w, cmd)
*/ */
bool bool
windFrameButtons(w, cmd) windFrameButtons(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
extern void windBarLocations(); extern void windBarLocations();
@ -498,9 +497,9 @@ windFrameButtons(w, cmd)
*/ */
void void
windClientButtons(w, cmd) windClientButtons(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
/* /*
* Is this an initial 'down push' in a non-iconic window? If so, we * Is this an initial 'down push' in a non-iconic window? If so, we
@ -599,11 +598,11 @@ windClientButtons(w, cmd)
*/ */
bool bool
WindButtonInFrame(w, x, y, b) WindButtonInFrame(
MagWindow *w; MagWindow *w,
int x; int x,
int y; int y,
int b; int b)
{ {
TxCommand cmd; TxCommand cmd;
cmd.tx_p.p_x = x; cmd.tx_p.p_x = x;
@ -638,9 +637,9 @@ WindButtonInFrame(w, x, y, b)
*/ */
void void
windCmdInterp(w, cmd) windCmdInterp(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int cmdNum; int cmdNum;

View File

@ -54,7 +54,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#include "cif/cif.h" #include "cif/cif.h"
/* Forward declarations */ /* Forward declarations */
void windDoMacro(); void windDoMacro(MagWindow *w, TxCommand *cmd, bool interactive);
/* /*
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
@ -78,9 +78,9 @@ void windDoMacro();
*/ */
void void
windBorderCmd(w, cmd) windBorderCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int place; int place;
bool value; bool value;
@ -148,9 +148,9 @@ windBorderCmd(w, cmd)
*/ */
void void
windCaptionCmd(w, cmd) windCaptionCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int place; int place;
Rect ts; Rect ts;
@ -218,9 +218,9 @@ windCaptionCmd(w, cmd)
*/ */
void void
windCenterCmd(w, cmd) windCenterCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
Point rootPoint; Point rootPoint;
Rect newArea, oldArea; Rect newArea, oldArea;
@ -318,9 +318,9 @@ windCenterCmd(w, cmd)
*/ */
void void
windCloseCmd(w, cmd) windCloseCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
if ((cmd->tx_argc == 2) && GrWindowNamePtr) if ((cmd->tx_argc == 2) && GrWindowNamePtr)
{ {
@ -372,9 +372,9 @@ windCloseCmd(w, cmd)
*/ */
void void
windBypassCmd(w, cmd) windBypassCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int saveCount; int saveCount;
@ -410,9 +410,9 @@ windBypassCmd(w, cmd)
*/ */
void void
windCrashCmd(w, cmd) windCrashCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
if (cmd->tx_argc != 1) if (cmd->tx_argc != 1)
{ {
@ -457,9 +457,9 @@ windCrashCmd(w, cmd)
#define CURSOR_SCREEN 6 #define CURSOR_SCREEN 6
void void
windCursorCmd(w, cmd) windCursorCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
Point p_in, p_out; Point p_in, p_out;
int resulttype, saveunits, idx; int resulttype, saveunits, idx;
@ -588,9 +588,9 @@ windCursorCmd(w, cmd)
*/ */
void void
windDebugCmd(w, cmd) windDebugCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
if (cmd->tx_argc != 1) goto usage; if (cmd->tx_argc != 1) goto usage;
windPrintCommands = !windPrintCommands; windPrintCommands = !windPrintCommands;
@ -617,9 +617,9 @@ usage:
*/ */
void void
windDumpCmd(w, cmd) windDumpCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
(void) windDump(); (void) windDump();
} }
@ -643,9 +643,9 @@ windDumpCmd(w, cmd)
*/ */
void void
windEchoCmd(w, cmd) windEchoCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int i; int i;
bool newline = TRUE; bool newline = TRUE;
@ -686,9 +686,9 @@ windEchoCmd(w, cmd)
/*ARGSUSED*/ /*ARGSUSED*/
void void
windFilesCmd(w, cmd) windFilesCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
#define NUM_FD 20 /* max number of open files per process */ #define NUM_FD 20 /* max number of open files per process */
int fd; int fd;
@ -740,9 +740,9 @@ windFilesCmd(w, cmd)
*/ */
void void
windGrowCmd(w, cmd) windGrowCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
if (w == NULL) if (w == NULL)
{ {
@ -769,9 +769,9 @@ windGrowCmd(w, cmd)
*/ */
void void
windGrstatsCmd(w, cmd) windGrstatsCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
char *RunStats(), *rstatp; char *RunStats(), *rstatp;
static struct tms tlast, tdelta; static struct tms tlast, tdelta;
@ -875,9 +875,9 @@ windGrstatsCmd(w, cmd)
*/ */
void void
windHelpCmd(w, cmd) windHelpCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
ASSERT(FALSE, windHelpCmd); ASSERT(FALSE, windHelpCmd);
} }
@ -914,9 +914,9 @@ windHelpCmd(w, cmd)
#define LOG_CMD_RESUME 4 // Resume command logging. #define LOG_CMD_RESUME 4 // Resume command logging.
void void
windLogCommandsCmd(w, cmd) windLogCommandsCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
char *fileName = NULL; char *fileName = NULL;
unsigned char flags = 0; unsigned char flags = 0;
@ -994,9 +994,9 @@ usage:
*/ */
void void
windIntMacroCmd(w, cmd) windIntMacroCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
windDoMacro(w, cmd, TRUE); windDoMacro(w, cmd, TRUE);
} }
@ -1018,9 +1018,9 @@ windIntMacroCmd(w, cmd)
*/ */
void void
windMacroCmd(w, cmd) windMacroCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
windDoMacro(w, cmd, FALSE); windDoMacro(w, cmd, FALSE);
} }
@ -1042,10 +1042,10 @@ windMacroCmd(w, cmd)
*/ */
void void
windDoMacro(w, cmd, interactive) windDoMacro(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd,
bool interactive; bool interactive)
{ {
char *cp, *cn; char *cp, *cn;
char nulltext[] = ""; char nulltext[] = "";

View File

@ -64,9 +64,9 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
*/ */
void void
windOpenCmd(w, cmd) windOpenCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
Rect area; Rect area;
Point frame; Point frame;
@ -111,9 +111,9 @@ windOpenCmd(w, cmd)
*/ */
void void
windOverCmd(w, cmd) windOverCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
if (cmd->tx_argc != 1) if (cmd->tx_argc != 1)
{ {
@ -148,9 +148,9 @@ windOverCmd(w, cmd)
*/ */
void void
windPauseCmd(w, cmd) windPauseCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int i; int i;
static char ssline[TX_MAX_CMDLEN]; static char ssline[TX_MAX_CMDLEN];
@ -200,9 +200,9 @@ const char * const actTable[] =
*/ */
void void
windPushbuttonCmd(w, cmd) windPushbuttonCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int but, act; int but, act;
static TxCommand txcmd; static TxCommand txcmd;
@ -259,9 +259,9 @@ badusage:
*/ */
void void
windQuitCmd(w, cmd) windQuitCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
clientRec *cr; clientRec *cr;
bool checkfirst = TRUE; bool checkfirst = TRUE;
@ -332,9 +332,9 @@ windQuitCmd(w, cmd)
*/ */
void void
windRedoCmd(w, cmd) windRedoCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int count; int count;
@ -406,9 +406,9 @@ windRedoCmd(w, cmd)
*/ */
void void
windRedrawCmd(w, cmd) windRedrawCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
WindAreaChanged((MagWindow *) NULL, (Rect *) NULL); WindAreaChanged((MagWindow *) NULL, (Rect *) NULL);
} }
@ -432,9 +432,9 @@ windRedrawCmd(w, cmd)
*/ */
void void
windResetCmd(w, cmd) windResetCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
if (cmd->tx_argc != 1) if (cmd->tx_argc != 1)
{ {

View File

@ -72,9 +72,9 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
*/ */
void void
windScrollCmd(w, cmd) windScrollCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
Rect r; Rect r;
int xsize, ysize; int xsize, ysize;
@ -211,9 +211,9 @@ windScrollCmd(w, cmd)
*/ */
void void
windSetpointCmd(w, cmd) windSetpointCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int wid; int wid;
Point rootPoint; Point rootPoint;
@ -292,9 +292,9 @@ usage:
} }
int int
windSetPrintProc(name, val) windSetPrintProc(
char *name; char *name,
char *val; char *val)
{ {
TxPrintf("%s = \"%s\"\n", name, val); TxPrintf("%s = \"%s\"\n", name, val);
return 0; return 0;
@ -316,9 +316,9 @@ windSetPrintProc(name, val)
*/ */
void void
windSleepCmd(w, cmd) windSleepCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int time; int time;
@ -360,9 +360,9 @@ windSleepCmd(w, cmd)
*/ */
void void
windSourceCmd(w, cmd) windSourceCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
FILE *f; FILE *f;
@ -401,9 +401,9 @@ windSourceCmd(w, cmd)
*/ */
void void
windSpecialOpenCmd(w, cmd) windSpecialOpenCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
WindClient wc; WindClient wc;
Rect area; Rect area;
@ -478,9 +478,9 @@ usage:
*/ */
void void
windNamesCmd(w, cmd) windNamesCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
bool doforall = FALSE; bool doforall = FALSE;
WindClient wc = (WindClient)NULL; WindClient wc = (WindClient)NULL;
@ -591,9 +591,9 @@ windNamesCmd(w, cmd)
*/ */
void void
windUnderCmd(w, cmd) windUnderCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
if (cmd->tx_argc != 1) if (cmd->tx_argc != 1)
{ {
@ -631,9 +631,9 @@ windUnderCmd(w, cmd)
*/ */
void void
windUndoCmd(w, cmd) windUndoCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int count; int count;
@ -713,9 +713,9 @@ windUndoCmd(w, cmd)
*/ */
void void
windUpdateCmd(w, cmd) windUpdateCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
if (cmd->tx_argc == 1) if (cmd->tx_argc == 1)
WindUpdate(); WindUpdate();
@ -759,9 +759,9 @@ badusage:
*/ */
void void
windVersionCmd(w, cmd) windVersionCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
if (cmd->tx_argc != 1) { if (cmd->tx_argc != 1) {
TxError("Usage: %s\n", cmd->tx_argv[0]); TxError("Usage: %s\n", cmd->tx_argv[0]);
@ -795,9 +795,9 @@ windVersionCmd(w, cmd)
*/ */
void void
windViewCmd(w, cmd) windViewCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
if (w == NULL) if (w == NULL)
return; return;
@ -937,9 +937,9 @@ windViewCmd(w, cmd)
*/ */
void void
windXviewCmd(w, cmd) windXviewCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
CellUse *celluse; CellUse *celluse;
int ViewUnexpandFunc(); int ViewUnexpandFunc();
@ -967,9 +967,9 @@ windXviewCmd(w, cmd)
*/ */
int int
ViewUnexpandFunc(use, windowMask) ViewUnexpandFunc(
CellUse *use; /* Use that was just unexpanded. */ CellUse *use, /* Use that was just unexpanded. */
int windowMask; /* Window where it was unexpanded. */ int windowMask) /* Window where it was unexpanded. */
{ {
if (use->cu_parent == NULL) return 0; if (use->cu_parent == NULL) return 0;
DBWAreaChanged(use->cu_parent, &use->cu_bbox, windowMask, DBWAreaChanged(use->cu_parent, &use->cu_bbox, windowMask,
@ -998,9 +998,9 @@ ViewUnexpandFunc(use, windowMask)
*/ */
void void
windScrollBarsCmd(w, cmd) windScrollBarsCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int place; int place;
static const char * const onoff[] = {"on", "off", 0}; static const char * const onoff[] = {"on", "off", 0};
@ -1052,9 +1052,9 @@ windScrollBarsCmd(w, cmd)
*/ */
void void
windSendCmd(w, cmd) windSendCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
MagWindow *toWindow; MagWindow *toWindow;
WindClient client; WindClient client;
@ -1090,9 +1090,9 @@ windSendCmd(w, cmd)
} }
int int
windSendCmdFunc(w, cd) windSendCmdFunc(
MagWindow *w; MagWindow *w,
ClientData cd; ClientData cd)
{ {
*((MagWindow **) cd) = w; *((MagWindow **) cd) = w;
return 1; return 1;
@ -1129,9 +1129,9 @@ typedef struct _cdwpos {
*/ */
void void
windPositionsCmd(w, cmd) windPositionsCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
extern int windPositionsFunc(); extern int windPositionsFunc();
char *filename = NULL; char *filename = NULL;
@ -1174,9 +1174,9 @@ usage:
} }
int int
windPositionsFunc(w, cdata) windPositionsFunc(
MagWindow *w; MagWindow *w,
ClientData cdata; ClientData cdata)
{ {
cdwpos *windpos = (cdwpos *)cdata; cdwpos *windpos = (cdwpos *)cdata;
Rect r; Rect r;
@ -1236,9 +1236,9 @@ windPositionsFunc(w, cdata)
*/ */
void void
windZoomCmd(w, cmd) windZoomCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
float factor; float factor;

View File

@ -48,8 +48,8 @@ static char rcsid[] __attribute__ ((unused)) = "$Header$";
*/ */
void void
windPrintWindow(w) windPrintWindow(
MagWindow *w; MagWindow *w)
{ {
LinkedRect *lr; LinkedRect *lr;
@ -136,8 +136,8 @@ windDump()
*/ */
void void
windPrintCommand(cmd) windPrintCommand(
TxCommand *cmd; TxCommand *cmd)
{ {
if (cmd->tx_button == TX_NO_BUTTON) if (cmd->tx_button == TX_NO_BUTTON)
{ {

View File

@ -78,7 +78,9 @@ bool windSomeSeparateRedisplay = FALSE;
*/ */
int int
windCheckOnlyWindow(MagWindow **w, WindClient client) windCheckOnlyWindow(
MagWindow **w,
WindClient client)
{ {
MagWindow *sw, *tw; MagWindow *sw, *tw;
int wct = 0; int wct = 0;
@ -116,8 +118,8 @@ windCheckOnlyWindow(MagWindow **w, WindClient client)
*/ */
void void
windFreeList(llr) windFreeList(
LinkedRect **llr; /* A pointer to a list of linked rectangles */ LinkedRect **llr) /* A pointer to a list of linked rectangles */
{ {
LinkedRect *lr, *freelr; LinkedRect *lr, *freelr;
@ -211,8 +213,8 @@ windReClip()
*/ */
void void
WindSeparateRedisplay(w) WindSeparateRedisplay(
MagWindow *w; MagWindow *w)
{ {
windSomeSeparateRedisplay = TRUE; windSomeSeparateRedisplay = TRUE;
if (w->w_redrawAreas != (ClientData)NULL) return; if (w->w_redrawAreas != (ClientData)NULL) return;
@ -235,8 +237,8 @@ WindSeparateRedisplay(w)
*/ */
void void
WindIconChanged(w) WindIconChanged(
MagWindow *w; MagWindow *w)
{ {
ASSERT(w != NULL, "WindIconChanged"); ASSERT(w != NULL, "WindIconChanged");
w->w_flags |= WIND_REDRAWICON; w->w_flags |= WIND_REDRAWICON;
@ -264,9 +266,9 @@ WindIconChanged(w)
*/ */
void void
WindAreaChanged(w, area) WindAreaChanged(
MagWindow *w; /* The window that changed. */ MagWindow *w, /* The window that changed. */
Rect *area; /* The area in screen coordinates. Rect *area) /* The area in screen coordinates.
* NULL means the whole screen. Caller * NULL means the whole screen. Caller
* should clip this rectangle to the area * should clip this rectangle to the area
* of the window. * of the window.
@ -346,9 +348,9 @@ WindAreaChanged(w, area)
} }
bool bool
windChangedFunc(area, next) windChangedFunc(
Rect *area; /* Area that is still unobscured. */ Rect *area, /* Area that is still unobscured. */
LinkedRect *next; /* Next obscuring area. */ LinkedRect *next) /* Next obscuring area. */
{ {
/* If we're at the end of obscuring areas, paint an error /* If we're at the end of obscuring areas, paint an error
* tile to mark what's to be redisplayed. Otherwise, * tile to mark what's to be redisplayed. Otherwise,
@ -383,29 +385,29 @@ windChangedFunc(area, next)
*/ */
void void
windBarLocations(w, leftBar, botBar, up, down, right, left, zoom) windBarLocations(
MagWindow *w; /* The window under consideration. */ MagWindow *w, /* The window under consideration. */
/* The following are rectangles that will be filled /* The following are rectangles that will be filled
* in by this procedure. The values will be in the * in by this procedure. The values will be in the
* same coordinate sytem as w->w_allArea. * same coordinate sytem as w->w_allArea.
*/ */
Rect *leftBar; /* The location of the left scrollbar area (not the Rect *leftBar, /* The location of the left scrollbar area (not the
* bar itself). * bar itself).
*/ */
Rect *botBar; /* The location of the bottom scrollbar area. */ Rect *botBar, /* The location of the bottom scrollbar area. */
Rect *up; /* The location of the 'up arrow' icon above the Rect *up, /* The location of the 'up arrow' icon above the
* left scroll bar. * left scroll bar.
*/ */
Rect *down; /* The location of the 'down arrow' icon below the Rect *down, /* The location of the 'down arrow' icon below the
* left scroll bar. * left scroll bar.
*/ */
Rect *right; /* The location of the 'right arrow' icon to the right Rect *right, /* The location of the 'right arrow' icon to the right
* of the bottom scroll bar. * of the bottom scroll bar.
*/ */
Rect *left; /* The location of the 'left arrow' icon to the left of Rect *left, /* The location of the 'left arrow' icon to the left of
* the bottom scroll bar. * the bottom scroll bar.
*/ */
Rect *zoom; /* The location of the 'zoom' icon in the lower-left Rect *zoom) /* The location of the 'zoom' icon in the lower-left
* corner of the window. * corner of the window.
*/ */
{ {
@ -462,9 +464,9 @@ windBarLocations(w, leftBar, botBar, up, down, right, left, zoom)
*/ */
void void
WindDrawBorder(w, clip) WindDrawBorder(
MagWindow *w; MagWindow *w,
Rect *clip; Rect *clip)
{ {
Rect r; Rect r;
Rect leftBar, botBar, up, down, left, right, zoom; Rect leftBar, botBar, up, down, left, right, zoom;
@ -633,9 +635,9 @@ leave:
*/ */
void void
WindCaption(w, caption) WindCaption(
MagWindow *w; MagWindow *w,
char *caption; /* The string that is to be copied into the caption. char *caption) /* The string that is to be copied into the caption.
* (The string is copied, not just pointed at.) * (The string is copied, not just pointed at.)
*/ */
{ {
@ -666,8 +668,8 @@ WindCaption(w, caption)
*/ */
void void
windNewView(w) windNewView(
MagWindow *w; MagWindow *w)
{ {
Rect leftBar, botBar, up, down, right, left, zoom; Rect leftBar, botBar, up, down, right, left, zoom;
@ -696,8 +698,8 @@ windNewView(w)
*/ */
void void
WindRedisplay(w) WindRedisplay(
MagWindow *w; MagWindow *w)
{ {
WindAreaChanged(w, &(w->w_allArea)); WindAreaChanged(w, &(w->w_allArea));
} }
@ -717,8 +719,8 @@ WindRedisplay(w)
*/ */
void void
windRedrawIcon(w) windRedrawIcon(
MagWindow *w; MagWindow *w)
{ {
Point p; Point p;
clientRec *cl; clientRec *cl;
@ -900,10 +902,10 @@ WindUpdate()
*/ */
int int
windUpdateFunc(tile, dinfo, w) windUpdateFunc(
Tile *tile; /* Tile in the redisplay plane. */ Tile *tile, /* Tile in the redisplay plane. */
TileType dinfo; /* Split tile information (unused) */ TileType dinfo, /* Split tile information (unused) */
MagWindow *w; /* Window we're currently interested in. */ MagWindow *w) /* Window we're currently interested in. */
{ {
Rect area; Rect area;
@ -968,10 +970,10 @@ windUpdateFunc(tile, dinfo, w)
/* ARGSUSED */ /* ARGSUSED */
int int
windBackgroundFunc(tile, dinfo, notUsed) windBackgroundFunc(
Tile *tile; Tile *tile,
TileType dinfo; /* (unused) */ TileType dinfo, /* (unused) */
ClientData notUsed; /* (unused) */ ClientData notUsed) /* (unused) */
{ {
Rect area; Rect area;

View File

@ -59,7 +59,7 @@ extern MagWindow *windSearchPoint();
/* C99 compat */ /* C99 compat */
extern void windScreenToFrame(); extern void windScreenToFrame();
extern void WindPrintClientList(); extern void WindPrintClientList(bool wizard);
/* ----------------- constants ----------------- */ /* ----------------- constants ----------------- */

View File

@ -221,21 +221,20 @@ WindInit()
*/ */
WindClient WindClient
WindAddClient(clientName, create, delete, redisplay, command, update, WindAddClient(
exitproc, reposition, icon) char *clientName, /* A textual name for the client. This
char *clientName; /* A textual name for the client. This
* name will be visable in the user * name will be visable in the user
* interface as the name to use to switch * interface as the name to use to switch
* a window over to a new client * a window over to a new client
*/ */
bool (*create)(); bool (*create)(),
bool (*delete)(); bool (*delete)(),
void (*redisplay)(); void (*redisplay)(),
void (*command)(); void (*command)(),
void (*update)(); void (*update)(),
bool (*exitproc)(); bool (*exitproc)(),
void (*reposition)(); void (*reposition)(),
GrGlyph *icon; /* An icon to draw when the window is closed. GrGlyph *icon) /* An icon to draw when the window is closed.
* (currently for Sun Windows only). * (currently for Sun Windows only).
*/ */
{ {
@ -288,9 +287,9 @@ WindAddClient(clientName, create, delete, redisplay, command, update,
*/ */
WindClient WindClient
WindGetClient(clientName, exact) WindGetClient(
char *clientName; /* the textual name of the client */ char *clientName, /* the textual name of the client */
bool exact; /* must the name be exact, or are abbreviations allowed */ bool exact) /* must the name be exact, or are abbreviations allowed */
{ {
clientRec *cr, *found; clientRec *cr, *found;
int length; int length;
@ -339,8 +338,8 @@ WindGetClient(clientName, exact)
*/ */
char * char *
WindGetClientName(client) WindGetClientName(
WindClient client; WindClient client)
{ {
clientRec *clientrec = (clientRec *)client; clientRec *clientrec = (clientRec *)client;
if (client == (WindClient)NULL) return NULL; if (client == (WindClient)NULL) return NULL;
@ -366,8 +365,8 @@ WindGetClientName(client)
*/ */
WindClient WindClient
WindNextClient(client) WindNextClient(
WindClient client; WindClient client)
{ {
clientRec *cr = (clientRec *)client; clientRec *cr = (clientRec *)client;
int length; int length;
@ -393,8 +392,8 @@ WindNextClient(client)
*/ */
void void
WindPrintClientList(wizard) WindPrintClientList(
bool wizard; /* If true print the names of ALL clients, even those bool wizard) /* If true print the names of ALL clients, even those
* that don't have user-visable windows */ * that don't have user-visable windows */
{ {
clientRec *cr; clientRec *cr;
@ -424,10 +423,10 @@ WindPrintClientList(wizard)
*/ */
int int
WindExecute(w, rc, cmd) WindExecute(
MagWindow *w; MagWindow *w,
WindClient rc; WindClient rc,
TxCommand *cmd; TxCommand *cmd)
{ {
int cmdNum; int cmdNum;
clientRec *client = (clientRec *) rc; clientRec *client = (clientRec *) rc;
@ -469,11 +468,11 @@ WindExecute(w, rc, cmd)
*/ */
void void
WindAddCommand(rc, text, func, dynamic) WindAddCommand(
WindClient rc; WindClient rc,
char *text; char *text,
void (*func)(); void (*func)(),
bool dynamic; bool dynamic)
{ {
int cidx, numCommands = 0; int cidx, numCommands = 0;
clientRec *client = (clientRec *) rc; clientRec *client = (clientRec *) rc;
@ -552,10 +551,10 @@ WindAddCommand(rc, text, func, dynamic)
*/ */
int int
WindReplaceCommand(rc, command, newfunc) WindReplaceCommand(
WindClient rc; WindClient rc,
char *command; char *command,
void (*newfunc)(); void (*newfunc)())
{ {
int cidx, clen; int cidx, clen;
clientRec *client = (clientRec *) rc; clientRec *client = (clientRec *) rc;
@ -595,8 +594,8 @@ WindReplaceCommand(rc, command, newfunc)
*/ */
const char * const * const char * const *
WindGetCommandTable(rc) WindGetCommandTable(
WindClient rc; WindClient rc)
{ {
clientRec *client = (clientRec *) rc; clientRec *client = (clientRec *) rc;
return client->w_commandTable; return client->w_commandTable;

View File

@ -75,8 +75,8 @@ int windCurNumWindows = 0;
*/ */
void void
windUnlink(w) windUnlink(
MagWindow *w; MagWindow *w)
{ {
ASSERT(w != (MagWindow *) NULL, "windUnlink"); ASSERT(w != (MagWindow *) NULL, "windUnlink");
ASSERT(windTopWindow != (MagWindow *) NULL, "windUnlink"); ASSERT(windTopWindow != (MagWindow *) NULL, "windUnlink");
@ -127,8 +127,8 @@ windUnlink(w)
*/ */
void void
windFree(w) windFree(
MagWindow *w; MagWindow *w)
{ {
windWindowMask &= ~(1 << w->w_wid); windWindowMask &= ~(1 << w->w_wid);
windCurNumWindows--; windCurNumWindows--;
@ -158,8 +158,8 @@ windFree(w)
*/ */
void void
WindSetWindowAreas(w) WindSetWindowAreas(
MagWindow *w; MagWindow *w)
{ {
switch ( WindPackageType ) switch ( WindPackageType )
{ {
@ -193,8 +193,8 @@ WindSetWindowAreas(w)
*/ */
void void
windSetWindowPosition(w) windSetWindowPosition(
MagWindow *w; MagWindow *w)
{ {
} }
@ -214,8 +214,8 @@ windSetWindowPosition(w)
*/ */
bool bool
WindDelete(w) WindDelete(
MagWindow *w; MagWindow *w)
{ {
clientRec *cr; clientRec *cr;
@ -253,16 +253,16 @@ WindDelete(w)
*/ */
MagWindow * MagWindow *
WindCreate(client, frameArea, isHint, argc, argv) WindCreate(
WindClient client; /* The client that will control this window */ WindClient client, /* The client that will control this window */
Rect *frameArea; /* The area that the window is to occupy */ Rect *frameArea, /* The area that the window is to occupy */
bool isHint; /* TRUE if the above rectangle is only a bool isHint, /* TRUE if the above rectangle is only a
* hint and it is OK for a window package to * hint and it is OK for a window package to
* override it to maintain a consistent * override it to maintain a consistent
* user interface. * user interface.
*/ */
int argc; /* Passed to the client */ int argc, /* Passed to the client */
char *argv[]; char *argv[])
{ {
MagWindow *w; MagWindow *w;
clientRec *cr; clientRec *cr;
@ -386,12 +386,12 @@ WindCreate(client, frameArea, isHint, argc, argv)
*/ */
void void
WindOutToIn(w, out, in) WindOutToIn(
MagWindow *w; /* Window under consideration */ MagWindow *w, /* Window under consideration */
Rect *out; /* Pointer to rectangle of outside area of Rect *out, /* Pointer to rectangle of outside area of
* a window. * a window.
*/ */
Rect *in; /* Pointer to rectangle to be filled in with Rect *in) /* Pointer to rectangle to be filled in with
* inside area corresponding to out. * inside area corresponding to out.
*/ */
{ {
@ -435,8 +435,8 @@ void WindInToOut(w, in, out)
*/ */
void void
WindUnder(w) WindUnder(
MagWindow *w; /* the window to be moved */ MagWindow *w) /* the window to be moved */
{ {
Rect area; Rect area;
MagWindow *w2; MagWindow *w2;
@ -492,8 +492,8 @@ WindUnder(w)
*/ */
void void
WindOver(w) WindOver(
MagWindow *w; /* the window to be moved */ MagWindow *w) /* the window to be moved */
{ {
LinkedRect *r; LinkedRect *r;
Rect area; Rect area;
@ -557,9 +557,9 @@ WindOver(w)
*/ */
bool bool
windFindUnobscured(area, okArea) windFindUnobscured(
Rect *area; /* Area that may be obscured. */ Rect *area, /* Area that may be obscured. */
Rect *okArea; /* Modified to contain one of the Rect *okArea) /* Modified to contain one of the
* unobscured areas. * unobscured areas.
*/ */
{ {
@ -593,14 +593,14 @@ windFindUnobscured(area, okArea)
*/ */
void void
WindReframe(w, r, inside, move) WindReframe(
MagWindow *w; /* the window to be reframed */ MagWindow *w, /* the window to be reframed */
Rect *r; /* the new location in screen coordinates */ Rect *r, /* the new location in screen coordinates */
bool inside; /* TRUE if the rectangle is the screen location of bool inside, /* TRUE if the rectangle is the screen location of
* the inside of the window, FALSE if the above * the inside of the window, FALSE if the above
* rectangle includes border areas. * rectangle includes border areas.
*/ */
bool move; /* Move the coordinate system of the window the same bool move) /* Move the coordinate system of the window the same
* amount as the lower left corner of the window? * amount as the lower left corner of the window?
*/ */
{ {
@ -721,10 +721,9 @@ WindReframe(w, r, inside, move)
} }
bool bool
windReframeFunc(area, w) windReframeFunc(
Rect *area; /* Area to redisplay. */ Rect *area, /* Area to redisplay. */
MagWindow *w; /* Window in which to redisplay. */ MagWindow *w) /* Window in which to redisplay. */
{ {
WindAreaChanged(w, area); WindAreaChanged(w, area);
return FALSE; return FALSE;
@ -749,8 +748,8 @@ windReframeFunc(area, w)
*/ */
void void
WindFullScreen(w) WindFullScreen(
MagWindow *w; /* Window to be blown up or shrunk back. */ MagWindow *w) /* Window to be blown up or shrunk back. */
{ {
int i; int i;
MagWindow *w2; MagWindow *w2;

View File

@ -51,9 +51,9 @@ static char rcsid[] __attribute__ ((unused)) = "$Header$";
*/ */
MagWindow * MagWindow *
windSearchPoint(p, inside) windSearchPoint(
Point *p; /* A point in screen coordinates */ Point *p, /* A point in screen coordinates */
bool *inside; /* A pointer to a boolean variable that is set to bool *inside) /* A pointer to a boolean variable that is set to
* TRUE if the point is in the interior of the window, * TRUE if the point is in the interior of the window,
* and FALSE if it is in the border. If this pointer * and FALSE if it is in the border. If this pointer
* is NULL then 'inside' is not filled in. * is NULL then 'inside' is not filled in.
@ -92,8 +92,8 @@ windSearchPoint(p, inside)
*/ */
MagWindow * MagWindow *
WindSearchWid(wid) WindSearchWid(
int wid; int wid)
{ {
MagWindow *w; MagWindow *w;
for(w = windTopWindow; w != (MagWindow *) NULL; w = w->w_nextWindow) { for(w = windTopWindow; w != (MagWindow *) NULL; w = w->w_nextWindow) {
@ -119,8 +119,8 @@ WindSearchWid(wid)
*/ */
MagWindow * MagWindow *
WindSearchData(grdata) WindSearchData(
ClientData grdata; ClientData grdata)
{ {
MagWindow *w; MagWindow *w;
for(w = windTopWindow; w != (MagWindow *) NULL; w = w->w_nextWindow) { for(w = windTopWindow; w != (MagWindow *) NULL; w = w->w_nextWindow) {
@ -158,22 +158,22 @@ WindSearchData(grdata)
*/ */
int int
WindSearch(client, surfaceID, surfaceArea, func, clientData) WindSearch(
WindClient client; /* Search for the windows that belong to WindClient client, /* Search for the windows that belong to
* this client. NULL means all clients. * this client. NULL means all clients.
*/ */
ClientData surfaceID; /* The unique ID of the surface that we ClientData surfaceID, /* The unique ID of the surface that we
* are looking for. If NULL then look for * are looking for. If NULL then look for
* any surface. * any surface.
*/ */
Rect *surfaceArea; /* The area that we are looking for in surface Rect *surfaceArea, /* The area that we are looking for in surface
* coordinates. If NULL then match without * coordinates. If NULL then match without
* regard to the area in the window. * regard to the area in the window.
*/ */
int (*func)(); /* The function to call with each window int (*func)(), /* The function to call with each window
* that matches. * that matches.
*/ */
ClientData clientData; /* The client data to be passed to the caller's ClientData clientData) /* The client data to be passed to the caller's
* function. * function.
*/ */
{ {

View File

@ -83,10 +83,10 @@ extern void windHelp();
*/ */
int int
WindSendCommand(w, cmd, quiet) WindSendCommand(
MagWindow *w; MagWindow *w,
TxCommand *cmd; /* A pointer to a command */ TxCommand *cmd, /* A pointer to a command */
bool quiet; /* Don't print error/warning messages if this is set */ bool quiet) /* Don't print error/warning messages if this is set */
{ {
int windCmdNum, clientCmdNum; int windCmdNum, clientCmdNum;
clientRec *rc; clientRec *rc;
@ -351,8 +351,8 @@ WindSendCommand(w, cmd, quiet)
*/ */
void void
WindGrabInput(client) WindGrabInput(
WindClient client; WindClient client)
{ {
ASSERT( client != NULL, "WindGrabInput"); ASSERT( client != NULL, "WindGrabInput");
StackPush( (ClientData) windGrabber, windGrabberStack); StackPush( (ClientData) windGrabber, windGrabberStack);
@ -376,8 +376,8 @@ WindGrabInput(client)
*/ */
void void
WindReleaseInput(client) WindReleaseInput(
WindClient client; WindClient client)
{ {
ASSERT( client == windGrabber, "WindReleaseInput"); ASSERT( client == windGrabber, "WindReleaseInput");
windGrabber = (WindClient) StackPop(windGrabberStack); windGrabber = (WindClient) StackPop(windGrabberStack);
@ -399,12 +399,12 @@ WindReleaseInput(client)
*/ */
void void
windHelp(cmd, name, table) windHelp(
TxCommand *cmd; /* Information about command options. */ TxCommand *cmd, /* Information about command options. */
char *name; /* Name of client for whom help is being char *name, /* Name of client for whom help is being
* printed. * printed.
*/ */
char *table[]; /* Client's command table. */ char *table[]) /* Client's command table. */
{ {
static char *capName = NULL; static char *capName = NULL;
static char patString[200], *pattern; static char patString[200], *pattern;

View File

@ -45,12 +45,12 @@ static char rcsid[] __attribute__ ((unused)) = "$Header$";
*/ */
void void
WindScreenToSurface(w, screen, surface) WindScreenToSurface(
MagWindow *w; /* Window in whose coordinates screen is MagWindow *w, /* Window in whose coordinates screen is
* is defined. * is defined.
*/ */
Rect *screen; /* A rectangle in screen coordinates */ Rect *screen, /* A rectangle in screen coordinates */
Rect *surface; /* A pointer to a rectangle to be filled Rect *surface) /* A pointer to a rectangle to be filled
* in with a rectangle in surface coords that * in with a rectangle in surface coords that
* is big enough to contain everything * is big enough to contain everything
* displayed within the screen rectangle. * displayed within the screen rectangle.
@ -87,15 +87,15 @@ WindScreenToSurface(w, screen, surface)
*/ */
void void
WindPointToSurface(w, screenPoint, surfacePoint, surfaceBox) WindPointToSurface(
MagWindow *w; /* Window in whose coordinate system the MagWindow *w, /* Window in whose coordinate system the
* transformation is to be done. * transformation is to be done.
*/ */
Point *screenPoint; /* The point in screen coordinates. */ Point *screenPoint, /* The point in screen coordinates. */
Point *surfacePoint;/* Filled in with the nearest surface coordinate. Point *surfacePoint, /* Filled in with the nearest surface coordinate.
* Nothing is filled in if the pointer is NULL. * Nothing is filled in if the pointer is NULL.
*/ */
Rect *surfaceBox; /* Filled in with a box in surface coordinates that Rect *surfaceBox) /* Filled in with a box in surface coordinates that
* surrounds the point. It is not filled in if this * surrounds the point. It is not filled in if this
* is a NULL pointer. * is a NULL pointer.
*/ */
@ -175,12 +175,12 @@ WindPointToSurface(w, screenPoint, surfacePoint, surfaceBox)
*/ */
void void
WindSurfaceToScreen(w, surface, screen) WindSurfaceToScreen(
MagWindow *w; /* Window in whose coordinate system the MagWindow *w, /* Window in whose coordinate system the
* transform is to be done. * transform is to be done.
*/ */
Rect *surface; /* Rectangle in surface coordinates of w. */ Rect *surface, /* Rectangle in surface coordinates of w. */
Rect *screen; /* Rectangle filled in with screen coordinates Rect *screen) /* Rectangle filled in with screen coordinates
* (in w) of surface. * (in w) of surface.
*/ */
{ {
@ -265,10 +265,10 @@ WindSurfaceToScreen(w, surface, screen)
*/ */
void void
WindSurfaceToScreenNoClip(w, surface, screen) WindSurfaceToScreenNoClip(
MagWindow *w; MagWindow *w,
Rect *surface; Rect *surface,
Rect *screen; Rect *screen)
{ {
dlong tmp, dval; dlong tmp, dval;
@ -306,12 +306,12 @@ WindSurfaceToScreenNoClip(w, surface, screen)
*/ */
void void
WindPointToScreen(w, surface, screen) WindPointToScreen(
MagWindow *w; /* Window in whose coordinate system the MagWindow *w, /* Window in whose coordinate system the
* transform is to be done. * transform is to be done.
*/ */
Point *surface; /* Point in surface coordinates of w. */ Point *surface, /* Point in surface coordinates of w. */
Point *screen; /* Point filled in with screen coordinates Point *screen) /* Point filled in with screen coordinates
* (in w) of surface. * (in w) of surface.
*/ */
{ {
@ -352,12 +352,12 @@ WindPointToScreen(w, surface, screen)
*/ */
void void
windScreenToFrame(w, screen, frame) windScreenToFrame(
MagWindow *w; /* Window in whose coordinate system the MagWindow *w, /* Window in whose coordinate system the
* transform is to be done. * transform is to be done.
*/ */
Point *screen; /* Point in screen coordinates of w. */ Point *screen, /* Point in screen coordinates of w. */
Point *frame; /* Point filled in with frame coordinates. Point *frame) /* Point filled in with frame coordinates.
*/ */
{ {
switch ( WindPackageType ) switch ( WindPackageType )

View File

@ -62,8 +62,8 @@ extern void windNewView();
*/ */
void void
windFixSurfaceArea(w) windFixSurfaceArea(
MagWindow *w; /* Window to fix up. */ MagWindow *w) /* Window to fix up. */
{ {
Rect newArea, tmp; Rect newArea, tmp;
@ -92,8 +92,8 @@ windFixSurfaceArea(w)
*/ */
void void
WindUnload(surfaceID) WindUnload(
ClientData surfaceID; /* A unique ID for this surface */ ClientData surfaceID) /* A unique ID for this surface */
{ {
MagWindow *mw; MagWindow *mw;
@ -120,11 +120,11 @@ WindUnload(surfaceID)
*/ */
bool bool
WindLoad(w, client, surfaceID, surfaceArea) WindLoad(
MagWindow *w; MagWindow *w,
WindClient client; /* The unique identifier of the client */ WindClient client, /* The unique identifier of the client */
ClientData surfaceID; /* A unique ID for this surface */ ClientData surfaceID, /* A unique ID for this surface */
Rect *surfaceArea; /* The area that should appear in the window */ Rect *surfaceArea) /* The area that should appear in the window */
{ {
if (client != w->w_client) return FALSE; if (client != w->w_client) return FALSE;
@ -151,9 +151,9 @@ WindLoad(w, client, surfaceID, surfaceArea)
*/ */
void void
WindMove(w, surfaceArea) WindMove(
MagWindow *w; /* the window to be panned */ MagWindow *w, /* the window to be panned */
Rect *surfaceArea; /* The area to be viewed */ Rect *surfaceArea) /* The area to be viewed */
{ {
int size, xscale, yscale; int size, xscale, yscale;
int halfSizePixels, halfSizeUnits; int halfSizePixels, halfSizeUnits;
@ -232,9 +232,9 @@ WindMove(w, surfaceArea)
*/ */
void void
WindZoom(w, factor) WindZoom(
MagWindow *w; /* the window to be zoomed */ MagWindow *w, /* the window to be zoomed */
float factor; /* The amount to zoom by (1 is no change), float factor) /* The amount to zoom by (1 is no change),
* greater than 1 is a larger magnification * greater than 1 is a larger magnification
* (zoom in), and less than 1 is less mag. * (zoom in), and less than 1 is less mag.
* (zoom out) ) * (zoom out) )
@ -274,8 +274,9 @@ WindZoom(w, factor)
*/ */
void void
WindScale(scalen, scaled) WindScale(
int scalen, scaled; int scalen,
int scaled)
{ {
MagWindow *w2; MagWindow *w2;
Rect newArea; Rect newArea;
@ -313,8 +314,9 @@ WindScale(scalen, scaled)
*/ */
void void
WindTranslate(origx, origy) WindTranslate(
int origx, origy; int origx,
int origy)
{ {
extern bool DBMovePoint(); extern bool DBMovePoint();
MagWindow *w2; MagWindow *w2;
@ -355,8 +357,8 @@ WindTranslate(origx, origy)
/* ARGSUSED */ /* ARGSUSED */
void void
WindView(w) WindView(
MagWindow *w; MagWindow *w)
{ {
Rect bbox; Rect bbox;
#define SLOP 10 /* Amount of border (in fraction of a screenfull) #define SLOP 10 /* Amount of border (in fraction of a screenfull)
@ -399,15 +401,15 @@ WindView(w)
*/ */
void void
WindScroll(w, surfaceOffset, screenOffset) WindScroll(
MagWindow *w; MagWindow *w,
Point *surfaceOffset; /* An offset in surface coordinates. The Point *surfaceOffset, /* An offset in surface coordinates. The
* screen point that used to display surface * screen point that used to display surface
* point (0,0) will now display surface point * point (0,0) will now display surface point
* surfaceOffset. Can be NULL to indicate * surfaceOffset. Can be NULL to indicate
* no offset. * no offset.
*/ */
Point *screenOffset; /* An additional offset in screen coordinates. Point *screenOffset) /* An additional offset in screen coordinates.
* Can be NULL to indicate no offset. If * Can be NULL to indicate no offset. If
* non-NULL, then after scrolling according * non-NULL, then after scrolling according
* to surfaceOffset, the view is adjusted again * to surfaceOffset, the view is adjusted again

View File

@ -26,6 +26,12 @@
#include "utils/magic.h" #include "utils/magic.h"
#include "utils/geometry.h" #include "utils/geometry.h"
/* Forward declarations to avoid circular includes */
struct GR_GLY2;
typedef struct GR_GLY2 GrGlyph;
struct TxCommand_;
typedef struct TxCommand_ TxCommand;
/* SUBPIXELBITS represents a fixed-point shift for representing the */ /* SUBPIXELBITS represents a fixed-point shift for representing the */
/* scale factor between the screen and the layout. It is only */ /* scale factor between the screen and the layout. It is only */
/* necessary that the screen resolution * SUBPIXEL does not overflow */ /* necessary that the screen resolution * SUBPIXEL does not overflow */
@ -236,8 +242,8 @@ typedef struct WIND_S1 {
#define WIND_NO_WINDOW -3 /* Use NULL for the window */ #define WIND_NO_WINDOW -3 /* Use NULL for the window */
/* utility procs & special stuff */ /* utility procs & special stuff */
extern MagWindow *WindCreate(); extern MagWindow *WindCreate(WindClient client, Rect *frameArea, bool isHint, int argc, char *argv[]);
extern WindClient WindGetClient(); extern WindClient WindGetClient(char *clientName, bool exact);
extern WindClient WindNextClient(); extern WindClient WindNextClient();
extern WindClient WindAddClient(); extern WindClient WindAddClient();
extern char *WindGetClientName(); extern char *WindGetClientName();
@ -246,10 +252,10 @@ extern void WindUpdate();
extern void WindDrawBorder(); extern void WindDrawBorder();
extern void WindOutToIn(); extern void WindOutToIn();
extern void WindInToOut(); extern void WindInToOut();
extern void WindSetWindowAreas(); extern void WindSetWindowAreas(MagWindow *w);
extern void windFixSurfaceArea(); extern void windFixSurfaceArea();
extern int WindExecute(); extern int WindExecute(MagWindow *w, WindClient rc, TxCommand *cmd);
extern void WindAddCommand(); extern void WindAddCommand(WindClient rc, char *text, void (*func)(), bool dynamic);
extern int WindReplaceCommand(); extern int WindReplaceCommand();
extern const char * const *WindGetCommandTable(); extern const char * const *WindGetCommandTable();
extern int windCheckOnlyWindow(MagWindow **, WindClient); extern int windCheckOnlyWindow(MagWindow **, WindClient);
@ -262,8 +268,8 @@ extern MagWindow *WindSearchData();
/* procs for moving the surface inside of a window (changing the view) */ /* procs for moving the surface inside of a window (changing the view) */
extern void WindZoom(); extern void WindZoom(MagWindow *w, float factor);
extern void WindMove(); extern void WindMove(MagWindow *w, Rect *surfaceArea);
extern void WindView(); extern void WindView();
extern void WindScroll(); extern void WindScroll();
@ -271,21 +277,21 @@ extern void WindScroll();
/* procs for moving the window itself */ /* procs for moving the window itself */
extern void WindOver(); extern void WindOver();
extern void WindUnder(); extern void WindUnder();
extern void WindReframe(); extern void WindReframe(MagWindow *w, Rect *r, bool inside, bool move);
extern void WindFullScreen(); extern void WindFullScreen();
/* procs to transform into and out of screen coordinates */ /* procs to transform into and out of screen coordinates */
extern void WindScreenToSurface(); extern void WindScreenToSurface();
extern void WindSurfaceToScreen(); extern void WindSurfaceToScreen(MagWindow *w, Rect *surface, Rect *screen);
extern void WindPointToSurface(); extern void WindPointToSurface(MagWindow *w, Point *screenPoint, Point *surfacePoint, Rect *surfaceBox);
extern void WindPointToScreen(); extern void WindPointToScreen();
extern void WindSurfaceToScreenNoClip(); extern void WindSurfaceToScreenNoClip();
/* procs to change things or inform the window manager about changes */ /* procs to change things or inform the window manager about changes */
extern void WindCaption(); extern void WindCaption(MagWindow *w, char *caption);
extern void WindAreaChanged(); extern void WindAreaChanged(MagWindow *w, Rect *area);
extern void WindIconChanged(); extern void WindIconChanged();
extern bool WindLoad(); extern bool WindLoad();
extern void WindSeparateRedisplay(); extern void WindSeparateRedisplay();
@ -302,7 +308,7 @@ extern void WindRedisplay();
extern void windUnlink(); extern void windUnlink();
extern void windReClip(); extern void windReClip();
extern void windFree(); extern void windFree();
extern int WindSendCommand(); extern int WindSendCommand(MagWindow *w, TxCommand *cmd, bool quiet);
/* interface variables */ /* interface variables */
extern int WindDefaultFlags; /* Mask of properties applied to new windows */ extern int WindDefaultFlags; /* Mask of properties applied to new windows */