1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SLIDESHOW_SOURCE_INC_SLIDEBITMAP_HXX
21 #define INCLUDED_SLIDESHOW_SOURCE_INC_SLIDEBITMAP_HXX
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <cppcanvas/canvas.hxx>
25 #include <cppcanvas/bitmap.hxx>
27 #include <basegfx/point/b2dpoint.hxx>
28 #include <basegfx/polygon/b2dpolypolygon.hxx>
32 namespace com
{ namespace sun
{ namespace star
{ namespace rendering
38 /* Definition of SlideBitmap class */
45 /** Little wrapper encapsulating an XBitmap
47 This is to insulate us from changes to the preferred
48 transport format for bitmaps (using a sole XBitmap here is
49 a hack, since it is not guaranteed to work, or to work
50 without data loss, across different canvases). And since
51 we don't want to revert to a VCL Bitmap here, have to wait
52 until basegfx bitmap tooling is ready.
54 TODO(F2): Add support for Canvas-independent bitmaps
55 here. Then, Slide::getInitialSlideBitmap and
56 Slide::getFinalSlideBitmap must also be adapted (they no
57 longer need a Canvas ptr, which is actually a hack now).
62 explicit SlideBitmap( const ::cppcanvas::BitmapSharedPtr
& rBitmap
);
63 SlideBitmap(const SlideBitmap
&) = delete;
64 SlideBitmap
& operator=(const SlideBitmap
&) = delete;
66 bool draw( const ::cppcanvas::CanvasSharedPtr
& rCanvas
) const;
67 ::basegfx::B2ISize
getSize() const;
68 void move( const ::basegfx::B2DPoint
& rNewPos
);
69 void clip( const ::basegfx::B2DPolyPolygon
& rClipPoly
);
71 const css::uno::Reference
< css::rendering::XBitmap
>& getXBitmap();
74 ::basegfx::B2DPoint maOutputPos
;
75 ::basegfx::B2DPolyPolygon maClipPoly
;
77 // TODO(Q2): Remove UNO bitmap as the transport medium
78 css::uno::Reference
< css::rendering::XBitmap
> mxBitmap
;
81 typedef ::std::shared_ptr
< SlideBitmap
> SlideBitmapSharedPtr
;
85 #endif // INCLUDED_SLIDESHOW_SOURCE_INC_SLIDEBITMAP_HXX
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */