diff options
Diffstat (limited to 'vcl/inc/vcl')
-rw-r--r-- | vcl/inc/vcl/button.hxx | 28 | ||||
-rw-r--r-- | vcl/inc/vcl/controldata.hxx | 60 | ||||
-rw-r--r-- | vcl/inc/vcl/ctrl.hxx | 52 | ||||
-rw-r--r-- | vcl/inc/vcl/edit.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/vcl/fixbrd.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/vcl/fixed.hxx | 13 | ||||
-rw-r--r-- | vcl/inc/vcl/group.hxx | 5 | ||||
-rw-r--r-- | vcl/inc/vcl/ilstbox.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/vcl/outdev.hxx | 25 | ||||
-rw-r--r-- | vcl/inc/vcl/slider.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/vcl/tabctrl.hxx | 3 | ||||
-rwxr-xr-x | vcl/inc/vcl/textlayout.hxx | 134 | ||||
-rw-r--r-- | vcl/inc/vcl/window.hxx | 1 |
13 files changed, 305 insertions, 20 deletions
diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx index 94df24a9cea7..b80edf6712cd 100644 --- a/vcl/inc/vcl/button.hxx +++ b/vcl/inc/vcl/button.hxx @@ -144,10 +144,10 @@ protected: SAL_DLLPRIVATE PushButton( const PushButton & ); SAL_DLLPRIVATE PushButton& operator=( const PushButton & ); -protected: - using Window::ImplInit; SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle ); + using Control::ImplInitSettings; + using Window::ImplInit; public: SAL_DLLPRIVATE void ImplSetDefButton( BOOL bSet ); SAL_DLLPRIVATE static void ImplDrawPushButtonFrame( Window* pDev, Rectangle& rRect, USHORT nStyle ); @@ -158,6 +158,10 @@ protected: PushButton( WindowType nType ); virtual void FillLayoutData() const; + virtual const Font& + GetCanonicalFont( const StyleSettings& _rStyle ) const; + virtual const Color& + GetCanonicalTextColor( const StyleSettings& _rStyle ) const; public: PushButton( Window* pParent, WinBits nStyle = 0 ); PushButton( Window* pParent, const ResId& rResId ); @@ -307,19 +311,20 @@ private: SAL_DLLPRIVATE void ImplDrawRadioButtonState(); SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags, const Point& rPos, const Size& rSize, - const Size& rImageSize, long nImageSep, - Rectangle& rStateRect, Rectangle& rMouseRect, - bool bLayout = false ); + const Size& rImageSize, Rectangle& rStateRect, + Rectangle& rMouseRect, bool bLayout = false ); SAL_DLLPRIVATE void ImplDrawRadioButton( bool bLayout = false ); SAL_DLLPRIVATE void ImplInvalidateOrDrawRadioButtonState(); SAL_DLLPRIVATE void ImplUncheckAllOther(); SAL_DLLPRIVATE Size ImplGetRadioImageSize() const; + SAL_DLLPRIVATE long ImplGetImageToTextDistance() const; // Copy assignment is forbidden and not implemented. SAL_DLLPRIVATE RadioButton(const RadioButton &); SAL_DLLPRIVATE RadioButton& operator= (const RadioButton &); protected: + using Control::ImplInitSettings; using Window::ImplInit; SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle ); SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId ); @@ -330,6 +335,10 @@ public: protected: virtual void FillLayoutData() const; + virtual const Font& + GetCanonicalFont( const StyleSettings& _rStyle ) const; + virtual const Color& + GetCanonicalTextColor( const StyleSettings& _rStyle ) const; inline void SetMouseRect( const Rectangle& _rMouseRect ) { maMouseRect = _rMouseRect; } inline const Rectangle& GetMouseRect( ) const { return maMouseRect; } @@ -420,10 +429,10 @@ private: SAL_DLLPRIVATE void ImplInvalidateOrDrawCheckBoxState(); SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags, const Point& rPos, const Size& rSize, - const Size& rImageSize, long nImageSep, - Rectangle& rStateRect, + const Size& rImageSize, Rectangle& rStateRect, Rectangle& rMouseRect, bool bLayout ); SAL_DLLPRIVATE void ImplDrawCheckBox( bool bLayout = false ); + SAL_DLLPRIVATE long ImplGetImageToTextDistance() const; SAL_DLLPRIVATE Size ImplGetCheckImageSize() const; // Copy assignment is forbidden and not implemented. @@ -431,10 +440,15 @@ private: SAL_DLLPRIVATE CheckBox& operator= (const CheckBox &); protected: + using Control::ImplInitSettings; using Window::ImplInit; SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle ); SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId ); SAL_DLLPRIVATE virtual void FillLayoutData() const; + SAL_DLLPRIVATE virtual const Font& + GetCanonicalFont( const StyleSettings& _rStyle ) const; + SAL_DLLPRIVATE virtual const Color& + GetCanonicalTextColor( const StyleSettings& _rStyle ) const; public: SAL_DLLPRIVATE void ImplCheck(); diff --git a/vcl/inc/vcl/controldata.hxx b/vcl/inc/vcl/controldata.hxx new file mode 100644 index 000000000000..9ea698e792bd --- /dev/null +++ b/vcl/inc/vcl/controldata.hxx @@ -0,0 +1,60 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* 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. +************************************************************************/ +
+#ifndef VCL_CONTROLDATA_HXX +#define VCL_CONTROLDATA_HXX + +#include <vcl/controllayout.hxx> + +//........................................................................ +namespace vcl +{ +//........................................................................ + + //==================================================================== + //= ImplControlData + //==================================================================== + struct ImplControlData + { + mutable ControlLayoutData* mpLayoutData; + OutputDevice* mpReferenceDevice; + + ImplControlData() + :mpLayoutData( NULL ) + ,mpReferenceDevice( NULL ) + { + } + + ~ImplControlData() + { + delete mpLayoutData; + } + }; + +//........................................................................ +} // namespace vcl +//........................................................................ + +#endif // VCL_CONTROLDATA_HXX diff --git a/vcl/inc/vcl/ctrl.hxx b/vcl/inc/vcl/ctrl.hxx index 7bb5620ef93f..535f75549991 100644 --- a/vcl/inc/vcl/ctrl.hxx +++ b/vcl/inc/vcl/ctrl.hxx @@ -38,7 +38,7 @@ #include <vcl/salnativewidgets.hxx> // forward -namespace vcl { struct ControlLayoutData; } +namespace vcl { struct ImplControlData; struct ControlLayoutData; } // ----------- // - Control - @@ -47,11 +47,12 @@ namespace vcl { struct ControlLayoutData; } class VCL_DLLPUBLIC Control : public Window { protected: - mutable vcl::ControlLayoutData* mpLayoutData; + ::vcl::ImplControlData* mpControlData; + private: - BOOL mbHasFocus; - Link maGetFocusHdl; - Link maLoseFocusHdl; + BOOL mbHasFocus; + Link maGetFocusHdl; + Link maLoseFocusHdl; SAL_DLLPRIVATE void ImplInitControlData(); @@ -66,6 +67,14 @@ protected: // helper method for composite controls void AppendLayoutData( const Control& rSubControl ) const; + /// creates the mpData->mpLayoutData structure + void CreateLayoutData() const; + /// determines whether we currently have layout data + bool HasLayoutData() const; + /// returns the current layout data + ::vcl::ControlLayoutData* + GetLayoutData() const; + /** this calls both our event listeners, and a specified handler If the Control instance is destroyed during any of those calls, the @@ -84,6 +93,25 @@ protected: ULONG nEvent, const Link& rHandler, void* pCaller ); + /** draws the given text onto the given device + + If no reference device is set, the draw request will simply be forwarded to OutputDevice::DrawText. Otherwise, + the text will be rendered according to the metrics at the reference device. + + Note that the given rectangle might be modified, it will contain the result of a GetTextRect call (either + directly at the target device, or taking the reference device into account) when returning. + */ + void DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRect, + const XubString& _rStr, USHORT _nStyle, + MetricVector* _pVector, String* _pDisplayText ) const; + + virtual const Font& + GetCanonicalFont( const StyleSettings& _rStyle ) const; + virtual const Color& + GetCanonicalTextColor( const StyleSettings& _rStyle ) const; + + void ImplInitSettings( const BOOL _bFont, const BOOL _bForeground ); + //#if 0 // _SOLAR__PRIVATE public: SAL_DLLPRIVATE void ImplClearLayoutData() const; @@ -157,6 +185,20 @@ public: void SetLayoutDataParent( const Control* pParent ) const; virtual Size GetOptimalSize(WindowSizeType eType) const; + + /** sets a reference device used for rendering control text + @seealso DrawControlText + */ + void SetReferenceDevice( OutputDevice* _referenceDevice ); + OutputDevice* GetReferenceDevice() const; + + Font GetUnzoomedControlPointFont() const + { + Font aFont( GetCanonicalFont( GetSettings().GetStyleSettings() ) ); + if ( IsControlFont() ) + aFont.Merge( GetControlFont() ); + return aFont; + } }; #endif // _SV_CTRL_HXX diff --git a/vcl/inc/vcl/edit.hxx b/vcl/inc/vcl/edit.hxx index 534d63b3427c..fb99bd028631 100644 --- a/vcl/inc/vcl/edit.hxx +++ b/vcl/inc/vcl/edit.hxx @@ -124,6 +124,7 @@ private: SAL_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > ImplGetBreakIterator() const; protected: + using Control::ImplInitSettings; using Window::ImplInit; SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle ); SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle ); diff --git a/vcl/inc/vcl/fixbrd.hxx b/vcl/inc/vcl/fixbrd.hxx index 52de68d1c71f..68e1e69b9054 100644 --- a/vcl/inc/vcl/fixbrd.hxx +++ b/vcl/inc/vcl/fixbrd.hxx @@ -57,6 +57,7 @@ private: BOOL mbTransparent; private: + using Control::ImplInitSettings; using Window::ImplInit; SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle ); SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle ); diff --git a/vcl/inc/vcl/fixed.hxx b/vcl/inc/vcl/fixed.hxx index ba576f280b83..a5c834fce486 100644 --- a/vcl/inc/vcl/fixed.hxx +++ b/vcl/inc/vcl/fixed.hxx @@ -47,6 +47,7 @@ class VCL_DLLPUBLIC FixedText : public Control { //#if 0 // _SOLAR__PRIVATE private: + using Control::ImplInitSettings; using Window::ImplInit; SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle ); SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle ); @@ -58,6 +59,11 @@ public: //#endif protected: virtual void FillLayoutData() const; + virtual const Font& + GetCanonicalFont( const StyleSettings& _rStyle ) const; + virtual const Color& + GetCanonicalTextColor( const StyleSettings& _rStyle ) const; + public: FixedText( Window* pParent, WinBits nStyle = 0 ); FixedText( Window* pParent, const ResId& rResId ); @@ -81,6 +87,7 @@ public: class VCL_DLLPUBLIC FixedLine : public Control { private: + using Control::ImplInitSettings; using Window::ImplInit; SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle ); SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle ); @@ -89,6 +96,10 @@ private: protected: virtual void FillLayoutData() const; + virtual const Font& + GetCanonicalFont( const StyleSettings& _rStyle ) const; + virtual const Color& + GetCanonicalTextColor( const StyleSettings& _rStyle ) const; public: FixedLine( Window* pParent, WinBits nStyle = WB_HORZ ); @@ -113,6 +124,7 @@ private: Bitmap maBitmap; Bitmap maBitmapHC; + using Control::ImplInitSettings; using Window::ImplInit; SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle ); SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle ); @@ -153,6 +165,7 @@ private: BOOL mbInUserDraw; private: + using Control::ImplInitSettings; using Window::ImplInit; SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle ); SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle ); diff --git a/vcl/inc/vcl/group.hxx b/vcl/inc/vcl/group.hxx index 0e84344587c7..7d5dd43fbee3 100644 --- a/vcl/inc/vcl/group.hxx +++ b/vcl/inc/vcl/group.hxx @@ -42,6 +42,7 @@ class VCL_DLLPUBLIC GroupBox : public Control { private: + using Control::ImplInitSettings; using Window::ImplInit; SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle ); SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle ); @@ -50,6 +51,10 @@ private: const Point& rPos, const Size& rSize, bool bLayout = false ); virtual void FillLayoutData() const; + virtual const Font& + GetCanonicalFont( const StyleSettings& _rStyle ) const; + virtual const Color& + GetCanonicalTextColor( const StyleSettings& _rStyle ) const; public: GroupBox( Window* pParent, WinBits nStyle = 0 ); diff --git a/vcl/inc/vcl/ilstbox.hxx b/vcl/inc/vcl/ilstbox.hxx index e5f6696005fa..81dd32ef2705 100644 --- a/vcl/inc/vcl/ilstbox.hxx +++ b/vcl/inc/vcl/ilstbox.hxx @@ -369,6 +369,7 @@ public: void SetReadOnly( BOOL bReadOnly ) { mbReadOnly = bReadOnly; } BOOL IsReadOnly() const { return mbReadOnly; } + using Control::ImplInitSettings; void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); USHORT ImplGetTextStyle() const; diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx index f4e42846dd5e..130492a2bd0c 100644 --- a/vcl/inc/vcl/outdev.hxx +++ b/vcl/inc/vcl/outdev.hxx @@ -103,8 +103,12 @@ namespace awt { typedef std::vector< Rectangle > MetricVector; -namespace vcl { class PDFWriterImpl; } -namespace vcl { class ExtOutDevData; } +namespace vcl +{ + class PDFWriterImpl; + class ExtOutDevData; + class ITextLayout; +} #define OUTDEV_BUFFER_SIZE 128 @@ -431,9 +435,13 @@ public: SAL_DLLPRIVATE SalLayout* ImplGlyphFallbackLayout( SalLayout*, ImplLayoutArgs& ) const; SAL_DLLPRIVATE long ImplGetTextWidth( const SalLayout& ) const; - SAL_DLLPRIVATE void ImplDrawText( const Rectangle& rRect, + static + SAL_DLLPRIVATE XubString ImplGetEllipsisString( const OutputDevice& rTargetDevice, const XubString& rStr, + long nMaxWidth, USHORT nStyle, const ::vcl::ITextLayout& _rLayout ); + static + SAL_DLLPRIVATE void ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect, const String& rOrigStr, USHORT nStyle, - MetricVector* pVector, String* pDisplayText ); + MetricVector* pVector, String* pDisplayText, ::vcl::ITextLayout& _rLayout ); SAL_DLLPRIVATE void ImplDrawTextBackground( const SalLayout& ); SAL_DLLPRIVATE void ImplDrawTextLines( SalLayout&, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, BOOL bWordLine, BOOL bUnderlineAbove ); SAL_DLLPRIVATE bool ImplDrawRotateText( SalLayout& ); @@ -456,7 +464,8 @@ public: SAL_DLLPRIVATE void ImplDrawMnemonicLine( long nX, long nY, long nWidth ); SAL_DLLPRIVATE void ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine, Rectangle& rRect1, Rectangle& rRect2, long& rYOff, long& rWidth, FontEmphasisMark eEmphasis, long nHeight, short nOrient ); SAL_DLLPRIVATE void ImplDrawEmphasisMark( long nBaseX, long nX, long nY, const PolyPolygon& rPolyPoly, BOOL bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 ); - SAL_DLLPRIVATE long ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const XubString& rStr, USHORT nStyle ) const; + static + SAL_DLLPRIVATE long ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const XubString& rStr, USHORT nStyle, const ::vcl::ITextLayout& _rLayout ); SAL_DLLPRIVATE void ImplInitFontList() const; SAL_DLLPRIVATE void ImplUpdateFontData( bool bNewFontLists ); SAL_DLLPRIVATE static void ImplUpdateAllFontData( bool bNewFontLists ); @@ -649,10 +658,12 @@ public: GDIMetaFile& rMtf ); void DrawText( const Rectangle& rRect, const XubString& rStr, USHORT nStyle = 0, - MetricVector* pVector = NULL, String* pDisplayText = NULL ); + MetricVector* pVector = NULL, String* pDisplayText = NULL, + ::vcl::ITextLayout* _pTextLayout = NULL ); Rectangle GetTextRect( const Rectangle& rRect, const XubString& rStr, USHORT nStyle = TEXT_DRAW_WORDBREAK, - TextRectInfo* pInfo = NULL ) const; + TextRectInfo* pInfo = NULL, + const ::vcl::ITextLayout* _pTextLayout = NULL ) const; XubString GetEllipsisString( const XubString& rStr, long nMaxWidth, USHORT nStyle = TEXT_DRAW_ENDELLIPSIS ) const; void DrawCtrlText( const Point& rPos, const XubString& rStr, diff --git a/vcl/inc/vcl/slider.hxx b/vcl/inc/vcl/slider.hxx index 396ed0ca83cb..c3dfcfd42608 100644 --- a/vcl/inc/vcl/slider.hxx +++ b/vcl/inc/vcl/slider.hxx @@ -70,6 +70,7 @@ private: Link maSlideHdl; Link maEndSlideHdl; + using Control::ImplInitSettings; using Window::ImplInit; SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle ); SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId ); diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx index 378459b9eadb..30edf6227a60 100644 --- a/vcl/inc/vcl/tabctrl.hxx +++ b/vcl/inc/vcl/tabctrl.hxx @@ -78,6 +78,7 @@ private: Link maActivateHdl; Link maDeactivateHdl; + using Control::ImplInitSettings; SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); SAL_DLLPRIVATE ImplTabItem* ImplGetItem( USHORT nId ) const; SAL_DLLPRIVATE void ImplScrollBtnsColor(); @@ -101,6 +102,8 @@ protected: SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId ); virtual void FillLayoutData() const; + virtual const Font& GetCanonicalFont( const StyleSettings& _rStyle ) const; + virtual const Color& GetCanonicalTextColor( const StyleSettings& _rStyle ) const; SAL_DLLPRIVATE Rectangle* ImplFindPartRect( const Point& rPt ); public: diff --git a/vcl/inc/vcl/textlayout.hxx b/vcl/inc/vcl/textlayout.hxx new file mode 100755 index 000000000000..4c290452e2ad --- /dev/null +++ b/vcl/inc/vcl/textlayout.hxx @@ -0,0 +1,134 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* 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. +************************************************************************/ +
+#ifndef VCL_TEXTLAYOUT_HXX +#define VCL_TEXTLAYOUT_HXX + +#include "vcl/outdev.hxx" + +#include <tools/solar.h> +#include <tools/string.hxx> + +#include <memory> + +class Control; + +//........................................................................ +namespace vcl +{ +//........................................................................ + + //==================================================================== + //= ITextLayout + //==================================================================== + class SAL_NO_VTABLE ITextLayout + { + public: + virtual long GetTextWidth( const XubString& _rText, xub_StrLen _nStartIndex, xub_StrLen _nLength ) const = 0; + virtual void DrawText( const Point& _rStartPoint, const XubString& _rText, xub_StrLen _nStartIndex, xub_StrLen _nLength, + MetricVector* _pVector, String* _pDisplayText ) = 0; + virtual bool GetCaretPositions( const XubString& _rText, sal_Int32* _pCaretXArray, xub_StrLen _nStartIndex, xub_StrLen _nLength ) const = 0; + virtual xub_StrLen GetTextBreak( const XubString& _rText, long _nMaxTextWidth, xub_StrLen _nStartIndex, xub_StrLen _nLength ) const = 0; + virtual bool DecomposeTextRectAction() const = 0; + }; + + //==================================================================== + //= DefaultTextLayout + //==================================================================== + /** is an implementation of the ITextLayout interface which simply delegates its calls to the respective + methods of an OutputDevice instance, without any inbetween magic. + */ + class DefaultTextLayout : public ITextLayout + { + public: + DefaultTextLayout( OutputDevice& _rTargetDevice ) + :m_rTargetDevice( _rTargetDevice ) + { + } + virtual ~DefaultTextLayout(); + + // ITextLayout overridables + virtual long GetTextWidth( + const XubString& _rText, + xub_StrLen _nStartIndex, + xub_StrLen _nLength + ) const; + virtual void DrawText( + const Point& _rStartPoint, + const XubString& _rText, + xub_StrLen _nStartIndex, + xub_StrLen _nLength, + MetricVector* _pVector, + String* _pDisplayText + ); + virtual bool GetCaretPositions( + const XubString& _rText, + sal_Int32* _pCaretXArray, + xub_StrLen _nStartIndex, + xub_StrLen _nLength + ) const; + virtual xub_StrLen GetTextBreak( + const XubString& _rText, + long _nMaxTextWidth, + xub_StrLen _nStartIndex, + xub_StrLen _nLength + ) const; + virtual bool DecomposeTextRectAction() const; + + private: + OutputDevice& m_rTargetDevice; + }; + + //==================================================================== + //= ControlTextRenderer + //==================================================================== + class ReferenceDeviceTextLayout; + /** a class which allows rendering text of a Control onto a device, by taking into account the metrics of + a reference device. + */ + class ControlTextRenderer + { + public: + ControlTextRenderer( const Control& _rControl, OutputDevice& _rTargetDevice, OutputDevice& _rReferenceDevice ); + virtual ~ControlTextRenderer(); + + Rectangle DrawText( const Rectangle& _rRect, + const XubString& _rText, USHORT _nStyle = 0, + MetricVector* _pVector = NULL, String* _pDisplayText = NULL ); + + private: + ControlTextRenderer(); // never implemented + ControlTextRenderer( const ControlTextRenderer& ); // never implemented + ControlTextRenderer& operator=( const ControlTextRenderer& ); // never implemented + + private: + ::std::auto_ptr< ReferenceDeviceTextLayout > m_pImpl; + }; + +//........................................................................ +} // namespace vcl +//........................................................................ + +#endif // VCL_TEXTLAYOUT_HXX diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx index eba46362d94e..56fdb22ddc57 100644 --- a/vcl/inc/vcl/window.hxx +++ b/vcl/inc/vcl/window.hxx @@ -321,7 +321,6 @@ typedef USHORT StateChangedType; #define IMPL_MSGBOX_OFFSET_EXTRA_X 0 #define IMPL_MSGBOX_OFFSET_EXTRA_Y 2 #define IMPL_SEP_MSGBOX_IMAGE 8 -#define IMPL_SEP_BUTTON_IMAGE 4 #define DLGWINDOW_PREV 0 #define DLGWINDOW_NEXT 1 |