[Libreoffice-commits] core.git: 2 commits - include/vcl vcl/Library_vcl.mk vcl/source

Chris Sherlock chris.sherlock79 at gmail.com
Thu May 1 02:42:52 PDT 2014


 include/vcl/outdev.hxx               |   45 ----
 include/vcl/window.hxx               |   49 +++++
 vcl/Library_vcl.mk                   |    2 
 vcl/source/outdev/nativecontrols.cxx |  329 -----------------------------------
 vcl/source/outdev/text.cxx           |    4 
 vcl/source/window/nativecontrols.cxx |  307 ++++++++++++++++++++++++++++++++
 6 files changed, 357 insertions(+), 379 deletions(-)

New commits:
commit 4f45ec19fc96e4471dc3fe342e5acd910068dd12
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Thu May 1 19:40:57 2014 +1000

    VCL: sal_True -> true and sal_False -> false in outdev/text.cxx
    
    Change-Id: I51e43962784dd21da4e9b2003c3b734026706282

diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 4383e5e..bb9fbc1 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -742,7 +742,7 @@ void OutputDevice::SetTextFillColor( const Color& rColor )
 {
 
     Color aColor( rColor );
-    bool bTransFill = ImplIsColorTransparent( aColor ) ? sal_True : sal_False;
+    bool bTransFill = ImplIsColorTransparent( aColor ) ? true : false;
 
     if ( !bTransFill )
     {
@@ -1330,7 +1330,7 @@ bool OutputDevice::GetTextIsRTL( const OUString& rString, sal_Int32 nIndex, sal_
     bool bRTL = false;
     int nCharPos = -1;
     aArgs.GetNextPos( &nCharPos, &bRTL );
-    return (nCharPos != nIndex) ? sal_True : sal_False;
+    return (nCharPos != nIndex) ? true : false;
 }
 
 sal_Int32 OutputDevice::GetTextBreak( const OUString& rStr, long nTextWidth,
commit 5b86e33b5fb5f8250b88bf14e579cddd98fec36a
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Mon Apr 28 22:53:28 2014 +1000

    VCL: move native widget rendering functions out of OutputDevice
    
    The following functions should be in the Window class, not in
    OutputDevice:
    
    + IsNativeControlSupported
    + HitTestNativeControl
    + DrawNativeControl
    + GetNativeControlRegion
    
    Additionally, moved nativecontrols.cxx to vcl/source/window/ and whilst
    we are about it, it turns out that VirtualDevice isn't used by these
    functions. Therefore the 'orrible check to for the type of class can be
    removed and in fact as VirtualDevice doesn't use it at all then we can
    just remove the function and replace it with a call to
    IsNativeWidgetEnabled().
    
    Change-Id: Idd0bfb1cba1c2902f7a6d55d258efb38b67fb827

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 9cc34e8..7051f5a 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1795,51 +1795,6 @@ private:
     ///@}
 
 
-    /** @name Native Widget Rendering functions
-
-        These all just call through to the private mpGraphics functions of the same name.
-     */
-    ///@{
-
-public:
-
-    /** Query the platform layer for control support
-     */
-    bool                        IsNativeControlSupported( ControlType nType, ControlPart nPart ) const;
-
-    /** Query the native control to determine if it was acted upon
-     */
-    bool                        HitTestNativeControl(   ControlType nType,
-                                                        ControlPart nPart,
-                                                        const Rectangle& rControlRegion,
-                                                        const Point& aPos,
-                                                        bool& rIsInside ) const;
-
-    /** Request rendering of a particular control and/or part
-     */
-    bool                        DrawNativeControl(  ControlType nType,
-                                                    ControlPart nPart,
-                                                    const Rectangle& rControlRegion,
-                                                    ControlState nState,
-                                                    const ImplControlValue& aValue,
-                                                    const OUString& aCaption );
-
-    /** Query the native control's actual drawing region (including adornment)
-     */
-    bool                        GetNativeControlRegion( ControlType nType,
-                                                        ControlPart nPart,
-                                                        const Rectangle& rControlRegion,
-                                                        ControlState nState,
-                                                        const ImplControlValue& aValue,
-                                                        const OUString& aCaption,
-                                                        Rectangle &rNativeBoundingRegion,
-                                                        Rectangle &rNativeContentRegion ) const;
-    ///@}
-
-    /** @name EPS functions
-     */
-    ///@{
-
 public:
 
     /** Added return value to see if EPS could be painted directly.
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 001dfd5..19c20d01 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -970,7 +970,7 @@ public:
     bool                HasChildPathFocus( bool bSystemWindow = false ) const;
     bool                IsActive() const;
     bool                HasActiveChildFrame();
-    sal_uInt16              GetGetFocusFlags() const;
+    sal_uInt16          GetGetFocusFlags() const;
     void                GrabFocusToDocument();
 
     /**
@@ -1033,7 +1033,7 @@ public:
 
     Window*             FindWindow( const Point& rPos ) const;
 
-    sal_uInt16              GetChildCount() const;
+    sal_uInt16          GetChildCount() const;
     Window*             GetChild( sal_uInt16 nChild ) const;
     Window*             GetWindow( sal_uInt16 nType ) const;
     bool                IsChild( const Window* pWindow, bool bSystemWindow = false ) const;
@@ -1076,6 +1076,51 @@ public:
     void                SaveBackground( const Point& rPos, const Size& rSize,
                                         const Point& rDestOff, VirtualDevice& rSaveDevice );
 
+
+    /** @name Native Widget Rendering functions
+
+        These all just call through to the private mpGraphics functions of the same name.
+     */
+    ///@{
+
+    /** Query the platform layer for control support
+     */
+    bool                        IsNativeControlSupported( ControlType nType, ControlPart nPart ) const;
+
+    /** @name EPS functions
+     */
+    ///@{
+
+
+    /** Query the native control to determine if it was acted upon
+     */
+    bool                        HitTestNativeControl(   ControlType nType,
+                                                        ControlPart nPart,
+                                                        const Rectangle& rControlRegion,
+                                                        const Point& aPos,
+                                                        bool& rIsInside ) const;
+
+    /** Request rendering of a particular control and/or part
+     */
+    bool                        DrawNativeControl(  ControlType nType,
+                                                    ControlPart nPart,
+                                                    const Rectangle& rControlRegion,
+                                                    ControlState nState,
+                                                    const ImplControlValue& aValue,
+                                                    const OUString& aCaption );
+
+    /** Query the native control's actual drawing region (including adornment)
+     */
+    bool                        GetNativeControlRegion( ControlType nType,
+                                                        ControlPart nPart,
+                                                        const Rectangle& rControlRegion,
+                                                        ControlState nState,
+                                                        const ImplControlValue& aValue,
+                                                        const OUString& aCaption,
+                                                        Rectangle &rNativeBoundingRegion,
+                                                        Rectangle &rNativeContentRegion ) const;
+    ///@}
+
     const SystemEnvData*                      GetSystemData() const;
     ::com::sun::star::uno::Any                GetSystemDataAny() const;
 
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index d630017..c331fdf 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -146,6 +146,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/window/window \
     vcl/source/window/winproc \
     vcl/source/window/wrkwin \
+    vcl/source/window/nativecontrols \
     vcl/source/control/button \
     vcl/source/control/combobox \
     vcl/source/control/ctrl \
@@ -195,7 +196,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/outdev/gradient \
     vcl/source/outdev/curvedshapes \
     vcl/source/outdev/wallpaper \
-    vcl/source/outdev/nativecontrols \
     vcl/source/outdev/map \
     vcl/source/gdi/alpha \
     vcl/source/gdi/animate \
diff --git a/vcl/source/outdev/nativecontrols.cxx b/vcl/source/window/nativecontrols.cxx
similarity index 90%
rename from vcl/source/outdev/nativecontrols.cxx
rename to vcl/source/window/nativecontrols.cxx
index 28e2d35..38c8498 100644
--- a/vcl/source/outdev/nativecontrols.cxx
+++ b/vcl/source/window/nativecontrols.cxx
@@ -25,29 +25,6 @@
 
 #include <salgdi.hxx>
 
-static bool EnableNativeWidget( const OutputDevice& i_rDevice )
-{
-    const OutDevType eType( i_rDevice.GetOutDevType() );
-    switch ( eType )
-    {
-
-    case OUTDEV_WINDOW:
-        return dynamic_cast< const Window* >( &i_rDevice )->IsNativeWidgetEnabled();
-
-    case OUTDEV_VIRDEV:
-    {
-        const ::vcl::ExtOutDevData* pOutDevData( i_rDevice.GetExtOutDevData() );
-        const ::vcl::PDFExtOutDevData* pPDFData( dynamic_cast< const ::vcl::PDFExtOutDevData* >( pOutDevData ) );
-        if ( pPDFData != NULL )
-            return false;
-        return true;
-    }
-
-    default:
-        return false;
-    }
-}
-
 ImplControlValue::~ImplControlValue()
 {
 }
@@ -141,9 +118,9 @@ PushButtonValue* PushButtonValue::clone() const
 // These functions are mainly passthrough functions that allow access to
 // the SalFrame behind a Window object for native widget rendering purposes.
 
-bool OutputDevice::IsNativeControlSupported( ControlType nType, ControlPart nPart ) const
+bool Window::IsNativeControlSupported( ControlType nType, ControlPart nPart ) const
 {
-    if( !EnableNativeWidget( *this ) )
+    if( !IsNativeWidgetEnabled() )
         return false;
 
     if ( !mpGraphics )
@@ -153,13 +130,13 @@ bool OutputDevice::IsNativeControlSupported( ControlType nType, ControlPart nPar
     return( mpGraphics->IsNativeControlSupported(nType, nPart) );
 }
 
-bool OutputDevice::HitTestNativeControl( ControlType nType,
+bool Window::HitTestNativeControl( ControlType nType,
                               ControlPart nPart,
                               const Rectangle& rControlRegion,
                               const Point& aPos,
                               bool& rIsInside ) const
 {
-    if( !EnableNativeWidget( *this ) )
+    if( !IsNativeWidgetEnabled() )
         return false;
 
     if ( !mpGraphics )
@@ -252,14 +229,15 @@ static boost::shared_ptr< ImplControlValue > TransformControlValue( const ImplCo
     }
     return aResult;
 }
-bool OutputDevice::DrawNativeControl( ControlType nType,
+
+bool Window::DrawNativeControl( ControlType nType,
                             ControlPart nPart,
                             const Rectangle& rControlRegion,
                             ControlState nState,
                             const ImplControlValue& aValue,
                             const OUString& aCaption )
 {
-    if( !EnableNativeWidget( *this ) )
+    if( !IsNativeWidgetEnabled() )
         return false;
 
     // make sure the current clip region is initialized correctly
@@ -292,7 +270,7 @@ bool OutputDevice::DrawNativeControl( ControlType nType,
     return bRet;
 }
 
-bool OutputDevice::GetNativeControlRegion(  ControlType nType,
+bool Window::GetNativeControlRegion(  ControlType nType,
                                 ControlPart nPart,
                                 const Rectangle& rControlRegion,
                                 ControlState nState,
@@ -301,7 +279,7 @@ bool OutputDevice::GetNativeControlRegion(  ControlType nType,
                                 Rectangle &rNativeBoundingRegion,
                                 Rectangle &rNativeContentRegion ) const
 {
-    if( !EnableNativeWidget( *this ) )
+    if( !IsNativeWidgetEnabled() )
         return false;
 
     if ( !mpGraphics )


More information about the Libreoffice-commits mailing list