xref: /aoo4110/main/sd/source/ui/inc/sprite.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SD_SPRITE_HXX
25 #define SD_SPRITE_HXX
26 
27 #include <vcl/virdev.hxx>
28 #include <vcl/region.hxx>
29 #include <vcl/mapmod.hxx>
30 #include <vcl/image.hxx>
31 #include <vcl/bitmapex.hxx>
32 
33 // ----------
34 // - Sprite -
35 // ----------
36 
37 
38 namespace sd {
39 
40 class Marker;
41 class MetaFile;
42 
43 class Sprite
44 {
45 public:
46     Sprite( List* pListOfBmpEx );
47     ~Sprite();
48 
49 	sal_Bool			StartMoving( OutputDevice* pOut,
50 								 OutputDevice* pBottomLayer = NULL,
51 								 BitmapEx* pTopLayer = NULL,
52 								 MetaFile** ppTopMtf = NULL,
53 								 Marker* pObjStartMarker = NULL,
54 								 Marker* pObjEndMarker = NULL );
55 	void			MoveTo( OutputDevice* pOut, const Point& rPt, const Size* pSz = NULL );
56 	void			MoveTo( OutputDevice* pOut, const Point& rPt, const double& rScaleX, const double& rScaleY );
57 	void			EndMoving( OutputDevice* pOut );
58 
59 protected:
60 	MapMode			aOldMap;
61 	Region			aOldClip;
62 	Rectangle		aPaintRect;
63 	Point			aPt;
64 	Size			aSz;
65 	Point			aLayerOffsetPix;
66 	VirtualDevice*	pPaintDev;
67 	VirtualDevice*	pBottomLayer;
68 	BitmapEx*		pActBmpEx;
69 	BitmapEx*		pTopLayer;
70 	MetaFile**	ppTopMtf;
71 	Marker*			pObjStartMarker;
72 	Marker*			pObjEndMarker;
73 	List*			pListOfBmpEx;
74 	sal_uLong			nLastTime;
75 	sal_Bool			bClipRegion;
76 
77 	sal_Bool			ImplPrepareMoveTo();
78 	void			ImplDrawSprite( OutputDevice* pOut, const Point& rPt, const Size& rSz );
79 
80 };
81 
82 }
83 
84 #endif
85