diff options
Diffstat (limited to 'vcl')
31 files changed, 862 insertions, 605 deletions
diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h index d83067cb64b8..247de1b95dec 100644 --- a/vcl/aqua/inc/salgdi.h +++ b/vcl/aqua/inc/salgdi.h @@ -230,15 +230,15 @@ public: CGPoint* makeCGptArray(ULONG nPoints, const SalPoint* pPtAry); // native widget rendering methods that require mirroring virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, - const Point& aPos, SalControlHandle& rControlHandle, BOOL& rIsInside ); + const Point& aPos, BOOL& rIsInside ); virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, - ControlState nState, const ImplControlValue& aValue, SalControlHandle& rControlHandle, + ControlState nState, const ImplControlValue& aValue, const rtl::OUString& aCaption ); virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const rtl::OUString& aCaption ); + const rtl::OUString& aCaption ); virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, const rtl::OUString& aCaption, + const ImplControlValue& aValue, const rtl::OUString& aCaption, Region &rNativeBoundingRegion, Region &rNativeContentRegion ); // get device resolution diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx index b4b843eaca58..5eccf88dc523 100644 --- a/vcl/aqua/source/gdi/salnativewidgets.cxx +++ b/vcl/aqua/source/gdi/salnativewidgets.cxx @@ -380,7 +380,7 @@ BOOL AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n * nType/nPart combination. */ BOOL AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, - const Point& rPos, SalControlHandle& rControlHandle, BOOL& rIsInside ) + const Point& rPos, BOOL& rIsInside ) { if ( nType == CTRL_SCROLLBAR ) { @@ -468,7 +468,6 @@ UInt32 AquaSalGraphics::getTrackState( ControlState nState ) * * rControlRegion: The bounding region of the complete control in VCL frame coordinates. * aValue: An optional value (tristate/numerical/string) - * rControlHandle: Carries platform dependent data and is maintained by the AquaSalGraphics implementation. * aCaption: A caption or title string (like button text etc) */ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, @@ -476,7 +475,6 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, const Region& rControlRegion, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const rtl::OUString& aCaption ) { BOOL bOK = FALSE; @@ -1226,12 +1224,11 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, * * rControlRegion: The bounding region of the complete control in VCL frame coordinates. * aValue: An optional value (tristate/numerical/string) - * rControlHandle: Carries platform dependent data and is maintained by the AquaSalGraphics implementation. * aCaption: A caption or title string (like button text etc) */ BOOL AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const rtl::OUString& aCaption ) + const rtl::OUString& aCaption ) { return( FALSE ); } @@ -1248,11 +1245,10 @@ BOOL AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPar * * rControlRegion: The bounding region of the control in VCL frame coordinates. * aValue: An optional value (tristate/numerical/string) - * rControlHandle: Carries platform dependent data and is maintained by the AquaSalGraphics implementation. * aCaption: A caption or title string (like button text etc) */ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, const rtl::OUString& aCaption, + const ImplControlValue& aValue, const rtl::OUString& aCaption, Region &rNativeBoundingRegion, Region &rNativeContentRegion ) { diff --git a/vcl/inc/vcl/dockwin.hxx b/vcl/inc/vcl/dockwin.hxx index 3a1dca044bb7..61464400d595 100644 --- a/vcl/inc/vcl/dockwin.hxx +++ b/vcl/inc/vcl/dockwin.hxx @@ -152,7 +152,7 @@ public: void Unlock(); BOOL IsLocked() const; - void StartPopupMode( ToolBox* pParentToolBox ); + void StartPopupMode( ToolBox* pParentToolBox, ULONG nPopupModeFlags ); BOOL IsInPopupMode() const; void TitleButtonClick( USHORT nButton ); @@ -234,7 +234,10 @@ public: BOOL IsLocked( const Window *pWin ); void StartPopupMode( ToolBox *pParentToolBox, const Window *pWin ); + void StartPopupMode( ToolBox *pParentToolBox, const Window *pWin, ULONG nPopupModeFlags ); + BOOL IsInPopupMode( const Window *pWin ); + void EndPopupMode( const Window *pWin ); // required because those methods are not virtual in Window (!!!) and must // be availbale from the toolkit diff --git a/vcl/inc/vcl/graphite_cache.hxx b/vcl/inc/vcl/graphite_cache.hxx index eba5109c7446..5472b32dd62f 100644 --- a/vcl/inc/vcl/graphite_cache.hxx +++ b/vcl/inc/vcl/graphite_cache.hxx @@ -127,7 +127,7 @@ public: } m_segMap.clear(); }; - GrSegRecord * getSegment(ImplLayoutArgs & layoutArgs, bool bIsRtl) + GrSegRecord * getSegment(ImplLayoutArgs & layoutArgs, bool bIsRtl, int segCharLimit) { GrSegRecord * found = NULL; // try to find a segment starting at correct place, if not, try to find a @@ -152,8 +152,6 @@ public: if (found->m_seg->startCharacter() <= layoutArgs.mnMinCharPos && found->m_seg->stopCharacter() >= layoutArgs.mnEndCharPos) { - const size_t seg_char_limit = min(layoutArgs.mnLength, layoutArgs.mnEndCharPos - + GraphiteLayout::EXTRA_CONTEXT_LENGTH); DBG_ASSERT(found && found->m_seg, "null entry in GraphiteSegmentCache"); // restore original start character, in case it has changed found->m_seg->setTextSourceOffset(found->m_startChar); @@ -161,7 +159,7 @@ public: // interest // We could use substr and ==, but substr does a copy, // so its probably faster to do it like this - for (size_t i = layoutArgs.mnMinCharPos; i < seg_char_limit; i++) + for (int i = layoutArgs.mnMinCharPos; i < segCharLimit; i++) { //if (!found->m_rope->match(rtl::OUString(layoutArgs.mpStr[i], layoutArgs.mnLength), i - found->m_seg->startCharacter())) if (found->m_rope->getStr()[i-found->m_seg->startCharacter()] != layoutArgs.mpStr[i]) @@ -171,6 +169,15 @@ public: { return NULL; } + if (found->m_seg->stopCharacter() > layoutArgs.mnEndCharPos && + static_cast<int>(found->char2BaseGlyph().size()) > layoutArgs.mnEndCharPos) + { + // check that the requested end character isn't mid cluster + if (found->char2BaseGlyph()[layoutArgs.mnEndCharPos-layoutArgs.mnMinCharPos] == -1) + { + return NULL; + } + } // if (found->m_lockCount != 0) // OutputDebugString("Multple users of SegRecord!"); found->m_lockCount++; @@ -183,10 +190,8 @@ public: // this is expecially needed when editing a large paragraph // each edit changes the pointers, but if we don't reuse any segments it gets very // slow. - const size_t seg_char_limit = min(layoutArgs.mnLength, layoutArgs.mnEndCharPos - + GraphiteLayout::EXTRA_CONTEXT_LENGTH); rtl::OUString * rope = new rtl::OUString(layoutArgs.mpStr + layoutArgs.mnMinCharPos, - seg_char_limit - layoutArgs.mnMinCharPos); + segCharLimit - layoutArgs.mnMinCharPos); if (!rope) return NULL; size_t nHash = (*(rope)).hashCode(); GrRMEntry range = m_ropeMap.equal_range(nHash); diff --git a/vcl/inc/vcl/graphite_layout.hxx b/vcl/inc/vcl/graphite_layout.hxx index 1fbb11211ca0..520f4620cd90 100644 --- a/vcl/inc/vcl/graphite_layout.hxx +++ b/vcl/inc/vcl/graphite_layout.hxx @@ -75,6 +75,14 @@ namespace grutils { class GrFeatureParser; } class VCL_DLLPUBLIC GraphiteLayout : public SalLayout { public: + // Mask to allow Word break status to be stored within mvChar2BaseGlyph + enum { + WORD_BREAK_BEFORE = 0x40000000, + HYPHEN_BREAK_BEFORE = 0x80000000, + BREAK_MASK = 0xC0000000, + GLYPH_INDEX_MASK = 0x3FFFFFFF + } LineBreakMask; + class Glyphs : public std::vector<GlyphItem> { public: @@ -159,6 +167,7 @@ private: std::pair<int,int> glyph_to_chars(const GlyphItem &) const; std::pair<long,long> caret_positions(size_t) const; + void expandOrCondense(ImplLayoutArgs &rArgs); }; diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx index 70c1e6aa624d..9b748f2b5937 100644 --- a/vcl/inc/vcl/outdev.hxx +++ b/vcl/inc/vcl/outdev.hxx @@ -39,6 +39,7 @@ #include <vcl/mapmod.hxx> #include <vcl/wall.hxx> #include <vcl/settings.hxx> +#include <vcl/salnativewidgets.hxx> #include <tools/poly.hxx> #include <basegfx/vector/b2enums.hxx> #include <com/sun/star/uno/Reference.h> @@ -1177,6 +1178,49 @@ public: BitmapEx GetDownsampledBitmapEx( const Size& rDstSz, const Point& rSrcPt, const Size& rSrcSz, const BitmapEx& rBmpEx, long nMaxBmpDPIX, long nMaxBmpDPIY ); + + //------------------------------------- + // 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 ); + + // Query the native control to determine if it was acted upon + BOOL HitTestNativeControl( ControlType nType, + ControlPart nPart, + const Region& rControlRegion, + const Point& aPos, + BOOL& rIsInside ); + + // Request rendering of a particular control and/or part + BOOL DrawNativeControl( ControlType nType, + ControlPart nPart, + const Region& rControlRegion, + ControlState nState, + const ImplControlValue& aValue, + ::rtl::OUString aCaption ); + + // Request rendering of a caption string for a control + BOOL DrawNativeControlText( ControlType nType, + ControlPart nPart, + const Region& rControlRegion, + ControlState nState, + const ImplControlValue& aValue, + ::rtl::OUString aCaption ); + + // Query the native control's actual drawing region (including adornment) + BOOL GetNativeControlRegion( ControlType nType, + ControlPart nPart, + const Region& rControlRegion, + ControlState nState, + const ImplControlValue& aValue, + ::rtl::OUString aCaption, + Region &rNativeBoundingRegion, + Region &rNativeContentRegion ); + }; #endif // _SV_OUTDEV_HXX diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx index 02e9efbc0f94..510e797678b0 100644 --- a/vcl/inc/vcl/salgdi.hxx +++ b/vcl/inc/vcl/salgdi.hxx @@ -159,15 +159,15 @@ protected: // native widget rendering methods that require mirroring virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, - const Point& aPos, SalControlHandle& rControlHandle, BOOL& rIsInside ); + const Point& aPos, BOOL& rIsInside ); virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, - ControlState nState, const ImplControlValue& aValue, SalControlHandle& rControlHandle, + ControlState nState, const ImplControlValue& aValue, const rtl::OUString& aCaption ); virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const rtl::OUString& aCaption ); + const rtl::OUString& aCaption ); virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, const rtl::OUString& aCaption, + const ImplControlValue& aValue, const rtl::OUString& aCaption, Region &rNativeBoundingRegion, Region &rNativeContentRegion ); /** Render bitmap with alpha channel @@ -442,7 +442,6 @@ public: ControlPart nPart, const Region& rControlRegion, const Point& aPos, - SalControlHandle& rControlHandle, BOOL& rIsInside, const OutputDevice *pOutDev ); @@ -452,7 +451,6 @@ public: const Region& rControlRegion, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const rtl::OUString& aCaption, const OutputDevice *pOutDev ); @@ -462,7 +460,6 @@ public: const Region& rControlRegion, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const rtl::OUString& aCaption, const OutputDevice *pOutDev ); @@ -472,7 +469,6 @@ public: const Region& rControlRegion, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const rtl::OUString& aCaption, Region &rNativeBoundingRegion, Region &rNativeContentRegion, diff --git a/vcl/inc/vcl/vclevent.hxx b/vcl/inc/vcl/vclevent.hxx index fcf1d2ee0387..8ccb880fce34 100644 --- a/vcl/inc/vcl/vclevent.hxx +++ b/vcl/inc/vcl/vclevent.hxx @@ -154,8 +154,8 @@ namespace com { namespace sun { namespace star { #define VCLEVENT_TOOLBOX_FORMATCHANGED 1172 // request new layout #define VCLEVENT_COMBOBOX_SETTEXT 1173 // --> OD 2009-04-01 #i92103# -#define VCLEVENT_LISTBOX_ENTRY_EXPANDED 1174 -#define VCLEVENT_LISTBOX_ENTRY_COLLAPSED 1175 +#define VCLEVENT_ITEM_EXPANDED 1174 +#define VCLEVENT_ITEM_COLLAPSED 1175 // <-- #define VCLEVENT_DROPDOWN_PRE_OPEN 1176 diff --git a/vcl/inc/vcl/window.h b/vcl/inc/vcl/window.h index 9d917a09b6de..691c3ed18421 100644 --- a/vcl/inc/vcl/window.h +++ b/vcl/inc/vcl/window.h @@ -56,7 +56,6 @@ class VirtualDevice; class Cursor; class ImplDevFontList; class ImplFontCache; -class SalControlHandle; class SmartId; class VCLXWindow; class SalFrame; @@ -120,7 +119,6 @@ struct ImplWinData USHORT mnTrackFlags; USHORT mnIsTopWindow; BOOL mbMouseOver; // tracks mouse over for native widget paint effect - SalControlHandle* mpSalControlHandle; // native data for NWF BOOL mbEnableNativeWidget; // toggle native widget rendering SmartId* mpSmartHelpId; SmartId* mpSmartUniqueId; diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx index 3d1cc91ee468..8264767e59ad 100644 --- a/vcl/inc/vcl/window.hxx +++ b/vcl/inc/vcl/window.hxx @@ -124,6 +124,8 @@ namespace dnd { namespace vcl { struct ControlLayoutData; } +namespace svt { class PopupWindowControllerImpl; } + // --------------- // - WindowTypes - // --------------- @@ -362,6 +364,8 @@ class VCL_DLLPUBLIC Window : public OutputDevice friend class ImplPopupFloatWin; friend class MenuFloatingWindow; + friend class svt::PopupWindowControllerImpl; + private: // NOTE: to remove many dependencies of other modules // to this central file, all members are now hidden @@ -548,20 +552,18 @@ public: SAL_DLLPRIVATE ::std::vector<Window *>& ImplGetOwnerDrawList(); SAL_DLLPRIVATE Window* ImplGetTopmostFrameWindow(); - SAL_DLLPRIVATE Rectangle ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bClientOnly ); + SAL_DLLPRIVATE Rectangle ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bClientOnly ) const; SAL_DLLPRIVATE void ImplNotifyIconifiedState( BOOL bIconified ); SAL_DLLPRIVATE bool ImplStopDnd(); SAL_DLLPRIVATE void ImplStartDnd(); SAL_DLLPRIVATE static void ImplInitAppFontData( Window* pWindow ); - SAL_DLLPRIVATE void ImplInitSalControlHandle(); SAL_DLLPRIVATE void ImplPaintToDevice( OutputDevice* pTargetOutDev, const Point& rPos ); SAL_DLLPRIVATE BOOL ImplIsInTaskPaneList(); SAL_DLLPRIVATE void ImplIsInTaskPaneList( BOOL mbIsInTaskList ); SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvas > ImplGetCanvas( const Size& rFullscreenSize, bool bFullscreen, bool bSpriteCanvas ) const; - SAL_DLLPRIVATE void ImplMoveControlValue( ControlType, const ImplControlValue&, const Point& ) const; private: // Default construction is forbidden and not implemented. @@ -856,9 +858,9 @@ public: Point AbsoluteScreenToOutputPixel( const Point& rPos ) const; Rectangle GetDesktopRectPixel() const; // window extents including border and decoratrion - Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ); + Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const; // window extents of the client window, coordinates to be used in SetPosPixel - Rectangle GetClientWindowExtentsRelative( Window *pRelativeWindow ); + Rectangle GetClientWindowExtentsRelative( Window *pRelativeWindow ) const; virtual BOOL IsScrollable() const; virtual void Scroll( long nHorzScroll, long nVertScroll, @@ -1092,44 +1094,6 @@ public: void EnableNativeWidget( BOOL bEnable = TRUE ); BOOL IsNativeWidgetEnabled() const; - // These all just call through to the private mpWindowImpl->mpFrame functions of the same name. - - // Query the platform layer for control support - BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart ); - - // Query the native control to determine if it was acted upon - BOOL HitTestNativeControl( ControlType nType, - ControlPart nPart, - const Region& rControlRegion, - const Point& aPos, - BOOL& rIsInside ); - - // Request rendering of a particular control and/or part - BOOL DrawNativeControl( ControlType nType, - ControlPart nPart, - const Region& rControlRegion, - ControlState nState, - const ImplControlValue& aValue, - rtl::OUString aCaption ); - - // Request rendering of a caption string for a control - BOOL DrawNativeControlText( ControlType nType, - ControlPart nPart, - const Region& rControlRegion, - ControlState nState, - const ImplControlValue& aValue, - rtl::OUString aCaption ); - - // Query the native control's actual drawing region (including adornment) - BOOL GetNativeControlRegion( ControlType nType, - ControlPart nPart, - const Region& rControlRegion, - ControlState nState, - const ImplControlValue& aValue, - rtl::OUString aCaption, - Region &rNativeBoundingRegion, - Region &rNativeContentRegion ); - // a helper method for a Control's Draw method void PaintToDevice( OutputDevice* pDevice, const Point& rPos, const Size& rSize ); diff --git a/vcl/os2/inc/salgdi.h b/vcl/os2/inc/salgdi.h index ce486084a5b1..b8dc4eba0199 100644 --- a/vcl/os2/inc/salgdi.h +++ b/vcl/os2/inc/salgdi.h @@ -197,15 +197,15 @@ protected: #if 0 // native widget rendering methods that require mirroring virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, - const Point& aPos, SalControlHandle& rControlHandle, BOOL& rIsInside ); + const Point& aPos, BOOL& rIsInside ); virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, - ControlState nState, const ImplControlValue& aValue, SalControlHandle& rControlHandle, + ControlState nState, const ImplControlValue& aValue, rtl::OUString aCaption ); virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, rtl::OUString aCaption ); + rtl::OUString aCaption ); virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, rtl::OUString aCaption, + const ImplControlValue& aValue, rtl::OUString aCaption, Region &rNativeBoundingRegion, Region &rNativeContentRegion ); #endif diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index cd74a4cd88ce..ebccfdc1e6bb 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -741,6 +741,13 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry ) aMetrics.nEntryHeight ); } + if ( !aMetrics.bText && !aMetrics.bImage && !IsUserDrawEnabled() ) + { + // entries which have no (aka an empty) text, and no image, and are not user-drawn, should be + // shown nonetheless + aMetrics.nEntryHeight = mnTextHeight + mnBorder; + } + if ( aMetrics.nEntryWidth > mnMaxWidth ) mnMaxWidth = aMetrics.nEntryWidth; if ( aMetrics.nEntryHeight > mnMaxHeight ) diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 89fbe6d3db78..95f84626b582 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -408,6 +408,9 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth ) if( aImageSize.Height() > aSize.Height() ) aSize.Height() = aImageSize.Height(); + aSize.Width() += TAB_TABOFFSET_X*2; + aSize.Height() += TAB_TABOFFSET_Y*2; + Region aCtrlRegion( Rectangle( (const Point&)Point( 0, 0 ), aSize ) ); Region aBoundingRgn, aContentRgn; const ImplControlValue aControlValue( BUTTONVALUE_DONTKNOW, rtl::OUString(), 0 ); @@ -419,8 +422,6 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth ) return aCont.GetSize(); } - aSize.Width() += TAB_TABOFFSET_X*2; - aSize.Height() += TAB_TABOFFSET_Y*2; // For systems without synthetic bold support if ( mbExtraSpace ) aSize.Width() += TAB_EXTRASPACE_X; diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx index e3f63a03d081..e79308b2664e 100644 --- a/vcl/source/gdi/image.cxx +++ b/vcl/source/gdi/image.cxx @@ -50,6 +50,10 @@ #include <vcl/image.h> #include <vcl/image.hxx> +#if OSL_DEBUG_LEVEL > 0 +#include <rtl/strbuf.hxx> +#endif + DBG_NAME( Image ) DBG_NAME( ImageList ) @@ -543,11 +547,19 @@ void ImageAryData::Load(const rtl::OUString &rPrefix) rtl::OUString aFileName = rPrefix; aFileName += maName; -#ifdef DBG_UTIL - bool bSuccess = aImageTree->loadImage( aFileName, aSymbolsStyle, maBitmapEx, true ); - DBG_ASSERT (bSuccess, "ImageAryData::Failed to load image"); -#else - aImageTree->loadImage( aFileName, aSymbolsStyle, maBitmapEx, true ); +#if OSL_DEBUG_LEVEL > 0 + bool bSuccess = +#endif + aImageTree->loadImage( aFileName, aSymbolsStyle, maBitmapEx, true ); +#if OSL_DEBUG_LEVEL > 0 + if ( !bSuccess ) + { + ::rtl::OStringBuffer aMessage; + aMessage.append( "ImageAryData::Load: failed to load image '" ); + aMessage.append( ::rtl::OUStringToOString( aFileName, RTL_TEXTENCODING_UTF8 ).getStr() ); + aMessage.append( "'" ); + OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() ); + } #endif } diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk index 75f2b3fffc64..f069828f25f9 100644 --- a/vcl/source/gdi/makefile.mk +++ b/vcl/source/gdi/makefile.mk @@ -106,6 +106,7 @@ SLOFILES= $(EXCEPTIONSFILES) \ $(SLO)$/outdev4.obj \ $(SLO)$/outdev5.obj \ $(SLO)$/outdev6.obj \ + $(SLO)$/outdevnative.obj \ $(SLO)$/regband.obj \ $(SLO)$/region.obj \ $(SLO)$/wall.obj \ diff --git a/vcl/source/gdi/outdevnative.cxx b/vcl/source/gdi/outdevnative.cxx new file mode 100644 index 000000000000..fed41ec4de85 --- /dev/null +++ b/vcl/source/gdi/outdevnative.cxx @@ -0,0 +1,290 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_vcl.hxx" + +#include "vcl/outdev.hxx" +#include "vcl/window.hxx" +#include "vcl/salgdi.hxx" +#include "vcl/salnativewidgets.hxx" +#include "vcl/pdfextoutdevdata.hxx" + +// ----------------------------------------------------------------------- + +static bool lcl_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; + } +} + +// ----------------------------------------------------------------------- +// 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 ) +{ + if( !lcl_enableNativeWidget( *this ) ) + return FALSE; + + if ( !mpGraphics ) + if ( !ImplGetGraphics() ) + return FALSE; + + return( mpGraphics->IsNativeControlSupported(nType, nPart) ); +} + + +// ----------------------------------------------------------------------- + +BOOL OutputDevice::HitTestNativeControl( ControlType nType, + ControlPart nPart, + const Region& rControlRegion, + const Point& aPos, + BOOL& rIsInside ) +{ + if( !lcl_enableNativeWidget( *this ) ) + return FALSE; + + if ( !mpGraphics ) + if ( !ImplGetGraphics() ) + return FALSE; + + Point aWinOffs( mnOutOffX, mnOutOffY ); + Region screenRegion( rControlRegion ); + screenRegion.Move( aWinOffs.X(), aWinOffs.Y()); + + return( mpGraphics->HitTestNativeControl(nType, nPart, screenRegion, Point( aPos.X() + mnOutOffX, aPos.Y() + mnOutOffY ), + rIsInside, this ) ); +} + +// ----------------------------------------------------------------------- + +static void lcl_moveControlValue( ControlType nType, const ImplControlValue& aValue, const Point& rDelta ) +{ + if( aValue.getOptionalVal() ) + { + switch( nType ) + { + case CTRL_SLIDER: + { + SliderValue* pSlVal = reinterpret_cast<SliderValue*>(aValue.getOptionalVal()); + pSlVal->maThumbRect.Move( rDelta.X(), rDelta.Y() ); + } + break; + case CTRL_SCROLLBAR: + { + ScrollbarValue* pScVal = reinterpret_cast<ScrollbarValue*>(aValue.getOptionalVal()); + pScVal->maThumbRect.Move( rDelta.X(), rDelta.Y() ); + pScVal->maButton1Rect.Move( rDelta.X(), rDelta.Y() ); + pScVal->maButton2Rect.Move( rDelta.X(), rDelta.Y() ); + } + break; + case CTRL_SPINBOX: + case CTRL_SPINBUTTONS: + { + SpinbuttonValue* pSpVal = reinterpret_cast<SpinbuttonValue*>(aValue.getOptionalVal()); + pSpVal->maUpperRect.Move( rDelta.X(), rDelta.Y() ); + pSpVal->maLowerRect.Move( rDelta.X(), rDelta.Y() ); + } + break; + case CTRL_TOOLBAR: + { + ToolbarValue* pTVal = reinterpret_cast<ToolbarValue*>(aValue.getOptionalVal()); + pTVal->maGripRect.Move( rDelta.X(), rDelta.Y() ); + } + break; + } + } +} + +BOOL OutputDevice::DrawNativeControl( ControlType nType, + ControlPart nPart, + const Region& rControlRegion, + ControlState nState, + const ImplControlValue& aValue, + ::rtl::OUString aCaption ) +{ + if( !lcl_enableNativeWidget( *this ) ) + return FALSE; + + /* + if( !IsInPaint() && IsPaintTransparent() ) + { + // only required if called directly (ie, we're not in Paint() ): + // force redraw (Paint()) for transparent controls + // to trigger a repaint of the background + Region aClipRgn( GetClipRegion() ); + if( !rControlRegion.IsEmpty() ) + aClipRgn.Intersect( rControlRegion ); + Invalidate( aClipRgn, INVALIDATE_UPDATE ); + return TRUE; + } + */ + + // make sure the current clip region is initialized correctly + if ( !mpGraphics ) + if ( !ImplGetGraphics() ) + return FALSE; + + if ( mbInitClipRegion ) + ImplInitClipRegion(); + if ( mbOutputClipped ) + return TRUE; + + if ( mbInitLineColor ) + ImplInitLineColor(); + if ( mbInitFillColor ) + ImplInitFillColor(); + + // Convert the coordinates from relative to Window-absolute, so we draw + // in the correct place in platform code + Point aWinOffs( mnOutOffX, mnOutOffY ); + Region screenRegion( rControlRegion ); + screenRegion.Move( aWinOffs.X(), aWinOffs.Y()); + + // do so for ImplControlValue members, also + lcl_moveControlValue( nType, aValue, aWinOffs ); + + Region aTestRegion( GetActiveClipRegion() ); + aTestRegion.Intersect( rControlRegion ); + if( aTestRegion == rControlRegion ) + nState |= CTRL_CACHING_ALLOWED; // control is not clipped, caching allowed + + BOOL bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, aValue, aCaption, this ); + + // transform back ImplControlValue members + lcl_moveControlValue( nType, aValue, Point()-aWinOffs ); + + return bRet; +} + + +// ----------------------------------------------------------------------- + +BOOL OutputDevice::DrawNativeControlText(ControlType nType, + ControlPart nPart, + const Region& rControlRegion, + ControlState nState, + const ImplControlValue& aValue, + ::rtl::OUString aCaption ) +{ + if( !lcl_enableNativeWidget( *this ) ) + return FALSE; + + // make sure the current clip region is initialized correctly + if ( !mpGraphics ) + if ( !ImplGetGraphics() ) + return false; + + if ( mbInitClipRegion ) + ImplInitClipRegion(); + if ( mbOutputClipped ) + return true; + + if ( mbInitLineColor ) + ImplInitLineColor(); + if ( mbInitFillColor ) + ImplInitFillColor(); + + // Convert the coordinates from relative to Window-absolute, so we draw + // in the correct place in platform code + Point aWinOffs( mnOutOffX, mnOutOffY ); + Region screenRegion( rControlRegion ); + screenRegion.Move( aWinOffs.X(), aWinOffs.Y()); + lcl_moveControlValue( nType, aValue, aWinOffs ); + + BOOL bRet = mpGraphics->DrawNativeControlText(nType, nPart, screenRegion, nState, aValue, aCaption, this ); + + // transform back ImplControlValue members + lcl_moveControlValue( nType, aValue, Point()-aWinOffs ); + + return bRet; +} + + +// ----------------------------------------------------------------------- + +BOOL OutputDevice::GetNativeControlRegion( ControlType nType, + ControlPart nPart, + const Region& rControlRegion, + ControlState nState, + const ImplControlValue& aValue, + ::rtl::OUString aCaption, + Region &rNativeBoundingRegion, + Region &rNativeContentRegion ) +{ + if( !lcl_enableNativeWidget( *this ) ) + return FALSE; + + if ( !mpGraphics ) + if ( !ImplGetGraphics() ) + return FALSE; + + // Convert the coordinates from relative to Window-absolute, so we draw + // in the correct place in platform code + Point aWinOffs( mnOutOffX, mnOutOffY ); + Region screenRegion( rControlRegion ); + screenRegion.Move( aWinOffs.X(), aWinOffs.Y()); + lcl_moveControlValue( nType, aValue, aWinOffs ); + + BOOL bRet = mpGraphics->GetNativeControlRegion(nType, nPart, screenRegion, nState, aValue, + aCaption, rNativeBoundingRegion, + rNativeContentRegion, this ); + if( bRet ) + { + // transform back native regions + rNativeBoundingRegion.Move( -aWinOffs.X(), -aWinOffs.Y() ); + rNativeContentRegion.Move( -aWinOffs.X(), -aWinOffs.Y() ); + } + // transform back ImplControlValue members + lcl_moveControlValue( nType, aValue, Point()-aWinOffs ); + + return bRet; +} + + diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 55d6f7bdd892..84e45979d679 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -669,7 +669,7 @@ BOOL SalGraphics::DrawEPS( long nX, long nY, long nWidth, long nHeight, void* } BOOL SalGraphics::HitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, - const Point& aPos, SalControlHandle& rControlHandle, BOOL& rIsInside, const OutputDevice *pOutDev ) + const Point& aPos, BOOL& rIsInside, const OutputDevice *pOutDev ) { if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) ) { @@ -677,10 +677,10 @@ BOOL SalGraphics::HitTestNativeControl( ControlType nType, ControlPart nPart, co Region rgn( rControlRegion ); mirror( pt.X(), pOutDev ); mirror( rgn, pOutDev ); - return hitTestNativeControl( nType, nPart, rgn, pt, rControlHandle, rIsInside ); + return hitTestNativeControl( nType, nPart, rgn, pt, rIsInside ); } else - return hitTestNativeControl( nType, nPart, rControlRegion, aPos, rControlHandle, rIsInside ); + return hitTestNativeControl( nType, nPart, rControlRegion, aPos, rIsInside ); } void SalGraphics::mirror( ControlType nType, const ImplControlValue& rVal, const OutputDevice* pOutDev, bool bBack ) const @@ -722,7 +722,7 @@ void SalGraphics::mirror( ControlType nType, const ImplControlValue& rVal, const } BOOL SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, - ControlState nState, const ImplControlValue& aValue, SalControlHandle& rControlHandle, + ControlState nState, const ImplControlValue& aValue, const OUString& aCaption, const OutputDevice *pOutDev ) { if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) ) @@ -730,33 +730,33 @@ BOOL SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const Region rgn( rControlRegion ); mirror( rgn, pOutDev ); mirror( nType, aValue, pOutDev ); - BOOL bRet = drawNativeControl( nType, nPart, rgn, nState, aValue, rControlHandle, aCaption ); + BOOL bRet = drawNativeControl( nType, nPart, rgn, nState, aValue, aCaption ); mirror( nType, aValue, pOutDev, true ); return bRet; } else - return drawNativeControl( nType, nPart, rControlRegion, nState, aValue, rControlHandle, aCaption ); + return drawNativeControl( nType, nPart, rControlRegion, nState, aValue, aCaption ); } BOOL SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& aCaption, const OutputDevice *pOutDev ) + const OUString& aCaption, const OutputDevice *pOutDev ) { if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) ) { Region rgn( rControlRegion ); mirror( rgn, pOutDev ); mirror( nType, aValue, pOutDev ); - BOOL bRet = drawNativeControlText( nType, nPart, rgn, nState, aValue, rControlHandle, aCaption ); + BOOL bRet = drawNativeControlText( nType, nPart, rgn, nState, aValue, aCaption ); mirror( nType, aValue, pOutDev, true ); return bRet; } else - return drawNativeControlText( nType, nPart, rControlRegion, nState, aValue, rControlHandle, aCaption ); + return drawNativeControlText( nType, nPart, rControlRegion, nState, aValue, aCaption ); } BOOL SalGraphics::GetNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, const OUString& aCaption, + const ImplControlValue& aValue, const OUString& aCaption, Region &rNativeBoundingRegion, Region &rNativeContentRegion, const OutputDevice *pOutDev ) { if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) ) @@ -764,7 +764,7 @@ BOOL SalGraphics::GetNativeControlRegion( ControlType nType, ControlPart nPart, Region rgn( rControlRegion ); mirror( rgn, pOutDev ); mirror( nType, aValue, pOutDev ); - if( getNativeControlRegion( nType, nPart, rgn, nState, aValue, rControlHandle, aCaption, + if( getNativeControlRegion( nType, nPart, rgn, nState, aValue, aCaption, rNativeBoundingRegion, rNativeContentRegion ) ) { mirror( rNativeBoundingRegion, pOutDev, true ); @@ -779,7 +779,7 @@ BOOL SalGraphics::GetNativeControlRegion( ControlType nType, ControlPart nPart, } } else - return getNativeControlRegion( nType, nPart, rControlRegion, nState, aValue, rControlHandle, aCaption, + return getNativeControlRegion( nType, nPart, rControlRegion, nState, aValue, aCaption, rNativeBoundingRegion, rNativeContentRegion ); } diff --git a/vcl/source/gdi/salnativewidgets-none.cxx b/vcl/source/gdi/salnativewidgets-none.cxx index 8b87f142ba25..7faf12d062fe 100644 --- a/vcl/source/gdi/salnativewidgets-none.cxx +++ b/vcl/source/gdi/salnativewidgets-none.cxx @@ -60,7 +60,6 @@ BOOL SalGraphics::hitTestNativeControl( ControlType, ControlPart, const Region&, const Point&, - SalControlHandle&, BOOL& ) { return( FALSE ); @@ -74,7 +73,6 @@ BOOL SalGraphics::hitTestNativeControl( ControlType, * * rControlRegion: The bounding region of the complete control in VCL frame coordinates. * aValue: An optional value (tristate/numerical/string) - * rControlHandle: Carries platform dependent data and is maintained by the SalFrame implementation. * aCaption: A caption or title string (like button text etc) */ BOOL SalGraphics::drawNativeControl( ControlType, @@ -82,7 +80,6 @@ BOOL SalGraphics::drawNativeControl( ControlType, const Region&, ControlState, const ImplControlValue&, - SalControlHandle&, const OUString& ) { return( FALSE ); @@ -97,7 +94,6 @@ BOOL SalGraphics::drawNativeControl( ControlType, * * rControlRegion: The bounding region of the complete control in VCL frame coordinates. * aValue: An optional value (tristate/numerical/string) - * rControlHandle: Carries platform dependent data and is maintained by the SalFrame implementation. * aCaption: A caption or title string (like button text etc) */ BOOL SalGraphics::drawNativeControlText( ControlType, @@ -105,7 +101,6 @@ BOOL SalGraphics::drawNativeControlText( ControlType, const Region&, ControlState, const ImplControlValue&, - SalControlHandle&, const OUString& ) { return( FALSE ); @@ -123,7 +118,6 @@ BOOL SalGraphics::drawNativeControlText( ControlType, * * rControlRegion: The bounding region of the control in VCL frame coordinates. * aValue: An optional value (tristate/numerical/string) - * rControlHandle: Carries platform dependent data and is maintained by the SalFrame implementation. * aCaption: A caption or title string (like button text etc) */ BOOL SalGraphics::getNativeControlRegion( ControlType, @@ -131,7 +125,6 @@ BOOL SalGraphics::getNativeControlRegion( ControlType, const Region&, ControlState, const ImplControlValue&, - SalControlHandle&, const OUString&, Region &, Region & ) diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index 6e75d1fde868..ff2fd8f306b1 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -353,6 +353,46 @@ std::pair<float,float> GraphiteLayout::Glyphs::appendCluster(gr::Segment & rSeg, assert(size() < rGlyph2Char.size()); rChar2Base[nFirstCharInCluster-rArgs.mnMinCharPos] = size(); rGlyph2Char[size()] = nFirstCharInCluster; + + // can we break before this cluster? + // Glyphs may have either a positive or negative breakWeight refering to + // the position after or before the glyph respectively + int nPrevBreakWeight = 0; + if (nFirstGlyphInCluster > 0) + { + nPrevBreakWeight = (iGlyphs.first + (nFirstGlyphInCluster - 1))->breakweight(); + } + int nBreakWeight = aFirstGlyph.breakweight(); + if (nBreakWeight < 0) + { + // negative means it applies to the position before the glyph's character + nBreakWeight *= -1; + if (nPrevBreakWeight > 0 && nPrevBreakWeight < nBreakWeight) + { + // prevBreakWeight wins + nBreakWeight = nPrevBreakWeight; + } + } + else + { + nBreakWeight = 0; + // positive means break after + if (nPrevBreakWeight > 0) + nBreakWeight = nPrevBreakWeight; + } + if (nBreakWeight > gr::klbNoBreak/*0*/ && + // nBreakWeight <= gr::klbHyphenBreak) // uses Graphite hyphenation + nBreakWeight <= gr::klbLetterBreak) // Needed for issue 111272 + { + if (nBreakWeight < gr::klbHyphenBreak) + rChar2Base[nFirstCharInCluster-rArgs.mnMinCharPos] |= WORD_BREAK_BEFORE; + else + rChar2Base[nFirstCharInCluster-rArgs.mnMinCharPos] |= HYPHEN_BREAK_BEFORE; + } + // always allow a break before a space even if graphite doesn't + if (rArgs.mpStr[nFirstCharInCluster] == 0x20) + rChar2Base[nFirstCharInCluster-rArgs.mnMinCharPos] |= WORD_BREAK_BEFORE; + bool bBaseGlyph = true; for (int j = nFirstGlyphInCluster; j != nNextGlyph; j += nDelta) @@ -409,7 +449,7 @@ std::pair<float,float> GraphiteLayout::Glyphs::appendCluster(gr::Segment & rSeg, } } #ifdef GRLAYOUT_DEBUG - fprintf(grLog(),"Cluster g[%d-%d) c[%d-%d)%x x%ld y%f\n", nFirstGlyphInCluster, nNextGlyph, nFirstCharInCluster, nNextChar, rArgs.mpStr[nFirstCharInCluster], nXPos, aFirstGlyph.yOffset()); + fprintf(grLog(),"Cluster g[%d-%d) c[%d-%d)%x x%ld y%f bw%d\n", nFirstGlyphInCluster, nNextGlyph, nFirstCharInCluster, nNextChar, rArgs.mpStr[nFirstCharInCluster], nXPos, aFirstGlyph.yOffset(), nBreakWeight); #endif return aBounds; } @@ -641,6 +681,19 @@ gr::Segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs) if (bRtl && (mrFont.getSupportedScriptDirections() & gr::kfsdcHorizRtl)) maLayout.setRightToLeft(bRtl); + // Context is often needed beyond the specified end, however, we don't + // want it if there has been a direction change, since it is hard + // to tell between reordering within one direction and multi-directional + // text. Extra context, can also cause problems with ligatures stradling + // a hyphenation point, so disable if CTL is disabled. + const int nSegCharLimit = min(rArgs.mnLength, mnEndCharPos + EXTRA_CONTEXT_LENGTH); + int limit = rArgs.mnEndCharPos; + if ((nSegCharLimit > limit) && !(SAL_LAYOUT_COMPLEX_DISABLED & rArgs.mnFlags)) + { + limit += findSameDirLimit(rArgs.mpStr + rArgs.mnEndCharPos, + nSegCharLimit - rArgs.mnEndCharPos, bRtl); + } + #ifdef GRCACHE GrFontHasher hasher(mrFont); sal_Int32 aFontHash = hasher.hashCode(mpFeatures); @@ -648,7 +701,7 @@ gr::Segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs) (GraphiteCacheHandler::instance).getCache(aFontHash); if (pCache) { - *pSegRecord = pCache->getSegment(rArgs, bRtl); + *pSegRecord = pCache->getSegment(rArgs, bRtl, nSegCharLimit); if (*pSegRecord) { pSegment = (*pSegRecord)->getSegment(); @@ -667,18 +720,6 @@ gr::Segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs) } #endif - // Context is often needed beyond the specified end, however, we don't - // want it if there has been a direction change, since it is hard - // to tell between reordering within one direction and multi-directional - // text. - const int segCharLimit = min(rArgs.mnLength, mnEndCharPos + EXTRA_CONTEXT_LENGTH); - int limit = rArgs.mnEndCharPos; - if (segCharLimit > limit) - { - limit += findSameDirLimit(rArgs.mpStr + rArgs.mnEndCharPos, - segCharLimit - rArgs.mnEndCharPos, bRtl); - } - // Create a new TextSource object for the engine. mpTextSrc = new TextSourceAdaptor(rArgs, limit); if (mpFeatures) mpTextSrc->setFeatures(mpFeatures); @@ -795,27 +836,35 @@ bool GraphiteLayout::LayoutGlyphs(ImplLayoutArgs& rArgs, gr::Segment * pSegment) int GraphiteLayout::GetTextBreak(long maxmnWidth, long char_extra, int factor) const { - // Adjust maxmnWidth so FindNextBreakPoint returns a sensible answer. - maxmnWidth -= (mnEndCharPos-mnMinCharPos-1)*char_extra; // extra character spacing. - maxmnWidth /= factor; // scaling factor. +#ifdef GRLAYOUT_DEBUG + fprintf(grLog(),"Gr::GetTextBreak c[%d-%d) maxWidth %ld char extra %ld factor %d\n", + mnMinCharPos, mnEndCharPos, maxmnWidth, char_extra, factor); +#endif - // Ask the segment for the nearest whole letter break for the width. - //float width; - float targetWidth = maxmnWidth/mfScaling; // return quickly if this segment is narrower than the target width - // (sometimes graphite doesn't seem to realise this!) - if (targetWidth > mnWidth) + if (maxmnWidth > mnWidth * factor + char_extra * (mnEndCharPos - mnMinCharPos - 1)) return STRING_LEN; - //int nBreak = mpSegment->findNextBreakPoint(mnMinCharPos, - // gr::klbWordBreak, gr::klbLetterBreak, targetWidth, &width); - // LineFillSegment seems to give better results that findNextBreakPoint - // though it may be slower - gr::LayoutEnvironment aLE; - gr::LineFillSegment lineSeg(const_cast<gr::Font *>(&mrFont), mpTextSrc, &aLE, - mnMinCharPos, mpTextSrc->getContextLength(), - targetWidth); - int nBreak = lineSeg.stopCharacter(); + long nWidth = mvCharDxs[0] * factor; + int nLastBreak = -1; + for (size_t i = 1; i < mvCharDxs.size(); i++) + { + nWidth += char_extra; + if (nWidth > maxmnWidth) break; + if (mvChar2BaseGlyph[i] != -1) + { + if (mvChar2BaseGlyph[i] & (WORD_BREAK_BEFORE | HYPHEN_BREAK_BEFORE)) + nLastBreak = static_cast<int>(i); + } + nWidth += (mvCharDxs[i] - mvCharDxs[i-1]) * factor; + } + int nBreak = mnMinCharPos; + if (nLastBreak > -1) + nBreak += nLastBreak; + +#ifdef GRLAYOUT_DEBUG + fprintf(grLog(), "Gr::GetTextBreak break after %d\n", nBreak - mnMinCharPos); +#endif if (nBreak > mnEndCharPos) nBreak = STRING_LEN; else if (nBreak < mnMinCharPos) nBreak = mnMinCharPos; @@ -833,9 +882,10 @@ long GraphiteLayout::FillDXArray( sal_Int32* pDXArray ) const { for (size_t i = 0; i < mvCharDxs.size(); i++) { - assert((mvChar2BaseGlyph[i] >= -1) && (mvChar2BaseGlyph[i] < (signed)mvGlyphs.size())); + assert( (mvChar2BaseGlyph[i] == -1) || + ((signed)(mvChar2BaseGlyph[i] & GLYPH_INDEX_MASK) < (signed)mvGlyphs.size())); if (mvChar2BaseGlyph[i] != -1 && - mvGlyphs[mvChar2BaseGlyph[i]].mnGlyphIndex == GF_DROPPED) + mvGlyphs[mvChar2BaseGlyph[i] & GLYPH_INDEX_MASK].mnGlyphIndex == GF_DROPPED) { // when used in MultiSalLayout::GetTextBreak dropped glyphs // must have zero width @@ -865,7 +915,6 @@ long GraphiteLayout::FillDXArray( sal_Int32* pDXArray ) const void GraphiteLayout::AdjustLayout(ImplLayoutArgs& rArgs) { SalLayout::AdjustLayout(rArgs); - if(rArgs.mpDXArray) { std::vector<int> vDeltaWidths(mvGlyphs.size(), 0); @@ -894,8 +943,75 @@ void GraphiteLayout::AdjustLayout(ImplLayoutArgs& rArgs) } } } + else if (rArgs.mnLayoutWidth > 0) + { +#ifdef GRLAYOUT_DEBUG + fprintf(grLog(), "AdjustLayout width %ld=>%ld\n", mnWidth, rArgs.mnLayoutWidth); +#endif + expandOrCondense(rArgs); + } } +void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs) +{ + int nDeltaWidth = rArgs.mnLayoutWidth - mnWidth; + if (nDeltaWidth > 0) // expand, just expand between clusters + { + int nClusterCount = 0; + for (size_t j = 0; j < mvGlyphs.size(); j++) + { + if (mvGlyphs[j].IsClusterStart()) + { + ++nClusterCount; + } + } + if (nClusterCount > 1) + { + float fExtraPerCluster = static_cast<float>(nDeltaWidth) / static_cast<float>(nClusterCount - 1); + int nCluster = 0; + int nOffset = 0; + for (size_t i = 0; i < mvGlyphs.size(); i++) + { + if (mvGlyphs[i].IsClusterStart()) + { + nOffset = fExtraPerCluster * nCluster; + size_t nCharIndex = mvGlyph2Char[i]; + mvCharDxs[nCharIndex] += nOffset; + // adjust char dxs for rest of characters in cluster + while (++nCharIndex < mvGlyph2Char.size()) + { + int nChar2Base = (mvChar2BaseGlyph[nCharIndex] == -1)? -1 : mvChar2BaseGlyph[nCharIndex] & GLYPH_INDEX_MASK; + if (nChar2Base == -1 || nChar2Base == static_cast<int>(i)) + mvCharDxs[nCharIndex] += nOffset; + } + ++nCluster; + } + mvGlyphs[i].maLinearPos.X() += nOffset; + } + } + } + else // condense - apply a factor to all glyph positions + { + if (mvGlyphs.size() == 0) return; + Glyphs::iterator iLastGlyph = mvGlyphs.begin() + (mvGlyphs.size() - 1); + // position last glyph using original width + float fXFactor = static_cast<float>(rArgs.mnLayoutWidth - iLastGlyph->mnOrigWidth) / static_cast<float>(iLastGlyph->maLinearPos.X()); +#ifdef GRLAYOUT_DEBUG + fprintf(grLog(), "Condense by factor %f\n", fXFactor); +#endif + iLastGlyph->maLinearPos.X() = rArgs.mnLayoutWidth - iLastGlyph->mnOrigWidth; + Glyphs::iterator iGlyph = mvGlyphs.begin(); + while (iGlyph != iLastGlyph) + { + iGlyph->maLinearPos.X() = static_cast<float>(iGlyph->maLinearPos.X()) * fXFactor; + ++iGlyph; + } + for (size_t i = 0; i < mvCharDxs.size(); i++) + { + mvCharDxs[i] = fXFactor * static_cast<float>(mvCharDxs[i]); + } + } +} void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDeltaWidth) { @@ -917,37 +1033,39 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt int nPrevClusterLastChar = -1; for (size_t i = 0; i < nChars; i++) { - if (mvChar2BaseGlyph[i] > -1 && mvChar2BaseGlyph[i] != nPrevClusterGlyph) + int nChar2Base = (mvChar2BaseGlyph[i] == -1)? -1 : mvChar2BaseGlyph[i] & GLYPH_INDEX_MASK; + if ((nChar2Base > -1) && (nChar2Base != nPrevClusterGlyph)) { - assert((mvChar2BaseGlyph[i] > -1) && (mvChar2BaseGlyph[i] < (signed)mvGlyphs.size())); - GlyphItem & gi = mvGlyphs[mvChar2BaseGlyph[i]]; + assert((nChar2Base > -1) && (nChar2Base < (signed)mvGlyphs.size())); + GlyphItem & gi = mvGlyphs[nChar2Base]; if (!gi.IsClusterStart()) continue; // find last glyph of this cluster size_t j = i + 1; int nLastChar = i; - int nLastGlyph = mvChar2BaseGlyph[i]; + int nLastGlyph = nChar2Base; for (; j < nChars; j++) { - assert((mvChar2BaseGlyph[j] >= -1) && (mvChar2BaseGlyph[j] < (signed)mvGlyphs.size())); - if (mvChar2BaseGlyph[j] != -1 && mvGlyphs[mvChar2BaseGlyph[j]].IsClusterStart()) + int nChar2BaseJ = (mvChar2BaseGlyph[j] == -1)? -1 : mvChar2BaseGlyph[j] & GLYPH_INDEX_MASK; + assert((nChar2BaseJ >= -1) && (nChar2BaseJ < (signed)mvGlyphs.size())); + if (nChar2BaseJ != -1 && mvGlyphs[nChar2BaseJ].IsClusterStart()) { - nLastGlyph = mvChar2BaseGlyph[j] + ((bRtl)? 1 : -1); + nLastGlyph = nChar2BaseJ + ((bRtl)? 1 : -1); nLastChar = j - 1; break; } } if (nLastGlyph < 0) { - nLastGlyph = mvChar2BaseGlyph[i]; + nLastGlyph = nChar2Base; } // Its harder to find the last glyph rtl, since the first of // cluster is still on the left so we need to search towards // the previous cluster to the right if (bRtl) { - nLastGlyph = mvChar2BaseGlyph[i]; + nLastGlyph = nChar2Base; while (nLastGlyph + 1 < (signed)mvGlyphs.size() && !mvGlyphs[nLastGlyph+1].IsClusterStart()) { @@ -983,7 +1101,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt // update glyph positions if (bRtl) { - for (int n = mvChar2BaseGlyph[i]; n <= nLastGlyph; n++) + for (int n = nChar2Base; n <= nLastGlyph; n++) { assert((n > - 1) && (n < (signed)mvGlyphs.size())); mvGlyphs[n].maLinearPos.X() += -nDGlyphOrigin + nXOffset; @@ -991,17 +1109,17 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt } else { - for (int n = mvChar2BaseGlyph[i]; n <= nLastGlyph; n++) + for (int n = nChar2Base; n <= nLastGlyph; n++) { assert((n > - 1) && (n < (signed)mvGlyphs.size())); mvGlyphs[n].maLinearPos.X() += nDGlyphOrigin + nXOffset; } } - rDeltaWidth[mvChar2BaseGlyph[i]] = nDWidth; + rDeltaWidth[nChar2Base] = nDWidth; #ifdef GRLAYOUT_DEBUG - fprintf(grLog(),"c%d g%d-%d dW%ld-%ld=%ld dX%ld x%ld\t", (int)i, mvChar2BaseGlyph[i], nLastGlyph, nNewClusterWidth, nOrigClusterWidth, nDWidth, nDGlyphOrigin, mvGlyphs[mvChar2BaseGlyph[i]].maLinearPos.X()); + fprintf(grLog(),"c%d g%d-%d dW%ld-%ld=%ld dX%ld x%ld\t", (int)i, nChar2Base, nLastGlyph, nNewClusterWidth, nOrigClusterWidth, nDWidth, nDGlyphOrigin, mvGlyphs[nChar2Base].maLinearPos.X()); #endif - nPrevClusterGlyph = mvChar2BaseGlyph[i]; + nPrevClusterGlyph = nChar2Base; nPrevClusterLastChar = nLastChar; i = nLastChar; } @@ -1043,7 +1161,7 @@ void GraphiteLayout::kashidaJustify(std::vector<int>& rDeltaWidths, sal_GlyphId continue; } // calculate gap, ignore if too small - int nGapWidth = rDeltaWidths[nOrigGlyphIndex];; + int nGapWidth = rDeltaWidths[nOrigGlyphIndex]; // worst case is one kashida even for mini-gaps if( 3 * nGapWidth < nKashidaWidth ) { @@ -1104,13 +1222,14 @@ void GraphiteLayout::GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray { if (mvChar2BaseGlyph[nCharSlot] != -1) { - assert((mvChar2BaseGlyph[nCharSlot] > -1) && (mvChar2BaseGlyph[nCharSlot] < (signed)mvGlyphs.size())); - GlyphItem gi = mvGlyphs[mvChar2BaseGlyph[nCharSlot]]; + int nChar2Base = mvChar2BaseGlyph[nCharSlot] & GLYPH_INDEX_MASK; + assert((mvChar2BaseGlyph[nCharSlot] > -1) && (nChar2Base < (signed)mvGlyphs.size())); + GlyphItem gi = mvGlyphs[nChar2Base]; if (gi.mnGlyphIndex == GF_DROPPED) { continue; } - int nCluster = mvChar2BaseGlyph[nCharSlot]; + int nCluster = nChar2Base; long origClusterWidth = gi.mnNewWidth; long nMin = gi.maLinearPos.X(); long nMax = gi.maLinearPos.X() + gi.mnNewWidth; @@ -1135,7 +1254,7 @@ void GraphiteLayout::GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray pCaretXArray[i] = nMin; pCaretXArray[i+1] = nMax; } - prevBase = mvChar2BaseGlyph[nCharSlot]; + prevBase = nChar2Base; prevClusterWidth = origClusterWidth; } else if (prevBase > -1) @@ -1268,7 +1387,7 @@ int GraphiteLayout::GetNextGlyphs( int length, sal_GlyphId * glyph_out, #ifdef GRLAYOUT_DEBUG fprintf(grLog(),"GetNextGlyphs g%d c%d x%ld,%ld adv%ld, pos %ld,%ld\n", glyph_slot - 1, - mvGlyph2Char[glyph_slot-1], glyph_itr->maLinearPos.X(), glyph_itr->maLinearPos.Y(), nGlyphAdvance, + GLYPH_INDEX_MASK&mvGlyph2Char[glyph_slot-1], glyph_itr->maLinearPos.X(), glyph_itr->maLinearPos.Y(), nGlyphAdvance, aPosOut.X(), aPosOut.Y()); #endif diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index e3a8d2ce35de..e67c2d9ecfd5 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -426,11 +426,19 @@ void DockingManager::SetFloatingMode( const Window *pWindow, BOOL bFloating ) pWrapper->SetFloatingMode( bFloating ); } -void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWindow ) +void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWindow, ULONG nFlags ) { ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow ); if( pWrapper ) - pWrapper->StartPopupMode( pParentToolBox ); + pWrapper->StartPopupMode( pParentToolBox, nFlags ); +} + +void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWindow ) +{ + StartPopupMode( pParentToolBox, pWindow, FLOATWIN_POPUPMODE_ALLOWTEAROFF | + FLOATWIN_POPUPMODE_NOFOCUSCLOSE | + FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE | + FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE ); } BOOL DockingManager::IsInPopupMode( const Window *pWindow ) @@ -442,6 +450,17 @@ BOOL DockingManager::IsInPopupMode( const Window *pWindow ) return FALSE; } +// ----------------------------------------------------------------------- + +void DockingManager::EndPopupMode( const Window *pWin ) +{ + ImplDockingWindowWrapper *pWrapper = GetDockingWindowWrapper( pWin ); + if( pWrapper && pWrapper->GetFloatingWindow() && pWrapper->GetFloatingWindow()->IsInPopupMode() ) + pWrapper->GetFloatingWindow()->EndPopupMode(); +} + +// ----------------------------------------------------------------------- + void DockingManager::AddWindow( const Window *pWindow ) { ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow ); @@ -515,12 +534,15 @@ private: ImplDockingWindowWrapper* mpDockingWin; BOOL mbHighlight; BOOL mbMoving; + bool mbTrackingEnabled; Point maDelta; Point maTearOffPosition; + bool mbGripAtBottom; + bool mbHasGrip; void ImplSetBorder(); public: - ImplPopupFloatWin( Window* pParent, ImplDockingWindowWrapper* pDockingWin ); + ImplPopupFloatWin( Window* pParent, ImplDockingWindowWrapper* pDockingWin, bool bHasGrip ); ~ImplPopupFloatWin(); virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); @@ -537,9 +559,11 @@ public: Point GetTearOffPosition() const; void DrawGrip(); void DrawBorder(); + + bool hasGrip() const { return mbHasGrip; } }; -ImplPopupFloatWin::ImplPopupFloatWin( Window* pParent, ImplDockingWindowWrapper* pDockingWin ) : +ImplPopupFloatWin::ImplPopupFloatWin( Window* pParent, ImplDockingWindowWrapper* pDockingWin, bool bHasGrip ) : FloatingWindow( pParent, WB_NOBORDER | WB_SYSTEMWINDOW | WB_NOSHADOW) { mpWindowImpl->mbToolbarFloatingWindow = TRUE; // indicate window type, required for accessibility @@ -547,6 +571,9 @@ ImplPopupFloatWin::ImplPopupFloatWin( Window* pParent, ImplDockingWindowWrapper* mpDockingWin = pDockingWin; mbHighlight = FALSE; mbMoving = FALSE; + mbTrackingEnabled = FALSE; + mbGripAtBottom = TRUE; + mbHasGrip = bHasGrip; ImplSetBorder(); } @@ -582,7 +609,9 @@ void ImplPopupFloatWin::ImplSetBorder() // we're using a special border for the grip // by setting those members the method SetOutputSizePixel() can // be used to set the proper window size - mpWindowImpl->mnTopBorder = 1 + POPUP_DRAGHEIGHT+2; + mpWindowImpl->mnTopBorder = 1; + if( hasGrip() ) + mpWindowImpl->mnTopBorder += POPUP_DRAGHEIGHT+2; mpWindowImpl->mnBottomBorder = 1; mpWindowImpl->mnLeftBorder = 1; mpWindowImpl->mnRightBorder = 1; @@ -596,13 +625,25 @@ void ImplPopupFloatWin::Resize() Rectangle ImplPopupFloatWin::GetDragRect() const { - return Rectangle( 1, 1, GetOutputSizePixel().Width()-1, 2+POPUP_DRAGHEIGHT ); + Rectangle aRect; + if( hasGrip() ) + { + aRect = Rectangle( 1,1, GetOutputSizePixel().Width()-1, 2+POPUP_DRAGHEIGHT ); + if( mbGripAtBottom ) + { + int height = GetOutputSizePixel().Height(); + aRect.Top() = height - 3 - POPUP_DRAGHEIGHT; + aRect.Bottom() = aRect.Top() + 1 + POPUP_DRAGHEIGHT; + } + } + return aRect; } Point ImplPopupFloatWin::GetToolboxPosition() const { // return inner position where a toolbox could be placed - Point aPt( 1, 1+GetDragRect().getHeight() ); // grip + border + Point aPt( 1, 1 + ((mbGripAtBottom || !hasGrip()) ? 0 : GetDragRect().getHeight()) ); // grip + border + return aPt; } @@ -616,7 +657,6 @@ Point ImplPopupFloatWin::GetTearOffPosition() const void ImplPopupFloatWin::DrawBorder() { SetFillColor(); - SetLineColor( GetSettings().GetStyleSettings().GetShadowColor() ); Point aPt; Rectangle aRect( aPt, GetOutputSizePixel() ); @@ -626,9 +666,16 @@ void ImplPopupFloatWin::DrawBorder() if( !aItemClipRect.IsEmpty() ) { aItemClipRect.SetPos( AbsoluteScreenToOutputPixel( aItemClipRect.TopLeft() ) ); + + // draw the excluded border part with the background color of a toolbox + SetClipRegion( Region( aItemClipRect ) ); + SetLineColor( GetSettings().GetStyleSettings().GetFaceColor() ); + DrawRect( aRect ); + aClipRgn.Exclude( aItemClipRect ); SetClipRegion( aClipRgn ); } + SetLineColor( GetSettings().GetStyleSettings().GetShadowColor() ); DrawRect( aRect ); SetClipRegion( oldClipRgn ); } @@ -724,7 +771,8 @@ void ImplPopupFloatWin::Paint( const Rectangle& ) Rectangle aRect( aPt, GetOutputSizePixel() ); DrawWallpaper( aRect, Wallpaper( GetSettings().GetStyleSettings().GetFaceGradientColor() ) ); DrawBorder(); - DrawGrip(); + if( hasGrip() ) + DrawGrip(); } void ImplPopupFloatWin::MouseMove( const MouseEvent& rMEvt ) @@ -733,7 +781,7 @@ void ImplPopupFloatWin::MouseMove( const MouseEvent& rMEvt ) if( !ToolBox::AlwaysLocked() ) // no tear off if locking is enabled { - if( rMEvt.IsLeft() && GetDragRect().IsInside( aMousePos ) ) + if( mbTrackingEnabled && rMEvt.IsLeft() && GetDragRect().IsInside( aMousePos ) ) { // start window move mbMoving = TRUE; @@ -755,6 +803,7 @@ void ImplPopupFloatWin::MouseMove( const MouseEvent& rMEvt ) void ImplPopupFloatWin::MouseButtonUp( const MouseEvent& rMEvt ) { + mbTrackingEnabled = false; FloatingWindow::MouseButtonUp( rMEvt ); } @@ -769,6 +818,11 @@ void ImplPopupFloatWin::MouseButtonDown( const MouseEvent& rMEvt ) ImplMirrorFramePos(aState.maPos); maTearOffPosition = GetWindow( WINDOW_BORDER )->GetPosPixel(); maDelta = aState.maPos - maTearOffPosition; + mbTrackingEnabled = true; + } + else + { + mbTrackingEnabled = false; } } @@ -1187,7 +1241,7 @@ BOOL ImplDockingWindowWrapper::IsTitleButtonVisible( USHORT nButton ) const // ----------------------------------------------------------------------- -void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox ) +void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, ULONG nFlags ) { // do nothing if window is floating if( IsFloatingMode() ) @@ -1202,7 +1256,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox ) mpOldBorderWin = NULL; // no border window found // the new parent for popup mode - ImplPopupFloatWin* pWin = new ImplPopupFloatWin( mpParent, this ); + ImplPopupFloatWin* pWin = new ImplPopupFloatWin( mpParent, this, (nFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF) != 0 ); pWin->SetPopupModeEndHdl( LINK( this, ImplDockingWindowWrapper, PopupModeEnd ) ); pWin->SetText( GetWindow()->GetText() ); @@ -1232,12 +1286,6 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox ) // (SetPosPixel etc. check for valid mpFloatWin pointer) mpFloatWin = pWin; - ULONG nFlags = FLOATWIN_POPUPMODE_ALLOWTEAROFF | - FLOATWIN_POPUPMODE_NOFOCUSCLOSE | - FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE | - FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE; -// |FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE; - // if the subtoolbar was opened via keyboard make sure that key events // will go into subtoolbar if( pParentToolBox->IsKeyEvent() ) @@ -1339,7 +1387,7 @@ void ImplDockingWindowWrapper::SetFloatingMode( BOOL bFloatMode ) aSettings.SetStyleSettings( aStyleSettings ); pWin->SetSettings( aSettings );*/ - mpFloatWin = pWin; +// mpFloatWin = pWin; GetWindow()->mpWindowImpl->mpBorderWindow = NULL; @@ -1374,6 +1422,8 @@ void ImplDockingWindowWrapper::SetFloatingMode( BOOL bFloatMode ) pWin->SetMinOutputSizePixel( maMinOutSize ); pWin->SetMaxOutputSizePixel( maMaxOutSize ); + mpFloatWin = pWin; + if ( bVisible ) GetWindow()->Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx index b4f4d0f2b6df..d4ee01c26d61 100644 --- a/vcl/source/window/seleng.cxx +++ b/vcl/source/window/seleng.cxx @@ -200,7 +200,11 @@ void SelectionEngine::CursorPosChanging( BOOL bShift, BOOL bMod1 ) BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) { nFlags &= (~SELENG_CMDEVT); - if ( !pFunctionSet || !pWin || rMEvt.GetClicks() > 1 || rMEvt.IsRight() ) + if ( !pFunctionSet || !pWin ) + return FALSE; + const bool bRightClickCursorPositioning = + rMEvt.IsRight() && rMEvt.GetClicks() == 1 && !IsInSelection(); + if ( (rMEvt.GetClicks() > 1 || rMEvt.IsRight()) && !bRightClickCursorPositioning ) return FALSE; USHORT nModifier = rMEvt.GetModifier() | nLockedMods; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index b47aa50a2e72..ca92d9ed6c5b 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -98,6 +98,7 @@ #include "vcl/lazydelete.hxx" #include <set> +#include <typeinfo> using namespace rtl; using namespace ::com::sun::star::uno; @@ -1322,7 +1323,6 @@ ImplWinData* Window::ImplGetWinData() const mpWindowImpl->mpWinData->mnIsTopWindow = (USHORT) ~0; // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow()) mpWindowImpl->mpWinData->mbMouseOver = FALSE; mpWindowImpl->mpWinData->mbEnableNativeWidget = (pNoNWF && *pNoNWF) ? FALSE : TRUE; // TRUE: try to draw this control with native theme API - mpWindowImpl->mpWinData->mpSalControlHandle = NULL; mpWindowImpl->mpWinData->mpSmartHelpId = NULL; mpWindowImpl->mpWinData->mpSmartUniqueId = NULL; } @@ -4328,6 +4328,27 @@ Window::Window( Window* pParent, const ResId& rResId ) } // ----------------------------------------------------------------------- +#if OSL_DEBUG_LEVEL > 0 +namespace +{ + void lcl_appendWindowInfo( ByteString& io_rErrorString, const Window& i_rWindow ) + { + // skip border windows, they don't carry information which helps diagnosing the problem + const Window* pWindow( &i_rWindow ); + while ( pWindow && ( pWindow->GetType() == WINDOW_BORDERWINDOW ) ) + pWindow = pWindow->GetWindow( WINDOW_FIRSTCHILD ); + if ( !pWindow ) + pWindow = &i_rWindow; + + io_rErrorString += char(13); + io_rErrorString += typeid( *pWindow ).name(); + io_rErrorString += " (window text: '"; + io_rErrorString += ByteString( pWindow->GetText(), RTL_TEXTENCODING_UTF8 ); + io_rErrorString += "')"; + } +} +#endif +// ----------------------------------------------------------------------- Window::~Window() { @@ -4460,9 +4481,7 @@ Window::~Window() if ( ImplIsRealParentPath( pTempWin ) ) { bError = TRUE; - if ( aErrorStr.Len() ) - aErrorStr += "; "; - aErrorStr += ByteString( pTempWin->GetText(), RTL_TEXTENCODING_UTF8 ); + lcl_appendWindowInfo( aErrorStr, *pTempWin ); } pTempWin = pTempWin->mpWindowImpl->mpNextOverlap; } @@ -4483,9 +4502,7 @@ Window::~Window() if ( ImplIsRealParentPath( pTempWin ) ) { bError = TRUE; - if ( aErrorStr.Len() ) - aErrorStr += "; "; - aErrorStr += ByteString( pTempWin->GetText(), RTL_TEXTENCODING_UTF8 ); + lcl_appendWindowInfo( aErrorStr, *pTempWin ); } pTempWin = pTempWin->mpWindowImpl->mpFrameData->mpNextFrame; } @@ -4507,10 +4524,8 @@ Window::~Window() pTempWin = mpWindowImpl->mpFirstChild; while ( pTempWin ) { - aTempStr += ByteString( pTempWin->GetText(), RTL_TEXTENCODING_UTF8 ); + lcl_appendWindowInfo( aTempStr, *pTempWin ); pTempWin = pTempWin->mpWindowImpl->mpNext; - if ( pTempWin ) - aTempStr += "; "; } DBG_ERROR( aTempStr.GetBuffer() ); GetpApp()->Abort( String( aTempStr, RTL_TEXTENCODING_UTF8 ) ); // abort in non-pro version, this must be fixed! @@ -4524,10 +4539,8 @@ Window::~Window() pTempWin = mpWindowImpl->mpFirstOverlap; while ( pTempWin ) { - aTempStr += ByteString( pTempWin->GetText(), RTL_TEXTENCODING_UTF8 ); + lcl_appendWindowInfo( aTempStr, *pTempWin ); pTempWin = pTempWin->mpWindowImpl->mpNext; - if ( pTempWin ) - aTempStr += "; "; } DBG_ERROR( aTempStr.GetBuffer() ); GetpApp()->Abort( String( aTempStr, RTL_TEXTENCODING_UTF8 ) ); // abort in non-pro version, this must be fixed! @@ -4722,10 +4735,6 @@ Window::~Window() delete mpWindowImpl->mpWinData->mpFocusRect; if ( mpWindowImpl->mpWinData->mpTrackRect ) delete mpWindowImpl->mpWinData->mpTrackRect; - // Native widget support - delete mpWindowImpl->mpWinData->mpSalControlHandle; - mpWindowImpl->mpWinData->mpSalControlHandle = NULL; - if ( mpWindowImpl->mpWinData->mpSmartHelpId ) delete mpWindowImpl->mpWinData->mpSmartHelpId; if ( mpWindowImpl->mpWinData->mpSmartUniqueId ) @@ -7444,13 +7453,13 @@ Rectangle Window::ImplOutputToUnmirroredAbsoluteScreenPixel( const Rectangle &rR // ----------------------------------------------------------------------- -Rectangle Window::GetWindowExtentsRelative( Window *pRelativeWindow ) +Rectangle Window::GetWindowExtentsRelative( Window *pRelativeWindow ) const { // with decoration return ImplGetWindowExtentsRelative( pRelativeWindow, FALSE ); } -Rectangle Window::GetClientWindowExtentsRelative( Window *pRelativeWindow ) +Rectangle Window::GetClientWindowExtentsRelative( Window *pRelativeWindow ) const { // without decoration return ImplGetWindowExtentsRelative( pRelativeWindow, TRUE ); @@ -7458,12 +7467,12 @@ Rectangle Window::GetClientWindowExtentsRelative( Window *pRelativeWindow ) // ----------------------------------------------------------------------- -Rectangle Window::ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bClientOnly ) +Rectangle Window::ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bClientOnly ) const { SalFrameGeometry g = mpWindowImpl->mpFrame->GetGeometry(); // make sure we use the extent of our border window, // otherwise we miss a few pixels - Window *pWin = (!bClientOnly && mpWindowImpl->mpBorderWindow) ? mpWindowImpl->mpBorderWindow : this; + const Window *pWin = (!bClientOnly && mpWindowImpl->mpBorderWindow) ? mpWindowImpl->mpBorderWindow : this; Point aPos( pWin->OutputToScreenPixel( Point(0,0) ) ); aPos.X() += g.nX; diff --git a/vcl/source/window/window3.cxx b/vcl/source/window/window3.cxx index aecbc9c3ef0c..65019ba2a4af 100644 --- a/vcl/source/window/window3.cxx +++ b/vcl/source/window/window3.cxx @@ -28,269 +28,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" -#define _SV_WINDOW_CXX - -#include "svsys.h" -#include "vcl/window.h" #include "vcl/window.hxx" #include "vcl/waitobj.hxx" -#include "vcl/salgdi.hxx" -#include "vcl/salnativewidgets.hxx" -#include "vcl/salctrlhandle.hxx" -#include "rtl/ustring.hxx" #include "vcl/button.hxx" -using namespace rtl; - -// ----------------------------------------------------------------------- -// These functions are mainly passthrough functions that allow access to -// the SalFrame behind a Window object for native widget rendering purposes. -// ----------------------------------------------------------------------- - -void Window::ImplInitSalControlHandle() -{ - // create SalControlHandle on demand - // not needed for ordinary windows - // TODO: move creation to SalGraphics - //if( !ImplGetWinData()->mpSalControlHandle ) - // ImplGetWinData()->mpSalControlHandle = new SalControlHandle; -} - -// ----------------------------------------------------------------------- - -BOOL Window::IsNativeControlSupported( ControlType nType, ControlPart nPart ) -{ - if( !IsNativeWidgetEnabled() ) - return FALSE; - - if ( !mpGraphics ) - if ( !ImplGetGraphics() ) - return FALSE; - - return( mpGraphics->IsNativeControlSupported(nType, nPart) ); -} - - -// ----------------------------------------------------------------------- - -BOOL Window::HitTestNativeControl( ControlType nType, - ControlPart nPart, - const Region& rControlRegion, - const Point& aPos, - BOOL& rIsInside ) -{ - if( !IsNativeWidgetEnabled() ) - return FALSE; - - if ( !mpGraphics ) - if ( !ImplGetGraphics() ) - return FALSE; - - ImplInitSalControlHandle(); - - Point aWinOffs; - aWinOffs = OutputToScreenPixel( aWinOffs ); - Region screenRegion( rControlRegion ); - screenRegion.Move( aWinOffs.X(), aWinOffs.Y()); - - return( mpGraphics->HitTestNativeControl(nType, nPart, screenRegion, OutputToScreenPixel( aPos ), *ImplGetWinData()->mpSalControlHandle, rIsInside, this ) ); -} - -// ----------------------------------------------------------------------- - -void Window::ImplMoveControlValue( ControlType nType, const ImplControlValue& aValue, const Point& rDelta ) const -{ - if( aValue.getOptionalVal() ) - { - switch( nType ) - { - case CTRL_SLIDER: - { - SliderValue* pSlVal = reinterpret_cast<SliderValue*>(aValue.getOptionalVal()); - pSlVal->maThumbRect.Move( rDelta.X(), rDelta.Y() ); - } - break; - case CTRL_SCROLLBAR: - { - ScrollbarValue* pScVal = reinterpret_cast<ScrollbarValue*>(aValue.getOptionalVal()); - pScVal->maThumbRect.Move( rDelta.X(), rDelta.Y() ); - pScVal->maButton1Rect.Move( rDelta.X(), rDelta.Y() ); - pScVal->maButton2Rect.Move( rDelta.X(), rDelta.Y() ); - } - break; - case CTRL_SPINBOX: - case CTRL_SPINBUTTONS: - { - SpinbuttonValue* pSpVal = reinterpret_cast<SpinbuttonValue*>(aValue.getOptionalVal()); - pSpVal->maUpperRect.Move( rDelta.X(), rDelta.Y() ); - pSpVal->maLowerRect.Move( rDelta.X(), rDelta.Y() ); - } - break; - case CTRL_TOOLBAR: - { - ToolbarValue* pTVal = reinterpret_cast<ToolbarValue*>(aValue.getOptionalVal()); - pTVal->maGripRect.Move( rDelta.X(), rDelta.Y() ); - } - break; - } - } -} - -BOOL Window::DrawNativeControl( ControlType nType, - ControlPart nPart, - const Region& rControlRegion, - ControlState nState, - const ImplControlValue& aValue, - OUString aCaption ) -{ - if( !IsNativeWidgetEnabled() ) - return FALSE; - - /* - if( !IsInPaint() && IsPaintTransparent() ) - { - // only required if called directly (ie, we're not in Paint() ): - // force redraw (Paint()) for transparent controls - // to trigger a repaint of the background - Region aClipRgn( GetClipRegion() ); - if( !rControlRegion.IsEmpty() ) - aClipRgn.Intersect( rControlRegion ); - Invalidate( aClipRgn, INVALIDATE_UPDATE ); - return TRUE; - } - */ - - ImplInitSalControlHandle(); - - // make sure the current clip region is initialized correctly - if ( !mpGraphics ) - if ( !ImplGetGraphics() ) - return FALSE; - - if ( mbInitClipRegion ) - ImplInitClipRegion(); - if ( mbOutputClipped ) - return TRUE; - - if ( mbInitLineColor ) - ImplInitLineColor(); - if ( mbInitFillColor ) - ImplInitFillColor(); - - // Convert the coordinates from relative to Window-absolute, so we draw - // in the correct place in platform code - Point aWinOffs; - aWinOffs = OutputToScreenPixel( aWinOffs ); - Region screenRegion( rControlRegion ); - screenRegion.Move( aWinOffs.X(), aWinOffs.Y()); - - // do so for ImplControlValue members, also - ImplMoveControlValue( nType, aValue, aWinOffs ); - - Region aTestRegion( GetActiveClipRegion() ); - aTestRegion.Intersect( rControlRegion ); - if( aTestRegion == rControlRegion ) - nState |= CTRL_CACHING_ALLOWED; // control is not clipped, caching allowed - - BOOL bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, aValue, *ImplGetWinData()->mpSalControlHandle, aCaption, this ); - - // transform back ImplControlValue members - ImplMoveControlValue( nType, aValue, Point()-aWinOffs ); - - return bRet; -} - - -// ----------------------------------------------------------------------- - -BOOL Window::DrawNativeControlText(ControlType nType, - ControlPart nPart, - const Region& rControlRegion, - ControlState nState, - const ImplControlValue& aValue, - OUString aCaption ) -{ - if( !IsNativeWidgetEnabled() ) - return FALSE; - - ImplInitSalControlHandle(); - - // make sure the current clip region is initialized correctly - if ( !mpGraphics ) - if ( !ImplGetGraphics() ) - return false; - - if ( mbInitClipRegion ) - ImplInitClipRegion(); - if ( mbOutputClipped ) - return true; - - if ( mbInitLineColor ) - ImplInitLineColor(); - if ( mbInitFillColor ) - ImplInitFillColor(); - - // Convert the coordinates from relative to Window-absolute, so we draw - // in the correct place in platform code - Point aWinOffs; - aWinOffs = OutputToScreenPixel( aWinOffs ); - Region screenRegion( rControlRegion ); - screenRegion.Move( aWinOffs.X(), aWinOffs.Y()); - ImplMoveControlValue( nType, aValue, aWinOffs ); - - BOOL bRet = mpGraphics->DrawNativeControlText(nType, nPart, screenRegion, nState, aValue, *ImplGetWinData()->mpSalControlHandle, aCaption, this ); - - // transform back ImplControlValue members - ImplMoveControlValue( nType, aValue, Point()-aWinOffs ); - - return bRet; -} - - -// ----------------------------------------------------------------------- - -BOOL Window::GetNativeControlRegion( ControlType nType, - ControlPart nPart, - const Region& rControlRegion, - ControlState nState, - const ImplControlValue& aValue, - OUString aCaption, - Region &rNativeBoundingRegion, - Region &rNativeContentRegion ) -{ - if( !IsNativeWidgetEnabled() ) - return FALSE; - - if ( !mpGraphics ) - if ( !ImplGetGraphics() ) - return FALSE; - - ImplInitSalControlHandle(); - - // Convert the coordinates from relative to Window-absolute, so we draw - // in the correct place in platform code - Point aWinOffs; - aWinOffs = OutputToScreenPixel( aWinOffs ); - Region screenRegion( rControlRegion ); - screenRegion.Move( aWinOffs.X(), aWinOffs.Y()); - ImplMoveControlValue( nType, aValue, aWinOffs ); - - BOOL bRet = mpGraphics->GetNativeControlRegion(nType, nPart, screenRegion, nState, aValue, - *ImplGetWinData()->mpSalControlHandle, aCaption, rNativeBoundingRegion, - rNativeContentRegion, this ); - if( bRet ) - { - // transform back native regions - rNativeBoundingRegion.Move( -aWinOffs.X(), -aWinOffs.Y() ); - rNativeContentRegion.Move( -aWinOffs.X(), -aWinOffs.Y() ); - } - // transform back ImplControlValue members - ImplMoveControlValue( nType, aValue, Point()-aWinOffs ); - - return bRet; -} - - // ----------------------------------------------------------------------- WaitObject::~WaitObject() diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index de4d55b0230a..244c001b3aa0 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -191,34 +191,34 @@ static void NWCalcArrowRect( const Rectangle& rButton, Rectangle& rArrow ); //--- static Rectangle NWGetButtonArea( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, const OUString& rCaption ); + const ImplControlValue& aValue, const OUString& rCaption ); //--- static Rectangle NWGetEditBoxPixmapRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, const OUString& rCaption ); + const ImplControlValue& aValue, const OUString& rCaption ); static void NWPaintOneEditBox( int nScreen, GdkDrawable * gdkDrawable, GdkRectangle *gdkRect, ControlType nType, ControlPart nPart, Rectangle aEditBoxRect, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); //--- static Rectangle NWGetSpinButtonRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, const OUString& rCaption ); + const ImplControlValue& aValue, const OUString& rCaption ); static void NWPaintOneSpinButton( int nScreen, GdkPixmap * pixmap, ControlType nType, ControlPart nPart, Rectangle aAreaRect, - ControlState nState, const ImplControlValue& aValue, SalControlHandle& rControlHandle, + ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); //--- static Rectangle NWGetComboBoxButtonRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, const OUString& rCaption ); + const ImplControlValue& aValue, const OUString& rCaption ); //--- static Rectangle NWGetListBoxButtonRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, const OUString& rCaption ); + const ImplControlValue& aValue, const OUString& rCaption ); static Rectangle NWGetListBoxIndicatorRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, const OUString& rCaption ); + const ImplControlValue& aValue, const OUString& rCaption ); static Rectangle NWGetToolbarRect( int nScreen, ControlType nType, @@ -226,7 +226,6 @@ static Rectangle NWGetToolbarRect( int nScreen, Rectangle aAreaRect, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); //--- @@ -620,7 +619,6 @@ BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, const Point& aPos, - SalControlHandle&, BOOL& rIsInside ) { if ( ( nType == CTRL_SCROLLBAR ) && @@ -725,7 +723,6 @@ BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType, * * rControlRegion: The bounding region of the complete control in VCL frame coordinates. * aValue: An optional value (tristate/numerical/string) - * rControlHandle: Carries platform dependent data and is maintained by the SalFrame implementation. * rCaption: A caption or title string (like button text etc) */ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, @@ -733,13 +730,12 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, const Region& rControlRegion, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ) { if( (nType==CTRL_CHECKBOX) && (nPart==PART_ENTIRE_CONTROL) && aValue.getTristateVal() == BUTTONVALUE_MIXED ) { - return drawNativeMixedStateCheck( nType, nPart, rControlRegion, nState, aValue, rControlHandle, rCaption ); + return drawNativeMixedStateCheck( nType, nPart, rControlRegion, nState, aValue, rCaption ); } BOOL returnVal = FALSE; @@ -802,61 +798,61 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, if ( (nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL) ) { - returnVal = NWPaintGTKButton( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption ); + returnVal = NWPaintGTKButton( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if ( (nType==CTRL_RADIOBUTTON) && (nPart==PART_ENTIRE_CONTROL) ) { - returnVal = NWPaintGTKRadio( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption ); + returnVal = NWPaintGTKRadio( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if ( (nType==CTRL_CHECKBOX) && (nPart==PART_ENTIRE_CONTROL) ) { - returnVal = NWPaintGTKCheck( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption ); + returnVal = NWPaintGTKCheck( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if ( (nType==CTRL_SCROLLBAR) && ((nPart==PART_DRAW_BACKGROUND_HORZ) || (nPart==PART_DRAW_BACKGROUND_VERT)) ) { - returnVal = NWPaintGTKScrollbar( nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption ); + returnVal = NWPaintGTKScrollbar( nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if ( ((nType==CTRL_EDITBOX) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==HAS_BACKGROUND_TEXTURE)) ) || ((nType==CTRL_SPINBOX) && (nPart==HAS_BACKGROUND_TEXTURE)) || ((nType==CTRL_COMBOBOX) && (nPart==HAS_BACKGROUND_TEXTURE)) || ((nType==CTRL_LISTBOX) && (nPart==HAS_BACKGROUND_TEXTURE)) ) { - returnVal = NWPaintGTKEditBox( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption ); + returnVal = NWPaintGTKEditBox( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if ( ((nType==CTRL_MULTILINE_EDITBOX) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==HAS_BACKGROUND_TEXTURE)) ) ) { - returnVal = NWPaintGTKEditBox( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption ); + returnVal = NWPaintGTKEditBox( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if ( ((nType==CTRL_SPINBOX) || (nType==CTRL_SPINBUTTONS)) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==PART_ALL_BUTTONS)) ) { - returnVal = NWPaintGTKSpinBox( nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption ); + returnVal = NWPaintGTKSpinBox( nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if ( (nType == CTRL_COMBOBOX) && ( (nPart==PART_ENTIRE_CONTROL) ||(nPart==PART_BUTTON_DOWN) ) ) { - returnVal = NWPaintGTKComboBox( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption ); + returnVal = NWPaintGTKComboBox( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if ( (nType==CTRL_TAB_ITEM) || (nType==CTRL_TAB_PANE) || (nType==CTRL_TAB_BODY) || (nType==CTRL_FIXEDBORDER) ) { if ( nType == CTRL_TAB_BODY ) returnVal = TRUE; else - returnVal = NWPaintGTKTabItem( nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption); + returnVal = NWPaintGTKTabItem( nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption); } else if ( (nType==CTRL_LISTBOX) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==PART_WINDOW)) ) { - returnVal = NWPaintGTKListBox( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption ); + returnVal = NWPaintGTKListBox( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if ( (nType== CTRL_TOOLBAR) ) { - returnVal = NWPaintGTKToolbar( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption ); + returnVal = NWPaintGTKToolbar( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if ( (nType== CTRL_MENUBAR) ) { - returnVal = NWPaintGTKMenubar( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption ); + returnVal = NWPaintGTKMenubar( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if( (nType == CTRL_MENU_POPUP) && ( (nPart == PART_ENTIRE_CONTROL) @@ -866,19 +862,19 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, ) ) { - returnVal = NWPaintGTKPopupMenu( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption ); + returnVal = NWPaintGTKPopupMenu( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if( (nType == CTRL_TOOLTIP) && (nPart == PART_ENTIRE_CONTROL) ) { - returnVal = NWPaintGTKTooltip( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption ); + returnVal = NWPaintGTKTooltip( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if( (nType == CTRL_PROGRESS) && (nPart == PART_ENTIRE_CONTROL) ) { - returnVal = NWPaintGTKProgress( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption ); + returnVal = NWPaintGTKProgress( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if( (nType == CTRL_LISTNODE) && (nPart == PART_ENTIRE_CONTROL) ) { - returnVal = NWPaintGTKListNode( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption ); + returnVal = NWPaintGTKListNode( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if( (nType == CTRL_LISTNET) && (nPart == PART_ENTIRE_CONTROL) ) { @@ -887,7 +883,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, } else if( (nType == CTRL_SLIDER) ) { - returnVal = NWPaintGTKSlider( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption ); + returnVal = NWPaintGTKSlider( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } if( pixmap ) @@ -904,7 +900,6 @@ BOOL GtkSalGraphics::drawNativeMixedStateCheck( ControlType nType, const Region& rControlRegion, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ) { // need to emulate something for mixed state @@ -927,7 +922,7 @@ BOOL GtkSalGraphics::drawNativeMixedStateCheck( ControlType nType, SetClipRegion( pFontGC_, aRegion ); XDestroyRegion( aRegion ); - returnVal = drawNativeControl( nType, nPart, rControlRegion, nState, aValue, rControlHandle, rCaption ); + returnVal = drawNativeControl( nType, nPart, rControlRegion, nState, aValue, rCaption ); if( returnVal ) { @@ -938,7 +933,7 @@ BOOL GtkSalGraphics::drawNativeMixedStateCheck( ControlType nType, XUnionRectWithRegion( &aXRect, aRegion, aRegion ); SetClipRegion( pFontGC_, aRegion ); XDestroyRegion( aRegion ); - returnVal = drawNativeControl( nType, nPart, rControlRegion, nState, aValue, rControlHandle, rCaption ); + returnVal = drawNativeControl( nType, nPart, rControlRegion, nState, aValue, rCaption ); } // clean up @@ -957,7 +952,6 @@ BOOL GtkSalGraphics::drawNativeMixedStateCheck( ControlType nType, * * rControlRegion: The bounding region of the complete control in VCL frame coordinates. * aValue: An optional value (tristate/numerical/string) - * rControlHandle: Carries platform dependent data and is maintained by the SalFrame implementation. * rCaption: A caption or title string (like button text etc) */ BOOL GtkSalGraphics::drawNativeControlText( ControlType, @@ -965,7 +959,6 @@ BOOL GtkSalGraphics::drawNativeControlText( ControlType, const Region&, ControlState, const ImplControlValue&, - SalControlHandle&, const OUString& ) { return( FALSE ); @@ -983,7 +976,6 @@ BOOL GtkSalGraphics::drawNativeControlText( ControlType, * * rControlRegion: The bounding region of the control in VCL frame coordinates. * aValue: An optional value (tristate/numerical/string) - * rControlHandle: Carries platform dependent data and is maintained by the SalFrame implementation. * rCaption: A caption or title string (like button text etc) */ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, @@ -991,7 +983,6 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, const Region& rControlRegion, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption, Region &rNativeBoundingRegion, Region &rNativeContentRegion ) @@ -1003,7 +994,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, && (rControlRegion.GetBoundRect().GetHeight() > 16) ) { rNativeBoundingRegion = NWGetButtonArea( m_nScreen, nType, nPart, rControlRegion.GetBoundRect(), - nState, aValue, rControlHandle, rCaption ); + nState, aValue, rCaption ); rNativeContentRegion = rControlRegion; returnVal = TRUE; @@ -1011,7 +1002,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, if ( (nType==CTRL_COMBOBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { rNativeBoundingRegion = NWGetComboBoxButtonRect( m_nScreen, nType, nPart, rControlRegion.GetBoundRect(), nState, - aValue, rControlHandle, rCaption ); + aValue, rCaption ); rNativeContentRegion = rNativeBoundingRegion; returnVal = TRUE; @@ -1020,7 +1011,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, { rNativeBoundingRegion = NWGetSpinButtonRect( m_nScreen, nType, nPart, rControlRegion.GetBoundRect(), nState, - aValue, rControlHandle, rCaption ); + aValue, rCaption ); rNativeContentRegion = rNativeBoundingRegion; returnVal = TRUE; @@ -1028,7 +1019,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, if ( (nType==CTRL_LISTBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { rNativeBoundingRegion = NWGetListBoxButtonRect( m_nScreen, nType, nPart, rControlRegion.GetBoundRect(), nState, - aValue, rControlHandle, rCaption ); + aValue, rCaption ); rNativeContentRegion = rNativeBoundingRegion; returnVal = TRUE; @@ -1041,7 +1032,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, (nPart==PART_BUTTON) )) { - rNativeBoundingRegion = NWGetToolbarRect( m_nScreen, nType, nPart, rControlRegion.GetBoundRect(), nState, aValue, rControlHandle, rCaption ); + rNativeBoundingRegion = NWGetToolbarRect( m_nScreen, nType, nPart, rControlRegion.GetBoundRect(), nState, aValue, rCaption ); rNativeContentRegion = rNativeBoundingRegion; returnVal = TRUE; } @@ -1155,7 +1146,7 @@ BOOL GtkSalGraphics::NWPaintGTKButton( const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue&, - SalControlHandle&, const OUString& ) + const OUString& ) { GtkStateType stateType; GtkShadowType shadowType; @@ -1268,7 +1259,7 @@ BOOL GtkSalGraphics::NWPaintGTKButton( static Rectangle NWGetButtonArea( int nScreen, ControlType, ControlPart, Rectangle aAreaRect, ControlState nState, - const ImplControlValue&, SalControlHandle&, const OUString& ) + const ImplControlValue&, const OUString& ) { gboolean interiorFocus; gint focusWidth; @@ -1324,7 +1315,7 @@ BOOL GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, - const ImplControlValue& aValue, SalControlHandle&, + const ImplControlValue& aValue, const OUString& ) { GtkStateType stateType; @@ -1383,7 +1374,7 @@ BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle&, const OUString& ) + const OUString& ) { GtkStateType stateType; GtkShadowType shadowType; @@ -1438,7 +1429,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList&, ControlState nState, - const ImplControlValue& aValue, SalControlHandle&, + const ImplControlValue& aValue, const OUString& ) { ScrollbarValue* pScrollbarVal = (ScrollbarValue *)(aValue.getOptionalVal()); @@ -1844,7 +1835,7 @@ BOOL GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, + const ImplControlValue& aValue, const OUString& rCaption ) { Rectangle pixmapRect; @@ -1853,7 +1844,7 @@ BOOL GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable, // Find the overall bounding rect of the buttons's drawing area, // plus its actual draw rect excluding adornment pixmapRect = NWGetEditBoxPixmapRect( m_nScreen, nType, nPart, rControlRectangle, - nState, aValue, rControlHandle, rCaption ); + nState, aValue, rCaption ); for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it ) { clipRect.x = it->Left(); @@ -1861,7 +1852,7 @@ BOOL GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable, clipRect.width = it->GetWidth(); clipRect.height = it->GetHeight(); - NWPaintOneEditBox( m_nScreen, gdkDrawable, &clipRect, nType, nPart, pixmapRect, nState, aValue, rControlHandle, rCaption ); + NWPaintOneEditBox( m_nScreen, gdkDrawable, &clipRect, nType, nPart, pixmapRect, nState, aValue, rCaption ); } return( TRUE ); @@ -1878,7 +1869,6 @@ static Rectangle NWGetEditBoxPixmapRect(int nScreen, Rectangle aAreaRect, ControlState, const ImplControlValue&, - SalControlHandle&, const OUString& ) { Rectangle pixmapRect = aAreaRect; @@ -1915,7 +1905,6 @@ static void NWPaintOneEditBox( int nScreen, Rectangle aEditBoxRect, ControlState nState, const ImplControlValue&, - SalControlHandle&, const OUString& ) { GtkStateType stateType; @@ -1984,7 +1973,7 @@ BOOL GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart, const clipList&, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ) + const OUString& rCaption ) { GdkPixmap * pixmap; Rectangle pixmapRect; @@ -2032,8 +2021,8 @@ BOOL GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart, if ( !pixmap ) return( FALSE ); - upBtnRect = NWGetSpinButtonRect( m_nScreen, nType, upBtnPart, pixmapRect, upBtnState, aValue, rControlHandle, rCaption ); - downBtnRect = NWGetSpinButtonRect( m_nScreen, nType, downBtnPart, pixmapRect, downBtnState, aValue, rControlHandle, rCaption ); + upBtnRect = NWGetSpinButtonRect( m_nScreen, nType, upBtnPart, pixmapRect, upBtnState, aValue, rCaption ); + downBtnRect = NWGetSpinButtonRect( m_nScreen, nType, downBtnPart, pixmapRect, downBtnState, aValue, rCaption ); if ( (nType==CTRL_SPINBOX) && (nPart!=PART_ALL_BUTTONS) ) { @@ -2043,7 +2032,7 @@ BOOL GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart, aEditBoxRect.setX( 0 ); aEditBoxRect.setY( 0 ); - NWPaintOneEditBox( m_nScreen, pixmap, NULL, nType, nPart, aEditBoxRect, nState, aValue, rControlHandle, rCaption ); + NWPaintOneEditBox( m_nScreen, pixmap, NULL, nType, nPart, aEditBoxRect, nState, aValue, rCaption ); } NWSetWidgetState( gWidgetData[m_nScreen].gSpinButtonWidget, nState, stateType ); @@ -2060,8 +2049,8 @@ BOOL GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart, shadowRect.GetWidth(), shadowRect.GetHeight() ); } - NWPaintOneSpinButton( m_nScreen, pixmap, nType, upBtnPart, pixmapRect, upBtnState, aValue, rControlHandle, rCaption ); - NWPaintOneSpinButton( m_nScreen, pixmap, nType, downBtnPart, pixmapRect, downBtnState, aValue, rControlHandle, rCaption ); + NWPaintOneSpinButton( m_nScreen, pixmap, nType, upBtnPart, pixmapRect, upBtnState, aValue, rCaption ); + NWPaintOneSpinButton( m_nScreen, pixmap, nType, downBtnPart, pixmapRect, downBtnState, aValue, rCaption ); if( !NWRenderPixmapToScreen(pixmap, pixmapRect) ) { @@ -2081,7 +2070,6 @@ static Rectangle NWGetSpinButtonRect( int nScreen, Rectangle aAreaRect, ControlState, const ImplControlValue&, - SalControlHandle&, const OUString& ) { gint buttonSize; @@ -2125,7 +2113,6 @@ static void NWPaintOneSpinButton( int nScreen, Rectangle aAreaRect, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ) { Rectangle buttonRect; @@ -2137,7 +2124,7 @@ static void NWPaintOneSpinButton( int nScreen, NWEnsureGTKSpinButton( nScreen ); NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); - buttonRect = NWGetSpinButtonRect( nScreen, nType, nPart, aAreaRect, nState, aValue, rControlHandle, rCaption ); + buttonRect = NWGetSpinButtonRect( nScreen, nType, nPart, aAreaRect, nState, aValue, rCaption ); NWSetWidgetState( gWidgetData[nScreen].gSpinButtonWidget, nState, stateType ); gtk_paint_box( gWidgetData[nScreen].gSpinButtonWidget->style, pixmap, stateType, shadowType, NULL, gWidgetData[nScreen].gSpinButtonWidget, @@ -2169,7 +2156,7 @@ BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ) + const OUString& rCaption ) { Rectangle pixmapRect; Rectangle buttonRect; @@ -2194,7 +2181,7 @@ BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, NWSetWidgetState( gWidgetData[m_nScreen].gComboWidget, nState, stateType ); NWSetWidgetState( gWidgetData[m_nScreen].gArrowWidget, nState, stateType ); - buttonRect = NWGetComboBoxButtonRect( m_nScreen, nType, PART_BUTTON_DOWN, pixmapRect, nState, aValue, rControlHandle, rCaption ); + buttonRect = NWGetComboBoxButtonRect( m_nScreen, nType, PART_BUTTON_DOWN, pixmapRect, nState, aValue, rCaption ); if( nPart == PART_BUTTON_DOWN ) buttonRect.Left() += 1; @@ -2216,7 +2203,7 @@ BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, if( nPart == PART_ENTIRE_CONTROL ) NWPaintOneEditBox( m_nScreen, gdkDrawable, &clipRect, nType, nPart, aEditBoxRect, - nState, aValue, rControlHandle, rCaption ); + nState, aValue, rCaption ); // Buttons must paint opaque since some themes have alpha-channel enabled buttons gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE, @@ -2247,7 +2234,6 @@ static Rectangle NWGetComboBoxButtonRect( int nScreen, Rectangle aAreaRect, ControlState, const ImplControlValue&, - SalControlHandle&, const OUString& ) { Rectangle aButtonRect; @@ -2302,7 +2288,7 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, const clipList&, ControlState nState, const ImplControlValue& aValue, - SalControlHandle&, const OUString& ) + const OUString& ) { GdkPixmap * pixmap; Rectangle pixmapRect; @@ -2444,7 +2430,7 @@ BOOL GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ) + const OUString& rCaption ) { Rectangle pixmapRect; Rectangle widgetRect; @@ -2511,7 +2497,7 @@ BOOL GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable, y+(widgetRect.Top() - pixmapRect.Top()), widgetRect.GetWidth(), widgetRect.GetHeight() ); aIndicatorRect = NWGetListBoxIndicatorRect( m_nScreen, nType, nPart, widgetRect, nState, - aValue, rControlHandle, rCaption ); + aValue, rCaption ); gtk_paint_tab( gWidgetData[m_nScreen].gOptionMenuWidget->style, gdkDrawable, stateType, shadowType, &clipRect, gWidgetData[m_nScreen].gOptionMenuWidget, "optionmenutab", x+(aIndicatorRect.Left() - pixmapRect.Left()), @@ -2538,7 +2524,7 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar( const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle&, const OUString& ) + const OUString& ) { GtkStateType stateType; GtkShadowType shadowType; @@ -2685,7 +2671,7 @@ BOOL GtkSalGraphics::NWPaintGTKMenubar( const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue&, - SalControlHandle&, const OUString& ) + const OUString& ) { GtkStateType stateType; GtkShadowType shadowType; @@ -2770,7 +2756,7 @@ BOOL GtkSalGraphics::NWPaintGTKPopupMenu( const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue&, - SalControlHandle&, const OUString& ) + const OUString& ) { // #i50745# gtk does not draw disabled menu entries (and crux theme // even crashes), draw them using vcl functionality. @@ -2900,7 +2886,7 @@ BOOL GtkSalGraphics::NWPaintGTKTooltip( const Rectangle& rControlRectangle, const clipList& rClipList, ControlState, const ImplControlValue&, - SalControlHandle&, const OUString& ) + const OUString& ) { NWEnsureGTKTooltip( m_nScreen ); @@ -2938,7 +2924,7 @@ BOOL GtkSalGraphics::NWPaintGTKListNode( const Rectangle& rControlRectangle, const clipList&, ControlState nState, const ImplControlValue& rValue, - SalControlHandle&, const OUString& ) + const OUString& ) { NWEnsureGTKTreeView( m_nScreen ); @@ -2992,7 +2978,7 @@ BOOL GtkSalGraphics::NWPaintGTKProgress( const Rectangle& rControlRectangle, const clipList&, ControlState, const ImplControlValue& rValue, - SalControlHandle&, const OUString& ) + const OUString& ) { NWEnsureGTKProgressBar( m_nScreen ); @@ -3056,7 +3042,7 @@ BOOL GtkSalGraphics::NWPaintGTKSlider( const Rectangle& rControlRectangle, const clipList&, ControlState nState, const ImplControlValue& rValue, - SalControlHandle&, const OUString& ) + const OUString& ) { NWEnsureGTKSlider( m_nScreen ); @@ -3185,7 +3171,6 @@ static Rectangle NWGetListBoxButtonRect( int nScreen, Rectangle aAreaRect, ControlState, const ImplControlValue&, - SalControlHandle&, const OUString& ) { Rectangle aPartRect; @@ -3248,7 +3233,6 @@ static Rectangle NWGetListBoxIndicatorRect( int nScreen, Rectangle aAreaRect, ControlState, const ImplControlValue&, - SalControlHandle&, const OUString& ) { Rectangle aIndicatorRect; @@ -3295,7 +3279,6 @@ static Rectangle NWGetToolbarRect( int nScreen, Rectangle aAreaRect, ControlState, const ImplControlValue&, - SalControlHandle&, const OUString& ) { Rectangle aRet; diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx index ed3f782c8576..065b5435eeb0 100644 --- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx @@ -64,15 +64,15 @@ public: // native widget methods virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart ); virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, - const Point& aPos, SalControlHandle& rControlHandle, BOOL& rIsInside ); + const Point& aPos, BOOL& rIsInside ); virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, - ControlState nState, const ImplControlValue& aValue, SalControlHandle& rControlHandle, + ControlState nState, const ImplControlValue& aValue, const rtl::OUString& rCaption ); virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const rtl::OUString& rCaption ); + const rtl::OUString& rCaption ); virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, const rtl::OUString& rCaption, + const ImplControlValue& aValue, const rtl::OUString& rCaption, Region &rNativeBoundingRegion, Region &rNativeContentRegion ); //helper methods for frame's UpdateSettings @@ -101,86 +101,86 @@ protected: const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); BOOL NWPaintGTKRadio( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); BOOL NWPaintGTKCheck( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); BOOL NWPaintGTKScrollbar( ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); BOOL NWPaintGTKEditBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); BOOL NWPaintGTKSpinBox( ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); BOOL NWPaintGTKComboBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); BOOL NWPaintGTKTabItem( ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); BOOL NWPaintGTKListBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); BOOL NWPaintGTKToolbar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); BOOL NWPaintGTKMenubar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); BOOL NWPaintGTKPopupMenu( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); BOOL NWPaintGTKTooltip( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); BOOL NWPaintGTKProgress( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); BOOL NWPaintGTKSlider( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); BOOL NWPaintGTKListNode( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& rCaption ); + const OUString& rCaption ); BOOL drawNativeMixedStateCheck( ControlType nType, ControlPart nPart, const Region& rControlRegion, - ControlState nState, const ImplControlValue& aValue, SalControlHandle& rControlHandle, + ControlState nState, const ImplControlValue& aValue, const rtl::OUString& rCaption ); }; diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index ea9161235ac9..3adc9f5c679a 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -1177,18 +1177,18 @@ class KDESalGraphics : public X11SalGraphics virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart ); virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, const Point& aPos, - SalControlHandle& rControlHandle, BOOL& rIsInside ); + BOOL& rIsInside ); virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, + const ImplControlValue& aValue, const OUString& aCaption ); virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, + const ImplControlValue& aValue, const OUString& aCaption ); virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, + const ImplControlValue& aValue, const OUString& aCaption, Region &rNativeBoundingRegion, Region &rNativeContentRegion ); }; @@ -1242,7 +1242,7 @@ BOOL KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP */ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, const Point& rPos, - SalControlHandle&, BOOL& rIsInside ) + BOOL& rIsInside ) { if ( nType == CTRL_SCROLLBAR ) { @@ -1344,15 +1344,12 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, @param aValue An optional value (tristate/numerical/string). - @param rControlHandle - Carries platform dependent data and is maintained by the SalFrame implementation. - @param aCaption A caption or title string (like button text etc.) */ BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, - const ImplControlValue& aValue, SalControlHandle&, + const ImplControlValue& aValue, const OUString& ) { BOOL bReturn = FALSE; @@ -1489,15 +1486,12 @@ BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, @param aValue An optional value (tristate/numerical/string) - @param rControlHandle - Carries platform dependent data and is maintained by the SalFrame implementation. - @param aCaption A caption or title string (like button text etc.) */ BOOL KDESalGraphics::drawNativeControlText( ControlType, ControlPart, const Region&, ControlState, - const ImplControlValue&, SalControlHandle&, + const ImplControlValue&, const OUString& ) { return FALSE; @@ -1517,15 +1511,12 @@ BOOL KDESalGraphics::drawNativeControlText( ControlType, ControlPart, @param aValue An optional value (tristate/numerical/string) - @param rControlHandle - Carries platform dependent data and is maintained by the SalFrame implementation. - @param aCaption A caption or title string (like button text etc.) */ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, - const ImplControlValue&, SalControlHandle&, + const ImplControlValue&, const OUString&, Region &rNativeBoundingRegion, Region &rNativeContentRegion ) { diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx index 25dd50ce3958..e8d184e6539b 100644 --- a/vcl/unx/kde4/KDESalGraphics.cxx +++ b/vcl/unx/kde4/KDESalGraphics.cxx @@ -158,7 +158,7 @@ BOOL KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart par BOOL KDESalGraphics::hitTestNativeControl( ControlType, ControlPart, const Region&, const Point&, - SalControlHandle&, BOOL& ) + BOOL& ) { return FALSE; } @@ -220,7 +220,7 @@ namespace BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, const Region& rControlRegion, ControlState nControlState, - const ImplControlValue& value, SalControlHandle&, + const ImplControlValue& value, const OUString& ) { // put not implemented types here @@ -567,7 +567,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, BOOL KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, const Region& controlRegion, ControlState controlState, - const ImplControlValue& val, SalControlHandle&, + const ImplControlValue& val, const OUString&, Region &nativeBoundingRegion, Region &nativeContentRegion ) { diff --git a/vcl/unx/kde4/KDESalGraphics.hxx b/vcl/unx/kde4/KDESalGraphics.hxx index b5328f462a16..5661d743e0cd 100644 --- a/vcl/unx/kde4/KDESalGraphics.hxx +++ b/vcl/unx/kde4/KDESalGraphics.hxx @@ -59,7 +59,7 @@ class KDESalGraphics : public X11SalGraphics */ virtual BOOL hitTestNativeControl( ControlType type, ControlPart part, const Region& rControlRegion, const Point& aPos, - SalControlHandle& rControlHandle, BOOL& rIsInside ); + BOOL& rIsInside ); /** Draw the requested control described by part/nControlState. @param rControlRegion @@ -68,15 +68,12 @@ class KDESalGraphics : public X11SalGraphics @param aValue An optional value (tristate/numerical/string). - @param rControlHandle - Carries platform dependent data and is maintained by the SalFrame implementation. - @param aCaption A caption or title string (like button text etc.) */ virtual BOOL drawNativeControl( ControlType type, ControlPart part, const Region& rControlRegion, ControlState nControlState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, + const ImplControlValue& aValue, const rtl::OUString& aCaption ); /** Draw text on the widget. @@ -85,12 +82,11 @@ class KDESalGraphics : public X11SalGraphics @param rControlRegion The bounding region of the complete control in VCL frame coordinates. @param aValue An optional value (tristate/numerical/string) - @param rControlHandle Carries platform dependent data and is maintained by the SalFrame implementation. @param aCaption A caption or title string (like button text etc.) */ virtual BOOL drawNativeControlText( ControlType, ControlPart, const Region&, ControlState, - const ImplControlValue&, SalControlHandle&, + const ImplControlValue&, const rtl::OUString& ) { return false; } /** Check if the bounding regions match. @@ -106,15 +102,12 @@ class KDESalGraphics : public X11SalGraphics @param aValue An optional value (tristate/numerical/string) - @param rControlHandle - Carries platform dependent data and is maintained by the SalFrame implementation. - @param aCaption A caption or title string (like button text etc.) */ virtual BOOL getNativeControlRegion( ControlType type, ControlPart part, const Region& rControlRegion, ControlState nControlState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, + const ImplControlValue& aValue, const rtl::OUString& aCaption, Region &rNativeBoundingRegion, Region &rNativeContentRegion ); };
\ No newline at end of file diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx index bc6de4fbc94a..816c8fb0b4c4 100644 --- a/vcl/unx/source/fontmanager/fontconfig.cxx +++ b/vcl/unx/source/fontmanager/fontconfig.cxx @@ -123,6 +123,8 @@ class FontCfgWrapper FcPattern* (*m_pFcFontSetMatch)(FcConfig*,FcFontSet**, int, FcPattern*,FcResult*); FcBool (*m_pFcConfigAppFontAddFile)(FcConfig*, const FcChar8*); FcBool (*m_pFcConfigAppFontAddDir)(FcConfig*, const FcChar8*); + FcBool (*m_pFcConfigParseAndLoad)(FcConfig*,const FcChar8*,FcBool); + FcBool (*m_pFcConfigSubstitute)(FcConfig*,FcPattern*,FcMatchKind); FcBool (*m_pFcPatternAddInteger)(FcPattern*,const char*,int); FcBool (*m_pFcPatternAddDouble)(FcPattern*,const char*,double); @@ -221,6 +223,9 @@ public: { return m_pFcConfigAppFontAddFile( pConfig, pFileName ); } FcBool FcConfigAppFontAddDir(FcConfig* pConfig, const FcChar8* pDirName ) { return m_pFcConfigAppFontAddDir( pConfig, pDirName ); } + FcBool FcConfigParseAndLoad( FcConfig* pConfig, const FcChar8* pFileName, FcBool bComplain ) + { return m_pFcConfigParseAndLoad( pConfig, pFileName, bComplain ); } + void FcDefaultSubstitute( FcPattern* pPattern ) { m_pFcDefaultSubstitute( pPattern ); } FcPattern* FcFontSetMatch( FcConfig* pConfig, FcFontSet **ppFontSet, int nset, FcPattern* pPattern, FcResult* pResult ) @@ -326,6 +331,8 @@ FontCfgWrapper::FontCfgWrapper() loadSymbol( "FcConfigAppFontAddFile" ); m_pFcConfigAppFontAddDir = (FcBool(*)(FcConfig*, const FcChar8*)) loadSymbol( "FcConfigAppFontAddDir" ); + m_pFcConfigParseAndLoad = (FcBool(*)(FcConfig*, const FcChar8*, FcBool)) + loadSymbol( "FcConfigParseAndLoad" ); m_pFcDefaultSubstitute = (void(*)(FcPattern *)) loadSymbol( "FcDefaultSubstitute" ); m_pFcFontSetMatch = (FcPattern*(*)(FcConfig*,FcFontSet**,int,FcPattern*,FcResult*)) @@ -383,6 +390,7 @@ FontCfgWrapper::FontCfgWrapper() m_pFcPatternGetBool && m_pFcConfigAppFontAddFile && m_pFcConfigAppFontAddDir && + m_pFcConfigParseAndLoad && m_pFcDefaultSubstitute && m_pFcConfigSubstitute && m_pFcPatternAddInteger && @@ -767,10 +775,14 @@ int PrintFontManager::countFontconfigFonts( std::hash_map<rtl::OString, int, rtl // set family name if( pUpdate->m_nFamilyName != nFamilyName ) { +#if 0 // fontconfig prefers nameid=16 for the family name which is all fine + // but Writer suffers from #i79878# + // the only reasonable workaround for now is to use the classic nameid=1 pUpdate->m_aAliases.remove( pUpdate->m_nFamilyName ); pUpdate->m_aAliases.push_back( pUpdate->m_nFamilyName ); pUpdate->m_aAliases.remove( nFamilyName ); pUpdate->m_nFamilyName = nFamilyName; +#endif } if( eWeightRes == FcResultMatch ) pUpdate->m_eWeight = convertWeight(weight); @@ -836,13 +848,25 @@ bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName ) if( nVersion <= 20400 ) return false; const char* pDirName = (const char*)rDirName.getStr(); - bool bRet = (rWrapper.FcConfigAppFontAddDir( rWrapper.FcConfigGetCurrent(), (FcChar8*)pDirName ) == FcTrue); + bool bDirOk = (rWrapper.FcConfigAppFontAddDir( rWrapper.FcConfigGetCurrent(), (FcChar8*)pDirName ) == FcTrue); #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "FcConfigAppFontAddDir( \"%s\") => %d\n", pDirName, bRet ); #endif - return bRet; + if( bDirOk ) + { + const rtl::OString aConfFileName = rDirName + "/fc_local.conf"; + bool bCfgOk = rWrapper.FcConfigParseAndLoad( rWrapper.FcConfigGetCurrent(), + (FcChar8*)aConfFileName.getStr(), FcTrue ); + (void)bCfgOk; // silence compiler warning + +#if OSL_DEBUG_LEVEL > 1 + fprintf( stderr, "FcConfigParseAndLoad( \"%s\") => %d\n", aConfFileName.getStr(), bCfgOk ); +#endif + } + + return bDirOk; } static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern, diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h index 6b58e0c5375a..4b97eeb98c0b 100644 --- a/vcl/win/inc/salgdi.h +++ b/vcl/win/inc/salgdi.h @@ -228,15 +228,15 @@ protected: // native widget rendering methods that require mirroring virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, - const Point& aPos, SalControlHandle& rControlHandle, BOOL& rIsInside ); + const Point& aPos, BOOL& rIsInside ); virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion, - ControlState nState, const ImplControlValue& aValue, SalControlHandle& rControlHandle, + ControlState nState, const ImplControlValue& aValue, const rtl::OUString& aCaption ); virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const rtl::OUString& aCaption ); + const rtl::OUString& aCaption ); virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState, - const ImplControlValue& aValue, SalControlHandle& rControlHandle, const rtl::OUString& aCaption, + const ImplControlValue& aValue, const rtl::OUString& aCaption, Region &rNativeBoundingRegion, Region &rNativeContentRegion ); virtual bool drawAlphaBitmap( const SalTwoRect&, diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx index d1f11433d532..be5d7f8360bc 100644 --- a/vcl/win/source/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx @@ -319,7 +319,6 @@ BOOL WinSalGraphics::hitTestNativeControl( ControlType, ControlPart, const Region&, const Point&, - SalControlHandle&, BOOL& ) { return FALSE; @@ -425,7 +424,6 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, ControlPart nPart, ControlState nState, const ImplControlValue& aValue, - SalControlHandle&, OUString aCaption ) { // a listbox dropdown is actually a combobox dropdown @@ -961,7 +959,6 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, * * rControlRegion: The bounding region of the complete control in VCL frame coordinates. * aValue: An optional value (tristate/numerical/string) - * rControlHandle: Carries platform dependent data and is maintained by the WinSalGraphics implementation. * aCaption: A caption or title string (like button text etc) */ BOOL WinSalGraphics::drawNativeControl( ControlType nType, @@ -969,7 +966,6 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType, const Region& rControlRegion, ControlState nState, const ImplControlValue& aValue, - SalControlHandle& rControlHandle, const OUString& aCaption ) { BOOL bOk = false; @@ -1060,7 +1056,7 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType, OUString aCaptionStr( aCaption.replace('~', '&') ); // translate mnemonics bOk = ImplDrawNativeControl(mhDC, hTheme, rc, nType, nPart, nState, aValue, - rControlHandle, aCaptionStr ); + aCaptionStr ); // restore alignment SetTextAlign( mhDC, ta ); @@ -1080,7 +1076,6 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType, * * rControlRegion: The bounding region of the complete control in VCL frame coordinates. * aValue: An optional value (tristate/numerical/string) - * rControlHandle: Carries platform dependent data and is maintained by the WinSalGraphics implementation. * aCaption: A caption or title string (like button text etc) */ BOOL WinSalGraphics::drawNativeControlText( ControlType, @@ -1088,7 +1083,6 @@ BOOL WinSalGraphics::drawNativeControlText( ControlType, const Region&, ControlState, const ImplControlValue&, - SalControlHandle&, const OUString& ) { return( false ); @@ -1106,15 +1100,13 @@ BOOL WinSalGraphics::drawNativeControlText( ControlType, * * rControlRegion: The bounding region of the control in VCL frame coordinates. * aValue: An optional value (tristate/numerical/string) - * rControlHandle: Carries platform dependent data and is maintained by the WinSalGraphics implementation. * aCaption: A caption or title string (like button text etc) */ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, - ControlState, - const ImplControlValue&, - SalControlHandle&, + ControlState nState, + const ImplControlValue& rControlValue, const OUString&, Region &rNativeBoundingRegion, Region &rNativeContentRegion ) @@ -1230,6 +1222,7 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType, } } } + if( nType == CTRL_SLIDER && ( (nPart == PART_THUMB_HORZ) || (nPart == PART_THUMB_VERT) ) ) { HTHEME hTheme = getThemeHandle( mhWnd, L"Trackbar"); @@ -1258,6 +1251,37 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType, } } + if ( ( nType == CTRL_TAB_ITEM ) && ( nPart == PART_ENTIRE_CONTROL ) ) + { + Rectangle aControlRect( rControlRegion.GetBoundRect() ); + rNativeContentRegion = aControlRect; + + --aControlRect.Bottom(); + + TabitemValue *pValue = static_cast< TabitemValue* >( rControlValue.getOptionalVal() ); + if ( pValue ) + { + if ( pValue->isBothAligned() ) + --aControlRect.Right(); + } + + if ( nState & CTRL_STATE_SELECTED ) + { + aControlRect.Left() -= 2; + if ( pValue && !pValue->isBothAligned() ) + { + if ( pValue->isLeftAligned() || pValue->isNotAligned() ) + aControlRect.Right() += 2; + if ( pValue->isRightAligned() ) + aControlRect.Right() += 1; + } + aControlRect.Top() -= 2; + aControlRect.Bottom() += 2; + } + rNativeBoundingRegion = aControlRect; + bRet = TRUE; + } + ReleaseDC( mhWnd, hDC ); return( bRet ); } |