diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-07-19 17:44:44 +0200 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-07-19 17:45:28 +0200 |
| commit | f8a327877699a8565d36b2f0b1cbe074f224fba4 (patch) | |
| tree | 00673ec9887fa97a108a56910c97df6b37c6ff8c /fluid/Fl_Function_Type.h | |
| parent | 9ee8cdc727e7c510c28b51318b953d82aa1dd936 (diff) | |
FLUID: emulated RTTI for all types
Complete type hierarchy in Fl_Types doc
Window now derives correctly from Group
Menu Items now correctly (functionally in FLUID) derived form Button
Menu Buttons have a better hierarchy
Fixing two possible crash bugs where Input_Choice was assumed to be a Menu_
Hoping I have not degraded the original code!
Diffstat (limited to 'fluid/Fl_Function_Type.h')
| -rw-r--r-- | fluid/Fl_Function_Type.h | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/fluid/Fl_Function_Type.h b/fluid/Fl_Function_Type.h index 5da55cb49..d844016c9 100644 --- a/fluid/Fl_Function_Type.h +++ b/fluid/Fl_Function_Type.h @@ -42,7 +42,9 @@ const char *c_check(const char *c, int type = 0); // ---- Fl_Function_Type declaration -class Fl_Function_Type : public Fl_Type { +class Fl_Function_Type : public Fl_Type +{ + typedef Fl_Type super; const char* return_type; char public_, cdecl_, constructor, havewidgets; @@ -62,6 +64,7 @@ public: int is_code_block() const FL_OVERRIDE {return 1;} int is_public() const FL_OVERRIDE; ID id() const FL_OVERRIDE { return ID_Function; } + bool is_a(ID inID) FL_OVERRIDE { return (inID==ID_Function) ? true : super::is_a(inID); } void write_properties(Fd_Project_Writer &f) FL_OVERRIDE; void read_property(Fd_Project_Reader &f, const char *) FL_OVERRIDE; int has_signature(const char *, const char*) const; @@ -69,7 +72,9 @@ public: // ---- Fl_Code_Type declaration -class Fl_Code_Type : public Fl_Type { +class Fl_Code_Type : public Fl_Type +{ + typedef Fl_Type super; ExternalCodeEditor editor_; int cursor_position_; int code_input_scroll_row; @@ -86,6 +91,7 @@ public: int is_code_block() const FL_OVERRIDE {return 0;} int is_code() const FL_OVERRIDE {return 1;} ID id() const FL_OVERRIDE { return ID_Code; } + bool is_a(ID inID) FL_OVERRIDE { return (inID==ID_Code) ? true : super::is_a(inID); } int is_public() const FL_OVERRIDE { return -1; } int is_editing(); int reap_editor(); @@ -94,7 +100,9 @@ public: // ---- Fl_CodeBlock_Type declaration -class Fl_CodeBlock_Type : public Fl_Type { +class Fl_CodeBlock_Type : public Fl_Type +{ + typedef Fl_Type super; const char* after; public: @@ -109,13 +117,16 @@ public: int is_parent() const FL_OVERRIDE {return 1;} int is_public() const FL_OVERRIDE { return -1; } ID id() const FL_OVERRIDE { return ID_CodeBlock; } + bool is_a(ID inID) FL_OVERRIDE { return (inID==ID_CodeBlock) ? true : super::is_a(inID); } void write_properties(Fd_Project_Writer &f) FL_OVERRIDE; void read_property(Fd_Project_Reader &f, const char *) FL_OVERRIDE; }; // ---- Fl_Decl_Type declaration -class Fl_Decl_Type : public Fl_Type { +class Fl_Decl_Type : public Fl_Type +{ + typedef Fl_Type super; protected: char public_; @@ -132,11 +143,14 @@ public: void read_property(Fd_Project_Reader &f, const char *) FL_OVERRIDE; int is_public() const FL_OVERRIDE; ID id() const FL_OVERRIDE { return ID_Decl; } + bool is_a(ID inID) FL_OVERRIDE { return (inID==ID_Decl) ? true : super::is_a(inID); } }; // ---- Fl_Data_Type declaration -class Fl_Data_Type : public Fl_Decl_Type { +class Fl_Data_Type : public Fl_Decl_Type +{ + typedef Fl_Decl_Type super; const char *filename_; int text_mode_; @@ -151,11 +165,14 @@ public: void write_properties(Fd_Project_Writer &f) FL_OVERRIDE; void read_property(Fd_Project_Reader &f, const char *) FL_OVERRIDE; ID id() const FL_OVERRIDE { return ID_Data; } + bool is_a(ID inID) FL_OVERRIDE { return (inID==ID_Data) ? true : super::is_a(inID); } }; // ---- Fl_DeclBlock_Type declaration -class Fl_DeclBlock_Type : public Fl_Type { +class Fl_DeclBlock_Type : public Fl_Type +{ + typedef Fl_Type super; const char* after; char public_; @@ -173,11 +190,14 @@ public: int is_decl_block() const FL_OVERRIDE {return 1;} int is_public() const FL_OVERRIDE; ID id() const FL_OVERRIDE { return ID_DeclBlock; } + bool is_a(ID inID) FL_OVERRIDE { return (inID==ID_DeclBlock) ? true : super::is_a(inID); } }; // ---- Fl_Comment_Type declaration -class Fl_Comment_Type : public Fl_Type { +class Fl_Comment_Type : public Fl_Type +{ + typedef Fl_Type super; char in_c_, in_h_, style_; char title_buf[64]; @@ -194,11 +214,14 @@ public: int is_public() const FL_OVERRIDE { return 1; } int is_comment() const FL_OVERRIDE { return 1; } ID id() const FL_OVERRIDE { return ID_Comment; } + bool is_a(ID inID) FL_OVERRIDE { return (inID==ID_Comment) ? true : super::is_a(inID); } }; // ---- Fl_Class_Type declaration -class Fl_Class_Type : public Fl_Type { +class Fl_Class_Type : public Fl_Type +{ + typedef Fl_Type super; const char* subclass_of; char public_; const char* class_prefix; @@ -220,6 +243,7 @@ public: int is_class() const FL_OVERRIDE {return 1;} int is_public() const FL_OVERRIDE; ID id() const FL_OVERRIDE { return ID_Class; } + bool is_a(ID inID) FL_OVERRIDE { return (inID==ID_Class) ? true : super::is_a(inID); } void write_properties(Fd_Project_Writer &f) FL_OVERRIDE; void read_property(Fd_Project_Reader &f, const char *) FL_OVERRIDE; |
