LibreOffice Module canvas (master) 1
cairo_spritecanvas.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <com/sun/star/uno/XComponentContext.hpp>
23#include <com/sun/star/beans/XPropertySet.hpp>
24#include <com/sun/star/lang/XServiceName.hpp>
25#include <com/sun/star/lang/XServiceInfo.hpp>
26#include <com/sun/star/awt/XWindowListener.hpp>
27#include <com/sun/star/util/XUpdatable.hpp>
28#include <com/sun/star/rendering/XSpriteCanvas.hpp>
29#include <com/sun/star/rendering/XIntegerBitmap.hpp>
30#include <com/sun/star/rendering/XGraphicDevice.hpp>
31#include <com/sun/star/rendering/XBufferController.hpp>
32
34#include <comphelper/uno3.hxx>
35
40
45
46namespace cairocanvas
47{
48 typedef ::cppu::WeakComponentImplHelper< css::rendering::XSpriteCanvas,
49 css::rendering::XIntegerBitmap,
50 css::rendering::XGraphicDevice,
51 css::lang::XMultiServiceFactory,
52 css::rendering::XBufferController,
53 css::awt::XWindowListener,
54 css::util::XUpdatable,
55 css::beans::XPropertySet,
56 css::lang::XServiceName,
57 css::lang::XServiceInfo > WindowGraphicDeviceBase_Base;
58 typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >,
60 ::osl::MutexGuard,
81 public SurfaceProvider
82 {
83 };
84
87 ::osl::MutexGuard,
89
100 public RepaintTarget
101 {
102 public:
103 SpriteCanvas( const css::uno::Sequence< css::uno::Any >& aArguments,
104 const css::uno::Reference< css::uno::XComponentContext >& rxContext );
105
106 void initialize();
107
109 virtual void disposeThis() override;
110
111 // Forwarding the XComponent implementation to the
112 // cppu::ImplHelper templated base
113 // Classname Base doing refcounting Base implementing the XComponent interface
114 // | | |
115 // V V V
117
118 // XBufferController (partial)
119 virtual sal_Bool SAL_CALL showBuffer( sal_Bool bUpdateAll ) override;
120 virtual sal_Bool SAL_CALL switchBuffer( sal_Bool bUpdateAll ) override;
121
122 // XSpriteCanvas (partial)
123 virtual sal_Bool SAL_CALL updateScreen( sal_Bool bUpdateAll ) override;
124
125 // XServiceName
126 virtual OUString SAL_CALL getServiceName( ) override;
127
128 // XServiceInfo
129 virtual sal_Bool SAL_CALL supportsService(const OUString& sServiceName) override;
130 virtual OUString SAL_CALL getImplementationName() override;
131 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
132
133 // SurfaceProvider
134 virtual ::cairo::SurfaceSharedPtr getSurface() override;
135 virtual ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, int aContent ) override;
136 virtual ::cairo::SurfaceSharedPtr createSurface( ::Bitmap& rBitmap ) override;
137 virtual ::cairo::SurfaceSharedPtr changeSurface() override;
138 virtual OutputDevice* getOutputDevice() override;
139
140 // RepaintTarget
141 virtual bool repaint( const ::cairo::SurfaceSharedPtr& pSurface,
142 const css::rendering::ViewState& viewState,
143 const css::rendering::RenderState& renderState ) override;
144
147
148 const ::basegfx::B2ISize& getSizePixel() const;
149 void setSizePixel( const ::basegfx::B2ISize& rSize );
150 void flush();
151
152 private:
153 css::uno::Sequence< css::uno::Any > maArguments;
154 };
155
156 typedef ::rtl::Reference< SpriteCanvas > SpriteCanvasRef;
157}
158
159/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Product of this component's factory.
virtual OUString SAL_CALL getServiceName() override
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
css::uno::Sequence< css::uno::Any > maArguments
::cairo::SurfaceSharedPtr const & getWindowSurface() const
virtual ::cairo::SurfaceSharedPtr createSurface(const ::basegfx::B2ISize &rSize, int aContent) override
void setSizePixel(const ::basegfx::B2ISize &rSize)
virtual void disposeThis() override
Dispose all internal references.
virtual bool repaint(const ::cairo::SurfaceSharedPtr &pSurface, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState) override
virtual ::cairo::SurfaceSharedPtr getSurface() override
::cairo::SurfaceSharedPtr const & getBufferSurface() const
virtual ::cairo::SurfaceSharedPtr changeSurface() override
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL switchBuffer(sal_Bool bUpdateAll) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OutputDevice * getOutputDevice() override
virtual sal_Bool SAL_CALL showBuffer(sal_Bool bUpdateAll) override
const ::basegfx::B2ISize & getSizePixel() const
SpriteCanvas(const css::uno::Sequence< css::uno::Any > &aArguments, const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual sal_Bool SAL_CALL updateScreen(sal_Bool bUpdateAll) override
Helper template base class for XGraphicDevice implementations on windows.
Helper template to handle XIntegerBitmap method forwarding to BitmapCanvasHelper.
Canvas surface containing sprites.
std::shared_ptr< Surface > SurfaceSharedPtr
::cppu::WeakComponentImplHelper< css::rendering::XSpriteCanvas, css::rendering::XIntegerBitmap, css::rendering::XGraphicDevice, css::lang::XMultiServiceFactory, css::rendering::XBufferController, css::awt::XWindowListener, css::util::XUpdatable, css::beans::XPropertySet, css::lang::XServiceName, css::lang::XServiceInfo > WindowGraphicDeviceBase_Base
::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >, SpriteDeviceHelper, ::osl::MutexGuard, ::cppu::OWeakObject > SpriteCanvasBase_Base
::canvas::SpriteCanvasBase< SpriteCanvasBaseSpriteSurface_Base, SpriteCanvasHelper, ::osl::MutexGuard, ::cppu::OWeakObject > SpriteCanvasBaseT
::rtl::Reference< SpriteCanvas > SpriteCanvasRef
unsigned char sal_Bool
#define DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS(classname, baseclass, implhelper)