summaryrefslogtreecommitdiff
path: root/fluid/nodes
diff options
context:
space:
mode:
Diffstat (limited to 'fluid/nodes')
-rw-r--r--fluid/nodes/Function_Node.cxx7
-rw-r--r--fluid/nodes/Menu_Node.cxx7
-rw-r--r--fluid/nodes/Node.cxx11
-rw-r--r--fluid/nodes/Node.h2
-rw-r--r--fluid/nodes/Tree.cxx2
-rw-r--r--fluid/nodes/Widget_Node.cxx7
-rw-r--r--fluid/nodes/factory.cxx4
7 files changed, 25 insertions, 15 deletions
diff --git a/fluid/nodes/Function_Node.cxx b/fluid/nodes/Function_Node.cxx
index 8ffdbef01..a70b10462 100644
--- a/fluid/nodes/Function_Node.cxx
+++ b/fluid/nodes/Function_Node.cxx
@@ -35,6 +35,9 @@
#include <zlib.h>
+using namespace fld;
+using namespace fld::io;
+using namespace fld::proj;
/// Set a current class, so that the code of the children is generated correctly.
Class_Node *current_class = nullptr;
@@ -682,9 +685,9 @@ void Code_Node::write_code1(fld::io::Code_Writer& f) {
if ( handle_editor_changes() == 1 ) {
Fluid.main_window->redraw(); // tell fluid to redraw; edits may affect tree's contents
}
- // Matt: disabled f.tag(FD_TAG_GENERIC, 0);
+ f.tag(Mergeback::Tag::GENERIC, Mergeback::Tag::CODE, 0);
f.write_c_indented(name(), 0, '\n');
- // Matt: disabled f.tag(FD_TAG_CODE, get_uid());
+ f.tag(Mergeback::Tag::CODE, Mergeback::Tag::GENERIC, get_uid());
}
/**
diff --git a/fluid/nodes/Menu_Node.cxx b/fluid/nodes/Menu_Node.cxx
index 2a76b833a..a4434a4dd 100644
--- a/fluid/nodes/Menu_Node.cxx
+++ b/fluid/nodes/Menu_Node.cxx
@@ -44,6 +44,9 @@
#include <stdio.h>
#include <stdlib.h>
+using namespace fld;
+using namespace fld::proj;
+
Fl_Menu_Item menu_item_type_menu[] = {
{"Normal",0,nullptr,(void*)nullptr},
{"Toggle",0,nullptr,(void*)FL_MENU_BOX},
@@ -349,7 +352,7 @@ void Menu_Item_Node::write_static(fld::io::Code_Writer& f) {
f.write_c(", %s", ut);
if (use_v) f.write_c(" v");
f.write_c(") {\n");
- // Matt: disabled f.tag(FD_TAG_GENERIC, 0);
+ f.tag(Mergeback::Tag::GENERIC, Mergeback::Tag::MENU_CALLBACK, 0);
f.write_c_indented(callback(), 1, 0);
if (*(d-1) != ';' && *(d-1) != '}') {
const char *p = strrchr(callback(), '\n');
@@ -360,7 +363,7 @@ void Menu_Item_Node::write_static(fld::io::Code_Writer& f) {
if (*p != '#' && *p) f.write_c(";");
}
f.write_c("\n");
- // Matt: disabled f.tag(FD_TAG_MENU_CALLBACK, get_uid());
+ f.tag(Mergeback::Tag::MENU_CALLBACK, Mergeback::Tag::GENERIC, get_uid());
f.write_c("}\n");
// If the menu item is part of a Class or Widget Class, FLUID generates
diff --git a/fluid/nodes/Node.cxx b/fluid/nodes/Node.cxx
index 194484a93..08ec4a05b 100644
--- a/fluid/nodes/Node.cxx
+++ b/fluid/nodes/Node.cxx
@@ -696,7 +696,6 @@ void Node::add(Node *anchor, Strategy strategy) {
Fluid.proj.tree.first = this;
}
-#if 0
{ // make sure that we have no duplicate uid's
Node *tp = this;
do {
@@ -704,7 +703,6 @@ void Node::add(Node *anchor, Strategy strategy) {
tp = tp->next;
} while (tp!=end && tp!=nullptr);
}
-#endif
// Give the widgets in our tree a chance to update themselves
for (Node *t = this; t && t!=end->next; t = t->next) {
@@ -1274,11 +1272,14 @@ unsigned short Node::set_uid(unsigned short suggested_uid) {
suggested_uid = (unsigned short)rand();
for (;;) {
Node *tp = Fluid.proj.tree.first;
- for ( ; tp; tp = tp->next)
- if (tp!=this && tp->uid_==suggested_uid)
+ for ( ; tp; tp = tp->next) {
+ if (tp!=this && tp->uid_==suggested_uid) {
break;
- if (tp==nullptr)
+ }
+ }
+ if (tp==nullptr) {
break;
+ }
suggested_uid = (unsigned short)rand();
}
uid_ = suggested_uid;
diff --git a/fluid/nodes/Node.h b/fluid/nodes/Node.h
index 5c473a936..64d720297 100644
--- a/fluid/nodes/Node.h
+++ b/fluid/nodes/Node.h
@@ -39,7 +39,7 @@ class Project_Writer;
Declare where a new type is placed and how to create it.
Placement can be as the first or last child of the anchor, or right after the
- anchor. In most cases, the anchor is the last selected type node.
+ anchor. In most cases, the anchor is the last selected node.
If the source is FROM_USER, widgets may be created with default titles and
labels. Type created FROM_FILE will start with no label, so the label is set
diff --git a/fluid/nodes/Tree.cxx b/fluid/nodes/Tree.cxx
index ca9b3d761..92b5e7506 100644
--- a/fluid/nodes/Tree.cxx
+++ b/fluid/nodes/Tree.cxx
@@ -99,7 +99,7 @@ Node *Tree::find_by_uid(unsigned short uid) {
}
-/** Find a type node by using the codeview text positions.
+/** Find a node by using the codeview text positions.
\param[in] text_type 0=source file, 1=header, 2=.fl project file
\param[in] crsr cursor position in text
diff --git a/fluid/nodes/Widget_Node.cxx b/fluid/nodes/Widget_Node.cxx
index cba8607f2..95be9493d 100644
--- a/fluid/nodes/Widget_Node.cxx
+++ b/fluid/nodes/Widget_Node.cxx
@@ -46,6 +46,9 @@
#undef max
#include <algorithm>
+using namespace fld;
+using namespace fld::proj;
+
// Make an Widget_Node subclass instance.
// It figures out the automatic size and parent of the new widget,
// creates the Fl_Widget (by calling the virtual function _make),
@@ -1468,7 +1471,7 @@ void Widget_Node::write_static(fld::io::Code_Writer& f) {
f.write_c(", %s", ut);
if (use_v) f.write_c(" v");
f.write_c(") {\n");
- // Matt: disabled f.tag(FD_TAG_GENERIC, 0);
+ f.tag(Mergeback::Tag::GENERIC, Mergeback::Tag::WIDGET_CALLBACK, 0);
f.write_c_indented(callback(), 1, 0);
if (*(d-1) != ';' && *(d-1) != '}') {
const char *p = strrchr(callback(), '\n');
@@ -1479,7 +1482,7 @@ void Widget_Node::write_static(fld::io::Code_Writer& f) {
if (*p != '#' && *p) f.write_c(";");
}
f.write_c("\n");
- // Matt: disabled f.tag(FD_TAG_WIDGET_CALLBACK, get_uid());
+ f.tag(Mergeback::Tag::WIDGET_CALLBACK, Mergeback::Tag::GENERIC, get_uid());
f.write_c("}\n");
if (k) {
f.write_c("void %s::%s(%s* o, %s v) {\n", k, cn, t, ut);
diff --git a/fluid/nodes/factory.cxx b/fluid/nodes/factory.cxx
index 8388e0202..ca049880a 100644
--- a/fluid/nodes/factory.cxx
+++ b/fluid/nodes/factory.cxx
@@ -1597,7 +1597,7 @@ Node *typename_to_prototype(const char *inName)
}
/**
- Create and add a new type node to the widget tree.
+ Create and add a new node to the widget tree.
This is used by the .fl file reader. New types are always created as
the last child of the first compatible parent. New widgets have a default
@@ -1605,7 +1605,7 @@ Node *typename_to_prototype(const char *inName)
\param[in] inName a C string that described the type we want
\param[in] strategy add after current or as last child
- \return the type node that was created or nullptr
+ \return the node that was created or nullptr
\see add_new_widget_from_file(const char*, int)
add_new_widget_from_user(Node*, int)
add_new_widget_from_user(const char*, int)