summaryrefslogtreecommitdiff
path: root/fluid/Fl_Widget_Type.h
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>1998-10-06 18:21:25 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>1998-10-06 18:21:25 +0000
commitf9039b2ae21988783feae9b362818e7923e82d14 (patch)
tree6d6fe3679d73448758f9794e7d4d4f6b22a4adad /fluid/Fl_Widget_Type.h
parent67e89232f9ba067825a158734a09e0fa21aacbe3 (diff)
Initial revision
git-svn-id: file:///fltk/svn/fltk/trunk@2 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/Fl_Widget_Type.h')
-rw-r--r--fluid/Fl_Widget_Type.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/fluid/Fl_Widget_Type.h b/fluid/Fl_Widget_Type.h
new file mode 100644
index 000000000..c911054fa
--- /dev/null
+++ b/fluid/Fl_Widget_Type.h
@@ -0,0 +1,67 @@
+// Fl_Widget_Type.H
+
+// Type for creating all subclasses of Fl_Widget
+// This should have the widget pointer in it, but it is still in the
+// Fl_Type base class.
+
+#include "Fl_Type.H"
+
+struct Fl_Menu_Item;
+class Fluid_Image;
+
+#define NUM_EXTRA_CODE 4
+
+class Fl_Widget_Type : public Fl_Type {
+ virtual Fl_Widget *widget(int,int,int,int) = 0;
+ virtual Fl_Widget_Type *_make() = 0; // virtual constructor
+ virtual void setlabel(const char *);
+
+ const char *extra_code_[NUM_EXTRA_CODE];
+ const char *subclass_;
+ uchar hotspot_;
+
+protected:
+
+ void write_declare();
+ void write_static();
+ void write_code1();
+ void write_widget_code();
+ void write_code2();
+
+public:
+
+ const char *xclass; // junk string, used for shortcut
+ Fl_Widget *o;
+ int public_;
+
+ Fluid_Image *image;
+ void setimage(Fluid_Image *);
+
+ Fl_Widget_Type();
+ Fl_Type *make();
+ void open();
+
+ const char *extra_code(int n) const {return extra_code_[n];}
+ void extra_code(int n,const char *);
+ const char *subclass() const {return subclass_;}
+ void subclass(const char *);
+ uchar hotspot() const {return hotspot_;}
+ void hotspot(uchar v) {hotspot_ = v;}
+ uchar resizable() const;
+ void resizable(uchar v);
+
+ virtual int textstuff(int what, Fl_Font &, int &, Fl_Color &);
+ virtual Fl_Menu_Item *subtypes();
+
+ virtual int is_widget() const;
+
+ virtual void write_properties();
+ virtual void read_property(const char *);
+ virtual int read_fdesign(const char*, const char*);
+
+ ~Fl_Widget_Type();
+ void redraw();
+};
+
+void* const LOAD = (void *)9831;
+extern Fl_Widget_Type *current_widget; // one of the selected ones