summaryrefslogtreecommitdiff
path: root/fluid/Fl_Function_Type.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2024-12-27 20:56:02 -0500
committerMatthias Melcher <github@matthiasm.com>2024-12-27 20:56:10 -0500
commit050cbabdfe2fdbd1337736f017456012e2437b2d (patch)
tree21efed95ef5368e67a7a6377ab0a3a2f936e4426 /fluid/Fl_Function_Type.cxx
parent2100655a1b55d1c77932b649b758f2eab1107fcb (diff)
Fluid: Rename Stratgy constants to comply with CMP.
Capitalized constants. Added flag to indicate creation by user or file. Removed global variable 'reading_file'.
Diffstat (limited to 'fluid/Fl_Function_Type.cxx')
-rw-r--r--fluid/Fl_Function_Type.cxx41
1 files changed, 24 insertions, 17 deletions
diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx
index f490c9e11..935cd6405 100644
--- a/fluid/Fl_Function_Type.cxx
+++ b/fluid/Fl_Function_Type.cxx
@@ -202,15 +202,16 @@ Fl_Function_Type::~Fl_Function_Type() {
/**
Create a new function for the widget tree.
- \param[in] strategy new function add after current or as last child
+ \param[in] strategy add new function after current or as last child
\return the new node
*/
Fl_Type *Fl_Function_Type::make(Strategy strategy) {
Fl_Type *anchor = Fl_Type::current, *p = anchor;
- if (p && (strategy == kAddAfterCurrent)) p = p->parent;
+ if (p && (strategy.placement() == Strategy::AFTER_CURRENT))
+ p = p->parent;
while (p && !p->is_decl_block()) {
anchor = p;
- strategy = kAddAfterCurrent;
+ strategy.placement(Strategy::AFTER_CURRENT);
p = p->parent;
}
Fl_Function_Type *o = new Fl_Function_Type();
@@ -596,10 +597,11 @@ Fl_Code_Type::Fl_Code_Type() :
*/
Fl_Type *Fl_Code_Type::make(Strategy strategy) {
Fl_Type *anchor = Fl_Type::current, *p = anchor;
- if (p && (strategy == kAddAfterCurrent)) p = p->parent;
+ if (p && (strategy.placement() == Strategy::AFTER_CURRENT))
+ p = p->parent;
while (p && !p->is_code_block()) {
anchor = p;
- strategy = kAddAfterCurrent;
+ strategy.placement(Strategy::AFTER_CURRENT);
p = p->parent;
}
if (!p) {
@@ -763,10 +765,11 @@ Fl_CodeBlock_Type::~Fl_CodeBlock_Type() {
*/
Fl_Type *Fl_CodeBlock_Type::make(Strategy strategy) {
Fl_Type *anchor = Fl_Type::current, *p = anchor;
- if (p && (strategy == kAddAfterCurrent)) p = p->parent;
+ if (p && (strategy.placement() == Strategy::AFTER_CURRENT))
+ p = p->parent;
while (p && !p->is_code_block()) {
anchor = p;
- strategy = kAddAfterCurrent;
+ strategy.placement(Strategy::AFTER_CURRENT);
p = p->parent;
}
if (!p) {
@@ -904,10 +907,11 @@ int Fl_Decl_Type::is_public() const
*/
Fl_Type *Fl_Decl_Type::make(Strategy strategy) {
Fl_Type *anchor = Fl_Type::current, *p = anchor;
- if (p && (strategy == kAddAfterCurrent)) p = p->parent;
+ if (p && (strategy.placement() == Strategy::AFTER_CURRENT))
+ p = p->parent;
while (p && !p->is_decl_block()) {
anchor = p;
- strategy = kAddAfterCurrent;
+ strategy.placement(Strategy::AFTER_CURRENT);
p = p->parent;
}
Fl_Decl_Type *o = new Fl_Decl_Type();
@@ -1131,10 +1135,11 @@ Fl_Data_Type::~Fl_Data_Type() {
*/
Fl_Type *Fl_Data_Type::make(Strategy strategy) {
Fl_Type *anchor = Fl_Type::current, *p = anchor;
- if (p && (strategy == kAddAfterCurrent)) p = p->parent;
+ if (p && (strategy.placement() == Strategy::AFTER_CURRENT))
+ p = p->parent;
while (p && !p->is_decl_block()) {
anchor = p;
- strategy = kAddAfterCurrent;
+ strategy.placement(Strategy::AFTER_CURRENT);
p = p->parent;
}
Fl_Data_Type *o = new Fl_Data_Type();
@@ -1474,10 +1479,10 @@ int Fl_DeclBlock_Type::is_public() const {
*/
Fl_Type *Fl_DeclBlock_Type::make(Strategy strategy) {
Fl_Type *anchor = Fl_Type::current, *p = anchor;
- if (p && (strategy == kAddAfterCurrent)) p = p->parent;
+ if (p && (strategy.placement() == Strategy::AFTER_CURRENT)) p = p->parent;
while (p && !p->is_decl_block()) {
anchor = p;
- strategy = kAddAfterCurrent;
+ strategy.placement(Strategy::AFTER_CURRENT);
p = p->parent;
}
Fl_DeclBlock_Type *o = new Fl_DeclBlock_Type();
@@ -1706,10 +1711,11 @@ Fl_Comment_Type::Fl_Comment_Type() :
*/
Fl_Type *Fl_Comment_Type::make(Strategy strategy) {
Fl_Type *anchor = Fl_Type::current, *p = anchor;
- if (p && (strategy == kAddAfterCurrent)) p = p->parent;
+ if (p && (strategy.placement() == Strategy::AFTER_CURRENT))
+ p = p->parent;
while (p && !p->is_code_block()) {
anchor = p;
- strategy = kAddAfterCurrent;
+ strategy.placement(Strategy::AFTER_CURRENT);
p = p->parent;
}
Fl_Comment_Type *o = new Fl_Comment_Type();
@@ -1985,10 +1991,11 @@ void Fl_Class_Type::prefix(const char*p) {
*/
Fl_Type *Fl_Class_Type::make(Strategy strategy) {
Fl_Type *anchor = Fl_Type::current, *p = anchor;
- if (p && (strategy == kAddAfterCurrent)) p = p->parent;
+ if (p && (strategy.placement() == Strategy::AFTER_CURRENT))
+ p = p->parent;
while (p && !p->is_decl_block()) {
anchor = p;
- strategy = kAddAfterCurrent;
+ strategy.placement(Strategy::AFTER_CURRENT);
p = p->parent;
}
Fl_Class_Type *o = new Fl_Class_Type();