summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2025-07-08 15:07:18 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2025-07-08 15:25:14 +0200
commit5d68428a0058649f07c9be3053bd58fd3462d6d9 (patch)
treed411546fba10c3f661978d96cf03211a92406296 /fluid
parent3cf5a302fd2225b8d2622eb40e91262f4e7557c1 (diff)
Fix trailing whitespace and convert a few tabs to spaces
... according to CMP
Diffstat (limited to 'fluid')
-rw-r--r--fluid/Fluid.h2
-rw-r--r--fluid/Project.cxx2
-rw-r--r--fluid/app/Image_Asset.cxx46
-rw-r--r--fluid/app/Menu.cxx2
-rw-r--r--fluid/app/templates.cxx2
-rw-r--r--fluid/documentation/src/page_mergeback.dox22
-rw-r--r--fluid/nodes/factory.cxx2
-rw-r--r--fluid/panels/widget_panel.cxx20
-rw-r--r--fluid/panels/widget_panel.fl20
-rw-r--r--fluid/proj/i18n.cxx2
-rw-r--r--fluid/proj/mergeback.cxx12
-rw-r--r--fluid/proj/undo.h2
-rw-r--r--fluid/widgets/Formula_Input.h8
13 files changed, 71 insertions, 71 deletions
diff --git a/fluid/Fluid.h b/fluid/Fluid.h
index e533e6b68..d67c31cb3 100644
--- a/fluid/Fluid.h
+++ b/fluid/Fluid.h
@@ -89,7 +89,7 @@ public: // Member Variables
app::History history;
/// Command line arguments
app::Args args;
- /// List of available layouts
+ /// List of available layouts
app::Layout_List layout_list;
/// Set, if Fluid runs in batch mode, and no user interface is activated.
int batch_mode { 0 }; // fluid + any code generators (-u, -c, -cs)
diff --git a/fluid/Project.cxx b/fluid/Project.cxx
index 2c7dca6e5..cc845ef5b 100644
--- a/fluid/Project.cxx
+++ b/fluid/Project.cxx
@@ -14,7 +14,7 @@
// https://www.fltk.org/bugs.php
//
-#include <errno.h> // strerror(errno)
+#include <errno.h> // strerror(errno)
#include "Project.h"
#include "io/String_Writer.h"
diff --git a/fluid/app/Image_Asset.cxx b/fluid/app/Image_Asset.cxx
index a001f2291..7a05cd99b 100644
--- a/fluid/app/Image_Asset.cxx
+++ b/fluid/app/Image_Asset.cxx
@@ -44,23 +44,23 @@
/**
\brief A map of all image assets.
- \todo This is a global variable, but should be associated
+ \todo This is a global variable, but should be associated
with a project instead.
*/
static std::map<std::string, Image_Asset*> image_asset_map;
-/**
+/**
\brief Write the contents of the image file as binary source code.
- Write the contents of the image file as C++ code, so the image is available in
+ Write the contents of the image file as C++ code, so the image is available in
the target app in the original binary format, for example:
```
{ 1, 2, 3, ...}
```
\param f Write code to this C++ source code file
\param fmt short name of file contents for error message
- \return 0 if the file could not be opened or read
+ \return 0 if the file could not be opened or read
*/
size_t Image_Asset::write_static_binary(fld::io::Code_Writer& f, const char* fmt) {
size_t nData = 0;
@@ -86,7 +86,7 @@ size_t Image_Asset::write_static_binary(fld::io::Code_Writer& f, const char* fmt
}
-/**
+/**
\brief Write the contents of the image file as text with escaped special characters.
This function is only useful for writing out image formats that are ASCII text
@@ -94,7 +94,7 @@ size_t Image_Asset::write_static_binary(fld::io::Code_Writer& f, const char* fmt
\param f Write code to this C++ source code file
\param fmt short name of file contents for error message
- \return 0 if the file could not be opened or read
+ \return 0 if the file could not be opened or read
*/
size_t Image_Asset::write_static_text(fld::io::Code_Writer& f, const char* fmt) {
size_t nData = 0;
@@ -120,18 +120,18 @@ size_t Image_Asset::write_static_text(fld::io::Code_Writer& f, const char* fmt)
}
-/**
+/**
\brief Write the contents of the image file as uncompressed RGB.
Write source code that generates the uncompressed RGB image data at compile
time, and an initializer that creates the image at run time.
- \todo If the ld() value is not 0 and not d()*w(), the image data is not
+ \todo If the ld() value is not 0 and not d()*w(), the image data is not
written correctly. There is no check if the data is actually in RGB format.
\param f Write code to this C++ source code file
\param fmt short name of file contents for error message
- \return 0 if the file could not be opened or read
+ \return 0 if the file could not be opened or read
*/
void Image_Asset::write_static_rgb(fld::io::Code_Writer& f, const char* idata_name) {
// Write image data...
@@ -306,15 +306,15 @@ void Image_Asset::write_file_error(fld::io::Code_Writer& f, const char *fmt) {
The generated code loads the image if it hasn't been loaded yet, and then
returns a pointer to the image.
- \code
+ \code
static Fl_Image *'initializer_function_'() {
static Fl_Image *image = 0L;
if (!image)
image = new 'type_name'('product of format and remaining args');
return image;
}
- \endcode
-
+ \endcode
+
\param f Write the C++ code to this file.
\param image_class Name of the Fl_Image class, for example Fl_GIF_Image.
\param format Format string for additional parameters for the constructor.
@@ -341,7 +341,7 @@ void Image_Asset::write_initializer(fld::io::Code_Writer& f, const char *image_c
The generated code will call the image initializer function and assign
the resulting image to the widget.
-
+
\param f Write the C++ code to this file.
\param bind If true, use bind_image() instead of image().
\param var Name of the Fl_Widget or Fl_Menu_Item to attach the image to.
@@ -349,16 +349,16 @@ void Image_Asset::write_initializer(fld::io::Code_Writer& f, const char *image_c
*/
void Image_Asset::write_code(fld::io::Code_Writer& f, int bind, const char *var, int inactive) {
if (image_) {
- f.write_c("%s%s->%s%s( %s() );\n",
- f.indent(),
- var,
- bind ? "bind_" : "",
- inactive ? "deimage" : "image",
+ f.write_c("%s%s->%s%s( %s() );\n",
+ f.indent(),
+ var,
+ bind ? "bind_" : "",
+ inactive ? "deimage" : "image",
initializer_function_.c_str());
if (is_animated_gif_)
- f.write_c("%s((Fl_Anim_GIF_Image*)(%s()))->canvas(%s, Fl_Anim_GIF_Image::DONT_RESIZE_CANVAS);\n",
- f.indent(),
- initializer_function_.c_str(),
+ f.write_c("%s((Fl_Anim_GIF_Image*)(%s()))->canvas(%s, Fl_Anim_GIF_Image::DONT_RESIZE_CANVAS);\n",
+ f.indent(),
+ initializer_function_.c_str(),
var);
}
}
@@ -485,8 +485,8 @@ void Image_Asset::dec_ref() {
\brief Destructor for the Image_Asset class.
This destructor removes the image asset from the global image asset map
- and releases the associated shared image if it exists. It ensures that
- any resources associated with the Image_Asset are properly cleaned up
+ and releases the associated shared image if it exists. It ensures that
+ any resources associated with the Image_Asset are properly cleaned up
when the object is destroyed.
*/
Image_Asset::~Image_Asset() {
diff --git a/fluid/app/Menu.cxx b/fluid/app/Menu.cxx
index 32fe59805..ab03a822d 100644
--- a/fluid/app/Menu.cxx
+++ b/fluid/app/Menu.cxx
@@ -67,7 +67,7 @@ void menu_file_save_cb(Fl_Widget *, void *arg) { Fluid.save_project_file(arg); }
static void menu_file_print_cb(Fl_Widget *, void *arg) { Fluid.print_snapshots(); }
void menu_file_open_history_cb(Fl_Widget *, void *v) { Fluid.open_project_file(std::string((const char*)v)); }
static void menu_layout_sync_resize_cb(Fl_Menu_ *m, void*) {
- if (m->mvalue()->value()) Fluid.proj.tree.allow_layout = 1; else Fluid.proj.tree.allow_layout = 0;
+ if (m->mvalue()->value()) Fluid.proj.tree.allow_layout = 1; else Fluid.proj.tree.allow_layout = 0;
}
static void menu_file_revert_cb(Fl_Widget *, void *) { Fluid.revert_project(); }
void exit_cb(Fl_Widget *,void *) { Fluid.quit(); }
diff --git a/fluid/app/templates.cxx b/fluid/app/templates.cxx
index 6099cb41b..cbd266b13 100644
--- a/fluid/app/templates.cxx
+++ b/fluid/app/templates.cxx
@@ -13,7 +13,7 @@
//
// https://www.fltk.org/bugs.php
//
-#include <errno.h> // strerror(errno)
+#include <errno.h> // strerror(errno)
#include "app/templates.h"
#include "Fluid.h"
diff --git a/fluid/documentation/src/page_mergeback.dox b/fluid/documentation/src/page_mergeback.dox
index cbea8add9..7b3bc1a22 100644
--- a/fluid/documentation/src/page_mergeback.dox
+++ b/fluid/documentation/src/page_mergeback.dox
@@ -6,9 +6,9 @@
# Introduction to Mergeback #
- Fluid has introduced an experimental feature called **MergeBack** in version 1.5.
- This feature allows developers to edit the C++ source files generated by Fluid and
- then merge those changes back into the corresponding Fluid project file (.fl). This
+ Fluid has introduced an experimental feature called **MergeBack** in version 1.5.
+ This feature allows developers to edit the C++ source files generated by Fluid and
+ then merge those changes back into the corresponding Fluid project file (.fl). This
can streamline the development process by reducing the need to switch between Fluid
and your code editor for minor adjustments.
@@ -25,9 +25,9 @@
- Navigate to the **Settings Panel**.
- In the **Project Settings**, locate and enable the **MergeBack** option.
- Once enabled, Fluid assigns a unique ID to each node in your project.
- Additionally, user-editable code sections in the generated source files will
- be marked with special divider lines, indicating areas that can be edited
+ Once enabled, Fluid assigns a unique ID to each node in your project.
+ Additionally, user-editable code sections in the generated source files will
+ be marked with special divider lines, indicating areas that can be edited
and later merged back.
<H2>Understanding the Code Markers:</H2>
@@ -43,10 +43,10 @@
}
```
- The lines beginning with `//fl ▼` and `//fl ▲` are markers that Fluid
- uses to identify editable sections. These markers contain encoded information
- about the code block, including a CRC32 checksum and a unique node ID. Fluid
- uses this information during the merge process to detect changes and associate
+ The lines beginning with `//fl ▼` and `//fl ▲` are markers that Fluid
+ uses to identify editable sections. These markers contain encoded information
+ about the code block, including a CRC32 checksum and a unique node ID. Fluid
+ uses this information during the merge process to detect changes and associate
them with the correct nodes in your project.
<H2>Editing and Merging Back</H2>
@@ -76,5 +76,5 @@
Given the experimental nature of MergeBack, unexpected
behaviors may occur. Always ensure you have backups of your project
- files before using this feature.
+ files before using this feature.
*/
diff --git a/fluid/nodes/factory.cxx b/fluid/nodes/factory.cxx
index ca049880a..8c4caa08d 100644
--- a/fluid/nodes/factory.cxx
+++ b/fluid/nodes/factory.cxx
@@ -16,7 +16,7 @@
/**
-
+
\todo Verify the text
Type classes for most of the fltk widgets. Most of the work
diff --git a/fluid/panels/widget_panel.cxx b/fluid/panels/widget_panel.cxx
index f9365ae63..86bff8e62 100644
--- a/fluid/panels/widget_panel.cxx
+++ b/fluid/panels/widget_panel.cxx
@@ -1063,13 +1063,13 @@ static void cb_wp_gui_margins(Fl_Group* o, void* v) {
}
static void cb_Left(Fl_Value_Input* o, void* v) {
- flex_margin_cb(o, v,
+ flex_margin_cb(o, v,
[](Fl_Flex *w, Fl_Value_Input* i) -> void
{
int v;
w->margin(&v, nullptr, nullptr, nullptr);
i->value((double)v);
- },
+ },
[](Fl_Flex *w, int new_value) -> int
{
int l, t, r, b;
@@ -1107,7 +1107,7 @@ static void cb_Top(Fl_Value_Input* o, void* v) {
}
static void cb_Right(Fl_Value_Input* o, void* v) {
- flex_margin_cb(o, v,
+ flex_margin_cb(o, v,
[](Fl_Flex *w, Fl_Value_Input* i) -> void
{
int v;
@@ -1129,7 +1129,7 @@ static void cb_Right(Fl_Value_Input* o, void* v) {
}
static void cb_Bottom(Fl_Value_Input* o, void* v) {
- flex_margin_cb(o, v,
+ flex_margin_cb(o, v,
[](Fl_Flex *w, Fl_Value_Input* i) -> void
{
int v;
@@ -1151,12 +1151,12 @@ static void cb_Bottom(Fl_Value_Input* o, void* v) {
}
static void cb_Gap(Fl_Value_Input* o, void* v) {
- flex_margin_cb(o, v,
+ flex_margin_cb(o, v,
[](Fl_Flex *w, Fl_Value_Input* o) -> void
{
int v = w->gap();
o->value((double)v);
- },
+ },
[](Fl_Flex *w, int new_value) -> int
{
int g = w->gap();
@@ -1575,8 +1575,8 @@ static void cb_6(Fl_Menu_Button* o, void* v) {
if (d == c) return;
c = d;
labelcolor_common(c);
- w_labelcolor->color(c);
- w_labelcolor->labelcolor(fl_contrast(FL_BLACK,c));
+ w_labelcolor->color(c);
+ w_labelcolor->labelcolor(fl_contrast(FL_BLACK,c));
w_labelcolor->redraw();
}
}
@@ -1586,7 +1586,7 @@ Fl_Group *wp_style_box=(Fl_Group *)0;
static void cb_7(Fl_Choice* o, void* v) {
if (v == LOAD) {
if (current_widget->is_a(Type::Menu_Item)) {o->deactivate(); return;} else o->activate();
- int n = current_widget->o->box();
+ int n = current_widget->o->box();
if (!n) n = ZERO_ENTRY;
for (int j = 0; j < 72 /*int(sizeof(boxmenu)/sizeof(*boxmenu))*/; j++)
if (boxmenu[j].argument() == n) {o->value(j); break;}
@@ -1927,7 +1927,7 @@ Fl_Group *wp_cpp_class=(Fl_Group *)0;
static void cb_e(Fl_Input* o, void* v) {
if (v == LOAD) {
if (current_widget->is_a(Type::Menu_Item)) {
- o->deactivate();
+ o->deactivate();
} else {
o->activate();
o->value(current_widget->subclass());
diff --git a/fluid/panels/widget_panel.fl b/fluid/panels/widget_panel.fl
index d479b0bef..b120ec28f 100644
--- a/fluid/panels/widget_panel.fl
+++ b/fluid/panels/widget_panel.fl
@@ -1204,13 +1204,13 @@ h, ph, sh, ch, and i} xywh {275 150 55 20} labelsize 11 align 5 textsize 11
} {
Fl_Value_Input {} {
label {Left:}
- callback {flex_margin_cb(o, v,
+ callback {flex_margin_cb(o, v,
[](Fl_Flex *w, Fl_Value_Input* i) -> void
{
int v;
w->margin(&v, nullptr, nullptr, nullptr);
i->value((double)v);
- },
+ },
[](Fl_Flex *w, int new_value) -> int
{
int l, t, r, b;
@@ -1250,7 +1250,7 @@ h, ph, sh, ch, and i} xywh {275 150 55 20} labelsize 11 align 5 textsize 11
}
Fl_Value_Input {} {
label {Right:}
- callback {flex_margin_cb(o, v,
+ callback {flex_margin_cb(o, v,
[](Fl_Flex *w, Fl_Value_Input* i) -> void
{
int v;
@@ -1273,7 +1273,7 @@ h, ph, sh, ch, and i} xywh {275 150 55 20} labelsize 11 align 5 textsize 11
}
Fl_Value_Input {} {
label {Bottom:}
- callback {flex_margin_cb(o, v,
+ callback {flex_margin_cb(o, v,
[](Fl_Flex *w, Fl_Value_Input* i) -> void
{
int v;
@@ -1296,12 +1296,12 @@ h, ph, sh, ch, and i} xywh {275 150 55 20} labelsize 11 align 5 textsize 11
}
Fl_Value_Input {} {
label {Gap:}
- callback {flex_margin_cb(o, v,
+ callback {flex_margin_cb(o, v,
[](Fl_Flex *w, Fl_Value_Input* o) -> void
{
int v = w->gap();
o->value((double)v);
- },
+ },
[](Fl_Flex *w, int new_value) -> int
{
int g = w->gap();
@@ -1769,8 +1769,8 @@ if (v != LOAD) {
if (d == c) return;
c = d;
labelcolor_common(c);
- w_labelcolor->color(c);
- w_labelcolor->labelcolor(fl_contrast(FL_BLACK,c));
+ w_labelcolor->color(c);
+ w_labelcolor->labelcolor(fl_contrast(FL_BLACK,c));
w_labelcolor->redraw();
}} open
xywh {386 40 18 20}
@@ -1786,7 +1786,7 @@ if (v != LOAD) {
Fl_Choice {} {
callback {if (v == LOAD) {
if (current_widget->is_a(Type::Menu_Item)) {o->deactivate(); return;} else o->activate();
- int n = current_widget->o->box();
+ int n = current_widget->o->box();
if (!n) n = ZERO_ENTRY;
for (int j = 0; j < 72 /*int(sizeof(boxmenu)/sizeof(*boxmenu))*/; j++)
if (boxmenu[j].argument() == n) {o->value(j); break;}
@@ -2169,7 +2169,7 @@ if (v == LOAD) {
user_data 4
callback {if (v == LOAD) {
if (current_widget->is_a(Type::Menu_Item)) {
- o->deactivate();
+ o->deactivate();
} else {
o->activate();
o->value(current_widget->subclass());
diff --git a/fluid/proj/i18n.cxx b/fluid/proj/i18n.cxx
index a00dcf2f2..247522dd3 100644
--- a/fluid/proj/i18n.cxx
+++ b/fluid/proj/i18n.cxx
@@ -63,7 +63,7 @@ void I18n::read(io::Project_Reader &f, const char *key) {
gnu_conditional = f.read_word();
} else if (type == fld::I18n_Type::POSIX) {
posix_conditional = f.read_word();
- }
+ }
}
}
diff --git a/fluid/proj/mergeback.cxx b/fluid/proj/mergeback.cxx
index 53ea93244..d9e5b0136 100644
--- a/fluid/proj/mergeback.cxx
+++ b/fluid/proj/mergeback.cxx
@@ -112,7 +112,7 @@ int merge_back(Project &proj, const std::string &s, const std::string &p, Mergeb
}
/** Allocate and initialize MergeBack class. */
-Mergeback::Mergeback(Project &proj)
+Mergeback::Mergeback(Project &proj)
: proj_(proj),
code(nullptr),
line_no(0),
@@ -608,13 +608,13 @@ int Mergeback::merge_back(const std::string &s, const std::string &p, Task task)
/**
\brief Merges back code files with the project file.
- This function flushes text widgets, checks if the project filename and
- mergeback data are available, and then attempts to merge back the code
- files with the project file. If MergeBack is not enabled, it displays
+ This function flushes text widgets, checks if the project filename and
+ mergeback data are available, and then attempts to merge back the code
+ files with the project file. If MergeBack is not enabled, it displays
a message to the user. It handles both batch and interactive modes.
- \return int - Returns 1 if the project filename is not available,
- 0 if MergeBack is not enabled,
+ \return int - Returns 1 if the project filename is not available,
+ 0 if MergeBack is not enabled,
or the result of the merge_back function.
*/
int mergeback_code_files(Project &proj)
diff --git a/fluid/proj/undo.h b/fluid/proj/undo.h
index f87c747bd..7bb02b72f 100644
--- a/fluid/proj/undo.h
+++ b/fluid/proj/undo.h
@@ -30,7 +30,7 @@ namespace proj {
class Undo
{
public:
-
+
enum class OnceType {
ALWAYS = 0,
WINDOW_RESIZE
diff --git a/fluid/widgets/Formula_Input.h b/fluid/widgets/Formula_Input.h
index 060c1e157..5df30b5af 100644
--- a/fluid/widgets/Formula_Input.h
+++ b/fluid/widgets/Formula_Input.h
@@ -47,19 +47,19 @@ class Formula_Input : public Fl_Input
int eval_var(uchar *&s) const;
int eval(uchar *&s, int prio) const;
int eval(const char *s) const;
-
+
public:
Formula_Input(int x, int y, int w, int h, const char *l = nullptr);
/** Return the text in the widget text field. */
const char *text() const { return Fl_Input::value(); }
-
+
/** Set the text in the text field */
void text(const char *v) { Fl_Input::value(v); }
-
+
int value() const;
void value(int v);
-
+
/** Set the general callback for this widget. */
void callback(Fl_Callback *cb) { user_callback_ = cb; }