/* -*- 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 .
*/
namespace com::sun::star::beans { class XPropertySetInfo; } namespace com::sun::star::lang { class XMultiServiceFactory; } namespace com::sun::star::rendering { class XColorSpace; }
/* Definition of GraphicDeviceBase class */
namespace canvas
{ /** Helper template base class for XGraphicDevice implementations.
This base class provides partial implementations of the XGraphicDevice-related interface, such as XColorSpace.
This template basically interposes itself between the full interface you implement (i.e. not restricted to XGraphicDevice etc.). The problem with UNO partial interface implementation actually is, that you cannot do it the plain way, since deriving from a common base subclass always introduces the whole set of pure virtuals, that your baseclass helper just overridden) and your implementation class. You then only have to implement the functionality <em>besides</em> XGraphicDevice. If you want to support the optional debug XUpdatable interface, also add that to the base classes (client code will call the corresponding update() method, whenever a burst of animations is over).
class ExampleDevice : public ExampleDevice_Base { }; </pre>
@tpl Base Base class to use, most probably the WeakComponentImplHelper template with the appropriate interfaces. At least XGraphicDevice should be among them (why else would you use this template, then?). Base class must have an Base( const Mutex& ) constructor (like the WeakComponentImplHelper template has). As the very least, the base class must be derived from uno::XInterface, as some error reporting mechanisms rely on that.
@tpl DeviceHelper Device helper implementation for the backend in question. This object will be held as a member of this template class, and basically gets forwarded all XGraphicDevice API calls that could not be handled generically.
@tpl Mutex Lock strategy to use. Defaults to using the DisambiguationHelper-provided lock. Every time one of the methods is entered, an object of type Mutex is created with m_aMutex as the sole parameter, and destroyed again when the method scope is left.
@tpl UnambiguousBase Optional unambiguous base class for XInterface of Base. It's sometimes necessary to specify this parameter, e.g. if Base derives from multiple UNO interface (were each provides its own version of XInterface, making the conversion ambiguous)
*/ template< class Base, class DeviceHelper, class Mutex=::osl::MutexGuard, class UnambiguousBase=css::uno::XInterface > class GraphicDeviceBase : public Base
{ public: typedef Base BaseType; typedef Mutex MutexType; typedef UnambiguousBase UnambiguousBaseType;
void setDumpScreenContent( const css::uno::Any& rAny )
{ // TODO(Q1): this was mbDumpScreenContent = // rAny.get<bool>(), only that gcc3.3 wouldn't eat it
rAny >>= mbDumpScreenContent;
}
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.