Commit af769892 authored by Adam Jackson's avatar Adam Jackson

Static and dead code cleanup from mi/

parent 62224e39
......@@ -85,18 +85,6 @@ extern RegionPtr miCopyArea(
int /*yOut*/
);
extern void miOpqStipDrawable(
DrawablePtr /*pDraw*/,
GCPtr /*pGC*/,
RegionPtr /*prgnSrc*/,
MiBits * /*pbits*/,
int /*srcx*/,
int /*w*/,
int /*h*/,
int /*dstx*/,
int /*dsty*/
);
extern RegionPtr miCopyPlane(
DrawablePtr /*pSrcDrawable*/,
DrawablePtr /*pDstDrawable*/,
......@@ -144,15 +132,6 @@ extern void miRecolorCursor(
/* midash.c */
extern miDashPtr miDashLine(
int /*npt*/,
DDXPointPtr /*ppt*/,
unsigned int /*nDash*/,
unsigned char * /*pDash*/,
unsigned int /*offset*/,
int * /*pnseg*/
);
extern void miStepDash(
int /*dist*/,
int * /*pDashIndex*/,
......@@ -326,16 +305,6 @@ extern void miPolySegment(
/* mipolytext.c */
extern int miPolyText(
DrawablePtr /*pDraw*/,
GCPtr /*pGC*/,
int /*x*/,
int /*y*/,
int /*count*/,
char * /*chars*/,
FontEncoding /*fontEncoding*/
);
extern int miPolyText8(
DrawablePtr /*pDraw*/,
GCPtr /*pGC*/,
......@@ -354,16 +323,6 @@ extern int miPolyText16(
unsigned short * /*chars*/
);
extern int miImageText(
DrawablePtr /*pDraw*/,
GCPtr /*pGC*/,
int /*x*/,
int /*y*/,
int /*count*/,
char * /*chars*/,
FontEncoding /*fontEncoding*/
);
extern void miImageText8(
DrawablePtr /*pDraw*/,
GCPtr /*pGC*/,
......@@ -403,10 +362,6 @@ extern Bool miRectAlloc(
int /*n*/
);
extern void miSetExtents(
RegionPtr /*pReg*/
);
extern int miFindMaxBand(
RegionPtr /*prgn*/
);
......@@ -417,7 +372,6 @@ extern Bool miValidRegion(
);
#endif
extern Bool miRegionDataCopy(RegionPtr dst, RegionPtr src);
extern Bool miRegionBroken(RegionPtr pReg);
/* miscrinit.c */
......@@ -432,11 +386,6 @@ extern Bool miModifyPixmapHeader(
pointer /*pPixData*/
);
extern Bool miCloseScreen(
int /*index*/,
ScreenPtr /*pScreen*/
);
extern Bool miCreateScreenResources(
ScreenPtr /*pScreen*/
);
......
......@@ -425,15 +425,8 @@ static unsigned long lrustamp;
static arcCacheRec *lastCacheHit = &arcCache[0];
static RESTYPE cacheType;
/*
* External so it can be called when low on memory.
* Call with a zero ID in that case.
*/
/*ARGSUSED*/
int
miFreeArcCache (data, id)
pointer data;
XID id;
static int
miFreeArcCache (pointer data, XID id)
{
int k;
arcCacheRec *cent;
......@@ -3136,8 +3129,8 @@ struct finalSpanChunk {
static struct finalSpanChunk *chunks;
struct finalSpan *
realAllocSpan ()
static struct finalSpan *
realAllocSpan (void)
{
struct finalSpanChunk *newChunk;
struct finalSpan *span;
......
......@@ -400,13 +400,9 @@ miGetPlane(
* Note how the clipped out bits of the bitmap are always the background
* color so that the stipple never causes FillRect to draw them.
*/
void
miOpqStipDrawable(pDraw, pGC, prgnSrc, pbits, srcx, w, h, dstx, dsty)
DrawablePtr pDraw;
GCPtr pGC;
RegionPtr prgnSrc;
MiBits *pbits;
int srcx, w, h, dstx, dsty;
static void
miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
MiBits *pbits, int srcx, int w, int h, int dstx, int dsty)
{
int oldfill, i;
unsigned long oldfg;
......
......@@ -54,196 +54,6 @@ SOFTWARE.
static miDashPtr CheckDashStorage(miDashPtr *ppseg, int nseg, int *pnsegMax);
/* return a list of DashRec. there will be an extra
entry at the end holding the last point of the polyline.
this means that the code that actually draws dashes can
get a pair of points for every dash. only the point in the last
dash record is useful; the other fields are not used.
nseg is the number of segments, not the number of points.
example:
dash1.start
dash2.start
dash3.start
last-point
defines a list of segments
(dash1.pt, dash2.pt)
(dash2.pt, dash3.pt)
(dash3.pt, last-point)
and nseg == 3.
NOTE:
EVEN_DASH == ~ODD_DASH
NOTE ALSO:
miDashLines may return 0 segments, going from pt[0] to pt[0] with one dash.
*/
miDashPtr
miDashLine(npt, ppt, nDash, pDash, offset, pnseg)
int npt;
DDXPointPtr ppt;
unsigned int nDash;
unsigned char *pDash;
unsigned int offset;
int *pnseg;
{
DDXPointRec pt1, pt2;
int lenCur; /* npt used from this dash */
int lenMax; /* npt in this dash */
int iDash = 0; /* index of current dash */
int which; /* EVEN_DASH or ODD_DASH */
miDashPtr pseg; /* list of dash segments */
miDashPtr psegBase; /* start of list */
int nseg = 0; /* number of dashes so far */
int nsegMax = 0; /* num segs we can fit in this list */
int x, y, len;
int adx, ady, signdx, signdy;
int du, dv, e1, e2, e, base_e = 0;
lenCur = offset;
which = EVEN_DASH;
while(lenCur >= pDash[iDash])
{
lenCur -= pDash[iDash];
iDash++;
if (iDash >= nDash)
iDash = 0;
which = ~which;
}
lenMax = pDash[iDash];
psegBase = (miDashPtr)NULL;
pt2 = ppt[0]; /* just in case there is only one point */
while(--npt)
{
if (PtEqual(ppt[0], ppt[1]))
{
ppt++;
continue; /* no duplicated points in polyline */
}
pt1 = *ppt++;
pt2 = *ppt;
adx = pt2.x - pt1.x;
ady = pt2.y - pt1.y;
signdx = sign(adx);
signdy = sign(ady);
adx = abs(adx);
ady = abs(ady);
if (adx > ady)
{
du = adx;
dv = ady;
len = adx;
}
else
{
du = ady;
dv = adx;
len = ady;
}
e1 = dv * 2;
e2 = e1 - 2*du;
e = e1 - du;
x = pt1.x;
y = pt1.y;
nseg++;
pseg = CheckDashStorage(&psegBase, nseg, &nsegMax);
if (!pseg)
return (miDashPtr)NULL;
pseg->pt = pt1;
pseg->e1 = e1;
pseg->e2 = e2;
base_e = pseg->e = e;
pseg->which = which;
pseg->newLine = 1;
while (len--)
{
if (adx > ady)
{
/* X_AXIS */
if (((signdx > 0) && (e < 0)) ||
((signdx <=0) && (e <=0))
)
{
e += e1;
}
else
{
y += signdy;
e += e2;
}
x += signdx;
}
else
{
/* Y_AXIS */
if (((signdx > 0) && (e < 0)) ||
((signdx <=0) && (e <=0))
)
{
e +=e1;
}
else
{
x += signdx;
e += e2;
}
y += signdy;
}
lenCur++;
if (lenCur >= lenMax && (len || npt <= 1))
{
nseg++;
pseg = CheckDashStorage(&psegBase, nseg, &nsegMax);
if (!pseg)
return (miDashPtr)NULL;
pseg->pt.x = x;
pseg->pt.y = y;
pseg->e1 = e1;
pseg->e2 = e2;
pseg->e = e;
which = ~which;
pseg->which = which;
pseg->newLine = 0;
/* move on to next dash */
iDash++;
if (iDash >= nDash)
iDash = 0;
lenMax = pDash[iDash];
lenCur = 0;
}
} /* while len-- */
} /* while --npt */
if (lenCur == 0 && nseg != 0)
{
nseg--;
which = ~which;
}
*pnseg = nseg;
pseg = CheckDashStorage(&psegBase, nseg+1, &nsegMax);
if (!pseg)
return (miDashPtr)NULL;
pseg->pt = pt2;
pseg->e = base_e;
pseg->which = which;
pseg->newLine = 0;
return psegBase;
}
#define NSEGDELTA 16
/* returns a pointer to the pseg[nseg-1], growing the storage as
......@@ -251,8 +61,7 @@ necessary. this interface seems unnecessarily cumbersome.
*/
static
miDashPtr
static miDashPtr
CheckDashStorage(
miDashPtr *ppseg, /* base pointer */
int nseg, /* number of segment we want to write to */
......
......@@ -107,10 +107,8 @@ miFillArcSetup(arc, info)
}
}
void
miFillArcDSetup(arc, info)
xArc *arc;
miFillArcDRec *info;
static void
miFillArcDSetup(xArc *arc, miFillArcDRec *info)
{
/* h^2 * (2x - 2xorg)^2 = w^2 * h^2 - w^2 * (2y - 2yorg)^2 */
/* even: xorg = yorg = 0 odd: xorg = .5, yorg = -.5 */
......@@ -188,15 +186,9 @@ miGetArcEdge(
}
}
void
miEllipseAngleToSlope (angle, width, height, dxp, dyp, d_dxp, d_dyp)
int angle;
int width;
int height;
int *dxp;
int *dyp;
double *d_dxp;
double *d_dyp;
static void
miEllipseAngleToSlope (int angle, int width, int height, int *dxp, int *dyp,
double *d_dxp, double *d_dyp)
{
int dx, dy;
double d_dx, d_dy, scale;
......
......@@ -176,35 +176,11 @@ typedef struct _miArcSlice {
#define miFillInArcLower(slw) (((iny + dy) != 0) && \
((slw > 1) || (ine != inxk)))
extern int miFreeArcCache(
pointer /*data*/,
XID /*id*/
);
extern struct finalSpan *realAllocSpan(
void
);
extern void miFillArcSetup(
xArc * /*arc*/,
miFillArcRec * /*info*/
);
extern void miFillArcDSetup(
xArc * /*arc*/,
miFillArcDRec * /*info*/
);
extern void miEllipseAngleToSlope(
int /*angle*/,
int /*width*/,
int /*height*/,
int * /*dxp*/,
int * /*dyp*/,
double * /*d_dxp*/,
double * /*d_dyp*/
);
extern void miFillArcSliceSetup(
xArc * /*arc*/,
miArcSliceRec * /*slice*/,
......
/*
* mipointer.c
*/
/*
Copyright 1989, 1998 The Open Group
......@@ -409,6 +404,27 @@ miPointerAbsoluteCursor (int x, int y, unsigned long time)
miPointerSetPosition(inputInfo.pointer, &x, &y, time);
}
/* Move the pointer on the current screen, and update the sprite. */
static void
miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y,
unsigned long time)
{
SetupScreen(pScreen);
if (pDev && (pDev->coreEvents || pDev == inputInfo.pointer) &&
!pScreenPriv->waitForUpdate && pScreen == miPointer.pSpriteScreen)
{
miPointer.devx = x;
miPointer.devy = y;
if(!miPointer.pCursor->bits->emptyMask)
(*pScreenPriv->spriteFuncs->MoveCursor) (pScreen, x, y);
}
miPointer.x = x;
miPointer.y = y;
miPointer.pScreen = pScreen;
}
_X_EXPORT void
miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y, unsigned long time)
{
......@@ -499,24 +515,3 @@ miPointerMove (ScreenPtr pScreen, int x, int y, unsigned long time)
for (i = 0; i < nevents; i++)
mieqEnqueue(inputInfo.pointer, &events[i]);
}
/* Move the pointer on the current screen, and update the sprite. */
void
miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y,
unsigned long time)
{
SetupScreen(pScreen);
if (pDev && (pDev->coreEvents || pDev == inputInfo.pointer) &&
!pScreenPriv->waitForUpdate && pScreen == miPointer.pSpriteScreen)
{
miPointer.devx = x;
miPointer.devy = y;
if(!miPointer.pCursor->bits->emptyMask)
(*pScreenPriv->spriteFuncs->MoveCursor) (pScreen, x, y);
}
miPointer.x = x;
miPointer.y = y;
miPointer.pScreen = pScreen;
}
/*
* mipointer.h
*
*/
/*
Copyright 1989, 1998 The Open Group
......@@ -172,15 +166,6 @@ extern void miPointerSetPosition(
extern void miPointerUpdateSprite(
DeviceIntPtr pDev);
/* Moves the sprite to x, y on the current screen, and updates the event
* history. */
extern void miPointerMoved(
DeviceIntPtr pDev,
ScreenPtr pScreen,
int x,
int y,
unsigned long time);
extern int miPointerScreenIndex;
#endif /* MIPOINTER_H */
......@@ -180,14 +180,6 @@ typedef struct _ScanLineListBlock {
/* mipolyutil.c */
extern Bool miInsertEdgeInET(
EdgeTable * /*ET*/,
EdgeTableEntry * /*ETE*/,
int /*scanline*/,
ScanLineListBlock ** /*SLLBlock*/,
int * /*iSLLBlock*/
);
extern Bool miCreateETandAET(
int /*count*/,
DDXPointPtr /*pts*/,
......
......@@ -66,30 +66,6 @@ SOFTWARE.
#include "dixfontstr.h"
#include "mi.h"
int
miPolyText(pDraw, pGC, x, y, count, chars, fontEncoding)
DrawablePtr pDraw;
GCPtr pGC;
int x, y;
int count;
char *chars;
FontEncoding fontEncoding;
{
unsigned long n, i;
int w;
CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */
GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)chars,
fontEncoding, &n, charinfo);
w = 0;
for (i=0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
if (n != 0)
(*pGC->ops->PolyGlyphBlt)(
pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font));
return x+w;
}
_X_EXPORT int
miPolyText8(pDraw, pGC, x, y, count, chars)
DrawablePtr pDraw;
......@@ -112,7 +88,6 @@ miPolyText8(pDraw, pGC, x, y, count, chars)
return x+w;
}
_X_EXPORT int
miPolyText16(pDraw, pGC, x, y, count, chars)
DrawablePtr pDraw;
......@@ -136,31 +111,6 @@ miPolyText16(pDraw, pGC, x, y, count, chars)
return x+w;
}
int
miImageText(pDraw, pGC, x, y, count, chars, fontEncoding)
DrawablePtr pDraw;
GCPtr pGC;
int x, y;
int count;
char *chars;
FontEncoding fontEncoding;
{
unsigned long n, i;
FontPtr font = pGC->font;
int w;
CharInfoPtr charinfo[255];
GetGlyphs(font, (unsigned long)count, (unsigned char *)chars,
fontEncoding, &n, charinfo);
w = 0;
for (i=0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
if (n !=0 )
(*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(font));
return x+w;
}
_X_EXPORT void
miImageText8(pDraw, pGC, x, y, count, chars)
DrawablePtr pDraw;
......@@ -179,7 +129,6 @@ miImageText8(pDraw, pGC, x, y, count, chars)
(*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(font));
}
_X_EXPORT void
miImageText16(pDraw, pGC, x, y, count, chars)
DrawablePtr pDraw;
......
......@@ -73,13 +73,9 @@ SOFTWARE.
* bucket. Finally, we can insert it.
*
*/
Bool
miInsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock)
EdgeTable *ET;
EdgeTableEntry *ETE;
int scanline;
ScanLineListBlock **SLLBlock;
int *iSLLBlock;
static Bool
miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline,
ScanLineListBlock **SLLBlock, int *iSLLBlock)
{
EdgeTableEntry *start, *prev;
ScanLineList *pSLL, *pPrevSLL;
......
......@@ -221,7 +221,7 @@ _X_EXPORT BoxRec miEmptyBox = {0, 0, 0, 0};
_X_EXPORT RegDataRec miEmptyData = {0, 0};
RegDataRec miBrokenData = {0, 0};
RegionRec miBrokenRegion = { { 0, 0, 0, 0 }, &miBrokenData };
static RegionRec miBrokenRegion = { { 0, 0, 0, 0 }, &miBrokenData };
_X_EXPORT void
miPrintRegion(rgn)
......@@ -913,7 +913,7 @@ miRegionOp(
*
*-----------------------------------------------------------------------
*/
void
static void
miSetExtents (pReg)
RegionPtr pReg;
{
......@@ -2182,35 +2182,6 @@ miTranslateRegion(pReg, x, y)
}
}
Bool
miRegionDataCopy(
RegionPtr dst,
RegionPtr src)
{
good(dst);
good(src);
if (dst->data)
return TRUE;
if (dst == src)
return TRUE;
if (!src->data || !src->data->size)
{
xfreeData(dst);
dst->data = (RegDataPtr)NULL;
return TRUE;
}
if (!dst->data || (dst->data->size < src->data->numRects))
{
xfreeData(dst);
dst->data = xallocData(src->data->numRects);
if (!dst->data)
return miRegionBreak (dst);
}
dst->data->size = src->data->size;
dst->data->numRects = src->data->numRects;
return TRUE;
}
_X_EXPORT void
miRegionReset(pReg, pBox)
RegionPtr pReg;
......
......@@ -126,12 +126,8 @@ miModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel, devKind,
return TRUE;
}
/*ARGSUSED*/
Bool
miCloseScreen (iScreen, pScreen)
int iScreen;
ScreenPtr pScreen;
static Bool
miCloseScreen (int iScreen, ScreenPtr pScreen)
{
return ((*pScreen->DestroyPixmap)((PixmapPtr)pScreen->devPrivate));
}
......
......@@ -78,9 +78,7 @@ void miInitSpanGroup(spanGroup)
#define YMIN(spans) (spans->points[0].y)
#define YMAX(spans) (spans->points[spans->count-1].y)
void miSubtractSpans (spanGroup, sub)
SpanGroup *spanGroup;
Spans *sub;
static void miSubtractSpans (SpanGroup *spanGroup, Spans *sub)
{
int i, subCount, spansCount;
int ymin, ymax, xmin, xmax;
......@@ -364,9 +362,8 @@ static int UniquifySpansX(
return (newWidths - startNewWidths) + 1;
} /* UniquifySpansX */
void
miDisposeSpanGroup (spanGroup)
SpanGroup *spanGroup;
static void
miDisposeSpanGroup (SpanGroup *spanGroup)
{
int i;
Spans *spans;
......@@ -538,24 +535,3 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
spanGroup->ymin = MAXSHORT;
spanGroup->ymax = MINSHORT;
}
void miFillSpanGroup(pDraw, pGC, spanGroup)
DrawablePtr pDraw;
GCPtr pGC;
SpanGroup *spanGroup;
{
int i;
Spans *spans;
for (i = 0, spans = spanGroup->group; i != spanGroup->count; i++, spans++) {
(*pGC->ops->FillSpans)
(pDraw, pGC, spans->count, spans->points, spans->widths, TRUE);
xfree(spans->points);
xfree(spans->widths);
}
spanGroup->count = 0;
spanGroup->ymin = MAXSHORT;
spanGroup->ymax = MINSHORT;
} /* FillSpanGroup */
......@@ -71,13 +71,6 @@ extern void miAppendSpans(
Spans * /*spans*/
);
/* Paint a span group, possibly with some overlap */
extern void miFillSpanGroup(
DrawablePtr /*pDraw*/,
GCPtr /*pGC*/,