summaryrefslogtreecommitdiff
path: root/fluid/io
diff options
context:
space:
mode:
authormaxim nikonov <maxim.nikonov@hqo.co>2026-02-05 23:48:25 +0500
committermaxim nikonov <maxim.nikonov@hqo.co>2026-02-05 23:48:25 +0500
commitc53067d2f6cfd6e3c6b476c51ab8c4b931e40a30 (patch)
tree95bfab59b2d9a38a57b6aa05244cab2d0435c7d2 /fluid/io
parent57860e277f2298ad6c0830b1492087cfa124c862 (diff)
wip
Diffstat (limited to 'fluid/io')
-rw-r--r--fluid/io/Code_Writer.cxx34
-rw-r--r--fluid/io/Project_Reader.cxx4
-rw-r--r--fluid/io/String_Writer.cxx6
3 files changed, 22 insertions, 22 deletions
diff --git a/fluid/io/Code_Writer.cxx b/fluid/io/Code_Writer.cxx
index 7f265bafa..916d024bd 100644
--- a/fluid/io/Code_Writer.cxx
+++ b/fluid/io/Code_Writer.cxx
@@ -457,12 +457,12 @@ void Code_Writer::write_c_indented(const char *textlines, int inIndent, char inT
members of the class itself.
*/
bool is_class_member(Node *t) {
- return t->is_a(Type::Function)
- || t->is_a(Type::Decl)
- || t->is_a(Type::Data);
-// || t->is_a(Type::Class) // FLUID can't handle a class inside a class
-// || t->is_a(Type::Widget_Class)
-// || t->is_a(Type::DeclBlock) // Declaration blocks are generally not handled well
+ return t->is_a(FLD_NODE_TYPE_Function)
+ || t->is_a(FLD_NODE_TYPE_Decl)
+ || t->is_a(FLD_NODE_TYPE_Data);
+// || t->is_a(FLD_NODE_TYPE_Class) // FLUID can't handle a class inside a class
+// || t->is_a(FLD_NODE_TYPE_Widget_Class)
+// || t->is_a(FLD_NODE_TYPE_DeclBlock) // Declaration blocks are generally not handled well
}
/**
@@ -476,8 +476,8 @@ bool is_class_member(Node *t) {
\see is_class_member(Node *t)
*/
bool is_comment_before_class_member(Node *q) {
- if (q->is_a(Type::Comment) && q->next && q->next->level==q->level) {
- if (q->next->is_a(Type::Comment))
+ if (q->is_a(FLD_NODE_TYPE_Comment) && q->next && q->next->level==q->level) {
+ if (q->next->is_a(FLD_NODE_TYPE_Comment))
return is_comment_before_class_member(q->next);
if (is_class_member(q->next))
return true;
@@ -515,7 +515,7 @@ Node* Code_Writer::write_static(Node* p) {
Node* Code_Writer::write_code(Node* p) {
// write all code that comes before the children code
// (but don't write the last comment until the very end)
- if (!(p==Fluid.proj.tree.last && p->is_a(Type::Comment))) {
+ if (!(p==Fluid.proj.tree.last && p->is_a(FLD_NODE_TYPE_Comment))) {
if (write_codeview) p->code1_start = (int)ftell(code_file);
if (write_codeview) p->header1_start = (int)ftell(header_file);
p->write_code1(*this);
@@ -611,7 +611,7 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
// if the first entry in the Type tree is a comment, then it is probably
// a copyright notice. We print that before anything else in the file!
Node* first_node = Fluid.proj.tree.first;
- if (first_node && first_node->is_a(Type::Comment)) {
+ if (first_node && first_node->is_a(FLD_NODE_TYPE_Comment)) {
if (write_codeview) {
first_node->code1_start = first_node->code2_start = (int)ftell(code_file);
first_node->header1_start = first_node->header2_start = (int)ftell(header_file);
@@ -689,14 +689,14 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
}
}
std::string loc_include, loc_conditional;
- if (proj_.i18n.type==fld::I18n_Type::GNU) {
+ if (proj_.i18n.type==FLD_I18N_TYPE_GNU) {
loc_include = proj_.i18n.gnu_include;
loc_conditional = proj_.i18n.gnu_conditional;
} else {
loc_include = proj_.i18n.posix_include;
loc_conditional = proj_.i18n.posix_conditional;
}
- if ((proj_.i18n.type != fld::I18n_Type::NONE) && !loc_include.empty()) {
+ if ((proj_.i18n.type != FLD_I18N_TYPE_NONE) && !loc_include.empty()) {
int conditional = !loc_conditional.empty();
if (conditional) {
write_c("#ifdef %s\n", loc_conditional.c_str());
@@ -706,7 +706,7 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
write_c("#%sinclude \"%s\"\n", indent(), loc_include.c_str());
else
write_c("#%sinclude %s\n", indent(), loc_include.c_str());
- if (proj_.i18n.type == fld::I18n_Type::POSIX) {
+ if (proj_.i18n.type == FLD_I18N_TYPE_POSIX) {
if (!proj_.i18n.posix_file.empty()) {
write_c("extern nl_catd %s;\n", proj_.i18n.posix_file.c_str());
} else {
@@ -718,14 +718,14 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
}
if (conditional) {
write_c("#else\n");
- if (proj_.i18n.type == fld::I18n_Type::GNU) {
+ if (proj_.i18n.type == FLD_I18N_TYPE_GNU) {
if (!proj_.i18n.gnu_function.empty()) {
write_c("#%sifndef %s\n", indent(), proj_.i18n.gnu_function.c_str());
write_c("#%sdefine %s(text) text\n", indent_plus(1), proj_.i18n.gnu_function.c_str());
write_c("#%sendif\n", indent());
}
}
- if (proj_.i18n.type == fld::I18n_Type::POSIX) {
+ if (proj_.i18n.type == FLD_I18N_TYPE_POSIX) {
write_c("#%sifndef catgets\n", indent());
write_c("#%sdefine catgets(catalog, set, msgid, text) text\n", indent_plus(1));
write_c("#%sendif\n", indent());
@@ -733,7 +733,7 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
indentation--;
write_c("#endif\n");
}
- if (proj_.i18n.type == fld::I18n_Type::GNU && proj_.i18n.gnu_static_function[0]) {
+ if (proj_.i18n.type == FLD_I18N_TYPE_GNU && proj_.i18n.gnu_static_function[0]) {
write_c("#ifndef %s\n", proj_.i18n.gnu_static_function.c_str());
write_c("#%sdefine %s(text) text\n", indent_plus(1), proj_.i18n.gnu_static_function.c_str());
write_c("#endif\n");
@@ -751,7 +751,7 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
fprintf(header_file, "#endif\n");
Node* last_node = Fluid.proj.tree.last;
- if (last_node && (last_node != Fluid.proj.tree.first) && last_node->is_a(Type::Comment)) {
+ if (last_node && (last_node != Fluid.proj.tree.first) && last_node->is_a(FLD_NODE_TYPE_Comment)) {
if (write_codeview) {
last_node->code1_start = last_node->code2_start = (int)ftell(code_file);
last_node->header1_start = last_node->header2_start = (int)ftell(header_file);
diff --git a/fluid/io/Project_Reader.cxx b/fluid/io/Project_Reader.cxx
index a4c3695d6..e4eb65606 100644
--- a/fluid/io/Project_Reader.cxx
+++ b/fluid/io/Project_Reader.cxx
@@ -350,7 +350,7 @@ Node *Project_Reader::read_children(Node *p, int merge, Strategy strategy, char
// FIXME: this has no business in the file reader!
// TODO: this is called whenever something is pasted from the top level into a grid
// It makes sense to make this more universal for other widget types too.
- if (merge && t && t->parent && t->parent->is_a(Type::Grid)) {
+ if (merge && t && t->parent && t->parent->is_a(FLD_NODE_TYPE_Grid)) {
if (Window_Node::popupx != 0x7FFFFFFF) {
((Grid_Node*)t->parent)->insert_child_at(((Widget_Node*)t)->o, Window_Node::popupx, Window_Node::popupy);
} else {
@@ -403,7 +403,7 @@ int Project_Reader::read_project(const char *filename, int merge, Strategy strat
Fluid.proj.tree.current = nullptr;
// Force menu items to be rebuilt...
for (o = Fluid.proj.tree.first; o; o = o->next) {
- if (o->is_a(Type::Menu_Manager_)) {
+ if (o->is_a(FLD_NODE_TYPE_Menu_Manager_)) {
o->add_child(nullptr,nullptr);
}
}
diff --git a/fluid/io/String_Writer.cxx b/fluid/io/String_Writer.cxx
index 4928e218a..6d7761a49 100644
--- a/fluid/io/String_Writer.cxx
+++ b/fluid/io/String_Writer.cxx
@@ -69,7 +69,7 @@ int fld::io::write_strings(Project &proj, const std::string &filename) {
if (!fp) return 1;
switch (proj.i18n.type) {
- case fld::I18n_Type::NONE : /* None, just put static text out */
+ case FLD_I18N_TYPE_NONE : /* None, just put static text out */
fprintf(fp, "# generated by Fast Light User Interface Designer (fluid) version %.4f\n",
FL_VERSION);
for (auto w: proj.tree.all_widgets()) {
@@ -83,7 +83,7 @@ int fld::io::write_strings(Project &proj, const std::string &filename) {
}
}
break;
- case fld::I18n_Type::GNU : /* GNU gettext, put a .po file out */
+ case FLD_I18N_TYPE_GNU : /* GNU gettext, put a .po file out */
fprintf(fp, "# generated by Fast Light User Interface Designer (fluid) version %.4f\n",
FL_VERSION);
for (p = proj.tree.first; p; p = p->next) {
@@ -112,7 +112,7 @@ int fld::io::write_strings(Project &proj, const std::string &filename) {
}
}
break;
- case fld::I18n_Type::POSIX : /* POSIX catgets, put a .msg file out */
+ case FLD_I18N_TYPE_POSIX : /* POSIX catgets, put a .msg file out */
fprintf(fp, "$ generated by Fast Light User Interface Designer (fluid) version %.4f\n",
FL_VERSION);
fprintf(fp, "$set %s\n", proj.i18n.posix_set.c_str());