+
    bIi7                        R t Rt^ RIt^ RIt^ RIHtHtHtHtH	t	H
t
 ^ RIHt ^ RIHtHtHtHtHt ^ RIHt ^ RIHt ^ RI5 ^ R	IHtHt ]! ]! ^ ^4      4      t^ RI5 ^ R
IH t  ^ RI!H"t" ^ RI#H$t$ ^ RI%H&t&H't' ]$! ]^^ 4      t(]$! ]^ ^4      t)]$! ]^^4      t*Rt+Rt,/ RRebR]PZ                  bR^bR^ bR^ bR^
bRRbRRbRRbRRbRRbR^ bR]PZ                  bR]&bR^
bR ]bR!R"bt.^RI/5 R# t0R$ t1 ! R% R&4      t2 ! R' R(4      t3R) t4R* t5R+ t6R, t7 ! R- R.]3]24      t8 ! R/ R0]84      t9RfR1 lt:RfR2 lt;RgR3 lt<R4 t= ! R5 R6]9]4      t> ! R7 R84      t? ! R9 R:]@4      tA]A! 4       tA ! R; R<]84      tB ! R= R>]B4      tC ! R? R@]B4      tD]E! ]F! ^4      4      w  tGtHtItJRhtK. RiOtLRjRA ltMRR]']'RB]'RC]']&]&RD]&RE]&/tN ! RF RG]D4      tO]O! 4       tPRkRH ltQ ! RI RJ]O4      tR. ^ ^ ^ 3RK ltS ! RL RM]D4      tT ! RN RO]D4      tU ! RP RQ]D4      tV ! RR RS]D4      tW ! RT RU]D4      tX ! RV RW]D4      tY ! RX RY]B4      tZ ! RZ R[]O4      t[R]3R\ lt\ ! R] R^]84      t] ! R_ R`]24      t^ ! Ra Rb]84      t_Rc t`]aRd8X  d
   ]`! 4        R# R# )lz3.5.60z9Core of the graphics library - defines Drawing and ShapesN)picossinsqrtradiansfloor)Flowable)shapeCheckingverbosedefaultGraphicsFontName_unset_decimalSymbol)logger)colors)*)isSeqasBytes)fp_str)stringWidth)tt2ps)FILL_EVEN_ODDFILL_NON_ZEROzNon-Zero WindingzEven-Odd	transformstrokeColorstrokeWidthstrokeLineCapstrokeLineJoinstrokeMiterLimitstrokeDashArraystrokeOpacityfillOpacityfillOverprintFstrokeOverprintoverprintMask	fillColorfillModefontSizefontName
textAnchorstartc           	         ^ pV  F  p\        V\        WqV4      4      pK  	  \        V 4      V,          pTp	V^ ,          R8X  d   V) p
W,
          p	M#V^ ,          R8X  d   ^ p
MV) R,          p
W,           p	VR,          R8X  d$   V) pVR8X  d   ^ pMeVR8X  d   V) pMZV) R,          pMOVR,          R8X  d!   ^ pVR8X  d   TpM5VR8X  d   ^ pM+VR,          pM!V) R,          pVR8X  d   V) pMVR8X  d   TpM^ pWWhW3# )	    sng       @eendr)   w)maxr   len)textfontr&   leadingr(   	boxAnchorr0   thytybxbxts   &&&&&&       ڂC:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO CLAUDE\MAESTRO\maestro-backend\venv\Lib\site-packages\reportlab/graphics/shapes.py_textBoxLimitsr?   C   s   	A+ah/0  	D	'A	B|SRV	1s	RVW}cRu1b r"2c6b	2	u1b q"S5bRVuB3b r"b1    c           	     8   \        \        V4      W3W,           V3W,           W,           3WV,           334      pV U u. uF  q ^ ,          NK  	  pp V U u. uF  q ^,          NK  	  pp \        V4      \        V4      \        V4      \        V4      V3# u up i u up i )z
Find the corner points of the rotated w x h sized box at x,y
return the corner points and the min max points in the original space
)zTransformPointsrotateminr2   )xyr0   r9   angleCXYs   &&&&&   r>   _rotatedBoxLimitsrK   e   s    
 	qs1gqs13iQ3'HIAq!1qAq!1qAq63q63q63q61,, 	s   BBc                   *   a  ] tR t^ot o RtR tRtV tR# )_DrawTimeResizeablez:Addin class to provide the horribleness of _drawTimeResizec                    \        V R 4      '       dN   V P                  pVP                  pWuVn        Vn        \        VR4      '       d   VP                  W4       R# R# R# )_canvas_drawTimeResizeN)hasattrrO   _drawingwidthheightrP   )selfr0   r9   canvasdrawings   &&&  r>   rP   #_DrawTimeResizeable._drawTimeResizeq   sU    4	""\\FooG,-)GM7>v/00&&q+ 1	 #r@    N)__name__
__module____qualname____firstlineno____doc__rP   __static_attributes____classdictcell____classdict__s   @r>   rM   rM   o   s     D, ,r@   rM   c                   ,   a  ] tR t^yt o / 3R ltRtV tR# )_SetKeyWordArgsc                P    VP                  4        F  w  r#\        WV4       K  	  R# )z9In general properties may be supplied to the constructor.N)itemssetattr)rU   keywordskeyvalues   &&  r>   __init___SetKeyWordArgs.__init__z   s    "..*JCDu% +r@   rY   N)rZ   r[   r\   r]   rk   r_   r`   ra   s   @r>   rd   rd   y   s      " & &r@   rd   c                     V  Uu. uF
  qf   K  VNK  	  ppV'       g   R # V^ ,          w  r4rVVR,           F(  w  rxrWs8  d   TpW8  d   T	pW8  d   TpW8  g   K&  T
pK*  	  W4WV3# u upi )N   NNrY   )rectListrE   LxMinyMinxMaxyMaxx1y1x2y2s   &          r>   getRectsBoundsrz      sz    .HqHA.TqTDbEE9D9D9D9D " ## 	/s
   A&A&c                   V^W!,
          ,          ,
          V ,
          p^V^V,          ,
          V ,           ,          pW,
          pV .pWU,          ^V,          V,          ,
          pV^ 8  d   \        V4      pV^ 8  d   V) pRWX,           ,          p	. p
 V
P                  W,          4        T
P                  Yi,          4       TR,          pT^,          pT
 FQ  p^ Tu;8:  d
   ^8:  g   K  M K  TP                  YY,          T,           ,          T,           ,          T ,           4       KS  	  VP                  V4       V#     L; i    L; i)a#  
this is used to find if a curveTo path operator has extrema in its range
The curveTo operator is defined by the points y0, y1, y2, y3

    B(t):=(1-t)^3*y0+3*(1-t)^2*t*y1+3*(1-t)*t^2*y2+t^3*y3
        :=t^3*(y3-3*y2+3*y1-y0)+t^2*(3*y2-6*y1+3*y0)+t*(3*y1-3*y0)+y0
and is a cubic bezier curve.

The differential is a quadratic
    t^2*(3*y3-9*y2+9*y1-3*y0)+t*(6*y2-12*y1+6*y0)+3*y1-3*y0

The extrema must be at real roots, r, of the above which lie in 0<=r<=1

The quadratic coefficients are
    a=3*y3-9*y2+9*y1-3*y0 b=6*y2-12*y1+6*y0 c=3*y1-3*y0
or
    a=y3-3*y2+3*y1-y0 b=2*y2-4*y1+2*y0 c=y1-y0  (remove common factor of 3)
or
    a=y3-3*(y2-y1)-y0 b=2*(y2-2*y1+y0) c=y1-y0

The returned value is [y0,x1,x2,y3] where if found x1, x2 are any extremals that were found;
there can be 0, 1 or 2 extremals
g      ?g      )r   append)y0rw   ry   y3abcrJ   dqRr8   s   &&&&        r>   _getBezierExtremar      s   0 	BEl2oAAbDnAeA	A 	
ac!eA!tGQ3QB!#J	HHQSM	HHQSM 	
S	QA!wQwwqs1uIaK+,  HHRLH		s   D= *E =EEc           
          \        V 4      pV 3R  lp\        \        V\        ^ V^4      4      4      p\        \        V\        ^V^4      4      4      p\	        V4      \	        V4      \        V4      \        V4      3# )c                     W,          # NrY   )ips   &&r>   <lambda>getPathBounds.<locals>.<lambda>   s    QTr@   )r3   listmaprangerD   r2   )pointsr-   fxsyss   &    r>   getPathBoundsr      sd    FA!A	c!E!AaL!	"B	c!E!AaL!	"BGSWc"gs2w//r@   c                   V ^ ,          p\        V4      '       dY   V  Uu. uF  q"^ ,          NK  	  ppV  Uu. uF  q"^,          NK  	  pp\        V4      \        V4      \        V4      \        V4      3# \        V 4      # u upi u upi )z"Helper function for list of points)r   rD   r2   r   )	pointListfirstxyr   r   s   &    r>   getPointsBoundsr      sv    aLEU||'(ieei('(ieei(BR#b'3r733Y''	 )(s
   A>Bc                   v   a  ] tR t^t o Rt]! 4       tR tRR ltR t	RR lt
R t]'       d    R tR tR	tV tR
# )Shapea  Base class for all nodes in the tree. Nodes are simply
packets of data to be created, stored, and ultimately
rendered - they don't do anything active.  They provide
convenience methods for verification but do not
check attribiute assignments or use any clever setattr
tricks this time.c                N    \        RV P                  P                  ,          4      h)zReturn a clone of this shape.z!No copy method implemented for %s)NotImplementedError	__class__rZ   rU   s   &r>   copy
Shape.copy   s     ""EH_H_"_``r@   c                x    / pV P                   P                  4        F  w  r4VR,          R8w  g   K  WBV&   K  	  V# )z<Interface to make it easy to extract automatic
documentation:r+   ro   N_)__dict__rf   )rU   recurpropsri   rj   s   &&   r>   getPropertiesShape.getProperties   s;     ----/JC3x3"c
 0 r@   c                <    V P                   P                  V4       R# )z^Supports the bulk setting if properties from,
for example, a GUI application or a config file.N)r   update)rU   r   s   &&r>   setPropertiesShape.setProperties   s     	U#r@   c                    \        V P                  4       P                  4       4      pVP                  4        V'       d
   VR,           pV F  w  r4\	        V: V: RV: 24       K  	  R# )zConvenience. Lists them on standard output.  You
may provide a prefix - mostly helps to generate code
samples for documentation..z = N)r   r   rf   sortprint)rU   prefixpropListnamerj   s   &&   r>   dumpPropertiesShape.dumpProperties  sP    
 **,2245c\F%MTu56 &r@   c                   V P                   e   V P                  P                  4        F2  pV^ ,          R8w  g   K  WP                   9   d   K%  Q RV: RV : 24       h	  V P                   P                  4        Fn  w  r#\	        W4      '       g   Q RV: RV : 24       h\        W4      pVP                  V4      '       d   KI  Q RV: RV: R	V P                  P                  : 24       h	  R# R# )
a  If the programmer has provided the optional
_attrMap attribute, this checks all expected
attributes are present; no unwanted attributes
are present; and (if a checking function is found)
checks each attribute.  Either succeeds or raises
an informative exception.Nr   zUnexpected attribute z
 found in zMissing attribute z from zInvalid value z for attribute z
 in class )	_attrMapr   keysrf   rQ   getattrvalidater   rZ   )rU   ri   attr	metavaluerj   s   &    r>   verifyShape.verify  s     ==$}}))+q6S=--/dZ]_c1dd/ , $(==#6#6#8t**YdTX,YY*+ ))%00  Kejlprv  sA  sA  sJ  sJ  3K  K0 $9	 %r@   c                    \        WV4       R# )zGBy default we verify.  This could be off
in some parallel base classes.N)validateSetattr)rU   r   rj   s   &&&r>   __setattr__Shape.__setattr__%  s     De,r@   c                    \        R4      h)5Returns bounding rectangle of object as (x1,y1,x2,y2)z+Shapes and widgets must implement getBoundsr   r   s   &r>   	getBoundsShape.getBounds*  s    !"OPPr@   rY   Nro   ) )rZ   r[   r\   r]   r^   AttrMapr   r   r   r   r   r   r	   r   r   r_   r`   ra   s   @r>   r   r      sI      yHa$
7K" 	6	-
Q Qr@   r   c                   *  a  ] tR tRt o Rt]! ]! ]R^R7      ]! ]RR7      ]! ]	RR7      ]! ]	R^R7      ]! ]	R	^R7      R
7      t
R tR tR R ltR R ltR R ltR tR tR tR!R ltR tR tR"R ltR#R ltR$R ltR#R ltR#R ltR tR tR tRtV tR# )%Groupi.  a  Groups elements together.  May apply a transform
to its contents.  Has a publicly accessible property
'contents' which may be used to iterate over contents.
In addition, child nodes may be given a name in which
case they are subsequently accessible as properties.z"Coordinate transformation to applydescadvancedUsagezContained drawable elementsr   Turn on stroke overprintingTurn on fill overprintingoverprinting for ordinary CMYK)r   contentsr"   r!   r#   c                    V P                   P                  4       V n         . V n        RV n        V F  pV P	                  V4       K  	  \
        P                  W4       R# )zyInitial lists of elements may be provided to allow
compact definitions in literal Python code.  May or
may not be useful.Nro   r+   r+   ro   r+   r+   )r   cloner   r   addrd   rk   )rU   elementsrh   elts   &*, r>   rk   Group.__init__=  sK     ++-&CHHSM  	  0r@   c                    V'       d;   WP                   9  d   \        \        4      V P                   V&   \        WV4       R# R# )zLif name is not None add an attribute pointing to node and add to the attrMapN)r   AttrMapValueisValidChildrg   )rU   r   nodes   &&&r>   _addNamedNodeGroup._addNamedNodeM  s1    ==(&2<&@d#D% r@   Nc                    VeG   \        V4      '       g   Q R4       hV P                  P                  V4       V P                  W!4       R# R# )zAppends non-None child node to the 'contents' attribute. In addition,
if a name is provided, it is subsequently accessible by name
Nz1Can only add Shape or UserNode objects to a Group)r   r   r|   r   rU   r   r   s   &&&r>   r   	Group.addT  sF    
 %%Z'ZZ%MM  &t) r@   c                L    V P                  WR 7       V P                  R,          # ))r   r1   )r   r   r   s   &&&r>   _nn	Group._nn^  s    !}}R  r@   c                    Ve^   \        V4      '       g   Q R4       hV^ 8  d   V.V P                  W% MV P                  P                  W4       V P                  W24       R# R# )z4Inserts sub-node n in contents at specified locationNz4Can only insert Shape or UserNode objects in a Group)r   r   insertr   )rU   r   r-   r   s   &&&&r>   r   Group.insertb  sW    =??Z$ZZ?s%&Ca"$$Q)t& r@   c                p   \        V \        4      ;'       d)    \        V P                  V P                  4      ;'       g    \	        4       pV P
                  P                  4       Vn        \        VR4      '       d   V P                  R,          Vn        V P                  pVP                  P                  pV Fi  p\        V\        4      '       d   VP                  4       pM7\        V\        4      '       d   VP                  4       pMVP                  4       pV! V4       Kk  	  V P                  V4       V# )z9Return a new object which only contains primitive shapes.r   NNN)
isinstanceDrawingrS   rT   r   r   r   rQ   r   r   r|   UserNodeprovideNodeexpandUserNodesr   _copyNamedContents)rU   objself_contentsr   childnewChilds   &     r>   r   Group.expandUserNodesl  s     g&JJ74::dkk+JUUeg}}**,3{##T^^A5FS]LL"E%** ,,.E5)) 002 ::<hK # 	$
r@   c                   \        4       p\        V R4      '       d   V P                  Vn        \        VR4      '       d   V P                  R,          Vn        V P	                  4       R,          pV'       d   VP                  ^ 4      p\        V\        4      '       d#   VP                  ^ VP                  4       4       KQ  \        V\         4      '       d\   VP                  4       pVP                  R8X  d(   VP                  P                  VP                  4       K  VP                  V4       K  VP                  V4       K  V# )zreturn a fully expanded object	__label__r   r   r   )r   rQ   r   r   getContentspopr   r   r   r   _exploder   extendr   )rU   r   Pr-   s   &   r>   r   Group._explode  s    g4$$..CM3{##T^^A5FS]q!aA!X&&1==?+Au%%JJL;;-LL''

3GGAJ

r@   c                b    V P                    F  pVP                   P                  V4       K   	  R # r   )r   r|   )rU   r   r   s   && r>   _copyContentsGroup._copyContents  s"    ]]ELL& #r@   c                v   ^ RI H p V P                  pV'       g$   \        V P                  P	                  4       4      pV P
                  P                  4        F]  w  rgWu9   d1   VP                  V4      p\        WVP                  V,          4       K;  Wb9   g   KC  Wc9  g   KK  \        WV! V4      4       K_  	  R# )r+   )r   N)	r   r   r   r   r   r   rf   indexrg   )	rU   r   aKeysnoCopyr   r   kvposs	   &&&&     r>   r   Group._copyNamedContents  s    d4==#5#5#78eMM'')DA!#))!,S 12Q( *r@   c                    V P                   P                  4       Vn         V P                  V4       V P                  V4       V# )zcopies to obj)r   r   r  r   rU   r   s   &&r>   _copyGroup._copy  s7    }}**,3$
r@   c                @    V P                  V P                  4       4      # )zreturns a copy)r  r   r   s   &r>   r   
Group.copy  s    zz$..*++r@   c                P    \        V P                  \        WV4      4      V n        R# z&Convenience to help you set transformsN)mmultr   rC   )rU   thetacxcys   &&&&r>   rC   Group.rotate  s    t~~ver/BCr@   c                N    \        V P                  \        W4      4      V n        R# r  )r  r   	translate)rU   dxdys   &&&r>   r  Group.translate  s    t~~y/@Ar@   c                N    \        V P                  \        W4      4      V n        R# r  )r  r   scale)rU   sxsys   &&&r>   r  Group.scale  s    t~~uR}=r@   c                t    \        \        V P                  \        V4      4      \        V4      4      V n        R# r  )r  r   skewXskewY)rU   kxkys   &&&r>   skew
Group.skew  s#    uT^^U2Y?b	Jr@   c                >    V P                   RR W3,           V n         R# )z2Convenience function to set the origin arbitrarilyN)r   rU   rE   rF   s   &&&r>   shiftGroup.shift  s    ,aU2r@   c                ~    \         V n        V P                  P                  V P                  4       Wn        W n        R# )zgConvenience function to make a drawing from a group
After calling this the instance will be a drawing!
N)r   r   r   r   _xtraAttrMaprS   rT   )rU   rS   rT   s   &&&r>   	asDrawingGroup.asDrawing  s-     !T../
r@   c                h    \        V RR4      pV P                  pV'       d   W9  d   V.V,           pV# )zSReturn the list of things to be rendered
override to get more complicated behaviour
backgroundN)r   r   )rU   r   rH   s   &  r>   r   Group.getContents  s1     Dd+MM!QQr@   c                J   V P                   '       d   . pV P                    F"  pVP                  VP                  4       4       K$  	  \        V4      pVf   R # Vw  r4rVV P                  pW4.W6.WT.WV..p. p	V F  p
V	P                  \        Wz4      4       K  	  \        V	4      # R # r   )r   r|   r   rz   r   transformPointr   )rU   r   elemrv   rw   rx   ry   transcorners
newCornerscorners   &          r>   r   Group.getBounds  s    ===A)* &"Bz$NBBNNEw2(RG<GJ!!!."?@ "":.. r@   )r   r   r   rT   r   rS   r   )N)r   r+   r+   r+   r   ) rZ   r[   r\   r]   r^   r   r   isTransformisListOfShapes	isBooleanr   rk   r   r   r   r   r   r   r  r   r  r   rC   r  r  r'  r,  r0  r   r   r_   r`   ra   s   @r>   r   r   .  s     <  2Vefg4QR&y6ST$Y4O^_`$Y4Tcde
H1 &*!',*'	),DB>K3 r@   r   c                    ^ RI Hp V P                  pV! V4      P                  pT;'       g    VP                  pWQ9  d   V.W&   R# W!V,          9  d   W,          P	                  V4       R# R# )z7add an import of obj's class to a dictionary of imports)	getmoduleN)inspectrC  r   rZ   r|   )r   Ir-   rC  r   ms   &&&   r>   _addObjImportrG    sU    !A!A	QZZAzs	
A$	A 
r@   c                ,  a \        V \        4      '       d   \        V 4      # \        V 4      '       dU   RP	                  V3R lV  4       4      p\        V \
        4      '       d   RV R2# RT \        V 4      ^8X  d   R R2# R R2# V \        J d   S'       d   \        V SR4       R# \        V \        4      '       Ed<   S'       d   \        V S4       ^ R	I
Hp V! V P                  4      w  rErgrp
V'       d    V\        V4      ) R
 pV\        V4      ) R
1 M. pV P                  4       pVR,           Uu. uF  p\        VP                  VR
4      S4      NK!  	  upV Uu. uF#  q R\        VP                  VR
4      S4       2NK%  	  up,           VP!                  4        UUu. uF  w  rV R\        W,          S4       2NK  	  upp,           pV P"                  P$                   RRP	                  V4       R2# \'        V 4      # u upi u upi u uppi )zEreturn a repr style string with named fixed args first, then keywords,c              3   <   <"   T F  p\        VS4      x  K  	  R # 5ir   )_repr).0r  rE  s   & r>   	<genexpr>_repr.<locals>.<genexpr>  s     /$QeAajj$s   [](r   )EmptyClipPath)getfullargspecNrn   =)r   floatr   r   joinr   r3   rS  rG  r   rD  rT  rk   r   rK  r   rf   r   rZ   repr)rU   rE  r,   rT  argsvarargsvarkwdefaults
kwonlyargskwonlydefaultsannotationskargsr   r-   r  s   &f             r>   rK  rK    s   $ud|	tHH/$/0d4  qc8OqcTA#5Q77"5Q77		mD?3	D		mD#*R`aeananRoOu
K#h-)Ec(m^_%E .22h7heAEE!DM!$h77<=u!1U1554=+,-u=>01	:	1U14]O$	:; ..))*!CHHQK=::Dz 8=:s   5%H )H$"Hc           	         R p\        V RR4      pV'       d   WT V R\        V4       R2,          pV P                  4        F  p\        V\        4      '       d_   RV 2pV^,          p\        VRR 4      p	V	'       d
   RV	,           p	WT V RV R	V	 R2,          pV\        WxW#V4      ,          pV^,          pKw  WT V R
\        Wr4       R2,          pK  	  V# )r   r   Nz.transform = 
r  r   #rU  z._nn(Group())z.add(z)
)r   rK  r   r   r   _renderGroupPy)
GpfxrE  r   indentr,   rH   r-   npfxls
   &&&&&     r>   rd  rd    s    
A+d#A!#mE!H:R8
8!]]_aqc7DFA+b)ACE!8D63%}QCr::Aq622AFA8C5eAj\55A  Hr@   c                     VP                  V P                  4       \        V4      pVP                  4        UUu/ uF#  w  rEVP	                  V4      '       g   K  WCR  VbK%  	  upp# u uppi r   )r   r   r3   rf   
startswith)rU   rf  kwr-   r  r  s   &&,   r>   _extraKWrm  %  sP    IIdmmCA!xxz?zQ\\#->GAbE!Gz???s   A'	A'c                     a  ] tR tRt o Rt0 R"mt]0 R#m,
          t]! ]! ]	RR7      ]! ]	RR7      ]! R4      ]! ]
RR7      ]! ]! RR	R
R4      RR7      ]! ]! RRR
R4      RR7      ]! ]	RR7      ]! ]RR7      ]! ]RR7      R7	      t]! ]]! ]! ]! ]!  ^^ R7      RR7      R7      t]P%                  ]4       R$R ltR t]3R ltR tR tR tR tR%R ltR&R ltR'R  ltR!tV tR# )(r   i*  zwOutermost container; the thing a renderer works on.
This has no properties except a height, width and list
of contents.zDrawing width in points.r   zDrawing height in points.Nz=Background widget for the drawing e.g. Rect(0,0,width,height)LEFTRIGHTCENTERCENTREz+Horizontal alignment within parent documentTOPBOTTOMz)Vertical alignment within parent documentzGlobal scaling for renderingz.override the STATE_DEFAULTS value for fontNamez.override the STATE_DEFAULTS value for fontSize)	rS   rT   canvr3  hAlignvAlignrenderScaleinitialFontNameinitialFontSize)loemptyOKzOne or more plot modes)BASEformatsc                    R V n         \        P                  ! V .VO5/ VB  Wn        W n        RV n        RV n        RV n        R # )Nro  rt        ?)r3  r   rk   rS   rT   rv  rw  rx  )rU   rS   rT   nodesrh   s   &&&*,r>   rk   Drawing.__init__Z  s?    t.U.X.
r@   c                   R . ROR. RO/p\        V P                  4       RV4      pRV P                  P                  ,           pRpVRP	                  R VP                  4        4       4      ,          pVRV R2,          pVR	V P                   R
V P                   R2,          pVR,          pWB,          pVRV R2,          pV# )zreportlab.graphics.shapeszreportlab.lib.colorsrU   ExplodedDrawing_z0#Autogenerated by ReportLab guiedit do not edit
r   c              3   V   "   T F  w  rR V RRP                  V4       R2x  K!  	  R# 5i)zfrom z import z, rb  N)rW  )rL  rF  os   &  r>   rM  $Drawing._renderPy.<locals>.<genexpr>k  s)     PidaaS1b9is   ')z
class z(_DrawingEditorMixin,Drawing):
z	def __init__(self,width=z,height=z,*args,**kw):
z1		Drawing.__init__(self,width,height,*args,**kw)
z(

if __name__=="__main__": #NORUNTESTS
	z0().save(formats=['pdf'],outDir='.',fnRoot=None)
)_DrawingEditorMixinr   r   )Color	CMYKColor
PCMYKColor)rd  r   r   rZ   rW  rf   rS   rT   )rU   rE  re  r-   r,   s   &    r>   	_renderPyDrawing._renderPyc  s    ')R"$F 4==?6!4!8!88?	RWWPaggiPQQ	xs:;;	)$**Xdkk]/ZZ	CC		;A3>sttr@   c                    ^ RI Hp TP                  Y P                  ^ ^ V\        Jd   TM\        V R\        4      R7       R# )zThis is used by the Platypus framework to let the document
draw itself in a story.  It is specific to PDF and should not
be used directly.	renderPDF_showBoundaryshowBoundaryN)reportlab.graphicsr  drawru  r   r   )rU   r  r  s   && r>   r  Drawing.draws  s;     	1tYY1-9-H\gVZ[jkrNs 	 	ur@   c                ~    V P                   pV P                  pV P                  pVR 8w  d   W5,          pWE,          pW43# )r  )rS   rT   rx  )rU   
availWidthavailHeightrS   rT   rx  s   &&&   r>   wrapDrawing.wrap{  s?    

&& E!F}r@   c                t    \         P                  V 4      pV P                  Vn        V P                  Vn        V# )z:Return a new drawing which only contains primitive shapes.)r   r   rS   rT   r  s   & r>   r   Drawing.expandUserNodes  s-    ##D)JJ	[[

r@   c                l    V P                  V P                  V P                  V P                  4      4      # )zReturns a copy)r  r   rS   rT   r   s   &r>   r   Drawing.copy  s$    zz$..T[[ABBr@   c                6    V P                  \        V/ VB 4      # r   )r  r   )rU   rY  rl  s   &*,r>   asGroupDrawing.asGroup  s    zz%++,,r@   c                   VP                  RR4      p\        V\        4      '       d   RV,          pMRpTR,          p^ RIHp Rp	V'       gt   \        V RV P                  P                  R,           4      p\        V R^ 4      p
\        V
R	4      '       d	   V
! V 4      p
\        VR	4      '       d
   V! V
4      pM	 W:,          pVf   \        V RR4      p\        VR	4      '       d	   V! V 4      p\        P                  P                  V4      '       d#   \        P                  P                  V4      w  rCMT;'       g    \        V RR4      pVP!                  4       P!                  \        P"                  4      pV'       g   Rp\        P                  P                  V4      '       g^   \        P                  P%                  \        V R\        P                  P'                  \(        P*                  ^ ,          4      4      V4      p\        P                  P-                  V4      '       g   \        P.                  ! V4       \        P                  P1                  \        P                  P%                  WC4      4      p\        P                  P3                  V4      pV^,          R,          P5                  4       V P6                  9   d
   V^ ,          pT;'       g    \        V RR.4       Uu. uF  qP5                  4       NK  	  ppVRJ;'       d    V3;'       g    \        V RV4      3^ ,          p\8        P:                  P<                  \8        P>                  P<                  3pV;\8        P:                  n        \8        P>                  n        RV9   d   ^ RI H!p VR,           pV'       d   \E        VRV3,          4       VPF                  ! V VV3R\        V RVPH                  4      /\K        V R3/ VB B  V	R,           p	\(        PL                  R8X  d;   ^ RI'p^ RI(pVPS                  V4      PU                  RR4       VPW                  V4       V PX                   F  pVV9   g   K  ^ RI H-p V: RV: 2pV'       d   \E        VVV3,          4       \        V RR4      pV'       d<   \        VRV.4      pVV9   d%   \        VR^ 4      '       g   VP]                  4        MRpVPF                  ! V V3R VR\        V RVPH                  4      /\K        V R!3/ VB B  V	R",           V,           p	V'       g   K  VP_                  V4       K  	  R#V9   d    ^ R$I0H1p VR&,           pV'       d   \E        VR'V3,          4       VPF                  ! V V3R(VR)\        V R*R+.4      ^ ,          R,\        V R*RR-.4      ^,          R.\        V R.VPh                  4      R\        V RVPH                  4      R/\        V R/VPj                  4      /\K        V R03/ VB B  V	R1,           p	R2V9   dk   ^ R3I H6p VR4,           pV'       d   \E        VR5V3,          4       VPF                  ! V V3R\        V RVPH                  4      /\K        V R63/ VB B  V	R7,           p	R8V9   dk   ^ R%I H3p VR9,           pV'       d   \E        VR'V3,          4       VPF                  ! V V3R\        V RVPH                  4      /\K        V R03/ VB B  V	R:,           p	R;V9   d   VR<,           pV'       d   \E        VR;V3,          4       \o        VR=4      ;_uu_ 4       pVPq                  \s        V Pu                  4       Pw                  R>\        Px                  4      4      4       RRR4       V	R?,           p	Vw  \8        P:                  n        \8        P>                  n        \        V R@4      '       d   V P{                  W4       T	;'       d    WR,          ,           ;'       g    R#   \         d,   p\        T4      P                  R
4      ^ 8  d   h  Rp?ELpRp?ii ; iu upi   \d         d    ^ R%I H3p  ELi ; i  + '       g   i     L; i)AzSaves copies of self in desired location and formats.
Multiple formats can be supported in one call

the extra keywords can be of the form
_renderPM_dpi=96 (which passes dpi=96 to renderPM)
	seqNumberr   z%4d: zgenerating %s file %s	rl_configfileNamePatternz%03dchartId__call__znot all arguments convertedNoutDirr   _override_CWDrn   r~  pdfr
   r  z.pdfPDFr  
showBorder_renderPDF_z/.pdfmacCAROzPDF renderPM_drawTimeCollectordisabledfmt
_renderPM_z/.epsrenderPS_SEPrenderPSz.epsEPStitledeptEPS_infoTestingcompany	ReportLabpreview	ttf_embed
_renderPS_z/.epssvg	renderSVGz.svgSVG_renderSVG_z/.svgpsz.psz/.pspyz.pywbrb  z/.py
saveLogger)>r   r   int	reportlabr  r   r   rZ   rQ   	TypeErrorstrfindospathisabssplitrstripseprW  dirnamesysargvisdirmakedirsnormpathsplitextlower
_saveModesr   warnOnceenabledinfoOncer  r  r   
drawToFiler  rm  platformmacfs
macostoolsFSSpecSetCreatorTypetouched_bmModesr  clearsaverlextra.graphicsr  ImportErrorr  eps_previeweps_ttf_embedr  openwriter   r  replacelinesepr  )rU   r~  r
   fnRootr  r  rl  genFmtr  extr  errfnrootplotModerE   _savedr  filenamer  r  bmFmtr  dtcdtcfmtsr  r  r   s   &&&&&&,                    r>   r  Drawing.save  sh    B'fS!!v%FF))'T"3T^^5L5LV5SUFd9Q/Gwz**!$-vj))O#-F >T(40F6*%%D\F77==  WW]]62NFF99wtHS9F''/vww}}V$$rww||GDY[Y`Y`YhYhiliqiqrsitYu<vw}/~fww}}V$$bkk&&9!!"'',,v"=>77##F+A;r?  "doo5a[F(/(R(R74	5'3R(RT(R!GGI(RT$&55G:[['$yQX:Y9[]^_((&//*A*AA<CC&//"9H4f}Hfh'778  x  \WTR^_h_u_uEv  \  zB  CG  HU  z[  XZ  z[  \.C||U"(X&55ffE""8,]]E 7&,U3E&E(+;";<d#7=%c)UG<G'Jq0I0I		"##D(  `u  `'RVWcdmdzdzJ{  `  G  HL  MY  _  \^  _  `Dj5(3* #  H8E f}Hfh'778 (D(.D (/tJ	{'KA'ND +2$z2kBR*STU*V	D
 +2$yAVAV*WD .5T,yG]G]-^D +2${9CZCZ*[D #+4"Br"BD .CH4f}Hfh'778   (D-4T,yG]G]-^Daijno|  bC  @B  bCD .C83e|Hfh'778h  SWT,W`WmWm=n  Sqyz~  @L  rR  OQ  rR  S-C8e|HfX67ht$$ 0 8 8bjj IJK %-C;A8!84%%OOF'%%v"g~+++C ! O 3x}}%BCaGGO, UD  8778D %$s=   9`  )`9`> 7Aa `6 `11`6>aaa&	c                H   WP                   9   g   Q RV,          4       h^ RIHp VR8X  dN   ^ RIHp VP                  RR4      pVP                  ! W3R\        V RVP                  4      /\        V R	3/ VB B # WP                  9   d>   ^ R
IHp VP                  ! V 3RVR\        V RVP                  4      /\        V R3/ VB B # VR8X  d1    ^ RIHp	 V	P                  V V\        V RVP                  4      R7      # VR8X  d/   ^ RIHp	 V	P                  V \        V RVP                  4      R7      # VR8X  d   V P!                  4       # VR8X  d<   ^ RIHp
 V
P                  ! V 3R\        V RVP                  4      /\        V R3/ VB B # R#   \         d
    ^ RIHp	  Li ; i)z,Converts to an 8 bit string in given format.zUnknown file format "%s"r  r  r  r  r   r  r  r  r  r  r  r  r  r  )r  r  r  r  r  r  r  r  N)r  r  r  r  r  r   drawToStringr   r  rm  r  r  r  r  r  r  r  r  )rU   formatr
   r  rl  r  r  r  r  r  r  s   &&&&,      r>   asStringDrawing.asString  s   (M*Dv*MM('U?4FF72&E))$  [GDQ]^g^t^tDu  [  yA  BF  GT  yZ  WY  yZ  [  [}}$3(( X6 XwtT`%22H4 X6>tL6VSU6VX Xu_8E ((*1-4T,yG]G]-^ ) ` ` t^3((GDV_VlVl<m(nnt^>>##u_4))$  SGDV_VlVl<m  Spxy}  L  qR  OQ  qR  S  S   878s   F F! F!c                   V P                  4       pV P                  pV P                  p\        Wx.VO5!  p	V	P	                  4       w  rrVR8X  g.   VR8X  dx   W8  g!   WV,
          8  g   W8  g   WV,
          8  dR   W,
          V,           V,           V	n        W,
          V,           V,           V	n        ^^ ^ ^W*,
          WK,
          3V	n        V	# VR8X  g   VR8X  dD   W8  g   WV,
          8  d1   W,
          V,           V,           V	n        ^^ ^ ^W*,
          ^ 3V	n        V	# VR8X  g   VR8X  dB   W8  g   WV,
          8  d/   W,
          V,           V,           V	n        ^^ ^ ^^ WK,
          3V	n        V	# )z?return a base class drawing which ensures all the contents fitsfitexpandfitxexpandxfityexpandy)r   rS   rT   r   r   r   )rU   kindlpadrpadbpadtpadrH   oWoHrW   xLyLxHyHs   &&&&&&        r>   resizedDrawing.resized-  s@   ZZ[["##'')b;4>rw"W*SUY]V]S]E$JtOGMU4Z_GN!"1Qq 9G  6\dIo27bDjE$JtOGM!"1Qq 3G  6\dIo27bDjU4Z_GN!"1Qq47 3Gr@   )r3  rv  rT   rx  rw  rS   >   r  r  bmpr  gifjpgpctr  pngr  tifjpegpicttifftiff1tiffltiffp>   r  r  r  r  r  )i     )NNNNr   )Nr+   )r  r+   r+   r+   r+   ) rZ   r[   r\   r]   r^   r  r  r   r   isNumberisValidChildOrNoneOneOfisStringOrNoneisNumberOrNoner/  r   
SequenceOfr   r   rk   r  r   r  r  r   r   r  r  r  r  r_   r`   ra   s   @r>   r   r   *  s    J( 99HX+EFh,GHD!!"4:yzeFGXxHO|}eE8XxHOz{ #81OP&~;kl&~;kl
L E":z"Q$ &>@H
 OOL!   ' uC-z,xS> r@   r   c                   .   a  ] tR tRt o RtRR ltRtV tR# )r  i@  z<This is a mixin to provide functionality for edited drawingsNc                   \        V4      pV'       dm   \        VR4      '       d[   RVP                  9  d    VP                  P	                  4       Vn        V'       d   Vf   \         p\        WE4      VP                  V&   \        VR4      '       d8   V'       d0   V'       d   VP                  WbV4       R# VP                  W#4       R# V'       d   \        WV4       R# \        R4      h)zR
effectively setattr(obj,name,value), but takes care of things with _attrMaps etc
r   Nr   zCan't add, need name)
r   rQ   r   r   r   r   r   r   rg   
ValueError)rU   r   rj   r   r   r   r	  ivcs   &&&&&&& r>   _add_DrawingEditorMixin._addB  s     5!GC
++-"||113x'L!-h!<CLL3u#

3T*#CU#344r@   rY   NNNN)rZ   r[   r\   r]   r^   r5  r_   r`   ra   s   @r>   r  r  @  s     F5 5r@   r  c                   &   a  ] tR tRt o R tRtV tR# )isStrokeDashArrayiV  c                    \         P                  V4      ;'       gK    \        V\        \        34      ;'       d-    \        V^ ,          4      ;'       d    \        V^,          4      # r>  )isListOfNumbersOrNonetestr   r   tupler+  isListOfNumbers)rU   rE   s   &&r>   r<  isStrokeDashArray.testW  sP    $))!,yyAtEl1K1x1xPXYZ[\Y]P^1x1xcrstuvswcxyr@   rY   N)rZ   r[   r\   r]   r<  r_   r`   ra   s   @r>   r9  r9  V  s     z zr@   r9  c                      a  ] tR tRt o ]! ]! ]4      ]! ]4      ]! ]! ^ ^^4      RR7      ]! ]! ^ ^^4      RR7      ]! ]RR7      ]! ]	RR7      ]! ]
RR7      ]! ]RR7      ]! ]R	^R
7      R7	      tR tRtV tR# )	LineShapei[  z#Line cap 0=butt, 1=round & 2=squarer   z$Line join 0=miter, 1=round & 2=bevelz$miter limit control miter line joinsz[numbers] or [phase,[numbers]]zEThe level of transparency of the line, any real number betwen 0 and 1r   r   r   )	r   r   r   r   r   r   r   r"   r#   c                    \         R ,          V n        ^V n        ^ V n        ^ V n        ^ V n        RV n        RV n        V P                  V4       R# )r   N)	STATE_DEFAULTSr   r   r   r   r   r   r   r   rU   rl  s   &&r>   rk   LineShape.__init__j  sM    )-8 !#!2r@   )r   r   r   r   r   r   r   N)rZ   r[   r\   r]   r   r   isColorOrNoner+  r-  r9  	isOpacityrA  r   rk   r_   r`   ra   s   @r>   rA  rA  [  s      "=1"8,$U1Qq\7\]%eAal8^_'6\]&'8>^_$Y4{|&y6ST$Y4Tcde

H r@   rA  c                      a  ] tR tRt o ]! ]]! ]RR7      ]! ]RR7      ]! ]RR7      ]! ]RR7      R7      tR t	R t
RtV tR# )	Lineit  r   r   )r}  rv   rw   rx   ry   c                `    \         P                  W4       Wn        W n        W0n        W@n        R # r   )rA  rk   rv   rw   rx   ry   )rU   rv   rw   rx   ry   rl  s   &&&&&,r>   rk   Line.__init__|  s$    4$r@   c                ^    V P                   V P                  V P                  V P                  3# )r   )rv   rw   rx   ry   r   s   &r>   r   Line.getBounds  s!    $''47733r@   )rv   rx   rw   ry   N)rZ   r[   r\   r]   r   rA  r   r+  r   rk   r   r_   r`   ra   s   @r>   rI  rI  t  sH     I(+(+(+(+	
H4 4r@   rI  c                      a  ] tR tRt o ]! ]]! ]RR7      ]! ]RR7      ]! ]	RR7      ]! ]	R^R7      ]! ]
! ]]4      4      R7      tR	 tR
tV tR# )
SolidShapei  z$filling color of the shape, e.g. redr   zGthe level of transparency of the color, any real number between 0 and 1r   r   r   )r}  r$   r    r!   r#   r%   c                b    \         R ,          V n        RV n        \        P	                  W4       R# )r$   N)rC  r$   r    rA  rk   rD  s   &&r>   rk   SolidShape.__init__  s&    '4 	4$r@   )r$   r    N)rZ   r[   r\   r]   r   rA  r   rF  rG  rA  r-  r   r   r   rk   r_   r`   ra   s   @r>   rO  rO    s[      I 4Z["92{|$Y4OP$Y4TcdemM BC
H% %r@   rO  c                   V P                   p^ p^ p^ pV'       * pV P                   F  p	V	\        8X  dH   V'       d7   V'       d/   X
\        8w  d$   V^,          pV'       d   V\        ,          ! 4        V^,          p\        V	,          pW[,           pW,          ! WEV !   TpV	\        8X  d
   V^,          pT	p
K  	  V'       d7   V'       d/   X
\        8w  d$   V^,          pV'       d   V\        ,          ! 4        Wv8H  # )zHelper function for renderers.)r   	operators_MOVETO
_CLOSEPATH_PATH_OP_ARG_COUNT)r  	drawFuncs	countOnly
forceCloser   r   hadClosePath	hadMoveToactiveopr   nArgsjs   &&&&         r>   _renderPathr`    s     [[F	ALI]Fnn=j A%L!*-/NI"2&Iv{#AL  iCOj!#$$r@   znon-zerononzerozeven-oddevenoddc                      a  ] tR tRt o Rt]! ]]! ]4      ]! ]4      ]! ]	4      ]! ]
! ]! RR4      4      4      ]! ]! ]]4      4      R7      tRR^ R]3R ltR tR	 tR
 tR tR tR tRtV tR# )Pathi  z2Path, made up of straight lines and bezier curves.r  r  )r}  r   rS  
isClipPath	autocloser%   Nc                    \         P                  W4       Vf   . pVf   . p\        V4      ^,          ^ 8X  g   Q R4       hWn        W n        W0n        W@n        WPn        R # )N-Point list must have even number of elements!)rO  rk   r3   r   rS  re  rf  r%   )rU   r   rS  re  rf  r%   rl  s   &&&&&&,r>   rk   Path.__init__  sZ    D%>FI6{Q!#T%TT#"$  r@   c                    V P                  V P                  R ,          V P                  R ,          4      pVP                  V P	                  4       4       V# )r   )r   r   rS  r   r   rU   news   & r>   r   	Path.copy  s?    nnT[[^T^^A->?$,,./
r@   c                |    V P                   P                  W.4       V P                  P                  \        4       R # r   )r   r   rS  r|   rT  r+  s   &&&r>   moveToPath.moveTo  (    A6"g&r@   c                |    V P                   P                  W.4       V P                  P                  \        4       R # r   )r   r   rS  r|   _LINETOr+  s   &&&r>   lineToPath.lineTo  rq  r@   c                    V P                   P                  WW4WV.4       V P                  P                  \        4       R # r   )r   r   rS  r|   _CURVETO)rU   rv   rw   rx   ry   x3r~   s   &&&&&&&r>   curveToPath.curveTo  s-    BBB34h'r@   c                D    V P                   P                  \        4       R # r   )rS  r|   rU  r   s   &r>   	closePathPath.closePath  s    j)r@   c           	     j   V P                   p . pVP                  pVP                  p. pVP                  pVP                  p^ pV P                   F  p	\        V	,          p
W,           pV
^8X  d%   V! W,          4       V! W^,           ,          4       M`V
^8X  dZ   WV^1,          w  rpV! \        VR,          WV4      4       W^,           V^1,          w  pppV! \        VR,          VVV4      4       TpK  	  \        V4      \        V4      \        V4      \        V4      3#    \        T4      u # ; i)r+   r1   )	r   r|   r   rS  rV  r   rD   r2   r   )rU   r   rI   aXeXrJ   aYeYr   r]  r^  r_  rv   rx   rx  rw   ry   r~   s   &                 r>   r   Path.getBounds  s   	)ABBABBAnn*2.I!8vyMvc{OAX%!e}HB"(2rR89%c!AgHBr"(2r"R89 % q6#a&QA..	) ((s   DD# #D2)rf  r%   re  rS  r   )rZ   r[   r\   r]   r^   r   rO  r   r>  rA  NoneOrr-  r   r   r   rk   r   ro  rt  ry  r|  r   r_   r`   ra   s   @r>   rd  rd    s     <Jo. 1!), eE(:!;<mM BC
H #dqD[h !
''(*) )r@   rd  c           	      X   Vf   Tp. p\         R,          p	W9,          p
WI,          pW8  d   V^\         ,          ,           pK  \        W,
          4      pVP                  pVR8  dR   \        Y;'       g    R4      pWi,          p\	        \        W,          R,           4      ^4      pW,          pV^,          pM^p^ p\        V4       FH  pWV,          ,           pV! W\        V4      ,          ,           W\        V4      ,          ,           34       KJ  	  V'       d   VP                  4        V# )N     f@MbP?r        ?)
r   rV  r|   rD   r2   r  r   r   r   reverse)centerxcenteryradiusstartangledegreesendangledegreesyradiusdegreedeltar  r   degreestoradians
startangleendanglerG   r   radiansdeltar-   s   &&&&&&&&        r>   getArcPointsr    s    &F%x"3J/H

AbD=('(EATz% 1 1r2"3E&s*+A.w	Qq--	7#e*$$WSZ-?%?
@A   Mr@   c                   .   a  ] tR tRt o RtRR ltRtV tR# )ArcPathi*  zPath with an addArc methodNc
                   \        WW4WVWyR 7      p
V'       g   \        V P                  4      '       g2   V P                  V
^ ,          ^ ,          V
^ ,          ^,          4       V
^  V
 F  w  rV P	                  W4       K  	  R# ))r  r  r  N)r  r3   rS  ro  rt  )rU   r  r  r  r  r  r  r  ro  r  r   rE   rF   s   &&&&&&&&&&   r>   addArcArcPath.addArc,  s`    6ot  RT^^,,KK!Q!Q(!DAt{{1'Ar@   rY   r7  )rZ   r[   r\   r]   r^   r  r_   r`   ra   s   @r>   r  r  *  s     $( (r@   r  c                 X   . p. pV  F  p\        V4      '       g   Tp. p	MV^ ,          pVR,          p	V\        9  d   \        RV,          4      h\        P                  V4      p
\	        V	4      \
        V
,          8w  d   \        V: R\        V	4      : 24      hVP                  V
4       VP                  \        V	4      4       K  	  V^ 3V^33 F3  w  r\        V\	        V4      ^4       F  pWm,          V,           Wm&   K  	  K5  	  VP                  RR4      pV'       Ed}   R EFu  pW,          W^,           ,          3pV^ ,          f   V^,          f   K3  WoR^1,          p\        V4      \        V4      ppV^ ,          e   V^,          e   \        V4      \        V4      ppVV,
          p\        V4      R8  dO   VV,
          V,          p\        V\	        V4      ^4       F"  pVVWm,          V,
          ,          ,           Wm&   K$  	  K  \        V\	        V4      ^4       F  pVV,           R,          Wm&   K  	  EK  V^ ,          e   V^ ,          V,
          MV^,          V,
          p\        V\	        V4      ^4       F  pWm;;,          V,          uu&   K  	  EKx  	  \        WeV3/ VB # )	r+   rn   zbad operator name %sz bad arguments bboxNgư>r  )r+   ro   )r   _PATH_OP_NAMESr3  r  r3   rV  r  r|   r   r   r   r   rD   r2   absrd  )pathSegsre  r  r  rl  Or   segopNamerY  r]  r   r  r   r  r_  r   r   r   facs   &&&&,               r>   
definePathr  3  s9   
A
ASzzFDVFr7D'3f<==!!&)t9(,,fSYGHH		d  1v1v~qQ"A46AD #  66&DtAqS	!At|!h$Q$Aq63q6qAtAaD$41vs1v1ss8T>Q3)C"1SVA. 3Q</ / #1SVA. !As{ /
 !"! 0AaD1HadQhqQ*ADAID +) . J$$$r@   c                      a  ] tR tRt o Rt]! ]]! ]4      ]! ]4      ]! ]RR7      ]! ]RR7      ]! ]4      ]! ]4      R7      t	RR lt
R tR	 tR
tV tR# )Rectie  z)Rectangle, possibly with rounded corners.width of the object in pointsr   height of the objects in points)r}  rE   rF   rS   rT   rxryc                x    \         P                  W4       Wn        W n        W0n        W@n        WPn        W`n        R # r   )rO  rk   rE   rF   rS   rT   r  r  )rU   rE   rF   rS   rT   r  r  rl  s   &&&&&&&,r>   rk   Rect.__init__q  s.    D%
r@   c                    V P                  V P                  V P                  V P                  V P                  4      pVP                  V P                  4       4       V# r   )r   rE   rF   rS   rT   r   r   rk  s   & r>   r   	Rect.copyz  sB    nnTVVTVVTZZE$,,./
r@   c                    V P                   V P                  V P                   V P                  ,           V P                  V P                  ,           3# r   rE   rF   rS   rT   r   s   &r>   r   Rect.getBounds  s3     3TVVdkk5IJJr@   )rT   r  r  rS   rE   rF   Nr=  )rZ   r[   r\   r]   r^   r   rO  r   r+  r   rk   r   r   r_   r`   ra   s   @r>   r  r  e  s`     3J""X+JKh,MN(#(#
H
K Kr@   r  c                      a  ] tR tRt o Rt]! ]]! ]4      ]! ]4      ]! ]	RR7      ]! ]	RR7      ]! R4      R7      t
R tR	 tR
 tRtV tR# )Imagei  zBitmap image.r  r   r  N)r}  rE   rF   rS   rT   r  c                l    \         P                  W4       Wn        W n        W0n        W@n        WPn        R # r   )rO  rk   rE   rF   rS   rT   r  )rU   rE   rF   rS   rT   r  rl  s   &&&&&&,r>   rk   Image.__init__  s)    D%
	r@   c                    V P                  V P                  V P                  V P                  V P                  V P
                  4      pVP                  V P                  4       4       V# r   )r   rE   rF   rS   rT   r  r   r   rk  s   & r>   r   
Image.copy  sH    nnTVVTVVTZZdiiP$,,./
r@   c                    V P                   V P                  V P                   V P                  ,           V P                  V P                  ,           3# r   r  r   s   &r>   r   Image.getBounds  s3     3TVVdkk5IJJr@   )rT   r  rS   rE   rF   )rZ   r[   r\   r]   r^   r   rO  r   r+  r/  r   rk   r   r   r_   r`   ra   s   @r>   r  r    sX     J""^1PQn2STD!
H
K Kr@   r  c            
       z   a  ] tR tRt o ]! ]]! ]RR7      ]! ]RR7      ]! ]RR7      R7      tR t	R t
R	 tR
tV tR# )Circlei  x of the centrer   y of the centreradius in points)r}  r  r  rc                T    \         P                  W4       Wn        W n        W0n        R # r   )rO  rk   r  r  r  )rU   r  r  r  rl  s   &&&&,r>   rk   Circle.__init__  s    D%r@   c                    V P                  V P                  V P                  V P                  4      pVP	                  V P                  4       4       V# r   )r   r  r  r  r   r   rk  s   & r>   r   Circle.copy  s<    nnTWWdggtvv6$,,./
r@   c                    V P                   V P                  ,
          V P                  V P                  ,
          V P                   V P                  ,           V P                  V P                  ,           3# r   )r  r  r  r   s   &r>   r   Circle.getBounds  sH    $&& $''DFF"2DGGdff4DdggPTPVPVFVWWr@   )r  r  r  NrZ   r[   r\   r]   r   rO  r   r+  r   rk   r   r   r_   r`   ra   s   @r>   r  r    sH     J((9:((9:'9:
H
X Xr@   r  c                      a  ] tR tRt o ]! ]]! ]RR7      ]! ]RR7      ]! ]RR7      ]! ]RR7      R7      tR t	R	 t
R
 tRtV tR# )Ellipsei  r  r   r  zx radiuszy radius)r}  r  r  r  r  c                `    \         P                  W4       Wn        W n        W0n        W@n        R # r   )rO  rk   r  r  r  r  )rU   r  r  r  r  rl  s   &&&&&,r>   rk   Ellipse.__init__  s$    D%r@   c                    V P                  V P                  V P                  V P                  V P                  4      pVP                  V P                  4       4       V# r   )r   r  r  r  r  r   r   rk  s   & r>   r   Ellipse.copy  sB    nnTWWdggtww@$,,./
r@   c                    V P                   V P                  ,
          V P                  V P                  ,
          V P                   V P                  ,           V P                  V P                  ,           3# r   )r  r  r  r  r   s   &r>   r   Ellipse.getBounds  sH    GGdgg%tww'8$''DGG:KTWWW[W^W^M^__r@   )r  r  r  r  Nr  ra   s   @r>   r  r    sQ     J((9:((9:(
3(
3	
H
` `r@   r  c                      a  ] tR tRt o Rt]! ]]! ]RR7      ]! ]RR7      ]! ]RR7      ]! ]4      ]! ]4      ]! ]	4      ]! ]	4      ]! ]	4      ]! ]
RR7      R7
      t^tRR
 ltR tR tR tR tRtV tR	# )Wedgei  zgA "slice of a pie" by default translates to a polygon moves anticlockwise
from start angle to end angler  r   r  r  ztreat as annular ring)
r}  r  r  r  r  r  r  radius1yradius1annularNc                    \         P                  W4       WT8  d   VR ,           pK  WW4V3w  V n        V n        V n        V n        V n        W`n        Wpn        R# )ih  N)	rO  rk   r  r  r  r  r  r  r  )	rU   r  r  r  r  r  r  r  rl  s	   &&&&&&&&,r>   rk   Wedge.__init__  sR    D%/-c1O fH 	^dlDK1GI]r@   c                    \        V R R4      pVf   V P                  p\        V RR4      p\        V RV4      pVf   TpWV3# )r  Nr  r  )r   r  )rU   r  r  r  s   &   r>   
_xtraRadiiWedge._xtraRadii  sM    $	40?dkkG$y$/4
73?hG))r@   c                   V P                   pV P                  pV P                  pV P                  4       w  rEpV P                  pV P
                  p\        R ,          p	Wy,          p
W,          pW8  d   V^\        ,          ,           pK  \        W,
          4      p. pVR8  d^   \        V P                  ;'       g    RV4      pW,          p\        ^\        W,          R,           4      4      pVV,          pV^,          pM^p^ p. pVP                  pVP                  p\        V4       F.  pWV,          ,           pV! \        V4      \        V4      34       K0  	  V F0  w  ppV! WV,          ,           4       V! W$V,          ,           4       K2  	  V^ 8X  g   Vf   V^ 8X  g   Vf   V! V4       V! V4       MFVP!                  4        V F0  w  ppV! WV,          ,           4       V! W&V,          ,           4       K2  	  V P"                  '       Ed%   \%        \'        V R\(        4      R7      pVP+                  V^ ,          V^,          4       \        ^^V,          ^4       F*  pVP-                  VV,          VV^,           ,          4       K,  	  VP/                  4        VP+                  V^V,          ,          V^V,          ^,           ,          4       \        ^V,          ^,           ^V,          ^4       F*  pVP-                  VV,          VV^,           ,          4       K,  	  VP/                  4        V# \1        V4      # )r  r  r  r  r%   )r%   )r  r  r  r  r  r  r   rV  rD   r  r2   r  r|   r   r   r   r  r  rd  r   r   ro  rt  r|  Polygon)rU   r  r  r  r  r  r  r  r  r  r  r  rG   r   r  r  r-   CACAAr   r   r,   r   rE   s   &                       r>   	asPolygonWedge.asPolygon  s   ,,%)__%6"( 22..e8&7
"3!"}Hh)*;d..44"U;K&7LAc%,S012A 7LFAALiiMM1XE\11EUCJ'(  CAagQhgai   QJ'/!x?OgJ'
JJL!'!)#$'1*$%  <<<gd:}EFAHHVAYvay)1QqS^6!A#;/ $KKMHHVAaC[!A/1Q3q51Q'6!A#;/ (KKMH6?"r@   c                    V P                  V P                  V P                  V P                  V P                  V P
                  4      pVP                  V P                  4       4       V# r   )r   r  r  r  r  r  r   r   rk  s   & r>   r   
Wedge.copy*  sT    nnT\\LLKK**((	*
 	$,,./
r@   c                >    V P                  4       P                  4       # r   )r  r   r   s   &r>   r   Wedge.getBounds3  s    ~~))++r@   )r  r  r  r  r  r  r  )NF)rZ   r[   r\   r]   r^   r   rO  r   r+  r/  rA  r   r  rk   r  r  r   r   r_   r`   ra   s   @r>   r  r    s     ( Jx->?x->?h,>?(2&x0~.~./y.EF

H K	*4#l, ,r@   r  c                   `   a  ] tR tRt o Rt]! ]]! ]RR7      R7      t	. 3R lt
R tR tR	tV tR
# )r  i6  zGDefines a closed shape; Is implicitly
joined back to the start for you.5list of numbers in the form x1, y1, x2, y2 ... xn, ynr   r}  r   c                    \         P                  W4       \        V4      ^,          ^ 8X  g   Q R4       hT;'       g    . V n        R# )   rh  N)rO  rk   r3   r   )rU   r   rl  s   &&,r>   rk   Polygon.__init__>  s9    D%6{Q!#T%TT#llr@   c                z    V P                  V P                  4      pVP                  V P                  4       4       V# r   r   r   r   r   rk  s   & r>   r   Polygon.copyC  0    nnT[[)$,,./
r@   c                ,    \        V P                  4      # r   r   r   r   s   &r>   r   Polygon.getBoundsH      t{{++r@   r   N)rZ   r[   r\   r]   r^   r   rO  r   r>  r   rk   r   r   r_   r`   ra   s   @r>   r  r  6  s<     ) Jo3jk
H ! #

, ,r@   r  c                   `   a  ] tR tRt o Rt]! ]]! ]RR7      R7      t	. 3R lt
R tR tR	tV tR
# )PolyLineiK  zSeries of line segments.  Does not define a
closed shape; never filled even if apparently joined.
Put the numbers in the list, not two-tuples.r  r   r  c                J   \         P                  W4       T;'       g    . p\        V4      pV'       di   \        V^ ,          4      '       d3   . pV F'  w  rVVP	                  V4       VP	                  V4       K)  	  TpM\        V4      ^,          ^ 8X  g   Q R4       hWn        R# )r+   rh  N)rA  rk   r3   r   r|   r   )rU   r   rl  	lenPointsrq   rE   rF   s   &&,    r>   rk   PolyLine.__init__T  s    4$2K	VAY#EQHHQKHHQK $ 6{Q!+\-\\+r@   c                z    V P                  V P                  4      pVP                  V P                  4       4       V# r   r  rk  s   & r>   r   PolyLine.copyc  r  r@   c                ,    \        V P                  4      # r   r  r   s   &r>   r   PolyLine.getBoundsh  r  r@   r  N)rZ   r[   r\   r]   r^   r   rA  r   r>  r   rk   r   r   r_   r`   ra   s   @r>   r  r  K  s<     4 Io3jk
H ! 
, ,r@   r  c                      a  ] tR tRt o Rt]! ]]! ]! ]	]
! ]	^R7      3R4      RR7      ]! ]! ]]	R34      RR7      ]! ]! ]]	R	34      R
R7      R7      t^^-. 3R ltRtV tR# )Hatchingik  z\define a hatching of a set of polygons defined by lists of the form [x0,y0,x1,y1,....,xn,yn])r{  z
xy list(s)z8list(s) of numbers in the form x1, y1, x2, y2 ... xn, ynr   zangle(s)zCthe angle or list of angles at which hatching lines should be drawnzspacings(s)z-orthogonal distance(s) between hatching lines)r}  xyListsanglesspacingsc           
     h   \         P                  ! V 3/ VB  \        V4      '       d   V3p\        V4      '       d   V3p\        V4      '       d   V3p\	        V4      \	        V4      ,
          pV^ 8  d!   \        V4      WQR,          .,          ,           pW0n        W n        Wn        V P                  pV P                  p\        V4       EF  w  rXW,          p	\        V4      p\        V4      p
\        V4      pRpV) pV Fb  p\        ^ \	        V4      ^4       FE  pW^,           ,          V
,          W,          V,          ,
          p\!        VV4      p\#        VV4      pKG  	  Kd  	  \%        \'        W,          4      4      ^,
          p\%        \'        W,          4      4      ^,           p\        VV4       EF  p. pV	V,          pV EF  p\	        V4      ^,
          p\        ^ \	        V4      ^4       F  pVV,          pVV^,           ,          pVV
,          VV,          ,           pVV
,          VV,          ,
          pW,          pW^,           ,          pVV
,          VV,          ,           pVV
,          VV,          ,
          pVV8  d   VV8  g   VV8  dC   VV8  d<   VP)                  VVV,
          VV,
          ,          VV,
          ,          ,           4       TpK  	  EK  	  VP+                  4        \        ^ \	        V4      ^4       F  pVV,          V
,          VV,          ,
          pVV
,          VV,          V,          ,           pVV^,           ,          V
,          VV,          ,
          pVV
,          VV^,           ,          V,          ,           pV! VV4       V! VV4       K  	  EK  	  EK  	  R# )r+   iNr1   )rd  rk   r>  r+  r3   r   r  r  r  ro  rt  	enumerater   r   r   r   rD   r2   r  r   r|   r   )rU   r  r  r  kwdsr   ro  rt  r  spacingcosThetasinThetaspanMinspanMaxr   r_  rF   	spanStartspanEndstepnodeXstripeYr  r   r   a1b1rE   rv   rw   s   &&&&,                         r>   rk   Hatching.__init__t  s   d#d#7##zGFYFH {HKH%Q3H~a"&66H !&)HAkGENE5zH5zH GhG qQ*AA#xX5A!!GnG!!GnG	 +  E'/23a7I512Q6G i0!$, !AAqA"1SVA.aDacFxZ!H*4xZ!H*4DcFxZ(
2xZ(
2 wJ2w;2g:"g+!LLRUWRZ,@"R%,H)HI / !& 

 qUA.Aa)GH,<<A(q()::Aac
8+gh.>>A(51:h+>>A 1QK1QK /7 1- *r@   )r  r  r  N)rZ   r[   r\   r]   r^   r   rd  r   EitherOrr>  r0  r+  r   rk   r_   r`   ra   s   @r>   r  r  k  s     fDxOWX9Y(Z[gh  oi  jh'LM  TY  Z(?=)Q R  YH  I
H !""b M  M r@   r  c                     \        V R V4      pVP                  V4      pV^ 8  d%   \        V R^ 4      p	V	\        VRV W4V4      ,           pV# )_dp_dpLenN)r   rfindr   )
tAr4   r0   r'   r&   encodingpivotCharacterdpr   dpOffss
   &&&&&&&   r>   numericXShiftr    sP    	E.	)B

2A!tHQ'[bq(HEEHr@   c                     a  ] tR tRt o Rt]! ]! ]RR7      ]! ]RR7      ]! ]RR7      ]! RRR7      ]! ]R	R7      ]! ]	R
R7      ]! ]
! RRRR4      RR7      ]! ]4      ]! ]
! ^ ^^^^^^^4      RR7      R7	      tRtR tR tR tR tRtV tR# )Stringi  zeNot checked against the spec, just a way to make something work.
Can be anchored left, middle or end.zx point of anchoringr   zy point of anchoringzthe text of the stringNz_font name of the text - font is either acrobat standard or registered when using external font.z	font sizezcolor of the fontr)   middler/   numericz(treat (x,y) as one of the options below.z.Control whether text is filled/stroked etc etc)	rE   rF   r4   r'   r&   r$   r(   r  textRenderModeutf8c                    Wn         W n        W0n        R V n        \        R,          V n        \        R,          V n        \        R,          V n        V P                  V4       R# )r)   r'   r&   r$   N)	rE   rF   r4   r(   rC  r'   r&   r$   r   )rU   rE   rF   r4   rl  s   &&&&,r>   rk   String.__init__  sJ    	!&z2&z2'42r@   c                    V P                   \        V P                  V P                  V P                  V P
                  4      ,           # r   )rE   r   r4   r'   r&   r  r   s   &r>   getEastString.getEast  s,    vvDIIdmmDMM4==YYYr@   c                    V P                  V P                  V P                  V P                  4      pVP	                  V P                  4       4       V# r   )r   rE   rF   r4   r   r   rk  s   & r>   r   String.copy  s<    nnTVVTVVTYY7$,,./
r@   c           	        V P                   p\        WP                  V P                  V P                  4      pV P
                  pV P                  pVR 8w  dc   VR8X  d   VRV,          ,          pMJVR8X  d
   WB,          pM:VR8X  d4   V\        W1W P                  V P                  V P                  4      ,          pW@P                  RV P                  ,          ,
          WB,           V P                  V P                  ,           3# )r)   r  r  r/   r  g?)	r4   r   r'   r&   r  r(   rE   r  rF   )rU   r8   r0   r  rE   s   &    r>   r   String.getBounds  s    II--dmmD__FFw;8|SU
UY]2--dmmTT66C$--//dfft}}6LMMr@   )r$   r'   r&   r4   r(   rE   rF   )rZ   r[   r\   r]   r^   r   r   r+  isStringrF  r-  r   r  rk   r$  r   r   r_   r`   ra   s   @r>   r  r    s     , '=>'=>H*BC  +L  Mk: 4GH!%y"IOyz)%eAa!Aa!&<Brs

H HZ
N Nr@   r  c                   *   a  ] tR tRt o RtR tRtV tR# )r   i  aW  A simple template for creating a new node.  The user (Python
programmer) may subclasses this.  provideNode() must be defined to
provide a Shape primitive when called by a renderer.  It does
NOT inherit from Shape, as the renderer always replaces it, and
your own classes can safely inherit from it without getting
lots of unintended behaviour.c                    \        R4      h)zOverride this to create your own node. This lets widgets be
added to drawings; they must create a shape (typically a group)
so that the renderer can draw the custom node.4this method must be redefined by the user/programmerr   r   s   &r>   r   UserNode.provideNode  s    
 ""XYYr@   rY   N)rZ   r[   r\   r]   r^   r   r_   r`   ra   s   @r>   r   r     s     %Z Zr@   r   c                   *   a  ] tR tRt o RtR tRtV tR# )
DirectDrawi  z"try to draw directly on the canvasc                    \        R 4      h)r-  r   )rU   rV   s   &&r>   drawDirectlyDirectDraw.drawDirectly  s    !"XYYr@   rY   N)rZ   r[   r\   r]   r^   r2  r_   r`   ra   s   @r>   r0  r0    s     ,Z Zr@   r0  c                  6   \        ^
^
^^24      p ^ RIpVP                  p\        P                  P                  pV! R4       V! V P                  4       4       V! R4       V P                  4        V! R4       V! R4       V =V! R4       V P                  4        R# )
   Nza Rectangle: z
verifying...z OK
zdeleting rect.width zverifying...)r  pprintr  stdoutr  r   r   rS   )r  r6  ppr0   s       r>   r<  r<    s~    R3rA	B

AoqHHJgJ 	nHHJr@   __main__r   r   )r+   z		)r  r     r+   )ro  rt  ry  r|  )FF)NNN)b__version__r^   r  r  mathr   r   r   r   r   r   reportlab.platypusr   reportlab.rl_configr	   r
   r   _baseGFontNamer   r   reportlab.libr   r   reportlab.lib.validatorsreportlab.lib.utilsr   r   r  isNumberInRangerG  reportlab.lib.attrmapreportlab.lib.rl_accelr   reportlab.pdfbase.pdfmetricsr   reportlab.lib.fontsr   reportlab.pdfgen.canvasr   r   _baseGFontNameB_baseGFontNameI_baseGFontNameBINON_ZERO_WINDINGEVEN_ODDblackrC  r   r?   rK   rM   rd   rz   r   r   r   r   r   rG  rK  rd  rm  r   r  	Validatorr9  rA  rI  rO  r   r   rT  rs  rw  rU  rV  r  r`  _fillModeMaprd  rS  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r0  r<  rZ   rY   r@   r>   <module>rQ     sw  
 G  3 3 ' y y     & .?1Q'(	 # ) 4 % @q+q+!,  &  6<<	
 1 Q a  t T 4 U u Q  !" #& '( )* 7+6   D-, ,& &$"3j0(KQO/ KQZ{E {z	<"@
TeX Tl5 5,z	 z &'  249 4&% %& *.eAh &(J! 8%< 	d}M=}M=
F): F)P f6(d ( aA! 0%dK: K:KJ K8XZ X,`j `.i,J i,V,j ,*,y ,@V t V p 8<= 1NU 1NfZ" ZZ Z
" ZF r@   