merge the formfield patch from ooo-build
[ooovba.git] / goodies / source / inv / shapes.hxx
blobda45e8ab07c88e2d3f6582847f079c5a5dc6773b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: shapes.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SHAPES_HXX
31 #define _SHAPES_HXX
34 #include <vcl/image.hxx>
35 #include <vcl/outdev.hxx>
37 #define KANONEX 10
38 #define BOMBEY 20
39 #define MUNIXY 10
40 #define BOMBXY 5
41 #define WALLY 400
42 #define WALLKOLL 8
44 Image* ImplLoadImage( USHORT nId, ResMgr* pRes );
46 enum FighterMode { FIGHT_NORM, FIGHT_RIGHT, FIGHT_LEFT, FIGHT_DEST};
48 class Explosion;
50 class Fighter
52 private:
53 Image* pFightr;
54 Image* pFightl;
55 Point aOut;
56 Point aStart;
57 long nMax;
58 FighterMode eMode;
59 BOOL bNoKey;
60 Size aSize;
61 long nDelay;
63 public:
65 Image* pFight1;
67 Fighter(Size& rOut, ResMgr* pRes);
68 ~Fighter();
69 void Paint(OutputDevice& pDev);
70 void Move(long nDirect);
71 Point& GetPoint() { return aOut; }
72 BOOL Kollision(Rectangle, Explosion* pExpl);
73 void Init();
74 void NoFighter() { eMode = FIGHT_DEST; }
75 long GetHalf() { return aOut.X()+aSize.Width()/2; }
78 enum MuniMode { MUNI_DEL, MUNI_MODE1, MUNI_MODE2 };
80 #define MUNIY 10
81 #define MUNMAX 5
83 struct Munition_Impl
85 MuniMode eMode;
86 Point aPoint;
87 Rectangle aKoll;
90 DECLARE_LIST(MunitionListe,Munition_Impl*)
92 class Munition : public MunitionListe
94 private:
95 Image* pMunition2;
96 Size aSize;
98 public:
100 Image* pMunition1;
102 Munition(ResMgr* pRes);
103 ~Munition();
104 void Paint(OutputDevice& rDev);
105 void Start(Point& rPoint);
106 void SetDelete(long nWert) { GetObject(nWert)->eMode = MUNI_DEL; }
107 Rectangle GetKoll(long nWert) { return GetObject(nWert)->aKoll; }
108 void SetKoll(long nWert, Rectangle aRect)
109 { GetObject(nWert)->aKoll = aRect; }
110 MuniMode GetMode(long nWert) { return GetObject(nWert)->eMode; }
111 void SetMode(long nWert, enum MuniMode mode)
112 { GetObject(nWert)->eMode = mode; }
113 void SetPoint(long nWert, const Point& rPoint)
114 { GetObject(nWert)->aPoint = rPoint; }
115 Point GetPoint(long nWert) { return GetObject(nWert)->aPoint; }
116 long RemoveMunition();
117 void ClearAll();
120 struct Bombe_Impl
122 Point aXY;
123 Rectangle aKoll;
124 BOOL bDelete;
127 DECLARE_LIST(BombenListe, Bombe_Impl*)
129 class Bombe : public BombenListe
131 private:
132 Image* pBombe;
133 Size aSize;
134 long nSpeed;
136 public:
137 Bombe(ResMgr* pRes);
138 ~Bombe();
139 void Paint(OutputDevice& rDev);
140 Point& GetPoint(long nWert) { return GetObject(nWert)->aXY; }
141 void SetPoint(long nWert, const Point& rPoint)
142 { GetObject(nWert)->aXY = rPoint; }
143 void InsertBombe(const Point& rPoint);
144 Rectangle GetKoll(long nWert) { return GetObject(nWert)->aKoll; }
145 void SetKoll(long nWert, Rectangle aRect)
146 { GetObject(nWert)->aKoll = aRect; }
147 void SetDelete(long nWert) { GetObject(nWert)->bDelete = TRUE; }
148 void RemoveBomben();
149 void SetSpeed(long nWert) { nSpeed = nWert; }
150 void ClearAll();
151 BOOL Kollision(Rectangle aRect, Explosion* pExpl);
154 enum WallMode { WALL_MOD1, WALL_MOD2, WALL_MOD3, WALL_MOD4, WALL_MOD5,
155 WALL_MOD6, WALL_MOD7, WALL_MOD8, WALL_MOD9, WALL_MOD10,
156 WALL_DEL };
157 struct Wall_Impl
159 Point aXY;
160 WallMode eMode;
163 DECLARE_LIST(WallListe, Wall_Impl*)
165 class Wall : public WallListe
167 private:
168 Image* pWall1;
169 Image* pWall2;
170 Image* pWall3;
171 Image* pWall4;
172 Image* pWall5;
173 Image* pWall6;
174 Image* pWall7;
175 Image* pWall8;
176 Image* pWall9;
177 Image* pWall10;
178 Size aSize;
180 public:
181 Wall(ResMgr* pRes);
182 ~Wall();
184 void Paint(OutputDevice& pDev);
185 WallMode GetMode(long nWert) { return GetObject(nWert)->eMode; }
186 void SetMode(long nWert, enum WallMode Mode)
187 { GetObject(nWert)->eMode = Mode; }
188 Point GetPoint(long nWert) { return GetObject(nWert)->aXY; }
189 void InsertWall(const Point& rPoint);
190 void ClearAll();
191 BOOL Kollision(Rectangle& rRect, BOOL bDel);
194 #endif