
    ,hX4                        d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZmZmZmZ ddlmZ dd	lmZmZmZmZmZmZ  G d
 de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z  G d de      Z! G d de      Z" G d de      Z# G d de      Z$ G d  d!e      Z% G d" d#e      Z&y$)%z=
lxml custom element classes for shape-related XML elements.
    )absolute_import)MSO_AUTO_SHAPE_TYPEPP_PLACEHOLDER)	parse_xmlnsdecls)BaseShapeElement)ST_CoordinateST_PositiveCoordinate
XsdBoolean	XsdString)CT_TextBody)BaseOxmlElementOneAndOnlyOneOptionalAttributeRequiredAttribute	ZeroOrOne
ZeroOrMorec                   4    e Zd ZdZ ede      Z ede      Zy)CT_AdjPoint2Dz`a:pt` custom element class.xyN)__name__
__module____qualname____doc__r   r
   r   r        \/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/pptx/oxml/shapes/autoshape.pyr   r      s    &#}-A#}-Ar   r   c                   .    e Zd ZdZdZ ededd       Zy)CT_CustomGeometry2Dz"`a:custGeom` custom element class.)a:avLstza:gdLstza:ahLstza:cxnLstza:rect	a:pathLstr#      N
successors)r   r   r   r   _tag_seqr   pathLstr   r   r   r!   r!   %   s    ,SH=Gr   r!   c                   4    e Zd ZdZ ede      Z ede      Zy)CT_GeomGuidez
    ``<a:gd>`` custom element class, defining a "guide", corresponding to
    a yellow diamond-shaped handle on an autoshape.
    namefmlaN)r   r   r   r   r   r   r+   r,   r   r   r   r*   r*   ,   s!    
 VY/DVY/Dr   r*   c                        e Zd ZdZ ed      Zy)CT_GeomGuideListz,
    ``<a:avLst>`` custom element class
    za:gdN)r   r   r   r   r   gdr   r   r   r.   r.   6   s     
F	Br   r.   c                   2    e Zd ZdZ ed      Z ede      Zy)CT_NonVisualDrawingShapePropsz.
    ``<p:cNvSpPr>`` custom element class
    z	a:spLockstxBoxN)	r   r   r   r   r   spLocksr   r   r2   r   r   r   r1   r1   >   s     $Ggz2Er   r1   c                       e Zd ZdZ edd      Z edd      Z edd      Z ede	      Z
 ede	      Zd	 Zd
 Zd Zy)	CT_Path2Dz`a:path` custom element class.za:closer   r%   za:lnToza:moveTowhc                 "    | j                         S )z{Return a newly created `a:close` element.

        The new `a:close` element is appended to this `a:path` element.
        )
_add_closeselfs    r   	add_closezCT_Path2D.add_closeP   s    
   r   c                 d    | j                         }|j                         }||c|_        |_        |S )zReturn a newly created `a:lnTo` subtree with end point *(x, y)*.

        The new `a:lnTo` element is appended to this `a:path` element.
        )	_add_lnTo_add_ptr   r   )r;   r   r   lnTopts        r   add_lnTozCT_Path2D.add_lnToW   s/    
 ~~\\^
bdr   c                 d    | j                         }|j                         }||c|_        |_        |S )zReturn a newly created `a:moveTo` subtree with point *(x, y)*.

        The new `a:moveTo` element is appended to this `a:path` element.
        )_add_moveTor?   r   r   )r;   r   r   moveTorA   s        r   
add_moveTozCT_Path2D.add_moveToa   s2    
 !!#^^
bdr   N)r   r   r   r   r   closer@   rE   r   r   r6   r7   r<   rB   rF   r   r   r   r5   r5   G   sR    (yR0Eh2.D
r2F#45A#45A!r   r5   c                       e Zd ZdZy)CT_Path2DClosez`a:close` custom element class.N)r   r   r   r   r   r   r   rI   rI   l   s    )r   rI   c                   $    e Zd ZdZ edd      Zy)CT_Path2DLineToz`a:lnTo` custom element class.a:ptr   r%   Nr   r   r   r   r   rA   r   r   r   rK   rK   p   s    (	6b	)Br   rK   c                   *    e Zd ZdZ edd      Zd Zy)CT_Path2DListz!`a:pathLst` custom element class.za:pathr   r%   c                 D    | j                         }||c|_        |_        |S )z.Return a newly created `a:path` child element.)	_add_pathr6   r7   )r;   r6   r7   paths       r   add_pathzCT_Path2DList.add_path{   s"    ~~Ar   N)r   r   r   r   r   rR   rS   r   r   r   rO   rO   v   s    +h2.Dr   rO   c                   $    e Zd ZdZ edd      Zy)CT_Path2DMoveToz `a:moveTo` custom element class.rL   r   r%   NrM   r   r   r   rU   rU      s    *	6b	)Br   rU   c                   H    e Zd ZdZ ed      Z ede      Ze	d        Z
d Zy)CT_PresetGeometry2Dz+
    <a:prstGeom> custom element class
    r"   prstc                 :    | j                   }|g S |j                  S )z
        Sequence containing the ``gd`` element children of ``<a:avLst>``
        child element, empty if none are present.
        )avLstgd_lst)r;   rZ   s     r   r[   zCT_PresetGeometry2D.gd_lst   s!     

=I||r   c                     | j                          | j                         }|D ]&  \  }}|j                         }||_        d|z  |_        ( y)z
        Remove any ``<a:gd>`` element children of ``<a:avLst>`` and replace
        them with ones having (name, val) in *guides*.
        zval %dN)_remove_avLst
_add_avLst_add_gdr+   r,   )r;   guidesrZ   r+   valr/   s         r   rewrite_guidesz"CT_PresetGeometry2D.rewrite_guides   sL    
 	! 	%ID#BBGnBG	%r   N)r   r   r   r   r   rZ   r   r   rX   propertyr[   rb   r   r   r   rW   rW      s7     i EV%89D 
%r   rW   c                   6   e Zd ZdZ ed      Z ed      Z edd      Zd Z	d Z
ed	        Zed
        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zd Zed        Zed        Zy)CT_Shapez)
    ``<p:sp>`` custom element class
    zp:nvSpPrzp:spPrzp:txBody)zp:extLstr%   c                     | j                   j                  }|t        d      |j                         }|j	                  ||      S )z>Reference to `a:custGeom` descendant or |None| if not present.zshape must be freeform)r6   r7   )spPrcustGeom
ValueErrorget_or_add_pathLstrS   )r;   r6   r7   rh   r(   s        r   rS   zCT_Shape.add_path   sG    99%%566--/!q))r   c                 6    | j                   j                         S )zS
        Return the <a:ln> grandchild element, newly added if not present.
        )rg   get_or_add_lnr:   s    r   rl   zCT_Shape.get_or_add_ln   s     yy&&((r   c                 2    | j                   j                  duS )zTrue if this shape has custom geometry, i.e. is a freeform shape.

        A shape has custom geometry if it has a `p:spPr/a:custGeom`
        descendant (instead of `p:spPr/a:prstGeom`).
        N)rg   rh   r:   s    r   has_custom_geometryzCT_Shape.has_custom_geometry   s     yy!!--r   c                 h    | j                   }|y| j                  j                  j                  du ryy)z
        True if this shape is an auto shape. A shape is an auto shape if it
        has a ``<a:prstGeom>`` element and does not have a txBox="1" attribute
        on cNvSpPr.
        FT)prstGeomnvSpPrcNvSpPrr2   r;   rp   s     r   is_autoshapezCT_Shape.is_autoshape   s4     ==;;$$,r   c                 J    | j                   j                  j                  du ryy)z
        True if this shape is a text box. A shape is a text box if it has a
        ``txBox`` attribute on cNvSpPr that resolves to |True|. The default
        when the txBox attribute is missing is |False|.
        TF)rq   rr   r2   r:   s    r   
is_textboxzCT_Shape.is_textbox   s"     ;;$$,r   c                 .    | j                   j                  S )zI
        ``<a:ln>`` grand-child element or |None| if not present
        )rg   lnr:   s    r   rx   zCT_Shape.ln   s    
 yy||r   c                 \    t         j                         }|| ||||||fz  }t        |      }	|	S )zW
        Return a new ``<p:sp>`` element tree configured as a base auto shape.
        )re   _autoshape_sp_tmplr   )
id_r+   rX   lefttopwidthheighttmplxmlsps
             r   new_autoshape_spzCT_Shape.new_autoshape_sp   s9    
 **,c4sE64@@s^	r   c                 Z    t         j                         }|| |||||fz  }t        |      }|S )zReturn new `p:sp` element tree configured as freeform shape.

        The returned shape has a `a:custGeom` subtree but no paths in its
        path list.
        )re   _freeform_sp_tmplr   )	shape_idr+   r   r   cxcyr   r   r   s	            r   new_freeform_spzCT_Shape.new_freeform_sp   s7     ))+haB33s^	r   c                    t         j                         }|| |fz  }t        |      }|j                  j                  j                         }	||	_        ||	_        ||	_        ||	_	        t        j                  t        j                  t        j                  t        j                  t        j                  f}
||
v r#|j!                  t#        j$                                |S )za
        Return a new ``<p:sp>`` element tree configured as a placeholder
        shape.
        )re   _ph_sp_tmplr   rq   nvPrget_or_add_phtypeidxorientszr   TITLECENTER_TITLESUBTITLEBODYOBJECTappendr   new)r{   r+   ph_typer   r   r   r   r   r   ph(placeholder_types_that_have_a_text_frames              r   new_placeholder_spzCT_Shape.new_placeholder_sp   s     ##%c4[ s^YY^^))+	   ''##!!4
0 >>IIkoo'(	r   c                 Z    t         j                         }|| |||||fz  }t        |      }|S )zb
        Return a new ``<p:sp>`` element tree configured as a base textbox
        shape.
        )re   _textbox_sp_tmplr   )	r{   r+   r|   r}   r~   r   r   r   r   s	            r   new_textbox_spzCT_Shape.new_textbox_sp  s7     ((*c4sE6::s^	r   c                 8    | j                   }|y|j                  S )zk
        Value of ``prst`` attribute of ``<a:prstGeom>`` element or |None| if
        not present.
        N)rp   rX   rs   s     r   rX   zCT_Shape.prst&  s      ==}}r   c                 .    | j                   j                  S )z
        Reference to ``<a:prstGeom>`` child element or |None| if this shape
        doesn't have one, for example, if it's a placeholder shape.
        )rg   rp   r:   s    r   rp   zCT_Shape.prstGeom1  s     yy!!!r   c                  L    dt        dd      ddddddd	dd
ddddddS )N<p:sp ap >
  <p:nvSpPr>
    <p:cNvPr id="%d" name="%sY"/>
    <p:cNvSpPr/>
    <p:nvPr/>
  </p:nvSpPr>
  <p:spPr>
    <a:xfrm>
      <a:off x="" y=""/>
      <a:ext cx="" cy="z("/>
    </a:xfrm>
    <a:prstGeom prst="a  ">
      <a:avLst/>
    </a:prstGeom>
  </p:spPr>
  <p:style>
    <a:lnRef idx="1">
      <a:schemeClr val="accent1"/>
    </a:lnRef>
    <a:fillRef idx="3">
      <a:schemeClr val="accent1"/>
    </a:fillRef>
    <a:effectRef idx="2">
      <a:schemeClr val="accent1"/>
    </a:effectRef>
    <a:fontRef idx="minor">
      <a:schemeClr val="lt1"/>
    </a:fontRef>
  </p:style>
  <p:txBody>
    <a:bodyPr rtlCol="0" anchor="ctr"/>
    <a:lstStyle/>
    <a:p>
      <a:pPr algn="ctr"/>
    </a:p>
  </p:txBody>
</p:sp>r   r   r   r   rz   zCT_Shape._autoshape_sp_tmpl9  s*    N !c*D$dD$PTI$V&	
r   c                  F    dt        dd      ddddddd	dd
ddddS )Nr   r   r   r   r   r   r   r   r   r   r   a  "/>
    </a:xfrm>
    <a:custGeom>
      <a:avLst/>
      <a:gdLst/>
      <a:ahLst/>
      <a:cxnLst/>
      <a:rect l="l" t="t" r="r" b="b"/>
      <a:pathLst/>
    </a:custGeom>
  </p:spPr>
  <p:style>
    <a:lnRef idx="1">
      <a:schemeClr val="accent1"/>
    </a:lnRef>
    <a:fillRef idx="3">
      <a:schemeClr val="accent1"/>
    </a:fillRef>
    <a:effectRef idx="2">
      <a:schemeClr val="accent1"/>
    </a:effectRef>
    <a:fontRef idx="minor">
      <a:schemeClr val="lt1"/>
    </a:fontRef>
  </p:style>
  <p:txBody>
    <a:bodyPr rtlCol="0" anchor="ctr"/>
    <a:lstStyle/>
    <a:p>
      <a:pPr algn="ctr"/>
    </a:p>
  </p:txBody>
</p:sp>r   r   r   r   r   zCT_Shape._freeform_sp_tmplc  s'    X !c*D$dD$S)P+	
r   c                 *    t        j                         S )N)r   new_p_txBodyr:   s    r   _new_txBodyzCT_Shape._new_txBody  s    ''))r   c                  .    dt        dd      dddddS )	Nr   r   r   r   r   r   r   zq"/>
    <p:cNvSpPr>
      <a:spLocks noGrp="1"/>
    </p:cNvSpPr>
    <p:nvPr/>
  </p:nvSpPr>
  <p:spPr/>
</p:sp>r   r   r   r   r   zCT_Shape._ph_sp_tmpl  s     !c*D$	8	
r   c                  F    dt        dd      ddddddd	dd
ddddS )Nr   r   r   r   r   r   r   zc"/>
    <p:cNvSpPr txBox="1"/>
    <p:nvPr/>
  </p:nvSpPr>
  <p:spPr>
    <a:xfrm>
      <a:off x="r   r   r   z"/>
    </a:xfrm>
    <a:prstGeom prst="rect">
      <a:avLst/>
    </a:prstGeom>
    <a:noFill/>
  </p:spPr>
  <p:txBody>
    <a:bodyPr wrap="none">
      <a:spAutoFit/>
    </a:bodyPr>
    <a:lstStyle/>
    <a:p/>
  </p:txBody>
</p:sp>r   r   r   r   r   zCT_Shape._textbox_sp_tmpl  s%    4 !c*D$dD$/P	
r   N)r   r   r   r   r   rq   rg   r   txBodyrS   rl   rc   rn   rt   rv   rx   staticmethodr   r   r   r   rX   rp   rz   r   r   r   r   r   r   r   re   re      sR    :&F"Dzm<F*) . .         	 	  8     " " '
 '
R ,
 ,
\* 
 
 
 
r   re   c                   @    e Zd ZdZ ed      Z ed      Z ed      Zy)CT_ShapeNonVisualz-
    ``<p:nvSpPr>`` custom element class
    zp:cNvPrz	p:cNvSpPrzp:nvPrN)r   r   r   r   r   cNvPrrr   r   r   r   r   r   r     s'     )$EK(G"Dr   r   N)'r   
__future__r   pptx.enum.shapesr   r   	pptx.oxmlr   pptx.oxml.nsr   pptx.oxml.shapes.sharedr	   pptx.oxml.simpletypesr
   r   r   r   pptx.oxml.textr   pptx.oxml.xmlchemyr   r   r   r   r   r   r   r!   r*   r.   r1   r5   rI   rK   rO   rU   rW   re   r   r   r   r   <module>r      s    ' @    4  ' .O .>/ >0? 0 3$4 3" "J*_ **o *	O 	*o *%/ %@W
 W
t#( #r   