[Libreoffice-commits] .: 9 commits - vcl/inc vcl/source vcl/win

Jan Holesovsky kendy at kemper.freedesktop.org
Mon Jun 25 09:10:37 PDT 2012


 vcl/inc/salframe.hxx                         |    6 
 vcl/inc/svdata.hxx                           |    1 
 vcl/inc/win/salframe.h                       |    6 
 vcl/source/window/menu.cxx                   |  143 ++++-------
 vcl/win/source/gdi/salnativewidgets-luna.cxx |  345 +++------------------------
 5 files changed, 105 insertions(+), 396 deletions(-)

New commits:
commit 696dd4d25f6a50d600f31abcb524b4f36a46f00d
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Mon Jun 25 13:33:09 2012 +0200

    Better initialization of members.
    
    Change-Id: I5e11865222dbb966185585fe3fd413834c6c6b9a

diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index e595aa0..ded121d 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -109,6 +109,13 @@ public:
 static VisualStylesAPI vsAPI;
 
 VisualStylesAPI::VisualStylesAPI()
+    : lpfnOpenThemeData( NULL ),
+      lpfnCloseThemeData( NULL ),
+      lpfnGetThemeBackgroundContentRect( NULL ),
+      lpfnDrawThemeBackground( NULL ),
+      lpfnDrawThemeText( NULL ),
+      lpfnGetThemePartSize( NULL ),
+      lpfnIsThemeActive( NULL )
 {
     OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "uxtheme.dll" ) );
     mhModule = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT );
@@ -123,15 +130,6 @@ VisualStylesAPI::VisualStylesAPI()
         lpfnGetThemePartSize = (GetThemePartSize_Proc_T)osl_getAsciiFunctionSymbol( mhModule, "GetThemePartSize" );
         lpfnIsThemeActive = (IsThemeActive_Proc_T)osl_getAsciiFunctionSymbol( mhModule, "IsThemeActive" );
     }
-    else
-    {
-        lpfnOpenThemeData = NULL;
-        lpfnCloseThemeData = NULL;
-        lpfnGetThemeBackgroundContentRect = NULL;
-        lpfnDrawThemeBackground = NULL;
-        lpfnDrawThemeText = NULL;
-        lpfnGetThemePartSize = NULL;
-    }
 }
 
 VisualStylesAPI::~VisualStylesAPI()
commit 5068cf6a509240c6b12a4a005e7c20120f13d13e
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Mon Jun 25 13:22:47 2012 +0200

    Re-introduce a useful MSDN link about DWM and drawing into non-client area.
    
    Change-Id: If56d66f7ee8a509566da0cf5c21ce91bced67310

diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index eed2cc0..e595aa0 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -35,7 +35,10 @@
 // (found at http://stackoverflow.com/questions/4009701/windows-visual-themes-gallery-of-parts-and-states/4009712#4009712)
 //
 // Theme subclasses:
-// http://msdn.microsoft.com/en-us/library/windows/desktop/bb773218%28v=vs.85%29.aspx
+//   http://msdn.microsoft.com/en-us/library/windows/desktop/bb773218%28v=vs.85%29.aspx
+//
+// Drawing in non-client area (general DWM-related info):
+//   http://msdn.microsoft.com/en-us/library/windows/desktop/bb688195%28v=vs.85%29.aspx
 
 #define _SV_SALNATIVEWIDGETS_CXX
 
commit 9c5a22d19708eae17ad9880422bd03e81ea48c5d
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Thu Jun 21 17:55:53 2012 +0200

    aero toolbar: Extend the drawing of the toolbar to the menubar area.
    
    Fix the maTopDockingAreaHeight computation too, it did not work.
    
    Change-Id: I788c96960a5607482b750d536e522644e236f052

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 5f543c9..0fff3c3 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -754,7 +754,7 @@ static void ImplAddNWFSeparator( Window *pThis, const MenubarValue& rMenubarValu
     // add a separator if
     // - we have an adjacent docking area
     // - and if toolbars would draw them as well (mbDockingAreaSeparateTB must not be set, see dockingarea.cxx)
-    if( rMenubarValue.maTopDockingAreaHeight && !ImplGetSVData()->maNWFData.mbDockingAreaSeparateTB )
+    if( rMenubarValue.maTopDockingAreaHeight && !ImplGetSVData()->maNWFData.mbDockingAreaSeparateTB && !ImplGetSVData()->maNWFData.mbDockingAreaAvoidTBFrames )
     {
         // note: the menubar only provides the upper (dark) half of it, the rest (bright part) is drawn by the docking area
 
@@ -861,27 +861,24 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow )
 {
     // find docking area that is top aligned and return its height
     // note: dockingareas are direct children of the SystemWindow
-    int height=0;
-    sal_Bool bDone = sal_False;
     if( pWindow->ImplGetFrameWindow() )
     {
-        Window *pWin = pWindow->ImplGetFrameWindow()->GetWindow( WINDOW_FIRSTCHILD); //mpWindowImpl->mpFirstChild;
-        while( pWin && !bDone )
+        Window *pWin = pWindow->ImplGetFrameWindow()->GetWindow( WINDOW_FIRSTCHILD ); //mpWindowImpl->mpFirstChild;
+        while( pWin )
         {
             if( pWin->IsSystemWindow() )
             {
-                pWin = pWin->GetWindow( WINDOW_FIRSTCHILD); //mpWindowImpl->mpFirstChild;
-                while( pWin && !bDone )
+                Window *pChildWin = pWin->GetWindow( WINDOW_FIRSTCHILD ); //mpWindowImpl->mpFirstChild;
+                while( pChildWin )
                 {
-                    DockingAreaWindow *pDockingArea = dynamic_cast< DockingAreaWindow* >( pWin );
-                    if( pDockingArea && pDockingArea->GetAlign() == WINDOWALIGN_TOP )
-                    {
-                        bDone = sal_True;
-                        if( pDockingArea->IsVisible() )
-                            height = pDockingArea->GetOutputSizePixel().Height();
-                    }
+                    DockingAreaWindow *pDockingArea = NULL;
+                    if ( pChildWin->GetType() == WINDOW_DOCKINGAREA )
+                        pDockingArea = static_cast< DockingAreaWindow* >( pChildWin );
+
+                    if( pDockingArea && pDockingArea->GetAlign() == WINDOWALIGN_TOP && pDockingArea->IsVisible() )
+                        return pDockingArea->GetOutputSizePixel().Height();
                     else
-                        pWin = pWin->GetWindow( WINDOW_NEXT ); //mpWindowImpl->mpNext;
+                        pChildWin = pChildWin->GetWindow( WINDOW_NEXT ); //mpWindowImpl->mpNext;
                 }
 
             }
@@ -889,7 +886,7 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow )
                 pWin = pWin->GetWindow( WINDOW_NEXT ); //mpWindowImpl->mpNext;
         }
     }
-    return height;
+    return 0;
 }
 
 Menu::Menu()
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index ed39620..eed2cc0 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -459,7 +459,32 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState,
     pRect->bottom = rRect.Bottom()+1;
 }
 
-// ----
+void impl_drawAeroToolbar( HDC hDC, RECT rc )
+{
+    const long GRADIENT_HEIGHT = 32;
+
+    long gradient_break = rc.top;
+    GRADIENT_RECT g_rect[1] = { { 0, 1 } };
+
+    // very slow gradient at the top (if we have space for that)
+    if ( rc.bottom - rc.top > GRADIENT_HEIGHT )
+    {
+        gradient_break = rc.bottom - GRADIENT_HEIGHT;
+
+        TRIVERTEX vert[2] = {
+            { rc.left, rc.top,          0xff00, 0xff00, 0xff00, 0xff00 },
+            { rc.right, gradient_break, 0xfa00, 0xfa00, 0xfa00, 0xff00 },
+        };
+        GradientFill( hDC, vert, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
+    }
+
+    // gradient at the bottom
+    TRIVERTEX vert[2] = {
+        { rc.left, gradient_break, 0xfa00, 0xfa00, 0xfa00, 0xff00 },
+        { rc.right, rc.bottom,     0xe500, 0xe900, 0xee00, 0xff00 }
+    };
+    GradientFill( hDC, vert, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
+}
 
 sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
                             ControlType nType,
@@ -902,37 +927,14 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
                 const ToolbarValue *pValue = static_cast<const ToolbarValue*>(&aValue);
                 if( pValue->mbIsTopDockingArea )
                 {
+                    rc.top = 0; // extend potential gradient to cover menu bar as well
+
                     // make it more compatible with Aero
                     if( ImplGetSVData()->maNWFData.mbDockingAreaAvoidTBFrames )
                     {
-                        const long GRADIENT_HEIGHT = 32;
-
-                        long gradient_break = rc.top;
-                        GRADIENT_RECT g_rect[1] = { { 0, 1 } };
-
-                        // very slow gradient at the top (if we have space for that)
-                        if ( rc.bottom - rc.top > GRADIENT_HEIGHT )
-                        {
-                            gradient_break = rc.bottom - GRADIENT_HEIGHT;
-
-                            TRIVERTEX vert[2] = {
-                                { rc.left, rc.top,          0xff00, 0xff00, 0xff00, 0xff00 },
-                                { rc.right, gradient_break, 0xfa00, 0xfa00, 0xfa00, 0xff00 },
-                            };
-                            GradientFill( hDC, vert, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
-                        }
-
-                        // gradient at the bottom
-                        TRIVERTEX vert[2] = {
-                            { rc.left, gradient_break, 0xfa00, 0xfa00, 0xfa00, 0xff00 },
-                            { rc.right, rc.bottom,     0xe500, 0xe900, 0xee00, 0xff00 }
-                        };
-                        GradientFill( hDC, vert, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
-
+                        impl_drawAeroToolbar( hDC, rc );
                         return sal_True;
                     }
-                    else
-                        rc.top = 0; // extend potential gradient to cover menu bar as well
                 }
             }
             return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
@@ -947,6 +949,13 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
             {
                 const MenubarValue *pValue = static_cast<const MenubarValue*>(&aValue);
                 rc.bottom += pValue->maTopDockingAreaHeight;    // extend potential gradient to cover docking area as well
+
+                // make it more compatible with Aero
+                if( ImplGetSVData()->maNWFData.mbDockingAreaAvoidTBFrames )
+                {
+                    impl_drawAeroToolbar( hDC, rc );
+                    return sal_True;
+                }
             }
             return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
         }
commit 4f7f0b0539fd66f4ab01432cb062acb447269a23
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Mon Jun 25 13:09:36 2012 +0200

    Revert "Reduce copy'n'paste by different nesting of if's."
    
    This reverts commit 83208da599e46dbba39c9e9a5b503bc4e93d4eea.

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index a23f69a..5f543c9 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1,3 +1,4 @@
+
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*************************************************************************
  *
@@ -5498,45 +5499,56 @@ void MenuBarWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
                 Rectangle aRect = Rectangle( Point( nX, 1 ), Size( pData->aSz.Width(), GetOutputSizePixel().Height()-2 ) );
                 Push( PUSH_CLIPREGION );
                 IntersectClipRegion( aRect );
-
-                if( IsNativeControlSupported( CTRL_MENUBAR, PART_MENU_ITEM ) &&
-                    IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL ) )
+                if ( bHighlight )
                 {
-                    // draw background (transparency)
-                    MenubarValue aControlValue;
-                    aControlValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( this );
-
-                    Point tmp(0,0);
-                    Rectangle aBgRegion( tmp, GetOutputSizePixel() );
-                    DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL,
-                            aBgRegion,
-                            CTRL_STATE_ENABLED,
-                            aControlValue,
-                            OUString() );
-                    ImplAddNWFSeparator( this, aControlValue );
-
-                    if ( bHighlight )
+                    if( IsNativeControlSupported( CTRL_MENUBAR, PART_MENU_ITEM ) &&
+                        IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL ) )
                     {
+                        // draw background (transparency)
+                        MenubarValue aControlValue;
+                        aControlValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( this );
+
+                        Point tmp(0,0);
+                        Rectangle aBgRegion( tmp, GetOutputSizePixel() );
+                        DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL,
+                                           aBgRegion,
+                                           CTRL_STATE_ENABLED,
+                                           aControlValue,
+                                           OUString() );
+                        ImplAddNWFSeparator( this, aControlValue );
+
                         // draw selected item
                         DrawNativeControl( CTRL_MENUBAR, PART_MENU_ITEM,
-                                aRect,
-                                CTRL_STATE_ENABLED | CTRL_STATE_SELECTED,
-                                aControlValue,
-                                OUString() );
+                                           aRect,
+                                           CTRL_STATE_ENABLED | CTRL_STATE_SELECTED,
+                                           aControlValue,
+                                           OUString() );
                     }
-                }
-                else
-                {
-                    if ( bHighlight )
+                    else
                     {
                         SetFillColor( GetSettings().GetStyleSettings().GetMenuHighlightColor() );
                         SetLineColor();
                         DrawRect( aRect );
                     }
+                }
+                else
+                {
+                    if( IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL) )
+                    {
+                        MenubarValue aMenubarValue;
+                        aMenubarValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( this );
+
+                        // use full window size to get proper gradient
+                        // but clip accordingly
+                        Point aPt;
+                        Rectangle aCtrlRect( aPt, GetOutputSizePixel() );
+
+                        DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, aCtrlRect, CTRL_STATE_ENABLED, aMenubarValue, rtl::OUString() );
+                        ImplAddNWFSeparator( this, aMenubarValue );
+                    }
                     else
                         Erase( aRect );
                 }
-
                 Pop();
                 pMenu->ImplPaint( this, 0, 0, pData, bHighlight );
             }
commit ece807345296d4ab77aa7178e29efa8ac26836a0
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Mon Jun 25 13:09:17 2012 +0200

    Revert "aero: Implement a glass menubar on Windows."
    
    This reverts commit 64c696fc92a860fdbbe490ca503391b964dd646f.

diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index 6af1a28..cd3f3b9 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -279,12 +279,6 @@ public:
     // (e.g. input methods, printer update handlers).
     long                        CallCallback( sal_uInt16 nEvent, const void* pEvent ) const
     { return m_pProc ? m_pProc( m_pWindow, const_cast<SalFrame*>(this), nEvent, pEvent ) : 0; }
-
-    /// Update the region that is supposed to be handled by the window manager
-    ///
-    /// This is primarily for Windows Aero theme in order to be able to draw
-    /// to the Glass area.
-    virtual void extendWindowManagerFrameNative( int /*nLeft*/, int /*nRight*/, int /*nTop*/, int /*nBottom*/ ) {}
 };
 
 
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index e96979a..4f74c97 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -305,7 +305,6 @@ struct ImplSVNWFData
     bool                    mbToolboxDropDownSeparate:1;    // two adjacent buttons for
                                                             // toolbox dropdown buttons
     bool                    mbFlatMenu:1;                   // no popup 3D border
-    bool                    mbTransparentMenubar:1;         //< keep the background of the menubar transparent; needed for the Aero theme
     bool                    mbOpenMenuOnF10:1;              // on gnome the first menu opens on F10
     bool                    mbNoFocusRects:1;               // on Aqua focus rects are not used
     bool                    mbCenteredTabs:1;               // on Aqua, tabs are centered
diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h
index b805669..0d4e206 100644
--- a/vcl/inc/win/salframe.h
+++ b/vcl/inc/win/salframe.h
@@ -144,12 +144,6 @@ public:
     virtual void                BeginSetClipRegion( sal_uIntPtr nRects );
     virtual void                UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
     virtual void                EndSetClipRegion();
-
-    /// Update the region that is supposed to be handled by the window manager
-    ///
-    /// This is primarily for Windows Aero theme in order to be able to draw
-    /// to the Glass area.
-    virtual void extendWindowManagerFrameNative( int nLeft, int nRight, int nTop, int nBottom );
 };
 
 void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect );
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 935d5a9..a23f69a 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -52,7 +52,6 @@
 #include "vcl/toolbox.hxx"
 #include "vcl/dockingarea.hxx"
 
-#include "salframe.hxx"
 #include "salinst.hxx"
 #include "svdata.hxx"
 #include "svids.hrc"
@@ -2656,29 +2655,6 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemDa
                     nImageStyle  |= IMAGE_DRAW_DISABLE;
                 }
 
-                // Menubar highlights
-                if ( bIsMenuBar && pWin->IsNativeControlSupported( CTRL_MENUBAR, PART_MENU_ITEM ) )
-                {
-                    bool bHighlight = pThisItemOnly && bHighlighted;
-                    if ( bHighlight || ImplGetSVData()->maNWFData.mbTransparentMenubar )
-                    {
-                        Rectangle aRect = Rectangle( Point( aTopLeft.X(), 1 ), Size( pData->aSz.Width(), pWin->GetOutputSizePixel().Height()-2 ) );
-                        pWin->Push( PUSH_CLIPREGION );
-                        pWin->IntersectClipRegion( aRect );
-
-                        // draw selected item
-                        MenubarValue aControlValue;
-                        aControlValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( pWin );
-                        pWin->DrawNativeControl( CTRL_MENUBAR, PART_MENU_ITEM,
-                                aRect,
-                                CTRL_STATE_ENABLED | ( bHighlight? CTRL_STATE_SELECTED: 0 ),
-                                aControlValue,
-                                OUString() );
-
-                        pWin->Pop();
-                    }
-                }
-
                 // Separator
                 if ( !bLayout && !bIsMenuBar && ( pData->eType == MENUITEM_SEPARATOR ) )
                 {
@@ -3334,9 +3310,6 @@ Window* MenuBar::ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu )
         ( pMenu->ImplGetSalMenu() && pMenu->ImplGetSalMenu()->VisibleMenuBar() ) )
         nHeight = 0;
 
-    if ( pParent )
-        pParent->ImplGetFrame()->extendWindowManagerFrameNative( 0, 0, nHeight, 0 );
-
     pWindow->SetPosSizePixel( 0, 0, 0, nHeight, WINDOW_POSSIZE_HEIGHT );
     return pWindow;
 }
@@ -3920,18 +3893,6 @@ static void ImplInitMenuWindow( Window* pWin, sal_Bool bFont, sal_Bool bMenuBar
         pWin->SetTextColor( rStyleSettings.GetMenuTextColor() );
     pWin->SetTextFillColor();
     pWin->SetLineColor();
-
-    // update the window manager frame here too in order to be able to switch
-    // themes
-    if ( bMenuBar )
-    {
-        const Window *pParent = pWin->GetParent();
-        if ( pParent )
-        {
-            Size aSize = pWin->GetSizePixel();
-            pParent->ImplGetFrame()->extendWindowManagerFrameNative( 0, 0, aSize.Height(), 0 );
-        }
-    }
 }
 
 MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, Window* pParent, WinBits nStyle ) :
@@ -5554,9 +5515,15 @@ void MenuBarWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
                             OUString() );
                     ImplAddNWFSeparator( this, aControlValue );
 
-                    // NWF item highlight is drawn in ImplPaint() instead of
-                    // here, so that we can NWF-paint even the non-higlighted
-                    // items there
+                    if ( bHighlight )
+                    {
+                        // draw selected item
+                        DrawNativeControl( CTRL_MENUBAR, PART_MENU_ITEM,
+                                aRect,
+                                CTRL_STATE_ENABLED | CTRL_STATE_SELECTED,
+                                aControlValue,
+                                OUString() );
+                    }
                 }
                 else
                 {
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 40a522b..ed39620 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -35,10 +35,7 @@
 // (found at http://stackoverflow.com/questions/4009701/windows-visual-themes-gallery-of-parts-and-states/4009712#4009712)
 //
 // Theme subclasses:
-//   http://msdn.microsoft.com/en-us/library/windows/desktop/bb773218%28v=vs.85%29.aspx
-//
-// Drawing in non-client area (general DWM-related info):
-//   http://msdn.microsoft.com/en-us/library/windows/desktop/bb688195%28v=vs.85%29.aspx
+// http://msdn.microsoft.com/en-us/library/windows/desktop/bb773218%28v=vs.85%29.aspx
 
 #define _SV_SALNATIVEWIDGETS_CXX
 
@@ -51,7 +48,6 @@
 #include "win/svsys.h"
 #include "win/salgdi.h"
 #include "win/saldata.hxx"
-#include "win/salframe.h"
 
 #include "uxtheme.h"
 #include "vssym32.h"
@@ -75,7 +71,6 @@ static ThemeMap aThemeMap;
 class VisualStylesAPI
 {
 private:
-    // uxtheme.dll functions
     typedef HTHEME  (WINAPI * OpenThemeData_Proc_T) ( HWND hwnd, LPCWSTR pszClassList );
     typedef HRESULT (WINAPI * CloseThemeData_Proc_T) ( HTHEME hTheme );
     typedef HRESULT (WINAPI * GetThemeBackgroundContentRect_Proc_T) ( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pBoundingRect, RECT *pContentRect );
@@ -92,18 +87,12 @@ private:
     GetThemePartSize_Proc_T                 lpfnGetThemePartSize;
     IsThemeActive_Proc_T                    lpfnIsThemeActive;
 
-    // dwmapi.dll functions
-    typedef HRESULT (WINAPI * DwmExtendFrameIntoClientArea_Proc_T) ( HWND hWnd, const MARGINS *pMarInset );
-
-    DwmExtendFrameIntoClientArea_Proc_T     lpfnDwmExtendFrameIntoClientArea;
-
-    // module handles of the appropriate dll's
-    oslModule mhUxthemeModule;
-    oslModule mhDwmapiModule;
+    oslModule mhModule;
 
 public:
     VisualStylesAPI();
     ~VisualStylesAPI();
+    sal_Bool IsAvailable()  { return (mhModule != NULL); }
 
     HTHEME OpenThemeData( HWND hwnd, LPCWSTR pszClassList );
     HRESULT CloseThemeData( HTHEME hTheme );
@@ -112,52 +101,40 @@ public:
     HRESULT DrawThemeText( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, const RECT *pRect );
     HRESULT GetThemePartSize( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, THEMESIZE eSize, SIZE *psz );
     BOOL IsThemeActive( void );
-
-    HRESULT DwmExtendFrameIntoClientArea( HWND hWnd, const MARGINS *pMarInset );
 };
 
 static VisualStylesAPI vsAPI;
 
 VisualStylesAPI::VisualStylesAPI()
-    : lpfnOpenThemeData( NULL ),
-      lpfnCloseThemeData( NULL ),
-      lpfnGetThemeBackgroundContentRect( NULL ),
-      lpfnDrawThemeBackground( NULL ),
-      lpfnDrawThemeText( NULL ),
-      lpfnGetThemePartSize( NULL ),
-      lpfnIsThemeActive( NULL ),
-      lpfnDwmExtendFrameIntoClientArea( NULL )
 {
-    OUString aLibraryName( "uxtheme.dll" );
-    mhUxthemeModule = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT );
+    OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "uxtheme.dll" ) );
+    mhModule = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT );
 
-    if ( mhUxthemeModule )
+    if ( mhModule )
     {
-        lpfnOpenThemeData = (OpenThemeData_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "OpenThemeData" );
-        lpfnCloseThemeData = (CloseThemeData_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "CloseThemeData" );
-        lpfnGetThemeBackgroundContentRect = (GetThemeBackgroundContentRect_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "GetThemeBackgroundContentRect" );
-        lpfnDrawThemeBackground = (DrawThemeBackground_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "DrawThemeBackground" );
-        lpfnDrawThemeText = (DrawThemeText_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "DrawThemeText" );
-        lpfnGetThemePartSize = (GetThemePartSize_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "GetThemePartSize" );
-        lpfnIsThemeActive = (IsThemeActive_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "IsThemeActive" );
+        lpfnOpenThemeData = (OpenThemeData_Proc_T)osl_getAsciiFunctionSymbol( mhModule, "OpenThemeData" );
+        lpfnCloseThemeData = (CloseThemeData_Proc_T)osl_getAsciiFunctionSymbol( mhModule, "CloseThemeData" );
+        lpfnGetThemeBackgroundContentRect = (GetThemeBackgroundContentRect_Proc_T)osl_getAsciiFunctionSymbol( mhModule, "GetThemeBackgroundContentRect" );
+        lpfnDrawThemeBackground = (DrawThemeBackground_Proc_T)osl_getAsciiFunctionSymbol( mhModule, "DrawThemeBackground" );
+        lpfnDrawThemeText = (DrawThemeText_Proc_T)osl_getAsciiFunctionSymbol( mhModule, "DrawThemeText" );
+        lpfnGetThemePartSize = (GetThemePartSize_Proc_T)osl_getAsciiFunctionSymbol( mhModule, "GetThemePartSize" );
+        lpfnIsThemeActive = (IsThemeActive_Proc_T)osl_getAsciiFunctionSymbol( mhModule, "IsThemeActive" );
     }
-
-    aLibraryName = "dwmapi.dll";
-    mhDwmapiModule = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT );
-
-    if ( mhDwmapiModule )
+    else
     {
-        lpfnDwmExtendFrameIntoClientArea = (DwmExtendFrameIntoClientArea_Proc_T)osl_getAsciiFunctionSymbol( mhDwmapiModule, "DwmExtendFrameIntoClientArea" );
+        lpfnOpenThemeData = NULL;
+        lpfnCloseThemeData = NULL;
+        lpfnGetThemeBackgroundContentRect = NULL;
+        lpfnDrawThemeBackground = NULL;
+        lpfnDrawThemeText = NULL;
+        lpfnGetThemePartSize = NULL;
     }
 }
 
 VisualStylesAPI::~VisualStylesAPI()
 {
-    if( mhUxthemeModule )
-        osl_unloadModule( mhUxthemeModule );
-
-    if( mhDwmapiModule )
-        osl_unloadModule( mhDwmapiModule );
+    if( mhModule )
+        osl_unloadModule( mhModule );
 }
 
 HTHEME VisualStylesAPI::OpenThemeData( HWND hwnd, LPCWSTR pszClassList )
@@ -216,14 +193,6 @@ BOOL VisualStylesAPI::IsThemeActive( void )
         return FALSE;
 }
 
-HRESULT VisualStylesAPI::DwmExtendFrameIntoClientArea( HWND hWnd, const MARGINS *pMarInset )
-{
-    if (lpfnDwmExtendFrameIntoClientArea)
-        return (*lpfnDwmExtendFrameIntoClientArea) ( hWnd, pMarInset );
-    else
-        return S_FALSE;
-}
-
 /*********************************************************
  * Initialize XP theming and local stuff
  *********************************************************/
@@ -492,7 +461,7 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState,
 
 // ----
 
-sal_Bool ImplDrawNativeControl( HWND hWnd, HDC hDC, HTHEME hTheme, RECT rc,
+sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
                             ControlType nType,
                             ControlPart nPart,
                             ControlState nState,
@@ -974,22 +943,12 @@ sal_Bool ImplDrawNativeControl( HWND hWnd, HDC hDC, HTHEME hTheme, RECT rc,
     {
         if( nPart == PART_ENTIRE_CONTROL )
         {
-            if( ImplGetSVData()->maNWFData.mbTransparentMenubar )
+            if( aValue.getType() == CTRL_MENUBAR )
             {
-                // When the frame is correctly extended to the client area,
-                // Aero just needs us to repaint the affected rectangle in black
-                FillRect( hDC, &rc, static_cast< HBRUSH >( GetStockObject( BLACK_BRUSH ) ) );
-                return sal_True;
-            }
-            else
-            {
-                if( aValue.getType() == CTRL_MENUBAR )
-                {
-                    const MenubarValue *pValue = static_cast<const MenubarValue*>(&aValue);
-                    rc.bottom += pValue->maTopDockingAreaHeight;    // extend potential gradient to cover docking area as well
-                }
-                return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
+                const MenubarValue *pValue = static_cast<const MenubarValue*>(&aValue);
+                rc.bottom += pValue->maTopDockingAreaHeight;    // extend potential gradient to cover docking area as well
             }
+            return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
         }
         else if( nPart == PART_MENU_ITEM )
         {
@@ -997,25 +956,6 @@ sal_Bool ImplDrawNativeControl( HWND hWnd, HDC hDC, HTHEME hTheme, RECT rc,
                 iState = (nState & CTRL_STATE_SELECTED) ? MBI_HOT : MBI_NORMAL;
             else
                 iState = (nState & CTRL_STATE_SELECTED) ? MBI_DISABLEDHOT : MBI_DISABLED;
-
-            // draw the text glow so that the text is better visible
-            if ( ImplGetSVData()->maNWFData.mbTransparentMenubar )
-            {
-                HTHEME hGlowTheme = getThemeHandle( hWnd, L"TextGlow");
-                if ( !hTheme )
-                    return sal_False;
-
-                // I have no idea what is the correct name of the contstant
-                // that is represented by '1' below - but that draws the glow
-                // effect
-                // I've found the "TextGlow" theme handle here:
-                //   http://fc01.deviantart.net/fs26/f/2008/154/0/6/Vista_Visual_Style_Classes_by_UkIntel.html
-                // and its rendering here:
-                //   http://deskmodder.de/wiki/index.php/Vista_msstyleImage_900-938
-                // No better documentation on the topic, unfortunately :-(
-                ImplDrawTheme( hGlowTheme, hDC, 1, MBI_NORMAL, rc, aCaption );
-            }
-
             return ImplDrawTheme( hTheme, hDC, MENU_BARITEM, iState, rc, aCaption );
         }
     }
@@ -1296,7 +1236,7 @@ sal_Bool WinSalGraphics::drawNativeControl( ControlType nType,
     int ta = SetTextAlign( mhDC, TA_LEFT|TA_TOP|TA_NOUPDATECP );
 
     OUString aCaptionStr( aCaption.replace('~', '&') ); // translate mnemonics
-    bOk = ImplDrawNativeControl(mhWnd, mhDC, hTheme, rc,
+    bOk = ImplDrawNativeControl(mhDC, hTheme, rc,
                             nType, nPart, nState, aValue,
                             aCaptionStr );
 
@@ -1554,20 +1494,4 @@ void WinSalGraphics::updateSettingsNative( AllSettings& rSettings )
     rSettings.SetStyleSettings( aStyleSettings );
 }
 
-void WinSalFrame::extendWindowManagerFrameNative( int nLeft, int nRight, int nTop, int nBottom )
-{
-    // nothing to do for Windows before Vista
-    if( aSalShlData.maVersionInfo.dwMajorVersion < 6 || !vsAPI.IsThemeActive() )
-        return;
-
-    MARGINS aMargins = { nLeft, nRight, nTop, nBottom };
-    HRESULT nRet = vsAPI.DwmExtendFrameIntoClientArea( mhWnd, &aMargins );
-
-    ImplSVData* pSVData = ImplGetSVData();
-    if( nRet == S_OK )
-        pSVData->maNWFData.mbTransparentMenubar = true;
-    else
-        pSVData->maNWFData.mbTransparentMenubar = false;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit f2eef8314c97c068b2b0cdbf565997836528f85d
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Mon Jun 25 13:08:06 2012 +0200

    Revert "menubar: Improved Windows Vista or later look (based on Mirek M.'s design)."
    
    This reverts commit eac708b0b188d7e6477922bb4bc03199cd92f5ca.

diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 388b926..40a522b 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -492,81 +492,6 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState,
 
 // ----
 
-/// Draw an effect under the menubar for better readibility in the non-client area
-static bool impl_drawAeroMenubar( HWND hWnd, HDC hDC, RECT rc )
-{
-    const long GLOW_OFFSET = 5;
-    const long VISIBLE_FRAME = 2;
-    const long TRIANGLE_WIDTH = rc.bottom - rc.top - GLOW_OFFSET - VISIBLE_FRAME;
-    const COLOR16 FINAL_OPACITY = 0x2000;
-
-    // the glow effect gives us a nice fade into the gradient
-    HTHEME hGlowTheme = getThemeHandle( hWnd, L"TextGlow");
-    if ( !hGlowTheme )
-        return sal_False;
-
-    // first clear everything
-    FillRect( hDC, &rc, static_cast< HBRUSH >( GetStockObject( BLACK_BRUSH ) ) );
-
-    // gradient under the menu
-    TRIVERTEX vert[2] = {
-        { rc.left + GLOW_OFFSET + TRIANGLE_WIDTH,  rc.top + GLOW_OFFSET,      0x0000, 0x0000, 0x0000, 0x0000 },
-        { rc.right - GLOW_OFFSET - TRIANGLE_WIDTH, rc.bottom - VISIBLE_FRAME, 0xff00, 0xff00, 0xff00, FINAL_OPACITY }
-    };
-    GRADIENT_RECT g_rect[1] = { { 0, 1 } };
-    GradientFill( hDC, vert, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
-
-    // left side of the gradient consists of 2 triangles
-    TRIVERTEX vert_left_1[3] = {
-        { rc.left + GLOW_OFFSET, rc.top + GLOW_OFFSET,                       0x0000, 0x0000, 0x0000, 0x0000 },
-        { rc.left + GLOW_OFFSET, rc.bottom - VISIBLE_FRAME,                  0x0000, 0x0000, 0x0000, 0x0000 },
-        { rc.left + GLOW_OFFSET + TRIANGLE_WIDTH, rc.bottom - VISIBLE_FRAME, 0xff00, 0xff00, 0xff00, FINAL_OPACITY }
-    };
-    GRADIENT_TRIANGLE g_triangle[1] = { { 0, 1, 2 } };
-    GradientFill( hDC, vert_left_1, 3, g_triangle, 1, GRADIENT_FILL_TRIANGLE );
-
-    TRIVERTEX vert_left_2[3] = {
-        { rc.left + GLOW_OFFSET, rc.top + GLOW_OFFSET,                       0x0000, 0x0000, 0x0000, 0x0000 },
-        { rc.left + GLOW_OFFSET + TRIANGLE_WIDTH, rc.top + GLOW_OFFSET,      0x0000, 0x0000, 0x0000, 0x0000 },
-        { rc.left + GLOW_OFFSET + TRIANGLE_WIDTH, rc.bottom - VISIBLE_FRAME, 0xff00, 0xff00, 0xff00, FINAL_OPACITY }
-    };
-    GradientFill( hDC, vert_left_2, 3, g_triangle, 1, GRADIENT_FILL_TRIANGLE );
-
-    // right side of the gradient consists of 2 triangles
-    TRIVERTEX vert_right_1[3] = {
-        { rc.right - GLOW_OFFSET, rc.top + GLOW_OFFSET,                       0x0000, 0x0000, 0x0000, 0x0000 },
-        { rc.right - GLOW_OFFSET, rc.bottom - VISIBLE_FRAME,                  0x0000, 0x0000, 0x0000, 0x0000 },
-        { rc.right - GLOW_OFFSET - TRIANGLE_WIDTH, rc.bottom - VISIBLE_FRAME, 0xff00, 0xff00, 0xff00, FINAL_OPACITY }
-    };
-    GradientFill( hDC, vert_right_1, 3, g_triangle, 1, GRADIENT_FILL_TRIANGLE );
-
-    TRIVERTEX vert_right_2[3] = {
-        { rc.right - GLOW_OFFSET, rc.top + GLOW_OFFSET,                       0x0000, 0x0000, 0x0000, 0x0000 },
-        { rc.right - GLOW_OFFSET - TRIANGLE_WIDTH, rc.top + GLOW_OFFSET,      0x0000, 0x0000, 0x0000, 0x0000 },
-        { rc.right - GLOW_OFFSET - TRIANGLE_WIDTH, rc.bottom - VISIBLE_FRAME, 0xff00, 0xff00, 0xff00, FINAL_OPACITY }
-    };
-    GradientFill( hDC, vert_right_2, 3, g_triangle, 1, GRADIENT_FILL_TRIANGLE );
-
-    // I have no idea what is the correct name of the contstant
-    // that is represented by '1' below - but that draws the glow
-    // effect
-    // I've found the "TextGlow" theme handle here:
-    //   http://fc01.deviantart.net/fs26/f/2008/154/0/6/Vista_Visual_Style_Classes_by_UkIntel.html
-    // and its rendering here:
-    //   http://deskmodder.de/wiki/index.php/Vista_msstyleImage_900-938
-    // No better documentation on the topic, unfortunately :-(
-    RECT tmp_rc = rc;
-    tmp_rc.bottom += rc.bottom - rc.top; // expand it vertically so that it continues to the window
-    ImplDrawTheme( hGlowTheme, hDC, 1, MBI_NORMAL, tmp_rc, OUString() );
-
-    // make the frame visible, so that it integrates nicely with Aero
-    tmp_rc = rc;
-    tmp_rc.top = rc.bottom - VISIBLE_FRAME;
-    FillRect( hDC, &tmp_rc, static_cast< HBRUSH >( GetStockObject( BLACK_BRUSH ) ) );
-
-    return sal_True;
-}
-
 sal_Bool ImplDrawNativeControl( HWND hWnd, HDC hDC, HTHEME hTheme, RECT rc,
                             ControlType nType,
                             ControlPart nPart,
@@ -1049,17 +974,22 @@ sal_Bool ImplDrawNativeControl( HWND hWnd, HDC hDC, HTHEME hTheme, RECT rc,
     {
         if( nPart == PART_ENTIRE_CONTROL )
         {
-            // Windows Vista or later?  Try drawing to the non-client area...
-            if( ImplGetSVData()->maNWFData.mbTransparentMenubar && impl_drawAeroMenubar( hWnd, hDC, rc ) )
+            if( ImplGetSVData()->maNWFData.mbTransparentMenubar )
+            {
+                // When the frame is correctly extended to the client area,
+                // Aero just needs us to repaint the affected rectangle in black
+                FillRect( hDC, &rc, static_cast< HBRUSH >( GetStockObject( BLACK_BRUSH ) ) );
                 return sal_True;
-
-            // ...otherwise use the theme
-            if( aValue.getType() == CTRL_MENUBAR )
+            }
+            else
             {
-                const MenubarValue *pValue = static_cast<const MenubarValue*>(&aValue);
-                rc.bottom += pValue->maTopDockingAreaHeight;    // extend potential gradient to cover docking area as well
+                if( aValue.getType() == CTRL_MENUBAR )
+                {
+                    const MenubarValue *pValue = static_cast<const MenubarValue*>(&aValue);
+                    rc.bottom += pValue->maTopDockingAreaHeight;    // extend potential gradient to cover docking area as well
+                }
+                return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
             }
-            return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
         }
         else if( nPart == PART_MENU_ITEM )
         {
@@ -1068,6 +998,24 @@ sal_Bool ImplDrawNativeControl( HWND hWnd, HDC hDC, HTHEME hTheme, RECT rc,
             else
                 iState = (nState & CTRL_STATE_SELECTED) ? MBI_DISABLEDHOT : MBI_DISABLED;
 
+            // draw the text glow so that the text is better visible
+            if ( ImplGetSVData()->maNWFData.mbTransparentMenubar )
+            {
+                HTHEME hGlowTheme = getThemeHandle( hWnd, L"TextGlow");
+                if ( !hTheme )
+                    return sal_False;
+
+                // I have no idea what is the correct name of the contstant
+                // that is represented by '1' below - but that draws the glow
+                // effect
+                // I've found the "TextGlow" theme handle here:
+                //   http://fc01.deviantart.net/fs26/f/2008/154/0/6/Vista_Visual_Style_Classes_by_UkIntel.html
+                // and its rendering here:
+                //   http://deskmodder.de/wiki/index.php/Vista_msstyleImage_900-938
+                // No better documentation on the topic, unfortunately :-(
+                ImplDrawTheme( hGlowTheme, hDC, 1, MBI_NORMAL, rc, aCaption );
+            }
+
             return ImplDrawTheme( hTheme, hDC, MENU_BARITEM, iState, rc, aCaption );
         }
     }
commit ae8bb2e2abe7f1f380e3b142821336e2eea03104
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Mon Jun 25 13:06:45 2012 +0200

    Revert "aero menubar: Improve look according to Mirek M. + Astron's notes."
    
    This reverts commit 663bfb42c8e2a7e3306eaa59ca77746d0aa0a197.

diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 99c512f..388b926 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -493,70 +493,81 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState,
 // ----
 
 /// Draw an effect under the menubar for better readibility in the non-client area
-static bool impl_drawAeroMenubar( HDC hDC, RECT rc )
+static bool impl_drawAeroMenubar( HWND hWnd, HDC hDC, RECT rc )
 {
-    const long GROWING_WIDTH = 52;
+    const long GLOW_OFFSET = 5;
+    const long VISIBLE_FRAME = 2;
+    const long TRIANGLE_WIDTH = rc.bottom - rc.top - GLOW_OFFSET - VISIBLE_FRAME;
+    const COLOR16 FINAL_OPACITY = 0x2000;
 
-    const COLOR16 FINAL_VALUE = 0xf000;
-    const COLOR16 FINAL_OPACITY = 0xff00;
+    // the glow effect gives us a nice fade into the gradient
+    HTHEME hGlowTheme = getThemeHandle( hWnd, L"TextGlow");
+    if ( !hGlowTheme )
+        return sal_False;
 
-    const long VISIBLE_FRAME = 2;
-    const int FRAME_RATIO = 3;
+    // first clear everything
+    FillRect( hDC, &rc, static_cast< HBRUSH >( GetStockObject( BLACK_BRUSH ) ) );
 
     // gradient under the menu
     TRIVERTEX vert[2] = {
-        { rc.left + GROWING_WIDTH,  rc.top,                    0x0000, 0x0000, 0x0000, 0x0000 },
-        { rc.right - GROWING_WIDTH, rc.bottom - VISIBLE_FRAME, FINAL_VALUE, FINAL_VALUE, FINAL_VALUE, FINAL_OPACITY }
+        { rc.left + GLOW_OFFSET + TRIANGLE_WIDTH,  rc.top + GLOW_OFFSET,      0x0000, 0x0000, 0x0000, 0x0000 },
+        { rc.right - GLOW_OFFSET - TRIANGLE_WIDTH, rc.bottom - VISIBLE_FRAME, 0xff00, 0xff00, 0xff00, FINAL_OPACITY }
     };
     GRADIENT_RECT g_rect[1] = { { 0, 1 } };
     GradientFill( hDC, vert, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
 
-    // gradient in the frame (2 pixels between menu and the toolbars)
-    // [the "gradient" here is not really a gradient, but it is convenient to
-    // draw it this way ;-)]
-    TRIVERTEX vert_2[2] = {
-        { rc.left + GROWING_WIDTH,  rc.bottom - VISIBLE_FRAME, FINAL_VALUE / FRAME_RATIO, FINAL_VALUE / FRAME_RATIO, FINAL_VALUE / FRAME_RATIO, FINAL_OPACITY / FRAME_RATIO },
-        { rc.right - GROWING_WIDTH, rc.bottom,                 FINAL_VALUE / FRAME_RATIO, FINAL_VALUE / FRAME_RATIO, FINAL_VALUE / FRAME_RATIO, FINAL_OPACITY / FRAME_RATIO }
+    // left side of the gradient consists of 2 triangles
+    TRIVERTEX vert_left_1[3] = {
+        { rc.left + GLOW_OFFSET, rc.top + GLOW_OFFSET,                       0x0000, 0x0000, 0x0000, 0x0000 },
+        { rc.left + GLOW_OFFSET, rc.bottom - VISIBLE_FRAME,                  0x0000, 0x0000, 0x0000, 0x0000 },
+        { rc.left + GLOW_OFFSET + TRIANGLE_WIDTH, rc.bottom - VISIBLE_FRAME, 0xff00, 0xff00, 0xff00, FINAL_OPACITY }
     };
-    GradientFill( hDC, vert_2, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
+    GRADIENT_TRIANGLE g_triangle[1] = { { 0, 1, 2 } };
+    GradientFill( hDC, vert_left_1, 3, g_triangle, 1, GRADIENT_FILL_TRIANGLE );
 
-    const int STEP = 2;
-    for ( int i = 0; i < GROWING_WIDTH; i += STEP )
-    {
-        COLOR16 val = static_cast< double >( FINAL_VALUE ) * sin( ( static_cast< double >( i ) / GROWING_WIDTH ) * M_PI_2 );
-        COLOR16 op = static_cast< double >( FINAL_OPACITY ) * sin( ( static_cast< double >( i ) / GROWING_WIDTH ) * M_PI_2 );
-
-        // "growing" part of the gradient - menu
-        TRIVERTEX vert_left[2] = {
-            { rc.left + i, rc.top,                           0x0000, 0x0000, 0x0000, 0x0000 },
-            { rc.left + i + STEP, rc.bottom - VISIBLE_FRAME, val, val, val, op }
-        };
-        GradientFill( hDC, vert_left, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
-
-        TRIVERTEX vert_right[2] = {
-            { rc.right - i, rc.top,                           0x0000, 0x0000, 0x0000, 0x0000 },
-            { rc.right - i - STEP, rc.bottom - VISIBLE_FRAME, val, val, val, op }
-        };
-        GradientFill( hDC, vert_right, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
-
-        // "growing" part of the gradient - frame
-        TRIVERTEX vert_bottom_l[2] = {
-            { rc.left + i, rc.bottom - VISIBLE_FRAME, val / FRAME_RATIO, val / FRAME_RATIO, val / FRAME_RATIO, op / FRAME_RATIO },
-            { rc.left + i + STEP, rc.bottom,          val / FRAME_RATIO, val / FRAME_RATIO, val / FRAME_RATIO, op / FRAME_RATIO }
-        };
-        GradientFill( hDC, vert_bottom_l, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
-
-        TRIVERTEX vert_bottom_r[2] = {
-            { rc.right - i, rc.bottom - VISIBLE_FRAME, val / FRAME_RATIO, val / FRAME_RATIO, val / FRAME_RATIO, op / FRAME_RATIO },
-            { rc.right - i - STEP, rc.bottom,          val / FRAME_RATIO, val / FRAME_RATIO, val / FRAME_RATIO, op / FRAME_RATIO }
-        };
-        GradientFill( hDC, vert_bottom_r, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
-    }
+    TRIVERTEX vert_left_2[3] = {
+        { rc.left + GLOW_OFFSET, rc.top + GLOW_OFFSET,                       0x0000, 0x0000, 0x0000, 0x0000 },
+        { rc.left + GLOW_OFFSET + TRIANGLE_WIDTH, rc.top + GLOW_OFFSET,      0x0000, 0x0000, 0x0000, 0x0000 },
+        { rc.left + GLOW_OFFSET + TRIANGLE_WIDTH, rc.bottom - VISIBLE_FRAME, 0xff00, 0xff00, 0xff00, FINAL_OPACITY }
+    };
+    GradientFill( hDC, vert_left_2, 3, g_triangle, 1, GRADIENT_FILL_TRIANGLE );
+
+    // right side of the gradient consists of 2 triangles
+    TRIVERTEX vert_right_1[3] = {
+        { rc.right - GLOW_OFFSET, rc.top + GLOW_OFFSET,                       0x0000, 0x0000, 0x0000, 0x0000 },
+        { rc.right - GLOW_OFFSET, rc.bottom - VISIBLE_FRAME,                  0x0000, 0x0000, 0x0000, 0x0000 },
+        { rc.right - GLOW_OFFSET - TRIANGLE_WIDTH, rc.bottom - VISIBLE_FRAME, 0xff00, 0xff00, 0xff00, FINAL_OPACITY }
+    };
+    GradientFill( hDC, vert_right_1, 3, g_triangle, 1, GRADIENT_FILL_TRIANGLE );
 
-    return true;
+    TRIVERTEX vert_right_2[3] = {
+        { rc.right - GLOW_OFFSET, rc.top + GLOW_OFFSET,                       0x0000, 0x0000, 0x0000, 0x0000 },
+        { rc.right - GLOW_OFFSET - TRIANGLE_WIDTH, rc.top + GLOW_OFFSET,      0x0000, 0x0000, 0x0000, 0x0000 },
+        { rc.right - GLOW_OFFSET - TRIANGLE_WIDTH, rc.bottom - VISIBLE_FRAME, 0xff00, 0xff00, 0xff00, FINAL_OPACITY }
+    };
+    GradientFill( hDC, vert_right_2, 3, g_triangle, 1, GRADIENT_FILL_TRIANGLE );
+
+    // I have no idea what is the correct name of the contstant
+    // that is represented by '1' below - but that draws the glow
+    // effect
+    // I've found the "TextGlow" theme handle here:
+    //   http://fc01.deviantart.net/fs26/f/2008/154/0/6/Vista_Visual_Style_Classes_by_UkIntel.html
+    // and its rendering here:
+    //   http://deskmodder.de/wiki/index.php/Vista_msstyleImage_900-938
+    // No better documentation on the topic, unfortunately :-(
+    RECT tmp_rc = rc;
+    tmp_rc.bottom += rc.bottom - rc.top; // expand it vertically so that it continues to the window
+    ImplDrawTheme( hGlowTheme, hDC, 1, MBI_NORMAL, tmp_rc, OUString() );
+
+    // make the frame visible, so that it integrates nicely with Aero
+    tmp_rc = rc;
+    tmp_rc.top = rc.bottom - VISIBLE_FRAME;
+    FillRect( hDC, &tmp_rc, static_cast< HBRUSH >( GetStockObject( BLACK_BRUSH ) ) );
+
+    return sal_True;
 }
 
-sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
+sal_Bool ImplDrawNativeControl( HWND hWnd, HDC hDC, HTHEME hTheme, RECT rc,
                             ControlType nType,
                             ControlPart nPart,
                             ControlState nState,
@@ -1020,7 +1031,7 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
                         // gradient at the bottom
                         TRIVERTEX vert[2] = {
                             { rc.left, gradient_break, 0xfa00, 0xfa00, 0xfa00, 0xff00 },
-                            { rc.right, rc.bottom,     0xf000, 0xf000, 0xf000, 0xff00 }
+                            { rc.right, rc.bottom,     0xe500, 0xe900, 0xee00, 0xff00 }
                         };
                         GradientFill( hDC, vert, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
 
@@ -1039,7 +1050,7 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
         if( nPart == PART_ENTIRE_CONTROL )
         {
             // Windows Vista or later?  Try drawing to the non-client area...
-            if( ImplGetSVData()->maNWFData.mbTransparentMenubar && impl_drawAeroMenubar( hDC, rc ) )
+            if( ImplGetSVData()->maNWFData.mbTransparentMenubar && impl_drawAeroMenubar( hWnd, hDC, rc ) )
                 return sal_True;
 
             // ...otherwise use the theme
@@ -1337,7 +1348,7 @@ sal_Bool WinSalGraphics::drawNativeControl( ControlType nType,
     int ta = SetTextAlign( mhDC, TA_LEFT|TA_TOP|TA_NOUPDATECP );
 
     OUString aCaptionStr( aCaption.replace('~', '&') ); // translate mnemonics
-    bOk = ImplDrawNativeControl(mhDC, hTheme, rc,
+    bOk = ImplDrawNativeControl(mhWnd, mhDC, hTheme, rc,
                             nType, nPart, nState, aValue,
                             aCaptionStr );
 
commit 76197b88727b15cab5c1d4021b23a9a6b13626de
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Mon Jun 25 13:06:23 2012 +0200

    Revert "aero menubar: Make the text in menu black."
    
    This reverts commit 9164d135db46be9de56ef60f4b95bbd933fdb57e.

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 2bf8202..935d5a9 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2669,17 +2669,11 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemDa
                         // draw selected item
                         MenubarValue aControlValue;
                         aControlValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( pWin );
-
-                        // transparent menubar needs a trick to write nice text, do it via NWF
-                        OUString aText;
-                        if ( bIsMenuBar && ImplGetSVData()->maNWFData.mbTransparentMenubar )
-                            aText = pData->aText;
-
                         pWin->DrawNativeControl( CTRL_MENUBAR, PART_MENU_ITEM,
                                 aRect,
                                 CTRL_STATE_ENABLED | ( bHighlight? CTRL_STATE_SELECTED: 0 ),
                                 aControlValue,
-                                aText );
+                                OUString() );
 
                         pWin->Pop();
                     }
@@ -2809,8 +2803,7 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemDa
                 }
 
                 // Text:
-                if ( ( ( pData->eType == MENUITEM_STRING ) || ( pData->eType == MENUITEM_STRINGIMAGE ) ) &&
-                     !(bIsMenuBar && ImplGetSVData()->maNWFData.mbTransparentMenubar) )
+                if ( ( pData->eType == MENUITEM_STRING ) || ( pData->eType == MENUITEM_STRINGIMAGE ) )
                 {
                     aTmpPos.X() = aPos.X() + nTextPos;
                     aTmpPos.Y() = aPos.Y();
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index a93bdca..99c512f 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -82,7 +82,6 @@ private:
     typedef HRESULT (WINAPI * DrawThemeBackground_Proc_T) ( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect );
     typedef HRESULT (WINAPI * DrawThemeText_Proc_T) ( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, const RECT *pRect );
     typedef HRESULT (WINAPI * GetThemePartSize_Proc_T) ( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, THEMESIZE eSize, SIZE *psz );
-    typedef HRESULT (WINAPI * GetThemeSysFont_Proc_T) ( HTHEME hTheme, int iFontID, LOGFONTW *plf );
     typedef BOOL    (WINAPI * IsThemeActive_Proc_T) ( void );
 
     OpenThemeData_Proc_T                    lpfnOpenThemeData;
@@ -91,7 +90,6 @@ private:
     DrawThemeBackground_Proc_T              lpfnDrawThemeBackground;
     DrawThemeText_Proc_T                    lpfnDrawThemeText;
     GetThemePartSize_Proc_T                 lpfnGetThemePartSize;
-    GetThemeSysFont_Proc_T                  lpfnGetThemeSysFont;
     IsThemeActive_Proc_T                    lpfnIsThemeActive;
 
     // dwmapi.dll functions
@@ -113,7 +111,6 @@ public:
     HRESULT DrawThemeBackground( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect );
     HRESULT DrawThemeText( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, const RECT *pRect );
     HRESULT GetThemePartSize( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, THEMESIZE eSize, SIZE *psz );
-    HRESULT GetThemeSysFont( HTHEME hTheme, int iFontID, LOGFONTW *plf );
     BOOL IsThemeActive( void );
 
     HRESULT DwmExtendFrameIntoClientArea( HWND hWnd, const MARGINS *pMarInset );
@@ -128,7 +125,6 @@ VisualStylesAPI::VisualStylesAPI()
       lpfnDrawThemeBackground( NULL ),
       lpfnDrawThemeText( NULL ),
       lpfnGetThemePartSize( NULL ),
-      lpfnGetThemeSysFont( NULL ),
       lpfnIsThemeActive( NULL ),
       lpfnDwmExtendFrameIntoClientArea( NULL )
 {
@@ -143,7 +139,6 @@ VisualStylesAPI::VisualStylesAPI()
         lpfnDrawThemeBackground = (DrawThemeBackground_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "DrawThemeBackground" );
         lpfnDrawThemeText = (DrawThemeText_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "DrawThemeText" );
         lpfnGetThemePartSize = (GetThemePartSize_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "GetThemePartSize" );
-        lpfnGetThemeSysFont = (GetThemeSysFont_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "GetThemeSysFont" );
         lpfnIsThemeActive = (IsThemeActive_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "IsThemeActive" );
     }
 
@@ -213,14 +208,6 @@ HRESULT VisualStylesAPI::GetThemePartSize( HTHEME hTheme, HDC hdc, int iPartId,
         return S_FALSE;
 }
 
-HRESULT VisualStylesAPI::GetThemeSysFont( HTHEME hTheme, int iFontID, LOGFONTW *plf )
-{
-    if(lpfnGetThemeSysFont)
-        return (*lpfnGetThemeSysFont) ( hTheme, iFontID, plf );
-    else
-        return S_FALSE;
-}
-
 BOOL VisualStylesAPI::IsThemeActive( void )
 {
     if(lpfnIsThemeActive)
@@ -415,89 +402,18 @@ sal_Bool WinSalGraphics::hitTestNativeControl( ControlType,
     return FALSE;
 }
 
-sal_Bool ImplDrawTheme( HTHEME hTheme, HDC hDC, int iPart, int iState, RECT rc, const OUString& aStr, bool bAeroTrick = false )
+sal_Bool ImplDrawTheme( HTHEME hTheme, HDC hDC, int iPart, int iState, RECT rc, const OUString& aStr)
 {
     HRESULT hr = vsAPI.DrawThemeBackground( hTheme, hDC, iPart, iState, &rc, 0);
 
     if( aStr.getLength() )
     {
-        // oh well, in order to be able to draw solid text in the Aero border,
-        // we need to do the trick from
-        // http://msdn.microsoft.com/en-us/library/windows/desktop/bb688195%28v=vs.85%29.aspx#appendixb
-        if ( bAeroTrick && ( iPart == MENU_BARITEM ) )
-        {
-            HTHEME hCompositedTheme = vsAPI.OpenThemeData( NULL, L"CompositedWindow::Window" );
-            if ( hCompositedTheme )
-            {
-                HDC hdcPaint = CreateCompatibleDC(hDC);
-                if (hdcPaint)
-                {
-                    int cx = rc.right - rc.left;
-                    int cy = rc.bottom - rc.top;
-
-                    // Define the BITMAPINFO structure used to draw text.
-                    // Note that biHeight is negative. This is done because
-                    // DrawThemeTextEx() needs the bitmap to be in top-to-bottom
-                    // order.
-                    BITMAPINFO dib;
-                    dib.bmiHeader.biSize            = sizeof(BITMAPINFOHEADER);
-                    dib.bmiHeader.biWidth           = cx;
-                    dib.bmiHeader.biHeight          = -cy;
-                    dib.bmiHeader.biPlanes          = 1;
-                    dib.bmiHeader.biBitCount        = 32;
-                    dib.bmiHeader.biCompression     = 0; // BI_RGB - MinGW does not seem to define the contstant
-
-                    HBITMAP hbm = CreateDIBSection(hDC, &dib, DIB_RGB_COLORS, NULL, NULL, 0);
-                    if (hbm)
-                    {
-                        HBITMAP hbmOld = (HBITMAP)SelectObject(hdcPaint, hbm);
-
-                        // Select a font.
-                        LOGFONTW lgFont;
-                        HFONT hFontOld = NULL;
-                        if (SUCCEEDED(vsAPI.GetThemeSysFont(hCompositedTheme, TMT_MENUFONT, &lgFont)))
-                        {
-                            HFONT hFont = CreateFontIndirectW(&lgFont);
-                            hFontOld = (HFONT) SelectObject(hdcPaint, hFont);
-                        }
-
-                        // Blit the background to the bitmap
-                        BitBlt(hdcPaint, 0, 0, cx, cy, hDC, rc.left, rc.top, SRCCOPY);
-
-                        // Draw the title.
-                        RECT rcPaint;
-                        rcPaint.left = rcPaint.top = 0;
-                        rcPaint.right = cx;
-                        rcPaint.bottom = cy;
-                        hr = vsAPI.DrawThemeText( hCompositedTheme, hdcPaint, iPart, iState,
-                                reinterpret_cast<LPCWSTR>(aStr.getStr()), -1,
-                                DT_CENTER | DT_VCENTER | DT_SINGLELINE,
-                                0, &rcPaint);
-
-                        // Blit text to the frame.
-                        BitBlt(hDC, rc.left, rc.top, cx, cy, hdcPaint, 0, 0, SRCCOPY);
-
-                        SelectObject(hdcPaint, hbmOld);
-                        if (hFontOld)
-                        {
-                            SelectObject(hdcPaint, hFontOld);
-                        }
-                        DeleteObject(hbm);
-                    }
-                    DeleteDC(hdcPaint);
-                }
-                vsAPI.CloseThemeData(hCompositedTheme);
-            }
-        }
-        else
-        {
-            RECT rcContent;
-            hr = vsAPI.GetThemeBackgroundContentRect( hTheme, hDC, iPart, iState, &rc, &rcContent);
-            hr = vsAPI.DrawThemeText( hTheme, hDC, iPart, iState,
-                    reinterpret_cast<LPCWSTR>(aStr.getStr()), -1,
-                    DT_CENTER | DT_VCENTER | DT_SINGLELINE,
-                    0, &rcContent);
-        }
+        RECT rcContent;
+        hr = vsAPI.GetThemeBackgroundContentRect( hTheme, hDC, iPart, iState, &rc, &rcContent);
+        hr = vsAPI.DrawThemeText( hTheme, hDC, iPart, iState,
+            reinterpret_cast<LPCWSTR>(aStr.getStr()), -1,
+            DT_CENTER | DT_VCENTER | DT_SINGLELINE,
+            0, &rcContent);
     }
     return (hr == S_OK);
 }
@@ -1141,7 +1057,7 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
             else
                 iState = (nState & CTRL_STATE_SELECTED) ? MBI_DISABLEDHOT : MBI_DISABLED;
 
-            return ImplDrawTheme( hTheme, hDC, MENU_BARITEM, iState, rc, aCaption, true );
+            return ImplDrawTheme( hTheme, hDC, MENU_BARITEM, iState, rc, aCaption );
         }
     }
 
commit 0675317dd445c444aa4141fa17d809ce5a05dea0
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Mon Jun 25 13:00:18 2012 +0200

    Revert "aero menubar: Make the glow around the entries smaller."
    
    This reverts commit ff367eb669686c80cd5f0931cf0adf81d02f49e0.

diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 0ac78b9..a93bdca 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -66,40 +66,6 @@ using ::rtl::OUString;
 typedef map< wstring, HTHEME > ThemeMap;
 static ThemeMap aThemeMap;
 
-#ifdef __MINGW32__
-
-typedef int (WINAPI *DTT_CALLBACK_PROC)
-(
-  HDC hdc,
-  LPWSTR pszText,
-  int cchText,
-  LPRECT prc,
-  UINT dwFlags,
-  LPARAM lParam
-);
-
-typedef struct _DTTOPTS {
-  DWORD             dwSize;
-  DWORD             dwFlags;
-  COLORREF          crText;
-  COLORREF          crBorder;
-  COLORREF          crShadow;
-  int               iTextShadowType;
-  POINT             ptShadowOffset;
-  int               iBorderSize;
-  int               iFontPropId;
-  int               iColorPropId;
-  int               iStateId;
-  BOOL              fApplyOverlay;
-  int               iGlowSize;
-  DTT_CALLBACK_PROC pfnDrawTextCallback;
-  LPARAM            lParam;
-} DTTOPTS, *PDTTOPTS;
-
-#define DTT_GLOWSIZE   (1UL << 11)
-#define DTT_COMPOSITED (1UL << 13)
-
-#endif
 
 /****************************************************
  wrap visual styles API to avoid linking against it
@@ -115,7 +81,6 @@ private:
     typedef HRESULT (WINAPI * GetThemeBackgroundContentRect_Proc_T) ( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pBoundingRect, RECT *pContentRect );
     typedef HRESULT (WINAPI * DrawThemeBackground_Proc_T) ( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect );
     typedef HRESULT (WINAPI * DrawThemeText_Proc_T) ( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, const RECT *pRect );
-    typedef HRESULT (WINAPI * DrawThemeTextEx_Proc_T) ( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, LPRECT pRect, const DTTOPTS *pOptions );
     typedef HRESULT (WINAPI * GetThemePartSize_Proc_T) ( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, THEMESIZE eSize, SIZE *psz );
     typedef HRESULT (WINAPI * GetThemeSysFont_Proc_T) ( HTHEME hTheme, int iFontID, LOGFONTW *plf );
     typedef BOOL    (WINAPI * IsThemeActive_Proc_T) ( void );
@@ -125,7 +90,6 @@ private:
     GetThemeBackgroundContentRect_Proc_T    lpfnGetThemeBackgroundContentRect;
     DrawThemeBackground_Proc_T              lpfnDrawThemeBackground;
     DrawThemeText_Proc_T                    lpfnDrawThemeText;
-    DrawThemeTextEx_Proc_T                  lpfnDrawThemeTextEx;
     GetThemePartSize_Proc_T                 lpfnGetThemePartSize;
     GetThemeSysFont_Proc_T                  lpfnGetThemeSysFont;
     IsThemeActive_Proc_T                    lpfnIsThemeActive;
@@ -148,7 +112,6 @@ public:
     HRESULT GetThemeBackgroundContentRect( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pBoundingRect, RECT *pContentRect );
     HRESULT DrawThemeBackground( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect );
     HRESULT DrawThemeText( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, const RECT *pRect );
-    HRESULT DrawThemeTextEx( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, LPRECT pRect, const DTTOPTS *pOptions );
     HRESULT GetThemePartSize( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, THEMESIZE eSize, SIZE *psz );
     HRESULT GetThemeSysFont( HTHEME hTheme, int iFontID, LOGFONTW *plf );
     BOOL IsThemeActive( void );
@@ -164,7 +127,6 @@ VisualStylesAPI::VisualStylesAPI()
       lpfnGetThemeBackgroundContentRect( NULL ),
       lpfnDrawThemeBackground( NULL ),
       lpfnDrawThemeText( NULL ),
-      lpfnDrawThemeTextEx( NULL ),
       lpfnGetThemePartSize( NULL ),
       lpfnGetThemeSysFont( NULL ),
       lpfnIsThemeActive( NULL ),
@@ -180,7 +142,6 @@ VisualStylesAPI::VisualStylesAPI()
         lpfnGetThemeBackgroundContentRect = (GetThemeBackgroundContentRect_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "GetThemeBackgroundContentRect" );
         lpfnDrawThemeBackground = (DrawThemeBackground_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "DrawThemeBackground" );
         lpfnDrawThemeText = (DrawThemeText_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "DrawThemeText" );
-        lpfnDrawThemeTextEx = (DrawThemeTextEx_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "DrawThemeTextEx" );
         lpfnGetThemePartSize = (GetThemePartSize_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "GetThemePartSize" );
         lpfnGetThemeSysFont = (GetThemeSysFont_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "GetThemeSysFont" );
         lpfnIsThemeActive = (IsThemeActive_Proc_T)osl_getAsciiFunctionSymbol( mhUxthemeModule, "IsThemeActive" );
@@ -244,17 +205,6 @@ HRESULT VisualStylesAPI::DrawThemeText( HTHEME hTheme, HDC hdc, int iPartId, int
         return S_FALSE;
 }
 
-HRESULT VisualStylesAPI::DrawThemeTextEx( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, LPRECT pRect, const DTTOPTS *pOptions )
-{
-    if(lpfnDrawThemeTextEx)
-        return (*lpfnDrawThemeTextEx) (hTheme, hdc, iPartId, iStateId, pszText, iCharCount, dwTextFlags, pRect, pOptions);
-    else
-    {
-        // try to fallback
-        return DrawThemeText(hTheme, hdc, iPartId, iStateId, pszText, iCharCount, dwTextFlags, 0, pRect);
-    }
-}
-
 HRESULT VisualStylesAPI::GetThemePartSize( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, THEMESIZE eSize, SIZE *psz )
 {
     if(lpfnGetThemePartSize)
@@ -502,12 +452,6 @@ sal_Bool ImplDrawTheme( HTHEME hTheme, HDC hDC, int iPart, int iState, RECT rc,
                     {
                         HBITMAP hbmOld = (HBITMAP)SelectObject(hdcPaint, hbm);
 
-                        // Setup the theme drawing options.
-                        DTTOPTS DttOpts;
-                        DttOpts.dwSize = sizeof(DTTOPTS);
-                        DttOpts.dwFlags = DTT_COMPOSITED | DTT_GLOWSIZE;
-                        DttOpts.iGlowSize = 8;
-
                         // Select a font.
                         LOGFONTW lgFont;
                         HFONT hFontOld = NULL;
@@ -525,10 +469,10 @@ sal_Bool ImplDrawTheme( HTHEME hTheme, HDC hDC, int iPart, int iState, RECT rc,
                         rcPaint.left = rcPaint.top = 0;
                         rcPaint.right = cx;
                         rcPaint.bottom = cy;
-                        hr = vsAPI.DrawThemeTextEx( hCompositedTheme, hdcPaint, iPart, iState,
+                        hr = vsAPI.DrawThemeText( hCompositedTheme, hdcPaint, iPart, iState,
                                 reinterpret_cast<LPCWSTR>(aStr.getStr()), -1,
                                 DT_CENTER | DT_VCENTER | DT_SINGLELINE,
-                                &rcPaint, &DttOpts );
+                                0, &rcPaint);
 
                         // Blit text to the frame.
                         BitBlt(hDC, rc.left, rc.top, cx, cy, hdcPaint, 0, 0, SRCCOPY);


More information about the Libreoffice-commits mailing list