mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-12 05:20:17 +00:00
Fix many sparse warnings. (#157253, Kjartan Maraas.
2004-11-10 Matthias Clasen <mclasen@redhat.com> * gdk/linux-fb/*: Fix many sparse warnings. (#157253, Kjartan Maraas.
This commit is contained in:
parent
b09a165355
commit
6de551b504
@ -1,5 +1,8 @@
|
|||||||
2004-11-10 Matthias Clasen <mclasen@redhat.com>
|
2004-11-10 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gdk/linux-fb/*: Fix many sparse warnings. (#157253,
|
||||||
|
Kjartan Maraas.
|
||||||
|
|
||||||
* NEWS: Updates
|
* NEWS: Updates
|
||||||
|
|
||||||
2004-11-09 Matthias Clasen <mclasen@redhat.com>
|
2004-11-09 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
2004-11-10 Matthias Clasen <mclasen@redhat.com>
|
2004-11-10 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gdk/linux-fb/*: Fix many sparse warnings. (#157253,
|
||||||
|
Kjartan Maraas.
|
||||||
|
|
||||||
* NEWS: Updates
|
* NEWS: Updates
|
||||||
|
|
||||||
2004-11-09 Matthias Clasen <mclasen@redhat.com>
|
2004-11-09 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
2004-11-10 Matthias Clasen <mclasen@redhat.com>
|
2004-11-10 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gdk/linux-fb/*: Fix many sparse warnings. (#157253,
|
||||||
|
Kjartan Maraas.
|
||||||
|
|
||||||
* NEWS: Updates
|
* NEWS: Updates
|
||||||
|
|
||||||
2004-11-09 Matthias Clasen <mclasen@redhat.com>
|
2004-11-09 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
2004-11-10 Matthias Clasen <mclasen@redhat.com>
|
2004-11-10 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gdk/linux-fb/*: Fix many sparse warnings. (#157253,
|
||||||
|
Kjartan Maraas.
|
||||||
|
|
||||||
* NEWS: Updates
|
* NEWS: Updates
|
||||||
|
|
||||||
2004-11-09 Matthias Clasen <mclasen@redhat.com>
|
2004-11-09 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
@ -357,7 +357,7 @@ gdk_fb_cursor_invalidate (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gdk_fb_cursor_unhide()
|
gdk_fb_cursor_unhide (void)
|
||||||
{
|
{
|
||||||
GdkFBDrawingContext *mydc = gdk_fb_cursor_dc;
|
GdkFBDrawingContext *mydc = gdk_fb_cursor_dc;
|
||||||
GdkCursorPrivateFB *last_private;
|
GdkCursorPrivateFB *last_private;
|
||||||
|
@ -170,7 +170,7 @@ gdk_keymap_get_direction (GdkKeymap *keymap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
guint
|
guint
|
||||||
gdk_fb_keyboard_modifiers ()
|
gdk_fb_keyboard_modifiers (void)
|
||||||
{
|
{
|
||||||
return gdk_fb_keyboard->modifier_state;
|
return gdk_fb_keyboard->modifier_state;
|
||||||
}
|
}
|
||||||
|
@ -715,7 +715,7 @@ gdk_fb_switch (int sig)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GdkFBDisplay *
|
static GdkFBDisplay *
|
||||||
gdk_fb_display_new ()
|
gdk_fb_display_new (void)
|
||||||
{
|
{
|
||||||
GdkFBDisplay *display;
|
GdkFBDisplay *display;
|
||||||
gchar *fb_filename;
|
gchar *fb_filename;
|
||||||
|
@ -658,7 +658,7 @@ gdk_fb_mouse_ms_open (GdkFBMouse *mouse)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while ((i = read (fd, buf, sizeof(buf))) > 0)
|
while ((i = read (fd, buf, sizeof(buf))) > 0)
|
||||||
g_print ("Got %d bytes of junk from %s\n", mouse->file, i);
|
g_print ("Got %d bytes of junk from %s\n", i, mouse->file);
|
||||||
|
|
||||||
tcgetattr (fd, &tty);
|
tcgetattr (fd, &tty);
|
||||||
tty.c_iflag = IGNBRK | IGNPAR;
|
tty.c_iflag = IGNBRK | IGNPAR;
|
||||||
|
@ -203,7 +203,7 @@ gdk_pixmap_create_from_data (GdkDrawable *window,
|
|||||||
GdkPixmap*
|
GdkPixmap*
|
||||||
gdk_pixmap_foreign_new (GdkNativeWindow anid)
|
gdk_pixmap_foreign_new (GdkNativeWindow anid)
|
||||||
{
|
{
|
||||||
return (GdkPixmap*) gdk_drawable_ref (anid);
|
return (GdkPixmap*) gdk_drawable_ref ((GdkDrawable *)anid);
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkPixmap*
|
GdkPixmap*
|
||||||
|
@ -138,7 +138,7 @@ gdk_selection_convert (GdkWindow *requestor,
|
|||||||
if (event_window)
|
if (event_window)
|
||||||
{
|
{
|
||||||
event = gdk_event_make (event_window, GDK_SELECTION_REQUEST, TRUE);
|
event = gdk_event_make (event_window, GDK_SELECTION_REQUEST, TRUE);
|
||||||
event->selection.requestor = requestor;
|
event->selection.requestor = (unsigned int)requestor;
|
||||||
event->selection.selection = selection;
|
event->selection.selection = selection;
|
||||||
event->selection.target = target;
|
event->selection.target = target;
|
||||||
event->selection.property = _gdk_selection_property;
|
event->selection.property = _gdk_selection_property;
|
||||||
@ -173,7 +173,7 @@ gdk_selection_property_get (GdkWindow *requestor,
|
|||||||
|
|
||||||
if (!gdk_property_get (requestor,
|
if (!gdk_property_get (requestor,
|
||||||
_gdk_selection_property,
|
_gdk_selection_property,
|
||||||
0/*AnyPropertyType?*/,
|
NULL/*AnyPropertyType?*/,
|
||||||
0, 0,
|
0, 0,
|
||||||
FALSE,
|
FALSE,
|
||||||
&prop_type, &prop_format, &prop_len,
|
&prop_type, &prop_format, &prop_len,
|
||||||
@ -190,7 +190,7 @@ gdk_selection_property_get (GdkWindow *requestor,
|
|||||||
|
|
||||||
if (!gdk_property_get (requestor,
|
if (!gdk_property_get (requestor,
|
||||||
_gdk_selection_property,
|
_gdk_selection_property,
|
||||||
0/*AnyPropertyType?*/,
|
NULL/*AnyPropertyType?*/,
|
||||||
0, prop_len + 1,
|
0, prop_len + 1,
|
||||||
FALSE,
|
FALSE,
|
||||||
&prop_type, &prop_format, &prop_len,
|
&prop_type, &prop_format, &prop_len,
|
||||||
@ -268,7 +268,7 @@ gchar *
|
|||||||
gdk_utf8_to_string_target (const gchar *str)
|
gdk_utf8_to_string_target (const gchar *str)
|
||||||
{
|
{
|
||||||
g_warning ("gdk_utf8_to_string_target() not implemented\n");
|
g_warning ("gdk_utf8_to_string_target() not implemented\n");
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
@ -2343,7 +2343,7 @@ GdkWindow*
|
|||||||
gdk_window_foreign_new_for_display (GdkDisplay *display,
|
gdk_window_foreign_new_for_display (GdkDisplay *display,
|
||||||
GdkNativeWindow anid)
|
GdkNativeWindow anid)
|
||||||
{
|
{
|
||||||
return (GdkWindow*) gdk_drawable_ref (anid);
|
return (GdkWindow*) gdk_drawable_ref ((GdkDrawable *)anid);
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkWindow*
|
GdkWindow*
|
||||||
|
@ -1198,8 +1198,7 @@ miPolyArc(GdkDrawable *pDraw, GdkGC *pGC, int narcs, miArc *parcs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static double
|
static double
|
||||||
angleBetween (center, point1, point2)
|
angleBetween (SppPointRec center, SppPointRec point1, SppPointRec point2)
|
||||||
SppPointRec center, point1, point2;
|
|
||||||
{
|
{
|
||||||
double a1, a2, a;
|
double a1, a2, a;
|
||||||
|
|
||||||
@ -1218,10 +1217,7 @@ angleBetween (center, point1, point2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
translateBounds (b, x, y, fx, fy)
|
translateBounds (miArcFacePtr b, int x, int y, double fx, double fy)
|
||||||
miArcFacePtr b;
|
|
||||||
int x, y;
|
|
||||||
double fx, fy;
|
|
||||||
{
|
{
|
||||||
fx += x;
|
fx += x;
|
||||||
fy += y;
|
fy += y;
|
||||||
@ -1342,13 +1338,8 @@ miArcJoin (GdkDrawable *pDraw, GdkGC *pGC, miArcFacePtr pLeft, miArcFacePtr pRig
|
|||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static void
|
static void
|
||||||
miArcCap (pDraw, pGC, pFace, end, xOrg, yOrg, xFtrans, yFtrans)
|
miArcCap (GdkDrawable *pDraw, GdkGC *pGC, miArcFacePtr pFace, int end,
|
||||||
GdkDrawable* pDraw;
|
int xOrg, int yOrg, double xFtrans, double yFtrans)
|
||||||
GdkGC* pGC;
|
|
||||||
miArcFacePtr pFace;
|
|
||||||
int end;
|
|
||||||
int xOrg, yOrg;
|
|
||||||
double xFtrans, yFtrans;
|
|
||||||
{
|
{
|
||||||
SppPointRec corner, otherCorner, center, endPoint, poly[5];
|
SppPointRec corner, otherCorner, center, endPoint, poly[5];
|
||||||
|
|
||||||
@ -1400,7 +1391,6 @@ static void miRoundCap(GdkDrawable *pDraw, GdkGC *pGC, SppPointRec pCenter, SppP
|
|||||||
{
|
{
|
||||||
int cpt;
|
int cpt;
|
||||||
double width;
|
double width;
|
||||||
double miDatan2 ();
|
|
||||||
SppArcRec arc;
|
SppArcRec arc;
|
||||||
SppPointPtr pArcPts;
|
SppPointPtr pArcPts;
|
||||||
|
|
||||||
@ -1410,7 +1400,7 @@ static void miRoundCap(GdkDrawable *pDraw, GdkGC *pGC, SppPointRec pCenter, SppP
|
|||||||
arc.y = pCenter.y - width/2;
|
arc.y = pCenter.y - width/2;
|
||||||
arc.width = width;
|
arc.width = width;
|
||||||
arc.height = width;
|
arc.height = width;
|
||||||
arc.angle1 = -miDatan2 (pCorner.y - pCenter.y, pCorner.x - pCenter.x);
|
arc.angle1 = -(miDatan2 (pCorner.y - pCenter.y, pCorner.x - pCenter.x));
|
||||||
if(PTISEQUAL(pCenter, pEnd))
|
if(PTISEQUAL(pCenter, pEnd))
|
||||||
arc.angle2 = - 180.0;
|
arc.angle2 = - 180.0;
|
||||||
else {
|
else {
|
||||||
@ -1446,8 +1436,7 @@ static void miRoundCap(GdkDrawable *pDraw, GdkGC *pGC, SppPointRec pCenter, SppP
|
|||||||
# define mod(a,b) ((a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
|
# define mod(a,b) ((a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
|
||||||
|
|
||||||
static double
|
static double
|
||||||
miDcos (a)
|
miDcos (double a)
|
||||||
double a;
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -1464,8 +1453,7 @@ double a;
|
|||||||
}
|
}
|
||||||
|
|
||||||
static double
|
static double
|
||||||
miDsin (a)
|
miDsin (double a)
|
||||||
double a;
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -1482,8 +1470,7 @@ double a;
|
|||||||
}
|
}
|
||||||
|
|
||||||
static double
|
static double
|
||||||
miDasin (v)
|
miDasin (double v)
|
||||||
double v;
|
|
||||||
{
|
{
|
||||||
if (v == 0)
|
if (v == 0)
|
||||||
return 0.0;
|
return 0.0;
|
||||||
@ -1495,8 +1482,7 @@ double v;
|
|||||||
}
|
}
|
||||||
|
|
||||||
static double
|
static double
|
||||||
miDatan2 (dy, dx)
|
miDatan2 (double dy, double dx)
|
||||||
double dy, dx;
|
|
||||||
{
|
{
|
||||||
if (dy == 0) {
|
if (dy == 0) {
|
||||||
if (dx >= 0)
|
if (dx >= 0)
|
||||||
@ -1631,10 +1617,7 @@ struct arcData {
|
|||||||
# define ADD_REALLOC_STEP 20
|
# define ADD_REALLOC_STEP 20
|
||||||
|
|
||||||
static void
|
static void
|
||||||
addCap (capsp, ncapsp, sizep, end, arcIndex)
|
addCap (miArcCapPtr *capsp, int *ncapsp, int *sizep, int end, int arcIndex)
|
||||||
miArcCapPtr *capsp;
|
|
||||||
int *ncapsp, *sizep;
|
|
||||||
int end, arcIndex;
|
|
||||||
{
|
{
|
||||||
int newsize;
|
int newsize;
|
||||||
miArcCapPtr cap;
|
miArcCapPtr cap;
|
||||||
@ -1656,10 +1639,8 @@ addCap (capsp, ncapsp, sizep, end, arcIndex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
addJoin (joinsp, njoinsp, sizep, end0, index0, phase0, end1, index1, phase1)
|
addJoin (miArcJoinPtr *joinsp, int *njoinsp, int *sizep, int end0, int index0,
|
||||||
miArcJoinPtr *joinsp;
|
int phase0, int end1, int index1, int phase1)
|
||||||
int *njoinsp, *sizep;
|
|
||||||
int end0, index0, phase0, end1, index1, phase1;
|
|
||||||
{
|
{
|
||||||
int newsize;
|
int newsize;
|
||||||
miArcJoinPtr join;
|
miArcJoinPtr join;
|
||||||
@ -1685,10 +1666,7 @@ addJoin (joinsp, njoinsp, sizep, end0, index0, phase0, end1, index1, phase1)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static miArcDataPtr
|
static miArcDataPtr
|
||||||
addArc (arcsp, narcsp, sizep, xarc)
|
addArc (miArcDataPtr *arcsp, int *narcsp, int *sizep, miArc *xarc)
|
||||||
miArcDataPtr *arcsp;
|
|
||||||
int *narcsp, *sizep;
|
|
||||||
miArc *xarc;
|
|
||||||
{
|
{
|
||||||
int newsize;
|
int newsize;
|
||||||
miArcDataPtr arc;
|
miArcDataPtr arc;
|
||||||
@ -1742,9 +1720,7 @@ miFreeArcs(miPolyArcPtr arcs, GdkGC *pGC)
|
|||||||
# define dashXAngleStep (((double) (90 * 64)) / ((double) (DASH_MAP_SIZE - 1)))
|
# define dashXAngleStep (((double) (90 * 64)) / ((double) (DASH_MAP_SIZE - 1)))
|
||||||
|
|
||||||
static void
|
static void
|
||||||
computeDashMap (arcp, map)
|
computeDashMap (miArc *arcp, dashMap *map)
|
||||||
miArc *arcp;
|
|
||||||
dashMap *map;
|
|
||||||
{
|
{
|
||||||
int di;
|
int di;
|
||||||
double a, x, y, prevx = 0.0, prevy = 0.0, dist;
|
double a, x, y, prevx = 0.0, prevy = 0.0, dist;
|
||||||
@ -1823,15 +1799,15 @@ miComputeArcs (miArc *parcs, int narcs, GdkGC *pGC)
|
|||||||
|
|
||||||
for (iphase = 0; iphase < (isDoubleDash ? 2 : 1); iphase++) {
|
for (iphase = 0; iphase < (isDoubleDash ? 2 : 1); iphase++) {
|
||||||
arcs[iphase].njoins = 0;
|
arcs[iphase].njoins = 0;
|
||||||
arcs[iphase].joins = 0;
|
arcs[iphase].joins = NULL;
|
||||||
joinSize[iphase] = 0;
|
joinSize[iphase] = 0;
|
||||||
|
|
||||||
arcs[iphase].ncaps = 0;
|
arcs[iphase].ncaps = 0;
|
||||||
arcs[iphase].caps = 0;
|
arcs[iphase].caps = NULL;
|
||||||
capSize[iphase] = 0;
|
capSize[iphase] = 0;
|
||||||
|
|
||||||
arcs[iphase].narcs = 0;
|
arcs[iphase].narcs = 0;
|
||||||
arcs[iphase].arcs = 0;
|
arcs[iphase].arcs = NULL;
|
||||||
arcSize[iphase] = 0;
|
arcSize[iphase] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1937,7 +1913,7 @@ miComputeArcs (miArc *parcs, int narcs, GdkGC *pGC)
|
|||||||
/*
|
/*
|
||||||
* add dashed arcs to each bucket
|
* add dashed arcs to each bucket
|
||||||
*/
|
*/
|
||||||
arc = 0;
|
arc = NULL;
|
||||||
while (dashAngle != endAngle) {
|
while (dashAngle != endAngle) {
|
||||||
prevDashAngle = dashAngle;
|
prevDashAngle = dashAngle;
|
||||||
if (arcType == OTHER) {
|
if (arcType == OTHER) {
|
||||||
@ -2161,9 +2137,7 @@ arcfail:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static double
|
static double
|
||||||
angleToLength (angle, map)
|
angleToLength (int angle, dashMap *map)
|
||||||
int angle;
|
|
||||||
dashMap *map;
|
|
||||||
{
|
{
|
||||||
double len, excesslen, sidelen = map->map[DASH_MAP_SIZE - 1], totallen;
|
double len, excesslen, sidelen = map->map[DASH_MAP_SIZE - 1], totallen;
|
||||||
int di;
|
int di;
|
||||||
@ -2211,9 +2185,7 @@ angleToLength (angle, map)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
lengthToAngle (len, map)
|
lengthToAngle (double len, dashMap *map)
|
||||||
double len;
|
|
||||||
dashMap *map;
|
|
||||||
{
|
{
|
||||||
double sidelen = map->map[DASH_MAP_SIZE - 1];
|
double sidelen = map->map[DASH_MAP_SIZE - 1];
|
||||||
int angle, angleexcess;
|
int angle, angleexcess;
|
||||||
@ -2324,12 +2296,8 @@ static int computeAngleFromPath(int startAngle, int endAngle, dashMap *map, int
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
drawZeroArc (pDraw, pGC, tarc, lw, left, right)
|
drawZeroArc (GdkDrawable *pDraw, GdkGC *pGC, miArc *tarc, int lw,
|
||||||
GdkDrawable* pDraw;
|
miArcFacePtr left, miArcFacePtr right)
|
||||||
GdkGC* pGC;
|
|
||||||
miArc *tarc;
|
|
||||||
int lw;
|
|
||||||
miArcFacePtr right, left;
|
|
||||||
{
|
{
|
||||||
double x0 = 0.0, y0 = 0.0, x1 = 0.0, y1 = 0.0, w, h, x, y;
|
double x0 = 0.0, y0 = 0.0, x1 = 0.0, y1 = 0.0, w, h, x, y;
|
||||||
double xmax, ymax, xmin, ymin;
|
double xmax, ymax, xmin, ymin;
|
||||||
@ -2454,9 +2422,7 @@ drawZeroArc (pDraw, pGC, tarc, lw, left, right)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
tailEllipseY (def, acc)
|
tailEllipseY (struct arc_def *def, struct accelerators *acc)
|
||||||
struct arc_def *def;
|
|
||||||
struct accelerators *acc;
|
|
||||||
{
|
{
|
||||||
double t;
|
double t;
|
||||||
|
|
||||||
@ -2483,46 +2449,35 @@ tailEllipseY (def, acc)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static double
|
static double
|
||||||
outerXfromXY (x, y, def, acc)
|
outerXfromXY (double x, double y,
|
||||||
double x, y;
|
struct arc_def *def, struct accelerators *acc)
|
||||||
struct arc_def *def;
|
|
||||||
struct accelerators *acc;
|
|
||||||
{
|
{
|
||||||
return x + (x * acc->h2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
|
return x + (x * acc->h2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static double
|
static double
|
||||||
outerYfromXY (x, y, def, acc)
|
outerYfromXY (double x, double y,
|
||||||
double x, y;
|
struct arc_def *def, struct accelerators *acc)
|
||||||
struct arc_def *def;
|
|
||||||
struct accelerators *acc;
|
|
||||||
{
|
{
|
||||||
return y + (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
|
return y + (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static double
|
static double
|
||||||
innerXfromXY (x, y, def, acc)
|
innerXfromXY (double x, double y,
|
||||||
double x, y;
|
struct arc_def *def, struct accelerators *acc)
|
||||||
struct arc_def *def;
|
|
||||||
struct accelerators *acc;
|
|
||||||
{
|
{
|
||||||
return x - (x * acc->h2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
|
return x - (x * acc->h2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static double
|
static double
|
||||||
innerYfromXY (x, y, def, acc)
|
innerYfromXY (double x, double y,
|
||||||
double x, y;
|
struct arc_def *def, struct accelerators *acc)
|
||||||
struct arc_def *def;
|
|
||||||
struct accelerators *acc;
|
|
||||||
{
|
{
|
||||||
return y - (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
|
return y - (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static double
|
static double
|
||||||
innerYfromY (y, def, acc)
|
innerYfromY (double y, struct arc_def *def, struct accelerators *acc)
|
||||||
double y;
|
|
||||||
struct arc_def *def;
|
|
||||||
struct accelerators *acc;
|
|
||||||
{
|
{
|
||||||
double x;
|
double x;
|
||||||
|
|
||||||
@ -2532,9 +2487,7 @@ innerYfromY (y, def, acc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
computeLine (x1, y1, x2, y2, line)
|
computeLine (double x1, double y1, double x2, double y2, struct line *line)
|
||||||
double x1, y1, x2, y2;
|
|
||||||
struct line *line;
|
|
||||||
{
|
{
|
||||||
if (y1 == y2)
|
if (y1 == y2)
|
||||||
line->valid = 0;
|
line->valid = 0;
|
||||||
@ -2552,11 +2505,7 @@ computeLine (x1, y1, x2, y2, line)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
computeAcc (tarc, lw, def, acc)
|
computeAcc (miArc *tarc, int lw, struct arc_def *def, struct accelerators *acc)
|
||||||
miArc *tarc;
|
|
||||||
int lw;
|
|
||||||
struct arc_def *def;
|
|
||||||
struct accelerators *acc;
|
|
||||||
{
|
{
|
||||||
def->w = ((double) tarc->width) / 2.0;
|
def->w = ((double) tarc->width) / 2.0;
|
||||||
def->h = ((double) tarc->height) / 2.0;
|
def->h = ((double) tarc->height) / 2.0;
|
||||||
@ -2582,11 +2531,8 @@ computeAcc (tarc, lw, def, acc)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
computeBound (def, bound, acc, right, left)
|
computeBound (struct arc_def *def, struct arc_bound *bound,
|
||||||
struct arc_def *def;
|
struct accelerators *acc, miArcFacePtr right, miArcFacePtr left)
|
||||||
struct arc_bound *bound;
|
|
||||||
struct accelerators *acc;
|
|
||||||
miArcFacePtr right, left;
|
|
||||||
{
|
{
|
||||||
double t;
|
double t;
|
||||||
double innerTaily;
|
double innerTaily;
|
||||||
@ -2722,11 +2668,8 @@ computeBound (def, bound, acc, right, left)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static double
|
static double
|
||||||
hookEllipseY (scan_y, bound, acc, left)
|
hookEllipseY (double scan_y, struct arc_bound *bound,
|
||||||
double scan_y;
|
struct accelerators *acc, int left)
|
||||||
struct arc_bound *bound;
|
|
||||||
struct accelerators *acc;
|
|
||||||
int left;
|
|
||||||
{
|
{
|
||||||
double ret;
|
double ret;
|
||||||
|
|
||||||
@ -2748,12 +2691,8 @@ hookEllipseY (scan_y, bound, acc, left)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static double
|
static double
|
||||||
hookX (scan_y, def, bound, acc, left)
|
hookX (double scan_y, struct arc_def *def,
|
||||||
double scan_y;
|
struct arc_bound *bound, struct accelerators *acc, int left)
|
||||||
struct arc_def *def;
|
|
||||||
struct arc_bound *bound;
|
|
||||||
struct accelerators *acc;
|
|
||||||
int left;
|
|
||||||
{
|
{
|
||||||
double ellipse_y, x;
|
double ellipse_y, x;
|
||||||
double maxMin;
|
double maxMin;
|
||||||
@ -2805,16 +2744,9 @@ hookX (scan_y, def, bound, acc, left)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
arcSpan (y, lx, lw, rx, rw, def, bounds, acc, mask)
|
arcSpan (int y, int lx, int lw, int rx, int rw,
|
||||||
int y;
|
struct arc_def *def, struct arc_bound *bounds,
|
||||||
int lx;
|
struct accelerators *acc, int mask)
|
||||||
int lw;
|
|
||||||
int rx;
|
|
||||||
int rw;
|
|
||||||
struct arc_def *def;
|
|
||||||
struct arc_bound *bounds;
|
|
||||||
struct accelerators *acc;
|
|
||||||
int mask;
|
|
||||||
{
|
{
|
||||||
int linx, loutx, rinx, routx;
|
int linx, loutx, rinx, routx;
|
||||||
double x, altx;
|
double x, altx;
|
||||||
@ -2875,15 +2807,9 @@ arcSpan (y, lx, lw, rx, rw, def, bounds, acc, mask)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
arcSpan0 (lx, lw, rx, rw, def, bounds, acc, mask)
|
arcSpan0 (int lx, int lw, int rx, int rw,
|
||||||
int lx;
|
struct arc_def *def, struct arc_bound *bounds,
|
||||||
int lw;
|
struct accelerators *acc, int mask)
|
||||||
int rx;
|
|
||||||
int rw;
|
|
||||||
struct arc_def *def;
|
|
||||||
struct arc_bound *bounds;
|
|
||||||
struct accelerators *acc;
|
|
||||||
int mask;
|
|
||||||
{
|
{
|
||||||
double x;
|
double x;
|
||||||
|
|
||||||
@ -2903,14 +2829,9 @@ arcSpan0 (lx, lw, rx, rw, def, bounds, acc, mask)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
tailSpan (y, lw, rw, def, bounds, acc, mask)
|
tailSpan (int y, int lw, int rw,
|
||||||
int y;
|
struct arc_def *def, struct arc_bound *bounds,
|
||||||
int lw;
|
struct accelerators *acc, int mask)
|
||||||
int rw;
|
|
||||||
struct arc_def *def;
|
|
||||||
struct arc_bound *bounds;
|
|
||||||
struct accelerators *acc;
|
|
||||||
int mask;
|
|
||||||
{
|
{
|
||||||
double yy, xalt, x, lx, rx;
|
double yy, xalt, x, lx, rx;
|
||||||
int n;
|
int n;
|
||||||
@ -2975,7 +2896,7 @@ static struct finalSpan *freeFinalSpans, *tmpFinalSpan;
|
|||||||
# define allocFinalSpan() (freeFinalSpans ?\
|
# define allocFinalSpan() (freeFinalSpans ?\
|
||||||
((tmpFinalSpan = freeFinalSpans), \
|
((tmpFinalSpan = freeFinalSpans), \
|
||||||
(freeFinalSpans = freeFinalSpans->next), \
|
(freeFinalSpans = freeFinalSpans->next), \
|
||||||
(tmpFinalSpan->next = 0), \
|
(tmpFinalSpan->next = NULL), \
|
||||||
tmpFinalSpan) : \
|
tmpFinalSpan) : \
|
||||||
realAllocSpan ())
|
realAllocSpan ())
|
||||||
|
|
||||||
@ -2989,7 +2910,7 @@ struct finalSpanChunk {
|
|||||||
static struct finalSpanChunk *chunks;
|
static struct finalSpanChunk *chunks;
|
||||||
|
|
||||||
struct finalSpan *
|
struct finalSpan *
|
||||||
realAllocSpan ()
|
realAllocSpan (void)
|
||||||
{
|
{
|
||||||
register struct finalSpanChunk *newChunk;
|
register struct finalSpanChunk *newChunk;
|
||||||
register struct finalSpan *span;
|
register struct finalSpan *span;
|
||||||
@ -3005,14 +2926,14 @@ realAllocSpan ()
|
|||||||
span->next = span+1;
|
span->next = span+1;
|
||||||
span++;
|
span++;
|
||||||
}
|
}
|
||||||
span->next = 0;
|
span->next = NULL;
|
||||||
span = newChunk->data;
|
span = newChunk->data;
|
||||||
span->next = 0;
|
span->next = NULL;
|
||||||
return span;
|
return span;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
disposeFinalSpans ()
|
disposeFinalSpans (void)
|
||||||
{
|
{
|
||||||
struct finalSpanChunk *chunk, *next;
|
struct finalSpanChunk *chunk, *next;
|
||||||
|
|
||||||
@ -3020,16 +2941,14 @@ disposeFinalSpans ()
|
|||||||
next = chunk->next;
|
next = chunk->next;
|
||||||
g_free (chunk);
|
g_free (chunk);
|
||||||
}
|
}
|
||||||
chunks = 0;
|
chunks = NULL;
|
||||||
freeFinalSpans = 0;
|
freeFinalSpans = NULL;
|
||||||
g_free(finalSpans);
|
g_free(finalSpans);
|
||||||
finalSpans = 0;
|
finalSpans = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fillSpans (pDrawable, pGC)
|
fillSpans (GdkDrawable *pDrawable, GdkGC *pGC)
|
||||||
GdkDrawable* pDrawable;
|
|
||||||
GdkGC* pGC;
|
|
||||||
{
|
{
|
||||||
register struct finalSpan *span;
|
register struct finalSpan *span;
|
||||||
register GdkSpan* xSpan;
|
register GdkSpan* xSpan;
|
||||||
@ -3075,8 +2994,7 @@ fillSpans (pDrawable, pGC)
|
|||||||
realFindSpan (y))
|
realFindSpan (y))
|
||||||
|
|
||||||
static struct finalSpan **
|
static struct finalSpan **
|
||||||
realFindSpan (y)
|
realFindSpan (int y)
|
||||||
int y;
|
|
||||||
{
|
{
|
||||||
struct finalSpan **newSpans;
|
struct finalSpan **newSpans;
|
||||||
int newSize, newMiny, newMaxy;
|
int newSize, newMiny, newMaxy;
|
||||||
@ -3127,9 +3045,7 @@ realFindSpan (y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
newFinalSpan (y, xmin, xmax)
|
newFinalSpan (int y, register int xmin, register int xmax)
|
||||||
int y;
|
|
||||||
register int xmin, xmax;
|
|
||||||
{
|
{
|
||||||
register struct finalSpan *x;
|
register struct finalSpan *x;
|
||||||
register struct finalSpan **f;
|
register struct finalSpan **f;
|
||||||
@ -3139,9 +3055,9 @@ newFinalSpan (y, xmin, xmax)
|
|||||||
f = findSpan (y);
|
f = findSpan (y);
|
||||||
if (!f)
|
if (!f)
|
||||||
return;
|
return;
|
||||||
oldx = 0;
|
oldx = NULL;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
prev = 0;
|
prev = NULL;
|
||||||
for (x = *f; x; x=x->next) {
|
for (x = *f; x; x=x->next) {
|
||||||
if (x == oldx) {
|
if (x == oldx) {
|
||||||
prev = x;
|
prev = x;
|
||||||
@ -3184,9 +3100,7 @@ newFinalSpan (y, xmin, xmax)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mirrorSppPoint (quadrant, sppPoint)
|
mirrorSppPoint (int quadrant, SppPointPtr sppPoint)
|
||||||
int quadrant;
|
|
||||||
SppPointPtr sppPoint;
|
|
||||||
{
|
{
|
||||||
switch (quadrant) {
|
switch (quadrant) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -3387,7 +3301,7 @@ drawArc (miArc *tarc, int l, int a0, int a1, miArcFacePtr right, miArcFacePtr le
|
|||||||
computeAcc (tarc, l, &def, &acc);
|
computeAcc (tarc, l, &def, &acc);
|
||||||
for (j = 0; j < sweepno; j++) {
|
for (j = 0; j < sweepno; j++) {
|
||||||
mask = sweep[j].mask;
|
mask = sweep[j].mask;
|
||||||
passRight = passLeft = 0;
|
passRight = passLeft = NULL;
|
||||||
if (mask & (1 << rightq)) {
|
if (mask & (1 << rightq)) {
|
||||||
if (sweep[j].a0 == righta)
|
if (sweep[j].a0 == righta)
|
||||||
passRight = right;
|
passRight = right;
|
||||||
@ -3454,13 +3368,9 @@ drawArc (miArc *tarc, int l, int a0, int a1, miArcFacePtr right, miArcFacePtr le
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
drawQuadrant (def, acc, a0, a1, mask, right, left, spdata)
|
drawQuadrant (struct arc_def *def, struct accelerators *acc,
|
||||||
struct arc_def *def;
|
int a0, int a1, int mask, miArcFacePtr right,
|
||||||
struct accelerators *acc;
|
miArcFacePtr left, miArcSpanData *spdata)
|
||||||
int a0, a1;
|
|
||||||
int mask;
|
|
||||||
miArcFacePtr right, left;
|
|
||||||
miArcSpanData *spdata;
|
|
||||||
{
|
{
|
||||||
struct arc_bound bound;
|
struct arc_bound bound;
|
||||||
double yy, x, xalt;
|
double yy, x, xalt;
|
||||||
|
@ -45,7 +45,8 @@ SOFTWARE.
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "mi.h"
|
#include "mi.h"
|
||||||
|
|
||||||
static miDashPtr CheckDashStorage();
|
static miDashPtr
|
||||||
|
CheckDashStorage(miDashPtr *ppseg, int nseg, int *pnsegMax);
|
||||||
|
|
||||||
/* return a list of DashRec. there will be an extra
|
/* return a list of DashRec. there will be an extra
|
||||||
entry at the end holding the last point of the polyline.
|
entry at the end holding the last point of the polyline.
|
||||||
@ -79,13 +80,8 @@ enum { EVEN_DASH=0, ODD_DASH=1 };
|
|||||||
#define sign(x) ((x)>0)?1:( ((x)<0)?-1:0 )
|
#define sign(x) ((x)>0)?1:( ((x)<0)?-1:0 )
|
||||||
|
|
||||||
miDashPtr
|
miDashPtr
|
||||||
miDashLine(npt, ppt, nDash, pDash, offset, pnseg)
|
miDashLine(int npt, GdkPoint *ppt, unsigned int nDash,
|
||||||
int npt;
|
unsigned char *pDash, unsigned int offset, int *pnseg)
|
||||||
GdkPoint* ppt;
|
|
||||||
unsigned int nDash;
|
|
||||||
unsigned char *pDash;
|
|
||||||
unsigned int offset;
|
|
||||||
int *pnseg;
|
|
||||||
{
|
{
|
||||||
GdkPoint pt1, pt2;
|
GdkPoint pt1, pt2;
|
||||||
int lenCur; /* npt used from this dash */
|
int lenCur; /* npt used from this dash */
|
||||||
@ -248,12 +244,13 @@ necessary. this interface seems unnecessarily cumbersome.
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static
|
static miDashPtr
|
||||||
miDashPtr
|
CheckDashStorage(miDashPtr *ppseg, int nseg, int *pnsegMax)
|
||||||
CheckDashStorage(ppseg, nseg, pnsegMax)
|
#if 0
|
||||||
miDashPtr *ppseg; /* base pointer */
|
miDashPtr *ppseg; /* base pointer */
|
||||||
int nseg; /* number of segment we want to write to */
|
int nseg; /* number of segment we want to write to */
|
||||||
int *pnsegMax; /* size (in segments) of list so far */
|
int *pnsegMax; /* size (in segments) of list so far */
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if (nseg > *pnsegMax)
|
if (nseg > *pnsegMax)
|
||||||
{
|
{
|
||||||
@ -273,12 +270,15 @@ int *pnsegMax; /* size (in segments) of list so far */
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
miStepDash (dist, pDashIndex, pDash, numInDashList, pDashOffset)
|
miStepDash (int dist, int *pDashIndex, unsigned char *pDash,
|
||||||
|
int numInDashList, int *pDashOffset)
|
||||||
|
#if 0
|
||||||
int dist; /* distance to step */
|
int dist; /* distance to step */
|
||||||
int *pDashIndex; /* current dash */
|
int *pDashIndex; /* current dash */
|
||||||
unsigned char *pDash; /* dash list */
|
unsigned char *pDash; /* dash list */
|
||||||
int numInDashList; /* total length of dash list */
|
int numInDashList; /* total length of dash list */
|
||||||
int *pDashOffset; /* offset into current dash */
|
int *pDashOffset; /* offset into current dash */
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
int dashIndex, dashOffset;
|
int dashIndex, dashOffset;
|
||||||
int totallen;
|
int totallen;
|
||||||
|
@ -43,9 +43,7 @@ Author: Bob Scheifler, MIT X Consortium
|
|||||||
#define Dcos(d) cos((double)d*(M_PI/11520.0))
|
#define Dcos(d) cos((double)d*(M_PI/11520.0))
|
||||||
|
|
||||||
void
|
void
|
||||||
miFillArcSetup(arc, info)
|
miFillArcSetup(register miArc *arc, register miFillArcRec *info)
|
||||||
register miArc *arc;
|
|
||||||
register miFillArcRec *info;
|
|
||||||
{
|
{
|
||||||
info->y = arc->height >> 1;
|
info->y = arc->height >> 1;
|
||||||
info->dy = arc->height & 1;
|
info->dy = arc->height & 1;
|
||||||
@ -98,9 +96,7 @@ miFillArcSetup(arc, info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
miFillArcDSetup(arc, info)
|
miFillArcDSetup(register miArc *arc, register miFillArcDRec *info)
|
||||||
register miArc *arc;
|
|
||||||
register miFillArcDRec *info;
|
|
||||||
{
|
{
|
||||||
/* h^2 * (2x - 2xorg)^2 = w^2 * h^2 - w^2 * (2y - 2yorg)^2 */
|
/* h^2 * (2x - 2xorg)^2 = w^2 * h^2 - w^2 * (2y - 2yorg)^2 */
|
||||||
/* even: xorg = yorg = 0 odd: xorg = .5, yorg = -.5 */
|
/* even: xorg = yorg = 0 odd: xorg = .5, yorg = -.5 */
|
||||||
@ -130,11 +126,8 @@ miFillArcDSetup(arc, info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
miGetArcEdge(arc, edge, k, top, left)
|
miGetArcEdge(register miArc *arc, register miSliceEdgePtr edge, int k,
|
||||||
register miArc *arc;
|
gboolean top, gboolean left)
|
||||||
register miSliceEdgePtr edge;
|
|
||||||
int k;
|
|
||||||
gboolean top, left;
|
|
||||||
{
|
{
|
||||||
register int xady, y;
|
register int xady, y;
|
||||||
|
|
||||||
@ -178,14 +171,8 @@ miGetArcEdge(arc, edge, k, top, left)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
miEllipseAngleToSlope (angle, width, height, dxp, dyp, d_dxp, d_dyp)
|
miEllipseAngleToSlope (int angle, int width, int height, int *dxp, int *dyp,
|
||||||
int angle;
|
double *d_dxp, double *d_dyp)
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
int *dxp;
|
|
||||||
int *dyp;
|
|
||||||
double *d_dxp;
|
|
||||||
double *d_dyp;
|
|
||||||
{
|
{
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
double d_dx, d_dy, scale;
|
double d_dx, d_dy, scale;
|
||||||
@ -259,16 +246,13 @@ miEllipseAngleToSlope (angle, width, height, dxp, dyp, d_dxp, d_dyp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
miGetPieEdge(arc, angle, edge, top, left)
|
miGetPieEdge(register miArc *arc, register int angle,
|
||||||
register miArc *arc;
|
register miSliceEdgePtr edge, gboolean top, gboolean left)
|
||||||
register int angle;
|
|
||||||
register miSliceEdgePtr edge;
|
|
||||||
gboolean top, left;
|
|
||||||
{
|
{
|
||||||
register int k;
|
register int k;
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
|
|
||||||
miEllipseAngleToSlope (angle, arc->width, arc->height, &dx, &dy, 0, 0);
|
miEllipseAngleToSlope (angle, arc->width, arc->height, &dx, &dy, NULL, NULL);
|
||||||
|
|
||||||
if (dy == 0)
|
if (dy == 0)
|
||||||
{
|
{
|
||||||
@ -303,10 +287,8 @@ miGetPieEdge(arc, angle, edge, top, left)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
miFillArcSliceSetup(arc, slice, pGC)
|
miFillArcSliceSetup(register miArc *arc, register miArcSliceRec *slice,
|
||||||
register miArc *arc;
|
GdkGC *pGC)
|
||||||
register miArcSliceRec *slice;
|
|
||||||
GdkGC* pGC;
|
|
||||||
{
|
{
|
||||||
register int angle1, angle2;
|
register int angle1, angle2;
|
||||||
|
|
||||||
@ -532,10 +514,7 @@ miFillArcSliceSetup(arc, slice, pGC)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
miFillEllipseI(pDraw, pGC, arc)
|
miFillEllipseI(GdkDrawable *pDraw, GdkGC *pGC, miArc *arc)
|
||||||
GdkDrawable* pDraw;
|
|
||||||
GdkGC* pGC;
|
|
||||||
miArc *arc;
|
|
||||||
{
|
{
|
||||||
register int x, y, e;
|
register int x, y, e;
|
||||||
int yk, xk, ym, xm, dx, dy, xorg, yorg;
|
int yk, xk, ym, xm, dx, dy, xorg, yorg;
|
||||||
@ -561,10 +540,7 @@ miFillEllipseI(pDraw, pGC, arc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
miFillEllipseD(pDraw, pGC, arc)
|
miFillEllipseD(GdkDrawable *pDraw, GdkGC *pGC, miArc *arc)
|
||||||
GdkDrawable* pDraw;
|
|
||||||
GdkGC* pGC;
|
|
||||||
miArc *arc;
|
|
||||||
{
|
{
|
||||||
register int x, y;
|
register int x, y;
|
||||||
int xorg, yorg, dx, dy, slw;
|
int xorg, yorg, dx, dy, slw;
|
||||||
@ -611,10 +587,7 @@ miFillEllipseD(pDraw, pGC, arc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
miFillArcSliceI(pDraw, pGC, arc)
|
miFillArcSliceI(GdkDrawable *pDraw, GdkGC *pGC, miArc *arc)
|
||||||
GdkDrawable* pDraw;
|
|
||||||
GdkGC* pGC;
|
|
||||||
miArc *arc;
|
|
||||||
{
|
{
|
||||||
int yk, xk, ym, xm, dx, dy, xorg, yorg, slw;
|
int yk, xk, ym, xm, dx, dy, xorg, yorg, slw;
|
||||||
register int x, y, e;
|
register int x, y, e;
|
||||||
@ -658,10 +631,7 @@ miFillArcSliceI(pDraw, pGC, arc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
miFillArcSliceD(pDraw, pGC, arc)
|
miFillArcSliceD(GdkDrawable *pDraw, GdkGC *pGC, miArc *arc)
|
||||||
GdkDrawable* pDraw;
|
|
||||||
GdkGC* pGC;
|
|
||||||
miArc *arc;
|
|
||||||
{
|
{
|
||||||
register int x, y;
|
register int x, y;
|
||||||
int dx, dy, xorg, yorg, slw;
|
int dx, dy, xorg, yorg, slw;
|
||||||
@ -710,11 +680,7 @@ miFillArcSliceD(pDraw, pGC, arc)
|
|||||||
* fill each arc as it comes.
|
* fill each arc as it comes.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
miPolyFillArc(pDraw, pGC, narcs, parcs)
|
miPolyFillArc(GdkDrawable *pDraw, GdkGC *pGC, int narcs, miArc *parcs)
|
||||||
GdkDrawable* pDraw;
|
|
||||||
GdkGC* pGC;
|
|
||||||
int narcs;
|
|
||||||
miArc *parcs;
|
|
||||||
{
|
{
|
||||||
register int i;
|
register int i;
|
||||||
register miArc *arc;
|
register miArc *arc;
|
||||||
|
@ -174,51 +174,18 @@ typedef struct _miArcSlice {
|
|||||||
#define miFillInArcLower(slw) (((iny + dy) != 0) && \
|
#define miFillInArcLower(slw) (((iny + dy) != 0) && \
|
||||||
((slw > 1) || (ine != inxk)))
|
((slw > 1) || (ine != inxk)))
|
||||||
|
|
||||||
extern int miFreeArcCache(
|
extern int miFreeArcCache(gpointer data, guint id);
|
||||||
#if NeedFunctionPrototypes
|
|
||||||
gpointer /*data*/,
|
|
||||||
guint /*id*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern struct finalSpan *realAllocSpan(
|
extern struct finalSpan *realAllocSpan(void);
|
||||||
#if NeedFunctionPrototypes
|
|
||||||
void
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void miFillArcSetup(
|
extern void miFillArcSetup(miArc *arc, miFillArcRec *info);
|
||||||
#if NeedFunctionPrototypes
|
|
||||||
miArc * /*arc*/,
|
|
||||||
miFillArcRec * /*info*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void miFillArcDSetup(
|
extern void miFillArcDSetup(miArc *arc, miFillArcDRec *info);
|
||||||
#if NeedFunctionPrototypes
|
|
||||||
miArc * /*arc*/,
|
|
||||||
miFillArcDRec * /*info*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void miEllipseAngleToSlope(
|
extern void miEllipseAngleToSlope(int angle, int width, int height, int *dxp,
|
||||||
#if NeedFunctionPrototypes
|
int *dyp, double *d_dxp, double *d_dyp);
|
||||||
int /*angle*/,
|
|
||||||
int /*width*/,
|
|
||||||
int /*height*/,
|
|
||||||
int * /*dxp*/,
|
|
||||||
int * /*dyp*/,
|
|
||||||
double * /*d_dxp*/,
|
|
||||||
double * /*d_dyp*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void miFillArcSliceSetup(
|
extern void miFillArcSliceSetup(miArc *arc, miArcSliceRec *slice, GdkGC* pGC);
|
||||||
#if NeedFunctionPrototypes
|
|
||||||
miArc * /*arc*/,
|
|
||||||
miArcSliceRec * /*slice*/,
|
|
||||||
GdkGC* /*pGC*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -69,8 +69,7 @@ SOFTWARE.
|
|||||||
#else
|
#else
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define ICEIL ICIEL
|
#define ICEIL ICIEL
|
||||||
static __inline int ICEIL(x)
|
static __inline int ICEIL(double x)
|
||||||
double x;
|
|
||||||
{
|
{
|
||||||
int _cTmp = x;
|
int _cTmp = x;
|
||||||
return ((x == _cTmp) || (x < 0.0)) ? _cTmp : _cTmp+1;
|
return ((x == _cTmp) || (x < 0.0)) ? _cTmp : _cTmp+1;
|
||||||
@ -97,16 +96,14 @@ typedef struct _SppArc {
|
|||||||
/* mifpolycon.c */
|
/* mifpolycon.c */
|
||||||
|
|
||||||
extern void miFillSppPoly(
|
extern void miFillSppPoly(
|
||||||
#if NeedFunctionPrototypes
|
GdkDrawable* dst,
|
||||||
GdkDrawable* /*dst*/,
|
GdkGC* pgc,
|
||||||
GdkGC* /*pgc*/,
|
int count,
|
||||||
int /*count*/,
|
SppPointPtr ptsIn,
|
||||||
SppPointPtr /*ptsIn*/,
|
int xTrans,
|
||||||
int /*xTrans*/,
|
int yTrans,
|
||||||
int /*yTrans*/,
|
double xFtrans,
|
||||||
double /*xFtrans*/,
|
double yFtrans
|
||||||
double /*yFtrans*/
|
|
||||||
#endif
|
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif /* MIFPOLY_H */
|
#endif /* MIFPOLY_H */
|
||||||
|
@ -46,7 +46,8 @@ SOFTWARE.
|
|||||||
#include "mi.h"
|
#include "mi.h"
|
||||||
#include "mifpoly.h"
|
#include "mifpoly.h"
|
||||||
|
|
||||||
static int GetFPolyYBounds();
|
static int
|
||||||
|
GetFPolyYBounds(register SppPointPtr pts, int n, double yFtrans, int *by, int *ty);
|
||||||
|
|
||||||
#ifdef ICEILTEMPDECL
|
#ifdef ICEILTEMPDECL
|
||||||
ICEILTEMPDECL
|
ICEILTEMPDECL
|
||||||
@ -228,13 +229,8 @@ miFillSppPoly(GdkDrawable *dst, GdkGC *pgc, int count, SppPointPtr ptsIn, int xT
|
|||||||
|
|
||||||
/* Find the index of the point with the smallest y.also return the
|
/* Find the index of the point with the smallest y.also return the
|
||||||
* smallest and largest y */
|
* smallest and largest y */
|
||||||
static
|
static int
|
||||||
int
|
GetFPolyYBounds(register SppPointPtr pts, int n, double yFtrans, int *by, int *ty)
|
||||||
GetFPolyYBounds(pts, n, yFtrans, by, ty)
|
|
||||||
register SppPointPtr pts;
|
|
||||||
int n;
|
|
||||||
double yFtrans;
|
|
||||||
int *by, *ty;
|
|
||||||
{
|
{
|
||||||
register SppPointPtr ptMin;
|
register SppPointPtr ptMin;
|
||||||
double ymin, ymax;
|
double ymin, ymax;
|
||||||
|
@ -154,24 +154,22 @@ extern void miSetZeroLineBias(
|
|||||||
extern int miZeroLineScreenIndex;
|
extern int miZeroLineScreenIndex;
|
||||||
|
|
||||||
extern int miZeroClipLine(
|
extern int miZeroClipLine(
|
||||||
#if NeedFunctionPrototypes
|
int xmin,
|
||||||
int /*xmin*/,
|
int ymin,
|
||||||
int /*ymin*/,
|
int xmax,
|
||||||
int /*xmax*/,
|
int ymax,
|
||||||
int /*ymax*/,
|
int * new_x1,
|
||||||
int * /*new_x1*/,
|
int * new_y1,
|
||||||
int * /*new_y1*/,
|
int * new_x2,
|
||||||
int * /*new_x2*/,
|
int * new_y2,
|
||||||
int * /*new_y2*/,
|
unsigned int adx,
|
||||||
unsigned int /*adx*/,
|
unsigned int ady,
|
||||||
unsigned int /*ady*/,
|
int * pt1_clipped,
|
||||||
int * /*pt1_clipped*/,
|
int * pt2_clipped,
|
||||||
int * /*pt2_clipped*/,
|
int octant,
|
||||||
int /*octant*/,
|
unsigned int bias,
|
||||||
unsigned int /*bias*/,
|
int oc1,
|
||||||
int /*oc1*/,
|
int oc2
|
||||||
int /*oc2*/
|
|
||||||
#endif
|
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif /* MILINE_H */
|
#endif /* MILINE_H */
|
||||||
|
@ -54,22 +54,12 @@ SOFTWARE.
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "mi.h"
|
#include "mi.h"
|
||||||
|
|
||||||
extern gboolean miFillGeneralPoly(
|
extern gboolean miFillGeneralPoly(GdkDrawable* dst, GdkGC* pgc,
|
||||||
#if NeedFunctionPrototypes
|
int count, GdkPoint* ptsIn);
|
||||||
GdkDrawable* /*dst*/,
|
|
||||||
GdkGC* /*pgc*/,
|
|
||||||
int /*count*/,
|
|
||||||
GdkPoint* /*ptsIn*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
miFillPolygon(dst, pgc, shape, mode, count, pPts)
|
miFillPolygon(GdkDrawable *dst, register GdkGC *pgc, int shape,
|
||||||
GdkDrawable* dst;
|
int mode, register int count, GdkPoint *pPts)
|
||||||
register GdkGC* pgc;
|
|
||||||
int shape, mode;
|
|
||||||
register int count;
|
|
||||||
GdkPoint* pPts;
|
|
||||||
{
|
{
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
return;
|
return;
|
||||||
|
@ -181,50 +181,19 @@ typedef struct _ScanLineListBlock {
|
|||||||
|
|
||||||
/* mipolyutil.c */
|
/* mipolyutil.c */
|
||||||
|
|
||||||
extern gboolean miInsertEdgeInET(
|
extern gboolean miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline,
|
||||||
#if NeedFunctionPrototypes
|
ScanLineListBlock **SLLBlock, int *iSLLBlock);
|
||||||
EdgeTable * /*ET*/,
|
|
||||||
EdgeTableEntry * /*ETE*/,
|
|
||||||
int /*scanline*/,
|
|
||||||
ScanLineListBlock ** /*SLLBlock*/,
|
|
||||||
int * /*iSLLBlock*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern gboolean miCreateETandAET(
|
extern gboolean miCreateETandAET(int count, GdkPoint* pts, EdgeTable *ET,
|
||||||
#if NeedFunctionPrototypes
|
EdgeTableEntry *AET, EdgeTableEntry *pETEs,
|
||||||
int /*count*/,
|
ScanLineListBlock *pSLLBlock);
|
||||||
GdkPoint* /*pts*/,
|
|
||||||
EdgeTable * /*ET*/,
|
|
||||||
EdgeTableEntry * /*AET*/,
|
|
||||||
EdgeTableEntry * /*pETEs*/,
|
|
||||||
ScanLineListBlock * /*pSLLBlock*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void miloadAET(
|
extern void miloadAET(EdgeTableEntry *AET, EdgeTableEntry *ETEs);
|
||||||
#if NeedFunctionPrototypes
|
|
||||||
EdgeTableEntry * /*AET*/,
|
|
||||||
EdgeTableEntry * /*ETEs*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void micomputeWAET(
|
extern void micomputeWAET(EdgeTableEntry *AET);
|
||||||
#if NeedFunctionPrototypes
|
|
||||||
EdgeTableEntry * /*AET*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern int miInsertionSort(
|
extern int miInsertionSort(EdgeTableEntry *AET);
|
||||||
#if NeedFunctionPrototypes
|
|
||||||
EdgeTableEntry * /*AET*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void miFreeStorage(
|
extern void miFreeStorage(ScanLineListBlock *pSLLBlock);
|
||||||
#if NeedFunctionPrototypes
|
|
||||||
ScanLineListBlock * /*pSLLBlock*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -56,11 +56,7 @@ SOFTWARE.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
miFillGeneralPoly(dst, pgc, count, ptsIn)
|
miFillGeneralPoly(GdkDrawable *dst, GdkGC *pgc, int count, GdkPoint *ptsIn)
|
||||||
GdkDrawable* dst;
|
|
||||||
GdkGC* pgc;
|
|
||||||
int count; /* number of points */
|
|
||||||
GdkPoint* ptsIn; /* the points */
|
|
||||||
{
|
{
|
||||||
register EdgeTableEntry *pAET; /* the Active Edge Table */
|
register EdgeTableEntry *pAET; /* the Active Edge Table */
|
||||||
register int y; /* the current scanline */
|
register int y; /* the current scanline */
|
||||||
|
@ -68,12 +68,8 @@ SOFTWARE.
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
miInsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock)
|
miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline,
|
||||||
EdgeTable *ET;
|
ScanLineListBlock **SLLBlock, int *iSLLBlock)
|
||||||
EdgeTableEntry *ETE;
|
|
||||||
int scanline;
|
|
||||||
ScanLineListBlock **SLLBlock;
|
|
||||||
int *iSLLBlock;
|
|
||||||
{
|
{
|
||||||
register EdgeTableEntry *start, *prev;
|
register EdgeTableEntry *start, *prev;
|
||||||
register ScanLineList *pSLL, *pPrevSLL;
|
register ScanLineList *pSLL, *pPrevSLL;
|
||||||
@ -159,13 +155,9 @@ miInsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
miCreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock)
|
miCreateETandAET(register int count, register GdkPoint *pts, EdgeTable *ET,
|
||||||
register int count;
|
EdgeTableEntry *AET, register EdgeTableEntry *pETEs,
|
||||||
register GdkPoint* pts;
|
ScanLineListBlock *pSLLBlock)
|
||||||
EdgeTable *ET;
|
|
||||||
EdgeTableEntry *AET;
|
|
||||||
register EdgeTableEntry *pETEs;
|
|
||||||
ScanLineListBlock *pSLLBlock;
|
|
||||||
{
|
{
|
||||||
register GdkPoint* top, *bottom;
|
register GdkPoint* top, *bottom;
|
||||||
register GdkPoint* PrevPt, *CurrPt;
|
register GdkPoint* PrevPt, *CurrPt;
|
||||||
@ -255,8 +247,7 @@ miCreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
miloadAET(AET, ETEs)
|
miloadAET(register EdgeTableEntry *AET, register EdgeTableEntry *ETEs)
|
||||||
register EdgeTableEntry *AET, *ETEs;
|
|
||||||
{
|
{
|
||||||
register EdgeTableEntry *pPrevAET;
|
register EdgeTableEntry *pPrevAET;
|
||||||
register EdgeTableEntry *tmp;
|
register EdgeTableEntry *tmp;
|
||||||
@ -303,8 +294,7 @@ miloadAET(AET, ETEs)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
micomputeWAET(AET)
|
micomputeWAET(register EdgeTableEntry *AET)
|
||||||
register EdgeTableEntry *AET;
|
|
||||||
{
|
{
|
||||||
register EdgeTableEntry *pWETE;
|
register EdgeTableEntry *pWETE;
|
||||||
register int inside = 1;
|
register int inside = 1;
|
||||||
@ -342,8 +332,7 @@ micomputeWAET(AET)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
miInsertionSort(AET)
|
miInsertionSort(register EdgeTableEntry *AET)
|
||||||
register EdgeTableEntry *AET;
|
|
||||||
{
|
{
|
||||||
register EdgeTableEntry *pETEchase;
|
register EdgeTableEntry *pETEchase;
|
||||||
register EdgeTableEntry *pETEinsert;
|
register EdgeTableEntry *pETEinsert;
|
||||||
@ -379,8 +368,7 @@ miInsertionSort(AET)
|
|||||||
* Clean up our act.
|
* Clean up our act.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
miFreeStorage(pSLLBlock)
|
miFreeStorage(register ScanLineListBlock *pSLLBlock)
|
||||||
register ScanLineListBlock *pSLLBlock;
|
|
||||||
{
|
{
|
||||||
register ScanLineListBlock *tmpSLLBlock;
|
register ScanLineListBlock *tmpSLLBlock;
|
||||||
|
|
||||||
|
@ -59,8 +59,7 @@ Written by Joel McCormack, Summer 1989.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
void miInitSpanGroup(spanGroup)
|
void miInitSpanGroup(SpanGroup *spanGroup)
|
||||||
SpanGroup *spanGroup;
|
|
||||||
{
|
{
|
||||||
spanGroup->size = 0;
|
spanGroup->size = 0;
|
||||||
spanGroup->count = 0;
|
spanGroup->count = 0;
|
||||||
@ -72,9 +71,7 @@ void miInitSpanGroup(spanGroup)
|
|||||||
#define YMIN(spans) (spans->points[0].y)
|
#define YMIN(spans) (spans->points[0].y)
|
||||||
#define YMAX(spans) (spans->points[spans->count-1].y)
|
#define YMAX(spans) (spans->points[spans->count-1].y)
|
||||||
|
|
||||||
void miSubtractSpans (spanGroup, sub)
|
void miSubtractSpans (SpanGroup *spanGroup, Spans *sub)
|
||||||
SpanGroup *spanGroup;
|
|
||||||
Spans *sub;
|
|
||||||
{
|
{
|
||||||
int i, subCount, spansCount;
|
int i, subCount, spansCount;
|
||||||
int ymin, ymax, xmin, xmax;
|
int ymin, ymax, xmin, xmax;
|
||||||
@ -164,10 +161,7 @@ void miSubtractSpans (spanGroup, sub)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void miAppendSpans(spanGroup, otherGroup, spans)
|
void miAppendSpans(SpanGroup *spanGroup, SpanGroup *otherGroup, Spans *spans)
|
||||||
SpanGroup *spanGroup;
|
|
||||||
SpanGroup *otherGroup;
|
|
||||||
Spans *spans;
|
|
||||||
{
|
{
|
||||||
register int ymin, ymax;
|
register int ymin, ymax;
|
||||||
register int spansCount;
|
register int spansCount;
|
||||||
@ -199,15 +193,12 @@ void miAppendSpans(spanGroup, otherGroup, spans)
|
|||||||
}
|
}
|
||||||
} /* AppendSpans */
|
} /* AppendSpans */
|
||||||
|
|
||||||
void miFreeSpanGroup(spanGroup)
|
void miFreeSpanGroup(SpanGroup *spanGroup)
|
||||||
SpanGroup *spanGroup;
|
|
||||||
{
|
{
|
||||||
if (spanGroup->group != NULL) g_free(spanGroup->group);
|
if (spanGroup->group != NULL) g_free(spanGroup->group);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void QuickSortSpansX(points, numSpans)
|
static void QuickSortSpansX(register GdkSpan points[], register int numSpans)
|
||||||
register GdkSpan points[];
|
|
||||||
register int numSpans;
|
|
||||||
{
|
{
|
||||||
register int x;
|
register int x;
|
||||||
register int i, j, m;
|
register int i, j, m;
|
||||||
@ -286,9 +277,7 @@ static void QuickSortSpansX(points, numSpans)
|
|||||||
} /* QuickSortSpans */
|
} /* QuickSortSpans */
|
||||||
|
|
||||||
|
|
||||||
static int UniquifySpansX(spans, newPoints, newWidths)
|
static int UniquifySpansX(Spans *spans, register GdkSpan *newPoints)
|
||||||
Spans *spans;
|
|
||||||
register GdkSpan *newPoints;
|
|
||||||
{
|
{
|
||||||
register int newx1, newx2, oldpt, i, y;
|
register int newx1, newx2, oldpt, i, y;
|
||||||
GdkSpan *oldPoints, *startNewPoints = newPoints;
|
GdkSpan *oldPoints, *startNewPoints = newPoints;
|
||||||
@ -331,8 +320,7 @@ static int UniquifySpansX(spans, newPoints, newWidths)
|
|||||||
} /* UniquifySpansX */
|
} /* UniquifySpansX */
|
||||||
|
|
||||||
void
|
void
|
||||||
miDisposeSpanGroup (spanGroup)
|
miDisposeSpanGroup (SpanGroup *spanGroup)
|
||||||
SpanGroup *spanGroup;
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
Spans *spans;
|
Spans *spans;
|
||||||
@ -344,10 +332,7 @@ miDisposeSpanGroup (spanGroup)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
|
void miFillUniqueSpanGroup(GdkDrawable *pDraw, GdkGC *pGC, SpanGroup *spanGroup)
|
||||||
GdkDrawable* pDraw;
|
|
||||||
GdkGC* pGC;
|
|
||||||
SpanGroup *spanGroup;
|
|
||||||
{
|
{
|
||||||
register int i;
|
register int i;
|
||||||
register Spans *spans;
|
register Spans *spans;
|
||||||
@ -485,10 +470,7 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void miFillSpanGroup(pDraw, pGC, spanGroup)
|
void miFillSpanGroup(GdkDrawable *pDraw, GdkGC *pGC, SpanGroup *spanGroup)
|
||||||
GdkDrawable* pDraw;
|
|
||||||
GdkGC* pGC;
|
|
||||||
SpanGroup *spanGroup;
|
|
||||||
{
|
{
|
||||||
register int i;
|
register int i;
|
||||||
register Spans *spans;
|
register Spans *spans;
|
||||||
|
@ -56,70 +56,30 @@ typedef struct {
|
|||||||
} SpanGroup;
|
} SpanGroup;
|
||||||
|
|
||||||
/* Initialize SpanGroup. MUST BE DONE before use. */
|
/* Initialize SpanGroup. MUST BE DONE before use. */
|
||||||
extern void miInitSpanGroup(
|
extern void miInitSpanGroup(SpanGroup *spanGroup);
|
||||||
#if NeedFunctionPrototypes
|
|
||||||
SpanGroup * /*spanGroup*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
/* Add a Spans to a SpanGroup. The spans MUST BE in y-sorted order */
|
/* Add a Spans to a SpanGroup. The spans MUST BE in y-sorted order */
|
||||||
extern void miAppendSpans(
|
extern void miAppendSpans(SpanGroup *spanGroup, SpanGroup *otherGroup,
|
||||||
#if NeedFunctionPrototypes
|
Spans *spans);
|
||||||
SpanGroup * /*spanGroup*/,
|
|
||||||
SpanGroup * /*otherGroup*/,
|
|
||||||
Spans * /*spans*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
/* Paint a span group, possibly with some overlap */
|
/* Paint a span group, possibly with some overlap */
|
||||||
extern void miFillSpanGroup(
|
extern void miFillSpanGroup(GdkDrawable* pDraw, GdkGC* pGC,
|
||||||
#if NeedFunctionPrototypes
|
SpanGroup *spanGroup);
|
||||||
GdkDrawable* /*pDraw*/,
|
|
||||||
GdkGC* /*pGC*/,
|
|
||||||
SpanGroup * /*spanGroup*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
/* Paint a span group, insuring that each pixel is painted at most once */
|
/* Paint a span group, insuring that each pixel is painted at most once */
|
||||||
extern void miFillUniqueSpanGroup(
|
extern void miFillUniqueSpanGroup(GdkDrawable* pDraw, GdkGC* pGC,
|
||||||
#if NeedFunctionPrototypes
|
SpanGroup *spanGroup);
|
||||||
GdkDrawable* /*pDraw*/,
|
|
||||||
GdkGC* /*pGC*/,
|
|
||||||
SpanGroup * /*spanGroup*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
/* Free up data in a span group. MUST BE DONE or you'll suffer memory leaks */
|
/* Free up data in a span group. MUST BE DONE or you'll suffer memory leaks */
|
||||||
extern void miFreeSpanGroup(
|
extern void miFreeSpanGroup(SpanGroup *spanGroup);
|
||||||
#if NeedFunctionPrototypes
|
|
||||||
SpanGroup * /*spanGroup*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void miSubtractSpans(
|
extern void miSubtractSpans(SpanGroup *spanGroup, Spans *sub);
|
||||||
#if NeedFunctionPrototypes
|
|
||||||
SpanGroup * /*spanGroup*/,
|
|
||||||
Spans * /*sub*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void miDisposeSpanGroup(
|
extern void miDisposeSpanGroup(SpanGroup *spanGroup);
|
||||||
#if NeedFunctionPrototypes
|
|
||||||
SpanGroup * /*spanGroup*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern int miClipSpans(
|
extern int miClipSpans(GdkRegion* prgnDst, GdkPoint* ppt,
|
||||||
#if NeedFunctionPrototypes
|
int *pwidth, int nspans, GdkPoint* pptNew,
|
||||||
GdkRegion* /*prgnDst*/,
|
int *pwidthNew, int fSorted);
|
||||||
GdkPoint* /*ppt*/,
|
|
||||||
int * /*pwidth*/,
|
|
||||||
int /*nspans*/,
|
|
||||||
GdkPoint* /*pptNew*/,
|
|
||||||
int * /*pwidthNew*/,
|
|
||||||
int /*fSorted*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
/* Rops which must use span groups */
|
/* Rops which must use span groups */
|
||||||
#define miSpansCarefulRop(rop) (((rop) & 0xc) == 0x8 || ((rop) & 0x3) == 0x2)
|
#define miSpansCarefulRop(rop) (((rop) & 0xc) == 0x8 || ((rop) & 0x3) == 0x2)
|
||||||
|
@ -57,16 +57,10 @@ miLineArc (GdkDrawable *pDraw, GdkGC *pGC, GdkColor *pixel, SpanDataPtr spanData
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, overall_height,
|
miFillPolyHelper (GdkDrawable *pDrawable, GdkGC *pGC, GdkColor *pixel,
|
||||||
left, right, left_count, right_count)
|
SpanDataPtr spanData, int y, int overall_height,
|
||||||
GdkDrawable* pDrawable;
|
PolyEdgePtr left, PolyEdgePtr right, int left_count,
|
||||||
GdkGC* pGC;
|
int right_count)
|
||||||
GdkColor *pixel;
|
|
||||||
SpanDataPtr spanData;
|
|
||||||
int y; /* start y coordinate */
|
|
||||||
int overall_height; /* height of entire segment */
|
|
||||||
PolyEdgePtr left, right;
|
|
||||||
int left_count, right_count;
|
|
||||||
{
|
{
|
||||||
register int left_x = 0, left_e = 0;
|
register int left_x = 0, left_e = 0;
|
||||||
int left_stepx = 0;
|
int left_stepx = 0;
|
||||||
@ -157,12 +151,8 @@ miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, overall_height,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
miFillRectPolyHelper (pDrawable, pGC, pixel, spanData, x, y, w, h)
|
miFillRectPolyHelper (GdkDrawable *pDrawable, GdkGC *pGC, GdkColor *pixel,
|
||||||
GdkDrawable* pDrawable;
|
SpanDataPtr spanData, int x, int y, int w, int h)
|
||||||
GdkGC* pGC;
|
|
||||||
GdkColor* pixel;
|
|
||||||
SpanDataPtr spanData;
|
|
||||||
int x, y, w, h;
|
|
||||||
{
|
{
|
||||||
register GdkSpan* ppt;
|
register GdkSpan* ppt;
|
||||||
GdkColor oldPixel;
|
GdkColor oldPixel;
|
||||||
@ -202,13 +192,9 @@ miFillRectPolyHelper (pDrawable, pGC, pixel, spanData, x, y, w, h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* static */ int
|
/* static */ int
|
||||||
miPolyBuildEdge (x0, y0, k, dx, dy, xi, yi, left, edge)
|
miPolyBuildEdge (double x0, double y0, double k, register int dx,
|
||||||
double x0, y0;
|
register int dy, int xi, int yi, int left,
|
||||||
double k; /* x0 * dy - y0 * dx */
|
register PolyEdgePtr edge)
|
||||||
register int dx, dy;
|
|
||||||
int xi, yi;
|
|
||||||
int left;
|
|
||||||
register PolyEdgePtr edge;
|
|
||||||
{
|
{
|
||||||
int x, y, e;
|
int x, y, e;
|
||||||
int xady;
|
int xady;
|
||||||
@ -261,14 +247,9 @@ miPolyBuildEdge (x0, y0, k, dx, dy, xi, yi, left, edge)
|
|||||||
#define StepAround(v, incr, max) (((v) + (incr) < 0) ? (max - 1) : ((v) + (incr) == max) ? 0 : ((v) + (incr)))
|
#define StepAround(v, incr, max) (((v) + (incr) < 0) ? (max - 1) : ((v) + (incr) == max) ? 0 : ((v) + (incr)))
|
||||||
|
|
||||||
/* static */ int
|
/* static */ int
|
||||||
miPolyBuildPoly (vertices, slopes, count, xi, yi, left, right, pnleft, pnright, h)
|
miPolyBuildPoly (register PolyVertexPtr vertices, register PolySlopePtr slopes,
|
||||||
register PolyVertexPtr vertices;
|
int count, int xi, int yi, PolyEdgePtr left, PolyEdgePtr right,
|
||||||
register PolySlopePtr slopes;
|
int *pnleft, int *pnright, int *h)
|
||||||
int count;
|
|
||||||
int xi, yi;
|
|
||||||
PolyEdgePtr left, right;
|
|
||||||
int *pnleft, *pnright;
|
|
||||||
int *h;
|
|
||||||
{
|
{
|
||||||
int top, bottom;
|
int top, bottom;
|
||||||
double miny, maxy;
|
double miny, maxy;
|
||||||
@ -371,12 +352,8 @@ miPolyBuildPoly (vertices, slopes, count, xi, yi, left, right, pnleft, pnright,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
miLineOnePoint (pDrawable, pGC, pixel, spanData, x, y)
|
miLineOnePoint (GdkDrawable *pDrawable, GdkGC *pGC, GdkColor *pixel,
|
||||||
GdkDrawable* pDrawable;
|
SpanDataPtr spanData, int x, int y)
|
||||||
GdkGC* pGC;
|
|
||||||
GdkColor* pixel;
|
|
||||||
SpanDataPtr spanData;
|
|
||||||
int x, y;
|
|
||||||
{
|
{
|
||||||
GdkColor oldPixel;
|
GdkColor oldPixel;
|
||||||
GdkSpan span;
|
GdkSpan span;
|
||||||
@ -391,7 +368,8 @@ miLineOnePoint (pDrawable, pGC, pixel, spanData, x, y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
miLineJoin (GdkDrawable *pDrawable, GdkGC *pGC, GdkColor *pixel, SpanDataPtr spanData, LineFacePtr pLeft, LineFacePtr pRight)
|
miLineJoin (GdkDrawable *pDrawable, GdkGC *pGC, GdkColor *pixel,
|
||||||
|
SpanDataPtr spanData, LineFacePtr pLeft, LineFacePtr pRight)
|
||||||
{
|
{
|
||||||
double mx, my;
|
double mx, my;
|
||||||
double denom = 0.0;
|
double denom = 0.0;
|
||||||
@ -533,11 +511,7 @@ miLineJoin (GdkDrawable *pDrawable, GdkGC *pGC, GdkColor *pixel, SpanDataPtr spa
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
miLineArcI (pDraw, pGC, xorg, yorg, points)
|
miLineArcI (GdkDrawable *pDraw, GdkGC *pGC, int xorg, int yorg, GdkSpan *points)
|
||||||
GdkDrawable* pDraw;
|
|
||||||
GdkGC* pGC;
|
|
||||||
int xorg, yorg;
|
|
||||||
GdkSpan* points;
|
|
||||||
{
|
{
|
||||||
register GdkSpan* tpts, *bpts;
|
register GdkSpan* tpts, *bpts;
|
||||||
register int x, y, e, ex, slw;
|
register int x, y, e, ex, slw;
|
||||||
@ -610,15 +584,9 @@ miLineArcI (pDraw, pGC, xorg, yorg, points)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
miLineArcD (pDraw, pGC, xorg, yorg, points,
|
miLineArcD (GdkDrawable *pDraw, GdkGC *pGC, double xorg, double yorg, GdkSpan *points,
|
||||||
edge1, edgey1, edgeleft1, edge2, edgey2, edgeleft2)
|
PolyEdgePtr edge1, int edgey1, gboolean edgeleft1,
|
||||||
GdkDrawable* pDraw;
|
PolyEdgePtr edge2, int edgey2, gboolean edgeleft2)
|
||||||
GdkGC* pGC;
|
|
||||||
double xorg, yorg;
|
|
||||||
GdkSpan* points;
|
|
||||||
PolyEdgePtr edge1, edge2;
|
|
||||||
int edgey1, edgey2;
|
|
||||||
gboolean edgeleft1, edgeleft2;
|
|
||||||
{
|
{
|
||||||
register GdkSpan* pts;
|
register GdkSpan* pts;
|
||||||
double radius, x0, y0, el, er, yk, xlk, xrk, k;
|
double radius, x0, y0, el, er, yk, xlk, xrk, k;
|
||||||
@ -766,10 +734,8 @@ miLineArcD (pDraw, pGC, xorg, yorg, points,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
miRoundJoinFace (face, edge, leftEdge)
|
miRoundJoinFace (register LineFacePtr face, register PolyEdgePtr edge,
|
||||||
register LineFacePtr face;
|
gboolean *leftEdge)
|
||||||
register PolyEdgePtr edge;
|
|
||||||
gboolean *leftEdge;
|
|
||||||
{
|
{
|
||||||
int y;
|
int y;
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
@ -815,11 +781,9 @@ miRoundJoinFace (face, edge, leftEdge)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
miRoundJoinClip (pLeft, pRight, edge1, edge2, y1, y2, left1, left2)
|
miRoundJoinClip (register LineFacePtr pLeft, register LineFacePtr pRight,
|
||||||
register LineFacePtr pLeft, pRight;
|
PolyEdgePtr edge1, PolyEdgePtr edge2, int *y1, int *y2,
|
||||||
PolyEdgePtr edge1, edge2;
|
gboolean *left1, gboolean *left2)
|
||||||
int *y1, *y2;
|
|
||||||
gboolean *left1, *left2;
|
|
||||||
{
|
{
|
||||||
double denom;
|
double denom;
|
||||||
|
|
||||||
@ -840,11 +804,8 @@ miRoundJoinClip (pLeft, pRight, edge1, edge2, y1, y2, left1, left2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
miRoundCapClip (face, isInt, edge, leftEdge)
|
miRoundCapClip (register LineFacePtr face, gboolean isInt,
|
||||||
register LineFacePtr face;
|
register PolyEdgePtr edge, gboolean *leftEdge)
|
||||||
gboolean isInt;
|
|
||||||
register PolyEdgePtr edge;
|
|
||||||
gboolean *leftEdge;
|
|
||||||
{
|
{
|
||||||
int y;
|
int y;
|
||||||
register int dx, dy;
|
register int dx, dy;
|
||||||
@ -890,14 +851,10 @@ miRoundCapClip (face, isInt, edge, leftEdge)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
miLineArc (pDraw, pGC, pixel, spanData, leftFace, rightFace, xorg, yorg, isInt)
|
miLineArc (GdkDrawable *pDraw, GdkGC *pGC, GdkColor *pixel,
|
||||||
GdkDrawable* pDraw;
|
SpanDataPtr spanData, register LineFacePtr leftFace,
|
||||||
register GdkGC* pGC;
|
register LineFacePtr rightFace, double xorg, double yorg,
|
||||||
GdkColor* pixel;
|
gboolean isInt)
|
||||||
SpanDataPtr spanData;
|
|
||||||
register LineFacePtr leftFace, rightFace;
|
|
||||||
double xorg, yorg;
|
|
||||||
gboolean isInt;
|
|
||||||
{
|
{
|
||||||
GdkSpan* points;
|
GdkSpan* points;
|
||||||
int xorgi = 0, yorgi = 0;
|
int xorgi = 0, yorgi = 0;
|
||||||
@ -987,15 +944,9 @@ miLineArc (pDraw, pGC, pixel, spanData, leftFace, rightFace, xorg, yorg, isInt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
miLineProjectingCap (pDrawable, pGC, pixel, spanData, face, isLeft, xorg, yorg, isInt)
|
miLineProjectingCap (GdkDrawable *pDrawable, register GdkGC *pGC, GdkColor *pixel,
|
||||||
GdkDrawable* pDrawable;
|
SpanDataPtr spanData, register LineFacePtr face,
|
||||||
register GdkGC* pGC;
|
gboolean isLeft, double xorg, double yorg, gboolean isInt)
|
||||||
GdkColor *pixel;
|
|
||||||
SpanDataPtr spanData;
|
|
||||||
register LineFacePtr face;
|
|
||||||
gboolean isLeft;
|
|
||||||
double xorg, yorg;
|
|
||||||
gboolean isInt;
|
|
||||||
{
|
{
|
||||||
int xorgi = 0, yorgi = 0;
|
int xorgi = 0, yorgi = 0;
|
||||||
int lw;
|
int lw;
|
||||||
@ -1366,10 +1317,7 @@ miWideSegment (GdkDrawable *pDrawable, GdkGC *pGC, GdkColor *pixel, SpanDataPtr
|
|||||||
}
|
}
|
||||||
|
|
||||||
SpanDataPtr
|
SpanDataPtr
|
||||||
miSetupSpanData (pGC, spanData, npt)
|
miSetupSpanData (register GdkGC *pGC, SpanDataPtr spanData, int npt)
|
||||||
register GdkGC* pGC;
|
|
||||||
SpanDataPtr spanData;
|
|
||||||
int npt;
|
|
||||||
{
|
{
|
||||||
if ((npt < 3 && GDK_GC_FBDATA(pGC)->values.cap_style != GDK_CAP_ROUND) || miSpansEasyRop(GDK_GC_FBDATA(pGC)->alu))
|
if ((npt < 3 && GDK_GC_FBDATA(pGC)->values.cap_style != GDK_CAP_ROUND) || miSpansEasyRop(GDK_GC_FBDATA(pGC)->alu))
|
||||||
return (SpanDataPtr) NULL;
|
return (SpanDataPtr) NULL;
|
||||||
@ -1380,10 +1328,7 @@ miSetupSpanData (pGC, spanData, npt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
miCleanupSpanData (pDrawable, pGC, spanData)
|
miCleanupSpanData (GdkDrawable *pDrawable, GdkGC *pGC, SpanDataPtr spanData)
|
||||||
GdkDrawable* pDrawable;
|
|
||||||
GdkGC* pGC;
|
|
||||||
SpanDataPtr spanData;
|
|
||||||
{
|
{
|
||||||
if (GDK_GC_FBDATA(pGC)->values.line_style == GDK_LINE_DOUBLE_DASH)
|
if (GDK_GC_FBDATA(pGC)->values.line_style == GDK_LINE_DOUBLE_DASH)
|
||||||
{
|
{
|
||||||
@ -1403,12 +1348,8 @@ miCleanupSpanData (pDrawable, pGC, spanData)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
miWideLine (pDrawable, pGC, mode, npt, pPts)
|
miWideLine (GdkDrawable *pDrawable, GdkGC *pGC, int mode,
|
||||||
GdkDrawable* pDrawable;
|
register int npt, register GdkPoint *pPts)
|
||||||
register GdkGC* pGC;
|
|
||||||
int mode;
|
|
||||||
register int npt;
|
|
||||||
register GdkPoint* pPts;
|
|
||||||
{
|
{
|
||||||
int x1, y1, x2, y2;
|
int x1, y1, x2, y2;
|
||||||
SpanDataRec spanDataRec;
|
SpanDataRec spanDataRec;
|
||||||
@ -1544,15 +1485,11 @@ miWideLine (pDrawable, pGC, mode, npt, pPts)
|
|||||||
#define V_LEFT 3
|
#define V_LEFT 3
|
||||||
|
|
||||||
static void
|
static void
|
||||||
miWideDashSegment (pDrawable, pGC, spanData, pDashOffset, pDashIndex,
|
miWideDashSegment (GdkDrawable *pDrawable, register GdkGC *pGC,
|
||||||
x1, y1, x2, y2, projectLeft, projectRight, leftFace, rightFace)
|
SpanDataPtr spanData, int *pDashOffset, int *pDashIndex,
|
||||||
GdkDrawable* pDrawable;
|
int x1, int y1, int x2, int y2, gboolean projectLeft,
|
||||||
register GdkGC* pGC;
|
gboolean projectRight, LineFacePtr leftFace,
|
||||||
int *pDashOffset, *pDashIndex;
|
LineFacePtr rightFace)
|
||||||
SpanDataPtr spanData;
|
|
||||||
int x1, y1, x2, y2;
|
|
||||||
gboolean projectLeft, projectRight;
|
|
||||||
LineFacePtr leftFace, rightFace;
|
|
||||||
{
|
{
|
||||||
int dashIndex, dashRemain;
|
int dashIndex, dashRemain;
|
||||||
unsigned char *pDash;
|
unsigned char *pDash;
|
||||||
@ -1898,12 +1835,8 @@ miWideDashSegment (pDrawable, pGC, spanData, pDashOffset, pDashIndex,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
miWideDash (pDrawable, pGC, mode, npt, pPts)
|
miWideDash (GdkDrawable *pDrawable, register GdkGC *pGC, int mode,
|
||||||
GdkDrawable* pDrawable;
|
register int npt, register GdkPoint *pPts)
|
||||||
register GdkGC* pGC;
|
|
||||||
int mode;
|
|
||||||
register int npt;
|
|
||||||
register GdkPoint* pPts;
|
|
||||||
{
|
{
|
||||||
int x1, y1, x2, y2;
|
int x1, y1, x2, y2;
|
||||||
GdkColor pixel;
|
GdkColor pixel;
|
||||||
@ -2085,11 +2018,11 @@ miWideDash (pDrawable, pGC, mode, npt, pPts)
|
|||||||
/* these are stubs to allow old ddx miValidateGCs to work without change */
|
/* these are stubs to allow old ddx miValidateGCs to work without change */
|
||||||
|
|
||||||
void
|
void
|
||||||
miMiter()
|
miMiter(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
miNotMiter()
|
miNotMiter(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -157,8 +157,7 @@ typedef struct _LineFace {
|
|||||||
#else
|
#else
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define ICEIL ICIEL
|
#define ICEIL ICIEL
|
||||||
static __inline int ICEIL(x)
|
static __inline int ICEIL(double x)
|
||||||
double x;
|
|
||||||
{
|
{
|
||||||
int _cTmp = x;
|
int _cTmp = x;
|
||||||
return ((x == _cTmp) || (x < 0.0)) ? _cTmp : _cTmp+1;
|
return ((x == _cTmp) || (x < 0.0)) ? _cTmp : _cTmp+1;
|
||||||
@ -170,79 +169,31 @@ static __inline int ICEIL(x)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void miFillPolyHelper(
|
extern void miFillPolyHelper(GdkDrawable* pDrawable, GdkGC* pGC,
|
||||||
#if NeedFunctionPrototypes
|
GdkColor * pixel, SpanDataPtr spanData, int y,
|
||||||
GdkDrawable* /*pDrawable*/,
|
int overall_height, PolyEdgePtr left,
|
||||||
GdkGC* /*pGC*/,
|
PolyEdgePtr right, int left_count,
|
||||||
GdkColor * /*pixel*/,
|
int right_count);
|
||||||
SpanDataPtr /*spanData*/,
|
|
||||||
int /*y*/,
|
|
||||||
int /*overall_height*/,
|
|
||||||
PolyEdgePtr /*left*/,
|
|
||||||
PolyEdgePtr /*right*/,
|
|
||||||
int /*left_count*/,
|
|
||||||
int /*right_count*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
extern int miRoundJoinFace(
|
|
||||||
#if NeedFunctionPrototypes
|
|
||||||
LineFacePtr /*face*/,
|
|
||||||
PolyEdgePtr /*edge*/,
|
|
||||||
gboolean * /*leftEdge*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void miRoundJoinClip(
|
extern int miRoundJoinFace(LineFacePtr face, PolyEdgePtr edge,
|
||||||
#if NeedFunctionPrototypes
|
gboolean * leftEdge);
|
||||||
LineFacePtr /*pLeft*/,
|
|
||||||
LineFacePtr /*pRight*/,
|
|
||||||
PolyEdgePtr /*edge1*/,
|
|
||||||
PolyEdgePtr /*edge2*/,
|
|
||||||
int * /*y1*/,
|
|
||||||
int * /*y2*/,
|
|
||||||
gboolean * /*left1*/,
|
|
||||||
gboolean * /*left2*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern int miRoundCapClip(
|
extern void miRoundJoinClip(LineFacePtr pLeft, LineFacePtr pRight,
|
||||||
#if NeedFunctionPrototypes
|
PolyEdgePtr edge1, PolyEdgePtr edge2, int *y1,
|
||||||
LineFacePtr /*face*/,
|
int *y2, gboolean *left1, gboolean *left2);
|
||||||
gboolean /*isInt*/,
|
|
||||||
PolyEdgePtr /*edge*/,
|
|
||||||
gboolean * /*leftEdge*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void miLineProjectingCap(
|
extern int miRoundCapClip(LineFacePtr face, gboolean isInt, PolyEdgePtr edge,
|
||||||
#if NeedFunctionPrototypes
|
gboolean *leftEdge);
|
||||||
GdkDrawable* /*pDrawable*/,
|
|
||||||
GdkGC* /*pGC*/,
|
|
||||||
GdkColor * /*pixel*/,
|
|
||||||
SpanDataPtr /*spanData*/,
|
|
||||||
LineFacePtr /*face*/,
|
|
||||||
gboolean /*isLeft*/,
|
|
||||||
double /*xorg*/,
|
|
||||||
double /*yorg*/,
|
|
||||||
gboolean /*isInt*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern SpanDataPtr miSetupSpanData(
|
extern void miLineProjectingCap(GdkDrawable* pDrawable, GdkGC* pGC,
|
||||||
#if NeedFunctionPrototypes
|
GdkColor *pixel, SpanDataPtr spanData,
|
||||||
GdkGC* /*pGC*/,
|
LineFacePtr face, gboolean isLeft,
|
||||||
SpanDataPtr /*spanData*/,
|
double xorg, double yorg, gboolean isInt);
|
||||||
int /*npt*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void miCleanupSpanData(
|
extern SpanDataPtr miSetupSpanData(GdkGC* pGC, SpanDataPtr spanData, int npt);
|
||||||
#if NeedFunctionPrototypes
|
|
||||||
GdkDrawable* /*pDrawable*/,
|
extern void miCleanupSpanData(GdkDrawable* pDrawable, GdkGC* pGC,
|
||||||
GdkGC* /*pGC*/,
|
SpanDataPtr spanData);
|
||||||
SpanDataPtr /*spanData*/
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
extern int miPolyBuildEdge(double x0, double y0, double k, int dx, int dy,
|
extern int miPolyBuildEdge(double x0, double y0, double k, int dx, int dy,
|
||||||
int xi, int yi, int left, PolyEdgePtr edge);
|
int xi, int yi, int left, PolyEdgePtr edge);
|
||||||
|
@ -393,17 +393,11 @@ the numerator is therefore (2^32 - 1), which does not overflow an unsigned
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
miZeroClipLine(xmin, ymin, xmax, ymax,
|
miZeroClipLine(int xmin, int ymin, int xmax, int ymax,
|
||||||
new_x1, new_y1, new_x2, new_y2,
|
int *new_x1, int *new_y1, int *new_x2, int *new_y2,
|
||||||
adx, ady,
|
unsigned int adx, unsigned int ady,
|
||||||
pt1_clipped, pt2_clipped, octant, bias, oc1, oc2)
|
int *pt1_clipped, int *pt2_clipped, int octant,
|
||||||
int xmin, ymin, xmax, ymax;
|
unsigned int bias, int oc1, int oc2)
|
||||||
int *new_x1, *new_y1, *new_x2, *new_y2;
|
|
||||||
int *pt1_clipped, *pt2_clipped;
|
|
||||||
unsigned int adx, ady;
|
|
||||||
int octant;
|
|
||||||
unsigned int bias;
|
|
||||||
int oc1, oc2;
|
|
||||||
{
|
{
|
||||||
int swapped = 0;
|
int swapped = 0;
|
||||||
int clipDone = 0;
|
int clipDone = 0;
|
||||||
|
@ -86,12 +86,8 @@ SOFTWARE.
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
miZeroLine(pDraw, pGC, mode, npt, pptInit)
|
miZeroLine(GdkDrawable *pDraw, GdkGC *pGC,
|
||||||
GdkDrawable* pDraw;
|
int mode, int npt, GdkPoint *pptInit)
|
||||||
GdkGC* pGC;
|
|
||||||
int mode; /* Origin or Previous */
|
|
||||||
int npt; /* number of points */
|
|
||||||
GdkPoint* pptInit;
|
|
||||||
{
|
{
|
||||||
int Nspans, current_y = 0;
|
int Nspans, current_y = 0;
|
||||||
GdkPoint* ppt;
|
GdkPoint* ppt;
|
||||||
@ -318,12 +314,8 @@ miZeroLine(pDraw, pGC, mode, npt, pptInit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
miZeroDashLine(dst, pgc, mode, nptInit, pptInit)
|
miZeroDashLine(GdkDrawable *dst, GdkGC *pgc,
|
||||||
GdkDrawable* dst;
|
int mode, int nptInit, GdkPoint *pptInit)
|
||||||
GdkGC* pgc;
|
|
||||||
int mode;
|
|
||||||
int nptInit; /* number of points in polyline */
|
|
||||||
GdkPoint *pptInit; /* points in the polyline */
|
|
||||||
{
|
{
|
||||||
/* XXX kludge until real zero-width dash code is written */
|
/* XXX kludge until real zero-width dash code is written */
|
||||||
GDK_GC_FBDATA(pgc)->values.line_width = 1;
|
GDK_GC_FBDATA(pgc)->values.line_width = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user