1 /*
2  *	HT Editor
3  *	stddata.h
4  *
5  *	Copyright (C) 1999-2002 Sebastian Biallas (sb@biallas.net)
6  *
7  *	This program is free software; you can redistribute it and/or modify
8  *	it under the terms of the GNU General Public License version 2 as
9  *	published by the Free Software Foundation.
10  *
11  *	This program is distributed in the hope that it will be useful,
12  *	but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *	GNU General Public License for more details.
15  *
16  *	You should have received a copy of the GNU General Public License
17  *	along with this program; if not, write to the Free Software
18  *	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20 
21 #ifndef STDDATA_H
22 #define STDDATA_H
23 
24 #include "data.h"
25 
26 struct area_s {
27 	area_s	*left, *right;
28 	Object	*start, *end;
29 };
30 
31 class Area: public Object {
32 public:
33 	area_s			*a;
34 
Area()35 				Area() {};
Area(BuildCtorArg & a)36 				Area(BuildCtorArg &a): Object(a) {};
37 		void		init();
38 	virtual	void		load(ObjectStream &s);
39 	virtual	void 		done();
40 	virtual	ObjectID	getObjectID() const;
41 	virtual Area *		clone() const;
42 
43 		void		add(Object *Start, Object *End);
44 		bool		contains(Object *V);
45 		area_s		*getArea(Object *at);
46 		Object		*findNext(Object *From);
47 		Object		*findPrev(Object *From);
48 		void		freeRecursive(area_s *p);
49 	virtual	void		store(ObjectStream &s) const;
50 #ifdef DEBUG_FIXNEW
51 		void		dump();
52 #endif
53 };
54 
55 #define ATOM_AREA MAGIC32("AREA")
56 
57 bool init_stddata();
58 void done_stddata();
59 
60 #endif
61