Kaydet (Commit) 0b1e8399 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski Kaydeden (comit) Thorsten Behrens

QT5 fix build issues & cleanups

1. Linking problem on Windows due to Windows macros via
   <vcl/sysdata.hxx> include
2. Drop the custom MOC target for the old KF5 plugin
3. Correctly handle QT5 build without using QFont
4. ImplJobSetup is in the VL library, not the gen plugin

Change-Id: Iad97b1b9b57a8c356aaa88178aff03d0c14558c7
üst e8526657
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_CustomTarget_CustomTarget,vcl/unx/kf5))
$(call gb_CustomTarget_get_target,vcl/unx/kf5) : \
$(call gb_CustomTarget_get_workdir,vcl/unx/kf5)/Kf5Timer.moc \
$(call gb_CustomTarget_get_workdir,vcl/unx/kf5)/Kf5Widget.moc \
$(call gb_CustomTarget_get_workdir,vcl/unx/kf5)/%.moc : \
$(SRCDIR)/vcl/unx/kf5/%.hxx \
| $(call gb_CustomTarget_get_workdir,vcl/unx/kf5)/.dir
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),MOC,1)
$(MOC5) $< -o $@
# vim: set noet sw=4:
......@@ -45,13 +45,6 @@ class Qt5Font;
class VCL_DLLPUBLIC CommonSalLayout : public GenericSalLayout
{
#if ENABLE_QT5
friend hb_blob_t* getFontTable(hb_face_t*, hb_tag_t, void*);
explicit CommonSalLayout(const FontSelectPattern &rFSP,
FreetypeFont *pFreetypeFont,
Qt5Font *pFont, bool bUseQt5);
#endif
hb_font_t* mpHbFont;
const FontSelectPattern& mrFontSelData;
css::uno::Reference<css::i18n::XBreakIterator> mxBreak;
......@@ -84,19 +77,23 @@ class VCL_DLLPUBLIC CommonSalLayout : public GenericSalLayout
public:
#if defined(_WIN32)
explicit CommonSalLayout(HDC, WinFontInstance&, const WinFontFace&);
const FontSelectPattern& getFontSelData() const { return mrFontSelData; };
const FontSelectPattern& getFontSelData() const { return mrFontSelData; }
HFONT getHFONT() const { return mhFont; }
WinFontInstance& getWinFontInstance() const { return mrWinFontInstance; }
bool hasHScale() const;
#elif defined(MACOSX) || defined(IOS)
explicit CommonSalLayout(const CoreTextStyle&);
const CoreTextStyle& getFontData() const { return mrCoreTextStyle; };
const CoreTextStyle& getFontData() const { return mrCoreTextStyle; }
#else
explicit CommonSalLayout(FreetypeFont&);
const FreetypeFont* getFreetypeFont() const { return mpFreetypeFont; };
const FreetypeFont* getFreetypeFont() const { return mpFreetypeFont; }
#if ENABLE_QT5
explicit CommonSalLayout(const FontSelectPattern &rFSP,
FreetypeFont *pFreetypeFont,
Qt5Font *pFont, bool bUseQt5);
explicit CommonSalLayout(Qt5Font&);
const Qt5Font* getQt5Font() const { return mpQFont; };
const Qt5Font* getQt5Font() const { return mpQFont; }
bool useQt5() const { return mbUseQt5; }
#endif
#endif
......
......@@ -29,7 +29,7 @@
#define JOBSETUP_SYSTEM_UNIX 3
#define JOBSETUP_SYSTEM_MAC 4
class VCL_PLUGIN_PUBLIC ImplJobSetup
class VCL_DLLPUBLIC ImplJobSetup
{
private:
sal_uInt16 mnSystem; //< System - JOBSETUP_SYSTEM_xxxx
......
......@@ -21,7 +21,6 @@
#define INCLUDED_VCL_INC_SALGDI_HXX
#include <vcl/metric.hxx>
#include <vcl/sysdata.hxx>
#include "impfontmetricdata.hxx"
#include "salgdiimpl.hxx"
......@@ -46,6 +45,7 @@ class OpenGLContext;
class OutputDevice;
class FreetypeFont;
class CommonSalLayout;
struct SystemGraphicsData;
#if ENABLE_CAIRO_CANVAS
struct SystemFontData;
......
......@@ -133,7 +133,7 @@ public:
const FontSelectPattern& GetFontSelData() const { return maFontSelData; }
void GetFontMetric(ImplFontMetricDataRef const &) const;
const unsigned char* GetTable( const char* pName, sal_uLong* pLength );
const unsigned char* GetTable( const char* pName, sal_uLong* pLength ) const;
const FontCharMapRef GetFontCharMap() const;
bool GetFontCapabilities(vcl::FontCapabilities &) const;
......
......@@ -32,11 +32,9 @@
#if ENABLE_QT5
#include <qt5/Qt5Font.hxx>
#include <QtGui/QRawFont>
#else
class Qt5Font;
#endif
hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData)
static hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData)
{
char pTagName[5];
pTagName[0] = (char)(nTableTag >> 24);
......@@ -70,12 +68,12 @@ hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData
}
#else
const char* pBuffer = nullptr;
#if ENABLE_QT5
CommonSalLayout *pLayout = static_cast<CommonSalLayout*>( pUserData );
#if ENABLE_QT5
QByteArray aTable;
if ( pLayout->mbUseQt5 )
if ( pLayout->useQt5() )
{
QRawFont aRawFont( QRawFont::fromFont( *pLayout->mpQFont ) );
QRawFont aRawFont( QRawFont::fromFont( *pLayout->getQt5Font() ) );
aTable = aRawFont.fontTable( pTagName );
pBuffer = reinterpret_cast<const char*>( aTable.data() );
nLength = aTable.size();
......@@ -83,9 +81,8 @@ hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData
else
#endif
{
FreetypeFont* pFont = static_cast<FreetypeFont*>(pUserData);
pBuffer = reinterpret_cast<const char*>(
pFont->GetTable(pTagName, &nLength) );
pLayout->getFreetypeFont()->GetTable(pTagName, &nLength) );
}
#endif
......@@ -282,27 +279,35 @@ CommonSalLayout::CommonSalLayout(const FontSelectPattern &rFSP,
mpFreetypeFont->SetHbFont(mpHbFont);
}
}
#endif
CommonSalLayout::CommonSalLayout(FreetypeFont& rFreetypeFont) :
mrFontSelData(rFreetypeFont.GetFontSelData())
, mpFreetypeFont(&rFreetypeFont)
, mpVertGlyphs(nullptr)
CommonSalLayout::CommonSalLayout(FreetypeFont& rFreetypeFont)
: CommonSalLayout(rFreetypeFont.GetFontSelData(),
&rFreetypeFont, nullptr, false)
{
mpHbFont = rFreetypeFont.GetHbFont();
if (!mpHbFont)
{
hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, &rFreetypeFont, nullptr);
mpHbFont = createHbFont(pHbFace);
}
}
#if ENABLE_QT5
CommonSalLayout::CommonSalLayout(Qt5Font& rQFont)
: CommonSalLayout(rQFont.GetFontSelData(),
nullptr, &rQFont, true)
{
}
#else // ! ENABLE_QT5
CommonSalLayout::CommonSalLayout(FreetypeFont& rFreetypeFont)
: mrFontSelData(rFreetypeFont.GetFontSelData())
, mpFreetypeFont(&rFreetypeFont)
, mpVertGlyphs(nullptr)
{
mpHbFont = mpFreetypeFont->GetHbFont();
if (!mpHbFont)
{
hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, this, nullptr);
mpHbFont = createHbFont(pHbFace);
mpFreetypeFont->SetHbFont(mpHbFont);
}
}
#endif
#endif
......
......@@ -973,7 +973,7 @@ bool FreetypeFont::GetGlyphOutline(const GlyphItem& rGlyph,
return true;
}
const unsigned char* FreetypeFont::GetTable(const char* pName, sal_uLong* pLength)
const unsigned char* FreetypeFont::GetTable(const char* pName, sal_uLong* pLength) const
{
return mpFontInfo->GetTable( pName, pLength );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment