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:
parent
a6b935289e
commit
050919103f
@ -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).
|
||||
//
|
||||
@ -30,12 +30,12 @@
|
||||
|
||||
class Fl_Float_Input : public Fl_Input {
|
||||
public:
|
||||
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_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);}
|
||||
};
|
||||
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -60,11 +60,11 @@ public:
|
||||
FL_EXPORT void resize(int,int,int,int);
|
||||
|
||||
char valid() const {return valid_;}
|
||||
void valid(char i) {valid_ = i;}
|
||||
void valid(char v) {valid_ = v;}
|
||||
FL_EXPORT void invalidate();
|
||||
|
||||
static int can_do(int i) {return can_do(i,0);}
|
||||
static int can_do(const int *i) {return can_do(0, i);}
|
||||
static int can_do(int m) {return can_do(m,0);}
|
||||
static int can_do(const int *m) {return can_do(0, m);}
|
||||
int can_do() {return can_do(mode_,alist);}
|
||||
Fl_Mode mode() const {return (Fl_Mode)mode_;}
|
||||
int mode(int a) {return mode(a,0);}
|
||||
@ -90,5 +90,5 @@ public:
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -30,12 +30,12 @@
|
||||
|
||||
class Fl_Hor_Slider : public Fl_Slider {
|
||||
public:
|
||||
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_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);}
|
||||
};
|
||||
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -30,12 +30,12 @@
|
||||
|
||||
class Fl_Hor_Value_Slider : public Fl_Value_Slider {
|
||||
public:
|
||||
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_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);}
|
||||
};
|
||||
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -30,12 +30,12 @@
|
||||
|
||||
class Fl_Int_Input : public Fl_Input {
|
||||
public:
|
||||
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_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);}
|
||||
};
|
||||
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -30,12 +30,12 @@
|
||||
|
||||
class Fl_Multiline_Input : public Fl_Input {
|
||||
public:
|
||||
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_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);}
|
||||
};
|
||||
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -30,12 +30,12 @@
|
||||
|
||||
class Fl_Multiline_Output : public Fl_Output {
|
||||
public:
|
||||
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_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);}
|
||||
};
|
||||
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -30,12 +30,12 @@
|
||||
|
||||
class Fl_Output : public Fl_Input {
|
||||
public:
|
||||
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_Output(int X,int Y,int W,int H, const char *l = 0)
|
||||
: Fl_Input(X, Y, W, H, l) {type(FL_NORMAL_OUTPUT);}
|
||||
};
|
||||
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -29,12 +29,12 @@
|
||||
|
||||
class Fl_Radio_Light_Button : public Fl_Light_Button {
|
||||
public:
|
||||
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_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);}
|
||||
};
|
||||
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -32,8 +32,8 @@ class Fl_Repeat_Button : public Fl_Button {
|
||||
static FL_EXPORT void repeat_callback(void *);
|
||||
public:
|
||||
FL_EXPORT int handle(int);
|
||||
Fl_Repeat_Button(int x,int y,int w,int h,const char *l=0)
|
||||
: Fl_Button(x,y,w,h,l) {}
|
||||
Fl_Repeat_Button(int X,int Y,int W,int H,const char *l=0)
|
||||
: Fl_Button(X,Y,W,H,l) {}
|
||||
void deactivate() {
|
||||
Fl::remove_timeout(repeat_callback,this);
|
||||
Fl_Button::deactivate();
|
||||
@ -43,5 +43,5 @@ public:
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -30,12 +30,12 @@
|
||||
|
||||
class Fl_Secret_Input : public Fl_Input {
|
||||
public:
|
||||
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_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);}
|
||||
};
|
||||
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -30,12 +30,12 @@
|
||||
|
||||
class Fl_Select_Browser : public Fl_Browser {
|
||||
public:
|
||||
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_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);}
|
||||
};
|
||||
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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.
|
||||
//
|
||||
@ -78,7 +78,7 @@ class FL_EXPORT Fl_Text_Buffer {
|
||||
char character(int pos);
|
||||
char* text_in_rectangle(int start, int end, int rectStart, int rectEnd);
|
||||
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 replace(int start, int end, const char *text);
|
||||
void copy(Fl_Text_Buffer* fromBuf, int fromStart, int fromEnd, int toPos);
|
||||
@ -238,5 +238,5 @@ class FL_EXPORT Fl_Text_Buffer {
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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.
|
||||
//
|
||||
@ -95,7 +95,7 @@ class Fl_Text_Display: public Fl_Group {
|
||||
FL_EXPORT void cursor_style(int style);
|
||||
int scrollbar_width() { return scrollbar_width_; }
|
||||
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; }
|
||||
int word_start(int pos) { return buffer()->word_start(pos); }
|
||||
int word_end(int pos) { return buffer()->word_end(pos); }
|
||||
@ -243,5 +243,5 @@ class Fl_Text_Display: public Fl_Group {
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -30,12 +30,12 @@
|
||||
|
||||
class Fl_Toggle_Button : public Fl_Button {
|
||||
public:
|
||||
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_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);}
|
||||
};
|
||||
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -38,7 +38,7 @@ public:
|
||||
FL_EXPORT void draw();
|
||||
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_;}
|
||||
|
||||
Fl_Font textfont() const {return (Fl_Font)textfont_;}
|
||||
@ -52,5 +52,5 @@ public:
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -812,8 +812,8 @@ class Fl_FormsText : public Fl_Widget {
|
||||
protected:
|
||||
FL_EXPORT void draw();
|
||||
public:
|
||||
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_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);}
|
||||
};
|
||||
#define FL_NORMAL_TEXT FL_NO_BOX
|
||||
forms_constructorb(Fl_FormsText, fl_add_text)
|
||||
@ -838,5 +838,5 @@ inline void fl_draw() {Fl::flush();}
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -40,52 +40,52 @@ static Fl_Gl_Choice *first;
|
||||
// this assummes one of the two arguments is zero:
|
||||
// We keep the list system in Win32 to stay compatible and interpret
|
||||
// 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;
|
||||
|
||||
for (g = first; g; g = g->next)
|
||||
if (g->mode == mode && g->alist == alist)
|
||||
if (g->mode == m && g->alist == alistp)
|
||||
return g;
|
||||
|
||||
#ifdef __APPLE__
|
||||
const int *blist;
|
||||
int list[32];
|
||||
|
||||
if (alist)
|
||||
blist = alist;
|
||||
if (alistp)
|
||||
blist = alistp;
|
||||
else {
|
||||
int n = 0;
|
||||
if (mode & FL_INDEX) {
|
||||
if (m & FL_INDEX) {
|
||||
list[n++] = AGL_BUFFER_SIZE;
|
||||
list[n++] = 8; // glut tries many sizes, but this should work...
|
||||
} else {
|
||||
list[n++] = AGL_RGBA;
|
||||
list[n++] = AGL_GREEN_SIZE;
|
||||
list[n++] = (mode & FL_RGB8) ? 8 : 1;
|
||||
if (mode & FL_ALPHA) {
|
||||
list[n++] = (m & FL_RGB8) ? 8 : 1;
|
||||
if (m & FL_ALPHA) {
|
||||
list[n++] = AGL_ALPHA_SIZE;
|
||||
list[n++] = 1;
|
||||
}
|
||||
if (mode & FL_ACCUM) {
|
||||
if (m & FL_ACCUM) {
|
||||
list[n++] = AGL_ACCUM_GREEN_SIZE;
|
||||
list[n++] = 1;
|
||||
if (mode & FL_ALPHA) {
|
||||
if (m & FL_ALPHA) {
|
||||
list[n++] = AGL_ACCUM_ALPHA_SIZE;
|
||||
list[n++] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mode & FL_DOUBLE) {
|
||||
if (m & FL_DOUBLE) {
|
||||
list[n++] = AGL_DOUBLEBUFFER;
|
||||
}
|
||||
if (mode & FL_DEPTH) {
|
||||
if (m & FL_DEPTH) {
|
||||
list[n++] = AGL_DEPTH_SIZE; list[n++] = 16;
|
||||
}
|
||||
if (mode & FL_STENCIL) {
|
||||
if (m & FL_STENCIL) {
|
||||
list[n++] = AGL_STENCIL_SIZE; list[n++] = 1;
|
||||
}
|
||||
# ifdef AGL_STEREO /* is there such a thing as AGL_STEREO? */
|
||||
if (mode & FL_STEREO) {
|
||||
if (m & FL_STEREO) {
|
||||
list[n++] = AGL_STEREO;
|
||||
}
|
||||
# endif
|
||||
@ -101,44 +101,44 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int mode, const int *alist) {
|
||||
const int *blist;
|
||||
int list[32];
|
||||
|
||||
if (alist)
|
||||
blist = alist;
|
||||
if (alistp)
|
||||
blist = alistp;
|
||||
else {
|
||||
int n = 0;
|
||||
if (mode & FL_INDEX) {
|
||||
if (m & FL_INDEX) {
|
||||
list[n++] = GLX_BUFFER_SIZE;
|
||||
list[n++] = 8; // glut tries many sizes, but this should work...
|
||||
} else {
|
||||
list[n++] = GLX_RGBA;
|
||||
list[n++] = GLX_GREEN_SIZE;
|
||||
list[n++] = (mode & FL_RGB8) ? 8 : 1;
|
||||
if (mode & FL_ALPHA) {
|
||||
list[n++] = (m & FL_RGB8) ? 8 : 1;
|
||||
if (m & FL_ALPHA) {
|
||||
list[n++] = GLX_ALPHA_SIZE;
|
||||
list[n++] = 1;
|
||||
}
|
||||
if (mode & FL_ACCUM) {
|
||||
if (m & FL_ACCUM) {
|
||||
list[n++] = GLX_ACCUM_GREEN_SIZE;
|
||||
list[n++] = 1;
|
||||
if (mode & FL_ALPHA) {
|
||||
if (m & FL_ALPHA) {
|
||||
list[n++] = GLX_ACCUM_ALPHA_SIZE;
|
||||
list[n++] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mode & FL_DOUBLE) {
|
||||
if (m & FL_DOUBLE) {
|
||||
list[n++] = GLX_DOUBLEBUFFER;
|
||||
}
|
||||
if (mode & FL_DEPTH) {
|
||||
if (m & FL_DEPTH) {
|
||||
list[n++] = GLX_DEPTH_SIZE; list[n++] = 1;
|
||||
}
|
||||
if (mode & FL_STENCIL) {
|
||||
if (m & FL_STENCIL) {
|
||||
list[n++] = GLX_STENCIL_SIZE; list[n++] = 1;
|
||||
}
|
||||
if (mode & FL_STEREO) {
|
||||
if (m & FL_STEREO) {
|
||||
list[n++] = GLX_STEREO;
|
||||
}
|
||||
# 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++] = 4; // value Glut uses
|
||||
}
|
||||
@ -148,10 +148,10 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int mode, const int *alist) {
|
||||
}
|
||||
|
||||
fl_open_display();
|
||||
XVisualInfo *vis = glXChooseVisual(fl_display, fl_screen, (int *)blist);
|
||||
if (!vis) {
|
||||
XVisualInfo *visp = glXChooseVisual(fl_display, fl_screen, (int *)blist);
|
||||
if (!visp) {
|
||||
# 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
|
||||
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;
|
||||
// continue if it does not satisfy our requirements:
|
||||
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 ((mode & FL_ALPHA) && !pfd.cAlphaBits) continue;
|
||||
if ((mode & FL_ACCUM) && !pfd.cAccumBits) continue;
|
||||
if ((!(mode & FL_DOUBLE)) != (!(pfd.dwFlags & PFD_DOUBLEBUFFER))) continue;
|
||||
if ((!(mode & FL_STEREO)) != (!(pfd.dwFlags & PFD_STEREO))) continue;
|
||||
if ((mode & FL_DEPTH) && !pfd.cDepthBits) continue;
|
||||
if ((mode & FL_STENCIL) && !pfd.cStencilBits) continue;
|
||||
if (pfd.iPixelType != ((m&FL_INDEX)?PFD_TYPE_COLORINDEX:PFD_TYPE_RGBA)) continue;
|
||||
if ((m & FL_ALPHA) && !pfd.cAlphaBits) continue;
|
||||
if ((m & FL_ACCUM) && !pfd.cAccumBits) continue;
|
||||
if ((!(m & FL_DOUBLE)) != (!(pfd.dwFlags & PFD_DOUBLEBUFFER))) continue;
|
||||
if ((!(m & FL_STEREO)) != (!(pfd.dwFlags & PFD_STEREO))) continue;
|
||||
if ((m & FL_DEPTH) && !pfd.cDepthBits) continue;
|
||||
if ((m & FL_STENCIL) && !pfd.cStencilBits) continue;
|
||||
// see if better than the one we have already:
|
||||
if (pixelformat) {
|
||||
// offering overlay is better:
|
||||
@ -192,8 +192,8 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int mode, const int *alist) {
|
||||
#endif
|
||||
|
||||
g = new Fl_Gl_Choice;
|
||||
g->mode = mode;
|
||||
g->alist = alist;
|
||||
g->mode = m;
|
||||
g->alist = alistp;
|
||||
g->next = first;
|
||||
first = g;
|
||||
|
||||
@ -203,15 +203,15 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int mode, const int *alist) {
|
||||
#elif defined(__APPLE__)
|
||||
g->pixelformat = fmt;
|
||||
#else
|
||||
g->vis = vis;
|
||||
g->vis = visp;
|
||||
|
||||
if (/*MaxCmapsOfScreen(ScreenOfDisplay(fl_display,fl_screen))==1 && */
|
||||
vis->visualid == fl_visual->visualid &&
|
||||
visp->visualid == fl_visual->visualid &&
|
||||
!getenv("MESA_PRIVATE_CMAP"))
|
||||
g->colormap = fl_colormap;
|
||||
else
|
||||
g->colormap = XCreateColormap(fl_display, RootWindow(fl_display,fl_screen),
|
||||
vis->visual, AllocNone);
|
||||
visp->visual, AllocNone);
|
||||
#endif
|
||||
|
||||
return g;
|
||||
@ -318,5 +318,5 @@ void fl_delete_gl_context(GLContext context) {
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -262,10 +262,10 @@ void Fl_Gl_Window::flush() {
|
||||
// and depth test needs to be off:
|
||||
static GLContext ortho_context = 0;
|
||||
static Fl_Gl_Window* ortho_window = 0;
|
||||
int init = !ortho_context;
|
||||
if (init) ortho_context = fl_create_gl_context(this, g);
|
||||
int orthoinit = !ortho_context;
|
||||
if (orthoinit) ortho_context = fl_create_gl_context(this, g);
|
||||
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);
|
||||
glReadBuffer(GL_BACK);
|
||||
glDrawBuffer(GL_FRONT);
|
||||
@ -367,5 +367,5 @@ void Fl_Gl_Window::draw_overlay() {}
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -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
|
||||
// calculate area to erase:
|
||||
int r = X+W;
|
||||
int x;
|
||||
int xx;
|
||||
if (p >= pp) {
|
||||
x = X;
|
||||
xx = X;
|
||||
if (erase_cursor_only) r = xpos+2;
|
||||
else if (readonly()) x -= 3;
|
||||
else if (readonly()) xx -= 3;
|
||||
} else {
|
||||
x = xpos+(int)expandpos(p, pp, buf, 0);
|
||||
if (erase_cursor_only) r = x+2;
|
||||
else if (readonly()) x -= 3;
|
||||
xx = xpos+(int)expandpos(p, pp, buf, 0);
|
||||
if (erase_cursor_only) r = xx+2;
|
||||
else if (readonly()) xx -= 3;
|
||||
}
|
||||
// clip to and erase it:
|
||||
fl_color(color());
|
||||
fl_rectf(x, Y+ypos, r-x, height);
|
||||
fl_push_clip(x, Y+ypos, r-x, height);
|
||||
fl_rectf(xx, Y+ypos, r-xx, height);
|
||||
fl_push_clip(xx, Y+ypos, r-xx, height);
|
||||
// it now draws entire line over it
|
||||
// this should not draw letters to left of erased area, but
|
||||
// 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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -105,13 +105,13 @@ void Fl_Roller::draw() {
|
||||
if (active_r()) {
|
||||
// draw ridges:
|
||||
double junk;
|
||||
for (double y = -ARC+modf(offset*sin(ARC)/(W/2)/delta,&junk)*delta;;
|
||||
y += delta) {
|
||||
int y1 = int((sin(y)/sin(ARC)+1)*W/2);
|
||||
if (y1 <= 0) continue; else if (y1 >= W-1) break;
|
||||
fl_color(FL_DARK3); fl_yxline(X+y1,Y+1,Y+H-1);
|
||||
if (y < 0) y1--; else y1++;
|
||||
fl_color(FL_LIGHT1);fl_yxline(X+y1,Y+1,Y+H-1);
|
||||
for (double yy = -ARC+modf(offset*sin(ARC)/(W/2)/delta,&junk)*delta;;
|
||||
yy += delta) {
|
||||
int yy1 = int((sin(yy)/sin(ARC)+1)*W/2);
|
||||
if (yy1 <= 0) continue; else if (yy1 >= W-1) break;
|
||||
fl_color(FL_DARK3); fl_yxline(X+yy1,Y+1,Y+H-1);
|
||||
if (yy < 0) yy1--; else yy1++;
|
||||
fl_color(FL_LIGHT1);fl_yxline(X+yy1,Y+1,Y+H-1);
|
||||
}
|
||||
// draw edges:
|
||||
h1 = W/8+1; // distance from end the color inverts
|
||||
@ -139,13 +139,13 @@ void Fl_Roller::draw() {
|
||||
if (active_r()) {
|
||||
// draw ridges:
|
||||
double junk;
|
||||
for (double y = -ARC+modf(offset*sin(ARC)/(H/2)/delta,&junk)*delta;
|
||||
; y += delta) {
|
||||
int y1 = int((sin(y)/sin(ARC)+1)*H/2);
|
||||
if (y1 <= 0) continue; else if (y1 >= H-1) break;
|
||||
fl_color(FL_DARK3); fl_xyline(X+1,Y+y1,X+W-1);
|
||||
if (y < 0) y1--; else y1++;
|
||||
fl_color(FL_LIGHT1);fl_xyline(X+1,Y+y1,X+W-1);
|
||||
for (double yy = -ARC+modf(offset*sin(ARC)/(H/2)/delta,&junk)*delta;
|
||||
; yy += delta) {
|
||||
int yy1 = int((sin(yy)/sin(ARC)+1)*H/2);
|
||||
if (yy1 <= 0) continue; else if (yy1 >= H-1) break;
|
||||
fl_color(FL_DARK3); fl_xyline(X+1,Y+yy1,X+W-1);
|
||||
if (yy < 0) yy1--; else yy1++;
|
||||
fl_color(FL_LIGHT1);fl_xyline(X+1,Y+yy1,X+W-1);
|
||||
}
|
||||
// draw edges:
|
||||
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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -30,13 +30,13 @@
|
||||
#include <FL/Fl.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_Light_Button(x,y,w,h,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) {
|
||||
box(FL_NO_BOX);
|
||||
down_box(FL_ROUND_DOWN_BOX);
|
||||
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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -207,10 +207,10 @@ void Fl_Scrollbar::draw() {
|
||||
fl_color(fl_inactive(labelcolor()));
|
||||
int w1 = (H-4)/3; if (w1 < 1) w1 = 1;
|
||||
int x1 = X+(H-w1-1)/2;
|
||||
int y1 = Y+(H-2*w1-1)/2;
|
||||
fl_polygon(x1, y1+w1, x1+w1, y1+2*w1, x1+w1, y1);
|
||||
int yy1 = Y+(H-2*w1-1)/2;
|
||||
fl_polygon(x1, yy1+w1, x1+w1, yy1+2*w1, x1+w1, yy1);
|
||||
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
|
||||
if (H < 3*W) {Fl_Slider::draw(X,Y,W,H); return;}
|
||||
@ -226,10 +226,10 @@ void Fl_Scrollbar::draw() {
|
||||
fl_color(labelcolor() | 8);
|
||||
int w1 = (W-4)/3; if (w1 < 1) w1 = 1;
|
||||
int x1 = X+(W-2*w1-1)/2;
|
||||
int y1 = Y+(W-w1-1)/2;
|
||||
fl_polygon(x1, y1+w1, x1+2*w1, y1+w1, x1+w1, y1);
|
||||
y1 += H-W;
|
||||
fl_polygon(x1, y1, x1+w1, y1+w1, x1+2*w1, y1);
|
||||
int yy1 = Y+(W-w1-1)/2;
|
||||
fl_polygon(x1, yy1+w1, x1+2*w1, yy1+w1, x1+w1, yy1);
|
||||
yy1 += H-W;
|
||||
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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -33,14 +33,14 @@ void Fl_Slider::_Fl_Slider() {
|
||||
slider_ = 0; // FL_UP_BOX;
|
||||
}
|
||||
|
||||
Fl_Slider::Fl_Slider(int x, int y, int w, int h, const char* l)
|
||||
: Fl_Valuator(x, y, w, h, l) {
|
||||
Fl_Slider::Fl_Slider(int X, int Y, int W, int H, const char* l)
|
||||
: Fl_Valuator(X, Y, W, H, l) {
|
||||
box(FL_DOWN_BOX);
|
||||
_Fl_Slider();
|
||||
}
|
||||
|
||||
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_Slider::Fl_Slider(uchar t, int X, int Y, int W, int H, const char* l)
|
||||
: Fl_Valuator(X, Y, W, H, l) {
|
||||
type(t);
|
||||
box(t==FL_HOR_NICE_SLIDER || t==FL_VERT_NICE_SLIDER ?
|
||||
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
|
||||
// w = window, number of lines displayed
|
||||
// t = top, number of first line
|
||||
// l = length, total number of lines
|
||||
step(1, 1);
|
||||
if (p+w > t+l) l = p+w-t;
|
||||
slider_size(w >= l ? 1.0 : double(w)/double(l));
|
||||
bounds(t, l-w+t);
|
||||
if (p+W > t+l) l = p+W-t;
|
||||
slider_size(W >= l ? 1.0 : double(W)/double(l));
|
||||
bounds(t, l-W+t);
|
||||
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,
|
||||
// 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
|
||||
draw_box();
|
||||
}
|
||||
Fl_Color black = active_r() ? FL_FOREGROUND_COLOR : FL_INACTIVE_COLOR;
|
||||
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) {
|
||||
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;
|
||||
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;
|
||||
}
|
||||
|
||||
int W = (horizontal() ? w : h);
|
||||
int X, S;
|
||||
int ww = (horizontal() ? W : H);
|
||||
int xx, S;
|
||||
if (type()==FL_HOR_FILL_SLIDER || type() == FL_VERT_FILL_SLIDER) {
|
||||
S = int(val*W+.5);
|
||||
if (minimum()>maximum()) {S = W-S; X = W-S;}
|
||||
else X = 0;
|
||||
S = int(val*ww+.5);
|
||||
if (minimum()>maximum()) {S = ww-S; xx = ww-S;}
|
||||
else xx = 0;
|
||||
} else {
|
||||
S = int(slider_size_*W+.5);
|
||||
int T = (horizontal() ? h : w)/2+1;
|
||||
S = int(slider_size_*ww+.5);
|
||||
int T = (horizontal() ? H : W)/2+1;
|
||||
if (type()==FL_VERT_NICE_SLIDER || type()==FL_HOR_NICE_SLIDER) T += 4;
|
||||
if (S < T) S = T;
|
||||
X = int(val*(W-S)+.5);
|
||||
xx = int(val*(ww-S)+.5);
|
||||
}
|
||||
int xsl, ysl, wsl, hsl;
|
||||
if (horizontal()) {
|
||||
xsl = x+X;
|
||||
xsl = X+xx;
|
||||
wsl = S;
|
||||
ysl = y;
|
||||
hsl = h;
|
||||
ysl = Y;
|
||||
hsl = H;
|
||||
} else {
|
||||
ysl = y+X;
|
||||
ysl = Y+xx;
|
||||
hsl = S;
|
||||
xsl = x;
|
||||
wsl = w;
|
||||
xsl = X;
|
||||
wsl = W;
|
||||
}
|
||||
|
||||
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
|
||||
if (X > 0) {
|
||||
if (horizontal()) fl_clip(x, ysl, X, hsl);
|
||||
else fl_clip(xsl, y, wsl, X);
|
||||
draw_bg(x, y, w, h);
|
||||
if (xx > 0) {
|
||||
if (horizontal()) fl_clip(X, ysl, xx, hsl);
|
||||
else fl_clip(xsl, Y, wsl, xx);
|
||||
draw_bg(X, Y, W, H);
|
||||
fl_pop_clip();
|
||||
}
|
||||
if (X+S < W) {
|
||||
if (horizontal()) fl_clip(xsl+wsl, ysl, x+w-xsl-wsl, hsl);
|
||||
else fl_clip(xsl, ysl+hsl, wsl, y+h-ysl-hsl);
|
||||
draw_bg(x, y, w, h);
|
||||
if (xx+S < W) {
|
||||
if (horizontal()) fl_clip(xsl+wsl, ysl, X+W-xsl-wsl, hsl);
|
||||
else fl_clip(xsl, ysl+hsl, wsl, Y+H-ysl-hsl);
|
||||
draw_bg(X, Y, W, H);
|
||||
fl_pop_clip();
|
||||
}
|
||||
}
|
||||
@ -177,10 +177,10 @@ void Fl_Slider::draw() {
|
||||
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) {
|
||||
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);
|
||||
handle_push();
|
||||
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;
|
||||
}
|
||||
|
||||
int W = (horizontal() ? w : h);
|
||||
int mx = (horizontal() ? Fl::event_x()-x : Fl::event_y()-y);
|
||||
int ww = (horizontal() ? W : H);
|
||||
int mx = (horizontal() ? Fl::event_x()-X : Fl::event_y()-Y);
|
||||
int S;
|
||||
static int offcenter;
|
||||
|
||||
@ -203,41 +203,41 @@ int Fl_Slider::handle(int event, int x, int y, int w, int h) {
|
||||
|
||||
S = 0;
|
||||
if (event == FL_PUSH) {
|
||||
int X = int(val*W+.5);
|
||||
offcenter = mx-X;
|
||||
int xx = int(val*ww+.5);
|
||||
offcenter = mx-xx;
|
||||
if (offcenter < -10 || offcenter > 10) offcenter = 0;
|
||||
else return 1;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
S = int(slider_size_*W+.5); if (S >= W) return 0;
|
||||
int T = (horizontal() ? h : w)/2+1;
|
||||
S = int(slider_size_*ww+.5); if (S >= ww) return 0;
|
||||
int T = (horizontal() ? H : W)/2+1;
|
||||
if (type()==FL_VERT_NICE_SLIDER || type()==FL_HOR_NICE_SLIDER) T += 4;
|
||||
if (S < T) S = T;
|
||||
if (event == FL_PUSH) {
|
||||
int X = int(val*(W-S)+.5);
|
||||
offcenter = mx-X;
|
||||
int xx = int(val*(ww-S)+.5);
|
||||
offcenter = mx-xx;
|
||||
if (offcenter < 0) offcenter = 0;
|
||||
else if (offcenter > S) offcenter = S;
|
||||
else return 1;
|
||||
}
|
||||
}
|
||||
|
||||
int X = mx-offcenter;
|
||||
int xx = mx-offcenter;
|
||||
double v;
|
||||
char tryAgain = 1;
|
||||
while (tryAgain)
|
||||
{
|
||||
tryAgain = 0;
|
||||
if (X < 0) {
|
||||
X = 0;
|
||||
if (xx < 0) {
|
||||
xx = 0;
|
||||
offcenter = mx; if (offcenter < 0) offcenter = 0;
|
||||
} else if (X > (W-S)) {
|
||||
X = W-S;
|
||||
offcenter = mx-X; if (offcenter > S) offcenter = S;
|
||||
} else if (xx > (ww-S)) {
|
||||
xx = ww-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:
|
||||
if (event == FL_PUSH && v == value()) {
|
||||
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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -43,7 +43,7 @@
|
||||
// or by EXTRASPACE or by zero.
|
||||
// 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;
|
||||
Fl_Widget*const* a = array();
|
||||
int i;
|
||||
@ -55,16 +55,16 @@ int Fl_Tabs::tab_positions(int* p, int* w) {
|
||||
int wt = 0; int ht = 0;
|
||||
o->measure_label(wt,ht);
|
||||
|
||||
w[i] = wt+EXTRASPACE;
|
||||
p[i+1] = p[i]+w[i]+BORDER;
|
||||
wp[i] = wt+EXTRASPACE;
|
||||
p[i+1] = p[i]+wp[i]+BORDER;
|
||||
}
|
||||
int r = this->w();
|
||||
int r = w();
|
||||
if (p[i] <= r) return selected;
|
||||
// uh oh, they are too big:
|
||||
// pack them against right edge:
|
||||
p[i] = r;
|
||||
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] <= l) break;
|
||||
p[i] = l;
|
||||
@ -74,12 +74,12 @@ int Fl_Tabs::tab_positions(int* p, int* w) {
|
||||
for (i = 0; i<children(); i++) {
|
||||
if (p[i] >= i*EXTRASPACE) break;
|
||||
p[i] = i*EXTRASPACE;
|
||||
int W = this->w()-1-EXTRASPACE*(children()-i) - p[i];
|
||||
if (w[i] > W) w[i] = W;
|
||||
int W = w()-1-EXTRASPACE*(children()-i) - p[i];
|
||||
if (wp[i] > W) wp[i] = W;
|
||||
}
|
||||
// adjust edges according to visiblity:
|
||||
for (i = children(); i > selected; i--) {
|
||||
p[i] = p[i-1]+w[i-1];
|
||||
p[i] = p[i-1]+wp[i-1];
|
||||
}
|
||||
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_x < x()) return 0;
|
||||
int p[128], w[128];
|
||||
tab_positions(p, w);
|
||||
int p[128], wp[128];
|
||||
tab_positions(p, wp);
|
||||
for (int i=0; i<children(); 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 (damage() & (FL_DAMAGE_EXPOSE|FL_DAMAGE_ALL)) {
|
||||
int p[128]; int w[128];
|
||||
int selected = tab_positions(p,w);
|
||||
int p[128]; int wp[128];
|
||||
int selected = tab_positions(p,wp);
|
||||
int i;
|
||||
Fl_Widget*const* a = array();
|
||||
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--)
|
||||
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) {
|
||||
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 $".
|
||||
//
|
||||
|
@ -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.
|
||||
// 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
|
||||
*/
|
||||
void Fl_Text_Buffer::text( const char *t ) {
|
||||
int length, deletedLength;
|
||||
int insertedLength, deletedLength;
|
||||
const char *deletedText;
|
||||
|
||||
/* 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 );
|
||||
|
||||
/* Start a new buffer with a gap of PREFERRED_GAP_SIZE in the center */
|
||||
length = strlen( t );
|
||||
mBuf = (char *)malloc( length + PREFERRED_GAP_SIZE );
|
||||
mLength = length;
|
||||
mGapStart = length / 2;
|
||||
insertedLength = strlen( t );
|
||||
mBuf = (char *)malloc( insertedLength + PREFERRED_GAP_SIZE );
|
||||
mLength = insertedLength;
|
||||
mGapStart = insertedLength / 2;
|
||||
mGapEnd = mGapStart + PREFERRED_GAP_SIZE;
|
||||
memcpy( mBuf, t, mGapStart );
|
||||
memcpy( &mBuf[ mGapEnd ], &t[ mGapStart ], length - mGapStart );
|
||||
memcpy( &mBuf[ mGapEnd ], &t[ mGapStart ], insertedLength - mGapStart );
|
||||
#ifdef PURIFY
|
||||
{ int i; for ( i = mGapStart; i < mGapEnd; i++ ) mBuf[ i ] = '.'; }
|
||||
#endif
|
||||
@ -154,7 +154,7 @@ void Fl_Text_Buffer::text( const char *t ) {
|
||||
update_selections( 0, deletedLength, 0 );
|
||||
|
||||
/* 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 );
|
||||
}
|
||||
|
||||
@ -164,15 +164,15 @@ void Fl_Text_Buffer::text( const char *t ) {
|
||||
** include the character pointed to by "end"
|
||||
*/
|
||||
char * Fl_Text_Buffer::text_range( int start, int end ) {
|
||||
char * text;
|
||||
int length, part1Length;
|
||||
char * s;
|
||||
int copiedLength, part1Length;
|
||||
|
||||
/* 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 < 0 || start > mLength ) {
|
||||
text = (char *)malloc( 1 );
|
||||
text[ 0 ] = '\0';
|
||||
return text;
|
||||
s = (char *)malloc( 1 );
|
||||
s[ 0 ] = '\0';
|
||||
return s;
|
||||
}
|
||||
if ( end < start ) {
|
||||
int temp = start;
|
||||
@ -181,21 +181,21 @@ char * Fl_Text_Buffer::text_range( int start, int end ) {
|
||||
}
|
||||
if ( end > mLength )
|
||||
end = mLength;
|
||||
length = end - start;
|
||||
text = (char *)malloc( length + 1 );
|
||||
copiedLength = end - start;
|
||||
s = (char *)malloc( copiedLength + 1 );
|
||||
|
||||
/* Copy the text from the buffer to the returned string */
|
||||
if ( end <= mGapStart ) {
|
||||
memcpy( text, &mBuf[ start ], length );
|
||||
memcpy( s, &mBuf[ start ], copiedLength );
|
||||
} else if ( start >= mGapStart ) {
|
||||
memcpy( text, &mBuf[ start + ( mGapEnd - mGapStart ) ], length );
|
||||
memcpy( s, &mBuf[ start + ( mGapEnd - mGapStart ) ], copiedLength );
|
||||
} else {
|
||||
part1Length = mGapStart - start;
|
||||
memcpy( text, &mBuf[ start ], part1Length );
|
||||
memcpy( &text[ part1Length ], &mBuf[ mGapEnd ], length - part1Length );
|
||||
memcpy( s, &mBuf[ start ], part1Length );
|
||||
memcpy( &s[ part1Length ], &mBuf[ mGapEnd ], copiedLength - part1Length );
|
||||
}
|
||||
text[ length ] = '\0';
|
||||
return text;
|
||||
s[ copiedLength ] = '\0';
|
||||
return s;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -213,7 +213,7 @@ char Fl_Text_Buffer::character( int pos ) {
|
||||
/*
|
||||
** 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;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* insert and redisplay */
|
||||
nInserted = insert_( pos, text );
|
||||
nInserted = insert_( pos, s );
|
||||
mCursorPosHint = pos + nInserted;
|
||||
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
|
||||
** 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;
|
||||
int nInserted;
|
||||
|
||||
deletedText = text_range( start, end );
|
||||
remove_( start, end );
|
||||
nInserted = insert_( start, text );
|
||||
nInserted = insert_( start, s );
|
||||
mCursorPosHint = start + nInserted;
|
||||
call_modify_callbacks( start, end - start, nInserted, 0, 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,
|
||||
int fromEnd, int toPos ) {
|
||||
int length = fromEnd - fromStart;
|
||||
int copiedLength = fromEnd - fromStart;
|
||||
int part1Length;
|
||||
|
||||
/* 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 buffer with a gap large enough to accomodate the new text and a
|
||||
gap of PREFERRED_GAP_SIZE */
|
||||
if ( length > mGapEnd - mGapStart )
|
||||
reallocate_with_gap( toPos, length + PREFERRED_GAP_SIZE );
|
||||
if ( copiedLength > mGapEnd - mGapStart )
|
||||
reallocate_with_gap( toPos, copiedLength + PREFERRED_GAP_SIZE );
|
||||
else if ( toPos != mGapStart )
|
||||
move_gap( toPos );
|
||||
|
||||
/* Insert the new text (toPos now corresponds to the start of the gap) */
|
||||
if ( fromEnd <= fromBuf->mGapStart ) {
|
||||
memcpy( &mBuf[ toPos ], &fromBuf->mBuf[ fromStart ], length );
|
||||
memcpy( &mBuf[ toPos ], &fromBuf->mBuf[ fromStart ], copiedLength );
|
||||
} else if ( fromStart >= fromBuf->mGapStart ) {
|
||||
memcpy( &mBuf[ toPos ],
|
||||
&fromBuf->mBuf[ fromStart + ( fromBuf->mGapEnd - fromBuf->mGapStart ) ],
|
||||
length );
|
||||
copiedLength );
|
||||
} else {
|
||||
part1Length = fromBuf->mGapStart - fromStart;
|
||||
memcpy( &mBuf[ toPos ], &fromBuf->mBuf[ fromStart ], part1Length );
|
||||
memcpy( &mBuf[ toPos + part1Length ], &fromBuf->mBuf[ fromBuf->mGapEnd ],
|
||||
length - part1Length );
|
||||
copiedLength - part1Length );
|
||||
}
|
||||
mGapStart += length;
|
||||
mLength += length;
|
||||
update_selections( toPos, 0, length );
|
||||
mGapStart += copiedLength;
|
||||
mLength += copiedLength;
|
||||
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
|
||||
** 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 nLines, lineStartPos, nDeleted, insertDeleted, nInserted;
|
||||
const char *deletedText;
|
||||
|
||||
nLines = countLines( text );
|
||||
nLines = countLines( s );
|
||||
lineStartPos = line_start( startPos );
|
||||
nDeleted = line_end( skip_lines( startPos, nLines ) ) -
|
||||
lineStartPos;
|
||||
deletedText = text_range( lineStartPos, lineStartPos + nDeleted );
|
||||
insert_column_( column, lineStartPos, text, &insertDeleted, &nInserted,
|
||||
insert_column_( column, lineStartPos, s, &insertDeleted, &nInserted,
|
||||
&mCursorPosHint );
|
||||
if ( nDeleted != insertDeleted )
|
||||
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.
|
||||
*/
|
||||
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;
|
||||
const char *deletedText;
|
||||
|
||||
nLines = countLines( text );
|
||||
nLines = countLines( s );
|
||||
lineStartPos = line_start( startPos );
|
||||
nDeleted = line_end( skip_lines( startPos, nLines ) ) -
|
||||
lineStartPos;
|
||||
deletedText = text_range( lineStartPos, lineStartPos + nDeleted );
|
||||
overlay_rectangular_( lineStartPos, rectStart, rectEnd, text, &insertDeleted,
|
||||
overlay_rectangular_( lineStartPos, rectStart, rectEnd, s, &insertDeleted,
|
||||
&nInserted, &mCursorPosHint );
|
||||
if ( nDeleted != insertDeleted )
|
||||
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.
|
||||
*/
|
||||
void Fl_Text_Buffer::replace_rectangular( int start, int end, int rectStart,
|
||||
int rectEnd, const char *text ) {
|
||||
int rectEnd, const char *s ) {
|
||||
char *insPtr;
|
||||
const char *deletedText;
|
||||
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
|
||||
lines in the buffer at the end of the rectangle to make room for the
|
||||
additional lines in "text" */
|
||||
nInsertedLines = countLines( text );
|
||||
nInsertedLines = countLines( s );
|
||||
nDeletedLines = count_lines( start, end );
|
||||
if ( nInsertedLines < nDeletedLines ) {
|
||||
insLen = strlen( text );
|
||||
insLen = strlen( s );
|
||||
insText = (char *)malloc( insLen + nDeletedLines - nInsertedLines + 1 );
|
||||
strcpy( insText, text );
|
||||
strcpy( insText, s );
|
||||
insPtr = insText + insLen;
|
||||
for ( i = 0; i < nDeletedLines - nInsertedLines; i++ )
|
||||
*insPtr++ = '\n';
|
||||
@ -543,8 +543,8 @@ void Fl_Text_Buffer::remove_selection() {
|
||||
remove_selection_( &mPrimary );
|
||||
}
|
||||
|
||||
void Fl_Text_Buffer::replace_selection( const char *text ) {
|
||||
replace_selection_( &mPrimary, text );
|
||||
void Fl_Text_Buffer::replace_selection( const char *s ) {
|
||||
replace_selection_( &mPrimary, s );
|
||||
}
|
||||
|
||||
void Fl_Text_Buffer::secondary_select( int start, int end ) {
|
||||
@ -583,8 +583,8 @@ void Fl_Text_Buffer::remove_secondary_selection() {
|
||||
remove_selection_( &mSecondary );
|
||||
}
|
||||
|
||||
void Fl_Text_Buffer::replace_secondary_selection( const char *text ) {
|
||||
replace_selection_( &mSecondary, text );
|
||||
void Fl_Text_Buffer::replace_secondary_selection( const char *s ) {
|
||||
replace_selection_( &mSecondary, s );
|
||||
}
|
||||
|
||||
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
|
||||
** 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 ];
|
||||
|
||||
/* 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-
|
||||
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
|
||||
buffer's null substitution character */
|
||||
if ( histogram[ 0 ] != 0 )
|
||||
subsChars( string, length, '\0', mNullSubsChar );
|
||||
subsChars( string, len, '\0', mNullSubsChar );
|
||||
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
|
||||
** the buffer (i.e. not past the end).
|
||||
*/
|
||||
int Fl_Text_Buffer::insert_( int pos, const char *text ) {
|
||||
int length = strlen( text );
|
||||
int Fl_Text_Buffer::insert_( int pos, const char *s ) {
|
||||
int insertedLength = strlen( s );
|
||||
|
||||
/* 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 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
|
||||
gap of PREFERRED_GAP_SIZE */
|
||||
if ( length > mGapEnd - mGapStart )
|
||||
reallocate_with_gap( pos, length + PREFERRED_GAP_SIZE );
|
||||
if ( insertedLength > mGapEnd - mGapStart )
|
||||
reallocate_with_gap( pos, insertedLength + PREFERRED_GAP_SIZE );
|
||||
else if ( pos != mGapStart )
|
||||
move_gap( pos );
|
||||
|
||||
/* Insert the new text (pos now corresponds to the start of the gap) */
|
||||
memcpy( &mBuf[ pos ], text, length );
|
||||
mGapStart += length;
|
||||
mLength += length;
|
||||
update_selections( pos, 0, length );
|
||||
memcpy( &mBuf[ pos ], s, insertedLength );
|
||||
mGapStart += insertedLength;
|
||||
mLength += insertedLength;
|
||||
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 nLines, lineStart, lineEnd, len, endOffset;
|
||||
char *outStr, *outPtr, *expText;
|
||||
const char *text, *line;
|
||||
const char *s, *line;
|
||||
|
||||
/* 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
|
||||
@ -1313,9 +1313,9 @@ void Fl_Text_Buffer::remove_rectangular_( int start, int end, int rectStart,
|
||||
start = line_start( start );
|
||||
end = line_end( end );
|
||||
nLines = count_lines( start, end ) + 1;
|
||||
text = text_range( start, end );
|
||||
expText = expandTabs( text, 0, mTabDist, mNullSubsChar, &len );
|
||||
free( (void *) text );
|
||||
s = text_range( start, end );
|
||||
expText = expandTabs( s, 0, mTabDist, mNullSubsChar, &len );
|
||||
free( (void *) s );
|
||||
free( (void *) expText );
|
||||
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 );
|
||||
}
|
||||
|
||||
void Fl_Text_Selection::set( int start, int end ) {
|
||||
mSelected = start != end;
|
||||
void Fl_Text_Selection::set( int startpos, int endpos ) {
|
||||
mSelected = startpos != endpos;
|
||||
mRectangular = 0;
|
||||
mStart = min( start, end );
|
||||
mEnd = max( start, end );
|
||||
mStart = min( startpos, endpos );
|
||||
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 ) {
|
||||
mSelected = rectStart < rectEnd;
|
||||
mRectangular = 1;
|
||||
mStart = start;
|
||||
mEnd = end;
|
||||
mStart = startpos;
|
||||
mEnd = endpos;
|
||||
mRectStart = rectStart;
|
||||
mRectEnd = rectEnd;
|
||||
}
|
||||
|
||||
int Fl_Text_Selection::position( int *start, int *end ) {
|
||||
int Fl_Text_Selection::position( int *startpos, int *endpos ) {
|
||||
if ( !mSelected )
|
||||
return 0;
|
||||
*start = mStart;
|
||||
*end = mEnd;
|
||||
*startpos = mStart;
|
||||
*endpos = mEnd;
|
||||
|
||||
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 ) {
|
||||
if ( !mSelected )
|
||||
return 0;
|
||||
*isRect = mRectangular;
|
||||
*start = mStart;
|
||||
*end = mEnd;
|
||||
*startpos = mStart;
|
||||
*endpos = mEnd;
|
||||
if ( mRectangular ) {
|
||||
*rectStart = mRectStart;
|
||||
*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 ) {
|
||||
int start, end, isRect, rectStart, rectEnd;
|
||||
char *text;
|
||||
char *s;
|
||||
|
||||
/* If there's no selection, return an allocated empty string */
|
||||
if ( !sel->position( &start, &end, &isRect, &rectStart, &rectEnd ) ) {
|
||||
text = (char *)malloc( 1 );
|
||||
*text = '\0';
|
||||
return text;
|
||||
s = (char *)malloc( 1 );
|
||||
*s = '\0';
|
||||
return s;
|
||||
}
|
||||
|
||||
/* 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 );
|
||||
}
|
||||
|
||||
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;
|
||||
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 */
|
||||
if ( isRect )
|
||||
replace_rectangular( start, end, rectStart, rectEnd, text );
|
||||
replace_rectangular( start, end, rectStart, rectEnd, s );
|
||||
else
|
||||
replace( start, end, text );
|
||||
replace( start, end, s );
|
||||
|
||||
/* Unselect (happens automatically in BufReplace, but BufReplaceRect
|
||||
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 $".
|
||||
//
|
||||
|
@ -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.
|
||||
// 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();
|
||||
}
|
||||
|
||||
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) {
|
||||
damage_range1_start = start;
|
||||
damage_range1_end = end;
|
||||
} else if ((start >= damage_range1_start && start <= damage_range1_end) ||
|
||||
(end >= damage_range1_start && end <= damage_range1_end)) {
|
||||
damage_range1_start = min(damage_range1_start, start);
|
||||
damage_range1_end = max(damage_range1_end, end);
|
||||
damage_range1_start = startpos;
|
||||
damage_range1_end = endpos;
|
||||
} else if ((startpos >= damage_range1_start && startpos <= damage_range1_end) ||
|
||||
(endpos >= damage_range1_start && endpos <= damage_range1_end)) {
|
||||
damage_range1_start = min(damage_range1_start, startpos);
|
||||
damage_range1_end = max(damage_range1_end, endpos);
|
||||
} else if (damage_range2_start == -1 && damage_range2_end == -1) {
|
||||
damage_range2_start = start;
|
||||
damage_range2_end = end;
|
||||
damage_range2_start = startpos;
|
||||
damage_range2_end = endpos;
|
||||
} else {
|
||||
damage_range2_start = min(damage_range2_start, start);
|
||||
damage_range2_end = max(damage_range2_end, end);
|
||||
damage_range2_start = min(damage_range2_start, startpos);
|
||||
damage_range2_end = max(damage_range2_end, endpos);
|
||||
}
|
||||
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
|
||||
** 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;
|
||||
|
||||
/* If the range is outside of the displayed text, just return */
|
||||
if ( end < mFirstChar || ( start > mLastChar &&
|
||||
!empty_vlines() ) )
|
||||
return;
|
||||
if ( endpos < mFirstChar || ( startpos > mLastChar &&
|
||||
!empty_vlines() ) ) return;
|
||||
|
||||
/* Clean up the starting and ending values */
|
||||
if ( start < 0 ) start = 0;
|
||||
if ( start > mBuffer->length() ) start = mBuffer->length();
|
||||
if ( end < 0 ) end = 0;
|
||||
if ( end > mBuffer->length() ) end = mBuffer->length();
|
||||
if ( startpos < 0 ) startpos = 0;
|
||||
if ( startpos > mBuffer->length() ) startpos = mBuffer->length();
|
||||
if ( endpos < 0 ) endpos = 0;
|
||||
if ( endpos > mBuffer->length() ) endpos = mBuffer->length();
|
||||
|
||||
/* Get the starting and ending lines */
|
||||
if ( start < mFirstChar )
|
||||
start = mFirstChar;
|
||||
if ( !position_to_line( start, &startLine ) )
|
||||
if ( startpos < mFirstChar )
|
||||
startpos = mFirstChar;
|
||||
if ( !position_to_line( startpos, &startLine ) )
|
||||
startLine = mNVisibleLines - 1;
|
||||
if ( end >= mLastChar ) {
|
||||
if ( endpos >= mLastChar ) {
|
||||
lastLine = mNVisibleLines - 1;
|
||||
} else {
|
||||
if ( !position_to_line( end, &lastLine ) ) {
|
||||
if ( !position_to_line( endpos, &lastLine ) ) {
|
||||
/* shouldn't happen */
|
||||
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 */
|
||||
startIndex = mLineStarts[ startLine ] == -1 ? 0 :
|
||||
start - mLineStarts[ startLine ];
|
||||
if ( end >= mLastChar )
|
||||
startpos - mLineStarts[ startLine ];
|
||||
if ( endpos >= mLastChar )
|
||||
endIndex = INT_MAX;
|
||||
else if ( mLineStarts[ lastLine ] == -1 )
|
||||
endIndex = 0;
|
||||
else
|
||||
endIndex = end - mLineStarts[ lastLine ];
|
||||
endIndex = endpos - mLineStarts[ lastLine ];
|
||||
|
||||
/* If the starting and ending lines are the same, redisplay the single
|
||||
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. */
|
||||
|
||||
Fl_Font font = textfont();
|
||||
int size = textsize();
|
||||
int fsize = textsize();
|
||||
Fl_Color foreground;
|
||||
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;
|
||||
|
||||
styleRec = mStyleTable + si;
|
||||
font = styleRec->font;
|
||||
size = styleRec->size;
|
||||
font = styleRec->font;
|
||||
fsize = styleRec->size;
|
||||
|
||||
if ( style & (HIGHLIGHT_MASK | PRIMARY_MASK) ) {
|
||||
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_rectf( X, Y, toX - X, mMaxsize );
|
||||
fl_color( foreground );
|
||||
fl_font( font, size );
|
||||
fl_font( font, fsize );
|
||||
fl_draw( string, nChars, X, Y + mMaxsize - fl_descent());
|
||||
|
||||
// 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 ) {
|
||||
Fl_Font font;
|
||||
int size;
|
||||
int fsize;
|
||||
|
||||
if ( style & STYLE_LOOKUP_MASK ) {
|
||||
int si = (style & STYLE_LOOKUP_MASK) - 'A';
|
||||
if (si < 0) si = 0;
|
||||
else if (si >= mNStyles) si = mNStyles - 1;
|
||||
|
||||
font = mStyleTable[si].font;
|
||||
size = mStyleTable[si].size;
|
||||
font = mStyleTable[si].font;
|
||||
fsize = mStyleTable[si].size;
|
||||
} else {
|
||||
font = textfont();
|
||||
size = textsize();
|
||||
font = textfont();
|
||||
fsize = textsize();
|
||||
}
|
||||
fl_font( font, size );
|
||||
fl_font( font, fsize );
|
||||
|
||||
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
|
||||
** 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();
|
||||
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
|
||||
range to show the text color/and font changes as well. */
|
||||
if ( sel->selected() ) {
|
||||
if ( sel->start() < *start ) {
|
||||
*start = sel->start();
|
||||
if ( sel->start() < *startpos ) {
|
||||
*startpos = sel->start();
|
||||
extended = 1;
|
||||
}
|
||||
if ( sel->end() > *end ) {
|
||||
*end = sel->end();
|
||||
if ( sel->end() > *endpos ) {
|
||||
*endpos = sel->end();
|
||||
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
|
||||
redraw characters exposed by possible font size changes */
|
||||
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.
|
||||
@ -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 $".
|
||||
//
|
||||
|
@ -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.
|
||||
// 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::bound_key_function(int key, int state, Key_Binding* list) {
|
||||
Key_Binding* current;
|
||||
for (current = list; current; current = current->next)
|
||||
if (current->key == key)
|
||||
if (current->state == FL_TEXT_EDITOR_ANY_STATE || current->state == state)
|
||||
Key_Binding* cur;
|
||||
for (cur = list; cur; cur = cur->next)
|
||||
if (cur->key == key)
|
||||
if (cur->state == FL_TEXT_EDITOR_ANY_STATE || cur->state == state)
|
||||
break;
|
||||
if (!current) return 0;
|
||||
return current->function;
|
||||
if (!cur) return 0;
|
||||
return cur->function;
|
||||
}
|
||||
|
||||
void
|
||||
Fl_Text_Editor::remove_all_key_bindings(Key_Binding** list) {
|
||||
Key_Binding *current, *next;
|
||||
for (current = *list; current; current = next) {
|
||||
next = current->next;
|
||||
delete current;
|
||||
Key_Binding *cur, *next;
|
||||
for (cur = *list; cur; cur = next) {
|
||||
next = cur->next;
|
||||
delete cur;
|
||||
}
|
||||
*list = 0;
|
||||
}
|
||||
|
||||
void
|
||||
Fl_Text_Editor::remove_key_binding(int key, int state, Key_Binding** list) {
|
||||
Key_Binding *current, *last = 0;
|
||||
for (current = *list; current; last = current, current = current->next)
|
||||
if (current->key == key && current->state == state) break;
|
||||
if (!current) return;
|
||||
if (last) last->next = current->next;
|
||||
else *list = current->next;
|
||||
delete current;
|
||||
Key_Binding *cur, *last = 0;
|
||||
for (cur = *list; cur; last = cur, cur = cur->next)
|
||||
if (cur->key == key && cur->state == state) break;
|
||||
if (!cur) return;
|
||||
if (last) last->next = cur->next;
|
||||
else *list = cur->next;
|
||||
delete cur;
|
||||
}
|
||||
|
||||
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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -82,15 +82,15 @@ void Fl_Tile::resize(int X,int Y,int W,int H) {
|
||||
p += 8;
|
||||
for (int i=children(); i--;) {
|
||||
Fl_Widget* o = *a++;
|
||||
int X = o->x()+dx;
|
||||
int R = X+o->w();
|
||||
if (*p++ >= OR) X += dw; else if (X > NR) X = NR;
|
||||
int xx = o->x()+dx;
|
||||
int R = xx+o->w();
|
||||
if (*p++ >= OR) xx += dw; else if (xx > NR) xx = NR;
|
||||
if (*p++ >= OR) R += dw; else if (R > NR) R = NR;
|
||||
int Y = o->y()+dy;
|
||||
int B = Y+o->h();
|
||||
if (*p++ >= OB) Y += dh; else if (Y > NB) Y = NB;
|
||||
int yy = o->y()+dy;
|
||||
int B = yy+o->h();
|
||||
if (*p++ >= OB) yy += dh; else if (yy > NB) yy = 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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -130,11 +130,11 @@ tt_exit(Fl_Widget *w) {
|
||||
}
|
||||
|
||||
static void
|
||||
tt_enter(Fl_Widget* widget) {
|
||||
tt_enter(Fl_Widget* wp) {
|
||||
// printf("tt_enter(widget=%p)\n", widget);
|
||||
// printf(" window=%p\n", window);
|
||||
// find the enclosing group with a tooltip:
|
||||
Fl_Widget* w = widget;
|
||||
Fl_Widget* w = wp;
|
||||
while (w && !w->tooltip()) {
|
||||
//if (w == window) return; // don't do anything if pointed at tooltip
|
||||
w = w->parent();
|
||||
@ -142,7 +142,7 @@ tt_enter(Fl_Widget* widget) {
|
||||
if (!w) {
|
||||
Fl_Tooltip::enter_area(0, 0, 0, 0, 0, 0);
|
||||
} 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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -116,12 +116,12 @@ double Fl_Valuator::increment(double v, int n) {
|
||||
int Fl_Valuator::format(char* buffer) {
|
||||
double v = value();
|
||||
if (!A) return sprintf(buffer, "%g", v);
|
||||
int i, x;
|
||||
int i, X;
|
||||
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);
|
||||
}
|
||||
|
||||
//
|
||||
// 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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -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_Valuator(x, y, w, h, l), input(x, y, w, h, 0) {
|
||||
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) {
|
||||
soft_ = 0;
|
||||
if (input.parent()) // defeat automatic-add
|
||||
((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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -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_Valuator(x,y,w,h,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) {
|
||||
box(FL_NO_BOX);
|
||||
align(FL_ALIGN_LEFT);
|
||||
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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -28,8 +28,8 @@
|
||||
#include <FL/fl_draw.H>
|
||||
#include <math.h>
|
||||
|
||||
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_Value_Slider::Fl_Value_Slider(int X, int Y, int W, int H, const char*l)
|
||||
: Fl_Slider(X,Y,W,H,l) {
|
||||
step(1,100);
|
||||
textfont_ = FL_HELVETICA;
|
||||
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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -117,8 +117,8 @@ void Fl::default_atclose(Fl_Window* window, void* v) {
|
||||
|
||||
void (*Fl::atclose)(Fl_Window*, void*) = default_atclose;
|
||||
|
||||
void Fl_Window::default_callback(Fl_Window* window, void* v) {
|
||||
Fl::atclose(window, v);
|
||||
void Fl_Window::default_callback(Fl_Window* win, void* v) {
|
||||
Fl::atclose(win, v);
|
||||
}
|
||||
|
||||
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 $".
|
||||
//
|
||||
|
@ -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.
|
||||
//
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
|
||||
FILE *f;
|
||||
uchar *data;
|
||||
uchar *ptr;
|
||||
|
||||
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];
|
||||
|
||||
// read the data:
|
||||
for (i = 0, data = (uchar *)array; i < n;) {
|
||||
for (i = 0, ptr = (uchar *)array; i < n;) {
|
||||
if (!fgets(buffer,1024,f)) {
|
||||
fclose(f);
|
||||
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) {
|
||||
int t;
|
||||
if (sscanf(a," 0x%x",&t)>0) {
|
||||
*data++ = t;
|
||||
*ptr++ = t;
|
||||
i ++;
|
||||
}
|
||||
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 $".
|
||||
//
|
||||
|
@ -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.
|
||||
//
|
||||
@ -77,9 +77,9 @@ Fl_XPM_Image::Fl_XPM_Image(const char *name) : Fl_Pixmap((char *const*)0) {
|
||||
q++;
|
||||
int n = 0;
|
||||
for (int x = 0; x < 3; x++) {
|
||||
int d = hexdigit(*q);
|
||||
if (d > 15) break;
|
||||
n = (n<<4)+d;
|
||||
int xd = hexdigit(*q);
|
||||
if (xd > 15) break;
|
||||
n = (n<<4)+xd;
|
||||
q++;
|
||||
}
|
||||
*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') {
|
||||
c -= '0';
|
||||
for (int x=0; x<2; x++) {
|
||||
int d = hexdigit(*q);
|
||||
if (d>7) break;
|
||||
c = (c<<3)+d;
|
||||
int xd = hexdigit(*q);
|
||||
if (xd>7) break;
|
||||
c = (c<<3)+xd;
|
||||
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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -47,10 +47,10 @@ int XParseGeometry(const char*, int*, int*, unsigned int*, unsigned int*);
|
||||
# define YNegative 0x0020
|
||||
#endif
|
||||
|
||||
static int match(const char *a, const char *match, int atleast = 1) {
|
||||
const char *b = match;
|
||||
static int fl_match(const char *a, const char *s, int atleast = 1) {
|
||||
const char *b = s;
|
||||
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:
|
||||
@ -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;}
|
||||
s++; // point after the dash
|
||||
|
||||
if (match(s, "iconic")) {
|
||||
if (fl_match(s, "iconic")) {
|
||||
fl_show_iconic = 1;
|
||||
i++;
|
||||
return 1;
|
||||
} else if (match(s, "kbd")) {
|
||||
} else if (fl_match(s, "kbd")) {
|
||||
Fl::visible_focus(1);
|
||||
i++;
|
||||
return 1;
|
||||
} else if (match(s, "nokbd", 3)) {
|
||||
} else if (fl_match(s, "nokbd", 3)) {
|
||||
Fl::visible_focus(0);
|
||||
i++;
|
||||
return 1;
|
||||
} else if (match(s, "dnd", 2)) {
|
||||
} else if (fl_match(s, "dnd", 2)) {
|
||||
Fl::dnd_text_ops(1);
|
||||
i++;
|
||||
return 1;
|
||||
} else if (match(s, "nodnd", 3)) {
|
||||
} else if (fl_match(s, "nodnd", 3)) {
|
||||
Fl::dnd_text_ops(0);
|
||||
i++;
|
||||
return 1;
|
||||
} else if (match(s, "tooltips", 2)) {
|
||||
} else if (fl_match(s, "tooltips", 2)) {
|
||||
Fl_Tooltip::enable();
|
||||
i++;
|
||||
return 1;
|
||||
} else if (match(s, "notooltips", 3)) {
|
||||
} else if (fl_match(s, "notooltips", 3)) {
|
||||
Fl_Tooltip::disable();
|
||||
i++;
|
||||
return 1;
|
||||
@ -114,7 +114,7 @@ int Fl::arg(int argc, char **argv, int &i) {
|
||||
if (i >= argc-1 || !v)
|
||||
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;
|
||||
flags = XParseGeometry(v, &gx, &gy, &gw, &gh);
|
||||
@ -122,26 +122,26 @@ int Fl::arg(int argc, char **argv, int &i) {
|
||||
geometry = v;
|
||||
|
||||
#if !defined(WIN32) && !defined(__APPLE__)
|
||||
} else if (match(s, "display", 2)) {
|
||||
} else if (fl_match(s, "display", 2)) {
|
||||
Fl::display(v);
|
||||
#endif
|
||||
|
||||
} else if (match(s, "title", 2)) {
|
||||
} else if (fl_match(s, "title", 2)) {
|
||||
title = v;
|
||||
|
||||
} else if (match(s, "name", 2)) {
|
||||
} else if (fl_match(s, "name", 2)) {
|
||||
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;
|
||||
|
||||
} 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;
|
||||
|
||||
} 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;
|
||||
|
||||
} else if (match(s, "scheme", 1)) {
|
||||
} else if (fl_match(s, "scheme", 1)) {
|
||||
Fl::scheme(v);
|
||||
|
||||
} else return 0; // unrecognized
|
||||
@ -203,17 +203,17 @@ void Fl_Window::show(int argc, char **argv) {
|
||||
static char beenhere;
|
||||
if (!beenhere) {
|
||||
if (geometry) {
|
||||
int flags = 0, gx = x(), gy = y(); unsigned int gw = w(), gh = h();
|
||||
flags = XParseGeometry(geometry, &gx, &gy, &gw, &gh);
|
||||
if (flags & XNegative) gx = Fl::w()-w()+gx;
|
||||
if (flags & YNegative) gy = Fl::h()-h()+gy;
|
||||
int fl = 0, gx = x(), gy = y(); unsigned int gw = w(), gh = h();
|
||||
fl = XParseGeometry(geometry, &gx, &gy, &gw, &gh);
|
||||
if (fl & XNegative) gx = Fl::w()-w()+gx;
|
||||
if (fl & YNegative) gy = Fl::h()-h()+gy;
|
||||
// int mw,mh; minsize(mw,mh);
|
||||
// if (mw > gw) gw = mw;
|
||||
// if (mh > gh) gh = mh;
|
||||
Fl_Widget *r = resizable();
|
||||
if (!r) resizable(this);
|
||||
// for WIN32 we assumme window is not mapped yet:
|
||||
if (flags & (XValue | YValue))
|
||||
if (fl & (XValue | YValue))
|
||||
x(-1), resize(gx,gy,gw,gh);
|
||||
else
|
||||
size(gw,gh);
|
||||
@ -412,5 +412,5 @@ int XParseGeometry(const char* string, int* x, int* y,
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -245,7 +245,7 @@ int Fl::scheme(const char *s) {
|
||||
}
|
||||
|
||||
int Fl::reload_scheme() {
|
||||
Fl_Window *w;
|
||||
Fl_Window *win;
|
||||
|
||||
get_system_colors();
|
||||
|
||||
@ -270,7 +270,7 @@ int Fl::reload_scheme() {
|
||||
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...
|
||||
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...
|
||||
for (w = first_window(); w; w = next_window(w)) {
|
||||
w->labeltype(scheme_bg_ ? FL_NORMAL_LABEL : FL_NO_LABEL);
|
||||
w->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
|
||||
w->image(scheme_bg_);
|
||||
w->redraw();
|
||||
for (win = first_window(); win; win = next_window(win)) {
|
||||
win->labeltype(scheme_bg_ ? FL_NORMAL_LABEL : FL_NO_LABEL);
|
||||
win->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
|
||||
win->image(scheme_bg_);
|
||||
win->redraw();
|
||||
}
|
||||
|
||||
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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -49,8 +49,8 @@ extern HWND fl_capture;
|
||||
extern WindowRef fl_capture;
|
||||
#endif
|
||||
|
||||
void Fl::grab(Fl_Window* w) {
|
||||
if (w) {
|
||||
void Fl::grab(Fl_Window* win) {
|
||||
if (win) {
|
||||
if (!grab_) {
|
||||
#ifdef WIN32
|
||||
SetActiveWindow(fl_capture = fl_xid(first_window()));
|
||||
@ -77,7 +77,7 @@ void Fl::grab(Fl_Window* w) {
|
||||
fl_event_time);
|
||||
#endif
|
||||
}
|
||||
grab_ = w;
|
||||
grab_ = win;
|
||||
} else {
|
||||
if (grab_) {
|
||||
#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 $".
|
||||
//
|
||||
|
138
src/Fl_x.cxx
138
src/Fl_x.cxx
@ -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).
|
||||
//
|
||||
@ -117,8 +117,8 @@ void Fl::add_fd(int n, int events, void (*cb)(int, void*), void *v) {
|
||||
# endif
|
||||
}
|
||||
|
||||
void Fl::add_fd(int fd, void (*cb)(int, void*), void* v) {
|
||||
Fl::add_fd(fd, POLLIN, cb, v);
|
||||
void Fl::add_fd(int n, void (*cb)(int, void*), void* v) {
|
||||
Fl::add_fd(n, POLLIN, cb, v);
|
||||
}
|
||||
|
||||
void Fl::remove_fd(int n, int events) {
|
||||
@ -368,13 +368,13 @@ int Fl::w() {
|
||||
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();
|
||||
Window root = RootWindow(fl_display, fl_screen);
|
||||
Window c; int mx,my,cx,cy; unsigned int mask;
|
||||
XQueryPointer(fl_display,root,&root,&c,&mx,&my,&cx,&cy,&mask);
|
||||
x = mx;
|
||||
y = my;
|
||||
xx = mx;
|
||||
yy = my;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
@ -516,7 +516,7 @@ int fl_handle(const XEvent& xevent)
|
||||
if (!fl_selection_requestor) return 0;
|
||||
static unsigned char* buffer;
|
||||
if (buffer) {XFree(buffer); buffer = 0;}
|
||||
long read = 0;
|
||||
long bytesread = 0;
|
||||
if (fl_xevent->xselection.property) for (;;) {
|
||||
// The Xdnd code pastes 64K chunks together, possibly to avoid
|
||||
// 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,
|
||||
fl_xevent->xselection.requestor,
|
||||
fl_xevent->xselection.property,
|
||||
read/4, 65536, 1, 0,
|
||||
bytesread/4, 65536, 1, 0,
|
||||
&actual, &format, &count, &remaining,
|
||||
&portion)) break; // quit on error
|
||||
if (read) { // append to the accumulated buffer
|
||||
buffer = (unsigned char*)realloc(buffer, read+count*format/8+remaining);
|
||||
memcpy(buffer+read, portion, count*format/8);
|
||||
if (bytesread) { // append to the accumulated buffer
|
||||
buffer = (unsigned char*)realloc(buffer, bytesread+count*format/8+remaining);
|
||||
memcpy(buffer+bytesread, portion, count*format/8);
|
||||
XFree(portion);
|
||||
} else { // Use the first section without moving the memory:
|
||||
buffer = portion;
|
||||
}
|
||||
read += count*format/8;
|
||||
bytesread += count*format/8;
|
||||
if (!remaining) break;
|
||||
}
|
||||
Fl::e_text = (char*)buffer;
|
||||
Fl::e_length = read;
|
||||
Fl::e_length = bytesread;
|
||||
fl_selection_requestor->handle(FL_PASTE);
|
||||
// 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
|
||||
@ -914,17 +914,17 @@ void Fl_Window::resize(int X,int Y,int W,int H) {
|
||||
|
||||
void fl_fix_focus(); // in Fl.cxx
|
||||
|
||||
Fl_X* Fl_X::set_xid(Fl_Window* w, Window xid) {
|
||||
Fl_X* x = new Fl_X;
|
||||
x->xid = xid;
|
||||
x->other_xid = 0;
|
||||
x->setwindow(w);
|
||||
x->next = Fl_X::first;
|
||||
x->region = 0;
|
||||
x->wait_for_expose = 1;
|
||||
Fl_X::first = x;
|
||||
if (w->modal()) {Fl::modal_ = w; fl_fix_focus();}
|
||||
return x;
|
||||
Fl_X* Fl_X::set_xid(Fl_Window* win, Window winxid) {
|
||||
Fl_X* xp = new Fl_X;
|
||||
xp->xid = winxid;
|
||||
xp->other_xid = 0;
|
||||
xp->setwindow(win);
|
||||
xp->next = Fl_X::first;
|
||||
xp->region = 0;
|
||||
xp->wait_for_expose = 1;
|
||||
Fl_X::first = xp;
|
||||
if (win->modal()) {Fl::modal_ = win; fl_fix_focus();}
|
||||
return xp;
|
||||
}
|
||||
|
||||
// More commonly a subclass calls this, because it hides the really
|
||||
@ -945,25 +945,25 @@ ExposureMask|StructureNotifyMask
|
||||
|EnterWindowMask|LeaveWindowMask
|
||||
|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()
|
||||
|
||||
int X = w->x();
|
||||
int Y = w->y();
|
||||
int W = w->w();
|
||||
int X = win->x();
|
||||
int Y = win->y();
|
||||
int W = win->w();
|
||||
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 (!w->parent() && !Fl::grab()) {
|
||||
if (!win->parent() && !Fl::grab()) {
|
||||
// center windows in case window manager does not do anything:
|
||||
if (!(w->flags() & Fl_Window::FL_FORCE_POSITION)) {
|
||||
w->x(X = (Fl::w()-W)/2);
|
||||
w->y(Y = (Fl::h()-H)/2);
|
||||
if (!(win->flags() & Fl_Window::FL_FORCE_POSITION)) {
|
||||
win->x(X = (Fl::w()-W)/2);
|
||||
win->y(Y = (Fl::h()-H)/2);
|
||||
}
|
||||
// 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:
|
||||
if (w->border()) {
|
||||
if (win->border()) {
|
||||
// ensure border is on screen:
|
||||
// (assumme extremely minimal dimensions for this border)
|
||||
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;
|
||||
}
|
||||
|
||||
ulong root = w->parent() ?
|
||||
fl_xid(w->window()) : RootWindow(fl_display, fl_screen);
|
||||
ulong root = win->parent() ?
|
||||
fl_xid(win->window()) : RootWindow(fl_display, fl_screen);
|
||||
|
||||
XSetWindowAttributes attr;
|
||||
int mask = CWBorderPixel|CWColormap|CWEventMask|CWBitGravity;
|
||||
attr.event_mask = w->parent() ? childEventMask : XEventMask;
|
||||
attr.event_mask = win->parent() ? childEventMask : XEventMask;
|
||||
attr.colormap = colormap;
|
||||
attr.border_pixel = 0;
|
||||
attr.bit_gravity = 0; // StaticGravity;
|
||||
if (w->override()) {
|
||||
if (win->override()) {
|
||||
attr.override_redirect = 1;
|
||||
attr.save_under = 1;
|
||||
mask |= CWOverrideRedirect | CWSaveUnder;
|
||||
} else attr.override_redirect = 0;
|
||||
if (Fl::grab()) {
|
||||
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) {
|
||||
attr.background_pixel = fl_background_pixel;
|
||||
@ -1006,54 +1006,54 @@ void Fl_X::make_xid(Fl_Window* w, XVisualInfo *visual, Colormap colormap)
|
||||
mask |= CWBackPixel;
|
||||
}
|
||||
|
||||
Fl_X* x =
|
||||
set_xid(w, XCreateWindow(fl_display,
|
||||
root,
|
||||
X, Y, W, H,
|
||||
0, // borderwidth
|
||||
visual->depth,
|
||||
InputOutput,
|
||||
visual->visual,
|
||||
mask, &attr));
|
||||
Fl_X* xp =
|
||||
set_xid(win, XCreateWindow(fl_display,
|
||||
root,
|
||||
X, Y, W, H,
|
||||
0, // borderwidth
|
||||
visual->depth,
|
||||
InputOutput,
|
||||
visual->visual,
|
||||
mask, &attr));
|
||||
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:
|
||||
|
||||
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);
|
||||
|
||||
// send size limits and border:
|
||||
x->sendxjunk();
|
||||
xp->sendxjunk();
|
||||
|
||||
// set the class property, which controls the icon used:
|
||||
if (w->xclass()) {
|
||||
if (win->xclass()) {
|
||||
char buffer[1024];
|
||||
char *p; const char *q;
|
||||
// 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;
|
||||
// create the capitalized version:
|
||||
q = buffer;
|
||||
*p = toupper(*q++); if (*p++ == 'X') *p++ = toupper(*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);
|
||||
}
|
||||
|
||||
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":
|
||||
Fl_Window* w = x->next->w;
|
||||
while (w->parent()) w = w->window();
|
||||
XSetTransientForHint(fl_display, x->xid, fl_xid(w));
|
||||
if (!w->visible()) showit = 0; // guess that wm will not show it
|
||||
Fl_Window* wp = xp->next->w;
|
||||
while (wp->parent()) wp = wp->window();
|
||||
XSetTransientForHint(fl_display, xp->xid, fl_xid(wp));
|
||||
if (!wp->visible()) showit = 0; // guess that wm will not show it
|
||||
}
|
||||
|
||||
// Make it receptive to DnD:
|
||||
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);
|
||||
|
||||
XWMHints hints;
|
||||
@ -1065,18 +1065,18 @@ void Fl_X::make_xid(Fl_Window* w, XVisualInfo *visual, Colormap colormap)
|
||||
fl_show_iconic = 0;
|
||||
showit = 0;
|
||||
}
|
||||
if (w->icon()) {
|
||||
hints.icon_pixmap = (Pixmap)w->icon();
|
||||
if (win->icon()) {
|
||||
hints.icon_pixmap = (Pixmap)win->icon();
|
||||
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) {
|
||||
w->set_visible();
|
||||
w->handle(FL_SHOW); // get child windows to appear
|
||||
w->redraw();
|
||||
win->set_visible();
|
||||
win->handle(FL_SHOW); // get child windows to appear
|
||||
win->redraw();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1233,5 +1233,5 @@ void Fl_Window::make_current() {
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -287,13 +287,13 @@ void Fl_Widget::draw_box(Fl_Boxtype b, Fl_Color c) const {
|
||||
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 {
|
||||
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;
|
||||
}
|
||||
|
||||
//
|
||||
// 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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -265,7 +265,7 @@ static struct TableEntry {
|
||||
|
||||
void Fl_Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) {
|
||||
if (!shown()) return;
|
||||
Cursor cursor;
|
||||
Cursor xc;
|
||||
int deleteit = 0;
|
||||
if (c == FL_CURSOR_DEFAULT) {
|
||||
c = cursor_default;
|
||||
@ -274,7 +274,7 @@ void Fl_Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) {
|
||||
}
|
||||
|
||||
if (!c) {
|
||||
cursor = None;
|
||||
xc = None;
|
||||
} else {
|
||||
if (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, p);
|
||||
}
|
||||
cursor = q->cursor;
|
||||
xc = q->cursor;
|
||||
} else {
|
||||
cursor = XCreateFontCursor(fl_display, (c-1)*2);
|
||||
xc = XCreateFontCursor(fl_display, (c-1)*2);
|
||||
deleteit = 1;
|
||||
}
|
||||
XColor fgc;
|
||||
@ -303,14 +303,14 @@ void Fl_Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) {
|
||||
XColor bgc;
|
||||
Fl::get_color(bg,r,g,b);
|
||||
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);
|
||||
if (deleteit) XFreeCursor(fl_display, cursor);
|
||||
XDefineCursor(fl_display, fl_xid(this), xc);
|
||||
if (deleteit) XFreeCursor(fl_display, xc);
|
||||
}
|
||||
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -44,15 +44,15 @@ void fl_curve(double X0, double Y0,
|
||||
fl_transformed_vertex(x,y);
|
||||
|
||||
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 y2 = fl_transform_y(X2,Y2);
|
||||
double x3 = fl_transform_x(X3,Y3);
|
||||
double y3 = fl_transform_y(X3,Y3);
|
||||
|
||||
// find the area:
|
||||
double a = fabs((x-x2)*(y3-y1)-(y-y2)*(x3-x1));
|
||||
double b = fabs((x-x3)*(y2-y1)-(y-y3)*(x2-x1));
|
||||
double a = fabs((x-x2)*(y3-yy1)-(y-y2)*(x3-x1));
|
||||
double b = fabs((x-x3)*(y2-yy1)-(y-y3)*(x2-x1));
|
||||
if (b > a) a = b;
|
||||
|
||||
// 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;
|
||||
|
||||
// calculate the coefficients of 3rd order equation:
|
||||
double ya = (y3-3*y2+3*y1-y);
|
||||
double yb = 3*(y2-2*y1+y);
|
||||
double yc = 3*(y1-y);
|
||||
double ya = (y3-3*y2+3*yy1-y);
|
||||
double yb = 3*(y2-2*yy1+y);
|
||||
double yc = 3*(yy1-y);
|
||||
// calculate the forward differences:
|
||||
double dy1 = ((ya*e+yb)*e+yc)*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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -86,7 +86,7 @@ int Fl::dnd() {
|
||||
fl_local_grab = grabfunc;
|
||||
Window target_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);
|
||||
|
||||
while (Fl::pushed()) {
|
||||
@ -110,25 +110,25 @@ int Fl::dnd() {
|
||||
if (new_window != target_window) {
|
||||
if (local_window) {
|
||||
local_handle(FL_DND_LEAVE, local_window);
|
||||
} else if (version) {
|
||||
} else if (dndversion) {
|
||||
fl_sendClientMessage(target_window, fl_XdndLeave, source_window);
|
||||
}
|
||||
version = new_version;
|
||||
dndversion = new_version;
|
||||
target_window = new_window;
|
||||
local_window = new_local_window;
|
||||
if (local_window) {
|
||||
local_handle(FL_DND_ENTER, local_window);
|
||||
} else if (version) {
|
||||
} else if (dndversion) {
|
||||
fl_sendClientMessage(target_window, fl_XdndEnter, source_window,
|
||||
version<<24, XA_STRING, 0, 0);
|
||||
dndversion<<24, XA_STRING, 0, 0);
|
||||
}
|
||||
}
|
||||
if (local_window) {
|
||||
local_handle(FL_DND_DRAG, local_window);
|
||||
} else if (version) {
|
||||
} else if (dndversion) {
|
||||
fl_sendClientMessage(target_window, fl_XdndPosition, source_window,
|
||||
0, (e_x_root<<16)|e_y_root, fl_event_time,
|
||||
fl_XdndActionCopy);
|
||||
0, (e_x_root<<16)|e_y_root, fl_event_time,
|
||||
fl_XdndActionCopy);
|
||||
}
|
||||
Fl::wait();
|
||||
}
|
||||
@ -136,9 +136,9 @@ int Fl::dnd() {
|
||||
if (local_window) {
|
||||
fl_i_own_selection[0] = 1;
|
||||
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,
|
||||
0, fl_event_time);
|
||||
0, fl_event_time);
|
||||
} else if (target_window) {
|
||||
// fake a drop by clicking the middle mouse button:
|
||||
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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -63,7 +63,7 @@
|
||||
# include "Fl_XColor.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 scanline_add;
|
||||
static int scanline_mask;
|
||||
@ -358,16 +358,16 @@ static void figure_out_visual() {
|
||||
XPixmapFormatValues *pfv;
|
||||
for (pfv = pfvlist; pfv < pfvlist+FL_NUM_pfv; pfv++)
|
||||
if (pfv->depth == fl_visual->depth) break;
|
||||
i.format = ZPixmap;
|
||||
i.byte_order = ImageByteOrder(fl_display);
|
||||
xi.format = ZPixmap;
|
||||
xi.byte_order = ImageByteOrder(fl_display);
|
||||
//i.bitmap_unit = 8;
|
||||
//i.bitmap_bit_order = MSBFirst;
|
||||
//i.bitmap_pad = 8;
|
||||
i.depth = fl_visual->depth;
|
||||
i.bits_per_pixel = pfv->bits_per_pixel;
|
||||
xi.depth = fl_visual->depth;
|
||||
xi.bits_per_pixel = pfv->bits_per_pixel;
|
||||
|
||||
if (i.bits_per_pixel & 7) bytes_per_pixel = 0; // produce fatal error
|
||||
else bytes_per_pixel = i.bits_per_pixel/8;
|
||||
if (xi.bits_per_pixel & 7) bytes_per_pixel = 0; // produce fatal error
|
||||
else bytes_per_pixel = xi.bits_per_pixel/8;
|
||||
|
||||
unsigned int n = pfv->scanline_pad/8;
|
||||
if (pfv->scanline_pad & 7 || (n&(n-1)))
|
||||
@ -383,7 +383,7 @@ static void figure_out_visual() {
|
||||
return;
|
||||
}
|
||||
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
|
||||
|
||||
// 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
|
||||
// 24 or more bits per integer.
|
||||
# ifdef U16
|
||||
::i.byte_order = WORDS_BIGENDIAN;
|
||||
xi.byte_order = WORDS_BIGENDIAN;
|
||||
# else
|
||||
::i.byte_order = 1;
|
||||
xi.byte_order = 1;
|
||||
# endif
|
||||
if (rs == 11 && gs == 6 && bs == 0 && fl_extrashift == 3) {
|
||||
converter = c565_converter;
|
||||
@ -412,7 +412,7 @@ static void figure_out_visual() {
|
||||
break;
|
||||
|
||||
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) {
|
||||
converter = rgb_converter;
|
||||
mono_converter = rrr_converter;
|
||||
@ -425,7 +425,7 @@ static void figure_out_visual() {
|
||||
break;
|
||||
|
||||
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;}
|
||||
if (rs == 0 && gs == 8 && bs == 16) {
|
||||
converter = xbgr_converter;
|
||||
@ -440,14 +440,14 @@ static void figure_out_visual() {
|
||||
converter = xrgb_converter;
|
||||
mono_converter = xrrr_converter;
|
||||
} else {
|
||||
::i.byte_order = WORDS_BIGENDIAN;
|
||||
xi.byte_order = WORDS_BIGENDIAN;
|
||||
converter = color32_converter;
|
||||
mono_converter = mono32_converter;
|
||||
}
|
||||
break;
|
||||
|
||||
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;
|
||||
|
||||
if (!bytes_per_pixel) figure_out_visual();
|
||||
i.width = w;
|
||||
i.height = h;
|
||||
xi.width = w;
|
||||
xi.height = h;
|
||||
|
||||
void (*conv)(const uchar *from, uchar *to, int w, int delta) = 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
|
||||
conv == rgb_converter && delta==3
|
||||
) && !(linedelta&scanline_add)) {
|
||||
i.data = (char *)(buf+delta*dx+linedelta*dy);
|
||||
i.bytes_per_line = linedelta;
|
||||
xi.data = (char *)(buf+delta*dx+linedelta*dy);
|
||||
xi.bytes_per_line = linedelta;
|
||||
|
||||
} else {
|
||||
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 = new STORETYPE[size];
|
||||
}}
|
||||
i.data = (char *)buffer;
|
||||
i.bytes_per_line = linesize*sizeof(STORETYPE);
|
||||
xi.data = (char *)buffer;
|
||||
xi.bytes_per_line = linesize*sizeof(STORETYPE);
|
||||
if (buf) {
|
||||
buf += delta*dx+linedelta*dy;
|
||||
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;
|
||||
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 {
|
||||
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);
|
||||
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;
|
||||
@ -570,5 +570,5 @@ void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) {
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -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++) {
|
||||
const uchar *p = *data++;
|
||||
// the first 1 or 2 characters are the color index:
|
||||
int index = *p++;
|
||||
int ind = *p++;
|
||||
uchar* c;
|
||||
if (chars_per_pixel>1) {
|
||||
#ifdef U64
|
||||
U64* colors = d.byte1[index];
|
||||
if (!colors) colors = d.byte1[index] = new U64[256];
|
||||
U64* colors = d.byte1[ind];
|
||||
if (!colors) colors = d.byte1[ind] = new U64[256];
|
||||
#else
|
||||
U32* colors = d.byte1[index];
|
||||
if (!colors) colors = d.byte1[index] = new U32[256];
|
||||
U32* colors = d.byte1[ind];
|
||||
if (!colors) colors = d.byte1[ind] = new U32[256];
|
||||
#endif
|
||||
c = (uchar*)&colors[*p];
|
||||
index = (index<<8)+*p++;
|
||||
ind = (ind<<8)+*p++;
|
||||
} else {
|
||||
c = (uchar *)&d.colors[index];
|
||||
c = (uchar *)&d.colors[ind];
|
||||
}
|
||||
// look for "c word", or last word if none:
|
||||
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
|
||||
// "bg" should be transparent...
|
||||
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;
|
||||
uchar* bitmap = new uchar[W * d.h];
|
||||
*fl_mask_bitmap = bitmap;
|
||||
for (int y = 0; y < d.h; y++) {
|
||||
const uchar* p = data[y];
|
||||
for (int Y = 0; Y < d.h; Y++) {
|
||||
const uchar* p = data[Y];
|
||||
if (chars_per_pixel <= 1) {
|
||||
for (int x = 0; x < W; x++) {
|
||||
for (int X = 0; X < W; X++) {
|
||||
int b = (*p++ != transparent_index);
|
||||
if (*p++ != transparent_index) b |= 2;
|
||||
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;
|
||||
}
|
||||
} else {
|
||||
for (int x = 0; x < W; x++) {
|
||||
for (int X = 0; X < W; X++) {
|
||||
int b = 0;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
int index = *p++;
|
||||
index = (index<<8) | (*p++);
|
||||
if (index != transparent_index) b |= (1<<i);
|
||||
int ind = *p++;
|
||||
ind = (ind<<8) | (*p++);
|
||||
if (ind != transparent_index) b |= (1<<i);
|
||||
}
|
||||
*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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -181,14 +181,14 @@ int fl_old_shortcut(const char* s) {
|
||||
|
||||
// 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];
|
||||
if (!c || !label) return 0;
|
||||
if (!c || !l) return 0;
|
||||
for (;;) {
|
||||
if (!*label) return 0;
|
||||
if (*label++ == '&' && *label) {
|
||||
if (*label == '&') label++;
|
||||
else if (*label == c) return 1;
|
||||
if (!*l) return 0;
|
||||
if (*l++ == '&' && *l) {
|
||||
if (*l == '&') l++;
|
||||
else if (*l == c) return 1;
|
||||
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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -56,14 +56,14 @@ ColorMenu::ColorMenu(Fl_Color oldcol) :
|
||||
|
||||
void ColorMenu::drawbox(Fl_Color c) {
|
||||
if (c < 0 || c > 255) return;
|
||||
int x = (c%8)*BOXSIZE+BORDER;
|
||||
int y = (c/8)*BOXSIZE+BORDER;
|
||||
int X = (c%8)*BOXSIZE+BORDER;
|
||||
int Y = (c/8)*BOXSIZE+BORDER;
|
||||
#if BORDER_WIDTH < 3
|
||||
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);
|
||||
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(c == which ? FL_DOWN_BOX : FL_BORDER_BOX,
|
||||
x, y, BOXSIZE+1, BOXSIZE+1, c);
|
||||
X, Y, BOXSIZE+1, BOXSIZE+1, c);
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -26,8 +26,8 @@
|
||||
#include <FL/forms.H>
|
||||
|
||||
Fl_FormsBitmap::Fl_FormsBitmap(
|
||||
Fl_Boxtype t, int x, int y, int w, int h, const char* l)
|
||||
: Fl_Widget(x, y, w, h, l) {
|
||||
Fl_Boxtype t, int X, int Y, int W, int H, const char* l)
|
||||
: Fl_Widget(X, Y, W, H, l) {
|
||||
box(t);
|
||||
b = 0;
|
||||
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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -60,9 +60,9 @@ void Fl_Group::forms_end() {
|
||||
int Y = o->h();
|
||||
Fl_Widget*const* a = array();
|
||||
for (int i=children(); i--;) {
|
||||
Fl_Widget* o = *a++;
|
||||
int newy = Y-o->y()-o->h();
|
||||
o->y(newy);
|
||||
Fl_Widget* ow = *a++;
|
||||
int newy = Y-ow->y()-ow->h();
|
||||
ow->y(newy);
|
||||
}
|
||||
}
|
||||
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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -37,9 +37,9 @@ void Fl_Free::step(void *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_Widget(x,y,w,h,l) {
|
||||
Fl_Widget(X,Y,W,H,l) {
|
||||
type(t);
|
||||
hfunc = hdl;
|
||||
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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -26,8 +26,8 @@
|
||||
#include <FL/forms.H>
|
||||
|
||||
Fl_FormsPixmap::Fl_FormsPixmap(
|
||||
Fl_Boxtype t, int x, int y, int w, int h, const char* l)
|
||||
: Fl_Widget(x, y, w, h, l) {
|
||||
Fl_Boxtype t, int X, int Y, int W, int H, const char* l)
|
||||
: Fl_Widget(X, Y, W, H, l) {
|
||||
box(t);
|
||||
b = 0;
|
||||
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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -126,8 +126,8 @@ Fl_Timer::~Fl_Timer() {
|
||||
Fl::remove_timeout(stepcb, this);
|
||||
}
|
||||
|
||||
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_Timer::Fl_Timer(uchar t, int X, int Y, int W, int H, const char* l)
|
||||
: Fl_Widget(X, Y, W, H, l) {
|
||||
box(FL_DOWN_BOX);
|
||||
selection_color(FL_RED);
|
||||
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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
//
|
||||
@ -127,9 +127,9 @@ int Fl_Glut_Window::handle(int event) {
|
||||
break;
|
||||
} else {
|
||||
if (special) {
|
||||
int i = Fl::event_key();
|
||||
if (i > FL_F && i <= FL_F_Last) i = i-FL_F;
|
||||
special(i,ex,ey);
|
||||
int k = Fl::event_key();
|
||||
if (k > FL_F && k <= FL_F_Last) k -= FL_F;
|
||||
special(k,ex,ey);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
@ -167,11 +167,11 @@ void Fl_Glut_Window::_init() {
|
||||
mode(glut_mode);
|
||||
}
|
||||
|
||||
Fl_Glut_Window::Fl_Glut_Window(int w, int h, const char *t) :
|
||||
Fl_Gl_Window(w,h,t) {_init();}
|
||||
Fl_Glut_Window::Fl_Glut_Window(int W, int H, const char *t) :
|
||||
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_Gl_Window(x,y,w,h,t) {_init();}
|
||||
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();}
|
||||
|
||||
static int initargc;
|
||||
static char **initargv;
|
||||
@ -402,5 +402,5 @@ int glutLayerGet(GLenum type) {
|
||||
#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 $".
|
||||
//
|
||||
|
@ -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).
|
||||
*
|
||||
@ -60,15 +60,15 @@ static int numericsort(struct dirent **A, struct dirent **B, int cs) {
|
||||
const char* b = (*B)->d_name;
|
||||
int ret = 0;
|
||||
for (;;) {
|
||||
if (isdigit((unsigned)*a) && isdigit((unsigned)*b)) {
|
||||
if (isdigit(*a & 255) && isdigit(*b & 255)) {
|
||||
int diff,magdiff;
|
||||
while (*a == '0') a++;
|
||||
while (*b == '0') b++;
|
||||
while (isdigit((unsigned)*a) && *a == *b) {a++; b++;}
|
||||
diff = (isdigit((unsigned)*a) && isdigit((unsigned)*b)) ? *a - *b : 0;
|
||||
while (isdigit(*a & 255) && *a == *b) {a++; b++;}
|
||||
diff = (isdigit(*a & 255) && isdigit(*b & 255)) ? *a - *b : 0;
|
||||
magdiff = 0;
|
||||
while (isdigit((unsigned)*a)) {magdiff++; a++;}
|
||||
while (isdigit((unsigned)*b)) {magdiff--; b++;}
|
||||
while (isdigit(*a & 255)) {magdiff++; a++;}
|
||||
while (isdigit(*b & 255)) {magdiff--; b++;}
|
||||
if (magdiff) {ret = magdiff; break;} /* compare # of significant digits*/
|
||||
if (diff) {ret = diff; break;} /* compare first non-zero digit */
|
||||
} else {
|
||||
@ -77,7 +77,7 @@ static int numericsort(struct dirent **A, struct dirent **B, int cs) {
|
||||
if ((ret = *a-*b)) break;
|
||||
} else {
|
||||
/* compare case-insensitve */
|
||||
if ((ret = tolower((unsigned)*a)-tolower((unsigned)*b))) break;
|
||||
if ((ret = tolower(*a & 255)-tolower(*b & 255))) 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 $".
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user