[ooo-build-commit] Branch 'ooo/OOO320' - basegfx/source vcl/inc vcl/source vcl/unx

Jan Holesovsky kendy at kemper.freedesktop.org
Wed Nov 4 02:56:55 PST 2009


 basegfx/source/polygon/b3dpolygontools.cxx |  167 ++++++++++++++++++++++-------
 vcl/inc/vcl/bitmapex.hxx                   |   13 ++
 vcl/source/gdi/bitmapex.cxx                |   73 ++++++++++++
 vcl/unx/gtk/window/gtkframe.cxx            |   16 ++
 vcl/unx/inc/plugins/gtk/gtkframe.hxx       |    7 -
 5 files changed, 233 insertions(+), 43 deletions(-)

New commits:
commit a0018684ae83fee609ced775983a455b674e4d24
Author: Oliver Bolte <obo at openoffice.org>
Date:   Tue Nov 3 07:20:40 2009 +0000

    CWS-TOOLING: integrate CWS ooo32gsl02
    2009-10-26 18:53:55 +0100 aw  r277188 : #i105856# Corrected error with not taking into account that getB2DRange may be empty for primitives
    2009-10-21 11:55:42 +0200 pl  r277083 : fix a compile problem
    2009-10-21 11:51:34 +0200 pl  r277082 : fix a compile problem
    2009-10-21 11:47:51 +0200 pl  r277081 : fix a compile problem
    2009-10-20 17:42:51 +0200 pl  r277067 : #i106068# add missing SAL_FRAME_STYLE_FLOAT_FOCUSABLE handling
    2009-10-20 17:37:20 +0200 aw  r277065 : #i105065# speedup 3D/FontWork
    2009-10-20 17:36:32 +0200 aw  r277064 : #i105065# speedup 3D/FontWork
    2009-10-20 17:36:14 +0200 aw  r277063 : #i105065# speedup 3D/FontWork
    2009-10-20 17:36:02 +0200 aw  r277062 : #i105065# speedup 3D/FontWork
    2009-10-20 17:35:41 +0200 aw  r277061 : #i105065# speedup 3D/FontWork
    2009-10-20 13:48:09 +0200 aw  r277052 : #i105856# changed conditions for using the filled TextShape for HitTest to do the same as before primitives
    2009-10-13 19:06:46 +0200 pl  r276870 : #i105753# fix quickstart mode on Mac

diff --git a/basegfx/source/polygon/b3dpolygontools.cxx b/basegfx/source/polygon/b3dpolygontools.cxx
index 9164793..0eb5bcc 100644
--- a/basegfx/source/polygon/b3dpolygontools.cxx
+++ b/basegfx/source/polygon/b3dpolygontools.cxx
@@ -875,52 +875,147 @@ namespace basegfx
             }
             else
             {
+                bool bRetval(false);
                 const B3DVector aPlaneNormal(rCandidate.getNormal());
 
                 if(!aPlaneNormal.equalZero())
                 {
-                    const double fAbsX(fabs(aPlaneNormal.getX()));
-                    const double fAbsY(fabs(aPlaneNormal.getY()));
-                    const double fAbsZ(fabs(aPlaneNormal.getZ()));
+                    const sal_uInt32 nPointCount(rCandidate.count());
 
-                    if(fAbsX > fAbsY && fAbsX > fAbsZ)
+                    if(nPointCount)
                     {
-                        // normal points mostly in X-Direction, use YZ-Polygon projection for check
-                        B3DHomMatrix aTrans;
+                        B3DPoint aCurrentPoint(rCandidate.getB3DPoint(nPointCount - 1));
+                        const double fAbsX(fabs(aPlaneNormal.getX()));
+                        const double fAbsY(fabs(aPlaneNormal.getY()));
+                        const double fAbsZ(fabs(aPlaneNormal.getZ()));
 
-                        aTrans.set(0, 0, 0.0);
-                        aTrans.set(0, 1, 1.0);
-                        aTrans.set(1, 1, 0.0);
-                        aTrans.set(1, 2, 1.0);
-        
-                        const B2DPolygon aYZ(createB2DPolygonFromB3DPolygon(rCandidate, aTrans));
-
-                        return isInside(aYZ, B2DPoint(rPoint.getY(), rPoint.getZ()), bWithBorder);
-                    }
-                    else if(fAbsY > fAbsX && fAbsY > fAbsZ)
-                    {
-                        // normal points mostly in Y-Direction, use XZ-Polygon projection for check
-                        B3DHomMatrix aTrans;
-                        
-                        aTrans.set(1, 1, 0.0);
-                        aTrans.set(1, 2, 1.0);
-                        
-                        const B2DPolygon aXZ(createB2DPolygonFromB3DPolygon(rCandidate, aTrans));
-
-                        return isInside(aXZ, B2DPoint(rPoint.getX(), rPoint.getZ()), bWithBorder);
-                    }
-                    else
-                    {
-                        // normal points mostly in Z-Direction, use XY-Polygon projection for check
-                        B3DHomMatrix aTrans;
-                        
-                        const B2DPolygon aXY(createB2DPolygonFromB3DPolygon(rCandidate, aTrans));
-
-                        return isInside(aXY, B2DPoint(rPoint.getX(), rPoint.getY()), bWithBorder);
+                        if(fAbsX > fAbsY && fAbsX > fAbsZ)
+                        {
+                            // normal points mostly in X-Direction, use YZ-Polygon projection for check
+                            // x -> y, y -> z
+                            for(sal_uInt32 a(0); a < nPointCount; a++)
+                            {
+                                const B3DPoint aPreviousPoint(aCurrentPoint);
+                                aCurrentPoint = rCandidate.getB3DPoint(a);
+                                
+                                // cross-over in Z?
+                                const bool bCompZA(fTools::more(aPreviousPoint.getZ(), rPoint.getZ()));
+                                const bool bCompZB(fTools::more(aCurrentPoint.getZ(), rPoint.getZ()));
+
+                                if(bCompZA != bCompZB)
+                                {
+                                    // cross-over in Y?
+                                    const bool bCompYA(fTools::more(aPreviousPoint.getY(), rPoint.getY()));
+                                    const bool bCompYB(fTools::more(aCurrentPoint.getY(), rPoint.getY()));
+                                
+                                    if(bCompYA == bCompYB)
+                                    {
+                                        if(bCompYA)
+                                        {
+                                            bRetval = !bRetval;
+                                        }
+                                    }
+                                    else
+                                    {
+                                        const double fCompare(
+                                            aCurrentPoint.getY() - (aCurrentPoint.getZ() - rPoint.getZ()) *
+                                            (aPreviousPoint.getY() - aCurrentPoint.getY()) /
+                                            (aPreviousPoint.getZ() - aCurrentPoint.getZ()));
+
+                                        if(fTools::more(fCompare, rPoint.getY()))
+                                        {
+                                            bRetval = !bRetval;
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                        else if(fAbsY > fAbsX && fAbsY > fAbsZ)
+                        {
+                            // normal points mostly in Y-Direction, use XZ-Polygon projection for check
+                            // x -> x, y -> z
+                            for(sal_uInt32 a(0); a < nPointCount; a++)
+                            {
+                                const B3DPoint aPreviousPoint(aCurrentPoint);
+                                aCurrentPoint = rCandidate.getB3DPoint(a);
+                                
+                                // cross-over in Z?
+                                const bool bCompZA(fTools::more(aPreviousPoint.getZ(), rPoint.getZ()));
+                                const bool bCompZB(fTools::more(aCurrentPoint.getZ(), rPoint.getZ()));
+
+                                if(bCompZA != bCompZB)
+                                {
+                                    // cross-over in X?
+                                    const bool bCompXA(fTools::more(aPreviousPoint.getX(), rPoint.getX()));
+                                    const bool bCompXB(fTools::more(aCurrentPoint.getX(), rPoint.getX()));
+                                
+                                    if(bCompXA == bCompXB)
+                                    {
+                                        if(bCompXA)
+                                        {
+                                            bRetval = !bRetval;
+                                        }
+                                    }
+                                    else
+                                    {
+                                        const double fCompare(
+                                            aCurrentPoint.getX() - (aCurrentPoint.getZ() - rPoint.getZ()) *
+                                            (aPreviousPoint.getX() - aCurrentPoint.getX()) /
+                                            (aPreviousPoint.getZ() - aCurrentPoint.getZ()));
+
+                                        if(fTools::more(fCompare, rPoint.getX()))
+                                        {
+                                            bRetval = !bRetval;
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                        else
+                        {
+                            // normal points mostly in Z-Direction, use XY-Polygon projection for check
+                            // x -> x, y -> y
+                            for(sal_uInt32 a(0); a < nPointCount; a++)
+                            {
+                                const B3DPoint aPreviousPoint(aCurrentPoint);
+                                aCurrentPoint = rCandidate.getB3DPoint(a);
+                                
+                                // cross-over in Y?
+                                const bool bCompYA(fTools::more(aPreviousPoint.getY(), rPoint.getY()));
+                                const bool bCompYB(fTools::more(aCurrentPoint.getY(), rPoint.getY()));
+
+                                if(bCompYA != bCompYB)
+                                {
+                                    // cross-over in X?
+                                    const bool bCompXA(fTools::more(aPreviousPoint.getX(), rPoint.getX()));
+                                    const bool bCompXB(fTools::more(aCurrentPoint.getX(), rPoint.getX()));
+                                
+                                    if(bCompXA == bCompXB)
+                                    {
+                                        if(bCompXA)
+                                        {
+                                            bRetval = !bRetval;
+                                        }
+                                    }
+                                    else
+                                    {
+                                        const double fCompare(
+                                            aCurrentPoint.getX() - (aCurrentPoint.getY() - rPoint.getY()) *
+                                            (aPreviousPoint.getX() - aCurrentPoint.getX()) /
+                                            (aPreviousPoint.getY() - aCurrentPoint.getY()));
+
+                                        if(fTools::more(fCompare, rPoint.getX()))
+                                        {
+                                            bRetval = !bRetval;
+                                        }
+                                    }
+                                }
+                            }
+                        }
                     }
                 }
 
-                return false;
+                return bRetval;
             }
         }
 
diff --git a/vcl/inc/vcl/bitmapex.hxx b/vcl/inc/vcl/bitmapex.hxx
index 82287c5..dc4c3e0 100644
--- a/vcl/inc/vcl/bitmapex.hxx
+++ b/vcl/inc/vcl/bitmapex.hxx
@@ -381,6 +381,19 @@ public:
                                 const BmpFilterParam* pFilterParam = NULL,
                                 const Link* pProgress = NULL );
 
+    /** Get transparency at given position
+
+        @param nX
+        integer X-Position in Bitmap
+
+        @param nY
+        integer Y-Position in Bitmap
+
+        @return transparency value in the range of [0 .. 255] where
+                0 is not transparent, 255 is fully transparent
+     */
+    sal_uInt8 GetTransparency(sal_Int32 nX, sal_Int32 nY) const;
+
 public:
 
     friend VCL_DLLPUBLIC SvStream&	operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx );
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 1af5b19..83e1780 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -47,6 +47,7 @@
 #include <tools/rc.h>
 #endif
 #include <vcl/svapp.hxx>
+#include <vcl/bmpacc.hxx>
 
 // ------------
 // - BitmapEx -
@@ -761,6 +762,78 @@ void BitmapEx::Draw( OutputDevice* pOutDev,
 
 // ------------------------------------------------------------------
 
+sal_uInt8 BitmapEx::GetTransparency(sal_Int32 nX, sal_Int32 nY) const
+{
+    sal_uInt8 nTransparency(0xff);
+
+    if(!aBitmap.IsEmpty())
+    {
+        if(nX >= 0 && nX < aBitmapSize.Width() && nY >= 0 && nY < aBitmapSize.Height())
+        {
+            switch(eTransparent)
+            {
+                case TRANSPARENT_NONE:
+                {
+                    // not transparent, ergo all covered
+                    nTransparency = 0x00;
+                    break;
+                }
+                case TRANSPARENT_COLOR:
+                {
+                    Bitmap aTestBitmap(aBitmap);
+                    BitmapReadAccess* pRead = aTestBitmap.AcquireReadAccess();
+
+                    if(pRead)
+                    {
+                        const Color aColor = pRead->GetColor(nY, nX);
+
+                        // if color is not equal to TransparentColor, we are not transparent
+                        if(aColor != aTransparentColor)
+                        {
+                            nTransparency = 0x00;
+                        }
+
+                        aTestBitmap.ReleaseAccess(pRead);
+                    }
+                    break;
+                }
+                case TRANSPARENT_BITMAP:
+                {
+                    if(!aMask.IsEmpty())
+                    {
+                        Bitmap aTestBitmap(aMask);
+                        BitmapReadAccess* pRead = aTestBitmap.AcquireReadAccess();
+
+                        if(pRead)
+                        {
+                            const BitmapColor aBitmapColor(pRead->GetPixel(nY, nX));
+
+                            if(bAlpha)
+                            {
+                                nTransparency = aBitmapColor.GetIndex();
+                            }
+                            else
+                            {
+                                if(0x00 != aBitmapColor.GetIndex())
+                                {
+                                    nTransparency = 0x00;
+                                }
+                            }
+
+                            aTestBitmap.ReleaseAccess(pRead);
+                        }
+                    }
+                    break;
+                }
+            }
+        }
+    }
+
+    return nTransparency;
+}
+
+// ------------------------------------------------------------------
+
 SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx )
 {
     rBitmapEx.aBitmap.Write( rOStm );
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 5097643..e658455 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -772,7 +772,10 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
     m_aForeignTopLevelWindow = None;
     m_nStyle = nStyle;
 
-    GtkWindowType eWinType = ((nStyle & SAL_FRAME_STYLE_FLOAT) && ! (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION))
+    GtkWindowType eWinType = (  (nStyle & SAL_FRAME_STYLE_FLOAT) &&
+                              ! (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|
+                                           SAL_FRAME_STYLE_FLOAT_FOCUSABLE))
+                              )
         ? GTK_WINDOW_POPUP : GTK_WINDOW_TOPLEVEL;
 
     if( nStyle & SAL_FRAME_STYLE_SYSTEMCHILD )
@@ -801,7 +804,7 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
     bool bDecoHandling =
         ! isChild() &&
         ( ! (nStyle & SAL_FRAME_STYLE_FLOAT) ||
-          (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) );
+          (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_FLOAT_FOCUSABLE) ) );
 
     /* #i100116# metacity has a peculiar behavior regarding WM_HINT accept focus and _NET_WM_USER_TIME
         at some point that may be fixed in metacity and we will have to revisit this
@@ -832,6 +835,11 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
             lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, true );
             bNoDecor = true;
         }
+        else if( (nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) )
+        {
+            eType = GDK_WINDOW_TYPE_HINT_UTILITY;
+        }
+        
         if( (nStyle & SAL_FRAME_STYLE_PARTIAL_FULLSCREEN ) )
         {
             eType = GDK_WINDOW_TYPE_HINT_TOOLBAR;
@@ -869,7 +877,7 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
     if( bDecoHandling )
     {
         gtk_window_set_resizable( GTK_WINDOW(m_pWindow), (nStyle & SAL_FRAME_STYLE_SIZEABLE) ? TRUE : FALSE );
-        if( ( (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) || bMetaCityToolWindowHack )
+        if( ( (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION)) ) || bMetaCityToolWindowHack )
             lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, false );
     }
     
@@ -2072,7 +2080,7 @@ void GtkSalFrame::ToTop( USHORT nFlags )
              *  to our window - which it of course won't since our input hint
              *  is set to false.
              */
-            if( (m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) )
+            if( (m_nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_FLOAT_FOCUSABLE)) )
                 XSetInputFocus( getDisplay()->GetDisplay(), GDK_WINDOW_XWINDOW( m_pWindow->window ), RevertToParent, CurrentTime );
         }
         else
diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
index bd90f91..f55e5ec 100644
--- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
@@ -242,9 +242,10 @@ class GtkSalFrame : public SalFrame
     bool isFloatGrabWindow() const
     {
         return
-            (m_nStyle & SAL_FRAME_STYLE_FLOAT) &&       // only a float can be floatgrab
-            !(m_nStyle & SAL_FRAME_STYLE_TOOLTIP) &&    // tool tips are not
-            !(m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION); // toolbars are also not
+            (m_nStyle & SAL_FRAME_STYLE_FLOAT) &&                // only a float can be floatgrab
+            !(m_nStyle & SAL_FRAME_STYLE_TOOLTIP) &&             // tool tips are not
+            !(m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) && // toolbars are also not
+            !(m_nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE);       // focusable floats are not
     }
     
     bool isChild( bool bPlug = true, bool bSysChild = true )


More information about the ooo-build-commit mailing list