From 217120c28190fb0c544a48b9dec984ca4e9bd327 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Thu, 5 May 2022 18:57:07 +0200 Subject: Move struct shape_data_type inside Fl_XXX_Window_Driver. --- src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H | 10 +++++----- src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx | 3 +++ src/drivers/Wayland/Fl_Wayland_Window_Driver.H | 13 ++++++------- src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx | 1 + src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H | 12 ++++++------ src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx | 1 + src/drivers/X11/Fl_X11_Window_Driver.H | 14 ++++++-------- src/drivers/X11/Fl_X11_Window_Driver.cxx | 1 + 8 files changed, 29 insertions(+), 26 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H index f0d31ec1c..f5c9d8f7f 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H +++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H @@ -65,11 +65,6 @@ class NSOpenGLPixelFormat; ? where do we handle the interface between OpenGL/DirectX and Cocoa/Windows/Glx? */ -struct Fl_Window_Driver::shape_data_type { - Fl_Image* shape_; ///< shape image - typedef struct CGImage* CGImageRef; - CGImageRef mask; -}; /** \} @@ -80,6 +75,11 @@ struct Fl_Window_Driver::shape_data_type { class FL_EXPORT Fl_Cocoa_Window_Driver : public Fl_Window_Driver { private: + struct shape_data_type { + Fl_Image* shape_; ///< shape image + typedef struct CGImage* CGImageRef; + CGImageRef mask; + } *shape_data_; void shape_bitmap_(Fl_Image* b); void shape_alpha_(Fl_Image* img, int offset); CGRect* subRect_; // makes sure subwindow remains inside its parent window diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx index e91342c8a..b7f213da0 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx @@ -35,6 +35,7 @@ Fl_Cocoa_Window_Driver::Fl_Cocoa_Window_Driver(Fl_Window *win) window_flags_ = 0; icon_image = NULL; screen_num_ = 0; + shape_data_ = NULL; } @@ -88,6 +89,8 @@ void Fl_Cocoa_Window_Driver::draw_begin() CGContextClipToMask(my_gc, CGRectMake(0,0,w(),h()), shape_data_->mask); // requires Mac OS 10.4 } CGContextSaveGState(my_gc); + CGAffineTransform mat = CGContextGetCTM(my_gc); + printf("mat.a=%g\n",mat.a); # endif } } diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.H b/src/drivers/Wayland/Fl_Wayland_Window_Driver.H index df4876ccc..4fdcd957b 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.H +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.H @@ -42,18 +42,17 @@ typedef struct _cairo_pattern cairo_pattern_t; -struct Fl_Window_Driver::shape_data_type { - int lw_; ///< width of shape image - int lh_; ///< height of shape image - Fl_Image* shape_; ///< shape image - cairo_pattern_t *mask_pattern_; -}; - class FL_EXPORT Fl_Wayland_Window_Driver : public Fl_Window_Driver { friend class Fl_X; private: + struct shape_data_type { + int lw_; ///< width of shape image + int lh_; ///< height of shape image + Fl_Image* shape_; ///< shape image + cairo_pattern_t *mask_pattern_; + } *shape_data_; static bool in_flush; // useful for progressive window drawing struct wl_cursor *cursor_; void delete_cursor_(); diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx index 0f07082c5..e7377cc7f 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx @@ -63,6 +63,7 @@ void Fl_Wayland_Window_Driver::destroy_double_buffer() { Fl_Wayland_Window_Driver::Fl_Wayland_Window_Driver(Fl_Window *win) : Fl_Window_Driver(win) { + shape_data_ = NULL; cursor_ = NULL; in_handle_configure = false; screen_num_ = -1; diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H index 356eb8297..6c169f0b1 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H @@ -42,12 +42,6 @@ */ -struct Fl_Window_Driver::shape_data_type { - int lw_; ///< width of shape image - int lh_; ///< height of shape image - Fl_Image* shape_; ///< shape image - Fl_Bitmap *effective_bitmap_; ///< auxiliary bitmap image -}; class FL_EXPORT Fl_WinAPI_Window_Driver : public Fl_Window_Driver { @@ -58,6 +52,12 @@ class FL_EXPORT Fl_WinAPI_Window_Driver : public Fl_Window_Driver HICON big_icon; HICON small_icon; }; + struct shape_data_type { + int lw_; ///< width of shape image + int lh_; ///< height of shape image + Fl_Image* shape_; ///< shape image + Fl_Bitmap *effective_bitmap_; ///< auxiliary bitmap image + } *shape_data_; int screen_num_; private: void shape_bitmap_(Fl_Image* b); diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx index ab4bbfdee..459143dad 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx @@ -39,6 +39,7 @@ Fl_WinAPI_Window_Driver::Fl_WinAPI_Window_Driver(Fl_Window *win) : Fl_Window_Driver(win) { icon_ = new icon_data; + shape_data_ = NULL; memset(icon_, 0, sizeof(icon_data)); cursor = NULL; screen_num_ = -1; diff --git a/src/drivers/X11/Fl_X11_Window_Driver.H b/src/drivers/X11/Fl_X11_Window_Driver.H index a8224e8e1..b140441fd 100644 --- a/src/drivers/X11/Fl_X11_Window_Driver.H +++ b/src/drivers/X11/Fl_X11_Window_Driver.H @@ -44,14 +44,6 @@ class Fl_Bitmap; */ - -struct Fl_Window_Driver::shape_data_type { - int lw_; ///< width of shape image - int lh_; ///< height of shape image - Fl_Image* shape_; ///< shape image - Fl_Bitmap *effective_bitmap_; ///< auxiliary bitmap image -}; - class FL_EXPORT Fl_X11_Window_Driver : public Fl_Window_Driver { friend class Fl_X; @@ -63,6 +55,12 @@ private: Fl_RGB_Image **icons; int count; } *icon_; + struct shape_data_type { + int lw_; ///< width of shape image + int lh_; ///< height of shape image + Fl_Image* shape_; ///< shape image + Fl_Bitmap *effective_bitmap_; ///< auxiliary bitmap image + } *shape_data_; #if USE_XFT // --- support for screen-specific scaling factors struct type_for_resize_window_between_screens { diff --git a/src/drivers/X11/Fl_X11_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Window_Driver.cxx index 725f8f5e0..ed9dd8fcb 100644 --- a/src/drivers/X11/Fl_X11_Window_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Window_Driver.cxx @@ -48,6 +48,7 @@ Fl_X11_Window_Driver::Fl_X11_Window_Driver(Fl_Window *win) : Fl_Window_Driver(win) { icon_ = new icon_data; + shape_data_ = NULL; memset(icon_, 0, sizeof(icon_data)); #if USE_XFT screen_num_ = -1; -- cgit v1.2.3