More shadow variable changes...

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2567 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2002-08-09 03:17:30 +00:00
parent a6b935289e
commit 050919103f
56 changed files with 653 additions and 654 deletions

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Float_Input.H,v 1.4.2.3.2.1 2002/01/01 15:11:27 easysw Exp $" // "$Id: Fl_Float_Input.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $"
// //
// Floating point input header file for the Fast Light Tool Kit (FLTK). // Floating point input header file for the Fast Light Tool Kit (FLTK).
// //
@ -30,12 +30,12 @@
class Fl_Float_Input : public Fl_Input { class Fl_Float_Input : public Fl_Input {
public: public:
Fl_Float_Input(int x,int y,int w,int h,const char *l = 0) Fl_Float_Input(int X,int Y,int W,int H,const char *l = 0)
: Fl_Input(x,y,w,h,l) {type(FL_FLOAT_INPUT);} : Fl_Input(X,Y,W,H,l) {type(FL_FLOAT_INPUT);}
}; };
#endif #endif
// //
// End of "$Id: Fl_Float_Input.H,v 1.4.2.3.2.1 2002/01/01 15:11:27 easysw Exp $". // End of "$Id: Fl_Float_Input.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Gl_Window.H,v 1.7.2.5.2.1 2002/01/01 15:11:27 easysw Exp $" // "$Id: Fl_Gl_Window.H,v 1.7.2.5.2.2 2002/08/09 03:17:29 easysw Exp $"
// //
// OpenGL header file for the Fast Light Tool Kit (FLTK). // OpenGL header file for the Fast Light Tool Kit (FLTK).
// //
@ -60,11 +60,11 @@ public:
FL_EXPORT void resize(int,int,int,int); FL_EXPORT void resize(int,int,int,int);
char valid() const {return valid_;} char valid() const {return valid_;}
void valid(char i) {valid_ = i;} void valid(char v) {valid_ = v;}
FL_EXPORT void invalidate(); FL_EXPORT void invalidate();
static int can_do(int i) {return can_do(i,0);} static int can_do(int m) {return can_do(m,0);}
static int can_do(const int *i) {return can_do(0, i);} static int can_do(const int *m) {return can_do(0, m);}
int can_do() {return can_do(mode_,alist);} int can_do() {return can_do(mode_,alist);}
Fl_Mode mode() const {return (Fl_Mode)mode_;} Fl_Mode mode() const {return (Fl_Mode)mode_;}
int mode(int a) {return mode(a,0);} int mode(int a) {return mode(a,0);}
@ -90,5 +90,5 @@ public:
#endif #endif
// //
// End of "$Id: Fl_Gl_Window.H,v 1.7.2.5.2.1 2002/01/01 15:11:27 easysw Exp $". // End of "$Id: Fl_Gl_Window.H,v 1.7.2.5.2.2 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Hor_Slider.H,v 1.4.2.3.2.1 2002/01/01 15:11:27 easysw Exp $" // "$Id: Fl_Hor_Slider.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $"
// //
// Horizontal slider header file for the Fast Light Tool Kit (FLTK). // Horizontal slider header file for the Fast Light Tool Kit (FLTK).
// //
@ -30,12 +30,12 @@
class Fl_Hor_Slider : public Fl_Slider { class Fl_Hor_Slider : public Fl_Slider {
public: public:
Fl_Hor_Slider(int x,int y,int w,int h,const char *l=0) Fl_Hor_Slider(int X,int Y,int W,int H,const char *l=0)
: Fl_Slider(x,y,w,h,l) {type(FL_HOR_SLIDER);} : Fl_Slider(X,Y,W,H,l) {type(FL_HOR_SLIDER);}
}; };
#endif #endif
// //
// End of "$Id: Fl_Hor_Slider.H,v 1.4.2.3.2.1 2002/01/01 15:11:27 easysw Exp $". // End of "$Id: Fl_Hor_Slider.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Hor_Value_Slider.H,v 1.4.2.3.2.1 2002/01/01 15:11:27 easysw Exp $" // "$Id: Fl_Hor_Value_Slider.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $"
// //
// Horizontal value slider header file for the Fast Light Tool Kit (FLTK). // Horizontal value slider header file for the Fast Light Tool Kit (FLTK).
// //
@ -30,12 +30,12 @@
class Fl_Hor_Value_Slider : public Fl_Value_Slider { class Fl_Hor_Value_Slider : public Fl_Value_Slider {
public: public:
Fl_Hor_Value_Slider(int x,int y,int w,int h,const char *l=0) Fl_Hor_Value_Slider(int X,int Y,int W,int H,const char *l=0)
: Fl_Value_Slider(x,y,w,h,l) {type(FL_HOR_SLIDER);} : Fl_Value_Slider(X,Y,W,H,l) {type(FL_HOR_SLIDER);}
}; };
#endif #endif
// //
// End of "$Id: Fl_Hor_Value_Slider.H,v 1.4.2.3.2.1 2002/01/01 15:11:27 easysw Exp $". // End of "$Id: Fl_Hor_Value_Slider.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Int_Input.H,v 1.4.2.3.2.1 2002/01/01 15:11:27 easysw Exp $" // "$Id: Fl_Int_Input.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $"
// //
// Integer input header file for the Fast Light Tool Kit (FLTK). // Integer input header file for the Fast Light Tool Kit (FLTK).
// //
@ -30,12 +30,12 @@
class Fl_Int_Input : public Fl_Input { class Fl_Int_Input : public Fl_Input {
public: public:
Fl_Int_Input(int x,int y,int w,int h,const char *l = 0) Fl_Int_Input(int X,int Y,int W,int H,const char *l = 0)
: Fl_Input(x,y,w,h,l) {type(FL_INT_INPUT);} : Fl_Input(X,Y,W,H,l) {type(FL_INT_INPUT);}
}; };
#endif #endif
// //
// End of "$Id: Fl_Int_Input.H,v 1.4.2.3.2.1 2002/01/01 15:11:27 easysw Exp $". // End of "$Id: Fl_Int_Input.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Multiline_Input.H,v 1.4.2.3.2.1 2002/01/01 15:11:28 easysw Exp $" // "$Id: Fl_Multiline_Input.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $"
// //
// Multiline input header file for the Fast Light Tool Kit (FLTK). // Multiline input header file for the Fast Light Tool Kit (FLTK).
// //
@ -30,12 +30,12 @@
class Fl_Multiline_Input : public Fl_Input { class Fl_Multiline_Input : public Fl_Input {
public: public:
Fl_Multiline_Input(int x,int y,int w,int h,const char *l = 0) Fl_Multiline_Input(int X,int Y,int W,int H,const char *l = 0)
: Fl_Input(x,y,w,h,l) {type(FL_MULTILINE_INPUT);} : Fl_Input(X,Y,W,H,l) {type(FL_MULTILINE_INPUT);}
}; };
#endif #endif
// //
// End of "$Id: Fl_Multiline_Input.H,v 1.4.2.3.2.1 2002/01/01 15:11:28 easysw Exp $". // End of "$Id: Fl_Multiline_Input.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Multiline_Output.H,v 1.4.2.3.2.2 2002/04/11 11:52:41 easysw Exp $" // "$Id: Fl_Multiline_Output.H,v 1.4.2.3.2.3 2002/08/09 03:17:29 easysw Exp $"
// //
// Multi line output header file for the Fast Light Tool Kit (FLTK). // Multi line output header file for the Fast Light Tool Kit (FLTK).
// //
@ -30,12 +30,12 @@
class Fl_Multiline_Output : public Fl_Output { class Fl_Multiline_Output : public Fl_Output {
public: public:
Fl_Multiline_Output(int x,int y,int w,int h,const char *l = 0) Fl_Multiline_Output(int X,int Y,int W,int H,const char *l = 0)
: Fl_Output(x,y,w,h,l) {type(FL_MULTILINE_OUTPUT);} : Fl_Output(X,Y,W,H,l) {type(FL_MULTILINE_OUTPUT);}
}; };
#endif #endif
// //
// End of "$Id: Fl_Multiline_Output.H,v 1.4.2.3.2.2 2002/04/11 11:52:41 easysw Exp $". // End of "$Id: Fl_Multiline_Output.H,v 1.4.2.3.2.3 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Output.H,v 1.5.2.3.2.2 2002/04/11 11:52:41 easysw Exp $" // "$Id: Fl_Output.H,v 1.5.2.3.2.3 2002/08/09 03:17:29 easysw Exp $"
// //
// Output header file for the Fast Light Tool Kit (FLTK). // Output header file for the Fast Light Tool Kit (FLTK).
// //
@ -30,12 +30,12 @@
class Fl_Output : public Fl_Input { class Fl_Output : public Fl_Input {
public: public:
Fl_Output(int x, int y, int w, int h, const char *l = 0) Fl_Output(int X,int Y,int W,int H, const char *l = 0)
: Fl_Input(x, y, w, h, l) {type(FL_NORMAL_OUTPUT);} : Fl_Input(X, Y, W, H, l) {type(FL_NORMAL_OUTPUT);}
}; };
#endif #endif
// //
// End of "$Id: Fl_Output.H,v 1.5.2.3.2.2 2002/04/11 11:52:41 easysw Exp $". // End of "$Id: Fl_Output.H,v 1.5.2.3.2.3 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Radio_Light_Button.H,v 1.4.2.3.2.1 2002/01/01 15:11:28 easysw Exp $" // "$Id: Fl_Radio_Light_Button.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $"
// //
// Radio light button header file for the Fast Light Tool Kit (FLTK). // Radio light button header file for the Fast Light Tool Kit (FLTK).
// //
@ -29,12 +29,12 @@
class Fl_Radio_Light_Button : public Fl_Light_Button { class Fl_Radio_Light_Button : public Fl_Light_Button {
public: public:
Fl_Radio_Light_Button(int x,int y,int w,int h,const char *l=0) Fl_Radio_Light_Button(int X,int Y,int W,int H,const char *l=0)
: Fl_Light_Button(x,y,w,h,l) {type(FL_RADIO_BUTTON);} : Fl_Light_Button(X,Y,W,H,l) {type(FL_RADIO_BUTTON);}
}; };
#endif #endif
// //
// End of "$Id: Fl_Radio_Light_Button.H,v 1.4.2.3.2.1 2002/01/01 15:11:28 easysw Exp $". // End of "$Id: Fl_Radio_Light_Button.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Repeat_Button.H,v 1.5.2.5.2.1 2002/01/01 15:11:28 easysw Exp $" // "$Id: Fl_Repeat_Button.H,v 1.5.2.5.2.2 2002/08/09 03:17:29 easysw Exp $"
// //
// Repeat button header file for the Fast Light Tool Kit (FLTK). // Repeat button header file for the Fast Light Tool Kit (FLTK).
// //
@ -32,8 +32,8 @@ class Fl_Repeat_Button : public Fl_Button {
static FL_EXPORT void repeat_callback(void *); static FL_EXPORT void repeat_callback(void *);
public: public:
FL_EXPORT int handle(int); FL_EXPORT int handle(int);
Fl_Repeat_Button(int x,int y,int w,int h,const char *l=0) Fl_Repeat_Button(int X,int Y,int W,int H,const char *l=0)
: Fl_Button(x,y,w,h,l) {} : Fl_Button(X,Y,W,H,l) {}
void deactivate() { void deactivate() {
Fl::remove_timeout(repeat_callback,this); Fl::remove_timeout(repeat_callback,this);
Fl_Button::deactivate(); Fl_Button::deactivate();
@ -43,5 +43,5 @@ public:
#endif #endif
// //
// End of "$Id: Fl_Repeat_Button.H,v 1.5.2.5.2.1 2002/01/01 15:11:28 easysw Exp $". // End of "$Id: Fl_Repeat_Button.H,v 1.5.2.5.2.2 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Secret_Input.H,v 1.4.2.3.2.1 2002/01/01 15:11:28 easysw Exp $" // "$Id: Fl_Secret_Input.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $"
// //
// Secret input header file for the Fast Light Tool Kit (FLTK). // Secret input header file for the Fast Light Tool Kit (FLTK).
// //
@ -30,12 +30,12 @@
class Fl_Secret_Input : public Fl_Input { class Fl_Secret_Input : public Fl_Input {
public: public:
Fl_Secret_Input(int x,int y,int w,int h,const char *l = 0) Fl_Secret_Input(int X,int Y,int W,int H,const char *l = 0)
: Fl_Input(x,y,w,h,l) {type(FL_SECRET_INPUT);} : Fl_Input(X,Y,W,H,l) {type(FL_SECRET_INPUT);}
}; };
#endif #endif
// //
// End of "$Id: Fl_Secret_Input.H,v 1.4.2.3.2.1 2002/01/01 15:11:28 easysw Exp $". // End of "$Id: Fl_Secret_Input.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Select_Browser.H,v 1.4.2.3.2.1 2002/01/01 15:11:28 easysw Exp $" // "$Id: Fl_Select_Browser.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $"
// //
// Select browser header file for the Fast Light Tool Kit (FLTK). // Select browser header file for the Fast Light Tool Kit (FLTK).
// //
@ -30,12 +30,12 @@
class Fl_Select_Browser : public Fl_Browser { class Fl_Select_Browser : public Fl_Browser {
public: public:
Fl_Select_Browser(int x,int y,int w,int h,const char *l=0) Fl_Select_Browser(int X,int Y,int W,int H,const char *l=0)
: Fl_Browser(x,y,w,h,l) {type(FL_SELECT_BROWSER);} : Fl_Browser(X,Y,W,H,l) {type(FL_SELECT_BROWSER);}
}; };
#endif #endif
// //
// End of "$Id: Fl_Select_Browser.H,v 1.4.2.3.2.1 2002/01/01 15:11:28 easysw Exp $". // End of "$Id: Fl_Select_Browser.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Text_Buffer.H,v 1.3.2.3 2002/06/09 13:35:49 easysw Exp $" // "$Id: Fl_Text_Buffer.H,v 1.3.2.4 2002/08/09 03:17:29 easysw Exp $"
// //
// Header file for Fl_Text_Buffer class. // Header file for Fl_Text_Buffer class.
// //
@ -78,7 +78,7 @@ class FL_EXPORT Fl_Text_Buffer {
char character(int pos); char character(int pos);
char* text_in_rectangle(int start, int end, int rectStart, int rectEnd); char* text_in_rectangle(int start, int end, int rectStart, int rectEnd);
void insert(int pos, const char* text); void insert(int pos, const char* text);
void append(const char* text) { insert(length(), text); } void append(const char* t) { insert(length(), t); }
void remove(int start, int end); void remove(int start, int end);
void replace(int start, int end, const char *text); void replace(int start, int end, const char *text);
void copy(Fl_Text_Buffer* fromBuf, int fromStart, int fromEnd, int toPos); void copy(Fl_Text_Buffer* fromBuf, int fromStart, int fromEnd, int toPos);
@ -238,5 +238,5 @@ class FL_EXPORT Fl_Text_Buffer {
#endif #endif
// //
// End of "$Id: Fl_Text_Buffer.H,v 1.3.2.3 2002/06/09 13:35:49 easysw Exp $". // End of "$Id: Fl_Text_Buffer.H,v 1.3.2.4 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Text_Display.H,v 1.4.2.9 2002/08/05 18:03:58 easysw Exp $" // "$Id: Fl_Text_Display.H,v 1.4.2.10 2002/08/09 03:17:29 easysw Exp $"
// //
// Header file for Fl_Text_Display class. // Header file for Fl_Text_Display class.
// //
@ -95,7 +95,7 @@ class Fl_Text_Display: public Fl_Group {
FL_EXPORT void cursor_style(int style); FL_EXPORT void cursor_style(int style);
int scrollbar_width() { return scrollbar_width_; } int scrollbar_width() { return scrollbar_width_; }
Fl_Align scrollbar_align() { return scrollbar_align_; } Fl_Align scrollbar_align() { return scrollbar_align_; }
void scrollbar_width(int w) { scrollbar_width_ = w; } void scrollbar_width(int W) { scrollbar_width_ = W; }
void scrollbar_align(Fl_Align a) { scrollbar_align_ = a; } void scrollbar_align(Fl_Align a) { scrollbar_align_ = a; }
int word_start(int pos) { return buffer()->word_start(pos); } int word_start(int pos) { return buffer()->word_start(pos); }
int word_end(int pos) { return buffer()->word_end(pos); } int word_end(int pos) { return buffer()->word_end(pos); }
@ -243,5 +243,5 @@ class Fl_Text_Display: public Fl_Group {
#endif #endif
// //
// End of "$Id: Fl_Text_Display.H,v 1.4.2.9 2002/08/05 18:03:58 easysw Exp $". // End of "$Id: Fl_Text_Display.H,v 1.4.2.10 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Toggle_Button.H,v 1.4.2.3.2.1 2002/01/01 15:11:28 easysw Exp $" // "$Id: Fl_Toggle_Button.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $"
// //
// Toggle button header file for the Fast Light Tool Kit (FLTK). // Toggle button header file for the Fast Light Tool Kit (FLTK).
// //
@ -30,12 +30,12 @@
class Fl_Toggle_Button : public Fl_Button { class Fl_Toggle_Button : public Fl_Button {
public: public:
Fl_Toggle_Button(int x,int y,int w,int h,const char *l=0) Fl_Toggle_Button(int X,int Y,int W,int H,const char *l=0)
: Fl_Button(x,y,w,h,l) {type(FL_TOGGLE_BUTTON);} : Fl_Button(X,Y,W,H,l) {type(FL_TOGGLE_BUTTON);}
}; };
#endif #endif
// //
// End of "$Id: Fl_Toggle_Button.H,v 1.4.2.3.2.1 2002/01/01 15:11:28 easysw Exp $". // End of "$Id: Fl_Toggle_Button.H,v 1.4.2.3.2.2 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Value_Output.H,v 1.5.2.3.2.2 2002/01/01 15:11:28 easysw Exp $" // "$Id: Fl_Value_Output.H,v 1.5.2.3.2.3 2002/08/09 03:17:29 easysw Exp $"
// //
// Value output header file for the Fast Light Tool Kit (FLTK). // Value output header file for the Fast Light Tool Kit (FLTK).
// //
@ -38,7 +38,7 @@ public:
FL_EXPORT void draw(); FL_EXPORT void draw();
FL_EXPORT Fl_Value_Output(int x,int y,int w,int h,const char *l=0); FL_EXPORT Fl_Value_Output(int x,int y,int w,int h,const char *l=0);
void soft(uchar x) {soft_ = x;} void soft(uchar s) {soft_ = s;}
uchar soft() const {return soft_;} uchar soft() const {return soft_;}
Fl_Font textfont() const {return (Fl_Font)textfont_;} Fl_Font textfont() const {return (Fl_Font)textfont_;}
@ -52,5 +52,5 @@ public:
#endif #endif
// //
// End of "$Id: Fl_Value_Output.H,v 1.5.2.3.2.2 2002/01/01 15:11:28 easysw Exp $". // End of "$Id: Fl_Value_Output.H,v 1.5.2.3.2.3 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: forms.H,v 1.7.2.7.2.4 2002/03/25 21:08:41 easysw Exp $" // "$Id: forms.H,v 1.7.2.7.2.5 2002/08/09 03:17:29 easysw Exp $"
// //
// Forms emulation header file for the Fast Light Tool Kit (FLTK). // Forms emulation header file for the Fast Light Tool Kit (FLTK).
// //
@ -812,8 +812,8 @@ class Fl_FormsText : public Fl_Widget {
protected: protected:
FL_EXPORT void draw(); FL_EXPORT void draw();
public: public:
Fl_FormsText(Fl_Boxtype b, int x, int y, int w, int h, const char* l=0) Fl_FormsText(Fl_Boxtype b, int X, int Y, int W, int H, const char* l=0)
: Fl_Widget(x,y,w,h,l) {box(b); align(FL_ALIGN_LEFT);} : Fl_Widget(X,Y,W,H,l) {box(b); align(FL_ALIGN_LEFT);}
}; };
#define FL_NORMAL_TEXT FL_NO_BOX #define FL_NORMAL_TEXT FL_NO_BOX
forms_constructorb(Fl_FormsText, fl_add_text) forms_constructorb(Fl_FormsText, fl_add_text)
@ -838,5 +838,5 @@ inline void fl_draw() {Fl::flush();}
#endif /* define __FORMS_H__ */ #endif /* define __FORMS_H__ */
// //
// End of "$Id: forms.H,v 1.7.2.7.2.4 2002/03/25 21:08:41 easysw Exp $". // End of "$Id: forms.H,v 1.7.2.7.2.5 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Gl_Choice.cxx,v 1.5.2.7.2.10 2002/04/13 20:28:51 easysw Exp $" // "$Id: Fl_Gl_Choice.cxx,v 1.5.2.7.2.11 2002/08/09 03:17:29 easysw Exp $"
// //
// OpenGL visual selection code for the Fast Light Tool Kit (FLTK). // OpenGL visual selection code for the Fast Light Tool Kit (FLTK).
// //
@ -40,52 +40,52 @@ static Fl_Gl_Choice *first;
// this assummes one of the two arguments is zero: // this assummes one of the two arguments is zero:
// We keep the list system in Win32 to stay compatible and interpret // We keep the list system in Win32 to stay compatible and interpret
// the list later... // the list later...
Fl_Gl_Choice *Fl_Gl_Choice::find(int mode, const int *alist) { Fl_Gl_Choice *Fl_Gl_Choice::find(int m, const int *alistp) {
Fl_Gl_Choice *g; Fl_Gl_Choice *g;
for (g = first; g; g = g->next) for (g = first; g; g = g->next)
if (g->mode == mode && g->alist == alist) if (g->mode == m && g->alist == alistp)
return g; return g;
#ifdef __APPLE__ #ifdef __APPLE__
const int *blist; const int *blist;
int list[32]; int list[32];
if (alist) if (alistp)
blist = alist; blist = alistp;
else { else {
int n = 0; int n = 0;
if (mode & FL_INDEX) { if (m & FL_INDEX) {
list[n++] = AGL_BUFFER_SIZE; list[n++] = AGL_BUFFER_SIZE;
list[n++] = 8; // glut tries many sizes, but this should work... list[n++] = 8; // glut tries many sizes, but this should work...
} else { } else {
list[n++] = AGL_RGBA; list[n++] = AGL_RGBA;
list[n++] = AGL_GREEN_SIZE; list[n++] = AGL_GREEN_SIZE;
list[n++] = (mode & FL_RGB8) ? 8 : 1; list[n++] = (m & FL_RGB8) ? 8 : 1;
if (mode & FL_ALPHA) { if (m & FL_ALPHA) {
list[n++] = AGL_ALPHA_SIZE; list[n++] = AGL_ALPHA_SIZE;
list[n++] = 1; list[n++] = 1;
} }
if (mode & FL_ACCUM) { if (m & FL_ACCUM) {
list[n++] = AGL_ACCUM_GREEN_SIZE; list[n++] = AGL_ACCUM_GREEN_SIZE;
list[n++] = 1; list[n++] = 1;
if (mode & FL_ALPHA) { if (m & FL_ALPHA) {
list[n++] = AGL_ACCUM_ALPHA_SIZE; list[n++] = AGL_ACCUM_ALPHA_SIZE;
list[n++] = 1; list[n++] = 1;
} }
} }
} }
if (mode & FL_DOUBLE) { if (m & FL_DOUBLE) {
list[n++] = AGL_DOUBLEBUFFER; list[n++] = AGL_DOUBLEBUFFER;
} }
if (mode & FL_DEPTH) { if (m & FL_DEPTH) {
list[n++] = AGL_DEPTH_SIZE; list[n++] = 16; list[n++] = AGL_DEPTH_SIZE; list[n++] = 16;
} }
if (mode & FL_STENCIL) { if (m & FL_STENCIL) {
list[n++] = AGL_STENCIL_SIZE; list[n++] = 1; list[n++] = AGL_STENCIL_SIZE; list[n++] = 1;
} }
# ifdef AGL_STEREO /* is there such a thing as AGL_STEREO? */ # ifdef AGL_STEREO /* is there such a thing as AGL_STEREO? */
if (mode & FL_STEREO) { if (m & FL_STEREO) {
list[n++] = AGL_STEREO; list[n++] = AGL_STEREO;
} }
# endif # endif
@ -101,44 +101,44 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int mode, const int *alist) {
const int *blist; const int *blist;
int list[32]; int list[32];
if (alist) if (alistp)
blist = alist; blist = alistp;
else { else {
int n = 0; int n = 0;
if (mode & FL_INDEX) { if (m & FL_INDEX) {
list[n++] = GLX_BUFFER_SIZE; list[n++] = GLX_BUFFER_SIZE;
list[n++] = 8; // glut tries many sizes, but this should work... list[n++] = 8; // glut tries many sizes, but this should work...
} else { } else {
list[n++] = GLX_RGBA; list[n++] = GLX_RGBA;
list[n++] = GLX_GREEN_SIZE; list[n++] = GLX_GREEN_SIZE;
list[n++] = (mode & FL_RGB8) ? 8 : 1; list[n++] = (m & FL_RGB8) ? 8 : 1;
if (mode & FL_ALPHA) { if (m & FL_ALPHA) {
list[n++] = GLX_ALPHA_SIZE; list[n++] = GLX_ALPHA_SIZE;
list[n++] = 1; list[n++] = 1;
} }
if (mode & FL_ACCUM) { if (m & FL_ACCUM) {
list[n++] = GLX_ACCUM_GREEN_SIZE; list[n++] = GLX_ACCUM_GREEN_SIZE;
list[n++] = 1; list[n++] = 1;
if (mode & FL_ALPHA) { if (m & FL_ALPHA) {
list[n++] = GLX_ACCUM_ALPHA_SIZE; list[n++] = GLX_ACCUM_ALPHA_SIZE;
list[n++] = 1; list[n++] = 1;
} }
} }
} }
if (mode & FL_DOUBLE) { if (m & FL_DOUBLE) {
list[n++] = GLX_DOUBLEBUFFER; list[n++] = GLX_DOUBLEBUFFER;
} }
if (mode & FL_DEPTH) { if (m & FL_DEPTH) {
list[n++] = GLX_DEPTH_SIZE; list[n++] = 1; list[n++] = GLX_DEPTH_SIZE; list[n++] = 1;
} }
if (mode & FL_STENCIL) { if (m & FL_STENCIL) {
list[n++] = GLX_STENCIL_SIZE; list[n++] = 1; list[n++] = GLX_STENCIL_SIZE; list[n++] = 1;
} }
if (mode & FL_STEREO) { if (m & FL_STEREO) {
list[n++] = GLX_STEREO; list[n++] = GLX_STEREO;
} }
# if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample) # if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample)
if (mode & FL_MULTISAMPLE) { if (m & FL_MULTISAMPLE) {
list[n++] = GLX_SAMPLES_SGIS; list[n++] = GLX_SAMPLES_SGIS;
list[n++] = 4; // value Glut uses list[n++] = 4; // value Glut uses
} }
@ -148,10 +148,10 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int mode, const int *alist) {
} }
fl_open_display(); fl_open_display();
XVisualInfo *vis = glXChooseVisual(fl_display, fl_screen, (int *)blist); XVisualInfo *visp = glXChooseVisual(fl_display, fl_screen, (int *)blist);
if (!vis) { if (!visp) {
# if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample) # if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample)
if (mode&FL_MULTISAMPLE) return find(mode&~FL_MULTISAMPLE,0); if (m&FL_MULTISAMPLE) return find(m&~FL_MULTISAMPLE,0);
# endif # endif
return 0; return 0;
} }
@ -168,13 +168,13 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int mode, const int *alist) {
if (!DescribePixelFormat(fl_gc, i, sizeof(pfd), &pfd)) break; if (!DescribePixelFormat(fl_gc, i, sizeof(pfd), &pfd)) break;
// continue if it does not satisfy our requirements: // continue if it does not satisfy our requirements:
if (~pfd.dwFlags & (PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL)) continue; if (~pfd.dwFlags & (PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL)) continue;
if (pfd.iPixelType != ((mode&FL_INDEX)?PFD_TYPE_COLORINDEX:PFD_TYPE_RGBA)) continue; if (pfd.iPixelType != ((m&FL_INDEX)?PFD_TYPE_COLORINDEX:PFD_TYPE_RGBA)) continue;
if ((mode & FL_ALPHA) && !pfd.cAlphaBits) continue; if ((m & FL_ALPHA) && !pfd.cAlphaBits) continue;
if ((mode & FL_ACCUM) && !pfd.cAccumBits) continue; if ((m & FL_ACCUM) && !pfd.cAccumBits) continue;
if ((!(mode & FL_DOUBLE)) != (!(pfd.dwFlags & PFD_DOUBLEBUFFER))) continue; if ((!(m & FL_DOUBLE)) != (!(pfd.dwFlags & PFD_DOUBLEBUFFER))) continue;
if ((!(mode & FL_STEREO)) != (!(pfd.dwFlags & PFD_STEREO))) continue; if ((!(m & FL_STEREO)) != (!(pfd.dwFlags & PFD_STEREO))) continue;
if ((mode & FL_DEPTH) && !pfd.cDepthBits) continue; if ((m & FL_DEPTH) && !pfd.cDepthBits) continue;
if ((mode & FL_STENCIL) && !pfd.cStencilBits) continue; if ((m & FL_STENCIL) && !pfd.cStencilBits) continue;
// see if better than the one we have already: // see if better than the one we have already:
if (pixelformat) { if (pixelformat) {
// offering overlay is better: // offering overlay is better:
@ -192,8 +192,8 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int mode, const int *alist) {
#endif #endif
g = new Fl_Gl_Choice; g = new Fl_Gl_Choice;
g->mode = mode; g->mode = m;
g->alist = alist; g->alist = alistp;
g->next = first; g->next = first;
first = g; first = g;
@ -203,15 +203,15 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int mode, const int *alist) {
#elif defined(__APPLE__) #elif defined(__APPLE__)
g->pixelformat = fmt; g->pixelformat = fmt;
#else #else
g->vis = vis; g->vis = visp;
if (/*MaxCmapsOfScreen(ScreenOfDisplay(fl_display,fl_screen))==1 && */ if (/*MaxCmapsOfScreen(ScreenOfDisplay(fl_display,fl_screen))==1 && */
vis->visualid == fl_visual->visualid && visp->visualid == fl_visual->visualid &&
!getenv("MESA_PRIVATE_CMAP")) !getenv("MESA_PRIVATE_CMAP"))
g->colormap = fl_colormap; g->colormap = fl_colormap;
else else
g->colormap = XCreateColormap(fl_display, RootWindow(fl_display,fl_screen), g->colormap = XCreateColormap(fl_display, RootWindow(fl_display,fl_screen),
vis->visual, AllocNone); visp->visual, AllocNone);
#endif #endif
return g; return g;
@ -318,5 +318,5 @@ void fl_delete_gl_context(GLContext context) {
#endif #endif
// //
// End of "$Id: Fl_Gl_Choice.cxx,v 1.5.2.7.2.10 2002/04/13 20:28:51 easysw Exp $". // End of "$Id: Fl_Gl_Choice.cxx,v 1.5.2.7.2.11 2002/08/09 03:17:29 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.11 2002/05/25 13:38:24 easysw Exp $" // "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.12 2002/08/09 03:17:30 easysw Exp $"
// //
// OpenGL window code for the Fast Light Tool Kit (FLTK). // OpenGL window code for the Fast Light Tool Kit (FLTK).
// //
@ -262,10 +262,10 @@ void Fl_Gl_Window::flush() {
// and depth test needs to be off: // and depth test needs to be off:
static GLContext ortho_context = 0; static GLContext ortho_context = 0;
static Fl_Gl_Window* ortho_window = 0; static Fl_Gl_Window* ortho_window = 0;
int init = !ortho_context; int orthoinit = !ortho_context;
if (init) ortho_context = fl_create_gl_context(this, g); if (orthoinit) ortho_context = fl_create_gl_context(this, g);
fl_set_gl_context(this, ortho_context); fl_set_gl_context(this, ortho_context);
if (init || !save_valid || ortho_window != this) { if (orthoinit || !save_valid || ortho_window != this) {
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
glReadBuffer(GL_BACK); glReadBuffer(GL_BACK);
glDrawBuffer(GL_FRONT); glDrawBuffer(GL_FRONT);
@ -367,5 +367,5 @@ void Fl_Gl_Window::draw_overlay() {}
#endif #endif
// //
// End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.11 2002/05/25 13:38:24 easysw Exp $". // End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.12 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Input_.cxx,v 1.21.2.11.2.20 2002/08/09 01:09:49 easysw Exp $" // "$Id: Fl_Input_.cxx,v 1.21.2.11.2.21 2002/08/09 03:17:30 easysw Exp $"
// //
// Common input widget routines for the Fast Light Tool Kit (FLTK). // Common input widget routines for the Fast Light Tool Kit (FLTK).
// //
@ -237,20 +237,20 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
if (erase_cursor_only && p > pp) goto CONTINUE2; // this line is after if (erase_cursor_only && p > pp) goto CONTINUE2; // this line is after
// calculate area to erase: // calculate area to erase:
int r = X+W; int r = X+W;
int x; int xx;
if (p >= pp) { if (p >= pp) {
x = X; xx = X;
if (erase_cursor_only) r = xpos+2; if (erase_cursor_only) r = xpos+2;
else if (readonly()) x -= 3; else if (readonly()) xx -= 3;
} else { } else {
x = xpos+(int)expandpos(p, pp, buf, 0); xx = xpos+(int)expandpos(p, pp, buf, 0);
if (erase_cursor_only) r = x+2; if (erase_cursor_only) r = xx+2;
else if (readonly()) x -= 3; else if (readonly()) xx -= 3;
} }
// clip to and erase it: // clip to and erase it:
fl_color(color()); fl_color(color());
fl_rectf(x, Y+ypos, r-x, height); fl_rectf(xx, Y+ypos, r-xx, height);
fl_push_clip(x, Y+ypos, r-x, height); fl_push_clip(xx, Y+ypos, r-xx, height);
// it now draws entire line over it // it now draws entire line over it
// this should not draw letters to left of erased area, but // this should not draw letters to left of erased area, but
// that is nyi. // that is nyi.
@ -848,5 +848,5 @@ Fl_Input_::~Fl_Input_() {
} }
// //
// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.20 2002/08/09 01:09:49 easysw Exp $". // End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.21 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Roller.cxx,v 1.6.2.4.2.6 2002/05/24 14:19:19 easysw Exp $" // "$Id: Fl_Roller.cxx,v 1.6.2.4.2.7 2002/08/09 03:17:30 easysw Exp $"
// //
// Roller widget for the Fast Light Tool Kit (FLTK). // Roller widget for the Fast Light Tool Kit (FLTK).
// //
@ -105,13 +105,13 @@ void Fl_Roller::draw() {
if (active_r()) { if (active_r()) {
// draw ridges: // draw ridges:
double junk; double junk;
for (double y = -ARC+modf(offset*sin(ARC)/(W/2)/delta,&junk)*delta;; for (double yy = -ARC+modf(offset*sin(ARC)/(W/2)/delta,&junk)*delta;;
y += delta) { yy += delta) {
int y1 = int((sin(y)/sin(ARC)+1)*W/2); int yy1 = int((sin(yy)/sin(ARC)+1)*W/2);
if (y1 <= 0) continue; else if (y1 >= W-1) break; if (yy1 <= 0) continue; else if (yy1 >= W-1) break;
fl_color(FL_DARK3); fl_yxline(X+y1,Y+1,Y+H-1); fl_color(FL_DARK3); fl_yxline(X+yy1,Y+1,Y+H-1);
if (y < 0) y1--; else y1++; if (yy < 0) yy1--; else yy1++;
fl_color(FL_LIGHT1);fl_yxline(X+y1,Y+1,Y+H-1); fl_color(FL_LIGHT1);fl_yxline(X+yy1,Y+1,Y+H-1);
} }
// draw edges: // draw edges:
h1 = W/8+1; // distance from end the color inverts h1 = W/8+1; // distance from end the color inverts
@ -139,13 +139,13 @@ void Fl_Roller::draw() {
if (active_r()) { if (active_r()) {
// draw ridges: // draw ridges:
double junk; double junk;
for (double y = -ARC+modf(offset*sin(ARC)/(H/2)/delta,&junk)*delta; for (double yy = -ARC+modf(offset*sin(ARC)/(H/2)/delta,&junk)*delta;
; y += delta) { ; yy += delta) {
int y1 = int((sin(y)/sin(ARC)+1)*H/2); int yy1 = int((sin(yy)/sin(ARC)+1)*H/2);
if (y1 <= 0) continue; else if (y1 >= H-1) break; if (yy1 <= 0) continue; else if (yy1 >= H-1) break;
fl_color(FL_DARK3); fl_xyline(X+1,Y+y1,X+W-1); fl_color(FL_DARK3); fl_xyline(X+1,Y+yy1,X+W-1);
if (y < 0) y1--; else y1++; if (yy < 0) yy1--; else yy1++;
fl_color(FL_LIGHT1);fl_xyline(X+1,Y+y1,X+W-1); fl_color(FL_LIGHT1);fl_xyline(X+1,Y+yy1,X+W-1);
} }
// draw edges: // draw edges:
h1 = H/8+1; // distance from end the color inverts h1 = H/8+1; // distance from end the color inverts
@ -171,5 +171,5 @@ Fl_Roller::Fl_Roller(int X,int Y,int W,int H,const char* L)
} }
// //
// End of "$Id: Fl_Roller.cxx,v 1.6.2.4.2.6 2002/05/24 14:19:19 easysw Exp $". // End of "$Id: Fl_Roller.cxx,v 1.6.2.4.2.7 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Round_Button.cxx,v 1.4.2.3.2.3 2002/01/01 15:11:31 easysw Exp $" // "$Id: Fl_Round_Button.cxx,v 1.4.2.3.2.4 2002/08/09 03:17:30 easysw Exp $"
// //
// Round button for the Fast Light Tool Kit (FLTK). // Round button for the Fast Light Tool Kit (FLTK).
// //
@ -30,13 +30,13 @@
#include <FL/Fl.H> #include <FL/Fl.H>
#include <FL/Fl_Round_Button.H> #include <FL/Fl_Round_Button.H>
Fl_Round_Button::Fl_Round_Button(int x,int y,int w,int h, const char *l) Fl_Round_Button::Fl_Round_Button(int X,int Y,int W,int H, const char *l)
: Fl_Light_Button(x,y,w,h,l) { : Fl_Light_Button(X,Y,W,H,l) {
box(FL_NO_BOX); box(FL_NO_BOX);
down_box(FL_ROUND_DOWN_BOX); down_box(FL_ROUND_DOWN_BOX);
selection_color(FL_BLACK); selection_color(FL_BLACK);
} }
// //
// End of "$Id: Fl_Round_Button.cxx,v 1.4.2.3.2.3 2002/01/01 15:11:31 easysw Exp $". // End of "$Id: Fl_Round_Button.cxx,v 1.4.2.3.2.4 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.8 2002/03/25 21:08:41 easysw Exp $" // "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.9 2002/08/09 03:17:30 easysw Exp $"
// //
// Scroll bar widget for the Fast Light Tool Kit (FLTK). // Scroll bar widget for the Fast Light Tool Kit (FLTK).
// //
@ -207,10 +207,10 @@ void Fl_Scrollbar::draw() {
fl_color(fl_inactive(labelcolor())); fl_color(fl_inactive(labelcolor()));
int w1 = (H-4)/3; if (w1 < 1) w1 = 1; int w1 = (H-4)/3; if (w1 < 1) w1 = 1;
int x1 = X+(H-w1-1)/2; int x1 = X+(H-w1-1)/2;
int y1 = Y+(H-2*w1-1)/2; int yy1 = Y+(H-2*w1-1)/2;
fl_polygon(x1, y1+w1, x1+w1, y1+2*w1, x1+w1, y1); fl_polygon(x1, yy1+w1, x1+w1, yy1+2*w1, x1+w1, yy1);
x1 += (W-H); x1 += (W-H);
fl_polygon(x1, y1, x1, y1+2*w1, x1+w1, y1+w1); fl_polygon(x1, yy1, x1, yy1+2*w1, x1+w1, yy1+w1);
} }
} else { // vertical } else { // vertical
if (H < 3*W) {Fl_Slider::draw(X,Y,W,H); return;} if (H < 3*W) {Fl_Slider::draw(X,Y,W,H); return;}
@ -226,10 +226,10 @@ void Fl_Scrollbar::draw() {
fl_color(labelcolor() | 8); fl_color(labelcolor() | 8);
int w1 = (W-4)/3; if (w1 < 1) w1 = 1; int w1 = (W-4)/3; if (w1 < 1) w1 = 1;
int x1 = X+(W-2*w1-1)/2; int x1 = X+(W-2*w1-1)/2;
int y1 = Y+(W-w1-1)/2; int yy1 = Y+(W-w1-1)/2;
fl_polygon(x1, y1+w1, x1+2*w1, y1+w1, x1+w1, y1); fl_polygon(x1, yy1+w1, x1+2*w1, yy1+w1, x1+w1, yy1);
y1 += H-W; yy1 += H-W;
fl_polygon(x1, y1, x1+w1, y1+w1, x1+2*w1, y1); fl_polygon(x1, yy1, x1+w1, yy1+w1, x1+2*w1, yy1);
} }
} }
} }
@ -246,5 +246,5 @@ Fl_Scrollbar::Fl_Scrollbar(int X, int Y, int W, int H, const char* L)
} }
// //
// End of "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.8 2002/03/25 21:08:41 easysw Exp $". // End of "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.9 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Slider.cxx,v 1.8.2.10.2.8 2002/06/29 00:10:04 matthiaswm Exp $" // "$Id: Fl_Slider.cxx,v 1.8.2.10.2.9 2002/08/09 03:17:30 easysw Exp $"
// //
// Slider widget for the Fast Light Tool Kit (FLTK). // Slider widget for the Fast Light Tool Kit (FLTK).
// //
@ -33,14 +33,14 @@ void Fl_Slider::_Fl_Slider() {
slider_ = 0; // FL_UP_BOX; slider_ = 0; // FL_UP_BOX;
} }
Fl_Slider::Fl_Slider(int x, int y, int w, int h, const char* l) Fl_Slider::Fl_Slider(int X, int Y, int W, int H, const char* l)
: Fl_Valuator(x, y, w, h, l) { : Fl_Valuator(X, Y, W, H, l) {
box(FL_DOWN_BOX); box(FL_DOWN_BOX);
_Fl_Slider(); _Fl_Slider();
} }
Fl_Slider::Fl_Slider(uchar t, int x, int y, int w, int h, const char* l) Fl_Slider::Fl_Slider(uchar t, int X, int Y, int W, int H, const char* l)
: Fl_Valuator(x, y, w, h, l) { : Fl_Valuator(X, Y, W, H, l) {
type(t); type(t);
box(t==FL_HOR_NICE_SLIDER || t==FL_VERT_NICE_SLIDER ? box(t==FL_HOR_NICE_SLIDER || t==FL_VERT_NICE_SLIDER ?
FL_FLAT_BOX : FL_DOWN_BOX); FL_FLAT_BOX : FL_DOWN_BOX);
@ -63,15 +63,15 @@ void Fl_Slider::bounds(double a, double b) {
} }
} }
int Fl_Slider::scrollvalue(int p, int w, int t, int l) { int Fl_Slider::scrollvalue(int p, int W, int t, int l) {
// p = position, first line displayed // p = position, first line displayed
// w = window, number of lines displayed // w = window, number of lines displayed
// t = top, number of first line // t = top, number of first line
// l = length, total number of lines // l = length, total number of lines
step(1, 1); step(1, 1);
if (p+w > t+l) l = p+w-t; if (p+W > t+l) l = p+W-t;
slider_size(w >= l ? 1.0 : double(w)/double(l)); slider_size(W >= l ? 1.0 : double(W)/double(l));
bounds(t, l-w+t); bounds(t, l-W+t);
return value(p); return value(p);
} }
@ -82,19 +82,19 @@ int Fl_Slider::scrollvalue(int p, int w, int t, int l) {
// position on the widget itself covers a wider range than 0-1, // position on the widget itself covers a wider range than 0-1,
// actually it ranges from 0 to 1/(1-size). // actually it ranges from 0 to 1/(1-size).
void Fl_Slider::draw_bg(int x, int y, int w, int h) { void Fl_Slider::draw_bg(int X, int Y, int W, int H) {
if (!(damage()&FL_DAMAGE_ALL)) { // not a complete redraw if (!(damage()&FL_DAMAGE_ALL)) { // not a complete redraw
draw_box(); draw_box();
} }
Fl_Color black = active_r() ? FL_FOREGROUND_COLOR : FL_INACTIVE_COLOR; Fl_Color black = active_r() ? FL_FOREGROUND_COLOR : FL_INACTIVE_COLOR;
if (type() == FL_VERT_NICE_SLIDER) { if (type() == FL_VERT_NICE_SLIDER) {
draw_box(FL_THIN_DOWN_BOX, x+w/2-2, y, 4, h, black); draw_box(FL_THIN_DOWN_BOX, X+W/2-2, Y, 4, H, black);
} else if (type() == FL_HOR_NICE_SLIDER) { } else if (type() == FL_HOR_NICE_SLIDER) {
draw_box(FL_THIN_DOWN_BOX, x, y+h/2-2, w, 4, black); draw_box(FL_THIN_DOWN_BOX, X, Y+H/2-2, W, 4, black);
} }
} }
void Fl_Slider::draw(int x, int y, int w, int h) { void Fl_Slider::draw(int X, int Y, int W, int H) {
double val; double val;
if (minimum() == maximum()) if (minimum() == maximum())
@ -105,45 +105,45 @@ void Fl_Slider::draw(int x, int y, int w, int h) {
else if (val < 0.0) val = 0.0; else if (val < 0.0) val = 0.0;
} }
int W = (horizontal() ? w : h); int ww = (horizontal() ? W : H);
int X, S; int xx, S;
if (type()==FL_HOR_FILL_SLIDER || type() == FL_VERT_FILL_SLIDER) { if (type()==FL_HOR_FILL_SLIDER || type() == FL_VERT_FILL_SLIDER) {
S = int(val*W+.5); S = int(val*ww+.5);
if (minimum()>maximum()) {S = W-S; X = W-S;} if (minimum()>maximum()) {S = ww-S; xx = ww-S;}
else X = 0; else xx = 0;
} else { } else {
S = int(slider_size_*W+.5); S = int(slider_size_*ww+.5);
int T = (horizontal() ? h : w)/2+1; int T = (horizontal() ? H : W)/2+1;
if (type()==FL_VERT_NICE_SLIDER || type()==FL_HOR_NICE_SLIDER) T += 4; if (type()==FL_VERT_NICE_SLIDER || type()==FL_HOR_NICE_SLIDER) T += 4;
if (S < T) S = T; if (S < T) S = T;
X = int(val*(W-S)+.5); xx = int(val*(ww-S)+.5);
} }
int xsl, ysl, wsl, hsl; int xsl, ysl, wsl, hsl;
if (horizontal()) { if (horizontal()) {
xsl = x+X; xsl = X+xx;
wsl = S; wsl = S;
ysl = y; ysl = Y;
hsl = h; hsl = H;
} else { } else {
ysl = y+X; ysl = Y+xx;
hsl = S; hsl = S;
xsl = x; xsl = X;
wsl = w; wsl = W;
} }
if (damage()&FL_DAMAGE_ALL) { // complete redraw if (damage()&FL_DAMAGE_ALL) { // complete redraw
draw_bg(x, y, w, h); draw_bg(X, Y, W, H);
} else { // partial redraw, clip off new position of slider } else { // partial redraw, clip off new position of slider
if (X > 0) { if (xx > 0) {
if (horizontal()) fl_clip(x, ysl, X, hsl); if (horizontal()) fl_clip(X, ysl, xx, hsl);
else fl_clip(xsl, y, wsl, X); else fl_clip(xsl, Y, wsl, xx);
draw_bg(x, y, w, h); draw_bg(X, Y, W, H);
fl_pop_clip(); fl_pop_clip();
} }
if (X+S < W) { if (xx+S < W) {
if (horizontal()) fl_clip(xsl+wsl, ysl, x+w-xsl-wsl, hsl); if (horizontal()) fl_clip(xsl+wsl, ysl, X+W-xsl-wsl, hsl);
else fl_clip(xsl, ysl+hsl, wsl, y+h-ysl-hsl); else fl_clip(xsl, ysl+hsl, wsl, Y+H-ysl-hsl);
draw_bg(x, y, w, h); draw_bg(X, Y, W, H);
fl_pop_clip(); fl_pop_clip();
} }
} }
@ -177,10 +177,10 @@ void Fl_Slider::draw() {
h()-Fl::box_dh(box())); h()-Fl::box_dh(box()));
} }
int Fl_Slider::handle(int event, int x, int y, int w, int h) { int Fl_Slider::handle(int event, int X, int Y, int W, int H) {
switch (event) { switch (event) {
case FL_PUSH: case FL_PUSH:
if (!Fl::event_inside(x, y, w, h)) return 0; if (!Fl::event_inside(X, Y, W, H)) return 0;
if (Fl::visible_focus()) Fl::focus(this); if (Fl::visible_focus()) Fl::focus(this);
handle_push(); handle_push();
case FL_DRAG: { case FL_DRAG: {
@ -194,8 +194,8 @@ int Fl_Slider::handle(int event, int x, int y, int w, int h) {
else if (val < 0.0) val = 0.0; else if (val < 0.0) val = 0.0;
} }
int W = (horizontal() ? w : h); int ww = (horizontal() ? W : H);
int mx = (horizontal() ? Fl::event_x()-x : Fl::event_y()-y); int mx = (horizontal() ? Fl::event_x()-X : Fl::event_y()-Y);
int S; int S;
static int offcenter; static int offcenter;
@ -203,41 +203,41 @@ int Fl_Slider::handle(int event, int x, int y, int w, int h) {
S = 0; S = 0;
if (event == FL_PUSH) { if (event == FL_PUSH) {
int X = int(val*W+.5); int xx = int(val*ww+.5);
offcenter = mx-X; offcenter = mx-xx;
if (offcenter < -10 || offcenter > 10) offcenter = 0; if (offcenter < -10 || offcenter > 10) offcenter = 0;
else return 1; else return 1;
} }
} else { } else {
S = int(slider_size_*W+.5); if (S >= W) return 0; S = int(slider_size_*ww+.5); if (S >= ww) return 0;
int T = (horizontal() ? h : w)/2+1; int T = (horizontal() ? H : W)/2+1;
if (type()==FL_VERT_NICE_SLIDER || type()==FL_HOR_NICE_SLIDER) T += 4; if (type()==FL_VERT_NICE_SLIDER || type()==FL_HOR_NICE_SLIDER) T += 4;
if (S < T) S = T; if (S < T) S = T;
if (event == FL_PUSH) { if (event == FL_PUSH) {
int X = int(val*(W-S)+.5); int xx = int(val*(ww-S)+.5);
offcenter = mx-X; offcenter = mx-xx;
if (offcenter < 0) offcenter = 0; if (offcenter < 0) offcenter = 0;
else if (offcenter > S) offcenter = S; else if (offcenter > S) offcenter = S;
else return 1; else return 1;
} }
} }
int X = mx-offcenter; int xx = mx-offcenter;
double v; double v;
char tryAgain = 1; char tryAgain = 1;
while (tryAgain) while (tryAgain)
{ {
tryAgain = 0; tryAgain = 0;
if (X < 0) { if (xx < 0) {
X = 0; xx = 0;
offcenter = mx; if (offcenter < 0) offcenter = 0; offcenter = mx; if (offcenter < 0) offcenter = 0;
} else if (X > (W-S)) { } else if (xx > (ww-S)) {
X = W-S; xx = ww-S;
offcenter = mx-X; if (offcenter > S) offcenter = S; offcenter = mx-xx; if (offcenter > S) offcenter = S;
} }
v = round(X*(maximum()-minimum())/(W-S) + minimum()); v = round(xx*(maximum()-minimum())/(ww-S) + minimum());
// make sure a click outside the sliderbar moves it: // make sure a click outside the sliderbar moves it:
if (event == FL_PUSH && v == value()) { if (event == FL_PUSH && v == value()) {
offcenter = S/2; offcenter = S/2;
@ -295,5 +295,5 @@ int Fl_Slider::handle(int event) {
} }
// //
// End of "$Id: Fl_Slider.cxx,v 1.8.2.10.2.8 2002/06/29 00:10:04 matthiaswm Exp $". // End of "$Id: Fl_Slider.cxx,v 1.8.2.10.2.9 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.10 2002/05/15 16:50:27 easysw Exp $" // "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.11 2002/08/09 03:17:30 easysw Exp $"
// //
// Tab widget for the Fast Light Tool Kit (FLTK). // Tab widget for the Fast Light Tool Kit (FLTK).
// //
@ -43,7 +43,7 @@
// or by EXTRASPACE or by zero. // or by EXTRASPACE or by zero.
// Return value is the index of the selected item. // Return value is the index of the selected item.
int Fl_Tabs::tab_positions(int* p, int* w) { int Fl_Tabs::tab_positions(int* p, int* wp) {
int selected = -1; int selected = -1;
Fl_Widget*const* a = array(); Fl_Widget*const* a = array();
int i; int i;
@ -55,16 +55,16 @@ int Fl_Tabs::tab_positions(int* p, int* w) {
int wt = 0; int ht = 0; int wt = 0; int ht = 0;
o->measure_label(wt,ht); o->measure_label(wt,ht);
w[i] = wt+EXTRASPACE; wp[i] = wt+EXTRASPACE;
p[i+1] = p[i]+w[i]+BORDER; p[i+1] = p[i]+wp[i]+BORDER;
} }
int r = this->w(); int r = w();
if (p[i] <= r) return selected; if (p[i] <= r) return selected;
// uh oh, they are too big: // uh oh, they are too big:
// pack them against right edge: // pack them against right edge:
p[i] = r; p[i] = r;
for (i = children(); i--;) { for (i = children(); i--;) {
int l = r-w[i]; int l = r-wp[i];
if (p[i+1] < l) l = p[i+1]; if (p[i+1] < l) l = p[i+1];
if (p[i] <= l) break; if (p[i] <= l) break;
p[i] = l; p[i] = l;
@ -74,12 +74,12 @@ int Fl_Tabs::tab_positions(int* p, int* w) {
for (i = 0; i<children(); i++) { for (i = 0; i<children(); i++) {
if (p[i] >= i*EXTRASPACE) break; if (p[i] >= i*EXTRASPACE) break;
p[i] = i*EXTRASPACE; p[i] = i*EXTRASPACE;
int W = this->w()-1-EXTRASPACE*(children()-i) - p[i]; int W = w()-1-EXTRASPACE*(children()-i) - p[i];
if (w[i] > W) w[i] = W; if (wp[i] > W) wp[i] = W;
} }
// adjust edges according to visiblity: // adjust edges according to visiblity:
for (i = children(); i > selected; i--) { for (i = children(); i > selected; i--) {
p[i] = p[i-1]+w[i-1]; p[i] = p[i-1]+wp[i-1];
} }
return selected; return selected;
} }
@ -108,8 +108,8 @@ Fl_Widget *Fl_Tabs::which(int event_x, int event_y) {
if (event_y > y()+H || event_y < y()) return 0; if (event_y > y()+H || event_y < y()) return 0;
} }
if (event_x < x()) return 0; if (event_x < x()) return 0;
int p[128], w[128]; int p[128], wp[128];
tab_positions(p, w); tab_positions(p, wp);
for (int i=0; i<children(); i++) { for (int i=0; i<children(); i++) {
if (event_x < x()+p[i+1]) return child(i); if (event_x < x()+p[i+1]) return child(i);
} }
@ -233,17 +233,17 @@ void Fl_Tabs::draw() {
if (v) update_child(*v); if (v) update_child(*v);
} }
if (damage() & (FL_DAMAGE_EXPOSE|FL_DAMAGE_ALL)) { if (damage() & (FL_DAMAGE_EXPOSE|FL_DAMAGE_ALL)) {
int p[128]; int w[128]; int p[128]; int wp[128];
int selected = tab_positions(p,w); int selected = tab_positions(p,wp);
int i; int i;
Fl_Widget*const* a = array(); Fl_Widget*const* a = array();
for (i=0; i<selected; i++) for (i=0; i<selected; i++)
draw_tab(x()+p[i], x()+p[i+1], w[i], H, a[i], LEFT); draw_tab(x()+p[i], x()+p[i+1], wp[i], H, a[i], LEFT);
for (i=children()-1; i > selected; i--) for (i=children()-1; i > selected; i--)
draw_tab(x()+p[i], x()+p[i+1], w[i], H, a[i], RIGHT); draw_tab(x()+p[i], x()+p[i+1], wp[i], H, a[i], RIGHT);
if (v) { if (v) {
i = selected; i = selected;
draw_tab(x()+p[i], x()+p[i+1], w[i], H, a[i], SELECTED); draw_tab(x()+p[i], x()+p[i+1], wp[i], H, a[i], SELECTED);
} }
} }
} }
@ -300,5 +300,5 @@ Fl_Tabs::Fl_Tabs(int X,int Y,int W, int H, const char *l) :
} }
// //
// End of "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.10 2002/05/15 16:50:27 easysw Exp $". // End of "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.11 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Text_Buffer.cxx,v 1.9.2.10 2002/08/09 01:09:49 easysw Exp $" // "$Id: Fl_Text_Buffer.cxx,v 1.9.2.11 2002/08/09 03:17:30 easysw Exp $"
// //
// Copyright 2001-2002 by Bill Spitzak and others. // Copyright 2001-2002 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under // Original code Copyright Mark Edel. Permission to distribute under
@ -130,7 +130,7 @@ char * Fl_Text_Buffer::text() {
** Replace the entire contents of the text buffer ** Replace the entire contents of the text buffer
*/ */
void Fl_Text_Buffer::text( const char *t ) { void Fl_Text_Buffer::text( const char *t ) {
int length, deletedLength; int insertedLength, deletedLength;
const char *deletedText; const char *deletedText;
/* Save information for redisplay, and get rid of the old buffer */ /* Save information for redisplay, and get rid of the old buffer */
@ -139,13 +139,13 @@ void Fl_Text_Buffer::text( const char *t ) {
free( (void *)mBuf ); free( (void *)mBuf );
/* Start a new buffer with a gap of PREFERRED_GAP_SIZE in the center */ /* Start a new buffer with a gap of PREFERRED_GAP_SIZE in the center */
length = strlen( t ); insertedLength = strlen( t );
mBuf = (char *)malloc( length + PREFERRED_GAP_SIZE ); mBuf = (char *)malloc( insertedLength + PREFERRED_GAP_SIZE );
mLength = length; mLength = insertedLength;
mGapStart = length / 2; mGapStart = insertedLength / 2;
mGapEnd = mGapStart + PREFERRED_GAP_SIZE; mGapEnd = mGapStart + PREFERRED_GAP_SIZE;
memcpy( mBuf, t, mGapStart ); memcpy( mBuf, t, mGapStart );
memcpy( &mBuf[ mGapEnd ], &t[ mGapStart ], length - mGapStart ); memcpy( &mBuf[ mGapEnd ], &t[ mGapStart ], insertedLength - mGapStart );
#ifdef PURIFY #ifdef PURIFY
{ int i; for ( i = mGapStart; i < mGapEnd; i++ ) mBuf[ i ] = '.'; } { int i; for ( i = mGapStart; i < mGapEnd; i++ ) mBuf[ i ] = '.'; }
#endif #endif
@ -154,7 +154,7 @@ void Fl_Text_Buffer::text( const char *t ) {
update_selections( 0, deletedLength, 0 ); update_selections( 0, deletedLength, 0 );
/* Call the saved display routine(s) to update the screen */ /* Call the saved display routine(s) to update the screen */
call_modify_callbacks( 0, deletedLength, length, 0, deletedText ); call_modify_callbacks( 0, deletedLength, insertedLength, 0, deletedText );
free( (void *)deletedText ); free( (void *)deletedText );
} }
@ -164,15 +164,15 @@ void Fl_Text_Buffer::text( const char *t ) {
** include the character pointed to by "end" ** include the character pointed to by "end"
*/ */
char * Fl_Text_Buffer::text_range( int start, int end ) { char * Fl_Text_Buffer::text_range( int start, int end ) {
char * text; char * s;
int length, part1Length; int copiedLength, part1Length;
/* Make sure start and end are ok, and allocate memory for returned string. /* Make sure start and end are ok, and allocate memory for returned string.
If start is bad, return "", if end is bad, adjust it. */ If start is bad, return "", if end is bad, adjust it. */
if ( start < 0 || start > mLength ) { if ( start < 0 || start > mLength ) {
text = (char *)malloc( 1 ); s = (char *)malloc( 1 );
text[ 0 ] = '\0'; s[ 0 ] = '\0';
return text; return s;
} }
if ( end < start ) { if ( end < start ) {
int temp = start; int temp = start;
@ -181,21 +181,21 @@ char * Fl_Text_Buffer::text_range( int start, int end ) {
} }
if ( end > mLength ) if ( end > mLength )
end = mLength; end = mLength;
length = end - start; copiedLength = end - start;
text = (char *)malloc( length + 1 ); s = (char *)malloc( copiedLength + 1 );
/* Copy the text from the buffer to the returned string */ /* Copy the text from the buffer to the returned string */
if ( end <= mGapStart ) { if ( end <= mGapStart ) {
memcpy( text, &mBuf[ start ], length ); memcpy( s, &mBuf[ start ], copiedLength );
} else if ( start >= mGapStart ) { } else if ( start >= mGapStart ) {
memcpy( text, &mBuf[ start + ( mGapEnd - mGapStart ) ], length ); memcpy( s, &mBuf[ start + ( mGapEnd - mGapStart ) ], copiedLength );
} else { } else {
part1Length = mGapStart - start; part1Length = mGapStart - start;
memcpy( text, &mBuf[ start ], part1Length ); memcpy( s, &mBuf[ start ], part1Length );
memcpy( &text[ part1Length ], &mBuf[ mGapEnd ], length - part1Length ); memcpy( &s[ part1Length ], &mBuf[ mGapEnd ], copiedLength - part1Length );
} }
text[ length ] = '\0'; s[ copiedLength ] = '\0';
return text; return s;
} }
/* /*
@ -213,7 +213,7 @@ char Fl_Text_Buffer::character( int pos ) {
/* /*
** Insert null-terminated string "text" at position "pos" in "buf" ** Insert null-terminated string "text" at position "pos" in "buf"
*/ */
void Fl_Text_Buffer::insert( int pos, const char *text ) { void Fl_Text_Buffer::insert( int pos, const char *s ) {
int nInserted; int nInserted;
/* if pos is not contiguous to existing text, make it */ /* if pos is not contiguous to existing text, make it */
@ -221,7 +221,7 @@ void Fl_Text_Buffer::insert( int pos, const char *text ) {
if ( pos < 0 ) pos = 0; if ( pos < 0 ) pos = 0;
/* insert and redisplay */ /* insert and redisplay */
nInserted = insert_( pos, text ); nInserted = insert_( pos, s );
mCursorPosHint = pos + nInserted; mCursorPosHint = pos + nInserted;
call_modify_callbacks( pos, 0, nInserted, 0, NULL ); call_modify_callbacks( pos, 0, nInserted, 0, NULL );
} }
@ -230,13 +230,13 @@ void Fl_Text_Buffer::insert( int pos, const char *text ) {
** Delete the characters between "start" and "end", and insert the ** Delete the characters between "start" and "end", and insert the
** null-terminated string "text" in their place in in "buf" ** null-terminated string "text" in their place in in "buf"
*/ */
void Fl_Text_Buffer::replace( int start, int end, const char *text ) { void Fl_Text_Buffer::replace( int start, int end, const char *s ) {
const char * deletedText; const char * deletedText;
int nInserted; int nInserted;
deletedText = text_range( start, end ); deletedText = text_range( start, end );
remove_( start, end ); remove_( start, end );
nInserted = insert_( start, text ); nInserted = insert_( start, s );
mCursorPosHint = start + nInserted; mCursorPosHint = start + nInserted;
call_modify_callbacks( start, end - start, nInserted, 0, deletedText ); call_modify_callbacks( start, end - start, nInserted, 0, deletedText );
free( (void *)deletedText ); free( (void *)deletedText );
@ -266,7 +266,7 @@ void Fl_Text_Buffer::remove( int start, int end ) {
void Fl_Text_Buffer::copy( Fl_Text_Buffer *fromBuf, int fromStart, void Fl_Text_Buffer::copy( Fl_Text_Buffer *fromBuf, int fromStart,
int fromEnd, int toPos ) { int fromEnd, int toPos ) {
int length = fromEnd - fromStart; int copiedLength = fromEnd - fromStart;
int part1Length; int part1Length;
/* Prepare the buffer to receive the new text. If the new text fits in /* Prepare the buffer to receive the new text. If the new text fits in
@ -274,27 +274,27 @@ void Fl_Text_Buffer::copy( Fl_Text_Buffer *fromBuf, int fromStart,
the text should be inserted. If the new text is too large, reallocate the text should be inserted. If the new text is too large, reallocate
the buffer with a gap large enough to accomodate the new text and a the buffer with a gap large enough to accomodate the new text and a
gap of PREFERRED_GAP_SIZE */ gap of PREFERRED_GAP_SIZE */
if ( length > mGapEnd - mGapStart ) if ( copiedLength > mGapEnd - mGapStart )
reallocate_with_gap( toPos, length + PREFERRED_GAP_SIZE ); reallocate_with_gap( toPos, copiedLength + PREFERRED_GAP_SIZE );
else if ( toPos != mGapStart ) else if ( toPos != mGapStart )
move_gap( toPos ); move_gap( toPos );
/* Insert the new text (toPos now corresponds to the start of the gap) */ /* Insert the new text (toPos now corresponds to the start of the gap) */
if ( fromEnd <= fromBuf->mGapStart ) { if ( fromEnd <= fromBuf->mGapStart ) {
memcpy( &mBuf[ toPos ], &fromBuf->mBuf[ fromStart ], length ); memcpy( &mBuf[ toPos ], &fromBuf->mBuf[ fromStart ], copiedLength );
} else if ( fromStart >= fromBuf->mGapStart ) { } else if ( fromStart >= fromBuf->mGapStart ) {
memcpy( &mBuf[ toPos ], memcpy( &mBuf[ toPos ],
&fromBuf->mBuf[ fromStart + ( fromBuf->mGapEnd - fromBuf->mGapStart ) ], &fromBuf->mBuf[ fromStart + ( fromBuf->mGapEnd - fromBuf->mGapStart ) ],
length ); copiedLength );
} else { } else {
part1Length = fromBuf->mGapStart - fromStart; part1Length = fromBuf->mGapStart - fromStart;
memcpy( &mBuf[ toPos ], &fromBuf->mBuf[ fromStart ], part1Length ); memcpy( &mBuf[ toPos ], &fromBuf->mBuf[ fromStart ], part1Length );
memcpy( &mBuf[ toPos + part1Length ], &fromBuf->mBuf[ fromBuf->mGapEnd ], memcpy( &mBuf[ toPos + part1Length ], &fromBuf->mBuf[ fromBuf->mGapEnd ],
length - part1Length ); copiedLength - part1Length );
} }
mGapStart += length; mGapStart += copiedLength;
mLength += length; mLength += copiedLength;
update_selections( toPos, 0, length ); update_selections( toPos, 0, copiedLength );
} }
/* /*
@ -305,17 +305,17 @@ void Fl_Text_Buffer::copy( Fl_Text_Buffer *fromBuf, int fromStart,
** number of characters inserted and deleted in the operation (beginning ** number of characters inserted and deleted in the operation (beginning
** at startPos) are returned in these arguments ** at startPos) are returned in these arguments
*/ */
void Fl_Text_Buffer::insert_column( int column, int startPos, const char *text, void Fl_Text_Buffer::insert_column( int column, int startPos, const char *s,
int *charsInserted, int *charsDeleted ) { int *charsInserted, int *charsDeleted ) {
int nLines, lineStartPos, nDeleted, insertDeleted, nInserted; int nLines, lineStartPos, nDeleted, insertDeleted, nInserted;
const char *deletedText; const char *deletedText;
nLines = countLines( text ); nLines = countLines( s );
lineStartPos = line_start( startPos ); lineStartPos = line_start( startPos );
nDeleted = line_end( skip_lines( startPos, nLines ) ) - nDeleted = line_end( skip_lines( startPos, nLines ) ) -
lineStartPos; lineStartPos;
deletedText = text_range( lineStartPos, lineStartPos + nDeleted ); deletedText = text_range( lineStartPos, lineStartPos + nDeleted );
insert_column_( column, lineStartPos, text, &insertDeleted, &nInserted, insert_column_( column, lineStartPos, s, &insertDeleted, &nInserted,
&mCursorPosHint ); &mCursorPosHint );
if ( nDeleted != insertDeleted ) if ( nDeleted != insertDeleted )
fprintf( stderr, "internal consistency check ins1 failed" ); fprintf( stderr, "internal consistency check ins1 failed" );
@ -334,16 +334,16 @@ void Fl_Text_Buffer::insert_column( int column, int startPos, const char *text,
** in the operation (beginning at startPos) are returned in these arguments. ** in the operation (beginning at startPos) are returned in these arguments.
*/ */
void Fl_Text_Buffer::overlay_rectangular( int startPos, int rectStart, void Fl_Text_Buffer::overlay_rectangular( int startPos, int rectStart,
int rectEnd, const char *text, int *charsInserted, int *charsDeleted ) { int rectEnd, const char *s, int *charsInserted, int *charsDeleted ) {
int nLines, lineStartPos, nDeleted, insertDeleted, nInserted; int nLines, lineStartPos, nDeleted, insertDeleted, nInserted;
const char *deletedText; const char *deletedText;
nLines = countLines( text ); nLines = countLines( s );
lineStartPos = line_start( startPos ); lineStartPos = line_start( startPos );
nDeleted = line_end( skip_lines( startPos, nLines ) ) - nDeleted = line_end( skip_lines( startPos, nLines ) ) -
lineStartPos; lineStartPos;
deletedText = text_range( lineStartPos, lineStartPos + nDeleted ); deletedText = text_range( lineStartPos, lineStartPos + nDeleted );
overlay_rectangular_( lineStartPos, rectStart, rectEnd, text, &insertDeleted, overlay_rectangular_( lineStartPos, rectStart, rectEnd, s, &insertDeleted,
&nInserted, &mCursorPosHint ); &nInserted, &mCursorPosHint );
if ( nDeleted != insertDeleted ) if ( nDeleted != insertDeleted )
fprintf( stderr, "internal consistency check ovly1 failed" ); fprintf( stderr, "internal consistency check ovly1 failed" );
@ -361,7 +361,7 @@ void Fl_Text_Buffer::overlay_rectangular( int startPos, int rectStart,
** rectangle, add extra lines to make room for it. ** rectangle, add extra lines to make room for it.
*/ */
void Fl_Text_Buffer::replace_rectangular( int start, int end, int rectStart, void Fl_Text_Buffer::replace_rectangular( int start, int end, int rectStart,
int rectEnd, const char *text ) { int rectEnd, const char *s ) {
char *insPtr; char *insPtr;
const char *deletedText; const char *deletedText;
char *insText = (char *)""; char *insText = (char *)"";
@ -380,12 +380,12 @@ void Fl_Text_Buffer::replace_rectangular( int start, int end, int rectStart,
column. If more lines will be inserted than deleted, insert extra column. If more lines will be inserted than deleted, insert extra
lines in the buffer at the end of the rectangle to make room for the lines in the buffer at the end of the rectangle to make room for the
additional lines in "text" */ additional lines in "text" */
nInsertedLines = countLines( text ); nInsertedLines = countLines( s );
nDeletedLines = count_lines( start, end ); nDeletedLines = count_lines( start, end );
if ( nInsertedLines < nDeletedLines ) { if ( nInsertedLines < nDeletedLines ) {
insLen = strlen( text ); insLen = strlen( s );
insText = (char *)malloc( insLen + nDeletedLines - nInsertedLines + 1 ); insText = (char *)malloc( insLen + nDeletedLines - nInsertedLines + 1 );
strcpy( insText, text ); strcpy( insText, s );
insPtr = insText + insLen; insPtr = insText + insLen;
for ( i = 0; i < nDeletedLines - nInsertedLines; i++ ) for ( i = 0; i < nDeletedLines - nInsertedLines; i++ )
*insPtr++ = '\n'; *insPtr++ = '\n';
@ -543,8 +543,8 @@ void Fl_Text_Buffer::remove_selection() {
remove_selection_( &mPrimary ); remove_selection_( &mPrimary );
} }
void Fl_Text_Buffer::replace_selection( const char *text ) { void Fl_Text_Buffer::replace_selection( const char *s ) {
replace_selection_( &mPrimary, text ); replace_selection_( &mPrimary, s );
} }
void Fl_Text_Buffer::secondary_select( int start, int end ) { void Fl_Text_Buffer::secondary_select( int start, int end ) {
@ -583,8 +583,8 @@ void Fl_Text_Buffer::remove_secondary_selection() {
remove_selection_( &mSecondary ); remove_selection_( &mSecondary );
} }
void Fl_Text_Buffer::replace_secondary_selection( const char *text ) { void Fl_Text_Buffer::replace_secondary_selection( const char *s ) {
replace_selection_( &mSecondary, text ); replace_selection_( &mSecondary, s );
} }
void Fl_Text_Buffer::highlight( int start, int end ) { void Fl_Text_Buffer::highlight( int start, int end ) {
@ -1063,11 +1063,11 @@ int Fl_Text_Buffer::findchars_backward( int startPos, const char *searchChars,
** substitution. Returns 0, if substitution is no longer possible ** substitution. Returns 0, if substitution is no longer possible
** because all non-printable characters are already in use. ** because all non-printable characters are already in use.
*/ */
int Fl_Text_Buffer::substitute_null_characters( char *string, int length ) { int Fl_Text_Buffer::substitute_null_characters( char *string, int len ) {
char histogram[ 256 ]; char histogram[ 256 ];
/* Find out what characters the string contains */ /* Find out what characters the string contains */
histogramCharacters( string, length, histogram, 1 ); histogramCharacters( string, len, histogram, 1 );
/* Does the string contain the null-substitute character? If so, re- /* Does the string contain the null-substitute character? If so, re-
histogram the buffer text to find a character which is ok in both the histogram the buffer text to find a character which is ok in both the
@ -1091,7 +1091,7 @@ int Fl_Text_Buffer::substitute_null_characters( char *string, int length ) {
/* If the string contains null characters, substitute them with the /* If the string contains null characters, substitute them with the
buffer's null substitution character */ buffer's null substitution character */
if ( histogram[ 0 ] != 0 ) if ( histogram[ 0 ] != 0 )
subsChars( string, length, '\0', mNullSubsChar ); subsChars( string, len, '\0', mNullSubsChar );
return 1; return 1;
} }
@ -1163,26 +1163,26 @@ static char chooseNullSubsChar( char hist[ 256 ] ) {
** on to call redisplay). pos must be contiguous with the existing text in ** on to call redisplay). pos must be contiguous with the existing text in
** the buffer (i.e. not past the end). ** the buffer (i.e. not past the end).
*/ */
int Fl_Text_Buffer::insert_( int pos, const char *text ) { int Fl_Text_Buffer::insert_( int pos, const char *s ) {
int length = strlen( text ); int insertedLength = strlen( s );
/* Prepare the buffer to receive the new text. If the new text fits in /* Prepare the buffer to receive the new text. If the new text fits in
the current buffer, just move the gap (if necessary) to where the current buffer, just move the gap (if necessary) to where
the text should be inserted. If the new text is too large, reallocate the text should be inserted. If the new text is too large, reallocate
the buffer with a gap large enough to accomodate the new text and a the buffer with a gap large enough to accomodate the new text and a
gap of PREFERRED_GAP_SIZE */ gap of PREFERRED_GAP_SIZE */
if ( length > mGapEnd - mGapStart ) if ( insertedLength > mGapEnd - mGapStart )
reallocate_with_gap( pos, length + PREFERRED_GAP_SIZE ); reallocate_with_gap( pos, insertedLength + PREFERRED_GAP_SIZE );
else if ( pos != mGapStart ) else if ( pos != mGapStart )
move_gap( pos ); move_gap( pos );
/* Insert the new text (pos now corresponds to the start of the gap) */ /* Insert the new text (pos now corresponds to the start of the gap) */
memcpy( &mBuf[ pos ], text, length ); memcpy( &mBuf[ pos ], s, insertedLength );
mGapStart += length; mGapStart += insertedLength;
mLength += length; mLength += insertedLength;
update_selections( pos, 0, length ); update_selections( pos, 0, insertedLength );
return length; return insertedLength;
} }
/* /*
@ -1304,7 +1304,7 @@ void Fl_Text_Buffer::remove_rectangular_( int start, int end, int rectStart,
int rectEnd, int *replaceLen, int *endPos ) { int rectEnd, int *replaceLen, int *endPos ) {
int nLines, lineStart, lineEnd, len, endOffset; int nLines, lineStart, lineEnd, len, endOffset;
char *outStr, *outPtr, *expText; char *outStr, *outPtr, *expText;
const char *text, *line; const char *s, *line;
/* allocate a buffer for the replacement string large enough to hold /* allocate a buffer for the replacement string large enough to hold
possibly expanded tabs as well as an additional FL_TEXT_MAX_EXP_CHAR_LEN * 2 possibly expanded tabs as well as an additional FL_TEXT_MAX_EXP_CHAR_LEN * 2
@ -1313,9 +1313,9 @@ void Fl_Text_Buffer::remove_rectangular_( int start, int end, int rectStart,
start = line_start( start ); start = line_start( start );
end = line_end( end ); end = line_end( end );
nLines = count_lines( start, end ) + 1; nLines = count_lines( start, end ) + 1;
text = text_range( start, end ); s = text_range( start, end );
expText = expandTabs( text, 0, mTabDist, mNullSubsChar, &len ); expText = expandTabs( s, 0, mTabDist, mNullSubsChar, &len );
free( (void *) text ); free( (void *) s );
free( (void *) expText ); free( (void *) expText );
outStr = (char *)malloc( len + nLines * FL_TEXT_MAX_EXP_CHAR_LEN * 2 + 1 ); outStr = (char *)malloc( len + nLines * FL_TEXT_MAX_EXP_CHAR_LEN * 2 + 1 );
@ -1666,39 +1666,39 @@ static void overlayRectInLine( const char *line, char *insLine, int rectStart,
*outLen = ( outPtr - outStr ) + strlen( linePtr ); *outLen = ( outPtr - outStr ) + strlen( linePtr );
} }
void Fl_Text_Selection::set( int start, int end ) { void Fl_Text_Selection::set( int startpos, int endpos ) {
mSelected = start != end; mSelected = startpos != endpos;
mRectangular = 0; mRectangular = 0;
mStart = min( start, end ); mStart = min( startpos, endpos );
mEnd = max( start, end ); mEnd = max( startpos, endpos );
} }
void Fl_Text_Selection::set_rectangular( int start, int end, void Fl_Text_Selection::set_rectangular( int startpos, int endpos,
int rectStart, int rectEnd ) { int rectStart, int rectEnd ) {
mSelected = rectStart < rectEnd; mSelected = rectStart < rectEnd;
mRectangular = 1; mRectangular = 1;
mStart = start; mStart = startpos;
mEnd = end; mEnd = endpos;
mRectStart = rectStart; mRectStart = rectStart;
mRectEnd = rectEnd; mRectEnd = rectEnd;
} }
int Fl_Text_Selection::position( int *start, int *end ) { int Fl_Text_Selection::position( int *startpos, int *endpos ) {
if ( !mSelected ) if ( !mSelected )
return 0; return 0;
*start = mStart; *startpos = mStart;
*end = mEnd; *endpos = mEnd;
return 1; return 1;
} }
int Fl_Text_Selection::position( int *start, int *end, int Fl_Text_Selection::position( int *startpos, int *endpos,
int *isRect, int *rectStart, int *rectEnd ) { int *isRect, int *rectStart, int *rectEnd ) {
if ( !mSelected ) if ( !mSelected )
return 0; return 0;
*isRect = mRectangular; *isRect = mRectangular;
*start = mStart; *startpos = mStart;
*end = mEnd; *endpos = mEnd;
if ( mRectangular ) { if ( mRectangular ) {
*rectStart = mRectStart; *rectStart = mRectStart;
*rectEnd = mRectEnd; *rectEnd = mRectEnd;
@ -1722,13 +1722,13 @@ int Fl_Text_Selection::includes(int pos, int lineStartPos, int dispIndex) {
char * Fl_Text_Buffer::selection_text_( Fl_Text_Selection *sel ) { char * Fl_Text_Buffer::selection_text_( Fl_Text_Selection *sel ) {
int start, end, isRect, rectStart, rectEnd; int start, end, isRect, rectStart, rectEnd;
char *text; char *s;
/* If there's no selection, return an allocated empty string */ /* If there's no selection, return an allocated empty string */
if ( !sel->position( &start, &end, &isRect, &rectStart, &rectEnd ) ) { if ( !sel->position( &start, &end, &isRect, &rectStart, &rectEnd ) ) {
text = (char *)malloc( 1 ); s = (char *)malloc( 1 );
*text = '\0'; *s = '\0';
return text; return s;
} }
/* If the selection is not rectangular, return the selected range */ /* If the selection is not rectangular, return the selected range */
@ -1750,7 +1750,7 @@ void Fl_Text_Buffer::remove_selection_( Fl_Text_Selection *sel ) {
remove( start, end ); remove( start, end );
} }
void Fl_Text_Buffer::replace_selection_( Fl_Text_Selection *sel, const char *text ) { void Fl_Text_Buffer::replace_selection_( Fl_Text_Selection *sel, const char *s ) {
int start, end, isRect, rectStart, rectEnd; int start, end, isRect, rectStart, rectEnd;
Fl_Text_Selection oldSelection = *sel; Fl_Text_Selection oldSelection = *sel;
@ -1760,9 +1760,9 @@ void Fl_Text_Buffer::replace_selection_( Fl_Text_Selection *sel, const char *tex
/* Do the appropriate type of replace */ /* Do the appropriate type of replace */
if ( isRect ) if ( isRect )
replace_rectangular( start, end, rectStart, rectEnd, text ); replace_rectangular( start, end, rectStart, rectEnd, s );
else else
replace( start, end, text ); replace( start, end, s );
/* Unselect (happens automatically in BufReplace, but BufReplaceRect /* Unselect (happens automatically in BufReplace, but BufReplaceRect
can't detect when the contents of a selection goes away) */ can't detect when the contents of a selection goes away) */
@ -2289,5 +2289,5 @@ Fl_Text_Buffer::outputfile(const char *file, int start, int end, int buflen) {
// //
// End of "$Id: Fl_Text_Buffer.cxx,v 1.9.2.10 2002/08/09 01:09:49 easysw Exp $". // End of "$Id: Fl_Text_Buffer.cxx,v 1.9.2.11 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Text_Display.cxx,v 1.12.2.23 2002/07/30 18:40:50 easysw Exp $" // "$Id: Fl_Text_Display.cxx,v 1.12.2.24 2002/08/09 03:17:30 easysw Exp $"
// //
// Copyright 2001-2002 by Bill Spitzak and others. // Copyright 2001-2002 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under // Original code Copyright Mark Edel. Permission to distribute under
@ -347,20 +347,20 @@ void Fl_Text_Display::draw_text( int left, int top, int width, int height ) {
fl_pop_clip(); fl_pop_clip();
} }
void Fl_Text_Display::redisplay_range(int start, int end) { void Fl_Text_Display::redisplay_range(int startpos, int endpos) {
if (damage_range1_start == -1 && damage_range1_end == -1) { if (damage_range1_start == -1 && damage_range1_end == -1) {
damage_range1_start = start; damage_range1_start = startpos;
damage_range1_end = end; damage_range1_end = endpos;
} else if ((start >= damage_range1_start && start <= damage_range1_end) || } else if ((startpos >= damage_range1_start && startpos <= damage_range1_end) ||
(end >= damage_range1_start && end <= damage_range1_end)) { (endpos >= damage_range1_start && endpos <= damage_range1_end)) {
damage_range1_start = min(damage_range1_start, start); damage_range1_start = min(damage_range1_start, startpos);
damage_range1_end = max(damage_range1_end, end); damage_range1_end = max(damage_range1_end, endpos);
} else if (damage_range2_start == -1 && damage_range2_end == -1) { } else if (damage_range2_start == -1 && damage_range2_end == -1) {
damage_range2_start = start; damage_range2_start = startpos;
damage_range2_end = end; damage_range2_end = endpos;
} else { } else {
damage_range2_start = min(damage_range2_start, start); damage_range2_start = min(damage_range2_start, startpos);
damage_range2_end = max(damage_range2_end, end); damage_range2_end = max(damage_range2_end, endpos);
} }
damage(FL_DAMAGE_SCROLL); damage(FL_DAMAGE_SCROLL);
} }
@ -371,29 +371,28 @@ void Fl_Text_Display::redisplay_range(int start, int end) {
** after pos, including blank lines which are not technically part of ** after pos, including blank lines which are not technically part of
** any range of characters. ** any range of characters.
*/ */
void Fl_Text_Display::draw_range(int start, int end) { void Fl_Text_Display::draw_range(int startpos, int endpos) {
int i, startLine, lastLine, startIndex, endIndex; int i, startLine, lastLine, startIndex, endIndex;
/* If the range is outside of the displayed text, just return */ /* If the range is outside of the displayed text, just return */
if ( end < mFirstChar || ( start > mLastChar && if ( endpos < mFirstChar || ( startpos > mLastChar &&
!empty_vlines() ) ) !empty_vlines() ) ) return;
return;
/* Clean up the starting and ending values */ /* Clean up the starting and ending values */
if ( start < 0 ) start = 0; if ( startpos < 0 ) startpos = 0;
if ( start > mBuffer->length() ) start = mBuffer->length(); if ( startpos > mBuffer->length() ) startpos = mBuffer->length();
if ( end < 0 ) end = 0; if ( endpos < 0 ) endpos = 0;
if ( end > mBuffer->length() ) end = mBuffer->length(); if ( endpos > mBuffer->length() ) endpos = mBuffer->length();
/* Get the starting and ending lines */ /* Get the starting and ending lines */
if ( start < mFirstChar ) if ( startpos < mFirstChar )
start = mFirstChar; startpos = mFirstChar;
if ( !position_to_line( start, &startLine ) ) if ( !position_to_line( startpos, &startLine ) )
startLine = mNVisibleLines - 1; startLine = mNVisibleLines - 1;
if ( end >= mLastChar ) { if ( endpos >= mLastChar ) {
lastLine = mNVisibleLines - 1; lastLine = mNVisibleLines - 1;
} else { } else {
if ( !position_to_line( end, &lastLine ) ) { if ( !position_to_line( endpos, &lastLine ) ) {
/* shouldn't happen */ /* shouldn't happen */
lastLine = mNVisibleLines - 1; lastLine = mNVisibleLines - 1;
} }
@ -401,13 +400,13 @@ void Fl_Text_Display::draw_range(int start, int end) {
/* Get the starting and ending positions within the lines */ /* Get the starting and ending positions within the lines */
startIndex = mLineStarts[ startLine ] == -1 ? 0 : startIndex = mLineStarts[ startLine ] == -1 ? 0 :
start - mLineStarts[ startLine ]; startpos - mLineStarts[ startLine ];
if ( end >= mLastChar ) if ( endpos >= mLastChar )
endIndex = INT_MAX; endIndex = INT_MAX;
else if ( mLineStarts[ lastLine ] == -1 ) else if ( mLineStarts[ lastLine ] == -1 )
endIndex = 0; endIndex = 0;
else else
endIndex = end - mLineStarts[ lastLine ]; endIndex = endpos - mLineStarts[ lastLine ];
/* If the starting and ending lines are the same, redisplay the single /* If the starting and ending lines are the same, redisplay the single
line between "start" and "end" */ line between "start" and "end" */
@ -1045,7 +1044,7 @@ void Fl_Text_Display::draw_string( int style, int X, int Y, int toX,
configured here, on the fly. */ configured here, on the fly. */
Fl_Font font = textfont(); Fl_Font font = textfont();
int size = textsize(); int fsize = textsize();
Fl_Color foreground; Fl_Color foreground;
Fl_Color background; Fl_Color background;
@ -1055,8 +1054,8 @@ void Fl_Text_Display::draw_string( int style, int X, int Y, int toX,
else if (si >= mNStyles) si = mNStyles - 1; else if (si >= mNStyles) si = mNStyles - 1;
styleRec = mStyleTable + si; styleRec = mStyleTable + si;
font = styleRec->font; font = styleRec->font;
size = styleRec->size; fsize = styleRec->size;
if ( style & (HIGHLIGHT_MASK | PRIMARY_MASK) ) { if ( style & (HIGHLIGHT_MASK | PRIMARY_MASK) ) {
background = selection_color(); background = selection_color();
@ -1074,7 +1073,7 @@ void Fl_Text_Display::draw_string( int style, int X, int Y, int toX,
fl_color( background ); fl_color( background );
fl_rectf( X, Y, toX - X, mMaxsize ); fl_rectf( X, Y, toX - X, mMaxsize );
fl_color( foreground ); fl_color( foreground );
fl_font( font, size ); fl_font( font, fsize );
fl_draw( string, nChars, X, Y + mMaxsize - fl_descent()); fl_draw( string, nChars, X, Y + mMaxsize - fl_descent());
// CET - FIXME // CET - FIXME
@ -1240,20 +1239,20 @@ int Fl_Text_Display::position_style( int lineStartPos,
*/ */
int Fl_Text_Display::string_width( const char *string, int length, int style ) { int Fl_Text_Display::string_width( const char *string, int length, int style ) {
Fl_Font font; Fl_Font font;
int size; int fsize;
if ( style & STYLE_LOOKUP_MASK ) { if ( style & STYLE_LOOKUP_MASK ) {
int si = (style & STYLE_LOOKUP_MASK) - 'A'; int si = (style & STYLE_LOOKUP_MASK) - 'A';
if (si < 0) si = 0; if (si < 0) si = 0;
else if (si >= mNStyles) si = mNStyles - 1; else if (si >= mNStyles) si = mNStyles - 1;
font = mStyleTable[si].font; font = mStyleTable[si].font;
size = mStyleTable[si].size; fsize = mStyleTable[si].size;
} else { } else {
font = textfont(); font = textfont();
size = textsize(); fsize = textsize();
} }
fl_font( font, size ); fl_font( font, fsize );
return ( int ) ( fl_width( string, length ) ); return ( int ) ( fl_width( string, length ) );
} }
@ -1712,7 +1711,7 @@ int Fl_Text_Display::vline_length( int visLineNum ) {
** redraw requests resulting from changes to the attached style buffer (which ** redraw requests resulting from changes to the attached style buffer (which
** contains auxiliary information for coloring or styling text). ** contains auxiliary information for coloring or styling text).
*/ */
void Fl_Text_Display::extend_range_for_styles( int *start, int *end ) { void Fl_Text_Display::extend_range_for_styles( int *startpos, int *endpos ) {
Fl_Text_Selection * sel = mStyleBuffer->primary_selection(); Fl_Text_Selection * sel = mStyleBuffer->primary_selection();
int extended = 0; int extended = 0;
@ -1727,12 +1726,12 @@ void Fl_Text_Display::extend_range_for_styles( int *start, int *end ) {
tells the text display's buffer modify callback to extend it's redraw tells the text display's buffer modify callback to extend it's redraw
range to show the text color/and font changes as well. */ range to show the text color/and font changes as well. */
if ( sel->selected() ) { if ( sel->selected() ) {
if ( sel->start() < *start ) { if ( sel->start() < *startpos ) {
*start = sel->start(); *startpos = sel->start();
extended = 1; extended = 1;
} }
if ( sel->end() > *end ) { if ( sel->end() > *endpos ) {
*end = sel->end(); *endpos = sel->end();
extended = 1; extended = 1;
} }
} }
@ -1741,7 +1740,7 @@ void Fl_Text_Display::extend_range_for_styles( int *start, int *end ) {
fonts don't match in spacing, extend redraw area to end of line to fonts don't match in spacing, extend redraw area to end of line to
redraw characters exposed by possible font size changes */ redraw characters exposed by possible font size changes */
if ( mFixedFontWidth == -1 && extended ) if ( mFixedFontWidth == -1 && extended )
* end = mBuffer->line_end( *end ) + 1; *endpos = mBuffer->line_end( *endpos ) + 1;
} }
// The draw() method. It tries to minimize what is draw as much as possible. // The draw() method. It tries to minimize what is draw as much as possible.
@ -1962,5 +1961,5 @@ int Fl_Text_Display::handle(int event) {
// //
// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.23 2002/07/30 18:40:50 easysw Exp $". // End of "$Id: Fl_Text_Display.cxx,v 1.12.2.24 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Text_Editor.cxx,v 1.9.2.6 2002/04/11 11:52:42 easysw Exp $" // "$Id: Fl_Text_Editor.cxx,v 1.9.2.7 2002/08/09 03:17:30 easysw Exp $"
// //
// Copyright 2001-2002 by Bill Spitzak and others. // Copyright 2001-2002 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under // Original code Copyright Mark Edel. Permission to distribute under
@ -113,34 +113,34 @@ void Fl_Text_Editor::add_default_key_bindings(Key_Binding** list) {
Fl_Text_Editor::Key_Func Fl_Text_Editor::Key_Func
Fl_Text_Editor::bound_key_function(int key, int state, Key_Binding* list) { Fl_Text_Editor::bound_key_function(int key, int state, Key_Binding* list) {
Key_Binding* current; Key_Binding* cur;
for (current = list; current; current = current->next) for (cur = list; cur; cur = cur->next)
if (current->key == key) if (cur->key == key)
if (current->state == FL_TEXT_EDITOR_ANY_STATE || current->state == state) if (cur->state == FL_TEXT_EDITOR_ANY_STATE || cur->state == state)
break; break;
if (!current) return 0; if (!cur) return 0;
return current->function; return cur->function;
} }
void void
Fl_Text_Editor::remove_all_key_bindings(Key_Binding** list) { Fl_Text_Editor::remove_all_key_bindings(Key_Binding** list) {
Key_Binding *current, *next; Key_Binding *cur, *next;
for (current = *list; current; current = next) { for (cur = *list; cur; cur = next) {
next = current->next; next = cur->next;
delete current; delete cur;
} }
*list = 0; *list = 0;
} }
void void
Fl_Text_Editor::remove_key_binding(int key, int state, Key_Binding** list) { Fl_Text_Editor::remove_key_binding(int key, int state, Key_Binding** list) {
Key_Binding *current, *last = 0; Key_Binding *cur, *last = 0;
for (current = *list; current; last = current, current = current->next) for (cur = *list; cur; last = cur, cur = cur->next)
if (current->key == key && current->state == state) break; if (cur->key == key && cur->state == state) break;
if (!current) return; if (!cur) return;
if (last) last->next = current->next; if (last) last->next = cur->next;
else *list = current->next; else *list = cur->next;
delete current; delete cur;
} }
void void
@ -439,5 +439,5 @@ int Fl_Text_Editor::handle(int event) {
} }
// //
// End of "$Id: Fl_Text_Editor.cxx,v 1.9.2.6 2002/04/11 11:52:42 easysw Exp $". // End of "$Id: Fl_Text_Editor.cxx,v 1.9.2.7 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Tile.cxx,v 1.5.2.5.2.2 2002/01/01 15:11:31 easysw Exp $" // "$Id: Fl_Tile.cxx,v 1.5.2.5.2.3 2002/08/09 03:17:30 easysw Exp $"
// //
// Tile widget for the Fast Light Tool Kit (FLTK). // Tile widget for the Fast Light Tool Kit (FLTK).
// //
@ -82,15 +82,15 @@ void Fl_Tile::resize(int X,int Y,int W,int H) {
p += 8; p += 8;
for (int i=children(); i--;) { for (int i=children(); i--;) {
Fl_Widget* o = *a++; Fl_Widget* o = *a++;
int X = o->x()+dx; int xx = o->x()+dx;
int R = X+o->w(); int R = xx+o->w();
if (*p++ >= OR) X += dw; else if (X > NR) X = NR; if (*p++ >= OR) xx += dw; else if (xx > NR) xx = NR;
if (*p++ >= OR) R += dw; else if (R > NR) R = NR; if (*p++ >= OR) R += dw; else if (R > NR) R = NR;
int Y = o->y()+dy; int yy = o->y()+dy;
int B = Y+o->h(); int B = yy+o->h();
if (*p++ >= OB) Y += dh; else if (Y > NB) Y = NB; if (*p++ >= OB) yy += dh; else if (yy > NB) yy = NB;
if (*p++ >= OB) B += dh; else if (B > NB) B = NB; if (*p++ >= OB) B += dh; else if (B > NB) B = NB;
o->resize(X,Y,R-X,B-Y); o->redraw(); o->resize(xx,yy,R-xx,B-yy); o->redraw();
} }
} }
@ -196,5 +196,5 @@ int Fl_Tile::handle(int event) {
} }
// //
// End of "$Id: Fl_Tile.cxx,v 1.5.2.5.2.2 2002/01/01 15:11:31 easysw Exp $". // End of "$Id: Fl_Tile.cxx,v 1.5.2.5.2.3 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Tooltip.cxx,v 1.38.2.23 2002/05/15 16:37:06 spitzak Exp $" // "$Id: Fl_Tooltip.cxx,v 1.38.2.24 2002/08/09 03:17:30 easysw Exp $"
// //
// Tooltip source file for the Fast Light Tool Kit (FLTK). // Tooltip source file for the Fast Light Tool Kit (FLTK).
// //
@ -130,11 +130,11 @@ tt_exit(Fl_Widget *w) {
} }
static void static void
tt_enter(Fl_Widget* widget) { tt_enter(Fl_Widget* wp) {
// printf("tt_enter(widget=%p)\n", widget); // printf("tt_enter(widget=%p)\n", widget);
// printf(" window=%p\n", window); // printf(" window=%p\n", window);
// find the enclosing group with a tooltip: // find the enclosing group with a tooltip:
Fl_Widget* w = widget; Fl_Widget* w = wp;
while (w && !w->tooltip()) { while (w && !w->tooltip()) {
//if (w == window) return; // don't do anything if pointed at tooltip //if (w == window) return; // don't do anything if pointed at tooltip
w = w->parent(); w = w->parent();
@ -142,7 +142,7 @@ tt_enter(Fl_Widget* widget) {
if (!w) { if (!w) {
Fl_Tooltip::enter_area(0, 0, 0, 0, 0, 0); Fl_Tooltip::enter_area(0, 0, 0, 0, 0, 0);
} else { } else {
Fl_Tooltip::enter_area(widget,0,0,widget->w(), widget->h(), w->tooltip()); Fl_Tooltip::enter_area(wp,0,0,wp->w(), wp->h(), w->tooltip());
} }
} }
@ -203,5 +203,5 @@ void Fl_Widget::tooltip(const char *tt) {
} }
// //
// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.23 2002/05/15 16:37:06 spitzak Exp $". // End of "$Id: Fl_Tooltip.cxx,v 1.38.2.24 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Valuator.cxx,v 1.5.2.4.2.4 2002/05/28 00:16:08 easysw Exp $" // "$Id: Fl_Valuator.cxx,v 1.5.2.4.2.5 2002/08/09 03:17:30 easysw Exp $"
// //
// Valuator widget for the Fast Light Tool Kit (FLTK). // Valuator widget for the Fast Light Tool Kit (FLTK).
// //
@ -116,12 +116,12 @@ double Fl_Valuator::increment(double v, int n) {
int Fl_Valuator::format(char* buffer) { int Fl_Valuator::format(char* buffer) {
double v = value(); double v = value();
if (!A) return sprintf(buffer, "%g", v); if (!A) return sprintf(buffer, "%g", v);
int i, x; int i, X;
double ba = B / A; double ba = B / A;
for (x = 1, i = 0; x < ba; x *= 10) i++; for (X = 1, i = 0; X < ba; X *= 10) i++;
return sprintf(buffer, "%.*f", i, v); return sprintf(buffer, "%.*f", i, v);
} }
// //
// End of "$Id: Fl_Valuator.cxx,v 1.5.2.4.2.4 2002/05/28 00:16:08 easysw Exp $". // End of "$Id: Fl_Valuator.cxx,v 1.5.2.4.2.5 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Value_Input.cxx,v 1.6.2.5.2.6 2002/05/25 07:18:38 easysw Exp $" // "$Id: Fl_Value_Input.cxx,v 1.6.2.5.2.7 2002/08/09 03:17:30 easysw Exp $"
// //
// Value input widget for the Fast Light Tool Kit (FLTK). // Value input widget for the Fast Light Tool Kit (FLTK).
// //
@ -115,8 +115,8 @@ int Fl_Value_Input::handle(int event) {
} }
} }
Fl_Value_Input::Fl_Value_Input(int x, int y, int w, int h, const char* l) Fl_Value_Input::Fl_Value_Input(int X, int Y, int W, int H, const char* l)
: Fl_Valuator(x, y, w, h, l), input(x, y, w, h, 0) { : Fl_Valuator(X, Y, W, H, l), input(X, Y, W, H, 0) {
soft_ = 0; soft_ = 0;
if (input.parent()) // defeat automatic-add if (input.parent()) // defeat automatic-add
((Fl_Group*)input.parent())->remove(input); ((Fl_Group*)input.parent())->remove(input);
@ -131,5 +131,5 @@ Fl_Value_Input::Fl_Value_Input(int x, int y, int w, int h, const char* l)
} }
// //
// End of "$Id: Fl_Value_Input.cxx,v 1.6.2.5.2.6 2002/05/25 07:18:38 easysw Exp $". // End of "$Id: Fl_Value_Input.cxx,v 1.6.2.5.2.7 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Value_Output.cxx,v 1.6.2.3.2.4 2002/07/20 05:56:44 easysw Exp $" // "$Id: Fl_Value_Output.cxx,v 1.6.2.3.2.5 2002/08/09 03:17:30 easysw Exp $"
// //
// Value output widget for the Fast Light Tool Kit (FLTK). // Value output widget for the Fast Light Tool Kit (FLTK).
// //
@ -86,8 +86,8 @@ int Fl_Value_Output::handle(int event) {
} }
} }
Fl_Value_Output::Fl_Value_Output(int x,int y,int w,int h,const char *l) Fl_Value_Output::Fl_Value_Output(int X, int Y, int W, int H,const char *l)
: Fl_Valuator(x,y,w,h,l) { : Fl_Valuator(X,Y,W,H,l) {
box(FL_NO_BOX); box(FL_NO_BOX);
align(FL_ALIGN_LEFT); align(FL_ALIGN_LEFT);
textfont_ = FL_HELVETICA; textfont_ = FL_HELVETICA;
@ -97,5 +97,5 @@ Fl_Value_Output::Fl_Value_Output(int x,int y,int w,int h,const char *l)
} }
// //
// End of "$Id: Fl_Value_Output.cxx,v 1.6.2.3.2.4 2002/07/20 05:56:44 easysw Exp $". // End of "$Id: Fl_Value_Output.cxx,v 1.6.2.3.2.5 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Value_Slider.cxx,v 1.5.2.4.2.2 2002/01/01 15:11:31 easysw Exp $" // "$Id: Fl_Value_Slider.cxx,v 1.5.2.4.2.3 2002/08/09 03:17:30 easysw Exp $"
// //
// Value slider widget for the Fast Light Tool Kit (FLTK). // Value slider widget for the Fast Light Tool Kit (FLTK).
// //
@ -28,8 +28,8 @@
#include <FL/fl_draw.H> #include <FL/fl_draw.H>
#include <math.h> #include <math.h>
Fl_Value_Slider::Fl_Value_Slider(int x,int y,int w,int h, const char*l) Fl_Value_Slider::Fl_Value_Slider(int X, int Y, int W, int H, const char*l)
: Fl_Slider(x,y,w,h,l) { : Fl_Slider(X,Y,W,H,l) {
step(1,100); step(1,100);
textfont_ = FL_HELVETICA; textfont_ = FL_HELVETICA;
textsize_ = 10; textsize_ = 10;
@ -72,5 +72,5 @@ int Fl_Value_Slider::handle(int event) {
} }
// //
// End of "$Id: Fl_Value_Slider.cxx,v 1.5.2.4.2.2 2002/01/01 15:11:31 easysw Exp $". // End of "$Id: Fl_Value_Slider.cxx,v 1.5.2.4.2.3 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Window.cxx,v 1.6.2.3.2.9 2002/08/05 17:50:25 easysw Exp $" // "$Id: Fl_Window.cxx,v 1.6.2.3.2.10 2002/08/09 03:17:30 easysw Exp $"
// //
// Window widget class for the Fast Light Tool Kit (FLTK). // Window widget class for the Fast Light Tool Kit (FLTK).
// //
@ -117,8 +117,8 @@ void Fl::default_atclose(Fl_Window* window, void* v) {
void (*Fl::atclose)(Fl_Window*, void*) = default_atclose; void (*Fl::atclose)(Fl_Window*, void*) = default_atclose;
void Fl_Window::default_callback(Fl_Window* window, void* v) { void Fl_Window::default_callback(Fl_Window* win, void* v) {
Fl::atclose(window, v); Fl::atclose(win, v);
} }
Fl_Window *Fl_Window::current() { Fl_Window *Fl_Window::current() {
@ -127,5 +127,5 @@ Fl_Window *Fl_Window::current() {
// //
// End of "$Id: Fl_Window.cxx,v 1.6.2.3.2.9 2002/08/05 17:50:25 easysw Exp $". // End of "$Id: Fl_Window.cxx,v 1.6.2.3.2.10 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_XBM_Image.cxx,v 1.1.2.6 2002/06/28 15:23:03 easysw Exp $" // "$Id: Fl_XBM_Image.cxx,v 1.1.2.7 2002/08/09 03:17:30 easysw Exp $"
// //
// Fl_XBM_Image routines. // Fl_XBM_Image routines.
// //
@ -43,7 +43,7 @@
Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) { Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
FILE *f; FILE *f;
uchar *data; uchar *ptr;
if ((f = fopen(name, "rb")) == NULL) return; if ((f = fopen(name, "rb")) == NULL) return;
@ -79,7 +79,7 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
array = new uchar[n]; array = new uchar[n];
// read the data: // read the data:
for (i = 0, data = (uchar *)array; i < n;) { for (i = 0, ptr = (uchar *)array; i < n;) {
if (!fgets(buffer,1024,f)) { if (!fgets(buffer,1024,f)) {
fclose(f); fclose(f);
return; return;
@ -88,7 +88,7 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
while (*a && i<n) { while (*a && i<n) {
int t; int t;
if (sscanf(a," 0x%x",&t)>0) { if (sscanf(a," 0x%x",&t)>0) {
*data++ = t; *ptr++ = t;
i ++; i ++;
} }
while (*a && *a++ != ','); while (*a && *a++ != ',');
@ -100,5 +100,5 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
// //
// End of "$Id: Fl_XBM_Image.cxx,v 1.1.2.6 2002/06/28 15:23:03 easysw Exp $". // End of "$Id: Fl_XBM_Image.cxx,v 1.1.2.7 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_XPM_Image.cxx,v 1.1.2.6 2002/05/25 13:38:24 easysw Exp $" // "$Id: Fl_XPM_Image.cxx,v 1.1.2.7 2002/08/09 03:17:30 easysw Exp $"
// //
// Fl_XPM_Image routines. // Fl_XPM_Image routines.
// //
@ -77,9 +77,9 @@ Fl_XPM_Image::Fl_XPM_Image(const char *name) : Fl_Pixmap((char *const*)0) {
q++; q++;
int n = 0; int n = 0;
for (int x = 0; x < 3; x++) { for (int x = 0; x < 3; x++) {
int d = hexdigit(*q); int xd = hexdigit(*q);
if (d > 15) break; if (xd > 15) break;
n = (n<<4)+d; n = (n<<4)+xd;
q++; q++;
} }
*myp++ = n; *myp++ = n;
@ -89,9 +89,9 @@ Fl_XPM_Image::Fl_XPM_Image(const char *name) : Fl_Pixmap((char *const*)0) {
if (c>='0' && c<='7') { if (c>='0' && c<='7') {
c -= '0'; c -= '0';
for (int x=0; x<2; x++) { for (int x=0; x<2; x++) {
int d = hexdigit(*q); int xd = hexdigit(*q);
if (d>7) break; if (xd>7) break;
c = (c<<3)+d; c = (c<<3)+xd;
q++; q++;
} }
} }
@ -125,5 +125,5 @@ Fl_XPM_Image::Fl_XPM_Image(const char *name) : Fl_Pixmap((char *const*)0) {
// //
// End of "$Id: Fl_XPM_Image.cxx,v 1.1.2.6 2002/05/25 13:38:24 easysw Exp $". // End of "$Id: Fl_XPM_Image.cxx,v 1.1.2.7 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_arg.cxx,v 1.5.2.8.2.11 2002/04/14 12:51:56 easysw Exp $" // "$Id: Fl_arg.cxx,v 1.5.2.8.2.12 2002/08/09 03:17:30 easysw Exp $"
// //
// Optional argument initialization code for the Fast Light Tool Kit (FLTK). // Optional argument initialization code for the Fast Light Tool Kit (FLTK).
// //
@ -47,10 +47,10 @@ int XParseGeometry(const char*, int*, int*, unsigned int*, unsigned int*);
# define YNegative 0x0020 # define YNegative 0x0020
#endif #endif
static int match(const char *a, const char *match, int atleast = 1) { static int fl_match(const char *a, const char *s, int atleast = 1) {
const char *b = match; const char *b = s;
while (*a && (*a == *b || tolower(*a) == *b)) {a++; b++;} while (*a && (*a == *b || tolower(*a) == *b)) {a++; b++;}
return !*a && b >= match+atleast; return !*a && b >= s+atleast;
} }
// flags set by previously parsed arguments: // flags set by previously parsed arguments:
@ -80,31 +80,31 @@ int Fl::arg(int argc, char **argv, int &i) {
if (s[0] != '-' || s[1] == '-' || !s[1]) {return_i = 1; return 0;} if (s[0] != '-' || s[1] == '-' || !s[1]) {return_i = 1; return 0;}
s++; // point after the dash s++; // point after the dash
if (match(s, "iconic")) { if (fl_match(s, "iconic")) {
fl_show_iconic = 1; fl_show_iconic = 1;
i++; i++;
return 1; return 1;
} else if (match(s, "kbd")) { } else if (fl_match(s, "kbd")) {
Fl::visible_focus(1); Fl::visible_focus(1);
i++; i++;
return 1; return 1;
} else if (match(s, "nokbd", 3)) { } else if (fl_match(s, "nokbd", 3)) {
Fl::visible_focus(0); Fl::visible_focus(0);
i++; i++;
return 1; return 1;
} else if (match(s, "dnd", 2)) { } else if (fl_match(s, "dnd", 2)) {
Fl::dnd_text_ops(1); Fl::dnd_text_ops(1);
i++; i++;
return 1; return 1;
} else if (match(s, "nodnd", 3)) { } else if (fl_match(s, "nodnd", 3)) {
Fl::dnd_text_ops(0); Fl::dnd_text_ops(0);
i++; i++;
return 1; return 1;
} else if (match(s, "tooltips", 2)) { } else if (fl_match(s, "tooltips", 2)) {
Fl_Tooltip::enable(); Fl_Tooltip::enable();
i++; i++;
return 1; return 1;
} else if (match(s, "notooltips", 3)) { } else if (fl_match(s, "notooltips", 3)) {
Fl_Tooltip::disable(); Fl_Tooltip::disable();
i++; i++;
return 1; return 1;
@ -114,7 +114,7 @@ int Fl::arg(int argc, char **argv, int &i) {
if (i >= argc-1 || !v) if (i >= argc-1 || !v)
return 0; // all the rest need an argument, so if missing it is an error return 0; // all the rest need an argument, so if missing it is an error
if (match(s, "geometry")) { if (fl_match(s, "geometry")) {
int flags, gx, gy; unsigned int gw, gh; int flags, gx, gy; unsigned int gw, gh;
flags = XParseGeometry(v, &gx, &gy, &gw, &gh); flags = XParseGeometry(v, &gx, &gy, &gw, &gh);
@ -122,26 +122,26 @@ int Fl::arg(int argc, char **argv, int &i) {
geometry = v; geometry = v;
#if !defined(WIN32) && !defined(__APPLE__) #if !defined(WIN32) && !defined(__APPLE__)
} else if (match(s, "display", 2)) { } else if (fl_match(s, "display", 2)) {
Fl::display(v); Fl::display(v);
#endif #endif
} else if (match(s, "title", 2)) { } else if (fl_match(s, "title", 2)) {
title = v; title = v;
} else if (match(s, "name", 2)) { } else if (fl_match(s, "name", 2)) {
name = v; name = v;
} else if (match(s, "bg2", 3) || match(s, "background2", 11)) { } else if (fl_match(s, "bg2", 3) || fl_match(s, "background2", 11)) {
fl_bg2 = v; fl_bg2 = v;
} else if (match(s, "bg", 2) || match(s, "background", 10)) { } else if (fl_match(s, "bg", 2) || fl_match(s, "background", 10)) {
fl_bg = v; fl_bg = v;
} else if (match(s, "fg", 2) || match(s, "foreground", 10)) { } else if (fl_match(s, "fg", 2) || fl_match(s, "foreground", 10)) {
fl_fg = v; fl_fg = v;
} else if (match(s, "scheme", 1)) { } else if (fl_match(s, "scheme", 1)) {
Fl::scheme(v); Fl::scheme(v);
} else return 0; // unrecognized } else return 0; // unrecognized
@ -203,17 +203,17 @@ void Fl_Window::show(int argc, char **argv) {
static char beenhere; static char beenhere;
if (!beenhere) { if (!beenhere) {
if (geometry) { if (geometry) {
int flags = 0, gx = x(), gy = y(); unsigned int gw = w(), gh = h(); int fl = 0, gx = x(), gy = y(); unsigned int gw = w(), gh = h();
flags = XParseGeometry(geometry, &gx, &gy, &gw, &gh); fl = XParseGeometry(geometry, &gx, &gy, &gw, &gh);
if (flags & XNegative) gx = Fl::w()-w()+gx; if (fl & XNegative) gx = Fl::w()-w()+gx;
if (flags & YNegative) gy = Fl::h()-h()+gy; if (fl & YNegative) gy = Fl::h()-h()+gy;
// int mw,mh; minsize(mw,mh); // int mw,mh; minsize(mw,mh);
// if (mw > gw) gw = mw; // if (mw > gw) gw = mw;
// if (mh > gh) gh = mh; // if (mh > gh) gh = mh;
Fl_Widget *r = resizable(); Fl_Widget *r = resizable();
if (!r) resizable(this); if (!r) resizable(this);
// for WIN32 we assumme window is not mapped yet: // for WIN32 we assumme window is not mapped yet:
if (flags & (XValue | YValue)) if (fl & (XValue | YValue))
x(-1), resize(gx,gy,gw,gh); x(-1), resize(gx,gy,gw,gh);
else else
size(gw,gh); size(gw,gh);
@ -412,5 +412,5 @@ int XParseGeometry(const char* string, int* x, int* y,
#endif // ifdef WIN32 #endif // ifdef WIN32
// //
// End of "$Id: Fl_arg.cxx,v 1.5.2.8.2.11 2002/04/14 12:51:56 easysw Exp $". // End of "$Id: Fl_arg.cxx,v 1.5.2.8.2.12 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.12 2002/07/17 15:23:58 easysw Exp $" // "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.13 2002/08/09 03:17:30 easysw Exp $"
// //
// System color support for the Fast Light Tool Kit (FLTK). // System color support for the Fast Light Tool Kit (FLTK).
// //
@ -245,7 +245,7 @@ int Fl::scheme(const char *s) {
} }
int Fl::reload_scheme() { int Fl::reload_scheme() {
Fl_Window *w; Fl_Window *win;
get_system_colors(); get_system_colors();
@ -270,7 +270,7 @@ int Fl::reload_scheme() {
tile.mask = 0; tile.mask = 0;
} }
if (!scheme_bg_) scheme_bg_ = new Fl_Tiled_Image(&tile, Fl::w(), Fl::h()); if (!scheme_bg_) scheme_bg_ = new Fl_Tiled_Image(&tile, w(), h());
// Load plastic buttons, etc... // Load plastic buttons, etc...
set_boxtype(FL_UP_FRAME, FL_PLASTIC_UP_FRAME); set_boxtype(FL_UP_FRAME, FL_PLASTIC_UP_FRAME);
@ -305,11 +305,11 @@ int Fl::reload_scheme() {
} }
// Set (or clear) the background tile for all windows... // Set (or clear) the background tile for all windows...
for (w = first_window(); w; w = next_window(w)) { for (win = first_window(); win; win = next_window(win)) {
w->labeltype(scheme_bg_ ? FL_NORMAL_LABEL : FL_NO_LABEL); win->labeltype(scheme_bg_ ? FL_NORMAL_LABEL : FL_NO_LABEL);
w->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_CLIP); win->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
w->image(scheme_bg_); win->image(scheme_bg_);
w->redraw(); win->redraw();
} }
return 1; return 1;
@ -317,5 +317,5 @@ int Fl::reload_scheme() {
// //
// End of "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.12 2002/07/17 15:23:58 easysw Exp $". // End of "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.13 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_grab.cxx,v 1.1.2.4.2.6 2002/01/03 08:08:21 matthiaswm Exp $" // "$Id: Fl_grab.cxx,v 1.1.2.4.2.7 2002/08/09 03:17:30 easysw Exp $"
// //
// Grab/release code for the Fast Light Tool Kit (FLTK). // Grab/release code for the Fast Light Tool Kit (FLTK).
// //
@ -49,8 +49,8 @@ extern HWND fl_capture;
extern WindowRef fl_capture; extern WindowRef fl_capture;
#endif #endif
void Fl::grab(Fl_Window* w) { void Fl::grab(Fl_Window* win) {
if (w) { if (win) {
if (!grab_) { if (!grab_) {
#ifdef WIN32 #ifdef WIN32
SetActiveWindow(fl_capture = fl_xid(first_window())); SetActiveWindow(fl_capture = fl_xid(first_window()));
@ -77,7 +77,7 @@ void Fl::grab(Fl_Window* w) {
fl_event_time); fl_event_time);
#endif #endif
} }
grab_ = w; grab_ = win;
} else { } else {
if (grab_) { if (grab_) {
#ifdef WIN32 #ifdef WIN32
@ -100,5 +100,5 @@ void Fl::grab(Fl_Window* w) {
} }
// //
// End of "$Id: Fl_grab.cxx,v 1.1.2.4.2.6 2002/01/03 08:08:21 matthiaswm Exp $". // End of "$Id: Fl_grab.cxx,v 1.1.2.4.2.7 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_x.cxx,v 1.24.2.24.2.22 2002/06/24 02:04:54 easysw Exp $" // "$Id: Fl_x.cxx,v 1.24.2.24.2.23 2002/08/09 03:17:30 easysw Exp $"
// //
// X specific code for the Fast Light Tool Kit (FLTK). // X specific code for the Fast Light Tool Kit (FLTK).
// //
@ -117,8 +117,8 @@ void Fl::add_fd(int n, int events, void (*cb)(int, void*), void *v) {
# endif # endif
} }
void Fl::add_fd(int fd, void (*cb)(int, void*), void* v) { void Fl::add_fd(int n, void (*cb)(int, void*), void* v) {
Fl::add_fd(fd, POLLIN, cb, v); Fl::add_fd(n, POLLIN, cb, v);
} }
void Fl::remove_fd(int n, int events) { void Fl::remove_fd(int n, int events) {
@ -368,13 +368,13 @@ int Fl::w() {
return DisplayWidth(fl_display,fl_screen); return DisplayWidth(fl_display,fl_screen);
} }
void Fl::get_mouse(int &x, int &y) { void Fl::get_mouse(int &xx, int &yy) {
fl_open_display(); fl_open_display();
Window root = RootWindow(fl_display, fl_screen); Window root = RootWindow(fl_display, fl_screen);
Window c; int mx,my,cx,cy; unsigned int mask; Window c; int mx,my,cx,cy; unsigned int mask;
XQueryPointer(fl_display,root,&root,&c,&mx,&my,&cx,&cy,&mask); XQueryPointer(fl_display,root,&root,&c,&mx,&my,&cx,&cy,&mask);
x = mx; xx = mx;
y = my; yy = my;
} }
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
@ -516,7 +516,7 @@ int fl_handle(const XEvent& xevent)
if (!fl_selection_requestor) return 0; if (!fl_selection_requestor) return 0;
static unsigned char* buffer; static unsigned char* buffer;
if (buffer) {XFree(buffer); buffer = 0;} if (buffer) {XFree(buffer); buffer = 0;}
long read = 0; long bytesread = 0;
if (fl_xevent->xselection.property) for (;;) { if (fl_xevent->xselection.property) for (;;) {
// The Xdnd code pastes 64K chunks together, possibly to avoid // The Xdnd code pastes 64K chunks together, possibly to avoid
// bugs in X servers, or maybe to avoid an extra round-trip to // bugs in X servers, or maybe to avoid an extra round-trip to
@ -526,21 +526,21 @@ int fl_handle(const XEvent& xevent)
if (XGetWindowProperty(fl_display, if (XGetWindowProperty(fl_display,
fl_xevent->xselection.requestor, fl_xevent->xselection.requestor,
fl_xevent->xselection.property, fl_xevent->xselection.property,
read/4, 65536, 1, 0, bytesread/4, 65536, 1, 0,
&actual, &format, &count, &remaining, &actual, &format, &count, &remaining,
&portion)) break; // quit on error &portion)) break; // quit on error
if (read) { // append to the accumulated buffer if (bytesread) { // append to the accumulated buffer
buffer = (unsigned char*)realloc(buffer, read+count*format/8+remaining); buffer = (unsigned char*)realloc(buffer, bytesread+count*format/8+remaining);
memcpy(buffer+read, portion, count*format/8); memcpy(buffer+bytesread, portion, count*format/8);
XFree(portion); XFree(portion);
} else { // Use the first section without moving the memory: } else { // Use the first section without moving the memory:
buffer = portion; buffer = portion;
} }
read += count*format/8; bytesread += count*format/8;
if (!remaining) break; if (!remaining) break;
} }
Fl::e_text = (char*)buffer; Fl::e_text = (char*)buffer;
Fl::e_length = read; Fl::e_length = bytesread;
fl_selection_requestor->handle(FL_PASTE); fl_selection_requestor->handle(FL_PASTE);
// Detect if this paste is due to Xdnd by the property name (I use // Detect if this paste is due to Xdnd by the property name (I use
// XA_SECONDARY for that) and send an XdndFinished message. It is not // XA_SECONDARY for that) and send an XdndFinished message. It is not
@ -914,17 +914,17 @@ void Fl_Window::resize(int X,int Y,int W,int H) {
void fl_fix_focus(); // in Fl.cxx void fl_fix_focus(); // in Fl.cxx
Fl_X* Fl_X::set_xid(Fl_Window* w, Window xid) { Fl_X* Fl_X::set_xid(Fl_Window* win, Window winxid) {
Fl_X* x = new Fl_X; Fl_X* xp = new Fl_X;
x->xid = xid; xp->xid = winxid;
x->other_xid = 0; xp->other_xid = 0;
x->setwindow(w); xp->setwindow(win);
x->next = Fl_X::first; xp->next = Fl_X::first;
x->region = 0; xp->region = 0;
x->wait_for_expose = 1; xp->wait_for_expose = 1;
Fl_X::first = x; Fl_X::first = xp;
if (w->modal()) {Fl::modal_ = w; fl_fix_focus();} if (win->modal()) {Fl::modal_ = win; fl_fix_focus();}
return x; return xp;
} }
// More commonly a subclass calls this, because it hides the really // More commonly a subclass calls this, because it hides the really
@ -945,25 +945,25 @@ ExposureMask|StructureNotifyMask
|EnterWindowMask|LeaveWindowMask |EnterWindowMask|LeaveWindowMask
|PointerMotionMask; |PointerMotionMask;
void Fl_X::make_xid(Fl_Window* w, XVisualInfo *visual, Colormap colormap) void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap)
{ {
Fl_Group::current(0); // get rid of very common user bug: forgot end() Fl_Group::current(0); // get rid of very common user bug: forgot end()
int X = w->x(); int X = win->x();
int Y = w->y(); int Y = win->y();
int W = w->w(); int W = win->w();
if (W <= 0) W = 1; // X don't like zero... if (W <= 0) W = 1; // X don't like zero...
int H = w->h(); int H = win->h();
if (H <= 0) H = 1; // X don't like zero... if (H <= 0) H = 1; // X don't like zero...
if (!w->parent() && !Fl::grab()) { if (!win->parent() && !Fl::grab()) {
// center windows in case window manager does not do anything: // center windows in case window manager does not do anything:
if (!(w->flags() & Fl_Window::FL_FORCE_POSITION)) { if (!(win->flags() & Fl_Window::FL_FORCE_POSITION)) {
w->x(X = (Fl::w()-W)/2); win->x(X = (Fl::w()-W)/2);
w->y(Y = (Fl::h()-H)/2); win->y(Y = (Fl::h()-H)/2);
} }
// force the window to be on-screen. Usually the X window manager // force the window to be on-screen. Usually the X window manager
// does this, but a few don't, so we do it here for consistency: // does this, but a few don't, so we do it here for consistency:
if (w->border()) { if (win->border()) {
// ensure border is on screen: // ensure border is on screen:
// (assumme extremely minimal dimensions for this border) // (assumme extremely minimal dimensions for this border)
const int top = 20; const int top = 20;
@ -982,23 +982,23 @@ void Fl_X::make_xid(Fl_Window* w, XVisualInfo *visual, Colormap colormap)
if (Y < 0) Y = 0; if (Y < 0) Y = 0;
} }
ulong root = w->parent() ? ulong root = win->parent() ?
fl_xid(w->window()) : RootWindow(fl_display, fl_screen); fl_xid(win->window()) : RootWindow(fl_display, fl_screen);
XSetWindowAttributes attr; XSetWindowAttributes attr;
int mask = CWBorderPixel|CWColormap|CWEventMask|CWBitGravity; int mask = CWBorderPixel|CWColormap|CWEventMask|CWBitGravity;
attr.event_mask = w->parent() ? childEventMask : XEventMask; attr.event_mask = win->parent() ? childEventMask : XEventMask;
attr.colormap = colormap; attr.colormap = colormap;
attr.border_pixel = 0; attr.border_pixel = 0;
attr.bit_gravity = 0; // StaticGravity; attr.bit_gravity = 0; // StaticGravity;
if (w->override()) { if (win->override()) {
attr.override_redirect = 1; attr.override_redirect = 1;
attr.save_under = 1; attr.save_under = 1;
mask |= CWOverrideRedirect | CWSaveUnder; mask |= CWOverrideRedirect | CWSaveUnder;
} else attr.override_redirect = 0; } else attr.override_redirect = 0;
if (Fl::grab()) { if (Fl::grab()) {
attr.save_under = 1; mask |= CWSaveUnder; attr.save_under = 1; mask |= CWSaveUnder;
if (!w->border()) {attr.override_redirect = 1; mask |= CWOverrideRedirect;} if (!win->border()) {attr.override_redirect = 1; mask |= CWOverrideRedirect;}
} }
if (fl_background_pixel >= 0) { if (fl_background_pixel >= 0) {
attr.background_pixel = fl_background_pixel; attr.background_pixel = fl_background_pixel;
@ -1006,54 +1006,54 @@ void Fl_X::make_xid(Fl_Window* w, XVisualInfo *visual, Colormap colormap)
mask |= CWBackPixel; mask |= CWBackPixel;
} }
Fl_X* x = Fl_X* xp =
set_xid(w, XCreateWindow(fl_display, set_xid(win, XCreateWindow(fl_display,
root, root,
X, Y, W, H, X, Y, W, H,
0, // borderwidth 0, // borderwidth
visual->depth, visual->depth,
InputOutput, InputOutput,
visual->visual, visual->visual,
mask, &attr)); mask, &attr));
int showit = 1; int showit = 1;
if (!w->parent() && !attr.override_redirect) { if (!win->parent() && !attr.override_redirect) {
// Communicate all kinds 'o junk to the X Window Manager: // Communicate all kinds 'o junk to the X Window Manager:
w->label(w->label(), w->iconlabel()); win->label(win->label(), win->iconlabel());
XChangeProperty(fl_display, x->xid, WM_PROTOCOLS, XChangeProperty(fl_display, xp->xid, WM_PROTOCOLS,
XA_ATOM, 32, 0, (uchar*)&WM_DELETE_WINDOW, 1); XA_ATOM, 32, 0, (uchar*)&WM_DELETE_WINDOW, 1);
// send size limits and border: // send size limits and border:
x->sendxjunk(); xp->sendxjunk();
// set the class property, which controls the icon used: // set the class property, which controls the icon used:
if (w->xclass()) { if (win->xclass()) {
char buffer[1024]; char buffer[1024];
char *p; const char *q; char *p; const char *q;
// truncate on any punctuation, because they break XResource lookup: // truncate on any punctuation, because they break XResource lookup:
for (p = buffer, q = w->xclass(); isalnum(*q)||(*q&128);) *p++ = *q++; for (p = buffer, q = win->xclass(); isalnum(*q)||(*q&128);) *p++ = *q++;
*p++ = 0; *p++ = 0;
// create the capitalized version: // create the capitalized version:
q = buffer; q = buffer;
*p = toupper(*q++); if (*p++ == 'X') *p++ = toupper(*q++); *p = toupper(*q++); if (*p++ == 'X') *p++ = toupper(*q++);
while ((*p++ = *q++)); while ((*p++ = *q++));
XChangeProperty(fl_display, x->xid, XA_WM_CLASS, XA_STRING, 8, 0, XChangeProperty(fl_display, xp->xid, XA_WM_CLASS, XA_STRING, 8, 0,
(unsigned char *)buffer, p-buffer-1); (unsigned char *)buffer, p-buffer-1);
} }
if (w->non_modal() && x->next && !fl_disable_transient_for) { if (win->non_modal() && xp->next && !fl_disable_transient_for) {
// find some other window to be "transient for": // find some other window to be "transient for":
Fl_Window* w = x->next->w; Fl_Window* wp = xp->next->w;
while (w->parent()) w = w->window(); while (wp->parent()) wp = wp->window();
XSetTransientForHint(fl_display, x->xid, fl_xid(w)); XSetTransientForHint(fl_display, xp->xid, fl_xid(wp));
if (!w->visible()) showit = 0; // guess that wm will not show it if (!wp->visible()) showit = 0; // guess that wm will not show it
} }
// Make it receptive to DnD: // Make it receptive to DnD:
int version = 4; int version = 4;
XChangeProperty(fl_display, x->xid, fl_XdndAware, XChangeProperty(fl_display, xp->xid, fl_XdndAware,
XA_ATOM, sizeof(int)*8, 0, (unsigned char*)&version, 1); XA_ATOM, sizeof(int)*8, 0, (unsigned char*)&version, 1);
XWMHints hints; XWMHints hints;
@ -1065,18 +1065,18 @@ void Fl_X::make_xid(Fl_Window* w, XVisualInfo *visual, Colormap colormap)
fl_show_iconic = 0; fl_show_iconic = 0;
showit = 0; showit = 0;
} }
if (w->icon()) { if (win->icon()) {
hints.icon_pixmap = (Pixmap)w->icon(); hints.icon_pixmap = (Pixmap)win->icon();
hints.flags |= IconPixmapHint; hints.flags |= IconPixmapHint;
} }
XSetWMHints(fl_display, x->xid, &hints); XSetWMHints(fl_display, xp->xid, &hints);
} }
XMapWindow(fl_display, x->xid); XMapWindow(fl_display, xp->xid);
if (showit) { if (showit) {
w->set_visible(); win->set_visible();
w->handle(FL_SHOW); // get child windows to appear win->handle(FL_SHOW); // get child windows to appear
w->redraw(); win->redraw();
} }
} }
@ -1233,5 +1233,5 @@ void Fl_Window::make_current() {
#endif #endif
// //
// End of "$Id: Fl_x.cxx,v 1.24.2.24.2.22 2002/06/24 02:04:54 easysw Exp $". // End of "$Id: Fl_x.cxx,v 1.24.2.24.2.23 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: fl_boxtype.cxx,v 1.8.2.4.2.9 2002/07/30 14:57:02 easysw Exp $" // "$Id: fl_boxtype.cxx,v 1.8.2.4.2.10 2002/08/09 03:17:30 easysw Exp $"
// //
// Box drawing code for the Fast Light Tool Kit (FLTK). // Box drawing code for the Fast Light Tool Kit (FLTK).
// //
@ -287,13 +287,13 @@ void Fl_Widget::draw_box(Fl_Boxtype b, Fl_Color c) const {
draw_box(b, x_, y_, w_, h_, c); draw_box(b, x_, y_, w_, h_, c);
} }
void Fl_Widget::draw_box(Fl_Boxtype b, int x, int y, int w, int h, Fl_Color c) void Fl_Widget::draw_box(Fl_Boxtype b, int X, int Y, int W, int H, Fl_Color c)
const { const {
draw_it_active = active_r(); draw_it_active = active_r();
fl_box_table[b].f(x, y, w, h, c); fl_box_table[b].f(X, Y, W, H, c);
draw_it_active = 1; draw_it_active = 1;
} }
// //
// End of "$Id: fl_boxtype.cxx,v 1.8.2.4.2.9 2002/07/30 14:57:02 easysw Exp $". // End of "$Id: fl_boxtype.cxx,v 1.8.2.4.2.10 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: fl_cursor.cxx,v 1.6.2.6.2.6 2002/08/05 17:50:25 easysw Exp $" // "$Id: fl_cursor.cxx,v 1.6.2.6.2.7 2002/08/09 03:17:30 easysw Exp $"
// //
// Mouse cursor support for the Fast Light Tool Kit (FLTK). // Mouse cursor support for the Fast Light Tool Kit (FLTK).
// //
@ -265,7 +265,7 @@ static struct TableEntry {
void Fl_Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) { void Fl_Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) {
if (!shown()) return; if (!shown()) return;
Cursor cursor; Cursor xc;
int deleteit = 0; int deleteit = 0;
if (c == FL_CURSOR_DEFAULT) { if (c == FL_CURSOR_DEFAULT) {
c = cursor_default; c = cursor_default;
@ -274,7 +274,7 @@ void Fl_Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) {
} }
if (!c) { if (!c) {
cursor = None; xc = None;
} else { } else {
if (c >= FL_CURSOR_NS) { if (c >= FL_CURSOR_NS) {
TableEntry *q = (c > FL_CURSOR_NESW) ? table+4 : table+(c-FL_CURSOR_NS); TableEntry *q = (c > FL_CURSOR_NESW) ? table+4 : table+(c-FL_CURSOR_NS);
@ -291,9 +291,9 @@ void Fl_Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) {
XFreePixmap(fl_display, m); XFreePixmap(fl_display, m);
XFreePixmap(fl_display, p); XFreePixmap(fl_display, p);
} }
cursor = q->cursor; xc = q->cursor;
} else { } else {
cursor = XCreateFontCursor(fl_display, (c-1)*2); xc = XCreateFontCursor(fl_display, (c-1)*2);
deleteit = 1; deleteit = 1;
} }
XColor fgc; XColor fgc;
@ -303,14 +303,14 @@ void Fl_Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) {
XColor bgc; XColor bgc;
Fl::get_color(bg,r,g,b); Fl::get_color(bg,r,g,b);
bgc.red = r<<8; bgc.green = g<<8; bgc.blue = b<<8; bgc.red = r<<8; bgc.green = g<<8; bgc.blue = b<<8;
XRecolorCursor(fl_display, cursor, &fgc, &bgc); XRecolorCursor(fl_display, xc, &fgc, &bgc);
} }
XDefineCursor(fl_display, fl_xid(this), cursor); XDefineCursor(fl_display, fl_xid(this), xc);
if (deleteit) XFreeCursor(fl_display, cursor); if (deleteit) XFreeCursor(fl_display, xc);
} }
#endif #endif
// //
// End of "$Id: fl_cursor.cxx,v 1.6.2.6.2.6 2002/08/05 17:50:25 easysw Exp $". // End of "$Id: fl_cursor.cxx,v 1.6.2.6.2.7 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: fl_curve.cxx,v 1.4.2.4.2.3 2002/01/01 15:11:32 easysw Exp $" // "$Id: fl_curve.cxx,v 1.4.2.4.2.4 2002/08/09 03:17:30 easysw Exp $"
// //
// Bezier curve functions for the Fast Light Tool Kit (FLTK). // Bezier curve functions for the Fast Light Tool Kit (FLTK).
// //
@ -44,15 +44,15 @@ void fl_curve(double X0, double Y0,
fl_transformed_vertex(x,y); fl_transformed_vertex(x,y);
double x1 = fl_transform_x(X1,Y1); double x1 = fl_transform_x(X1,Y1);
double y1 = fl_transform_y(X1,Y1); double yy1 = fl_transform_y(X1,Y1);
double x2 = fl_transform_x(X2,Y2); double x2 = fl_transform_x(X2,Y2);
double y2 = fl_transform_y(X2,Y2); double y2 = fl_transform_y(X2,Y2);
double x3 = fl_transform_x(X3,Y3); double x3 = fl_transform_x(X3,Y3);
double y3 = fl_transform_y(X3,Y3); double y3 = fl_transform_y(X3,Y3);
// find the area: // find the area:
double a = fabs((x-x2)*(y3-y1)-(y-y2)*(x3-x1)); double a = fabs((x-x2)*(y3-yy1)-(y-y2)*(x3-x1));
double b = fabs((x-x3)*(y2-y1)-(y-y3)*(x2-x1)); double b = fabs((x-x3)*(y2-yy1)-(y-y3)*(x2-x1));
if (b > a) a = b; if (b > a) a = b;
// use that to guess at the number of segments: // use that to guess at the number of segments:
@ -72,9 +72,9 @@ void fl_curve(double X0, double Y0,
double dx2 = dx3 + 2*xb*e*e; double dx2 = dx3 + 2*xb*e*e;
// calculate the coefficients of 3rd order equation: // calculate the coefficients of 3rd order equation:
double ya = (y3-3*y2+3*y1-y); double ya = (y3-3*y2+3*yy1-y);
double yb = 3*(y2-2*y1+y); double yb = 3*(y2-2*yy1+y);
double yc = 3*(y1-y); double yc = 3*(yy1-y);
// calculate the forward differences: // calculate the forward differences:
double dy1 = ((ya*e+yb)*e+yc)*e; double dy1 = ((ya*e+yb)*e+yc)*e;
double dy3 = 6*ya*e*e*e; double dy3 = 6*ya*e*e*e;
@ -100,5 +100,5 @@ void fl_curve(double X0, double Y0,
} }
// //
// End of "$Id: fl_curve.cxx,v 1.4.2.4.2.3 2002/01/01 15:11:32 easysw Exp $". // End of "$Id: fl_curve.cxx,v 1.4.2.4.2.4 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: fl_dnd_x.cxx,v 1.5.2.4 2002/04/10 19:22:45 easysw Exp $" // "$Id: fl_dnd_x.cxx,v 1.5.2.5 2002/08/09 03:17:30 easysw Exp $"
// //
// Drag & Drop code for the Fast Light Tool Kit (FLTK). // Drag & Drop code for the Fast Light Tool Kit (FLTK).
// //
@ -86,7 +86,7 @@ int Fl::dnd() {
fl_local_grab = grabfunc; fl_local_grab = grabfunc;
Window target_window = 0; Window target_window = 0;
Fl_Window* local_window = 0; Fl_Window* local_window = 0;
int version = 4; int dest_x, dest_y; int dndversion = 4; int dest_x, dest_y;
XSetSelectionOwner(fl_display, fl_XdndSelection, fl_message_window, fl_event_time); XSetSelectionOwner(fl_display, fl_XdndSelection, fl_message_window, fl_event_time);
while (Fl::pushed()) { while (Fl::pushed()) {
@ -110,25 +110,25 @@ int Fl::dnd() {
if (new_window != target_window) { if (new_window != target_window) {
if (local_window) { if (local_window) {
local_handle(FL_DND_LEAVE, local_window); local_handle(FL_DND_LEAVE, local_window);
} else if (version) { } else if (dndversion) {
fl_sendClientMessage(target_window, fl_XdndLeave, source_window); fl_sendClientMessage(target_window, fl_XdndLeave, source_window);
} }
version = new_version; dndversion = new_version;
target_window = new_window; target_window = new_window;
local_window = new_local_window; local_window = new_local_window;
if (local_window) { if (local_window) {
local_handle(FL_DND_ENTER, local_window); local_handle(FL_DND_ENTER, local_window);
} else if (version) { } else if (dndversion) {
fl_sendClientMessage(target_window, fl_XdndEnter, source_window, fl_sendClientMessage(target_window, fl_XdndEnter, source_window,
version<<24, XA_STRING, 0, 0); dndversion<<24, XA_STRING, 0, 0);
} }
} }
if (local_window) { if (local_window) {
local_handle(FL_DND_DRAG, local_window); local_handle(FL_DND_DRAG, local_window);
} else if (version) { } else if (dndversion) {
fl_sendClientMessage(target_window, fl_XdndPosition, source_window, fl_sendClientMessage(target_window, fl_XdndPosition, source_window,
0, (e_x_root<<16)|e_y_root, fl_event_time, 0, (e_x_root<<16)|e_y_root, fl_event_time,
fl_XdndActionCopy); fl_XdndActionCopy);
} }
Fl::wait(); Fl::wait();
} }
@ -136,9 +136,9 @@ int Fl::dnd() {
if (local_window) { if (local_window) {
fl_i_own_selection[0] = 1; fl_i_own_selection[0] = 1;
if (local_handle(FL_DND_RELEASE, local_window)) paste(*belowmouse(), 0); if (local_handle(FL_DND_RELEASE, local_window)) paste(*belowmouse(), 0);
} else if (version) { } else if (dndversion) {
fl_sendClientMessage(target_window, fl_XdndDrop, source_window, fl_sendClientMessage(target_window, fl_XdndDrop, source_window,
0, fl_event_time); 0, fl_event_time);
} else if (target_window) { } else if (target_window) {
// fake a drop by clicking the middle mouse button: // fake a drop by clicking the middle mouse button:
XButtonEvent msg; XButtonEvent msg;
@ -167,5 +167,5 @@ int Fl::dnd() {
// //
// End of "$Id: fl_dnd_x.cxx,v 1.5.2.4 2002/04/10 19:22:45 easysw Exp $". // End of "$Id: fl_dnd_x.cxx,v 1.5.2.5 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: fl_draw_image.cxx,v 1.5.2.6.2.4 2002/04/11 11:52:42 easysw Exp $" // "$Id: fl_draw_image.cxx,v 1.5.2.6.2.5 2002/08/09 03:17:30 easysw Exp $"
// //
// Image drawing routines for the Fast Light Tool Kit (FLTK). // Image drawing routines for the Fast Light Tool Kit (FLTK).
// //
@ -63,7 +63,7 @@
# include "Fl_XColor.H" # include "Fl_XColor.H"
# include "flstring.h" # include "flstring.h"
static XImage i; // template used to pass info to X static XImage xi; // template used to pass info to X
static int bytes_per_pixel; static int bytes_per_pixel;
static int scanline_add; static int scanline_add;
static int scanline_mask; static int scanline_mask;
@ -358,16 +358,16 @@ static void figure_out_visual() {
XPixmapFormatValues *pfv; XPixmapFormatValues *pfv;
for (pfv = pfvlist; pfv < pfvlist+FL_NUM_pfv; pfv++) for (pfv = pfvlist; pfv < pfvlist+FL_NUM_pfv; pfv++)
if (pfv->depth == fl_visual->depth) break; if (pfv->depth == fl_visual->depth) break;
i.format = ZPixmap; xi.format = ZPixmap;
i.byte_order = ImageByteOrder(fl_display); xi.byte_order = ImageByteOrder(fl_display);
//i.bitmap_unit = 8; //i.bitmap_unit = 8;
//i.bitmap_bit_order = MSBFirst; //i.bitmap_bit_order = MSBFirst;
//i.bitmap_pad = 8; //i.bitmap_pad = 8;
i.depth = fl_visual->depth; xi.depth = fl_visual->depth;
i.bits_per_pixel = pfv->bits_per_pixel; xi.bits_per_pixel = pfv->bits_per_pixel;
if (i.bits_per_pixel & 7) bytes_per_pixel = 0; // produce fatal error if (xi.bits_per_pixel & 7) bytes_per_pixel = 0; // produce fatal error
else bytes_per_pixel = i.bits_per_pixel/8; else bytes_per_pixel = xi.bits_per_pixel/8;
unsigned int n = pfv->scanline_pad/8; unsigned int n = pfv->scanline_pad/8;
if (pfv->scanline_pad & 7 || (n&(n-1))) if (pfv->scanline_pad & 7 || (n&(n-1)))
@ -383,7 +383,7 @@ static void figure_out_visual() {
return; return;
} }
if (!fl_visual->red_mask) if (!fl_visual->red_mask)
Fl::fatal("Can't do %d bits_per_pixel colormap",i.bits_per_pixel); Fl::fatal("Can't do %d bits_per_pixel colormap",xi.bits_per_pixel);
# endif # endif
// otherwise it is a TrueColor visual: // otherwise it is a TrueColor visual:
@ -398,9 +398,9 @@ static void figure_out_visual() {
// All 16-bit TrueColor visuals are supported on any machine with // All 16-bit TrueColor visuals are supported on any machine with
// 24 or more bits per integer. // 24 or more bits per integer.
# ifdef U16 # ifdef U16
::i.byte_order = WORDS_BIGENDIAN; xi.byte_order = WORDS_BIGENDIAN;
# else # else
::i.byte_order = 1; xi.byte_order = 1;
# endif # endif
if (rs == 11 && gs == 6 && bs == 0 && fl_extrashift == 3) { if (rs == 11 && gs == 6 && bs == 0 && fl_extrashift == 3) {
converter = c565_converter; converter = c565_converter;
@ -412,7 +412,7 @@ static void figure_out_visual() {
break; break;
case 3: case 3:
if (::i.byte_order) {rs = 16-rs; gs = 16-gs; bs = 16-bs;} if (xi.byte_order) {rs = 16-rs; gs = 16-gs; bs = 16-bs;}
if (rs == 0 && gs == 8 && bs == 16) { if (rs == 0 && gs == 8 && bs == 16) {
converter = rgb_converter; converter = rgb_converter;
mono_converter = rrr_converter; mono_converter = rrr_converter;
@ -425,7 +425,7 @@ static void figure_out_visual() {
break; break;
case 4: case 4:
if ((::i.byte_order!=0) != WORDS_BIGENDIAN) if ((xi.byte_order!=0) != WORDS_BIGENDIAN)
{rs = 24-rs; gs = 24-gs; bs = 24-bs;} {rs = 24-rs; gs = 24-gs; bs = 24-bs;}
if (rs == 0 && gs == 8 && bs == 16) { if (rs == 0 && gs == 8 && bs == 16) {
converter = xbgr_converter; converter = xbgr_converter;
@ -440,14 +440,14 @@ static void figure_out_visual() {
converter = xrgb_converter; converter = xrgb_converter;
mono_converter = xrrr_converter; mono_converter = xrrr_converter;
} else { } else {
::i.byte_order = WORDS_BIGENDIAN; xi.byte_order = WORDS_BIGENDIAN;
converter = color32_converter; converter = color32_converter;
mono_converter = mono32_converter; mono_converter = mono32_converter;
} }
break; break;
default: default:
Fl::fatal("Can't do %d bits_per_pixel",i.bits_per_pixel); Fl::fatal("Can't do %d bits_per_pixel",xi.bits_per_pixel);
} }
} }
@ -467,8 +467,8 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
dy -= Y; dy -= Y;
if (!bytes_per_pixel) figure_out_visual(); if (!bytes_per_pixel) figure_out_visual();
i.width = w; xi.width = w;
i.height = h; xi.height = h;
void (*conv)(const uchar *from, uchar *to, int w, int delta) = converter; void (*conv)(const uchar *from, uchar *to, int w, int delta) = converter;
if (mono) conv = mono_converter; if (mono) conv = mono_converter;
@ -491,8 +491,8 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
# endif # endif
conv == rgb_converter && delta==3 conv == rgb_converter && delta==3
) && !(linedelta&scanline_add)) { ) && !(linedelta&scanline_add)) {
i.data = (char *)(buf+delta*dx+linedelta*dy); xi.data = (char *)(buf+delta*dx+linedelta*dy);
i.bytes_per_line = linedelta; xi.bytes_per_line = linedelta;
} else { } else {
int linesize = ((w*bytes_per_pixel+scanline_add)&scanline_mask)/sizeof(STORETYPE); int linesize = ((w*bytes_per_pixel+scanline_add)&scanline_mask)/sizeof(STORETYPE);
@ -509,8 +509,8 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
buffer_size = size; buffer_size = size;
buffer = new STORETYPE[size]; buffer = new STORETYPE[size];
}} }}
i.data = (char *)buffer; xi.data = (char *)buffer;
i.bytes_per_line = linesize*sizeof(STORETYPE); xi.bytes_per_line = linesize*sizeof(STORETYPE);
if (buf) { if (buf) {
buf += delta*dx+linedelta*dy; buf += delta*dx+linedelta*dy;
for (int j=0; j<h; ) { for (int j=0; j<h; ) {
@ -521,7 +521,7 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
buf += linedelta; buf += linedelta;
to += linesize; to += linesize;
} }
XPutImage(fl_display,fl_window,fl_gc, &i, 0, 0, X+dx, Y+dy+j-k, w, k); XPutImage(fl_display,fl_window,fl_gc, &xi, 0, 0, X+dx, Y+dy+j-k, w, k);
} }
} else { } else {
STORETYPE* linebuf = new STORETYPE[(W*delta+(sizeof(STORETYPE)-1))/sizeof(STORETYPE)]; STORETYPE* linebuf = new STORETYPE[(W*delta+(sizeof(STORETYPE)-1))/sizeof(STORETYPE)];
@ -533,7 +533,7 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
conv((uchar*)linebuf, (uchar*)to, w, delta); conv((uchar*)linebuf, (uchar*)to, w, delta);
to += linesize; to += linesize;
} }
XPutImage(fl_display,fl_window,fl_gc, &i, 0, 0, X+dx, Y+dy+j-k, w, k); XPutImage(fl_display,fl_window,fl_gc, &xi, 0, 0, X+dx, Y+dy+j-k, w, k);
} }
delete[] linebuf; delete[] linebuf;
@ -570,5 +570,5 @@ void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) {
#endif #endif
// //
// End of "$Id: fl_draw_image.cxx,v 1.5.2.6.2.4 2002/04/11 11:52:42 easysw Exp $". // End of "$Id: fl_draw_image.cxx,v 1.5.2.6.2.5 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: fl_draw_pixmap.cxx,v 1.4.2.8.2.9 2002/05/25 13:38:25 easysw Exp $" // "$Id: fl_draw_pixmap.cxx,v 1.4.2.8.2.10 2002/08/09 03:17:30 easysw Exp $"
// //
// Pixmap drawing code for the Fast Light Tool Kit (FLTK). // Pixmap drawing code for the Fast Light Tool Kit (FLTK).
// //
@ -178,20 +178,20 @@ int fl_draw_pixmap(const char*const* di, int x, int y, Fl_Color bg) {
for (int i=0; i<ncolors; i++) { for (int i=0; i<ncolors; i++) {
const uchar *p = *data++; const uchar *p = *data++;
// the first 1 or 2 characters are the color index: // the first 1 or 2 characters are the color index:
int index = *p++; int ind = *p++;
uchar* c; uchar* c;
if (chars_per_pixel>1) { if (chars_per_pixel>1) {
#ifdef U64 #ifdef U64
U64* colors = d.byte1[index]; U64* colors = d.byte1[ind];
if (!colors) colors = d.byte1[index] = new U64[256]; if (!colors) colors = d.byte1[ind] = new U64[256];
#else #else
U32* colors = d.byte1[index]; U32* colors = d.byte1[ind];
if (!colors) colors = d.byte1[index] = new U32[256]; if (!colors) colors = d.byte1[ind] = new U32[256];
#endif #endif
c = (uchar*)&colors[*p]; c = (uchar*)&colors[*p];
index = (index<<8)+*p++; ind = (ind<<8)+*p++;
} else { } else {
c = (uchar *)&d.colors[index]; c = (uchar *)&d.colors[ind];
} }
// look for "c word", or last word if none: // look for "c word", or last word if none:
const uchar *previous_word = p; const uchar *previous_word = p;
@ -215,7 +215,7 @@ int fl_draw_pixmap(const char*const* di, int x, int y, Fl_Color bg) {
// assume "None" or "#transparent" for any errors // assume "None" or "#transparent" for any errors
// "bg" should be transparent... // "bg" should be transparent...
Fl::get_color(bg, c[0], c[1], c[2]); Fl::get_color(bg, c[0], c[1], c[2]);
transparent_index = index; transparent_index = ind;
} }
} }
} }
@ -226,10 +226,10 @@ int fl_draw_pixmap(const char*const* di, int x, int y, Fl_Color bg) {
int W = (d.w+7)/8; int W = (d.w+7)/8;
uchar* bitmap = new uchar[W * d.h]; uchar* bitmap = new uchar[W * d.h];
*fl_mask_bitmap = bitmap; *fl_mask_bitmap = bitmap;
for (int y = 0; y < d.h; y++) { for (int Y = 0; Y < d.h; Y++) {
const uchar* p = data[y]; const uchar* p = data[Y];
if (chars_per_pixel <= 1) { if (chars_per_pixel <= 1) {
for (int x = 0; x < W; x++) { for (int X = 0; X < W; X++) {
int b = (*p++ != transparent_index); int b = (*p++ != transparent_index);
if (*p++ != transparent_index) b |= 2; if (*p++ != transparent_index) b |= 2;
if (*p++ != transparent_index) b |= 4; if (*p++ != transparent_index) b |= 4;
@ -241,12 +241,12 @@ int fl_draw_pixmap(const char*const* di, int x, int y, Fl_Color bg) {
*bitmap++ = b; *bitmap++ = b;
} }
} else { } else {
for (int x = 0; x < W; x++) { for (int X = 0; X < W; X++) {
int b = 0; int b = 0;
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
int index = *p++; int ind = *p++;
index = (index<<8) | (*p++); ind = (ind<<8) | (*p++);
if (index != transparent_index) b |= (1<<i); if (ind != transparent_index) b |= (1<<i);
} }
*bitmap++ = b; *bitmap++ = b;
} }
@ -260,5 +260,5 @@ int fl_draw_pixmap(const char*const* di, int x, int y, Fl_Color bg) {
} }
// //
// End of "$Id: fl_draw_pixmap.cxx,v 1.4.2.8.2.9 2002/05/25 13:38:25 easysw Exp $". // End of "$Id: fl_draw_pixmap.cxx,v 1.4.2.8.2.10 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: fl_shortcut.cxx,v 1.4.2.9.2.6 2002/06/26 02:01:33 matthiaswm Exp $" // "$Id: fl_shortcut.cxx,v 1.4.2.9.2.7 2002/08/09 03:17:30 easysw Exp $"
// //
// Shortcut support routines for the Fast Light Tool Kit (FLTK). // Shortcut support routines for the Fast Light Tool Kit (FLTK).
// //
@ -181,14 +181,14 @@ int fl_old_shortcut(const char* s) {
// Tests for &x shortcuts in button labels: // Tests for &x shortcuts in button labels:
int Fl_Widget::test_shortcut(const char *label) { int Fl_Widget::test_shortcut(const char *l) {
char c = Fl::event_text()[0]; char c = Fl::event_text()[0];
if (!c || !label) return 0; if (!c || !l) return 0;
for (;;) { for (;;) {
if (!*label) return 0; if (!*l) return 0;
if (*label++ == '&' && *label) { if (*l++ == '&' && *l) {
if (*label == '&') label++; if (*l == '&') l++;
else if (*label == c) return 1; else if (*l == c) return 1;
else return 0; else return 0;
} }
} }
@ -200,5 +200,5 @@ int Fl_Widget::test_shortcut() {
} }
// //
// End of "$Id: fl_shortcut.cxx,v 1.4.2.9.2.6 2002/06/26 02:01:33 matthiaswm Exp $". // End of "$Id: fl_shortcut.cxx,v 1.4.2.9.2.7 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: fl_show_colormap.cxx,v 1.5.2.4.2.1 2002/01/01 15:11:32 easysw Exp $" // "$Id: fl_show_colormap.cxx,v 1.5.2.4.2.2 2002/08/09 03:17:30 easysw Exp $"
// //
// Colormap color selection dialog for the Fast Light Tool Kit (FLTK). // Colormap color selection dialog for the Fast Light Tool Kit (FLTK).
// //
@ -56,14 +56,14 @@ ColorMenu::ColorMenu(Fl_Color oldcol) :
void ColorMenu::drawbox(Fl_Color c) { void ColorMenu::drawbox(Fl_Color c) {
if (c < 0 || c > 255) return; if (c < 0 || c > 255) return;
int x = (c%8)*BOXSIZE+BORDER; int X = (c%8)*BOXSIZE+BORDER;
int y = (c/8)*BOXSIZE+BORDER; int Y = (c/8)*BOXSIZE+BORDER;
#if BORDER_WIDTH < 3 #if BORDER_WIDTH < 3
if (c == which) fl_draw_box(FL_DOWN_BOX, x+1, y+1, BOXSIZE-1, BOXSIZE-1, c); if (c == which) fl_draw_box(FL_DOWN_BOX, X+1, Y+1, BOXSIZE-1, BOXSIZE-1, c);
else fl_draw_box(FL_BORDER_BOX, x, y, BOXSIZE+1, BOXSIZE+1, c); else fl_draw_box(FL_BORDER_BOX, X, Y, BOXSIZE+1, BOXSIZE+1, c);
#else #else
fl_draw_box(c == which ? FL_DOWN_BOX : FL_BORDER_BOX, fl_draw_box(c == which ? FL_DOWN_BOX : FL_BORDER_BOX,
x, y, BOXSIZE+1, BOXSIZE+1, c); X, Y, BOXSIZE+1, BOXSIZE+1, c);
#endif #endif
} }
@ -150,5 +150,5 @@ Fl_Color fl_show_colormap(Fl_Color oldcol) {
} }
// //
// End of "$Id: fl_show_colormap.cxx,v 1.5.2.4.2.1 2002/01/01 15:11:32 easysw Exp $". // End of "$Id: fl_show_colormap.cxx,v 1.5.2.4.2.2 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: forms_bitmap.cxx,v 1.4.2.3.2.1 2002/01/01 15:11:32 easysw Exp $" // "$Id: forms_bitmap.cxx,v 1.4.2.3.2.2 2002/08/09 03:17:30 easysw Exp $"
// //
// Forms compatible bitmap function for the Fast Light Tool Kit (FLTK). // Forms compatible bitmap function for the Fast Light Tool Kit (FLTK).
// //
@ -26,8 +26,8 @@
#include <FL/forms.H> #include <FL/forms.H>
Fl_FormsBitmap::Fl_FormsBitmap( Fl_FormsBitmap::Fl_FormsBitmap(
Fl_Boxtype t, int x, int y, int w, int h, const char* l) Fl_Boxtype t, int X, int Y, int W, int H, const char* l)
: Fl_Widget(x, y, w, h, l) { : Fl_Widget(X, Y, W, H, l) {
box(t); box(t);
b = 0; b = 0;
color(FL_BLACK); color(FL_BLACK);
@ -46,5 +46,5 @@ void Fl_FormsBitmap::draw() {
} }
// //
// End of "$Id: forms_bitmap.cxx,v 1.4.2.3.2.1 2002/01/01 15:11:32 easysw Exp $". // End of "$Id: forms_bitmap.cxx,v 1.4.2.3.2.2 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: forms_compatability.cxx,v 1.5.2.3.2.2 2002/01/01 15:11:32 easysw Exp $" // "$Id: forms_compatability.cxx,v 1.5.2.3.2.3 2002/08/09 03:17:30 easysw Exp $"
// //
// Forms compatibility functions for the Fast Light Tool Kit (FLTK). // Forms compatibility functions for the Fast Light Tool Kit (FLTK).
// //
@ -60,9 +60,9 @@ void Fl_Group::forms_end() {
int Y = o->h(); int Y = o->h();
Fl_Widget*const* a = array(); Fl_Widget*const* a = array();
for (int i=children(); i--;) { for (int i=children(); i--;) {
Fl_Widget* o = *a++; Fl_Widget* ow = *a++;
int newy = Y-o->y()-o->h(); int newy = Y-ow->y()-ow->h();
o->y(newy); ow->y(newy);
} }
} }
end(); end();
@ -202,5 +202,5 @@ char *fl_show_simple_input(const char *str1, const char *defstr) {
} }
// //
// End of "$Id: forms_compatability.cxx,v 1.5.2.3.2.2 2002/01/01 15:11:32 easysw Exp $". // End of "$Id: forms_compatability.cxx,v 1.5.2.3.2.3 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: forms_free.cxx,v 1.4.2.4.2.1 2002/01/01 15:11:32 easysw Exp $" // "$Id: forms_free.cxx,v 1.4.2.4.2.2 2002/08/09 03:17:30 easysw Exp $"
// //
// Forms free widget routines for the Fast Light Tool Kit (FLTK). // Forms free widget routines for the Fast Light Tool Kit (FLTK).
// //
@ -37,9 +37,9 @@ void Fl_Free::step(void *v) {
Fl::add_timeout(.01,step,v); Fl::add_timeout(.01,step,v);
} }
Fl_Free::Fl_Free(uchar t,int x,int y,int w,int h,const char *l, Fl_Free::Fl_Free(uchar t,int X, int Y, int W, int H,const char *l,
FL_HANDLEPTR hdl) : FL_HANDLEPTR hdl) :
Fl_Widget(x,y,w,h,l) { Fl_Widget(X,Y,W,H,l) {
type(t); type(t);
hfunc = hdl; hfunc = hdl;
if (t == FL_SLEEPING_FREE) set_flag(INACTIVE); if (t == FL_SLEEPING_FREE) set_flag(INACTIVE);
@ -73,5 +73,5 @@ int Fl_Free::handle(int e) {
} }
// //
// End of "$Id: forms_free.cxx,v 1.4.2.4.2.1 2002/01/01 15:11:32 easysw Exp $". // End of "$Id: forms_free.cxx,v 1.4.2.4.2.2 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: forms_pixmap.cxx,v 1.4.2.3.2.1 2002/01/01 15:11:32 easysw Exp $" // "$Id: forms_pixmap.cxx,v 1.4.2.3.2.2 2002/08/09 03:17:30 easysw Exp $"
// //
// Forms pixmap drawing routines for the Fast Light Tool Kit (FLTK). // Forms pixmap drawing routines for the Fast Light Tool Kit (FLTK).
// //
@ -26,8 +26,8 @@
#include <FL/forms.H> #include <FL/forms.H>
Fl_FormsPixmap::Fl_FormsPixmap( Fl_FormsPixmap::Fl_FormsPixmap(
Fl_Boxtype t, int x, int y, int w, int h, const char* l) Fl_Boxtype t, int X, int Y, int W, int H, const char* l)
: Fl_Widget(x, y, w, h, l) { : Fl_Widget(X, Y, W, H, l) {
box(t); box(t);
b = 0; b = 0;
color(FL_BLACK); color(FL_BLACK);
@ -46,5 +46,5 @@ void Fl_FormsPixmap::draw() {
} }
// //
// End of "$Id: forms_pixmap.cxx,v 1.4.2.3.2.1 2002/01/01 15:11:32 easysw Exp $". // End of "$Id: forms_pixmap.cxx,v 1.4.2.3.2.2 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: forms_timer.cxx,v 1.4.2.3.2.2 2002/06/29 00:10:04 matthiaswm Exp $" // "$Id: forms_timer.cxx,v 1.4.2.3.2.3 2002/08/09 03:17:30 easysw Exp $"
// //
// Forms timer object for the Fast Light Tool Kit (FLTK). // Forms timer object for the Fast Light Tool Kit (FLTK).
// //
@ -126,8 +126,8 @@ Fl_Timer::~Fl_Timer() {
Fl::remove_timeout(stepcb, this); Fl::remove_timeout(stepcb, this);
} }
Fl_Timer::Fl_Timer(uchar t, int x, int y, int w, int h, const char* l) Fl_Timer::Fl_Timer(uchar t, int X, int Y, int W, int H, const char* l)
: Fl_Widget(x, y, w, h, l) { : Fl_Widget(X, Y, W, H, l) {
box(FL_DOWN_BOX); box(FL_DOWN_BOX);
selection_color(FL_RED); selection_color(FL_RED);
delay = 0; delay = 0;
@ -161,5 +161,5 @@ void Fl_Timer::suspended(char d) {
} }
// //
// End of "$Id: forms_timer.cxx,v 1.4.2.3.2.2 2002/06/29 00:10:04 matthiaswm Exp $". // End of "$Id: forms_timer.cxx,v 1.4.2.3.2.3 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: glut_compatability.cxx,v 1.4.2.5.2.2 2002/06/26 14:52:33 matthiaswm Exp $" // "$Id: glut_compatability.cxx,v 1.4.2.5.2.3 2002/08/09 03:17:30 easysw Exp $"
// //
// GLUT emulation routines for the Fast Light Tool Kit (FLTK). // GLUT emulation routines for the Fast Light Tool Kit (FLTK).
// //
@ -127,9 +127,9 @@ int Fl_Glut_Window::handle(int event) {
break; break;
} else { } else {
if (special) { if (special) {
int i = Fl::event_key(); int k = Fl::event_key();
if (i > FL_F && i <= FL_F_Last) i = i-FL_F; if (k > FL_F && k <= FL_F_Last) k -= FL_F;
special(i,ex,ey); special(k,ex,ey);
return 1; return 1;
} }
break; break;
@ -167,11 +167,11 @@ void Fl_Glut_Window::_init() {
mode(glut_mode); mode(glut_mode);
} }
Fl_Glut_Window::Fl_Glut_Window(int w, int h, const char *t) : Fl_Glut_Window::Fl_Glut_Window(int W, int H, const char *t) :
Fl_Gl_Window(w,h,t) {_init();} Fl_Gl_Window(W,H,t) {_init();}
Fl_Glut_Window::Fl_Glut_Window(int x,int y,int w,int h, const char *t) : Fl_Glut_Window::Fl_Glut_Window(int X,int Y,int W,int H, const char *t) :
Fl_Gl_Window(x,y,w,h,t) {_init();} Fl_Gl_Window(X,Y,W,H,t) {_init();}
static int initargc; static int initargc;
static char **initargv; static char **initargv;
@ -402,5 +402,5 @@ int glutLayerGet(GLenum type) {
#endif #endif
// //
// End of "$Id: glut_compatability.cxx,v 1.4.2.5.2.2 2002/06/26 14:52:33 matthiaswm Exp $". // End of "$Id: glut_compatability.cxx,v 1.4.2.5.2.3 2002/08/09 03:17:30 easysw Exp $".
// //

View File

@ -1,5 +1,5 @@
/* /*
* "$Id: numericsort.c,v 1.10.2.4.2.5 2002/05/04 18:41:55 easysw Exp $" * "$Id: numericsort.c,v 1.10.2.4.2.6 2002/08/09 03:17:30 easysw Exp $"
* *
* Numeric sorting routine for the Fast Light Tool Kit (FLTK). * Numeric sorting routine for the Fast Light Tool Kit (FLTK).
* *
@ -60,15 +60,15 @@ static int numericsort(struct dirent **A, struct dirent **B, int cs) {
const char* b = (*B)->d_name; const char* b = (*B)->d_name;
int ret = 0; int ret = 0;
for (;;) { for (;;) {
if (isdigit((unsigned)*a) && isdigit((unsigned)*b)) { if (isdigit(*a & 255) && isdigit(*b & 255)) {
int diff,magdiff; int diff,magdiff;
while (*a == '0') a++; while (*a == '0') a++;
while (*b == '0') b++; while (*b == '0') b++;
while (isdigit((unsigned)*a) && *a == *b) {a++; b++;} while (isdigit(*a & 255) && *a == *b) {a++; b++;}
diff = (isdigit((unsigned)*a) && isdigit((unsigned)*b)) ? *a - *b : 0; diff = (isdigit(*a & 255) && isdigit(*b & 255)) ? *a - *b : 0;
magdiff = 0; magdiff = 0;
while (isdigit((unsigned)*a)) {magdiff++; a++;} while (isdigit(*a & 255)) {magdiff++; a++;}
while (isdigit((unsigned)*b)) {magdiff--; b++;} while (isdigit(*b & 255)) {magdiff--; b++;}
if (magdiff) {ret = magdiff; break;} /* compare # of significant digits*/ if (magdiff) {ret = magdiff; break;} /* compare # of significant digits*/
if (diff) {ret = diff; break;} /* compare first non-zero digit */ if (diff) {ret = diff; break;} /* compare first non-zero digit */
} else { } else {
@ -77,7 +77,7 @@ static int numericsort(struct dirent **A, struct dirent **B, int cs) {
if ((ret = *a-*b)) break; if ((ret = *a-*b)) break;
} else { } else {
/* compare case-insensitve */ /* compare case-insensitve */
if ((ret = tolower((unsigned)*a)-tolower((unsigned)*b))) break; if ((ret = tolower(*a & 255)-tolower(*b & 255))) break;
} }
if (!*a) break; if (!*a) break;
@ -105,5 +105,5 @@ int fl_numericsort(struct dirent **A, struct dirent **B) {
} }
/* /*
* End of "$Id: numericsort.c,v 1.10.2.4.2.5 2002/05/04 18:41:55 easysw Exp $". * End of "$Id: numericsort.c,v 1.10.2.4.2.6 2002/08/09 03:17:30 easysw Exp $".
*/ */