|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Graphics Extension Library source file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "GfxRoundRectangle2D.h" |
|
20 #include "GfxRoundRectangleIteratorP.h" |
|
21 #include "GfxFlatteningPathIterator.h" |
|
22 #include "GfxRectangleIteratorP.h" |
|
23 |
|
24 |
|
25 // --------------------------------------------------------------------------- |
|
26 // Constructor |
|
27 // --------------------------------------------------------------------------- |
|
28 // -------------------------------------------------------------------------- |
|
29 // TGfxRoundRectangle2D::TGfxRoundRectangle2D() |
|
30 // --------------------------------------------------------------------------- |
|
31 TGfxRoundRectangle2D::TGfxRoundRectangle2D() |
|
32 : TGfxRectangularShape( 0, |
|
33 0, |
|
34 0, |
|
35 0 ), |
|
36 iArcWidth( 0 ), |
|
37 iArcHeight( 0 ) |
|
38 { |
|
39 } |
|
40 |
|
41 // -------------------------------------------------------------------------- |
|
42 // TGfxRoundRectangle2D::TGfxRoundRectangle2D( const TFloatFixPt& aX, |
|
43 // --------------------------------------------------------------------------- |
|
44 TGfxRoundRectangle2D::TGfxRoundRectangle2D( const TFloatFixPt& aX, |
|
45 const TFloatFixPt& aY, |
|
46 const TFloatFixPt& aW, |
|
47 const TFloatFixPt& aH, |
|
48 const TFloatFixPt& aArcWidth, |
|
49 const TFloatFixPt& aArcHeight ) |
|
50 : TGfxRectangularShape( aX, |
|
51 aY, |
|
52 aW, |
|
53 aH ), |
|
54 iArcWidth( aArcWidth ), |
|
55 iArcHeight( aArcHeight ) |
|
56 { |
|
57 } |
|
58 |
|
59 // -------------------------------------------------------------------------- |
|
60 // void TGfxRoundRectangle2D::GetPathIteratorL( TGfxAffineTransform* aAt, |
|
61 // --------------------------------------------------------------------------- |
|
62 void TGfxRoundRectangle2D::GetPathIteratorL( TGfxAffineTransform* aAt, |
|
63 CGfxPathIterator*& aPitr ) |
|
64 { |
|
65 TFloatFixPt KZero; |
|
66 if ( iArcWidth <= KZero && iArcHeight <= KZero ) |
|
67 aPitr = new ( ELeave ) CGfxRectangleIteratorP( this, aAt ); |
|
68 else |
|
69 aPitr = new ( ELeave ) CGfxRoundRectangleIteratorP( this, aAt ); |
|
70 } |
|
71 |
|
72 // -------------------------------------------------------------------------- |
|
73 // void TGfxRoundRectangle2D::GetPathIteratorL( TGfxAffineTransform* aAt, |
|
74 // --------------------------------------------------------------------------- |
|
75 void TGfxRoundRectangle2D::GetPathIteratorL( TGfxAffineTransform* aAt, |
|
76 TInt aLimit, |
|
77 CGfxPathIterator*& aPitr ) |
|
78 { |
|
79 aPitr = CGfxFlatteningPathIterator::NewL( this, aAt, aLimit ); |
|
80 |
|
81 } |
|
82 |
|
83 |