Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef _XPOLYIMP_HXX
21 : #define _XPOLYIMP_HXX
22 :
23 : #include <tools/gen.hxx>
24 : #include <svx/xpoly.hxx>
25 : #include <vector>
26 :
27 : class ImpXPolygon
28 : {
29 : public:
30 : Point* pPointAry;
31 : sal_uInt8* pFlagAry;
32 : Point* pOldPointAry;
33 : sal_Bool bDeleteOldPoints;
34 : sal_uInt16 nSize;
35 : sal_uInt16 nResize;
36 : sal_uInt16 nPoints;
37 : sal_uInt16 nRefCount;
38 :
39 : ImpXPolygon( sal_uInt16 nInitSize = 16, sal_uInt16 nResize=16 );
40 : ImpXPolygon( const ImpXPolygon& rImpXPoly );
41 : ~ImpXPolygon();
42 :
43 : bool operator==(const ImpXPolygon& rImpXPoly) const;
44 0 : bool operator!=(const ImpXPolygon& rImpXPoly) const { return !operator==(rImpXPoly); }
45 :
46 1399 : void CheckPointDelete()
47 : {
48 1399 : if ( bDeleteOldPoints )
49 : {
50 0 : delete[] (char*)pOldPointAry;
51 0 : bDeleteOldPoints = sal_False;
52 : }
53 1399 : }
54 :
55 : void Resize( sal_uInt16 nNewSize, sal_Bool bDeletePoints = sal_True );
56 : void InsertSpace( sal_uInt16 nPos, sal_uInt16 nCount );
57 : void Remove( sal_uInt16 nPos, sal_uInt16 nCount );
58 : };
59 :
60 : typedef ::std::vector< XPolygon* > XPolygonList;
61 :
62 : class ImpXPolyPolygon
63 : {
64 : public:
65 : XPolygonList aXPolyList;
66 : sal_uInt16 nRefCount;
67 :
68 0 : ImpXPolyPolygon() { nRefCount = 1; }
69 : ImpXPolyPolygon( const ImpXPolyPolygon& rImpXPolyPoly );
70 : ~ImpXPolyPolygon();
71 :
72 : bool operator==(const ImpXPolyPolygon& rImpXPolyPoly) const;
73 0 : bool operator!=(const ImpXPolyPolygon& rImpXPolyPoly) const { return !operator==(rImpXPolyPoly); }
74 : };
75 :
76 :
77 :
78 : #endif // _XPOLYIMP_HXX
79 :
80 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|