LibreOffice Module canvas (master)  1
dx_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 #ifndef INCLUDED_CANVAS_SOURCE_DIRECTX_DX_SPRITECANVAS_HXX
21 #define INCLUDED_CANVAS_SOURCE_DIRECTX_DX_SPRITECANVAS_HXX
22 
23 #include <rtl/ref.hxx>
24 
25 #include <com/sun/star/uno/XComponentContext.hpp>
26 #include <com/sun/star/beans/XPropertySet.hpp>
27 #include <com/sun/star/lang/XServiceName.hpp>
28 #include <com/sun/star/awt/XWindowListener.hpp>
29 #include <com/sun/star/awt/XTopWindow.hpp>
30 #include <com/sun/star/util/XUpdatable.hpp>
31 #include <com/sun/star/rendering/XSpriteCanvas.hpp>
32 #include <com/sun/star/rendering/XIntegerBitmap.hpp>
33 #include <com/sun/star/rendering/XGraphicDevice.hpp>
34 #include <com/sun/star/rendering/XBufferController.hpp>
35 
36 #include <cppuhelper/compbase.hxx>
37 #include <comphelper/uno3.hxx>
38 
43 
44 #include "dx_bitmapprovider.hxx"
46 #include "dx_surfacebitmap.hxx"
47 #include "dx_impltools.hxx"
49 
50 
51 namespace dxcanvas
52 {
53  typedef ::cppu::WeakComponentImplHelper< css::rendering::XSpriteCanvas,
54  css::rendering::XIntegerBitmap,
55  css::rendering::XGraphicDevice,
56  css::lang::XMultiServiceFactory,
57  css::rendering::XBufferController,
58  css::awt::XWindowListener,
59  css::util::XUpdatable,
60  css::beans::XPropertySet,
61  css::lang::XServiceName > WindowGraphicDeviceBase_Base;
62  typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >,
64  ::osl::MutexGuard,
83  class SpriteCanvasBaseSpriteSurface_Base : public SpriteCanvasBase_Base,
85  {
86  };
87 
88  typedef ::canvas::SpriteCanvasBase< SpriteCanvasBaseSpriteSurface_Base,
90  ::osl::MutexGuard,
92 
102  class SpriteCanvas : public SpriteCanvasBaseT, public BitmapProvider
103  {
104  public:
105  SpriteCanvas( const css::uno::Sequence<
106  css::uno::Any >& aArguments,
107  const css::uno::Reference<
108  css::uno::XComponentContext >& rxContext );
109 
110  void initialize();
111 
113  virtual void disposeThis() override;
114 
115  // Forwarding the XComponent implementation to the
116  // cppu::ImplHelper templated base
117  // Classname Base doing refcounting Base implementing the XComponent interface
118  // | | |
119  // V V V
120  DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( SpriteCanvas, WindowGraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase )
121 
122  // XBufferController (partial)
123  virtual sal_Bool SAL_CALL showBuffer( sal_Bool bUpdateAll ) override;
124  virtual sal_Bool SAL_CALL switchBuffer( sal_Bool bUpdateAll ) override;
125 
126  // XSpriteCanvas (partial)
127  virtual sal_Bool SAL_CALL updateScreen( sal_Bool bUpdateAll ) override;
128 
129  // XServiceName
130  virtual OUString SAL_CALL getServiceName( ) override;
131 
134 
137 
138  // BitmapProvider
139  virtual IBitmapSharedPtr getBitmap() const override;
140 
141  private:
142  css::uno::Sequence< css::uno::Any > maArguments;
143  css::uno::Reference< css::uno::XComponentContext > mxComponentContext;
144  };
145 
146  typedef ::rtl::Reference< SpriteCanvas > SpriteCanvasRef;
147 }
148 
149 #endif
150 
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Canvas surface containing sprites.
css::uno::Sequence< css::uno::Any > maArguments
std::shared_ptr< IBitmap > IBitmapSharedPtr
Definition: dx_ibitmap.hxx:59
std::shared_ptr< IDXRenderModule > IDXRenderModuleSharedPtr
virtual sal_Bool SAL_CALL updateScreen(sal_Bool bUpdateAll) override
virtual void disposeThis() override
Dispose all internal references.
#define DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS(classname, baseclass, implhelper)
::rtl::Reference< SpriteCanvas > SpriteCanvasRef
::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 > WindowGraphicDeviceBase_Base
unsigned char sal_Bool
const IDXRenderModuleSharedPtr & getRenderModule() const
Retrieve rendermodule object for this Canvas.
virtual sal_Bool SAL_CALL switchBuffer(sal_Bool bUpdateAll) override
virtual sal_Bool SAL_CALL showBuffer(sal_Bool bUpdateAll) override
::canvas::SpriteCanvasBase< SpriteCanvasBaseSpriteSurface_Base, SpriteCanvasHelper,::osl::MutexGuard,::cppu::OWeakObject > SpriteCanvasBaseT
std::shared_ptr< DXSurfaceBitmap > DXSurfaceBitmapSharedPtr
virtual IBitmapSharedPtr getBitmap() const override
SpriteCanvas(const css::uno::Sequence< css::uno::Any > &aArguments, const css::uno::Reference< css::uno::XComponentContext > &rxContext)
const DXSurfaceBitmapSharedPtr & getBackBuffer() const
Get backbuffer for this canvas.
virtual OUString SAL_CALL getServiceName() override
Product of this component's factory.
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >, SpriteDeviceHelper,::osl::MutexGuard,::cppu::OWeakObject > SpriteCanvasBase_Base