FLTK logo

[master] 217120c - Move struct shape_data_type inside Fl_XXX_Window_Driver.

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 217120c - Move struct shape_data_type inside Fl_XXX_Window_Driver. "ManoloFLTK" May 05, 2022  
 
commit 217120c28190fb0c544a48b9dec984ca4e9bd327
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Thu May 5 18:57:07 2022 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Thu May 5 18:57:07 2022 +0200

    Move struct shape_data_type inside Fl_XXX_Window_Driver.

 src/Fl_Window_Driver.H                           |  2 --
 src/Fl_Window_Driver.cxx                         |  1 -
 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 +
 10 files changed, 29 insertions(+), 29 deletions(-)

diff --git src/Fl_Window_Driver.H src/Fl_Window_Driver.H
index 9d2a890..ddc4463 100644
--- src/Fl_Window_Driver.H
+++ src/Fl_Window_Driver.H
@@ -56,8 +56,6 @@ private:
 
 protected:
   Fl_Window *pWindow;
-  struct shape_data_type;
-  shape_data_type *shape_data_; ///< non-null means the window has a non-rectangular shape
   void flush_Fl_Window(); // accessor to protected Fl_Window::flush()
 public:
   Fl_Window_Driver(Fl_Window *);
diff --git src/Fl_Window_Driver.cxx src/Fl_Window_Driver.cxx
index 025aa36..23c66be 100644
--- src/Fl_Window_Driver.cxx
+++ src/Fl_Window_Driver.cxx
@@ -39,7 +39,6 @@ extern void fl_throw_focus(Fl_Widget *o);
  */
 Fl_Window_Driver::Fl_Window_Driver(Fl_Window *win)
   : pWindow(win) {
-  shape_data_ = NULL;
   wait_for_expose_value = 0;
   other_xid = 0;
 }
diff --git src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H
index f0d31ec..f5c9d8f 100644
--- src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H
+++ 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 src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx
index e91342c..b7f213d 100644
--- src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx
+++ 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 src/drivers/Wayland/Fl_Wayland_Window_Driver.H src/drivers/Wayland/Fl_Wayland_Window_Driver.H
index df4876c..4fdcd95 100644
--- src/drivers/Wayland/Fl_Wayland_Window_Driver.H
+++ 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 src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index 0f07082..e7377cc 100644
--- src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ 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 src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H
index 356eb82..6c169f0 100644
--- src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H
+++ 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 src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
index ab4bbfd..459143d 100644
--- src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
+++ 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 src/drivers/X11/Fl_X11_Window_Driver.H src/drivers/X11/Fl_X11_Window_Driver.H
index a8224e8..b140441 100644
--- src/drivers/X11/Fl_X11_Window_Driver.H
+++ 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 src/drivers/X11/Fl_X11_Window_Driver.cxx src/drivers/X11/Fl_X11_Window_Driver.cxx
index 725f8f5..ed9dd8f 100644
--- src/drivers/X11/Fl_X11_Window_Driver.cxx
+++ 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;
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.