]> git.saurik.com Git - wxWidgets.git/commitdiff
Adapted wxGTK to wxMSW's notion of region setting.
authorRobert Roebling <robert@roebling.de>
Sat, 4 Mar 2000 09:24:17 +0000 (09:24 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 4 Mar 2000 09:24:17 +0000 (09:24 +0000)
  Made Julian's gc_include_inferior hack a bit less radical.
  Small addition to changes.txt,
  Compile fix to dbbrowse sample. Still crashes upon startup.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

demos/dbbrowse/dbtree.cpp
docs/gtk/changes.txt
samples/drawing/drawing.cpp
src/gtk/dcclient.cpp
src/gtk1/dcclient.cpp

index 8bacf0a3711baa340cd063d421667ee145403b22..33bc980d71e24dc7c0e6ea231892f958a1842652 100644 (file)
@@ -159,7 +159,7 @@ int  DBTree::OnPopulate()
         Temp2 = ((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkTableName;
         if (Temp2 == "")
          Temp2 = _("None");
         Temp2 = ((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkTableName;
         if (Temp2 == "")
          Temp2 = _("None");
-        Temp2.Printf(_("This Primary Key is used in the following Tables : %s"),Temp2);
+        Temp2.Printf(_("This Primary Key is used in the following Tables : %s"),Temp2.c_str());
         Funkt = AppendItem(Docu,Temp2,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData("KEY"));
        }
        else
         Funkt = AppendItem(Docu,Temp2,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData("KEY"));
        }
        else
index 5bb7d1c5d712deff1500586c06698c8a2f8f5fae..abc2c00ef30aa2e4dcddf7f61e9ee421f5a2c33d 100644 (file)
@@ -1,5 +1,13 @@
 12th March '2000: wxWindows 2.1.14 released
 
 12th March '2000: wxWindows 2.1.14 released
 
+
+
+Added support for pipes and a stream class to get data
+out of them.
+
+Added memory file system (so you can save html pages with
+images in memory).
+
 Added wxDragImage class for dragging easily images.
 
 The DEB and RPM packages now conform better to various
 Added wxDragImage class for dragging easily images.
 
 The DEB and RPM packages now conform better to various
index 91a4cc41696935762dbd9c24f34dea27c11dba0a..0f1cf27ffd0f29a951fe6847e745158f17f55cf0 100644 (file)
@@ -897,14 +897,18 @@ void MyCanvas::DrawRegions(wxDC& dc)
     dc.SetPen( *wxTRANSPARENT_PEN );
     dc.DrawRectangle( 10,10,310,310 );
     
     dc.SetPen( *wxTRANSPARENT_PEN );
     dc.DrawRectangle( 10,10,310,310 );
     
-    wxRegion region( 20,20,100,270 );
-    dc.SetClippingRegion( region );
+    dc.SetClippingRegion( 20,20,100,270 );
     
     dc.SetBrush( *wxRED_BRUSH );
     dc.DrawRectangle( 10,10,310,310 );
     
     dc.SetBrush( *wxRED_BRUSH );
     dc.DrawRectangle( 10,10,310,310 );
+
+    dc.SetClippingRegion( 20,20,100,100 );
     
     
-    region = wxRegion( 120,30,100,270 );
-    dc.SetClippingRegion( region );
+    dc.SetBrush( *wxCYAN_BRUSH );
+    dc.DrawRectangle( 10,10,310,310 );
+
+    dc.DestroyClippingRegion();
+    dc.SetClippingRegion( 120,30,100,270 );
     
     dc.SetBrush( *wxGREY_BRUSH );
     dc.DrawRectangle( 10,10,310,310 );
     
     dc.SetBrush( *wxGREY_BRUSH );
     dc.DrawRectangle( 10,10,310,310 );
index 15b1c16e4b0cd3b15c90f80546fbb21043d6e13b..153341d17580c2edf34db889bd0e0518f7700c35 100644 (file)
@@ -21,6 +21,7 @@
 #include <math.h>               // for floating-point functions
 
 #include <gdk/gdk.h>
 #include <math.h>               // for floating-point functions
 
 #include <gdk/gdk.h>
+#include <gdk/gdkx.h>
 #include <gtk/gtk.h>
 
 //-----------------------------------------------------------------------------
 #include <gtk/gtk.h>
 
 //-----------------------------------------------------------------------------
@@ -153,10 +154,6 @@ static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
         {
             wxGCPool[i].m_gc = gdk_gc_new( window );
             gdk_gc_set_exposures( wxGCPool[i].m_gc, FALSE );
         {
             wxGCPool[i].m_gc = gdk_gc_new( window );
             gdk_gc_set_exposures( wxGCPool[i].m_gc, FALSE );
-            // This allows you to e.g. copy from the screen
-            // without clipping the windows on it.
-            gdk_gc_set_subwindow( wxGCPool[i].m_gc, 
-                                 GDK_INCLUDE_INFERIORS );
             wxGCPool[i].m_type = type;
             wxGCPool[i].m_used = FALSE;
         }
             wxGCPool[i].m_type = type;
             wxGCPool[i].m_used = FALSE;
         }
@@ -909,7 +906,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
 
     int old_logical_func = m_logicalFunction;
     SetLogicalFunction( logical_func );
 
     int old_logical_func = m_logicalFunction;
     SetLogicalFunction( logical_func );
-
+    
     if (use_bitmap_method)
     {
         /* scale/translate bitmap size */
     if (use_bitmap_method)
     {
         /* scale/translate bitmap size */
@@ -986,6 +983,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
 
         /* Draw XPixmap or XBitmap, depending on what the wxBitmap contains. For
            drawing a mono-bitmap (XBitmap) we use the current text GC */
 
         /* Draw XPixmap or XBitmap, depending on what the wxBitmap contains. For
            drawing a mono-bitmap (XBitmap) we use the current text GC */
+    
         if (is_mono)
             gdk_draw_bitmap( m_window, m_textGC, use_bitmap.GetBitmap(), xsrc, ysrc, xx, yy, ww, hh );
         else
         if (is_mono)
             gdk_draw_bitmap( m_window, m_textGC, use_bitmap.GetBitmap(), xsrc, ysrc, xx, yy, ww, hh );
         else
@@ -1028,10 +1026,21 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
                for a different implementation of the same problem. */
 
             wxBitmap bitmap( width, height );
                for a different implementation of the same problem. */
 
             wxBitmap bitmap( width, height );
-            gdk_window_copy_area( bitmap.GetPixmap(), m_penGC, 0, 0,
+            
+            /* We have to use the srcDC's GC as it might be a 
+               wxScreenDC and we only have the GDK_INCLUDE_INFERIORS
+               flag set there. */
+
+            if (srcDC->GetWindow() == GDK_ROOT_PARENT())
+                gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
+
+            gdk_window_copy_area( bitmap.GetPixmap(), srcDC->m_penGC, 0, 0,
                                   srcDC->GetWindow(),
                                   xsrc, ysrc, width, height );
 
                                   srcDC->GetWindow(),
                                   xsrc, ysrc, width, height );
 
+            if (srcDC->GetWindow() == GDK_ROOT_PARENT())
+                gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
+                
             /* scale image */
 
             wxImage image( bitmap );
             /* scale image */
 
             wxImage image( bitmap );
@@ -1048,11 +1057,17 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
         }
         else
         {
         }
         else
         {
-            /* no scaling and not a memory dc with a mask either */
+            /* No scaling and not a memory dc with a mask either */
+
+            if (srcDC->GetWindow() == GDK_ROOT_PARENT())
+                gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
 
             gdk_window_copy_area( m_window, m_penGC, xx, yy,
                                   srcDC->GetWindow(),
                                   xsrc, ysrc, width, height );
 
             gdk_window_copy_area( m_window, m_penGC, xx, yy,
                                   srcDC->GetWindow(),
                                   xsrc, ysrc, width, height );
+                                  
+            if (srcDC->GetWindow() == GDK_ROOT_PARENT())
+                gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
         }
     }
 
         }
     }
 
@@ -1635,8 +1650,11 @@ void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoo
     rect.width = XLOG2DEVREL(width);
     rect.height = YLOG2DEVREL(height);
     
     rect.width = XLOG2DEVREL(width);
     rect.height = YLOG2DEVREL(height);
     
-    m_currentClippingRegion.Clear();
-    m_currentClippingRegion.Union( rect );
+    if (!m_currentClippingRegion.IsEmpty())
+        m_currentClippingRegion.Intersect( rect );
+    else
+        m_currentClippingRegion.Union( rect );
+        
 #if USE_PAINT_REGION    
     if (!m_paintClippingRegion.IsEmpty())
         m_currentClippingRegion.Intersect( m_paintClippingRegion );
 #if USE_PAINT_REGION    
     if (!m_paintClippingRegion.IsEmpty())
         m_currentClippingRegion.Intersect( m_paintClippingRegion );
@@ -1665,8 +1683,11 @@ void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion &region  )
 
     if (!m_window) return;
     
 
     if (!m_window) return;
     
-    m_currentClippingRegion.Clear();
-    m_currentClippingRegion.Union( region );
+    if (!m_currentClippingRegion.IsEmpty())
+        m_currentClippingRegion.Intersect( region );
+    else
+        m_currentClippingRegion.Union( region );
+    
 #if USE_PAINT_REGION    
     if (!m_paintClippingRegion.IsEmpty())
         m_currentClippingRegion.Intersect( m_paintClippingRegion );
 #if USE_PAINT_REGION    
     if (!m_paintClippingRegion.IsEmpty())
         m_currentClippingRegion.Intersect( m_paintClippingRegion );
@@ -1686,8 +1707,10 @@ void wxWindowDC::DestroyClippingRegion()
 
     m_currentClippingRegion.Clear();
     
 
     m_currentClippingRegion.Clear();
     
+#if USE_PAINT_REGION    
     if (!m_paintClippingRegion.IsEmpty())
         m_currentClippingRegion.Union( m_paintClippingRegion );
     if (!m_paintClippingRegion.IsEmpty())
         m_currentClippingRegion.Union( m_paintClippingRegion );
+#endif
 
     if (!m_window) return;
 
 
     if (!m_window) return;
 
index 15b1c16e4b0cd3b15c90f80546fbb21043d6e13b..153341d17580c2edf34db889bd0e0518f7700c35 100644 (file)
@@ -21,6 +21,7 @@
 #include <math.h>               // for floating-point functions
 
 #include <gdk/gdk.h>
 #include <math.h>               // for floating-point functions
 
 #include <gdk/gdk.h>
+#include <gdk/gdkx.h>
 #include <gtk/gtk.h>
 
 //-----------------------------------------------------------------------------
 #include <gtk/gtk.h>
 
 //-----------------------------------------------------------------------------
@@ -153,10 +154,6 @@ static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
         {
             wxGCPool[i].m_gc = gdk_gc_new( window );
             gdk_gc_set_exposures( wxGCPool[i].m_gc, FALSE );
         {
             wxGCPool[i].m_gc = gdk_gc_new( window );
             gdk_gc_set_exposures( wxGCPool[i].m_gc, FALSE );
-            // This allows you to e.g. copy from the screen
-            // without clipping the windows on it.
-            gdk_gc_set_subwindow( wxGCPool[i].m_gc, 
-                                 GDK_INCLUDE_INFERIORS );
             wxGCPool[i].m_type = type;
             wxGCPool[i].m_used = FALSE;
         }
             wxGCPool[i].m_type = type;
             wxGCPool[i].m_used = FALSE;
         }
@@ -909,7 +906,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
 
     int old_logical_func = m_logicalFunction;
     SetLogicalFunction( logical_func );
 
     int old_logical_func = m_logicalFunction;
     SetLogicalFunction( logical_func );
-
+    
     if (use_bitmap_method)
     {
         /* scale/translate bitmap size */
     if (use_bitmap_method)
     {
         /* scale/translate bitmap size */
@@ -986,6 +983,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
 
         /* Draw XPixmap or XBitmap, depending on what the wxBitmap contains. For
            drawing a mono-bitmap (XBitmap) we use the current text GC */
 
         /* Draw XPixmap or XBitmap, depending on what the wxBitmap contains. For
            drawing a mono-bitmap (XBitmap) we use the current text GC */
+    
         if (is_mono)
             gdk_draw_bitmap( m_window, m_textGC, use_bitmap.GetBitmap(), xsrc, ysrc, xx, yy, ww, hh );
         else
         if (is_mono)
             gdk_draw_bitmap( m_window, m_textGC, use_bitmap.GetBitmap(), xsrc, ysrc, xx, yy, ww, hh );
         else
@@ -1028,10 +1026,21 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
                for a different implementation of the same problem. */
 
             wxBitmap bitmap( width, height );
                for a different implementation of the same problem. */
 
             wxBitmap bitmap( width, height );
-            gdk_window_copy_area( bitmap.GetPixmap(), m_penGC, 0, 0,
+            
+            /* We have to use the srcDC's GC as it might be a 
+               wxScreenDC and we only have the GDK_INCLUDE_INFERIORS
+               flag set there. */
+
+            if (srcDC->GetWindow() == GDK_ROOT_PARENT())
+                gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
+
+            gdk_window_copy_area( bitmap.GetPixmap(), srcDC->m_penGC, 0, 0,
                                   srcDC->GetWindow(),
                                   xsrc, ysrc, width, height );
 
                                   srcDC->GetWindow(),
                                   xsrc, ysrc, width, height );
 
+            if (srcDC->GetWindow() == GDK_ROOT_PARENT())
+                gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
+                
             /* scale image */
 
             wxImage image( bitmap );
             /* scale image */
 
             wxImage image( bitmap );
@@ -1048,11 +1057,17 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
         }
         else
         {
         }
         else
         {
-            /* no scaling and not a memory dc with a mask either */
+            /* No scaling and not a memory dc with a mask either */
+
+            if (srcDC->GetWindow() == GDK_ROOT_PARENT())
+                gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
 
             gdk_window_copy_area( m_window, m_penGC, xx, yy,
                                   srcDC->GetWindow(),
                                   xsrc, ysrc, width, height );
 
             gdk_window_copy_area( m_window, m_penGC, xx, yy,
                                   srcDC->GetWindow(),
                                   xsrc, ysrc, width, height );
+                                  
+            if (srcDC->GetWindow() == GDK_ROOT_PARENT())
+                gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
         }
     }
 
         }
     }
 
@@ -1635,8 +1650,11 @@ void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoo
     rect.width = XLOG2DEVREL(width);
     rect.height = YLOG2DEVREL(height);
     
     rect.width = XLOG2DEVREL(width);
     rect.height = YLOG2DEVREL(height);
     
-    m_currentClippingRegion.Clear();
-    m_currentClippingRegion.Union( rect );
+    if (!m_currentClippingRegion.IsEmpty())
+        m_currentClippingRegion.Intersect( rect );
+    else
+        m_currentClippingRegion.Union( rect );
+        
 #if USE_PAINT_REGION    
     if (!m_paintClippingRegion.IsEmpty())
         m_currentClippingRegion.Intersect( m_paintClippingRegion );
 #if USE_PAINT_REGION    
     if (!m_paintClippingRegion.IsEmpty())
         m_currentClippingRegion.Intersect( m_paintClippingRegion );
@@ -1665,8 +1683,11 @@ void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion &region  )
 
     if (!m_window) return;
     
 
     if (!m_window) return;
     
-    m_currentClippingRegion.Clear();
-    m_currentClippingRegion.Union( region );
+    if (!m_currentClippingRegion.IsEmpty())
+        m_currentClippingRegion.Intersect( region );
+    else
+        m_currentClippingRegion.Union( region );
+    
 #if USE_PAINT_REGION    
     if (!m_paintClippingRegion.IsEmpty())
         m_currentClippingRegion.Intersect( m_paintClippingRegion );
 #if USE_PAINT_REGION    
     if (!m_paintClippingRegion.IsEmpty())
         m_currentClippingRegion.Intersect( m_paintClippingRegion );
@@ -1686,8 +1707,10 @@ void wxWindowDC::DestroyClippingRegion()
 
     m_currentClippingRegion.Clear();
     
 
     m_currentClippingRegion.Clear();
     
+#if USE_PAINT_REGION    
     if (!m_paintClippingRegion.IsEmpty())
         m_currentClippingRegion.Union( m_paintClippingRegion );
     if (!m_paintClippingRegion.IsEmpty())
         m_currentClippingRegion.Union( m_paintClippingRegion );
+#endif
 
     if (!m_window) return;
 
 
     if (!m_window) return;