Rename member Fl_Graphics_Driver::p to xpoint to avoid shadowing.

This commit is contained in:
ManoloFLTK 2022-03-21 14:39:00 +01:00
parent 49dae86edf
commit bf5b902180
7 changed files with 33 additions and 35 deletions

View File

@ -17,7 +17,7 @@ Changes in FLTK 1.4.0 Released: ??? ?? 2022
New Features and Extensions New Features and Extensions
- FLTK 1.4 introduces a new platform, Wayland, available for recent Unix - FLTK 1.4 introduces a new platform, Wayland, available for recent Linux
distributions. More information in README.Wayland.txt distributions. More information in README.Wayland.txt
- Windows platform: added support for using a manifest to set the - Windows platform: added support for using a manifest to set the
application's level of DPI awareness (issue #309). application's level of DPI awareness (issue #309).
@ -224,7 +224,7 @@ Changes in FLTK 1.4.0 Released: ??? ?? 2022
- Fixed crash for very small Fl_Color_Chooser (STR #3490). - Fixed crash for very small Fl_Color_Chooser (STR #3490).
- Removed all shadow lint in header files (STR #2714). - Removed all shadow lint in header files (STR #2714).
- Fixed pulldown menu position when at the bottom of the screen (STR #2880). - Fixed pulldown menu position when at the bottom of the screen (STR #2880).
- Fixed missing item handling in Fl_Chekc_Browser (STR #3480). - Fixed missing item handling in Fl_Check_Browser (STR #3480).
- Fixed Delete key in Fl_Input deleting entire widgets in Fluid (STR #2841). - Fixed Delete key in Fl_Input deleting entire widgets in Fluid (STR #2841).
- Reorganized Fluid Template feature (STR #3336). - Reorganized Fluid Template feature (STR #3336).
- Updated Fluid documentation and image (STR #3328). - Updated Fluid documentation and image (STR #3328).

View File

@ -2,7 +2,7 @@
// Declaration of classes Fl_Graphics_Driver, Fl_Scalable_Graphics_Driver, // Declaration of classes Fl_Graphics_Driver, Fl_Scalable_Graphics_Driver,
// and Fl_Font_Descriptor for the Fast Light Tool Kit (FLTK). // and Fl_Font_Descriptor for the Fast Light Tool Kit (FLTK).
// //
// Copyright 2010-2021 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 // 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 // the file "COPYING" which should have been included with this file. If this
@ -175,7 +175,7 @@ protected:
Fl_Font_Descriptor *font_descriptor_; ///< For internal use by FLTK Fl_Font_Descriptor *font_descriptor_; ///< For internal use by FLTK
int p_size; int p_size;
typedef struct { float x; float y; } XPOINT; typedef struct { float x; float y; } XPOINT;
XPOINT *p; XPOINT *xpoint;
#ifndef FL_DOXYGEN #ifndef FL_DOXYGEN
enum {LINE, LOOP, POLYGON, POINT_}; enum {LINE, LOOP, POLYGON, POINT_};
inline int vertex_no() { return n; } inline int vertex_no() { return n; }

View File

@ -1,7 +1,7 @@
// //
// Fl_Graphics_Driver class for the Fast Light Tool Kit (FLTK). // Fl_Graphics_Driver class for the Fast Light Tool Kit (FLTK).
// //
// Copyright 2010-2021 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 // 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 // the file "COPYING" which should have been included with this file. If this
@ -51,7 +51,7 @@ Fl_Graphics_Driver::Fl_Graphics_Driver()
font_descriptor_ = NULL; font_descriptor_ = NULL;
scale_ = 1; scale_ = 1;
p_size = 0; p_size = 0;
p = NULL; xpoint = NULL;
}; };
/** Return the graphics driver used when drawing to the platform's display */ /** Return the graphics driver used when drawing to the platform's display */
@ -526,13 +526,13 @@ void Fl_Graphics_Driver::end_points() {}
void Fl_Graphics_Driver::end_line() {} void Fl_Graphics_Driver::end_line() {}
void Fl_Graphics_Driver::fixloop() { // remove equal points from closed path void Fl_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 && xpoint[n-1].x == xpoint[0].x && xpoint[n-1].y == xpoint[0].y) n--;
} }
/** see fl_end_loop() */ /** see fl_end_loop() */
void Fl_Graphics_Driver::end_loop() { void Fl_Graphics_Driver::end_loop() {
fixloop(); fixloop();
if (n>2) transformed_vertex((float)p[0].x, (float)p[0].y); if (n>2) transformed_vertex((float)xpoint[0].x, (float)xpoint[0].y);
end_line(); end_line();
} }
@ -544,9 +544,9 @@ void Fl_Graphics_Driver::end_complex_polygon() {}
/** see fl_gap() */ /** see fl_gap() */
void Fl_Graphics_Driver::gap() { void Fl_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 && xpoint[n-1].x == xpoint[gap_].x && xpoint[n-1].y == xpoint[gap_].y) n--;
if (n > gap_+2) { if (n > gap_+2) {
transformed_vertex((float)p[gap_].x, (float)p[gap_].y); transformed_vertex(xpoint[gap_].x, xpoint[gap_].y);
gap_ = n; gap_ = n;
} else { } else {
n = gap_; n = gap_;
@ -667,13 +667,13 @@ float Fl_Graphics_Driver::override_scale() { return scale();}
void Fl_Graphics_Driver::restore_scale(float) { } void Fl_Graphics_Driver::restore_scale(float) { }
void Fl_Graphics_Driver::transformed_vertex0(float x, float y) { void Fl_Graphics_Driver::transformed_vertex0(float x, float y) {
if (!n || x != p[n-1].x || y != p[n-1].y) { if (!n || x != xpoint[n-1].x || y != xpoint[n-1].y) {
if (n >= p_size) { if (n >= p_size) {
p_size = p ? 2*p_size : 16; p_size = xpoint ? 2*p_size : 16;
p = (XPOINT*)realloc((void*)p, p_size*sizeof(*p)); xpoint = (XPOINT*)realloc((void*)xpoint, p_size*sizeof(*xpoint));
} }
p[n].x = x; xpoint[n].x = x;
p[n].y = y; xpoint[n].y = y;
n++; n++;
} }
} }

View File

@ -405,7 +405,6 @@ static void fl_new_ic()
NULL); NULL);
} else { } else {
fl_is_over_the_spot = 1; fl_is_over_the_spot = 1;
XVaNestedList status_attr = NULL;
status_attr = XVaCreateNestedList(0, XNAreaNeeded, &status_area, NULL); status_attr = XVaCreateNestedList(0, XNAreaNeeded, &status_area, NULL);
XGetICValues(fl_xim_ic, XNStatusAttributes, status_attr, NULL); XGetICValues(fl_xim_ic, XNStatusAttributes, status_attr, NULL);

View File

@ -2,7 +2,7 @@
// Definition of Apple Quartz graphics driver // Definition of Apple Quartz graphics driver
// for the Fast Light Tool Kit (FLTK). // for the Fast Light Tool Kit (FLTK).
// //
// Copyright 2010-2018 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 // 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 // the file "COPYING" which should have been included with this file. If this
@ -59,7 +59,7 @@ protected:
virtual void cache_size(Fl_Image* img, int &width, int &height); virtual void cache_size(Fl_Image* img, int &width, int &height);
public: public:
Fl_Quartz_Graphics_Driver(); Fl_Quartz_Graphics_Driver();
virtual ~Fl_Quartz_Graphics_Driver() { if (p) free(p); } virtual ~Fl_Quartz_Graphics_Driver() { if (xpoint) free(xpoint); }
virtual int has_feature(driver_feature mask) { return mask & NATIVE; } virtual int has_feature(driver_feature mask) { return mask & NATIVE; }
virtual void gc(void *ctxt) { gc_ = (CGContextRef)ctxt; global_gc(); } virtual void gc(void *ctxt) { gc_ = (CGContextRef)ctxt; global_gc(); }
virtual void *gc() {return gc_;} virtual void *gc() {return gc_;}

View File

@ -1,7 +1,7 @@
// //
// Portable drawing routines for the Fast Light Tool Kit (FLTK). // 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 // 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 // the file "COPYING" which should have been included with this file. If this
@ -29,7 +29,7 @@
void Fl_Quartz_Graphics_Driver::end_points() { void Fl_Quartz_Graphics_Driver::end_points() {
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
point(p[i].x, p[i].y); point(xpoint[i].x, xpoint[i].y);
} }
} }
@ -40,9 +40,9 @@ void Fl_Quartz_Graphics_Driver::end_line() {
} }
if (n<=1) return; if (n<=1) return;
CGContextSetShouldAntialias(gc_, true); CGContextSetShouldAntialias(gc_, true);
CGContextMoveToPoint(gc_, p[0].x, p[0].y); CGContextMoveToPoint(gc_, xpoint[0].x, xpoint[0].y);
for (int i=1; i<n; i++) for (int i=1; i<n; i++)
CGContextAddLineToPoint(gc_, p[i].x, p[i].y); CGContextAddLineToPoint(gc_, xpoint[i].x, xpoint[i].y);
CGContextStrokePath(gc_); CGContextStrokePath(gc_);
CGContextSetShouldAntialias(gc_, false); CGContextSetShouldAntialias(gc_, false);
} }
@ -55,9 +55,9 @@ void Fl_Quartz_Graphics_Driver::end_polygon() {
} }
if (n<=1) return; if (n<=1) return;
CGContextSetShouldAntialias(gc_, true); CGContextSetShouldAntialias(gc_, true);
CGContextMoveToPoint(gc_, p[0].x, p[0].y); CGContextMoveToPoint(gc_, xpoint[0].x, xpoint[0].y);
for (int i=1; i<n; i++) for (int i=1; i<n; i++)
CGContextAddLineToPoint(gc_, p[i].x, p[i].y); CGContextAddLineToPoint(gc_, xpoint[i].x, xpoint[i].y);
CGContextClosePath(gc_); CGContextClosePath(gc_);
CGContextFillPath(gc_); CGContextFillPath(gc_);
CGContextSetShouldAntialias(gc_, false); CGContextSetShouldAntialias(gc_, false);
@ -71,9 +71,9 @@ void Fl_Quartz_Graphics_Driver::end_complex_polygon() {
} }
if (n<=1) return; if (n<=1) return;
CGContextSetShouldAntialias(gc_, true); CGContextSetShouldAntialias(gc_, true);
CGContextMoveToPoint(gc_, p[0].x, p[0].y); CGContextMoveToPoint(gc_, xpoint[0].x, xpoint[0].y);
for (int i=1; i<n; i++) for (int i=1; i<n; i++)
CGContextAddLineToPoint(gc_, p[i].x, p[i].y); CGContextAddLineToPoint(gc_, xpoint[i].x, xpoint[i].y);
CGContextClosePath(gc_); CGContextClosePath(gc_);
CGContextFillPath(gc_); CGContextFillPath(gc_);
CGContextSetShouldAntialias(gc_, false); CGContextSetShouldAntialias(gc_, false);

View File

@ -1,7 +1,7 @@
// //
// Implementation of classes Fl_SVG_Graphics_Driver and Fl_SVG_File_Surface in the Fast Light Tool Kit (FLTK). // Implementation of classes Fl_SVG_Graphics_Driver and Fl_SVG_File_Surface in the Fast Light Tool Kit (FLTK).
// //
// Copyright 2020 by Bill Spitzak and others. // Copyright 2020-2022 by Bill Spitzak and others.
// //
// This library is free software. Distribution and use rights are outlined in // 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 // the file "COPYING" which should have been included with this file. If this
@ -137,7 +137,6 @@ Fl_SVG_Graphics_Driver::Fl_SVG_Graphics_Driver(FILE *f) {
user_dash_array_ = 0; user_dash_array_ = 0;
dasharray_ = fl_strdup("none"); dasharray_ = fl_strdup("none");
p_size = 0; p_size = 0;
p = NULL;
last_rgb_name_ = NULL; last_rgb_name_ = NULL;
} }
@ -856,7 +855,7 @@ void Fl_SVG_Graphics_Driver::loop(int x0, int y0, int x1, int y1, int x2, int y2
void Fl_SVG_Graphics_Driver::end_points() { void Fl_SVG_Graphics_Driver::end_points() {
for (int i=0; i<n; i++) { for (int i=0; i<n; i++) {
fprintf(out_, "<path d=\"M %f %f L %f %f\" fill=\"none\" stroke=\"rgb(%u,%u,%u)\" stroke-width=\"%d\" />\n", fprintf(out_, "<path d=\"M %f %f L %f %f\" fill=\"none\" stroke=\"rgb(%u,%u,%u)\" stroke-width=\"%d\" />\n",
p[i].x, p[i].y, p[i].x, p[i].y, red_, green_, blue_, width_); xpoint[i].x, xpoint[i].y, xpoint[i].x, xpoint[i].y, red_, green_, blue_, width_);
} }
} }
@ -866,9 +865,9 @@ void Fl_SVG_Graphics_Driver::end_line() {
return; return;
} }
if (n<=1) return; if (n<=1) return;
fprintf(out_, "<path d=\"M %f %f", p[0].x, p[0].y); fprintf(out_, "<path d=\"M %f %f", xpoint[0].x, xpoint[0].y);
for (int i=1; i<n; i++) for (int i=1; i<n; i++)
fprintf(out_, " L %f %f", p[i].x, p[i].y); fprintf(out_, " L %f %f", xpoint[i].x, xpoint[i].y);
fprintf(out_, "\" fill=\"none\" stroke=\"rgb(%u,%u,%u)\" stroke-width=\"%d\" stroke-dasharray=\"%s\" stroke-linecap=\"%s\" stroke-linejoin=\"%s\" />\n", fprintf(out_, "\" fill=\"none\" stroke=\"rgb(%u,%u,%u)\" stroke-width=\"%d\" stroke-dasharray=\"%s\" stroke-linecap=\"%s\" stroke-linejoin=\"%s\" />\n",
red_, green_, blue_, width_, dasharray_, linecap_, linejoin_); red_, green_, blue_, width_, dasharray_, linecap_, linejoin_);
} }
@ -880,9 +879,9 @@ void Fl_SVG_Graphics_Driver::end_polygon() {
return; return;
} }
if (n<=1) return; if (n<=1) return;
fprintf(out_, "<path d=\"M %f %f", p[0].x, p[0].y); fprintf(out_, "<path d=\"M %f %f", xpoint[0].x, xpoint[0].y);
for (int i=1; i<n; i++) for (int i=1; i<n; i++)
fprintf(out_, " L %f %f", p[i].x, p[i].y); fprintf(out_, " L %f %f", xpoint[i].x, xpoint[i].y);
fprintf(out_, " z\" fill=\"rgb(%u,%u,%u)\" />\n", red_, green_, blue_); fprintf(out_, " z\" fill=\"rgb(%u,%u,%u)\" />\n", red_, green_, blue_);
} }
@ -910,9 +909,9 @@ void Fl_SVG_Graphics_Driver::end_complex_polygon() {
return; return;
} }
if (n<=1) return; if (n<=1) return;
fprintf(out_, "<path d=\"M %f %f", p[0].x, p[0].y); fprintf(out_, "<path d=\"M %f %f", xpoint[0].x, xpoint[0].y);
for (int i=1; i<n; i++) for (int i=1; i<n; i++)
fprintf(out_, " L %f %f", p[i].x, p[i].y); fprintf(out_, " L %f %f", xpoint[i].x, xpoint[i].y);
fprintf(out_, " z\" fill=\"rgb(%u,%u,%u)\" />\n", red_, green_, blue_); fprintf(out_, " z\" fill=\"rgb(%u,%u,%u)\" />\n", red_, green_, blue_);
} }