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/Wayland | |
| 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/Wayland')
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Copy_Surface_Driver.H | 6 | ||||
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H | 30 | ||||
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx | 10 | ||||
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H | 6 | ||||
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.H | 10 | ||||
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Screen_Driver.H | 68 | ||||
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Window_Driver.H | 64 |
7 files changed, 97 insertions, 97 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Copy_Surface_Driver.H b/src/drivers/Wayland/Fl_Wayland_Copy_Surface_Driver.H index f5f6eee11..e10a801ce 100644 --- a/src/drivers/Wayland/Fl_Wayland_Copy_Surface_Driver.H +++ b/src/drivers/Wayland/Fl_Wayland_Copy_Surface_Driver.H @@ -26,9 +26,9 @@ class Fl_Wayland_Copy_Surface_Driver : public Fl_Copy_Surface_Driver { protected: Fl_Wayland_Copy_Surface_Driver(int w, int h); ~Fl_Wayland_Copy_Surface_Driver(); - void set_current(); - void translate(int x, int y); - void untranslate(); + void set_current() FL_OVERRIDE; + void translate(int x, int y) FL_OVERRIDE; + void untranslate() FL_OVERRIDE; }; #endif // FL_WAYLAND_COPY_SURFACE_DRIVER_H diff --git a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H index e30143468..960f18c11 100644 --- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H +++ b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H @@ -38,21 +38,21 @@ class Fl_Wayland_Gl_Window_Driver : public Fl_Gl_Window_Driver { friend class Fl_Wayland_Gl_Plugin; bool egl_swap_in_progress; Fl_Wayland_Gl_Window_Driver(Fl_Gl_Window *win); - virtual float pixels_per_unit(); - virtual void make_current_before(); - virtual int mode_(int m, const int *a); - virtual void swap_buffers(); - virtual void resize(int is_a_resize, int w, int h); - virtual char swap_type(); - virtual Fl_Gl_Choice *find(int m, const int *alistp); - virtual GLContext create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g); - virtual void set_gl_context(Fl_Window* w, GLContext context); - virtual void delete_gl_context(GLContext); - virtual void make_overlay_current(); - virtual void redraw_overlay(); - virtual void gl_start(); - virtual void gl_visual(Fl_Gl_Choice *c); - char *alpha_mask_for_string(const char *str, int n, int w, int h, Fl_Fontsize fs); + float pixels_per_unit() FL_OVERRIDE; + void make_current_before() FL_OVERRIDE; + int mode_(int m, const int *a) FL_OVERRIDE; + void swap_buffers() FL_OVERRIDE; + void resize(int is_a_resize, int w, int h) FL_OVERRIDE; + char swap_type() FL_OVERRIDE; + Fl_Gl_Choice *find(int m, const int *alistp) FL_OVERRIDE; + GLContext create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g) FL_OVERRIDE; + void set_gl_context(Fl_Window* w, GLContext context) FL_OVERRIDE; + void delete_gl_context(GLContext) FL_OVERRIDE; + void make_overlay_current() FL_OVERRIDE; + void redraw_overlay() FL_OVERRIDE; + void gl_start() FL_OVERRIDE; + void gl_visual(Fl_Gl_Choice *c) FL_OVERRIDE; + char *alpha_mask_for_string(const char *str, int n, int w, int h, Fl_Fontsize fs) FL_OVERRIDE; static EGLDisplay egl_display; static EGLint configs_count; void init(); diff --git a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx index 3624d63f9..45a26e046 100644 --- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx @@ -371,20 +371,20 @@ void Fl_Wayland_Gl_Window_Driver::swap_buffers() { class Fl_Wayland_Gl_Plugin : public Fl_Wayland_Plugin { public: Fl_Wayland_Gl_Plugin() : Fl_Wayland_Plugin(name()) { } - virtual const char *name() { return "gl.wayland.fltk.org"; } - virtual void do_swap(Fl_Window *w) { + const char *name() FL_OVERRIDE { return "gl.wayland.fltk.org"; } + void do_swap(Fl_Window *w) FL_OVERRIDE { Fl_Gl_Window_Driver *gldr = Fl_Gl_Window_Driver::driver(w->as_gl_window()); if (gldr->overlay() == w) gldr->swap_buffers(); } - virtual void invalidate(Fl_Window *w) { + void invalidate(Fl_Window *w) FL_OVERRIDE { w->as_gl_window()->valid(0); } - virtual void terminate() { + void terminate() FL_OVERRIDE { if (Fl_Wayland_Gl_Window_Driver::egl_display != EGL_NO_DISPLAY) { eglTerminate(Fl_Wayland_Gl_Window_Driver::egl_display); } } - virtual void destroy(struct gl_start_support *gl_start_support_) { + void destroy(struct gl_start_support *gl_start_support_) FL_OVERRIDE { eglDestroySurface(Fl_Wayland_Gl_Window_Driver::egl_display, gl_start_support_->egl_surface); wl_egl_window_destroy(gl_start_support_->egl_window); wl_subsurface_destroy(gl_start_support_->subsurface); diff --git a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H index 01932fc50..d736df9de 100644 --- a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H +++ b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H @@ -75,13 +75,13 @@ public: Fl_Wayland_Graphics_Driver(); static const uint32_t wld_format; void set_buffer(struct fl_wld_buffer *buffer, float scale = 0); - virtual void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen osrc, int srcx, int srcy); + void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen osrc, int srcx, int srcy) FL_OVERRIDE; static struct fl_wld_buffer *create_shm_buffer(int width, int height); static void buffer_release(struct wld_window *window); static void buffer_commit(struct wld_window *window, bool need_damage = true); static void cairo_init(struct fl_wld_buffer *buffer, int width, int height, int stride, cairo_format_t format); - virtual void *gc(); - virtual void gc(void *gc); + void *gc() FL_OVERRIDE; + void gc(void *gc) FL_OVERRIDE; }; #endif // FL_WAYLAND_GRAPHICS_DRIVER_H diff --git a/src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.H b/src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.H index 7959267f8..8e7246c24 100644 --- a/src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.H +++ b/src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.H @@ -21,15 +21,15 @@ #include <FL/platform.H> class Fl_Wayland_Image_Surface_Driver : public Fl_Image_Surface_Driver { - virtual void end_current(); + void end_current() FL_OVERRIDE; struct wld_window *pre_window; public: Fl_Wayland_Image_Surface_Driver(int w, int h, int high_res, Fl_Offscreen off); ~Fl_Wayland_Image_Surface_Driver(); - virtual void set_current(); - virtual void translate(int x, int y); - virtual void untranslate(); - virtual Fl_RGB_Image *image(); + void set_current() FL_OVERRIDE; + void translate(int x, int y) FL_OVERRIDE; + void untranslate() FL_OVERRIDE; + Fl_RGB_Image *image() FL_OVERRIDE; }; #endif // FL_WAYLAND_IMAGE_SURFACE_DRIVER_H diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H index 8ef09fd68..afc895e01 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H @@ -117,49 +117,49 @@ public: struct zwp_text_input_manager_v3 *text_input_base; Fl_Wayland_Screen_Driver(); - virtual APP_SCALING_CAPABILITY rescalable() { return PER_SCREEN_APP_SCALING; } - virtual float scale(int n); - virtual void scale(int n, float f); + APP_SCALING_CAPABILITY rescalable() FL_OVERRIDE { return PER_SCREEN_APP_SCALING; } + float scale(int n) FL_OVERRIDE; + void scale(int n, float f) FL_OVERRIDE; int screen_num_unscaled(int x, int y); void copy_image(const unsigned char* data, int W, int H); // --- screen configuration void init_workarea(); - virtual void init(); - virtual int x(); - virtual int y(); - virtual int w(); - virtual int h(); - virtual void screen_xywh(int &X, int &Y, int &W, int &H, int n); - virtual void screen_dpi(float &h, float &v, int n=0); - virtual void screen_work_area(int &X, int &Y, int &W, int &H, int n); + void init() FL_OVERRIDE; + int x() FL_OVERRIDE; + int y() FL_OVERRIDE; + int w() FL_OVERRIDE; + int h() FL_OVERRIDE; + void screen_xywh(int &X, int &Y, int &W, int &H, int n) FL_OVERRIDE; + void screen_dpi(float &h, float &v, int n=0) FL_OVERRIDE; + void screen_work_area(int &X, int &Y, int &W, int &H, int n) FL_OVERRIDE; // --- audible output - virtual void beep(int type); + void beep(int type) FL_OVERRIDE; // --- global events - virtual void flush(); - virtual void grab(Fl_Window* win); + void flush() FL_OVERRIDE; + void grab(Fl_Window* win) FL_OVERRIDE; // --- global colors - virtual void get_system_colors(); - virtual const char *get_system_scheme(); - virtual int dnd(int unused); - virtual int compose(int &del); - virtual void compose_reset(); - virtual Fl_RGB_Image *read_win_rectangle(int X, int Y, int w, int h, Fl_Window *win, bool may_capture_subwins, bool *did_capture_subwins); - virtual int get_mouse(int &x, int &y); - virtual void open_display_platform(); - virtual void close_display(); - virtual void display(const char *d); + void get_system_colors() FL_OVERRIDE; + const char *get_system_scheme() FL_OVERRIDE; + int dnd(int unused) FL_OVERRIDE; + int compose(int &del) FL_OVERRIDE; + void compose_reset() FL_OVERRIDE; + Fl_RGB_Image *read_win_rectangle(int X, int Y, int w, int h, Fl_Window *win, bool may_capture_subwins, bool *did_capture_subwins) FL_OVERRIDE; + int get_mouse(int &x, int &y) FL_OVERRIDE; + void open_display_platform() FL_OVERRIDE; + void close_display() FL_OVERRIDE; + void display(const char *d) FL_OVERRIDE; // --- compute dimensions of an Fl_Offscreen - virtual void offscreen_size(Fl_Offscreen o, int &width, int &height); - virtual int has_marked_text() const; + void offscreen_size(Fl_Offscreen o, int &width, int &height) FL_OVERRIDE; + int has_marked_text() const FL_OVERRIDE; static int next_marked_length; // next length of marked text after current marked text will have been replaced // --- clipboard operations // this one is in fl_wayland_clipboard_dnd.cxx - virtual void copy(const char *stuff, int len, int clipboard, const char *type); + void copy(const char *stuff, int len, int clipboard, const char *type) FL_OVERRIDE; // this one is in fl_wayland_clipboard_dnd.cxx - virtual void paste(Fl_Widget &receiver, int clipboard, const char *type); + void paste(Fl_Widget &receiver, int clipboard, const char *type) FL_OVERRIDE; // this one is in fl_wayland_clipboard_dnd.cxx - virtual int clipboard_contains(const char *type); + int clipboard_contains(const char *type) FL_OVERRIDE; // --- Wayland-special void set_cursor(); struct wl_cursor *default_cursor(); @@ -173,11 +173,11 @@ public: static bool own_output(struct wl_output *output); typedef enum {unspecified, MUTTER, WESTON, KDE} compositor_name; static compositor_name compositor; // identifies the used Wayland compositor - void set_spot(int font, int height, int x, int y, int w, int h, Fl_Window *win); - void reset_spot(); - virtual void *control_maximize_button(void *data); - int event_key(int k); - int get_key(int k); + void set_spot(int font, int height, int x, int y, int w, int h, Fl_Window *win) FL_OVERRIDE; + void reset_spot() FL_OVERRIDE; + void *control_maximize_button(void *data) FL_OVERRIDE; + int event_key(int k) FL_OVERRIDE; + int get_key(int k) FL_OVERRIDE; }; diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.H b/src/drivers/Wayland/Fl_Wayland_Window_Driver.H index 2b12ededd..60e346915 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.H +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.H @@ -77,7 +77,7 @@ public: static type_for_resize_window_between_screens data_for_resize_window_between_screens_; void decorated_win_size(int &w, int &h); void shape_bitmap_(Fl_Image* b); - void shape_alpha_(Fl_Image* img, int offset); + void shape_alpha_(Fl_Image* img, int offset) FL_OVERRIDE; void update_scale(); cairo_rectangle_int_t *subRect() { return subRect_; } // getter void subRect(cairo_rectangle_int_t *r); // setter @@ -93,40 +93,40 @@ public: static void resize_after_screen_change(void *data); // --- window data - virtual int decorated_w(); - virtual int decorated_h(); - virtual const Fl_Image* shape(); + int decorated_w() FL_OVERRIDE; + int decorated_h() FL_OVERRIDE; + const Fl_Image* shape() FL_OVERRIDE; // --- window management - virtual Fl_X *makeWindow(); - virtual void take_focus(); - virtual void flush(); - virtual void flush_overlay(); - virtual void draw_end(); - virtual void make_current(); - virtual void show(); - virtual void resize(int X,int Y,int W,int H); - virtual void label(const char *name, const char *mininame); - virtual void destroy_double_buffer(); - virtual void hide(); - virtual void map(); - virtual void unmap(); - virtual void fullscreen_on(); - virtual void fullscreen_off(int X, int Y, int W, int H); - virtual void use_border(); - virtual void size_range(); - virtual void iconize(); - virtual void decoration_sizes(int *top, int *left, int *right, int *bottom); + Fl_X *makeWindow() FL_OVERRIDE; + void take_focus() FL_OVERRIDE; + void flush() FL_OVERRIDE; + void flush_overlay() FL_OVERRIDE; + void draw_end() FL_OVERRIDE; + void make_current() FL_OVERRIDE; + void show() FL_OVERRIDE; + void resize(int X,int Y,int W,int H) FL_OVERRIDE; + void label(const char *name, const char *mininame) FL_OVERRIDE; + void destroy_double_buffer() FL_OVERRIDE; + void hide() FL_OVERRIDE; + void map() FL_OVERRIDE; + void unmap() FL_OVERRIDE; + void fullscreen_on() FL_OVERRIDE; + void fullscreen_off(int X, int Y, int W, int H) FL_OVERRIDE; + void use_border() FL_OVERRIDE; + void size_range() FL_OVERRIDE; + void iconize() FL_OVERRIDE; + void decoration_sizes(int *top, int *left, int *right, int *bottom) FL_OVERRIDE; // --- window cursor stuff - virtual int set_cursor(Fl_Cursor); - virtual int set_cursor(const Fl_RGB_Image*, int, int); - - virtual void shape(const Fl_Image* img); - virtual void capture_titlebar_and_borders(Fl_RGB_Image*& top, Fl_RGB_Image*& left, Fl_RGB_Image*& bottom, Fl_RGB_Image*& right); - virtual int scroll(int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, void (*draw_area)(void*, int,int,int,int), void* data); - virtual void wait_for_expose(); - virtual void reposition_menu_window(int x, int y); - virtual void menu_window_area(int &X, int &Y, int &W, int &H, int nscreen = -1); + int set_cursor(Fl_Cursor) FL_OVERRIDE; + int set_cursor(const Fl_RGB_Image*, int, int) FL_OVERRIDE; + + void shape(const Fl_Image* img) FL_OVERRIDE; + void capture_titlebar_and_borders(Fl_RGB_Image*& top, Fl_RGB_Image*& left, Fl_RGB_Image*& bottom, Fl_RGB_Image*& right) FL_OVERRIDE; + int scroll(int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, void (*draw_area)(void*, int,int,int,int), void* data) FL_OVERRIDE; + void wait_for_expose() FL_OVERRIDE; + void reposition_menu_window(int x, int y) FL_OVERRIDE; + void menu_window_area(int &X, int &Y, int &W, int &H, int nscreen = -1) FL_OVERRIDE; }; |
