From 050cbabdfe2fdbd1337736f017456012e2437b2d Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Fri, 27 Dec 2024 20:56:02 -0500 Subject: Fluid: Rename Stratgy constants to comply with CMP. Capitalized constants. Added flag to indicate creation by user or file. Removed global variable 'reading_file'. --- fluid/Fl_Function_Type.cxx | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) (limited to 'fluid/Fl_Function_Type.cxx') 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(); -- cgit v1.2.3