From 398acd9c2a73d0d5c69bb51f7f3497e229fb367c Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 24 Jul 2012 04:37:22 +0000 Subject: STR 2705: moved all inline constructors (that I could find) from header files into source files. Even though this breaks downward compatibility, it does make dynamic linking possible for all classes. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9637 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Box.cxx | 12 +++++++++++ src/Fl_Browser.cxx | 39 ++++++++++++++++------------------- src/Fl_Button.cxx | 17 ++++++++++++++++ src/Fl_Clock.cxx | 10 +++++++++ src/Fl_Counter.cxx | 8 ++++++++ src/Fl_Dial.cxx | 17 ++++++++++++++++ src/Fl_Double_Window.cxx | 37 +++++++++++++++++++++++++++++++++ src/Fl_Group.cxx | 51 ++++++++++++++++++++++++++++++++++++++++++++++ src/Fl_Input.cxx | 33 +++++++++++------------------- src/Fl_Light_Button.cxx | 9 ++++++++ src/Fl_Menu_Bar.cxx | 6 ++++++ src/Fl_Menu_Window.cxx | 14 +++++++++++++ src/Fl_Repeat_Button.cxx | 7 +++++++ src/Fl_Return_Button.cxx | 7 +++++++ src/Fl_Round_Button.cxx | 9 ++++++++ src/Fl_Single_Window.cxx | 26 ++++++++++++++++++++++-- src/Fl_Slider.cxx | 53 ++++++++++++++++++++++++++++++++---------------- src/Fl_Sys_Menu_Bar.cxx | 9 ++++++++ src/Fl_Tile.cxx | 7 +++++++ src/Fl_Value_Slider.cxx | 8 ++++++++ 20 files changed, 318 insertions(+), 61 deletions(-) (limited to 'src') diff --git a/src/Fl_Box.cxx b/src/Fl_Box.cxx index a6d3d63c3..1dbc40468 100644 --- a/src/Fl_Box.cxx +++ b/src/Fl_Box.cxx @@ -19,6 +19,18 @@ #include #include + +Fl_Box::Fl_Box(int X, int Y, int W, int H, const char *l) +: Fl_Widget(X,Y,W,H,l) +{ +} + +Fl_Box::Fl_Box(Fl_Boxtype b, int X, int Y, int W, int H, const char *l) +: Fl_Widget(X,Y,W,H,l) +{ + box(b); +} + void Fl_Box::draw() { draw_box(); draw_label(); diff --git a/src/Fl_Browser.cxx b/src/Fl_Browser.cxx index 86e93d95a..b9c140780 100644 --- a/src/Fl_Browser.cxx +++ b/src/Fl_Browser.cxx @@ -23,11 +23,10 @@ #include #include -#if defined(FL_DLL) // really needed for c'tors for MS VC++ only #include #include #include -#endif + // I modified this from the original Forms data to use a linked list // so that the number of items in the browser and size of those items @@ -908,29 +907,27 @@ void Fl_Browser::remove_icon(int line) { icon(line,0); } -/* - The following constructors must not be in the header file(s) if we - build a shared object (DLL). Instead they are defined here to force - the constructor (and default destructor as well) to be defined in - the DLL and exported (STR #2632, #2645). - - Note: if you change any of them, do the same changes in the specific - header file as well. This redundant definition was chosen to enable - inline constructors in the header files (for static linking) as well - as those here for dynamic linking (Windows DLL). -*/ -#if defined(FL_DLL) - Fl_Hold_Browser::Fl_Hold_Browser(int X,int Y,int W,int H,const char *L) - : Fl_Browser(X,Y,W,H,L) {type(FL_HOLD_BROWSER);} +Fl_Hold_Browser::Fl_Hold_Browser(int X,int Y,int W,int H,const char *L) +: Fl_Browser(X,Y,W,H,L) +{ + type(FL_HOLD_BROWSER); +} + + +Fl_Multi_Browser::Fl_Multi_Browser(int X,int Y,int W,int H,const char *L) +: Fl_Browser(X,Y,W,H,L) +{ + type(FL_MULTI_BROWSER); +} - Fl_Multi_Browser::Fl_Multi_Browser(int X,int Y,int W,int H,const char *L) - : Fl_Browser(X,Y,W,H,L) {type(FL_MULTI_BROWSER);} - Fl_Select_Browser::Fl_Select_Browser(int X,int Y,int W,int H,const char *L) - : Fl_Browser(X,Y,W,H,L) {type(FL_SELECT_BROWSER);} +Fl_Select_Browser::Fl_Select_Browser(int X,int Y,int W,int H,const char *L) +: Fl_Browser(X,Y,W,H,L) +{ + type(FL_SELECT_BROWSER); +} -#endif // FL_DLL // // End of "$Id$". diff --git a/src/Fl_Button.cxx b/src/Fl_Button.cxx index 33196ad8d..edc26a81e 100644 --- a/src/Fl_Button.cxx +++ b/src/Fl_Button.cxx @@ -21,6 +21,9 @@ #include #include +#include +#include + Fl_Widget_Tracker *Fl_Button::key_release_tracker = 0; @@ -206,6 +209,20 @@ Fl_Button::Fl_Button(int X, int Y, int W, int H, const char *L) set_flag(SHORTCUT_LABEL); } + +Fl_Radio_Button::Fl_Radio_Button(int X,int Y,int W,int H,const char *L) +: Fl_Button(X, Y, W, H, L) { + type(FL_RADIO_BUTTON); +} + + +Fl_Toggle_Button::Fl_Toggle_Button(int X,int Y,int W,int H,const char *l) +: Fl_Button(X,Y,W,H,l) +{ + type(FL_TOGGLE_BUTTON); +} + + // // End of "$Id$". // diff --git a/src/Fl_Clock.cxx b/src/Fl_Clock.cxx index 946768b65..3926ec1b7 100644 --- a/src/Fl_Clock.cxx +++ b/src/Fl_Clock.cxx @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -204,6 +205,15 @@ Fl_Clock::~Fl_Clock() { Fl::remove_timeout(tick, this); } + +Fl_Round_Clock::Fl_Round_Clock(int X,int Y,int W,int H, const char *L) +: Fl_Clock(X, Y, W, H, L) +{ + type(FL_ROUND_CLOCK); + box(FL_NO_BOX); +} + + // // End of "$Id$". // diff --git a/src/Fl_Counter.cxx b/src/Fl_Counter.cxx index a2661e8a3..f27743df3 100644 --- a/src/Fl_Counter.cxx +++ b/src/Fl_Counter.cxx @@ -18,6 +18,7 @@ #include #include +#include #include void Fl_Counter::draw() { @@ -197,6 +198,13 @@ Fl_Counter::Fl_Counter(int X, int Y, int W, int H, const char* L) textcolor_ = FL_FOREGROUND_COLOR; } + +Fl_Simple_Counter::Fl_Simple_Counter(int X,int Y,int W,int H, const char *L) +: Fl_Counter(X,Y,W,H,L) { + type(FL_SIMPLE_COUNTER); +} + + // // End of "$Id$". // diff --git a/src/Fl_Dial.cxx b/src/Fl_Dial.cxx index 1b6202bee..a29163ddc 100644 --- a/src/Fl_Dial.cxx +++ b/src/Fl_Dial.cxx @@ -18,10 +18,13 @@ #include #include +#include +#include #include #include #include + // All angles are measured with 0 to the right and counter-clockwise /** Draws dial at given position and size. @@ -152,6 +155,20 @@ Fl_Dial::Fl_Dial(int X, int Y, int W, int H, const char* l) a2 = 315; } + +Fl_Fill_Dial::Fl_Fill_Dial(int X,int Y,int W,int H, const char *L) +: Fl_Dial(X,Y,W,H,L) { + type(FL_FILL_DIAL); +} + + +Fl_Line_Dial::Fl_Line_Dial(int X,int Y,int W,int H, const char *L) +: Fl_Dial(X,Y,W,H,L) +{ + type(FL_LINE_DIAL); +} + + // // End of "$Id$". // diff --git a/src/Fl_Double_Window.cxx b/src/Fl_Double_Window.cxx index 189cae305..713430e88 100644 --- a/src/Fl_Double_Window.cxx +++ b/src/Fl_Double_Window.cxx @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -55,6 +56,23 @@ static int can_xdbe() { } #endif + +Fl_Double_Window::Fl_Double_Window(int W, int H, const char *l) +: Fl_Window(W,H,l), + force_doublebuffering_(0) +{ + type(FL_DOUBLE_WINDOW); +} + + +Fl_Double_Window::Fl_Double_Window(int X, int Y, int W, int H, const char *l) +: Fl_Window(X,Y,W,H,l), + force_doublebuffering_(0) +{ + type(FL_DOUBLE_WINDOW); +} + + void Fl_Double_Window::show() { Fl_Window::show(); } @@ -473,6 +491,25 @@ Fl_Double_Window::~Fl_Double_Window() { hide(); } + +Fl_Overlay_Window::Fl_Overlay_Window(int W, int H, const char *l) +: Fl_Double_Window(W,H,l) +{ + overlay_ = 0; + force_doublebuffering_=1; + image(0); +} + + +Fl_Overlay_Window::Fl_Overlay_Window(int X, int Y, int W, int H, const char *l) +: Fl_Double_Window(X,Y,W,H,l) +{ + overlay_ = 0; + force_doublebuffering_=1; + image(0); +} + + // // End of "$Id$". // diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx index 2f71c02a0..695a5c48d 100644 --- a/src/Fl_Group.cxx +++ b/src/Fl_Group.cxx @@ -28,6 +28,10 @@ #include #include +#include +#include + + Fl_Group* Fl_Group::current_; // Hack: A single child is stored in the pointer to the array, while @@ -823,6 +827,53 @@ void Fl_Group::draw_outside_label(const Fl_Widget& widget) const { widget.draw_label(X,Y,W,H,(Fl_Align)a); } + +Fl_Input_Choice::Fl_Input_Choice (int X,int Y,int W,int H,const char*L) +: Fl_Group(X,Y,W,H,L) +{ + Fl_Group::box(FL_DOWN_BOX); + align(FL_ALIGN_LEFT); // default like Fl_Input + inp_ = new Fl_Input(inp_x(), inp_y(), + inp_w(), inp_h()); + inp_->callback(inp_cb, (void*)this); + inp_->box(FL_FLAT_BOX); // cosmetic + inp_->when(FL_WHEN_CHANGED|FL_WHEN_NOT_CHANGED); + menu_ = new InputMenuButton(menu_x(), menu_y(), + menu_w(), menu_h()); + menu_->callback(menu_cb, (void*)this); + menu_->box(FL_FLAT_BOX); // cosmetic + end(); +} + + +Fl_Spinner::Fl_Spinner(int X, int Y, int W, int H, const char *L) +: Fl_Group(X, Y, W, H, L), + input_(X, Y, W - H / 2 - 2, H), + up_button_(X + W - H / 2 - 2, Y, H / 2 + 2, H / 2, "@-42<"), + down_button_(X + W - H / 2 - 2, Y + H - H / 2, + H / 2 + 2, H / 2, "@-42>") +{ + end(); + + value_ = 1.0; + minimum_ = 1.0; + maximum_ = 100.0; + step_ = 1.0; + format_ = "%g"; + + align(FL_ALIGN_LEFT); + + input_.value("1"); + input_.type(FL_INT_INPUT); + input_.when(FL_WHEN_ENTER_KEY | FL_WHEN_RELEASE); + input_.callback((Fl_Callback *)sb_cb, this); + + up_button_.callback((Fl_Callback *)sb_cb, this); + + down_button_.callback((Fl_Callback *)sb_cb, this); +} + + // // End of "$Id$". // diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx index afd91e74c..92fb64b05 100644 --- a/src/Fl_Input.cxx +++ b/src/Fl_Input.cxx @@ -31,14 +31,12 @@ #include #include "flstring.h" -#if defined(FL_DLL) // really needed for c'tors for MS VC++ only #include #include #include #include #include #include -#endif #ifdef HAVE_LOCALE_H # include @@ -763,50 +761,43 @@ Fl_Input::Fl_Input(int X, int Y, int W, int H, const char *l) : Fl_Input_(X, Y, W, H, l) { } -/* - The following constructors must not be in the header file(s) if we - build a shared object (DLL). Instead they are defined here to force - the constructor (and default destructor as well) to be defined in - the DLL and exported (STR #2632). - - Note: if you change any of them, do the same changes in the specific - header file as well. This redundant definition was chosen to enable - inline constructors in the header files (for static linking) as well - as those here for dynamic linking (Windows DLL). -*/ -#if defined(FL_DLL) Fl_Float_Input::Fl_Float_Input(int X,int Y,int W,int H,const char *l) - : Fl_Input(X,Y,W,H,l) { +: Fl_Input(X,Y,W,H,l) +{ type(FL_FLOAT_INPUT); } + Fl_Int_Input::Fl_Int_Input(int X,int Y,int W,int H,const char *l) - : Fl_Input(X,Y,W,H,l) { +: Fl_Input(X,Y,W,H,l) { type(FL_INT_INPUT); } + Fl_Multiline_Input::Fl_Multiline_Input(int X,int Y,int W,int H,const char *l) - : Fl_Input(X,Y,W,H,l) { +: Fl_Input(X,Y,W,H,l) { type(FL_MULTILINE_INPUT); } + Fl_Output::Fl_Output(int X,int Y,int W,int H, const char *l) - : Fl_Input(X, Y, W, H, l) { +: Fl_Input(X, Y, W, H, l) { type(FL_NORMAL_OUTPUT); } + Fl_Multiline_Output::Fl_Multiline_Output(int X,int Y,int W,int H,const char *l) - : Fl_Output(X,Y,W,H,l) { +: Fl_Output(X,Y,W,H,l) { type(FL_MULTILINE_OUTPUT); } + Fl_Secret_Input::Fl_Secret_Input(int X,int Y,int W,int H,const char *l) - : Fl_Input(X,Y,W,H,l) { +: Fl_Input(X,Y,W,H,l) { type(FL_SECRET_INPUT); } -#endif // FL_DLL // // End of "$Id$". diff --git a/src/Fl_Light_Button.cxx b/src/Fl_Light_Button.cxx index f89da1182..b2a6cee09 100644 --- a/src/Fl_Light_Button.cxx +++ b/src/Fl_Light_Button.cxx @@ -25,6 +25,7 @@ #include #include +#include #include #include "flstring.h" @@ -160,6 +161,14 @@ Fl_Light_Button::Fl_Light_Button(int X, int Y, int W, int H, const char* l) align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); } + +Fl_Radio_Light_Button::Fl_Radio_Light_Button(int X,int Y,int W,int H,const char *l) +: Fl_Light_Button(X,Y,W,H,l) +{ + type(FL_RADIO_BUTTON); +} + + // // End of "$Id$". // diff --git a/src/Fl_Menu_Bar.cxx b/src/Fl_Menu_Bar.cxx index 31b1b24f1..3bf1a8f8d 100644 --- a/src/Fl_Menu_Bar.cxx +++ b/src/Fl_Menu_Bar.cxx @@ -64,6 +64,12 @@ int Fl_Menu_Bar::handle(int event) { return 0; } + +Fl_Menu_Bar::Fl_Menu_Bar(int X, int Y, int W, int H,const char *l) +: Fl_Menu_(X,Y,W,H,l) +{ +} + // // End of "$Id$". // diff --git a/src/Fl_Menu_Window.cxx b/src/Fl_Menu_Window.cxx index 9677b578f..28e121d0a 100644 --- a/src/Fl_Menu_Window.cxx +++ b/src/Fl_Menu_Window.cxx @@ -96,6 +96,20 @@ Fl_Menu_Window::~Fl_Menu_Window() { hide(); } + +Fl_Menu_Window::Fl_Menu_Window(int W, int H, const char *l) +: Fl_Single_Window(W,H,l) +{ + image(0); +} + + +Fl_Menu_Window::Fl_Menu_Window(int X, int Y, int W, int H, const char *l) +: Fl_Single_Window(X,Y,W,H,l) { + image(0); +} + + // // End of "$Id$". // diff --git a/src/Fl_Repeat_Button.cxx b/src/Fl_Repeat_Button.cxx index 94e6927a7..874a126e4 100644 --- a/src/Fl_Repeat_Button.cxx +++ b/src/Fl_Repeat_Button.cxx @@ -56,6 +56,13 @@ int Fl_Repeat_Button::handle(int event) { } } + +Fl_Repeat_Button::Fl_Repeat_Button(int X,int Y,int W,int H,const char *l) +: Fl_Button(X,Y,W,H,l) +{ +} + + // // End of "$Id$". // diff --git a/src/Fl_Return_Button.cxx b/src/Fl_Return_Button.cxx index 7ec0ba98b..9e144b8ec 100644 --- a/src/Fl_Return_Button.cxx +++ b/src/Fl_Return_Button.cxx @@ -59,6 +59,13 @@ int Fl_Return_Button::handle(int event) { return Fl_Button::handle(event); } + +Fl_Return_Button::Fl_Return_Button(int X, int Y, int W, int H,const char *l) +: Fl_Button(X,Y,W,H,l) +{ +} + + // // End of "$Id$". // diff --git a/src/Fl_Round_Button.cxx b/src/Fl_Round_Button.cxx index 4ca7f2ba7..d3ba77e22 100644 --- a/src/Fl_Round_Button.cxx +++ b/src/Fl_Round_Button.cxx @@ -22,6 +22,7 @@ #include #include +#include /** Creates a new Fl_Round_Button widget using the given @@ -34,6 +35,14 @@ Fl_Round_Button::Fl_Round_Button(int X,int Y,int W,int H, const char *l) selection_color(FL_FOREGROUND_COLOR); } + +Fl_Radio_Round_Button::Fl_Radio_Round_Button(int X,int Y,int W,int H,const char *L) +: Fl_Round_Button(X,Y,W,H,L) +{ + type(FL_RADIO_BUTTON); +} + + // // End of "$Id$". // diff --git a/src/Fl_Single_Window.cxx b/src/Fl_Single_Window.cxx index 3f5b55aeb..fd871a3b8 100644 --- a/src/Fl_Single_Window.cxx +++ b/src/Fl_Single_Window.cxx @@ -24,8 +24,30 @@ #include -void Fl_Single_Window::show() {Fl_Window::show();} -void Fl_Single_Window::flush() {Fl_Window::flush();} + +void Fl_Single_Window::show() +{ + Fl_Window::show(); +} + + +void Fl_Single_Window::flush() +{ + Fl_Window::flush(); +} + + +Fl_Single_Window::Fl_Single_Window(int W, int H, const char *l) +: Fl_Window(W,H,l) +{ +} + + +Fl_Single_Window::Fl_Single_Window(int X, int Y, int W, int H, const char *l) +: Fl_Window(X,Y,W,H,l) +{ +} + // // End of "$Id$". diff --git a/src/Fl_Slider.cxx b/src/Fl_Slider.cxx index a4d47eee1..648e3ce4f 100644 --- a/src/Fl_Slider.cxx +++ b/src/Fl_Slider.cxx @@ -18,13 +18,15 @@ #include #include +#include +#include +#include +#include +#include #include #include #include "flstring.h" -#if defined(FL_DLL) // really needed for c'tors for MS VC++ only -#include -#endif void Fl_Slider::_Fl_Slider() { slider_size_ = 0; @@ -359,24 +361,41 @@ int Fl_Slider::handle(int event) { h()-Fl::box_dh(box())); } -/* - The following constructor must not be in the header file if we - build a shared object (DLL). Instead it is defined here to force - the constructor (and default destructor as well) to be defined - in the DLL and exported (STR #2632). - - Note: if you the ctor here, do the same changes in the specific - header file as well. This redundant definition was chosen to enable - inline constructors in the header files (for static linking) as well - as the one here for dynamic linking (Windows DLL). -*/ -#if defined(FL_DLL) +Fl_Fill_Slider::Fl_Fill_Slider(int X,int Y,int W,int H,const char *L) +: Fl_Slider(X,Y,W,H,L) +{ + type(FL_VERT_FILL_SLIDER); +} + Fl_Hor_Slider::Fl_Hor_Slider(int X,int Y,int W,int H,const char *l) - : Fl_Slider(X,Y,W,H,l) {type(FL_HOR_SLIDER);} +: Fl_Slider(X,Y,W,H,l) { + type(FL_HOR_SLIDER); +} + + +Fl_Hor_Fill_Slider::Fl_Hor_Fill_Slider(int X,int Y,int W,int H,const char *L) +: Fl_Slider(X,Y,W,H,L) +{ + type(FL_HOR_FILL_SLIDER); +} + + +Fl_Hor_Nice_Slider::Fl_Hor_Nice_Slider(int X,int Y,int W,int H,const char *L) +: Fl_Slider(X,Y,W,H,L) +{ + type(FL_HOR_NICE_SLIDER); + box(FL_FLAT_BOX); +} + + +Fl_Nice_Slider::Fl_Nice_Slider(int X,int Y,int W,int H,const char *L) +: Fl_Slider(X,Y,W,H,L) { + type(FL_VERT_NICE_SLIDER); + box(FL_FLAT_BOX); +} -#endif // FL_DLL // // End of "$Id$". diff --git a/src/Fl_Sys_Menu_Bar.cxx b/src/Fl_Sys_Menu_Bar.cxx index 7a161cbc2..b3ed78073 100644 --- a/src/Fl_Sys_Menu_Bar.cxx +++ b/src/Fl_Sys_Menu_Bar.cxx @@ -273,6 +273,15 @@ void Fl_Sys_Menu_Bar::replace(int rank, const char *name) void Fl_Sys_Menu_Bar::draw() { } + +Fl_Sys_Menu_Bar::Fl_Sys_Menu_Bar(int x,int y,int w,int h,const char *l) +: Fl_Menu_Bar(x,y,w,h,l) +{ + deactivate(); // don't let the old area take events + fl_sys_menu_bar = this; +} + + #endif /* __APPLE__ */ // diff --git a/src/Fl_Tile.cxx b/src/Fl_Tile.cxx index 9ac184df6..f89edcdbc 100644 --- a/src/Fl_Tile.cxx +++ b/src/Fl_Tile.cxx @@ -200,6 +200,13 @@ int Fl_Tile::handle(int event) { return Fl_Group::handle(event); } + +Fl_Tile::Fl_Tile(int X,int Y,int W,int H,const char*l) +: Fl_Group(X,Y,W,H,l) +{ +} + + // // End of "$Id$". // diff --git a/src/Fl_Value_Slider.cxx b/src/Fl_Value_Slider.cxx index 2774f8428..ac06271cc 100644 --- a/src/Fl_Value_Slider.cxx +++ b/src/Fl_Value_Slider.cxx @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -72,6 +73,13 @@ int Fl_Value_Slider::handle(int event) { shh-Fl::box_dh(box())); } + +Fl_Hor_Value_Slider::Fl_Hor_Value_Slider(int X,int Y,int W,int H,const char *l) +: Fl_Value_Slider(X,Y,W,H,l) { + type(FL_HOR_SLIDER); +} + + // // End of "$Id$". // -- cgit v1.2.3