xref: /aoo42x/main/tools/inc/poly.h (revision 514f4c20)
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 _POLY_H
25 #define _POLY_H
26 
27 #include <tools/gen.hxx>
28 
29 #define MAX_64KPOINTS       ((((sal_uInt16)0xFFFF)-32)/sizeof(Point))
30 
31 // -------------------
32 // - ImplPolygonData -
33 // -------------------
34 
35 class ImplPolygonData
36 {
37 public:
38     Point*          mpPointAry;
39     sal_uInt8*           mpFlagAry;
40     sal_uInt16          mnPoints;
41     sal_uIntPtr           mnRefCount;
42 };
43 
44 // ---------------
45 // - ImplPolygon -
46 // ---------------
47 
48 class ImplPolygon  : public ImplPolygonData
49 {
50 public:
51                     ImplPolygon( sal_uInt16 nInitSize, sal_Bool bFlags = sal_False );
52                     ImplPolygon( sal_uInt16 nPoints, const Point* pPtAry, const sal_uInt8* pInitFlags = NULL );
53                     ImplPolygon( const ImplPolygon& rImplPoly );
54                     ~ImplPolygon();
55 
56     void            ImplSetSize( sal_uInt16 nSize, sal_Bool bResize = sal_True );
57     void            ImplCreateFlagArray();
58     void            ImplSplit( sal_uInt16 nPos, sal_uInt16 nSpace, ImplPolygon* pInitPoly = NULL );
59     void            ImplRemove( sal_uInt16 nPos, sal_uInt16 nCount );
60 };
61 
62 // -------------------
63 // - ImplPolyPolygon -
64 // -------------------
65 
66 #define MAX_POLYGONS        ((sal_uInt16)0x3FF0)
67 
68 class Polygon;
69 typedef Polygon* SVPPOLYGON;
70 
71 class ImplPolyPolygon
72 {
73 public:
74     SVPPOLYGON*     mpPolyAry;
75     sal_uIntPtr           mnRefCount;
76     sal_uInt16          mnCount;
77     sal_uInt16          mnSize;
78     sal_uInt16          mnResize;
79 
ImplPolyPolygon(sal_uInt16 nInitSize,sal_uInt16 nResize)80                     ImplPolyPolygon( sal_uInt16 nInitSize, sal_uInt16 nResize )
81                         { mpPolyAry = NULL; mnCount = 0; mnRefCount = 1;
82                           mnSize = nInitSize; mnResize = nResize; }
83                     ImplPolyPolygon( sal_uInt16 nInitSize );
84                     ImplPolyPolygon( const ImplPolyPolygon& rImplPolyPoly );
85                     ~ImplPolyPolygon();
86 };
87 
88 #endif // _SV_POLY_H
89