/src/libreoffice/vcl/inc/animate/AnimationRenderer.hxx
Line | Count | Source |
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 <vcl/dllapi.h> |
23 | | #include <vcl/animate/Animation.hxx> |
24 | | #include <vcl/animate/AnimationFrame.hxx> |
25 | | #include <vcl/region.hxx> |
26 | | #include <vcl/vclptr.hxx> |
27 | | |
28 | | class Animation; |
29 | | class OutputDevice; |
30 | | class VirtualDevice; |
31 | | struct AnimationFrame; |
32 | | |
33 | | struct AnimationData |
34 | | { |
35 | | Point maOriginStartPt; |
36 | | Size maStartSize; |
37 | | VclPtr<OutputDevice> mpRenderContext; |
38 | | AnimationRenderer* mpRendererData; |
39 | | tools::Long mnRendererId; |
40 | | bool mbIsPaused; |
41 | | |
42 | | AnimationData(); |
43 | | }; |
44 | | |
45 | | |
46 | | class VCL_DLLPUBLIC AnimationRenderer |
47 | | { |
48 | | private: |
49 | | Animation* mpParent; |
50 | | VclPtr<OutputDevice> mpRenderContext; |
51 | | tools::Long mnRendererId; |
52 | | Point maOriginPt; |
53 | | Point maDispPt; |
54 | | Point maRestPt; |
55 | | Size maLogicalSize; |
56 | | Size maSizePx; |
57 | | Size maDispSz; |
58 | | Size maRestSz; |
59 | | vcl::Region maClip; |
60 | | VclPtr<VirtualDevice> mpBackground; |
61 | | VclPtr<VirtualDevice> mpRestore; |
62 | | sal_uLong mnActIndex; |
63 | | Disposal meLastDisposal; |
64 | | bool mbIsPaused; |
65 | | bool mbIsMarked; |
66 | | bool mbIsMirroredHorizontally; |
67 | | bool mbIsMirroredVertically; |
68 | | |
69 | | public: |
70 | | AnimationRenderer( Animation* pParent, OutputDevice* pOut, |
71 | | const Point& rPt, const Size& rSz, sal_uLong nRendererId, |
72 | | OutputDevice* pFirstFrameOutDev = nullptr ); |
73 | | AnimationRenderer(AnimationRenderer&&) = delete; |
74 | | SAL_DLLPRIVATE ~AnimationRenderer(); |
75 | | |
76 | | bool matches(const OutputDevice* pOut, tools::Long nRendererId) const; |
77 | | void drawToIndex( sal_uLong nIndex ); |
78 | | SAL_DLLPRIVATE void draw( sal_uLong nIndex, VirtualDevice* pVDev=nullptr ); |
79 | | SAL_DLLPRIVATE void repaint(); |
80 | | SAL_DLLPRIVATE AnimationData* createAnimationData() const; |
81 | | |
82 | | void getPosSize( const AnimationFrame& rAnm, Point& rPosPix, Size& rSizePix ); |
83 | | |
84 | 0 | const Point& getOriginPosition() const { return maOriginPt; } |
85 | | |
86 | 0 | const Size& getOutSizePix() const { return maSizePx; } |
87 | | |
88 | 0 | void pause( bool bIsPaused ) { mbIsPaused = bIsPaused; } |
89 | 0 | bool isPaused() const { return mbIsPaused; } |
90 | | |
91 | 0 | void setMarked( bool bIsMarked ) { mbIsMarked = bIsMarked; } |
92 | 0 | bool isMarked() const { return mbIsMarked; } |
93 | | }; |
94 | | |
95 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |