diff options
| author | Matthias Melcher <github@matthiasm.com> | 2022-12-30 19:14:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-30 19:14:36 +0100 |
| commit | 44c874b731f9f58c2f50c3c6076371058cbe26e3 (patch) | |
| tree | 2386dfcc700c41a1109fc78b96875c11056abcc9 /FL | |
| parent | f58a93a159105336136ce6e54ab7fc161e4fa15a (diff) | |
Use `FL_OVERRIDE` for all overridden virtual methods (#611)
FL_OVERRIDE is defined as `override` for C++11 and higher
FL_OVERRIDE is defined as `override` for VisualC 2015 and newer
Don't interfere with Fl_Widget::override()
Diffstat (limited to 'FL')
74 files changed, 391 insertions, 331 deletions
diff --git a/FL/Fl_Adjuster.H b/FL/Fl_Adjuster.H index c2e308128..be7a10766 100644 --- a/FL/Fl_Adjuster.H +++ b/FL/Fl_Adjuster.H @@ -43,9 +43,9 @@ class FL_EXPORT Fl_Adjuster : public Fl_Valuator { int ix; int soft_; protected: - void draw(); - int handle(int); - void value_damage(); + void draw() FL_OVERRIDE; + int handle(int) FL_OVERRIDE; + void value_damage() FL_OVERRIDE; public: Fl_Adjuster(int X,int Y,int W,int H,const char *l=0); /** diff --git a/FL/Fl_Bitmap.H b/FL/Fl_Bitmap.H index 308e09022..7fde10f5b 100644 --- a/FL/Fl_Bitmap.H +++ b/FL/Fl_Bitmap.H @@ -54,13 +54,13 @@ public: Fl_Bitmap(const uchar *bits, int bits_length, int W, int H); Fl_Bitmap(const char *bits, int bits_length, int W, int H); virtual ~Fl_Bitmap(); - virtual Fl_Image *copy(int W, int H) const; + Fl_Image *copy(int W, int H) const FL_OVERRIDE; Fl_Image *copy() const { return Fl_Image::copy(); } - virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0); + void draw(int X, int Y, int W, int H, int cx=0, int cy=0) FL_OVERRIDE; void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);} - virtual void label(Fl_Widget*w); - virtual void label(Fl_Menu_Item*m); - virtual void uncache(); + void label(Fl_Widget*w) FL_OVERRIDE; + void label(Fl_Menu_Item*m) FL_OVERRIDE; + void uncache() FL_OVERRIDE; }; #endif diff --git a/FL/Fl_Box.H b/FL/Fl_Box.H index c168566aa..050be02cc 100644 --- a/FL/Fl_Box.H +++ b/FL/Fl_Box.H @@ -31,7 +31,7 @@ */ class FL_EXPORT Fl_Box : public Fl_Widget { protected: - void draw(); + void draw() FL_OVERRIDE; public: /** - The first constructor sets box() to FL_NO_BOX, which @@ -47,7 +47,7 @@ public: /** See Fl_Box::Fl_Box(int x, int y, int w, int h, const char * = 0) */ Fl_Box(Fl_Boxtype b, int X, int Y, int W, int H, const char *l); - virtual int handle(int); + int handle(int) FL_OVERRIDE; }; #endif diff --git a/FL/Fl_Browser.H b/FL/Fl_Browser.H index 707b3acc1..5b86a6599 100644 --- a/FL/Fl_Browser.H +++ b/FL/Fl_Browser.H @@ -98,30 +98,30 @@ class FL_EXPORT Fl_Browser : public Fl_Browser_ { protected: // required routines for Fl_Browser_ subclass: - void* item_first() const ; - void* item_next(void* item) const ; - void* item_prev(void* item) const ; - void* item_last()const ; - int item_selected(void* item) const ; - void item_select(void* item, int val); - int item_height(void* item) const ; - int item_width(void* item) const ; - void item_draw(void* item, int X, int Y, int W, int H) const ; - int full_height() const ; - int incr_height() const ; - const char *item_text(void *item) const; + void* item_first() const FL_OVERRIDE; + void* item_next(void* item) const FL_OVERRIDE; + void* item_prev(void* item) const FL_OVERRIDE; + void* item_last()const FL_OVERRIDE; + int item_selected(void* item) const FL_OVERRIDE; + void item_select(void* item, int val) FL_OVERRIDE; + int item_height(void* item) const FL_OVERRIDE; + int item_width(void* item) const FL_OVERRIDE; + void item_draw(void* item, int X, int Y, int W, int H) const FL_OVERRIDE; + int full_height() const FL_OVERRIDE; + int incr_height() const FL_OVERRIDE; + const char *item_text(void *item) const FL_OVERRIDE; /** Swap the items \p a and \p b. You must call redraw() to make any changes visible. \param[in] a,b the items to be swapped. \see swap(int,int), item_swap() */ - void item_swap(void *a, void *b) { swap((FL_BLINE*)a, (FL_BLINE*)b); } + void item_swap(void *a, void *b) FL_OVERRIDE { swap((FL_BLINE*)a, (FL_BLINE*)b); } /** Return the item at specified \p line. \param[in] line The line of the item to return. (1 based) \returns The item, or NULL if line out of range. \see item_at(), find_line(), lineno() */ - void *item_at(int line) const { return (void*)find_line(line); } + void *item_at(int line) const FL_OVERRIDE { return (void*)find_line(line); } FL_BLINE* find_line(int line) const ; FL_BLINE* _remove(int line) ; @@ -188,10 +188,10 @@ public: int selected(int line) const ; void show(int line); /** Shows the entire Fl_Browser widget -- opposite of hide(). */ - void show() { Fl_Widget::show(); } + void show() FL_OVERRIDE { Fl_Widget::show(); } void hide(int line); /** Hides the entire Fl_Browser widget -- opposite of show(). */ - void hide() { Fl_Widget::hide(); } + void hide() FL_OVERRIDE { Fl_Widget::hide(); } int visible(int line) const ; int value() const ; diff --git a/FL/Fl_Browser_.H b/FL/Fl_Browser_.H index 2fdbf9620..78d242206 100644 --- a/FL/Fl_Browser_.H +++ b/FL/Fl_Browser_.H @@ -198,7 +198,7 @@ protected: int leftedge() const; // x position after scrollbar & border void *find_item(int ypos); // item under mouse - void draw(); + void draw() FL_OVERRIDE; Fl_Browser_(int X,int Y,int W,int H,const char *L=0); public: @@ -224,8 +224,8 @@ public: */ Fl_Scrollbar hscrollbar; - int handle(int event); - void resize(int X,int Y,int W,int H); + int handle(int event) FL_OVERRIDE; + void resize(int X,int Y,int W,int H) FL_OVERRIDE; int select(void *item,int val=1,int docallbacks=0); int select_only(void *item,int docallbacks=0); diff --git a/FL/Fl_Button.H b/FL/Fl_Button.H index e9ad92df8..38d804070 100644 --- a/FL/Fl_Button.H +++ b/FL/Fl_Button.H @@ -84,11 +84,11 @@ protected: static void key_release_timeout(void*); void simulate_key_action(); - virtual void draw(); + void draw() FL_OVERRIDE; public: - virtual int handle(int); + int handle(int) FL_OVERRIDE; Fl_Button(int X, int Y, int W, int H, const char *L = 0); diff --git a/FL/Fl_Cairo_Window.H b/FL/Fl_Cairo_Window.H index 86f25c986..0816adee3 100644 --- a/FL/Fl_Cairo_Window.H +++ b/FL/Fl_Cairo_Window.H @@ -94,7 +94,7 @@ public: protected: /** Overloaded to provide cairo callback support */ - void draw() { + void draw() FL_OVERRIDE { Fl_Double_Window::draw(); if (draw_cb_) { // call the Cairo draw callback // manual method ? if yes explicitly get a cairo_context here diff --git a/FL/Fl_Chart.H b/FL/Fl_Chart.H index a19b68cd6..fc9c22f19 100644 --- a/FL/Fl_Chart.H +++ b/FL/Fl_Chart.H @@ -78,7 +78,7 @@ class FL_EXPORT Fl_Chart : public Fl_Widget { Fl_Fontsize textsize_; Fl_Color textcolor_; protected: - void draw(); + void draw() FL_OVERRIDE; public: Fl_Chart(int X, int Y, int W, int H, const char *L = 0); diff --git a/FL/Fl_Check_Browser.H b/FL/Fl_Check_Browser.H index da2cd579c..50a719f7a 100644 --- a/FL/Fl_Check_Browser.H +++ b/FL/Fl_Check_Browser.H @@ -31,20 +31,20 @@ class FL_EXPORT Fl_Check_Browser : public Fl_Browser_ { protected: /* required routines for Fl_Browser_ subclass: */ - void *item_first() const; - void *item_next(void *) const; - void *item_prev(void *) const; - int item_height(void *) const; - int item_width(void *) const; - void item_draw(void *, int, int, int, int) const; - void item_select(void *, int); - int item_selected(void *) const; - const char *item_text(void *item) const; // override + void *item_first() const FL_OVERRIDE; + void *item_next(void *) const FL_OVERRIDE; + void *item_prev(void *) const FL_OVERRIDE; + int item_height(void *) const FL_OVERRIDE; + int item_width(void *) const FL_OVERRIDE; + void item_draw(void *, int, int, int, int) const FL_OVERRIDE; + void item_select(void *, int) FL_OVERRIDE; + int item_selected(void *) const FL_OVERRIDE; + const char *item_text(void *item) const FL_OVERRIDE; public: - void *item_at(int index) const; // override - void item_swap(int ia, int ib); // override - void item_swap(void *a, void *b); // override + void *item_at(int index) const FL_OVERRIDE; + void item_swap(int ia, int ib); + void item_swap(void *a, void *b) FL_OVERRIDE; /* private data */ @@ -104,7 +104,7 @@ public: char *text(int item) const; // returns pointer to internal buffer protected: - int handle(int); + int handle(int) FL_OVERRIDE; }; #endif // Fl_Check_Browser_H diff --git a/FL/Fl_Choice.H b/FL/Fl_Choice.H index 31da14524..fa7dc7bb5 100644 --- a/FL/Fl_Choice.H +++ b/FL/Fl_Choice.H @@ -102,9 +102,9 @@ */ class FL_EXPORT Fl_Choice : public Fl_Menu_ { protected: - void draw(); + void draw() FL_OVERRIDE; public: - int handle(int); + int handle(int) FL_OVERRIDE; Fl_Choice(int X, int Y, int W, int H, const char *L = 0); diff --git a/FL/Fl_Clock.H b/FL/Fl_Clock.H index aa29ec04a..0a5eac4bc 100644 --- a/FL/Fl_Clock.H +++ b/FL/Fl_Clock.H @@ -68,7 +68,7 @@ class FL_EXPORT Fl_Clock_Output : public Fl_Widget { int shadow_; // draw shadows of hands void drawhands(Fl_Color,Fl_Color); // part of draw protected: - void draw(); + void draw() FL_OVERRIDE; void draw(int X, int Y, int W, int H); public: @@ -151,7 +151,7 @@ public: */ class FL_EXPORT Fl_Clock : public Fl_Clock_Output { public: - int handle(int); + int handle(int) FL_OVERRIDE; Fl_Clock(int X, int Y, int W, int H, const char *L = 0); diff --git a/FL/Fl_Color_Chooser.H b/FL/Fl_Color_Chooser.H index 8ba252035..1aa569c11 100644 --- a/FL/Fl_Color_Chooser.H +++ b/FL/Fl_Color_Chooser.H @@ -36,10 +36,10 @@ class FL_EXPORT Flcc_HueBox : public Fl_Widget { int px, py; protected: - void draw(); + void draw() FL_OVERRIDE; int handle_key(int); public: - int handle(int); + int handle(int) FL_OVERRIDE; Flcc_HueBox(int X, int Y, int W, int H) : Fl_Widget(X,Y,W,H) { px = py = 0;} }; @@ -48,10 +48,10 @@ public: class FL_EXPORT Flcc_ValueBox : public Fl_Widget { int py; protected: - void draw(); + void draw() FL_OVERRIDE; int handle_key(int); public: - int handle(int); + int handle(int) FL_OVERRIDE; Flcc_ValueBox(int X, int Y, int W, int H) : Fl_Widget(X,Y,W,H) { py = 0;} }; @@ -59,7 +59,7 @@ public: /** For internal use only */ class FL_EXPORT Flcc_Value_Input : public Fl_Value_Input { public: - int format(char*); + int format(char*) FL_OVERRIDE; Flcc_Value_Input(int X, int Y, int W, int H) : Fl_Value_Input(X,Y,W,H) {} }; @@ -121,7 +121,7 @@ class FL_EXPORT Fl_Color_Chooser : public Fl_Group { static void mode_cb(Fl_Widget*, void*); public: - int handle(int e); + int handle(int e) FL_OVERRIDE; /** Returns which Fl_Color_Chooser variant is currently active diff --git a/FL/Fl_Copy_Surface.H b/FL/Fl_Copy_Surface.H index 9b195e938..752179a01 100644 --- a/FL/Fl_Copy_Surface.H +++ b/FL/Fl_Copy_Surface.H @@ -50,20 +50,20 @@ class FL_EXPORT Fl_Copy_Surface : public Fl_Widget_Surface { private: class Fl_Copy_Surface_Driver *platform_surface; protected: - void translate(int x, int y); - void untranslate(); + void translate(int x, int y) FL_OVERRIDE; + void untranslate() FL_OVERRIDE; public: Fl_Copy_Surface(int w, int h); ~Fl_Copy_Surface(); - void set_current(); - virtual bool is_current(); + void set_current() FL_OVERRIDE; + bool is_current() FL_OVERRIDE; /** Returns the pixel width of the copy surface */ int w(); /** Returns the pixel height of the copy surface */ int h(); - void origin(int *x, int *y); - void origin(int x, int y); - int printable_rect(int *w, int *h); + void origin(int *x, int *y) FL_OVERRIDE; + void origin(int x, int y) FL_OVERRIDE; + int printable_rect(int *w, int *h) FL_OVERRIDE; }; @@ -88,10 +88,10 @@ protected: int height; Fl_Copy_Surface_Driver(int w, int h) : Fl_Widget_Surface(NULL), width(w), height(h) {} virtual ~Fl_Copy_Surface_Driver() {} - virtual void set_current() = 0; - virtual void translate(int x, int y) = 0; - virtual void untranslate() = 0; - int printable_rect(int *w, int *h); + void set_current() FL_OVERRIDE = 0; + void translate(int x, int y) FL_OVERRIDE = 0; + void untranslate() FL_OVERRIDE = 0; + int printable_rect(int *w, int *h) FL_OVERRIDE; /** Each platform implements this function its own way. It returns an object implementing all virtual functions of class Fl_Copy_Surface_Driver for the plaform. diff --git a/FL/Fl_Counter.H b/FL/Fl_Counter.H index fc1ce48f0..2f6452318 100644 --- a/FL/Fl_Counter.H +++ b/FL/Fl_Counter.H @@ -56,13 +56,13 @@ class FL_EXPORT Fl_Counter : public Fl_Valuator { protected: - void draw(); + void draw() FL_OVERRIDE; // compute widths of arrow boxes void arrow_widths(int &w1, int &w2); public: - int handle(int); + int handle(int) FL_OVERRIDE; Fl_Counter(int X, int Y, int W, int H, const char* L = 0); ~Fl_Counter(); diff --git a/FL/Fl_Dial.H b/FL/Fl_Dial.H index e11d3cb26..2440b5cfd 100644 --- a/FL/Fl_Dial.H +++ b/FL/Fl_Dial.H @@ -51,11 +51,11 @@ protected: // these allow subclasses to put the dial in a smaller area: void draw(int X, int Y, int W, int H); int handle(int event, int X, int Y, int W, int H); - void draw(); + void draw() FL_OVERRIDE; public: - int handle(int); + int handle(int) FL_OVERRIDE; /** Creates a new Fl_Dial widget using the given position, size, and label string. The default type is FL_NORMAL_DIAL. diff --git a/FL/Fl_Double_Window.H b/FL/Fl_Double_Window.H index 73f8fddf0..016b778a9 100644 --- a/FL/Fl_Double_Window.H +++ b/FL/Fl_Double_Window.H @@ -33,13 +33,13 @@ public: /** Return non-null if this is an Fl_Overlay_Window object. */ - virtual Fl_Double_Window *as_double_window() {return this; } - void show(); + Fl_Double_Window *as_double_window() FL_OVERRIDE {return this; } + void show() FL_OVERRIDE; /** Same as Fl_Window::show(int a, char **b) */ void show(int a, char **b) {Fl_Window::show(a,b);} - void resize(int,int,int,int); - void hide(); - void flush(); + void resize(int,int,int,int) FL_OVERRIDE; + void hide() FL_OVERRIDE; + void flush() FL_OVERRIDE; ~Fl_Double_Window(); /** diff --git a/FL/Fl_File_Browser.H b/FL/Fl_File_Browser.H index 8ea51b2ad..101add4de 100644 --- a/FL/Fl_File_Browser.H +++ b/FL/Fl_File_Browser.H @@ -42,11 +42,11 @@ class FL_EXPORT Fl_File_Browser : public Fl_Browser { const char *pattern_; const char *errmsg_; - int full_height() const; - int item_height(void *) const; - int item_width(void *) const; - void item_draw(void *, int, int, int, int) const; - int incr_height() const { return (item_height(0)); } + int full_height() const FL_OVERRIDE; + int item_height(void *) const FL_OVERRIDE; + int item_width(void *) const FL_OVERRIDE; + void item_draw(void *, int, int, int, int) const FL_OVERRIDE; + int incr_height() const FL_OVERRIDE { return (item_height(0)); } public: enum { FILES, DIRECTORIES }; diff --git a/FL/Fl_File_Input.H b/FL/Fl_File_Input.H index 5b2d781cb..832db013e 100644 --- a/FL/Fl_File_Input.H +++ b/FL/Fl_File_Input.H @@ -57,10 +57,10 @@ public: Fl_File_Input(int X, int Y, int W, int H, const char *L=0); - virtual int handle(int event); + int handle(int event) FL_OVERRIDE; protected: - virtual void draw(); + void draw() FL_OVERRIDE; public: /** Gets the box type used for the navigation bar. */ diff --git a/FL/Fl_Flex.H b/FL/Fl_Flex.H index 687e6b0aa..6d8a76fbd 100644 --- a/FL/Fl_Flex.H +++ b/FL/Fl_Flex.H @@ -144,7 +144,7 @@ public: virtual ~Fl_Flex(); virtual void end(); - virtual void resize(int x, int y, int w, int h); + void resize(int x, int y, int w, int h) FL_OVERRIDE; /** Set the horizontal or vertical size of a child widget. @@ -167,7 +167,7 @@ protected: virtual int alloc_size(int size) const; - void on_remove(int); /* override */ + void on_remove(int) FL_OVERRIDE; public: diff --git a/FL/Fl_FormsBitmap.H b/FL/Fl_FormsBitmap.H index e5d6fb1db..edde9a11b 100644 --- a/FL/Fl_FormsBitmap.H +++ b/FL/Fl_FormsBitmap.H @@ -28,7 +28,7 @@ class FL_EXPORT Fl_FormsBitmap : public Fl_Widget { Fl_Bitmap *b; protected: - void draw(); + void draw() FL_OVERRIDE; public: Fl_FormsBitmap(Fl_Boxtype, int, int, int, int, const char * = 0); void set(int W, int H, const uchar *bits); diff --git a/FL/Fl_FormsPixmap.H b/FL/Fl_FormsPixmap.H index 43cccd966..3cbe7c01c 100644 --- a/FL/Fl_FormsPixmap.H +++ b/FL/Fl_FormsPixmap.H @@ -29,7 +29,7 @@ class FL_EXPORT Fl_FormsPixmap : public Fl_Widget { Fl_Pixmap *b; protected: - void draw(); + void draw() FL_OVERRIDE; public: Fl_FormsPixmap(Fl_Boxtype t, int X, int Y, int W, int H, const char *L= 0); diff --git a/FL/Fl_Free.H b/FL/Fl_Free.H index 1424a5956..138a21370 100644 --- a/FL/Fl_Free.H +++ b/FL/Fl_Free.H @@ -56,9 +56,9 @@ class FL_EXPORT Fl_Free : public Fl_Widget { FL_HANDLEPTR hfunc; static void step(void *); protected: - void draw(); + void draw() FL_OVERRIDE; public: - int handle(int e); + int handle(int e) FL_OVERRIDE; Fl_Free(uchar t,int X,int Y,int W,int H,const char *L,FL_HANDLEPTR hdl); ~Fl_Free(); }; diff --git a/FL/Fl_Gl_Window.H b/FL/Fl_Gl_Window.H index 0f5cf3216..c33bed8db 100644 --- a/FL/Fl_Gl_Window.H +++ b/FL/Fl_Gl_Window.H @@ -73,17 +73,17 @@ class FL_EXPORT Fl_Gl_Window : public Fl_Window { static int gl_plugin_linkage(); protected: void draw_begin(); - virtual void draw(); + void draw() FL_OVERRIDE; void draw_end(); public: - void show(); + void show() FL_OVERRIDE; /** Same as Fl_Window::show(int a, char **b) */ void show(int a, char **b) {Fl_Window::show(a,b);} - void flush(); - void hide(); - void resize(int,int,int,int); - int handle(int); + void flush() FL_OVERRIDE; + void hide() FL_OVERRIDE; + void resize(int,int,int,int) FL_OVERRIDE; + int handle(int) FL_OVERRIDE; /** Is turned off when FLTK creates a new context for this window or @@ -207,7 +207,7 @@ public: void make_overlay_current(); // Note: Doxygen docs in Fl_Widget.H to avoid redundancy. - virtual Fl_Gl_Window* as_gl_window() {return this;} + Fl_Gl_Window* as_gl_window() FL_OVERRIDE {return this;} float pixels_per_unit(); /** Gives the window width in OpenGL pixels. diff --git a/FL/Fl_Graphics_Driver.H b/FL/Fl_Graphics_Driver.H index 266624153..f70af0636 100644 --- a/FL/Fl_Graphics_Driver.H +++ b/FL/Fl_Graphics_Driver.H @@ -419,76 +419,76 @@ protected: int line_width_; virtual Fl_Region scale_clip(float f); void unscale_clip(Fl_Region r); - virtual void point(int x, int y); + void point(int x, int y) FL_OVERRIDE; virtual void point_unscaled(float x, float y); - virtual void rect(int x, int y, int w, int h); - virtual void rectf(int x, int y, int w, int h); + void rect(int x, int y, int w, int h) FL_OVERRIDE; + void rectf(int x, int y, int w, int h) FL_OVERRIDE; virtual void rectf_unscaled(int x, int y, int w, int h); - virtual void line(int x, int y, int x1, int y1); + void line(int x, int y, int x1, int y1) FL_OVERRIDE; virtual void line_unscaled(int x, int y, int x1, int y1); - virtual void line(int x, int y, int x1, int y1, int x2, int y2); + void line(int x, int y, int x1, int y1, int x2, int y2) FL_OVERRIDE; virtual void line_unscaled(int x, int y, int x1, int y1, int x2, int y2); - virtual void xyline(int x, int y, int x1); + void xyline(int x, int y, int x1) FL_OVERRIDE; virtual void xyline_unscaled(int x, int y, int x1); - virtual void xyline(int x, int y, int x1, int y2) {Fl_Graphics_Driver::xyline(x, y, x1, y2);} - virtual void xyline(int x, int y, int x1, int y2, int x3) {Fl_Graphics_Driver::xyline(x, y, x1, y2, x3);} - virtual void yxline(int x, int y, int y1); + void xyline(int x, int y, int x1, int y2) FL_OVERRIDE {Fl_Graphics_Driver::xyline(x, y, x1, y2);} + void xyline(int x, int y, int x1, int y2, int x3) FL_OVERRIDE {Fl_Graphics_Driver::xyline(x, y, x1, y2, x3);} + void yxline(int x, int y, int y1) FL_OVERRIDE; virtual void yxline_unscaled(int x, int y, int y1); - virtual void yxline(int x, int y, int y1, int x2) {Fl_Graphics_Driver::yxline(x, y, y1, x2);} - virtual void yxline(int x, int y, int y1, int x2, int y3) {Fl_Graphics_Driver::yxline(x, y, y1, x2, y3);} - virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2); + void yxline(int x, int y, int y1, int x2) FL_OVERRIDE {Fl_Graphics_Driver::yxline(x, y, y1, x2);} + void yxline(int x, int y, int y1, int x2, int y3) FL_OVERRIDE {Fl_Graphics_Driver::yxline(x, y, y1, x2, y3);} + void loop(int x0, int y0, int x1, int y1, int x2, int y2) FL_OVERRIDE; virtual void loop_unscaled(int x0, int y0, int x1, int y1, int x2, int y2); - virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3); + void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) FL_OVERRIDE; virtual void loop_unscaled(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3); - virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2); + void polygon(int x0, int y0, int x1, int y1, int x2, int y2) FL_OVERRIDE; virtual void polygon_unscaled(int x0, int y0, int x1, int y1, int x2, int y2); - virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3); + void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) FL_OVERRIDE; virtual void polygon_unscaled(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3); - virtual void circle(double x, double y, double r); + void circle(double x, double y, double r) FL_OVERRIDE; virtual void ellipse_unscaled(double xt, double yt, double rx, double ry); - virtual void font(Fl_Font face, Fl_Fontsize size); - virtual Fl_Font font(); + void font(Fl_Font face, Fl_Fontsize size) FL_OVERRIDE; + Fl_Font font() FL_OVERRIDE; virtual void font_unscaled(Fl_Font face, Fl_Fontsize size); - virtual double width(const char *str, int n); - virtual double width(unsigned int c); + double width(const char *str, int n) FL_OVERRIDE; + double width(unsigned int c) FL_OVERRIDE; virtual double width_unscaled(const char *str, int n); virtual double width_unscaled(unsigned int c); - virtual Fl_Fontsize size(); + Fl_Fontsize size() FL_OVERRIDE; virtual Fl_Fontsize size_unscaled(); - virtual void text_extents(const char *str, int n, int &dx, int &dy, int &w, int &h); + void text_extents(const char *str, int n, int &dx, int &dy, int &w, int &h) FL_OVERRIDE; virtual void text_extents_unscaled(const char *str, int n, int &dx, int &dy, int &w, int &h); - virtual int height(); - virtual int descent(); + int height() FL_OVERRIDE; + int descent() FL_OVERRIDE; virtual int height_unscaled(); virtual int descent_unscaled(); - virtual void draw(const char *str, int n, int x, int y); + void draw(const char *str, int n, int x, int y) FL_OVERRIDE; virtual void draw_unscaled(const char *str, int n, int x, int y); - virtual void draw(int angle, const char *str, int n, int x, int y); + void draw(int angle, const char *str, int n, int x, int y) FL_OVERRIDE; virtual void draw_unscaled(int angle, const char *str, int n, int x, int y); - virtual void draw(const char *str, int nChars, float x, float y); - virtual void rtl_draw(const char* str, int n, int x, int y); + void draw(const char *str, int nChars, float x, float y) FL_OVERRIDE; + void rtl_draw(const char* str, int n, int x, int y) FL_OVERRIDE; virtual void rtl_draw_unscaled(const char* str, int n, int x, int y); - virtual void arc(double x, double y, double r, double start, double end); - virtual void arc(int x, int y, int w, int h, double a1, double a2); + void arc(double x, double y, double r, double start, double end) FL_OVERRIDE; + void arc(int x, int y, int w, int h, double a1, double a2) FL_OVERRIDE; virtual void arc_unscaled(int x, int y, int w, int h, double a1, double a2); - virtual void pie(int x, int y, int w, int h, double a1, double a2); + void pie(int x, int y, int w, int h, double a1, double a2) FL_OVERRIDE; virtual void pie_unscaled(int x, int y, int w, int h, double a1, double a2); - virtual void line_style(int style, int width=0, char* dashes=0); + void line_style(int style, int width=0, char* dashes=0) FL_OVERRIDE; virtual void line_style_unscaled(int style, int width, char* dashes); void draw_image_rescale(void *buf, Fl_Draw_Image_Cb cb, int X, int Y, int W, int H, int D, int L, bool mono); virtual void draw_image_unscaled(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0); virtual void draw_image_unscaled(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3); - void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0); - void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3); + void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0) FL_OVERRIDE; + void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3) FL_OVERRIDE; virtual void draw_image_mono_unscaled(const uchar* buf, int x, int y, int w, int h, int d, int l); - void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0); + void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0) FL_OVERRIDE; virtual void draw_image_mono_unscaled(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1); - void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1); + void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1) FL_OVERRIDE; - void transformed_vertex(double xf, double yf); - void vertex(double x, double y); - virtual float override_scale(); - virtual void restore_scale(float); + void transformed_vertex(double xf, double yf) FL_OVERRIDE; + void vertex(double x, double y) FL_OVERRIDE; + float override_scale() FL_OVERRIDE; + void restore_scale(float) FL_OVERRIDE; virtual void *change_pen_width(int lwidth); virtual void reset_pen_width(void *data); }; diff --git a/FL/Fl_Group.H b/FL/Fl_Group.H index 6441b6149..025e3518b 100644 --- a/FL/Fl_Group.H +++ b/FL/Fl_Group.H @@ -67,7 +67,7 @@ class FL_EXPORT Fl_Group : public Fl_Widget { Fl_Group& operator=(const Fl_Group&); protected: - void draw(); + void draw() FL_OVERRIDE; void draw_child(Fl_Widget& widget) const; void draw_children(); void draw_outside_label(const Fl_Widget& widget) const ; @@ -80,7 +80,7 @@ protected: public: - int handle(int); + int handle(int) FL_OVERRIDE; void begin(); void end(); static Fl_Group *current(); @@ -101,7 +101,7 @@ public: int find(const Fl_Widget& o) const {return find(&o);} Fl_Widget* const* array() const; - void resize(int,int,int,int); + void resize(int,int,int,int) FL_OVERRIDE; /** Creates a new Fl_Group widget using the given position, size, and label string. The default boxtype is FL_NO_BOX. @@ -221,7 +221,7 @@ public: unsigned int clip_children() { return (flags() & CLIP_CHILDREN) != 0; } // Note: Doxygen docs in Fl_Widget.H to avoid redundancy. - virtual Fl_Group* as_group() { return this; } + Fl_Group* as_group() FL_OVERRIDE { return this; } // back compatibility functions: diff --git a/FL/Fl_Help_View.H b/FL/Fl_Help_View.H index 9b3a1a242..6f19a9a54 100644 --- a/FL/Fl_Help_View.H +++ b/FL/Fl_Help_View.H @@ -262,7 +262,7 @@ class FL_EXPORT Fl_Help_View : public Fl_Group { // Help viewer widget static int compare_targets(const Fl_Help_Target *t0, const Fl_Help_Target *t1); int do_align(Fl_Help_Block *block, int line, int xx, int a, int &l); protected: - void draw(); + void draw() FL_OVERRIDE; private: void format(); void format_table(int *table_width, int *columns, const char *table); @@ -273,7 +273,7 @@ private: Fl_Shared_Image *get_image(const char *name, int W, int H); int get_length(const char *l); public: - int handle(int); + int handle(int) FL_OVERRIDE; private: void hv_draw(const char *t, int x, int y, int entity_extra_length = 0); @@ -319,7 +319,7 @@ public: */ void link(Fl_Help_Func *fn) { link_ = fn; } int load(const char *f); - void resize(int,int,int,int); + void resize(int,int,int,int) FL_OVERRIDE; /** Gets the size of the help view. */ int size() const { return (size_); } void size(int W, int H) { Fl_Widget::size(W, H); } diff --git a/FL/Fl_Image.H b/FL/Fl_Image.H index d571d9e88..fb1ddf734 100644 --- a/FL/Fl_Image.H +++ b/FL/Fl_Image.H @@ -356,16 +356,16 @@ public: Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0); Fl_RGB_Image(const uchar *bits, int bits_length, int W, int H, int D, int LD); Fl_RGB_Image(const Fl_Pixmap *pxm, Fl_Color bg=FL_GRAY); - virtual ~Fl_RGB_Image(); - virtual Fl_Image *copy(int W, int H) const; + ~Fl_RGB_Image() FL_OVERRIDE; + Fl_Image *copy(int W, int H) const FL_OVERRIDE; Fl_Image *copy() const { return Fl_Image::copy(); } - virtual void color_average(Fl_Color c, float i); - virtual void desaturate(); - virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0); + void color_average(Fl_Color c, float i) FL_OVERRIDE; + void desaturate() FL_OVERRIDE; + void draw(int X, int Y, int W, int H, int cx=0, int cy=0) FL_OVERRIDE; void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);} - virtual void label(Fl_Widget*w); - virtual void label(Fl_Menu_Item*m); - virtual void uncache(); + void label(Fl_Widget*w) FL_OVERRIDE; + void label(Fl_Menu_Item*m) FL_OVERRIDE; + void uncache() FL_OVERRIDE; /** Sets the maximum allowed image size in bytes when creating an Fl_RGB_Image object. The image size in bytes of an Fl_RGB_Image object is the value of the product w() * h() * d(). diff --git a/FL/Fl_Image_Surface.H b/FL/Fl_Image_Surface.H index 1fea39604..fcd9db430 100644 --- a/FL/Fl_Image_Surface.H +++ b/FL/Fl_Image_Surface.H @@ -68,18 +68,18 @@ private: class Fl_Image_Surface_Driver *platform_surface; Fl_Offscreen get_offscreen_before_delete_(); protected: - void translate(int x, int y); - void untranslate(); + void translate(int x, int y) FL_OVERRIDE; + void untranslate() FL_OVERRIDE; public: Fl_Image_Surface(int w, int h, int high_res = 0, Fl_Offscreen off = 0); ~Fl_Image_Surface(); - void set_current(); - virtual bool is_current(); + void set_current() FL_OVERRIDE; + bool is_current() FL_OVERRIDE; Fl_RGB_Image *image(); Fl_Shared_Image *highres_image(); - void origin(int *x, int *y); - void origin(int x, int y); - int printable_rect(int *w, int *h); + void origin(int *x, int *y) FL_OVERRIDE; + void origin(int x, int y) FL_OVERRIDE; + int printable_rect(int *w, int *h) FL_OVERRIDE; Fl_Offscreen offscreen(); void rescale(); }; @@ -107,10 +107,10 @@ protected: int external_offscreen; Fl_Image_Surface_Driver(int w, int h, int /*high_res*/, Fl_Offscreen off) : Fl_Widget_Surface(NULL), width(w), height(h), offscreen(off) {external_offscreen = (off != 0);} virtual ~Fl_Image_Surface_Driver() {} - virtual void set_current() = 0; - virtual void translate(int x, int y) = 0; - virtual void untranslate() = 0; - int printable_rect(int *w, int *h); + void set_current() FL_OVERRIDE = 0; + void translate(int x, int y) FL_OVERRIDE = 0; + void untranslate() FL_OVERRIDE = 0; + int printable_rect(int *w, int *h) FL_OVERRIDE; virtual Fl_RGB_Image *image() = 0; /** Each platform implements this function its own way. It returns an object implementing all virtual functions diff --git a/FL/Fl_Input.H b/FL/Fl_Input.H index 0967d332f..93d1c2642 100644 --- a/FL/Fl_Input.H +++ b/FL/Fl_Input.H @@ -255,11 +255,11 @@ class FL_EXPORT Fl_Input : public Fl_Input_ { int kf_copy_cut(); protected: - void draw(); + void draw() FL_OVERRIDE; int handle_key(); public: - int handle(int); + int handle(int) FL_OVERRIDE; Fl_Input(int,int,int,int,const char * = 0); }; diff --git a/FL/Fl_Input_.H b/FL/Fl_Input_.H index bd159049a..0ec9b09ab 100644 --- a/FL/Fl_Input_.H +++ b/FL/Fl_Input_.H @@ -215,7 +215,7 @@ protected: public: /* Change the size of the widget. */ - void resize(int, int, int, int); + void resize(int, int, int, int) FL_OVERRIDE; /* Constructor */ Fl_Input_(int, int, int, int, const char* = 0); diff --git a/FL/Fl_Input_Choice.H b/FL/Fl_Input_Choice.H index c02195be7..f61d664b6 100644 --- a/FL/Fl_Input_Choice.H +++ b/FL/Fl_Input_Choice.H @@ -44,11 +44,11 @@ class FL_EXPORT Fl_Input_Choice : public Fl_Group { // Private class to handle slightly 'special' behavior of menu button class InputMenuButton : public Fl_Menu_Button { - void draw(); + void draw() FL_OVERRIDE; const Fl_Menu_Item* popup(); public: InputMenuButton(int X, int Y, int W, int H, const char *L=0); - int handle(int e); + int handle(int e) FL_OVERRIDE; }; Fl_Input *inp_; @@ -93,7 +93,7 @@ public: Fl_Input_Choice(int X, int Y, int W, int H, const char *L=0); - void resize(int X, int Y, int W, int H); + void resize(int X, int Y, int W, int H) FL_OVERRIDE; /** Adds an item to the menu. When any item is selected, the Fl_Input_Choice callback() is invoked, diff --git a/FL/Fl_Light_Button.H b/FL/Fl_Light_Button.H index 2794073f3..a03ec2e69 100644 --- a/FL/Fl_Light_Button.H +++ b/FL/Fl_Light_Button.H @@ -35,9 +35,9 @@ */ class FL_EXPORT Fl_Light_Button : public Fl_Button { protected: - virtual void draw(); + void draw() FL_OVERRIDE; public: - virtual int handle(int); + int handle(int) FL_OVERRIDE; Fl_Light_Button(int x,int y,int w,int h,const char *l = 0); }; diff --git a/FL/Fl_Menu_Bar.H b/FL/Fl_Menu_Bar.H index a97ccf45a..3157519ac 100644 --- a/FL/Fl_Menu_Bar.H +++ b/FL/Fl_Menu_Bar.H @@ -65,9 +65,9 @@ class FL_EXPORT Fl_Menu_Bar : public Fl_Menu_ { friend class Fl_Sys_Menu_Bar_Driver; protected: - void draw(); + void draw() FL_OVERRIDE; public: - int handle(int); + int handle(int) FL_OVERRIDE; /** Creates a new Fl_Menu_Bar widget using the given position, size, and label string. The default boxtype is FL_UP_BOX. diff --git a/FL/Fl_Menu_Button.H b/FL/Fl_Menu_Button.H index 7eb8e17ff..4cc0e930d 100644 --- a/FL/Fl_Menu_Button.H +++ b/FL/Fl_Menu_Button.H @@ -55,7 +55,7 @@ */ class FL_EXPORT Fl_Menu_Button : public Fl_Menu_ { protected: - void draw(); + void draw() FL_OVERRIDE; public: /** \brief indicate what mouse buttons pop up the menu. @@ -71,7 +71,7 @@ public: POPUP23, /**< pops up with the mouse 2nd or 3rd buttons. */ POPUP123 /**< pops up with any mouse button. */ }; - int handle(int); + int handle(int) FL_OVERRIDE; const Fl_Menu_Item* popup(); Fl_Menu_Button(int,int,int,int,const char * =0); }; diff --git a/FL/Fl_Native_File_Chooser.H b/FL/Fl_Native_File_Chooser.H index 2aaa0a463..3df8f57e3 100644 --- a/FL/Fl_Native_File_Chooser.H +++ b/FL/Fl_Native_File_Chooser.H @@ -251,26 +251,26 @@ protected: public: Fl_Native_File_Chooser_FLTK_Driver(int val); virtual ~Fl_Native_File_Chooser_FLTK_Driver(); - virtual void type(int t); - virtual int type() const ; - virtual void options(int o); - virtual int options() const; - virtual int count() const; - virtual const char *filename() const ; - virtual const char *filename(int i) const ; - virtual void directory(const char *val) ; - virtual const char *directory() const; - virtual void title(const char *t); - virtual const char* title() const; - virtual const char *filter() const ; - virtual void filter(const char *f); - virtual int filters() const ; - virtual void filter_value(int i) ; - virtual int filter_value() const ; - virtual void preset_file(const char*f) ; - virtual const char* preset_file() const; - virtual const char *errmsg() const ; - virtual int show() ; + void type(int t) FL_OVERRIDE; + int type() const FL_OVERRIDE; + void options(int o) FL_OVERRIDE; + int options() const FL_OVERRIDE; + int count() const FL_OVERRIDE; + const char *filename() const FL_OVERRIDE; + const char *filename(int i) const FL_OVERRIDE; + void directory(const char *val) FL_OVERRIDE; + const char *directory() const FL_OVERRIDE; + void title(const char *t) FL_OVERRIDE; + const char* title() const FL_OVERRIDE; + const char *filter() const FL_OVERRIDE; + void filter(const char *f) FL_OVERRIDE; + int filters() const FL_OVERRIDE; + void filter_value(int i) FL_OVERRIDE; + int filter_value() const FL_OVERRIDE; + void preset_file(const char*f) FL_OVERRIDE; + const char* preset_file() const FL_OVERRIDE; + const char *errmsg() const FL_OVERRIDE; + int show() FL_OVERRIDE; }; /** diff --git a/FL/Fl_Overlay_Window.H b/FL/Fl_Overlay_Window.H index 13676ab90..b03037586 100644 --- a/FL/Fl_Overlay_Window.H +++ b/FL/Fl_Overlay_Window.H @@ -49,10 +49,10 @@ public: private: Fl_Window *overlay_; public: - void show(); - void hide(); - void flush(); - void resize(int,int,int,int); + void show() FL_OVERRIDE; + void hide() FL_OVERRIDE; + void flush() FL_OVERRIDE; + void resize(int,int,int,int) FL_OVERRIDE; ~Fl_Overlay_Window(); /** Returns non-zero if there's hardware overlay support */ int can_do_overlay(); @@ -72,7 +72,7 @@ protected: public: /** Same as Fl_Window::show(int a, char **b) */ void show(int a, char **b) {Fl_Double_Window::show(a,b);} - virtual Fl_Overlay_Window *as_overlay_window() {return this; } + Fl_Overlay_Window *as_overlay_window() FL_OVERRIDE {return this; } }; #endif diff --git a/FL/Fl_Pack.H b/FL/Fl_Pack.H index cb2d7bb95..1e38c4187 100644 --- a/FL/Fl_Pack.H +++ b/FL/Fl_Pack.H @@ -61,7 +61,7 @@ public: }; protected: - void draw(); + void draw() FL_OVERRIDE; public: Fl_Pack(int X, int Y, int W, int H, const char *L = 0); diff --git a/FL/Fl_Pixmap.H b/FL/Fl_Pixmap.H index caa0e9371..ddf996fba 100644 --- a/FL/Fl_Pixmap.H +++ b/FL/Fl_Pixmap.H @@ -63,15 +63,15 @@ public: /** The constructors create a new pixmap from the specified XPM data. */ explicit Fl_Pixmap(const uchar* const * D) : Fl_Image(-1,0,1), alloc_data(0), id_(0), mask_(0) {set_data((const char*const*)D); measure();} virtual ~Fl_Pixmap(); - virtual Fl_Image *copy(int W, int H) const; + Fl_Image *copy(int W, int H) const FL_OVERRIDE; Fl_Image *copy() const { return Fl_Image::copy(); } - virtual void color_average(Fl_Color c, float i); - virtual void desaturate(); - virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0); + void color_average(Fl_Color c, float i) FL_OVERRIDE; + void desaturate() FL_OVERRIDE; + void draw(int X, int Y, int W, int H, int cx=0, int cy=0) FL_OVERRIDE; void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);} - virtual void label(Fl_Widget*w); - virtual void label(Fl_Menu_Item*m); - virtual void uncache(); + void label(Fl_Widget*w) FL_OVERRIDE; + void label(Fl_Menu_Item*m) FL_OVERRIDE; + void uncache() FL_OVERRIDE; }; #endif diff --git a/FL/Fl_Positioner.H b/FL/Fl_Positioner.H index 17963f614..ce1a7980b 100644 --- a/FL/Fl_Positioner.H +++ b/FL/Fl_Positioner.H @@ -44,11 +44,11 @@ protected: // these allow subclasses to put the dial in a smaller area: void draw(int, int, int, int); int handle(int, int, int, int, int); - void draw(); + void draw() FL_OVERRIDE; public: - int handle(int); + int handle(int) FL_OVERRIDE; /** Creates a new Fl_Positioner widget using the given position, size, and label string. The default boxtype is FL_NO_BOX. diff --git a/FL/Fl_PostScript.H b/FL/Fl_PostScript.H index bb9b27d79..8b2e2749a 100644 --- a/FL/Fl_PostScript.H +++ b/FL/Fl_PostScript.H @@ -86,7 +86,7 @@ public: /** The destructor. */ ~Fl_PostScript_File_Device(); /** Don't use with this class. */ - int begin_job(int pagecount, int* from, int* to, char **perr_message); + int begin_job(int pagecount, int* from, int* to, char **perr_message) FL_OVERRIDE; /** Begins the session where all graphics requests will go to a local PostScript file. Opens a file dialog to select an output PostScript file. This member function makes end_job() close the resulting PostScript file and display an @@ -123,28 +123,28 @@ public: return begin_job(ps_output, pagecount, format, layout); } - int begin_page (void); - int printable_rect(int *w, int *h); - void margins(int *left, int *top, int *right, int *bottom); - void origin(int *x, int *y); - void origin(int x, int y); - void scale (float scale_x, float scale_y = 0.); - void rotate(float angle); - void translate(int x, int y); - void untranslate(void); - int end_page (void); + int begin_page (void) FL_OVERRIDE; + int printable_rect(int *w, int *h) FL_OVERRIDE; + void margins(int *left, int *top, int *right, int *bottom) FL_OVERRIDE; + void origin(int *x, int *y) FL_OVERRIDE; + void origin(int x, int y) FL_OVERRIDE; + void scale (float scale_x, float scale_y = 0.) FL_OVERRIDE; + void rotate(float angle) FL_OVERRIDE; + void translate(int x, int y) FL_OVERRIDE; + void untranslate(void) FL_OVERRIDE; + int end_page (void) FL_OVERRIDE; /** Completes all PostScript output. This also closes with \p fclose() the underlying file() unless close_command() was used to set another function. */ - void end_job(void); + void end_job(void) FL_OVERRIDE; /** Label of the PostScript file chooser window */ static const char *file_chooser_title; /** Returns the underlying FILE* receiving all PostScript data */ FILE *file(); /** Sets the function end_job() calls to close the file() */ void close_command(Fl_PostScript_Close_Command cmd); - virtual void set_current(); - virtual void end_current(); + void set_current() FL_OVERRIDE; + void end_current() FL_OVERRIDE; }; /** Encapsulated PostScript drawing surface. @@ -193,13 +193,13 @@ public: with fl_alert(). */ ~Fl_EPS_File_Surface(); - virtual int printable_rect(int *w, int *h); + int printable_rect(int *w, int *h) FL_OVERRIDE; /** Returns the underlying FILE pointer */ FILE *file(); - virtual void origin(int x, int y); - virtual void origin(int *px, int *py); - virtual void translate(int x, int y); - virtual void untranslate(); + void origin(int x, int y) FL_OVERRIDE; + void origin(int *px, int *py) FL_OVERRIDE; + void translate(int x, int y) FL_OVERRIDE; + void untranslate() FL_OVERRIDE; /** Completes all EPS output. The only operation possible with the Fl_EPS_File_Surface object after calling close() is its destruction. \return The status code of output operations to the FILE object. 0 indicates success. */ diff --git a/FL/Fl_Printer.H b/FL/Fl_Printer.H index a8e4fdce4..b65fa3085 100644 --- a/FL/Fl_Printer.H +++ b/FL/Fl_Printer.H @@ -99,20 +99,20 @@ private: public: /** The constructor */ Fl_Printer(void); - int begin_job(int pagecount = 0, int *frompage = NULL, int *topage = NULL, char **perr_message = NULL); - int begin_page(void); - int printable_rect(int *w, int *h); - void margins(int *left, int *top, int *right, int *bottom); - void origin(int *x, int *y); - void origin(int x, int y); - void scale(float scale_x, float scale_y = 0.); - void rotate(float angle); - void translate(int x, int y); - void untranslate(void); - int end_page (void); - void end_job (void); - void set_current(void); - virtual bool is_current(); + int begin_job(int pagecount = 0, int *frompage = NULL, int *topage = NULL, char **perr_message = NULL) FL_OVERRIDE; + int begin_page(void) FL_OVERRIDE; + int printable_rect(int *w, int *h) FL_OVERRIDE; + void margins(int *left, int *top, int *right, int *bottom) FL_OVERRIDE; + void origin(int *x, int *y) FL_OVERRIDE; + void origin(int x, int y) FL_OVERRIDE; + void scale(float scale_x, float scale_y = 0.) FL_OVERRIDE; + void rotate(float angle) FL_OVERRIDE; + void translate(int x, int y) FL_OVERRIDE; + void untranslate(void) FL_OVERRIDE; + int end_page (void) FL_OVERRIDE; + void end_job (void) FL_OVERRIDE; + void set_current(void) FL_OVERRIDE; + bool is_current() FL_OVERRIDE; /** \name These attributes are useful for the Linux/Unix platform only. \{ diff --git a/FL/Fl_Progress.H b/FL/Fl_Progress.H index e0b5d8911..81c4f8241 100644 --- a/FL/Fl_Progress.H +++ b/FL/Fl_Progress.H @@ -41,7 +41,7 @@ class FL_EXPORT Fl_Progress : public Fl_Widget { protected: - virtual void draw(); + void draw() FL_OVERRIDE; public: diff --git a/FL/Fl_Repeat_Button.H b/FL/Fl_Repeat_Button.H index 08ac61a33..f80008e00 100644 --- a/FL/Fl_Repeat_Button.H +++ b/FL/Fl_Repeat_Button.H @@ -31,7 +31,7 @@ class FL_EXPORT Fl_Repeat_Button : public Fl_Button { static void repeat_callback(void *); public: - int handle(int); + int handle(int) FL_OVERRIDE; /** Creates a new Fl_Repeat_Button widget using the given position, size, and label string. The default boxtype is FL_UP_BOX. diff --git a/FL/Fl_Return_Button.H b/FL/Fl_Return_Button.H index d998dd31f..81ce47873 100644 --- a/FL/Fl_Return_Button.H +++ b/FL/Fl_Return_Button.H @@ -30,9 +30,9 @@ */ class FL_EXPORT Fl_Return_Button : public Fl_Button { protected: - void draw(); + void draw() FL_OVERRIDE; public: - int handle(int); + int handle(int) FL_OVERRIDE; /** Creates a new Fl_Return_Button widget using the given position, size, and label string. The default boxtype is FL_UP_BOX. diff --git a/FL/Fl_Roller.H b/FL/Fl_Roller.H index bd37a886c..5775058b8 100644 --- a/FL/Fl_Roller.H +++ b/FL/Fl_Roller.H @@ -37,9 +37,9 @@ */ class FL_EXPORT Fl_Roller : public Fl_Valuator { protected: - void draw(); + void draw() FL_OVERRIDE; public: - int handle(int); + int handle(int) FL_OVERRIDE; Fl_Roller(int X,int Y,int W,int H,const char* L=0); }; diff --git a/FL/Fl_SVG_File_Surface.H b/FL/Fl_SVG_File_Surface.H index 3599199d5..2a8061e16 100644 --- a/FL/Fl_SVG_File_Surface.H +++ b/FL/Fl_SVG_File_Surface.H @@ -65,11 +65,11 @@ public: ~Fl_SVG_File_Surface(); /** Returns the underlying FILE pointer */ FILE *file(); - virtual void origin(int x, int y); - virtual void origin(int *x, int *y); - virtual void translate(int x, int y); - virtual void untranslate(); - virtual int printable_rect(int *w, int *h); + void origin(int x, int y) FL_OVERRIDE; + void origin(int *x, int *y) FL_OVERRIDE; + void translate(int x, int y) FL_OVERRIDE; + void untranslate() FL_OVERRIDE; + int printable_rect(int *w, int *h) FL_OVERRIDE; /** Closes the FILE pointer where SVG data is output. The underlying FILE is closed by function fclose() unless another function was set at object's construction time. The only operation possible after this on the Fl_SVG_File_Surface object is its destruction. diff --git a/FL/Fl_SVG_Image.H b/FL/Fl_SVG_Image.H index 2171c2a75..6d9f77777 100644 --- a/FL/Fl_SVG_Image.H +++ b/FL/Fl_SVG_Image.H @@ -146,7 +146,7 @@ private: float average_weight_; float svg_scaling_(int W, int H); void rasterize_(int W, int H); - virtual void cache_size_(int &width, int &height); + void cache_size_(int &width, int &height) FL_OVERRIDE; void init_(const char *name, const unsigned char *filedata, size_t length); Fl_SVG_Image(const Fl_SVG_Image *source); public: @@ -157,17 +157,17 @@ public: Fl_SVG_Image(const char *sharedname, const char *svg_data); Fl_SVG_Image(const char *sharedname, const unsigned char *svg_data, size_t length); virtual ~Fl_SVG_Image(); - virtual Fl_Image *copy(int W, int H) const; + Fl_Image *copy(int W, int H) const FL_OVERRIDE; Fl_Image *copy() const { return Fl_Image::copy(); } void resize(int width, int height); - virtual void desaturate(); - virtual void color_average(Fl_Color c, float i); - virtual void draw(int X, int Y, int W, int H, int cx = 0, int cy = 0); + void desaturate() FL_OVERRIDE; + void color_average(Fl_Color c, float i) FL_OVERRIDE; + void draw(int X, int Y, int W, int H, int cx = 0, int cy = 0) FL_OVERRIDE; void draw(int X, int Y) { draw(X, Y, w(), h(), 0, 0); } - virtual Fl_SVG_Image *as_svg_image() { return this; } - virtual void normalize(); + Fl_SVG_Image *as_svg_image() FL_OVERRIDE { return this; } + void normalize() FL_OVERRIDE; }; #endif // FL_SVG_IMAGE_H diff --git a/FL/Fl_Scroll.H b/FL/Fl_Scroll.H index 1917c96fd..0331c8330 100644 --- a/FL/Fl_Scroll.H +++ b/FL/Fl_Scroll.H @@ -146,19 +146,19 @@ protected: // (STR#1895) protected: - int on_insert(Fl_Widget*, int); // override - int on_move(int, int); // override + int on_insert(Fl_Widget*, int) FL_OVERRIDE; + int on_move(int, int) FL_OVERRIDE; void fix_scrollbar_order(); void bbox(int&,int&,int&,int&) const; - void draw(); + void draw() FL_OVERRIDE; public: Fl_Scrollbar scrollbar; Fl_Scrollbar hscrollbar; - void resize(int X, int Y, int W, int H); - int handle(int); + void resize(int X, int Y, int W, int H) FL_OVERRIDE; + int handle(int) FL_OVERRIDE; Fl_Scroll(int X, int Y, int W, int H, const char *L = 0); virtual ~Fl_Scroll(); @@ -181,7 +181,7 @@ public: void clear(); /* delete child n (by index) */ - virtual int delete_child(int n); + int delete_child(int n) FL_OVERRIDE; /** Gets the current size of the scrollbars' troughs, in pixels. diff --git a/FL/Fl_Scrollbar.H b/FL/Fl_Scrollbar.H index f4542cfdc..8e7a45ee9 100644 --- a/FL/Fl_Scrollbar.H +++ b/FL/Fl_Scrollbar.H @@ -45,13 +45,13 @@ class FL_EXPORT Fl_Scrollbar : public Fl_Slider { static void timeout_cb(void*); void increment_cb(); protected: - void draw(); + void draw() FL_OVERRIDE; public: Fl_Scrollbar(int X,int Y,int W,int H, const char *L = 0); ~Fl_Scrollbar(); - int handle(int); + int handle(int) FL_OVERRIDE; /** Gets the integer value (position) of the slider in the scrollbar. diff --git a/FL/Fl_Secret_Input.H b/FL/Fl_Secret_Input.H index 0c7eb1666..bd4ca30f9 100644 --- a/FL/Fl_Secret_Input.H +++ b/FL/Fl_Secret_Input.H @@ -39,7 +39,7 @@ public: Inherited destructor destroys the widget and any value associated with it. */ Fl_Secret_Input(int X,int Y,int W,int H,const char *l = 0); - int handle(int); + int handle(int) FL_OVERRIDE; }; #endif diff --git a/FL/Fl_Shared_Image.H b/FL/Fl_Shared_Image.H index 9307b9e58..c95db55e0 100644 --- a/FL/Fl_Shared_Image.H +++ b/FL/Fl_Shared_Image.H @@ -139,22 +139,22 @@ public: */ int original() { return original_; } - void release(); - void reload(); + void release() FL_OVERRIDE; + virtual void reload(); - virtual Fl_Shared_Image *as_shared_image() { + Fl_Shared_Image *as_shared_image() FL_OVERRIDE { return this; } - virtual Fl_Image *copy(int W, int H) const; + Fl_Image *copy(int W, int H) const FL_OVERRIDE; Fl_Image *copy() const { return Fl_Image::copy(); } - virtual void color_average(Fl_Color c, float i); - virtual void desaturate(); - virtual void draw(int X, int Y, int W, int H, int cx = 0, int cy = 0); + void color_average(Fl_Color c, float i) FL_OVERRIDE; + void desaturate() FL_OVERRIDE; + void draw(int X, int Y, int W, int H, int cx = 0, int cy = 0) FL_OVERRIDE; void draw(int X, int Y) { draw(X, Y, w(), h(), 0, 0); } - virtual void uncache(); + void uncache() FL_OVERRIDE; static Fl_Shared_Image *find(const char *name, int W = 0, int H = 0); static Fl_Shared_Image *get(const char *name, int W = 0, int H = 0); diff --git a/FL/Fl_Simple_Terminal.H b/FL/Fl_Simple_Terminal.H index 74b012810..d7d438c8b 100644 --- a/FL/Fl_Simple_Terminal.H +++ b/FL/Fl_Simple_Terminal.H @@ -228,7 +228,7 @@ private: protected: // Fltk - virtual void draw(); + void draw() FL_OVERRIDE; // Internal methods void enforce_stay_at_bottom(); diff --git a/FL/Fl_Single_Window.H b/FL/Fl_Single_Window.H index bab37b4dc..8cd101e54 100644 --- a/FL/Fl_Single_Window.H +++ b/FL/Fl_Single_Window.H @@ -31,7 +31,7 @@ */ class FL_EXPORT Fl_Single_Window : public Fl_Window { public: - void show(); + void show() FL_OVERRIDE; /** Same as Fl_Window::show(int a, char **b) */ void show(int a, char **b) {Fl_Window::show(a,b);} diff --git a/FL/Fl_Slider.H b/FL/Fl_Slider.H index 4761c6f11..071423864 100644 --- a/FL/Fl_Slider.H +++ b/FL/Fl_Slider.H @@ -68,11 +68,11 @@ protected: // these allow subclasses to put the slider in a smaller area: void draw(int, int, int, int); int handle(int, int, int, int, int); - void draw(); + void draw() FL_OVERRIDE; public: - int handle(int); + int handle(int) FL_OVERRIDE; Fl_Slider(int X,int Y,int W,int H, const char *L = 0); Fl_Slider(uchar t,int X,int Y,int W,int H, const char *L); diff --git a/FL/Fl_Spinner.H b/FL/Fl_Spinner.H index aa5442f2b..cad68a3a0 100644 --- a/FL/Fl_Spinner.H +++ b/FL/Fl_Spinner.H @@ -58,7 +58,7 @@ protected: public: Fl_Spinner_Input(int X, int Y, int W, int H) : Fl_Input(X, Y, W, H) {} - int handle(int event); // implemented in src/Fl_Spinner.cxx + int handle(int event) FL_OVERRIDE; // implemented in src/Fl_Spinner.cxx }; Fl_Spinner_Input input_; // Input field for the value @@ -66,16 +66,16 @@ protected: up_button_, // Up button down_button_; // Down button - virtual void draw(); + void draw() FL_OVERRIDE; public: // Constructor Fl_Spinner(int X, int Y, int W, int H, const char *L = 0); // Event handling - int handle(int event); + int handle(int event) FL_OVERRIDE; // Resize group and subwidgets - void resize(int X, int Y, int W, int H); + void resize(int X, int Y, int W, int H) FL_OVERRIDE; /** Returns the format string for the value. */ const char *format() const { return (format_); } diff --git a/FL/Fl_Sys_Menu_Bar.H b/FL/Fl_Sys_Menu_Bar.H index beb4425a9..7045757a6 100644 --- a/FL/Fl_Sys_Menu_Bar.H +++ b/FL/Fl_Sys_Menu_Bar.H @@ -95,7 +95,7 @@ class Fl_Sys_Menu_Bar_Driver; class FL_EXPORT Fl_Sys_Menu_Bar : public Fl_Menu_Bar { static Fl_Sys_Menu_Bar_Driver *driver(); protected: - virtual void draw(); + void draw() FL_OVERRIDE; public: /** Possible styles of the Window menu in the system menu bar */ typedef enum { @@ -110,7 +110,7 @@ public: */ const Fl_Menu_Item *menu() const {return Fl_Menu_::menu();} void menu(const Fl_Menu_Item *m); - virtual void update(); + void update() FL_OVERRIDE; int add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0); /** Adds a new menu item. \see Fl_Menu_::add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0) diff --git a/FL/Fl_Table.H b/FL/Fl_Table.H index 15e7836bb..d6b4c4738 100644 --- a/FL/Fl_Table.H +++ b/FL/Fl_Table.H @@ -231,7 +231,7 @@ protected: Fl_Scrollbar *hscrollbar; ///< child horizontal scrollbar widget // Fltk - int handle(int e); // fltk handle() override + int handle(int e) FL_OVERRIDE; // fltk handle() FL_OVERRIDE // Class maintenance void recalc_dimensions(); @@ -397,7 +397,7 @@ protected: } // draw() has to be protected per FLTK convention (was public in 1.3.x) - void draw(); + void draw() FL_OVERRIDE; public: Fl_Table(int X, int Y, int W, int H, const char *l=0); @@ -732,7 +732,7 @@ public: void set_selection(int row_top, int col_left, int row_bot, int col_right); int move_cursor(int R, int C, int shiftselect); int move_cursor(int R, int C); - void resize(int X, int Y, int W, int H); // fltk resize() override + void resize(int X, int Y, int W, int H) FL_OVERRIDE; // fltk resize() FL_OVERRIDE // This crashes sortapp() during init. // void box(Fl_Boxtype val) { diff --git a/FL/Fl_Table_Row.H b/FL/Fl_Table_Row.H index 655efab81..ac35f333c 100644 --- a/FL/Fl_Table_Row.H +++ b/FL/Fl_Table_Row.H @@ -112,7 +112,7 @@ private: TableRowSelectMode _selectmode; protected: - int handle(int event); + int handle(int event) FL_OVERRIDE; int find_cell(TableContext context, // find cell's x/y/w/h given r/c int R, int C, int &X, int &Y, int &W, int &H) { return(Fl_Table::find_cell(context, R, C, X, Y, W, H)); @@ -139,7 +139,7 @@ public: */ ~Fl_Table_Row() { } - void rows(int val); // set number of rows + void rows(int val) FL_OVERRIDE; // set number of rows int rows() { // get number of rows return(Fl_Table::rows()); } @@ -177,7 +177,7 @@ public: */ void select_all_rows(int flag=1); // all rows to a known state - void clear() { + void clear() FL_OVERRIDE { rows(0); // implies clearing selection cols(0); Fl_Table::clear(); // clear the table diff --git a/FL/Fl_Tabs.H b/FL/Fl_Tabs.H index cb4e493eb..27f5bc0da 100644 --- a/FL/Fl_Tabs.H +++ b/FL/Fl_Tabs.H @@ -215,14 +215,14 @@ protected: virtual void draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int sel=0); virtual int tab_height(); - void draw(); + void draw() FL_OVERRIDE; public: Fl_Tabs(int X, int Y, int W, int H, const char *L = 0); virtual ~Fl_Tabs(); - int handle(int); + int handle(int) FL_OVERRIDE; Fl_Widget *value(); int value(Fl_Widget *); /** diff --git a/FL/Fl_Text_Display.H b/FL/Fl_Text_Display.H index 1d5b51193..1b8647f92 100644 --- a/FL/Fl_Text_Display.H +++ b/FL/Fl_Text_Display.H @@ -167,7 +167,7 @@ public: Fl_Text_Display(int X, int Y, int W, int H, const char *l = 0); ~Fl_Text_Display(); - virtual int handle(int e); + int handle(int e) FL_OVERRIDE; void buffer(Fl_Text_Buffer* buf); @@ -433,7 +433,7 @@ public: void wrap_mode(int wrap, int wrap_margin); virtual void recalc_display(); - virtual void resize(int X, int Y, int W, int H); + void resize(int X, int Y, int W, int H) FL_OVERRIDE; /** Convert an x pixel position into a column number. @@ -471,7 +471,7 @@ protected: // Anything with "vline" indicates thats it deals with currently // visible lines. - virtual void draw(); + void draw() FL_OVERRIDE; void draw_text(int X, int Y, int W, int H); void draw_range(int start, int end); void draw_cursor(int, int); diff --git a/FL/Fl_Text_Editor.H b/FL/Fl_Text_Editor.H index 48f8a1ac0..b9a0d42b0 100644 --- a/FL/Fl_Text_Editor.H +++ b/FL/Fl_Text_Editor.H @@ -50,7 +50,7 @@ class FL_EXPORT Fl_Text_Editor : public Fl_Text_Display { Fl_Text_Editor(int X, int Y, int W, int H, const char* l = 0); ~Fl_Text_Editor() { remove_all_key_bindings(); } - virtual int handle(int e); + int handle(int e) FL_OVERRIDE; /** Sets the current insert mode; if non-zero, new text is inserted before the current cursor position. Otherwise, new diff --git a/FL/Fl_Tile.H b/FL/Fl_Tile.H index 5b818fe89..52d14210c 100644 --- a/FL/Fl_Tile.H +++ b/FL/Fl_Tile.H @@ -26,9 +26,9 @@ class FL_EXPORT Fl_Tile : public Fl_Group { public: - int handle(int event); + int handle(int event) FL_OVERRIDE; Fl_Tile(int X, int Y, int W, int H, const char *L=0); - void resize(int X, int Y, int W, int H); + void resize(int X, int Y, int W, int H) FL_OVERRIDE; void position(int oldx, int oldy, int newx, int newy); }; diff --git a/FL/Fl_Tiled_Image.H b/FL/Fl_Tiled_Image.H index ebccd3be4..d705dda5e 100644 --- a/FL/Fl_Tiled_Image.H +++ b/FL/Fl_Tiled_Image.H @@ -43,13 +43,13 @@ public: Fl_Tiled_Image(Fl_Image *i, int W = 0, int H = 0); virtual ~Fl_Tiled_Image(); - virtual Fl_Image *copy(int W, int H) const; + Fl_Image *copy(int W, int H) const FL_OVERRIDE; Fl_Image *copy() const { return Fl_Image::copy(); } - virtual void color_average(Fl_Color c, float i); - virtual void desaturate(); - virtual void draw(int X, int Y, int W, int H, int cx = 0, int cy = 0); + void color_average(Fl_Color c, float i) FL_OVERRIDE; + void desaturate() FL_OVERRIDE; + void draw(int X, int Y, int W, int H, int cx = 0, int cy = 0) FL_OVERRIDE; void draw(int X, int Y) { draw(X, Y, w(), h(), 0, 0); } /** Gets The image that is tiled */ Fl_Image *image() { return image_; } diff --git a/FL/Fl_Timer.H b/FL/Fl_Timer.H index 6c9db28a1..b79bbebfa 100644 --- a/FL/Fl_Timer.H +++ b/FL/Fl_Timer.H @@ -43,9 +43,9 @@ class FL_EXPORT Fl_Timer : public Fl_Widget { double delay, total; long lastsec,lastusec; protected: - void draw(); + void draw() FL_OVERRIDE; public: - int handle(int); + int handle(int) FL_OVERRIDE; Fl_Timer(uchar t,int x,int y,int w,int h, const char *l); ~Fl_Timer(); void value(double); diff --git a/FL/Fl_Tree.H b/FL/Fl_Tree.H index 44509e978..9a56e1841 100644 --- a/FL/Fl_Tree.H +++ b/FL/Fl_Tree.H @@ -312,14 +312,14 @@ protected: // undocmented draw_tree() dropped -- draw() does all the work now // draw() has to be protected per FLTK convention (was public in 1.3.x) - void draw(); + void draw() FL_OVERRIDE; public: Fl_Tree(int X, int Y, int W, int H, const char *L=0); ~Fl_Tree(); - int handle(int e); + int handle(int e) FL_OVERRIDE; void show_self(); - void resize(int,int,int,int); + void resize(int,int,int,int) FL_OVERRIDE; /////////////////////// // root methods diff --git a/FL/Fl_Value_Input.H b/FL/Fl_Value_Input.H index 03f9814b3..7aca4e9ba 100644 --- a/FL/Fl_Value_Input.H +++ b/FL/Fl_Value_Input.H @@ -61,13 +61,13 @@ public: private: char soft_; static void input_cb(Fl_Widget*,void*); - virtual void value_damage(); // cause damage() due to value() changing + void value_damage() FL_OVERRIDE; // cause damage() due to value() changing public: - int handle(int); + int handle(int) FL_OVERRIDE; protected: - void draw(); + void draw() FL_OVERRIDE; public: - void resize(int,int,int,int); + void resize(int,int,int,int) FL_OVERRIDE; Fl_Value_Input(int x,int y,int w,int h,const char *l=0); ~Fl_Value_Input(); diff --git a/FL/Fl_Value_Output.H b/FL/Fl_Value_Output.H index c78383286..4e380ea2a 100644 --- a/FL/Fl_Value_Output.H +++ b/FL/Fl_Value_Output.H @@ -43,10 +43,10 @@ class FL_EXPORT Fl_Value_Output : public Fl_Valuator { Fl_Color textcolor_; protected: - void draw(); + void draw() FL_OVERRIDE; public: - int handle(int); + int handle(int) FL_OVERRIDE; Fl_Value_Output(int x,int y,int w,int h,const char *l=0); /** diff --git a/FL/Fl_Value_Slider.H b/FL/Fl_Value_Slider.H index e49b046a1..3d7e42cba 100644 --- a/FL/Fl_Value_Slider.H +++ b/FL/Fl_Value_Slider.H @@ -36,10 +36,10 @@ class FL_EXPORT Fl_Value_Slider : public Fl_Slider { short value_height_; protected: - void draw(); + void draw() FL_OVERRIDE; public: - int handle(int); + int handle(int) FL_OVERRIDE; Fl_Value_Slider(int x, int y, int w, int h, const char *l = 0); /** Gets the typeface of the text in the value box. */ diff --git a/FL/Fl_Window.H b/FL/Fl_Window.H index c7ecb416d..ddb3283eb 100644 --- a/FL/Fl_Window.H +++ b/FL/Fl_Window.H @@ -93,7 +93,7 @@ protected: /** Stores the last window that was made current. See current() const */ static Fl_Window *current_; - void draw(); + void draw() FL_OVERRIDE; /** Forces the window to be drawn, this window is also made current and calls draw(). */ virtual void flush(); @@ -170,7 +170,7 @@ public: */ virtual ~Fl_Window(); - virtual int handle(int); + int handle(int) FL_OVERRIDE; /** Changes the size and position of the window. If shown() is true, @@ -188,7 +188,7 @@ public: dimensions. It is up to the application developer to verify window parameters after the resize request. */ - virtual void resize(int X,int Y,int W,int H); + void resize(int X,int Y,int W,int H) FL_OVERRIDE; /** Sets whether or not the window manager border is around the window. The default value is true. <I>With some X window managers, this does not work after show() has been called.</I> @@ -201,9 +201,9 @@ public: void clear_border() {set_flag(NOBORDER);} /** Returns whether the window possesses a border */ unsigned int border() const {return !(flags() & NOBORDER);} - /** Activates the flags NOBORDER|FL_OVERRIDE */ + /** Activates the flags NOBORDER|OVERRIDE */ void set_override() {set_flag(NOBORDER|OVERRIDE);} - /** Returns non zero if FL_OVERRIDE flag is set, 0 otherwise. */ + /** Returns non zero if OVERRIDE flag is set, 0 otherwise. */ unsigned int override() const { return flags()&OVERRIDE; } /** A "modal" window, when shown(), will prevent any events from @@ -424,12 +424,12 @@ public: \see Fl_Window::show(int argc, char **argv) */ - virtual void show(); + void show() FL_OVERRIDE; /** Removes the window from the screen. If the window is already hidden or has not been shown then this does nothing and is harmless. */ - virtual void hide(); + void hide() FL_OVERRIDE; /** Puts the window on the screen and parses command-line arguments. @@ -567,7 +567,7 @@ public: int decorated_h() const; // Note: Doxygen docs in Fl_Widget.H to avoid redundancy. - virtual Fl_Window* as_window() { return this; } + Fl_Window* as_window() FL_OVERRIDE { return this; } /** Return non-null if this is an Fl_Overlay_Window object. diff --git a/FL/Fl_Wizard.H b/FL/Fl_Wizard.H index 785cee450..b45d21892 100644 --- a/FL/Fl_Wizard.H +++ b/FL/Fl_Wizard.H @@ -43,7 +43,7 @@ class FL_EXPORT Fl_Wizard : public Fl_Group { protected: - virtual void draw(); + void draw() FL_OVERRIDE; public: diff --git a/FL/fl_attr.h b/FL/fl_attr.h index 32e88a2a4..e2d6961da 100644 --- a/FL/fl_attr.h +++ b/FL/fl_attr.h @@ -31,4 +31,62 @@ # define __fl_attr(x) #endif + +#ifdef FL_DOXYGEN + +/** + This macro makes it safe to use the C++11 keyword \c override with + older compilers. +*/ +#define FL_OVERRIDE override + +#else + +#ifdef __cplusplus + +// Visual Studio defines __cplusplus = '199711L' which is not helpful. +// We assume that Visual Studio 2015 (1900) and later support the +// 'override' keyword. For VS version number encoding see: +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros + +#if defined(_MSC_VER) && (_MSC_VER >= 1900) + +#define FL_OVERRIDE override + +#else // not Visual Studio or an older version + +#if (__cplusplus >= 202002L) +// put here definitions applying to C++20 and above +#endif + +#if (__cplusplus >= 201703L) +// put here definitions applying to C++17 and above +#endif + +#if (__cplusplus >= 201402L) +// put here definitions applying to C++14 and above +#endif + +#if (__cplusplus >= 201103L) +// put here definitions applying to C++11 and above +#define FL_OVERRIDE override +#else +// replace non-existing `override` with no-op +#define FL_OVERRIDE +#endif + +#if (__cplusplus >= 199711L) +// put here definitions applying to C++98 and above +#endif + +#endif /* not Visual Studio */ + +#else +/* C, not C++ */ + +#endif /* __cplusplus */ + +#endif /* FL_DOXYGEN */ + + #endif /* !_FL_fl_attr_h_ */ diff --git a/FL/fl_types.h b/FL/fl_types.h index ea1c5299b..54318871b 100644 --- a/FL/fl_types.h +++ b/FL/fl_types.h @@ -21,6 +21,8 @@ #ifndef FL_TYPES_H #define FL_TYPES_H +#include "fl_attr.h" + /** \name Miscellaneous */ /*@{*/ /* group: Miscellaneous */ diff --git a/FL/forms.H b/FL/forms.H index 7e08b176b..a25a1c936 100644 --- a/FL/forms.H +++ b/FL/forms.H @@ -802,7 +802,7 @@ inline void fl_set_slider_precision(Fl_Widget* o, int i) { // meaning of FL_ALIGN_INSIDE. Implementation in forms.cxx class FL_EXPORT Fl_FormsText : public Fl_Widget { protected: - void draw(); + void draw() FL_OVERRIDE; 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);} @@ -43,9 +43,9 @@ class FL_EXPORT Fl_Glut_Window : public Fl_Gl_Window { void _init(); int mouse_down; protected: - void draw(); - void draw_overlay(); - int handle(int); + void draw() FL_OVERRIDE; + void draw_overlay() FL_OVERRIDE; + int handle(int) FL_OVERRIDE; public: // so the inline functions work int number; int menu[3]; |
