[Libreoffice-commits] .: vcl/inc vcl/unx

Michael Meeks michael at kemper.freedesktop.org
Thu May 31 04:04:28 PDT 2012


 vcl/inc/unx/gtk/gtkgdi.hxx               |    5 +++++
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |   30 +++++++++++++++++++++++++++++-
 2 files changed, 34 insertions(+), 1 deletion(-)

New commits:
commit 7b52e6b9b1c42ccd9ff5a6adbc3b62622d31ca75
Author: Ruslan Kabatsayev <b7.10110111 at gmail.com>
Date:   Mon May 28 02:28:49 2012 +0400

    GTK theming: implement rendering window background
    
    Change-Id: I34c6c38f383fce54aa0b2a61a5e88ee9a8cff4e7

diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx
index bdc397e..fbdcef1 100644
--- a/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -165,6 +165,11 @@ protected:
     GdkPixmap* NWGetPixmapFromScreen( Rectangle srcRect );
     sal_Bool NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect );
 
+    sal_Bool NWPaintGTKWindowBackground( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+                           const Rectangle& rControlRectangle,
+                           const clipList& rClipList,
+                           ControlState nState, const ImplControlValue& aValue,
+                           const OUString& rCaption );
     sal_Bool NWPaintGTKButtonReal( GtkWidget* button, GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
                            const Rectangle& rControlRectangle,
                            const clipList& rClipList,
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index d65d635..f9781ab 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -614,7 +614,8 @@ sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPar
                 (   (nPart == PART_TRACK_HORZ_AREA)
                 ||  (nPart == PART_TRACK_VERT_AREA)
                 )
-        )
+        ) ||
+        (nType == CTRL_WINDOW_BACKGROUND)
         )
         return( sal_True );
     return( sal_False );
@@ -898,6 +899,10 @@ sal_Bool GtkSalGraphics::drawNativeControl(    ControlType nType,
     {
         returnVal = NWPaintGTKSlider( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
     }
+    else if( nType == CTRL_WINDOW_BACKGROUND )
+    {
+        returnVal = NWPaintGTKWindowBackground( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
+    }
 
     if( pixmap )
     {
@@ -1132,6 +1137,29 @@ sal_Bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,
 /************************************************************************
  * Individual control drawing functions
  ************************************************************************/
+sal_Bool GtkSalGraphics::NWPaintGTKWindowBackground(
+            GdkDrawable* gdkDrawable,
+            ControlType, ControlPart,
+            const Rectangle& rControlRectangle,
+            const clipList& rClipList,
+            ControlState nState, const ImplControlValue&,
+            const OUString& )
+{
+        int w,h;
+        gtk_window_get_size(GTK_WINDOW(m_pWindow),&w,&h);
+        GdkRectangle clipRect;
+        for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
+        {
+            clipRect.x = it->Left();
+            clipRect.y = it->Top();
+            clipRect.width = it->GetWidth();
+            clipRect.height = it->GetHeight();
+
+            gtk_paint_flat_box(m_pWindow->style,gdkDrawable,GTK_STATE_NORMAL,GTK_SHADOW_NONE,&clipRect,m_pWindow,"base",0,0,w,h);
+        }
+
+        return sal_True;
+}
 
 sal_Bool GtkSalGraphics::NWPaintGTKButtonReal(
             GtkWidget* button,


More information about the Libreoffice-commits mailing list