/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * 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/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_PRE_POST_WIN_H #define INCLUDED_PRE_POST_WIN_H # include <prewin.h> # include <postwin.h> #endif
#include <hb-ot.h> #include <dwrite.h>
namespace vcl::font
{ class PhysicalFontCollection; class FontSelectPattern;
} class WinFontInstance; class ImplFontAttrCache; class SalGraphicsImpl; class WinSalGraphicsImplBase; class FontMetricData;
// win32 specific physically available font face class WinFontFace final : public vcl::font::PhysicalFontFace
{ public: explicit WinFontFace(const ENUMLOGFONTEXW&, const NEWTEXTMETRICW&);
~WinFontFace() override;
/** * WinSalGraphics never owns the HDC it uses to draw, because the HDC can have * various origins with different ways to correctly free it. And WinSalGraphics * stores all default values (mhDef*) of the HDC, which must be restored when * the HDC changes (setHDC) or the SalGraphics is destructed. So think of the * HDC in terms of Rust's Borrowing semantics.
*/ class WinSalGraphics : public SalGraphics
{ friendclass WinSalGraphicsImpl; friendclass ScopedFont;
public: enum Type
{
PRINTER,
VIRTUAL_DEVICE,
WINDOW,
SCREEN
};
// public SalGraphics methods, the interface to the independent vcl part
// get device resolution virtualvoid GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) override; // get the depth of the device virtual sal_uInt16 GetBitCount() const override; // get the width of the device virtual tools::Long GetGraphicsWidth() const override;
// set the clip region to empty virtualvoid ResetClipRegion() override;
// set the line color to transparent (= don't draw lines) virtualvoid SetLineColor() override; // set the line color to a specific color virtualvoid SetLineColor( Color nColor ) override; // set the fill color to transparent (= don't fill) virtualvoid SetFillColor() override; // set the fill color to a specific color, shapes will be // filled accordingly virtualvoid SetFillColor( Color nColor ) override; // enable/disable XOR drawing virtualvoid SetXORMode( bool bSet, bool ) override; // set line color for raster operations virtualvoid SetROPLineColor( SalROPColor nROPColor ) override; // set fill color for raster operations virtualvoid SetROPFillColor( SalROPColor nROPColor ) override; // set the text color to a specific color virtualvoid SetTextColor( Color nColor ) override; // set the font virtualvoid SetFont( LogicalFontInstance*, int nFallbackLevel ) override; // get the current font's metrics virtualvoid GetFontMetric( FontMetricDataRef&, int nFallbackLevel ) override; // get the repertoire of the current font virtual FontCharMapRef GetFontCharMap() const override; // get the layout capabilities of the current font virtualbool GetFontCapabilities(vcl::FontCapabilities &rGetFontCapabilities) const override; // graphics must fill supplied font list virtualvoid GetDevFontList( vcl::font::PhysicalFontCollection* ) override; // graphics must drop any cached font info virtualvoid ClearDevFontCache() override; virtualbool AddTempDevFont( vcl::font::PhysicalFontCollection*, const OUString& rFileURL, const OUString& rFontName ) override;
/// Update settings based on the platform values staticvoid updateSettingsNative( AllSettings& rSettings );
// Returns base HFONT, an optional HFONT for non-rotated CJK glyphs, // and tmDescent value for adjusting offset in vertical writing mode.
std::tuple<HFONT, HFONT, sal_Int32>
ImplDoSetFont(HDC hDC, vcl::font::FontSelectPattern const& i_rFont, const vcl::font::PhysicalFontFace* i_pFontFace, HFONT& o_rOldFont);
HDC getHDC() const { return mhLocalDC; } // NOTE: this doesn't transfer ownership! See class comment. void setHDC(HDC aNew);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.