graphics: convert K&R function definitions to ANSI C

Convert the old-style (K&R) function definitions in graphics/ 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.

Adds a forward typedef for TileType in graphics.h so the GrClipTriangle
prototype can name it without creating a circular include with the
database layer.

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:48:52 +02:00
parent da2438e5cf
commit 4f8c244876
No known key found for this signature in database
GPG Key ID: 588785BFDFB01ABD
27 changed files with 851 additions and 744 deletions

View File

@ -84,16 +84,16 @@ bool W3Ddelete();
/* ------------------------Low-Level Routines--------------------------------- */
void
w3dLock(w)
MagWindow *w;
w3dLock(
MagWindow *w)
{
grSimpleLock(w, TRUE);
w3dSetProjection(w);
}
void
w3dUnlock(w)
MagWindow *w;
w3dUnlock(
MagWindow *w)
{
glFlush();
glFinish();
@ -111,11 +111,11 @@ w3dUnlock(w)
/* -------------------Low-Level Drawing Routines------------------------------ */
void
w3dFillEdge(bbox, r, ztop, zbot)
Rect *bbox; /* tile bounding box */
Rect *r;
float ztop;
float zbot;
w3dFillEdge(
Rect *bbox, /* tile bounding box */
Rect *r,
float ztop,
float zbot)
{
float ztmp;
float xbot = (float)r->r_xbot;
@ -142,11 +142,11 @@ w3dFillEdge(bbox, r, ztop, zbot)
}
void
w3dFillPolygon(p, np, zval, istop)
Point *p;
int np;
float zval;
bool istop;
w3dFillPolygon(
Point *p,
int np,
float zval,
bool istop)
{
int i;
@ -162,10 +162,10 @@ w3dFillPolygon(p, np, zval, istop)
}
void
w3dFillTile(r, zval, istop)
Rect *r;
float zval;
bool istop;
w3dFillTile(
Rect *r,
float zval,
bool istop)
{
float xbot, ybot, xtop, ytop;
@ -192,8 +192,12 @@ w3dFillTile(r, zval, istop)
}
void
w3dFillXSide(xstart, xend, yval, ztop, zbot)
float xstart, xend, yval, ztop, zbot;
w3dFillXSide(
float xstart,
float xend,
float yval,
float ztop,
float zbot)
{
glBegin(GL_POLYGON);
glVertex3f(xstart, yval, zbot);
@ -204,8 +208,12 @@ w3dFillXSide(xstart, xend, yval, ztop, zbot)
}
void
w3dFillYSide(xval, ystart, yend, ztop, zbot)
float xval, ystart, yend, ztop, zbot;
w3dFillYSide(
float xval,
float ystart,
float yend,
float ztop,
float zbot)
{
glBegin(GL_POLYGON);
glVertex3f(xval, ystart, zbot);
@ -219,8 +227,13 @@ w3dFillYSide(xval, ystart, yend, ztop, zbot)
/* counterclockwise direction with respect to the tile interior. */
void
w3dFillDiagonal(x1, y1, x2, y2, ztop, zbot)
float x1, y1, x2, y2, ztop, zbot;
w3dFillDiagonal(
float x1,
float y1,
float x2,
float y2,
float ztop,
float zbot)
{
glBegin(GL_POLYGON);
glVertex3f(x1, y1, zbot);
@ -231,13 +244,13 @@ w3dFillDiagonal(x1, y1, x2, y2, ztop, zbot)
}
void
w3dFillOps(trans, tile, dinfo, cliprect, ztop, zbot)
Transform *trans;
Tile *tile;
TileType dinfo;
Rect *cliprect;
float ztop;
float zbot;
w3dFillOps(
Transform *trans,
Tile *tile,
TileType dinfo,
Rect *cliprect,
float ztop,
float zbot)
{
LinkedRect *tilesegs, *segptr;
Rect r, r2;
@ -381,11 +394,11 @@ w3dFillOps(trans, tile, dinfo, cliprect, ztop, zbot)
}
void
w3dRenderVolume(tile, dinfo, trans, cliprect)
Tile *tile;
TileType dinfo;
Transform *trans;
Rect *cliprect;
w3dRenderVolume(
Tile *tile,
TileType dinfo,
Transform *trans,
Rect *cliprect)
{
float zbot, ztop;
float ftop = 0.0, fthk = 0.0;
@ -413,11 +426,11 @@ w3dRenderVolume(tile, dinfo, trans, cliprect)
}
void
w3dRenderCIF(tile, dinfo, layer, trans)
Tile *tile;
TileType dinfo;
CIFLayer *layer;
Transform *trans;
w3dRenderCIF(
Tile *tile,
TileType dinfo,
CIFLayer *layer,
Transform *trans)
{
float zbot, ztop;
float ftop, fthk;
@ -468,8 +481,8 @@ w3dClear()
/* -------------------High-Level Drawing Routines------------------------------ */
void
w3dSetProjection(w)
MagWindow *w;
w3dSetProjection(
MagWindow *w)
{
W3DclientRec *crec;
Window wind;
@ -546,10 +559,10 @@ w3dSetProjection(w)
/* Magic layer tile painting function */
int
w3dPaintFunc(tile, dinfo, cxp)
Tile *tile; /* Tile to be displayed */
TileType dinfo; /* Split tile information */
TreeContext *cxp; /* From DBTreeSrTiles */
w3dPaintFunc(
Tile *tile, /* Tile to be displayed */
TileType dinfo, /* Split tile information */
TreeContext *cxp) /* From DBTreeSrTiles */
{
SearchContext *scx = cxp->tc_scx;
@ -593,10 +606,10 @@ w3dPaintFunc(tile, dinfo, cxp)
/* CIF layer tile painting function */
int
w3dCIFPaintFunc(tile, dinfo, arg)
Tile *tile; /* Tile to be displayed */
TileType dinfo; /* Split tile information */
ClientData *arg; /* is NULL */
w3dCIFPaintFunc(
Tile *tile, /* Tile to be displayed */
TileType dinfo, /* Split tile information */
ClientData *arg) /* is NULL */
{
CIFLayer *layer = (CIFLayer *)arg;
@ -648,9 +661,9 @@ w3dCIFPaintFunc(tile, dinfo, arg)
*/
void
w3dHelp(w, cmd)
MagWindow *w;
TxCommand *cmd;
w3dHelp(
MagWindow *w,
TxCommand *cmd)
{
const char * const *msg;
W3DclientRec *crec = (W3DclientRec *) w->w_clientData;
@ -679,9 +692,9 @@ w3dHelp(w, cmd)
*/
void
w3dCutBox(w, cmd)
MagWindow *w;
TxCommand *cmd;
w3dCutBox(
MagWindow *w,
TxCommand *cmd)
{
bool hide = FALSE;
int lidx = 1, num_layers;
@ -768,9 +781,9 @@ w3dCutBox(w, cmd)
*/
void
w3dSeeLayers(w, cmd)
MagWindow *w;
TxCommand *cmd;
w3dSeeLayers(
MagWindow *w,
TxCommand *cmd)
{
bool hide = FALSE;
int lidx = 1, num_layers;
@ -821,9 +834,9 @@ w3dSeeLayers(w, cmd)
*/
void
w3dClose(w, cmd)
MagWindow *w;
TxCommand *cmd;
w3dClose(
MagWindow *w,
TxCommand *cmd)
{
W3DclientRec *crec = (W3DclientRec *) w->w_clientData;
@ -844,9 +857,9 @@ w3dClose(w, cmd)
*/
void
w3dRescale(crec, scalefactor)
W3DclientRec *crec;
float scalefactor;
w3dRescale(
W3DclientRec *crec,
float scalefactor)
{
crec->scale_xy /= scalefactor;
crec->prescale_z /= scalefactor;
@ -867,9 +880,9 @@ w3dRescale(crec, scalefactor)
*/
void
w3dToggleCIF(w, cmd)
MagWindow *w;
TxCommand *cmd;
w3dToggleCIF(
MagWindow *w,
TxCommand *cmd)
{
W3DclientRec *crec = (W3DclientRec *) w->w_clientData;
@ -906,9 +919,9 @@ w3dToggleCIF(w, cmd)
*/
void
w3dLevel(w, cmd)
MagWindow *w;
TxCommand *cmd;
w3dLevel(
MagWindow *w,
TxCommand *cmd)
{
W3DclientRec *crec = (W3DclientRec *) w->w_clientData;
@ -946,8 +959,8 @@ w3dLevel(w, cmd)
*/
void
w3drefreshFunc(mw)
MagWindow *mw;
w3drefreshFunc(
MagWindow *mw)
{
W3DclientRec *crec = (W3DclientRec *) mw->w_clientData;
Rect screenRect;
@ -972,9 +985,9 @@ w3drefreshFunc(mw)
*/
void
w3dDefaults(w, cmd)
MagWindow *w;
TxCommand *cmd;
w3dDefaults(
MagWindow *w,
TxCommand *cmd)
{
W3DclientRec *crec = (W3DclientRec *) w->w_clientData;
@ -998,9 +1011,9 @@ w3dDefaults(w, cmd)
*/
void
w3dRefresh(w, cmd)
MagWindow *w;
TxCommand *cmd;
w3dRefresh(
MagWindow *w,
TxCommand *cmd)
{
W3DclientRec *crec = (W3DclientRec *) w->w_clientData;
@ -1022,9 +1035,9 @@ w3dRefresh(w, cmd)
*/
void
w3dView(w, cmd)
MagWindow *w;
TxCommand *cmd;
w3dView(
MagWindow *w,
TxCommand *cmd)
{
bool relative = FALSE;
int argc = cmd->tx_argc;
@ -1094,9 +1107,9 @@ w3dView(w, cmd)
*/
void
w3dScroll(w, cmd)
MagWindow *w;
TxCommand *cmd;
w3dScroll(
MagWindow *w,
TxCommand *cmd)
{
bool relative = FALSE;
int argc = cmd->tx_argc;
@ -1167,9 +1180,9 @@ w3dScroll(w, cmd)
*/
void
w3dZoom(w, cmd)
MagWindow *w;
TxCommand *cmd;
w3dZoom(
MagWindow *w,
TxCommand *cmd)
{
bool relative = FALSE;
int argc = cmd->tx_argc;
@ -1244,9 +1257,9 @@ w3dZoom(w, cmd)
*/
void
w3dRenderValues(w, cmd)
MagWindow *w;
TxCommand *cmd;
w3dRenderValues(
MagWindow *w,
TxCommand *cmd)
{
int lidx;
CIFLayer *layer;
@ -1329,9 +1342,9 @@ badusage:
*/
void
Set3DDefaults(mw, crec)
MagWindow *mw;
W3DclientRec *crec;
Set3DDefaults(
MagWindow *mw,
W3DclientRec *crec)
{
int height, width;
int centerx, centery;
@ -1399,9 +1412,9 @@ Set3DDefaults(mw, crec)
*/
bool
W3DloadWindow(window, name)
MagWindow *window;
char *name;
W3DloadWindow(
MagWindow *window,
char *name)
{
CellDef *newEditDef;
CellUse *newEditUse;
@ -1444,10 +1457,10 @@ W3DloadWindow(window, name)
*/
bool
W3Dcreate(window, argc, argv)
MagWindow *window;
int argc;
char *argv[];
W3Dcreate(
MagWindow *window,
int argc,
char *argv[])
{
W3DclientRec *crec;
Tk_Window tkwind, tktop;
@ -1614,8 +1627,8 @@ W3Dcreate(window, argc, argv)
*/
bool
W3Ddelete(window)
MagWindow *window;
W3Ddelete(
MagWindow *window)
{
W3DclientRec *cr;
Tk_Window xw;
@ -1647,10 +1660,10 @@ W3Ddelete(window)
*/
void
W3Dredisplay(w, rootArea, clipArea)
MagWindow *w; /* The window containing the area. */
Rect *rootArea; /* Ignore this---area defined by window with box */
Rect *clipArea; /* Ignore this, too */
W3Dredisplay(
MagWindow *w, /* The window containing the area. */
Rect *rootArea, /* Ignore this---area defined by window with box */
Rect *clipArea) /* Ignore this, too */
{
W3DclientRec *crec;
CellDef *cellDef;
@ -1724,10 +1737,10 @@ W3Dredisplay(w, rootArea, clipArea)
*/
void
W3DCIFredisplay(w, rootArea, clipArea)
MagWindow *w; /* The window containing the area. */
Rect *rootArea; /* Ignore this---area defined by window with box */
Rect *clipArea; /* Ignore this, too */
W3DCIFredisplay(
MagWindow *w, /* The window containing the area. */
Rect *rootArea, /* Ignore this---area defined by window with box */
Rect *clipArea) /* Ignore this, too */
{
W3DclientRec *crec;
SearchContext scx;
@ -1801,9 +1814,9 @@ W3DCIFredisplay(w, rootArea, clipArea)
*/
void
W3Dcommand(w, cmd)
MagWindow *w;
TxCommand *cmd;
W3Dcommand(
MagWindow *w,
TxCommand *cmd)
{
int cmdNum;

View File

@ -70,9 +70,9 @@ sigRetVal MapWindow();
#define TIMEOUT 10 /* timeout period (minutes) */
int
main (argc, argv)
int argc;
char **argv;
main(
int argc,
char **argv)
{
XEvent xevent;
@ -126,8 +126,8 @@ main (argc, argv)
*/
void
ParseEvent (event)
XEvent *event;
ParseEvent(
XEvent *event)
{
if (event->type == KeyPress)
{
@ -269,7 +269,8 @@ SetTimeOut()
*/
sigRetVal
TimeOut(int signo)
TimeOut(
int signo)
{
int tmpid;
@ -293,7 +294,8 @@ TimeOut(int signo)
*/
sigRetVal
MapWindow(int signo)
MapWindow(
int signo)
{
Window window;
@ -315,7 +317,9 @@ MapWindow(int signo)
*/
void
sigSetAction(int signo, sigRetVal (*handler)(int))
sigSetAction(
int signo,
sigRetVal (*handler)(int))
{
#if defined(SYSV) || defined(CYGWIN)
struct sigaction sa;

View File

@ -102,11 +102,11 @@ GrResetCMap()
*/
bool
GrReadCMap(techStyle, dispType, monType, path, libPath)
char *techStyle; /* The type of dstyle file requested by
GrReadCMap(
char *techStyle, /* The type of dstyle file requested by
* the current technology.
*/
char *dispType; /* A class of color map files for one or
char *dispType, /* A class of color map files for one or
* more display types. Usually this
* is defaulted to NULL, in which case the
* type required by the current driver is
@ -115,11 +115,11 @@ char *dispType; /* A class of color map files for one or
* needed at all (it's a black-and-white
* display), so nothing is loaded.
*/
char *monType; /* The class of monitors being used. Usually
char *monType, /* The class of monitors being used. Usually
* given as "std".
*/
char *path; /* a search path */
char *libPath; /* a library search path */
char *path, /* a search path */
char *libPath) /* a library search path */
{
int max, red, green, blue, newmax, argc, i;
@ -244,21 +244,21 @@ cleanup:
*/
bool
GrSaveCMap(techStyle, dispType, monType, path, libPath)
char *techStyle; /* The type of dstyle file requested by
GrSaveCMap(
char *techStyle, /* The type of dstyle file requested by
* the current technology.
*/
char *dispType; /* A class of color map files for one or
char *dispType, /* A class of color map files for one or
* more display types. Usually this
* is defaulted to NULL, in which case the
* type required by the current driver is
* used.
*/
char *monType; /* The class of monitors being used. Usually
char *monType, /* The class of monitors being used. Usually
* given as "std".
*/
char *path; /* a search path */
char *libPath; /* a library search path */
char *path, /* a search path */
char *libPath) /* a library search path */
{
FILE *f;
@ -319,8 +319,8 @@ char *libPath; /* a library search path */
*/
int
GrNameToColor(colorname)
char *colorname;
GrNameToColor(
char *colorname)
{
int i;
colorEntry *ce;
@ -351,9 +351,11 @@ GrNameToColor(colorname)
*/
bool
GrGetColor(color, red, green, blue)
int color; /* Color to be read. */
int *red, *green, *blue; /* Pointers to values of color elements. */
GrGetColor(
int color, /* Color to be read. */
int *red,
int *green,
int *blue)
{
colorEntry *ce;
@ -381,9 +383,11 @@ GrGetColor(color, red, green, blue)
*/
bool
GrPutColor(color, red, green, blue)
int color; /* Color to be changed. */
int red, green, blue; /* New intensities for color. */
GrPutColor(
int color, /* Color to be changed. */
int red,
int green,
int blue)
{
colorEntry *ce;
@ -425,15 +429,16 @@ GrPutColor(color, red, green, blue)
*/
void
GrPutManyColors(color, red, green, blue, opaqueBit)
int color; /* A specification of colors to be modified. */
int red, green, blue; /* New intensity values. */
int opaqueBit; /* The opaque/transparent bit. It is assumed
GrPutManyColors(
int color, /* A specification of colors to be modified. */
int red,
int green,
int blue,
int opaqueBit) /* The opaque/transparent bit. It is assumed
* that the opaque layer colors or
* transparent layer bits lie to the right
* of the opaque/transparent bit.
*/
{
int i;
int mask = color;

View File

@ -39,7 +39,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
/* Forward declaration: */
extern bool GrDisjoint();
extern void GrClipTriangle();
extern void GrClipTriangle(Rect *r, Rect *c, bool clipped, TileType dinfo, Point *points, int *np);
/* The following rectangle defines the size of the cross drawn for
* zero-size rectangles. This must be all on one line to keep
@ -83,8 +83,8 @@ int grCurOutline, grCurFill, grCurColor;
bool grDriverInformed = TRUE;
void
GrSetStuff(style)
int style;
GrSetStuff(
int style)
{
grCurDStyle = style;
grCurWMask = GrStyleTable[style].mask;
@ -136,11 +136,11 @@ grInformDriver()
*/
void
grClipAgainst(startllr, clip)
LinkedRect **startllr; /* A pointer to the pointer that heads
grClipAgainst(
LinkedRect **startllr, /* A pointer to the pointer that heads
* the list .
*/
Rect *clip; /* The rectangle to clip against */
Rect *clip) /* The rectangle to clip against */
{
extern bool grClipAddFunc(); /* forward declaration */
LinkedRect **llr, *lr;
@ -185,8 +185,8 @@ bool grClipAddFunc(box, cd)
void
grObsBox(r)
Rect *r;
grObsBox(
Rect *r)
{
LinkedRect *ob;
LinkedRect *ar;
@ -231,18 +231,17 @@ grObsBox(r)
*/
bool
grClipPoints(line, box, p1, p1OK, p2, p2OK)
Rect *line; /* Actually a line from line->r_ll to
grClipPoints(
Rect *line, /* Actually a line from line->r_ll to
* line->r_ur. It is assumed that r_ll is to
* the left of r_ur, but we don't assume that
* r_ll is below r_ur.
*/
Rect *box; /* A box to check intersections with */
Point *p1, *p2; /* To be filled in with 0, 1, or 2 points
* that are on the border of the box as well as
* on the line.
*/
bool *p1OK, *p2OK; /* Says if the point was filled in */
Rect *box, /* A box to check intersections with */
Point *p1,
bool *p1OK,
Point *p2,
bool *p2OK)
{
int tmp, delx, dely;
bool delyneg;
@ -376,8 +375,11 @@ grClipPoints(line, box, p1, p1OK, p2, p2OK)
*/
void
GrClipLine(x1, y1, x2, y2)
int x1, y1, x2, y2;
GrClipLine(
int x1,
int y1,
int x2,
int y2)
{
LinkedRect **ar;
LinkedRect *ob;
@ -527,9 +529,12 @@ deleteit: {
*/
void
grAddSegment(llx, lly, urx, ury, segments)
int llx, lly, urx, ury;
LinkedRect **segments;
grAddSegment(
int llx,
int lly,
int urx,
int ury,
LinkedRect **segments)
{
LinkedRect *curseg;
@ -571,10 +576,10 @@ grAddSegment(llx, lly, urx, ury, segments)
*/
bool
GrBoxOutline(tile, dinfo, tilesegs)
Tile *tile;
TileType dinfo;
LinkedRect **tilesegs;
GrBoxOutline(
Tile *tile,
TileType dinfo,
LinkedRect **tilesegs)
{
Rect rect;
TileType ttype;
@ -774,7 +779,11 @@ GrBoxOutline(tile, dinfo, tilesegs)
*---------------------------------------------------------
*/
void
GrBox(MagWindow *mw, Transform *trans, Tile *tile, TileType dinfo)
GrBox(
MagWindow *mw,
Transform *trans,
Tile *tile,
TileType dinfo)
{
Rect r, r2, clipr;
bool needClip, needObscure, simpleBox;
@ -984,11 +993,11 @@ GrBox(MagWindow *mw, Transform *trans, Tile *tile, TileType dinfo)
*/
void
GrDrawFastBox(prect, scale)
Rect *prect; /* The rectangle to be drawn, given in
GrDrawFastBox(
Rect *prect, /* The rectangle to be drawn, given in
* screen coordinates.
*/
int scale; /* If < 0, we reduce the cross size for
int scale) /* If < 0, we reduce the cross size for
* points according to the (negative) scale,
* so point labels don't dominate a top-level
* layout.
@ -1156,13 +1165,13 @@ GrDrawFastBox(prect, scale)
#define yround(d) (int)(((((d % width) << 1) >= width) ? 1 : 0) + (d / width))
void
GrClipTriangle(r, c, clipped, dinfo, points, np)
Rect *r; /* Bounding box of triangle, in screen coords */
Rect *c; /* Clipping rectangle */
bool clipped; /* Boolean, if bounding box is clipped */
TileType dinfo; /* Split side and direction information */
Point *points; /* Point array (up to 5 points) to fill */
int *np; /* Number of points in the clipped polygon */
GrClipTriangle(
Rect *r, /* Bounding box of triangle, in screen coords */
Rect *c, /* Clipping rectangle */
bool clipped, /* Boolean, if bounding box is clipped */
TileType dinfo, /* Split side and direction information */
Point *points, /* Point array (up to 5 points) to fill */
int *np) /* Number of points in the clipped polygon */
{
if (!(dinfo & TT_SIDE))
{
@ -1419,9 +1428,9 @@ GrClipTriangle(r, c, clipped, dinfo, points, np)
*/
void
GrDrawTriangleEdge(r, dinfo)
Rect *r; /* Bounding box of triangle, in screen coords */
TileType dinfo;
GrDrawTriangleEdge(
Rect *r, /* Bounding box of triangle, in screen coords */
TileType dinfo)
{
Point tpoints[5];
int tnum, i, j;
@ -1460,11 +1469,11 @@ GrDrawTriangleEdge(r, dinfo)
*/
void
GrDiagonal(prect, dinfo)
Rect *prect; /* The rectangle to be drawn, given in
GrDiagonal(
Rect *prect, /* The rectangle to be drawn, given in
* screen coordinates.
*/
TileType dinfo; /* split and direction information */
TileType dinfo) /* split and direction information */
{
Rect *r;
bool needClip, needObscure;
@ -1541,9 +1550,9 @@ GrDiagonal(prect, dinfo)
*/
void
GrFillPolygon(polyp, np)
Point *polyp; /* Array of points defining polygon */
int np; /* number of points in array polyp */
GrFillPolygon(
Point *polyp, /* Array of points defining polygon */
int np) /* number of points in array polyp */
{
if (grFillPolygonPtr != NULL)
{
@ -1567,11 +1576,11 @@ GrFillPolygon(polyp, np)
*/
void
GrClipBox(prect, style)
Rect *prect; /* The rectangle to be drawn, given in
GrClipBox(
Rect *prect, /* The rectangle to be drawn, given in
* screen coordinates.
*/
int style; /* The style to be used in drawing it. */
int style) /* The style to be used in drawing it. */
{
GrSetStuff(style);
GrFastBox(prect);
@ -1603,11 +1612,11 @@ GrClipBox(prect, style)
* ----------------------------------------------------------------------------
*/
bool
GrDisjoint(area, clipBox, func, cdarg)
Rect * area;
Rect * clipBox;
bool (*func) ();
ClientData cdarg;
GrDisjoint(
Rect * area,
Rect * clipBox,
bool (*func) (),
ClientData cdarg)
{
Rect ok, rArea;
bool result;

View File

@ -102,10 +102,10 @@ GR_STYLE_LINE *GrStyleTable;
bool
GrDrawGlyphNum(num, xoff, yoff)
int num;
int xoff;
int yoff;
GrDrawGlyphNum(
int num,
int xoff,
int yoff)
{
Point p;
@ -133,8 +133,8 @@ GrDrawGlyphNum(num, xoff, yoff)
*/
int
GrGetStyleFromName(stylename)
char *stylename;
GrGetStyleFromName(
char *stylename)
{
int style;
int maxstyles = TECHBEGINSTYLES + (DBWNumStyles * 2);
@ -196,9 +196,9 @@ GrResetStyles()
*/
bool
styleBuildDisplayStyle(line, version)
char *line;
int version;
styleBuildDisplayStyle(
char *line,
int version)
{
bool res;
int argsread;
@ -284,9 +284,9 @@ styleBuildDisplayStyle(line, version)
*/
bool
styleBuildStipplesStyle(line, version)
char *line;
int version;
styleBuildStipplesStyle(
char *line,
int version)
{
bool res;
int ord;
@ -360,9 +360,9 @@ styleBuildStipplesStyle(line, version)
*/
bool
GrLoadCursors(path, libPath)
char *path;
char *libPath;
GrLoadCursors(
char *path,
char *libPath)
{
if (grCursorGlyphs != (GrGlyphs *) NULL)
{
@ -402,8 +402,8 @@ char *libPath;
*/
int
GrLoadStyles(techType, path, libPath)
char *techType; /* Type of styles wanted by the technology
GrLoadStyles(
char *techType, /* Type of styles wanted by the technology
* file (usually "std"). We tack two things
* onto this name: the type of styles
* wanted by the display, and a version
@ -411,8 +411,8 @@ char *techType; /* Type of styles wanted by the technology
* to look up the actual display styles
* file.
*/
char *path;
char *libPath;
char *path,
char *libPath)
{
FILE *inp;
int res = 0;

View File

@ -54,8 +54,8 @@ extern void (*grFreeCursorPtr)();
*/
void
GrFreeGlyphs(g)
GrGlyphs *g;
GrFreeGlyphs(
GrGlyphs *g)
{
int i;
ASSERT(g != NULL, "GrFreeGlyphs");
@ -94,10 +94,11 @@ GrFreeGlyphs(g)
*/
bool
GrReadGlyphs(filename, path, libPath, gl)
char *filename;
char *path, *libPath; /* paths to search in for the file */
GrGlyphs **gl; /* To be filled in with a malloc'ed structure
GrReadGlyphs(
char *filename,
char *path,
char *libPath,
GrGlyphs **gl) /* To be filled in with a malloc'ed structure
* This structure must be freed by the caller
* if it is not to live forever.
*/

View File

@ -63,8 +63,8 @@ LinkedRect * grCurObscure; /* A list of obscuring areas */
*/
static char *
grWindName(w)
MagWindow *w;
grWindName(
MagWindow *w)
{
if (w == NULL) return "<NULL>";
if (w == GR_LOCK_SCREEN) return "<FULL-SCREEN>";
@ -92,11 +92,11 @@ grWindName(w)
*/
void
grSimpleLock(w, inside)
MagWindow *w; /* The window to lock, or GR_LOCK_SCREEN if the
grSimpleLock(
MagWindow *w, /* The window to lock, or GR_LOCK_SCREEN if the
* whole screen.
*/
bool inside; /* If TRUE, clip to inside of window, otherwise clip
bool inside) /* If TRUE, clip to inside of window, otherwise clip
* to outside of window.
*/
{
@ -128,8 +128,8 @@ grSimpleLock(w, inside)
void
grSimpleUnlock(w)
MagWindow *w;
grSimpleUnlock(
MagWindow *w)
{
ASSERT(w != NULL, "grSimpleUnlock");
if (grTraceLocks) TxError("--- Unlock %s\n", grWindName(w));
@ -160,8 +160,8 @@ grSimpleUnlock(w)
*/
void
GrClipTo(r)
Rect *r;
GrClipTo(
Rect *r)
{
if (grLockedWindow == NULL) return;
if (grLockScreen)

View File

@ -243,13 +243,12 @@ void (*GrResumePtr)() = grNullProc;
*/
bool
GrSetDisplay(type, outName, mouseName)
char *type; /* Name of the display type. */
char *outName; /* Filename used for communciation with
GrSetDisplay(
char *type, /* Name of the display type. */
char *outName, /* Filename used for communciation with
* display. */
char *mouseName; /* Filename used for communciation
char *mouseName) /* Filename used for communciation
* with tablet. */
{
char **ptr;
char *cp;
@ -326,8 +325,9 @@ char *mouseName; /* Filename used for communciation
* ----------------------------------------------------------------------------
*/
bool
GrIsDisplay(disp1, disp2)
char *disp1, *disp2;
GrIsDisplay(
char *disp1,
char *disp2)
{
char **ptr1, **ptr2;
int i, j;
@ -379,11 +379,11 @@ GrIsDisplay(disp1, disp2)
*/
void
GrGuessDisplayType(graphics, mouse, display, monitor)
char **graphics; /* default device for sending out graphics */
char **mouse; /* default device for reading mouse (tablet) */
char **display; /* default type of device (OGL, etc...) */
char **monitor; /* default type of monitor (pale, std) */
GrGuessDisplayType(
char **graphics, /* default device for sending out graphics */
char **mouse, /* default device for reading mouse (tablet) */
char **display, /* default type of device (OGL, etc...) */
char **monitor) /* default type of monitor (pale, std) */
{
bool onSun; /* Are we on a Sun? */
bool haveX; /* are we running under X? */
@ -443,11 +443,11 @@ GrGuessDisplayType(graphics, mouse, display, monitor)
*/
char *
grFgets(str, n, stream, name)
char *str;
int n;
FILE *stream;
char *name; /* The user name of the stream, for the error msg */
grFgets(
char *str,
int n,
FILE *stream,
char *name) /* The user name of the stream, for the error msg */
{
fd_set fn;
char *newstr;

View File

@ -71,28 +71,42 @@ nullDoNothing()
/* 1-argument stub (int or pointer) */
static void
nullDoNothingI(int a)
nullDoNothingI(
int a)
{
(void) a;
}
/* 2-argument stub */
static void
nullDoNothingII(int a, int b)
nullDoNothingII(
int a,
int b)
{
(void) a; (void) b;
}
/* 4-argument stub */
static void
nullDoNothingIIII(int a, int b, int c, int d)
nullDoNothingIIII(
int a,
int b,
int c,
int d)
{
(void) a; (void) b; (void) c; (void) d;
}
/* 7-argument stub (for grFontTextPtr) */
static void
nullDoNothingIIIIIII(int a, int b, int c, int d, int e, int f, int g)
nullDoNothingIIIIIII(
int a,
int b,
int c,
int d,
int e,
int f,
int g)
{
(void) a; (void) b; (void) c; (void) d; (void) e; (void) f; (void) g;
}
@ -100,14 +114,17 @@ nullDoNothingIIIIIII(int a, int b, int c, int d, int e, int f, int g)
/* bool-returning stubs — return FALSE so callers treat backing store / window
* creation as unavailable, which is correct for the headless null driver. */
static bool
nullReturnFalseI(int a)
nullReturnFalseI(
int a)
{
(void) a;
return FALSE;
}
static bool
nullReturnFalseII(int a, int b)
nullReturnFalseII(
int a,
int b)
{
(void) a; (void) b;
return FALSE;
@ -115,7 +132,10 @@ nullReturnFalseII(int a, int b)
/* 3-argument bool-returning stub (for grDrawGridPtr) */
static bool
nullReturnFalseIII(int a, int b, int c)
nullReturnFalseIII(
int a,
int b,
int c)
{
(void) a; (void) b; (void) c;
return FALSE;
@ -123,7 +143,8 @@ nullReturnFalseIII(int a, int b, int c)
/* 1-argument int-returning stub (for GrWindowIdPtr) */
static int
nullReturnZeroI(int a)
nullReturnZeroI(
int a)
{
(void) a;
return 0;
@ -214,10 +235,10 @@ NullInit()
*/
int
NullTextSize(text, size, r)
char *text;
int size;
Rect *r;
NullTextSize(
char *text,
int size,
Rect *r)
{
ASSERT(r != NULL, "nullTextSize");
r->r_xbot = 0;
@ -307,10 +328,10 @@ NullBitBlt()
*/
bool
nullSetDisplay(dispType, outFileName, mouseFileName)
char *dispType;
char *outFileName;
char *mouseFileName;
nullSetDisplay(
char *dispType,
char *outFileName,
char *mouseFileName)
{
TxPrintf("Using NULL graphics device.\n");

View File

@ -80,9 +80,9 @@ extern void grOGLWStdin(int fd, ClientData cdata); /* cb_textio_input_t (unused)
*/
void
groglSetWMandC (mask, c)
int mask; /* New value for write mask */
int c; /* New value for current color */
groglSetWMandC(
int mask, /* New value for write mask */
int c) /* New value for current color */
{
static int oldMask = -1;
static int oldColor = -1;
@ -135,8 +135,8 @@ groglSetWMandC (mask, c)
*/
void
groglSetLineStyle (style)
int style; /* New stipple pattern for lines. */
groglSetLineStyle(
int style) /* New stipple pattern for lines. */
{
static int oldStyle = -1;
GLushort glstyle;
@ -172,9 +172,9 @@ groglSetLineStyle (style)
*/
void
groglSetSPattern (sttable, numstipples)
int **sttable; /* The table of patterns */
int numstipples; /* Number of stipples */
groglSetSPattern(
int **sttable, /* The table of patterns */
int numstipples) /* Number of stipples */
{
int i, j, k, n;
GLubyte *pdata;
@ -209,8 +209,8 @@ groglSetSPattern (sttable, numstipples)
*/
void
groglSetStipple (stipple)
int stipple; /* The stipple number to be used. */
groglSetStipple(
int stipple) /* The stipple number to be used. */
{
static int oldStip = -1;
if (stipple == oldStip) return;
@ -358,7 +358,8 @@ GrOGLFlush()
/*
int
glTransYs(int wy)
glTransYs(
int wy)
{
int my;
GLint vparms[4];
@ -376,8 +377,11 @@ glTransYs(int wy)
*----------------------------------------------------------------------
*/
void
oglSetProjection(llx, lly, width, height)
int llx, lly, width, height;
oglSetProjection(
int llx,
int lly,
int width,
int height)
{
glXMakeCurrent(grXdpy, (GLXDrawable)oglCurrent.window, grXcontext);
@ -612,10 +616,10 @@ pipehandler(
*/
bool
oglSetDisplay (dispType, outFileName, mouseFileName)
char *dispType; /* arguments not used by X */
char *outFileName;
char *mouseFileName;
oglSetDisplay(
char *dispType, /* arguments not used by X */
char *outFileName,
char *mouseFileName)
{
int fildes[2], fildes2[2];
char *planecount;
@ -801,9 +805,9 @@ grOGLWStdin(
*/
bool
GrOGLCreate(w, name)
MagWindow *w;
char *name;
GrOGLCreate(
MagWindow *w,
char *name)
{
Window wind;
HashEntry *entry;
@ -912,8 +916,8 @@ GrOGLCreate(w, name)
*/
void
GrOGLDelete(w)
MagWindow *w;
GrOGLDelete(
MagWindow *w)
{
int xw;
HashEntry *entry;
@ -941,8 +945,8 @@ GrOGLDelete(w)
*/
void
GrOGLConfigure(w)
MagWindow *w;
GrOGLConfigure(
MagWindow *w)
{
XMoveResizeWindow(grXdpy,(Window) w->w_grdata,
w->w_frameArea.r_xbot, glTransYs(w->w_frameArea.r_ytop),
@ -967,8 +971,8 @@ GrOGLConfigure(w)
*/
void
GrOGLRaise(w)
MagWindow *w;
GrOGLRaise(
MagWindow *w)
{
XRaiseWindow(grXdpy, (Window) w->w_grdata );
}
@ -990,8 +994,8 @@ GrOGLRaise(w)
*/
void
GrOGLLower(w)
MagWindow *w;
GrOGLLower(
MagWindow *w)
{
XLowerWindow(grXdpy, (Window) w->w_grdata );
}
@ -1013,9 +1017,9 @@ GrOGLLower(w)
*/
void
GrOGLLock(w, flag)
MagWindow *w;
bool flag;
GrOGLLock(
MagWindow *w,
bool flag)
{
grSimpleLock(w, flag);
if ( w != GR_LOCK_SCREEN )
@ -1045,8 +1049,8 @@ GrOGLLock(w, flag)
*/
void
GrOGLUnlock(w)
MagWindow *w;
GrOGLUnlock(
MagWindow *w)
{
GrOGLFlush();
grSimpleUnlock(w);
@ -1066,9 +1070,9 @@ GrOGLUnlock(w)
*/
void
GrOGLIconUpdate(w,text)
MagWindow *w;
char *text;
GrOGLIconUpdate(
MagWindow *w,
char *text)
{
Window wind = (Window) w->w_grdata;
XClassHint class;

View File

@ -71,9 +71,9 @@ int groglNbRects=0;
*/
void
groglDrawLines(lines, nb)
Rect lines[];
int nb;
groglDrawLines(
Rect lines[],
int nb)
{
int i;
@ -109,9 +109,11 @@ groglDrawLines(lines, nb)
*/
void
groglDrawLine (x1, y1, x2, y2)
int x1, y1; /* Screen coordinates of first point. */
int x2, y2; /* Screen coordinates of second point. */
groglDrawLine(
int x1,
int y1,
int x2,
int y2)
{
if (groglNbLines == OGL_BATCH_SIZE) GR_X_FLUSH_LINES();
groglLines[groglNbLines].r_ll.p_x = x1;
@ -134,9 +136,9 @@ groglDrawLine (x1, y1, x2, y2)
*/
void
groglFillRects(rects, nb)
OGLRect rects[];
int nb;
groglFillRects(
OGLRect rects[],
int nb)
{
int i;
@ -168,8 +170,8 @@ groglFillRects(rects, nb)
*/
void
groglFillRect(r)
Rect *r; /* Address of a rectangle in screen
groglFillRect(
Rect *r) /* Address of a rectangle in screen
* coordinates.
*/
{
@ -203,9 +205,9 @@ groglFillRect(r)
*/
void
groglFillPolygon(tp, np)
Point *tp;
int np;
groglFillPolygon(
Point *tp,
int np)
{
int i;

View File

@ -66,15 +66,15 @@ GLuint grXBases[4];
*/
bool
groglDrawGrid (prect, outline, clip)
Rect *prect; /* A rectangle that forms the template
groglDrawGrid(
Rect *prect, /* A rectangle that forms the template
* for the grid. Note: in order to maintain
* precision for the grid, the rectangle
* coordinates are specified in units of
* screen coordinates multiplied by SUBPIXEL.
*/
int outline; /* the outline style */
Rect *clip; /* a clipping rectangle */
int outline, /* the outline style */
Rect *clip) /* a clipping rectangle */
{
int xsize, ysize;
int x, y;
@ -222,8 +222,8 @@ groglLoadFont()
*/
void
groglSetCharSize (size)
int size; /* Width of characters */
groglSetCharSize(
int size) /* Width of characters */
{
oglCurrent.fontSize = size;
@ -267,10 +267,10 @@ groglSetCharSize (size)
*/
int
GrOGLTextSize(text, size, r)
char *text;
int size;
Rect *r;
GrOGLTextSize(
char *text,
int size,
Rect *r)
{
XCharStruct overall;
XFontStruct *font;
@ -324,9 +324,10 @@ GrOGLTextSize(text, size, r)
*/
int
GrOGLReadPixel (w, x, y)
MagWindow *w;
int x,y; /* the location of a pixel in screen coords */
GrOGLReadPixel(
MagWindow *w,
int x,
int y)
{
return 0;
}
@ -347,9 +348,9 @@ GrOGLReadPixel (w, x, y)
*/
void
GrOGLBitBlt(r, p)
Rect *r;
Point *p;
GrOGLBitBlt(
Rect *r,
Point *p)
{
glCopyPixels(r->r_xbot, r->r_ybot, r->r_xtop - r->r_xbot + 1,
r->r_ytop - r->r_ybot + 1, GL_COLOR);
@ -390,10 +391,10 @@ myCombine(GLdouble coords[3], GLdouble *vertex_data[4],
*/
void
groglDrawCharacter(clist, tc, pixsize)
FontChar *clist;
unsigned char tc;
int pixsize;
groglDrawCharacter(
FontChar *clist,
unsigned char tc,
int pixsize)
{
Point *tp;
int np, nptotal;
@ -468,14 +469,14 @@ groglDrawCharacter(clist, tc, pixsize)
*/
void
groglFontText(text, font, size, rotate, pos, clip, obscure)
char *text; /* The text to be drawn */
int font; /* Font to use from fontList */
int size; /* Pixel size of the font */
int rotate; /* Text rotation */
Point *pos; /* Text base position */
Rect *clip; /* Clipping area */
LinkedRect *obscure; /* List of obscuring areas */
groglFontText(
char *text, /* The text to be drawn */
int font, /* Font to use from fontList */
int size, /* Pixel size of the font */
int rotate, /* Text rotation */
Point *pos, /* Text base position */
Rect *clip, /* Clipping area */
LinkedRect *obscure) /* List of obscuring areas */
{
char *tptr;
Point *coffset; /* vector to next character */
@ -535,7 +536,8 @@ static GC grXcopyGC = (GC)NULL;
*/
void
groglFreeBackingStore(MagWindow *window)
groglFreeBackingStore(
MagWindow *window)
{
Pixmap pmap = (Pixmap)window->w_backingStore;
if (pmap == (Pixmap)NULL) return;
@ -561,7 +563,8 @@ groglFreeBackingStore(MagWindow *window)
*/
void
groglCreateBackingStore(MagWindow *w)
groglCreateBackingStore(
MagWindow *w)
{
Pixmap pmap;
Window wind = (Window)w->w_grdata;
@ -609,7 +612,9 @@ groglCreateBackingStore(MagWindow *w)
*/
bool
groglGetBackingStore(MagWindow *w, Rect *area)
groglGetBackingStore(
MagWindow *w,
Rect *area)
{
Pixmap pmap;
Window wind = (Window)w->w_grdata;
@ -658,7 +663,9 @@ groglGetBackingStore(MagWindow *w, Rect *area)
*/
bool
groglScrollBackingStore(MagWindow *w, Point *shift)
groglScrollBackingStore(
MagWindow *w,
Point *shift)
{
Pixmap pmap;
unsigned int width, height;
@ -717,7 +724,9 @@ groglScrollBackingStore(MagWindow *w, Point *shift)
*/
void
groglPutBackingStore(MagWindow *w, Rect *area)
groglPutBackingStore(
MagWindow *w,
Rect *area)
{
Pixmap pmap = (Pixmap)w->w_backingStore;
Window wind = (Window)w->w_grdata;
@ -771,14 +780,13 @@ groglPutBackingStore(MagWindow *w, Rect *area)
*/
void
groglPutText (text, pos, clip, obscure)
char *text; /* The text to be drawn. */
Point *pos; /* A point located at the leftmost point of
groglPutText(
char *text, /* The text to be drawn. */
Point *pos, /* A point located at the leftmost point of
* the baseline for this string.
*/
Rect *clip; /* A rectangle to clip against */
LinkedRect *obscure; /* A list of obscuring rectangles */
Rect *clip, /* A rectangle to clip against */
LinkedRect *obscure) /* A list of obscuring rectangles */
{
Rect location;
Rect overlap;
@ -832,10 +840,9 @@ groglPutText (text, pos, clip, obscure)
*/
void
grOGLGeoSub(r, area)
Rect *r; /* Rectangle to be subtracted from. */
Rect *area; /* Area to be subtracted. */
grOGLGeoSub(
Rect *r, /* Rectangle to be subtracted from. */
Rect *area) /* Area to be subtracted. */
{
if (r->r_xbot == area->r_xbot) r->r_xbot = area->r_xtop;
else

View File

@ -54,9 +54,9 @@ extern Cursor grCursors[MAX_CURSORS]; /* grX11su5.c */
*/
void
GrOGLDrawGlyph (gl, p)
GrGlyph *gl; /* A single glyph */
Point *p; /* screen pos of lower left corner */
GrOGLDrawGlyph(
GrGlyph *gl, /* A single glyph */
Point *p) /* screen pos of lower left corner */
{
Rect bBox;
bool anyObscure;
@ -182,8 +182,8 @@ GrOGLDrawGlyph (gl, p)
*/
void
groglDefineCursor(glyphs)
GrGlyphs *glyphs;
groglDefineCursor(
GrGlyphs *glyphs)
{
int glyphnum;
Rect oldClip;
@ -298,8 +298,8 @@ groglDefineCursor(glyphs)
*/
void
GrOGLSetCursor(cursorNum)
int cursorNum; /* The cursor number as defined in the display
GrOGLSetCursor(
int cursorNum) /* The cursor number as defined in the display
* styles file.
*/
{

View File

@ -64,7 +64,7 @@ TOGL_CURRENT toglCurrent= {(Tk_Font)0, 0, 0, 0, 0,
*/
extern void GrTOGLClose(), GrTOGLFlush();
extern void GrTOGLDelete(), GrTOGLConfigure(), GrTOGLRaise(), GrTOGLLower();
extern void GrTOGLLock(), GrTOGLUnlock(), GrTOGLIconUpdate();
extern void GrTOGLLock(MagWindow *w, bool flag), GrTOGLUnlock(), GrTOGLIconUpdate();
extern bool GrTOGLInit();
extern bool GrTOGLEventPending(), GrTOGLCreate(), grtoglGetCursorPos();
extern int GrTOGLWindowId();
@ -87,9 +87,9 @@ extern void toglSetProjection();
*/
void
grtoglSetWMandC (mask, c)
int mask; /* New value for write mask */
int c; /* New value for current color */
grtoglSetWMandC(
int mask, /* New value for write mask */
int c) /* New value for current color */
{
static int oldColor = -1;
static int oldMask = -1;
@ -150,8 +150,8 @@ grtoglSetWMandC (mask, c)
*/
void
grtoglSetLineStyle (style)
int style; /* New stipple pattern for lines. */
grtoglSetLineStyle(
int style) /* New stipple pattern for lines. */
{
static int oldStyle = -1;
GLushort glstyle;
@ -188,9 +188,9 @@ grtoglSetLineStyle (style)
*/
void
grtoglSetSPattern (sttable, numstipples)
int **sttable; /* The table of patterns */
int numstipples; /* Number of stipples */
grtoglSetSPattern(
int **sttable, /* The table of patterns */
int numstipples) /* Number of stipples */
{
int i, j, k, n;
GLubyte *pdata;
@ -225,8 +225,8 @@ grtoglSetSPattern (sttable, numstipples)
*/
void
grtoglSetStipple (stipple)
int stipple; /* The stipple number to be used. */
grtoglSetStipple(
int stipple) /* The stipple number to be used. */
{
static int oldStip = -1;
if (stipple == oldStip) return;
@ -402,8 +402,11 @@ static GLXPbuffer pbuffer = None;
*/
void
toglSetProjection(llx, lly, width, height)
int llx, lly, width, height;
toglSetProjection(
int llx,
int lly,
int width,
int height)
{
if (toglCurrent.mw->w_flags & WIND_OFFSCREEN)
{
@ -485,9 +488,9 @@ toglSetProjection(llx, lly, width, height)
*/
void
TOGLEventProc(clientData, xevent)
ClientData clientData;
XEvent *xevent;
TOGLEventProc(
ClientData clientData,
XEvent *xevent)
{
TxInputEvent *event;
HashEntry *entry;
@ -979,10 +982,10 @@ toglOnScreen()
*/
bool
oglSetDisplay (dispType, outFileName, mouseFileName)
char *dispType;
char *outFileName;
char *mouseFileName;
oglSetDisplay(
char *dispType,
char *outFileName,
char *mouseFileName)
{
char *planecount;
char *fullname;
@ -1000,8 +1003,8 @@ oglSetDisplay (dispType, outFileName, mouseFileName)
GrPixelCorrect = 0;
GrLockPtr = GrTOGLLock;
GrUnlockPtr = GrTOGLUnlock;
GrLockPtr = (void (*)())GrTOGLLock;
GrUnlockPtr = (void (*)())GrTOGLUnlock;
GrInitPtr = GrTOGLInit;
GrClosePtr = GrTOGLClose;
GrSetCMapPtr = GrTOGLSetCMap;
@ -1095,9 +1098,9 @@ extern void MakeWindowCommand();
*/
bool
GrTOGLCreate(w, name)
MagWindow *w;
char *name;
GrTOGLCreate(
MagWindow *w,
char *name)
{
Tk_Window tkwind, tktop;
Window wind;
@ -1244,8 +1247,8 @@ GrTOGLCreate(w, name)
*/
void
GrTOGLDelete(w)
MagWindow *w;
GrTOGLDelete(
MagWindow *w)
{
Tk_Window xw;
HashEntry *entry;
@ -1274,8 +1277,8 @@ GrTOGLDelete(w)
*/
void
GrTOGLConfigure(w)
MagWindow *w;
GrTOGLConfigure(
MagWindow *w)
{
if (w->w_flags & WIND_OFFSCREEN) return;
@ -1302,8 +1305,8 @@ GrTOGLConfigure(w)
*/
void
GrTOGLRaise(w)
MagWindow *w;
GrTOGLRaise(
MagWindow *w)
{
Tk_Window tkwind;
@ -1330,8 +1333,8 @@ GrTOGLRaise(w)
*/
void
GrTOGLLower(w)
MagWindow *w;
GrTOGLLower(
MagWindow *w)
{
Tk_Window tkwind;
@ -1365,9 +1368,9 @@ extern void TCairoOffScreen();
#endif
void
GrTOGLLock(w, flag)
MagWindow *w;
bool flag;
GrTOGLLock(
MagWindow *w,
bool flag)
{
Window wind;
@ -1421,8 +1424,8 @@ GrTOGLLock(w, flag)
*/
void
GrTOGLUnlock(w)
MagWindow *w;
GrTOGLUnlock(
MagWindow *w)
{
#ifdef CAIRO_OFFSCREEN_RENDER
@ -1537,9 +1540,9 @@ GrTOGLEventPending()
*/
void
GrTOGLIconUpdate(w,text) /* See Blt code */
MagWindow *w;
char *text;
GrTOGLIconUpdate(
MagWindow *w,
char *text)
{
Tk_Window tkwind;
Window wind;
@ -1592,8 +1595,8 @@ GrTOGLIconUpdate(w,text) /* See Blt code */
*/
int
GrTOGLWindowId(tkname)
char *tkname;
GrTOGLWindowId(
char *tkname)
{
Tk_Window tkwind;
MagWindow *mw;

View File

@ -66,9 +66,9 @@ int grtoglNbDiagonal = 0;
*/
void
grtoglDrawLines(lines, nb)
Rect lines[];
int nb;
grtoglDrawLines(
Rect lines[],
int nb)
{
#ifdef OGL_SERVER_SIDE_ONLY
@ -103,9 +103,11 @@ grtoglDrawLines(lines, nb)
*/
void
grtoglDrawLine (x1, y1, x2, y2)
int x1, y1; /* Screen coordinates of first point. */
int x2, y2; /* Screen coordinates of second point. */
grtoglDrawLine(
int x1,
int y1,
int x2,
int y2)
{
/* Treat straight and diagonal lines separately. Some */
/* implementations of OpenGL make straight lines twice as thick */
@ -143,9 +145,9 @@ grtoglDrawLine (x1, y1, x2, y2)
*/
void
grtoglFillRects(rects, nb)
TOGLRect rects[];
int nb;
grtoglFillRects(
TOGLRect rects[],
int nb)
{
#ifdef OGL_SERVER_SIDE_ONLY
@ -178,8 +180,8 @@ grtoglFillRects(rects, nb)
*/
void
grtoglFillRect(r)
Rect *r; /* Address of a rectangle in screen
grtoglFillRect(
Rect *r) /* Address of a rectangle in screen
* coordinates.
*/
{
@ -213,9 +215,9 @@ grtoglFillRect(r)
*/
void
grtoglFillPolygon(tp, np)
Point *tp;
int np;
grtoglFillPolygon(
Point *tp,
int np)
{
int i;

View File

@ -61,15 +61,15 @@ typedef struct {
*/
bool
grtoglDrawGrid (prect, outline, clip)
Rect *prect; /* A rectangle that forms the template
grtoglDrawGrid(
Rect *prect, /* A rectangle that forms the template
* for the grid. Note: in order to maintain
* precision for the grid, the rectangle
* coordinates are specified in units of
* screen coordinates multiplied by SUBPIXEL.
*/
int outline; /* the outline style */
Rect *clip; /* a clipping rectangle */
int outline, /* the outline style */
Rect *clip) /* a clipping rectangle */
{
int xsize, ysize;
int x, y;
@ -160,8 +160,8 @@ grtoglLoadFont()
*/
void
grtoglSetCharSize (size)
int size; /* Width of characters, in pixels (6 or 8). */
grtoglSetCharSize(
int size) /* Width of characters, in pixels (6 or 8). */
{
toglCurrent.fontSize = size;
switch (size)
@ -204,10 +204,10 @@ grtoglSetCharSize (size)
*/
int
GrTOGLTextSize(text, size, r)
char *text;
int size;
Rect *r;
GrTOGLTextSize(
char *text,
int size,
Rect *r)
{
Tk_FontMetrics overall;
Tk_Font font;
@ -252,7 +252,8 @@ GrTOGLTextSize(text, size, r)
/* backing store contains valid data or not. */
void
grtoglFreeBackingStore(MagWindow *w)
grtoglFreeBackingStore(
MagWindow *w)
{
RenderFrame *rf;
@ -265,7 +266,8 @@ grtoglFreeBackingStore(MagWindow *w)
}
void
grtoglCreateBackingStore(MagWindow *w)
grtoglCreateBackingStore(
MagWindow *w)
{
RenderFrame *rf;
@ -298,7 +300,9 @@ grtoglCreateBackingStore(MagWindow *w)
}
bool
grtoglGetBackingStore(MagWindow *w, Rect *area)
grtoglGetBackingStore(
MagWindow *w,
Rect *area)
{
RenderFrame *rf;
unsigned int width, height;
@ -336,7 +340,9 @@ grtoglGetBackingStore(MagWindow *w, Rect *area)
bool
grtoglScrollBackingStore(MagWindow *w, Point *shift)
grtoglScrollBackingStore(
MagWindow *w,
Point *shift)
{
RenderFrame *rf;
GLuint FramebufferName, RenderbufferName;
@ -396,7 +402,9 @@ grtoglScrollBackingStore(MagWindow *w, Point *shift)
}
void
grtoglPutBackingStore(MagWindow *w, Rect *area)
grtoglPutBackingStore(
MagWindow *w,
Rect *area)
{
RenderFrame *rf;
GLuint FramebufferName, RenderbufferName;
@ -452,9 +460,10 @@ grtoglPutBackingStore(MagWindow *w, Rect *area)
*/
int
GrTOGLReadPixel (w, x, y)
MagWindow *w;
int x,y; /* the location of a pixel in screen coords */
GrTOGLReadPixel(
MagWindow *w,
int x,
int y)
{
return 0; /* OpenGL has no such function, so return 0 */
}
@ -475,9 +484,9 @@ GrTOGLReadPixel (w, x, y)
*/
void
GrTOGLBitBlt(r, p)
Rect *r;
Point *p;
GrTOGLBitBlt(
Rect *r,
Point *p)
{
glCopyPixels(r->r_xbot, r->r_ybot, r->r_xtop - r->r_xbot + 1,
r->r_ytop - r->r_ybot + 1, GL_COLOR);
@ -518,10 +527,10 @@ myCombine(GLdouble coords[3], GLdouble *vertex_data[4],
*/
void
grtoglDrawCharacter(clist, tc, pixsize)
FontChar *clist;
unsigned char tc;
int pixsize;
grtoglDrawCharacter(
FontChar *clist,
unsigned char tc,
int pixsize)
{
Point *tp;
int np, nptotal;
@ -596,14 +605,14 @@ grtoglDrawCharacter(clist, tc, pixsize)
*/
void
grtoglFontText(text, font, size, rotate, pos, clip, obscure)
char *text; /* The text to be drawn */
int font; /* Font to use from fontList */
int size; /* Pixel size of the font */
int rotate; /* Text rotation */
Point *pos; /* Text base position */
Rect *clip; /* Clipping area */
LinkedRect *obscure; /* List of obscuring areas */
grtoglFontText(
char *text, /* The text to be drawn */
int font, /* Font to use from fontList */
int size, /* Pixel size of the font */
int rotate, /* Text rotation */
Point *pos, /* Text base position */
Rect *clip, /* Clipping area */
LinkedRect *obscure) /* List of obscuring areas */
{
char *tptr;
Point *coffset; /* vector to next character */
@ -666,14 +675,13 @@ grtoglFontText(text, font, size, rotate, pos, clip, obscure)
*/
void
grtoglPutText (text, pos, clip, obscure)
char *text; /* The text to be drawn. */
Point *pos; /* A point located at the leftmost point of
grtoglPutText(
char *text, /* The text to be drawn. */
Point *pos, /* A point located at the leftmost point of
* the baseline for this string.
*/
Rect *clip; /* A rectangle to clip against */
LinkedRect *obscure; /* A list of obscuring rectangles */
Rect *clip, /* A rectangle to clip against */
LinkedRect *obscure) /* A list of obscuring rectangles */
{
Rect location;
Rect overlap;
@ -726,10 +734,9 @@ grtoglPutText (text, pos, clip, obscure)
*/
void
grTOGLGeoSub(r, area)
Rect *r; /* Rectangle to be subtracted from. */
Rect *area; /* Area to be subtracted. */
grTOGLGeoSub(
Rect *r, /* Rectangle to be subtracted from. */
Rect *area) /* Area to be subtracted. */
{
if (r->r_xbot == area->r_xbot) r->r_xbot = area->r_xtop;
else

View File

@ -47,14 +47,14 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
*/
bool
GrFontText(str, style, p, font, size, rotate, clip)
char *str; /* The text to be drawn. */
int style; /* Display style to use for the text */
Point *p; /* Point of origin */
int font; /* Font to use */
int size; /* Scale */
int rotate; /* Rotation (in degrees) */
Rect *clip; /* Clipping area */
GrFontText(
char *str, /* The text to be drawn. */
int style, /* Display style to use for the text */
Point *p, /* Point of origin */
int font, /* Font to use */
int size, /* Scale */
int rotate, /* Rotation (in degrees) */
Rect *clip) /* Clipping area */
{
Rect nClip;
Point pstart;
@ -106,29 +106,28 @@ GrFontText(str, style, p, font, size, rotate, clip)
*/
bool
GrPutText(str, style, p, pos, size, adjust, clip, actual)
char *str; /* The text to be drawn. */
int style; /* The style for drawing text; if -1 then
GrPutText(
char *str, /* The text to be drawn. */
int style, /* The style for drawing text; if -1 then
* the caller has already set the style
* and we don't have to.
*/
Point *p; /* The point to align with */
int pos; /* The alignment desired (GR_NORTH,
Point *p, /* The point to align with */
int pos, /* The alignment desired (GR_NORTH,
* GR_NORTHEAST, etc.)
*/
int size; /* The desired size of the text
int size, /* The desired size of the text
* (such as GR_TEXT_MEDIUM).
*/
bool adjust; /* TRUE means adjust the text (either by
bool adjust, /* TRUE means adjust the text (either by
* sliding it around or using a smaller font)
* if that is necessary to make it fit into
* the clipping rectangle. FALSE means
* display the text exactly as instructed,
* clipping it if it doesn't fit.
*/
Rect *clip; /* A clipping rectangle for the text */
Rect *actual; /* To be filled in with the location of the
Rect *clip, /* A clipping rectangle for the text */
Rect *actual) /* To be filled in with the location of the
* text.
*/
{
@ -315,13 +314,13 @@ GrPutText(str, style, p, pos, size, adjust, clip, actual)
*/
void
GrLabelSize(text, pos, size, area)
char *text; /* Text of the label. */
int pos; /* Position of the label relative
GrLabelSize(
char *text, /* Text of the label. */
int pos, /* Position of the label relative
* to its positioning point.
*/
int size; /* Text size. */
Rect *area; /* To be filled in with label size. */
int size, /* Text size. */
Rect *area) /* To be filled in with label size. */
{
int xoffset, yoffset; /* Offsets due to label position. */

View File

@ -100,7 +100,7 @@ extern bool GrTkInstalledCMap;
*/
extern void GrTkClose(), GrTkFlush();
extern void GrTkDelete(),GrTkConfigure(),GrTkRaise(),GrTkLower();
extern void GrTkLock(),GrTkUnlock(),GrTkIconUpdate();
extern void GrTkLock(MagWindow *w, bool flag),GrTkUnlock(),GrTkIconUpdate();
extern bool GrTkInit();
extern bool GrTkEventPending(), GrTkCreate(), grtkGetCursorPos();
extern int GrTkWindowId();
@ -121,9 +121,9 @@ extern char *GrTkWindowName();
*/
void
grtkSetWMandC (mask, c)
long mask; /* New value for write mask */
int c; /* New value for current color */
grtkSetWMandC(
long mask, /* New value for write mask */
int c) /* New value for current color */
{
static int oldC = -1;
static int oldM = -1;
@ -163,8 +163,8 @@ grtkSetWMandC (mask, c)
*/
void
grtkSetLineStyle (style)
int style; /* New stipple pattern for lines. */
grtkSetLineStyle(
int style) /* New stipple pattern for lines. */
{
static int oldStyle = -1;
LineStyle *linestyle;
@ -258,9 +258,9 @@ grtkSetLineStyle (style)
*/
void
grtkSetSPattern (sttable, numstipples)
int **sttable; /* The table of patterns */
int numstipples; /* Number of stipples */
grtkSetSPattern(
int **sttable, /* The table of patterns */
int numstipples) /* Number of stipples */
{
Tk_Window tkwind;
Window xwid;
@ -311,8 +311,8 @@ grtkSetSPattern (sttable, numstipples)
*/
void
grtkSetStipple (stipple)
int stipple; /* The stipple number to be used. */
grtkSetStipple(
int stipple) /* The stipple number to be used. */
{
static int oldStip = -1;
if (stipple == oldStip) return;
@ -345,8 +345,8 @@ grtkSetStipple (stipple)
#define visual_table_len 7
bool
GrTkInit(dispType)
char *dispType;
GrTkInit(
char *dispType)
{
int i,j;
XVisualInfo grvisual_info, *grvisual_get, grtemplate;
@ -728,9 +728,9 @@ GrTkFlush ()
*/
void
MagicEventProc(clientData, xevent)
ClientData clientData;
XEvent *xevent;
MagicEventProc(
ClientData clientData,
XEvent *xevent)
{
HashEntry *entry;
Tk_Window wind = (Tk_Window)clientData;
@ -1217,10 +1217,10 @@ keys_and_buttons:
*/
bool
x11SetDisplay (dispType, outFileName, mouseFileName)
char *dispType;
char *outFileName;
char *mouseFileName;
x11SetDisplay(
char *dispType,
char *outFileName,
char *mouseFileName)
{
char *planecount;
char *fullname;
@ -1235,8 +1235,8 @@ x11SetDisplay (dispType, outFileName, mouseFileName)
/* Set up the procedure values in the indirection table. */
GrLockPtr = GrTkLock;
GrUnlockPtr = GrTkUnlock;
GrLockPtr = (void (*)())GrTkLock;
GrUnlockPtr = (void (*)())GrTkUnlock;
GrInitPtr = GrTkInit;
GrClosePtr = GrTkClose;
GrSetCMapPtr = GrTkSetCMap;
@ -1321,9 +1321,9 @@ extern void MakeWindowCommand();
*/
bool
GrTkCreate(w, name)
MagWindow *w;
char *name;
GrTkCreate(
MagWindow *w,
char *name)
{
Tk_Window tkwind, tktop;
Window wind;
@ -1545,8 +1545,8 @@ GrTkCreate(w, name)
*/
void
GrTkDelete(w)
MagWindow *w;
GrTkDelete(
MagWindow *w)
{
Tk_Window xw;
HashEntry *entry;
@ -1576,8 +1576,8 @@ GrTkDelete(w)
*/
void
GrTkConfigure(w)
MagWindow *w;
GrTkConfigure(
MagWindow *w)
{
if (w->w_flags & WIND_OFFSCREEN) return;
@ -1604,8 +1604,8 @@ GrTkConfigure(w)
*/
void
GrTkRaise(w)
MagWindow *w;
GrTkRaise(
MagWindow *w)
{
Tk_Window tkwind;
@ -1632,8 +1632,8 @@ GrTkRaise(w)
*/
void
GrTkLower(w)
MagWindow *w;
GrTkLower(
MagWindow *w)
{
Tk_Window tkwind;
@ -1660,9 +1660,9 @@ GrTkLower(w)
*/
void
GrTkLock(w, flag)
MagWindow *w;
bool flag;
GrTkLock(
MagWindow *w,
bool flag)
{
grSimpleLock(w, flag);
@ -1699,8 +1699,8 @@ GrTkLock(w, flag)
*/
void
GrTkUnlock(w)
MagWindow *w;
GrTkUnlock(
MagWindow *w)
{
GR_TK_FLUSH_BATCH();
grSimpleUnlock(w);
@ -1753,9 +1753,9 @@ GrTkEventPending()
*/
void
GrTkIconUpdate(w, text) /* See Blt code */
MagWindow *w;
char *text;
GrTkIconUpdate(
MagWindow *w,
char *text)
{
Tk_Window tkwind;
Window wind;
@ -1806,8 +1806,8 @@ GrTkIconUpdate(w, text) /* See Blt code */
*/
int
GrTkWindowId(tkname)
char *tkname;
GrTkWindowId(
char *tkname)
{
Tk_Window tkwind;
MagWindow *mw;

View File

@ -192,9 +192,9 @@ int grtkNbRects=0;
*/
void
grtkDrawLines(lines, nb)
XSegment lines[];
int nb;
grtkDrawLines(
XSegment lines[],
int nb)
{
XDrawSegments(grXdpy, grCurrent.windowid, grGCDraw,
lines, nb);
@ -213,9 +213,11 @@ grtkDrawLines(lines, nb)
*/
void
grtkDrawLine (x1, y1, x2, y2)
int x1, y1; /* Screen coordinates of first point. */
int x2, y2; /* Screen coordinates of second point. */
grtkDrawLine(
int x1,
int y1,
int x2,
int y2)
{
if (grtkNbLines == TK_BATCH_SIZE) GR_TK_FLUSH_LINES();
grtkLines[grtkNbLines].x1 = x1;
@ -239,9 +241,9 @@ grtkDrawLine (x1, y1, x2, y2)
*/
void
grtkFillRects(rects, nb)
XRectangle rects[];
int nb;
grtkFillRects(
XRectangle rects[],
int nb)
{
XFillRectangles(grXdpy, grCurrent.windowid, grGCFill, rects, nb);
}
@ -259,8 +261,8 @@ grtkFillRects(rects, nb)
*/
void
grtkFillRect(r)
Rect *r; /* Address of a rectangle in screen
grtkFillRect(
Rect *r) /* Address of a rectangle in screen
* coordinates.
*/
{
@ -289,9 +291,9 @@ grtkFillRect(r)
*/
void
grtkFillPolygon(tp, np)
Point *tp;
int np;
grtkFillPolygon(
Point *tp,
int np)
{
XPoint xp[5];
int i;

View File

@ -52,15 +52,15 @@
#define GR_NUM_GRIDS 64
bool
grtkDrawGrid (prect, outline, clip)
Rect *prect; /* A rectangle that forms the template
grtkDrawGrid(
Rect *prect, /* A rectangle that forms the template
* for the grid. Note: in order to maintain
* precision for the grid, the rectangle
* coordinates are specified in units of
* screen coordinates multiplied by SUBPIXEL.
*/
int outline; /* the outline style */
Rect *clip; /* a clipping rectangle */
int outline, /* the outline style */
Rect *clip) /* a clipping rectangle */
{
int xsize, ysize;
int x, y;
@ -133,8 +133,8 @@ grtkDrawGrid (prect, outline, clip)
*/
void
grtkSetCharSize (size)
int size; /* Width of characters, in pixels (6 or 8). */
grtkSetCharSize(
int size) /* Width of characters, in pixels (6 or 8). */
{
grCurrent.fontSize = size;
switch (size)
@ -177,10 +177,10 @@ grtkSetCharSize (size)
*/
int
GrTkTextSize(text, size, r)
char *text;
int size;
Rect *r;
GrTkTextSize(
char *text,
int size,
Rect *r)
{
Tk_FontMetrics overall;
Tk_Font font;
@ -233,9 +233,10 @@ GrTkTextSize(text, size, r)
*/
int
GrTkReadPixel (w, x, y)
MagWindow *w;
int x,y; /* the location of a pixel in screen coords */
GrTkReadPixel(
MagWindow *w,
int x,
int y)
{
XImage *image;
unsigned long value;
@ -265,9 +266,9 @@ GrTkReadPixel (w, x, y)
*/
void
GrTkBitBlt(r, p)
Rect *r;
Point *p;
GrTkBitBlt(
Rect *r,
Point *p)
{
Window wind = grCurrent.windowid;
@ -295,9 +296,9 @@ GrTkBitBlt(r, p)
*/
void
grtkRectConvert(mr, xr)
Rect *mr; /* source rectangle pointer */
XRectangle *xr; /* destination rectangle pointer */
grtkRectConvert(
Rect *mr, /* source rectangle pointer */
XRectangle *xr) /* destination rectangle pointer */
{
xr->x = mr->r_xbot;
xr->y = grMagicToX(mr->r_ytop);
@ -316,14 +317,14 @@ grtkRectConvert(mr, xr)
*/
void
grtkFontText(text, font, size, rotate, pos, clip, obscure)
char *text;
int font;
int size; /* pixel size of the text */
int rotate; /* text rotation */
Point *pos; /* text base position */
Rect *clip;
LinkedRect *obscure;
grtkFontText(
char *text,
int font,
int size, /* pixel size of the text */
int rotate, /* text rotation */
Point *pos, /* text base position */
Rect *clip,
LinkedRect *obscure)
{
char *tptr;
FontChar *ccur, *clist;
@ -477,14 +478,13 @@ grtkFontText(text, font, size, rotate, pos, clip, obscure)
*/
void
grtkPutText (text, pos, clip, obscure)
char *text; /* The text to be drawn. */
Point *pos; /* A point located at the leftmost point of
grtkPutText(
char *text, /* The text to be drawn. */
Point *pos, /* A point located at the leftmost point of
* the baseline for this string.
*/
Rect *clip; /* A rectangle to clip against */
LinkedRect *obscure; /* A list of obscuring rectangles */
Rect *clip, /* A rectangle to clip against */
LinkedRect *obscure) /* A list of obscuring rectangles */
{
Rect location;
Rect overlap;
@ -547,10 +547,9 @@ grtkPutText (text, pos, clip, obscure)
*/
void
grtkGeoSub(r, area)
Rect *r; /* Rectangle to be subtracted from. */
Rect *area; /* Area to be subtracted. */
grtkGeoSub(
Rect *r, /* Rectangle to be subtracted from. */
Rect *area) /* Area to be subtracted. */
{
if (r->r_xbot == area->r_xbot) r->r_xbot = area->r_xtop;
else

View File

@ -140,8 +140,8 @@ grTkFreeFonts()
*/
void
grTkFreeCursors(glyphs)
GrGlyphs *glyphs;
grTkFreeCursors(
GrGlyphs *glyphs)
{
int i;
for (i = 0; i < glyphs->gr_num; i++)
@ -169,8 +169,8 @@ typedef struct {
} CursorCache;
void
grTkDefineCursor(glyphs)
GrGlyphs *glyphs;
grTkDefineCursor(
GrGlyphs *glyphs)
{
char *fgname, *bgname;
int glyphnum;
@ -308,8 +308,8 @@ grTkDefineCursor(glyphs)
*/
char *
GrTkWindowName(mw)
MagWindow *mw;
GrTkWindowName(
MagWindow *mw)
{
Tk_Window tkwind;
char *tkname;
@ -332,7 +332,8 @@ GrTkWindowName(mw)
*/
void
grtkFreeBackingStore(MagWindow *window)
grtkFreeBackingStore(
MagWindow *window)
{
Pixmap pmap = (Pixmap)window->w_backingStore;
if (pmap == (Pixmap)NULL) return;
@ -357,7 +358,8 @@ grtkFreeBackingStore(MagWindow *window)
*/
void
grtkCreateBackingStore(MagWindow *w)
grtkCreateBackingStore(
MagWindow *w)
{
Pixmap pmap;
Tk_Window tkwind = (Tk_Window)w->w_grdata;
@ -399,7 +401,9 @@ grtkCreateBackingStore(MagWindow *w)
*/
bool
grtkGetBackingStore(MagWindow *w, Rect *area)
grtkGetBackingStore(
MagWindow *w,
Rect *area)
{
Pixmap pmap;
Tk_Window tkwind = (Tk_Window)w->w_grdata;
@ -466,7 +470,9 @@ grtkGetBackingStore(MagWindow *w, Rect *area)
*/
bool
grtkScrollBackingStore(MagWindow *w, Point *shift)
grtkScrollBackingStore(
MagWindow *w,
Point *shift)
{
Pixmap pmap;
Tk_Window tkwind = (Tk_Window)w->w_grdata;
@ -531,7 +537,9 @@ grtkScrollBackingStore(MagWindow *w, Point *shift)
*/
void
grtkPutBackingStore(MagWindow *w, Rect *area)
grtkPutBackingStore(
MagWindow *w,
Rect *area)
{
Pixmap pmap = (Pixmap)w->w_backingStore;
Tk_Window tkwind = (Tk_Window)w->w_grdata;
@ -615,8 +623,8 @@ grtkPutBackingStore(MagWindow *w, Rect *area)
*/
char *
GrTkGetColorByName(name)
char *name;
GrTkGetColorByName(
char *name)
{
Tk_Window tkwind = Tk_MainWindow(magicinterp);
int style, red, green, blue;
@ -896,12 +904,12 @@ ImgLayerCreate(interp, name, argc, argv, typePtr, master, clientDataPtr)
*/
static int
ImgLayerConfigureMaster(masterPtr, objc, objv, flags)
LayerMaster *masterPtr; /* Pointer to data structure describing
ImgLayerConfigureMaster(
LayerMaster *masterPtr, /* Pointer to data structure describing
* overall pixmap image to (reconfigure). */
int objc; /* Number of entries in objv. */
Tcl_Obj *const objv[]; /* Pairs of configuration options for image. */
int flags; /* Flags to pass to Tk_ConfigureWidget,
int objc, /* Number of entries in objv. */
Tcl_Obj *const objv[], /* Pairs of configuration options for image. */
int flags) /* Flags to pass to Tk_ConfigureWidget,
* such as TK_CONFIG_ARGV_ONLY. */
{
LayerInstance *instancePtr;
@ -963,8 +971,8 @@ ImgLayerConfigureMaster(masterPtr, objc, objv, flags)
*/
void
grDrawOffScreenBox(rect)
Rect *rect;
grDrawOffScreenBox(
Rect *rect)
{
(*grDrawLinePtr)(rect->r_xbot, rect->r_ytop - 1, rect->r_xtop - 1,
rect->r_ytop - 1);
@ -1003,8 +1011,8 @@ grDrawOffScreenBox(rect)
#define LAYER_LAYOUT 3
static void
ImgLayerConfigureInstance(instancePtr)
LayerInstance *instancePtr; /* Instance to reconfigure. */
ImgLayerConfigureInstance(
LayerInstance *instancePtr) /* Instance to reconfigure. */
{
LayerMaster *masterPtr = instancePtr->masterPtr;
XGCValues gcValues;
@ -1241,11 +1249,11 @@ error:
*/
static int
ImgLayerCmd(clientData, interp, objc, objv)
ClientData clientData; /* Information about the image master. */
Tcl_Interp *interp; /* Current interpreter. */
int objc; /* Number of arguments. */
Tcl_Obj *const objv[]; /* Argument objects. */
ImgLayerCmd(
ClientData clientData, /* Information about the image master. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
static char *layerOptions[] = {"cget", "configure", (char *) NULL};
LayerMaster *masterPtr = (LayerMaster *) clientData;
@ -1310,10 +1318,10 @@ ImgLayerCmd(clientData, interp, objc, objv)
*/
static ClientData
ImgLayerGet(tkwin, masterData)
Tk_Window tkwin; /* Window in which the instance will be
ImgLayerGet(
Tk_Window tkwin, /* Window in which the instance will be
* used. */
ClientData masterData; /* Pointer to our master structure for the
ClientData masterData) /* Pointer to our master structure for the
* image. */
{
LayerMaster *masterPtr = (LayerMaster *) masterData;
@ -1376,17 +1384,17 @@ ImgLayerGet(tkwin, masterData)
*/
static void
ImgLayerDisplay(clientData, display, drawable, imageX, imageY, width,
height, drawableX, drawableY)
ClientData clientData; /* Pointer to LayerInstance structure for
ImgLayerDisplay(
ClientData clientData, /* Pointer to LayerInstance structure for
* for instance to be displayed. */
Display *display; /* Display on which to draw image. */
Drawable drawable; /* Pixmap or window in which to draw image. */
int imageX, imageY; /* Upper-left corner of region within image
* to draw. */
int width, height; /* Dimensions of region within image to draw. */
int drawableX, drawableY; /* Coordinates within drawable that
* correspond to imageX and imageY. */
Display *display, /* Display on which to draw image. */
Drawable drawable, /* Pixmap or window in which to draw image. */
int imageX,
int imageY,
int width,
int height,
int drawableX,
int drawableY)
{
LayerInstance *instancePtr = (LayerInstance *) clientData;
@ -1420,10 +1428,10 @@ ImgLayerDisplay(clientData, display, drawable, imageX, imageY, width,
*/
static void
ImgLayerFree(clientData, display)
ClientData clientData; /* Pointer to LayerInstance structure for
ImgLayerFree(
ClientData clientData, /* Pointer to LayerInstance structure for
* for instance to be displayed. */
Display *display; /* Display containing window that used image. */
Display *display) /* Display containing window that used image. */
{
LayerInstance *instancePtr = (LayerInstance *) clientData;
LayerInstance *prevPtr;
@ -1479,8 +1487,8 @@ ImgLayerFree(clientData, display)
*/
static void
ImgLayerDelete(masterData)
ClientData masterData; /* Pointer to BitmapMaster structure for
ImgLayerDelete(
ClientData masterData) /* Pointer to BitmapMaster structure for
* image. Must not have any more instances. */
{
LayerMaster *masterPtr = (LayerMaster *) masterData;
@ -1515,8 +1523,8 @@ ImgLayerDelete(masterData)
*/
static void
ImgLayerCmdDeletedProc(clientData)
ClientData clientData; /* Pointer to BitmapMaster structure for
ImgLayerCmdDeletedProc(
ClientData clientData) /* Pointer to BitmapMaster structure for
* image. */
{
LayerMaster *masterPtr = (LayerMaster *) clientData;
@ -1542,7 +1550,8 @@ ImgLayerCmdDeletedProc(clientData)
*/
void
RegisterTkCommands(Tcl_Interp *interp)
RegisterTkCommands(
Tcl_Interp *interp)
{
Tcl_CreateCommand(interp, "magic::magiccolor",
(Tcl_CmdProc *)_magic_magiccolor, (ClientData)NULL,

View File

@ -134,9 +134,9 @@ extern bool grx11GetCursorPos();
*/
void
grx11SetWMandC (mask, c)
int mask; /* New value for write mask */
int c; /* New value for current color */
grx11SetWMandC(
int mask, /* New value for write mask */
int c) /* New value for current color */
{
static int oldC = -1;
static int oldM = -1;
@ -176,8 +176,8 @@ grx11SetWMandC (mask, c)
*/
void
grx11SetLineStyle (style)
int style; /* New stipple pattern for lines. */
grx11SetLineStyle(
int style) /* New stipple pattern for lines. */
{
static int oldStyle = -1;
LineStyle *linestyle;
@ -271,9 +271,9 @@ grx11SetLineStyle (style)
*/
void
grx11SetSPattern (sttable, numstipples)
int **sttable; /* Table of patterns */
int numstipples; /* Number of stipples */
grx11SetSPattern(
int **sttable, /* Table of patterns */
int numstipples) /* Number of stipples */
{
Pixmap p;
int i, x, y, pat;
@ -311,8 +311,8 @@ grx11SetSPattern (sttable, numstipples)
*/
void
grx11SetStipple (stipple)
int stipple; /* The stipple number to be used. */
grx11SetStipple(
int stipple) /* The stipple number to be used. */
{
static int oldStip = -1;
if (stipple == oldStip) return;
@ -343,8 +343,8 @@ grx11SetStipple (stipple)
*/
bool
GrX11Init(dispType)
char *dispType;
GrX11Init(
char *dispType)
{
int i,j;
XVisualInfo grvisual_info, *grvisual_get, grtemplate;
@ -965,10 +965,10 @@ grX11Stdin(
*/
bool
x11SetDisplay (dispType, outFileName, mouseFileName)
char *dispType; /* arguments not used by X */
char *outFileName;
char *mouseFileName;
x11SetDisplay(
char *dispType, /* arguments not used by X */
char *outFileName,
char *mouseFileName)
{
int fildes[2],fildes2[2];
char *fullname;
@ -1147,9 +1147,9 @@ grXWStdin(
*/
bool
GrX11Create(w, name)
MagWindow *w;
char *name;
GrX11Create(
MagWindow *w,
char *name)
{
Window wind;
static int firstWindow = 1;
@ -1279,8 +1279,8 @@ GrX11Create(w, name)
*/
void
GrX11Delete(w)
MagWindow *w;
GrX11Delete(
MagWindow *w)
{
Window xw;
HashEntry *entry;
@ -1308,8 +1308,8 @@ GrX11Delete(w)
*/
void
GrX11Configure(w)
MagWindow *w;
GrX11Configure(
MagWindow *w)
{
XMoveResizeWindow(grXdpy,(Window) w->w_grdata,
w->w_frameArea.r_xbot, grMagicToXs(w->w_frameArea.r_ytop),
@ -1334,8 +1334,8 @@ GrX11Configure(w)
*/
void
GrX11Raise(w)
MagWindow *w;
GrX11Raise(
MagWindow *w)
{
XRaiseWindow(grXdpy, (Window) w->w_grdata );
}
@ -1357,8 +1357,8 @@ GrX11Raise(w)
*/
void
GrX11Lower(w)
MagWindow *w;
GrX11Lower(
MagWindow *w)
{
XLowerWindow(grXdpy, (Window) w->w_grdata );
}
@ -1381,9 +1381,9 @@ GrX11Lower(w)
*/
void
GrX11Lock(w, flag)
MagWindow *w;
bool flag;
GrX11Lock(
MagWindow *w,
bool flag)
{
grSimpleLock(w, flag);
if ( w != GR_LOCK_SCREEN )
@ -1411,8 +1411,8 @@ GrX11Lock(w, flag)
*/
void
GrX11Unlock(w)
MagWindow *w;
GrX11Unlock(
MagWindow *w)
{
GR_X_FLUSH_BATCH();
grSimpleUnlock(w);
@ -1432,10 +1432,9 @@ GrX11Unlock(w)
*/
void
GrX11IconUpdate(w,text)
MagWindow *w;
char *text;
GrX11IconUpdate(
MagWindow *w,
char *text)
{
Window wind = (Window)(w->w_grdata);
XClassHint class;

View File

@ -225,9 +225,9 @@ int grx11NbRects=0;
*/
void
grx11DrawLines(lines, nb)
XSegment lines[];
int nb;
grx11DrawLines(
XSegment lines[],
int nb)
{
XDrawSegments(grXdpy, grCurrent.window, grGCDraw,
lines, nb);
@ -245,9 +245,11 @@ grx11DrawLines(lines, nb)
*/
void
grx11DrawLine (x1, y1, x2, y2)
int x1, y1; /* Screen coordinates of first point. */
int x2, y2; /* Screen coordinates of second point. */
grx11DrawLine(
int x1,
int y1,
int x2,
int y2)
{
if (grx11NbLines == X11_BATCH_SIZE) GR_X_FLUSH_LINES();
grx11Lines[grx11NbLines].x1 = x1;
@ -270,9 +272,9 @@ grx11DrawLine (x1, y1, x2, y2)
*/
void
grx11FillRects(rects, nb)
XRectangle rects[];
int nb;
grx11FillRects(
XRectangle rects[],
int nb)
{
XFillRectangles(grXdpy, grCurrent.window, grGCFill, rects, nb);
}
@ -290,8 +292,8 @@ grx11FillRects(rects, nb)
*/
void
grx11FillRect(r)
Rect *r; /* Address of a rectangle in screen
grx11FillRect(
Rect *r) /* Address of a rectangle in screen
* coordinates.
*/
{
@ -315,9 +317,9 @@ grx11FillRect(r)
*/
void
grx11FillPolygon(tp, np)
Point *tp;
int np;
grx11FillPolygon(
Point *tp,
int np)
{
XPoint xp[5];
int i;

View File

@ -68,15 +68,15 @@ static XFontStruct *grXFonts[4];
#define GR_NUM_GRIDS 64
bool
grx11DrawGrid (prect, outline, clip)
Rect *prect; /* A rectangle that forms the template
grx11DrawGrid(
Rect *prect, /* A rectangle that forms the template
* for the grid. Note: in order to maintain
* precision for the grid, the rectangle
* coordinates are specified in units of
* screen coordinates multiplied by SUBPIXEL.
*/
int outline; /* the outline style */
Rect *clip; /* a clipping rectangle */
int outline, /* the outline style */
Rect *clip) /* a clipping rectangle */
{
int xsize, ysize;
int x, y;
@ -194,8 +194,8 @@ grx11LoadFont()
*/
void
grx11SetCharSize (size)
int size; /* Width of characters, in pixels (6 or 8). */
grx11SetCharSize(
int size) /* Width of characters, in pixels (6 or 8). */
{
grCurrent.fontSize = size;
switch (size)
@ -238,10 +238,10 @@ grx11SetCharSize (size)
*/
int
GrX11TextSize(text, size, r)
char *text;
int size;
Rect *r;
GrX11TextSize(
char *text,
int size,
Rect *r)
{
XCharStruct overall;
XFontStruct *font;
@ -292,9 +292,10 @@ GrX11TextSize(text, size, r)
*/
int
GrX11ReadPixel (w, x, y)
MagWindow *w;
int x,y; /* the location of a pixel in screen coords */
GrX11ReadPixel(
MagWindow *w,
int x,
int y)
{
XImage *image;
unsigned long value;
@ -326,9 +327,9 @@ GrX11ReadPixel (w, x, y)
*/
void
GrX11BitBlt(r, p)
Rect *r;
Point *p;
GrX11BitBlt(
Rect *r,
Point *p)
{
Drawable wind = (Drawable)grCurrent.window;
@ -354,7 +355,8 @@ static GC grXcopyGC = (GC)NULL;
*/
void
grx11FreeBackingStore(MagWindow *window)
grx11FreeBackingStore(
MagWindow *window)
{
Pixmap pmap = (Pixmap)window->w_backingStore;
if (pmap == (Pixmap)NULL) return;
@ -380,7 +382,8 @@ grx11FreeBackingStore(MagWindow *window)
*/
void
grx11CreateBackingStore(MagWindow *w)
grx11CreateBackingStore(
MagWindow *w)
{
Pixmap pmap;
Window wind = (Window)w->w_grdata;
@ -433,7 +436,9 @@ grx11CreateBackingStore(MagWindow *w)
*/
bool
grx11GetBackingStore(MagWindow *w, Rect *area)
grx11GetBackingStore(
MagWindow *w,
Rect *area)
{
Pixmap pmap;
Window wind = (Window)w->w_grdata;
@ -482,7 +487,9 @@ grx11GetBackingStore(MagWindow *w, Rect *area)
*/
bool
grx11ScrollBackingStore(MagWindow *w, Point *shift)
grx11ScrollBackingStore(
MagWindow *w,
Point *shift)
{
Pixmap pmap;
unsigned int width, height;
@ -541,7 +548,9 @@ grx11ScrollBackingStore(MagWindow *w, Point *shift)
*/
void
grx11PutBackingStore(MagWindow *w, Rect *area)
grx11PutBackingStore(
MagWindow *w,
Rect *area)
{
Pixmap pmap = (Pixmap)w->w_backingStore;
Window wind = (Window)w->w_grdata;
@ -592,9 +601,9 @@ grx11PutBackingStore(MagWindow *w, Rect *area)
*/
void
grx11RectConvert(mr, xr)
Rect *mr;
XRectangle *xr;
grx11RectConvert(
Rect *mr,
XRectangle *xr)
{
xr->x = mr->r_xbot;
xr->y = grMagicToX(mr->r_ytop);
@ -613,14 +622,14 @@ grx11RectConvert(mr, xr)
*/
void
grx11FontText(text, font, size, rotate, pos, clip, obscure)
char *text;
int font;
int size; /* pixel size of the text */
int rotate; /* text rotation */
Point *pos; /* text base position */
Rect *clip;
LinkedRect *obscure;
grx11FontText(
char *text,
int font,
int size, /* pixel size of the text */
int rotate, /* text rotation */
Point *pos, /* text base position */
Rect *clip,
LinkedRect *obscure)
{
char *tptr;
FontChar *ccur, *clist;
@ -774,14 +783,13 @@ grx11FontText(text, font, size, rotate, pos, clip, obscure)
*/
void
grx11PutText (text, pos, clip, obscure)
char *text; /* The text to be drawn. */
Point *pos; /* A point located at the leftmost point of
grx11PutText(
char *text, /* The text to be drawn. */
Point *pos, /* A point located at the leftmost point of
* the baseline for this string.
*/
Rect *clip; /* A rectangle to clip against */
LinkedRect *obscure; /* A list of obscuring rectangles */
Rect *clip, /* A rectangle to clip against */
LinkedRect *obscure) /* A list of obscuring rectangles */
{
Rect location;
Rect overlap;
@ -842,9 +850,9 @@ grx11PutText (text, pos, clip, obscure)
*/
void
grX11suGeoSub(r, area)
Rect *r; /* Rectangle to be subtracted from. */
Rect *area; /* Area to be subtracted. */
grX11suGeoSub(
Rect *r, /* Rectangle to be subtracted from. */
Rect *area) /* Area to be subtracted. */
{
if (r->r_xbot == area->r_xbot) r->r_xbot = area->r_xtop;
else

View File

@ -53,9 +53,9 @@ Cursor grCursors[MAX_CURSORS];
*/
void
GrX11DrawGlyph (gl, p)
GrGlyph *gl; /* A single glyph */
Point *p; /* screen pos of lower left corner */
GrX11DrawGlyph(
GrGlyph *gl, /* A single glyph */
Point *p) /* screen pos of lower left corner */
{
Rect bBox;
bool anyObscure;
@ -168,8 +168,8 @@ GrX11DrawGlyph (gl, p)
*/
void
grx11DefineCursor(glyphs)
GrGlyphs *glyphs;
grx11DefineCursor(
GrGlyphs *glyphs)
{
int glyphnum;
Rect oldClip;
@ -301,8 +301,8 @@ grx11DefineCursor(glyphs)
*/
void
GrX11SetCursor(cursorNum)
int cursorNum; /* The cursor number as defined in the display
GrX11SetCursor(
int cursorNum) /* The cursor number as defined in the display
* styles file.
*/
{

View File

@ -63,9 +63,9 @@ pthread_t xloop_thread = 0;
*/
void
ParseEvent (event, parentID)
XEvent *event;
int parentID;
ParseEvent(
XEvent *event,
int parentID)
{
if (event->type == KeyPress)
{
@ -161,8 +161,8 @@ ParseEvent (event, parentID)
*/
void
xloop_begin(window)
Window window;
xloop_begin(
Window window)
{
XEvent xevent;
int parentID;
@ -201,8 +201,8 @@ xloop_begin(window)
*/
int
xloop_create(window)
Window window;
xloop_create(
Window window)
{
int status = 0;

View File

@ -25,6 +25,15 @@
#include "utils/magic.h"
#include "utils/geometry.h"
/* Forward declaration to avoid circular include with windows/windows.h */
struct WIND_S1;
typedef struct WIND_S1 MagWindow;
/* TileType is defined in database/database.h, which sits above graphics in
* the include hierarchy; repeat the (identical) typedef here so prototypes
* can name it without creating a circular dependency. */
typedef int TileType;
/* data structures */
typedef struct {
int idx, mask, color, outline, fill, stipple;
@ -54,13 +63,13 @@ extern void (*GrLockPtr)();
extern void (*GrUnlockPtr)();
extern bool GrHaveLock();
extern void GrClipTo();
extern void GrClipBox();
extern void GrClipBox(Rect *prect, int style);
extern void GrClipLine();
extern bool GrPutText();
extern bool GrPutText(char *str, int style, Point *p, int pos, int size, bool adjust, Rect *clip, Rect *actual);
extern void GrFillPolygon();
extern void (*GrDrawGlyphPtr)();
extern void (*GrBitBltPtr)();
extern int (*GrReadPixelPtr)();
extern int (*GrReadPixelPtr)(MagWindow *w, int x, int y);
extern void (*GrFlushPtr)();
/* Tablet routines */
@ -83,8 +92,10 @@ extern bool GrDrawGlyphNum();
#define GrFastBox(x) GrDrawFastBox(x, 0)
/* external color map routines */
extern bool GrReadCMap(), GrSaveCMap();
extern bool GrGetColor(), GrPutColor();
extern bool GrReadCMap(char *techStyle, char *dispType, char *monType, char *path, char *libPath);
extern bool GrSaveCMap(char *techStyle, char *dispType, char *monType, char *path, char *libPath);
extern bool GrGetColor(int color, int *red, int *green, int *blue);
extern bool GrPutColor(int color, int red, int green, int blue);
extern int GrNameToColor();
extern void GrPutManyColors();
extern void (*GrSetCMapPtr)();
@ -139,7 +150,7 @@ extern void (*GrResumePtr)();
#define GrResume (*GrResumePtr)
/* C99 compat */
extern void GrClipTriangle();
extern void GrClipTriangle(Rect *r, Rect *c, bool clipped, TileType dinfo, Point *points, int *np);
extern void GrBox();
extern bool GrFontText();
extern void GrDiagonal();