summaryrefslogtreecommitdiff
path: root/src/drivers/Xlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/Xlib')
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H5
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx18
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx16
3 files changed, 19 insertions, 20 deletions
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H
index f7619ef10..807e82b5f 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H
@@ -1,7 +1,7 @@
//
// Definition of class Fl_Xlib_Graphics_Driver for the Fast Light Tool Kit (FLTK).
//
-// Copyright 2010-2020 by Bill Spitzak and others.
+// Copyright 2010-2022 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -96,8 +96,7 @@ private:
static GC gc_;
uchar *mask_bitmap_;
uchar **mask_bitmap() {return &mask_bitmap_;}
- typedef struct {short x, y;} XPOINT;
- XPOINT *p;
+ XPoint *short_point;
#if USE_XFT
static Window draw_window;
static struct _XftDraw* draw_;
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
index 697acecb3..8a9380486 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
@@ -1,7 +1,7 @@
//
// Rectangle drawing routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2018 by Bill Spitzak and others.
+// Copyright 1998-2022 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -42,7 +42,7 @@ GC fl_gc = 0;
Fl_Xlib_Graphics_Driver::Fl_Xlib_Graphics_Driver(void) {
mask_bitmap_ = NULL;
- p = NULL;
+ short_point = NULL;
#if USE_PANGO
Fl_Graphics_Driver::font(0, 0);
#endif
@@ -52,7 +52,7 @@ Fl_Xlib_Graphics_Driver::Fl_Xlib_Graphics_Driver(void) {
}
Fl_Xlib_Graphics_Driver::~Fl_Xlib_Graphics_Driver() {
- if (p) free(p);
+ if (short_point) free(short_point);
}
@@ -85,19 +85,19 @@ void Fl_Xlib_Graphics_Driver::add_rectangle_to_region(Fl_Region r, int X, int Y,
void Fl_Xlib_Graphics_Driver::transformed_vertex0(float fx, float fy) {
short x = short(fx), y = short(fy);
- if (!n || x != p[n-1].x || y != p[n-1].y) {
+ if (!n || x != short_point[n-1].x || y != short_point[n-1].y) {
if (n >= p_size) {
- p_size = p ? 2*p_size : 16;
- p = (XPOINT*)realloc((void*)p, p_size*sizeof(*p));
+ p_size = short_point ? 2*p_size : 16;
+ short_point = (XPoint*)realloc((void*)short_point, p_size*sizeof(*short_point));
}
- p[n].x = x ;
- p[n].y = y ;
+ short_point[n].x = x ;
+ short_point[n].y = y ;
n++;
}
}
void Fl_Xlib_Graphics_Driver::fixloop() { // remove equal points from closed path
- while (n>2 && p[n-1].x == p[0].x && p[n-1].y == p[0].y) n--;
+ while (n>2 && short_point[n-1].x == short_point[0].x && short_point[n-1].y == short_point[0].y) n--;
}
// FIXME: should be members of Fl_Xlib_Graphics_Driver
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx
index 59b3e58eb..3b43a360a 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx
@@ -1,7 +1,7 @@
//
// Portable drawing routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2018 by Bill Spitzak and others.
+// Copyright 1998-2022 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -29,7 +29,7 @@
void Fl_Xlib_Graphics_Driver::end_points() {
- if (n>1) XDrawPoints(fl_display, fl_window, gc_, (XPoint*)p, n, 0);
+ if (n>1) XDrawPoints(fl_display, fl_window, gc_, short_point, n, 0);
}
void Fl_Xlib_Graphics_Driver::end_line() {
@@ -37,13 +37,13 @@ void Fl_Xlib_Graphics_Driver::end_line() {
end_points();
return;
}
- if (n>1) XDrawLines(fl_display, fl_window, gc_, (XPoint*)p, n, 0);
+ if (n>1) XDrawLines(fl_display, fl_window, gc_, short_point, n, 0);
}
void Fl_Xlib_Graphics_Driver::end_loop() {
fixloop();
if (n>2) {
- transformed_vertex0(p[0].x , p[0].y );
+ transformed_vertex0(short_point[0].x , short_point[0].y );
}
end_line();
}
@@ -54,13 +54,13 @@ void Fl_Xlib_Graphics_Driver::end_polygon() {
end_line();
return;
}
- if (n>2) XFillPolygon(fl_display, fl_window, gc_, (XPoint*)p, n, Convex, 0);
+ if (n>2) XFillPolygon(fl_display, fl_window, gc_, short_point, n, Convex, 0);
}
void Fl_Xlib_Graphics_Driver::gap() {
- while (n>gap_+2 && p[n-1].x == p[gap_].x && p[n-1].y == p[gap_].y) n--;
+ while (n>gap_+2 && short_point[n-1].x == short_point[gap_].x && short_point[n-1].y == short_point[gap_].y) n--;
if (n > gap_+2) {
- transformed_vertex0(p[gap_].x, p[gap_].y);
+ transformed_vertex0(short_point[gap_].x, short_point[gap_].y);
gap_ = n;
} else {
n = gap_;
@@ -73,7 +73,7 @@ void Fl_Xlib_Graphics_Driver::end_complex_polygon() {
end_line();
return;
}
- if (n>2) XFillPolygon(fl_display, fl_window, gc_, (XPoint*)p, n, 0, 0);
+ if (n>2) XFillPolygon(fl_display, fl_window, gc_, short_point, n, 0, 0);
}
// shortcut the closed circles so they use XDrawArc: