/* -*- 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 .
*/
#ifdef IOS // iOS defines a different Point class so include salgeom.hxx after postmac.h // so that it will use the Point class in tools/gen.hxx #include"salgeom.hxx" #endif
struct AquaSharedAttributes
{ /// path representing current clip region
CGMutablePathRef mxClipPath;
/// Drawing colors /// pen color RGBA
RGBAColor maLineColor;
/// brush color RGBA
RGBAColor maFillColor;
// Graphics types #ifdef MACOSX
AquaSalFrame* mpFrame; /// is this a window graphics bool mbWindow; #else// IOS // mirror AquaSalVirtualDevice::mbForeignContext for SvpSalGraphics objects related to such bool mbForeignContext; #endif /// is this a printer graphics bool mbPrinter; /// is this a virtual device graphics bool mbVirDev;
CGLayerHolder maLayer; // Quartz graphics layer
CGContextHolder maContextHolder; // Quartz drawing context
CGContextHolder maBGContextHolder; // Quartz drawing context for CGLayer
CGContextHolder maCSContextHolder; // Quartz drawing context considering the color space int mnWidth; int mnHeight; int mnXorMode; // 0: off 1: on 2: invert only int mnBitmapDepth; // zero unless bitmap
Color maTextColor; /// allows text to be rendered without antialiasing bool mbNonAntialiasedText;
void refreshRect(float lX, float lY, float lWidth, float lHeight)
{ #ifdef MACOSX if (!mbWindow) // view only on Window graphics return;
if (mpFrame)
{ // update a little more around the designated rectangle // this helps with antialiased rendering // Rounding down x and width can accumulate a rounding error of up to 2 // The decrementing of x, the rounding error and the antialiasing border // require that the width and the height need to be increased by four const tools::Rectangle aVclRect(
Point(tools::Long(lX - 1), tools::Long(lY - 1)),
Size(tools::Long(lWidth + 4), tools::Long(lHeight + 4)));
// apply the XOR mask to the target context if active and dirty void applyXorContext()
{ if (!mpXorEmulation) return; if (mpXorEmulation->UpdateTarget())
{
refreshRect(0, 0, mnWidth, mnHeight); // TODO: refresh minimal changerect
}
}
// differences between VCL, Quartz and kHiThemeOrientation coordinate systems // make some graphics seem to be vertically-mirrored from a VCL perspective bool isFlipped() const
{ #ifdef MACOSX return mbWindow; #else returnfalse; #endif
}
};
class AquaGraphicsBackend final : public SalGraphicsImpl, public AquaGraphicsBackendBase
{ private: void drawPixelImpl( tools::Long nX, tools::Long nY, const RGBAColor& rColor); // helper to draw single pixels
public: // get device resolution virtualvoid GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) 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; virtualbool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) 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;
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.