summaryrefslogtreecommitdiff
path: root/fluid/Project.h
diff options
context:
space:
mode:
Diffstat (limited to 'fluid/Project.h')
-rw-r--r--fluid/Project.h77
1 files changed, 43 insertions, 34 deletions
diff --git a/fluid/Project.h b/fluid/Project.h
index d4d60daaa..f920c6ff3 100644
--- a/fluid/Project.h
+++ b/fluid/Project.h
@@ -22,7 +22,7 @@
#include "proj/i18n.h"
#include "nodes/Tree.h"
-#include <string>
+#include <FL/filename.H>
// ---- project class declaration
@@ -41,49 +41,49 @@ class Project
{
public: // Member Variables
// Undo actions for this Project.
- proj::Undo undo { *this };
+ proj::Undo undo;
// Manage the node tree of the project.
- node::Tree tree { *this };
+ node::Tree tree;
// Project internationalization.
- proj::I18n i18n { *this };
+ proj::I18n i18n;
/// If set, generate code to include the header file form the c++ file
- int include_H_from_C = 1;
+ int include_H_from_C;
/// If set, handle keyboard shortcut Ctrl on macOS using Cmd instead
- int use_FL_COMMAND = 0;
+ int use_FL_COMMAND;
/// Clear if UTF-8 characters in statics texts are written as escape sequences
- int utf8_in_src = 0;
+ int utf8_in_src;
/// If set, <FL/Fl.H> will not be included from the header code before anything else
- int avoid_early_includes = 0;
+ int avoid_early_includes;
/// If set, command line overrides header file name in .fl file.
- int header_file_set = 0;
+ int header_file_set;
/// If set, command line overrides source code file name in .fl file.
- int code_file_set = 0;
+ int code_file_set;
/// later
- int write_mergeback_data = 0;
+ int write_mergeback_data;
/// Filename of the current .fl project file
- const char *proj_filename { nullptr };
+ const char *proj_filename;
/// Hold the default extension for header files, or the entire filename if set via command line.
- std::string header_file_name = ".h";
- /// Hold the default extension for source code files, or the entire filename if set via command line.
- std::string code_file_name = ".cxx";
+ char *header_file_name_;
+ /// Hold the default extension for source code files, or the entire filename if set via command line.
+ char *code_file_name_;
/// Macro used in header file for #ifdef MACRO \n #defined MACRO \n ... \n #endif
- std::string include_guard = "";
+ char *include_guard_;
/// Used as a counter to set the .fl project dir as the current directory.
- int in_project_dir { 0 };
+ int in_project_dir;
/// Application work directory, stored here when temporarily changing to the source code directory.
- std::string app_work_dir = "";
+ char app_work_dir_[FL_PATH_MAX];
/// Set if the current design has been modified compared to the associated .fl design file.
- int modflag { 0 };
+ int modflag;
/// Set if the code files are older than the current design.
- int modflag_c { 0 };
+ int modflag_c;
/// Currently used layout preset.
- app::Layout_Preset *layout { app::default_layout_preset };
+ app::Layout_Preset *layout;
public: // Methods
Project();
@@ -91,21 +91,32 @@ public: // Methods
void reset();
void update_settings_dialog();
- std::string projectfile_path() const;
- std::string projectfile_name() const;
- std::string codefile_path() const;
- std::string codefile_name() const;
- std::string headerfile_path() const;
- std::string headerfile_name() const;
- std::string stringsfile_path() const;
- std::string stringsfile_name() const;
- std::string basename() const;
+ // Getters for file name settings
+ const char *header_file_name() const { return header_file_name_; }
+ const char *code_file_name() const { return code_file_name_; }
+ const char *include_guard() const { return include_guard_; }
+
+ // Setters for file name settings
+ void set_header_file_name(const char *name);
+ void set_code_file_name(const char *name);
+ void set_include_guard(const char *guard);
+
+ // Path computation methods - fill provided buffer
+ void projectfile_path(char *buf, int bufsize) const;
+ const char *projectfile_name() const;
+ void codefile_path(char *buf, int bufsize) const;
+ void codefile_name(char *buf, int bufsize) const;
+ void headerfile_path(char *buf, int bufsize) const;
+ void headerfile_name(char *buf, int bufsize) const;
+ void stringsfile_path(char *buf, int bufsize) const;
+ void stringsfile_name(char *buf, int bufsize) const;
+ void basename(char *buf, int bufsize) const;
void enter_project_dir();
void leave_project_dir();
- void set_filename(std::nullptr_t);
- void set_filename(const std::string &c);
+ void clear_filename();
+ void set_filename(const char *c);
void write_strings();
void set_modflag(int mf, int mfc = -1);
@@ -114,5 +125,3 @@ public: // Methods
} // namespace fld
#endif // FLUID_PROJECT_H
-
-