textstuff() methods no longer inline to work around a bug in a compiler.

Don not merge into 2.0 tree!  Already done!

-Carl


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@505 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Carl E. Thompson
1999-04-03 15:51:39 +00:00
parent d19b50423c
commit 4435aed5ca
+71 -59
View File
@@ -1,5 +1,5 @@
// //
// "$Id: factory.cxx,v 1.4.2.1 1999/03/30 23:11:26 carl Exp $" // "$Id: factory.cxx,v 1.4.2.2 1999/04/03 15:51:39 carl Exp $"
// //
// Widget factory code for the Fast Light Tool Kit (FLTK). // Widget factory code for the Fast Light Tool Kit (FLTK).
// //
@@ -145,17 +145,7 @@ static Fl_Menu_Item browser_type_menu[] = {
{0}}; {0}};
class Fl_Browser_Type : public Fl_Widget_Type { class Fl_Browser_Type : public Fl_Widget_Type {
Fl_Menu_Item *subtypes() {return browser_type_menu;} Fl_Menu_Item *subtypes() {return browser_type_menu;}
int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c);
Fl_Browser *o = (Fl_Browser*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o);
switch (w) {
case 4:
case 0: f = o->textfont(); s = o->textsize(); c = o->textcolor(); break;
case 1: o->textfont(f); break;
case 2: o->textsize(s); break;
case 3: o->textcolor(c); break;
}
return 1;
}
public: public:
virtual const char *type_name() {return "Fl_Browser";} virtual const char *type_name() {return "Fl_Browser";}
Fl_Widget *widget(int x,int y,int w,int h) { Fl_Widget *widget(int x,int y,int w,int h) {
@@ -171,6 +161,18 @@ public:
}; };
static Fl_Browser_Type Fl_Browser_type; static Fl_Browser_Type Fl_Browser_type;
int Fl_Browser_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) {
Fl_Browser *o = (Fl_Browser*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o);
switch (w) {
case 4:
case 0: f = o->textfont(); s = o->textsize(); c = o->textcolor(); break;
case 1: o->textfont(f); break;
case 2: o->textsize(s); break;
case 3: o->textcolor(c); break;
}
return 1;
}
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
#include <FL/Fl_Counter.H> #include <FL/Fl_Counter.H>
@@ -180,7 +182,17 @@ static Fl_Menu_Item counter_type_menu[] = {
{0}}; {0}};
class Fl_Counter_Type : public Fl_Widget_Type { class Fl_Counter_Type : public Fl_Widget_Type {
Fl_Menu_Item *subtypes() {return counter_type_menu;} Fl_Menu_Item *subtypes() {return counter_type_menu;}
int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c);
int is_valuator() const {return 1;}
public:
virtual const char *type_name() {return "Fl_Counter";}
Fl_Widget *widget(int x,int y,int w,int h) {
return new Fl_Counter(x,y,w,h,"counter:");}
Fl_Widget_Type *_make() {return new Fl_Counter_Type();}
};
static Fl_Counter_Type Fl_Counter_type;
int Fl_Counter_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) {
Fl_Counter *o = (Fl_Counter*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o); Fl_Counter *o = (Fl_Counter*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o);
switch (w) { switch (w) {
case 4: case 4:
@@ -191,14 +203,6 @@ class Fl_Counter_Type : public Fl_Widget_Type {
} }
return 1; return 1;
} }
int is_valuator() const {return 1;}
public:
virtual const char *type_name() {return "Fl_Counter";}
Fl_Widget *widget(int x,int y,int w,int h) {
return new Fl_Counter(x,y,w,h,"counter:");}
Fl_Widget_Type *_make() {return new Fl_Counter_Type();}
};
static Fl_Counter_Type Fl_Counter_type;
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
@@ -212,17 +216,7 @@ static Fl_Menu_Item input_type_menu[] = {
{0}}; {0}};
class Fl_Input_Type : public Fl_Widget_Type { class Fl_Input_Type : public Fl_Widget_Type {
Fl_Menu_Item *subtypes() {return input_type_menu;} Fl_Menu_Item *subtypes() {return input_type_menu;}
int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c);
Fl_Input_ *o = (Fl_Input_*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o);
switch (w) {
case 4:
case 0: f = o->textfont(); s = o->textsize(); c = o->textcolor(); break;
case 1: o->textfont(f); break;
case 2: o->textsize(s); break;
case 3: o->textcolor(c); break;
}
return 1;
}
public: public:
virtual const char *type_name() {return "Fl_Input";} virtual const char *type_name() {return "Fl_Input";}
Fl_Widget *widget(int x,int y,int w,int h) { Fl_Widget *widget(int x,int y,int w,int h) {
@@ -234,6 +228,18 @@ public:
}; };
static Fl_Input_Type Fl_Input_type; static Fl_Input_Type Fl_Input_type;
int Fl_Input_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) {
Fl_Input_ *o = (Fl_Input_*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o);
switch (w) {
case 4:
case 0: f = o->textfont(); s = o->textsize(); c = o->textcolor(); break;
case 1: o->textfont(f); break;
case 2: o->textsize(s); break;
case 3: o->textcolor(c); break;
}
return 1;
}
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
#include <FL/Fl_Clock.H> #include <FL/Fl_Clock.H>
@@ -358,7 +364,17 @@ static Fl_Output_Type Fl_Output_type;
class Fl_Value_Input_Type : public Fl_Widget_Type { class Fl_Value_Input_Type : public Fl_Widget_Type {
public: public:
virtual const char *type_name() {return "Fl_Value_Input";} virtual const char *type_name() {return "Fl_Value_Input";}
int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c);
int is_valuator() const {return 1;}
Fl_Widget *widget(int x,int y,int w,int h) {
Fl_Value_Input *o = new Fl_Value_Input(x,y,w,h,"value:");
return o;
}
Fl_Widget_Type *_make() {return new Fl_Value_Input_Type();}
};
static Fl_Value_Input_Type Fl_Value_Input_type;
int Fl_Value_Input_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) {
Fl_Value_Input *o = (Fl_Value_Input*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o); Fl_Value_Input *o = (Fl_Value_Input*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o);
switch (w) { switch (w) {
case 4: case 4:
@@ -369,14 +385,6 @@ public:
} }
return 1; return 1;
} }
int is_valuator() const {return 1;}
Fl_Widget *widget(int x,int y,int w,int h) {
Fl_Value_Input *o = new Fl_Value_Input(x,y,w,h,"value:");
return o;
}
Fl_Widget_Type *_make() {return new Fl_Value_Input_Type();}
};
static Fl_Value_Input_Type Fl_Value_Input_type;
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
@@ -384,7 +392,17 @@ static Fl_Value_Input_Type Fl_Value_Input_type;
class Fl_Value_Output_Type : public Fl_Widget_Type { class Fl_Value_Output_Type : public Fl_Widget_Type {
public: public:
virtual const char *type_name() {return "Fl_Value_Output";} virtual const char *type_name() {return "Fl_Value_Output";}
int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c);
int is_valuator() const {return 1;}
Fl_Widget *widget(int x,int y,int w,int h) {
Fl_Value_Output *o = new Fl_Value_Output(x,y,w,h,"value:");
return o;
}
Fl_Widget_Type *_make() {return new Fl_Value_Output_Type();}
};
static Fl_Value_Output_Type Fl_Value_Output_type;
int Fl_Value_Output_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) {
Fl_Value_Output *o = (Fl_Value_Output*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o); Fl_Value_Output *o = (Fl_Value_Output*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o);
switch (w) { switch (w) {
case 4: case 4:
@@ -395,20 +413,21 @@ public:
} }
return 1; return 1;
} }
int is_valuator() const {return 1;}
Fl_Widget *widget(int x,int y,int w,int h) {
Fl_Value_Output *o = new Fl_Value_Output(x,y,w,h,"value:");
return o;
}
Fl_Widget_Type *_make() {return new Fl_Value_Output_Type();}
};
static Fl_Value_Output_Type Fl_Value_Output_type;
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
#include <FL/Fl_Value_Slider.H> #include <FL/Fl_Value_Slider.H>
class Fl_Value_Slider_Type : public Fl_Slider_Type { class Fl_Value_Slider_Type : public Fl_Slider_Type {
int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c);
public:
virtual const char *type_name() {return "Fl_Value_Slider";}
Fl_Widget *widget(int x,int y,int w,int h) {
return new Fl_Value_Slider(x,y,w,h);}
Fl_Widget_Type *_make() {return new Fl_Value_Slider_Type();}
};
static Fl_Value_Slider_Type Fl_Value_Slider_type;
int Fl_Value_Slider_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) {
Fl_Value_Slider *o = (Fl_Value_Slider*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o); Fl_Value_Slider *o = (Fl_Value_Slider*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o);
switch (w) { switch (w) {
case 4: case 4:
@@ -419,13 +438,6 @@ class Fl_Value_Slider_Type : public Fl_Slider_Type {
} }
return 1; return 1;
} }
public:
virtual const char *type_name() {return "Fl_Value_Slider";}
Fl_Widget *widget(int x,int y,int w,int h) {
return new Fl_Value_Slider(x,y,w,h);}
Fl_Widget_Type *_make() {return new Fl_Value_Slider_Type();}
};
static Fl_Value_Slider_Type Fl_Value_Slider_type;
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
@@ -673,5 +685,5 @@ int lookup_symbol(const char *name, int &v, int numberok) {
} }
// //
// End of "$Id: factory.cxx,v 1.4.2.1 1999/03/30 23:11:26 carl Exp $". // End of "$Id: factory.cxx,v 1.4.2.2 1999/04/03 15:51:39 carl Exp $".
// //