[Libreoffice-commits] core.git: Branch 'feature/rendercontext' - 2 commits - include/vcl vcl/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Tue Apr 28 02:26:51 PDT 2015


 include/vcl/button.hxx        |    6 ++---
 include/vcl/edit.hxx          |    2 -
 vcl/source/control/button.cxx |   46 +++++++++++++++++++++---------------------
 vcl/source/control/edit.cxx   |   12 +++++-----
 4 files changed, 33 insertions(+), 33 deletions(-)

New commits:
commit 9c8904c3cf415f41166fb3b26178826ef4b76521
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Tue Apr 28 17:48:03 2015 +0900

    vcl edit: Delegate RenderContext to sub-methods, use Invalidate
    
    Change-Id: Ifb1a54e852bc9011389cac758e6f0dfd6c84d464

diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx
index 1cb85ab..fe298be 100644
--- a/include/vcl/edit.hxx
+++ b/include/vcl/edit.hxx
@@ -104,7 +104,7 @@ private:
     SAL_DLLPRIVATE void        ImplInitEditData();
     SAL_DLLPRIVATE void        ImplModified();
     SAL_DLLPRIVATE OUString    ImplGetText() const;
-    SAL_DLLPRIVATE void        ImplRepaint(bool bLayout = false);
+    SAL_DLLPRIVATE void        ImplRepaint(vcl::RenderContext& rRenderContext, bool bLayout = false);
     SAL_DLLPRIVATE void        ImplInvalidateOrRepaint();
     SAL_DLLPRIVATE void        ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uInt8 nMode );
     SAL_DLLPRIVATE void        ImplSetText( const OUString& rStr, const Selection* pNewSelection = 0 );
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index e751ac8..1ad2e23 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -462,7 +462,7 @@ void Edit::ImplInvalidateOrRepaint()
             Update();
     }
     else
-        ImplRepaint();
+        Invalidate();
 }
 
 long Edit::ImplGetTextYPosition() const
@@ -474,7 +474,7 @@ long Edit::ImplGetTextYPosition() const
     return ( GetOutputSizePixel().Height() - GetTextHeight() ) / 2;
 }
 
-void Edit::ImplRepaint(bool bLayout)
+void Edit::ImplRepaint(vcl::RenderContext& /*rRenderContext*/, bool bLayout)
 {
     if ( !IsReallyVisible() )
         return;
@@ -1745,13 +1745,13 @@ void Edit::KeyInput( const KeyEvent& rKEvt )
 void Edit::FillLayoutData() const
 {
     mpControlData->mpLayoutData = new vcl::ControlLayoutData();
-    const_cast<Edit*>(this)->ImplRepaint(true);
+    const_cast<Edit*>(this)->Invalidate();
 }
 
-void Edit::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& )
+void Edit::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
 {
-    if ( !mpSubEdit )
-        ImplRepaint();
+    if (!mpSubEdit)
+        ImplRepaint(rRenderContext);
 }
 
 void Edit::Resize()
commit e46a61d68630768dce1dbd918c85f5ed79fb3085
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Tue Apr 28 17:43:26 2015 +0900

    vcl button: Delegate RenderContext to sub-methods, use Invalidate
    
    Change-Id: Idd4181180da0bbbac872b58569e30cbc384125fe

diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 59fca9c..1d5c658 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -122,7 +122,7 @@ protected:
     SAL_DLLPRIVATE void            ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
     SAL_DLLPRIVATE void            ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawFlags,
                                                const Rectangle& rRect, bool bLayout, bool bMenuBtnSep );
-    SAL_DLLPRIVATE void            ImplDrawPushButton( bool bLayout = false );
+    SAL_DLLPRIVATE void            ImplDrawPushButton(vcl::RenderContext& rRenderContext, bool bLayout = false);
     using Button::ImplGetTextStyle;
     SAL_DLLPRIVATE sal_uInt16          ImplGetTextStyle( sal_uLong nDrawFlags ) const;
     SAL_DLLPRIVATE bool            IsSymbol() const { return ( (meSymbol != SymbolType::DONTKNOW) && (meSymbol != SymbolType::IMAGE) ); }
@@ -297,7 +297,7 @@ private:
                               const Point& rPos, const Size& rSize,
                               const Size& rImageSize, Rectangle& rStateRect,
                               Rectangle& rMouseRect, bool bLayout = false );
-    SAL_DLLPRIVATE void     ImplDrawRadioButton( bool bLayout = false );
+    SAL_DLLPRIVATE void     ImplDrawRadioButton(vcl::RenderContext& rRenderContext, bool bLayout = false );
     SAL_DLLPRIVATE void     ImplInvalidateOrDrawRadioButtonState();
     SAL_DLLPRIVATE void     ImplUncheckAllOther();
     SAL_DLLPRIVATE Size     ImplGetRadioImageSize() const;
@@ -425,7 +425,7 @@ private:
                                     const Point& rPos, const Size& rSize,
                                     const Size& rImageSize, Rectangle& rStateRect,
                                     Rectangle& rMouseRect, bool bLayout );
-    SAL_DLLPRIVATE void         ImplDrawCheckBox( bool bLayout = false );
+    SAL_DLLPRIVATE void         ImplDrawCheckBox(vcl::RenderContext& rRenderContext, bool bLayout = false );
     SAL_DLLPRIVATE long         ImplGetImageToTextDistance() const;
     SAL_DLLPRIVATE Size         ImplGetCheckImageSize() const;
 
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index e580fb1..4af855a 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -910,7 +910,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawF
     pDev->Pop();  // restore clipregion
 }
 
-void PushButton::ImplDrawPushButton( bool bLayout )
+void PushButton::ImplDrawPushButton(vcl::RenderContext& /*rRenderContext*/, bool bLayout)
 {
     if( !bLayout )
         HideFocus();
@@ -1190,7 +1190,7 @@ void PushButton::MouseButtonDown( const MouseEvent& rMEvt )
             nTrackFlags |= STARTTRACK_BUTTONREPEAT;
 
         ImplGetButtonState() |= BUTTON_DRAW_PRESSED;
-        ImplDrawPushButton();
+        Invalidate();
         StartTracking( nTrackFlags );
 
         if ( nTrackFlags & STARTTRACK_BUTTONREPEAT )
@@ -1224,7 +1224,7 @@ void PushButton::Tracking( const TrackingEvent& rTEvt )
             else
                 ImplGetButtonState() &= ~BUTTON_DRAW_PRESSED;
 
-            ImplDrawPushButton();
+            Invalidate();
 
             // do not call Click handler if aborted
             if ( !rTEvt.IsTrackingCanceled() )
@@ -1248,7 +1248,7 @@ void PushButton::Tracking( const TrackingEvent& rTEvt )
             else
             {
                 ImplGetButtonState() |= BUTTON_DRAW_PRESSED;
-                ImplDrawPushButton();
+                Invalidate();
             }
         }
         else
@@ -1256,7 +1256,7 @@ void PushButton::Tracking( const TrackingEvent& rTEvt )
             if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED )
             {
                 ImplGetButtonState() &= ~BUTTON_DRAW_PRESSED;
-                ImplDrawPushButton();
+                Invalidate();
             }
         }
     }
@@ -1272,7 +1272,7 @@ void PushButton::KeyInput( const KeyEvent& rKEvt )
         if ( !(ImplGetButtonState() & BUTTON_DRAW_PRESSED) )
         {
             ImplGetButtonState() |= BUTTON_DRAW_PRESSED;
-            ImplDrawPushButton();
+            Invalidate();
         }
 
         if ( ( GetStyle() & WB_REPEAT ) &&
@@ -1282,7 +1282,7 @@ void PushButton::KeyInput( const KeyEvent& rKEvt )
     else if ( (ImplGetButtonState() & BUTTON_DRAW_PRESSED) && (aKeyCode.GetCode() == KEY_ESCAPE) )
     {
         ImplGetButtonState() &= ~BUTTON_DRAW_PRESSED;
-        ImplDrawPushButton();
+        Invalidate();
     }
     else
         Button::KeyInput( rKEvt );
@@ -1310,7 +1310,7 @@ void PushButton::KeyUp( const KeyEvent& rKEvt )
         else
             ImplGetButtonState() &= ~BUTTON_DRAW_PRESSED;
 
-        ImplDrawPushButton();
+        Invalidate();
 
         if ( !( ( GetStyle() & WB_REPEAT )  &&
                 ! ( GetStyle() & WB_TOGGLE ) ) )
@@ -1323,12 +1323,12 @@ void PushButton::KeyUp( const KeyEvent& rKEvt )
 void PushButton::FillLayoutData() const
 {
     mpControlData->mpLayoutData = new vcl::ControlLayoutData();
-    const_cast<PushButton*>(this)->ImplDrawPushButton( true );
+    const_cast<PushButton*>(this)->Invalidate();
 }
 
-void PushButton::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& )
+void PushButton::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
 {
-    ImplDrawPushButton();
+    ImplDrawPushButton(rRenderContext);
 }
 
 void PushButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
@@ -1588,7 +1588,7 @@ void PushButton::EndSelection()
     {
         ImplGetButtonState() &= ~BUTTON_DRAW_PRESSED;
         if ( !mbPressed )
-            ImplDrawPushButton();
+            Invalidate();
     }
 }
 
@@ -2111,7 +2111,7 @@ void RadioButton::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
     pDev->Pop();
 }
 
-void RadioButton::ImplDrawRadioButton( bool bLayout )
+void RadioButton::ImplDrawRadioButton(vcl::RenderContext& /*rRenderContext*/, bool bLayout)
 {
     if( !bLayout )
         HideFocus();
@@ -2402,12 +2402,12 @@ void RadioButton::KeyUp( const KeyEvent& rKEvt )
 void RadioButton::FillLayoutData() const
 {
     mpControlData->mpLayoutData = new vcl::ControlLayoutData();
-    const_cast<RadioButton*>(this)->ImplDrawRadioButton( true );
+    const_cast<RadioButton*>(this)->Invalidate();
 }
 
-void RadioButton::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& )
+void RadioButton::Paint( vcl::RenderContext& rRenderContext, const Rectangle& )
 {
-    ImplDrawRadioButton();
+    ImplDrawRadioButton(rRenderContext);
 }
 
 void RadioButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
@@ -3129,7 +3129,7 @@ void CheckBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
     pDev->Pop();
 }
 
-void CheckBox::ImplDrawCheckBox( bool bLayout )
+void CheckBox::ImplDrawCheckBox(vcl::RenderContext& rRenderContext, bool bLayout)
 {
     Size aImageSize = ImplGetCheckImageSize();
     aImageSize.Width()  = CalcZoom( aImageSize.Width() );
@@ -3138,7 +3138,7 @@ void CheckBox::ImplDrawCheckBox( bool bLayout )
     if( !bLayout )
         HideFocus();
 
-    ImplDraw( this, 0, Point(), GetOutputSizePixel(), aImageSize,
+    ImplDraw( &rRenderContext, 0, Point(), GetOutputSizePixel(), aImageSize,
               maStateRect, maMouseRect, bLayout );
 
     if( !bLayout )
@@ -3284,12 +3284,12 @@ void CheckBox::KeyUp( const KeyEvent& rKEvt )
 void CheckBox::FillLayoutData() const
 {
     mpControlData->mpLayoutData = new vcl::ControlLayoutData();
-    const_cast<CheckBox*>(this)->ImplDrawCheckBox( true );
+    const_cast<CheckBox*>(this)->Invalidate();
 }
 
-void CheckBox::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& )
+void CheckBox::Paint( vcl::RenderContext& rRenderContext, const Rectangle& )
 {
-    ImplDrawCheckBox();
+    ImplDrawCheckBox(rRenderContext);
 }
 
 void CheckBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
@@ -3409,7 +3409,7 @@ void CheckBox::GetFocus()
         aSize.Height() += 2;
         aSize.Width() += 2;
         setPosSizePixel( aPos.X(), aPos.Y(), aSize.Width(), aSize.Height(), WINDOW_POSSIZE_ALL );
-        ImplDrawCheckBox();
+        Invalidate();
     }
     else
         ShowFocus( ImplGetFocusRect() );
@@ -3439,7 +3439,7 @@ void CheckBox::LoseFocus()
         aSize.Height() -= 2;
         aSize.Width() -= 2;
         setPosSizePixel( aPos.X(), aPos.Y(), aSize.Width(), aSize.Height(), WINDOW_POSSIZE_ALL );
-        ImplDrawCheckBox();
+        Invalidate();
     }
 }
 


More information about the Libreoffice-commits mailing list