From d589c05b1741bf699897feef73c35a58592dc876 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Tue, 15 Oct 2024 18:59:28 +0200 Subject: [PATCH] Fix documentation typos and trailing whitespace --- FL/Fl_Preferences.H | 10 +++--- FL/Fl_Widget.H | 2 +- FL/fl_draw.H | 2 +- FL/names.h | 6 ++-- fluid/Fl_Group_Type.cxx | 2 +- fluid/code.cxx | 4 +-- fluid/file.cxx | 2 +- src/Fl_Browser.cxx | 8 ++--- src/Fl_File_Chooser2.cxx | 2 +- src/Fl_Image.cxx | 2 +- src/Fl_Input.cxx | 2 +- src/Fl_Preferences.cxx | 32 +++++++++---------- src/Fl_Text_Display.cxx | 2 +- .../Cairo/Fl_Cairo_Graphics_Driver.cxx | 2 +- src/fl_engraved_label.cxx | 2 +- 15 files changed, 40 insertions(+), 40 deletions(-) diff --git a/FL/Fl_Preferences.H b/FL/Fl_Preferences.H index dfdc7debe..591f1d230 100644 --- a/FL/Fl_Preferences.H +++ b/FL/Fl_Preferences.H @@ -43,7 +43,7 @@ in a key name are treated as subgroups, i.e. the key 'window/width' would actually refer to the key 'width' inside the group 'window'. - Keys have a unique name within their group. A value can be any string includin + Keys have a unique name within their group. A value can be any string including control characters 0x00 to 0x1f, 0x7f, and UTF-8 octets. Several methods allow setting and getting numerical values and binary data. @@ -61,11 +61,11 @@ may change at any time. Preferences files are not meant to be created or edited "by hand." - FLTK preferences are not meant to replace a fully features database. No merging + FLTK preferences are not meant to replace a fully featured database. No merging of data takes place. If several instances of an app access the same database at the same time, only the most recent changes will persist. - Preferences should no be used to store document data. The .prefs file should + Preferences should not be used to store document data. The .prefs file should be kept small for performance reasons. One application can have multiple preferences files. Extensive binary data however should be stored in separate files: see \a Fl_Preferences::get_userdata_path() . @@ -135,9 +135,9 @@ public: MEMORY, ///< Returned if querying memory mapped preferences ROOT_MASK = 0x00FF, ///< Mask for the values above CORE = 0x0100, ///< OR'd by FLTK to read and write core library preferences and options - C_LOCALE = 0x1000, ///< This flag should always be set, it makes sure that floating point + C_LOCALE = 0x1000, ///< This flag should always be set to ensure that floating point values + ///< are written and read correctly independently of the current locale CLEAR = 0x2000, ///< Don't read a possibly existing database. Instead, start with an empty set of preferences. - ///< values are written correctly independently of the current locale SYSTEM_L = SYSTEM | C_LOCALE, ///< Preferences are used system-wide, locale independent USER_L = USER | C_LOCALE, ///< Preferences apply only to the current user, locale independent CORE_SYSTEM_L = CORE | SYSTEM_L, ///< Same as CORE | SYSTEM | C_LOCALE diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H index c9fe89bba..d10d42ef5 100644 --- a/FL/Fl_Widget.H +++ b/FL/Fl_Widget.H @@ -693,7 +693,7 @@ public: /** Set the gap between the label and the image in pixels. This value is limited to 0..255. - \param[in] gap spacing in pixels + \param[in] gap spacing in pixels */ void label_image_spacing(int gap) { label_.spacing = (uchar)gap; } diff --git a/FL/fl_draw.H b/FL/fl_draw.H index f5575e950..6535d031a 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -997,7 +997,7 @@ FL_EXPORT void fl_measure(const char *str, int &x, int &y, int draw_symbols = 1) as graphical symbols \param[in] spacing spacing between text and image */ -FL_EXPORT void fl_draw(const char *str, int x, int y, int w, int h, +FL_EXPORT void fl_draw(const char *str, int x, int y, int w, int h, Fl_Align align, Fl_Image *img = 0, int draw_symbols = 1, int spacing = 0); /** diff --git a/FL/names.h b/FL/names.h index 15a491f84..984afbfe0 100644 --- a/FL/names.h +++ b/FL/names.h @@ -1,7 +1,7 @@ // -// Event names header file for the Fast Light Tool Kit (FLTK). +// Event and other names header file for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2023 by Bill Spitzak and others. +// Copyright 1998-2024 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -116,7 +116,7 @@ const char * const fl_fontnames[] = }; /** - This is an array of callback reason names you can use to convert font numbers into names. + This is an array of callback reason names you can use to convert callback reasons into names. The array gets defined inline wherever your '\#include ' appears. */ diff --git a/fluid/Fl_Group_Type.cxx b/fluid/Fl_Group_Type.cxx index 61e4332a9..dca269927 100644 --- a/fluid/Fl_Group_Type.cxx +++ b/fluid/Fl_Group_Type.cxx @@ -122,7 +122,7 @@ void group_cb(Fl_Widget *, void *) { n->o->resize(q->o->x(),q->o->y(),q->o->w(),q->o->h()); for (Fl_Type *t = qq->next; t && (t->level > qq->level);) { if (t->level != n->level || t == n || !t->selected) { - t = t->next; + t = t->next; continue; } Fl_Type *nxt = t->remove(); diff --git a/fluid/code.cxx b/fluid/code.cxx index 873b9d789..f10777c3e 100644 --- a/fluid/code.cxx +++ b/fluid/code.cxx @@ -1,7 +1,7 @@ // // Code output routines for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2023 by Bill Spitzak and others. +// Copyright 1998-2024 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -1091,7 +1091,7 @@ int Fd_Code_Writer::crc_puts(const char *text) { /** Write a single ASCII character to the code file. If MergeBack is enabled, the CRC calculation is continued. - \note to wrote UTF8 characters, use Fd_Code_Writer::crc_puts(const char *text) + \note to write UTF-8 characters, use Fd_Code_Writer::crc_puts(const char *text) \param[in] c any character between 0 and 127 inclusive \return see fputc(int, FILE*) */ diff --git a/fluid/file.cxx b/fluid/file.cxx index 2365630c2..cdbf10d62 100644 --- a/fluid/file.cxx +++ b/fluid/file.cxx @@ -405,7 +405,7 @@ Fl_Type *Fd_Project_Reader::read_children(Fl_Type *p, int merge, Strategy strate t->layout_widget(); } - + if (strategy == kAddAsFirstChild) { strategy = kAddAfterCurrent; } diff --git a/src/Fl_Browser.cxx b/src/Fl_Browser.cxx index 46546fb66..9228529e2 100644 --- a/src/Fl_Browser.cxx +++ b/src/Fl_Browser.cxx @@ -1,7 +1,7 @@ // // Browser widget for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2017 by Bill Spitzak and others. +// Copyright 1998-2024 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -526,9 +526,9 @@ void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const { Fl_Color lcol = textcolor(); Fl_Align talign = FL_ALIGN_LEFT; // check for all the @-lines recognized by XForms: - //#if defined(__GNUC__) - //#warning FIXME This maybe needs to be more UTF8 aware now...? - //#endif /*__GNUC__*/ + // #if defined(__GNUC__) + // #warning FIXME This maybe needs to be more UTF-8 aware now...? + // #endif /*__GNUC__*/ if ( format_char() ) { // can be NULL while (*str == format_char() && *++str && *str != format_char()) { switch (*str++) { diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index cc0332e48..46e902c18 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -1315,7 +1315,7 @@ Fl_File_Chooser::update_preview() window->cursor(FL_CURSOR_DEFAULT); Fl::check(); - // Scan the buffer for printable UTF8 chars... + // Scan the buffer for printable UTF-8 chars... for (ptr = preview_text_; *ptr; ptr++) { uchar c = uchar(*ptr); if ( (c&0x80)==0 ) { diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx index 5fd0c8d3b..21a7db2b9 100644 --- a/src/Fl_Image.cxx +++ b/src/Fl_Image.cxx @@ -83,7 +83,7 @@ void Fl_Image::draw_empty(int X, int Y) { It is recommended not to call this member function to reduce the size of an image to the size of the area where this image will be drawn, and to use Fl_Image::scale() instead. - + The new image should be released when you are done with it. Note: since FLTK 1.4.0 you can use Fl_Image::release() for all types diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx index a079f8f5a..fd66d8f24 100644 --- a/src/Fl_Input.cxx +++ b/src/Fl_Input.cxx @@ -328,7 +328,7 @@ int Fl_Input::kf_copy_cut() { handles key combinations for Insert, Enter, and Tab depending on the widget's input_type(). - The method then checks for Ctrl key combinations, such as Ctrl-A, Ctrl-C, + The method then checks for Ctrl key combinations, such as Ctrl-A, Ctrl-C, Ctrl-V, Ctrl-X, and Ctrl-Z, which are commonly used for select all, copy, paste, cut, and undo operations. diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx index f2f8fbe94..586416bf5 100644 --- a/src/Fl_Preferences.cxx +++ b/src/Fl_Preferences.cxx @@ -42,33 +42,33 @@ compatible). Preferences files are *not* supposed to be edited manually. Nevertheless, here are the docs: - A .prefs file contains multiple lines. A line is defined a 0 or more ASCII + A .prefs file contains multiple lines. A line is defined by 0 or more ASCII characters in the range from 0x20 to 0x7e, followed by a single '\n' line ending character. Note that there are no tabs, \0 characters, or '\r' characters anywhere in a line. Some parts of a line may allow 0x80 to 0xff - to support Unicode UTF8 octets. + to support Unicode UTF-8 octets. - The first line is always "; FLTK preferences file format 1.0", followed by a + The first line is always "; FLTK preferences file format 1.0", followed by a '\n' to indicate the end of the line. The version number may change some time in the future if the file format ever changes. - The second line contains the vendor information when the file was created: + The second line contains the vendor information when the file was created: "; vendor: VENDOR\n" - The third line contains the application name + The third line contains the application name "; application: APPLICATION_NAME\n" - Any following line that starts with a ';' is not relevant for data and seen + Any following line that starts with a ';' is not relevant for data and seen as a comment. Fl_Preferences tries to preserve comments, but has no API to set or read comments. - All data is stored in key/value pairs. All key/value pairs are store inside + All data is stored in key/value pairs. All key/value pairs are stored inside their group. There can be multiple groups. Group naming is used to indicate a hierarchy. - A line starting with a '[' starts a group. Before and after a group line, + A line starting with a '[' starts a group. Before and after a group line, there is always an empty line (no characters, just a '\n'). A group line ends - in "]\n". Directly between the '[] and ']' is the name of the group. The first + in "]\n". Directly between the '[' and ']' is the name of the group. The first ("root")-group is always declared with the line "[.]\n". Simple group names are written starting with "./", for example "[./name]\n". @@ -86,17 +86,17 @@ the value. There is no space before or after the ":". The value may contain more ":" characters. - The value is a text of ASCII characters 0x20 to 0x7e, or UTF8 Unicode octets + The value is a text of ASCII characters 0x20 to 0x7e or UTF-8 Unicode octets 0x80 to 0xff. The key/value line ends in a "\n". Key/value lines wrap before or at column 80 - with a "/n" and continue in the next line, starting with a "+" which indicates + with a "\n" and continue in the next line, starting with a "+" which indicates that this is an overflow line and is furthermore ignored. The type of a value - is not stored in a file. It is not an error to call Fl_Preferences::set with a - "double" and read back a string. + is not stored in the file. It is not an error to call Fl_Preferences::set with + a "double" and read back a string. * Integers are written as signed int using "%d". - * Floating point values are written with decimal points if C_LOCALE is set + * Floating point values are written with decimal points if C_LOCALE is set when creating the file. * When text is written, "\r", "\n", and the "\" character are escaped by prepending them with an additional "\", other characters <0x20 and 0x7f @@ -241,7 +241,7 @@ unsigned int Fl_Preferences::file_access() } /** - Determine the file name and path to preferences that would be openend with + Determine the file name and path to preferences that would be opened with these parameters. Find the possible location of a preference file on disk without touching any @@ -327,7 +327,7 @@ Fl_Preferences::Root Fl_Preferences::filename( char *buffer, size_t buffer_size, For backward compatibility, the old \c USER `.prefs` file naming scheme \$(directory)/.fltk/\$(vendor)/\$(application).prefs is checked first. If that file does not exist, the environment variable `$XDG_CONFIG_HOME` is - read as a base directory. If `$XDG_CONFIG_HOME` not set, the base directory + read as a base directory. If `$XDG_CONFIG_HOME` is not set, the base directory defaults to `$HOME/.config/`. The user preferences will be stored in diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index 087681ea1..ca0f7e6a2 100644 --- a/src/Fl_Text_Display.cxx +++ b/src/Fl_Text_Display.cxx @@ -503,7 +503,7 @@ void Fl_Text_Display::display_needs_recalc() { display_needs_recalc_ = true; redraw(); // ensure draw() gets called } - + /** Recalculate the display's visible lines and scrollbar sizes. Beware calling this directly may cause a lot of CPU if called repeatedly (issue 300). diff --git a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx index c0b050f09..0fa517b97 100644 --- a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx +++ b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx @@ -1109,7 +1109,7 @@ static int font_sort(Fl_Fontdesc *fa, Fl_Fontdesc *fb) { Fl_Font Fl_Cairo_Graphics_Driver::set_fonts(const char* /*pattern_name*/) { // Return immideatly if the fonts were already counted - if (font_count_ != -1) + if (font_count_ != -1) return FL_FREE_FONT + font_count_; fl_open_display(); int n_families, count = 0; diff --git a/src/fl_engraved_label.cxx b/src/fl_engraved_label.cxx index 2185548f6..3f98e3155 100644 --- a/src/fl_engraved_label.cxx +++ b/src/fl_engraved_label.cxx @@ -32,7 +32,7 @@ static void innards(const char *str, int len, int X, int Y, const int data[][3], fl_color(c); } -static void dispatch(const Fl_Label* o, +static void dispatch(const Fl_Label* o, int x, int y, int w, int h, Fl_Align align, void (*callthis)(const char*,int,int,int)) {