summaryrefslogtreecommitdiff
path: root/fluid/nodes/Widget_Node.h
diff options
context:
space:
mode:
Diffstat (limited to 'fluid/nodes/Widget_Node.h')
-rw-r--r--fluid/nodes/Widget_Node.h68
1 files changed, 34 insertions, 34 deletions
diff --git a/fluid/nodes/Widget_Node.h b/fluid/nodes/Widget_Node.h
index b2afa58a6..98a943333 100644
--- a/fluid/nodes/Widget_Node.h
+++ b/fluid/nodes/Widget_Node.h
@@ -19,7 +19,7 @@
#include "nodes/Node.h"
-#include <string>
+#include <FL/fl_string_functions.h>
#define NUM_EXTRA_CODE 4
@@ -30,7 +30,7 @@ extern void* const LOAD;
extern Node* current_node; // one of the selected ones
extern Widget_Node* current_widget; // one of the selected ones
-extern std::string subclassname(Node* l);
+extern const char* subclassname(Node* l);
extern int is_name(const char* c);
void selection_changed(Node* new_current);
Node* sort(Node* parent);
@@ -47,19 +47,19 @@ class Widget_Node : public Node
void setlabel(const char *) override;
/// Additional code blocks that can be inserted in the generated code
- std::string extra_code_[NUM_EXTRA_CODE];
+ char *extra_code_[NUM_EXTRA_CODE];
/// User can call the ctor for a class that is derived from the node class
- std::string subclass_;
+ char *subclass_;
/// Keep a copy the tooltip here, also always updates the widget's tooltip
- std::string tooltip_;
+ char *tooltip_;
/// Image name or file name.
- std::string image_name_;
+ char *image_name_;
/// Name or file name of deactivated image
- std::string inactive_name_;
+ char *inactive_name_;
/// Set's a widget's hotspot, or adds a divider to a menu item
- uchar hotspot_ = 0;
+ uchar hotspot_;
/// On menu items, set the "headline" flag
- bool menu_headline_ = false;
+ int menu_headline_;
protected:
@@ -67,7 +67,7 @@ protected:
/// We can't open a window in batch mode, even if we want the "visible" flags
/// set, so we need a second place to store this information while also
/// disabling the output of the "hide" property by the Widget Type.
- uchar override_visible_ = 0;
+ uchar override_visible_;
void write_static(fld::io::Code_Writer& f) override;
void write_code1(fld::io::Code_Writer& f) override;
@@ -83,58 +83,58 @@ protected:
public:
/// Pointer to widget for interactive editing.
- Fl_Widget* o = nullptr;
+ Fl_Widget* o;
/// Widget access mode, 0=private, 1=public, 2=protected
- int public_ = 1;
+ int public_;
// ---- Image stuff
/// Set the bind image flag for the active image
- int bind_image_ = 0;
+ int bind_image_;
/// Compress the active image when inlining into source code
- int compress_image_ = 1;
+ int compress_image_;
/// Scale the active image, great for hires screens
- int scale_image_w_ = 0, scale_image_h_ = 0;
+ int scale_image_w_, scale_image_h_;
/// Pointer to the shared image data of the active image
- Image_Asset* image = nullptr;
+ Image_Asset* image;
/// Set the bind image flag for the inactive image
- int bind_deimage_ = 0;
+ int bind_deimage_;
/// Compress the inactive image when inlining into source code
- int compress_deimage_ = 1;
+ int compress_deimage_;
/// Scale the inactive image
- int scale_deimage_w_ = 0, scale_deimage_h_ = 0;
+ int scale_deimage_w_, scale_deimage_h_;
/// Pointer to the shared image data of the inactive image
- Image_Asset* inactive = nullptr;
+ Image_Asset* inactive;
void setimage(Image_Asset *);
- std::string image_name() const { return image_name_; }
- void image_name(const std::string& name);
+ const char* image_name() const { return image_name_ ? image_name_ : ""; }
+ void image_name(const char *name);
void setinactive(Image_Asset *);
- std::string inactive_name() const { return inactive_name_; }
- void inactive_name(const std::string& name);
+ const char* inactive_name() const { return inactive_name_ ? inactive_name_ : ""; }
+ void inactive_name(const char *name);
- Widget_Node() = default;
- ~Widget_Node() override;
+ Widget_Node();
+ ~Widget_Node();
Node* make(Strategy strategy) override;
void open() override;
- const std::string& extra_code(int n) const { return extra_code_[n]; }
- void extra_code(int n, const std::string& code);
- std::string subclass() const { return subclass_; }
- void subclass(const std::string& name);
- std::string tooltip() const { return tooltip_; }
- void tooltip(const std::string& text);
+ const char* extra_code(int n) const { return extra_code_[n] ? extra_code_[n] : ""; }
+ void extra_code(int n, const char *code);
+ const char* subclass() const { return subclass_ ? subclass_ : ""; }
+ void subclass(const char *name);
+ const char* tooltip() const { return tooltip_ ? tooltip_ : ""; }
+ void tooltip(const char *text);
// Note: hotspot is misused by menu items to indicate a divider
uchar hotspot() const { return hotspot_; }
void hotspot(uchar v) { hotspot_ = v; }
uchar resizable() const;
void resizable(uchar v);
- bool menu_headline() const { return menu_headline_; }
- void menu_headline(bool v) { menu_headline_ = v; }
+ int menu_headline() const { return menu_headline_; }
+ void menu_headline(int v) { menu_headline_ = v; }
virtual int textstuff(int what, Fl_Font &, int &, Fl_Color &);
virtual Fl_Menu_Item* subtypes();