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 /fluid | |
| 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 'fluid')
45 files changed, 1751 insertions, 2026 deletions
diff --git a/fluid/CMakeLists.txt b/fluid/CMakeLists.txt index 94948f357..e730f274c 100644 --- a/fluid/CMakeLists.txt +++ b/fluid/CMakeLists.txt @@ -1,6 +1,4 @@ # -# "$Id$" -# # CMakeLists.txt to build fluid for the FLTK project using CMake (www.cmake.org) # # Copyright 1998-2018 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 # diff --git a/fluid/CodeEditor.cxx b/fluid/CodeEditor.cxx index 689f12855..4dd1cef96 100644 --- a/fluid/CodeEditor.cxx +++ b/fluid/CodeEditor.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Code editor widget 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 // // @@ -28,91 +26,91 @@ Fl_Text_Display::Style_Table_Entry CodeEditor:: - styletable[] = { // Style table - { FL_FOREGROUND_COLOR, FL_COURIER, 11 }, // A - Plain - { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // B - Line comments - { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // C - Block comments - { FL_BLUE, FL_COURIER, 11 }, // D - Strings - { FL_DARK_RED, FL_COURIER, 11 }, // E - Directives - { FL_DARK_RED, FL_COURIER_BOLD, 11 }, // F - Types - { FL_BLUE, FL_COURIER_BOLD, 11 } // G - Keywords - }; + styletable[] = { // Style table + { FL_FOREGROUND_COLOR, FL_COURIER, 11 }, // A - Plain + { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // B - Line comments + { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // C - Block comments + { FL_BLUE, FL_COURIER, 11 }, // D - Strings + { FL_DARK_RED, FL_COURIER, 11 }, // E - Directives + { FL_DARK_RED, FL_COURIER_BOLD, 11 }, // F - Types + { FL_BLUE, FL_COURIER_BOLD, 11 } // G - Keywords + }; const char * const CodeEditor:: - code_keywords[] = { // Sorted list of C/C++ keywords... - "and", - "and_eq", - "asm", - "bitand", - "bitor", - "break", - "case", - "catch", - "compl", - "continue", - "default", - "delete", - "do", - "else", - "false", - "for", - "goto", - "if", - "new", - "not", - "not_eq", - "operator", - "or", - "or_eq", - "return", - "switch", - "template", - "this", - "throw", - "true", - "try", - "while", - "xor", - "xor_eq" - }; + code_keywords[] = { // Sorted list of C/C++ keywords... + "and", + "and_eq", + "asm", + "bitand", + "bitor", + "break", + "case", + "catch", + "compl", + "continue", + "default", + "delete", + "do", + "else", + "false", + "for", + "goto", + "if", + "new", + "not", + "not_eq", + "operator", + "or", + "or_eq", + "return", + "switch", + "template", + "this", + "throw", + "true", + "try", + "while", + "xor", + "xor_eq" + }; const char * const CodeEditor:: - code_types[] = { // Sorted list of C/C++ types... - "auto", - "bool", - "char", - "class", - "const", - "const_cast", - "double", - "dynamic_cast", - "enum", - "explicit", - "extern", - "float", - "friend", - "inline", - "int", - "long", - "mutable", - "namespace", - "private", - "protected", - "public", - "register", - "short", - "signed", - "sizeof", - "static", - "static_cast", - "struct", - "template", - "typedef", - "typename", - "union", - "unsigned", - "virtual", - "void", - "volatile" - }; + code_types[] = { // Sorted list of C/C++ types... + "auto", + "bool", + "char", + "class", + "const", + "const_cast", + "double", + "dynamic_cast", + "enum", + "explicit", + "extern", + "float", + "friend", + "inline", + "int", + "long", + "mutable", + "namespace", + "private", + "protected", + "public", + "register", + "short", + "signed", + "sizeof", + "static", + "static_cast", + "struct", + "template", + "typedef", + "typename", + "union", + "unsigned", + "virtual", + "void", + "volatile" + }; // attempt to make the fluid code editor widget honour textsize setting void CodeEditor::textsize(Fl_Fontsize s) { @@ -134,12 +132,12 @@ extern "C" { // 'style_parse()' - Parse text and produce style data. void CodeEditor::style_parse(const char *text, char *style, int length) { - char current; - int col; - int last; - char buf[255], - *bufptr; - const char *temp; + char current; + int col; + int last; + char buf[255], + *bufptr; + const char *temp; // Style letters: // @@ -160,64 +158,64 @@ void CodeEditor::style_parse(const char *text, char *style, int length) { current = 'E'; } else if (strncmp(text, "//", 2) == 0) { current = 'B'; - for (; length > 0 && *text != '\n'; length --, text ++) *style++ = 'B'; + for (; length > 0 && *text != '\n'; length --, text ++) *style++ = 'B'; if (length == 0) break; } else if (strncmp(text, "/*", 2) == 0) { current = 'C'; } else if (strncmp(text, "\\\"", 2) == 0) { // Quoted quote... - *style++ = current; - *style++ = current; - text ++; - length --; - col += 2; - continue; + *style++ = current; + *style++ = current; + text ++; + length --; + col += 2; + continue; } else if (*text == '\"') { current = 'D'; } else if (!last && (islower(*text) || *text == '_')) { // Might be a keyword... - for (temp = text, bufptr = buf; - (islower(*temp) || *temp == '_') && bufptr < (buf + sizeof(buf) - 1); - *bufptr++ = *temp++) { - // nothing - } + for (temp = text, bufptr = buf; + (islower(*temp) || *temp == '_') && bufptr < (buf + sizeof(buf) - 1); + *bufptr++ = *temp++) { + // nothing + } if (!islower(*temp) && *temp != '_') { - *bufptr = '\0'; + *bufptr = '\0'; bufptr = buf; - if (bsearch(&bufptr, code_types, - sizeof(code_types) / sizeof(code_types[0]), - sizeof(code_types[0]), compare_keywords)) { - while (text < temp) { - *style++ = 'F'; - text ++; - length --; - col ++; - } - - text --; - length ++; - last = 1; - continue; - } else if (bsearch(&bufptr, code_keywords, - sizeof(code_keywords) / sizeof(code_keywords[0]), - sizeof(code_keywords[0]), compare_keywords)) { - while (text < temp) { - *style++ = 'G'; - text ++; - length --; - col ++; - } - - text --; - length ++; - last = 1; - continue; - } - } + if (bsearch(&bufptr, code_types, + sizeof(code_types) / sizeof(code_types[0]), + sizeof(code_types[0]), compare_keywords)) { + while (text < temp) { + *style++ = 'F'; + text ++; + length --; + col ++; + } + + text --; + length ++; + last = 1; + continue; + } else if (bsearch(&bufptr, code_keywords, + sizeof(code_keywords) / sizeof(code_keywords[0]), + sizeof(code_keywords[0]), compare_keywords)) { + while (text < temp) { + *style++ = 'G'; + text ++; + length --; + col ++; + } + + text --; + length ++; + last = 1; + continue; + } + } } } else if (current == 'C' && strncmp(text, "*/", 2) == 0) { // Close a C comment... @@ -232,18 +230,18 @@ void CodeEditor::style_parse(const char *text, char *style, int length) { // Continuing in string... if (strncmp(text, "\\\"", 2) == 0) { // Quoted end quote... - *style++ = current; - *style++ = current; - text ++; - length --; - col += 2; - continue; + *style++ = current; + *style++ = current; + text ++; + length --; + col += 2; + continue; } else if (*text == '\"') { // End quote... - *style++ = current; - col ++; - current = 'A'; - continue; + *style++ = current; + col ++; + current = 'A'; + continue; } } @@ -269,12 +267,12 @@ void CodeEditor::style_unfinished_cb(int, void*) { } void CodeEditor::style_update(int pos, int nInserted, int nDeleted, int /*nRestyled*/, const char * /*deletedText*/, void *cbArg) { - CodeEditor *editor = (CodeEditor *)cbArg; - int start, // Start of text - end; // End of text - char last, // Last style on line - *style, // Style data - *text; // Text data + CodeEditor *editor = (CodeEditor *)cbArg; + int start, // Start of text + end; // End of text + char last, // Last style on line + *style, // Style data + *text; // Text data // If this is just a selection change, just unselect the style buffer... @@ -360,7 +358,7 @@ int CodeEditor::auto_indent(int, CodeEditor* e) { char *ptr; for (ptr = text; isspace(*ptr); ptr ++) {/*empty*/} - *ptr = '\0'; + *ptr = '\0'; if (*text) { // use only a single 'insert' call to avoid redraw issues int n = strlen(text); @@ -394,7 +392,7 @@ CodeEditor::CodeEditor(int X, int Y, int W, int H, const char *L) : highlight_data(new Fl_Text_Buffer(mBuffer->length()), styletable, sizeof(styletable) / sizeof(styletable[0]), - 'A', style_unfinished_cb, this); + 'A', style_unfinished_cb, this); style_parse(text, style, mBuffer->length()); @@ -420,9 +418,9 @@ CodeEditor::~CodeEditor() { CodeViewer::CodeViewer(int X, int Y, int W, int H, const char *L) -: CodeEditor(X, Y, W, H, L) +: CodeEditor(X, Y, W, H, L) { - default_key_function(kf_ignore); + default_key_function(kf_ignore); remove_all_key_bindings(&key_bindings); cursor_style(CARET_CURSOR); } @@ -436,7 +434,3 @@ void CodeViewer::draw() CodeEditor::draw(); Fl::set_color(FL_SELECTION_COLOR, c); } - -// -// End of "$Id$". -// diff --git a/fluid/CodeEditor.h b/fluid/CodeEditor.h index 66e3b207a..e865ac63e 100644 --- a/fluid/CodeEditor.h +++ b/fluid/CodeEditor.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Code editor widget 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 // #ifndef CodeEditor_h @@ -59,7 +57,7 @@ class CodeEditor : public Fl_Text_Editor { // attempt to make the fluid code editor widget honour textsize setting void textsize(Fl_Fontsize s); - + }; class CodeViewer : public CodeEditor { @@ -75,7 +73,3 @@ class CodeViewer : public CodeEditor { }; #endif // !CodeEditor_h - -// -// End of "$Id$". -// diff --git a/fluid/ExternalCodeEditor_UNIX.cxx b/fluid/ExternalCodeEditor_UNIX.cxx index 8e415e0b3..189f29778 100644 --- a/fluid/ExternalCodeEditor_UNIX.cxx +++ b/fluid/ExternalCodeEditor_UNIX.cxx @@ -1,9 +1,7 @@ // -// "$Id$". +// External code editor management class for Unix // -// External code editor management class for Unix -// -// Note: This entire file Unix only +// Note: This entire file Unix only #include <errno.h> /* errno */ #include <string.h> /* strerror() */ @@ -84,17 +82,17 @@ void ExternalCodeEditor::close_editor() { "pid=%ld file=%s", long(pid_), filename()); break; case 0: // process still running - switch ( fl_choice("Please close external editor\npid=%ld file=%s", - "Force Close", // button 0 - "Closed", // button 1 - 0, // button 2 - long(pid_), filename() ) ) { - case 0: // Force Close - kill_editor(); - continue; - case 1: // Closed? try to reap - continue; - } + switch ( fl_choice("Please close external editor\npid=%ld file=%s", + "Force Close", // button 0 + "Closed", // button 1 + 0, // button 2 + long(pid_), filename() ) ) { + case 0: // Force Close + kill_editor(); + continue; + case 1: // Closed? try to reap + continue; + } break; case 1: // process reaped return; @@ -338,9 +336,9 @@ int ExternalCodeEditor::start_editor(const char *editor_cmd, int nargs; char **args = 0; if (make_args(cmd, &nargs, &args) > 0) { - execvp(args[0], args); // run command - doesn't return if succeeds - fl_alert("couldn't exec() '%s': %s", cmd, strerror(errno)); - exit(1); + execvp(args[0], args); // run command - doesn't return if succeeds + fl_alert("couldn't exec() '%s': %s", cmd, strerror(errno)); + exit(1); } exit(1); // break; @@ -384,7 +382,7 @@ int ExternalCodeEditor::reap_editor(pid_t *pid_reaped) { { stop_update_timer(); } break; } - if ( G_debug ) + if ( G_debug ) printf("*** EDITOR REAPED: pid=%ld #open=%d\n", long(wpid), L_editors_open); return 1; } @@ -411,7 +409,7 @@ int ExternalCodeEditor::open_editor(const char *editor_cmd, pid_t wpid; switch ( reap_editor(&wpid) ) { case -2: // no editor running? (unlikely if is_editing() true) - break; + break; case -1: // waitpid() failed fl_alert("ERROR: waitpid() failed: %s\nfile='%s', pid=%ld", strerror(errno), filename(), (long)pid_); @@ -475,7 +473,3 @@ void ExternalCodeEditor::set_update_timer_callback(Fl_Timeout_Handler cb) { int ExternalCodeEditor::editors_open() { return L_editors_open; } - -// -// End of "$Id$". -// diff --git a/fluid/ExternalCodeEditor_UNIX.h b/fluid/ExternalCodeEditor_UNIX.h index 355a041c7..d366a95c1 100644 --- a/fluid/ExternalCodeEditor_UNIX.h +++ b/fluid/ExternalCodeEditor_UNIX.h @@ -1,6 +1,4 @@ // -// "$Id$". -// // External code editor management class for Unix // // Handles starting and keeping track of an external text editor, @@ -47,6 +45,3 @@ public: }; #endif /*_EXTCODEEDITOR_H */ -// -// End of "$Id$". -// diff --git a/fluid/ExternalCodeEditor_WIN32.cxx b/fluid/ExternalCodeEditor_WIN32.cxx index 4890b1b08..05388d066 100644 --- a/fluid/ExternalCodeEditor_WIN32.cxx +++ b/fluid/ExternalCodeEditor_WIN32.cxx @@ -1,9 +1,7 @@ // -// "$Id$". +// External code editor management class for Windows // -// External code editor management class for Windows -// -// Note: This entire file Windows only. +// Note: This entire file Windows only. #include <stdio.h> // snprintf() @@ -88,7 +86,7 @@ int ExternalCodeEditor::is_editing() { return( (pinfo_.dwProcessId != 0) ? 1 : 0 ); } -// [Static/Local] Terminate_app()'s callback to send WM_CLOSE to a single window. +// [Static/Local] Terminate_app()'s callback to send WM_CLOSE to a single window. static BOOL CALLBACK terminate_app_enum(HWND hwnd, LPARAM lParam) { DWORD dwID; GetWindowThreadProcessId(hwnd, &dwID); @@ -144,17 +142,17 @@ void ExternalCodeEditor::close_editor() { "pid=%ld file=%s", long(pinfo_.dwProcessId), filename()); break; case 0: // process still running - switch ( fl_choice("Please close external editor\npid=%ld file=%s", - "Force Close", // button 0 - "Closed", // button 1 - 0, // button 2 - long(pinfo_.dwProcessId), filename() ) ) { - case 0: // Force Close - kill_editor(); - continue; - case 1: // Closed? try to reap - continue; - } + switch ( fl_choice("Please close external editor\npid=%ld file=%s", + "Force Close", // button 0 + "Closed", // button 1 + 0, // button 2 + long(pinfo_.dwProcessId), filename() ) ) { + case 0: // Force Close + kill_editor(); + continue; + case 1: // Closed? try to reap + continue; + } break; case 1: // process reaped return; @@ -178,7 +176,7 @@ void ExternalCodeEditor::kill_editor() { } case 0: { // success -- process reaped DWORD pid = pinfo_.dwProcessId; // save pid - reap_cleanup(); // clears pinfo_ + reap_cleanup(); // clears pinfo_ if ( G_debug ) printf("*** kill_editor() REAP pid=%ld #open=%ld\n", long(pid), long(L_editors_open)); @@ -217,7 +215,7 @@ int ExternalCodeEditor::handle_changes(const char **code, int force) { // Get file size if ( GetFileSizeEx(fh, &fsize) == 0 ) { DWORD err = GetLastError(); - CloseHandle(fh); + CloseHandle(fh); SetLastError(err); // return error from GetFileSizeEx(), not CloseHandle() return -1; } @@ -225,7 +223,7 @@ int ExternalCodeEditor::handle_changes(const char **code, int force) { FILETIME ftCreate, ftAccess, ftWrite; if ( GetFileTime(fh, &ftCreate, &ftAccess, &ftWrite) == 0 ) { DWORD err = GetLastError(); - CloseHandle(fh); + CloseHandle(fh); SetLastError(err); // return error from GetFileTime(), not CloseHandle() return -1; } @@ -481,7 +479,7 @@ int ExternalCodeEditor::reap_editor(DWORD *pid_reaped) { } case WAIT_OBJECT_0: { // reaped DWORD wpid = pinfo_.dwProcessId; // save pid - reap_cleanup(); // clears pinfo_ + reap_cleanup(); // clears pinfo_ if ( pid_reaped ) *pid_reaped = wpid; // return pid to caller if ( G_debug ) printf("*** EDITOR REAPED: pid=%ld #open=%d\n", long(wpid), L_editors_open); @@ -515,8 +513,8 @@ int ExternalCodeEditor::open_editor(const char *editor_cmd, // See if editor recently closed but not reaped; try to reap DWORD wpid; switch ( reap_editor(&wpid) ) { - case -2: // no editor running (unlikely to happen) - break; + case -2: // no editor running (unlikely to happen) + break; case -1: // wait failed fl_alert("ERROR: WaitForSingleObject() failed: %s\nfile='%s', pid=%ld", get_ms_errmsg(), filename(), long(pinfo_.dwProcessId)); @@ -578,7 +576,3 @@ void ExternalCodeEditor::set_update_timer_callback(Fl_Timeout_Handler cb) { int ExternalCodeEditor::editors_open() { return L_editors_open; } - -// -// End of "$Id$". -// diff --git a/fluid/ExternalCodeEditor_WIN32.h b/fluid/ExternalCodeEditor_WIN32.h index 29c3ba6a6..de4c2c4a7 100644 --- a/fluid/ExternalCodeEditor_WIN32.h +++ b/fluid/ExternalCodeEditor_WIN32.h @@ -1,6 +1,4 @@ // -// "$Id$". -// // External code editor management class for Windows // // Handles starting and keeping track of an external text editor, @@ -28,7 +26,7 @@ #include <string.h> /* sprintf().. */ class ExternalCodeEditor { - PROCESS_INFORMATION pinfo_; // CreateProcess() handle to running process + PROCESS_INFORMATION pinfo_; // CreateProcess() handle to running process FILETIME file_mtime_; // last modify time of the file (used to determine if file changed) LARGE_INTEGER file_size_; // last file size (used to determine if changed) const char * filename_; // tmpfilename editor uses @@ -59,6 +57,3 @@ public: }; #endif /*_EXTCODEEDITOR_H */ -// -// End of "$Id$". -// diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx index 030c6c454..d39e2164d 100644 --- a/fluid/Fl_Function_Type.cxx +++ b/fluid/Fl_Function_Type.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // C function type code 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 // #include <FL/Fl.H> #include <FL/Fl_Window.H> @@ -286,7 +284,7 @@ void Fl_Function_Type::write_code1() { star = "*"; } else rtype = "void"; } - + const char* k = class_name(0); if (k) { if (havechildren) @@ -306,21 +304,21 @@ void Fl_Function_Type::write_code1() { if (havechildren) write_c("%s%s ", rtype, star); } - + // if this is a subclass, only write_h() the part before the ':' char s[1024], *sptr = s; char *nptr = (char *)name(); - + while (*nptr) { if (*nptr == ':') { if (nptr[1] != ':') break; // Copy extra ":" for "class::member"... *sptr++ = *nptr++; - } + } *sptr++ = *nptr++; } *sptr = '\0'; - + write_h("%s;\n", s); // skip all function default param. init in body: int skips=0,skipc=0; @@ -328,25 +326,25 @@ void Fl_Function_Type::write_code1() { for (sptr=s,nptr=(char*)name(); *nptr; nc++,nptr++) { if (!skips && *nptr=='(') plevel++; else if (!skips && *nptr==')') plevel--; - if ( *nptr=='"' && !(nc && *(nptr-1)=='\\') ) + if ( *nptr=='"' && !(nc && *(nptr-1)=='\\') ) skips = skips ? 0 : 1; else if(!skips && *nptr=='\'' && !(nc && *(nptr-1)=='\\')) skipc = skipc ? 0 : 1; - if(!skips && !skipc && plevel==1 && *nptr =='=' && - !(nc && *(nptr-1)=='\'') ) // ignore '=' case + if(!skips && !skipc && plevel==1 && *nptr =='=' && + !(nc && *(nptr-1)=='\'') ) // ignore '=' case while(*++nptr && (skips || skipc || ( (*nptr!=',' && *nptr!=')') || plevel!=1) )) { - if ( *nptr=='"' && *(nptr-1)!='\\' ) + if ( *nptr=='"' && *(nptr-1)!='\\' ) skips = skips ? 0 : 1; else if(!skips && *nptr=='\'' && *(nptr-1)!='\\') skipc = skipc ? 0 : 1; if (!skips && !skipc && *nptr=='(') plevel++; else if (!skips && *nptr==')') plevel--; } - - if (sptr < (s + sizeof(s) - 1)) *sptr++ = *nptr; + + if (sptr < (s + sizeof(s) - 1)) *sptr++ = *nptr; } *sptr = '\0'; - + if (havechildren) write_c("%s::%s {\n", k, s); } else { @@ -361,7 +359,7 @@ void Fl_Function_Type::write_code1() { if (havechildren) write_c("static "); } - + // write everything but the default parameters (if any) char s[1024], *sptr; char *nptr; @@ -370,30 +368,30 @@ void Fl_Function_Type::write_code1() { for (sptr=s,nptr=(char*)name(); *nptr; nc++,nptr++) { if (!skips && *nptr=='(') plevel++; else if (!skips && *nptr==')') plevel--; - if ( *nptr=='"' && !(nc && *(nptr-1)=='\\') ) + if ( *nptr=='"' && !(nc && *(nptr-1)=='\\') ) skips = skips ? 0 : 1; else if(!skips && *nptr=='\'' && !(nc && *(nptr-1)=='\\')) skipc = skipc ? 0 : 1; - if(!skips && !skipc && plevel==1 && *nptr =='=' && - !(nc && *(nptr-1)=='\'') ) // ignore '=' case + if(!skips && !skipc && plevel==1 && *nptr =='=' && + !(nc && *(nptr-1)=='\'') ) // ignore '=' case while(*++nptr && (skips || skipc || ( (*nptr!=',' && *nptr!=')') || plevel!=1) )) { - if ( *nptr=='"' && *(nptr-1)!='\\' ) + if ( *nptr=='"' && *(nptr-1)!='\\' ) skips = skips ? 0 : 1; else if(!skips && *nptr=='\'' && *(nptr-1)!='\\') skipc = skipc ? 0 : 1; if (!skips && !skipc && *nptr=='(') plevel++; else if (!skips && *nptr==')') plevel--; } - - if (sptr < (s + sizeof(s) - 1)) *sptr++ = *nptr; + + if (sptr < (s + sizeof(s) - 1)) *sptr++ = *nptr; } *sptr = '\0'; - + if (havechildren) write_c("%s%s %s {\n", rtype, star, s); } } - + if (havewidgets && child && !child->name()) write_c(" %s* w;\n", subclassname(child)); indentation += 2; } @@ -406,7 +404,7 @@ void Fl_Function_Type::write_code2() { havechildren = 1; if (child->is_window() && child->name()) var = child->name(); } - + if (ismain()) { if (havewidgets) write_c(" %s->show(argc, argv);\n", var); if (havechildren) write_c(" return Fl::run();\n"); @@ -421,7 +419,7 @@ void Fl_Function_Type::write_code2() { int Fl_Function_Type::has_signature(const char *rtype, const char *sig) const { if (rtype && !return_type) return 0; if (!name()) return 0; - if ( (rtype==0L || strcmp(return_type, rtype)==0) + if ( (rtype==0L || strcmp(return_type, rtype)==0) && fl_filename_match(name(), sig)) { return 1; } @@ -585,7 +583,7 @@ void Fl_CodeBlock_Type::write_code2() { //////////////////////////////////////////////////////////////// -int Fl_Decl_Type::is_public() const +int Fl_Decl_Type::is_public() const { Fl_Type *p = parent; while (p && !p->is_decl_block()) p = p->parent; @@ -615,7 +613,7 @@ void Fl_Decl_Type::write_properties() { case 1: write_string("public"); break; case 2: write_string("protected"); break; } - if (static_) + if (static_) write_string("local"); else write_string("global"); @@ -743,7 +741,7 @@ void Fl_Decl_Type::write_code1() { write_h(" %.*s; %s\n", (int)(e-c), c, csc); } else { if (public_) { - if (static_) + if (static_) write_h("extern "); else write_comment_h(); @@ -754,7 +752,7 @@ void Fl_Decl_Type::write_code1() { } } else { write_comment_c(); - if (static_) + if (static_) write_c("static "); write_c("%.*s; %s\n", (int)(e-c), c, csc); } @@ -830,7 +828,7 @@ void Fl_Data_Type::open() { leave_source_dir(); if (fn) { if (strcmp(fn, data_filename->value())) - set_modflag(1); + set_modflag(1); data_filename->value(fn); } } @@ -852,7 +850,7 @@ void Fl_Data_Type::open() { for (;;++q) { if (!*q) break; if (!isspace((unsigned char)(*q))) goto OOPS; - } + } if (n==q) { OOPS: message = "variable name must be a C identifier"; free((void*)s); @@ -881,7 +879,7 @@ void Fl_Data_Type::open() { // store the filename c = data_filename->value(); if (filename_ && strcmp(filename_, data_filename->value())) - set_modflag(1); + set_modflag(1); else if (!filename_ && *c) set_modflag(1); if (filename_) { free((void*)filename_); filename_ = 0L; } @@ -974,7 +972,7 @@ void Fl_Data_Type::write_code1() { } } else { write_comment_c(); - if (static_) + if (static_) write_c("static "); if (text_mode_) { write_c("const char *%s = /* text inlined from %s */\n", c, fn); @@ -988,7 +986,7 @@ void Fl_Data_Type::write_code1() { write_c(";\n"); } } - // if we are in interactive mode, we pop up a warning dialog + // if we are in interactive mode, we pop up a warning dialog // giving the error: (batch_mode && !write_sourceview) ??? if (message && !write_sourceview) { if (batch_mode) @@ -1109,7 +1107,7 @@ Fl_Type *Fl_Comment_Type::make() { void Fl_Comment_Type::write_properties() { Fl_Type::write_properties(); - if (in_c_) write_string("in_source"); else write_string("not_in_source"); + if (in_c_) write_string("in_source"); else write_string("not_in_source"); if (in_h_) write_string("in_header"); else write_string("not_in_header"); } @@ -1133,11 +1131,11 @@ static void load_comments_preset(Fl_Preferences &menu) { static const char * const predefined_comment[] = { "GNU Public License/GPL Header", "GNU Public License/GPL Footer", "GNU Public License/LGPL Header", "GNU Public License/LGPL Footer", - "FLTK/Header", "FLTK/Footer" }; + "FLTK/Header" }; int i; - menu.set("n", 6); + menu.set("n", 5); Fl_Preferences db(Fl_Preferences::USER, "fltk.org", "fluid_comments"); - for (i=0; i<6; i++) { + for (i=0; i<5; i++) { menu.set(Fl_Preferences::Name(i), predefined_comment[i]); db.set(predefined_comment[i], comment_text[i]); } @@ -1180,7 +1178,7 @@ void Fl_Comment_Type::open() { // add the current comment to the database const char *xname = fl_input( "Please enter a name to reference the current\ncomment in your database.\n\n" - "Use forward slashes '/' to create submenus.", + "Use forward slashes '/' to create submenus.", "My Comment"); if (xname) { char *name = strdup(xname); @@ -1200,8 +1198,8 @@ void Fl_Comment_Type::open() { if (itempath[0]==0 || last_selected_item==0) { fl_message("Please select an entry form this menu first."); } else if (fl_choice("Are you sure that you want to delete the entry\n" - "\"%s\"\nfrom the database?", "Cancel", "Delete", - NULL, itempath)) { + "\"%s\"\nfrom the database?", "Cancel", "Delete", + NULL, itempath)) { Fl_Preferences db(Fl_Preferences::USER, "fltk.org", "fluid_comments"); db.deleteEntry(itempath); comment_predefined->remove(last_selected_item); @@ -1221,7 +1219,7 @@ void Fl_Comment_Type::open() { if (comment_predefined->item_pathname(itempath, 255)==0) { if (itempath[0]=='/') memmove(itempath, itempath+1, 255); Fl_Preferences db(Fl_Preferences::USER, "fltk.org", "fluid_comments"); - char *text; + char *text; db.get(itempath, text, "(no text found in data base)"); comment_input->buffer()->text(text); free(text); @@ -1231,9 +1229,9 @@ void Fl_Comment_Type::open() { } else if (w == comment_load) { // load a comment from disk - fl_file_chooser_ok_label("Use File"); + fl_file_chooser_ok_label("Use File"); const char *fname = fl_file_chooser("Pick a comment", 0L, 0L); - fl_file_chooser_ok_label(NULL); + fl_file_chooser_ok_label(NULL); if (fname) { if (comment_input->buffer()->loadfile(fname)) { fl_alert("Error loading file\n%s", fname); @@ -1263,7 +1261,7 @@ BREAK2: } const char *Fl_Comment_Type::title() { - const char* n = name(); + const char* n = name(); if (!n || !*n) return type_name(); if (title_buf[0]==0) { const char *s = n; @@ -1338,11 +1336,11 @@ const char* Fl_Type::class_name(const int need_nest) const { const char* q = 0; if(need_nest) q=p->class_name(need_nest); if (q) { - static char s[256]; - if (q != s) strlcpy(s, q, sizeof(s)); - strlcat(s, "::", sizeof(s)); - strlcat(s, p->name(), sizeof(s)); - return s; + static char s[256]; + if (q != s) strlcpy(s, q, sizeof(s)); + strlcat(s, "::", sizeof(s)); + strlcat(s, p->name(), sizeof(s)); + return s; } return p->name(); } @@ -1412,9 +1410,9 @@ void Fl_Class_Type::read_property(const char *c) { void Fl_Class_Type::open() { if (!class_panel) make_class_panel(); char fullname[FL_PATH_MAX]=""; - if (prefix() && strlen(prefix())) + if (prefix() && strlen(prefix())) sprintf(fullname,"%s %s",prefix(),name()); - else + else strcpy(fullname, name()); c_name_input->static_value(fullname); c_subclass_input->static_value(subclass_of); @@ -1423,9 +1421,9 @@ void Fl_Class_Type::open() { c_comment_input->buffer()->text(c?c:""); class_panel->show(); const char* message = 0; - + char *na=0,*pr=0,*p=0; // name and prefix substrings - + for (;;) { // repeat as long as there are errors if (message) fl_alert("%s", message); for (;;) { @@ -1454,7 +1452,7 @@ void Fl_Class_Type::open() { if (p<s) p++; if (is_id(*p) && p<na) pr=p; // prefix detected c = c_subclass_input->value(); - message = c_check(c); + message = c_check(c); if (message) { free((void*)s);continue;} name(na); prefix(pr); @@ -1529,7 +1527,3 @@ int Fl_Class_Type::has_function(const char *rtype, const char *sig) const { } return 0; } - -// -// End of "$Id$". -// diff --git a/fluid/Fl_Group_Type.cxx b/fluid/Fl_Group_Type.cxx index 6fa4cf867..cc6fb59a6 100644 --- a/fluid/Fl_Group_Type.cxx +++ b/fluid/Fl_Group_Type.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Group object code for the Fast Light Tool Kit (FLTK). // // Object describing an Fl_Group and links to Fl_Window_Type.C and @@ -13,11 +11,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/Fl.H> @@ -33,7 +31,7 @@ void igroup::resize(int X, int Y, int W, int H) { redraw(); } -Fl_Group_Type Fl_Group_type; // the "factory" +Fl_Group_Type Fl_Group_type; // the "factory" Fl_Type *Fl_Group_Type::make() { return Fl_Widget_Type::make(); @@ -49,8 +47,8 @@ void fix_group_size(Fl_Type *tt) { for (Fl_Type *nn = t->next; nn && nn->level > t->level; nn = nn->next) { if (!nn->is_widget() || nn->is_menu_item()) continue; Fl_Widget_Type* n = (Fl_Widget_Type*)nn; - int x = n->o->x(); if (x < X) X = x; - int y = n->o->y(); if (y < Y) Y = y; + int x = n->o->x(); if (x < X) X = x; + int y = n->o->y(); if (y < Y) Y = y; int r = x+n->o->w();if (r > R) R = r; int b = y+n->o->h();if (b > B) B = b; } @@ -133,7 +131,7 @@ Fl_Menu_Item pack_type_menu[] = { {"VERTICAL", 0, 0, (void*)Fl_Pack::VERTICAL}, {0}}; -Fl_Pack_Type Fl_Pack_type; // the "factory" +Fl_Pack_Type Fl_Pack_type; // the "factory" //////////////////////////////////////////////////////////////// @@ -143,7 +141,7 @@ static const int MAX_COLS = 7; // this is a minimal table widget used as an example when adding tables in Fluid class Fluid_Table : public Fl_Table { int data[MAX_ROWS][MAX_COLS]; // data array for cells - + // Draw the row/col headings // Make this a dark thin upbox with the text inside. // @@ -153,7 +151,7 @@ class Fluid_Table : public Fl_Table { fl_color(FL_BLACK); fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); fl_pop_clip(); - } + } // Draw the cell data // Dark gray text on white background with subtle border // @@ -166,7 +164,7 @@ class Fluid_Table : public Fl_Table { // Draw box border fl_color(color()); fl_rect(X,Y,W,H); fl_pop_clip(); - } + } // Handle drawing table's cells // Fl_Table calls this function to draw each visible cell in the table. // It's up to us to use FLTK's drawing functions to draw the cells the way we want. @@ -176,15 +174,15 @@ class Fluid_Table : public Fl_Table { switch ( context ) { case CONTEXT_STARTPAGE: // before page is drawn.. fl_font(FL_HELVETICA, 16); // set the font for our drawing operations - return; + return; case CONTEXT_COL_HEADER: // Draw column headers sprintf(s,"%c",'A'+COL); // "A", "B", "C", etc. DrawHeader(s,X,Y,W,H); - return; + return; case CONTEXT_ROW_HEADER: // Draw row headers sprintf(s,"%03d:",ROW); // "001:", "002:", etc DrawHeader(s,X,Y,W,H); - return; + return; case CONTEXT_CELL: // Draw data in cells sprintf(s,"%d",data[ROW][COL]); DrawData(s,X,Y,W,H); @@ -215,7 +213,7 @@ public: const char table_type_name[] = "Fl_Table"; -Fl_Table_Type Fl_Table_type; // the "factory" +Fl_Table_Type Fl_Table_type; // the "factory" Fl_Widget *Fl_Table_Type::widget(int X,int Y,int W,int H) { Fluid_Table *table = new Fluid_Table(X, Y, W, H); @@ -232,7 +230,7 @@ void itabs::resize(int X, int Y, int W, int H) { redraw(); } -Fl_Tabs_Type Fl_Tabs_type; // the "factory" +Fl_Tabs_Type Fl_Tabs_type; // the "factory" // This is called when user clicks on a widget in the window. See // if it is a tab title, and adjust visibility and return new selection: @@ -263,7 +261,7 @@ void iwizard::resize(int X, int Y, int W, int H) { redraw(); } -Fl_Wizard_Type Fl_Wizard_type; // the "factory" +Fl_Wizard_Type Fl_Wizard_type; // the "factory" // This is called when o is created. If it is in the tab group make // sure it is visible: @@ -409,7 +407,7 @@ Fl_Menu_Item scroll_type_menu[] = { {"BOTH_ALWAYS", 0, 0, (void*)Fl_Scroll::BOTH_ALWAYS}, {0}}; -Fl_Scroll_Type Fl_Scroll_type; // the "factory" +Fl_Scroll_Type Fl_Scroll_type; // the "factory" void Fl_Scroll_Type::copy_properties() { Fl_Group_Type::copy_properties(); @@ -424,13 +422,9 @@ void Fl_Scroll_Type::copy_properties() { const char tile_type_name[] = "Fl_Tile"; -Fl_Tile_Type Fl_Tile_type; // the "factory" +Fl_Tile_Type Fl_Tile_type; // the "factory" void Fl_Tile_Type::copy_properties() { Fl_Group_Type::copy_properties(); // no additional properties } - -// -// End of "$Id$". -// diff --git a/fluid/Fl_Menu_Type.cxx b/fluid/Fl_Menu_Type.cxx index 448b898e6..5c1a56f30 100644 --- a/fluid/Fl_Menu_Type.cxx +++ b/fluid/Fl_Menu_Type.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Menu item code for the Fast Light Tool Kit (FLTK). // // Menu items are kludged by making a phony Fl_Box widget so the normal @@ -15,11 +13,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/Fl.H> @@ -90,7 +88,7 @@ void Fl_Input_Choice_Type::build_menu() { if (q->is_parent()) {lvl++; m->flags |= FL_SUBMENU;} m++; int l1 = - (q->next && q->next->is_menu_item()) ? q->next->level : level; + (q->next && q->next->is_menu_item()) ? q->next->level : level; while (lvl > l1) {m->label(0); m++; lvl--;} lvl = l1; } @@ -226,7 +224,7 @@ void Fl_Menu_Item_Type::write_static() { // Go up one more level for Fl_Input_Choice, as these are groups themselves if (t && !strcmp(t->type_name(), "Fl_Input_Choice")) write_c("->parent()"); - for (t = t->parent; t && t->is_widget() && !is_class(); q = t, t = t->parent) + for (t = t->parent; t && t->is_widget() && !is_class(); q = t, t = t->parent) write_c("->parent()"); if (!q || strcmp(q->type_name(), "widget_class")) write_c("->user_data()"); @@ -244,11 +242,11 @@ void Fl_Menu_Item_Type::write_static() { // entire array out: const char* k = class_name(1); if (k) { - int i; + int i; if (i18n_type) write_c("\nunsigned char %s::%s_i18n_done = 0;", k, menu_name(i)); write_c("\nFl_Menu_Item %s::%s[] = {\n", k, menu_name(i)); } else { - int i; + int i; if (i18n_type) write_c("\nunsigned char %s_i18n_done = 0;", menu_name(i)); write_c("\nFl_Menu_Item %s[] = {\n", menu_name(i)); } @@ -271,11 +269,11 @@ void Fl_Menu_Item_Type::write_static() { if (c) { if (c==m->name()) { // assign a menu item address directly to a variable - int i; + int i; const char* n = ((Fl_Menu_Item_Type *)q)->menu_name(i); write_c("Fl_Menu_Item* %s::%s = %s::%s + %d;\n", k, c, k, n, i); } else { - // if the name is an array, only define the array. + // if the name is an array, only define the array. // The actual assignment is in write_code1() write_c("Fl_Menu_Item* %s::%s;\n", k, c); } @@ -315,12 +313,12 @@ void Fl_Menu_Item_Type::write_item() { else if (label()) write_cstring(label()); // we will call i18n when the widget is instantiated for the first time else write_c("\"\""); if (((Fl_Button*)o)->shortcut()) { - int s = ((Fl_Button*)o)->shortcut(); - if (use_FL_COMMAND && (s & (FL_CTRL|FL_META))) { - write_c(", FL_COMMAND|0x%x, ", s & ~(FL_CTRL|FL_META)); - } else { - write_c(", 0x%x, ", s); - } + int s = ((Fl_Button*)o)->shortcut(); + if (use_FL_COMMAND && (s & (FL_CTRL|FL_META))) { + write_c(", FL_COMMAND|0x%x, ", s & ~(FL_CTRL|FL_META)); + } else { + write_c(", 0x%x, ", s); + } } else write_c(", 0, "); if (callback()) { @@ -337,7 +335,7 @@ void Fl_Menu_Item_Type::write_item() { else write_c(" 0,"); write_c(" %d, (uchar)%s, %d, %d, %d", flags(), - labeltypes[o->labeltype()], o->labelfont(), o->labelsize(), o->labelcolor()); + labeltypes[o->labeltype()], o->labelfont(), o->labelsize(), o->labelcolor()); write_c("},\n"); } @@ -449,7 +447,7 @@ void Fl_Menu_Type::build_menu() { if (q->is_parent()) {lvl++; m->flags |= FL_SUBMENU;} m++; int l1 = - (q->next && q->next->is_menu_item()) ? q->next->level : level; + (q->next && q->next->is_menu_item()) ? q->next->level : level; while (lvl > l1) {m->label(0); m++; lvl--;} lvl = l1; } @@ -484,10 +482,10 @@ void Fl_Menu_Type::write_code2() { const char *mName = mi->menu_name(i); for (Fl_Type* q = next; q && q->is_menu_item(); q = q->next) { if (((Fl_Menu_Item_Type*)q)->label()) nLabel++; - int thislevel = q->level; if (q->is_parent()) thislevel++; - int nextlevel = - (q->next && q->next->is_menu_item()) ? q->next->level : next->level+1; - nItem += 1 + ((thislevel > nextlevel) ? (thislevel-nextlevel) : 0); + int thislevel = q->level; if (q->is_parent()) thislevel++; + int nextlevel = + (q->next && q->next->is_menu_item()) ? q->next->level : next->level+1; + nItem += 1 + ((thislevel > nextlevel) ? (thislevel-nextlevel) : 0); } if (nLabel) { write_c("%sif (!%s_i18n_done) {\n", indent(), mName); @@ -501,7 +499,7 @@ void Fl_Menu_Type::write_code2() { break; case 2: write_c("%s %s[i].label(catgets(%s,%s,i+%d,%s[i].label()));\n", - indent(), mName, i18n_file[0] ? i18n_file : "_catalog", + indent(), mName, i18n_file[0] ? i18n_file : "_catalog", i18n_set, mi->msgnum(), mName); break; } @@ -510,7 +508,7 @@ void Fl_Menu_Type::write_code2() { } } write_c("%s%s->menu(%s);\n", indent(), name() ? name() : "o", - unique_id(this, "menu", name(), label())); + unique_id(this, "menu", name(), label())); } Fl_Widget_Type::write_code2(); } @@ -592,13 +590,13 @@ void Shortcut_Button::draw() { if (value()) draw_box(FL_DOWN_BOX, (Fl_Color)9); else draw_box(FL_UP_BOX, FL_WHITE); fl_font(FL_HELVETICA,14); fl_color(FL_FOREGROUND_COLOR); - if (use_FL_COMMAND && (svalue & (FL_CTRL|FL_META))) { - char buf[1024]; - fl_snprintf(buf, 1023, "Command+%s", fl_shortcut_label(svalue&~(FL_CTRL|FL_META))); - fl_draw(buf,x()+6,y(),w(),h(),FL_ALIGN_LEFT); - } else { - fl_draw(fl_shortcut_label(svalue),x()+6,y(),w(),h(),FL_ALIGN_LEFT); - } + if (use_FL_COMMAND && (svalue & (FL_CTRL|FL_META))) { + char buf[1024]; + fl_snprintf(buf, 1023, "Command+%s", fl_shortcut_label(svalue&~(FL_CTRL|FL_META))); + fl_draw(buf,x()+6,y(),w(),h(),FL_ALIGN_LEFT); + } else { + fl_draw(fl_shortcut_label(svalue),x()+6,y(),w(),h(),FL_ALIGN_LEFT); + } } int Shortcut_Button::handle(int e) { @@ -629,7 +627,7 @@ int Shortcut_Button::handle(int e) { return r; } } - + void shortcut_in_cb(Shortcut_Button* i, void* v) { if (v == LOAD) { if (current_widget->is_button()) @@ -650,27 +648,23 @@ void shortcut_in_cb(Shortcut_Button* i, void* v) { int mod = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_button()) { - Fl_Button* b = (Fl_Button*)(((Fl_Widget_Type*)o)->o); + Fl_Button* b = (Fl_Button*)(((Fl_Widget_Type*)o)->o); if (b->shortcut()!=i->svalue) mod = 1; - b->shortcut(i->svalue); - if (o->is_menu_item()) ((Fl_Widget_Type*)o)->redraw(); + b->shortcut(i->svalue); + if (o->is_menu_item()) ((Fl_Widget_Type*)o)->redraw(); } else if (o->selected && o->is_input()) { - Fl_Input_* b = (Fl_Input_*)(((Fl_Widget_Type*)o)->o); + Fl_Input_* b = (Fl_Input_*)(((Fl_Widget_Type*)o)->o); if (b->shortcut()!=i->svalue) mod = 1; - b->shortcut(i->svalue); + b->shortcut(i->svalue); } else if (o->selected && o->is_value_input()) { - Fl_Value_Input* b = (Fl_Value_Input*)(((Fl_Widget_Type*)o)->o); + Fl_Value_Input* b = (Fl_Value_Input*)(((Fl_Widget_Type*)o)->o); if (b->shortcut()!=i->svalue) mod = 1; - b->shortcut(i->svalue); + b->shortcut(i->svalue); } else if (o->selected && o->is_text_display()) { - Fl_Text_Display* b = (Fl_Text_Display*)(((Fl_Widget_Type*)o)->o); + Fl_Text_Display* b = (Fl_Text_Display*)(((Fl_Widget_Type*)o)->o); if (b->shortcut()!=i->svalue) mod = 1; - b->shortcut(i->svalue); + b->shortcut(i->svalue); } if (mod) set_modflag(1); } } - -// -// End of "$Id$". -// diff --git a/fluid/Fl_Type.cxx b/fluid/Fl_Type.cxx index 33cec2609..12103d8f8 100644 --- a/fluid/Fl_Type.cxx +++ b/fluid/Fl_Type.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Widget type code for the Fast Light Tool Kit (FLTK). // // Each object described by Fluid is one of these objects. They @@ -21,11 +19,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/Fl.H> @@ -44,10 +42,10 @@ #include "pixmaps/invisible.xpm" //#include "pixmaps/unlock.xpm" -static Fl_Pixmap lock_pixmap(lock_xpm); +static Fl_Pixmap lock_pixmap(lock_xpm); static Fl_Pixmap protected_pixmap(protected_xpm); static Fl_Pixmap invisible_pixmap(invisible_xpm); -//static Fl_Pixmap unlock_pixmap(unlock_xpm); +//static Fl_Pixmap unlock_pixmap(unlock_xpm); #include "pixmaps/flWindow.xpm" #include "pixmaps/flButton.xpm" @@ -102,66 +100,66 @@ static Fl_Pixmap invisible_pixmap(invisible_xpm); #include "pixmaps/flTable.xpm" #include "pixmaps/flSimpleTerminal.xpm" -static Fl_Pixmap window_pixmap(flWindow_xpm); -static Fl_Pixmap button_pixmap(flButton_xpm); -static Fl_Pixmap checkbutton_pixmap(flCheckButton_xpm); -static Fl_Pixmap roundbutton_pixmap(flRoundButton_xpm); -static Fl_Pixmap box_pixmap(flBox_xpm); -static Fl_Pixmap group_pixmap(flGroup_xpm); -static Fl_Pixmap function_pixmap(flFunction_xpm); -static Fl_Pixmap code_pixmap(flCode_xpm); -static Fl_Pixmap codeblock_pixmap(flCodeBlock_xpm); -static Fl_Pixmap comment_pixmap(flComment_xpm); -static Fl_Pixmap declaration_pixmap(flDeclaration_xpm); -static Fl_Pixmap declarationblock_pixmap(flDeclarationBlock_xpm); -static Fl_Pixmap class_pixmap(flClass_xpm); -static Fl_Pixmap tabs_pixmap(flTabs_xpm); -static Fl_Pixmap input_pixmap(flInput_xpm); -static Fl_Pixmap choice_pixmap(flChoice_xpm); -static Fl_Pixmap menuitem_pixmap(flMenuitem_xpm); -static Fl_Pixmap menubar_pixmap(flMenubar_xpm); -static Fl_Pixmap submenu_pixmap(flSubmenu_xpm); -static Fl_Pixmap scroll_pixmap(flScroll_xpm); -static Fl_Pixmap tile_pixmap(flTile_xpm); -static Fl_Pixmap wizard_pixmap(flWizard_xpm); -static Fl_Pixmap pack_pixmap(flPack_xpm); -static Fl_Pixmap returnbutton_pixmap(flReturnButton_xpm); -static Fl_Pixmap lightbutton_pixmap(flLightButton_xpm); -static Fl_Pixmap repeatbutton_pixmap(flRepeatButton_xpm); -static Fl_Pixmap menubutton_pixmap(flMenuButton_xpm); -static Fl_Pixmap output_pixmap(flOutput_xpm); -static Fl_Pixmap textdisplay_pixmap(flTextDisplay_xpm); -static Fl_Pixmap textedit_pixmap(flTextEdit_xpm); -static Fl_Pixmap fileinput_pixmap(flFileInput_xpm); -static Fl_Pixmap browser_pixmap(flBrowser_xpm); -static Fl_Pixmap checkbrowser_pixmap(flCheckBrowser_xpm); -static Fl_Pixmap filebrowser_pixmap(flFileBrowser_xpm); -static Fl_Pixmap clock_pixmap(flClock_xpm); -static Fl_Pixmap help_pixmap(flHelp_xpm); -static Fl_Pixmap progress_pixmap(flProgress_xpm); -static Fl_Pixmap slider_pixmap(flSlider_xpm); -static Fl_Pixmap scrollbar_pixmap(flScrollBar_xpm); -static Fl_Pixmap valueslider_pixmap(flValueSlider_xpm); -static Fl_Pixmap adjuster_pixmap(flAdjuster_xpm); -static Fl_Pixmap counter_pixmap(flCounter_xpm); -static Fl_Pixmap dial_pixmap(flDial_xpm); -static Fl_Pixmap roller_pixmap(flRoller_xpm); -static Fl_Pixmap valueinput_pixmap(flValueInput_xpm); -static Fl_Pixmap valueoutput_pixmap(flValueOutput_xpm); -static Fl_Pixmap spinner_pixmap(flSpinner_xpm); -static Fl_Pixmap widgetclass_pixmap(flWidgetClass_xpm); -static Fl_Pixmap data_pixmap(flData_xpm); -static Fl_Pixmap tree_pixmap(flTree_xpm); +static Fl_Pixmap window_pixmap(flWindow_xpm); +static Fl_Pixmap button_pixmap(flButton_xpm); +static Fl_Pixmap checkbutton_pixmap(flCheckButton_xpm); +static Fl_Pixmap roundbutton_pixmap(flRoundButton_xpm); +static Fl_Pixmap box_pixmap(flBox_xpm); +static Fl_Pixmap group_pixmap(flGroup_xpm); +static Fl_Pixmap function_pixmap(flFunction_xpm); +static Fl_Pixmap code_pixmap(flCode_xpm); +static Fl_Pixmap codeblock_pixmap(flCodeBlock_xpm); +static Fl_Pixmap comment_pixmap(flComment_xpm); +static Fl_Pixmap declaration_pixmap(flDeclaration_xpm); +static Fl_Pixmap declarationblock_pixmap(flDeclarationBlock_xpm); +static Fl_Pixmap class_pixmap(flClass_xpm); +static Fl_Pixmap tabs_pixmap(flTabs_xpm); +static Fl_Pixmap input_pixmap(flInput_xpm); +static Fl_Pixmap choice_pixmap(flChoice_xpm); +static Fl_Pixmap menuitem_pixmap(flMenuitem_xpm); +static Fl_Pixmap menubar_pixmap(flMenubar_xpm); +static Fl_Pixmap submenu_pixmap(flSubmenu_xpm); +static Fl_Pixmap scroll_pixmap(flScroll_xpm); +static Fl_Pixmap tile_pixmap(flTile_xpm); +static Fl_Pixmap wizard_pixmap(flWizard_xpm); +static Fl_Pixmap pack_pixmap(flPack_xpm); +static Fl_Pixmap returnbutton_pixmap(flReturnButton_xpm); +static Fl_Pixmap lightbutton_pixmap(flLightButton_xpm); +static Fl_Pixmap repeatbutton_pixmap(flRepeatButton_xpm); +static Fl_Pixmap menubutton_pixmap(flMenuButton_xpm); +static Fl_Pixmap output_pixmap(flOutput_xpm); +static Fl_Pixmap textdisplay_pixmap(flTextDisplay_xpm); +static Fl_Pixmap textedit_pixmap(flTextEdit_xpm); +static Fl_Pixmap fileinput_pixmap(flFileInput_xpm); +static Fl_Pixmap browser_pixmap(flBrowser_xpm); +static Fl_Pixmap checkbrowser_pixmap(flCheckBrowser_xpm); +static Fl_Pixmap filebrowser_pixmap(flFileBrowser_xpm); +static Fl_Pixmap clock_pixmap(flClock_xpm); +static Fl_Pixmap help_pixmap(flHelp_xpm); +static Fl_Pixmap progress_pixmap(flProgress_xpm); +static Fl_Pixmap slider_pixmap(flSlider_xpm); +static Fl_Pixmap scrollbar_pixmap(flScrollBar_xpm); +static Fl_Pixmap valueslider_pixmap(flValueSlider_xpm); +static Fl_Pixmap adjuster_pixmap(flAdjuster_xpm); +static Fl_Pixmap counter_pixmap(flCounter_xpm); +static Fl_Pixmap dial_pixmap(flDial_xpm); +static Fl_Pixmap roller_pixmap(flRoller_xpm); +static Fl_Pixmap valueinput_pixmap(flValueInput_xpm); +static Fl_Pixmap valueoutput_pixmap(flValueOutput_xpm); +static Fl_Pixmap spinner_pixmap(flSpinner_xpm); +static Fl_Pixmap widgetclass_pixmap(flWidgetClass_xpm); +static Fl_Pixmap data_pixmap(flData_xpm); +static Fl_Pixmap tree_pixmap(flTree_xpm); static Fl_Pixmap table_pixmap(flTable_xpm); static Fl_Pixmap simple_terminal_pixmap(flSimpleTerminal_xpm); Fl_Pixmap *pixmap[] = { 0, &window_pixmap, &button_pixmap, &checkbutton_pixmap, &roundbutton_pixmap, /* 0..4 */ - &box_pixmap, &group_pixmap, &function_pixmap, &code_pixmap, &codeblock_pixmap, &declaration_pixmap, /* 5..10 */ + &box_pixmap, &group_pixmap, &function_pixmap, &code_pixmap, &codeblock_pixmap, &declaration_pixmap, /* 5..10 */ &declarationblock_pixmap, &class_pixmap, &tabs_pixmap, &input_pixmap, &choice_pixmap, /* 11..15 */ &menuitem_pixmap, &menubar_pixmap, &submenu_pixmap, &scroll_pixmap, &tile_pixmap, &wizard_pixmap, /* 16..21 */ &pack_pixmap, &returnbutton_pixmap, &lightbutton_pixmap, &repeatbutton_pixmap, &menubutton_pixmap, /* 22..26 */ &output_pixmap, &textdisplay_pixmap, &textedit_pixmap, &fileinput_pixmap, &browser_pixmap, /* 27..32 */ - &checkbrowser_pixmap, &filebrowser_pixmap, &clock_pixmap, &help_pixmap, &progress_pixmap, /* 33..36 */ + &checkbrowser_pixmap, &filebrowser_pixmap, &clock_pixmap, &help_pixmap, &progress_pixmap, /* 33..36 */ &slider_pixmap, &scrollbar_pixmap, &valueslider_pixmap, &adjuster_pixmap, &counter_pixmap, /* 37..41 */ &dial_pixmap, &roller_pixmap, &valueinput_pixmap, &valueoutput_pixmap, &comment_pixmap, /* 42..46 */ &spinner_pixmap, &widgetclass_pixmap, &data_pixmap, &tree_pixmap, &table_pixmap, /* 47..51 */ @@ -186,23 +184,23 @@ extern int show_comments; static char *copy_trunc(char *p, const char *str, int maxl, int quote) { - int size = 0; // truncated string size in characters - int bs; // size of UTF-8 character in bytes - const char *end = str + strlen(str); // end of input string - if (quote) *p++ = '"'; // opening quote - while (size < maxl) { // maximum <maxl> characters - if (!(*str & (-32))) break; // end of string (0 or control char) - bs = fl_utf8len(*str); // size of next character - if (bs <= 0) break; // some error - leave - if (str + bs > end) break; // UTF-8 sequence beyond end of string - while (bs--) *p++ = *str++; // copy that character into the buffer - size++; // count copied characters + int size = 0; // truncated string size in characters + int bs; // size of UTF-8 character in bytes + const char *end = str + strlen(str); // end of input string + if (quote) *p++ = '"'; // opening quote + while (size < maxl) { // maximum <maxl> characters + if (!(*str & (-32))) break; // end of string (0 or control char) + bs = fl_utf8len(*str); // size of next character + if (bs <= 0) break; // some error - leave + if (str + bs > end) break; // UTF-8 sequence beyond end of string + while (bs--) *p++ = *str++; // copy that character into the buffer + size++; // count copied characters } - if (*str) { // string was truncated + if (*str) { // string was truncated strcpy(p,"..."); p += 3; } - if (quote) *p++ = '"'; // closing quote - *p = 0; // terminating null byte + if (quote) *p++ = '"'; // closing quote + *p = 0; // terminating null byte return p; } @@ -222,7 +220,7 @@ class Widget_Browser : public Fl_Browser_ { void item_draw(void *,int,int,int,int) const ; int incr_height() const ; -public: +public: int handle(int); void callback(); @@ -320,10 +318,10 @@ extern const char* subclassname(Fl_Type*); followed by the name of the object. Other objects show their content as text, possibly abbreviated with an ellipsis. - \param v v is a pointer to the actual widget type and can be cast safely - to Fl_Type - \param X,Y these give the position in window coordinates of the top left - corner of this line + \param v v is a pointer to the actual widget type and can be cast safely + to Fl_Type + \param X,Y these give the position in window coordinates of the top left + corner of this line */ void Widget_Browser::item_draw(void *v, int X, int Y, int, int) const { // cast to a more general type @@ -355,10 +353,10 @@ void Widget_Browser::item_draw(void *v, int X, int Y, int, int) const { Y += comment_incr/2; comment_incr -= comment_incr/2; } - + if (l->new_selected) fl_color(fl_contrast(FL_FOREGROUND_COLOR,FL_SELECTION_COLOR)); else fl_color(FL_FOREGROUND_COLOR); - + // Width=10: Draw the triangle that indicates possible children if (l->is_parent()) { X = X - 18 - 13; @@ -381,11 +379,11 @@ void Widget_Browser::item_draw(void *v, int X, int Y, int, int) const { } X = X + 13 + 18; } - + // Width=18: Draw the icon associated with the type. Fl_Pixmap *pm = pixmap[l->pixmapID()]; if (pm) pm->draw(X-18, Y); - + // Add tags on top of the icon for locked and protected types. switch (l->is_public()) { case 0: lock_pixmap.draw(X - 17, Y); break; @@ -395,7 +393,7 @@ void Widget_Browser::item_draw(void *v, int X, int Y, int, int) const { if (l->is_widget() && ((Fl_Widget_Type*)l)->o && !((Fl_Widget_Type*)l)->o->visible()) { invisible_pixmap.draw(X - 17, Y); } - + // Indent=12 per level: Now write the text that comes after the graphics representation Y += comment_incr; if (l->is_widget() || l->is_class()) { @@ -492,9 +490,9 @@ int Widget_Browser::handle(int e) { if (l) { X += 3 + 12*l->level - hposition(); if (l->is_parent() && Fl::event_x()>X && Fl::event_x()<X+13) { - title = pushedtitle = l; - redraw_line(l); - return 1; + title = pushedtitle = l; + redraw_line(l); + return 1; } } break; @@ -516,27 +514,27 @@ int Widget_Browser::handle(int e) { if (!title) { l = (Fl_Type*)find_item(Fl::event_y()); if (l && l->new_selected && (Fl::event_clicks() || Fl::event_state(FL_CTRL))) - l->open(); + l->open(); break; } l = pushedtitle; title = pushedtitle = 0; if (l) { if (l->open_) { - l->open_ = 0; - for (Fl_Type*k = l->next; k&&k->level>l->level; k = k->next) - k->visible = 0; + l->open_ = 0; + for (Fl_Type*k = l->next; k&&k->level>l->level; k = k->next) + k->visible = 0; } else { - l->open_ = 1; - for (Fl_Type*k=l->next; k&&k->level>l->level;) { - k->visible = 1; - if (k->is_parent() && !k->open_) { - Fl_Type *j; - for (j = k->next; j && j->level>k->level; j = j->next) {/*empty*/} - k = j; - } else - k = k->next; - } + l->open_ = 1; + for (Fl_Type*k=l->next; k&&k->level>l->level;) { + k->visible = 1; + if (k->is_parent() && !k->open_) { + Fl_Type *j; + for (j = k->next; j && j->level>k->level; j = j->next) {/*empty*/} + k = j; + } else + k = k->next; + } } redraw(); } @@ -640,8 +638,8 @@ void Fl_Type::insert(Fl_Type *g) { // Return message number for I18N... int Fl_Type::msgnum() { - int count; - Fl_Type *p; + int count; + Fl_Type *p; for (count = 0, p = this; p;) { if (p->label()) count ++; @@ -686,7 +684,7 @@ int storestring(const char *n, const char * & p, int nostrip) { if (!nostrip) while (e > n && isspace((int)(unsigned char)*(e-1))) e--; length = e-n; if (!length) n = 0; - } + } if (n == p) return 0; if (n && p && !strncmp(n,p,length) && !p[length]) return 0; if (p) free((void *)p); @@ -792,13 +790,13 @@ void select_all_cb(Fl_Widget *,void *) { if (p) { int foundany = 0; for (Fl_Type *t = p->next; t && t->level>p->level; t = t->next) { - if (!t->new_selected) {widget_browser->select(t,1,0); foundany = 1;} + if (!t->new_selected) {widget_browser->select(t,1,0); foundany = 1;} } if (foundany) break; p = p->parent; } else { for (Fl_Type *t = Fl_Type::first; t; t = t->next) - widget_browser->select(t,1,0); + widget_browser->select(t,1,0); break; } } @@ -816,13 +814,13 @@ void select_none_cb(Fl_Widget *,void *) { if (p) { int foundany = 0; for (Fl_Type *t = p->next; t && t->level>p->level; t = t->next) { - if (t->new_selected) {widget_browser->select(t,0,0); foundany = 1;} + if (t->new_selected) {widget_browser->select(t,0,0); foundany = 1;} } if (foundany) break; p = p->parent; } else { for (Fl_Type *t = Fl_Type::first; t; t = t->next) - widget_browser->select(t,0,0); + widget_browser->select(t,0,0); break; } } @@ -849,9 +847,9 @@ void delete_all(int selected_only) { } else f = f->next; } if(!selected_only) { - include_H_from_C=1; - use_FL_COMMAND=0; - } + include_H_from_C=1; + use_FL_COMMAND=0; + } selection_changed(0); } @@ -860,7 +858,7 @@ void delete_all(int selected_only) { // returns pointer to whatever is after f & children void Fl_Type::move_before(Fl_Type* g) { if (level != g->level) printf("move_before levels don't match! %d %d\n", - level, g->level); + level, g->level); Fl_Type* n; for (n = next; n && n->level > level; n = n->next) {/*empty*/} if (n == g) return; @@ -921,10 +919,10 @@ void later_cb(Fl_Widget*,void*) { void Fl_Type::write() { write_indent(level); write_word(type_name()); - + if (is_class()) { - const char * p = ((Fl_Class_Type*)this)->prefix(); - if (p && strlen(p)) + const char * p = ((Fl_Class_Type*)this)->prefix(); + if (p && strlen(p)) write_word(p); } @@ -937,7 +935,7 @@ void Fl_Type::write() { write_open(level); Fl_Type *child; for (child = next; child && child->level > level; child = child->next) - if (child->level == level+1) child->write(); + if (child->level == level+1) child->write(); write_close(level); } @@ -1141,8 +1139,3 @@ int Fl_Type::user_defined(const char* cbname) const { return 1; return 0; } - - -// -// End of "$Id$". -// diff --git a/fluid/Fl_Type.h b/fluid/Fl_Type.h index 6794bef37..6512ae317 100644 --- a/fluid/Fl_Type.h +++ b/fluid/Fl_Type.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Widget type header file for the Fast Light Tool Kit (FLTK). // // Each object described by Fluid is one of these objects. They @@ -18,11 +16,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/Fl_Widget.H> @@ -58,17 +56,17 @@ protected: const char *user_data_type_; const char *comment_; -public: // things that should not be public: +public: // things that should not be public: Fl_Type *parent; // parent, which is previous in list char new_selected; // browser highlight char selected; // copied here by selection_changed() - char open_; // state of triangle in browser + char open_; // state of triangle in browser char visible; // true if all parents are open - char rtti; // hack because I have no rtti, this is 0 for base class - int level; // number of parents over this + char rtti; // hack because I have no rtti, this is 0 for base class + int level; // number of parents over this static Fl_Type *first, *last; // linked list of all objects - Fl_Type *next, *prev; // linked list of all objects + Fl_Type *next, *prev; // linked list of all objects Fl_Type *factory; const char *callback_name(); @@ -86,7 +84,7 @@ public: void add(Fl_Type *parent); // add as new child void insert(Fl_Type *n); // insert into list before n - Fl_Type* remove(); // remove from list + Fl_Type* remove(); // remove from list void move_before(Fl_Type*); // move before a sibling virtual const char *title(); // string for browser @@ -112,7 +110,7 @@ public: virtual void remove_child(Fl_Type*); static Fl_Type *current; // most recently picked object - virtual void open(); // what happens when you double-click + virtual void open(); // what happens when you double-click // read and write data to a saved file: virtual void write(); @@ -166,8 +164,8 @@ class Fl_Function_Type : public Fl_Type { const char* return_type; char public_, cdecl_, constructor, havewidgets; public: - Fl_Function_Type() : - Fl_Type(), + Fl_Function_Type() : + Fl_Type(), return_type(0L), public_(0), cdecl_(0), constructor(0), havewidgets(0) { } ~Fl_Function_Type() { @@ -228,7 +226,7 @@ public: // 1 -- file changed, internal records updated, 'code' has new content // -1 -- error getting file info (get_ms_errmsg() has reason) // - // TODO: Figure out how saving a fluid file can be intercepted to grab + // TODO: Figure out how saving a fluid file can be intercepted to grab // current contents of editor file.. // int handle_editor_changes() { @@ -346,7 +344,7 @@ public: ~Fl_Class_Type() { if (subclass_of) free((void*)subclass_of); } - + // state variables for output: char write_public_state; // true when public: has been printed Fl_Class_Type* parent_class; // save class if nested @@ -590,13 +588,13 @@ protected: Fl_Menu_Item* subtypes() {return window_type_menu;} friend class Overlay_Window; - int mx,my; // mouse position during dragging - int x1,y1; // initial position of selection box - int bx,by,br,bt; // bounding box of selection before snapping - int sx,sy,sr,st; // bounding box of selection after snapping to guides + int mx,my; // mouse position during dragging + int x1,y1; // initial position of selection box + int bx,by,br,bt; // bounding box of selection before snapping + int sx,sy,sr,st; // bounding box of selection after snapping to guides int dx,dy; - int drag; // which parts of bbox are being moved - int numselected; // number of children selected + int drag; // which parts of bbox are being moved + int numselected; // number of children selected enum {LEFT=1,RIGHT=2,BOTTOM=4,TOP=8,DRAG=16,BOX=32}; void draw_overlay(); void newdx(); @@ -607,7 +605,7 @@ protected: void write_code2(); Fl_Widget_Type *_make() {return 0;} // we don't call this Fl_Widget *widget(int,int,int,int) {return 0;} - int recalc; // set by fix_overlay() + int recalc; // set by fix_overlay() void moveallchildren(); int pixmapID() { return 1; } @@ -622,8 +620,8 @@ public: void open(); - void fix_overlay(); // Update the bounding box, etc - uchar *read_image(int &ww, int &hh); // Read an image of the window + void fix_overlay(); // Update the bounding box, etc + uchar *read_image(int &ww, int &hh); // Read an image of the window virtual void write_properties(); virtual void read_property(const char *); @@ -918,14 +916,9 @@ public: // handle a command and return the number of args used, or 0 virtual int arg(int argc, char **argv, int &i) = 0; // optional test the plugin - virtual int test(const char *a1=0L, const char *a2=0L, const char *a3=0L) { + virtual int test(const char *a1=0L, const char *a2=0L, const char *a3=0L) { return 0; } // show a GUI panel to edit some data virtual void show_panel() { } }; - - -// -// End of "$Id$". -// diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index ca344170a..e63c299cd 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/fluid/Fl_Widget_Type.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Widget type code 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 // #include <FL/Fl.H> @@ -118,12 +116,12 @@ Fl_Type *Fl_Widget_Type::make() { // Figure out a position and size for the widget int X,Y,W,H; - if (is_group()) { // fill the parent with the widget + if (is_group()) { // fill the parent with the widget X = ULX+B; W = p->o->w()-B; Y = ULY+B; H = p->o->h()-B; - } else if (q != p) { // copy position and size of current widget + } else if (q != p) { // copy position and size of current widget W = q->o->w(); H = q->o->h(); X = q->o->x()+W; @@ -133,7 +131,7 @@ Fl_Type *Fl_Widget_Type::make() { Y = q->o->y()+H; if (Y+H > ULY+p->o->h()) Y = ULY+B; } - } else { // just make it small and square... + } else { // just make it small and square... X = ULX+B; Y = ULY+B; W = H = B; @@ -345,7 +343,7 @@ void name_public_member_cb(Fl_Choice* i, void* v) { // if this is not in a class, it can be only private or public w->public_ = (i->value()>0); } - mod = 1; + mod = 1; } } if (mod) { @@ -353,7 +351,7 @@ void name_public_member_cb(Fl_Choice* i, void* v) { redraw_browser(); } } -} +} void name_public_cb(Fl_Choice* i, void* v) { if (v == LOAD) { @@ -363,8 +361,8 @@ void name_public_cb(Fl_Choice* i, void* v) { int mod = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - ((Fl_Widget_Type*)o)->public_ = i->value(); - mod = 1; + ((Fl_Widget_Type*)o)->public_ = i->value(); + mod = 1; } } if (mod) { @@ -372,7 +370,7 @@ void name_public_cb(Fl_Choice* i, void* v) { redraw_browser(); } } -} +} static char* oldlabel; static unsigned oldlabellen; @@ -390,7 +388,7 @@ void label_cb(Fl_Input* i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { o->label(i->value()); - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -411,7 +409,7 @@ void image_cb(Fl_Input* i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { ((Fl_Widget_Type*)o)->image_name(i->value()); - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -422,17 +420,17 @@ void image_browse_cb(Fl_Button* b, void *v) { if (v == LOAD) { if (current_widget->is_widget() && !current_widget->is_window()) b->activate(); - else + else b->deactivate(); } else { int mod = 0; if (ui_find_image(image_input->value())) { image_input->value(ui_find_image_name); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { - if (o->selected && o->is_widget()) { - ((Fl_Widget_Type*)o)->image_name(ui_find_image_name); - mod = 1; - } + if (o->selected && o->is_widget()) { + ((Fl_Widget_Type*)o)->image_name(ui_find_image_name); + mod = 1; + } } if (mod) set_modflag(1); } @@ -453,7 +451,7 @@ void inactive_cb(Fl_Input* i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { ((Fl_Widget_Type*)o)->inactive_name(i->value()); - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -462,19 +460,19 @@ void inactive_cb(Fl_Input* i, void *v) { void inactive_browse_cb(Fl_Button* b, void *v) { if (v == LOAD) { - if (current_widget->is_widget() && !current_widget->is_window()) + if (current_widget->is_widget() && !current_widget->is_window()) b->activate(); - else + else b->deactivate(); } else { int mod = 0; if (ui_find_image(inactive_input->value())) { inactive_input->value(ui_find_image_name); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { - if (o->selected && o->is_widget()) { - ((Fl_Widget_Type*)o)->inactive_name(ui_find_image_name); - mod = 1; - } + if (o->selected && o->is_widget()) { + ((Fl_Widget_Type*)o)->inactive_name(ui_find_image_name); + mod = 1; + } } if (mod) set_modflag(1); } @@ -492,7 +490,7 @@ void tooltip_cb(Fl_Input* i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { ((Fl_Widget_Type*)o)->tooltip(i->value()); - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -513,13 +511,13 @@ void x_cb(Fl_Value_Input *i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - w->resize((int)i->value(), w->y(), w->w(), w->h()); - if (w->window()) w->window()->redraw(); - if (o->is_window()) { + w->resize((int)i->value(), w->y(), w->w(), w->h()); + if (w->window()) w->window()->redraw(); + if (o->is_window()) { ((Fl_Window *)w)->size_range(gridx, gridy, Fl::w(), Fl::h(), gridx, gridy, 0); - } - mod = 1; + } + mod = 1; } } if (mod) set_modflag(1); @@ -538,13 +536,13 @@ void y_cb(Fl_Value_Input *i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - w->resize(w->x(), (int)i->value(), w->w(), w->h()); - if (w->window()) w->window()->redraw(); - if (o->is_window()) { + w->resize(w->x(), (int)i->value(), w->w(), w->h()); + if (w->window()) w->window()->redraw(); + if (o->is_window()) { ((Fl_Window *)w)->size_range(gridx, gridy, Fl::w(), Fl::h(), gridx, gridy, 0); - } - mod = 1; + } + mod = 1; } } if (mod) set_modflag(1); @@ -563,13 +561,13 @@ void w_cb(Fl_Value_Input *i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - w->resize(w->x(), w->y(), (int)i->value(), w->h()); - if (w->window()) w->window()->redraw(); - if (o->is_window()) { + w->resize(w->x(), w->y(), (int)i->value(), w->h()); + if (w->window()) w->window()->redraw(); + if (o->is_window()) { ((Fl_Window *)w)->size_range(gridx, gridy, Fl::w(), Fl::h(), gridx, gridy, 0); - } - mod = 1; + } + mod = 1; } } if (mod) set_modflag(1); @@ -588,13 +586,13 @@ void h_cb(Fl_Value_Input *i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - w->resize(w->x(), w->y(), w->w(), (int)i->value()); - if (w->window()) w->window()->redraw(); - if (o->is_window()) { + w->resize(w->x(), w->y(), w->w(), (int)i->value()); + if (w->window()) w->window()->redraw(); + if (o->is_window()) { ((Fl_Window *)w)->size_range(gridx, gridy, Fl::w(), Fl::h(), gridx, gridy, 0); - } - mod = 1; + } + mod = 1; } } if (mod) set_modflag(1); @@ -615,7 +613,7 @@ void wc_relative_cb(Fl_Light_Button *i, void *v) { if (o->selected && !strcmp(current_widget->type_name(), "widget_class")) { Fl_Widget_Class_Type *t = (Fl_Widget_Class_Type *)o; t->wc_relative = i->value(); - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -746,10 +744,10 @@ void box_cb(Fl_Choice* i, void *v) { if (n == ZERO_ENTRY) n = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; q->o->box((Fl_Boxtype)n); q->redraw(); - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -780,18 +778,18 @@ void down_box_cb(Fl_Choice* i, void *v) { if (n == ZERO_ENTRY) n = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected) { - if (o->is_button() && !o->is_menu_item()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; + if (o->is_button() && !o->is_menu_item()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; ((Fl_Button*)(q->o))->down_box((Fl_Boxtype)n); if (((Fl_Button*)(q->o))->value()) q->redraw(); - } else if (!strcmp(o->type_name(), "Fl_Input_Choice")) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - ((Fl_Input_Choice*)(q->o))->down_box((Fl_Boxtype)n); - } else if (o->is_menu_button()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; + } else if (!strcmp(o->type_name(), "Fl_Input_Choice")) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + ((Fl_Input_Choice*)(q->o))->down_box((Fl_Boxtype)n); + } else if (o->is_menu_button()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; ((Fl_Menu_*)(q->o))->down_box((Fl_Boxtype)n); - } - mod = 1; + } + mod = 1; } } if (mod) set_modflag(1); @@ -832,9 +830,9 @@ void when_cb(Fl_Choice* i, void *v) { if (n == ZERO_ENTRY) n = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->o->when(n|(q->o->when()&FL_WHEN_NOT_CHANGED)); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->when(n|(q->o->when()&FL_WHEN_NOT_CHANGED)); + mod = 1; } } if (mod) set_modflag(1); @@ -850,9 +848,9 @@ void when_button_cb(Fl_Light_Button* i, void *v) { int n = i->value() ? FL_WHEN_NOT_CHANGED : 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->o->when(n|(q->o->when()&~FL_WHEN_NOT_CHANGED)); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->when(n|(q->o->when()&~FL_WHEN_NOT_CHANGED)); + mod = 1; } } if (mod) set_modflag(1); @@ -912,8 +910,8 @@ void hotspot_cb(Fl_Light_Button* i,void* v) { if (!p || !p->is_widget()) return; while (!p->is_window()) p = p->parent; for (Fl_Type *o = p->next; o && o->level > p->level; o = o->next) { - if (o->is_widget() && o != current_widget) - ((Fl_Widget_Type*)o)->hotspot(0); + if (o->is_widget() && o != current_widget) + ((Fl_Widget_Type*)o)->hotspot(0); } } set_modflag(1); @@ -930,17 +928,17 @@ void visible_cb(Fl_Light_Button* i, void* v) { int n = i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - n ? q->o->show() : q->o->hide(); - q->redraw(); - mod = 1; - if (n && q->parent && q->parent->type_name()) { - if (!strcmp(q->parent->type_name(), "Fl_Tabs")) { - ((Fl_Tabs *)q->o->parent())->value(q->o); - } else if (!strcmp(q->parent->type_name(), "Fl_Wizard")) { - ((Fl_Wizard *)q->o->parent())->value(q->o); - } - } + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + n ? q->o->show() : q->o->hide(); + q->redraw(); + mod = 1; + if (n && q->parent && q->parent->type_name()) { + if (!strcmp(q->parent->type_name(), "Fl_Tabs")) { + ((Fl_Tabs *)q->o->parent())->value(q->o); + } else if (!strcmp(q->parent->type_name(), "Fl_Wizard")) { + ((Fl_Wizard *)q->o->parent())->value(q->o); + } + } } } if (mod) { @@ -960,10 +958,10 @@ void active_cb(Fl_Light_Button* i, void* v) { int n = i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - n ? q->o->activate() : q->o->deactivate(); - q->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + n ? q->o->activate() : q->o->deactivate(); + q->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1001,10 +999,10 @@ void labelfont_cb(Fl_Choice* i, void *v) { int n = i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->o->labelfont(n); - q->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->labelfont(n); + q->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1021,10 +1019,10 @@ void labelsize_cb(Fl_Value_Input* i, void *v) { if (n <= 0) n = Fl_Widget_Type::default_size; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->o->labelsize(n); - q->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->labelsize(n); + q->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1056,10 +1054,10 @@ void labeltype_cb(Fl_Choice* i, void *v) { if (n<0) return; // should not happen for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* p = (Fl_Widget_Type*)o; - p->o->labeltype((Fl_Labeltype)n); - p->redraw(); - mod = 1; + Fl_Widget_Type* p = (Fl_Widget_Type*)o; + p->o->labeltype((Fl_Labeltype)n); + p->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1079,12 +1077,12 @@ void color_cb(Fl_Button* i, void *v) { c = d; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->o->color(c); q->o->redraw(); + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->color(c); q->o->redraw(); if (q->parent && q->parent->type_name() == tabs_type_name) { if (q->o->parent()) q->o->parent()->redraw(); } - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -1103,9 +1101,9 @@ void color2_cb(Fl_Button* i, void *v) { c = d; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->o->selection_color(c); q->o->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->selection_color(c); q->o->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1122,9 +1120,9 @@ void labelcolor_cb(Fl_Button* i, void *v) { c = d; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->o->labelcolor(c); q->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->labelcolor(c); q->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1166,29 +1164,29 @@ void align_cb(Fl_Button* i, void *v) { int mod = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - Fl_Align x = q->o->align(); - Fl_Align y; - if (i->value()) { - y = x | b; - if (b == FL_ALIGN_LEFT || b == FL_ALIGN_TOP) { - Fl_Button *b1 = relative(i,+1); - b1->clear(); - y = y & ~(b1->argument()); - } - if (b == FL_ALIGN_RIGHT || b == FL_ALIGN_BOTTOM) { - Fl_Button *b1 = relative(i,-1); - b1->clear(); - y = y & ~(b1->argument()); - } - } else { - y = x & ~b; - } - if (x != y) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + Fl_Align x = q->o->align(); + Fl_Align y; + if (i->value()) { + y = x | b; + if (b == FL_ALIGN_LEFT || b == FL_ALIGN_TOP) { + Fl_Button *b1 = relative(i,+1); + b1->clear(); + y = y & ~(b1->argument()); + } + if (b == FL_ALIGN_RIGHT || b == FL_ALIGN_BOTTOM) { + Fl_Button *b1 = relative(i,-1); + b1->clear(); + y = y & ~(b1->argument()); + } + } else { + y = x & ~b; + } + if (x != y) { q->o->align(y); - q->redraw(); - mod = 1; - } + q->redraw(); + mod = 1; + } } } if (mod) set_modflag(1); @@ -1210,14 +1208,14 @@ void align_position_cb(Fl_Choice *i, void *v) { int mod = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - Fl_Align x = q->o->align(); - Fl_Align y = (x & ~FL_ALIGN_POSITION_MASK) | b; - if (x != y) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + Fl_Align x = q->o->align(); + Fl_Align y = (x & ~FL_ALIGN_POSITION_MASK) | b; + if (x != y) { q->o->align(y); - q->redraw(); - mod = 1; - } + q->redraw(); + mod = 1; + } } } if (mod) set_modflag(1); @@ -1239,14 +1237,14 @@ void align_text_image_cb(Fl_Choice *i, void *v) { int mod = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - Fl_Align x = q->o->align(); - Fl_Align y = (x & ~FL_ALIGN_IMAGE_MASK) | b; - if (x != y) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + Fl_Align x = q->o->align(); + Fl_Align y = (x & ~FL_ALIGN_IMAGE_MASK) | b; + if (x != y) { q->o->align(y); - q->redraw(); - mod = 1; - } + q->redraw(); + mod = 1; + } } } if (mod) set_modflag(1); @@ -1308,7 +1306,7 @@ void user_data_cb(Fl_Input *i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected) { o->user_data(c); - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -1329,13 +1327,13 @@ void user_data_type_cb(Fl_Input *i, void *v) { else if (!strcmp(c,dflt)) c = 0; if (!d) { if (c && *c && c[strlen(c)-1] != '*' && strcmp(c,"long")) - d = "must be pointer or long"; + d = "must be pointer or long"; } if (d) {fl_message("Error in type: %s",d); haderror = 1; return;} for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected) { o->user_data_type(c); - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -1355,9 +1353,9 @@ void v_input_cb(Fl_Input* i, void* v) { if (d) {fl_message("Error in %s: %s",i->label(),d); haderror = 1; return;} for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type *t = (Fl_Widget_Type*)o; - t->extra_code(n,c); - mod = 1; + Fl_Widget_Type *t = (Fl_Widget_Type*)o; + t->extra_code(n,c); + mod = 1; } } if (mod) set_modflag(1); @@ -1373,9 +1371,9 @@ void subclass_cb(Fl_Input* i, void* v) { const char *c = i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type *t = (Fl_Widget_Type*)o; - t->subclass(c); - mod = 1; + Fl_Widget_Type *t = (Fl_Widget_Type*)o; + t->subclass(c); + mod = 1; } } if (mod) set_modflag(1); @@ -1401,10 +1399,10 @@ void textfont_cb(Fl_Choice* i, void* v) { n = (Fl_Font)i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->textstuff(1,n,s,c); - q->o->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->textstuff(1,n,s,c); + q->o->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1422,10 +1420,10 @@ void textsize_cb(Fl_Value_Input* i, void* v) { if (s <= 0) s = Fl_Widget_Type::default_size; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->textstuff(2,n,s,c); - q->o->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->textstuff(2,n,s,c); + q->o->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1446,9 +1444,9 @@ void textcolor_cb(Fl_Button* i, void* v) { c = d; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->textstuff(3,n,s,c); q->o->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->textstuff(3,n,s,c); q->o->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1564,8 +1562,8 @@ void set_max_size_cb(Fl_Button*, void* v) { void slider_size_cb(Fl_Value_Input* i, void* v) { if (v == LOAD) { - if (current_widget->is_window()) - i->parent()->hide(); + if (current_widget->is_window()) + i->parent()->hide(); else i->parent()->show(); if (current_widget->is_valuator()<2) {i->deactivate(); return;} @@ -1576,12 +1574,12 @@ void slider_size_cb(Fl_Value_Input* i, void* v) { double n = i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - if (q->is_valuator()>=2) { - ((Fl_Slider*)(q->o))->slider_size(n); - q->o->redraw(); - mod = 1; - } + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + if (q->is_valuator()>=2) { + ((Fl_Slider*)(q->o))->slider_size(n); + q->o->redraw(); + mod = 1; + } } } if (mod) set_modflag(1); @@ -1605,12 +1603,12 @@ void min_cb(Fl_Value_Input* i, void* v) { double n = i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - if (q->is_valuator()) { - ((Fl_Valuator*)(q->o))->minimum(n); - q->o->redraw(); - mod = 1; - } else if (q->is_spinner()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + if (q->is_valuator()) { + ((Fl_Valuator*)(q->o))->minimum(n); + q->o->redraw(); + mod = 1; + } else if (q->is_spinner()) { ((Fl_Spinner*)(q->o))->minimum(n); q->o->redraw(); mod = 1; @@ -1638,16 +1636,16 @@ void max_cb(Fl_Value_Input* i, void* v) { double n = i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - if (q->is_valuator()) { - ((Fl_Valuator*)(q->o))->maximum(n); - q->o->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + if (q->is_valuator()) { + ((Fl_Valuator*)(q->o))->maximum(n); + q->o->redraw(); + mod = 1; } else if (q->is_spinner()) { ((Fl_Spinner*)(q->o))->maximum(n); q->o->redraw(); mod = 1; - } + } } } if (mod) set_modflag(1); @@ -1698,25 +1696,25 @@ void value_cb(Fl_Value_Input* i, void* v) { } else if (current_widget->is_spinner()) { i->activate(); i->value(((Fl_Spinner*)(current_widget->o))->value()); - } else + } else i->deactivate(); } else { int mod = 0; double n = i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - if (q->is_valuator()) { - ((Fl_Valuator*)(q->o))->value(n); - mod = 1; - } else if (q->is_button()) { - ((Fl_Button*)(q->o))->value(n != 0); - if (q->is_menu_item()) q->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + if (q->is_valuator()) { + ((Fl_Valuator*)(q->o))->value(n); + mod = 1; + } else if (q->is_button()) { + ((Fl_Button*)(q->o))->value(n != 0); + if (q->is_menu_item()) q->redraw(); + mod = 1; } else if (q->is_spinner()) { ((Fl_Spinner*)(q->o))->value(n); mod = 1; - } + } } } if (mod) set_modflag(1); @@ -1857,7 +1855,7 @@ void live_mode_cb(Fl_Button*o,void *) { Fl_Window_Type *w = (Fl_Window_Type*)current_widget; int mw = w->sr_min_w; if (mw>0) mw += 20; int mh = w->sr_min_h; if (mh>0) mh += 55; - int MW = w->sr_max_w; if (MW>0) MW += 20; + int MW = w->sr_max_w; if (MW>0) MW += 20; int MH = w->sr_max_h; if (MH>2) MH += 55; if (mw || mh || MW || MH) live_window->size_range(mw, mh, MW, MH); @@ -1890,8 +1888,8 @@ static void load_panel() { current_widget=(Fl_Widget_Type*)Fl_Type::current; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->is_widget() && o->selected) { - numselected++; - if (!current_widget) current_widget = (Fl_Widget_Type*)o; + numselected++; + if (!current_widget) current_widget = (Fl_Widget_Type*)o; } } } @@ -1926,8 +1924,8 @@ void selection_changed(Fl_Type *p) { if (haderror) { Fl_Type *q = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { - o->new_selected = o->selected; - if (!q && o->selected) q = o; + o->new_selected = o->selected; + if (!q && o->selected) q = o; } if (!p || !p->selected) p = q; Fl_Type::current = p; @@ -2024,7 +2022,7 @@ void Fl_Widget_Type::write_static() { } if (write_extern_declaration) write_declare("extern void %s(%s*, %s);", callback(), t, - user_data_type() ? user_data_type() : "void*"); + user_data_type() ? user_data_type() : "void*"); } const char* k = class_name(1); const char* c = array_name(this); @@ -2071,7 +2069,7 @@ void Fl_Widget_Type::write_static() { write_c(" ((%s*)(o", k); Fl_Type *q = 0; for (Fl_Type* p = parent; p && p->is_widget(); q = p, p = p->parent) - write_c("->parent()"); + write_c("->parent()"); if (!q || strcmp(q->type_name(), "widget_class")) write_c("->user_data()"); write_c("))->%s_i(o,v);\n}\n", cn); @@ -2135,24 +2133,24 @@ void Fl_Widget_Type::write_code1() { if (extra_code(n) && !isdeclare(extra_code(n))) { int instring = 0; - int inname = 0; + int inname = 0; for (ptr = extra_code(n); *ptr; ptr ++) { - if (instring) { - if (*ptr == '\\') ptr++; - else if (*ptr == '\"') instring = 0; - } else if (inname && !isalnum(*ptr & 255)) inname = 0; + if (instring) { + if (*ptr == '\\') ptr++; + else if (*ptr == '\"') instring = 0; + } else if (inname && !isalnum(*ptr & 255)) inname = 0; else if (*ptr == '\"') instring = 1; - else if (isalnum(*ptr & 255) || *ptr == '_') { - size_t len = strspn(ptr, "0123456789_" - "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + else if (isalnum(*ptr & 255) || *ptr == '_') { + size_t len = strspn(ptr, "0123456789_" + "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); if (!strncmp(ptr, "o", len)) { - varused = 1; - break; - } else ptr += len - 1; + varused = 1; + break; + } else ptr += len - 1; } - } + } } } @@ -2179,13 +2177,13 @@ void Fl_Widget_Type::write_code1() { case 1 : /* GNU gettext */ write_c("%s(", i18n_function); write_cstring(label()); - write_c(")"); + write_c(")"); break; case 2 : /* POSIX catgets */ write_c("catgets(%s,%s,%d,", i18n_file[0] ? i18n_file : "_catalog", - i18n_set, msgnum()); + i18n_set, msgnum()); write_cstring(label()); - write_c(")"); + write_c(")"); break; } } @@ -2201,32 +2199,32 @@ void Fl_Widget_Type::write_code1() { void Fl_Widget_Type::write_color(const char* field, Fl_Color color) { const char* color_name = 0; switch (color) { - case FL_FOREGROUND_COLOR: color_name = "FL_FOREGROUND_COLOR"; break; - case FL_BACKGROUND2_COLOR: color_name = "FL_BACKGROUND2_COLOR"; break; - case FL_INACTIVE_COLOR: color_name = "FL_INACTIVE_COLOR"; break; - case FL_SELECTION_COLOR: color_name = "FL_SELECTION_COLOR"; break; - case FL_GRAY0: color_name = "FL_GRAY0"; break; - case FL_DARK3: color_name = "FL_DARK3"; break; - case FL_DARK2: color_name = "FL_DARK2"; break; - case FL_DARK1: color_name = "FL_DARK1"; break; - case FL_BACKGROUND_COLOR: color_name = "FL_BACKGROUND_COLOR"; break; - case FL_LIGHT1: color_name = "FL_LIGHT1"; break; - case FL_LIGHT2: color_name = "FL_LIGHT2"; break; - case FL_LIGHT3: color_name = "FL_LIGHT3"; break; - case FL_BLACK: color_name = "FL_BLACK"; break; - case FL_RED: color_name = "FL_RED"; break; - case FL_GREEN: color_name = "FL_GREEN"; break; - case FL_YELLOW: color_name = "FL_YELLOW"; break; - case FL_BLUE: color_name = "FL_BLUE"; break; - case FL_MAGENTA: color_name = "FL_MAGENTA"; break; - case FL_CYAN: color_name = "FL_CYAN"; break; - case FL_DARK_RED: color_name = "FL_DARK_RED"; break; - case FL_DARK_GREEN: color_name = "FL_DARK_GREEN"; break; - case FL_DARK_YELLOW: color_name = "FL_DARK_YELLOW"; break; - case FL_DARK_BLUE: color_name = "FL_DARK_BLUE"; break; - case FL_DARK_MAGENTA: color_name = "FL_DARK_MAGENTA"; break; - case FL_DARK_CYAN: color_name = "FL_DARK_CYAN"; break; - case FL_WHITE: color_name = "FL_WHITE"; break; + case FL_FOREGROUND_COLOR: color_name = "FL_FOREGROUND_COLOR"; break; + case FL_BACKGROUND2_COLOR: color_name = "FL_BACKGROUND2_COLOR"; break; + case FL_INACTIVE_COLOR: color_name = "FL_INACTIVE_COLOR"; break; + case FL_SELECTION_COLOR: color_name = "FL_SELECTION_COLOR"; break; + case FL_GRAY0: color_name = "FL_GRAY0"; break; + case FL_DARK3: color_name = "FL_DARK3"; break; + case FL_DARK2: color_name = "FL_DARK2"; break; + case FL_DARK1: color_name = "FL_DARK1"; break; + case FL_BACKGROUND_COLOR: color_name = "FL_BACKGROUND_COLOR"; break; + case FL_LIGHT1: color_name = "FL_LIGHT1"; break; + case FL_LIGHT2: color_name = "FL_LIGHT2"; break; + case FL_LIGHT3: color_name = "FL_LIGHT3"; break; + case FL_BLACK: color_name = "FL_BLACK"; break; + case FL_RED: color_name = "FL_RED"; break; + case FL_GREEN: color_name = "FL_GREEN"; break; + case FL_YELLOW: color_name = "FL_YELLOW"; break; + case FL_BLUE: color_name = "FL_BLUE"; break; + case FL_MAGENTA: color_name = "FL_MAGENTA"; break; + case FL_CYAN: color_name = "FL_CYAN"; break; + case FL_DARK_RED: color_name = "FL_DARK_RED"; break; + case FL_DARK_GREEN: color_name = "FL_DARK_GREEN"; break; + case FL_DARK_YELLOW: color_name = "FL_DARK_YELLOW"; break; + case FL_DARK_BLUE: color_name = "FL_DARK_BLUE"; break; + case FL_DARK_MAGENTA: color_name = "FL_DARK_MAGENTA"; break; + case FL_DARK_CYAN: color_name = "FL_DARK_CYAN"; break; + case FL_WHITE: color_name = "FL_WHITE"; break; } const char *var = is_class() ? "this" : name() ? name() : "o"; if (color_name) { @@ -2250,13 +2248,13 @@ void Fl_Widget_Type::write_widget_code() { case 1 : /* GNU gettext */ write_c("%s(", i18n_function); write_cstring(tooltip()); - write_c(")"); + write_c(")"); break; case 2 : /* POSIX catgets */ write_c("catgets(%s,%s,%d,", i18n_file[0] ? i18n_file : "_catalog", - i18n_set, msgnum() + 1); + i18n_set, msgnum() + 1); write_cstring(tooltip()); - write_c(")"); + write_c(")"); break; } write_c(");\n"); @@ -2286,16 +2284,16 @@ void Fl_Widget_Type::write_widget_code() { if (is_button()) { Fl_Button* b = (Fl_Button*)o; if (b->down_box()) write_c("%s%s->down_box(FL_%s);\n", indent(), var, - boxname(b->down_box())); + boxname(b->down_box())); if (b->value()) write_c("%s%s->value(1);\n", indent(), var); } else if (!strcmp(type_name(), "Fl_Input_Choice")) { Fl_Input_Choice* b = (Fl_Input_Choice*)o; if (b->down_box()) write_c("%s%s->down_box(FL_%s);\n", indent(), var, - boxname(b->down_box())); + boxname(b->down_box())); } else if (is_menu_button()) { Fl_Menu_* b = (Fl_Menu_*)o; if (b->down_box()) write_c("%s%s->down_box(FL_%s);\n", indent(), var, - boxname(b->down_box())); + boxname(b->down_box())); } if (o->color() != tplate->color() || subclass()) write_color("color", o->color()); @@ -2305,7 +2303,7 @@ void Fl_Widget_Type::write_widget_code() { if (inactive) inactive->write_code(var, 1); if (o->labeltype() != tplate->labeltype() || subclass()) write_c("%s%s->labeltype(FL_%s);\n", indent(), var, - item_name(labeltypemenu, o->labeltype())); + item_name(labeltypemenu, o->labeltype())); if (o->labelfont() != tplate->labelfont() || subclass()) write_c("%s%s->labelfont(%d);\n", indent(), var, o->labelfont()); if (o->labelsize() != tplate->labelsize() || subclass()) @@ -2367,12 +2365,12 @@ void Fl_Widget_Type::write_widget_code() { if (o->align() != tplate->align() || subclass()) { int i = o->align(); write_c("%s%s->align(Fl_Align(%s", indent(), var, - item_name(alignmenu, i & ~FL_ALIGN_INSIDE)); + item_name(alignmenu, i & ~FL_ALIGN_INSIDE)); if (i & FL_ALIGN_INSIDE) write_c("|FL_ALIGN_INSIDE"); write_c("));\n"); } - // avoid the unsupported combination of flegs when user sets - // "when" to "FL_WHEN_NEVER", but keeps the "no change" set. + // avoid the unsupported combination of flegs when user sets + // "when" to "FL_WHEN_NEVER", but keeps the "no change" set. // FIXME: This could be reflected in the GUI by graying out the button. Fl_When ww = o->when(); if (ww==FL_WHEN_NOT_CHANGED) @@ -2560,7 +2558,7 @@ void Fl_Widget_Type::read_property(const char *c) { } else if (!strcmp(c,"deimage")) { inactive_name(read_word()); } else if (!strcmp(c,"type")) { - if (is_spinner()) + if (is_spinner()) ((Fl_Spinner*)o)->type(item_number(subtypes(), read_word())); else o->type(item_number(subtypes(), read_word())); @@ -2681,23 +2679,23 @@ void Fl_Widget_Type::read_property(const char *c) { Fl_Menu_Item boxmenu1[] = { // these extra ones are for looking up fdesign saved strings: - {"NO_FRAME", 0,0,(void *)FL_NO_BOX}, - {"ROUNDED3D_UPBOX", 0,0,(void *)_FL_ROUND_UP_BOX}, - {"ROUNDED3D_DOWNBOX", 0,0,(void *)_FL_ROUND_DOWN_BOX}, - {"OVAL3D_UPBOX", 0,0,(void *)_FL_ROUND_UP_BOX}, - {"OVAL3D_DOWNBOX", 0,0,(void *)_FL_ROUND_DOWN_BOX}, - {"0", 0,0,(void *)ZERO_ENTRY}, - {"1", 0,0,(void *)FL_UP_BOX}, - {"2", 0,0,(void *)FL_DOWN_BOX}, - {"3", 0,0,(void *)FL_FLAT_BOX}, - {"4", 0,0,(void *)FL_BORDER_BOX}, - {"5", 0,0,(void *)FL_SHADOW_BOX}, - {"6", 0,0,(void *)FL_FRAME_BOX}, - {"7", 0,0,(void *)FL_ROUNDED_BOX}, - {"8", 0,0,(void *)FL_RFLAT_BOX}, - {"9", 0,0,(void *)FL_RSHADOW_BOX}, - {"10", 0,0,(void *)FL_UP_FRAME}, - {"11", 0,0,(void *)FL_DOWN_FRAME}, + {"NO_FRAME", 0,0,(void *)FL_NO_BOX}, + {"ROUNDED3D_UPBOX", 0,0,(void *)_FL_ROUND_UP_BOX}, + {"ROUNDED3D_DOWNBOX", 0,0,(void *)_FL_ROUND_DOWN_BOX}, + {"OVAL3D_UPBOX", 0,0,(void *)_FL_ROUND_UP_BOX}, + {"OVAL3D_DOWNBOX", 0,0,(void *)_FL_ROUND_DOWN_BOX}, + {"0", 0,0,(void *)ZERO_ENTRY}, + {"1", 0,0,(void *)FL_UP_BOX}, + {"2", 0,0,(void *)FL_DOWN_BOX}, + {"3", 0,0,(void *)FL_FLAT_BOX}, + {"4", 0,0,(void *)FL_BORDER_BOX}, + {"5", 0,0,(void *)FL_SHADOW_BOX}, + {"6", 0,0,(void *)FL_FRAME_BOX}, + {"7", 0,0,(void *)FL_ROUNDED_BOX}, + {"8", 0,0,(void *)FL_RFLAT_BOX}, + {"9", 0,0,(void *)FL_RSHADOW_BOX}, + {"10", 0,0,(void *)FL_UP_FRAME}, + {"11", 0,0,(void *)FL_DOWN_FRAME}, {0}}; extern int fdesign_flip; @@ -2709,10 +2707,10 @@ int Fl_Widget_Type::read_fdesign(const char* propname, const char* value) { float x,y,w,h; if (sscanf(value,"%f %f %f %f",&x,&y,&w,&h) == 4) { if (fdesign_flip) { - Fl_Type *p; - for (p = parent; p && !p->is_window(); p = p->parent) {/*empty*/} - if (p && p->is_widget()) y = ((Fl_Widget_Type*)p)->o->h()-(y+h); - } + Fl_Type *p; + for (p = parent; p && !p->is_window(); p = p->parent) {/*empty*/} + if (p && p->is_widget()) y = ((Fl_Widget_Type*)p)->o->h()-(y+h); + } x += pasteoffset; y += pasteoffset; o->resize(int(x),int(y),int(w),int(h)); @@ -2812,7 +2810,7 @@ void Fl_Widget_Type::leave_live_mode() { copy all properties from the edit widget to the live widget */ void Fl_Widget_Type::copy_properties() { - if (!live_widget) + if (!live_widget) return; // copy all attributes common to all widget types @@ -2876,7 +2874,7 @@ void Fl_Widget_Type::copy_properties() { d->step(s->step()); d->value(s->value()); } - + /* TODO: implement this {Fl_Font ff; int fs; Fl_Color fc; if (textstuff(4,ff,fs,fc)) { Fl_Font f; int s; Fl_Color c; textstuff(0,f,s,c); @@ -2885,11 +2883,11 @@ void Fl_Widget_Type::copy_properties() { if (c != fc) write_string("textcolor %d", c); }}*/ - if (!o->visible()) + if (!o->visible()) w->hide(); - if (!o->active()) + if (!o->active()) w->deactivate(); - if (resizable() && w->parent()) + if (resizable() && w->parent()) w->parent()->resizable(o); } @@ -2899,7 +2897,3 @@ void Fl_Pack_Type::copy_properties() Fl_Pack *d = (Fl_Pack*)live_widget, *s =(Fl_Pack*)o; d->spacing(s->spacing()); } - -// -// End of "$Id$". -// diff --git a/fluid/Fl_Widget_Type.h b/fluid/Fl_Widget_Type.h index 6103888d0..ab33f4e10 100644 --- a/fluid/Fl_Widget_Type.h +++ b/fluid/Fl_Widget_Type.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Widget type header file for the Fast Light Tool Kit (FLTK). // // Type for creating all subclasses of Fl_Widget @@ -13,11 +11,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_Type.h" @@ -27,7 +25,3 @@ class Fluid_Image; extern void* const LOAD; extern Fl_Widget_Type *current_widget; // one of the selected ones - -// -// End of "$Id$". -// diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx index ac1f4dca2..8f0f39dc1 100644 --- a/fluid/Fl_Window_Type.cxx +++ b/fluid/Fl_Window_Type.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Window type code for the Fast Light Tool Kit (FLTK). // // The widget describing an Fl_Window. This is also all the code @@ -13,11 +11,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/Fl.H> @@ -47,9 +45,9 @@ extern const char* i18n_function; extern const char* i18n_file; extern const char* i18n_set; -extern Fl_Preferences fluid_prefs; +extern Fl_Preferences fluid_prefs; -inline int fl_min(int a, int b) { return (a < b ? a : b); } +inline int fl_min(int a, int b) { return (a < b ? a : b); } #include "widget_panel.h" @@ -156,23 +154,23 @@ void i18n_type_cb(Fl_Choice *c, void *) { void i18n_text_cb(Fl_Input *i, void *) { undo_checkpoint(); - + if (i == i18n_function_input) i18n_function = i->value(); else if (i == i18n_file_input) i18n_file = i->value(); else if (i == i18n_include_input) i18n_include = i->value(); - + set_modflag(1); } void i18n_int_cb(Fl_Int_Input *i, void *) { undo_checkpoint(); - + if (i == i18n_set_input) i18n_set = i->value(); - + set_modflag(1); } @@ -294,11 +292,11 @@ void Overlay_Window::draw() { if ((damage()&FL_DAMAGE_ALL) && (!box() || (box()>=4&&!(box()&2)) || box()>=_FL_ROUNDED_BOX)) { // if so, draw checkerboard so user can see what areas are clear: - for (int Y = 0; Y < h(); Y += CHECKSIZE) + for (int Y = 0; Y < h(); Y += CHECKSIZE) for (int X = 0; X < w(); X += CHECKSIZE) { - fl_color(((Y/(2*CHECKSIZE))&1) != ((X/(2*CHECKSIZE))&1) ? - FL_WHITE : FL_BLACK); - fl_rectf(X,Y,CHECKSIZE,CHECKSIZE); + fl_color(((Y/(2*CHECKSIZE))&1) != ((X/(2*CHECKSIZE))&1) ? + FL_WHITE : FL_BLACK); + fl_rectf(X,Y,CHECKSIZE,CHECKSIZE); } } Fl_Overlay_Window::draw(); @@ -470,7 +468,7 @@ void border_cb(Fl_Light_Button* i, void* v) { void xclass_cb(Fl_Input* i, void* v) { if (v == LOAD) { if (!current_widget->is_window()) { - i->hide(); + i->hide(); i->parent()->hide(); // hides the "X Class:" label as well return; } @@ -482,11 +480,11 @@ void xclass_cb(Fl_Input* i, void* v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { mod = 1; - Fl_Widget_Type* w = (Fl_Widget_Type*)o; - if (w->is_window() || w->is_button()) - storestring(i->value(),w->xclass); - if (w->is_window()) ((Fl_Window*)(w->o))->xclass(w->xclass); - else if (w->is_menu_item()) w->redraw(); + Fl_Widget_Type* w = (Fl_Widget_Type*)o; + if (w->is_window() || w->is_button()) + storestring(i->value(),w->xclass); + if (w->is_window()) ((Fl_Window*)(w->o))->xclass(w->xclass); + else if (w->is_menu_item()) w->redraw(); } } if (mod) set_modflag(1); @@ -534,7 +532,7 @@ void Fl_Window_Type::newdx() { if (mydx < 0) mydx = 0; } else if (dx0 < -snap) { if (mydx > 0) mydx = 0; - } else + } else mydx = 0; int dy0 = my-y1; int iy = (drag&BOTTOM) ? by : bt; @@ -543,7 +541,7 @@ void Fl_Window_Type::newdx() { if (mydy < 0) mydy = 0; } else if (dy0 < -snap) { if (mydy > 0) mydy = 0; - } else + } else mydy = 0; } @@ -578,7 +576,7 @@ void Fl_Window_Type::newposition(Fl_Widget_Type *myo,int &X,int &Y,int &R,int &T } else { if (drag&LEFT) { if (X==bx) { - X += dx; + X += dx; } else { if (X<bx+dx) X = bx+dx; } @@ -592,14 +590,14 @@ void Fl_Window_Type::newposition(Fl_Widget_Type *myo,int &X,int &Y,int &R,int &T } if (drag&RIGHT) { if (R==br) { - R += dx; + R += dx; } else { if (R>br+dx) R = br+dx; } } if (drag&BOTTOM) { if (T==bt) { - T += dy; + T += dy; } else { if (T>bt+dx) T = bt+dx; } @@ -727,12 +725,12 @@ void Fl_Window_Type::draw_overlay() { numselected = 0; for (Fl_Type *q=next; q && q->level>level; q=q->next) if (q->selected && q->is_widget() && !q->is_menu_item()) { - numselected++; - Fl_Widget_Type* myo = (Fl_Widget_Type*)q; - if (myo->o->x() < bx) bx = myo->o->x(); - if (myo->o->y() < by) by = myo->o->y(); - if (myo->o->x()+myo->o->w() > br) br = myo->o->x()+myo->o->w(); - if (myo->o->y()+myo->o->h() > bt) bt = myo->o->y()+myo->o->h(); + numselected++; + Fl_Widget_Type* myo = (Fl_Widget_Type*)q; + if (myo->o->x() < bx) bx = myo->o->x(); + if (myo->o->y() < by) by = myo->o->y(); + if (myo->o->x()+myo->o->w() > br) br = myo->o->x()+myo->o->w(); + if (myo->o->y()+myo->o->h() > bt) bt = myo->o->y()+myo->o->h(); } recalc = 0; sx = bx; sy = by; sr = br; st = bt; @@ -763,14 +761,14 @@ void Fl_Window_Type::draw_overlay() { if (t > myst) myst = t; if (!(myo->o->align() & FL_ALIGN_INSIDE)) { // Adjust left/right/top/bottom for top/bottom labels... - int ww, hh; - ww = (myo->o->align() & FL_ALIGN_WRAP) ? myo->o->w() : 0; - hh = myo->o->labelsize(); - myo->o->measure_label(ww, hh); - if (myo->o->align() & FL_ALIGN_TOP) y -= hh; - else if (myo->o->align() & FL_ALIGN_BOTTOM) t += hh; - else if (myo->o->align() & FL_ALIGN_LEFT) x -= ww + 4; - else if (myo->o->align() & FL_ALIGN_RIGHT) r += ww + 4; + int ww, hh; + ww = (myo->o->align() & FL_ALIGN_WRAP) ? myo->o->w() : 0; + hh = myo->o->labelsize(); + myo->o->measure_label(ww, hh); + if (myo->o->align() & FL_ALIGN_TOP) y -= hh; + else if (myo->o->align() & FL_ALIGN_BOTTOM) t += hh; + else if (myo->o->align() & FL_ALIGN_LEFT) x -= ww + 4; + else if (myo->o->align() & FL_ALIGN_RIGHT) r += ww + 4; } if (x < mybx) mybx = x; if (y < myby) myby = y; @@ -794,34 +792,34 @@ void Fl_Window_Type::draw_overlay() { if (drag) { // Check top spacing... if (abs(d = myby - ysp) < 3) { - dy -= d; - if (drag & DRAG) mybt -= d; - myby -= d; - draw_v_arrow(mybx+5, myby, 0); + dy -= d; + if (drag & DRAG) mybt -= d; + myby -= d; + draw_v_arrow(mybx+5, myby, 0); } // Check bottom spacing... if (abs(d = o->h() - mybt - ysp) < 3) { - dy += d; - if (drag & DRAG) myby += d; - mybt += d; - draw_v_arrow(mybx+5, mybt, o->h()); + dy += d; + if (drag & DRAG) myby += d; + mybt += d; + draw_v_arrow(mybx+5, mybt, o->h()); } // Check left spacing... if (abs(d = mybx - xsp) < 3) { dx -= d; - if (drag & DRAG) mybr -= d; - mybx -= d; - draw_h_arrow(mybx, myby+5, 0); + if (drag & DRAG) mybr -= d; + mybx -= d; + draw_h_arrow(mybx, myby+5, 0); } // Check right spacing... if (abs(d = o->w() - mybr - xsp) < 3) { - dx += d; - if (drag & DRAG) mybx += d; - mybr += d; - draw_h_arrow(mybr, myby+5, o->w()); + dx += d; + if (drag & DRAG) mybx += d; + mybr += d; + draw_h_arrow(mybr, myby+5, o->w()); } } @@ -836,187 +834,187 @@ void Fl_Window_Type::draw_overlay() { mysel->ideal_size(iw, ih); if (drag & (TOP | BOTTOM)) { - // Check height - if (abs(d = ih - h) < 5) { + // Check height + if (abs(d = ih - h) < 5) { // Resize height - if (drag & TOP) { - myby -= d; - y -= d; - dy -= d; - } else { - mybt += d; - t += d; - dy += d; - } - } - - // Draw height guide - draw_height(x < 50 ? x+10 : x-10, y, t, - x < 50 ? FL_ALIGN_RIGHT : FL_ALIGN_LEFT); + if (drag & TOP) { + myby -= d; + y -= d; + dy -= d; + } else { + mybt += d; + t += d; + dy += d; + } + } + + // Draw height guide + draw_height(x < 50 ? x+10 : x-10, y, t, + x < 50 ? FL_ALIGN_RIGHT : FL_ALIGN_LEFT); } if (drag & (LEFT | RIGHT)) { - // Check width - if (abs(d = iw - w) < 5) { + // Check width + if (abs(d = iw - w) < 5) { // Resize width if (drag & LEFT) { - mybx -= d; - x -= d; - dx -= d; - } else { - mybr += d; - r += d; - dx += d; - } - } - - // Draw width guide - draw_width(x, y < 50 ? y+10 : y-10, r, - y < 50 ? FL_ALIGN_BOTTOM : FL_ALIGN_TOP); + mybx -= d; + x -= d; + dx -= d; + } else { + mybr += d; + r += d; + dx += d; + } + } + + // Draw width guide + draw_width(x, y < 50 ? y+10 : y-10, r, + y < 50 ? FL_ALIGN_BOTTOM : FL_ALIGN_TOP); } } // Check spacing and alignment between individual widgets if (drag && selection->is_widget()) { for (Fl_Type *q=next; q && q->level>level; q = q->next) - if (q != selection && q->is_widget()) { + if (q != selection && q->is_widget()) { Fl_Widget_Type *qw = (Fl_Widget_Type*)q; // Only check visible widgets... - if (!qw->o->visible_r()) continue; + if (!qw->o->visible_r()) continue; // Get bounding box of widget... - int qx = qw->o->x(); - int qr = qw->o->x() + qw->o->w(); - int qy = qw->o->y(); - int qt = qw->o->y() + qw->o->h(); + int qx = qw->o->x(); + int qr = qw->o->x() + qw->o->w(); + int qy = qw->o->y(); + int qt = qw->o->y() + qw->o->h(); - if (!(qw->o->align() & FL_ALIGN_INSIDE)) { + if (!(qw->o->align() & FL_ALIGN_INSIDE)) { // Adjust top/bottom for top/bottom labels... - int ww, hh; - ww = qw->o->w(); - hh = qw->o->labelsize(); - qw->o->measure_label(ww, hh); - if (qw->o->align() & FL_ALIGN_TOP) qy -= hh; - if (qw->o->align() & FL_ALIGN_BOTTOM) qt += hh; - } + int ww, hh; + ww = qw->o->w(); + hh = qw->o->labelsize(); + qw->o->measure_label(ww, hh); + if (qw->o->align() & FL_ALIGN_TOP) qy -= hh; + if (qw->o->align() & FL_ALIGN_BOTTOM) qt += hh; + } // Do horizontal alignment when the widget is within 25 - // pixels vertically... - if (fl_min(abs(qy - mysel->o->y() - mysel->o->h()), - abs(mysel->o->y() - qt)) < 25) { + // pixels vertically... + if (fl_min(abs(qy - mysel->o->y() - mysel->o->h()), + abs(mysel->o->y() - qt)) < 25) { // Align to left of other widget... if ((drag & (LEFT | DRAG)) && abs(d = mybx - qx) < 3) { - dx += d; + dx += d; mybx += d; - if (drag & DRAG) mybr += d; + if (drag & DRAG) mybr += d; - draw_left_brace(qw->o); - } + draw_left_brace(qw->o); + } // Align to right of other widget... if ((drag & (RIGHT | DRAG)) && - abs(d = qr - mybr) < 3) { - dx += d; + abs(d = qr - mybr) < 3) { + dx += d; if (drag & DRAG) mybx += d; - mybr += d; + mybr += d; - draw_right_brace(qw->o); - } + draw_right_brace(qw->o); + } } // Align to top of other widget... if ((drag & (TOP | DRAG)) && abs(d = myby - qy) < 3) { - dy += d; + dy += d; myby += d; - if (drag & DRAG) mybt += d; + if (drag & DRAG) mybt += d; - draw_top_brace(qw->o); - } + draw_top_brace(qw->o); + } // Align to bottom of other widget... if ((drag & (BOTTOM | DRAG)) && abs(d = qt - mybt) < 3) { - dy += d; + dy += d; if (drag & DRAG) myby += d; - mybt += d; + mybt += d; - draw_bottom_brace(qw->o); - } + draw_bottom_brace(qw->o); + } // Check spacing between widgets - if (mysel->is_group()) mysel->ideal_spacing(xsp, ysp); + if (mysel->is_group()) mysel->ideal_spacing(xsp, ysp); else qw->ideal_spacing(xsp, ysp); if ((qt)>=myby && qy<=mybt) { if (drag & (LEFT | DRAG)) { - // Compare left of selected to left of current - if (abs(d = qx - mybx - xsp) >= 3) - d = qx - mybx + xsp; + // Compare left of selected to left of current + if (abs(d = qx - mybx - xsp) >= 3) + d = qx - mybx + xsp; - if (abs(d) < 3) { - dx += d; - mybx += d; - if (drag & DRAG) mybr += d; + if (abs(d) < 3) { + dx += d; + mybx += d; + if (drag & DRAG) mybr += d; - // Draw left arrow - draw_h_arrow(mybx, (myby+mybt)/2, qx); + // Draw left arrow + draw_h_arrow(mybx, (myby+mybt)/2, qx); } - // Compare left of selected to right of current + // Compare left of selected to right of current if (abs(d = qr - mybx - xsp) >= 3) - d = qr - mybx + xsp; + d = qr - mybx + xsp; - if (abs(d) < 3) { - dx += d; - mybx += d; - if (drag & DRAG) mybr += d; + if (abs(d) < 3) { + dx += d; + mybx += d; + if (drag & DRAG) mybr += d; - // Draw left arrow - draw_h_arrow(mybx, (myby+mybt)/2, qr); + // Draw left arrow + draw_h_arrow(mybx, (myby+mybt)/2, qr); } - } + } if (drag & (RIGHT | DRAG)) { - // Compare right of selected to left of current - if (abs(d = qx - mybr - xsp) >= 3) - d = qx - mybr + xsp; + // Compare right of selected to left of current + if (abs(d = qx - mybr - xsp) >= 3) + d = qx - mybr + xsp; - if (abs(d) < 3) { - dx += d; - if (drag & DRAG) mybx += d; - mybr += d; + if (abs(d) < 3) { + dx += d; + if (drag & DRAG) mybx += d; + mybr += d; - // Draw right arrow - draw_h_arrow(mybr, (myby+mybt)/2, qx); + // Draw right arrow + draw_h_arrow(mybr, (myby+mybt)/2, qx); } - // Compare right of selected to right of current + // Compare right of selected to right of current if (abs(d = qr - mybr + xsp) >= 3) - d = qr - mybr - xsp; + d = qr - mybr - xsp; if (abs(d) < 3) { - dx += d; - if (drag & DRAG) mybx += d; - mybr += d; + dx += d; + if (drag & DRAG) mybx += d; + mybr += d; - // Draw right arrow - draw_h_arrow(mybr, (myby+mybt)/2, qr); + // Draw right arrow + draw_h_arrow(mybr, (myby+mybt)/2, qr); } } - } + } if (qr>=mybx && qx<=mybr) { // Compare top of selected to top of current if (drag & (TOP | DRAG)) { - if (abs(d = qy - myby - ysp) >= 3) - d = qy - myby + ysp; + if (abs(d = qy - myby - ysp) >= 3) + d = qy - myby + ysp; - if (abs(d) < 3) { - dy += d; - myby += d; - if (drag & DRAG) mybt += d; + if (abs(d) < 3) { + dy += d; + myby += d; + if (drag & DRAG) mybt += d; - // Draw up arrow... - draw_v_arrow((mybx+mybr)/2, myby, qy); + // Draw up arrow... + draw_v_arrow((mybx+mybr)/2, myby, qy); } // Compare top of selected to bottom of current @@ -1024,44 +1022,44 @@ void Fl_Window_Type::draw_overlay() { d = qt - myby + ysp; if (abs(d) < 3) { - dy += d; - myby += d; - if (drag & DRAG) mybt += d; + dy += d; + myby += d; + if (drag & DRAG) mybt += d; - // Draw up arrow... - draw_v_arrow((mybx+mybr)/2, myby, qt); + // Draw up arrow... + draw_v_arrow((mybx+mybr)/2, myby, qt); } - } + } - // Compare bottom of selected to top of current + // Compare bottom of selected to top of current if (drag & (BOTTOM | DRAG)) { - if (abs(d = qy - mybt - ysp) >= 3) - d = qy - mybt + ysp; + if (abs(d = qy - mybt - ysp) >= 3) + d = qy - mybt + ysp; - if (abs(d) < 3) { - dy += d; - if (drag & DRAG) myby += d; - mybt += d; + if (abs(d) < 3) { + dy += d; + if (drag & DRAG) myby += d; + mybt += d; - // Draw down arrow... - draw_v_arrow((mybx+mybr)/2, mybt, qy); + // Draw down arrow... + draw_v_arrow((mybx+mybr)/2, mybt, qy); } - // Compare bottom of selected to bottom of current + // Compare bottom of selected to bottom of current if (abs(d = qt - mybt - ysp) >= 3) d = qt - mybt + ysp; if (abs(d) < 3) { - dy += d; - if (drag & DRAG) myby += d; - mybt += d; + dy += d; + if (drag & DRAG) myby += d; + mybt += d; - // Draw down arrow... - draw_v_arrow((mybx+mybr)/2, mybt, qt); + // Draw down arrow... + draw_v_arrow((mybx+mybr)/2, mybt, qt); } - } + } } - } + } } mysx += mybx-mybx_bak; mysr += mybr-mybr_bak; mysy += myby-myby_bak; myst += mybt-mybt_bak; @@ -1097,17 +1095,17 @@ void check_redraw_corresponding_parent(Fl_Type *s) { Fl_Widget_Type * prev_parent = 0; if( !s || !s->selected || !s->is_widget()) return; for (Fl_Type *i=s; i && i->parent; i=i->parent) { - if (i->is_group() && prev_parent && - (!strcmp(i->type_name(), "Fl_Tabs") || - !strcmp(i->type_name(), "Fl_Wizard"))) { - ((Fl_Tabs*)((Fl_Widget_Type*)i)->o)->value(prev_parent->o); - return; - } - if (i->is_group() && s->is_widget()) - prev_parent = (Fl_Widget_Type*)i; + if (i->is_group() && prev_parent && + (!strcmp(i->type_name(), "Fl_Tabs") || + !strcmp(i->type_name(), "Fl_Wizard"))) { + ((Fl_Tabs*)((Fl_Widget_Type*)i)->o)->value(prev_parent->o); + return; + } + if (i->is_group() && s->is_widget()) + prev_parent = (Fl_Widget_Type*)i; } } - + // do that for every window (when selected set changes): void redraw_overlays() { for (Fl_Type *o=Fl_Type::first; o; o=o->next) @@ -1150,18 +1148,18 @@ void Fl_Window_Type::moveallchildren() // move all the children, whether selected or not: Fl_Type* p; for (p = myo->next; p && p->level>myo->level; p = p->next) - if (p->is_widget() && !p->is_menu_item()) { - Fl_Widget_Type* myo2 = (Fl_Widget_Type*)p; - int X,Y,R,T; - newposition(myo2,X,Y,R,T); - myo2->o->resize(X,Y,R-X,T-Y); - } + if (p->is_widget() && !p->is_menu_item()) { + Fl_Widget_Type* myo2 = (Fl_Widget_Type*)p; + int X,Y,R,T; + newposition(myo2,X,Y,R,T); + myo2->o->resize(X,Y,R-X,T-Y); + } i = p; } else { i = i->next; } } - for (i=next; i && i->level>level; i=i->next) + for (i=next; i && i->level>level; i=i->next) fix_group_size(i); o->redraw(); recalc = 1; @@ -1194,7 +1192,7 @@ int Fl_Window_Type::handle(int event) { if (i->is_widget() && !i->is_menu_item()) { Fl_Widget_Type* myo = (Fl_Widget_Type*)i; for (Fl_Widget *o1 = myo->o; o1; o1 = o1->parent()) - if (!o1->visible()) goto CONTINUE2; + if (!o1->visible()) goto CONTINUE2; if (Fl::event_inside(myo->o)) { selection = myo; if (Fl::event_clicks()==1) @@ -1204,7 +1202,7 @@ int Fl_Window_Type::handle(int event) { }} // see if user grabs edges of selected region: if (numselected && !(Fl::event_state(FL_SHIFT)) && - mx<=br+snap && mx>=bx-snap && my<=bt+snap && my>=by-snap) { + mx<=br+snap && mx>=bx-snap && my<=bt+snap && my>=by-snap) { int snap1 = snap>5 ? snap : 5; int w1 = (br-bx)/4; if (w1 > snap1) w1 = snap1; if (mx>=br-w1) drag |= RIGHT; @@ -1219,12 +1217,12 @@ int Fl_Window_Type::handle(int event) { if (t) { //if (t == selection) return 1; // indicates mouse eaten w/o change if (Fl::event_state(FL_SHIFT)) { - Fl::event_is_click(0); - select(t, !t->selected); + Fl::event_is_click(0); + select(t, !t->selected); } else { - deselect(); - select(t, 1); - if (t->is_menu_item()) t->open(); + deselect(); + select(t, 1); + if (t->is_menu_item()) t->open(); } selection = t; drag = 0; @@ -1257,21 +1255,21 @@ int Fl_Window_Type::handle(int event) { if (!toggle) deselect(); else Fl::event_is_click(0); // select everything in box: for (Fl_Type*i=next; i&&i->level>level; i=i->next) - if (i->is_widget() && !i->is_menu_item()) { - Fl_Widget_Type* myo = (Fl_Widget_Type*)i; - for (Fl_Widget *o1 = myo->o; o1; o1 = o1->parent()) - if (!o1->visible()) goto CONTINUE; - if (Fl::event_inside(myo->o)) selection = myo; - if (myo->o->x()>=x1 && myo->o->y()>y1 && - myo->o->x()+myo->o->w()<mx && myo->o->y()+myo->o->h()<my) { - n++; - select(myo, toggle ? !myo->selected : 1); - } + if (i->is_widget() && !i->is_menu_item()) { + Fl_Widget_Type* myo = (Fl_Widget_Type*)i; + for (Fl_Widget *o1 = myo->o; o1; o1 = o1->parent()) + if (!o1->visible()) goto CONTINUE; + if (Fl::event_inside(myo->o)) selection = myo; + if (myo->o->x()>=x1 && myo->o->y()>y1 && + myo->o->x()+myo->o->w()<mx && myo->o->y()+myo->o->h()<my) { + n++; + select(myo, toggle ? !myo->selected : 1); + } CONTINUE:; } // if nothing in box, select what was clicked on: if (!n) { - select(selection, toggle ? !selection->selected : 1); + select(selection, toggle ? !selection->selected : 1); } } drag = 0; @@ -1296,13 +1294,13 @@ int Fl_Window_Type::handle(int event) { Fl_Type *p = i->parent; while (p && p != this) p = p->parent; if (!p || !p->is_widget()) { - i = next; if (!i || i->level <= level) return 0; + i = next; if (!i || i->level <= level) return 0; } p = i; for (;;) { - i = backtab ? i->prev : i->next; - if (!i || i->level <= level) {i = p; break;} - if (i->is_widget() && !i->is_menu_item()) break; + i = backtab ? i->prev : i->next; + if (!i || i->level <= level) {i = p; break;} + if (i->is_widget() && !i->is_menu_item()) break; } deselect(); select(i,1); return 1;} @@ -1521,7 +1519,7 @@ void Fl_Widget_Class_Type::write_code1() { write_c(" clear_flag(16);\n"); write_c(" _%s();\n", trimclassname(name())); write_c("}\n\n"); - + // a constructor that takes size and label from the Fluid database write_c("%s::%s()\n", name(), trimclassname(name())); write_c(" : %s(0, 0, %d, %d, ", c, o->w(), o->h()); @@ -1532,7 +1530,7 @@ void Fl_Widget_Class_Type::write_code1() { write_c(" clear_flag(16);\n"); write_c(" _%s();\n", trimclassname(name())); write_c("}\n\n"); - + write_c("void %s::_%s() {\n", name(), trimclassname(name())); // write_c(" %s *w = this;\n", name()); } else { @@ -1596,8 +1594,3 @@ void Fl_Window_Type::copy_properties() { Fl_Widget_Type::copy_properties(); /// \todo copy resizing constraints over } - - -// -// End of "$Id$". -// diff --git a/fluid/Fluid_Image.cxx b/fluid/Fluid_Image.cxx index d0572d8eb..19784e0e0 100644 --- a/fluid/Fluid_Image.cxx +++ b/fluid/Fluid_Image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Pixmap (and other images) label support 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 // #include <FL/Fl.H> @@ -112,7 +110,7 @@ void Fluid_Image::write_static() { } fclose(f); } - + write_c(";\n"); write_initializer("Fl_JPEG_Image", "\"%s\", %s", fl_filename_name(name()), idata_name); } else { @@ -121,7 +119,7 @@ void Fluid_Image::write_static() { if (image_header_written != write_number) { write_c("#include <FL/Fl_Image.H>\n"); image_header_written = write_number; - } + } write_c("static const unsigned char %s[] =\n", idata_name); const int extra_data = img->ld() ? (img->ld()-img->w()*img->d()) : 0; write_cdata(img->data()[0], (img->w() * img->d() + extra_data) * img->h()); @@ -249,8 +247,3 @@ Fluid_Image *ui_find_image(const char *oldname) { leave_source_dir(); return ret; } - - -// -// End of "$Id$". -// diff --git a/fluid/Fluid_Image.h b/fluid/Fluid_Image.h index f36ec2b1e..7020c14f6 100644 --- a/fluid/Fluid_Image.h +++ b/fluid/Fluid_Image.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Image header file for the Fast Light Tool Kit (FLTK). // // This class stores the image labels for widgets in fluid. This is @@ -13,11 +11,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 FLUID_IMAGE_H @@ -53,7 +51,3 @@ Fluid_Image *ui_find_image(const char *); extern const char *ui_find_image_name; #endif - -// -// End of "$Id$". -// diff --git a/fluid/Makefile b/fluid/Makefile index 0bb6f515b..ff191601b 100644 --- a/fluid/Makefile +++ b/fluid/Makefile @@ -1,6 +1,4 @@ # -# "$Id$" -# # FLUID makefile 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 # include ../makeinclude @@ -135,7 +133,3 @@ rebuild: ./fluid -u -c print_panel.fl ./fluid -u -c template_panel.fl ./fluid -u -c widget_panel.fl - -# -# End of "$Id$". -# diff --git a/fluid/Shortcut_Button.h b/fluid/Shortcut_Button.h index c8a79af37..8726fa654 100644 --- a/fluid/Shortcut_Button.h +++ b/fluid/Shortcut_Button.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Shortcut header file 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 // #include <FL/Fl_Button.H> @@ -26,7 +24,3 @@ public: Shortcut_Button(int X,int Y,int W,int H, const char* l = 0) : Fl_Button(X,Y,W,H,l) {svalue = 0;} }; - -// -// End of "$Id$". -// diff --git a/fluid/about_panel.cxx b/fluid/about_panel.cxx index d4ef95098..7dc5fadde 100644 --- a/fluid/about_panel.cxx +++ b/fluid/about_panel.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // About dialog for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,15 +9,15 @@ // // 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 // // generated by Fast Light User Interface Designer (fluid) version 1.0400 #include "about_panel.h" -void show_help(const char *name); +void show_help(const char *name); Fl_Double_Window *about_panel=(Fl_Double_Window *)0; @@ -1563,7 +1561,3 @@ unsigned char fluid_org_png[27580] = /* data inlined from ../documentation/src/f 66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66, 8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,144,206, 240,255,228,188,96,226,178,174,58,106,0,0,0,0,73,69,78,68,174,66,96,130}; - -// -// End of "$Id$". -// diff --git a/fluid/about_panel.fl b/fluid/about_panel.fl index be0003c72..a0a302349 100644 --- a/fluid/about_panel.fl +++ b/fluid/about_panel.fl @@ -3,8 +3,6 @@ version 1.0400 header_name {.h} code_name {.cxx} comment {// -// "$Id$" -// // About dialog for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -15,9 +13,9 @@ comment {// // // 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 // } {in_source in_header } @@ -75,9 +73,3 @@ Version x.x.x} data fluid_org_png { comment {Embedded image for internal fluid.html web page.} public local filename {../documentation/src/fluid-org.png} } - -comment { -// -// End of "$Id$". -//} {in_source in_header -} diff --git a/fluid/about_panel.h b/fluid/about_panel.h index 2a7c69903..effa7ccb4 100644 --- a/fluid/about_panel.h +++ b/fluid/about_panel.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // About dialog 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 // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -22,7 +20,7 @@ #define about_panel_h #include <FL/Fl.H> #include <time.h> -extern void show_help(const char *name); +extern void show_help(const char *name); #include <FL/Fl_Double_Window.H> #include "../src/flstring.h" extern Fl_Double_Window *about_panel; @@ -32,7 +30,3 @@ extern Fl_Double_Window *about_panel; Fl_Double_Window* make_about_panel(); extern unsigned char fluid_org_png[27580]; #endif - -// -// End of "$Id$". -// diff --git a/fluid/align_widget.cxx b/fluid/align_widget.cxx index 5ba65ea39..7a05b6129 100644 --- a/fluid/align_widget.cxx +++ b/fluid/align_widget.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Alignment code 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 // #include <FL/Fl.H> @@ -29,7 +27,7 @@ #define BREAK_ON_FIRST break //#define BREAK_ON_FIRST -void align_widget_cb(Fl_Widget*, long how) +void align_widget_cb(Fl_Widget*, long how) { const int max = 32768, min = -32768; int left, right, top, bot, wdt, hgt, n; @@ -43,70 +41,70 @@ void align_widget_cb(Fl_Widget*, long how) for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->x()<left) - left = w->x(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->x()<left) + left = w->x(); + BREAK_ON_FIRST; } if (left!=max) for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(left, w->y(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(left, w->y(), w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(left, w->y(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(left, w->y(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } break; case 11: // align h.center left = max; right = min; for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->x()<left) - left = w->x(); - if (w->x()+w->w()>right) - right = w->x()+w->w(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->x()<left) + left = w->x(); + if (w->x()+w->w()>right) + right = w->x()+w->w(); + BREAK_ON_FIRST; } if (left!=max) { int center2 = left+right; for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize((center2-w->w())/2, w->y(), w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize((center2-w->w())/2, w->y(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } } break; case 12: // align right @@ -114,103 +112,103 @@ void align_widget_cb(Fl_Widget*, long how) for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->x()+w->w()>right) - right = w->x()+w->w(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->x()+w->w()>right) + right = w->x()+w->w(); + BREAK_ON_FIRST; } if (right!=min) for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(right-w->w(), w->y(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(right-w->w(), w->y(), w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(right-w->w(), w->y(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(right-w->w(), w->y(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } break; case 13: // align top top = max; for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->y()<top) - top = w->y(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->y()<top) + top = w->y(); + BREAK_ON_FIRST; } if (top!=max) for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(w->x(), top, w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(w->x(), top, w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(w->x(), top, w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(w->x(), top, w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } break; case 14: // align v.center top = max; bot = min; for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->y()<top) - top = w->y(); - if (w->y()+w->h()>bot) - bot = w->y()+w->h(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->y()<top) + top = w->y(); + if (w->y()+w->h()>bot) + bot = w->y()+w->h(); + BREAK_ON_FIRST; } if (top!=max) { int center2 = top+bot; for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(w->x(), (center2-w->h())/2, w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(w->x(), (center2-w->h())/2, w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } } break; case 15: // align bottom @@ -218,33 +216,33 @@ void align_widget_cb(Fl_Widget*, long how) for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->y()+w->h()>bot) - bot = w->y()+w->h(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->y()+w->h()>bot) + bot = w->y()+w->h(); + BREAK_ON_FIRST; } if (bot!=min) for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize( w->x(), bot-w->h(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize( w->x(), bot-w->h(), w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize( w->x(), bot-w->h(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize( w->x(), bot-w->h(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } break; //---- space evently case 20: // space evenly across @@ -252,13 +250,13 @@ void align_widget_cb(Fl_Widget*, long how) for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->x()<left) - left = w->x(); - if (w->x()+w->w()>right) - right = w->x()+w->w(); - wdt += w->w(); - n++; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->x()<left) + left = w->x(); + if (w->x()+w->w()>right) + right = w->x()+w->w(); + wdt += w->w(); + n++; } wdt = (right-left)-wdt; n--; @@ -266,28 +264,28 @@ void align_widget_cb(Fl_Widget*, long how) { int cnt = 0, wsum = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - cnt++; - wsum += w->w(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + cnt++; + wsum += w->w(); + } } break; case 21: // space evenly down @@ -295,13 +293,13 @@ void align_widget_cb(Fl_Widget*, long how) for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->y()<top) - top = w->y(); - if (w->y()+w->h()>bot) - bot = w->y()+w->h(); - hgt += w->h(); - n++; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->y()<top) + top = w->y(); + if (w->y()+w->h()>bot) + bot = w->y()+w->h(); + hgt += w->h(); + n++; } hgt = (bot-top)-hgt; n--; @@ -309,28 +307,28 @@ void align_widget_cb(Fl_Widget*, long how) { int cnt = 0, hsum = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - cnt++; - hsum += w->h(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + cnt++; + hsum += w->h(); + } } break; //---- make same size @@ -339,160 +337,160 @@ void align_widget_cb(Fl_Widget*, long how) for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->w()>wdt) - wdt = w->w(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->w()>wdt) + wdt = w->w(); + BREAK_ON_FIRST; } if (wdt!=min) for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(w->x(), w->y(), wdt, w->h()); - } else { - // Otherwise, just do the widget... - w->resize(w->x(), w->y(), wdt, w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(w->x(), w->y(), wdt, w->h()); + } else { + // Otherwise, just do the widget... + w->resize(w->x(), w->y(), wdt, w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } break; case 31: // same height hgt = min; for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->h()>hgt) - hgt = w->h(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->h()>hgt) + hgt = w->h(); + BREAK_ON_FIRST; } if (hgt!=min) for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize( w->x(), w->y(), w->w(), hgt); - } else { - // Otherwise, just do the widget... - w->resize( w->x(), w->y(), w->w(), hgt); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize( w->x(), w->y(), w->w(), hgt); + } else { + // Otherwise, just do the widget... + w->resize( w->x(), w->y(), w->w(), hgt); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } break; case 32: // same size hgt = min; wdt = min; for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->w()>wdt) - wdt = w->w(); - if (w->h()>hgt) - hgt = w->h(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->w()>wdt) + wdt = w->w(); + if (w->h()>hgt) + hgt = w->h(); + BREAK_ON_FIRST; } if (hgt!=min) for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize( w->x(), w->y(), wdt, hgt); - } else { - // Otherwise, just do the widget... - w->resize( w->x(), w->y(), wdt, hgt); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize( w->x(), w->y(), wdt, hgt); + } else { + // Otherwise, just do the widget... + w->resize( w->x(), w->y(), wdt, hgt); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } break; //---- center in group case 40: // center hor for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget() && o->parent) { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - Fl_Widget *p = ((Fl_Widget_Type *)o->parent)->o; - int center2; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + Fl_Widget *p = ((Fl_Widget_Type *)o->parent)->o; + int center2; - if (w->window() == p) center2 = p->w(); - else center2 = 2*p->x()+p->w(); + if (w->window() == p) center2 = p->w(); + else center2 = 2*p->x()+p->w(); - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button() && !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize((center2-w->w())/2, w->y(), w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button() && !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize((center2-w->w())/2, w->y(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); } break; case 41: // center vert for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget() && o->parent) { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - Fl_Widget *p = ((Fl_Widget_Type *)o->parent)->o; - int center2; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + Fl_Widget *p = ((Fl_Widget_Type *)o->parent)->o; + int center2; - if (w->window() == p) center2 = p->h(); - else center2 = 2*p->y()+p->h(); + if (w->window() == p) center2 = p->h(); + else center2 = 2*p->y()+p->h(); - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(w->x(), (center2-w->h())/2, w->w(), w->h()); - } - set_modflag(1); - w->redraw(); - if (w->window()) w->window()->redraw(); + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(w->x(), (center2-w->h())/2, w->w(), w->h()); + } + set_modflag(1); + w->redraw(); + if (w->window()) w->window()->redraw(); } break; } @@ -506,9 +504,9 @@ void widget_size_cb(Fl_Widget *, long size) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); + changed = 1; + set_modflag(1); + undo_checkpoint(); } Fl_Widget *w = ((Fl_Widget_Type *)o)->o; @@ -524,9 +522,3 @@ void widget_size_cb(Fl_Widget *, long size) { } } } - - -// -// End of "$Id$". -// - diff --git a/fluid/alignment_panel.cxx b/fluid/alignment_panel.cxx index 1237f397c..280cec0b6 100644 --- a/fluid/alignment_panel.cxx +++ b/fluid/alignment_panel.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Setting and shell dialogs 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 // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -142,7 +140,7 @@ Fl_Double_Window* make_project_window() { } // Fl_Double_Window* project_window return project_window; } -void scheme_cb(Fl_Choice *, void *); +void scheme_cb(Fl_Choice *, void *); Fl_Double_Window *settings_window=(Fl_Double_Window *)0; @@ -543,7 +541,7 @@ Fl_Double_Window* make_layout_window() { /** Copy of all options in user and system mode */ -static int opt[10][2]; +static int opt[10][2]; /** Update the UI using the values in the opt array @@ -631,12 +629,12 @@ void show_global_settings_window() { readPrefs(); refreshUI(); fl_message( - "WARNING!\n\n" - "The following dialog changes the user interface behavior\n" - "of ALL FLTK applications, for the current user, or for \n" - "ALL users on this machine.\n\n" - "Please choose these settings carefully, or reset\n" - "user and system settings to \"default\"."); + "WARNING!\n\n" + "The following dialog changes the user interface behavior\n" + "of ALL FLTK applications, for the current user, or for \n" + "ALL users on this machine.\n\n" + "Please choose these settings carefully, or reset\n" + "user and system settings to \"default\"."); global_settings_window->show(); } @@ -808,11 +806,11 @@ dropping text from other applications still works.\n\nDefault is on."); o->labelfont(2); o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE)); { wGTKText = new Fl_Choice(245, 300, 100, 25, "Native File Chooser uses GTK:"); - wGTKText->tooltip("OPTION_FNFC_USES_GTK\n \nIf \'Native File Chooser uses GTK\' is enable\ -d, the Fl_Native_File_Chooser class\ncalls the GTK open/save file dialogs when\ - they are available on the platfom. If disabled, the Fl_Native_File_Chooser cl\ -ass\nalways uses FLTK\'s own file dialog (i.e., Fl_File_Chooser) even if GTK i\ -s available.\n\nDefault is on."); + wGTKText->tooltip("OPTION_FNFC_USES_GTK\n\nIf \'Native File Chooser uses GTK\' is enabled, the F\ +l_Native_File_Chooser class\ncalls the GTK open/save file dialogs when they ar\ +e available on the platfom. If disabled, the Fl_Native_File_Chooser class\nalw\ +ays uses FLTK\'s own file dialog (i.e., Fl_File_Chooser) even if GTK is availa\ +ble.\n\nDefault is on."); wGTKText->down_box(FL_BORDER_BOX); wGTKText->callback((Fl_Callback*)cb_wGTKText); wGTKText->menu(menu_wGTKText); @@ -854,7 +852,3 @@ ions to specific values (not \'default\')."); Fl::option(Fl::OPTION_SHOW_TOOLTIPS,1); // make sure tooltips are on ! return global_settings_window; } - -// -// End of "$Id$". -// diff --git a/fluid/alignment_panel.fl b/fluid/alignment_panel.fl index 2652a451e..7d0300eb1 100644 --- a/fluid/alignment_panel.fl +++ b/fluid/alignment_panel.fl @@ -3,8 +3,6 @@ version 1.0400 header_name {.h} code_name {.cxx} comment {// -// "$Id$" -// // Setting and shell dialogs for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -15,9 +13,9 @@ comment {// // // 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 // } {in_source in_header } @@ -560,12 +558,12 @@ Function {show_global_settings_window()} {open return_type void readPrefs(); refreshUI(); fl_message( - "WARNING!\\n\\n" - "The following dialog changes the user interface behavior\\n" - "of ALL FLTK applications, for the current user, or for \\n" - "ALL users on this machine.\\n\\n" - "Please choose these settings carefully, or reset\\n" - "user and system settings to \\"default\\"."); + "WARNING!\\n\\n" + "The following dialog changes the user interface behavior\\n" + "of ALL FLTK applications, for the current user, or for \\n" + "ALL users on this machine.\\n\\n" + "Please choose these settings carefully, or reset\\n" + "user and system settings to \\"default\\"."); global_settings_window->show();} {} } @@ -702,7 +700,7 @@ Default is on.} xywh {245 225 100 25} down_box BORDER_BOX callback {int mode = wUserOrSystem->value(); opt[Fl::OPTION_FNFC_USES_GTK ][mode] = wGTKText->value();} open tooltip {OPTION_FNFC_USES_GTK - + If 'Native File Chooser uses GTK' is enabled, the Fl_Native_File_Chooser class calls the GTK open/save file dialogs when they are available on the platfom. If disabled, the Fl_Native_File_Chooser class always uses FLTK's own file dialog (i.e., Fl_File_Chooser) even if GTK is available. @@ -789,9 +787,3 @@ global_settings_window->hide();} code {readPrefs(); Fl::option(Fl::OPTION_SHOW_TOOLTIPS,1); // make sure tooltips are on !} {} } - -comment { -// -// End of "$Id$". -//} {in_source in_header -} diff --git a/fluid/alignment_panel.h b/fluid/alignment_panel.h index 5702267f5..c7f4549ae 100644 --- a/fluid/alignment_panel.h +++ b/fluid/alignment_panel.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Setting and shell dialogs 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 // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -63,7 +61,7 @@ extern Fl_Input *i18n_function_input; Fl_Double_Window* make_project_window(); extern Fl_Menu_Item menu_i18n_type_chooser[]; extern void i18n_cb(Fl_Choice *,void *); -extern void scheme_cb(Fl_Choice *, void *); +extern void scheme_cb(Fl_Choice *, void *); extern Fl_Double_Window *settings_window; extern void scheme_cb(Fl_Choice*, void*); extern Fl_Choice *scheme_choice; @@ -119,7 +117,3 @@ extern Fl_Menu_Item menu_wGTKText[]; extern Fl_Menu_Item menu_wPrintGTKText[]; extern Fl_Menu_Item menu_wUserOrSystem[]; #endif - -// -// End of "$Id$". -// diff --git a/fluid/code.cxx b/fluid/code.cxx index c9d63e1b5..b782ee35f 100644 --- a/fluid/code.cxx +++ b/fluid/code.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Code output routines 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 <stdio.h> @@ -197,35 +195,35 @@ void write_cstring(const char *s, int length) { // else fall through: default: if (c >= ' ' && c < 127) { - // a legal ASCII character - if (linelength >= 78) {fputs("\\\n",code_file); linelength = 0;} - putc(c, code_file); - linelength++; - break; + // a legal ASCII character + if (linelength >= 78) {fputs("\\\n",code_file); linelength = 0;} + putc(c, code_file); + linelength++; + break; } // otherwise we must print it as an octal constant: c &= 255; if (c < 8) { - if (linelength >= 76) {fputs("\\\n",code_file); linelength = 0;} - fprintf(code_file, "\\%o",c); - linelength += 2; + if (linelength >= 76) {fputs("\\\n",code_file); linelength = 0;} + fprintf(code_file, "\\%o",c); + linelength += 2; } else if (c < 64) { - if (linelength >= 75) {fputs("\\\n",code_file); linelength = 0;} - fprintf(code_file, "\\%o",c); - linelength += 3; + if (linelength >= 75) {fputs("\\\n",code_file); linelength = 0;} + fprintf(code_file, "\\%o",c); + linelength += 3; } else { - if (linelength >= 74) {fputs("\\\n",code_file); linelength = 0;} - fprintf(code_file, "\\%o",c); - linelength += 4; + if (linelength >= 74) {fputs("\\\n",code_file); linelength = 0;} + fprintf(code_file, "\\%o",c); + linelength += 4; } // We must not put more numbers after it, because some C compilers // consume them as part of the quoted sequence. Use string constant // pasting to avoid this: c = *p; if (p < e && ( (c>='0'&&c<='9') || (c>='a'&&c<='f') || (c>='A'&&c<='F') )) { - putc('\"', code_file); linelength++; - if (linelength >= 79) {fputs("\n",code_file); linelength = 0;} - putc('\"', code_file); linelength++; + putc('\"', code_file); linelength++; + if (linelength >= 79) {fputs("\n",code_file); linelength = 0;} + putc('\"', code_file); linelength++; } break; } @@ -318,22 +316,22 @@ static Fl_Type* write_code(Fl_Type* p) { if (strcmp(q->type_name(), "Function")) q = write_code(q); else { int level = q->level; - do { - q = q->next; - } while (q && q->level > level); + do { + q = q->next; + } while (q && q->level > level); } } - // write all code that come after the children + // write all code that come after the children p->write_code2(); for (q = p->next; q && q->level > p->level;) { if (!strcmp(q->type_name(), "Function")) q = write_code(q); else { int level = q->level; - do { - q = q->next; - } while (q && q->level > level); + do { + q = q->next; + } while (q && q->level > level); } } @@ -341,7 +339,7 @@ static Fl_Type* write_code(Fl_Type* p) { current_widget_class = 0L; } else { for (q = p->next; q && q->level > p->level;) q = write_code(q); - // write all code that come after the children + // write all code that come after the children p->write_code2(); } if (write_sourceview) { @@ -357,7 +355,7 @@ extern Fl_Class_Type *current_class; int write_code(const char *s, const char *t) { const char *filemode = "w"; - if (write_sourceview) + if (write_sourceview) filemode = "wb"; write_number++; delete id_root; id_root = 0; @@ -376,7 +374,7 @@ int write_code(const char *s, const char *t) { if (!f) {fclose(code_file); return 0;} header_file = f; } - // if the first entry in the Type tree is a comment, then it is probably + // if the first entry in the Type tree is a comment, then it is probably // a copyright notice. We print that before anything else in the file! Fl_Type* first_type = Fl_Type::first; if (first_type && first_type->is_comment()) { @@ -406,7 +404,7 @@ int write_code(const char *s, const char *t) { *b = 0; fprintf(header_file, "#ifndef %s\n", define_name); fprintf(header_file, "#define %s\n", define_name); - } + } write_declare("#include <FL/Fl.H>"); if (i18n_type && i18n_include[0]) { @@ -420,7 +418,7 @@ int write_code(const char *s, const char *t) { else { write_c("// Initialize I18N stuff now for menus...\n"); write_c("#include <locale.h>\n"); - write_c("static char *_locale = setlocale(LC_MESSAGES, \"\");\n"); + write_c("static char *_locale = setlocale(LC_MESSAGES, \"\");\n"); write_c("static nl_catd _catalog = catopen(\"%s\", 0);\n", i18n_program); } @@ -490,110 +488,110 @@ int write_strings(const char *sfile) { switch (i18n_type) { case 0 : /* None, just put static text out */ fprintf(fp, "# generated by Fast Light User Interface Designer (fluid) version %.4f\n", - FL_VERSION); + FL_VERSION); for (p = Fl_Type::first; p; p = p->next) { if (p->is_widget()) { - w = (Fl_Widget_Type *)p; - - if (w->label()) { - for (const char *s = w->label(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); + w = (Fl_Widget_Type *)p; + + if (w->label()) { + for (const char *s = w->label(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); putc('\n', fp); - } - - if (w->tooltip()) { - for (const char *s = w->tooltip(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); + } + + if (w->tooltip()) { + for (const char *s = w->tooltip(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); putc('\n', fp); - } - } + } + } } break; case 1 : /* GNU gettext, put a .po file out */ fprintf(fp, "# generated by Fast Light User Interface Designer (fluid) version %.4f\n", - FL_VERSION); + FL_VERSION); for (p = Fl_Type::first; p; p = p->next) { if (p->is_widget()) { - w = (Fl_Widget_Type *)p; + w = (Fl_Widget_Type *)p; - if (w->label()) { - const char *s; + if (w->label()) { + const char *s; - fputs("msgid \"", fp); - for (s = w->label(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); + fputs("msgid \"", fp); + for (s = w->label(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); fputs("\"\n", fp); - fputs("msgstr \"", fp); - for (s = w->label(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); + fputs("msgstr \"", fp); + for (s = w->label(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); fputs("\"\n", fp); - } + } - if (w->tooltip()) { - const char *s; + if (w->tooltip()) { + const char *s; - fputs("msgid \"", fp); - for (s = w->tooltip(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); + fputs("msgid \"", fp); + for (s = w->tooltip(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); fputs("\"\n", fp); - fputs("msgstr \"", fp); - for (s = w->tooltip(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); + fputs("msgstr \"", fp); + for (s = w->tooltip(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); fputs("\"\n", fp); - } - } + } + } } break; case 2 : /* POSIX catgets, put a .msg file out */ fprintf(fp, "$ generated by Fast Light User Interface Designer (fluid) version %.4f\n", - FL_VERSION); + FL_VERSION); fprintf(fp, "$set %s\n", i18n_set); fputs("$quote \"\n", fp); for (i = 1, p = Fl_Type::first; p; p = p->next) { if (p->is_widget()) { - w = (Fl_Widget_Type *)p; - - if (w->label()) { - fprintf(fp, "%d \"", i ++); - for (const char *s = w->label(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); + w = (Fl_Widget_Type *)p; + + if (w->label()) { + fprintf(fp, "%d \"", i ++); + for (const char *s = w->label(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); fputs("\"\n", fp); - } - - if (w->tooltip()) { - fprintf(fp, "%d \"", i ++); - for (const char *s = w->tooltip(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); + } + + if (w->tooltip()) { + fprintf(fp, "%d \"", i ++); + for (const char *s = w->tooltip(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); fputs("\"\n", fp); - } - } + } + } } break; } @@ -609,7 +607,3 @@ void Fl_Type::write_code1() { write_c("// Code for %s\n", title()); } void Fl_Type::write_code2() {} - -// -// End of "$Id$". -// diff --git a/fluid/comments.h b/fluid/comments.h index fa9298b27..708089ed8 100644 --- a/fluid/comments.h +++ b/fluid/comments.h @@ -50,24 +50,18 @@ static const char * const comment_text[] = { "//", // FLTK/Header "//\n" - "// \"$Id$\"\n" - "//\n" "// ... for the Fast Light Tool Kit (FLTK).\n" "//\n" - "// Copyright 1998-2010 by Bill Spitzak and others.\n" + "// Copyright 1998-2020 by Bill Spitzak and others.\n" "//\n" "// This library is free software. Distribution and use rights are outlined in\n" "// the file \"COPYING\" which should have been included with this file. If this\n" "// file is missing or damaged, see the license at:\n" "//\n" - "// http://www.fltk.org/COPYING.php\n" + "// https://www.fltk.org/COPYING.php\n" "//\n" - "// Please report all bugs and problems on the following page:\n" + "// Please see the following page on how to report bugs and issues:\n" "//\n" - "// http://www.fltk.org/str.php\n" - "//\n", - // FLTK/Footer - "\n//\n" - "// End of \"$Id$\".\n" - "//", -}; + "// https://www.fltk.org/bugs.php\n" + "//\n" + }; diff --git a/fluid/factory.cxx b/fluid/factory.cxx index cd7c53c9e..23f903498 100644 --- a/fluid/factory.cxx +++ b/fluid/factory.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Widget factory code for the Fast Light Tool Kit (FLTK). // // Type classes for most of the fltk widgets. Most of the work @@ -17,11 +15,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/Fl.H> @@ -204,8 +202,8 @@ public: if (!batch_mode) { char buffer[20]; for (int i = 1; i <= 20; i++) { - sprintf(buffer,"Browser Line %d",i); - b->add(buffer); + sprintf(buffer,"Browser Line %d",i); + b->add(buffer); } } return b; @@ -252,8 +250,8 @@ public: if (!batch_mode) { char buffer[20]; for (int i = 1; i <= 20; i++) { - sprintf(buffer,"Browser Line %d",i); - b->add(buffer); + sprintf(buffer,"Browser Line %d",i); + b->add(buffer); } } return b; @@ -399,7 +397,7 @@ public: w -= Fl::box_dw(o->box()); int ww = (int)fl_width('m'); w = ((w + ww - 1) / ww) * ww + Fl::box_dw(o->box()) + h / 2; - if (w < 40) w = 40 ; + if (w < 40) w = 40 ; } virtual const char *type_name() {return "Fl_Spinner";} virtual const char *alt_type_name() {return "fltk::Spinner";} @@ -1145,125 +1143,125 @@ Fl_Type *Fl_Type_make(const char *tn) { struct symbol {const char *name; int value;}; static symbol table[] = { - {"BLACK", FL_BLACK}, - {"RED", FL_RED}, - {"GREEN", FL_GREEN}, - {"YELLOW", FL_YELLOW}, - {"BLUE", FL_BLUE}, - {"MAGENTA", FL_MAGENTA}, - {"CYAN", FL_CYAN}, - {"WHITE", FL_WHITE}, - - {"LCOL", FL_BLACK}, - {"COL1", FL_GRAY}, - {"MCOL", FL_LIGHT1}, - {"LEFT_BCOL", FL_LIGHT3}, - {"TOP_BCOL", FL_LIGHT2}, - {"BOTTOM_BCOL", FL_DARK2}, - {"RIGHT_BCOL", FL_DARK3}, - {"INACTIVE", FL_INACTIVE_COLOR}, - {"INACTIVE_COL", FL_INACTIVE_COLOR}, - {"FREE_COL1", FL_FREE_COLOR}, - {"FREE_COL2", FL_FREE_COLOR+1}, - {"FREE_COL3", FL_FREE_COLOR+2}, - {"FREE_COL4", FL_FREE_COLOR+3}, - {"FREE_COL5", FL_FREE_COLOR+4}, - {"FREE_COL6", FL_FREE_COLOR+5}, - {"FREE_COL7", FL_FREE_COLOR+6}, - {"FREE_COL8", FL_FREE_COLOR+7}, - {"FREE_COL9", FL_FREE_COLOR+8}, - {"FREE_COL10", FL_FREE_COLOR+9}, - {"FREE_COL11", FL_FREE_COLOR+10}, - {"FREE_COL12", FL_FREE_COLOR+11}, - {"FREE_COL13", FL_FREE_COLOR+12}, - {"FREE_COL14", FL_FREE_COLOR+13}, - {"FREE_COL15", FL_FREE_COLOR+14}, - {"FREE_COL16", FL_FREE_COLOR+15}, - {"TOMATO", 131}, - {"INDIANRED", 164}, - {"SLATEBLUE", 195}, - {"DARKGOLD", 84}, - {"PALEGREEN", 157}, - {"ORCHID", 203}, - {"DARKCYAN", 189}, - {"DARKTOMATO", 113}, - {"WHEAT", 174}, - {"ALIGN_CENTER", FL_ALIGN_CENTER}, - {"ALIGN_TOP", FL_ALIGN_TOP}, - {"ALIGN_BOTTOM", FL_ALIGN_BOTTOM}, - {"ALIGN_LEFT", FL_ALIGN_LEFT}, - {"ALIGN_RIGHT", FL_ALIGN_RIGHT}, - {"ALIGN_INSIDE", FL_ALIGN_INSIDE}, - {"ALIGN_TOP_LEFT", FL_ALIGN_TOP | FL_ALIGN_LEFT}, - {"ALIGN_TOP_RIGHT", FL_ALIGN_TOP | FL_ALIGN_RIGHT}, - {"ALIGN_BOTTOM_LEFT", FL_ALIGN_BOTTOM | FL_ALIGN_LEFT}, - {"ALIGN_BOTTOM_RIGHT", FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT}, - {"ALIGN_CENTER|FL_ALIGN_INSIDE", FL_ALIGN_CENTER|FL_ALIGN_INSIDE}, - {"ALIGN_TOP|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_INSIDE}, - {"ALIGN_BOTTOM|FL_ALIGN_INSIDE", FL_ALIGN_BOTTOM|FL_ALIGN_INSIDE}, - {"ALIGN_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_LEFT|FL_ALIGN_INSIDE}, - {"ALIGN_RIGHT|FL_ALIGN_INSIDE", FL_ALIGN_RIGHT|FL_ALIGN_INSIDE}, - {"ALIGN_INSIDE|FL_ALIGN_INSIDE", FL_ALIGN_INSIDE|FL_ALIGN_INSIDE}, - {"ALIGN_TOP_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE}, - {"ALIGN_TOP_RIGHT|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_RIGHT|FL_ALIGN_INSIDE}, - {"ALIGN_BOTTOM_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_INSIDE}, + {"BLACK", FL_BLACK}, + {"RED", FL_RED}, + {"GREEN", FL_GREEN}, + {"YELLOW", FL_YELLOW}, + {"BLUE", FL_BLUE}, + {"MAGENTA", FL_MAGENTA}, + {"CYAN", FL_CYAN}, + {"WHITE", FL_WHITE}, + + {"LCOL", FL_BLACK}, + {"COL1", FL_GRAY}, + {"MCOL", FL_LIGHT1}, + {"LEFT_BCOL", FL_LIGHT3}, + {"TOP_BCOL", FL_LIGHT2}, + {"BOTTOM_BCOL", FL_DARK2}, + {"RIGHT_BCOL", FL_DARK3}, + {"INACTIVE", FL_INACTIVE_COLOR}, + {"INACTIVE_COL", FL_INACTIVE_COLOR}, + {"FREE_COL1", FL_FREE_COLOR}, + {"FREE_COL2", FL_FREE_COLOR+1}, + {"FREE_COL3", FL_FREE_COLOR+2}, + {"FREE_COL4", FL_FREE_COLOR+3}, + {"FREE_COL5", FL_FREE_COLOR+4}, + {"FREE_COL6", FL_FREE_COLOR+5}, + {"FREE_COL7", FL_FREE_COLOR+6}, + {"FREE_COL8", FL_FREE_COLOR+7}, + {"FREE_COL9", FL_FREE_COLOR+8}, + {"FREE_COL10", FL_FREE_COLOR+9}, + {"FREE_COL11", FL_FREE_COLOR+10}, + {"FREE_COL12", FL_FREE_COLOR+11}, + {"FREE_COL13", FL_FREE_COLOR+12}, + {"FREE_COL14", FL_FREE_COLOR+13}, + {"FREE_COL15", FL_FREE_COLOR+14}, + {"FREE_COL16", FL_FREE_COLOR+15}, + {"TOMATO", 131}, + {"INDIANRED", 164}, + {"SLATEBLUE", 195}, + {"DARKGOLD", 84}, + {"PALEGREEN", 157}, + {"ORCHID", 203}, + {"DARKCYAN", 189}, + {"DARKTOMATO", 113}, + {"WHEAT", 174}, + {"ALIGN_CENTER", FL_ALIGN_CENTER}, + {"ALIGN_TOP", FL_ALIGN_TOP}, + {"ALIGN_BOTTOM", FL_ALIGN_BOTTOM}, + {"ALIGN_LEFT", FL_ALIGN_LEFT}, + {"ALIGN_RIGHT", FL_ALIGN_RIGHT}, + {"ALIGN_INSIDE", FL_ALIGN_INSIDE}, + {"ALIGN_TOP_LEFT", FL_ALIGN_TOP | FL_ALIGN_LEFT}, + {"ALIGN_TOP_RIGHT", FL_ALIGN_TOP | FL_ALIGN_RIGHT}, + {"ALIGN_BOTTOM_LEFT", FL_ALIGN_BOTTOM | FL_ALIGN_LEFT}, + {"ALIGN_BOTTOM_RIGHT", FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT}, + {"ALIGN_CENTER|FL_ALIGN_INSIDE", FL_ALIGN_CENTER|FL_ALIGN_INSIDE}, + {"ALIGN_TOP|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_INSIDE}, + {"ALIGN_BOTTOM|FL_ALIGN_INSIDE", FL_ALIGN_BOTTOM|FL_ALIGN_INSIDE}, + {"ALIGN_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_LEFT|FL_ALIGN_INSIDE}, + {"ALIGN_RIGHT|FL_ALIGN_INSIDE", FL_ALIGN_RIGHT|FL_ALIGN_INSIDE}, + {"ALIGN_INSIDE|FL_ALIGN_INSIDE", FL_ALIGN_INSIDE|FL_ALIGN_INSIDE}, + {"ALIGN_TOP_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE}, + {"ALIGN_TOP_RIGHT|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_RIGHT|FL_ALIGN_INSIDE}, + {"ALIGN_BOTTOM_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_INSIDE}, {"ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE",FL_ALIGN_BOTTOM|FL_ALIGN_RIGHT|FL_ALIGN_INSIDE}, - {"ALIGN_LEFT_TOP", FL_ALIGN_TOP | FL_ALIGN_LEFT}, - {"ALIGN_RIGHT_TOP", FL_ALIGN_TOP | FL_ALIGN_RIGHT}, - {"ALIGN_LEFT_BOTTOM", FL_ALIGN_BOTTOM | FL_ALIGN_LEFT}, - {"ALIGN_RIGHT_BOTTOM", FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT}, - {"INVALID_STYLE", 255}, - {"NORMAL_STYLE", FL_HELVETICA}, - {"BOLD_STYLE", FL_HELVETICA|FL_BOLD}, - {"ITALIC_STYLE", FL_HELVETICA|FL_ITALIC}, - {"BOLDITALIC_STYLE", FL_HELVETICA|FL_BOLD|FL_ITALIC}, - {"FIXED_STYLE", FL_COURIER}, - {"FIXEDBOLD_STYLE", FL_COURIER|FL_BOLD}, - {"FIXEDITALIC_STYLE", FL_COURIER|FL_ITALIC}, - {"FIXEDBOLDITALIC_STYLE", FL_COURIER|FL_BOLD|FL_ITALIC}, - {"TIMES_STYLE", FL_TIMES}, - {"TIMESBOLD_STYLE", FL_TIMES|FL_BOLD}, - {"TIMESITALIC_STYLE", FL_TIMES|FL_ITALIC}, - {"TIMESBOLDITALIC_STYLE", FL_TIMES|FL_BOLD|FL_ITALIC}, - {"SHADOW_STYLE", (_FL_SHADOW_LABEL<<8)}, - {"ENGRAVED_STYLE", (_FL_ENGRAVED_LABEL<<8)}, - {"EMBOSSED_STYLE", (_FL_EMBOSSED_LABEL<<0)}, - {"TINY_SIZE", 8}, - {"SMALL_SIZE", 11}, - {"NORMAL_SIZE", FL_NORMAL_SIZE}, - {"MEDIUM_SIZE", 18}, - {"LARGE_SIZE", 24}, - {"HUGE_SIZE", 32}, - {"DEFAULT_SIZE", FL_NORMAL_SIZE}, - {"TINY_FONT", 8}, - {"SMALL_FONT", 11}, - {"NORMAL_FONT", FL_NORMAL_SIZE}, - {"MEDIUM_FONT", 18}, - {"LARGE_FONT", 24}, - {"HUGE_FONT", 32}, - {"NORMAL_FONT1", 11}, - {"NORMAL_FONT2", FL_NORMAL_SIZE}, - {"DEFAULT_FONT", 11}, - {"RETURN_END_CHANGED", 0}, - {"RETURN_CHANGED", 1}, - {"RETURN_END", 2}, - {"RETURN_ALWAYS", 3}, - {"PUSH_BUTTON", FL_TOGGLE_BUTTON}, - {"RADIO_BUTTON", FL_RADIO_BUTTON}, - {"HIDDEN_BUTTON", FL_HIDDEN_BUTTON}, - {"SELECT_BROWSER", FL_SELECT_BROWSER}, - {"HOLD_BROWSER", FL_HOLD_BROWSER}, - {"MULTI_BROWSER", FL_MULTI_BROWSER}, - {"SIMPLE_COUNTER", FL_SIMPLE_COUNTER}, - {"LINE_DIAL", FL_LINE_DIAL}, - {"FILL_DIAL", FL_FILL_DIAL}, - {"VERT_SLIDER", FL_VERT_SLIDER}, - {"HOR_SLIDER", FL_HOR_SLIDER}, - {"VERT_FILL_SLIDER", FL_VERT_FILL_SLIDER}, - {"HOR_FILL_SLIDER", FL_HOR_FILL_SLIDER}, - {"VERT_NICE_SLIDER", FL_VERT_NICE_SLIDER}, - {"HOR_NICE_SLIDER", FL_HOR_NICE_SLIDER}, + {"ALIGN_LEFT_TOP", FL_ALIGN_TOP | FL_ALIGN_LEFT}, + {"ALIGN_RIGHT_TOP", FL_ALIGN_TOP | FL_ALIGN_RIGHT}, + {"ALIGN_LEFT_BOTTOM", FL_ALIGN_BOTTOM | FL_ALIGN_LEFT}, + {"ALIGN_RIGHT_BOTTOM", FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT}, + {"INVALID_STYLE", 255}, + {"NORMAL_STYLE", FL_HELVETICA}, + {"BOLD_STYLE", FL_HELVETICA|FL_BOLD}, + {"ITALIC_STYLE", FL_HELVETICA|FL_ITALIC}, + {"BOLDITALIC_STYLE", FL_HELVETICA|FL_BOLD|FL_ITALIC}, + {"FIXED_STYLE", FL_COURIER}, + {"FIXEDBOLD_STYLE", FL_COURIER|FL_BOLD}, + {"FIXEDITALIC_STYLE", FL_COURIER|FL_ITALIC}, + {"FIXEDBOLDITALIC_STYLE", FL_COURIER|FL_BOLD|FL_ITALIC}, + {"TIMES_STYLE", FL_TIMES}, + {"TIMESBOLD_STYLE", FL_TIMES|FL_BOLD}, + {"TIMESITALIC_STYLE", FL_TIMES|FL_ITALIC}, + {"TIMESBOLDITALIC_STYLE", FL_TIMES|FL_BOLD|FL_ITALIC}, + {"SHADOW_STYLE", (_FL_SHADOW_LABEL<<8)}, + {"ENGRAVED_STYLE", (_FL_ENGRAVED_LABEL<<8)}, + {"EMBOSSED_STYLE", (_FL_EMBOSSED_LABEL<<0)}, + {"TINY_SIZE", 8}, + {"SMALL_SIZE", 11}, + {"NORMAL_SIZE", FL_NORMAL_SIZE}, + {"MEDIUM_SIZE", 18}, + {"LARGE_SIZE", 24}, + {"HUGE_SIZE", 32}, + {"DEFAULT_SIZE", FL_NORMAL_SIZE}, + {"TINY_FONT", 8}, + {"SMALL_FONT", 11}, + {"NORMAL_FONT", FL_NORMAL_SIZE}, + {"MEDIUM_FONT", 18}, + {"LARGE_FONT", 24}, + {"HUGE_FONT", 32}, + {"NORMAL_FONT1", 11}, + {"NORMAL_FONT2", FL_NORMAL_SIZE}, + {"DEFAULT_FONT", 11}, + {"RETURN_END_CHANGED", 0}, + {"RETURN_CHANGED", 1}, + {"RETURN_END", 2}, + {"RETURN_ALWAYS", 3}, + {"PUSH_BUTTON", FL_TOGGLE_BUTTON}, + {"RADIO_BUTTON", FL_RADIO_BUTTON}, + {"HIDDEN_BUTTON", FL_HIDDEN_BUTTON}, + {"SELECT_BROWSER", FL_SELECT_BROWSER}, + {"HOLD_BROWSER", FL_HOLD_BROWSER}, + {"MULTI_BROWSER", FL_MULTI_BROWSER}, + {"SIMPLE_COUNTER", FL_SIMPLE_COUNTER}, + {"LINE_DIAL", FL_LINE_DIAL}, + {"FILL_DIAL", FL_FILL_DIAL}, + {"VERT_SLIDER", FL_VERT_SLIDER}, + {"HOR_SLIDER", FL_HOR_SLIDER}, + {"VERT_FILL_SLIDER", FL_VERT_FILL_SLIDER}, + {"HOR_FILL_SLIDER", FL_HOR_FILL_SLIDER}, + {"VERT_NICE_SLIDER", FL_VERT_NICE_SLIDER}, + {"HOR_NICE_SLIDER", FL_HOR_NICE_SLIDER}, }; #include <stdlib.h> @@ -1275,7 +1273,3 @@ int lookup_symbol(const char *name, int &v, int numberok) { if (numberok && ((v = atoi(name)) || !strcmp(name,"0"))) return 1; return 0; } - -// -// End of "$Id$". -// diff --git a/fluid/file.cxx b/fluid/file.cxx index 65c4131bb..dd2ef345c 100644 --- a/fluid/file.cxx +++ b/fluid/file.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fluid file routines for the Fast Light Tool Kit (FLTK). // // You may find the basic read_* and write_* routines to @@ -14,11 +12,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 <stdio.h> @@ -171,7 +169,7 @@ static int hexdigit(int x) { } -static int read_quoted() { // read whatever character is after a \ . +static int read_quoted() { // read whatever character is after a \ . int c,d,x; switch(c = fgetc(fin)) { case '\n': lineno++; return -1; @@ -182,7 +180,7 @@ static int read_quoted() { // read whatever character is after a \ . case 'r' : return('\r'); case 't' : return('\t'); case 'v' : return('\v'); - case 'x' : /* read hex */ + case 'x' : /* read hex */ for (c=x=0; x<3; x++) { int ch = fgetc(fin); d = hexdigit(ch); @@ -190,7 +188,7 @@ static int read_quoted() { // read whatever character is after a \ . c = (c<<4)+d; } break; - default: /* read octal */ + default: /* read octal */ if (c<'0' || c>'7') break; c -= '0'; for (x=0; x<2; x++) { @@ -208,9 +206,9 @@ static int read_quoted() { // read whatever character is after a \ . // This will skip all comments (# to end of line), and evaluate // all \xxx sequences and use \ at the end of line to remove the newline. // A word is any one of: -// a continuous string of non-space chars except { and } and # -// everything between matching {...} (unless wantbrace != 0) -// the characters '{' and '}' +// a continuous string of non-space chars except { and } and # +// everything between matching {...} (unless wantbrace != 0) +// the characters '{' and '}' static char *buffer; static int buflen; @@ -233,9 +231,9 @@ const char *read_word(int wantbrace) { // skip all the whitespace before it: for (;;) { x = getc(fin); - if (x < 0 && feof(fin)) { // eof + if (x < 0 && feof(fin)) { // eof return 0; - } else if (x == '#') { // comment + } else if (x == '#') { // comment do x = getc(fin); while (x >= 0 && x != '\n'); lineno++; continue; @@ -257,9 +255,9 @@ const char *read_word(int wantbrace) { x = getc(fin); if (x<0) {read_error("Missing '}'"); break;} else if (x == '#') { // embedded comment - do x = getc(fin); while (x >= 0 && x != '\n'); - lineno++; - continue; + do x = getc(fin); while (x >= 0 && x != '\n'); + lineno++; + continue; } else if (x == '\n') lineno++; else if (x == '\\') {x = read_quoted(); if (x<0) continue;} else if (x == '{') nesting++; @@ -312,7 +310,7 @@ extern const char* code_file_name; int write_file(const char *filename, int selected_only) { if (!open_write(filename)) return 0; write_string("# data file for the Fltk User Interface Designer (fluid)\n" - "version %.4f",FL_VERSION); + "version %.4f",FL_VERSION); if(!include_H_from_C) write_string("\ndo_not_include_H_from_C"); if(use_FL_COMMAND) @@ -322,11 +320,11 @@ int write_file(const char *filename, int selected_only) { write_string("\ni18n_include %s", i18n_include); switch (i18n_type) { case 1 : /* GNU gettext */ - write_string("\ni18n_function %s", i18n_function); + write_string("\ni18n_function %s", i18n_function); break; case 2 : /* POSIX catgets */ if (i18n_file[0]) write_string("\ni18n_file %s", i18n_file); - write_string("\ni18n_set %s", i18n_set); + write_string("\ni18n_set %s", i18n_set); break; } } @@ -487,7 +485,7 @@ static void read_children(Fl_Type *p, int paste) { } Fl_Type::current = p; - + CONTINUE:; } } @@ -612,35 +610,31 @@ void read_fdesign() { } else if (!strcmp(name,"class")) { if (!strcmp(value,"FL_BEGIN_GROUP")) { - group = widget = (Fl_Widget_Type*)Fl_Type_make("Fl_Group"); - Fl_Type::current = group; + group = widget = (Fl_Widget_Type*)Fl_Type_make("Fl_Group"); + Fl_Type::current = group; } else if (!strcmp(value,"FL_END_GROUP")) { - if (group) { - Fl_Group* g = (Fl_Group*)(group->o); - g->begin(); - g->forms_end(); - Fl_Group::current(0); - } - group = widget = 0; - Fl_Type::current = window; + if (group) { + Fl_Group* g = (Fl_Group*)(group->o); + g->begin(); + g->forms_end(); + Fl_Group::current(0); + } + group = widget = 0; + Fl_Type::current = window; } else { - for (int i = 0; class_matcher[i]; i += 2) - if (!strcmp(value,class_matcher[i])) { - value = class_matcher[i+1]; break;} - widget = (Fl_Widget_Type*)Fl_Type_make(value); - if (!widget) { - printf("class %s not found, using Fl_Button\n", value); - widget = (Fl_Widget_Type*)Fl_Type_make("Fl_Button"); - } + for (int i = 0; class_matcher[i]; i += 2) + if (!strcmp(value,class_matcher[i])) { + value = class_matcher[i+1]; break;} + widget = (Fl_Widget_Type*)Fl_Type_make(value); + if (!widget) { + printf("class %s not found, using Fl_Button\n", value); + widget = (Fl_Widget_Type*)Fl_Type_make("Fl_Button"); + } } } else if (widget) { if (!widget->read_fdesign(name, value)) - printf("Ignoring \"%s: %s\"\n", name, value); + printf("Ignoring \"%s: %s\"\n", name, value); } } } - -// -// End of "$Id$". -// diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx index 8db15bfca..5155c7fd7 100644 --- a/fluid/fluid.cxx +++ b/fluid/fluid.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // FLUID main entry 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 <FL/Fl.H> @@ -81,7 +79,7 @@ extern "C" // static Fl_Help_Dialog *help_dialog = 0; -Fl_Preferences fluid_prefs(Fl_Preferences::USER, "fltk.org", "fluid"); +Fl_Preferences fluid_prefs(Fl_Preferences::USER, "fltk.org", "fluid"); int gridx = 5; int gridy = 5; int snap = 1; @@ -93,14 +91,14 @@ char G_external_editor_command[512]; int show_coredevmenus = 1; // File history info... -char absolute_history[10][FL_PATH_MAX]; -char relative_history[10][FL_PATH_MAX]; +char absolute_history[10][FL_PATH_MAX]; +char relative_history[10][FL_PATH_MAX]; -void load_history(); -void update_history(const char *); +void load_history(); +void update_history(const char *); // Shell command support... -void show_shell_window(); +void show_shell_window(); Fl_Menu_Item *save_item = 0L; Fl_Menu_Item *history_item = 0L; @@ -201,7 +199,7 @@ static void external_editor_timer(void*) { if ( p->is_code() ) { Fl_Code_Type *code = (Fl_Code_Type*)p; // Code changed by external editor? - if ( code->handle_editor_changes() ) { // updates ram, file size/mtime + if ( code->handle_editor_changes() ) { // updates ram, file size/mtime modified++; } if ( code->is_editing() ) { // editor open? @@ -225,7 +223,7 @@ static void external_editor_timer(void*) { void save_cb(Fl_Widget *, void *v) { Fl_Native_File_Chooser fnfc; const char *c = filename; - if (v || !c || !*c) { + if (v || !c || !*c) { fnfc.title("Save To:"); fnfc.type(Fl_Native_File_Chooser::BROWSE_SAVE_FILE); fnfc.filter("FLUID Files\t*.f[ld]"); @@ -244,7 +242,7 @@ void save_cb(Fl_Widget *, void *v) { if (fl_choice("The file \"%s\" already exists.\n" "Do you want to replace it?", "Cancel", - "Replace", NULL, basename) == 0) return; + "Replace", NULL, basename) == 0) return; } if (v != (void *)2) set_filename(c); @@ -318,7 +316,7 @@ void save_template_cb(Fl_Widget *, void *) { if (!fl_access(filename, 0)) { if (fl_choice("The template \"%s\" already exists.\n" "Do you want to replace it?", "Cancel", - "Replace", NULL, c) == 0) return; + "Replace", NULL, c) == 0) return; } if (!write_file(filename)) { @@ -417,7 +415,7 @@ void exit_cb(Fl_Widget *,void *) { return; case 1 : /* Save */ save_cb(NULL, NULL); - if (modflag) return; // Didn't save! + if (modflag) return; // Didn't save! } save_position(main_window,"main_window_pos"); @@ -464,7 +462,7 @@ apple_open_cb(const char *c) { return; case 1 : /* Save */ save_cb(NULL, NULL); - if (modflag) return; // Didn't save! + if (modflag) return; // Didn't save! } } const char *oldfilename; @@ -499,7 +497,7 @@ void open_cb(Fl_Widget *, void *v) { return; case 1 : /* Save */ save_cb(NULL, NULL); - if (modflag) return; // Didn't save! + if (modflag) return; // Didn't save! } } const char *c; @@ -547,7 +545,7 @@ void open_history_cb(Fl_Widget *, void *v) { return; case 1 : /* Save */ save_cb(NULL, NULL); - if (modflag) return; // Didn't save! + if (modflag) return; // Didn't save! } } const char *oldfilename = filename; @@ -643,30 +641,30 @@ void new_from_template_cb(Fl_Widget *w, void *v) { FILE *infile, *outfile; if ((infile = fl_fopen(tname, "r")) == NULL) { - fl_alert("Error reading template file \"%s\":\n%s", tname, - strerror(errno)); - set_modflag(0); - undo_clear(); - return; + fl_alert("Error reading template file \"%s\":\n%s", tname, + strerror(errno)); + set_modflag(0); + undo_clear(); + return; } if ((outfile = fl_fopen(cutfname(1), "w")) == NULL) { - fl_alert("Error writing buffer file \"%s\":\n%s", cutfname(1), - strerror(errno)); - fclose(infile); - set_modflag(0); - undo_clear(); - return; + fl_alert("Error writing buffer file \"%s\":\n%s", cutfname(1), + strerror(errno)); + fclose(infile); + set_modflag(0); + undo_clear(); + return; } while (fgets(line, sizeof(line), infile)) { - // Replace @INSTANCE@ with the instance name... - for (ptr = line; (next = strstr(ptr, "@INSTANCE@")) != NULL; ptr = next + 10) { - fwrite(ptr, next - ptr, 1, outfile); - fputs(iname, outfile); - } + // Replace @INSTANCE@ with the instance name... + for (ptr = line; (next = strstr(ptr, "@INSTANCE@")) != NULL; ptr = next + 10) { + fwrite(ptr, next - ptr, 1, outfile); + fputs(iname, outfile); + } - fputs(ptr, outfile); + fputs(ptr, outfile); } fclose(infile); @@ -689,10 +687,10 @@ void new_from_template_cb(Fl_Widget *w, void *v) { } int exit_early = 0; -int update_file = 0; // fluid -u -int compile_file = 0; // fluid -c -int compile_strings = 0; // fluic -cs -int batch_mode = 0; // if set (-c, -u) don't open display +int update_file = 0; // fluid -u +int compile_file = 0; // fluid -c +int compile_strings = 0; // fluic -cs +int batch_mode = 0; // if set (-c, -u) don't open display int header_file_set = 0; int code_file_set = 0; const char* header_file_name = ".h"; @@ -897,8 +895,8 @@ void about_cb(Fl_Widget *, void *) { } void show_help(const char *name) { - const char *docdir; - char helpname[FL_PATH_MAX]; + const char *docdir; + char helpname[FL_PATH_MAX]; if (!help_dialog) help_dialog = new Fl_Help_Dialog(); @@ -973,12 +971,12 @@ void manual_cb(Fl_Widget *, void *) { void print_menu_cb(Fl_Widget *, void *) { int w, h, ww, hh; int frompage, topage; - Fl_Type *t; // Current widget - int num_windows; // Number of windows - Fl_Window_Type *windows[1000]; // Windows to print - int winpage; // Current window page + Fl_Type *t; // Current widget + int num_windows; // Number of windows + Fl_Window_Type *windows[1000]; // Windows to print + int winpage; // Current window page Fl_Window *win; - + for (t = Fl_Type::first, num_windows = 0; t; t = t->next) { if (t->is_window()) { windows[num_windows] = (Fl_Window_Type *)t; @@ -986,7 +984,7 @@ void print_menu_cb(Fl_Widget *, void *) { num_windows ++; } } - + Fl_Printer printjob; if ( printjob.start_job(num_windows, &frompage, &topage) ) return; int pagecount = 0; @@ -1006,13 +1004,13 @@ void print_menu_cb(Fl_Widget *, void *) { sprintf(date, "%d/%d", ++pagecount, topage-frompage+1); fl_draw(date, w - (int)fl_width(date), fl_height()); // Get the base filename... - const char *basename = strrchr(filename, + const char *basename = strrchr(filename, #ifdef _WIN32 - '\\' + '\\' #else - '/' + '/' #endif - ); + ); if (basename) basename ++; else basename = filename; sprintf(date, "%s", basename); @@ -1257,8 +1255,8 @@ void make_main_window() { // Load file history from preferences... void load_history() { - int i; // Looping var - int max_files; + int i; // Looping var + int max_files; fluid_prefs.get("recent_files", max_files, 5); @@ -1284,9 +1282,9 @@ void load_history() { // Update file history from preferences... void update_history(const char *flname) { - int i; // Looping var - char absolute[FL_PATH_MAX]; - int max_files; + int i; // Looping var + char absolute[FL_PATH_MAX]; + int max_files; fluid_prefs.get("recent_files", max_files, 5); @@ -1343,8 +1341,8 @@ public: ~Fl_Process() {if (_fpt) close();} // FIXME: popen needs the UTF-8 equivalent fl_popen - FILE * popen (const char *cmd, const char *mode="r"); - //not necessary here: FILE * fl_fopen (const char *file, const char *mode="r"); + FILE * popen (const char *cmd, const char *mode="r"); + //not necessary here: FILE * fl_fopen (const char *file, const char *mode="r"); int close(); FILE * desc() const { return _fpt;} // non null if file is open @@ -1396,7 +1394,7 @@ FILE * Fl_Process::popen(const char *cmd, const char *mode) { // Create windows pipes if (!createPipe(pin) || !createPipe(pout) || (!fusion && !createPipe(perr) ) ) - return freeHandles(); // error + return freeHandles(); // error // Initialize Startup Info ZeroMemory(&si, sizeof(STARTUPINFO)); @@ -1407,7 +1405,7 @@ FILE * Fl_Process::popen(const char *cmd, const char *mode) { si.hStdError = fusion ? pout[1] : perr [1]; if ( CreateProcess(NULL, (LPTSTR) cmd,NULL,NULL,TRUE, - DETACHED_PROCESS,NULL,NULL, &si, &pi)) { + DETACHED_PROCESS,NULL,NULL, &si, &pi)) { // don't need theses handles inherited by child process: clean_close(pin[0]); clean_close(pout[1]); clean_close(perr[1]); HANDLE & h = *mode == 'r' ? pout[0] : pin[1]; @@ -1483,7 +1481,7 @@ static bool prepare_shell_command(const char * &command) { // common pre-shell // Support the full piped shell command... void shell_pipe_cb(FL_SOCKET, void*) { - char line[1024]=""; // Line from command output... + char line[1024]=""; // Line from command output... if (s_proc.get_line(line, sizeof(line)) != NULL) { // Add the line to the output list... @@ -1498,7 +1496,7 @@ shell_pipe_cb(FL_SOCKET, void*) { void do_shell_command(Fl_Return_Button*, void*) { - const char *command=NULL; // Command to run + const char *command=NULL; // Command to run if (!prepare_shell_command(command)) return; @@ -1663,8 +1661,8 @@ void update_sourceview_timer(void*) // Set the "modified" flag and update the title of the main window... void set_modflag(int mf) { - const char *basename; - static char title[FL_PATH_MAX]; + const char *basename; + static char title[FL_PATH_MAX]; modflag = mf; @@ -1749,9 +1747,9 @@ static void sigint(SIGARG) { int main(int argc,char **argv) { int i = 1; - + if (!Fl::args(argc,argv,i,arg) || i < argc-1) { - static const char *msg = + static const char *msg = "usage: %s <switches> name.fl\n" " -u : update .fl file and exit (may be combined with '-c' or '-cs')\n" " -c : write .cxx and .h and exit\n" @@ -1783,7 +1781,7 @@ int main(int argc,char **argv) { } if (exit_early) exit(0); - + const char *c = argv[i]; fl_register_images(); @@ -1818,13 +1816,13 @@ int main(int argc,char **argv) { } undo_resume(); - if (update_file) { // fluid -u + if (update_file) { // fluid -u write_file(c,0); if (!compile_file) exit(0); } - if (compile_file) { // fluid -c[s] + if (compile_file) { // fluid -c[s] if (compile_strings) write_strings_cb(0,0); write_cb(0,0); @@ -1853,7 +1851,3 @@ int main(int argc,char **argv) { return (0); } - -// -// End of "$Id$". -// diff --git a/fluid/function_panel.cxx b/fluid/function_panel.cxx index 9004f2bea..72e795781 100644 --- a/fluid/function_panel.cxx +++ b/fluid/function_panel.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Code dialogs 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 // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -148,7 +146,7 @@ Fl_Double_Window* make_function_panel() { Fl_Double_Window *code_panel=(Fl_Double_Window *)0; static void cb_code_panel(Fl_Double_Window*, void*) { - if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) + if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) return; // ignore Escape code_panel->hide(); // otherwise hide..; } @@ -725,7 +723,7 @@ Fl_Window *widgetbin_panel=(Fl_Window *)0; static void cb_widgetbin_panel(Fl_Window* o, void* v) { if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) exit_cb((Fl_Widget*)o, v); -else +else toggle_widgetbin_cb((Fl_Widget*)o, v); } @@ -1174,5 +1172,3 @@ Fl_Double_Window* make_sourceview() { } // -// End of "$Id$". -// diff --git a/fluid/function_panel.fl b/fluid/function_panel.fl index 81dbfe4b4..f8187f56b 100644 --- a/fluid/function_panel.fl +++ b/fluid/function_panel.fl @@ -3,8 +3,6 @@ version 1.0400 header_name {.h} code_name {.cxx} comment {// -// "$Id$" -// // Code dialogs for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -15,9 +13,9 @@ comment {// // // 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 // } {in_source in_header } @@ -136,7 +134,7 @@ Function {make_function_panel()} {} { Function {make_code_panel()} {} { Fl_Window code_panel { label {Code Properties} - callback {if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) + callback {if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) return; // ignore Escape code_panel->hide(); // otherwise hide..} open xywh {503 450 540 180} type Double labelsize 11 hide resizable @@ -541,7 +539,7 @@ Function {make_widgetbin()} {open label {Widget Bin} callback {if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) exit_cb((Fl_Widget*)o, v); -else +else toggle_widgetbin_cb((Fl_Widget*)o, v);} open xywh {410 171 574 85} type Single align 80 hide non_modal } { @@ -963,7 +961,5 @@ Function {make_sourceview()} {} { } comment { -// -// End of "$Id$". //} {in_source in_header } diff --git a/fluid/function_panel.h b/fluid/function_panel.h index b66f5bf69..26f26c594 100644 --- a/fluid/function_panel.h +++ b/fluid/function_panel.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Code dialogs 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 // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -124,5 +122,3 @@ Fl_Double_Window* make_sourceview(); #endif // -// End of "$Id$". -// diff --git a/fluid/print_panel.cxx b/fluid/print_panel.cxx index 5587438bc..f41cae23d 100644 --- a/fluid/print_panel.cxx +++ b/fluid/print_panel.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // FLUID print panel 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 // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -505,25 +503,25 @@ Fl_Double_Window* make_print_panel() { } // Fl_Double_Window* print_properties_panel return print_properties_panel; } -void print_cb(Fl_Return_Button *, void *); +void print_cb(Fl_Return_Button *, void *); void print_load() { FILE *lpstat; char line[1024], name[1024], *nptr, qname[2048], *qptr, defname[1024]; int i; - + if (print_choice->size() > 1) { for (i = 1; print_choice->text(i); i ++) { free(print_choice->menu()[i].user_data()); } } - + print_choice->clear(); print_choice->add("Print To File", 0, 0, 0, FL_MENU_DIVIDER); print_choice->value(0); - + defname[0] = '\0'; - + if ((lpstat = popen("LC_MESSAGES=C LANG=C lpstat -p -d", "r")) != NULL) { while (fgets(line, sizeof(line), lpstat)) { if (!strncmp(line, "printer ", 8) && @@ -532,7 +530,7 @@ void print_load() { if (*nptr == '/') *qptr++ = '\\'; } *qptr = '\0'; - + print_choice->add(qname, 0, 0, (void *)strdup(name), 0); } else if (!strncmp(line, "system default destination: ", 28)) { if (sscanf(line + 28, "%s", defname) != 1) defname[0] = '\0'; @@ -540,7 +538,7 @@ void print_load() { } pclose(lpstat); } - + if (defname[0]) { for (i = 1; print_choice->text(i); i ++) { if (!strcmp((char *)print_choice->menu()[i].user_data(), defname)) { @@ -549,8 +547,8 @@ void print_load() { } } } else if (print_choice->size() > 2) print_choice->value(1); - - + + print_update_status(); } @@ -559,7 +557,7 @@ void print_update_status() { char command[1024]; static char status[1024]; const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data(); - + if (print_choice->value()) { snprintf(command, sizeof(command), "lpstat -p '%s'", printer); if ((lpstat = popen(command, "r")) != NULL) { @@ -567,21 +565,17 @@ void print_update_status() { pclose(lpstat); } else strcpy(status, "printer status unavailable"); } else status[0] = '\0'; - + print_status->label(status); - + char name[1024]; int val; - + snprintf(name, sizeof(name), "%s/page_size", printer); fluid_prefs.get(name, val, 0); print_page_size->value(val); - + snprintf(name, sizeof(name), "%s/output_mode", printer); fluid_prefs.get(name, val, 0); print_output_mode[val]->setonly(); } - -// -// End of "$Id$". -// diff --git a/fluid/print_panel.fl b/fluid/print_panel.fl index 48e2af8ad..1dd08615f 100644 --- a/fluid/print_panel.fl +++ b/fluid/print_panel.fl @@ -3,8 +3,6 @@ version 1.0400 header_name {.h} code_name {.cxx} comment {// -// "$Id$" -// // FLUID print panel for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -15,9 +13,9 @@ comment {// // // 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 // } {in_source in_header } @@ -53,7 +51,7 @@ Function {make_print_panel()} {open } {} Fl_Button print_properties { label {Properties...} - callback {print_properties_panel->show();} selected + callback {print_properties_panel->show();} xywh {294 10 105 25} } Fl_Box print_status { @@ -358,9 +356,3 @@ snprintf(name, sizeof(name), "%s/output_mode", printer); fluid_prefs.get(name, val, 0); print_output_mode[val]->setonly();} {} } - -comment { -// -// End of "$Id$". -//} {in_source in_header -} diff --git a/fluid/print_panel.h b/fluid/print_panel.h index 66b770caf..93f2095b6 100644 --- a/fluid/print_panel.h +++ b/fluid/print_panel.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // FLUID print panel 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 // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -52,11 +50,7 @@ extern Fl_Choice *print_page_size; extern Fl_Button *print_output_mode[4]; Fl_Double_Window* make_print_panel(); extern Fl_Menu_Item menu_print_page_size[]; -extern void print_cb(Fl_Return_Button *, void *); +extern void print_cb(Fl_Return_Button *, void *); void print_load(); void print_update_status(); #endif - -// -// End of "$Id$". -// diff --git a/fluid/template_panel.cxx b/fluid/template_panel.cxx index 42edb4f69..f46b85d18 100644 --- a/fluid/template_panel.cxx +++ b/fluid/template_panel.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // FLUID template support 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 // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -182,11 +180,11 @@ Fl_Double_Window* make_template_panel() { void template_clear() { int i; void *filename; - + for (i = 1; i <= template_browser->size(); i ++) { if ((filename = template_browser->data(i)) != NULL) free(filename); } - + template_browser->deselect(); template_browser->clear(); } @@ -194,19 +192,19 @@ void template_clear() { void template_delete_cb(Fl_Button *, void *) { int item = template_browser->value(); if (item < 1) return; - + const char *name = template_browser->text(item); const char *flfile = (const char *)template_browser->data(item); if (!flfile) return; - + if (!fl_choice("Are you sure you want to delete the template \"%s\"?", "Cancel", "Delete", 0, name)) return; - + if (fl_unlink(flfile)) { fl_alert("Unable to delete template \"%s\":\n%s", name, strerror(errno)); return; } - + template_browser->remove(item); template_browser->do_callback(); } @@ -216,13 +214,13 @@ void template_load() { char name[1024], filename[1400], path[1024], *ptr; struct dirent **files; int num_files; - + fluid_prefs.getUserdataPath(path, sizeof(path)); strlcat(path, "templates", sizeof(path)); - + int sample_templates_generated = 0; fluid_prefs.get("sample_templates_generated", sample_templates_generated, 0); - + if (!sample_templates_generated) { strcpy(filename, path); strcat(filename, "/FLTK_License.fl"); @@ -230,44 +228,40 @@ void template_load() { if (f) { fputs( "# data file for the Fltk User Interface Designer (fluid)\nversion 1.0400\nheader_name {.h}\n" - "code_name {.cxx}\ncomment {//\n// \"$Id$\"\n//\n// @INSTANCE@ for the Fast Light Tool Kit (FLT" + "code_name {.cxx}\ncomment {//\n// @INSTANCE@ for the Fast Light Tool Kit (FLT" "K).\n//\n// Copyright 1998-2020 by Bill Spitzak and others.\n//\n// This library is free sof" "tware. Distribution and use rights are outlined in\n// the file \"COPYING\" which should have " "been included with this file. If this\n// file is missing or damaged, see the license at:\n" - "//\n// https://www.fltk.org/COPYING.php\n//\n// Please report all bugs and problems on th" - "e following page:\n//\n// https://www.fltk.org/str.php\n//\n} {selected in_source in_head" - "er\n}\n\ncomment {\n//\n// End of \"$Id$\".\n//} {in_source in_header\n}\n", f); + "//\n// https://www.fltk.org/COPYING.php\n//\n// Please see the following page on how to report " + "bugs and issues:\n//\n// https://www.fltk.org/bugs.php\n//\n} {selected in_source in_head" + "er\n}\n", f); fclose(f); } sample_templates_generated = 1; fluid_prefs.set("sample_templates_generated", sample_templates_generated); fluid_prefs.flush(); } - + num_files = fl_filename_list(path, &files); - + for (i = 0; i < num_files; i ++) { if (fl_filename_match(files[i]->d_name, "*.fl")) { // Format the name as the filename with "_" replaced with " " // and without the trailing ".fl"... strlcpy(name, files[i]->d_name, sizeof(name)); *strstr(name, ".fl") = '\0'; - + for (ptr = name; *ptr; ptr ++) { if (*ptr == '_') *ptr = ' '; } - + // Add the template to the browser... snprintf(filename, sizeof(filename), "%s/%s", path, files[i]->d_name); template_browser->add(name, strdup(filename)); } - + free(files[i]); } - + if (num_files > 0) free(files); } - -// -// End of "$Id$". -// diff --git a/fluid/template_panel.fl b/fluid/template_panel.fl index 3346052c6..5da887495 100644 --- a/fluid/template_panel.fl +++ b/fluid/template_panel.fl @@ -3,8 +3,6 @@ version 1.0400 header_name {.h} code_name {.cxx} comment {// -// "$Id$" -// // FLUID template support for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -15,9 +13,9 @@ comment {// // // 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 // } {in_source in_header } @@ -226,13 +224,13 @@ if (!sample_templates_generated) { if (f) { fputs( "\# data file for the Fltk User Interface Designer (fluid)\\nversion 1.0400\\nheader_name {.h}\\n" -"code_name {.cxx}\\ncomment {//\\n// \\"$Id$\\"\\n//\\n// @INSTANCE@ for the Fast Light Tool Kit (FLT" +"code_name {.cxx}\\ncomment {//\\n// @INSTANCE@ for the Fast Light Tool Kit (FLT" "K).\\n//\\n// Copyright 1998-2020 by Bill Spitzak and others.\\n//\\n// This library is free sof" "tware. Distribution and use rights are outlined in\\n// the file \\"COPYING\\" which should have " "been included with this file. If this\\n// file is missing or damaged, see the license at:\\n" -"//\\n// https://www.fltk.org/COPYING.php\\n//\\n// Please report all bugs and problems on th" -"e following page:\\n//\\n// https://www.fltk.org/str.php\\n//\\n} {selected in_source in_head" -"er\\n}\\n\\ncomment {\\n//\\n// End of \\"$Id$\\".\\n//} {in_source in_header\\n}\\n", f); +"//\\n// https://www.fltk.org/COPYING.php\\n//\\n// Please see the following page on how to report " +"bugs and issues:\\n//\\n// https://www.fltk.org/bugs.php\\n//\\n} {selected in_source in_head" +"er\\n}\\n", f); fclose(f); } sample_templates_generated = 1; @@ -264,9 +262,3 @@ for (i = 0; i < num_files; i ++) { if (num_files > 0) free(files);} {selected } } - -comment { -// -// End of "$Id$". -//} {in_source in_header -} diff --git a/fluid/template_panel.h b/fluid/template_panel.h index 5b78eb3e2..5c754d77c 100644 --- a/fluid/template_panel.h +++ b/fluid/template_panel.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // FLUID template support 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 // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -40,7 +38,3 @@ void template_clear(); void template_delete_cb(Fl_Button *, void *); void template_load(); #endif - -// -// End of "$Id$". -// diff --git a/fluid/undo.cxx b/fluid/undo.cxx index 1ffb41e8a..40b0f045b 100644 --- a/fluid/undo.cxx +++ b/fluid/undo.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // FLUID undo support 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 // #include <FL/Fl.H> @@ -32,9 +30,9 @@ #endif // _WIN32 && !__CYGWIN__ -extern Fl_Preferences fluid_prefs; // FLUID preferences -extern Fl_Menu_Item Main_Menu[]; // Main menu -extern Fl_Menu_Bar *main_menubar; // Main menubar +extern Fl_Preferences fluid_prefs; // FLUID preferences +extern Fl_Menu_Item Main_Menu[]; // Main menu +extern Fl_Menu_Bar *main_menubar; // Main menubar @@ -46,11 +44,11 @@ extern Fl_Menu_Bar *main_menubar; // Main menubar // -int undo_current = 0; // Current undo level in buffer -int undo_last = 0; // Last undo level in buffer -int undo_max = 0; // Maximum undo level used -int undo_save = -1; // Last undo level that was saved -static int undo_paused = 0; // Undo checkpointing paused? +int undo_current = 0; // Current undo level in buffer +int undo_last = 0; // Last undo level in buffer +int undo_max = 0; // Maximum undo level used +int undo_save = -1; // Last undo level that was saved +static int undo_paused = 0; // Undo checkpointing paused? // Return the undo filename. @@ -68,8 +66,8 @@ static char *undo_filename(int level) { // append filename: "undo_PID_LEVEL.fl" snprintf(undo_path + undo_path_len, - sizeof(undo_path) - undo_path_len - 1, - "undo_%d_%d.fl", getpid(), level); + sizeof(undo_path) - undo_path_len - 1, + "undo_%d_%d.fl", getpid(), level); return undo_path; } @@ -187,8 +185,3 @@ void undo_resume() { void undo_suspend() { undo_paused = 1; } - - -// -// End of "$Id$". -// diff --git a/fluid/undo.h b/fluid/undo.h index 6ce595581..c1d1aef44 100644 --- a/fluid/undo.h +++ b/fluid/undo.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // FLUID undo definitions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,29 +7,25 @@ // 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 undo_h # define undo_h -extern int undo_current; // Current undo level in buffer -extern int undo_last; // Last undo level in buffer -extern int undo_save; // Last undo level that was saved +extern int undo_current; // Current undo level in buffer +extern int undo_last; // Last undo level in buffer +extern int undo_save; // Last undo level that was saved -void redo_cb(Fl_Widget *, void *); // Redo menu callback -void undo_cb(Fl_Widget *, void *); // Undo menu callback -void undo_checkpoint(); // Save current file to undo buffer -void undo_clear(); // Clear undo buffer -void undo_resume(); // Resume undo checkpoints -void undo_suspend(); // Suspend undo checkpoints +void redo_cb(Fl_Widget *, void *); // Redo menu callback +void undo_cb(Fl_Widget *, void *); // Undo menu callback +void undo_checkpoint(); // Save current file to undo buffer +void undo_clear(); // Clear undo buffer +void undo_resume(); // Resume undo checkpoints +void undo_suspend(); // Suspend undo checkpoints #endif // !undo_h - -// -// End of "$Id$". -// diff --git a/fluid/widget_panel.cxx b/fluid/widget_panel.cxx index dfdacbe81..7ebb3c538 100644 --- a/fluid/widget_panel.cxx +++ b/fluid/widget_panel.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Widget panel 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 // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -868,7 +866,3 @@ avior."); } // Fl_Double_Window* o return w; } - -// -// End of "$Id$". -// diff --git a/fluid/widget_panel.fl b/fluid/widget_panel.fl index b870d39d7..0ccb9763e 100644 --- a/fluid/widget_panel.fl +++ b/fluid/widget_panel.fl @@ -3,8 +3,6 @@ version 1.0400 header_name {.h} code_name {.cxx} comment {// -// "$Id$" -// // Widget panel for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -15,9 +13,9 @@ comment {// // // 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 // } {in_source in_header } @@ -702,9 +700,3 @@ wCallback->do_callback(wCallback, v);} open } } } - -comment { -// -// End of "$Id$". -//} {in_source in_header -} diff --git a/fluid/widget_panel.h b/fluid/widget_panel.h index 2cb59b4a4..3f7a1761b 100644 --- a/fluid/widget_panel.h +++ b/fluid/widget_panel.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Widget panel 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 // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -115,7 +113,3 @@ extern Fl_Menu_Item menu_1[]; extern Fl_Menu_Item menu_2[]; extern Fl_Menu_Item menu_3[]; #endif - -// -// End of "$Id$". -// |
