diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-07-01 18:03:10 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-07-06 20:28:20 +0200 |
| commit | f09e17c3c564e8310125a10c03397cbf473ff643 (patch) | |
| tree | 8d0fd4a28e3686c33aaa140d07ddba26ab28bdc2 /src/drivers/Xlib | |
| parent | b0e0c355edaa2e23148cb0260ada907aec930f05 (diff) | |
Remove $Id$ tags, update URL's, and more
- remove obsolete svn '$Id$' tags from all source files
- update .fl files and generated files accordingly
- replace 'http://www.fltk.org' URL's with 'https://...'
- replace bug report URL 'str.php' with 'bugs.php'
- remove trailing whitespace
- fix other whitespace errors flagged by Git
- add and/or fix missing or wrong standard headers
- convert tabs to spaces in all source files
The only relevant code changes are in the fluid/ folder where
some .fl files and other source files were used to generate
the '$Id' headers and footers.
Diffstat (limited to 'src/drivers/Xlib')
| -rw-r--r-- | src/drivers/Xlib/Fl_Font.H | 22 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Copy_Surface_Driver.cxx | 12 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H | 12 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx | 12 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver_arci.cxx | 12 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver_color.cxx | 26 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx | 132 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx | 66 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx | 64 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx | 22 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx | 34 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx | 12 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Image_Surface_Driver.cxx | 12 |
13 files changed, 180 insertions, 258 deletions
diff --git a/src/drivers/Xlib/Fl_Font.H b/src/drivers/Xlib/Fl_Font.H index 49917b6d3..3b220e5d3 100644 --- a/src/drivers/Xlib/Fl_Font.H +++ b/src/drivers/Xlib/Fl_Font.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Font definitions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Two internal fltk data structures: @@ -44,7 +42,7 @@ public: int angle; FL_EXPORT Fl_Xlib_Font_Descriptor(const char* xfontname, Fl_Fontsize size, int angle); # else - XUtf8FontStruct* font; // X UTF-8 font information + XUtf8FontStruct* font; // X UTF-8 font information FL_EXPORT Fl_Xlib_Font_Descriptor(const char* xfontname); # endif # if HAVE_GL @@ -58,17 +56,13 @@ public: #if !USE_XFT struct Fl_Xlib_Fontdesc { // replaces Fl_Fontdesc const char *name; - char fontname[128]; // "Pretty" font name - Fl_Font_Descriptor *first; // linked list of sizes of this style - char **xlist; // matched X font names - int n; // size of xlist, negative = don't free xlist! + char fontname[128]; // "Pretty" font name + Fl_Font_Descriptor *first; // linked list of sizes of this style + char **xlist; // matched X font names + int n; // size of xlist, negative = don't free xlist! }; #endif extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Copy_Surface_Driver.cxx b/src/drivers/Xlib/Fl_Xlib_Copy_Surface_Driver.cxx index 18176a0a6..373cf9e4d 100644 --- a/src/drivers/Xlib/Fl_Xlib_Copy_Surface_Driver.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Copy_Surface_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Copy-to-clipboard code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -95,7 +93,3 @@ void Fl_Xlib_Copy_Surface_Driver::untranslate() { } #endif // FL_CFG_GFX_XLIB - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H index 784bc8d02..322b45c68 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of class Fl_Xlib_Graphics_Driver for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -218,7 +216,3 @@ protected: }; #endif // FL_XLIB_GRAPHICS_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx index 3a1ff8361..c98cb546f 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -292,7 +290,3 @@ int Fl_Xlib_Graphics_Driver::pfd_array_length = FL_FREE_FONT; PangoFontDescription **Fl_Xlib_Graphics_Driver::pfd_array = (PangoFontDescription**)calloc(pfd_array_length, sizeof(PangoFontDescription*)); #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_arci.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_arci.cxx index dc35080b3..381ac0d97 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_arci.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_arci.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Arc (integer) drawing functions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -38,7 +36,3 @@ void Fl_Xlib_Graphics_Driver::pie_unscaled(float x,float y,float w,float h,doubl XDrawArc(fl_display, fl_window, gc_, x,y,w-1,h-1, int(a1*64),int((a2-a1)*64)); XFillArc(fl_display, fl_window, gc_, x,y,w-1,h-1, int(a1*64),int((a2-a1)*64)); } - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_color.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_color.cxx index f13bfc190..937ed7c50 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_color.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_color.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Color functions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Implementation of fl_color(i), fl_color(r,g,b). @@ -44,14 +42,14 @@ extern unsigned fl_cmap[256]; // defined in fl_color.cxx // figure_out_visual() calculates masks & shifts for generating // pixels in true-color visuals: -uchar fl_redmask; /**< color mask used in current color map handling */ -uchar fl_greenmask; /**< color mask used in current color map handling */ -uchar fl_bluemask; /**< color mask used in current color map handling */ +uchar fl_redmask; /**< color mask used in current color map handling */ +uchar fl_greenmask; /**< color mask used in current color map handling */ +uchar fl_bluemask; /**< color mask used in current color map handling */ -int fl_redshift; /**< color shift used in current color map handling */ -int fl_greenshift; /**< color shift used in current color map handling */ -int fl_blueshift; /**< color shift used in current color map handling */ -int fl_extrashift; /**< color shift used in current color map handling */ +int fl_redshift; /**< color shift used in current color map handling */ +int fl_greenshift; /**< color shift used in current color map handling */ +int fl_blueshift; /**< color shift used in current color map handling */ +int fl_extrashift; /**< color shift used in current color map handling */ static uchar beenhere; @@ -345,7 +343,3 @@ void Fl_Xlib_Graphics_Driver::set_color(Fl_Color i, unsigned c) { /** \} */ - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx index 2e615e241..8b3784566 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // X11 font utilities for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Select fonts from the FLTK font table. @@ -67,9 +65,9 @@ static int attribute(int n, const char *p) { if (!*p || *p=='-' || *p=='*') return 0; if (n == 3) { // weight if (!strncmp(p,"normal",6) || - !strncmp(p,"light",5) || - !strncmp(p,"medium",6) || - !strncmp(p,"book",4)) return 0; + !strncmp(p,"light",5) || + !strncmp(p,"medium",6) || + !strncmp(p,"book",4)) return 0; if (!strncmp(p,"bold",4) || !strncmp(p,"demi",4)) return FL_BOLD; } else if (n == 4) { // slant if (*p == 'r') return 0; @@ -108,12 +106,12 @@ const char* Fl_Xlib_Graphics_Driver::get_font_name(Fl_Font fnum, int* ap) { if (strstr(p,"bold")) type = FL_BOLD; if (strstr(p,"ital")) type |= FL_ITALIC; for (;*p; p++) { - if (*p == '*' || *p == ' ' || *p == '-') { - do p++; while (*p == '*' || *p == ' ' || *p == '-'); - if (!*p) break; - if (o < (f->fontname + ENDOFBUFFER - 1)) *o++ = ' '; - } - if (o < (f->fontname + ENDOFBUFFER - 1)) *o++ = *p; + if (*p == '*' || *p == ' ' || *p == '-') { + do p++; while (*p == '*' || *p == ' ' || *p == '-'); + if (!*p) break; + if (o < (f->fontname + ENDOFBUFFER - 1)) *o++ = ' '; + } + if (o < (f->fontname + ENDOFBUFFER - 1)) *o++ = *p; } *o = 0; @@ -122,35 +120,35 @@ const char* Fl_Xlib_Graphics_Driver::get_font_name(Fl_Font fnum, int* ap) { // get the family: const char *x = fl_font_word(p,2); if (*x) x++; if (*x=='*') x++; if (!*x) { - if (ap) *ap = 0; - return p; + if (ap) *ap = 0; + return p; } const char *e = fl_font_word(x,1); if ((e - x) < (int)(ENDOFBUFFER - 1)) { - // MRS: we want strncpy here, not strlcpy... - strncpy(o,x,e-x); - o += e-x; + // MRS: we want strncpy here, not strlcpy... + strncpy(o,x,e-x); + o += e-x; } else { - strlcpy(f->fontname, x, ENDOFBUFFER); - o = f->fontname+ENDOFBUFFER-1; + strlcpy(f->fontname, x, ENDOFBUFFER); + o = f->fontname+ENDOFBUFFER-1; } // collect all the attribute words: for (int n = 3; n <= 6; n++) { - // get the next word: - if (*e) e++; x = e; e = fl_font_word(x,1); - int t = attribute(n,x); - if (t < 0) { - if (o < (f->fontname + ENDOFBUFFER - 1)) *o++ = ' '; - if ((e - x) < (int)(ENDOFBUFFER - (o - f->fontname) - 1)) { - // MRS: we want strncpy here, not strlcpy... - strncpy(o,x,e-x); - o += e-x; - } else { - strlcpy(o,x, ENDOFBUFFER - (o - f->fontname) - 1); - o = f->fontname+ENDOFBUFFER-1; - } - } else type |= t; + // get the next word: + if (*e) e++; x = e; e = fl_font_word(x,1); + int t = attribute(n,x); + if (t < 0) { + if (o < (f->fontname + ENDOFBUFFER - 1)) *o++ = ' '; + if ((e - x) < (int)(ENDOFBUFFER - (o - f->fontname) - 1)) { + // MRS: we want strncpy here, not strlcpy... + strncpy(o,x,e-x); + o += e-x; + } else { + strlcpy(o,x, ENDOFBUFFER - (o - f->fontname) - 1); + o = f->fontname+ENDOFBUFFER-1; + } + } else type |= t; } // skip over the '*' for the size and get the registry-encoding: @@ -181,15 +179,15 @@ static int ultrasort(const void *aa, const void *bb) { int ret = 0; for (;;) { if (isdigit(*a) && isdigit(*b)) { - int na = strtol(a, (char **)&a, 10); - int nb = strtol(b, (char **)&b, 10); - if (!ret) ret = na-nb; + int na = strtol(a, (char **)&a, 10); + int nb = strtol(b, (char **)&b, 10); + if (!ret) ret = na-nb; } else if (*a != *b) { - return (*a-*b); + return (*a-*b); } else if (!*a) { - return ret; + return ret; } else { - a++; b++; + a++; b++; } } } else { @@ -290,26 +288,26 @@ Fl_Font Fl_Xlib_Graphics_Driver::set_fonts(const char* xstarname) { int size = to_canonical(canon, p, sizeof(canon)); if (size >= 0) { for (;;) { // find all matching fonts: - if (i >= xlistsize) break; - const char *q = xlist[i]; - char this_canon[1024]; - if (to_canonical(this_canon, q, sizeof(this_canon)) < 0) break; - if (strcmp(canon, this_canon)) break; - i++; + if (i >= xlistsize) break; + const char *q = xlist[i]; + char this_canon[1024]; + if (to_canonical(this_canon, q, sizeof(this_canon)) < 0) break; + if (strcmp(canon, this_canon)) break; + i++; } /*if (*p=='-' || i > first_xlist+1)*/ p = canon; } unsigned int j; for (j = 0;; j++) { /*if (j < FL_FREE_FONT) { - // see if it is one of our built-in fonts: - // if so, set the list of x fonts, since we have it anyway - if (fl_fonts[j].name && !strcmp(fl_fonts[j].name, p)) break; + // see if it is one of our built-in fonts: + // if so, set the list of x fonts, since we have it anyway + if (fl_fonts[j].name && !strcmp(fl_fonts[j].name, p)) break; } else */{ - j = fl_free_font++; - if (p == canon) p = strdup(p); else used_xlist = 1; - Fl::set_font((Fl_Font)j, p); - break; + j = fl_free_font++; + if (p == canon) p = strdup(p); else used_xlist = 1; + Fl::set_font((Fl_Font)j, p); + break; } } Fl_Xlib_Fontdesc *s = ((Fl_Xlib_Fontdesc*)fl_fonts)+j; @@ -346,9 +344,9 @@ int Fl_Xlib_Graphics_Driver::get_font_sizes(Fl_Font fnum, int*& sizep) { int n; for (n = numsizes-1; n > 0; n--) if (sizes[n-1] < s) break; if (sizes[n] != s) { - for (int m = numsizes; m > n; m--) sizes[m] = sizes[m-1]; - sizes[n] = s; - numsizes++; + for (int m = numsizes; m > n; m--) sizes[m] = sizes[m-1]; + sizes[n] = s; + numsizes++; } } } @@ -484,9 +482,9 @@ static const char *find_best_font(const char *fname, int size) { strcpy(namebuffer+l,c); name = namebuffer; ptsize = size; - } else if (!ptsize || // no fonts yet - (thissize < ptsize && ptsize > size) || // current font too big - (thissize > ptsize && thissize <= size) // current too small + } else if (!ptsize || // no fonts yet + (thissize < ptsize && ptsize > size) || // current font too big + (thissize > ptsize && thissize <= size) // current too small ) { name = thisname; ptsize = thissize; @@ -497,9 +495,9 @@ static const char *find_best_font(const char *fname, int size) { // if (ptsize != size) { // see if we already found this unscalable font: // for (f = s->first; f; f = f->next) { // if (f->minsize <= ptsize && f->maxsize >= ptsize) { -// if (f->minsize > size) f->minsize = size; -// if (f->maxsize < size) f->maxsize = size; -// return f; +// if (f->minsize > size) f->minsize = size; +// if (f->maxsize < size) f->maxsize = size; +// return f; // } // } // } @@ -673,8 +671,8 @@ void Fl_Xlib_Graphics_Driver::draw_unscaled(int angle, const char *str, int n, i if (!warning && angle != 0) { warning = 1; fprintf(stderr, - "libfltk: rotated text not implemented by X backend.\n" - " You should use the Xft backend. Check USE_XFT in config.h.\n"); + "libfltk: rotated text not implemented by X backend.\n" + " You should use the Xft backend. Check USE_XFT in config.h.\n"); } this->draw(str, n, (int)x, (int)y); } @@ -713,7 +711,3 @@ float Fl_Xlib_Graphics_Driver::scale_bitmap_for_PostScript() { } #endif // FL_DOXYGEN - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx index ee36e1cf6..5a80904ab 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // More font utilities for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef FL_DOXYGEN @@ -276,7 +274,7 @@ static void make_raw_name(char *raw, char *pretty) mods |= BOLD; } goto NEXT_STYLE; - + case 'L': if (strncasecmp(style, "Light", 5) == 0) { @@ -564,13 +562,13 @@ static XftFont* fontopen(const char* name, /*Fl_Fontsize*/double size, bool core nxt++; // first char of next name } - // Add the current name to the match pattern - XftPatternAddString(fnt_pat, XFT_FAMILY, curr); + // Add the current name to the match pattern + XftPatternAddString(fnt_pat, XFT_FAMILY, curr); if(nxt) curr = nxt; // move onto next name (if it exists) - // Now do a cut-down version of the FLTK name conversion. - // NOTE: we only use the slant and weight of the first name, - // subsequent names we ignore this for... But we still need to do the check. + // Now do a cut-down version of the FLTK name conversion. + // NOTE: we only use the slant and weight of the first name, + // subsequent names we ignore this for... But we still need to do the check. switch (*curr++) { case 'I': break; // italic case 'P': // bold-italic (falls-through) @@ -615,28 +613,28 @@ static XftFont* fontopen(const char* name, /*Fl_Fontsize*/double size, bool core #if 0 // the XftResult never seems to get set to anything... abandon this code? switch(match_result) { // how good a match is this font for our request? case XftResultMatch: - puts("Object exists with the specified ID"); - break; + puts("Object exists with the specified ID"); + break; case XftResultTypeMismatch: - puts("Object exists, but the type does not match"); - break; + puts("Object exists, but the type does not match"); + break; case XftResultNoId: - puts("Object exists, but has fewer values than specified"); - break; + puts("Object exists, but has fewer values than specified"); + break; case FcResultOutOfMemory: - puts("FcResult: Malloc failed"); - break; + puts("FcResult: Malloc failed"); + break; case XftResultNoMatch: - puts("Object does not exist at all"); - break; + puts("Object does not exist at all"); + break; default: - printf("Invalid XftResult status %d \n", match_result); - break; + printf("Invalid XftResult status %d \n", match_result); + break; } #endif @@ -801,21 +799,21 @@ void Fl_Xlib_Graphics_Driver::draw_unscaled(const char *str, int n, int x, int y if (fl_overlay) { if (!draw_) draw_ = XftDrawCreate(fl_display, draw_overlay_window = fl_window, - fl_overlay_visual->visual, fl_overlay_colormap); + fl_overlay_visual->visual, fl_overlay_colormap); else //if (draw_overlay_window != fl_window) XftDrawChange(draw_, draw_overlay_window = fl_window); } else #endif if (!draw_) draw_ = XftDrawCreate(fl_display, draw_window = fl_window, - fl_visual->visual, fl_colormap); + fl_visual->visual, fl_colormap); else //if (draw_window != fl_window) XftDrawChange(draw_, draw_window = fl_window); Region region = fl_clip_region(); if (!(region && XEmptyRegion(region))) { XftDrawSetClip(draw_, region); - + // Use fltk's color allocator, copy the results to match what // XftCollorAllocValue returns: XftColor color; @@ -825,7 +823,7 @@ void Fl_Xlib_Graphics_Driver::draw_unscaled(const char *str, int n, int x, int y color.color.green = ((int)g)*0x101; color.color.blue = ((int)b)*0x101; color.color.alpha = 0xffff; - + const wchar_t *buffer = utf8reformat(str, n); #ifdef __CYGWIN__ XftDrawString16(draw_, &color, ((Fl_Xlib_Font_Descriptor*)font_descriptor())->font, x1, y1, (XftChar16 *)buffer, n); @@ -847,14 +845,14 @@ void Fl_Xlib_Graphics_Driver::drawUCS4(const void *str, int n, int x, int y) { if (fl_overlay) { if (!draw_) draw_ = XftDrawCreate(fl_display, draw_overlay_window = fl_window, - fl_overlay_visual->visual, fl_overlay_colormap); + fl_overlay_visual->visual, fl_overlay_colormap); else //if (draw_overlay_window != fl_window) XftDrawChange(draw_, draw_overlay_window = fl_window); } else #endif if (!draw_) draw_ = XftDrawCreate(fl_display, draw_window = fl_window, - fl_visual->visual, fl_colormap); + fl_visual->visual, fl_colormap); else //if (draw_window != fl_window) XftDrawChange(draw_, draw_window = fl_window); @@ -934,7 +932,7 @@ extern "C" { int Fl_Xlib_Graphics_Driver::get_font_sizes(Fl_Font fnum, int*& sizep) { Fl_Fontdesc *s = fl_fonts+fnum; if (!s->name) s = fl_fonts; // empty slot in table, use entry 0 - + fl_open_display(); XftFontSet* fs = XftListFonts(fl_display, fl_screen, XFT_FAMILY, XftTypeString, s->name+1, @@ -1301,7 +1299,7 @@ void Fl_Xlib_Graphics_Driver::do_draw(int from_right, const char *str, int n, in Region region = clip_region(); if (region && XEmptyRegion(region)) return; if (!playout_) context(); - + char *str2 = NULL; const char *tmpv = (const char *)memchr(str, '\n', n); if (tmpv == str + n - 1) { // ignore final '\n' @@ -1339,7 +1337,7 @@ void Fl_Xlib_Graphics_Driver::do_draw(int from_right, const char *str, int n, in else XftDrawChange(draw_, draw_window = fl_window); XftDrawSetClip(draw_, region); - + int dx, dy, w, h, y_correction, desc = descent_unscaled(), lheight = height_unscaled(); fl_pango_layout_get_pixel_extents(playout_, dx, dy, w, h, desc, lheight, y_correction); if (from_right) { @@ -1465,7 +1463,3 @@ Fl_Xlib_Font_Descriptor::Fl_Xlib_Font_Descriptor(const char* name, Fl_Fontsize f #endif // USE_PANGO #endif // FL_DOXYGEN - -// -// End of "$Id$" -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx index 8fed7834b..b379a8e88 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Image drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // I hope a simple and portable method of drawing color and monochrome @@ -60,7 +58,7 @@ #include <X11/extensions/Xrender.h> #endif -static XImage xi; // template used to pass info to X +static XImage xi; // template used to pass info to X static int bytes_per_pixel; static int scanline_add; static int scanline_mask; @@ -68,8 +66,8 @@ static int scanline_mask; static void (*converter)(const uchar *from, uchar *to, int w, int delta); static void (*mono_converter)(const uchar *from, uchar *to, int w, int delta); -static int dir; // direction-alternator -static int ri,gi,bi; // saved error-diffusion value +static int dir; // direction-alternator +static int ri,gi,bi; // saved error-diffusion value # if USE_COLORMAP //////////////////////////////////////////////////////////////// @@ -468,9 +466,9 @@ static void figure_out_visual() { # define MAXBUFFER 0x40000 // 256k static void innards(const uchar *buf, int X, int Y, int W, int H, - int delta, int linedelta, int mono, - Fl_Draw_Image_Cb cb, void* userdata, - const bool alpha, GC gc) + int delta, int linedelta, int mono, + Fl_Draw_Image_Cb cb, void* userdata, + const bool alpha, GC gc) { if (!linedelta) linedelta = W*abs(delta); @@ -509,7 +507,7 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, // This can set bytes_per_line negative if image is bottom-to-top // I tested it on Linux, but it may fail on other Xlib implementations: if (buf && ( -# if 0 // set this to 1 to allow 32-bit shortcut +# if 0 // set this to 1 to allow 32-bit shortcut delta == 4 && # if WORDS_BIGENDIAN conv == rgbx_converter @@ -526,7 +524,7 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, } else { int linesize = ((w*bytes_per_pixel+scanline_add)&scanline_mask)/sizeof(STORETYPE); int blocking = h; - static STORETYPE *buffer; // our storage, always word aligned + static STORETYPE *buffer; // our storage, always word aligned static long buffer_size; {int size = linesize*h; if (size > MAXBUFFER) { @@ -543,26 +541,26 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, if (buf) { buf += delta*dx+linedelta*dy; for (int j=0; j<h; ) { - STORETYPE *to = buffer; - int k; - for (k = 0; j<h && k<blocking; k++, j++) { - conv(buf, (uchar*)to, w, delta); - buf += linedelta; - to += linesize; - } - XPutImage(fl_display,fl_window,gc, &xi, 0, 0, X+dx, Y+dy+j-k, w, k); + STORETYPE *to = buffer; + int k; + for (k = 0; j<h && k<blocking; k++, j++) { + conv(buf, (uchar*)to, w, delta); + buf += linedelta; + to += linesize; + } + XPutImage(fl_display,fl_window,gc, &xi, 0, 0, X+dx, Y+dy+j-k, w, k); } } else { STORETYPE* linebuf = new STORETYPE[(W*delta+(sizeof(STORETYPE)-1))/sizeof(STORETYPE)]; for (int j=0; j<h; ) { - STORETYPE *to = buffer; - int k; - for (k = 0; j<h && k<blocking; k++, j++) { - cb(userdata, dx, dy+j, w, (uchar*)linebuf); - conv((uchar*)linebuf, (uchar*)to, w, delta); - to += linesize; - } - XPutImage(fl_display,fl_window,gc, &xi, 0, 0, X+dx, Y+dy+j-k, w, k); + STORETYPE *to = buffer; + int k; + for (k = 0; j<h && k<blocking; k++, j++) { + cb(userdata, dx, dy+j, w, (uchar*)linebuf); + conv((uchar*)linebuf, (uchar*)to, w, delta); + to += linesize; + } + XPutImage(fl_display,fl_window,gc, &xi, 0, 0, X+dx, Y+dy+j-k, w, k); } delete[] linebuf; @@ -586,7 +584,7 @@ void Fl_Xlib_Graphics_Driver::draw_image_unscaled(const uchar* buf, int x, int y } void Fl_Xlib_Graphics_Driver::draw_image_unscaled(Fl_Draw_Image_Cb cb, void* data, - int x, int y, int w, int h,int d) { + int x, int y, int w, int h,int d) { const bool alpha = !!(abs(d) & FL_IMAGE_WITH_ALPHA); if (alpha) d ^= FL_IMAGE_WITH_ALPHA; @@ -600,7 +598,7 @@ void Fl_Xlib_Graphics_Driver::draw_image_mono_unscaled(const uchar* buf, int x, } void Fl_Xlib_Graphics_Driver::draw_image_mono_unscaled(Fl_Draw_Image_Cb cb, void* data, - int x, int y, int w, int h,int d) { + int x, int y, int w, int h,int d) { innards(0,x+offset_x_*scale(),y+offset_y_*scale(),w,h,d,0,1,cb,data,0,gc_); } @@ -892,7 +890,3 @@ void Fl_Xlib_Graphics_Driver::cache(Fl_Pixmap *pxm) { void Fl_Xlib_Graphics_Driver::uncache_pixmap(fl_uintptr_t offscreen) { XFreePixmap(fl_display, (Fl_Offscreen)offscreen); } - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx index 703c92ccf..606b82920 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Line style code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -47,9 +45,9 @@ void Fl_Xlib_Graphics_Driver::line_style_unscaled(int style, float width, char* } char* p = dashes = buf; switch (style & 0xff) { - case FL_DASH: *p++ = dash; *p++ = gap; break; - case FL_DOT: *p++ = dot; *p++ = gap; break; - case FL_DASHDOT: *p++ = dash; *p++ = gap; *p++ = dot; *p++ = gap; break; + case FL_DASH: *p++ = dash; *p++ = gap; break; + case FL_DOT: *p++ = dot; *p++ = gap; break; + case FL_DASHDOT: *p++ = dash; *p++ = gap; *p++ = dot; *p++ = gap; break; case FL_DASHDOTDOT: *p++ = dash; *p++ = gap; *p++ = dot; *p++ = gap; *p++ = dot; *p++ = gap; break; } ndashes = p-buf; @@ -59,11 +57,7 @@ if (*dashes == 0) ndashes = 0;//against error with very small scaling static int Join[4] = {JoinMiter, JoinMiter, JoinRound, JoinBevel}; XSetLineAttributes(fl_display, gc_, line_width_, - ndashes ? LineOnOffDash : LineSolid, - Cap[(style>>8)&3], Join[(style>>12)&3]); + ndashes ? LineOnOffDash : LineSolid, + Cap[(style>>8)&3], Join[(style>>12)&3]); if (ndashes) XSetDashes(fl_display, gc_, 0, dashes, ndashes); } - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx index af6b19c9a..ab591da09 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -140,8 +138,8 @@ int Fl_Xlib_Graphics_Driver::clip_line(int &x1, int &y1, int &x2, int &y2) { window corner, but with a line width so that a part of the line should be visible (in this case 2 of 5 pixels): - fl_line_style (FL_SOLID,5); // line width = 5 - fl_rect (-1,-1,100,100); // top/left: 2 pixels visible + fl_line_style (FL_SOLID,5); // line width = 5 + fl_rect (-1,-1,100,100); // top/left: 2 pixels visible In this example case, no clipping would be done, because X can handle it and clip unneeded pixels. @@ -156,9 +154,9 @@ int Fl_Xlib_Graphics_Driver::clip_line(int &x1, int &y1, int &x2, int &y2) { /* clip_rect() returns 1 if the area is invisible (clipped) because ... - (a) w <= 0 or h <= 0 i.e. nothing is visible - (b) x+w < clip_min() or y+h < clip_min() i.e. left of or above visible area - (c) x > clip_max() or y > clip_max() i.e. right of or below visible area + (a) w <= 0 or h <= 0 i.e. nothing is visible + (b) x+w < clip_min() or y+h < clip_min() i.e. left of or above visible area + (c) x > clip_max() or y > clip_max() i.e. right of or below visible area clip_min() and clip_max() are the minimal and maximal x/y coordinate values used for clipping. @@ -175,9 +173,9 @@ int Fl_Xlib_Graphics_Driver::clip_line(int &x1, int &y1, int &x2, int &y2) { int Fl_Xlib_Graphics_Driver::clip_rect(int &x, int &y, int &w, int &h) { - if (w <= 0 || h <= 0) return 1; // (a) - if (x+w < clip_min() || y+h < clip_min()) return 1; // (b) - if (x > clip_max() || y > clip_max()) return 1; // (c) + if (w <= 0 || h <= 0) return 1; // (a) + if (x+w < clip_min() || y+h < clip_min()) return 1; // (b) + if (x > clip_max() || y > clip_max()) return 1; // (c) if (x < clip_min()) { w -= (clip_min()-x); x = clip_min(); } if (y < clip_min()) { h -= (clip_min()-y); y = clip_min(); } @@ -197,8 +195,8 @@ int Fl_Xlib_Graphics_Driver::clip_rect(int &x, int &y, int &w, int &h) { Fl_Region Fl_Xlib_Graphics_Driver::XRectangleRegion(int x, int y, int w, int h) { XRectangle R; Fl_Region r = XCreateRegion(); // create an empty region - if (clip_rect(x, y, w, h)) // outside valid coordinate space - return r; // empty region + if (clip_rect(x, y, w, h)) // outside valid coordinate space + return r; // empty region R.x = x; R.y = y; R.width = w; R.height = h; XUnionRectWithRegion(&R, r, r); return r; @@ -392,7 +390,7 @@ int Fl_Xlib_Graphics_Driver::not_clipped(int x, int y, int w, int h) { Fl_Region r = rstack[rstackptr]; if (!r) return 1; // get rid of coordinates outside the 16-bit range the X calls take. - if (clip_rect(x,y,w,h)) return 0; // clipped + if (clip_rect(x,y,w,h)) return 0; // clipped return XRectInRegion(r, x, y, w, h); } @@ -408,7 +406,3 @@ void Fl_Xlib_Graphics_Driver::restore_clip() { else XSetClipMask(fl_display, gc_, 0); } } - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx index 94164c36f..f94b685c0 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Portable drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -95,7 +93,3 @@ void Fl_Xlib_Graphics_Driver::ellipse_unscaled(double xt, double yt, double rx, (what == POLYGON ? XFillArc : XDrawArc) (fl_display, fl_window, gc_, llx, lly, w, h, 0, 360*64); } - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Image_Surface_Driver.cxx b/src/drivers/Xlib/Fl_Xlib_Image_Surface_Driver.cxx index 1f6aa0c1c..89fe4a100 100644 --- a/src/drivers/Xlib/Fl_Xlib_Image_Surface_Driver.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Image_Surface_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Draw-to-image code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "Fl_Xlib_Graphics_Driver.H" @@ -82,7 +80,3 @@ void Fl_Xlib_Image_Surface_Driver::end_current() fl_window = pre_window; Fl_Surface_Device::end_current(); } - -// -// End of "$Id$". -// |
