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 /src/drivers/Cairo | |
| 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 'src/drivers/Cairo')
| -rw-r--r-- | src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H | 190 | ||||
| -rw-r--r-- | src/drivers/Cairo/Fl_Display_Cairo_Graphics_Driver.H | 10 |
2 files changed, 100 insertions, 100 deletions
diff --git a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H index 3343345a1..0b5eee198 100644 --- a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H +++ b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H @@ -38,7 +38,7 @@ typedef struct _PangoFontDescription PangoFontDescription; class Fl_Cairo_Font_Descriptor : public Fl_Font_Descriptor { public: Fl_Cairo_Font_Descriptor(const char* fontname, Fl_Fontsize size, PangoContext *context); - virtual FL_EXPORT ~Fl_Cairo_Font_Descriptor(); + FL_EXPORT ~Fl_Cairo_Font_Descriptor() FL_OVERRIDE; PangoFontDescription *fontref; int **width; // array of arrays of character widths int line_height; @@ -57,7 +57,7 @@ protected: PangoLayout *pango_layout_; public: Fl_Cairo_Graphics_Driver(); - virtual ~Fl_Cairo_Graphics_Driver(); + ~Fl_Cairo_Graphics_Driver() FL_OVERRIDE; class Clip { public: @@ -93,110 +93,110 @@ public: void needs_commit_tag(bool *tag) { needs_commit_tag_ = tag; } // implementation of drawing methods - void color(Fl_Color c); - void color(uchar r, uchar g, uchar b); - Fl_Color color(); - - void push_clip(int x, int y, int w, int h); - void push_no_clip(); - void pop_clip(); - - void line_style(int style, int width=0, char* dashes=0); - - void rect(int x, int y, int w, int h); - void rectf(int x, int y, int w, int h); - - void xyline(int x, int y, int x1); - void xyline(int x, int y, int x1, int y2); - void xyline(int x, int y, int x1, int y2, int x3); - - void yxline(int x, int y, int y1); - void yxline(int x, int y, int y1, int x2); - void yxline(int x, int y, int y1, int x2, int y3); - - void line(int x1, int y1, int x2, int y2); - void line(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); - void loop(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); - void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3); - void point(int x, int y); - void overlay_rect(int x, int y, int w , int h); - int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H); - void restore_clip(); - int not_clipped(int x, int y, int w, int h); - - void begin_points(); - void begin_line(); - void begin_loop(); - void begin_polygon(); - void vertex(double x, double y); - void curve(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3); - void circle(double x, double y, double r); - void arc(double x, double y, double r, double start, double a); - void arc(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); - void end_points(); - void end_line(); - void end_loop(); - void end_polygon(); - void begin_complex_polygon() { begin_polygon(); } - void gap() { gap_ = 1; } - void end_complex_polygon() { end_polygon(); } - void transformed_vertex(double x, double y); - - void draw_image_mono(const uchar* d, int x,int y,int w,int h, int delta=1, int ld=0); - void draw_image(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=3); - void draw_image_mono(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=1); + void color(Fl_Color c) FL_OVERRIDE; + void color(uchar r, uchar g, uchar b) FL_OVERRIDE; + Fl_Color color() FL_OVERRIDE; + + void push_clip(int x, int y, int w, int h) FL_OVERRIDE; + void push_no_clip() FL_OVERRIDE; + void pop_clip() FL_OVERRIDE; + + void line_style(int style, int width=0, char* dashes=0) FL_OVERRIDE; + + void rect(int x, int y, int w, int h) FL_OVERRIDE; + void rectf(int x, int y, int w, int h) FL_OVERRIDE; + + void xyline(int x, int y, int x1) FL_OVERRIDE; + void xyline(int x, int y, int x1, int y2) FL_OVERRIDE; + void xyline(int x, int y, int x1, int y2, int x3) FL_OVERRIDE; + + void yxline(int x, int y, int y1) FL_OVERRIDE; + void yxline(int x, int y, int y1, int x2) FL_OVERRIDE; + void yxline(int x, int y, int y1, int x2, int y3) FL_OVERRIDE; + + void line(int x1, int y1, int x2, int y2) FL_OVERRIDE; + void line(int x1, int y1, int x2, int y2, int x3, int y3) FL_OVERRIDE; + + void loop(int x0, int y0, int x1, int y1, int x2, int y2) FL_OVERRIDE; + void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) FL_OVERRIDE; + void polygon(int x0, int y0, int x1, int y1, int x2, int y2) FL_OVERRIDE; + void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) FL_OVERRIDE; + void point(int x, int y) FL_OVERRIDE; + void overlay_rect(int x, int y, int w , int h) FL_OVERRIDE; + int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H) FL_OVERRIDE; + void restore_clip() FL_OVERRIDE; + int not_clipped(int x, int y, int w, int h) FL_OVERRIDE; + + void begin_points() FL_OVERRIDE; + void begin_line() FL_OVERRIDE; + void begin_loop() FL_OVERRIDE; + void begin_polygon() FL_OVERRIDE; + void vertex(double x, double y) FL_OVERRIDE; + void curve(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3) FL_OVERRIDE; + void circle(double x, double y, double r) FL_OVERRIDE; + void arc(double x, double y, double r, double start, double a) FL_OVERRIDE; + void arc(int x, int y, int w, int h, double a1, double a2) FL_OVERRIDE; + void pie(int x, int y, int w, int h, double a1, double a2) FL_OVERRIDE; + void end_points() FL_OVERRIDE; + void end_line() FL_OVERRIDE; + void end_loop() FL_OVERRIDE; + void end_polygon() FL_OVERRIDE; + void begin_complex_polygon() FL_OVERRIDE { begin_polygon(); } + void gap() FL_OVERRIDE { gap_ = 1; } + void end_complex_polygon() FL_OVERRIDE { end_polygon(); } + void transformed_vertex(double x, double y) FL_OVERRIDE; + + void draw_image_mono(const uchar* d, int x,int y,int w,int h, int delta=1, int ld=0) FL_OVERRIDE; + void draw_image(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=3) FL_OVERRIDE; + void draw_image_mono(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=1) FL_OVERRIDE; void ps_origin(int x, int y); void ps_translate(int, int); void ps_untranslate(); void draw_cached_pattern_(Fl_Image *img, cairo_pattern_t *pat, int X, int Y, int W, int H, int cx, int cy); - void draw_image(const uchar *data, int ix, int iy, int iw, int ih, int D, int LD); - void draw_rgb(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, int cy); - void cache(Fl_RGB_Image *rgb); - void uncache(Fl_RGB_Image *img, fl_uintptr_t &id_, fl_uintptr_t &mask_); - void draw_bitmap(Fl_Bitmap *bm,int XP, int YP, int WP, int HP, int cx, int cy); + void draw_image(const uchar *data, int ix, int iy, int iw, int ih, int D, int LD) FL_OVERRIDE; + void draw_rgb(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, int cy) FL_OVERRIDE; + void cache(Fl_RGB_Image *rgb) FL_OVERRIDE; + void uncache(Fl_RGB_Image *img, fl_uintptr_t &id_, fl_uintptr_t &mask_) FL_OVERRIDE; + void draw_bitmap(Fl_Bitmap *bm,int XP, int YP, int WP, int HP, int cx, int cy) FL_OVERRIDE; static cairo_pattern_t *bitmap_to_pattern(Fl_Bitmap *bm, bool complement, cairo_surface_t **p_surface); - void cache(Fl_Bitmap *img); - virtual void delete_bitmask(fl_uintptr_t bm); - void cache(Fl_Pixmap *pxm); - void draw_pixmap(Fl_Pixmap *rgb,int XP, int YP, int WP, int HP, int cx, int cy); - void uncache_pixmap(fl_uintptr_t p); - - void font(Fl_Font fnum, Fl_Fontsize s); - Fl_Font font() { return Fl_Graphics_Driver::font(); } - void draw(const char* s, int nBytes, int x, int y) { draw(s, nBytes, float(x), float(y)); } - void draw(const char* s, int nBytes, float x, float y); - void draw(int angle, const char *str, int n, int x, int y); - void rtl_draw(const char* str, int n, int x, int y); - int height(); - int descent(); - double width(const char *str, int n); - double width(unsigned c); - void text_extents(const char* txt, int n, int& dx, int& dy, int& w, int& h); - virtual PangoFontDescription* pango_font_description() { + void cache(Fl_Bitmap *img) FL_OVERRIDE; + void delete_bitmask(fl_uintptr_t bm) FL_OVERRIDE; + void cache(Fl_Pixmap *pxm) FL_OVERRIDE; + void draw_pixmap(Fl_Pixmap *rgb,int XP, int YP, int WP, int HP, int cx, int cy) FL_OVERRIDE; + void uncache_pixmap(fl_uintptr_t p) FL_OVERRIDE; + + void font(Fl_Font fnum, Fl_Fontsize s) FL_OVERRIDE; + Fl_Font font() FL_OVERRIDE { return Fl_Graphics_Driver::font(); } + void draw(const char* s, int nBytes, int x, int y) FL_OVERRIDE { draw(s, nBytes, float(x), float(y)); } + void draw(const char* s, int nBytes, float x, float y) FL_OVERRIDE; + void draw(int angle, const char *str, int n, int x, int y) FL_OVERRIDE; + void rtl_draw(const char* str, int n, int x, int y) FL_OVERRIDE; + int height() FL_OVERRIDE; + int descent() FL_OVERRIDE; + double width(const char *str, int n) FL_OVERRIDE; + double width(unsigned c) FL_OVERRIDE; + void text_extents(const char* txt, int n, int& dx, int& dy, int& w, int& h) FL_OVERRIDE; + PangoFontDescription* pango_font_description() FL_OVERRIDE { return ((Fl_Cairo_Font_Descriptor*)font_descriptor())->fontref; } static void init_built_in_fonts(); - virtual Fl_Font set_fonts(const char* pattern_name); - virtual const char *font_name(int num); - virtual void font_name(int num, const char *name); - virtual const char* get_font_name(Fl_Font fnum, int* ap); - virtual int get_font_sizes(Fl_Font fnum, int*& sizep); - virtual Fl_Region XRectangleRegion(int x, int y, int w, int h); - virtual void XDestroyRegion(Fl_Region r); - virtual void add_rectangle_to_region(Fl_Region r, int X, int Y, int W, int H); - virtual void cache_size(Fl_Image *img, int &width, int &height); - virtual char can_do_alpha_blending(); - virtual float override_scale(); - virtual void restore_scale(float); - virtual void antialias(int state); - virtual int antialias(); + Fl_Font set_fonts(const char* pattern_name) FL_OVERRIDE; + const char *font_name(int num) FL_OVERRIDE; + void font_name(int num, const char *name) FL_OVERRIDE; + const char* get_font_name(Fl_Font fnum, int* ap) FL_OVERRIDE; + int get_font_sizes(Fl_Font fnum, int*& sizep) FL_OVERRIDE; + Fl_Region XRectangleRegion(int x, int y, int w, int h) FL_OVERRIDE; + void XDestroyRegion(Fl_Region r) FL_OVERRIDE; + void add_rectangle_to_region(Fl_Region r, int X, int Y, int W, int H) FL_OVERRIDE; + void cache_size(Fl_Image *img, int &width, int &height) FL_OVERRIDE; + char can_do_alpha_blending() FL_OVERRIDE; + float override_scale() FL_OVERRIDE; + void restore_scale(float) FL_OVERRIDE; + void antialias(int state) FL_OVERRIDE; + int antialias() FL_OVERRIDE; }; #endif // FL_CAIRO_GRAPHICS_DRIVER_H diff --git a/src/drivers/Cairo/Fl_Display_Cairo_Graphics_Driver.H b/src/drivers/Cairo/Fl_Display_Cairo_Graphics_Driver.H index 76986af9a..7c514b1cf 100644 --- a/src/drivers/Cairo/Fl_Display_Cairo_Graphics_Driver.H +++ b/src/drivers/Cairo/Fl_Display_Cairo_Graphics_Driver.H @@ -27,11 +27,11 @@ class Fl_Display_Cairo_Graphics_Driver : public Fl_Cairo_Graphics_Driver { private: static void *gc_; public: - virtual void scale(float f); - virtual float scale() {return Fl_Graphics_Driver::scale();} - virtual void gc(void *value); - virtual void* gc(); - virtual void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy); + void scale(float f) FL_OVERRIDE; + float scale() {return Fl_Graphics_Driver::scale();} + void gc(void *value) FL_OVERRIDE; + void* gc() FL_OVERRIDE; + void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy) FL_OVERRIDE; }; #endif // FL_DISPLAY_CAIRO_GRAPHICS_DRIVER_H |
