svgtopt/gfx2d/src/GfxGc/GfxStroke.cpp
changeset 0 d46562c3d99d
equal deleted inserted replaced
-1:000000000000 0:d46562c3d99d
       
     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 "GfxStroke.h"
       
    20 #include "GfxGeneralPath.h"
       
    21 
       
    22 // --------------------------------------------------------------------------
       
    23 //  TGfxStroke::TGfxStroke()
       
    24 // ---------------------------------------------------------------------------
       
    25  TGfxStroke::TGfxStroke()
       
    26     {
       
    27     SetVars( 1, EGfxJoinMiter, EGfxCapButt, TFloatFixPt( 4 ) );
       
    28     }
       
    29 
       
    30 // --------------------------------------------------------------------------
       
    31 //  void TGfxStroke::SetStrokeWidth( TFloatFixPt aWidth )
       
    32 // ---------------------------------------------------------------------------
       
    33  void TGfxStroke::SetStrokeWidth( TFloatFixPt aWidth )
       
    34     {
       
    35     iStrokeWidth = aWidth;
       
    36     }
       
    37 
       
    38 // --------------------------------------------------------------------------
       
    39 //  void TGfxStroke::SetMiterLimit( TFixPt aMiterLimit )
       
    40 // ---------------------------------------------------------------------------
       
    41  void TGfxStroke::SetMiterLimit( TFloatFixPt aMiterLimit )
       
    42     {
       
    43     iMiterLimit = aMiterLimit;
       
    44     }
       
    45 
       
    46 // --------------------------------------------------------------------------
       
    47 //  void TGfxStroke::SetJoinType( TGfxJoinType aJoin )
       
    48 // ---------------------------------------------------------------------------
       
    49  void TGfxStroke::SetJoinType( TGfxJoinType aJoin )
       
    50     {
       
    51     iJoin = aJoin;
       
    52     }
       
    53 
       
    54 // --------------------------------------------------------------------------
       
    55 //  void TGfxStroke::SetCapType( TGfxCapType aCap )
       
    56 // ---------------------------------------------------------------------------
       
    57  void TGfxStroke::SetCapType( TGfxCapType aCap )
       
    58     {
       
    59     iCap = aCap;
       
    60     }
       
    61 
       
    62 // --------------------------------------------------------------------------
       
    63 //  TFloatFixPt TGfxStroke::StrokeWidth()
       
    64 // ---------------------------------------------------------------------------
       
    65  TFloatFixPt TGfxStroke::StrokeWidth()
       
    66     {
       
    67     return iStrokeWidth;
       
    68     }
       
    69 
       
    70 // --------------------------------------------------------------------------
       
    71 //  TGfxJoinType TGfxStroke::StrokeJoin()
       
    72 // ---------------------------------------------------------------------------
       
    73  TGfxJoinType TGfxStroke::StrokeJoin()
       
    74 	{
       
    75 	return iJoin;
       
    76 	}
       
    77 
       
    78 // --------------------------------------------------------------------------
       
    79 //  TGfxCapType TGfxStroke::StrokeCap()
       
    80 // ---------------------------------------------------------------------------
       
    81  TGfxCapType TGfxStroke::StrokeCap()
       
    82 	{
       
    83 	return iCap;
       
    84 	}
       
    85 
       
    86 // --------------------------------------------------------------------------
       
    87 //  TFloatFixPt TGfxStroke::StrokeMiterLimit()
       
    88 // ---------------------------------------------------------------------------
       
    89  TFloatFixPt TGfxStroke::StrokeMiterLimit()
       
    90 	{
       
    91 	return iMiterLimit;
       
    92 	}
       
    93 
       
    94 // --------------------------------------------------------------------------
       
    95 //  TGfxStroke::TGfxStroke( TFloatFixPt aStrokeWidth )
       
    96 // ---------------------------------------------------------------------------
       
    97  TGfxStroke::TGfxStroke( TFloatFixPt aStrokeWidth )
       
    98     {
       
    99     SetVars( aStrokeWidth, EGfxJoinMiter, EGfxCapButt, TFloatFixPt( 4 ) );
       
   100     }
       
   101 
       
   102 // --------------------------------------------------------------------------
       
   103 //  TGfxStroke::TGfxStroke( TFloatFixPt aStrokeWidth,
       
   104 // ---------------------------------------------------------------------------
       
   105  TGfxStroke::TGfxStroke( TFloatFixPt aStrokeWidth,
       
   106                                  TGfxJoinType aJoin,
       
   107                                  TGfxCapType aCap,
       
   108                                  TFloatFixPt& aMiterLimit )
       
   109     {
       
   110     SetVars( aStrokeWidth, aJoin, aCap, aMiterLimit );
       
   111     }
       
   112 
       
   113 // --------------------------------------------------------------------------
       
   114 // void TGfxStroke::SetVars( TFloatFixPt aStrokeWidth,
       
   115 // ---------------------------------------------------------------------------
       
   116 void TGfxStroke::SetVars( TFloatFixPt aStrokeWidth,
       
   117                           TGfxJoinType aJoin,
       
   118                           TGfxCapType aCap,
       
   119                           const TFloatFixPt& aMiterLimit )
       
   120     {
       
   121     iStrokeWidth = aStrokeWidth;
       
   122     iJoin = aJoin;
       
   123     iCap = aCap;
       
   124     iMiterLimit = aMiterLimit;
       
   125     }
       
   126 
       
   127