diff options
Diffstat (limited to 'vcl')
44 files changed, 367 insertions, 206 deletions
diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h index 476400f1564b..4c52c06a7393 100644 --- a/vcl/aqua/inc/salgdi.h +++ b/vcl/aqua/inc/salgdi.h @@ -348,6 +348,7 @@ public: virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart ); virtual SystemGraphicsData GetGraphicsData() const; + virtual SystemFontData GetSysFontData( int /* nFallbacklevel */ ) const; private: // differences between VCL, Quartz and kHiThemeOrientation coordinate systems diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index 661eb64b83ce..b1499e2c32d5 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -2298,6 +2298,43 @@ void AquaSalGraphics::FreeEmbedFontData( const void* pData, long nDataLen ) // ----------------------------------------------------------------------- +SystemFontData AquaSalGraphics::GetSysFontData( int /* nFallbacklevel */ ) const +{ + SystemFontData aSysFontData; + OSStatus err; + aSysFontData.nSize = sizeof( SystemFontData ); + + // NOTE: Native ATSU font fallbacks are used, not the VCL fallbacks. + ATSUFontID fontId; + err = ATSUGetAttribute( maATSUStyle, kATSUFontTag, sizeof(fontId), &fontId, 0 ); + if (err) fontId = 0; + aSysFontData.aATSUFontID = (void *) fontId; + + Boolean bFbold; + err = ATSUGetAttribute( maATSUStyle, kATSUQDBoldfaceTag, sizeof(bFbold), &bFbold, 0 ); + if (err) bFbold = FALSE; + aSysFontData.bFakeBold = (bool) bFbold; + + Boolean bFItalic; + err = ATSUGetAttribute( maATSUStyle, kATSUQDItalicTag, sizeof(bFItalic), &bFItalic, 0 ); + if (err) bFItalic = FALSE; + aSysFontData.bFakeItalic = (bool) bFItalic; + + ATSUVerticalCharacterType aVerticalCharacterType; + err = ATSUGetAttribute( maATSUStyle, kATSUVerticalCharacterTag, sizeof(aVerticalCharacterType), &aVerticalCharacterType, 0 ); + if (!err && aVerticalCharacterType == kATSUStronglyVertical) { + aSysFontData.bVerticalCharacterType = true; + } else { + aSysFontData.bVerticalCharacterType = false; + } + + aSysFontData.bAntialias = !mbNonAntialiasedText; + + return aSysFontData; +} + +// ----------------------------------------------------------------------- + SystemGraphicsData AquaSalGraphics::GetGraphicsData() const { SystemGraphicsData aRes; diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx index c0bcfa35fae5..3f821f995a51 100644 --- a/vcl/inc/vcl/outdev.hxx +++ b/vcl/inc/vcl/outdev.hxx @@ -53,6 +53,8 @@ class ImplFontEntry; struct ImplObjStack; struct ImplKernPairData; struct SystemGraphicsData; +struct SystemFontData; +struct SystemTextLayoutData; class ImplFontCache; class ImplDevFontList; class ImplGetDevFontList; @@ -883,6 +885,12 @@ public: void SetFont( const Font& rNewFont ); const Font& GetFont() const { return maFont; } + + SystemFontData GetSysFontData( int nFallbacklevel ) const; + SystemTextLayoutData GetSysTextLayoutData( const Point& rStartPt, const XubString& rStr, + xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN, + const sal_Int32* pDXAry = NULL ) const; + void SetTextColor( const Color& rColor ); const Color& GetTextColor() const { return maTextColor; } void SetTextFillColor(); diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx index 2bbb44d67b42..5cf6e70f5114 100644 --- a/vcl/inc/vcl/salgdi.hxx +++ b/vcl/inc/vcl/salgdi.hxx @@ -57,6 +57,7 @@ struct FontSubsetInfo; class OutputDevice; class ServerFontLayout; struct SystemGraphicsData; +struct SystemFontData; namespace basegfx { class B2DVector; @@ -493,6 +494,7 @@ public: sal_uInt8 nTransparency, const OutputDevice *pOutDev ); virtual SystemGraphicsData GetGraphicsData() const = 0; + virtual SystemFontData GetSysFontData( int nFallbacklevel ) const = 0; }; #endif // _SV_SALGDI_HXX diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx index d98a6373d6fc..2e2a5e80e761 100644 --- a/vcl/inc/vcl/sysdata.hxx +++ b/vcl/inc/vcl/sysdata.hxx @@ -31,10 +31,12 @@ #ifndef _SV_SYSDATA_HXX #define _SV_SYSDATA_HXX +#include <vector> + #ifdef QUARTZ // predeclare the native classes to avoid header/include problems typedef struct CGContext *CGContextRef; -typedef struct CGLayer *CGLayerRef; +typedef struct CGLayer *CGLayerRef; #ifdef __OBJC__ @class NSView; #else @@ -141,4 +143,50 @@ struct SystemWindowData #endif }; + +// -------------------- +// - SystemGlyphData - +// -------------------- + +struct SystemGlyphData +{ + unsigned long index; + double x; + double y; +}; + + +// -------------------- +// - SystemFontData - +// -------------------- + +struct SystemFontData +{ + unsigned long nSize; // size in bytes of this structure +#if defined( WNT ) + HFONT hFont; // native font object +#elif defined( QUARTZ ) + void* aATSUFontID; // native font object +#elif defined( UNX ) + void* nFontId; // native font id + int nFontFlags; // native font flags +#endif + bool bFakeBold; // Does this font need faking the bold style + bool bFakeItalic; // Does this font need faking the italic style + bool bAntialias; // Should this font be antialiased + bool bVerticalCharacterType; // Is the font using vertical character type +}; + +// -------------------- +// - SystemTextLayoutData - +// -------------------- + +struct SystemTextLayoutData +{ + unsigned long nSize; // size in bytes of this structure + std::vector<SystemGlyphData> rGlyphData; // glyph data + int orientation; // Text orientation + SystemFontData aSysFontData; // Font data for the text layout +}; + #endif // _SV_SYSDATA_HXX diff --git a/vcl/os2/inc/salgdi.h b/vcl/os2/inc/salgdi.h index 5e70f50ada79..1fb51f089100 100644 --- a/vcl/os2/inc/salgdi.h +++ b/vcl/os2/inc/salgdi.h @@ -328,6 +328,7 @@ public: virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart ); virtual SystemGraphicsData GetGraphicsData() const; + virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; }; // Init/Deinit Graphics diff --git a/vcl/os2/source/gdi/salgdi3.cxx b/vcl/os2/source/gdi/salgdi3.cxx index 546f4bf2b7cd..573fa7336fb0 100644 --- a/vcl/os2/source/gdi/salgdi3.cxx +++ b/vcl/os2/source/gdi/salgdi3.cxx @@ -1754,3 +1754,21 @@ void Os2SalGraphics::DrawServerFontLayout( const ServerFontLayout& ) //-------------------------------------------------------------------------- +SystemFontData Os2SalGraphics::GetSysFontData( int nFallbacklevel ) const +{ + SystemFontData aSysFontData; + + if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1; + if (nFallbacklevel < 0 ) nFallbacklevel = 0; + + aSysFontData.nSize = sizeof( SystemFontData ); + aSysFontData.hFont = mhFonts[nFallbacklevel]; + aSysFontData.bFakeBold = false; + aSysFontData.bFakeItalic = false; + aSysFontData.bAntialias = true; + aSysFontData.bVerticalCharacterType = false; + + return aSysFontData; +} + +//-------------------------------------------------------------------------- diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 521e56da207e..537964582ceb 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -63,6 +63,7 @@ #include <vcl/outdev.hxx> #include <vcl/edit.hxx> #include <vcl/fontcfg.hxx> +#include <vcl/sysdata.hxx> #ifndef _OSL_FILE_H #include <osl/file.h> #endif @@ -7700,6 +7701,97 @@ FontMetric OutputDevice::GetFontMetric( const Font& rFont ) const // ----------------------------------------------------------------------- +/** OutputDevice::GetSysFontData + * + * @param nFallbacklevel Fallback font level (0 = best matching font) + * + * Retrieve detailed font information in platform independent structure + * + * @return SystemFontData + **/ +SystemFontData OutputDevice::GetSysFontData(int nFallbacklevel) const +{ + SystemFontData aSysFontData; + aSysFontData.nSize = sizeof(aSysFontData); + + if (!mpGraphics) ImplGetGraphics(); + if (mpGraphics) aSysFontData = mpGraphics->GetSysFontData(nFallbacklevel); + + return aSysFontData; +} + + +// ----------------------------------------------------------------------- + +/** OutputDevice::GetSysTextLayoutData + * + * @param rStartPt Start point of the text + * @param rStr Text string that will be transformed into layout of glyphs + * @param nIndex Position in the string from where layout will be done + * @param nLen Length of the string + * @param pDXAry Custom layout adjustment data + * + * Export finalized glyph layout data as platform independent SystemTextLayoutData + * (see vcl/inc/vcl/sysdata.hxx) + * + * Only parameters rStartPt and rStr are mandatory, the rest is optional + * (default values will be used) + * + * @return SystemTextLayoutData + **/ +SystemTextLayoutData OutputDevice::GetSysTextLayoutData(const Point& rStartPt, const XubString& rStr, xub_StrLen nIndex, xub_StrLen nLen, + const sal_Int32* pDXAry) const +{ + DBG_TRACE( "OutputDevice::GetSysTextLayoutData()" ); + DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice ); + + SystemTextLayoutData aSysLayoutData; + aSysLayoutData.nSize = sizeof(aSysLayoutData); + aSysLayoutData.rGlyphData.reserve( 256 ); + + if ( mpMetaFile ) { + if (pDXAry) + mpMetaFile->AddAction( new MetaTextArrayAction( rStartPt, rStr, pDXAry, nIndex, nLen ) ); + else + mpMetaFile->AddAction( new MetaTextAction( rStartPt, rStr, nIndex, nLen ) ); + } + + if ( !IsDeviceOutputNecessary() ) return aSysLayoutData; + + SalLayout* rLayout = ImplLayout( rStr, nIndex, nLen, rStartPt, 0, pDXAry, true ); + + // setup glyphs + Point aPos; + sal_GlyphId aGlyphId; + int nFallbacklevel = 0; + for( int nStart = 0; rLayout->GetNextGlyphs( 1, &aGlyphId, aPos, nStart ); ) + { + // NOTE: Windows backend is producing unicode chars (ucs4), so on windows, + // ETO_GLYPH_INDEX is unusable, unless extra glyph conversion is made. + + SystemGlyphData aGlyph; + aGlyph.index = static_cast<unsigned long> (aGlyphId & GF_IDXMASK); + aGlyph.x = aPos.X(); + aGlyph.y = aPos.Y(); + aSysLayoutData.rGlyphData.push_back(aGlyph); + + int nLevel = (aGlyphId & GF_FONTMASK) >> GF_FONTSHIFT; + if (nLevel > nFallbacklevel && nLevel < MAX_FALLBACK) + nFallbacklevel = nLevel; + } + + // Get font data + aSysLayoutData.aSysFontData = GetSysFontData(nFallbacklevel); + aSysLayoutData.orientation = rLayout->GetOrientation(); + + rLayout->Release(); + + return aSysLayoutData; +} + +// ----------------------------------------------------------------------- + + long OutputDevice::GetMinKashida() const { DBG_TRACE( "OutputDevice::GetMinKashida()" ); diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index e30c36650aa4..9ad5d8e13705 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -45,9 +45,9 @@ #include <vcl/svapp.hxx> #include <vcl/window.hxx> -#include <prex.h> +#include <tools/prex.h> #include <X11/Xatom.h> -#include <postx.h> +#include <tools/postx.h> #include <dlfcn.h> #include <vcl/salbtype.hxx> diff --git a/vcl/unx/headless/svpgdi.cxx b/vcl/unx/headless/svpgdi.cxx index 4ee06961444a..cd3e286d167a 100644 --- a/vcl/unx/headless/svpgdi.cxx +++ b/vcl/unx/headless/svpgdi.cxx @@ -558,6 +558,22 @@ BOOL SvpSalGraphics::drawEPS( long, long, long, long, void*, ULONG ) return FALSE; } +SystemFontData SvpSalGraphics::GetSysFontData( int nFallbacklevel ) const +{ + SystemFontData aSysFontData; + + if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1; + if (nFallbacklevel < 0 ) nFallbacklevel = 0; + + aSysFontData.nSize = sizeof( SystemFontData ); + aSysFontData.nFontId = 0; + aSysFontData.nFontFlags = 0; + aSysFontData.bFakeBold = false; + aSysFontData.bFakeItalic = false; + aSysFontData.bAntialias = true; + return aSysFontData; +} + SystemGraphicsData SvpSalGraphics::GetGraphicsData() const { SystemGraphicsData aRes; diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx index 984a77cccfad..1c71704c0031 100644 --- a/vcl/unx/headless/svpgdi.hxx +++ b/vcl/unx/headless/svpgdi.hxx @@ -169,6 +169,7 @@ public: virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize ); virtual SystemGraphicsData GetGraphicsData() const; + virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; }; #endif diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index 2ff48966c765..eb342a130d85 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -1398,6 +1398,22 @@ bool PspGraphics::filterText( const String& rOrig, String& rNewText, xub_StrLen return bRet && m_bSwallowFaxNo; } +SystemFontData PspGraphics::GetSysFontData( int nFallbacklevel ) const +{ + SystemFontData aSysFontData; + + if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1; + if (nFallbacklevel < 0 ) nFallbacklevel = 0; + + aSysFontData.nSize = sizeof( SystemFontData ); + aSysFontData.nFontId = 0; + aSysFontData.nFontFlags = 0; + aSysFontData.bFakeBold = false; + aSysFontData.bFakeItalic = false; + aSysFontData.bAntialias = true; + return aSysFontData; +} + SystemGraphicsData PspGraphics::GetGraphicsData() const { SystemGraphicsData aRes; diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx index ba7d690a9f90..81e4a29b8d55 100644 --- a/vcl/unx/headless/svppspgraphics.hxx +++ b/vcl/unx/headless/svppspgraphics.hxx @@ -194,7 +194,9 @@ public: virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize ); virtual bool filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop ); + virtual SystemGraphicsData GetGraphicsData() const; + virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; }; #endif // _SVP_PSPGRAPHICS_HXX diff --git a/vcl/unx/inc/Xproto.h b/vcl/unx/inc/Xproto.h index 83d717818d9e..553c32221406 100644 --- a/vcl/unx/inc/Xproto.h +++ b/vcl/unx/inc/Xproto.h @@ -33,7 +33,7 @@ #include "sal/config.h" -#include "prex.h" +#include <tools/prex.h> #if defined __GNUC__ #pragma GCC system_header @@ -47,6 +47,6 @@ #pragma enable_warn #endif -#include "postx.h" +#include <tools/postx.h> #endif diff --git a/vcl/unx/inc/plugins/gtk/gtkdata.hxx b/vcl/unx/inc/plugins/gtk/gtkdata.hxx index 970a8edf02c3..fd09bcca17e3 100644 --- a/vcl/unx/inc/plugins/gtk/gtkdata.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkdata.hxx @@ -31,11 +31,11 @@ #ifndef _VCL_GTKDATA_HXX #define _VCL_GTKDATA_HXX -#include <prex.h> +#include <tools/prex.h> #include <gdk/gdk.h> #include <gdk/gdkx.h> #include <gtk/gtk.h> -#include <postx.h> +#include <tools/postx.h> #include <saldisp.hxx> #include <saldata.hxx> diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx index 1ceec7fb0c70..74394c71e4b2 100644 --- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx @@ -31,12 +31,12 @@ #ifndef _VCL_GTKFRAME_HXX #define _VCL_GTKFRAME_HXX -#include <prex.h> +#include <tools/prex.h> #include <gtk/gtk.h> #include <gdk/gdk.h> #include <gdk/gdkx.h> #include <gdk/gdkkeysyms.h> -#include <postx.h> +#include <tools/postx.h> #include <vcl/salframe.hxx> #include <vcl/sysdata.hxx> diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx index 5211367c355a..5bc7ab40b98e 100644 --- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx @@ -31,11 +31,11 @@ #ifndef _VCL_GTKGDI_HXX #define _VCL_GTKGDI_HXX -#include <prex.h> +#include <tools/prex.h> #include <gtk/gtk.h> #include <gdk/gdkx.h> #include <gdk/gdkkeysyms.h> -#include <postx.h> +#include <tools/postx.h> #include <salgdi.h> diff --git a/vcl/unx/inc/postx.h b/vcl/unx/inc/postx.h deleted file mode 100644 index 68a2c3a31cf8..000000000000 --- a/vcl/unx/inc/postx.h +++ /dev/null @@ -1,76 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: postx.h,v $ - * $Revision: 1.7 $ - * - * 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 _POSTX_H -#define _POSTX_H - -#if defined __cplusplus -} -#endif - -/* X-Types */ -#undef Window -#undef BYTE -#undef INT8 -#undef INT64 -#undef BOOL -#undef Font -#undef Cursor -#undef String -#undef KeyCode -#undef Region -#undef Icon -#undef Time -#undef Boolean - -#undef Min -#undef Max -#undef DestroyAll -#undef Success - -#undef Printer -/* #undef FontInfo */ -#undef Orientation - -#undef GetToken -#undef ReleaseToken -#undef InitializeToken -#undef NextRequest - -#ifdef KeyPress -#if KeyPress != 2 -Error KeyPress must be Equal 2 -#endif -#undef KeyPress -#endif -#define XLIB_KeyPress 2 - -#endif - diff --git a/vcl/unx/inc/prex.h b/vcl/unx/inc/prex.h deleted file mode 100644 index 131e628efe2e..000000000000 --- a/vcl/unx/inc/prex.h +++ /dev/null @@ -1,81 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: prex.h,v $ - * $Revision: 1.17 $ - * - * 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 _PREX_H -#define _PREX_H - -#define Window XLIB_Window -#define BYTE XLIB_BYTE -#define INT8 XLIB_INT8 -#define INT64 XLIB_INT64 -#define BOOL XLIB_BOOL -#define Font XLIB_Font -#define Cursor XLIB_Cursor -#define String XLIB_String -#define KeyCode XLIB_KeyCode -#define Region XLIB_Region -#define Icon XLIB_Icon -#define Time XLIB_Time -#define Region XLIB_Region -#define Boolean XLIB_Boolean - -#if defined __cplusplus -extern "C" { -#endif - -#if defined(LINUX) || defined(FREEBSD) // should really check for xfree86 or for X11R6.1 and higher -#define __XKeyboardExtension__ 1 -#else -#define __XKeyboardExtension__ 0 -#endif - -#include <X11/X.h> -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include <X11/StringDefs.h> -#include <X11/extensions/Xrender.h> -#if __XKeyboardExtension__ -#include <X11/XKBlib.h> -#endif -typedef unsigned long Pixel; - -#undef DestroyAll -#define DestroyAll XLIB_DestroyAll -#define XLIB_DestroyAll 0 -#undef String -#define String XLIB_String - -#undef KeyCode -#define KeyCode XLIB_KeyCode //undef in intrinsics - -#define __Ol_OlXlibExt_h__ - -#endif - diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h index 5c31d889453c..219cc5f0a8ff 100644 --- a/vcl/unx/inc/pspgraphics.h +++ b/vcl/unx/inc/pspgraphics.h @@ -197,6 +197,7 @@ public: virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ); virtual SystemGraphicsData GetGraphicsData() const; + virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; }; #endif // _VCL_PSPGRAPHICS_H diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index 55c8f8303052..bfe25b84d150 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -336,6 +336,7 @@ public: long nHeight, sal_uInt8 nTransparency ); virtual SystemGraphicsData GetGraphicsData() const; + virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; /* use to handle GraphicsExpose/NoExpose after XCopyArea & friends * if pFrame is not NULL, corresponding Paint events are generated diff --git a/vcl/unx/inc/svunx.h b/vcl/unx/inc/svunx.h index 7e6b98b33192..02572dea9084 100644 --- a/vcl/unx/inc/svunx.h +++ b/vcl/unx/inc/svunx.h @@ -31,8 +31,8 @@ #ifndef _SVUNX_H #define _SVUNX_H -#include <prex.h> -#include <postx.h> +#include <tools/prex.h> +#include <tools/postx.h> #endif diff --git a/vcl/unx/inc/wmadaptor.hxx b/vcl/unx/inc/wmadaptor.hxx index a6146748fb8a..314854926ba1 100644 --- a/vcl/unx/inc/wmadaptor.hxx +++ b/vcl/unx/inc/wmadaptor.hxx @@ -37,9 +37,9 @@ #include <tools/gen.hxx> #include <vcl/dllapi.h> #ifndef _PREX_H -#include <prex.h> +#include <tools/prex.h> #include <X11/Xlib.h> -#include <postx.h> +#include <tools/postx.h> #endif #include <vector> diff --git a/vcl/unx/inc/xfont.hxx b/vcl/unx/inc/xfont.hxx index f2a0496f545d..8b87e268ca08 100644 --- a/vcl/unx/inc/xfont.hxx +++ b/vcl/unx/inc/xfont.hxx @@ -31,9 +31,9 @@ #define EXTENDED_FONTSTRUCT_HXX #ifndef _XLIB_H_ -#include <prex.h> +#include <tools/prex.h> #include <X11/Xlib.h> -#include <postx.h> +#include <tools/postx.h> #endif #include <tools/ref.hxx> #include <rtl/tencinfo.h> diff --git a/vcl/unx/source/app/i18n_cb.cxx b/vcl/unx/source/app/i18n_cb.cxx index b40cc888e7ac..fd8b3d5af559 100644 --- a/vcl/unx/source/app/i18n_cb.cxx +++ b/vcl/unx/source/app/i18n_cb.cxx @@ -34,10 +34,10 @@ #include <stdio.h> #include <string.h> #include <sal/alloca.h> -#include <prex.h> +#include <tools/prex.h> #include <X11/Xlocale.h> #include <X11/Xlib.h> -#include <postx.h> +#include <tools/postx.h> #include <salunx.h> #include <XIM.h> diff --git a/vcl/unx/source/app/i18n_ic.cxx b/vcl/unx/source/app/i18n_ic.cxx index 817fc2781e8c..cacffbcfdbb1 100644 --- a/vcl/unx/source/app/i18n_ic.cxx +++ b/vcl/unx/source/app/i18n_ic.cxx @@ -34,10 +34,10 @@ #include <stdio.h> #include <sal/alloca.h> -#include <prex.h> +#include <tools/prex.h> #include <X11/Xlocale.h> #include <X11/Xlib.h> -#include <postx.h> +#include <tools/postx.h> #include <salunx.h> diff --git a/vcl/unx/source/app/i18n_im.cxx b/vcl/unx/source/app/i18n_im.cxx index a47cefcef7dd..ae472d6323f4 100644 --- a/vcl/unx/source/app/i18n_im.cxx +++ b/vcl/unx/source/app/i18n_im.cxx @@ -44,11 +44,11 @@ #include <sal/alloca.h> #endif -#include <prex.h> +#include <tools/prex.h> #include <X11/Xlocale.h> #include <X11/Xlib.h> #include <XIM.h> -#include <postx.h> +#include <tools/postx.h> #include <salunx.h> #include <saldisp.hxx> diff --git a/vcl/unx/source/app/i18n_status.cxx b/vcl/unx/source/app/i18n_status.cxx index b8ef7e74e635..cdaa5b1a9cf0 100644 --- a/vcl/unx/source/app/i18n_status.cxx +++ b/vcl/unx/source/app/i18n_status.cxx @@ -36,10 +36,10 @@ #endif #include <sal/alloca.h> -#include <prex.h> +#include <tools/prex.h> #include <X11/Xlib.h> #include <XIM.h> -#include <postx.h> +#include <tools/postx.h> #include <salunx.h> diff --git a/vcl/unx/source/app/keysymnames.cxx b/vcl/unx/source/app/keysymnames.cxx index 4a2bf13af3e0..188f159300b0 100644 --- a/vcl/unx/source/app/keysymnames.cxx +++ b/vcl/unx/source/app/keysymnames.cxx @@ -32,9 +32,9 @@ #include "precompiled_vcl.hxx" #ifndef SOLARIS -#include <prex.h> +#include <tools/prex.h> #include <X11/XKBlib.h> -#include <postx.h> +#include <tools/postx.h> #endif #include <saldisp.hxx> diff --git a/vcl/unx/source/app/randrwrapper.cxx b/vcl/unx/source/app/randrwrapper.cxx index b079e2909e71..8d01b64d4680 100644 --- a/vcl/unx/source/app/randrwrapper.cxx +++ b/vcl/unx/source/app/randrwrapper.cxx @@ -31,9 +31,9 @@ #ifdef USE_RANDR -#include "prex.h" +#include <tools/prex.h> #include <X11/extensions/Xrandr.h> -#include "postx.h" +#include <tools/postx.h> #include "osl/module.h" #include "rtl/ustring.hxx" diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index 3bcd1cf792da..328129ef3e29 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -52,7 +52,7 @@ #include <osl/module.h> #endif -#include <prex.h> +#include <tools/prex.h> #include <X11/cursorfont.h> #include "salcursors.h" #include "invert50.h" @@ -81,7 +81,7 @@ Status XineramaGetInfo(Display*, int, XRectangle*, unsigned char*, int*); #endif #endif -#include <postx.h> +#include <tools/postx.h> #include <salunx.h> #include <sal/types.h> diff --git a/vcl/unx/source/app/sm.cxx b/vcl/unx/source/app/sm.cxx index 5bc307b0146f..7e4e16579623 100644 --- a/vcl/unx/source/app/sm.cxx +++ b/vcl/unx/source/app/sm.cxx @@ -40,9 +40,9 @@ #include <osl/process.h> #include <osl/security.h> -#include <prex.h> +#include <tools/prex.h> #include <X11/Xatom.h> -#include <postx.h> +#include <tools/postx.h> #include <sm.hxx> #include <saldata.hxx> #include <saldisp.hxx> diff --git a/vcl/unx/source/app/wmadaptor.cxx b/vcl/unx/source/app/wmadaptor.cxx index 37015b6e58d6..d15433865450 100644 --- a/vcl/unx/source/app/wmadaptor.cxx +++ b/vcl/unx/source/app/wmadaptor.cxx @@ -43,11 +43,11 @@ #include <rtl/locale.h> #include <osl/process.h> -#include <prex.h> +#include <tools/prex.h> #include <X11/X.h> #include <X11/Xatom.h> #include <X11/Xresource.h> -#include <postx.h> +#include <tools/postx.h> #if OSL_DEBUG_LEVEL > 1 #include <stdio.h> diff --git a/vcl/unx/source/gdi/gcach_xpeer.hxx b/vcl/unx/source/gdi/gcach_xpeer.hxx index 73a924c60439..3af34ffd9297 100644 --- a/vcl/unx/source/gdi/gcach_xpeer.hxx +++ b/vcl/unx/source/gdi/gcach_xpeer.hxx @@ -33,9 +33,9 @@ #include <vcl/glyphcache.hxx> -#include <prex.h> +#include <tools/prex.h> #include <X11/extensions/Xrender.h> -#include <postx.h> +#include <tools/postx.h> #include <vcl/dllapi.h> diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index 4a4bccd86d2a..e8dfe391dc86 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -1504,6 +1504,22 @@ SystemGraphicsData PspGraphics::GetGraphicsData() const return aRes; } +SystemFontData PspGraphics::GetSysFontData( int nFallbacklevel ) const +{ + SystemFontData aSysFontData; + + if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1; + if (nFallbacklevel < 0 ) nFallbacklevel = 0; + + aSysFontData.nSize = sizeof( SystemFontData ); + aSysFontData.nFontId = 0; + aSysFontData.nFontFlags = 0; + aSysFontData.bFakeBold = false; + aSysFontData.bFakeItalic = false; + aSysFontData.bAntialias = true; + return aSysFontData; +} + bool PspGraphics::supportsOperation( OutDevSupportType ) const { return false; diff --git a/vcl/unx/source/gdi/salbmp.cxx b/vcl/unx/source/gdi/salbmp.cxx index f70f445ed28c..4db44d664c16 100644 --- a/vcl/unx/source/gdi/salbmp.cxx +++ b/vcl/unx/source/gdi/salbmp.cxx @@ -37,9 +37,9 @@ #ifdef FREEBSD #include <sys/types.h> #endif -#include <prex.h> +#include <tools/prex.h> #include "Xproto.h" -#include <postx.h> +#include <tools/postx.h> #include <salunx.h> #include <osl/endian.h> #include <rtl/memory.h> diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index e2c41b52006b..9cbd9a075dff 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -50,6 +50,7 @@ #include "pspgraphics.h" #include "salvd.h" #include "xfont.hxx" +#include <vcl/sysdata.hxx> #include "xlfd_attr.hxx" #include "xlfd_smpl.hxx" #include "xlfd_extd.hxx" @@ -797,7 +798,11 @@ CairoWrapper::CairoWrapper() if( !XQueryExtension( GetX11SalData()->GetDisplay()->GetDisplay(), "RENDER", &nDummy, &nDummy, &nDummy ) ) return; +#ifdef MACOSX + OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libcairo.2.dylib" )); +#else OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libcairo.so.2" )); +#endif mpCairoLib = osl_loadModule( aLibName.pData, SAL_LOADMODULE_DEFAULT ); if( !mpCairoLib ) return; @@ -1703,6 +1708,31 @@ SalLayout* X11SalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe //-------------------------------------------------------------------------- +SystemFontData X11SalGraphics::GetSysFontData( int nFallbacklevel ) const +{ + SystemFontData aSysFontData; + aSysFontData.nSize = sizeof( SystemFontData ); + aSysFontData.nFontId = 0; + + if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1; + if (nFallbacklevel < 0 ) nFallbacklevel = 0; + + if (mpServerFont[nFallbacklevel] != NULL) + { + ServerFont* rFont = mpServerFont[nFallbacklevel]; + aSysFontData.nFontId = rFont->GetFtFace(); + aSysFontData.nFontFlags = rFont->GetLoadFlags(); + aSysFontData.bFakeBold = rFont->NeedsArtificialBold(); + aSysFontData.bFakeItalic = rFont->NeedsArtificialItalic(); + aSysFontData.bAntialias = rFont->GetAntialiasAdvice(); + aSysFontData.bVerticalCharacterType = rFont->GetFontSelData().mbVertical; + } + + return aSysFontData; +} + +//-------------------------------------------------------------------------- + BOOL X11SalGraphics::CreateFontSubset( const rtl::OUString& rToFile, const ImplFontData* pFont, diff --git a/vcl/unx/source/gdi/salvd.cxx b/vcl/unx/source/gdi/salvd.cxx index 3e00dcb63bef..915c42661fdc 100644 --- a/vcl/unx/source/gdi/salvd.cxx +++ b/vcl/unx/source/gdi/salvd.cxx @@ -31,9 +31,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" -#include <prex.h> +#include <tools/prex.h> #include <X11/extensions/Xrender.h> -#include <postx.h> +#include <tools/postx.h> #include <salunx.h> #include <saldata.hxx> diff --git a/vcl/unx/source/gdi/xrender_peer.hxx b/vcl/unx/source/gdi/xrender_peer.hxx index 24abd9d239e2..f1e2fd77a273 100644 --- a/vcl/unx/source/gdi/xrender_peer.hxx +++ b/vcl/unx/source/gdi/xrender_peer.hxx @@ -31,9 +31,9 @@ #ifndef _SV_XRENDER_PEER_HXX #define _SV_XRENDER_PEER_HXX -#include <prex.h> +#include <tools/prex.h> #include <X11/extensions/Xrender.h> -#include <postx.h> +#include <tools/postx.h> #include <vcl/salgtype.hxx> #include <osl/module.h> diff --git a/vcl/unx/source/plugadapt/salplug.cxx b/vcl/unx/source/plugadapt/salplug.cxx index 668493c6ccb3..2177c9549eff 100644 --- a/vcl/unx/source/plugadapt/salplug.cxx +++ b/vcl/unx/source/plugadapt/salplug.cxx @@ -37,9 +37,9 @@ #include <rtl/ustrbuf.hxx> #include <svunx.h> -#include <prex.h> +#include <tools/prex.h> #include <X11/Xatom.h> -#include <postx.h> +#include <tools/postx.h> #include <vcl/salinst.hxx> #include <saldata.hxx> diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx index 4f66bd3d5291..22e43999caa6 100644 --- a/vcl/unx/source/window/salframe.cxx +++ b/vcl/unx/source/window/salframe.cxx @@ -36,7 +36,7 @@ #include <stdlib.h> #include <unistd.h> -#include "prex.h" +#include <tools/prex.h> #include <X11/Xatom.h> #include <X11/keysym.h> #include "FWS.hxx" @@ -44,7 +44,7 @@ #ifndef SOLARIS #include <X11/extensions/dpms.h> #endif -#include "postx.h" +#include <tools/postx.h> #include "salunx.h" #include "saldata.hxx" diff --git a/vcl/unx/source/window/salobj.cxx b/vcl/unx/source/window/salobj.cxx index 49b1a677c98b..eed6264f00bc 100644 --- a/vcl/unx/source/window/salobj.cxx +++ b/vcl/unx/source/window/salobj.cxx @@ -31,10 +31,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" -#include <prex.h> +#include <tools/prex.h> #include <X11/Xlib.h> #include <X11/extensions/shape.h> -#include <postx.h> +#include <tools/postx.h> #include <salunx.h> #include <salstd.hxx> diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h index f9d4681e0e6e..0475ea4a193e 100644 --- a/vcl/win/inc/salgdi.h +++ b/vcl/win/inc/salgdi.h @@ -352,6 +352,7 @@ public: virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart ); virtual SystemGraphicsData GetGraphicsData() const; + virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; }; // Init/Deinit Graphics diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index 16c055209088..99f276faa964 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -34,6 +34,10 @@ #include <string.h> #include <malloc.h> +#include <tools/prewin.h> +#include <windows.h> +#include <tools/postwin.h> +#include <vcl/sysdata.hxx> #include "tools/svwin.h" #include "wincomp.hxx" @@ -2849,3 +2853,26 @@ void WinSalGraphics::DrawServerFontLayout( const ServerFontLayout& ) {} //-------------------------------------------------------------------------- + +SystemFontData WinSalGraphics::GetSysFontData( int nFallbacklevel ) const +{ + SystemFontData aSysFontData; + + if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1; + if (nFallbacklevel < 0 ) nFallbacklevel = 0; + + aSysFontData.nSize = sizeof( SystemFontData ); + aSysFontData.hFont = mhFonts[nFallbacklevel]; + aSysFontData.bFakeBold = false; + aSysFontData.bFakeItalic = false; + aSysFontData.bAntialias = true; + aSysFontData.bVerticalCharacterType = false; + + OSL_TRACE("\r\n:WinSalGraphics::GetSysFontData(): FontID: %p, Fallback level: %d", + aSysFontData.hFont, + nFallbacklevel); + + return aSysFontData; +} + +//-------------------------------------------------------------------------- |