LibreOffice Module canvas (master) 1
ogl_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
10#pragma once
11
12#include <rtl/ref.hxx>
13
14#include <com/sun/star/uno/XComponentContext.hpp>
15#include <com/sun/star/beans/XPropertySet.hpp>
16#include <com/sun/star/lang/XServiceName.hpp>
17#include <com/sun/star/awt/XWindowListener.hpp>
18#include <com/sun/star/util/XUpdatable.hpp>
19#include <com/sun/star/rendering/XSpriteCanvas.hpp>
20#include <com/sun/star/rendering/XGraphicDevice.hpp>
21#include <com/sun/star/rendering/XBufferController.hpp>
22
24#include <comphelper/uno3.hxx>
25
26#include <base/canvasbase.hxx>
29
31#include "ogl_canvashelper.hxx"
32
33
34namespace oglcanvas
35{
36 class CanvasCustomSprite;
37
38 typedef ::cppu::WeakComponentImplHelper< css::rendering::XSpriteCanvas,
39 css::rendering::XGraphicDevice,
40 css::lang::XMultiServiceFactory,
41 css::rendering::XBufferController,
42 css::awt::XWindowListener,
43 css::util::XUpdatable,
44 css::beans::XPropertySet,
45 css::lang::XServiceName > WindowGraphicDeviceBase_Base;
49 ::osl::MutexGuard,
51
54 ::osl::MutexGuard,
56
67 {
68 public:
69 SpriteCanvas( const css::uno::Sequence<
70 css::uno::Any >& aArguments,
71 const css::uno::Reference<
72 css::uno::XComponentContext >& rxContext );
73
74 void initialize();
75
77 virtual void disposeThis() override;
78
79 // Forwarding the XComponent implementation to the
80 // cppu::ImplHelper templated base
81 // Classname Base doing refcounting Base implementing the XComponent interface
82 // | | |
83 // V V V
85
86 // XBufferController (partial)
87 virtual sal_Bool SAL_CALL showBuffer( sal_Bool bUpdateAll ) override;
88 virtual sal_Bool SAL_CALL switchBuffer( sal_Bool bUpdateAll ) override;
89
90 // XSpriteCanvas
91 virtual css::uno::Reference< css::rendering::XAnimatedSprite > SAL_CALL createSpriteFromAnimation( const css::uno::Reference< css::rendering::XAnimation >& animation ) override;
92 virtual css::uno::Reference< css::rendering::XAnimatedSprite > SAL_CALL createSpriteFromBitmaps( const css::uno::Sequence< css::uno::Reference< css::rendering::XBitmap > >& animationBitmaps, ::sal_Int8 interpolationMode ) override;
93 virtual css::uno::Reference< css::rendering::XCustomSprite > SAL_CALL createCustomSprite( const css::geometry::RealSize2D& spriteSize ) override;
94 virtual css::uno::Reference< css::rendering::XSprite > SAL_CALL createClonedSprite( const css::uno::Reference< css::rendering::XSprite >& original ) override;
95 virtual sal_Bool SAL_CALL updateScreen( sal_Bool bUpdateAll ) override;
96
97 // XServiceName
98 virtual OUString SAL_CALL getServiceName( ) override;
99
100 void show( const ::rtl::Reference< CanvasCustomSprite >& );
101 void hide( const ::rtl::Reference< CanvasCustomSprite >& );
102
105 void renderRecordedActions() const;
106
107 private:
108 css::uno::Sequence< css::uno::Any > maArguments;
109 };
110
111 typedef ::rtl::Reference< SpriteCanvas > SpriteCanvasRef;
112}
113
114/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Helper template base class for XGraphicDevice implementations on windows.
Helper template to handle XCanvas method forwarding to CanvasHelper.
Definition: canvasbase.hxx:109
Base class, initializing its own baseclass with m_aMutex.
Helper class for basic canvas functionality.
Product of this component's factory.
virtual sal_Bool SAL_CALL updateScreen(sal_Bool bUpdateAll) override
virtual void disposeThis() override
Dispose all internal references.
virtual css::uno::Reference< css::rendering::XCustomSprite > SAL_CALL createCustomSprite(const css::geometry::RealSize2D &spriteSize) override
SpriteCanvas(const css::uno::Sequence< css::uno::Any > &aArguments, const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual css::uno::Reference< css::rendering::XAnimatedSprite > SAL_CALL createSpriteFromBitmaps(const css::uno::Sequence< css::uno::Reference< css::rendering::XBitmap > > &animationBitmaps, ::sal_Int8 interpolationMode) override
virtual css::uno::Reference< css::rendering::XSprite > SAL_CALL createClonedSprite(const css::uno::Reference< css::rendering::XSprite > &original) override
void hide(const ::rtl::Reference< CanvasCustomSprite > &)
css::uno::Sequence< css::uno::Any > maArguments
virtual OUString SAL_CALL getServiceName() override
void renderRecordedActions() const
Write out recorded actions.
virtual sal_Bool SAL_CALL switchBuffer(sal_Bool bUpdateAll) override
virtual css::uno::Reference< css::rendering::XAnimatedSprite > SAL_CALL createSpriteFromAnimation(const css::uno::Reference< css::rendering::XAnimation > &animation) override
virtual sal_Bool SAL_CALL showBuffer(sal_Bool bUpdateAll) override
void show(const ::rtl::Reference< CanvasCustomSprite > &)
::canvas::CanvasBase< SpriteCanvasDeviceBaseT, CanvasHelper, ::osl::MutexGuard, ::cppu::OWeakObject > SpriteCanvasBaseT
::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >, SpriteDeviceHelper, ::osl::MutexGuard, ::cppu::OWeakObject > SpriteCanvasDeviceBaseT
::rtl::Reference< SpriteCanvas > SpriteCanvasRef
::cppu::WeakComponentImplHelper< css::rendering::XSpriteCanvas, css::rendering::XGraphicDevice, css::lang::XMultiServiceFactory, css::rendering::XBufferController, css::awt::XWindowListener, css::util::XUpdatable, css::beans::XPropertySet, css::lang::XServiceName > WindowGraphicDeviceBase_Base
unsigned char sal_Bool
signed char sal_Int8
#define DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS(classname, baseclass, implhelper)