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 | |
| 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')
114 files changed, 1232 insertions, 1928 deletions
diff --git a/src/drivers/Android/Fl_Android_Application.H b/src/drivers/Android/Fl_Android_Application.H index cb20decf9..e511b6748 100644 --- a/src/drivers/Android/Fl_Android_Application.H +++ b/src/drivers/Android/Fl_Android_Application.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Android Native Application interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -270,7 +268,3 @@ private: #endif // FL_ANDROID_APPLICATION_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Application.cxx b/src/drivers/Android/Fl_Android_Application.cxx index 015cc5cee..87053543a 100644 --- a/src/drivers/Android/Fl_Android_Application.cxx +++ b/src/drivers/Android/Fl_Android_Application.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Android Native Application interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -842,8 +840,3 @@ Fl_Android_Java::~Fl_Android_Java() pJavaVM->DetachCurrentThread(); } } - - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Graphics_Clipping.H b/src/drivers/Android/Fl_Android_Graphics_Clipping.H index 863c1d51b..dbec82f18 100644 --- a/src/drivers/Android/Fl_Android_Graphics_Clipping.H +++ b/src/drivers/Android/Fl_Android_Graphics_Clipping.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Graphics regions and clipping for the Fast Light Tool Kit (FLTK). // // Copyright 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 // /** @@ -183,7 +181,3 @@ protected: #endif // FL_ANDROID_GRAPHICS_CLIPPING_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Graphics_Clipping.cxx b/src/drivers/Android/Fl_Android_Graphics_Clipping.cxx index 4de919922..eaae68c50 100644 --- a/src/drivers/Android/Fl_Android_Graphics_Clipping.cxx +++ b/src/drivers/Android/Fl_Android_Graphics_Clipping.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Clipping region routines for the Fast Light Tool Kit (FLTK). // // Copyright 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 // @@ -808,8 +806,3 @@ int Fl_Android_Graphics_Driver::not_clipped(int x, int y, int w, int h) return 1; } } - - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Graphics_Driver.H b/src/drivers/Android/Fl_Android_Graphics_Driver.H index 26d0c8509..1c54a0ff2 100644 --- a/src/drivers/Android/Fl_Android_Graphics_Driver.H +++ b/src/drivers/Android/Fl_Android_Graphics_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of classes Fl_Graphics_Driver, Fl_Surface_Device, Fl_Display_Device // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -352,7 +350,3 @@ public: #endif // FL_ANDROID_GRAPHICS_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Graphics_Driver.cxx b/src/drivers/Android/Fl_Android_Graphics_Driver.cxx index db40dc729..b15c677b7 100644 --- a/src/drivers/Android/Fl_Android_Graphics_Driver.cxx +++ b/src/drivers/Android/Fl_Android_Graphics_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Graphics 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 // @@ -1270,8 +1268,3 @@ void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) { fl_color(r,g,b); fl_rectf(x,y,w,h); } - - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Graphics_Font.H b/src/drivers/Android/Fl_Android_Graphics_Font.H index 0f39700b3..b07ba7d3c 100644 --- a/src/drivers/Android/Fl_Android_Graphics_Font.H +++ b/src/drivers/Android/Fl_Android_Graphics_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 // #ifndef FL_ANDROID_GRAPHICS_FONT_H @@ -132,7 +130,3 @@ public: #endif // FL_ANDROID_GRAPHICS_FONT_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Graphics_Font.cxx b/src/drivers/Android/Fl_Android_Graphics_Font.cxx index ac4a026c4..48e61525c 100644 --- a/src/drivers/Android/Fl_Android_Graphics_Font.cxx +++ b/src/drivers/Android/Fl_Android_Graphics_Font.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Graphics 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 // @@ -797,8 +795,3 @@ void Fl_Android_Graphics_Driver::font_name(int num, const char *name) s->fontname[0] = 0; } } - - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Image_Surface_Driver.cxx b/src/drivers/Android/Fl_Android_Image_Surface_Driver.cxx index 33aa6507a..f15cc1c80 100644 --- a/src/drivers/Android/Fl_Android_Image_Surface_Driver.cxx +++ b/src/drivers/Android/Fl_Android_Image_Surface_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Draw-to-image code for the Fast Light Tool Kit (FLTK). // // Copyright 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 // @@ -115,7 +113,3 @@ void Fl_GDI_Image_Surface_Driver::end_current_(Fl_Surface_Device*) } #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Screen_Driver.H b/src/drivers/Android/Fl_Android_Screen_Driver.H index 636e91dee..f5fab6750 100644 --- a/src/drivers/Android/Fl_Android_Screen_Driver.H +++ b/src/drivers/Android/Fl_Android_Screen_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android screen interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -37,7 +35,7 @@ extern void (*fl_lock_function)(); class Fl_Window; -class FL_EXPORT Fl_Android_Screen_Driver : public Fl_Screen_Driver +class FL_EXPORT Fl_Android_Screen_Driver : public Fl_Screen_Driver { // easy access to the super class typedef Fl_Screen_Driver super; @@ -139,7 +137,7 @@ public: virtual void disable_im(); virtual void open_display_platform(); virtual void offscreen_size(Fl_Offscreen off, int &width, int &height); -#if defined(FLTK_HIDPI_SUPPORT) +#if defined(FLTK_HIDPI_SUPPORT) virtual APP_SCALING_CAPABILITY rescalable() { return PER_SCREEN_APP_SCALING; } @@ -176,7 +174,3 @@ public: }; #endif // FL_ANDROID_SCREEN_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Screen_Driver.cxx b/src/drivers/Android/Fl_Android_Screen_Driver.cxx index ef6957382..b37421cc8 100644 --- a/src/drivers/Android/Fl_Android_Screen_Driver.cxx +++ b/src/drivers/Android/Fl_Android_Screen_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Android screen interface 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 // @@ -568,8 +566,3 @@ void Fl_Android_Screen_Driver::grab(Fl_Window* win) \} \endcond */ - - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Screen_Keyboard.cxx b/src/drivers/Android/Fl_Android_Screen_Keyboard.cxx index c708040ec..9aaf0df7f 100644 --- a/src/drivers/Android/Fl_Android_Screen_Keyboard.cxx +++ b/src/drivers/Android/Fl_Android_Screen_Keyboard.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Android screen interface 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 // @@ -212,7 +210,7 @@ static int android_to_fltk_modifiers(int a) int Fl_Android_Screen_Driver::handle_keyboard_event(AInputQueue *queue, AInputEvent *event) { /* -int32_t AKeyEvent_getAction (const AInputEvent *key_event) +int32_t AKeyEvent_getAction (const AInputEvent *key_event) { AKEY_EVENT_ACTION_DOWN = 0, AKEY_EVENT_ACTION_UP = 1, AKEY_EVENT_ACTION_MULTIPLE = 2 } > Reading up on ACTION_MULTIPLE also explains how to deal with > special or sequences of characters: @@ -221,14 +219,14 @@ int32_t AKeyEvent_getAction (const AInputEvent *key_event) > executed. Otherwise, if the key code is KEYCODE_UNKNOWN, then this > is a sequence of characters as returned by getCharacters()." -int32_t AKeyEvent_getFlags (const AInputEvent *key_event) +int32_t AKeyEvent_getFlags (const AInputEvent *key_event) { AKEY_EVENT_FLAG_WOKE_HERE = 0x1, AKEY_EVENT_FLAG_SOFT_KEYBOARD = 0x2, AKEY_EVENT_FLAG_KEEP_TOUCH_MODE = 0x4, AKEY_EVENT_FLAG_FROM_SYSTEM = 0x8, AKEY_EVENT_FLAG_EDITOR_ACTION = 0x10, AKEY_EVENT_FLAG_CANCELED = 0x20, AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY = 0x40, AKEY_EVENT_FLAG_LONG_PRESS = 0x80, AKEY_EVENT_FLAG_CANCELED_LONG_PRESS = 0x100, AKEY_EVENT_FLAG_TRACKING = 0x200, AKEY_EVENT_FLAG_FALLBACK = 0x400 } -int32_t AKeyEvent_getKeyCode (const AInputEvent *key_event) +int32_t AKeyEvent_getKeyCode (const AInputEvent *key_event) { AKEYCODE_UNKNOWN = 0, AKEYCODE_SOFT_LEFT = 1, AKEYCODE_SOFT_RIGHT = 2, AKEYCODE_HOME = 3, AKEYCODE_BACK = 4, AKEYCODE_CALL = 5, AKEYCODE_ENDCALL = 6, AKEYCODE_0 = 7, @@ -240,10 +238,10 @@ int32_t AKeyEvent_getKeyCode (const AInputEvent *key_event) AKEYCODE_CLEAR = 28, AKEYCODE_A = 29, AKEYCODE_B = 30, AKEYCODE_C = 31, AKEYCODE_D = 32, AKEYCODE_E = 33, AKEYCODE_F = 34, AKEYCODE_G = 35, ... -int32_t AKeyEvent_getScanCode (const AInputEvent *key_event) +int32_t AKeyEvent_getScanCode (const AInputEvent *key_event) { AKEY_STATE_UNKNOWN = -1, AKEY_STATE_UP = 0, AKEY_STATE_DOWN = 1, AKEY_STATE_VIRTUAL = 2 } -int32_t AKeyEvent_getMetaState (const AInputEvent *key_event) +int32_t AKeyEvent_getMetaState (const AInputEvent *key_event) { AMETA_NONE = 0, AMETA_ALT_ON = 0x02, AMETA_ALT_LEFT_ON = 0x10, AMETA_ALT_RIGHT_ON = 0x20, AMETA_SHIFT_ON = 0x01, AMETA_SHIFT_LEFT_ON = 0x40, AMETA_SHIFT_RIGHT_ON = 0x80, AMETA_SYM_ON = 0x04, @@ -252,9 +250,9 @@ int32_t AKeyEvent_getMetaState (const AInputEvent *key_event) AMETA_NUM_LOCK_ON = 0x200000, AMETA_SCROLL_LOCK_ON = 0x400000 } -int32_t AKeyEvent_getRepeatCount (const AInputEvent *key_event) -int64_t AKeyEvent_getDownTime (const AInputEvent *key_event) -int64_t AKeyEvent_getEventTime (const AInputEvent *key_event) +int32_t AKeyEvent_getRepeatCount (const AInputEvent *key_event) +int64_t AKeyEvent_getDownTime (const AInputEvent *key_event) +int64_t AKeyEvent_getEventTime (const AInputEvent *key_event) */ Fl_Android_Application::log_i("Key event: action=%d keyCode=%d metaState=0x%x scanCode=%d", AKeyEvent_getAction(event), @@ -452,9 +450,3 @@ void Fl_Android_Screen_Driver::release_keyboard() ANATIVEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS); } } - - - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_System_Driver.H b/src/drivers/Android/Fl_Android_System_Driver.H index e3ccb41bd..2a8682ddb 100644 --- a/src/drivers/Android/Fl_Android_System_Driver.H +++ b/src/drivers/Android/Fl_Android_System_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android system driver for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // 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: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -123,7 +121,3 @@ public: }; #endif // FL_ANDROID_SYSTEM_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_System_Driver.cxx b/src/drivers/Android/Fl_Android_System_Driver.cxx index 0c7185370..e6aa970e4 100644 --- a/src/drivers/Android/Fl_Android_System_Driver.cxx +++ b/src/drivers/Android/Fl_Android_System_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android system driver. // // Copyright 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,12 +93,12 @@ extern "C" { Pseudo doxygen docs (static function intentionally not documented): - param[in] utf8 input string (UTF-8) - param[in,out] wbuf in: pointer to output string buffer - out: new string (the pointer may be changed) - param[in] lg optional: input string length (default = -1) + param[in] utf8 input string (UTF-8) + param[in,out] wbuf in: pointer to output string buffer + out: new string (the pointer may be changed) + param[in] lg optional: input string length (default = -1) - returns pointer to string buffer + returns pointer to string buffer */ static wchar_t *utf8_to_wchar(const char *utf8, wchar_t *&wbuf, int lg = -1) { unsigned len = (lg >= 0) ? (unsigned)lg : (unsigned)strlen(utf8); @@ -132,11 +130,11 @@ static wchar_t *utf8_to_wchar(const char *utf8, wchar_t *&wbuf, int lg = -1) { Pseudo doxygen docs (static function intentionally not documented): - param[in] wstr input string (wide character, UTF-16) - param[in,out] utf8 in: pointer to output string buffer - out: new string (pointer may be changed) + param[in] wstr input string (wide character, UTF-16) + param[in,out] utf8 in: pointer to output string buffer + out: new string (pointer may be changed) - returns pointer to string buffer + returns pointer to string buffer */ static char *wchar_to_utf8(const wchar_t *wstr, char *&utf8) { unsigned len = (unsigned)wcslen(wstr); @@ -152,7 +150,7 @@ static char *wchar_to_utf8(const wchar_t *wstr, char *&utf8) { /* Creates a driver that manages all system related calls. - + This function must be implemented once for every platform. */ Fl_System_Driver *Fl_System_Driver::newSystemDriver() @@ -237,7 +235,7 @@ int Fl_WinAPI_System_Driver::execvp(const char *file, char *const *argv) { # else wchar_t **ar; utf8_to_wchar(file, wbuf); - + int i = 0, n = 0; while (argv[i]) {i++; n++;} ar = (wchar_t **)malloc(sizeof(wchar_t *) * (n + 1)); @@ -252,14 +250,14 @@ int Fl_WinAPI_System_Driver::execvp(const char *file, char *const *argv) { i++; } ar[n] = NULL; - _wexecvp(wbuf, ar); // STR #3040 + _wexecvp(wbuf, ar); // STR #3040 i = 0; while (i < n) { free(ar[i]); i++; } free(ar); - return -1; // STR #3040 + return -1; // STR #3040 #endif } @@ -360,7 +358,7 @@ char *fl_locale_to_utf8(const char *s, int len, UINT codepage) } if (codepage < 1) codepage = fl_codepage; buf[l] = 0; - + l = MultiByteToWideChar(codepage, 0, s, len, (WCHAR*)wbufa, buf_len); if (l < 0) l = 0; wbufa[l] = 0; @@ -501,16 +499,16 @@ int Fl_WinAPI_System_Driver::filename_expand(char *to, int tolen, const char *fr char *start = temp; char *end = temp+strlen(temp); int ret = 0; - for (char *a=temp; a<end; ) { // for each slash component + for (char *a=temp; a<end; ) { // for each slash component char *e; for (e=a; e<end && !isdirsep(*e); e++) {/*empty*/} // find next slash const char *value = 0; // this will point at substitute value switch (*a) { - case '~': // a home directory name - if (e <= a+1) { // current user's directory + case '~': // a home directory name + if (e <= a+1) { // current user's directory value = getenv("HOME"); } break; - case '$': /* an environment variable */ + case '$': /* an environment variable */ {char t = *e; *(char *)e = 0; value = getenv(a+1); *(char *)e = t;} break; } @@ -537,16 +535,16 @@ int Fl_WinAPI_System_Driver::filename_expand(char *to, int tolen, const char *fr } int // O - 0 if no change, 1 if changed -Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename +Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename int tolen, // I - Size of "to" buffer const char *from, // I - Absolute filename const char *base) // I - Find path relative to this path { - char *newslash; // Directory separator - const char *slash; // Directory separator + char *newslash; // Directory separator + const char *slash; // Directory separator char *cwd = 0L, *cwd_buf = 0L; if (base) cwd = cwd_buf = strdup(base); - + // return if "from" is not an absolute path if (from[0] == '\0' || (!isdirsep(*from) && !isalpha(*from) && from[1] != ':' && @@ -555,7 +553,7 @@ Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename if (cwd_buf) free(cwd_buf); return 0; } - + // return if "cwd" is not an absolute path if (!cwd || cwd[0] == '\0' || (!isdirsep(*cwd) && !isalpha(*cwd) && cwd[1] != ':' && @@ -564,18 +562,18 @@ Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename if (cwd_buf) free(cwd_buf); return 0; } - + // convert all backslashes into forward slashes for (newslash = strchr(cwd, '\\'); newslash; newslash = strchr(newslash + 1, '\\')) *newslash = '/'; - + // test for the exact same string and return "." if so if (!strcasecmp(from, cwd)) { strlcpy(to, ".", tolen); free(cwd_buf); return (1); } - + // test for the same drive. Return the absolute path if not if (tolower(*from & 255) != tolower(*cwd & 255)) { // Not the same drive... @@ -583,44 +581,44 @@ Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename free(cwd_buf); return 0; } - + // compare the path name without the drive prefix from += 2; cwd += 2; - + // compare both path names until we find a difference for (slash = from, newslash = cwd; *slash != '\0' && *newslash != '\0'; slash ++, newslash ++) if (isdirsep(*slash) && isdirsep(*newslash)) continue; else if (tolower(*slash & 255) != tolower(*newslash & 255)) break; - + // skip over trailing slashes if ( *newslash == '\0' && *slash != '\0' && !isdirsep(*slash) &&(newslash==cwd || !isdirsep(newslash[-1])) ) newslash--; - + // now go back to the first character of the first differing paths segment while (!isdirsep(*slash) && slash > from) slash --; if (isdirsep(*slash)) slash ++; - + // do the same for the current dir if (isdirsep(*newslash)) newslash --; if (*newslash != '\0') while (!isdirsep(*newslash) && newslash > cwd) newslash --; - + // prepare the destination buffer to[0] = '\0'; to[tolen - 1] = '\0'; - + // now add a "previous dir" sequence for every following slash in the cwd while (*newslash != '\0') { if (isdirsep(*newslash)) strlcat(to, "../", tolen); newslash ++; } - + // finally add the differing path from "from" strlcat(to, slash, tolen); - + free(cwd_buf); return 1; } @@ -666,9 +664,9 @@ int Fl_WinAPI_System_Driver::filename_absolute(char *to, int tolen, const char * int Fl_WinAPI_System_Driver::filename_isdir(const char *n) { - struct _stat s; - char fn[FL_PATH_MAX]; - int length; + struct _stat s; + char fn[FL_PATH_MAX]; + int length; length = (int) strlen(n); // This workaround brought to you by the fine folks at Microsoft! // (read lots of sarcasm in that...) @@ -709,7 +707,7 @@ const char *Fl_WinAPI_System_Driver::filename_ext(const char *buf) { int Fl_WinAPI_System_Driver::open_uri(const char *uri, char *msg, int msglen) { - if (msg) snprintf(msg, msglen, "open %s", uri); + if (msg) snprintf(msg, msglen, "open %s", uri); return (int)(ShellExecute(HWND_DESKTOP, "open", uri, NULL, NULL, SW_SHOW) > (void *)32); } @@ -732,7 +730,7 @@ int Fl_WinAPI_System_Driver::file_browser_load_filesystem(Fl_File_Browser *brows // // Normal Windows code uses drive bits... // - DWORD drives; // Drive available bits + DWORD drives; // Drive available bits drives = GetLogicalDrives(); for (int i = 'A'; i <= 'Z'; i ++, drives >>= 1) if (drives & 1) @@ -771,19 +769,19 @@ void Fl_WinAPI_System_Driver::newUUID(char *uuidBuffer) UUID ud; UUID *pu = &ud; int got_uuid = 0; - - if (!hMod) { // first time in? + + if (!hMod) { // first time in? hMod = LoadLibrary("Rpcrt4.dll"); } - - if (hMod) { // do we have a usable handle to Rpcrt4.dll? + + if (hMod) { // do we have a usable handle to Rpcrt4.dll? uuid_func uuid_crt = (uuid_func)GetProcAddress(hMod, "UuidCreate"); if (uuid_crt != NULL) { RPC_STATUS rpc_res = uuid_crt(pu); if ( // is the return status OK for our needs? - (rpc_res == RPC_S_OK) || // all is well + (rpc_res == RPC_S_OK) || // all is well (rpc_res == RPC_S_UUID_LOCAL_ONLY) || // only unique to this machine - (rpc_res == RPC_S_UUID_NO_ADDRESS) // probably only locally unique + (rpc_res == RPC_S_UUID_NO_ADDRESS) // probably only locally unique ) { got_uuid = -1; sprintf(uuidBuffer, "%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", @@ -793,14 +791,14 @@ void Fl_WinAPI_System_Driver::newUUID(char *uuidBuffer) } } } - if (got_uuid == 0) { // did not make a UUID - use fallback logic + if (got_uuid == 0) { // did not make a UUID - use fallback logic unsigned char b[16]; - time_t t = time(0); // first 4 byte + time_t t = time(0); // first 4 byte b[0] = (unsigned char)t; b[1] = (unsigned char)(t>>8); b[2] = (unsigned char)(t>>16); b[3] = (unsigned char)(t>>24); - int r = rand(); // four more bytes + int r = rand(); // four more bytes b[4] = (unsigned char)r; b[5] = (unsigned char)(r>>8); b[6] = (unsigned char)(r>>16); @@ -834,8 +832,8 @@ void Fl_WinAPI_System_Driver::newUUID(char *uuidBuffer) char *Fl_WinAPI_System_Driver::preference_rootnode(Fl_Preferences *prefs, Fl_Preferences::Root root, const char *vendor, const char *application) { -# define FLPREFS_RESOURCE "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" -# define FLPREFS_RESOURCEW L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" +# define FLPREFS_RESOURCE "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" +# define FLPREFS_RESOURCEW L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" static char filename[ FL_PATH_MAX ]; filename[0] = 0; size_t appDataLen = strlen(vendor) + strlen(application) + 8; @@ -941,7 +939,3 @@ void Fl_WinAPI_System_Driver::gettime(time_t *sec, int *usec) { } #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Window_Driver.H b/src/drivers/Android/Fl_Android_Window_Driver.H index 4f92c8283..865fa518e 100644 --- a/src/drivers/Android/Fl_Android_Window_Driver.H +++ b/src/drivers/Android/Fl_Android_Window_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android window driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -33,13 +31,13 @@ There is one window driver for each Fl_Window. Window drivers manage window actions such as resizing, events, decoration, fullscreen modes, etc. . All - drawing and rendering is managed by the Surface device and the associated + drawing and rendering is managed by the Surface device and the associated graphics driver. - window specific event handling - window types and styles, depth, etc. - decorations - + ? where do we handle the interface between OpenGL/DirectX and Cocoa/Windows/Glx? */ @@ -143,7 +141,3 @@ public: #endif // FL_ANDROID_WINDOW_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Window_Driver.cxx b/src/drivers/Android/Fl_Android_Window_Driver.cxx index d3e1147bd..cac79426e 100644 --- a/src/drivers/Android/Fl_Android_Window_Driver.cxx +++ b/src/drivers/Android/Fl_Android_Window_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android window driver. // // Copyright 2018-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 // @@ -402,13 +400,13 @@ static HRGN bitmap2region(Fl_Image* image) { /* Does this need to be dynamically determined, perhaps? */ const int ALLOC_UNIT = 100; DWORD maxRects = ALLOC_UNIT; - + RGNDATA* pData = (RGNDATA*)malloc(sizeof(RGNDATAHEADER)+(sizeof(RECT)*maxRects)); pData->rdh.dwSize = sizeof(RGNDATAHEADER); pData->rdh.iType = RDH_RECTANGLES; pData->rdh.nCount = pData->rdh.nRgnSize = 0; SetRect(&pData->rdh.rcBound, MAXLONG, MAXLONG, 0, 0); - + const int bytesPerLine = (image->w() + 7)/8; BYTE* p, *data = (BYTE*)*image->data(); for (int y = 0; y < image->h(); y++) { @@ -551,7 +549,7 @@ void Fl_WinAPI_Window_Driver::flush_overlay() void Fl_WinAPI_Window_Driver::icons(const Fl_RGB_Image *icons[], int count) { free_icons(); - + if (count > 0) { icon_->icons = new Fl_RGB_Image*[count]; icon_->count = count; @@ -559,7 +557,7 @@ void Fl_WinAPI_Window_Driver::icons(const Fl_RGB_Image *icons[], int count) { for (int i = 0;i < count;i++) icon_->icons[i] = (Fl_RGB_Image*)((Fl_RGB_Image*)icons[i])->copy(); } - + if (Fl_X::i(pWindow)) set_icons(); } @@ -594,7 +592,7 @@ void Fl_WinAPI_Window_Driver::free_icons() { void Fl_WinAPI_Window_Driver::make_current() { fl_GetDC(fl_xid(pWindow)); - + #if USE_COLORMAP // Windows maintains a hardware and software color palette; the // SelectPalette() call updates the current soft->hard mapping @@ -602,7 +600,7 @@ void Fl_WinAPI_Window_Driver::make_current() { // code does any drawing... fl_select_palette(); #endif // USE_COLORMAP - + fl_graphics_driver->clip_region(0); ((Fl_GDI_Graphics_Driver*)fl_graphics_driver)->scale(Fl::screen_driver()->scale(screen_num())); } @@ -653,7 +651,7 @@ void Fl_WinAPI_Window_Driver::hide() { } if (hide_common()) return; - + // make sure any custom icons get freed // icons(NULL, 0); // free_icons() is called by the Fl_Window destructor // this little trick keeps the current clipboard alive, even if we are about @@ -673,9 +671,9 @@ void Fl_WinAPI_Window_Driver::hide() { if (Fl::cairo_autolink_context()) Fl::cairo_make_current((Fl_Window*) 0); # endif } - + if (ip->region) Fl_Graphics_Driver::default_driver().XDestroyRegion(ip->region); - + // this little trickery seems to avoid the popup window stacking problem HWND p = GetForegroundWindow(); if (p==GetParent(ip->xid)) { @@ -716,19 +714,19 @@ void Fl_WinAPI_Window_Driver::make_fullscreen(int X, int Y, int W, int H) { Fl_Window *w = pWindow; int top, bottom, left, right; int sx, sy, sw, sh; - + top = fullscreen_screen_top(); bottom = fullscreen_screen_bottom(); left = fullscreen_screen_left(); right = fullscreen_screen_right(); - + if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) { top = screen_num(); bottom = top; left = top; right = top; } - + Fl::screen_xywh(sx, sy, sw, sh, top); Y = sy; Fl::screen_xywh(sx, sy, sw, sh, bottom); @@ -737,11 +735,11 @@ void Fl_WinAPI_Window_Driver::make_fullscreen(int X, int Y, int W, int H) { X = sx; Fl::screen_xywh(sx, sy, sw, sh, right); W = sx + sw - X; - + DWORD flags = GetWindowLong(fl_xid(w), GWL_STYLE); flags = flags & ~(WS_THICKFRAME|WS_CAPTION); SetWindowLong(fl_xid(w), GWL_STYLE, flags); - + // SWP_NOSENDCHANGING is so that we can override size limits float s = Fl::screen_driver()->scale(screen_num()); SetWindowPos(fl_xid(w), HWND_TOP, X*s, Y*s, W*s, H*s, SWP_NOSENDCHANGING | SWP_FRAMECHANGED); @@ -826,7 +824,3 @@ void Fl_WinAPI_Window_Driver::resize_after_screen_change(void *data) { } #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/README.txt b/src/drivers/Android/README.txt index 650c07f68..f2bccf651 100644 --- a/src/drivers/Android/README.txt +++ b/src/drivers/Android/README.txt @@ -3,7 +3,7 @@ WonkoBook:Android matt$ svn ps svn:keywords "author date id revision" Fl_Android_Application.* property 'svn:keywords' set on 'Fl_Android_Application.cpp' property 'svn:keywords' set on 'Fl_Android_Application.h' -WonkoBook:Android matt$ svn pg svn:eol-style Fl_Font.H +WonkoBook:Android matt$ svn pg svn:eol-style Fl_Font.H native WonkoBook:Android matt$ svn ps svn:eol-style "native" Fl_Android_Application.* property 'svn:eol-style' set on 'Fl_Android_Application.cpp' diff --git a/src/drivers/Android/stb_truetype.h b/src/drivers/Android/stb_truetype.h index a08e929f9..e2efae228 100644 --- a/src/drivers/Android/stb_truetype.h +++ b/src/drivers/Android/stb_truetype.h @@ -46,7 +46,7 @@ // Rob Loach Cort Stratton // Kenney Phillis Jr. github:oyvindjam // Brian Costabile github:vassvik -// +// // VERSION HISTORY // // 1.19 (2018-02-11) GPOS kerning, STBTT_fmod @@ -206,7 +206,7 @@ // // Advancing for the next character: // Call GlyphHMetrics, and compute 'current_point += SF * advance'. -// +// // // ADVANCED USAGE // @@ -251,7 +251,7 @@ // Curve tesselation 120 LOC \__ 550 LOC Bitmap creation // Bitmap management 100 LOC / // Baked bitmap interface 70 LOC / -// Font name matching & access 150 LOC ---- 150 +// Font name matching & access 150 LOC ---- 150 // C runtime library abstraction 60 LOC ---- 60 // // @@ -344,7 +344,7 @@ int main(int argc, char **argv) } return 0; } -#endif +#endif // // Output: // @@ -358,9 +358,9 @@ int main(int argc, char **argv) // :@@. M@M // @@@o@@@@ // :M@@V:@@. -// +// ////////////////////////////////////////////////////////////////////////////// -// +// // Complete program: print "Hello World!" banner, with bugs // #if 0 @@ -653,7 +653,7 @@ STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, cons // Calling these functions in sequence is roughly equivalent to calling // stbtt_PackFontRanges(). If you more control over the packing of multiple // fonts, or if you want to pack custom data into a font texture, take a look -// at the source to of stbtt_PackFontRanges() and create a custom version +// at the source to of stbtt_PackFontRanges() and create a custom version // using these functions, e.g. call GatherRects multiple times, // building up a single array of rects, then call PackRects once, // then call RenderIntoRects repeatedly. This may result in a @@ -959,7 +959,7 @@ STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, floa // and computing from that can allow drop-out prevention). // // The algorithm has not been optimized at all, so expect it to be slow -// if computing lots of characters or very large sizes. +// if computing lots of characters or very large sizes. @@ -1716,7 +1716,7 @@ static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, s if (i != 0) num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); - // now start the new one + // now start the new one start_off = !(flags & 1); if (start_off) { // if we start off with an off-curve point, then when we need to find a point on the curve @@ -1769,7 +1769,7 @@ static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, s int comp_num_verts = 0, i; stbtt_vertex *comp_verts = 0, *tmp = 0; float mtx[6] = {1,0,0,1,0,0}, m, n; - + flags = ttSHORT(comp); comp+=2; gidx = ttSHORT(comp); comp+=2; @@ -1799,7 +1799,7 @@ static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, s mtx[2] = ttSHORT(comp)/16384.0f; comp+=2; mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; } - + // Find transformation scales. m = (float) STBTT_sqrt(mtx[0]*mtx[0] + mtx[1]*mtx[1]); n = (float) STBTT_sqrt(mtx[2]*mtx[2] + mtx[3]*mtx[3]); @@ -2727,7 +2727,7 @@ static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, i float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); STBTT_assert(z != NULL); if (!z) return z; - + // round dx down to avoid overshooting if (dxdy < 0) z->dx = -STBTT_ifloor(STBTT_FIX * -dxdy); @@ -2805,7 +2805,7 @@ static void stbtt__fill_active_edges(unsigned char *scanline, int len, stbtt__ac } } } - + e = e->next; } } @@ -3527,7 +3527,7 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info { int ix0,iy0,ix1,iy1; stbtt__bitmap gbm; - stbtt_vertex *vertices; + stbtt_vertex *vertices; int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); if (scale_x == 0) scale_x = scale_y; @@ -3550,7 +3550,7 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info if (height) *height = gbm.h; if (xoff ) *xoff = ix0; if (yoff ) *yoff = iy0; - + if (gbm.w && gbm.h) { gbm.pixels = (unsigned char *) STBTT_malloc(gbm.w * gbm.h, info->userdata); if (gbm.pixels) { @@ -3561,7 +3561,7 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info } STBTT_free(vertices, info->userdata); return gbm.pixels; -} +} STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff) { @@ -3573,7 +3573,7 @@ STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigne int ix0,iy0; stbtt_vertex *vertices; int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); - stbtt__bitmap gbm; + stbtt__bitmap gbm; stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,0,0); gbm.pixels = output; @@ -3595,7 +3595,7 @@ STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char * STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff) { return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y,shift_x,shift_y, stbtt_FindGlyphIndex(info,codepoint), width,height,xoff,yoff); -} +} STBTT_DEF void stbtt_MakeCodepointBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float *sub_x, float *sub_y, int codepoint) { @@ -3610,7 +3610,7 @@ STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, uns STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff) { return stbtt_GetCodepointBitmapSubpixel(info, scale_x, scale_y, 0.0f,0.0f, codepoint, width,height,xoff,yoff); -} +} STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint) { @@ -3735,7 +3735,7 @@ static void stbrp_init_target(stbrp_context *con, int pw, int ph, stbrp_node *no con->y = 0; con->bottom_y = 0; STBTT__NOTUSED(nodes); - STBTT__NOTUSED(num_nodes); + STBTT__NOTUSED(num_nodes); } static void stbrp_pack_rects(stbrp_context *con, stbrp_rect *rects, int num_rects) @@ -4110,7 +4110,7 @@ STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char n = 0; for (i=0; i < num_ranges; ++i) n += ranges[i].num_chars; - + rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context); if (rects == NULL) return 0; @@ -4121,7 +4121,7 @@ STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects); stbtt_PackFontRangesPackRects(spc, rects, n); - + return_value = stbtt_PackFontRangesRenderIntoRects(spc, &info, ranges, num_ranges, rects); STBTT_free(rects, spc->user_allocator_context); @@ -4269,7 +4269,7 @@ static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex int x1 = (int) verts[i ].x, y1 = (int) verts[i ].y; if (y > STBTT_min(y0,y1) && y < STBTT_max(y0,y1) && x > STBTT_min(x0,x1)) { float x_inter = (y - y0) / (y1 - y0) * (x1-x0) + x0; - if (x_inter < x) + if (x_inter < x) winding += (y0 < y1) ? 1 : -1; } } @@ -4295,7 +4295,7 @@ static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex y1 = (int)verts[i ].y; if (y > STBTT_min(y0,y1) && y < STBTT_max(y0,y1) && x > STBTT_min(x0,x1)) { float x_inter = (y - y0) / (y1 - y0) * (x1-x0) + x0; - if (x_inter < x) + if (x_inter < x) winding += (y0 < y1) ? 1 : -1; } } else { @@ -4307,7 +4307,7 @@ static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex if (hits[1][0] < 0) winding += (hits[1][1] < 0 ? -1 : 1); } - } + } } } return winding; @@ -4388,7 +4388,7 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc // invert for y-downwards bitmaps scale_y = -scale_y; - + { int x,y,i,j; float *precompute; @@ -4537,7 +4537,7 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc STBTT_free(verts, info->userdata); } return data; -} +} STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, float scale, int codepoint, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff) { @@ -4555,7 +4555,7 @@ STBTT_DEF void stbtt_FreeSDF(unsigned char *bitmap, void *userdata) // // check if a utf8 string contains a prefix which is the utf16 string; if so return length of matching utf8 string -static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, stbtt_int32 len1, stbtt_uint8 *s2, stbtt_int32 len2) +static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, stbtt_int32 len1, stbtt_uint8 *s2, stbtt_int32 len2) { stbtt_int32 i=0; @@ -4594,7 +4594,7 @@ static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, s return i; } -static int stbtt_CompareUTF8toUTF16_bigendian_internal(char *s1, int len1, char *s2, int len2) +static int stbtt_CompareUTF8toUTF16_bigendian_internal(char *s1, int len1, char *s2, int len2) { return len1 == stbtt__CompareUTF8toUTF16_bigendian_prefix((stbtt_uint8*) s1, len1, (stbtt_uint8*) s2, len2); } @@ -4723,7 +4723,7 @@ STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index) { - return stbtt_GetFontOffsetForIndex_internal((unsigned char *) data, index); + return stbtt_GetFontOffsetForIndex_internal((unsigned char *) data, index); } STBTT_DEF int stbtt_GetNumberOfFonts(const unsigned char *data) @@ -4816,38 +4816,38 @@ This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------ ALTERNATIVE A - MIT License Copyright (c) 2017 Sean Barrett -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ ALTERNATIVE B - Public Domain (www.unlicense.org) This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -software, either in source code form or as a compiled binary, for any purpose, +Anyone is free to copy, modify, publish, use, compile, sell, or distribute this +software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and to -the detriment of our heirs and successors. We intend this dedication to be an -overt act of relinquishment in perpetuity of all present and future rights to +In jurisdictions that recognize copyright laws, the author or authors of this +software dedicate any and all copyright interest in the software to the public +domain. We make this dedication for the benefit of the public at large and to +the detriment of our heirs and successors. We intend this dedication to be an +overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ */ diff --git a/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm b/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm index 4fa639d6a..ab3d90fb0 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm +++ b/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm @@ -1,6 +1,4 @@ // -// "$Id$" -// // Mac OS X-specific printing support (objective-c++) 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 to: +// 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/Fl_Paged_Device.H> @@ -132,9 +130,9 @@ int Fl_Cocoa_Printer_Driver::begin_job (int pagecount, int *frompage, int *topag pageFormat = (PMPageFormat)[info PMPageFormat];//from 10.5 printSettings = (PMPrintSettings)[info PMPrintSettings];//from 10.5 UInt32 from32, to32; - PMGetFirstPage(printSettings, &from32); + PMGetFirstPage(printSettings, &from32); if (frompage) *frompage = (int)from32; - PMGetLastPage(printSettings, &to32); + PMGetLastPage(printSettings, &to32); if (topage) { *topage = (int)to32; if (*topage > pagecount && pagecount > 0) *topage = pagecount; @@ -176,9 +174,9 @@ int Fl_Cocoa_Printer_Driver::begin_job (int pagecount, int *frompage, int *topag return 1; } UInt32 from32, to32; - PMGetFirstPage(printSettings, &from32); + PMGetFirstPage(printSettings, &from32); if (frompage) *frompage = (int)from32; - PMGetLastPage(printSettings, &to32); + PMGetLastPage(printSettings, &to32); if (topage) *topage = (int)to32; if(topage && *topage > pagecount) *topage = pagecount; CFStringRef mystring[1]; @@ -234,10 +232,10 @@ int Fl_Cocoa_Printer_Driver::printable_rect(int *w, int *h) OSStatus status; PMRect pmRect; int x, y; - + status = PMGetAdjustedPageRect(pageFormat, &pmRect); if (status != noErr) return 1; - + x = (int)pmRect.left; y = (int)pmRect.top; *w = int((int)(pmRect.right - x) / scale_x + 1); @@ -303,7 +301,7 @@ void Fl_Cocoa_Printer_Driver::untranslate(void) } int Fl_Cocoa_Printer_Driver::begin_page (void) -{ +{ OSStatus status = PMSessionBeginPageNoDialog(printSession, pageFormat, NULL); CGContextRef gc; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 @@ -330,11 +328,11 @@ int Fl_Cocoa_Printer_Driver::begin_page (void) PMPaperGetMargins(paper, &margins); PMOrientation orientation; PMGetOrientation(pageFormat, &orientation); - + status = PMGetAdjustedPageRect(pageFormat, &pmRect); double h = pmRect.bottom - pmRect.top; x_offset = 0; - y_offset = 0; + y_offset = 0; angle = 0; scale_x = scale_y = 1; win_scale_x = win_scale_y = 1; @@ -354,7 +352,7 @@ int Fl_Cocoa_Printer_Driver::begin_page (void) } int Fl_Cocoa_Printer_Driver::end_page (void) -{ +{ CGContextRef gc = (CGContextRef)driver()->gc(); CGContextFlush(gc); CGContextRestoreGState(gc); @@ -368,7 +366,7 @@ int Fl_Cocoa_Printer_Driver::end_page (void) void Fl_Cocoa_Printer_Driver::end_job (void) { OSStatus status; - + status = PMSessionError(printSession); if (status != noErr) { fl_alert ("PM Session error %d", (int)status); @@ -471,7 +469,3 @@ void Fl_Cocoa_Printer_Driver::draw_decorated_window(Fl_Window *win, int x_offset [title release]; this->print_widget(win, x_offset, y_offset + bt); // print the window inner part } - -// -// End of "$Id$". -// diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H index 97dd28a77..23af18f6f 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H +++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Cocoa Screen interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -29,9 +27,9 @@ /* Move everything here that manages the native screen interface. - + There is exactly one screen driver in the system. - + - screen configuration and sizes - multiple screens - native dialog boxes @@ -47,7 +45,7 @@ class Fl_RGB_Image; class NSImage; #endif -class FL_EXPORT Fl_Cocoa_Screen_Driver : public Fl_Screen_Driver +class FL_EXPORT Fl_Cocoa_Screen_Driver : public Fl_Screen_Driver { protected: struct XRectangle {int x, y, width, height;}; @@ -101,7 +99,7 @@ public: // --- compute dimensions of an Fl_Offscreen virtual void offscreen_size(Fl_Offscreen o, int &width, int &height); virtual float retina_factor() { return 2; } - + virtual APP_SCALING_CAPABILITY rescalable() { return SYSTEMWIDE_APP_SCALING; } virtual float scale(int n) {return scale_;} virtual void scale(int n, float f) { scale_ = f;} @@ -113,7 +111,3 @@ private: #endif // FL_COCOA_SCREEN_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx index 71743d7cb..bf85d0efc 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Cocoa Screen interface. // // 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 // @@ -44,7 +42,7 @@ int Fl_Cocoa_Screen_Driver::next_marked_length = 0; /** Creates a driver that manages all screen and display related calls. - + This function must be implemented once for every platform. */ Fl_Screen_Driver *Fl_Screen_Driver::newScreenDriver() @@ -265,72 +263,72 @@ int Fl_Cocoa_Screen_Driver::input_widget_handle_key(int key, unsigned mods, unsi { switch (key) { case FL_Delete: { - if (mods==0) return input->kf_delete_char_right(); // Delete (OSX-HIG,TE,SA,WOX) - if (mods==FL_CTRL) return input->kf_delete_char_right(); // Ctrl-Delete (??? TE,!SA,!WOX) - if (mods==FL_ALT) return input->kf_delete_word_right(); // Alt-Delete (OSX-HIG,TE,SA) - return 0; // ignore other combos, pass to parent + if (mods==0) return input->kf_delete_char_right(); // Delete (OSX-HIG,TE,SA,WOX) + if (mods==FL_CTRL) return input->kf_delete_char_right(); // Ctrl-Delete (??? TE,!SA,!WOX) + if (mods==FL_ALT) return input->kf_delete_word_right(); // Alt-Delete (OSX-HIG,TE,SA) + return 0; // ignore other combos, pass to parent } - + case FL_Left: - if (mods==0) return input->kf_move_char_left(); // Left (OSX-HIG) - if (mods==FL_ALT) return input->kf_move_word_left(); // Alt-Left (OSX-HIG) - if (mods==FL_META) return input->kf_move_sol(); // Meta-Left (OSX-HIG) - if (mods==FL_CTRL) return input->kf_move_sol(); // Ctrl-Left (TE/SA) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_move_char_left(); // Left (OSX-HIG) + if (mods==FL_ALT) return input->kf_move_word_left(); // Alt-Left (OSX-HIG) + if (mods==FL_META) return input->kf_move_sol(); // Meta-Left (OSX-HIG) + if (mods==FL_CTRL) return input->kf_move_sol(); // Ctrl-Left (TE/SA) + return 0; // ignore other combos, pass to parent + case FL_Right: - if (mods==0) return input->kf_move_char_right(); // Right (OSX-HIG) - if (mods==FL_ALT) return input->kf_move_word_right(); // Alt-Right (OSX-HIG) - if (mods==FL_META) return input->kf_move_eol(); // Meta-Right (OSX-HIG) - if (mods==FL_CTRL) return input->kf_move_eol(); // Ctrl-Right (TE/SA) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_move_char_right(); // Right (OSX-HIG) + if (mods==FL_ALT) return input->kf_move_word_right(); // Alt-Right (OSX-HIG) + if (mods==FL_META) return input->kf_move_eol(); // Meta-Right (OSX-HIG) + if (mods==FL_CTRL) return input->kf_move_eol(); // Ctrl-Right (TE/SA) + return 0; // ignore other combos, pass to parent + case FL_Up: - if (mods==0) return input->kf_lines_up(1); // Up (OSX-HIG) - if (mods==FL_CTRL) return input->kf_page_up(); // Ctrl-Up (TE !HIG) - if (mods==FL_ALT) return input->kf_move_up_and_sol(); // Alt-Up (OSX-HIG) - if (mods==FL_META) return input->kf_top(); // Meta-Up (OSX-HIG) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_lines_up(1); // Up (OSX-HIG) + if (mods==FL_CTRL) return input->kf_page_up(); // Ctrl-Up (TE !HIG) + if (mods==FL_ALT) return input->kf_move_up_and_sol(); // Alt-Up (OSX-HIG) + if (mods==FL_META) return input->kf_top(); // Meta-Up (OSX-HIG) + return 0; // ignore other combos, pass to parent + case FL_Down: - if (mods==0) return input->kf_lines_down(1); // Dn (OSX-HIG) - if (mods==FL_CTRL) return input->kf_page_down(); // Ctrl-Dn (TE !HIG) - if (mods==FL_ALT) return input->kf_move_down_and_eol(); // Alt-Dn (OSX-HIG) - if (mods==FL_META) return input->kf_bottom(); // Meta-Dn (OSX-HIG) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_lines_down(1); // Dn (OSX-HIG) + if (mods==FL_CTRL) return input->kf_page_down(); // Ctrl-Dn (TE !HIG) + if (mods==FL_ALT) return input->kf_move_down_and_eol(); // Alt-Dn (OSX-HIG) + if (mods==FL_META) return input->kf_bottom(); // Meta-Dn (OSX-HIG) + return 0; // ignore other combos, pass to parent + case FL_Page_Up: // Fl_Input has no scroll control, so instead we move the cursor by one page // OSX-HIG recommends Alt increase one semantic unit, Meta next higher.. - if (mods==0) return input->kf_page_up(); // PgUp (OSX-HIG) - if (mods==FL_ALT) return input->kf_page_up(); // Alt-PageUp (OSX-HIG) - if (mods==FL_META) return input->kf_top(); // Meta-PageUp (OSX-HIG,!TE) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_page_up(); // PgUp (OSX-HIG) + if (mods==FL_ALT) return input->kf_page_up(); // Alt-PageUp (OSX-HIG) + if (mods==FL_META) return input->kf_top(); // Meta-PageUp (OSX-HIG,!TE) + return 0; // ignore other combos, pass to parent + case FL_Page_Down: // Fl_Input has no scroll control, so instead we move the cursor by one page // OSX-HIG recommends Alt increase one semantic unit, Meta next higher.. - if (mods==0) return input->kf_page_down(); // PgDn (OSX-HIG) - if (mods==FL_ALT) return input->kf_page_down(); // Alt-PageDn (OSX-HIG) - if (mods==FL_META) return input->kf_bottom(); // Meta-PageDn (OSX-HIG,!TE) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_page_down(); // PgDn (OSX-HIG) + if (mods==FL_ALT) return input->kf_page_down(); // Alt-PageDn (OSX-HIG) + if (mods==FL_META) return input->kf_bottom(); // Meta-PageDn (OSX-HIG,!TE) + return 0; // ignore other combos, pass to parent + case FL_Home: - if (mods==0) return input->kf_top(); // Home (OSX-HIG) - if (mods==FL_ALT) return input->kf_top(); // Alt-Home (???) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_top(); // Home (OSX-HIG) + if (mods==FL_ALT) return input->kf_top(); // Alt-Home (???) + return 0; // ignore other combos, pass to parent + case FL_End: - if (mods==0) return input->kf_bottom(); // End (OSX-HIG) - if (mods==FL_ALT) return input->kf_bottom(); // Alt-End (???) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_bottom(); // End (OSX-HIG) + if (mods==FL_ALT) return input->kf_bottom(); // Alt-End (???) + return 0; // ignore other combos, pass to parent + case FL_BackSpace: - if (mods==0) return input->kf_delete_char_left(); // Backspace (OSX-HIG) - if (mods==FL_CTRL) return input->kf_delete_char_left(); // Ctrl-Backspace (TE/SA) - if (mods==FL_ALT) return input->kf_delete_word_left(); // Alt-Backspace (OSX-HIG) - if (mods==FL_META) return input->kf_delete_sol(); // Meta-Backspace (OSX-HIG,!TE) - return 0; // ignore other combos, pass to parent + if (mods==0) return input->kf_delete_char_left(); // Backspace (OSX-HIG) + if (mods==FL_CTRL) return input->kf_delete_char_left(); // Ctrl-Backspace (TE/SA) + if (mods==FL_ALT) return input->kf_delete_word_left(); // Alt-Backspace (OSX-HIG) + if (mods==FL_META) return input->kf_delete_sol(); // Meta-Backspace (OSX-HIG,!TE) + return 0; // ignore other combos, pass to parent } return -1; } @@ -460,7 +458,7 @@ static void do_timer(CFRunLoopTimerRef timer, void* data) if (current_timer && current_timer->pending == 0) delete_timer(*current_timer); current_timer = NULL; - + Fl_Cocoa_Screen_Driver::breakMacEventLoop(); fl_unlock_function(); } @@ -550,7 +548,3 @@ void Fl_Cocoa_Screen_Driver::remove_timeout(Fl_Timeout_Handler cb, void* data) } } } - -// -// End of "$Id$". -// diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H index 9ef5d46c9..dedc7bb34 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H +++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Cocoa window driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -57,13 +55,13 @@ class NSOpenGLPixelFormat; There is one window driver for each Fl_Window. Window drivers manage window actions such as resizing, events, decoration, fullscreen modes, etc. . All - drawing and rendering is managed by the Surface device and the associated + drawing and rendering is managed by the Surface device and the associated graphics driver. - window specific event handling - window types and styles, depth, etc. - decorations - + ? where do we handle the interface between OpenGL/DirectX and Cocoa/Windows/Glx? */ struct Fl_Window_Driver::shape_data_type { @@ -144,7 +142,7 @@ public: CALayer *get_titlebar_layer(); static void draw_layer_to_context(CALayer *layer, CGContextRef gc, int w, int h); virtual int scroll(int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, void (*draw_area)(void*, int,int,int,int), void* data); - + // these functions are OpenGL-related and use objective-c // they are put here to avoid libfltk_gl dependency in Fl_cocoa.mm static NSOpenGLContext* create_GLcontext_for_window(NSOpenGLPixelFormat *pixelformat, NSOpenGLContext *shared_ctx, Fl_Window *window); @@ -155,14 +153,10 @@ public: static void GLcontext_makecurrent(NSOpenGLContext*); // uses Objective-c static void GL_cleardrawable(void); // uses Objective-c static void gl_start(NSOpenGLContext*); // uses Objective-c - + //icons virtual void icons(const Fl_RGB_Image *icons[], int count); NSImage *icon_image; }; #endif // FL_COCOA_WINDOW_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx index 0611e630e..97ff298f3 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Cocoa window driver. // // 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 // @@ -359,7 +357,3 @@ void Fl_Cocoa_Window_Driver::capture_titlebar_and_borders(Fl_RGB_Image*& top, Fl top->scale(w(),htop, s <1 ? 0 : 1, 1); CGContextRelease(auxgc); } - -// -// End of "$Id$". -// diff --git a/src/drivers/Cocoa/Fl_MacOS_Sys_Menu_Bar_Driver.H b/src/drivers/Cocoa/Fl_MacOS_Sys_Menu_Bar_Driver.H index 7502947d2..27f34e226 100644 --- a/src/drivers/Cocoa/Fl_MacOS_Sys_Menu_Bar_Driver.H +++ b/src/drivers/Cocoa/Fl_MacOS_Sys_Menu_Bar_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of class Fl_MacOS_Sys_Menu_Bar_Driver for the Fast Light Tool Kit (FLTK). // // Copyright 2017 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_MacOS_Sys_Menu_Bar_Driver_H @@ -49,7 +47,3 @@ public: #endif /* Fl_MacOS_Sys_Menu_Bar_Driver_H */ - -// -// End of "$Id$". -// diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.H b/src/drivers/Darwin/Fl_Darwin_System_Driver.H index 6f1625739..ee7ab30ea 100644 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.H +++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Darwin system driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -86,7 +84,3 @@ public: }; #endif // FL_DARWIN_SYSTEM_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx index 548b0287a..51a416b87 100644 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx +++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Darwin system driver. // // 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_Darwin_System_Driver.H" @@ -92,7 +90,7 @@ const char *Fl_Darwin_System_Driver::control_name() { /* Creates a driver that manages all system related calls. - + This function must be implemented once for every platform. */ Fl_System_Driver *Fl_System_Driver::newSystemDriver() @@ -159,7 +157,7 @@ int Fl_Darwin_System_Driver::filename_list(const char *d, dirent ***list, int (* // Use memcpy for speed since we already know the length of the string... memcpy(fullname, d, dirlen+1); char *name = fullname + dirlen; - if (name!=fullname && name[-1]!='/') *name++ = '/'; + if (name!=fullname && name[-1]!='/') *name++ = '/'; for (i=0; i<n; i++) { int newlen; dirent *de = (*list)[i]; @@ -190,7 +188,7 @@ int Fl_Darwin_System_Driver::filename_list(const char *d, dirent ***list, int (* int Fl_Darwin_System_Driver::open_uri(const char *uri, char *msg, int msglen) { - char *argv[3]; // Command-line arguments + char *argv[3]; // Command-line arguments argv[0] = (char*)"open"; argv[1] = (char*)uri; argv[2] = (char*)0; @@ -201,20 +199,20 @@ int Fl_Darwin_System_Driver::open_uri(const char *uri, char *msg, int msglen) int Fl_Darwin_System_Driver::file_browser_load_filesystem(Fl_File_Browser *browser, char *filename, int lname, Fl_File_Icon *icon) { // MacOS X and Darwin use getfsstat() system call... - int numfs; // Number of file systems - struct statfs *fs; // Buffer for file system info + int numfs; // Number of file systems + struct statfs *fs; // Buffer for file system info int num_files = 0; - + // We always have the root filesystem. browser->add("/", icon); - + // Get the mounted filesystems... numfs = getfsstat(NULL, 0, MNT_NOWAIT); if (numfs > 0) { // We have file systems, get them... fs = new struct statfs[numfs]; getfsstat(fs, sizeof(struct statfs) * numfs, MNT_NOWAIT); - + // Add filesystems to the list... for (int i = 0; i < numfs; i ++) { // Ignore "/", "/dev", and "/.vol"... @@ -225,7 +223,7 @@ int Fl_Darwin_System_Driver::file_browser_load_filesystem(Fl_File_Browser *brows } num_files ++; } - + // Free the memory used for the file system info array... delete[] fs; } @@ -261,7 +259,3 @@ const char *Fl_Darwin_System_Driver::filename_name( const char *name ) } return q; } - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_Font.H b/src/drivers/GDI/Fl_Font.H index b530ec422..f636bb2f4 100644 --- a/src/drivers/GDI/Fl_Font.H +++ b/src/drivers/GDI/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: @@ -42,7 +40,3 @@ public: extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx b/src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx index 7a8f24c6c..9d7591712 100644 --- a/src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx +++ b/src/drivers/GDI/Fl_GDI_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" @@ -89,7 +87,7 @@ Fl_GDI_Copy_Surface_Driver::~Fl_GDI_Copy_Surface_Driver() { SetClipboardData(CF_BITMAP, surf->offscreen()); Fl_Surface_Device::pop_current(); delete surf; - + CloseClipboard (); } DeleteEnhMetaFile(hmf); @@ -116,7 +114,3 @@ void Fl_GDI_Copy_Surface_Driver::untranslate() { ((Fl_GDI_Graphics_Driver*)driver())->untranslate_all(); } #endif // FL_CFG_GFX_GDI - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H index 626049aeb..7dd947f6e 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of classes Fl_Graphics_Driver, Fl_Surface_Device, Fl_Display_Device // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -171,7 +169,3 @@ public: #endif // FL_GDI_GRAPHICS_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx index 078800e75..1e0b11c82 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx +++ b/src/drivers/GDI/Fl_GDI_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 // @@ -294,7 +292,3 @@ Fl_Region Fl_GDI_Graphics_Driver::scale_clip(float f) { void Fl_GDI_Graphics_Driver::set_current_() { restore_clip(); } - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx index 9d4b0b354..6055ab1a5 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx +++ b/src/drivers/GDI/Fl_GDI_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 // /** @@ -60,7 +58,3 @@ void Fl_GDI_Graphics_Driver::pie_unscaled(float x, float y, float w, float h, do } else Pie(gc_, x, y, x+w, y+h, xa, ya, xb, yb); } else Pie(gc_, x, y, x+w, y+h, xa, ya, xb, yb); } - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_color.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_color.cxx index 9df0c8a39..9e6466e92 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_color.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_color.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // MSWidnows' GDI 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 // // The fltk "colormap". This allows ui colors to be stored in 8-bit @@ -101,11 +99,11 @@ void Fl_GDI_Graphics_Driver::color(Fl_Color i) { if (!xmap.pen || xmap.pwidth != tw) { #if USE_COLORMAP if (fl_palette) { - set_xmap(xmap, PALETTEINDEX(i), tw); + set_xmap(xmap, PALETTEINDEX(i), tw); } else { #endif - unsigned c = fl_cmap[i]; - set_xmap(xmap, RGB(uchar(c>>24), uchar(c>>16), uchar(c>>8)), tw); + unsigned c = fl_cmap[i]; + set_xmap(xmap, RGB(uchar(c>>24), uchar(c>>16), uchar(c>>8)), tw); #if USE_COLORMAP } #endif @@ -158,10 +156,10 @@ HBRUSH fl_brush_action(int action) { if (brushes[i].brush == NULL) goto CREATE_BRUSH; if ( (++brushes[i].usage) > 32000 ) { // keep a usage statistic for (int j=0; j<FL_N_BRUSH; j++) { - if (brushes[j].usage>16000) - brushes[j].usage -= 16000; - else - brushes[j].usage = 0; + if (brushes[j].usage>16000) + brushes[j].usage -= 16000; + else + brushes[j].usage = 0; } } return brushes[i].brush; @@ -170,8 +168,8 @@ HBRUSH fl_brush_action(int action) { for (i=0; i<FL_N_BRUSH; i++) { if (brushes[i].brush == NULL) goto CREATE_BRUSH; if (brushes[i].usage<umin) { - umin = brushes[i].usage; - imin = i; + umin = brushes[i].usage; + imin = i; } } i = imin; @@ -247,7 +245,3 @@ fl_select_palette(void) } #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx index 7127682cc..1e2b492f3 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Windows 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 WIN32_LEAN_AND_MEAN @@ -221,19 +219,19 @@ Fl_GDI_Font_Descriptor::Fl_GDI_Font_Descriptor(const char* name, Fl_Fontsize fsi } fid = CreateFont( -fsize, // negative makes it use "char size" - 0, // logical average character width - fl_angle_*10, // angle of escapement - fl_angle_*10, // base-line orientation angle + 0, // logical average character width + fl_angle_*10, // angle of escapement + fl_angle_*10, // base-line orientation angle weight, italic, - FALSE, // underline attribute flag - FALSE, // strikeout attribute flag + FALSE, // underline attribute flag + FALSE, // strikeout attribute flag DEFAULT_CHARSET, // character set identifier - OUT_DEFAULT_PRECIS, // output precision + OUT_DEFAULT_PRECIS, // output precision CLIP_DEFAULT_PRECIS,// clipping precision - DEFAULT_QUALITY, // output quality - DEFAULT_PITCH, // pitch and family - name // pointer to typeface name string + DEFAULT_QUALITY, // output quality + DEFAULT_PITCH, // pitch and family + name // pointer to typeface name string ); angle = fl_angle_; HDC gc = (HDC)fl_graphics_driver->gc(); @@ -395,7 +393,7 @@ double Fl_GDI_Graphics_Driver::width_unscaled(unsigned int c) { for (int i = 0; i < 0x0400; i++) fl_fontsize->width[r][i] = -1; } else { if ( fl_fontsize->width[r][c&0x03FF] >= 0 ) { // already cached - return (double) fl_fontsize->width[r][c & 0x03FF]; + return (double) fl_fontsize->width[r][c & 0x03FF]; } } unsigned short ii = r * 0x400; @@ -633,7 +631,3 @@ void Fl_GDI_Graphics_Driver::rtl_draw_unscaled(const char* c, int n, int x, int SetTextColor(gc_, oldColor); } #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx index 0533b3b5f..6bc9ad82d 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Windows image drawing code 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 @@ -110,8 +108,8 @@ static void monodither(uchar* to, const uchar* from, int w, int delta) { static int fl_abs(int v) { return v<0 ? -v : v; } static void innards(const uchar *buf, int X, int Y, int W, int H, - int delta, int linedelta, int depth, - Fl_Draw_Image_Cb cb, void* userdata, HDC gc) + int delta, int linedelta, int depth, + Fl_Draw_Image_Cb cb, void* userdata, HDC gc) { char indexed = 0; @@ -120,7 +118,7 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, #endif if (depth==0) depth = 3; - if (indexed || !fl_can_do_alpha_blending()) + if (indexed || !fl_can_do_alpha_blending()) depth = (depth-1)|1; if (!linedelta) linedelta = W*fl_abs(delta); @@ -149,9 +147,9 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, } else #endif if (depth<3) { - RGBQUAD *bmi_colors = &bmi.bmiColors[0]; // suppress warning (STR #3199) + RGBQUAD *bmi_colors = &bmi.bmiColors[0]; // suppress warning (STR #3199) for (int i=0; i<256; i++) { - bmi_colors[i].rgbBlue = (uchar)i; // bmi.bmiColors[i]... + bmi_colors[i].rgbBlue = (uchar)i; // bmi.bmiColors[i]... bmi_colors[i].rgbGreen = (uchar)i; bmi_colors[i].rgbRed = (uchar)i; bmi_colors[i].rgbReserved = (uchar)0; // must be zero @@ -170,7 +168,7 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, pixelsize = 4; } int linesize = (pixelsize*w+3)&~3; - + static U32* buffer; static long buffer_size; int blocking = h; @@ -201,85 +199,85 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, for (k = 0; j<h && k<blocking; k++, j++) { const uchar* from; if (!buf) { // run the converter: - cb(userdata, x-X, y-Y+j, w, (uchar*)line_buffer); - from = (uchar*)line_buffer; + cb(userdata, x-X, y-Y+j, w, (uchar*)line_buffer); + from = (uchar*)line_buffer; } else { - from = buf; - buf += linedelta; + from = buf; + buf += linedelta; } uchar *to = (uchar*)buffer+(blocking-k-1)*linesize; #if USE_COLORMAP if (indexed) { - if (depth<3) - monodither(to, from, w, delta); - else - dither(to, from, w, delta); - to += w; + if (depth<3) + monodither(to, from, w, delta); + else + dither(to, from, w, delta); + to += w; } else #endif { int i; switch (depth) { - case 1: + case 1: for (i=w; i--; from += delta) *to++ = *from; break; case 2: - for (i=w; i--; from += delta, to += 4) { - uchar a = from[1]; - uchar gray = (from[0]*a)>>8; - to[0] = gray; - to[1] = gray; - to[2] = gray; - to[3] = a; + for (i=w; i--; from += delta, to += 4) { + uchar a = from[1]; + uchar gray = (from[0]*a)>>8; + to[0] = gray; + to[1] = gray; + to[2] = gray; + to[3] = a; } break; case 3: - for (i=w; i--; from += delta, to += 3) { - uchar r = from[0]; - to[0] = from[2]; - to[1] = from[1]; - to[2] = r; + for (i=w; i--; from += delta, to += 3) { + uchar r = from[0]; + to[0] = from[2]; + to[1] = from[1]; + to[2] = r; } - break; + break; case 4: - for (i=w; i--; from += delta, to += 4) { + for (i=w; i--; from += delta, to += 4) { uchar a = from[3]; - uchar r = from[0]; - to[0] = (from[2]*a)>>8; - to[1] = (from[1]*a)>>8; - to[2] = (r*a)>>8; - to[3] = from[3]; + uchar r = from[0]; + to[0] = (from[2]*a)>>8; + to[1] = (from[1]*a)>>8; + to[2] = (r*a)>>8; + to[3] = from[3]; } - break; - } + break; + } } } if (fl_graphics_driver->has_feature(Fl_Graphics_Driver::PRINTER)) { // if print context, device and logical units are not equal, so SetDIBitsToDevice // does not do the expected job, whereas StretchDIBits does it. StretchDIBits(gc, x, y+j-k, w, k, 0, 0, w, k, - (LPSTR)((uchar*)buffer+(blocking-k)*linesize), - &bmi, + (LPSTR)((uchar*)buffer+(blocking-k)*linesize), + &bmi, #if USE_COLORMAP - indexed ? DIB_PAL_COLORS : DIB_RGB_COLORS + indexed ? DIB_PAL_COLORS : DIB_RGB_COLORS #else - DIB_RGB_COLORS + DIB_RGB_COLORS #endif - , SRCCOPY ); + , SRCCOPY ); delete[] buffer; buffer = NULL; buffer_size = 0; } else { SetDIBitsToDevice(gc, x, y+j-k, w, k, 0, 0, 0, k, - (LPSTR)((uchar*)buffer+(blocking-k)*linesize), - &bmi, + (LPSTR)((uchar*)buffer+(blocking-k)*linesize), + &bmi, #if USE_COLORMAP - indexed ? DIB_PAL_COLORS : DIB_RGB_COLORS + indexed ? DIB_PAL_COLORS : DIB_RGB_COLORS #else - DIB_RGB_COLORS + DIB_RGB_COLORS #endif - ); + ); } } } @@ -294,7 +292,7 @@ void Fl_GDI_Graphics_Driver::draw_image_unscaled(const uchar* buf, int x, int y, } void Fl_GDI_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) { if (fl_abs(d)&FL_IMAGE_WITH_ALPHA) { d ^= FL_IMAGE_WITH_ALPHA; innards(0,x,y,w,h,d,0,(d<3&&d>-3),cb,data, gc_); @@ -313,7 +311,7 @@ void Fl_GDI_Graphics_Driver::draw_image_mono_unscaled(const uchar* buf, int x, i } void Fl_GDI_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) { if (fl_abs(d)&FL_IMAGE_WITH_ALPHA) { d ^= FL_IMAGE_WITH_ALPHA; innards(0,x,y,w,h,d,0,1,cb,data, gc_); @@ -347,9 +345,9 @@ Fl_Bitmask Fl_GDI_Graphics_Driver::create_bitmask(int w, int h, const uchar *dat static uchar loNibble[16] = { 0x00, 0x08, 0x04, 0x0c, 0x02, 0x0a, 0x06, 0x0e, 0x01, 0x09, 0x05, 0x0d, 0x03, 0x0b, 0x07, 0x0f }; - int np = GetDeviceCaps(gc_, PLANES); //: was always one on sample machines + int np = GetDeviceCaps(gc_, PLANES); //: was always one on sample machines int bpp = GetDeviceCaps(gc_, BITSPIXEL);//: 1,4,8,16,24,32 and more odd stuff? - int Bpr = (bpp*w+7)/8; //: bytes per row + int Bpr = (bpp*w+7)/8; //: bytes per row int pad = Bpr&1, w1 = (w+7)/8, shr = ((w-1)&7)+1; if (bpp==4) shr = (shr+1)/2; uchar *newarray = new uchar[(Bpr+pad)*h]; @@ -391,7 +389,7 @@ Fl_Bitmask Fl_GDI_Graphics_Driver::create_bitmask(int w, int h, const uchar *dat bm = CreateBitmap(w, h, np, bpp, newarray); delete[] newarray; - + return bm; } @@ -601,7 +599,7 @@ static Fl_Bitmask fl_create_bitmap(int w, int h, const uchar *data) { const uchar* src = data; uchar* dest = newarray; Fl_Bitmask bm; - static uchar reverse[16] = /* Bit reversal lookup table */ + static uchar reverse[16] = /* Bit reversal lookup table */ { 0x00, 0x88, 0x44, 0xcc, 0x22, 0xaa, 0x66, 0xee, 0x11, 0x99, 0x55, 0xdd, 0x33, 0xbb, 0x77, 0xff }; @@ -613,9 +611,9 @@ static Fl_Bitmask fl_create_bitmap(int w, int h, const uchar *data) { } bm = CreateBitmap(w, h, 1, 1, newarray); - + delete[] newarray; - + return bm; } @@ -716,7 +714,3 @@ void Fl_GDI_Graphics_Driver::cache(Fl_Pixmap *img) { void Fl_GDI_Graphics_Driver::uncache_pixmap(fl_uintptr_t offscreen) { DeleteObject((Fl_Offscreen)offscreen); } - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_line_style.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_line_style.cxx index 41cca4fb0..e71fa65d7 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_line_style.cxx +++ b/src/drivers/GDI/Fl_GDI_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 // /** @@ -61,7 +59,3 @@ void Fl_GDI_Graphics_Driver::line_style_unscaled(int style, float width, char* d DeleteObject(fl_current_xmap->pen); fl_current_xmap->pen = newpen; } - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx index 3e5d6bfb9..6bb526b6c 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx +++ b/src/drivers/GDI/Fl_GDI_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 // @@ -197,7 +195,7 @@ int Fl_GDI_Graphics_Driver::clip_box(int x, int y, int w, int h, int& X, int& Y, ret = 2; } else if (EqualRgn(temp, rr)) { // complete ret = 0; - } else { // partial intersection + } else { // partial intersection RECT rect; GetRgnBox(temp, &rect); if (Fl_Surface_Device::surface() != Fl_Display_Device::display_device()) { // if print context, convert coords from device to logical @@ -239,7 +237,3 @@ void Fl_GDI_Graphics_Driver::restore_clip() { if (r) unscale_clip(r); } } - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_vertex.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_vertex.cxx index caace8b39..c556121cc 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_vertex.cxx +++ b/src/drivers/GDI/Fl_GDI_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,18 +7,18 @@ // 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 // /** \file Fl_GDI_Graphics_Driver_vertex.cxx \brief Portable drawing code for drawing arbitrary shapes with - simple 2D transformations, implemented for Windows GDI. + simple 2D transformations, implemented for Windows GDI. */ #include "Fl_GDI_Graphics_Driver.H" @@ -99,9 +97,5 @@ void Fl_GDI_Graphics_Driver::ellipse_unscaled(double xt, double yt, double rx, d SelectObject(gc_, fl_brush()); Pie(gc_, llx, lly, llx+w, lly+h, 0,0, 0,0); } else - Arc(gc_, llx, lly, llx+w, lly+h, 0,0, 0,0); + Arc(gc_, llx, lly, llx+w, lly+h, 0,0, 0,0); } - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx b/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx index 43fe15dcb..a7b9f1e8c 100644 --- a/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx +++ b/src/drivers/GDI/Fl_GDI_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 // @@ -102,8 +100,3 @@ void Fl_GDI_Image_Surface_Driver::end_current() fl_window = pre_window; Fl_Surface_Device::end_current(); } - - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Display_Device.H b/src/drivers/OpenGL/Fl_OpenGL_Display_Device.H index 7afa7d8cb..8e6d1c8bb 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Display_Device.H +++ b/src/drivers/OpenGL/Fl_OpenGL_Display_Device.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of class Fl_OpenGL_Display_Device for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2016 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 to: +// 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/Fl_Device.H> @@ -32,7 +30,3 @@ public: static Fl_OpenGL_Display_Device *display_device(); static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window*, int, int, int, int); }; - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx b/src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx index 4accea0a7..acd74bc95 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // implementation of class Fl_OpenGL_Display_Device for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2017 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 to: +// 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" @@ -132,13 +130,10 @@ Fl_RGB_Image* Fl_OpenGL_Display_Device::capture_gl_rectangle(Fl_Gl_Window *glw, memcpy(q, tmp, mByteWidth); } delete[] tmp; - + Fl_RGB_Image *img = new Fl_RGB_Image(baseAddress, w, h, 3, mByteWidth); img->alloc_array = 1; return img; } #endif -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H index 36ecab45d..f5de05333 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of OpenGL graphics driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -93,7 +91,3 @@ public: }; #endif // FL_OPENGL_GRAPHICS_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.cxx index 5544b136e..f543c93ca 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,25 +7,21 @@ // 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 // // Note: -// This file doesn't contribute any code to the library. -// It is kept as a placeholder for future usage. -// This file is not compiled (as of Aug 2017) +// This file doesn't contribute any code to the library. +// It is kept as a placeholder for future usage. +// This file is not compiled (as of Aug 2017) // -// Fl_OpenGL_Graphics_Driver is implemented in several files -// named Fl_OpenGL_Graphics_Driver_*.cxx. -// This may be changed in the future. +// Fl_OpenGL_Graphics_Driver is implemented in several files +// named Fl_OpenGL_Graphics_Driver_*.cxx. +// This may be changed in the future. #include <FL/gl.h> #include "Fl_OpenGL_Graphics_Driver.H" - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx index c0fd58aea..c4efee207 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Arc (integer) drawing functions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 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 // /** @@ -66,7 +64,3 @@ void Fl_OpenGL_Graphics_Driver::pie(int x,int y,int w,int h,double a1,double a2) } glEnd(); } - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx index f6586aa85..f6fcbb8a4 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_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 // /** @@ -71,7 +69,3 @@ void Fl_OpenGL_Graphics_Driver::color(uchar r,uchar g,uchar b) { Fl_Graphics_Driver::color( fl_rgb_color(r, g, b) ); glColor3ub(r,g,b); } - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx index 59bb7b268..24ce5396b 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Standard X11 font selection code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,18 +7,18 @@ // 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 // /* This module implements a lowest-common-denominator font for OpenGL. It will always work, even if the main graphics library does not support rendering text into a texture buffer. - + The font is limited to a single face and ASCII characters. It is drawn using lines which makes it arbitrarily scalable. I am trying to keep font data really compact. @@ -215,8 +213,3 @@ void Fl_OpenGL_Graphics_Driver::text_extents(const char *str, int n, int& dx, in } #endif - - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_line_style.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_line_style.cxx index 047cfba0d..8b5bf35a1 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_line_style.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_line_style.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Line style code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 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 // /** @@ -58,7 +56,3 @@ void Fl_OpenGL_Graphics_Driver::line_style(int style, int width, char* dashes) { glEnable(GL_LINE_STIPPLE); } } - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx index a0ce203ea..049a6060a 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle 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 // @@ -185,8 +183,3 @@ void Fl_OpenGL_Graphics_Driver::restore_clip() { // TODO: implement OpenGL clipping fl_clip_state_number++; } - - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_vertex.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_vertex.cxx index 894ab35c1..0a627bea6 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_vertex.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_vertex.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Portable drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 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 // /** @@ -123,11 +121,7 @@ void Fl_OpenGL_Graphics_Driver::circle(double cx, double cy, double r) { y += ty * tangetial_factor; x *= radial_factor; y *= radial_factor; - } - glEnd(); + } + glEnd(); } - -// -// End of "$Id$". -// diff --git a/src/drivers/Pico/Fl_Pico_Graphics_Driver.H b/src/drivers/Pico/Fl_Pico_Graphics_Driver.H index 354472ee0..93550f80c 100644 --- a/src/drivers/Pico/Fl_Pico_Graphics_Driver.H +++ b/src/drivers/Pico/Fl_Pico_Graphics_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of the Pico minimal graphics driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -211,7 +209,3 @@ class Fl_Pico_Graphics_Driver : public Fl_Graphics_Driver { }; #endif // FL_PICO_GRAPHICS_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Pico/Fl_Pico_Graphics_Driver.cxx b/src/drivers/Pico/Fl_Pico_Graphics_Driver.cxx index ace311323..f6f306e78 100644 --- a/src/drivers/Pico/Fl_Pico_Graphics_Driver.cxx +++ b/src/drivers/Pico/Fl_Pico_Graphics_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle 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 // @@ -335,8 +333,8 @@ void Fl_Pico_Graphics_Driver::circle(double x, double y, double r) int i = segs; if (i) { - double epsilon = A/i; // Arc length for equal-size steps - double cos_e = cos(epsilon); // Rotation coefficients + double epsilon = A/i; // Arc length for equal-size steps + double cos_e = cos(epsilon); // Rotation coefficients double sin_e = sin(epsilon); do { double Xnew = cos_e*X + sin_e*Y; @@ -506,9 +504,3 @@ void Fl_Pico_Graphics_Driver::draw(const char *str, int n, int x, int y) x += size_*0.5; } } - - - -// -// End of "$Id$". -// diff --git a/src/drivers/Pico/Fl_Pico_Screen_Driver.H b/src/drivers/Pico/Fl_Pico_Screen_Driver.H index 5c4126668..7f03cb60f 100644 --- a/src/drivers/Pico/Fl_Pico_Screen_Driver.H +++ b/src/drivers/Pico/Fl_Pico_Screen_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Pico Screen interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -58,7 +56,3 @@ public: #endif // FL_PICO_SCREEN_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Pico/Fl_Pico_Screen_Driver.cxx b/src/drivers/Pico/Fl_Pico_Screen_Driver.cxx index 912e92144..9b316c92f 100644 --- a/src/drivers/Pico/Fl_Pico_Screen_Driver.cxx +++ b/src/drivers/Pico/Fl_Pico_Screen_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of SDL Screen interface based on Pico // // Copyright 1998-2016 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 // @@ -132,8 +130,3 @@ int Fl_Pico_Screen_Driver::has_timeout(Fl_Timeout_Handler cb, void *argp) void Fl_Pico_Screen_Driver::remove_timeout(Fl_Timeout_Handler cb, void *argp) { } - - -// -// End of "$Id$". -// diff --git a/src/drivers/Pico/Fl_Pico_System_Driver.H b/src/drivers/Pico/Fl_Pico_System_Driver.H index 740ceceb1..5e3551b4c 100644 --- a/src/drivers/Pico/Fl_Pico_System_Driver.H +++ b/src/drivers/Pico/Fl_Pico_System_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Pico system driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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_PICO_SYSTEM_DRIVER_H @@ -32,7 +30,3 @@ public: }; #endif /* FL_PICO_SYSTEM_DRIVER_H */ - -// -// End of "$Id$". -// diff --git a/src/drivers/Pico/Fl_Pico_System_Driver.cxx b/src/drivers/Pico/Fl_Pico_System_Driver.cxx index 59ace9ec4..1dfb262ab 100644 --- a/src/drivers/Pico/Fl_Pico_System_Driver.cxx +++ b/src/drivers/Pico/Fl_Pico_System_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Pico system driver // for the Fast Light Tool Kit (FLTK). // @@ -10,17 +8,12 @@ // 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_Pico_System_Driver.H" #include "../../flstring.h" - - -// -// End of "$Id$". -// diff --git a/src/drivers/Pico/Fl_Pico_Window_Driver.H b/src/drivers/Pico/Fl_Pico_Window_Driver.H index 73b361a18..9601852bb 100644 --- a/src/drivers/Pico/Fl_Pico_Window_Driver.H +++ b/src/drivers/Pico/Fl_Pico_Window_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Pico Window interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -41,7 +39,3 @@ public: #endif // FL_PICO_WINDOW_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Pico/Fl_Pico_Window_Driver.cxx b/src/drivers/Pico/Fl_Pico_Window_Driver.cxx index a9b7034af..bbff4c6aa 100644 --- a/src/drivers/Pico/Fl_Pico_Window_Driver.cxx +++ b/src/drivers/Pico/Fl_Pico_Window_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of SDL Window interface based on Pico // // 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 // @@ -46,7 +44,3 @@ int Fl_Pico_Window_Driver::decorated_h() { return h(); } - -// -// End of "$Id$". -//
\ No newline at end of file diff --git a/src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.H b/src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.H index 93af14e51..8c18fd3dd 100644 --- a/src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.H +++ b/src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.H @@ -1,7 +1,5 @@ // -// "$Id$" -// // Definition of the Pico Android graphics driver // for the Fast Light Tool Kit (FLTK). // @@ -11,11 +9,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 // /** @@ -119,7 +117,3 @@ public: }; #endif // FL_PICOANDROID_GRAPHICS_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.cxx b/src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.cxx index 2639f9a65..e398f92b4 100644 --- a/src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.cxx +++ b/src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 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 // @@ -97,9 +95,3 @@ void Fl_PicoAndroid_Graphics_Driver::point(int x, int y) glDrawArrays(GL_POINTS, 0, 1); glDisableClientState(GL_VERTEX_ARRAY); } - - - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.H b/src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.H index 3b4b9960c..1163296cf 100644 --- a/src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.H +++ b/src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android Screen interface based on Pico // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -58,7 +56,7 @@ class FL_EXPORT Fl_PicoAndroid_Screen_Driver : public Fl_Pico_Screen_Driver int32_t handleInputEvent(struct android_app* app, AInputEvent* event); void initDisplay(); void termDisplay(); - + public: void drawFrame(); @@ -66,14 +64,10 @@ public: Fl_PicoAndroid_Screen_Driver(); virtual ~Fl_PicoAndroid_Screen_Driver(); virtual double wait(double time_to_wait); - + public: void android_main(struct android_app* state); }; #endif // FL_PICOANDROID_SCREEN_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.cxx b/src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.cxx index 6ab2d5025..63b60fe1f 100644 --- a/src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.cxx +++ b/src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android Screen interface based on Pico // // 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 // // http://developer.android.com/ndk/reference/group___native_activity.html @@ -443,7 +441,7 @@ double Fl_PicoAndroid_Screen_Driver::wait(double time_to_wait) /* - The following code should not be here! + The following code should not be here! All this must be refactored into the driver system! */ @@ -458,7 +456,7 @@ Fl_Fontdesc* fl_fonts = NULL; Undefined symbols for architecture x86_64: */ -#if !defined(FL_DOXYGEN) // *FIXME* silence Doxygen warnings +#if !defined(FL_DOXYGEN) // *FIXME* silence Doxygen warnings void fl_set_spot(int, int, int, int, int, int, Fl_Window*) { } void fl_reset_spot() { } @@ -562,10 +560,3 @@ drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.o:Fl_PicoAndroid_Window_Driver. drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.o:Fl_PicoAndroid_Window_Driver.cxx:vtable for Fl_PicoAndroid_Window_Driver: error: undefined reference to 'Fl_PicoAndroid_Window_Driver::flush_overlay()' #endif - - - -// -// End of "$Id$". -// - diff --git a/src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.H b/src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.H index 47d1a584e..813c2fb5b 100644 --- a/src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.H +++ b/src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android Window interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -55,7 +53,3 @@ public: #endif // FL_PICOSDL_WINDOW_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.cxx b/src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.cxx index 0fdad34bd..ade460f8e 100644 --- a/src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.cxx +++ b/src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android Window interface based on SDL // // 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 // @@ -122,7 +120,3 @@ void Fl_PicoAndroid_Window_Driver::flush() scr->drawFrame(); } #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.H b/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.H index 7f7dbde9e..eb8944286 100644 --- a/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.H +++ b/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.H @@ -1,7 +1,5 @@ // -// "$Id$" -// // Definition of the Pico minimal SDL graphics driver // for the Fast Light Tool Kit (FLTK). // @@ -11,11 +9,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 // /** @@ -118,7 +116,3 @@ public: }; #endif // FL_PICOSDL_GRAPHICS_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx index 771a13339..a8f1d07fc 100644 --- a/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx +++ b/src/drivers/PicoSDL/Fl_PicoSDL_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 // @@ -68,9 +66,3 @@ void Fl_PicoSDL_Graphics_Driver::point(int x, int y) SDL_SetRenderDrawColor((SDL_Renderer*)fl_window, r, g, b, SDL_ALPHA_OPAQUE); SDL_RenderDrawPoint((SDL_Renderer*)fl_window, x, y); } - - - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.H b/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.H index 1dc2a85e0..54b47a182 100644 --- a/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.H +++ b/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of SDL Screen interface based on Pico // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -38,7 +36,3 @@ public: #endif // FL_PICOSDL_SCREEN_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx index abd70c4cc..10f7ecacf 100644 --- a/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx +++ b/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of SDL Screen interface based on Pico // // 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 // @@ -135,10 +133,3 @@ double Fl_PicoSDL_Screen_Driver::wait(double time_to_wait) } return 0.0; } - - - -// -// End of "$Id$". -// - diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx index 028f02324..47afd61e8 100644 --- a/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx +++ b/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // System routines for the Fast Light Tool Kit (FLTK). // // Copyright 2016 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 // @@ -30,7 +28,3 @@ Fl_System_Driver *Fl_System_Driver::newSystemDriver() { return new Fl_System_Driver(); } - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H b/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H index ef765e9c3..8714285dc 100644 --- a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H +++ b/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of SDL Window interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -44,14 +42,10 @@ public: virtual Fl_X *makeWindow(); virtual void make_current(); virtual void draw_end(); - + // --- window management // virtual void flush(); }; #endif // FL_PICOSDL_WINDOW_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx index 2335f799c..a61890243 100644 --- a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx +++ b/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of SDL Window interface based on SDL // // 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 // @@ -104,8 +102,3 @@ void Fl_PicoSDL_Window_Driver::show() { makeWindow(); } } - - -// -// End of "$Id$". -// diff --git a/src/drivers/Posix/Fl_Posix_Printer_Driver.cxx b/src/drivers/Posix/Fl_Posix_Printer_Driver.cxx index bf206070e..dbb966a76 100644 --- a/src/drivers/Posix/Fl_Posix_Printer_Driver.cxx +++ b/src/drivers/Posix/Fl_Posix_Printer_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // PostScript priting support for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2016 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 to: +// 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" @@ -54,14 +52,14 @@ public: typedef struct _GtkPrintJob GtkPrintJob; typedef struct _GtkWidget GtkWidget; struct GError; - + GtkPrintJob *pjob; // data shared between begin_job() and end_job() char tmpfilename[50]; // name of temporary PostScript file containing to-be-printed data virtual int begin_job(int pagecount = 0, int *frompage = NULL, int *topage = NULL, char **perr_message=NULL); virtual void end_job(); static bool probe_for_GTK(); static void *ptr_gtk; // points to the GTK dynamic lib or NULL - + typedef GtkPrintUnixDialog* (*gtk_print_unix_dialog_new_t)(const char*, void*); typedef int (*gtk_dialog_run_t)(GtkDialog*); typedef GtkPrintSettings *(*gtk_print_unix_dialog_get_settings_t)(GtkPrintUnixDialog*); @@ -106,7 +104,7 @@ bool Fl_GTK_Printer_Driver::probe_for_GTK() { int Fl_GTK_Printer_Driver::begin_job(int pagecount, int *firstpage, int *lastpage, char **perr_message) { enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4; enum Fl_Paged_Device::Page_Layout layout = Fl_Paged_Device::PORTRAIT ; - + GtkPrintUnixDialog *pdialog = CALL_GTK(gtk_print_unix_dialog_new)(Fl_Printer::dialog_title, NULL); //2.10 if (dlsym(ptr_gtk, "gtk_get_major_version") || !CALL_GTK(gtk_check_version)(2, 18, 0)) CALL_GTK(gtk_print_unix_dialog_set_embed_page_setup)(pdialog, true); //2.18 @@ -236,7 +234,7 @@ Fl_Paged_Device* Fl_Printer::newPrinterDriver(void) int Fl_Posix_Printer_Driver::begin_job(int pages, int *firstpage, int *lastpage, char **perr_message) { enum Fl_Paged_Device::Page_Format format; enum Fl_Paged_Device::Page_Layout layout; - + // first test version for print dialog if (!print_panel) make_print_panel(); printing_style style = print_load(); @@ -247,12 +245,12 @@ int Fl_Posix_Printer_Driver::begin_job(int pages, int *firstpage, int *lastpage, { char tmp[10]; snprintf(tmp, sizeof(tmp), "%d", pages); print_to->value(tmp); } print_panel->show(); // this is modal while (print_panel->shown()) Fl::wait(); - + if (!print_start) // user clicked cancel return 1; - + // get options - + switch (print_page_size->value()) { case 0: format = Fl_Paged_Device::LETTER; @@ -281,7 +279,7 @@ int Fl_Posix_Printer_Driver::begin_job(int pages, int *firstpage, int *lastpage, default: format = Fl_Paged_Device::A4; } - + { // page range choice int from = 1, to = pages; if (print_pages->value()) { @@ -295,29 +293,29 @@ int Fl_Posix_Printer_Driver::begin_job(int pages, int *firstpage, int *lastpage, if (lastpage) *lastpage = to; if (pages > 0) pages = to - from + 1; } - + if (print_output_mode[0]->value()) layout = Fl_Paged_Device::PORTRAIT; else if (print_output_mode[1]->value()) layout = Fl_Paged_Device::LANDSCAPE; else if (print_output_mode[2]->value()) layout = Fl_Paged_Device::PORTRAIT; else layout = Fl_Paged_Device::LANDSCAPE; - - int print_pipe = print_choice->value(); // 0 = print to file, >0 = printer (pipe) - + + int print_pipe = print_choice->value(); // 0 = print to file, >0 = printer (pipe) + const char *media = print_page_size->text(print_page_size->value()); const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data(); if (!print_pipe) printer = "<File>"; - + if (!print_pipe) // fall back to file printing return Fl_PostScript_File_Device::begin_job (pages, format, layout); - + // Print: pipe the output into the lp command... - + char command[1024]; if (style == SystemV) snprintf(command, sizeof(command), "lp -s -d %s -n %d -t '%s' -o media=%s", printer, print_collate_button->value() ? 1 : (int)(print_copies->value() + 0.5), "FLTK", media); else snprintf(command, sizeof(command), "lpr -h -P%s -#%d -T FLTK ", printer, print_collate_button->value() ? 1 : (int)(print_copies->value() + 0.5)); - + Fl_PostScript_Graphics_Driver *ps = driver(); ps->output = popen(command, "w"); if (!ps->output) { @@ -333,8 +331,3 @@ int Fl_Posix_Printer_Driver::begin_job(int pages, int *firstpage, int *lastpage, } #endif // defined(FL_CFG_PRN_PS) && !defined(FL_NO_PRINT_SUPPORT) - - -// -// End of "$Id$". -// diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.H b/src/drivers/Posix/Fl_Posix_System_Driver.H index 407fa0270..55255b83f 100644 --- a/src/drivers/Posix/Fl_Posix_System_Driver.H +++ b/src/drivers/Posix/Fl_Posix_System_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of POSIX system driver // for the Fast Light Tool Kit (FLTK). // @@ -12,9 +10,9 @@ // // 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: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -79,7 +77,3 @@ public: }; #endif // FL_POSIX_SYSTEM_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.cxx b/src/drivers/Posix/Fl_Posix_System_Driver.cxx index 0cb16e585..d39ea6c82 100644 --- a/src/drivers/Posix/Fl_Posix_System_Driver.cxx +++ b/src/drivers/Posix/Fl_Posix_System_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Darwin system driver. // // Copyright 1998-2017 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> @@ -90,7 +88,7 @@ void *Fl_Posix_System_Driver::dlopen(const char *filename) int Fl_Posix_System_Driver::file_type(const char *filename) { int filetype; - struct stat fileinfo; // Information on file + struct stat fileinfo; // Information on file if (!::stat(filename, &fileinfo)) { if (S_ISDIR(fileinfo.st_mode)) @@ -128,7 +126,3 @@ void Fl_Posix_System_Driver::gettime(time_t *sec, int *usec) { *sec = tv.tv_sec; *usec = tv.tv_usec; } - -// -// End of "$Id$". -// diff --git a/src/drivers/PostScript/Fl_PostScript.cxx b/src/drivers/PostScript/Fl_PostScript.cxx index d04b27af3..b7b10da8e 100644 --- a/src/drivers/PostScript/Fl_PostScript.cxx +++ b/src/drivers/PostScript/Fl_PostScript.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Classes Fl_PostScript_File_Device and Fl_PostScript_Graphics_Driver for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -73,7 +71,7 @@ Fl_PostScript_Graphics_Driver *Fl_PostScript_File_Device::driver() int Fl_PostScript_File_Device::begin_job (int pagecount, enum Fl_Paged_Device::Page_Format format, - enum Fl_Paged_Device::Page_Layout layout) + enum Fl_Paged_Device::Page_Layout layout) { Fl_Native_File_Chooser fnfc; fnfc.title(Fl_PostScript_File_Device::file_chooser_title); @@ -135,7 +133,7 @@ int Fl_PostScript_Graphics_Driver::clocale_printf(const char *format, ...) return retval; } -// Prolog string +// Prolog string static const char * prolog = "/L { /y2 exch def\n" @@ -201,7 +199,7 @@ static const char * prolog = "/A85RLE { /ASCII85Decode filter /RunLengthDecode filter } bind def\n" // ASCII85Decode followed by RunLengthDecode filters -// color images +// color images "/CI { GS /py exch def /px exch def /sy exch def /sx exch def\n" "translate \n" @@ -211,7 +209,7 @@ static const char * prolog = " colorimage GR\n" "} bind def\n" -// gray images +// gray images "/GI { GS /py exch def /px exch def /sy exch def /sx exch def \n" "translate \n" @@ -223,7 +221,7 @@ static const char * prolog = "image GR\n" "} bind def\n" -// single-color bitmask +// single-color bitmask "/MI { GS /py exch def /px exch def /sy exch def /sx exch def \n" "translate \n" @@ -234,7 +232,7 @@ static const char * prolog = "} bind def\n" -// path +// path "/BFP { newpath moveto } def\n" "/BP { newpath } bind def \n" @@ -243,7 +241,7 @@ static const char * prolog = "/MT { moveto } bind def \n" "/LT { lineto } bind def \n" "/EFP { closepath fill } bind def\n" //was:stroke -"/ELP { stroke } bind def\n" +"/ELP { stroke } bind def\n" "/ECP { closepath stroke } bind def\n" // Closed (loop) "/LW { setlinewidth } bind def\n" @@ -287,7 +285,7 @@ static const char * prolog_2 = // prolog relevant only if lang_level >1 "end\n" "IDD image GR} bind def\n" -// gray image dict +// gray image dict "/GII {GS /inter exch def /py exch def /px exch def /sy exch def /sx exch def \n" "translate \n" "sx sy scale\n" @@ -367,13 +365,13 @@ static const char * prolog_2 = // prolog relevant only if lang_level >1 "/Times-RomanExt /Times-Roman ToLatinExtA /Times-BoldExt /Times-Bold ToLatinExtA \n" "/Times-ItalicExt /Times-Italic ToLatinExtA /Times-BoldItalicExt /Times-BoldItalic ToLatinExtA \n" -// proc to create a Type 0 font with 2-byte encoding +// proc to create a Type 0 font with 2-byte encoding // that merges a text font with ISO encoding + same font with LatinExtA encoding "/To2byte { 6 dict begin /FontType 0 def \n" "/FDepVector 3 1 roll findfont exch findfont 2 array astore def \n" "/FontMatrix [1 0 0 1 0 0] def /FMapType 6 def /Encoding [ 0 1 0 ] def\n" // 100: Hexa count of ISO array; A7: hexa count of LatinExtA array -"/SubsVector < 01 0100 00A7 > def\n" +"/SubsVector < 01 0100 00A7 > def\n" "currentdict end definefont pop } def\n" // create Type 0 versions of standard fonts "/Helvetica2B /HelveticaExt /Helvetica To2byte \n" @@ -431,7 +429,7 @@ static const char * prolog_2_pixmap = // prolog relevant only if lang_level == static const char * prolog_3 = // prolog relevant only if lang_level >2 -// masked color images +// masked color images "/CIM {GS /inter exch def /my exch def /mx exch def /py exch def /px exch def /sy exch def /sx exch def \n" "translate \n" "sx sy scale\n" @@ -455,7 +453,7 @@ static const char * prolog_3 = // prolog relevant only if lang_level >2 "/IMD 8 dict def\n" "IMD begin\n" "/ImageType 1 def\n" -"/Width mx def\n" +"/Width mx def\n" "/Height my def\n" "/BitsPerComponent 1 def\n" // "/Interpolate inter def\n" @@ -472,7 +470,7 @@ static const char * prolog_3 = // prolog relevant only if lang_level >2 "} bind def\n" -// masked gray images +// masked gray images "/GIM {GS /inter exch def /my exch def /mx exch def /py exch def /px exch def /sy exch def /sx exch def \n" "translate \n" "sx sy scale\n" @@ -497,7 +495,7 @@ static const char * prolog_3 = // prolog relevant only if lang_level >2 "IMD begin\n" "/ImageType 1 def\n" -"/Width mx def\n" +"/Width mx def\n" "/Height my def\n" "/BitsPerComponent 1 def\n" "/ImageMatrix [ mx 0 0 my neg 0 my ] def\n" @@ -516,9 +514,9 @@ static const char * prolog_3 = // prolog relevant only if lang_level >2 "\n" ; -// end prolog +// end prolog -int Fl_PostScript_Graphics_Driver::start_postscript (int pagecount, +int Fl_PostScript_Graphics_Driver::start_postscript (int pagecount, enum Fl_Paged_Device::Page_Format format, enum Fl_Paged_Device::Page_Layout layout) //returns 0 iff OK { @@ -539,7 +537,7 @@ int Fl_PostScript_Graphics_Driver::start_postscript (int pagecount, pw_ = Fl_Paged_Device::page_formats[format].width; ph_ = Fl_Paged_Device::page_formats[format].height; } - + fputs("%!PS-Adobe-3.0\n", output); fputs("%%Creator: FLTK\n", output); if (lang_level_>1) @@ -572,12 +570,12 @@ int Fl_PostScript_Graphics_Driver::start_postscript (int pagecount, fputs("/CR { GR } bind def\n", output); } page_policy_ = 1; - - + + fputs("%%EndProlog\n",output); if (lang_level_ >= 2) fprintf(output,"<< /Policies << /Pagesize 1 >> >> setpagedevice\n"); - + reset(); nPages=0; return 0; @@ -633,13 +631,13 @@ void Fl_PostScript_Graphics_Driver::reset(){ linestyle_=FL_SOLID; strcpy(linedash_,""); Clip *c=clip_; ////just not to have memory leaks for badly writen code (forgotten clip popping) - + while(c){ clip_=clip_->prev; delete c; c=clip_; } - + } void Fl_PostScript_Graphics_Driver::page_policy(int p){ @@ -653,7 +651,7 @@ void Fl_PostScript_Graphics_Driver::page_policy(int p){ void Fl_PostScript_Graphics_Driver::page(double pw, double ph, int media) { - + if (nPages){ fprintf(output, "CR\nGR\nGR\nGR\nSP\nrestore\n"); } @@ -665,7 +663,7 @@ void Fl_PostScript_Graphics_Driver::page(double pw, double ph, int media) { }else{ fprintf(output, "%%%%PageOrientation: Portrait\n"); } - + fprintf(output, "%%%%BeginPageSetup\n"); if((media & Fl_Paged_Device::MEDIA) &&(lang_level_>1)){ int r = media & Fl_Paged_Device::REVERSED; @@ -673,31 +671,31 @@ void Fl_PostScript_Graphics_Driver::page(double pw, double ph, int media) { fprintf(output, "<< /PageSize [%i %i] /Orientation %i>> setpagedevice\n", (int)(pw+.5), (int)(ph+.5), r); } fprintf(output, "%%%%EndPageSetup\n"); - + /* pw_ = pw; ph_ = ph;*/ reset(); - + fprintf(output, "save\n"); fprintf(output, "GS\n"); clocale_printf( "%g %g TR\n", (double)0 /*lm_*/ , ph_ /* - tm_*/); fprintf(output, "1 -1 SC\n"); line_style(0); fprintf(output, "GS\n"); - + if (!((media & Fl_Paged_Device::MEDIA) &&(lang_level_>1))){ if (pw > ph) { if(media & Fl_Paged_Device::REVERSED) { fprintf(output, "-90 rotate %i 0 translate\n", int(-pw)); - } + } else { fprintf(output, "90 rotate -%i -%i translate\n", (lang_level_ == 2 ? int(pw - ph) : 0), int(ph)); - } + } } else { - if(media & Fl_Paged_Device::REVERSED) - fprintf(output, "180 rotate %i %i translate\n", int(-pw), int(-ph)); - } + if(media & Fl_Paged_Device::REVERSED) + fprintf(output, "180 rotate %i %i translate\n", int(-pw), int(-ph)); + } } fprintf(output, "GS\nCS\n"); } @@ -761,7 +759,7 @@ void Fl_PostScript_Graphics_Driver::xyline(int x, int y, int x1, int y2, int x3) void Fl_PostScript_Graphics_Driver::xyline(int x, int y, int x1, int y2){ - + fprintf(output, "GS\n"); fprintf(output,"BP\n"); fprintf(output, "%i %i MT\n", x , y); @@ -777,13 +775,13 @@ void Fl_PostScript_Graphics_Driver::xyline(int x, int y, int x1){ fprintf(output, "%i %i MT\n", x , y); fprintf(output, "%i %i LT\n", x1 , y ); fprintf(output, "ELP\n"); - + fprintf(output, "GR\n"); } void Fl_PostScript_Graphics_Driver::yxline(int x, int y, int y1, int x2, int y3){ fprintf(output, "GS\n"); - + fprintf(output,"BP\n"); fprintf(output,"%i %i MT\n", x , y); fprintf(output, "%i %i LT\n", x , y1 ); @@ -850,7 +848,7 @@ void Fl_PostScript_Graphics_Driver::polygon(int x0, int y0, int x1, int y1, int fprintf(output, "%i %i LT\n", x1 , y1 ); fprintf(output, "%i %i LT\n", x2 , y2 ); fprintf(output, "%i %i LT\n", x3 , y3 ); - + fprintf(output, "EFP\n"); fprintf(output, "GR\n"); } @@ -880,14 +878,14 @@ static const double dashes_cap[5][7]={ void Fl_PostScript_Graphics_Driver::line_style(int style, int width, char* dashes){ //line_styled_=1; - + linewidth_=width; linestyle_=style; //dashes_= dashes; if(dashes){ if(dashes != linedash_) strcpy(linedash_,dashes); - + }else linedash_[0]=0; char width0 = 0; @@ -895,22 +893,22 @@ void Fl_PostScript_Graphics_Driver::line_style(int style, int width, char* dashe width=1; //for screen drawing compatibility width0=1; } - + fprintf(output, "%i setlinewidth\n", width); - + if(!style && (!dashes || !(*dashes)) && width0) //system lines style = FL_CAP_SQUARE; - + int cap = (style &0xf00) >> 8; if(cap) cap--; fprintf(output,"%i setlinecap\n", cap); - + int join = (style & 0xf000) >> 12; - + if(join) join--; fprintf(output,"%i setlinejoin\n", join); - - + + fprintf(output, "["); if(dashes && *dashes){ while(*dashes){ @@ -925,10 +923,10 @@ void Fl_PostScript_Graphics_Driver::line_style(int style, int width, char* dashe dt++; } }else{ - + const int *ds = dashes_flat[style & 0xff]; while (*ds >= 0){ - fprintf(output, "%i ",width * (*ds)); + fprintf(output, "%i ",width * (*ds)); ds++; } } @@ -937,7 +935,7 @@ void Fl_PostScript_Graphics_Driver::line_style(int style, int width, char* dashe } static const char *_fontNames[] = { -"Helvetica2B", +"Helvetica2B", "Helvetica-Bold2B", "Helvetica-Oblique2B", "Helvetica-BoldOblique2B", @@ -1037,10 +1035,10 @@ static uchar *calc_mask(uchar *img, int w, int h, Fl_Color bg) if (r != red || g != green || b != blue) byte |= bit; bit = bit>>1; // shift bit one step to the right if (bit == 0) { // single set bit has fallen out - *q++ = byte; // enter byte in mask - byte = 0; // reset next mask byte to zero - bit = 0x80; // and this byte - } + *q++ = byte; // enter byte in mask + byte = 0; // reset next mask byte to zero + bit = 0x80; // and this byte + } } if (bit != 0x80) *q++ = byte; // enter last columns' byte in mask } @@ -1104,16 +1102,16 @@ void Fl_PostScript_Graphics_Driver::transformed_draw_extra(const char* str, int static int is_in_table(unsigned utf) { unsigned i; static unsigned extra_table_roman[] = { // unicodes/*names*/ of other characters from PostScript standard fonts - 0x192/*florin*/, 0x2C6/*circumflex*/, 0x2C7/*caron*/, + 0x192/*florin*/, 0x2C6/*circumflex*/, 0x2C7/*caron*/, 0x2D8/*breve*/, 0x2D9/*dotaccent*/, 0x2DA/*ring*/, 0x2DB/*ogonek*/, 0x2DC/*tilde*/, 0x2DD/*hungarumlaut*/, - 0x2013/*endash*/, 0x2014/*emdash*/, 0x2018/*quoteleft*/, 0x2019/*quoteright*/, - 0x201A/*quotesinglbase*/, 0x201C/*quotedblleft*/, 0x201D/*quotedblright*/, 0x201E/*quotedblbase*/, + 0x2013/*endash*/, 0x2014/*emdash*/, 0x2018/*quoteleft*/, 0x2019/*quoteright*/, + 0x201A/*quotesinglbase*/, 0x201C/*quotedblleft*/, 0x201D/*quotedblright*/, 0x201E/*quotedblbase*/, 0x2020/*dagger*/, 0x2021/*daggerdbl*/, 0x2022/*bullet*/, - 0x2026/*ellipsis*/, 0x2030/*perthousand*/, 0x2039/*guilsinglleft*/, 0x203A/*guilsinglright*/, - 0x2044/*fraction*/, 0x20AC/*Euro*/, 0x2122/*trademark*/, + 0x2026/*ellipsis*/, 0x2030/*perthousand*/, 0x2039/*guilsinglleft*/, 0x203A/*guilsinglright*/, + 0x2044/*fraction*/, 0x20AC/*Euro*/, 0x2122/*trademark*/, 0x2202/*partialdiff*/, 0x2206/*Delta*/, 0x2211/*summation*/, 0x221A/*radical*/, - 0x221E/*infinity*/, 0x2260/*notequal*/, 0x2264/*lessequal*/, - 0x2265/*greaterequal*/, + 0x221E/*infinity*/, 0x2260/*notequal*/, 0x2264/*lessequal*/, + 0x2265/*greaterequal*/, 0x25CA/*lozenge*/, 0xFB01/*fi*/, 0xFB02/*fl*/, 0xF8FF/*apple*/ }; @@ -1186,7 +1184,7 @@ void Fl_PostScript_Graphics_Driver::reconcat(){ void Fl_PostScript_Graphics_Driver::begin_points(){ fprintf(output, "GS\n"); concat(); - + fprintf(output, "BP\n"); gap_=1; shape_=POINTS; @@ -1236,7 +1234,7 @@ void Fl_PostScript_Graphics_Driver::curve(double x, double y, double x1, double else clocale_printf("%g %g LT\n", x , y); gap_=0; - + clocale_printf("%g %g %g %g %g %g curveto \n", x1 , y1 , x2 , y2 , x3 , y3); } @@ -1251,9 +1249,9 @@ void Fl_PostScript_Graphics_Driver::circle(double x, double y, double r){ // fprintf(output, "ELP\n"); fprintf(output, "GR\n"); }else - + clocale_printf("%g %g %g 0 360 arc\n", x , y , r); - + } void Fl_PostScript_Graphics_Driver::arc(double x, double y, double r, double start, double a){ @@ -1263,7 +1261,7 @@ void Fl_PostScript_Graphics_Driver::arc(double x, double y, double r, double sta clocale_printf("%g %g %g %g %g arc\n", x , y , r , -start, -a); else clocale_printf("%g %g %g %g %g arcn\n", x , y , r , -start, -a); - + } void Fl_PostScript_Graphics_Driver::arc(int x, int y, int w, int h, double a1, double a2) { @@ -1278,7 +1276,7 @@ void Fl_PostScript_Graphics_Driver::arc(int x, int y, int w, int h, double a1, d clocale_printf("%g %g SC\n", 2.0/(w-1) , 2.0/(h-1) ); clocale_printf("%g %g TR\n", -x - w/2.0 +0.5 , -y - h/2.0 +0.5); end_line(); - + // fprintf(output, "%g setlinewidth\n", 2/sqrt(w*h)); // fprintf(output, "ELP\n"); // fprintf(output, 2.0/w , 2.0/w , " SC\n"; @@ -1321,7 +1319,7 @@ void Fl_PostScript_Graphics_Driver::end_loop(){ } void Fl_PostScript_Graphics_Driver::end_polygon(){ - + gap_=1; reconcat(); fprintf(output, "EFP\n"); @@ -1350,7 +1348,7 @@ void Fl_PostScript_Graphics_Driver::push_clip(int x, int y, int w, int h) { if(lang_level_<3) recover(); clocale_printf("%g %g %i %i CL\n", clip_->x-0.5 , clip_->y-0.5 , clip_->w , clip_->h); - + } void Fl_PostScript_Graphics_Driver::push_no_clip() { @@ -1390,9 +1388,9 @@ int Fl_PostScript_Graphics_Driver::clip_box(int x, int y, int w, int h, int &X, if (y > (Y=clip_->y)) {Y=y; ret=1;} if ((x+w) < (clip_->x+clip_->w)) { W=x+w-X; - + ret=1; - + }else W = clip_->x + clip_->w - X; if(W<0){ @@ -1474,7 +1472,7 @@ void Fl_PostScript_File_Device::scale (float s_x, float s_y) ps->scale_x = s_x; ps->scale_y = s_y; ps->clocale_printf("GR GR GS %d %d TR %f %f SC %f rotate GS\n", - ps->left_margin, ps->top_margin, ps->scale_x, ps->scale_y, ps->angle); + ps->left_margin, ps->top_margin, ps->scale_x, ps->scale_y, ps->angle); } void Fl_PostScript_File_Device::rotate (float rot_angle) @@ -1482,7 +1480,7 @@ void Fl_PostScript_File_Device::rotate (float rot_angle) Fl_PostScript_Graphics_Driver *ps = driver(); ps->angle = - rot_angle; ps->clocale_printf("GR GR GS %d %d TR %f %f SC %d %d TR %f rotate GS\n", - ps->left_margin, ps->top_margin, ps->scale_x, ps->scale_y, x_offset, y_offset, ps->angle); + ps->left_margin, ps->top_margin, ps->scale_x, ps->scale_y, x_offset, y_offset, ps->angle); } void Fl_PostScript_File_Device::translate(int x, int y) @@ -1625,7 +1623,3 @@ void Fl_EPS_File_Surface::untranslate() } #endif // !defined(FL_NO_PRINT_SUPPORT) - -// -// End of "$Id$". -// diff --git a/src/drivers/PostScript/Fl_PostScript_image.cxx b/src/drivers/PostScript/Fl_PostScript_image.cxx index 7c977bdf7..43f9b36c2 100644 --- a/src/drivers/PostScript/Fl_PostScript_image.cxx +++ b/src/drivers/PostScript/Fl_PostScript_image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Postscript image drawing implementation for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 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> @@ -191,7 +189,7 @@ void Fl_PostScript_Graphics_Driver::close_rle85(void *data) // stop doing RLE+AS // End of implementation of the /RunLengthEncode + /ASCII85Encode PostScript filter // - + int Fl_PostScript_Graphics_Driver::alpha_mask(const uchar * data, int w, int h, int D, int LD){ mask = 0; @@ -405,12 +403,12 @@ void Fl_PostScript_Graphics_Driver::draw_image(Fl_Draw_Image_Cb call, void *data } else { fprintf(output , "%g %g %g %g %i %i CI", x , y+h , w , -h , iw , ih); } - + int LD=iw*D; uchar *rgbdata=new uchar[LD]; uchar *curmask=mask; void *big = prepare_rle85(); - + if (level2_mask) { for (j = ih - 1; j >= 0; j--) { // output full image data call(data, 0, j, iw, rgbdata); @@ -448,7 +446,7 @@ void Fl_PostScript_Graphics_Driver::draw_image(Fl_Draw_Image_Cb call, void *data uchar r = curdata[0]; uchar g = curdata[1]; uchar b = curdata[2]; - + if (lang_level_<3 && D>3) { //can do mixing using bg_* colors) unsigned int a2 = curdata[3]; //must be int unsigned int a = 255-a2; @@ -456,11 +454,11 @@ void Fl_PostScript_Graphics_Driver::draw_image(Fl_Draw_Image_Cb call, void *data g = (a2 * g + bg_g * a)/255; b = (a2 * b + bg_b * a)/255; } - + write_rle85(r, big); write_rle85(g, big); write_rle85(b, big); curdata +=D; } - + } } close_rle85(big); @@ -631,7 +629,3 @@ int Fl_PostScript_Graphics_Driver::scale_for_image_(Fl_Image *img, int XP, int Y } #endif // !defined(FL_DOXYGEN) && !defined(FL_NO_PRINT_SUPPORT) - -// -// End of "$Id$" -// diff --git a/src/drivers/Quartz/Fl_Font.H b/src/drivers/Quartz/Fl_Font.H index e6c56a75c..36f7e2543 100644 --- a/src/drivers/Quartz/Fl_Font.H +++ b/src/drivers/Quartz/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: @@ -46,7 +44,3 @@ public: extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.H b/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.H index 087a9fe4c..e97304fe3 100644 --- a/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.H +++ b/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Quartz graphics driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // @@ -39,7 +37,3 @@ protected: }; #endif /* Fl_Quartz_Copy_Surface_Driver_H */ - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx index bf8efceb6..a1377a556 100644 --- a/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Copy-to-clipboard code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2019 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" @@ -100,12 +98,8 @@ void Fl_Quartz_Copy_Surface_Driver::draw_decorated_window(Fl_Window *win, int x_ float s = Fl::screen_scale(win->screen_num()); CGContextScaleCTM(gc, 1/s, s >= 1 ? -1/s : -1); Fl_Cocoa_Window_Driver::draw_layer_to_context(layer, gc, win->w() * s, bt*s); - CGContextRestoreGState(gc); + CGContextRestoreGState(gc); draw(win, x_offset, y_offset + bt); // print the window inner part } #endif // FL_CFG_GFX_QUARTZ - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H index 80d0bd615..6f511c6e4 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Quartz graphics driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -162,7 +160,7 @@ protected: virtual Fl_Font set_fonts(const char* xstarname); void set_fontname_in_fontdesc(Fl_Fontdesc *f); virtual void uncache_pixmap(fl_uintptr_t p); - + #if HAS_ATSU && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 enum {use_CoreText = 1, use_ATSU}; static int CoreText_or_ATSU; @@ -196,7 +194,3 @@ public: }; #endif // FL_QUARTZ_GRAPHICS_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx index e0383cebd..4ea518c9a 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_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 // #include "../../config_lib.h" @@ -39,7 +37,7 @@ void Fl_Quartz_Graphics_Driver::init_CoreText_or_ATSU() } else { CoreText_or_ATSU = use_CoreText; CoreText_or_ATSU_draw = &Fl_Quartz_Graphics_Driver::draw_CoreText; - CoreText_or_ATSU_width = &Fl_Quartz_Graphics_Driver::width_CoreText; + CoreText_or_ATSU_width = &Fl_Quartz_Graphics_Driver::width_CoreText; } } #endif @@ -155,7 +153,3 @@ void Fl_Quartz_Graphics_Driver::XDestroyRegion(Fl_Region r) { free(r); } } - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_arci.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_arci.cxx index f20b4135d..2cc7a12e6 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_arci.cxx +++ b/src/drivers/Quartz/Fl_Quartz_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_lib.h" @@ -70,7 +68,3 @@ void Fl_Quartz_Graphics_Driver::pie(int x,int y,int w,int h,double a1,double a2) } #endif // FL_CFG_GFX_QUARTZ - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_color.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_color.cxx index 8164b9188..cd03a8c04 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_color.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_color.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // MacOS 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 // #include "../../config_lib.h" @@ -79,7 +77,3 @@ void Fl_Quartz_Graphics_Driver::set_color(Fl_Color i, unsigned c) { } #endif // FL_CFG_GFX_QUARTZ - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx index 6dcfd7ca2..c528f2721 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // MacOS font selection 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 // /* Implementation of support for two text drawing APIs: Core Text (current) and ATSU (legacy) @@ -234,9 +232,9 @@ static UniChar *mac_Utf8_to_Utf16(const char *txt, int len, int *new_len) if (wlen >= utfWlen) { utfWlen = wlen + 100; - if (utfWbuf) free(utfWbuf); + if (utfWbuf) free(utfWbuf); utfWbuf = (UniChar*)malloc((utfWlen)*sizeof(UniChar)); - wlen = fl_utf8toUtf16(txt, len, (unsigned short*)utfWbuf, utfWlen); + wlen = fl_utf8toUtf16(txt, len, (unsigned short*)utfWbuf, utfWlen); } *new_len = wlen; return utfWbuf; @@ -522,15 +520,15 @@ double Fl_Quartz_Graphics_Driver::ADD_SUFFIX(width, _CoreText)(const UniChar* tx CGSize advance_size; CGGlyph glyph; for (int j = 0; j < block; j++) { // loop over the block - // ii spans all characters of this block - bool b = CTFontGetGlyphsForCharacters(fl_fontsize->fontref, &ii, &glyph, 1); - if (b) - CTFontGetAdvancesForGlyphs(fl_fontsize->fontref, kCTFontHorizontalOrientation, &glyph, &advance_size, 1); - else - advance_size.width = -1e9; // calculate this later - // the width of one character of this block of characters - fl_fontsize->width[r][j] = advance_size.width; - ii++; + // ii spans all characters of this block + bool b = CTFontGetGlyphsForCharacters(fl_fontsize->fontref, &ii, &glyph, 1); + if (b) + CTFontGetAdvancesForGlyphs(fl_fontsize->fontref, kCTFontHorizontalOrientation, &glyph, &advance_size, 1); + else + advance_size.width = -1e9; // calculate this later + // the width of one character of this block of characters + fl_fontsize->width[r][j] = advance_size.width; + ii++; } } // sum the widths of all characters of txt @@ -542,12 +540,12 @@ double Fl_Quartz_Graphics_Driver::ADD_SUFFIX(width, _CoreText)(const UniChar* tx bool must_release = false; bool b = CTFontGetGlyphsForCharacters(font2, &uni, &glyph, 1); if (!b) { // the current font doesn't contain this char - CFStringRef str = CFStringCreateWithCharactersNoCopy(NULL, &uni, 1, kCFAllocatorNull); - // find a font that contains it - font2 = CTFontCreateForString(font2, str, CFRangeMake(0,1)); - must_release = true; - CFRelease(str); - b = CTFontGetGlyphsForCharacters(font2, &uni, &glyph, 1); + CFStringRef str = CFStringCreateWithCharactersNoCopy(NULL, &uni, 1, kCFAllocatorNull); + // find a font that contains it + font2 = CTFontCreateForString(font2, str, CFRangeMake(0,1)); + must_release = true; + CFRelease(str); + b = CTFontGetGlyphsForCharacters(font2, &uni, &glyph, 1); } if (b) CTFontGetAdvancesForGlyphs(font2, kCTFontHorizontalOrientation, &glyph, &advance_size, 1); else advance_size.width = 0.; @@ -847,13 +845,13 @@ Fl_Font Fl_Quartz_Graphics_Driver::ADD_SUFFIX(set_fonts, _ATSU)(const char* xsta for (ItemCount idx = 0; idx < oFontCount; idx++) { // ByteCount actualLength = 0; - // Ptr oName; + // Ptr oName; // How to get the name - Apples docs say call this twice, once to get the length, then again // to get the actual name... // ATSUFindFontName (oFontIDs[idx], kFontFullName, kFontMacintoshPlatform, kFontRomanScript, kFontEnglishLanguage, // 0, NULL, &actualLength, NULL); // Now actualLength tells us the length of buffer we need - // oName = (Ptr)malloc(actualLength + 8); + // oName = (Ptr)malloc(actualLength + 8); // But who's got time for that nonsense? Let's just hard code a fixed buffer (urgh!) ByteCount actualLength = 511; char oName[512]; @@ -865,7 +863,7 @@ Fl_Font Fl_Quartz_Graphics_Driver::ADD_SUFFIX(set_fonts, _ATSU)(const char* xsta else oName[actualLength] = 0; Fl::set_font((Fl_Font)(fl_free_font++), strdup(oName)); - // free(oName); + // free(oName); } free(oFontIDs); return (Fl_Font)fl_free_font; @@ -874,7 +872,3 @@ Fl_Font Fl_Quartz_Graphics_Driver::ADD_SUFFIX(set_fonts, _ATSU)(const char* xsta #endif // HAS_ATSU #endif // FL_CFG_GFX_QUARTZ - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx index 5060c2009..98c37617c 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // MacOS image drawing 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" @@ -50,8 +48,8 @@ static void dataReleaseCB(void *info, const void *data, size_t size) userdata: ? */ 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, CGContextRef gc, Fl_Quartz_Graphics_Driver *driver) + int delta, int linedelta, int mono, + Fl_Draw_Image_Cb cb, void* userdata, CGContextRef gc, Fl_Quartz_Graphics_Driver *driver) { if (!linedelta) linedelta = W*abs(delta); @@ -65,14 +63,14 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, tmpBuf = new uchar[ H*W*abs(delta) ]; if (cb) { for (int i=0; i<H; i++) { - cb(userdata, 0, i, W, tmpBuf+i*W*abs(delta)); + cb(userdata, 0, i, W, tmpBuf+i*W*abs(delta)); } } else { uchar *p = tmpBuf; for (int i=0; i<H; i++) { - memcpy(p, buf+i*abs(linedelta), W*abs(delta)); - p += W*abs(delta); - } + memcpy(p, buf+i*abs(linedelta), W*abs(delta)); + p += W*abs(delta); + } } array = (void*)tmpBuf; linedelta = W*abs(delta); @@ -86,8 +84,8 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, // a release callback is necessary when the gc is a print context because the image data // must be kept until the page is closed. Thus tmpBuf can't be deleted here. It's too early. CGDataProviderRef src = CGDataProviderCreateWithData( 0L, array, abs(linedelta)*H, - tmpBuf ? dataReleaseCB : NULL - ); + tmpBuf ? dataReleaseCB : NULL + ); CGImageRef img = CGImageCreate( W, H, 8, 8*abs(delta), abs(linedelta), lut, abs(delta)&1?kCGImageAlphaNone:kCGImageAlphaLast, src, 0L, false, kCGRenderingIntentDefault); @@ -115,14 +113,14 @@ void Fl_Quartz_Graphics_Driver::draw_image(const uchar* buf, int x, int y, int w innards(buf,x,y,w,h,d,l,(d<3&&d>-3),0,0,gc_,this); } void Fl_Quartz_Graphics_Driver::draw_image(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,y,w,h,d,0,(d<3&&d>-3),cb,data,gc_,this); } void Fl_Quartz_Graphics_Driver::draw_image_mono(const uchar* buf, int x, int y, int w, int h, int d, int l){ innards(buf,x,y,w,h,d,l,1,0,0,gc_,this); } void Fl_Quartz_Graphics_Driver::draw_image_mono(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,y,w,h,d,0,1,cb,data,gc_,this); } @@ -211,7 +209,7 @@ void Fl_Quartz_Graphics_Driver::draw_pixmap(Fl_Pixmap *pxm, int XP, int YP, int if (!*id(pxm)) { cache(pxm); } - + CGImageRef cgimg = (CGImageRef)*Fl_Graphics_Driver::id(pxm); draw_CGImage(cgimg, X,Y,W,H, cx,cy, pxm->w(), pxm->h()); } @@ -290,7 +288,3 @@ void Fl_Quartz_Graphics_Driver::draw_CGImage(CGImageRef cgimg, int x, int y, int void Fl_Quartz_Graphics_Driver::uncache_pixmap(fl_uintptr_t pixmap_ref) { CGImageRelease((CGImageRef)pixmap_ref); } - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx index 1945ea55d..8dfa3090c 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx +++ b/src/drivers/Quartz/Fl_Quartz_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 // #include "../../config_lib.h" @@ -44,7 +42,7 @@ void Fl_Quartz_Graphics_Driver::line_style(int style, int width, char* dashes) { static CGLineJoin Join[4] = { kCGLineJoinMiter, kCGLineJoinMiter, kCGLineJoinRound, kCGLineJoinBevel }; if (width<1) width = 1; - quartz_line_width_ = (float)width; + quartz_line_width_ = (float)width; quartz_line_cap_ = Cap[(style>>8)&3]; // when printing kCGLineCapSquare seems better for solid lines if ( Fl_Surface_Device::surface() != Fl_Display_Device::display_device() @@ -53,7 +51,7 @@ void Fl_Quartz_Graphics_Driver::line_style(int style, int width, char* dashes) { quartz_line_cap_ = kCGLineCapSquare; } quartz_line_join_ = Join[(style>>12)&3]; - char *d = dashes; + char *d = dashes; static CGFloat pattern[16]; if (d && *d) { CGFloat *pDst = pattern; @@ -65,7 +63,7 @@ void Fl_Quartz_Graphics_Driver::line_style(int style, int width, char* dashes) { // adjust lengths to account for cap: if (style & 0x200) { dash = char(2*width); - dot = 1; + dot = 1; gap = char(2*width-1); } else { dash = char(3*width); @@ -88,7 +86,3 @@ void Fl_Quartz_Graphics_Driver::line_style(int style, int width, char* dashes) { } #endif // FL_CFG_GFX_QUARTZ - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx index 8266f16e8..caf4277c4 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx +++ b/src/drivers/Quartz/Fl_Quartz_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 // @@ -302,7 +300,3 @@ void Fl_Quartz_Graphics_Driver::restore_clip() { #endif // FL_CFG_GFX_QUARTZ - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx index 4a63b364d..5ee8f924f 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx +++ b/src/drivers/Quartz/Fl_Quartz_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 // #include "../../config_lib.h" @@ -42,7 +40,7 @@ void Fl_Quartz_Graphics_Driver::vertex(double x,double y) { void Fl_Quartz_Graphics_Driver::end_points() { if (quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(gc_, true); - for (int i=0; i<n; i++) { + for (int i=0; i<n; i++) { CGContextMoveToPoint(gc_, p[i].x, p[i].y); CGContextAddLineToPoint(gc_, p[i].x, p[i].y); CGContextStrokePath(gc_); @@ -79,7 +77,7 @@ void Fl_Quartz_Graphics_Driver::end_polygon() { if (n<=1) return; CGContextSetShouldAntialias(gc_, true); CGContextMoveToPoint(gc_, p[0].x, p[0].y); - for (int i=1; i<n; i++) + for (int i=1; i<n; i++) CGContextAddLineToPoint(gc_, p[i].x, p[i].y); CGContextClosePath(gc_); CGContextFillPath(gc_); @@ -153,7 +151,3 @@ void Fl_Quartz_Graphics_Driver::fixloop() { // remove equal points from closed #endif // FL_CFG_GFX_QUARTZ - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx index c0ac388d0..61068cf87 100644 --- a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_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 "../../config_lib.h" @@ -76,7 +74,7 @@ Fl_Quartz_Image_Surface_Driver::Fl_Quartz_Image_Surface_Driver(int w, int h, int driver()->scale(s); } CGContextSetShouldAntialias(offscreen, false); - CGContextTranslateCTM(offscreen, 0, height); + CGContextTranslateCTM(offscreen, 0, height); CGContextScaleCTM(offscreen, 1.0f, -1.0f); CGContextSaveGState(offscreen); CGContextSetRGBFillColor(offscreen, 1, 1, 1, 0); @@ -132,7 +130,3 @@ void Fl_Quartz_Image_Surface_Driver::end_current() } #endif // FL_CFG_GFX_QUARTZ - -// -// End of "$Id$". -// diff --git a/src/drivers/SVG/Fl_SVG_File_Surface.cxx b/src/drivers/SVG/Fl_SVG_File_Surface.cxx index d6cf7f4b7..d0946da8b 100644 --- a/src/drivers/SVG/Fl_SVG_File_Surface.cxx +++ b/src/drivers/SVG/Fl_SVG_File_Surface.cxx @@ -9,9 +9,9 @@ // // 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: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Complete implementation to draw into an SVG file using the standard FLTK drawing API. @@ -157,13 +157,13 @@ Fl_SVG_Graphics_Driver::~Fl_SVG_Graphics_Driver() void Fl_SVG_Graphics_Driver::rect(int x, int y, int w, int h) { fprintf(out_, "<rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" " - "fill=\"none\" stroke=\"rgb(%u,%u,%u)\" stroke-width=\"%d\" stroke-dasharray=\"%s\"" + "fill=\"none\" stroke=\"rgb(%u,%u,%u)\" stroke-width=\"%d\" stroke-dasharray=\"%s\"" " stroke-linecap=\"%s\" stroke-linejoin=\"%s\"/>\n", x, y, w-1, h-1, red_, green_, blue_, width_, dasharray_, linecap_, linejoin_); } void Fl_SVG_Graphics_Driver::rectf(int x, int y, int w, int h) { fprintf(out_, "<rect x=\"%.3f\" y=\"%.3f\" width=\"%d\" height=\"%d\" " - "fill=\"rgb(%u,%u,%u)\" />\n", x-.5, y-.5, w, h, red_, green_, blue_); + "fill=\"rgb(%u,%u,%u)\" />\n", x-.5, y-.5, w, h, red_, green_, blue_); } void Fl_SVG_Graphics_Driver::point(int x, int y) { @@ -171,10 +171,10 @@ void Fl_SVG_Graphics_Driver::point(int x, int y) { } void Fl_SVG_Graphics_Driver::line(int x1, int y1, int x2, int y2) { - fprintf(out_, - "<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" " - "style=\"stroke:rgb(%u,%u,%u);stroke-width:%d;stroke-linecap:%s;stroke-linejoin:%s;stroke-dasharray:%s\" />\n", - x1,y1,x2,y2, red_, green_, blue_, width_, linecap_, linejoin_, dasharray_); + fprintf(out_, + "<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" " + "style=\"stroke:rgb(%u,%u,%u);stroke-width:%d;stroke-linecap:%s;stroke-linejoin:%s;stroke-dasharray:%s\" />\n", + x1,y1,x2,y2, red_, green_, blue_, width_, linecap_, linejoin_, dasharray_); } void Fl_SVG_Graphics_Driver::font_(int ft, int s) { @@ -185,7 +185,7 @@ void Fl_SVG_Graphics_Driver::font_(int ft, int s) { else family_ = "Times"; int modulo = ft % 4; int use_bold = modulo == 1 || modulo == 3; - int use_italic = modulo >= 2; + int use_italic = modulo >= 2; bold_ = ( use_bold ? " font-weight=\"bold\"" : "" ); style_ = ( use_italic ? " font-style=\"italic\"" : "" ); if (use_italic && famnum != 2) style_ = " font-style=\"oblique\""; @@ -306,11 +306,11 @@ Fl_SVG_File_Surface::Fl_SVG_File_Surface(int w, int h, FILE *f) : Fl_Widget_Surf float s = (win ? Fl::screen_scale(win->screen_num()) : 1); int sw = w * s, sh = h * s; fprintf(f, - "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n" - "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \n" - "\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n" - "<svg width=\"%dpx\" height=\"%dpx\" viewBox=\"0 0 %d %d\"\n" - "xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n", sw, sh, sw, sh); + "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n" + "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \n" + "\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n" + "<svg width=\"%dpx\" height=\"%dpx\" viewBox=\"0 0 %d %d\"\n" + "xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n", sw, sh, sw, sh); width_ = w; height_ = h; fprintf(f, "<g transform=\"scale(%f)\">\n", s); fputs("<g transform=\"translate(0,0)\">\n", f); @@ -1017,7 +1017,3 @@ void Fl_SVG_File_Surface::untranslate() {} int Fl_SVG_File_Surface::printable_rect(int *w, int *h) {return 0;} #endif // FLTK_USE_SVG - -// -// End of "$Id$". -// diff --git a/src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx index 59c15685f..2e808f1f5 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Printing support for Windows for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // 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: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../GDI/Fl_GDI_Graphics_Driver.H" @@ -72,12 +70,12 @@ Fl_WinAPI_Printer_Driver::~Fl_WinAPI_Printer_Driver(void) { static void WIN_SetupPrinterDeviceContext(HDC prHDC) { if ( !prHDC ) return; - + fl_window = 0; SetGraphicsMode(prHDC, GM_ADVANCED); // to allow for rotations SetMapMode(prHDC, MM_ANISOTROPIC); SetTextAlign(prHDC, TA_BASELINE|TA_LEFT); - SetBkMode(prHDC, TRANSPARENT); + SetBkMode(prHDC, TRANSPARENT); // this matches 720 logical units to the number of device units in 10 inches of paper // thus the logical unit is the point (= 1/72 inch) SetWindowExtEx(prHDC, 720, 720, NULL); @@ -92,7 +90,7 @@ int Fl_WinAPI_Printer_Driver::begin_job (int pagecount, int *frompage, int *topa DOCINFO di; char docName [256]; int err = 0; - + abortPrint = FALSE; memset (&pd, 0, sizeof (PRINTDLG)); pd.lStructSize = sizeof (PRINTDLG); @@ -166,7 +164,7 @@ void Fl_WinAPI_Printer_Driver::end_job (void) if (! abortPrint) { prerr = EndDoc (hPr); if (prerr < 0) { - fl_alert ("EndDoc error %d", prerr); + fl_alert ("EndDoc error %d", prerr); } } DeleteDC (hPr); @@ -184,14 +182,14 @@ void Fl_WinAPI_Printer_Driver::absolute_printable_rect(int *x, int *y, int *w, i { POINT physPageSize; POINT pixelsPerInch; - XFORM transform; - + XFORM transform; + if (hPr == NULL) return; HDC gc = (HDC)driver()->gc(); GetWorldTransform(gc, &transform); ModifyWorldTransform(gc, NULL, MWT_IDENTITY); SetWindowOrgEx(gc, 0, 0, NULL); - + physPageSize.x = GetDeviceCaps(hPr, HORZRES); physPageSize.y = GetDeviceCaps(hPr, VERTRES); DPtoLP(hPr, &physPageSize, 1); @@ -204,7 +202,7 @@ void Fl_WinAPI_Printer_Driver::absolute_printable_rect(int *x, int *y, int *w, i *w -= (pixelsPerInch.x / 2); top_margin = (pixelsPerInch.y / 4); *h -= (pixelsPerInch.y / 2); - + *x = left_margin; *y = top_margin; origin(x_offset, y_offset); @@ -231,7 +229,7 @@ int Fl_WinAPI_Printer_Driver::printable_rect(int *w, int *h) int Fl_WinAPI_Printer_Driver::begin_page (void) { int rsult, w, h; - + rsult = 0; if (hPr != NULL) { WIN_SetupPrinterDeviceContext (hPr); @@ -279,7 +277,7 @@ void Fl_WinAPI_Printer_Driver::rotate (float rot_angle) int Fl_WinAPI_Printer_Driver::end_page (void) { int rsult; - + rsult = 0; if (hPr != NULL) { prerr = EndPage (hPr); @@ -332,7 +330,3 @@ void Fl_WinAPI_Printer_Driver::origin(int *x, int *y) { Fl_Paged_Device::origin(x, y); } - -// -// End of "$Id$". -// diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H index 11a923331..2964375f1 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Windows screen interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -31,7 +29,7 @@ class Fl_Window; -class FL_EXPORT Fl_WinAPI_Screen_Driver : public Fl_Screen_Driver +class FL_EXPORT Fl_WinAPI_Screen_Driver : public Fl_Screen_Driver { protected: RECT screens[MAX_SCREENS]; @@ -97,7 +95,3 @@ public: #endif // FL_WINAPI_SCREEN_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx index f87ae8df3..f65404922 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Windows screen interface 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 // @@ -315,10 +313,10 @@ static void getsyscolor(int what, const char* arg, void (*func)(uchar,uchar,ucha void Fl_WinAPI_Screen_Driver::get_system_colors() { - if (!bg2_set) getsyscolor(COLOR_WINDOW, fl_bg2,Fl::background2); - if (!fg_set) getsyscolor(COLOR_WINDOWTEXT, fl_fg, Fl::foreground); - if (!bg_set) getsyscolor(COLOR_BTNFACE, fl_bg, Fl::background); - getsyscolor(COLOR_HIGHLIGHT, 0, set_selection_color); + if (!bg2_set) getsyscolor(COLOR_WINDOW, fl_bg2,Fl::background2); + if (!fg_set) getsyscolor(COLOR_WINDOWTEXT, fl_fg, Fl::foreground); + if (!bg_set) getsyscolor(COLOR_BTNFACE, fl_bg, Fl::background); + getsyscolor(COLOR_HIGHLIGHT, 0, set_selection_color); } @@ -484,10 +482,10 @@ int Fl_WinAPI_Screen_Driver::compose(int &del) { Fl_RGB_Image * // O - image or NULL if failed Fl_WinAPI_Screen_Driver::read_win_rectangle( - int X, // I - Left position - int Y, // I - Top position - int w, // I - Width of area to read - int h, // I - Height of area to read + int X, // I - Left position + int Y, // I - Top position + int w, // I - Width of area to read + int h, // I - Height of area to read Fl_Window *win, // I - window to capture from or NULL to capture from current offscreen bool may_capture_subwins, bool *did_capture_subwins) { @@ -505,26 +503,26 @@ Fl_WinAPI_Screen_Driver::read_win_rectangle( Fl_RGB_Image *Fl_WinAPI_Screen_Driver::read_win_rectangle_unscaled(int X, int Y, int w, int h, Fl_Window *win) { - int d = 3; // Depth of image + int d = 3; // Depth of image int alpha = 0; uchar *p = NULL; - // Allocate the image data array as needed... + // Allocate the image data array as needed... const uchar *oldp = p; if (!p) p = new uchar[w * h * d]; - + // Initialize the default colors/alpha in the whole image... memset(p, alpha, w * h * d); - + // Grab all of the pixels in the image... - + // Assure that we are not trying to read non-existing data. If it is so, the // function should still work, but the out-of-bounds part of the image is // untouched (initialized with the alpha value or 0 (black), resp.). - + int ww = w; // We need the original width for output data line size - + int shift_x = 0; // X target shift if X modified int shift_y = 0; // Y target shift if X modified - + if (X < 0) { shift_x = -X; w += X; @@ -535,64 +533,64 @@ Fl_RGB_Image *Fl_WinAPI_Screen_Driver::read_win_rectangle_unscaled(int X, int Y, h += Y; Y = 0; } - - if (h < 1 || w < 1) return 0/*p*/; // nothing to copy - - int line_size = ((3*w+3)/4) * 4; // each line is aligned on a DWORD (4 bytes) - uchar *dib = new uchar[line_size*h]; // create temporary buffer to read DIB - + + if (h < 1 || w < 1) return 0/*p*/; // nothing to copy + + int line_size = ((3*w+3)/4) * 4; // each line is aligned on a DWORD (4 bytes) + uchar *dib = new uchar[line_size*h]; // create temporary buffer to read DIB + // fill in bitmap info for GetDIBits - + BITMAPINFO bi; bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bi.bmiHeader.biWidth = w; - bi.bmiHeader.biHeight = -h; // negative => top-down DIB + bi.bmiHeader.biHeight = -h; // negative => top-down DIB bi.bmiHeader.biPlanes = 1; - bi.bmiHeader.biBitCount = 24; // 24 bits RGB + bi.bmiHeader.biBitCount = 24; // 24 bits RGB bi.bmiHeader.biCompression = BI_RGB; bi.bmiHeader.biSizeImage = 0; bi.bmiHeader.biXPelsPerMeter = 0; bi.bmiHeader.biYPelsPerMeter = 0; bi.bmiHeader.biClrUsed = 0; bi.bmiHeader.biClrImportant = 0; - + // copy bitmap from original DC (Window, Fl_Offscreen, ...) if (win && Fl_Window::current() != win) win->make_current(); HDC gc = (HDC)fl_graphics_driver->gc(); HDC hdc = CreateCompatibleDC(gc); HBITMAP hbm = CreateCompatibleBitmap(gc,w,h); - - int save_dc = SaveDC(hdc); // save context for cleanup - SelectObject(hdc,hbm); // select bitmap - BitBlt(hdc,0,0,w,h,gc,X,Y,SRCCOPY); // copy image section to DDB - + + int save_dc = SaveDC(hdc); // save context for cleanup + SelectObject(hdc,hbm); // select bitmap + BitBlt(hdc,0,0,w,h,gc,X,Y,SRCCOPY); // copy image section to DDB + // copy RGB image data to the allocated DIB - + GetDIBits(hdc, hbm, 0, h, dib, (BITMAPINFO *)&bi, DIB_RGB_COLORS); - + // finally copy the image data to the user buffer - + for (int j = 0; j<h; j++) { - const uchar *src = dib + j * line_size; // source line - uchar *tg = p + (j + shift_y) * d * ww + shift_x * d; // target line + const uchar *src = dib + j * line_size; // source line + uchar *tg = p + (j + shift_y) * d * ww + shift_x * d; // target line for (int i = 0; i<w; i++) { uchar b = *src++; uchar g = *src++; - *tg++ = *src++; // R - *tg++ = g; // G - *tg++ = b; // B + *tg++ = *src++; // R + *tg++ = g; // G + *tg++ = b; // B if (alpha) - *tg++ = alpha; // alpha + *tg++ = alpha; // alpha } } - + // free used GDI and other structures - - RestoreDC(hdc,save_dc); // reset DC + + RestoreDC(hdc,save_dc); // reset DC DeleteDC(hdc); DeleteObject(hbm); - delete[] dib; // delete DIB temporary buffer - + delete[] dib; // delete DIB temporary buffer + Fl_RGB_Image *rgb = new Fl_RGB_Image(p, w, h, d); if (!oldp) rgb->alloc_array = 1; return rgb; @@ -622,7 +620,3 @@ int Fl_WinAPI_Screen_Driver::screen_num_unscaled(int x, int y) } return screen; } - -// -// End of "$Id$". -// diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H index d4b12fc34..e6446923d 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Windows system driver for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // 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: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -117,7 +115,3 @@ public: }; #endif // FL_WINAPI_SYSTEM_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx index 10c6a7b38..ab20cfe32 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Windows system driver for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // 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: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -92,12 +90,12 @@ extern "C" { Pseudo doxygen docs (static function intentionally not documented): - param[in] utf8 input string (UTF-8) - param[in,out] wbuf in: pointer to output string buffer - out: new string (the pointer may be changed) - param[in] lg optional: input string length (default = -1) + param[in] utf8 input string (UTF-8) + param[in,out] wbuf in: pointer to output string buffer + out: new string (the pointer may be changed) + param[in] lg optional: input string length (default = -1) - returns pointer to string buffer + returns pointer to string buffer */ static wchar_t *utf8_to_wchar(const char *utf8, wchar_t *&wbuf, int lg = -1) { unsigned len = (lg >= 0) ? (unsigned)lg : (unsigned)strlen(utf8); @@ -129,11 +127,11 @@ static wchar_t *utf8_to_wchar(const char *utf8, wchar_t *&wbuf, int lg = -1) { Pseudo doxygen docs (static function intentionally not documented): - param[in] wstr input string (wide character, UTF-16) - param[in,out] utf8 in: pointer to output string buffer - out: new string (pointer may be changed) + param[in] wstr input string (wide character, UTF-16) + param[in,out] utf8 in: pointer to output string buffer + out: new string (pointer may be changed) - returns pointer to string buffer + returns pointer to string buffer */ static char *wchar_to_utf8(const wchar_t *wstr, char *&utf8) { unsigned len = (unsigned)wcslen(wstr); @@ -146,7 +144,7 @@ static char *wchar_to_utf8(const wchar_t *wstr, char *&utf8) { /* Creates a driver that manages all system related calls. - + This function must be implemented once for every platform. */ Fl_System_Driver *Fl_System_Driver::newSystemDriver() @@ -239,7 +237,7 @@ int Fl_WinAPI_System_Driver::execvp(const char *file, char *const *argv) { # else wchar_t **ar; utf8_to_wchar(file, wbuf); - + int i = 0, n = 0; while (argv[i]) {i++; n++;} ar = (wchar_t **)malloc(sizeof(wchar_t *) * (n + 1)); @@ -254,14 +252,14 @@ int Fl_WinAPI_System_Driver::execvp(const char *file, char *const *argv) { i++; } ar[n] = NULL; - _wexecvp(wbuf, ar); // STR #3040 + _wexecvp(wbuf, ar); // STR #3040 i = 0; while (i < n) { free(ar[i]); i++; } free(ar); - return -1; // STR #3040 + return -1; // STR #3040 #endif } @@ -362,7 +360,7 @@ char *fl_locale_to_utf8(const char *s, int len, UINT codepage) } if (codepage < 1) codepage = fl_codepage; buf[l] = 0; - + l = MultiByteToWideChar(codepage, 0, s, len, (WCHAR*)wbufa, buf_len); if (l < 0) l = 0; wbufa[l] = 0; @@ -503,16 +501,16 @@ int Fl_WinAPI_System_Driver::filename_expand(char *to, int tolen, const char *fr char *start = temp; char *end = temp+strlen(temp); int ret = 0; - for (char *a=temp; a<end; ) { // for each slash component + for (char *a=temp; a<end; ) { // for each slash component char *e; for (e=a; e<end && !isdirsep(*e); e++) {/*empty*/} // find next slash const char *value = 0; // this will point at substitute value switch (*a) { - case '~': // a home directory name - if (e <= a+1) { // current user's directory + case '~': // a home directory name + if (e <= a+1) { // current user's directory value = getenv("HOME"); } break; - case '$': /* an environment variable */ + case '$': /* an environment variable */ {char t = *e; *(char *)e = 0; value = getenv(a+1); *(char *)e = t;} break; } @@ -539,16 +537,16 @@ int Fl_WinAPI_System_Driver::filename_expand(char *to, int tolen, const char *fr } int // O - 0 if no change, 1 if changed -Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename +Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename int tolen, // I - Size of "to" buffer const char *from, // I - Absolute filename const char *base) // I - Find path relative to this path { - char *newslash; // Directory separator - const char *slash; // Directory separator + char *newslash; // Directory separator + const char *slash; // Directory separator char *cwd = 0L, *cwd_buf = 0L; if (base) cwd = cwd_buf = strdup(base); - + // return if "from" is not an absolute path if (from[0] == '\0' || (!isdirsep(*from) && !isalpha(*from) && from[1] != ':' && @@ -557,7 +555,7 @@ Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename if (cwd_buf) free(cwd_buf); return 0; } - + // return if "cwd" is not an absolute path if (!cwd || cwd[0] == '\0' || (!isdirsep(*cwd) && !isalpha(*cwd) && cwd[1] != ':' && @@ -566,18 +564,18 @@ Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename if (cwd_buf) free(cwd_buf); return 0; } - + // convert all backslashes into forward slashes for (newslash = strchr(cwd, '\\'); newslash; newslash = strchr(newslash + 1, '\\')) *newslash = '/'; - + // test for the exact same string and return "." if so if (!strcasecmp(from, cwd)) { strlcpy(to, ".", tolen); free(cwd_buf); return (1); } - + // test for the same drive. Return the absolute path if not if (tolower(*from & 255) != tolower(*cwd & 255)) { // Not the same drive... @@ -585,44 +583,44 @@ Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename free(cwd_buf); return 0; } - + // compare the path name without the drive prefix from += 2; cwd += 2; - + // compare both path names until we find a difference for (slash = from, newslash = cwd; *slash != '\0' && *newslash != '\0'; slash ++, newslash ++) if (isdirsep(*slash) && isdirsep(*newslash)) continue; else if (tolower(*slash & 255) != tolower(*newslash & 255)) break; - + // skip over trailing slashes if ( *newslash == '\0' && *slash != '\0' && !isdirsep(*slash) &&(newslash==cwd || !isdirsep(newslash[-1])) ) newslash--; - + // now go back to the first character of the first differing paths segment while (!isdirsep(*slash) && slash > from) slash --; if (isdirsep(*slash)) slash ++; - + // do the same for the current dir if (isdirsep(*newslash)) newslash --; if (*newslash != '\0') while (!isdirsep(*newslash) && newslash > cwd) newslash --; - + // prepare the destination buffer to[0] = '\0'; to[tolen - 1] = '\0'; - + // now add a "previous dir" sequence for every following slash in the cwd while (*newslash != '\0') { if (isdirsep(*newslash)) strlcat(to, "../", tolen); newslash ++; } - + // finally add the differing path from "from" strlcat(to, slash, tolen); - + free(cwd_buf); return 1; } @@ -668,9 +666,9 @@ int Fl_WinAPI_System_Driver::filename_absolute(char *to, int tolen, const char * int Fl_WinAPI_System_Driver::filename_isdir(const char *n) { - struct _stat s; - char fn[FL_PATH_MAX]; - int length; + struct _stat s; + char fn[FL_PATH_MAX]; + int length; length = (int) strlen(n); // This workaround brought to you by the fine folks at Microsoft! // (read lots of sarcasm in that...) @@ -711,7 +709,7 @@ const char *Fl_WinAPI_System_Driver::filename_ext(const char *buf) { int Fl_WinAPI_System_Driver::open_uri(const char *uri, char *msg, int msglen) { - if (msg) snprintf(msg, msglen, "open %s", uri); + if (msg) snprintf(msg, msglen, "open %s", uri); return (int)(ShellExecute(HWND_DESKTOP, "open", uri, NULL, NULL, SW_SHOW) > (void *)32); } @@ -734,7 +732,7 @@ int Fl_WinAPI_System_Driver::file_browser_load_filesystem(Fl_File_Browser *brows // // Normal Windows code uses drive bits... // - DWORD drives; // Drive available bits + DWORD drives; // Drive available bits drives = GetLogicalDrives(); for (int i = 'A'; i <= 'Z'; i ++, drives >>= 1) if (drives & 1) @@ -773,19 +771,19 @@ void Fl_WinAPI_System_Driver::newUUID(char *uuidBuffer) UUID ud; UUID *pu = &ud; int got_uuid = 0; - - if (!hMod) { // first time in? + + if (!hMod) { // first time in? hMod = LoadLibrary("Rpcrt4.dll"); } - - if (hMod) { // do we have a usable handle to Rpcrt4.dll? + + if (hMod) { // do we have a usable handle to Rpcrt4.dll? uuid_func uuid_crt = (uuid_func)GetProcAddress(hMod, "UuidCreate"); if (uuid_crt != NULL) { RPC_STATUS rpc_res = uuid_crt(pu); if ( // is the return status OK for our needs? - (rpc_res == RPC_S_OK) || // all is well + (rpc_res == RPC_S_OK) || // all is well (rpc_res == RPC_S_UUID_LOCAL_ONLY) || // only unique to this machine - (rpc_res == RPC_S_UUID_NO_ADDRESS) // probably only locally unique + (rpc_res == RPC_S_UUID_NO_ADDRESS) // probably only locally unique ) { got_uuid = -1; sprintf(uuidBuffer, "%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", @@ -795,14 +793,14 @@ void Fl_WinAPI_System_Driver::newUUID(char *uuidBuffer) } } } - if (got_uuid == 0) { // did not make a UUID - use fallback logic + if (got_uuid == 0) { // did not make a UUID - use fallback logic unsigned char b[16]; - time_t t = time(0); // first 4 byte + time_t t = time(0); // first 4 byte b[0] = (unsigned char)t; b[1] = (unsigned char)(t>>8); b[2] = (unsigned char)(t>>16); b[3] = (unsigned char)(t>>24); - int r = rand(); // four more bytes + int r = rand(); // four more bytes b[4] = (unsigned char)r; b[5] = (unsigned char)(r>>8); b[6] = (unsigned char)(r>>16); @@ -836,8 +834,8 @@ void Fl_WinAPI_System_Driver::newUUID(char *uuidBuffer) char *Fl_WinAPI_System_Driver::preference_rootnode(Fl_Preferences *prefs, Fl_Preferences::Root root, const char *vendor, const char *application) { -# define FLPREFS_RESOURCE "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" -# define FLPREFS_RESOURCEW L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" +# define FLPREFS_RESOURCE "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" +# define FLPREFS_RESOURCEW L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" static char *filename = 0L; // make enough room for a UTF16 pathname if (!filename) filename = (char*)::malloc(2*FL_PATH_MAX); @@ -847,7 +845,7 @@ char *Fl_WinAPI_System_Driver::preference_rootnode(Fl_Preferences *prefs, Fl_Pre DWORD nn; LONG err; HKEY key; - + switch (root&Fl_Preferences::ROOT_MASK) { case Fl_Preferences::SYSTEM: err = RegOpenKeyW( HKEY_LOCAL_MACHINE, FLPREFS_RESOURCEW, &key ); @@ -953,7 +951,3 @@ void Fl_WinAPI_System_Driver::gettime(time_t *sec, int *usec) { *sec = t.time; *usec = t.millitm * 1000; } - -// -// End of "$Id$". -// diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H index e9c35d62b..89f83a955 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Cocoa window driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -33,13 +31,13 @@ There is one window driver for each Fl_Window. Window drivers manage window actions such as resizing, events, decoration, fullscreen modes, etc. . All - drawing and rendering is managed by the Surface device and the associated + drawing and rendering is managed by the Surface device and the associated graphics driver. - window specific event handling - window types and styles, depth, etc. - decorations - + ? where do we handle the interface between OpenGL/DirectX and Cocoa/Windows/Glx? */ @@ -124,7 +122,3 @@ public: #endif // FL_WINAPI_WINDOW_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx index 09b677fff..aa20c0c7f 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Cocoa window driver. // // 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 // @@ -209,13 +207,13 @@ static HRGN bitmap2region(Fl_Image* image) { /* Does this need to be dynamically determined, perhaps? */ const int ALLOC_UNIT = 100; DWORD maxRects = ALLOC_UNIT; - + RGNDATA* pData = (RGNDATA*)malloc(sizeof(RGNDATAHEADER)+(sizeof(RECT)*maxRects)); pData->rdh.dwSize = sizeof(RGNDATAHEADER); pData->rdh.iType = RDH_RECTANGLES; pData->rdh.nCount = pData->rdh.nRgnSize = 0; SetRect(&pData->rdh.rcBound, MAXLONG, MAXLONG, 0, 0); - + const int bytesPerLine = (image->w() + 7)/8; BYTE* p, *data = (BYTE*)*image->data(); for (int y = 0; y < image->h(); y++) { @@ -374,7 +372,7 @@ void Fl_WinAPI_Window_Driver::flush_overlay() void Fl_WinAPI_Window_Driver::icons(const Fl_RGB_Image *icons[], int count) { free_icons(); - + if (count > 0) { icon_->icons = new Fl_RGB_Image*[count]; icon_->count = count; @@ -384,7 +382,7 @@ void Fl_WinAPI_Window_Driver::icons(const Fl_RGB_Image *icons[], int count) { icon_->icons[i]->normalize(); } } - + if (Fl_X::i(pWindow)) set_icons(); } @@ -419,7 +417,7 @@ void Fl_WinAPI_Window_Driver::free_icons() { void Fl_WinAPI_Window_Driver::make_current() { fl_GetDC(fl_xid(pWindow)); - + #if USE_COLORMAP // Windows maintains a hardware and software color palette; the // SelectPalette() call updates the current soft->hard mapping @@ -427,7 +425,7 @@ void Fl_WinAPI_Window_Driver::make_current() { // code does any drawing... fl_select_palette(); #endif // USE_COLORMAP - + fl_graphics_driver->clip_region(0); ((Fl_GDI_Graphics_Driver*)fl_graphics_driver)->scale(Fl::screen_driver()->scale(screen_num())); } @@ -478,7 +476,7 @@ void Fl_WinAPI_Window_Driver::hide() { } if (hide_common()) return; - + // make sure any custom icons get freed // icons(NULL, 0); // free_icons() is called by the Fl_Window destructor // this little trick keeps the current clipboard alive, even if we are about @@ -498,9 +496,9 @@ void Fl_WinAPI_Window_Driver::hide() { if (Fl::cairo_autolink_context()) Fl::cairo_make_current((Fl_Window*) 0); # endif } - + if (ip->region) Fl_Graphics_Driver::default_driver().XDestroyRegion(ip->region); - + // this little trickery seems to avoid the popup window stacking problem HWND p = GetForegroundWindow(); if (p==GetParent(ip->xid)) { @@ -541,19 +539,19 @@ void Fl_WinAPI_Window_Driver::make_fullscreen(int X, int Y, int W, int H) { Fl_Window *w = pWindow; int top, bottom, left, right; int sx, sy, sw, sh; - + top = fullscreen_screen_top(); bottom = fullscreen_screen_bottom(); left = fullscreen_screen_left(); right = fullscreen_screen_right(); - + if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) { top = screen_num(); bottom = top; left = top; right = top; } - + Fl::screen_xywh(sx, sy, sw, sh, top); Y = sy; Fl::screen_xywh(sx, sy, sw, sh, bottom); @@ -562,11 +560,11 @@ void Fl_WinAPI_Window_Driver::make_fullscreen(int X, int Y, int W, int H) { X = sx; Fl::screen_xywh(sx, sy, sw, sh, right); W = sx + sw - X; - + DWORD flags = GetWindowLong(fl_xid(w), GWL_STYLE); flags = flags & ~(WS_THICKFRAME|WS_CAPTION); SetWindowLong(fl_xid(w), GWL_STYLE, flags); - + // SWP_NOSENDCHANGING is so that we can override size limits float s = Fl::screen_driver()->scale(screen_num()); SetWindowPos(fl_xid(w), HWND_TOP, X*s, Y*s, W*s, H*s, SWP_NOSENDCHANGING | SWP_FRAMECHANGED); @@ -709,7 +707,3 @@ void Fl_WinAPI_Window_Driver::resize_after_screen_change(void *data) { const Fl_Image* Fl_WinAPI_Window_Driver::shape() { return shape_data_ ? shape_data_->shape_ : NULL; } - -// -// End of "$Id$". -// diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.H b/src/drivers/X11/Fl_X11_Screen_Driver.H index 09b043c71..c25337e0f 100644 --- a/src/drivers/X11/Fl_X11_Screen_Driver.H +++ b/src/drivers/X11/Fl_X11_Screen_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of X11 Screen interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -31,7 +29,7 @@ class Fl_Window; -class FL_EXPORT Fl_X11_Screen_Driver : public Fl_Screen_Driver +class FL_EXPORT Fl_X11_Screen_Driver : public Fl_Screen_Driver { friend class Fl_Screen_Driver; protected: @@ -59,7 +57,7 @@ public: virtual void desktop_scale_factor(); int screen_num_unscaled(int x, int y); #endif - + static int ewmh_supported(); static void copy_image(const unsigned char* data, int W, int H, int destination); // --- display management @@ -108,7 +106,3 @@ public: #endif // FL_X11_SCREEN_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx index b93d22ac6..a09768975 100644 --- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of X11 Screen interface // // 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 // @@ -109,7 +107,7 @@ static double missed_timeout_by; /** Creates a driver that manages all screen and display related calls. - + This function must be implemented once for every platform. */ Fl_Screen_Driver *Fl_Screen_Driver::newScreenDriver() @@ -197,7 +195,7 @@ int Fl_X11_Screen_Driver::visual(int flags) static int fl_workarea_xywh[4] = { -1, -1, -1, -1 }; -void Fl_X11_Screen_Driver::init_workarea() +void Fl_X11_Screen_Driver::init_workarea() { Atom actual; unsigned long count, remaining; @@ -323,8 +321,8 @@ void Fl_X11_Screen_Driver::init() { screens[i].width = xsi[i].width; screens[i].height = xsi[i].height; if (dpi_by_randr) { - dpi[i][0] = dpih; - dpi[i][1] = dpiv; + dpi[i][0] = dpih; + dpi[i][1] = dpiv; } else { int mm = DisplayWidthMM(fl_display, fl_screen); dpi[i][0] = mm ? screens[i].width*25.4f/mm : 0.0f; @@ -350,13 +348,13 @@ void Fl_X11_Screen_Driver::init() { screens[i].scale = 1; #endif if (dpi_by_randr) { - dpi[i][0] = dpih; - dpi[i][1] = dpiv; + dpi[i][0] = dpih; + dpi[i][1] = dpiv; } else { - int mm = DisplayWidthMM(fl_display, i); - dpi[i][0] = mm ? screens[i].width*25.4f/mm : 0.0f; - mm = DisplayHeightMM(fl_display, fl_screen); - dpi[i][1] = mm ? screens[i].height*25.4f/mm : 0.0f; + int mm = DisplayWidthMM(fl_display, i); + dpi[i][0] = mm ? screens[i].width*25.4f/mm : 0.0f; + mm = DisplayHeightMM(fl_display, fl_screen); + dpi[i][1] = mm ? screens[i].height*25.4f/mm : 0.0f; } } } @@ -533,8 +531,8 @@ void Fl_X11_Screen_Driver::grab(Fl_Window* win) GrabModeAsync, fl_event_time); } - Fl::grab_ = win; // FIXME: Fl::grab_ "should be private", but we need - // a way to *set* the variable from the driver! + Fl::grab_ = win; // FIXME: Fl::grab_ "should be private", but we need + // a way to *set* the variable from the driver! } else { if (Fl::grab()) { // We must keep the grab in the non-EWMH fullscreen case @@ -545,8 +543,8 @@ void Fl_X11_Screen_Driver::grab(Fl_Window* win) // this flush is done in case the picked menu item goes into // an infinite loop, so we don't leave the X server locked up: XFlush(fl_display); - Fl::grab_ = 0; // FIXME: Fl::grab_ "should be private", but we need - // a way to *set* the variable from the driver! + Fl::grab_ = 0; // FIXME: Fl::grab_ "should be private", but we need + // a way to *set* the variable from the driver! fl_fix_focus(); } } @@ -602,11 +600,11 @@ void Fl_X11_Screen_Driver::get_system_colors() if (Fl::first_window()) key1 = Fl::first_window()->xclass(); if (!key1) key1 = "fltk"; if (!bg2_set) - getsyscolor("Text","background", fl_bg2, "#ffffff", Fl::background2); + getsyscolor("Text","background", fl_bg2, "#ffffff", Fl::background2); if (!fg_set) - getsyscolor(key1, "foreground", fl_fg, "#000000", Fl::foreground); + getsyscolor(key1, "foreground", fl_fg, "#000000", Fl::foreground); if (!bg_set) - getsyscolor(key1, "background", fl_bg, "#c0c0c0", Fl::background); + getsyscolor(key1, "background", fl_bg, "#c0c0c0", Fl::background); getsyscolor("Text", "selectBackground", 0, "#000080", set_selection_color); } @@ -670,8 +668,8 @@ int Fl_X11_Screen_Driver::has_timeout(Fl_Timeout_Handler cb, void *argp) { Removes a timeout callback. It is harmless to remove a timeout callback that no longer exists. - \note This version removes all matching timeouts, not just the first one. - This may change in the future. + \note This version removes all matching timeouts, not just the first one. + This may change in the future. */ void Fl_X11_Screen_Driver::remove_timeout(Fl_Timeout_Handler cb, void *argp) { for (Timeout** p = &first_timeout; *p;) { @@ -720,7 +718,7 @@ fl_subimage_offsets(int a, int aw, int b, int bw, int &obw) { int off; int ob; - + if (b >= a) { ob = b; off = 0; @@ -728,15 +726,15 @@ fl_subimage_offsets(int a, int aw, int b, int bw, int &obw) ob = a; off = a - b; } - + bw -= off; - + if (ob + bw <= a + aw) { obw = bw; } else { obw = (a + aw) - ob; } - + return off; } @@ -750,23 +748,23 @@ extern "C" { Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int h, Fl_Window *win, bool may_capture_subwins, bool *did_capture_subwins) { - XImage *image; // Captured image - int i, maxindex; // Looping vars - int x, y; // Current X & Y in image - int d; // Depth of image - unsigned char *line, // Array to hold image row - *line_ptr; // Pointer to current line image - unsigned char *pixel; // Current color value - XColor colors[4096]; // Colors from the colormap... - unsigned char cvals[4096][3]; // Color values from the colormap... - unsigned index_mask, - index_shift, - red_mask, - red_shift, - green_mask, - green_shift, - blue_mask, - blue_shift; + XImage *image; // Captured image + int i, maxindex; // Looping vars + int x, y; // Current X & Y in image + int d; // Depth of image + unsigned char *line, // Array to hold image row + *line_ptr; // Pointer to current line image + unsigned char *pixel; // Current color value + XColor colors[4096]; // Colors from the colormap... + unsigned char cvals[4096][3]; // Color values from the colormap... + unsigned index_mask, + index_shift, + red_mask, + red_shift, + green_mask, + green_shift, + blue_mask, + blue_shift; // // Under X11 we have the option of the XGetImage() interface or SGI's // ReadDisplay extension which does all of the really hard work for @@ -774,12 +772,12 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int // int allow_outside = w < 0; // negative w allows negative X or Y, that is, window frame if (w < 0) w = - w; - + Window xid = (win && !allow_outside ? fl_xid(win) : fl_window); float s = allow_outside ? Fl::screen_driver()->scale(win->screen_num()) : Fl_Surface_Device::surface()->driver()->scale(); int ws = w * s, hs = h * s, Xs = X*s, Ys = Y*s; - + # ifdef __sgi if (XReadDisplayQueryExtension(fl_display, &i, &i)) { image = XReadDisplay(fl_display, xid, Xs, Ys, ws, hs, 0, NULL); @@ -787,12 +785,12 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int # else image = 0; # endif // __sgi - + if (!image) { // fetch absolute coordinates int dx, dy, sx, sy, sw, sh; Window child_win; - + if (win) { XTranslateCoordinates(fl_display, xid, RootWindow(fl_display, fl_screen), Xs, Ys, &dx, &dy, &child_win); @@ -821,7 +819,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int noffx = fl_subimage_offsets(sx, sw, dx, ws, nw); noffy = fl_subimage_offsets(sy, sh, dy, hs, nh); if (nw <= 0 || nh <= 0) return 0; - + // allocate the image int bpp = fl_visual->depth + ((fl_visual->depth / 8) % 2) * 8; char* buf = (char*)malloc((bpp / 8) * ws * hs); @@ -831,7 +829,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int if (buf) free(buf); return 0; } - + XErrorHandler old_handler = XSetErrorHandler(xgetimageerrhandler); XImage *subimg = XGetSubImage(fl_display, xid, Xs + noffx, Ys + noffy, nw, nh, AllPlanes, ZPixmap, image, noffx, noffy); @@ -842,13 +840,13 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int } } } - + if (!image) return 0; if (s != 1) { w = ws; h = hs; } - + #ifdef DEBUG printf("width = %d\n", image->width); printf("height = %d\n", image->height); @@ -867,23 +865,23 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int printf("blue_mask = %08x\n", image->blue_mask); printf("map_entries = %d\n", fl_visual->visual->map_entries); #endif // DEBUG - + d = 3; uchar *p = NULL; // Allocate the image data array as needed... const uchar *oldp = p; if (!p) p = new uchar[w * h * d]; - + // Initialize the default colors/alpha in the whole image... memset(p, 0, w * h * d); - + // Check that we have valid mask/shift values... if (!image->red_mask && image->bits_per_pixel > 12) { // Greater than 12 bits must be TrueColor... image->red_mask = fl_visual->visual->red_mask; image->green_mask = fl_visual->visual->green_mask; image->blue_mask = fl_visual->visual->blue_mask; - + #ifdef DEBUG // Defined in Fl_Xlib_Graphics_Driver_color.cxx extern uchar fl_redmask, fl_greenmask, fl_bluemask; @@ -900,27 +898,27 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int printf("blue_mask = %08x\n", image->blue_mask); #endif // DEBUG } - + // Check if we have colormap image... if (!image->red_mask) { // Get the colormap entries for this window... maxindex = fl_visual->visual->map_entries; - + for (i = 0; i < maxindex; i ++) colors[i].pixel = i; - + XQueryColors(fl_display, fl_colormap, colors, maxindex); - + for (i = 0; i < maxindex; i ++) { cvals[i][0] = colors[i].red >> 8; cvals[i][1] = colors[i].green >> 8; cvals[i][2] = colors[i].blue >> 8; } - + // Read the pixels and output an RGB image... for (y = 0; y < image->height; y ++) { pixel = (unsigned char *)(image->data + y * image->bytes_per_line); line = p + y * w * d; - + switch (image->bits_per_pixel) { case 1 : for (x = image->width, line_ptr = line, index_mask = 128; @@ -935,7 +933,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int line_ptr[1] = cvals[0][1]; line_ptr[2] = cvals[0][2]; } - + if (index_mask > 1) { index_mask >>= 1; } else { @@ -944,17 +942,17 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int } } break; - + case 2 : for (x = image->width, line_ptr = line, index_shift = 6; x > 0; x --, line_ptr += d) { i = (*pixel >> index_shift) & 3; - + line_ptr[0] = cvals[i][0]; line_ptr[1] = cvals[i][1]; line_ptr[2] = cvals[i][2]; - + if (index_shift > 0) { index_shift -= 2; } else { @@ -963,18 +961,18 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int } } break; - + case 4 : for (x = image->width, line_ptr = line, index_shift = 4; x > 0; x --, line_ptr += d) { if (index_shift == 4) i = (*pixel >> 4) & 15; else i = *pixel & 15; - + line_ptr[0] = cvals[i][0]; line_ptr[1] = cvals[i][1]; line_ptr[2] = cvals[i][2]; - + if (index_shift > 0) { index_shift = 0; } else { @@ -983,7 +981,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int } } break; - + case 8 : for (x = image->width, line_ptr = line; x > 0; @@ -993,7 +991,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int line_ptr[2] = cvals[*pixel][2]; } break; - + case 12 : for (x = image->width, line_ptr = line, index_shift = 0; x > 0; @@ -1003,11 +1001,11 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int } else { i = ((pixel[1] << 8) | pixel[2]) & 4095; } - + line_ptr[0] = cvals[i][0]; line_ptr[1] = cvals[i][1]; line_ptr[2] = cvals[i][2]; - + if (index_shift == 0) { index_shift = 4; } else { @@ -1022,46 +1020,46 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int // RGB(A) image, so figure out the shifts & masks... red_mask = image->red_mask; red_shift = 0; - + while ((red_mask & 1) == 0) { red_mask >>= 1; red_shift ++; } - + green_mask = image->green_mask; green_shift = 0; - + while ((green_mask & 1) == 0) { green_mask >>= 1; green_shift ++; } - + blue_mask = image->blue_mask; blue_shift = 0; - + while ((blue_mask & 1) == 0) { blue_mask >>= 1; blue_shift ++; } - + // Read the pixels and output an RGB image... for (y = 0; y < image->height; y ++) { pixel = (unsigned char *)(image->data + y * image->bytes_per_line); line = p + y * w * d; - + switch (image->bits_per_pixel) { case 8 : for (x = image->width, line_ptr = line; x > 0; x --, line_ptr += d, pixel ++) { i = *pixel; - + line_ptr[0] = 255 * ((i >> red_shift) & red_mask) / red_mask; line_ptr[1] = 255 * ((i >> green_shift) & green_mask) / green_mask; line_ptr[2] = 255 * ((i >> blue_shift) & blue_mask) / blue_mask; } break; - + case 12 : for (x = image->width, line_ptr = line, index_shift = 0; x > 0; @@ -1071,11 +1069,11 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int } else { i = ((pixel[1] << 8) | pixel[2]) & 4095; } - + line_ptr[0] = 255 * ((i >> red_shift) & red_mask) / red_mask; line_ptr[1] = 255 * ((i >> green_shift) & green_mask) / green_mask; line_ptr[2] = 255 * ((i >> blue_shift) & blue_mask) / blue_mask; - + if (index_shift == 0) { index_shift = 4; } else { @@ -1084,7 +1082,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int } } break; - + case 16 : if (image->byte_order == LSBFirst) { // Little-endian... @@ -1092,7 +1090,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int x > 0; x --, line_ptr += d, pixel += 2) { i = (pixel[1] << 8) | pixel[0]; - + line_ptr[0] = 255 * ((i >> red_shift) & red_mask) / red_mask; line_ptr[1] = 255 * ((i >> green_shift) & green_mask) / green_mask; line_ptr[2] = 255 * ((i >> blue_shift) & blue_mask) / blue_mask; @@ -1103,14 +1101,14 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int x > 0; x --, line_ptr += d, pixel += 2) { i = (pixel[0] << 8) | pixel[1]; - + line_ptr[0] = 255 * ((i >> red_shift) & red_mask) / red_mask; line_ptr[1] = 255 * ((i >> green_shift) & green_mask) / green_mask; line_ptr[2] = 255 * ((i >> blue_shift) & blue_mask) / blue_mask; } } break; - + case 24 : if (image->byte_order == LSBFirst) { // Little-endian... @@ -1118,7 +1116,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int x > 0; x --, line_ptr += d, pixel += 3) { i = (((pixel[2] << 8) | pixel[1]) << 8) | pixel[0]; - + line_ptr[0] = 255 * ((i >> red_shift) & red_mask) / red_mask; line_ptr[1] = 255 * ((i >> green_shift) & green_mask) / green_mask; line_ptr[2] = 255 * ((i >> blue_shift) & blue_mask) / blue_mask; @@ -1129,14 +1127,14 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int x > 0; x --, line_ptr += d, pixel += 3) { i = (((pixel[0] << 8) | pixel[1]) << 8) | pixel[2]; - + line_ptr[0] = 255 * ((i >> red_shift) & red_mask) / red_mask; line_ptr[1] = 255 * ((i >> green_shift) & green_mask) / green_mask; line_ptr[2] = 255 * ((i >> blue_shift) & blue_mask) / blue_mask; } } break; - + case 32 : if (image->byte_order == LSBFirst) { // Little-endian... @@ -1144,7 +1142,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int x > 0; x --, line_ptr += d, pixel += 4) { i = (((((pixel[3] << 8) | pixel[2]) << 8) | pixel[1]) << 8) | pixel[0]; - + line_ptr[0] = 255 * ((i >> red_shift) & red_mask) / red_mask; line_ptr[1] = 255 * ((i >> green_shift) & green_mask) / green_mask; line_ptr[2] = 255 * ((i >> blue_shift) & blue_mask) / blue_mask; @@ -1155,7 +1153,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int x > 0; x --, line_ptr += d, pixel += 4) { i = (((((pixel[0] << 8) | pixel[1]) << 8) | pixel[2]) << 8) | pixel[3]; - + line_ptr[0] = 255 * ((i >> red_shift) & red_mask) / red_mask; line_ptr[1] = 255 * ((i >> green_shift) & green_mask) / green_mask; line_ptr[2] = 255 * ((i >> blue_shift) & blue_mask) / blue_mask; @@ -1165,10 +1163,10 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int } } } - + // Destroy the X image we've read and return the RGB(A) image... XDestroyImage(image); - + Fl_RGB_Image *rgb = new Fl_RGB_Image(p, w, h, d); if (!oldp) rgb->alloc_array = 1; return rgb; @@ -1191,7 +1189,7 @@ int Fl_X11_Screen_Driver::screen_num_unscaled(int x, int y) { int screen = -1; if (num_screens < 0) init(); - + for (int i = 0; i < num_screens; i ++) { int sx = screens[i].x_org, sy = screens[i].y_org, sw = screens[i].width, sh = screens[i].height; if ((x >= sx) && (x < (sx+sw)) && (y >= sy) && (y < (sy+sh))) { @@ -1247,7 +1245,7 @@ static void* value_of_key_in_schema(const char **known, const char *schema, cons // in the gsettings database. /* returns true under Ubuntu or Debian or FreeBSD and when the gnome scaling value has been found - + Ubuntu: Change the gnome scaling factor with: System Settings ==> Displays ==> Scale for menu and title bars @@ -1255,10 +1253,10 @@ static void* value_of_key_in_schema(const char **known, const char *schema, cons gsettings get com.ubuntu.user-interface scale-factor Example value: {'VGA-0': 10} Its type is "a{si}". This value should be divided by 8 to get the correct scaling factor. - + In Ubuntu 18, file $HOME/.config/monitors.xml contains the gnome scaling factor value, and FLTK reads that. - + Debian or FreeBSD : Change the gnome scaling factor with: Tweak tools ==> Windows ==> Window scaling @@ -1266,19 +1264,19 @@ static void* value_of_key_in_schema(const char **known, const char *schema, cons gsettings get org.gnome.settings-daemon.plugins.xsettings overrides Example value: {'Gdk/WindowScalingFactor': <2>} Its type is "a{sv}" and v itself is of type i - + It's also possible to use 'Tweak tools' under Ubuntu. With the standard Ubuntu desktop, the modified value goes to "org.gnome.settings-daemon.plugins.xsettings" as above. - + With Gnome session flashback under Ubuntu 'Tweak tools' puts the scaling value (1 or 2) in "org.gnome.desktop.interface scaling-factor". Read the current gnome scaling factor with: gsettings get org.gnome.desktop.interface scaling-factor Its type is "u" - - Thus, under Ubuntu, we read the 3 possible factor values and + + Thus, under Ubuntu, we read the 3 possible factor values and return the first value different from 1 to get the scaling factor. - + ================================================================================================= Ubuntu | default ubuntu desktop | System Settings => Displays => Scale for menu and title bars com.ubuntu.user-interface scale-factor @@ -1303,12 +1301,12 @@ static void* value_of_key_in_schema(const char **known, const char *schema, cons void *gobj = dlopen("libgobject-2.0.so", RTLD_LAZY); //fprintf(stderr,"glib=%p gio=%p gobj=%p\n",glib,gio,gobj); if (!glib || !gio || !gobj) return false; - + // define pters to used functions and variables g_settings_list_schemas_ftype g_settings_list_schemas_f = (g_settings_list_schemas_ftype)dlsym(gio, "g_settings_list_schemas"); // 2.26 g_settings_new_f = (g_settings_new_ftype)dlsym(gio, "g_settings_new"); // 2.26 g_settings_get_value_f = - (g_settings_get_value_ftype)dlsym(gio, "g_settings_get_value"); // 2.26 + (g_settings_get_value_ftype)dlsym(gio, "g_settings_get_value"); // 2.26 if (!g_settings_list_schemas_f || !g_settings_new_f || !g_settings_get_value_f) return false; g_variant_get_ftype g_variant_get_f = (g_variant_get_ftype)dlsym(glib, "g_variant_get"); //2.24 g_variant_iter_loop_ftype g_variant_iter_loop_f = (g_variant_iter_loop_ftype)dlsym(glib, "g_variant_iter_loop"); // 2.24 @@ -1320,7 +1318,7 @@ static void* value_of_key_in_schema(const char **known, const char *schema, cons //g_variant_get_type_ftype g_variant_get_type_f = (g_variant_get_type_ftype)dlsym(glib, "g_variant_get_type"); // 2.24 const unsigned *glib_major_version = (const unsigned *)dlsym(glib, "glib_major_version"); const unsigned *glib_minor_version = (const unsigned *)dlsym(glib, "glib_minor_version"); - + // call dynamic lib functions if (*glib_major_version * 1000 + *glib_minor_version < 2036) { typedef void (*init_ftype)(void); @@ -1331,7 +1329,7 @@ static void* value_of_key_in_schema(const char **known, const char *schema, cons float ubuntu_f = 1, ubuntu_desktop_f = 1, gnome_f = 1; bool found = false; void *gvar; - + bool ubuntu = false; // determine whether we run Ubuntu char line[400] = ""; @@ -1341,7 +1339,7 @@ static void* value_of_key_in_schema(const char **known, const char *schema, cons fclose(in); if (s && strstr(line, "Ubuntu")) ubuntu = true; } - + if (ubuntu) { gvar = value_of_key_in_schema(known, "com.ubuntu.user-interface", "scale-factor"); if (gvar) { @@ -1419,7 +1417,3 @@ void Fl_X11_Screen_Driver::desktop_scale_factor() } #endif // USE_XFT - -// -// End of "$Id$". -// diff --git a/src/drivers/X11/Fl_X11_System_Driver.H b/src/drivers/X11/Fl_X11_System_Driver.H index 138959d75..7c2306a28 100644 --- a/src/drivers/X11/Fl_X11_System_Driver.H +++ b/src/drivers/X11/Fl_X11_System_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Posix system driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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_X11_SYSTEM_DRIVER_H @@ -46,7 +44,7 @@ public: virtual void newUUID(char *uuidBuffer); virtual char *preference_rootnode(Fl_Preferences *prefs, Fl_Preferences::Root root, const char *vendor, const char *application); - virtual int preferences_need_protection_check() {return 1;} + virtual int preferences_need_protection_check() {return 1;} virtual int utf8locale(); // this one is in Fl_own_colormap.cxx virtual void own_colormap(); @@ -70,7 +68,3 @@ public: }; #endif /* FL_X11_SYSTEM_DRIVER_H */ - -// -// End of "$Id$". -// diff --git a/src/drivers/X11/Fl_X11_System_Driver.cxx b/src/drivers/X11/Fl_X11_System_Driver.cxx index 4914c1a29..0714ff753 100644 --- a/src/drivers/X11/Fl_X11_System_Driver.cxx +++ b/src/drivers/X11/Fl_X11_System_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Posix system driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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_X11_System_Driver.H" @@ -65,7 +63,7 @@ extern "C" { /** Creates a driver that manages all system related calls. - + This function must be implemented once for every platform. */ Fl_System_Driver *Fl_System_Driver::newSystemDriver() @@ -92,33 +90,33 @@ int Fl_X11_System_Driver::clocale_printf(FILE *output, const char *format, va_li // Find a program in the path... static char *path_find(const char *program, char *filename, int filesize) { - const char *path; // Search path - char *ptr, // Pointer into filename - *end; // End of filename buffer - - + const char *path; // Search path + char *ptr, // Pointer into filename + *end; // End of filename buffer + + if ((path = fl_getenv("PATH")) == NULL) path = "/bin:/usr/bin"; - + for (ptr = filename, end = filename + filesize - 1; *path; path ++) { if (*path == ':') { if (ptr > filename && ptr[-1] != '/' && ptr < end) *ptr++ = '/'; - + strlcpy(ptr, program, end - ptr + 1); - + if (!access(filename, X_OK)) return filename; - + ptr = filename; } else if (ptr < end) *ptr++ = *path; } - + if (ptr > filename) { if (ptr[-1] != '/' && ptr < end) *ptr++ = '/'; - + strlcpy(ptr, program, end - ptr + 1); - + if (!access(filename, X_OK)) return filename; } - + return 0; } @@ -136,10 +134,10 @@ int Fl_X11_System_Driver::open_uri(const char *uri, char *msg, int msglen) // Note that we specifically do not support the MAILER and // BROWSER environment variables because we have no idea whether // we need to run the listed commands in a terminal program. - char command[FL_PATH_MAX], // Command to run... - *argv[4], // Command-line arguments - remote[1024]; // Remote-mode command... - const char * const *commands; // Array of commands to check... + char command[FL_PATH_MAX], // Command to run... + *argv[4], // Command-line arguments + remote[1024]; // Remote-mode command... + const char * const *commands; // Array of commands to check... int i; static const char * const browsers[] = { "xdg-open", // Portland @@ -170,35 +168,35 @@ int Fl_X11_System_Driver::open_uri(const char *uri, char *msg, int msglen) "konqueror", // KDE NULL }; - + // Figure out which commands to check for... if (!strncmp(uri, "file://", 7)) commands = managers; else if (!strncmp(uri, "mailto:", 7) || !strncmp(uri, "news:", 5)) commands = readers; else commands = browsers; - + // Find the command to run... for (i = 0; commands[i]; i ++) if (path_find(commands[i], command, sizeof(command))) break; - + if (!commands[i]) { if (msg) { snprintf(msg, msglen, "No helper application found for \"%s\"", uri); } - + return 0; } - + // Handle command-specific arguments... argv[0] = (char *)commands[i]; - + if (!strcmp(commands[i], "firefox") || !strcmp(commands[i], "mozilla") || !strcmp(commands[i], "netscape") || !strcmp(commands[i], "thunderbird")) { // program -remote openURL(uri) snprintf(remote, sizeof(remote), "openURL(%s)", uri); - + argv[1] = (char *)"-remote"; argv[2] = remote; argv[3] = 0; @@ -212,16 +210,16 @@ int Fl_X11_System_Driver::open_uri(const char *uri, char *msg, int msglen) argv[1] = (char *)uri; argv[2] = 0; } - + if (msg) { strlcpy(msg, argv[0], msglen); - + for (i = 1; argv[i]; i ++) { strlcat(msg, " ", msglen); strlcat(msg, argv[i], msglen); } } - + return run_program(command, argv, msg, msglen) != 0; } @@ -236,7 +234,7 @@ int Fl_X11_System_Driver::file_browser_load_filesystem(Fl_File_Browser *browser, int res = -1, len; char *list = NULL, *name; struct vmount *vp; - + // We always have the root filesystem add("/", icon); // Get the required buffer size for the vmount structures @@ -274,7 +272,7 @@ int Fl_X11_System_Driver::file_browser_load_filesystem(Fl_File_Browser *browser, // http://www.daemon-systems.org/man/getmntinfo.3.html int res = -1; struct statvfs *list; - + // We always have the root filesystem browser->add("/", icon); # ifdef HAVE_PTHREAD @@ -303,8 +301,8 @@ int Fl_X11_System_Driver::file_browser_load_filesystem(Fl_File_Browser *browser, // // UNIX code uses /etc/fstab or similar... // - FILE *mtab; // /etc/mtab or /etc/mnttab file - char line[FL_PATH_MAX]; // Input line + FILE *mtab; // /etc/mtab or /etc/mnttab file + char line[FL_PATH_MAX]; // Input line // Every Unix has a root filesystem '/'. // This ensures that the user don't get an empty @@ -317,15 +315,15 @@ int Fl_X11_System_Driver::file_browser_load_filesystem(Fl_File_Browser *browser, // // Note: this misses automounted filesystems on FreeBSD if absent from /etc/fstab // - - mtab = fopen("/etc/mnttab", "r"); // Fairly standard + + mtab = fopen("/etc/mnttab", "r"); // Fairly standard if (mtab == NULL) - mtab = fopen("/etc/mtab", "r"); // More standard + mtab = fopen("/etc/mtab", "r"); // More standard if (mtab == NULL) - mtab = fopen("/etc/fstab", "r"); // Otherwise fallback to full list + mtab = fopen("/etc/fstab", "r"); // Otherwise fallback to full list if (mtab == NULL) - mtab = fopen("/etc/vfstab", "r"); // Alternate full list file - + mtab = fopen("/etc/vfstab", "r"); // Alternate full list file + if (mtab != NULL) { while (fgets(line, sizeof(line), mtab) != NULL) @@ -336,15 +334,15 @@ int Fl_X11_System_Driver::file_browser_load_filesystem(Fl_File_Browser *browser, continue; if (strcmp("/", filename) == 0) continue; // "/" was added before - + // Add a trailing slash (except for the root filesystem) strlcat(filename, "/", lname); - + // printf("Fl_File_Browser::load() - adding \"%s\" to list...\n", filename); browser->add(filename, icon); num_files ++; } - + fclose(mtab); } #endif // _AIX || ... @@ -357,17 +355,17 @@ void Fl_X11_System_Driver::newUUID(char *uuidBuffer) // #include <uuid/uuid.h> // void uuid_generate(uuid_t out); unsigned char b[16]; - time_t t = time(0); // first 4 byte + time_t t = time(0); // first 4 byte b[0] = (unsigned char)t; b[1] = (unsigned char)(t>>8); b[2] = (unsigned char)(t>>16); b[3] = (unsigned char)(t>>24); - int r = rand(); // four more bytes + int r = rand(); // four more bytes b[4] = (unsigned char)r; b[5] = (unsigned char)(r>>8); b[6] = (unsigned char)(r>>16); b[7] = (unsigned char)(r>>24); - unsigned long a = (unsigned long)&t; // four more bytes + unsigned long a = (unsigned long)&t; // four more bytes b[8] = (unsigned char)a; b[9] = (unsigned char)(a>>8); b[10] = (unsigned char)(a>>16); @@ -390,7 +388,7 @@ void Fl_X11_System_Driver::newUUID(char *uuidBuffer) b[10] = v.a[2]; b[11] = v.a[3]; # endif - char name[80]; // last four bytes + char name[80]; // last four bytes gethostname(name, 79); memcpy(b+12, name, 4); sprintf(uuidBuffer, "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", @@ -425,7 +423,7 @@ char *Fl_X11_System_Driver::preference_rootnode(Fl_Preferences *prefs, Fl_Prefer strcpy(filename, "/etc/fltk/"); break; } - + // Make sure that the parameters are not NULL if ( (vendor==0L) || (vendor[0]==0) ) vendor = "unknown"; @@ -449,12 +447,12 @@ int Fl_X11_System_Driver::XParseGeometry(const char* string, int* x, int* y, int Fl_X11_System_Driver::filename_list(const char *d, dirent ***list, int (*sort)(struct dirent **, struct dirent **) ) { int dirlen; char *dirloc; - + // Assume that locale encoding is no less dense than UTF-8 dirlen = strlen(d); dirloc = (char *)malloc(dirlen + 1); fl_utf8to_mb(d, dirlen, dirloc, dirlen + 1); - + #ifndef HAVE_SCANDIR // This version is when we define our own scandir int n = fl_scandir(dirloc, list, 0, sort); @@ -475,31 +473,31 @@ int Fl_X11_System_Driver::filename_list(const char *d, dirent ***list, int (*sor // changes: int n = scandir(dirloc, list, 0, (int(*)(const void*,const void*))sort); #endif - + free(dirloc); - + // convert every filename to UTF-8, and append a '/' to all // filenames that are directories int i; char *fullname = (char*)malloc(dirlen+FL_PATH_MAX+3); // Add enough extra for two /'s and a nul // Use memcpy for speed since we already know the length of the string... memcpy(fullname, d, dirlen+1); - + char *name = fullname + dirlen; if (name!=fullname && name[-1]!='/') *name++ = '/'; - + for (i=0; i<n; i++) { int newlen; dirent *de = (*list)[i]; int len = strlen(de->d_name); newlen = fl_utf8from_mb(NULL, 0, de->d_name, len); dirent *newde = (dirent*)malloc(de->d_name - (char*)de + newlen + 2); // Add space for a / and a nul - + // Conversion to UTF-8 memcpy(newde, de, de->d_name - (char*)de); fl_utf8from_mb(newde->d_name, newlen + 1, de->d_name, len); - + // Check if dir (checks done on "old" name as we need to interact with // the underlying OS) if (de->d_name[len-1]!='/' && len<=FL_PATH_MAX) { @@ -511,12 +509,12 @@ int Fl_X11_System_Driver::filename_list(const char *d, dirent ***list, int (*sor *dst = 0; } } - + free(de); (*list)[i] = newde; } free(fullname); - + return n; } @@ -619,7 +617,3 @@ const char *Fl_X11_System_Driver::shortcut_add_key_name(unsigned key, char *p, c } #endif // !defined(FL_DOXYGEN) - -// -// End of "$Id$". -// diff --git a/src/drivers/X11/Fl_X11_Window_Driver.H b/src/drivers/X11/Fl_X11_Window_Driver.H index 604b7d622..098808c72 100644 --- a/src/drivers/X11/Fl_X11_Window_Driver.H +++ b/src/drivers/X11/Fl_X11_Window_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of X11 window driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,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 // /** @@ -35,13 +33,13 @@ class Fl_Bitmap; There is one window driver for each Fl_Window. Window drivers manage window actions such as resizing, events, decoration, fullscreen modes, etc. . All - drawing and rendering is managed by the Surface device and the associated + drawing and rendering is managed by the Surface device and the associated graphics driver. - window specific event handling - window types and styles, depth, etc. - decorations - + ? where do we handle the interface between OpenGL/DirectX and Cocoa/Windows/Glx? */ @@ -86,7 +84,7 @@ private: char backbuffer_bad; void flush_double_dbe(int erase_overlay); #endif - + public: Fl_X11_Window_Driver(Fl_Window*); virtual ~Fl_X11_Window_Driver(); @@ -95,7 +93,7 @@ public: virtual int screen_num(); static void resize_after_screen_change(void *data); #endif // USE_XFT - + // --- window data virtual int decorated_w(); virtual int decorated_h(); @@ -144,7 +142,3 @@ public: #endif // FL_X11_WINDOW_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/X11/Fl_X11_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Window_Driver.cxx index 50a013ba6..19fc70b09 100644 --- a/src/drivers/X11/Fl_X11_Window_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Window_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of X11 window driver. // // 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 // @@ -34,8 +32,8 @@ #if HAVE_DLFCN_H #include <dlfcn.h> #endif -#define ShapeBounding 0 -#define ShapeSet 0 +#define ShapeBounding 0 +#define ShapeSet 0 #if HAVE_OVERLAY extern XVisualInfo *fl_find_overlay_visual(); @@ -89,7 +87,7 @@ void Fl_X11_Window_Driver::flush_double_dbe(int erase_overlay) if (i->region) {Fl_Graphics_Driver::default_driver().XDestroyRegion(i->region); i->region = 0;} pWindow->clear_damage(FL_DAMAGE_ALL); backbuffer_bad = 0; - } + } // Redraw as needed... if (pWindow->damage()) { fl_clip_region(i->region); i->region = 0; @@ -181,7 +179,7 @@ int Fl_X11_Window_Driver::decorated_h() int Fl_X11_Window_Driver::decorated_w() { int w, h; - + decorated_win_size(w, h); return w; } @@ -191,8 +189,8 @@ void Fl_X11_Window_Driver::take_focus() { Fl_X *i = Fl_X::i(pWindow); if (!Fl_X11_Screen_Driver::ewmh_supported()) - pWindow->show(); // Old WMs, XMapRaised - else if (i) // New WMs use the NETWM attribute: + pWindow->show(); // Old WMs, XMapRaised + else if (i) // New WMs use the NETWM attribute: activate_window(); } @@ -351,7 +349,7 @@ void Fl_X11_Window_Driver::combine_mask() void Fl_X11_Window_Driver::icons(const Fl_RGB_Image *icons[], int count) { free_icons(); - + if (count > 0) { icon_->icons = new Fl_RGB_Image*[count]; icon_->count = count; @@ -361,7 +359,7 @@ void Fl_X11_Window_Driver::icons(const Fl_RGB_Image *icons[], int count) { icon_->icons[i]->normalize(); } } - + if (Fl_X::i(pWindow)) set_icons(); } @@ -392,7 +390,7 @@ void Fl_X11_Window_Driver::free_icons() { (or NULL if a particular border is absent). Returned images can be deleted after use. Their depth and size may be platform-dependent. The top and bottom images extend from left of the left border to right of the right border. - + This function exploits a feature of Fl_X11_Screen_Driver::read_win_rectangle() which, when called with negative 3rd argument, captures the window decoration. Other requirement to capture the window decoration: @@ -449,7 +447,7 @@ void Fl_X11_Window_Driver::make_current() { #if USE_XFT ((Fl_Xlib_Graphics_Driver*)fl_graphics_driver)->scale(Fl::screen_driver()->scale(screen_num())); #endif - + #ifdef FLTK_USE_CAIRO // update the cairo_t context if (Fl::cairo_autolink_context()) Fl::cairo_make_current(pWindow); @@ -529,20 +527,20 @@ void Fl_X11_Window_Driver::decoration_sizes(int *top, int *left, int *right, in void Fl_X11_Window_Driver::show_with_args_begin() { // Get defaults for drag-n-drop and focus... const char *key = 0, *val; - + if (Fl::first_window()) key = Fl::first_window()->xclass(); if (!key) key = "fltk"; - + val = XGetDefault(fl_display, key, "dndTextOps"); if (val) Fl::dnd_text_ops(strcasecmp(val, "true") == 0 || strcasecmp(val, "on") == 0 || strcasecmp(val, "yes") == 0); - + val = XGetDefault(fl_display, key, "tooltips"); if (val) Fl_Tooltip::enable(strcasecmp(val, "true") == 0 || strcasecmp(val, "on") == 0 || strcasecmp(val, "yes") == 0); - + val = XGetDefault(fl_display, key, "visibleFocus"); if (val) Fl::visible_focus(strcasecmp(val, "true") == 0 || strcasecmp(val, "on") == 0 || @@ -624,7 +622,7 @@ void Fl_X11_Window_Driver::redraw_overlay() { overlay(new _Fl_Overlay(0,0,w(),h())); Fl_Group::current(0); } else { - overlay(pWindow); // fake the overlay + overlay(pWindow); // fake the overlay } } if (shown()) { @@ -712,8 +710,3 @@ int Fl_X11_Window_Driver::screen_num() { return screen_num_ >= 0 ? screen_num_ : 0; } #endif // USE_XFT - - -// -// End of "$Id$". -// 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$". -// |
