xref: /aoo41x/main/svx/inc/xpolyimp.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _XPOLYIMP_HXX
29 #define _XPOLYIMP_HXX
30 
31 #include <tools/gen.hxx>
32 #include <svx/xpoly.hxx>
33 
34 /*************************************************************************
35 |*
36 |*    class ImpXPolygon
37 |*
38 |*    Beschreibung
39 |*    Ersterstellung       08.11.94
40 |*    Letzte Aenderung Joe 26.09.95
41 |*
42 *************************************************************************/
43 class ImpXPolygon
44 {
45 public:
46 	Point*          pPointAry;
47 	sal_uInt8*           pFlagAry;
48 	Point*          pOldPointAry;
49 	sal_Bool            bDeleteOldPoints;
50 	sal_uInt16          nSize;
51 	sal_uInt16          nResize;
52 	sal_uInt16          nPoints;
53 	sal_uInt16          nRefCount;
54 
55 	ImpXPolygon( sal_uInt16 nInitSize = 16, sal_uInt16 nResize=16 );
56 	ImpXPolygon( const ImpXPolygon& rImpXPoly );
57 	~ImpXPolygon();
58 
59 	bool operator==(const ImpXPolygon& rImpXPoly) const;
60 	bool operator!=(const ImpXPolygon& rImpXPoly) const { return !operator==(rImpXPoly); }
61 
62 	void CheckPointDelete()
63 	{
64 		if ( bDeleteOldPoints )
65 		{
66 			delete[] (char*)pOldPointAry;
67 			bDeleteOldPoints = sal_False;
68 		}
69 	}
70 
71 	void Resize( sal_uInt16 nNewSize, sal_Bool bDeletePoints = sal_True );
72 	void InsertSpace( sal_uInt16 nPos, sal_uInt16 nCount );
73 	void Remove( sal_uInt16 nPos, sal_uInt16 nCount );
74 };
75 
76 
77 /*************************************************************************
78 |*
79 |*    class ImpXPolyPolygon
80 |*
81 |*    Beschreibung
82 |*    Ersterstellung          08.11.94
83 |*    Letzte Aenderung  Joe 26-09-1995
84 |*
85 *************************************************************************/
86 DECLARE_LIST( XPolygonList, XPolygon* )
87 
88 class ImpXPolyPolygon
89 {
90 public:
91 	XPolygonList aXPolyList;
92 	sal_uInt16       nRefCount;
93 
94 				 ImpXPolyPolygon( sal_uInt16 nInitSize = 16, sal_uInt16 nResize = 16 ) :
95 					aXPolyList( 1024, nInitSize, nResize )
96 					{ nRefCount = 1; }
97 				ImpXPolyPolygon( const ImpXPolyPolygon& rImpXPolyPoly );
98 				~ImpXPolyPolygon();
99 
100 	bool operator==(const ImpXPolyPolygon& rImpXPolyPoly) const;
101 	bool operator!=(const ImpXPolyPolygon& rImpXPolyPoly) const { return !operator==(rImpXPolyPoly); }
102 };
103 
104 
105 
106 #endif      // _XPOLYIMP_HXX
107