Index: vcl/aqua/source/gdi/salnativewidgets.cxx =================================================================== RCS file: /cvs/gsl/vcl/aqua/source/gdi/Attic/salnativewidgets.cxx,v retrieving revision 1.1.2.43 diff -u -r1.1.2.43 salnativewidgets.cxx --- vcl/aqua/source/gdi/salnativewidgets.cxx 14 Jun 2007 01:49:21 -0000 1.1.2.43 +++ vcl/aqua/source/gdi/salnativewidgets.cxx 18 Jun 2007 12:33:40 -0000 @@ -57,6 +57,43 @@ * AquaGet* are helpers for native controls */ +// Helper returns an HIRect + +HIRect ImplGetHIRectFromRectangle(Rectangle aRect) +{ + HIRect aHIRect; + aHIRect.origin.x = static_cast(aRect.Left()); + aHIRect.origin.y = static_cast(aRect.Top()); + aHIRect.size.width = static_cast(aRect.Right()) - static_cast(aRect.Left() +1); + aHIRect.size.height = static_cast(aRect.Bottom()) - static_cast(aRect.Top() +1); + return aHIRect; +} + +// Helper returns a Rectangle + +Rectangle ImplGetRectangleFromHIRect( HIRect aHIRect ) +{ + Rectangle aRect; + aRect.Top() = static_cast(aHIRect.origin.y); + aRect.Left() = static_cast(aHIRect.origin.x); + aRect.Bottom() = static_cast(aHIRect.size.height) + static_cast(aHIRect.origin.y); + aRect.Right() = static_cast(aHIRect.origin.x) + static_cast(aHIRect.size.width); + return aRect; +} + +// Helper returns a QD Rect + +Rect ImplGetRectFromHIRect(HIRect aHIRect) +{ + Rect aRect; + aRect.top = static_cast(aHIRect.origin.y); + aRect.left = static_cast(aHIRect.origin.x); + aRect.right= static_cast(aHIRect.origin.x) + static_cast(aHIRect.size.width); + aRect.bottom = static_cast(aHIRect.size.height) + static_cast(aHIRect.origin.y); + return aRect; +} + + static bool isAppleScrollBarVariantDoubleMax(void) { bool isDoubleMax = true; // default is DoubleMax @@ -153,6 +190,7 @@ case CTRL_MENU_POPUP: return "MENU_POPUP"; case CTRL_STATUSBAR: return "STATUSBAR"; case CTRL_TOOLTIP: return "TOOLTIP"; + case CTRL_WINDOW_BACKGROUND: return "WINDOW_BACKGROUND"; } AquaLog( "UNKNOWN ControlType %d!\n", (int) nType); @@ -287,6 +325,12 @@ return true; break; + case CTRL_WINDOW_BACKGROUND: + if ( nPart == PART_BACKGROUND_WINDOW || + nPart == PART_BACKGROUND_DIALOG ) + return true; + break; + case CTRL_MENUBAR: // ** TO DO + CHECK IF NEEDED ** if( nPart == PART_ENTIRE_CONTROL ) return true; @@ -495,13 +539,8 @@ Rectangle buttonRect = rControlRegion.GetBoundRect(); RefreshRect( buttonRect.Left(), buttonRect.Top(), buttonRect.GetWidth(), buttonRect.GetHeight() ); - - HIRect rc; - rc.origin.x = static_cast(buttonRect.Left()); - rc.origin.y = static_cast(buttonRect.Top()); - rc.size.width = static_cast(buttonRect.Right()) - static_cast(buttonRect.Left()); - rc.size.height = static_cast(buttonRect.Bottom()) - static_cast(buttonRect.Top()); - + HIRect rc = ImplGetHIRectFromRectangle(buttonRect); + /** Scrollbar parts code equivalent ** PART_BUTTON_UP 101 PART_BUTTON_DOWN 102 @@ -548,7 +587,20 @@ bOK = true; } break; - + + case CTRL_WINDOW_BACKGROUND: + { + HIThemeBackgroundDrawInfo aThemeBackgroundInfo; + aThemeBackgroundInfo.version = 0; + aThemeBackgroundInfo.state = getState( nState ); + aThemeBackgroundInfo.kind = kThemeBrushDialogBackgroundInactive; + + HIThemeApplyBackground( &rc, &aThemeBackgroundInfo, mrContext, kHIThemeOrientationNormal); + CGContextFillRect( mrContext, rc ); + bOK = true; + } + break; + case CTRL_MENU_POPUP: { if ((nPart == PART_ENTIRE_CONTROL) || (nPart == PART_MENU_ITEM )|| (nPart == HAS_BACKGROUND_TEXTURE )) Index: vcl/inc/window.h =================================================================== RCS file: /cvs/gsl/vcl/inc/window.h,v retrieving revision 1.26 diff -u -r1.26 window.h --- vcl/inc/window.h 13 Dec 2006 15:01:10 -0000 1.26 +++ vcl/inc/window.h 18 Jun 2007 12:33:41 -0000 @@ -68,6 +68,8 @@ #include #endif +#include + #include struct SalPaintEvent; @@ -298,6 +300,7 @@ WinBits mnExtendedStyle; WinBits mnPrevExtendedStyle; WindowType mnType; + ControlPart mnNativeBackground; USHORT mnWaitCount; USHORT mnPaintFlags; USHORT mnGetFocusFlags; Index: vcl/inc/vcl/salnativewidgets.hxx =================================================================== RCS file: /cvs/gsl/vcl/inc/vcl/salnativewidgets.hxx,v retrieving revision 1.2 diff -u -r1.2 salnativewidgets.hxx --- vcl/inc/vcl/salnativewidgets.hxx 11 Apr 2007 18:07:38 -0000 1.2 +++ vcl/inc/vcl/salnativewidgets.hxx 18 Jun 2007 12:33:41 -0000 @@ -138,6 +138,9 @@ // tool tips #define CTRL_TOOLTIP 140 +// to draw the implemented theme +#define CTRL_WINDOW_BACKGROUND 150 + /* Control Parts: * * Uniquely identify a part of a control, @@ -194,6 +197,9 @@ // For scrollbars that have 3 buttons (most KDE themes) #define HAS_THREE_BUTTONS 5000 +#define PART_BACKGROUND_WINDOW 6000 +#define PART_BACKGROUND_DIALOG 6001 + /* Control State: * * Specify how a particular part of the control Index: vcl/source/gdi/outdev6.cxx =================================================================== RCS file: /cvs/gsl/vcl/source/gdi/outdev6.cxx,v retrieving revision 1.19 diff -u -r1.19 outdev6.cxx --- vcl/source/gdi/outdev6.cxx 22 May 2007 16:43:01 -0000 1.19 +++ vcl/source/gdi/outdev6.cxx 18 Jun 2007 12:33:42 -0000 @@ -80,6 +80,9 @@ #include #endif +#include +#include + // ======================================================================== DBG_NAMEEX( OutputDevice ) @@ -937,6 +940,25 @@ { if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() ) return; + + if( meOutDevType == OUTDEV_WINDOW ) + { + Window* pWindow = static_cast(this); + ControlPart aCtrlPart = pWindow->ImplGetWindowImpl()->mnNativeBackground; + if( aCtrlPart != 0 ) + { + ImplControlValue aControlValue; + Region aCtrlRegion( Rectangle( Point(), GetOutputSizePixel() ) ); + ControlState nState = 0; + + if( pWindow->IsEnabled() ) nState |= CTRL_STATE_ENABLED; + if( pWindow->DrawNativeControl( CTRL_WINDOW_BACKGROUND, aCtrlPart, aCtrlRegion, + nState, aControlValue, rtl::OUString() ) ) + { + return; + } + } + } if ( mbBackground ) { Index: vcl/source/window/dialog.cxx =================================================================== RCS file: /cvs/gsl/vcl/source/window/dialog.cxx,v retrieving revision 1.36 diff -u -r1.36 dialog.cxx --- vcl/source/window/dialog.cxx 22 Nov 2006 10:40:03 -0000 1.36 +++ vcl/source/window/dialog.cxx 18 Jun 2007 12:33:42 -0000 @@ -402,11 +402,19 @@ void Dialog::ImplInitSettings() { - // Wir haben graue Dialoge + // user override if ( IsControlBackground() ) SetBackground( GetControlBackground() ); + // NWF background + else if( IsNativeControlSupported( CTRL_WINDOW_BACKGROUND, PART_BACKGROUND_DIALOG ) ) + { + mpWindowImpl->mnNativeBackground = PART_BACKGROUND_DIALOG; + EnableChildTransparentMode( TRUE ); + } + // fallback to settings color else SetBackground( GetSettings().GetStyleSettings().GetDialogColor() ); + } // ----------------------------------------------------------------------- Index: vcl/source/window/status.cxx =================================================================== RCS file: /cvs/gsl/vcl/source/window/status.cxx,v retrieving revision 1.21 diff -u -r1.21 status.cxx --- vcl/source/window/status.cxx 17 Sep 2006 12:21:30 -0000 1.21 +++ vcl/source/window/status.cxx 18 Jun 2007 12:33:43 -0000 @@ -67,7 +67,7 @@ #ifndef _SV_VIRDEV_HXX #include #endif - +#include // ======================================================================= @@ -276,8 +276,16 @@ aColor = rStyleSettings.GetFaceColor(); else aColor = rStyleSettings.GetWindowColor(); - SetBackground( aColor ); - mpImplData->mpVirDev->SetBackground( GetBackground() ); + SetBackground( aColor ); + mpImplData->mpVirDev->SetBackground( GetBackground() ); + + // NWF background + if( ! IsControlBackground() && + IsNativeControlSupported( CTRL_WINDOW_BACKGROUND, PART_BACKGROUND_WINDOW ) ) + { + ImplGetWindowImpl()->mnNativeBackground = PART_BACKGROUND_WINDOW; + EnableChildTransparentMode( TRUE ); + } } } Index: vcl/source/window/window.cxx =================================================================== RCS file: /cvs/gsl/vcl/source/window/window.cxx,v retrieving revision 1.248.2.8 diff -u -r1.248.2.8 window.cxx --- vcl/source/window/window.cxx 7 Jun 2007 13:07:10 -0000 1.248.2.8 +++ vcl/source/window/window.cxx 18 Jun 2007 12:33:46 -0000 @@ -186,6 +186,7 @@ #include #endif +#include #include #include #include @@ -739,6 +740,7 @@ mpWindowImpl->mbSuppressAccessibilityEvents = FALSE; // TRUE: do not send any accessibility events mpWindowImpl->mbDrawSelectionBackground = FALSE; // TRUE: draws transparent window background to indicate (toolbox) selection mpWindowImpl->mbIsInTaskPaneList = FALSE; // TRUE: window was added to the taskpanelist in the topmost system window + mpWindowImpl->mnNativeBackground = 0; // initialize later, depends on type mbEnableRTL = TRUE; // TRUE: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active }