/src/libreoffice/include/cppcanvas/sprite.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 | | namespace basegfx |
23 | | { |
24 | | class B2DHomMatrix; |
25 | | class B2DPolyPolygon; |
26 | | class B2DPoint; |
27 | | } |
28 | | |
29 | | |
30 | | /* Definition of Sprite class */ |
31 | | |
32 | | namespace cppcanvas |
33 | | { |
34 | | |
35 | | class Sprite |
36 | | { |
37 | | public: |
38 | 0 | virtual ~Sprite() {} |
39 | | |
40 | | virtual void setAlpha( const double& rAlpha ) = 0; |
41 | | |
42 | | /** Set the sprite position on screen |
43 | | |
44 | | This method differs from the XSprite::move() insofar, as |
45 | | no viewstate/renderstate transformations are applied to |
46 | | the specified position. The given position is interpreted |
47 | | in device coordinates (i.e. screen pixel) |
48 | | */ |
49 | | virtual void movePixel( const ::basegfx::B2DPoint& rNewPos ) = 0; |
50 | | |
51 | | /** Set the sprite position on screen |
52 | | |
53 | | This method sets the sprite position in the view |
54 | | coordinate system of the parent canvas |
55 | | */ |
56 | | virtual void move( const ::basegfx::B2DPoint& rNewPos ) = 0; |
57 | | |
58 | | virtual void transform( const ::basegfx::B2DHomMatrix& rMatrix ) = 0; |
59 | | |
60 | | /** Set output clipping |
61 | | |
62 | | This method differs from the XSprite::clip() insofar, as |
63 | | no viewstate/renderstate transformations are applied to |
64 | | the specified clip polygon. The given polygon is |
65 | | interpreted in device coordinates (i.e. screen pixel) |
66 | | */ |
67 | | virtual void setClipPixel( const ::basegfx::B2DPolyPolygon& rClipPoly ) = 0; |
68 | | |
69 | | /** Set output clipping |
70 | | |
71 | | This method applies the clip poly-polygon interpreted in |
72 | | the view coordinate system of the parent canvas. |
73 | | */ |
74 | | virtual void setClip( const ::basegfx::B2DPolyPolygon& rClipPoly ) = 0; |
75 | | |
76 | | virtual void setClip() = 0; |
77 | | |
78 | | virtual void show() = 0; |
79 | | virtual void hide() = 0; |
80 | | |
81 | | /** Change the sprite priority |
82 | | |
83 | | @param fPriority |
84 | | New sprite priority. The higher the priority, the further |
85 | | towards the viewer the sprite appears. That is, sprites |
86 | | with higher priority appear before ones with lower |
87 | | priority. |
88 | | */ |
89 | | virtual void setPriority( double fPriority ) = 0; |
90 | | }; |
91 | | } |
92 | | |
93 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |