HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/docx/oxml/__pycache__/shape.cpython-310.pyc
o

$we��@s�dZddlmZddlmZddlmZddlmZddl	m
Z
mZmZm
Z
mZmZddlmZmZmZmZmZer@ddlmZGd	d
�d
e�ZGdd�de�ZGd
d�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�Z Gdd�de�Z!Gdd�de�Z"Gdd �d e�Z#Gd!d"�d"e�Z$Gd#d$�d$e�Z%Gd%d&�d&e�Z&Gd'd(�d(e�Z'Gd)d*�d*e�Z(d+S),zDCustom element classes for shape-related elements like `<w:inline>`.�)�annotations)�
TYPE_CHECKING��nsdecls)�	parse_xml)�
ST_Coordinate�ST_DrawingElementId�ST_PositiveCoordinate�ST_RelationshipId�	XsdString�XsdToken)�BaseOxmlElement�
OneAndOnlyOne�OptionalAttribute�RequiredAttribute�	ZeroOrOne)�Lengthc@�eZdZdZdS)�	CT_Anchorz8`<wp:anchor>` element, container for a "floating" shape.N��__name__�
__module__�__qualname__�__doc__�rr�H/home/arjun/projects/env/lib/python3.10/site-packages/docx/oxml/shape.pyr�rc@�$eZdZdZede�Zede�ZdS)�CT_BlipzX``<a:blip>`` element, specifies image source and adjustments such as alpha and
    tint.zr:embedzr:linkN)rrrrrr
�embed�linkrrrrr!s
rc@seZdZdZeddd�ZdS)�CT_BlipFillPropertiesz9``<pic:blipFill>`` element, specifies picture properties.za:blip)z	a:srcRectza:tilez	a:stretch��
successorsN)rrrrr�bliprrrrr!)sr!c@�eZdZdZed�ZdS)�CT_GraphicalObjectz:``<a:graphic>`` element, container for a DrawingML object.z
a:graphicDataN)rrrrr�graphicDatarrrrr&/�r&c@s"eZdZdZed�Zede�ZdS)�CT_GraphicalObjectDatazI``<a:graphicData>`` element, container for the XML of a DrawingML object.zpic:pic�uriN)	rrrrr�picrrr*rrrrr)5sr)c@sPeZdZdZed�Zed�Zed�Zedd
d��Z	eddd��Z
edd��ZdS)�	CT_Inlinez5`<wp:inline>` element, container for an inline shape.z	wp:extentzwp:docPrz	a:graphic�cxr�cy�shape_id�intr+�
CT_Picture�returncCsLt|���}||j_||j_||j_d||j_d|jj	_
|jj	�|�|S)z\Return a new ``<wp:inline>`` element populated with the values passed as
        parameters.z
Picture %dz8http://schemas.openxmlformats.org/drawingml/2006/picture)r�_inline_xml�extentr-r.�docPr�id�name�graphicr'r*�_insert_pic)�clsr-r.r/r+�inlinerrr�newCs�z
CT_Inline.new�rId�str�filenamec	Cs8d}t�|||||�}|�||||�}|jj�|�|S)z�Create `wp:inline` element containing a `pic:pic` element.

        The contents of the `pic:pic` element is taken from the argument values.
        r)r1r<r8r'r9)	r:r/r=r?r-r.�pic_idr+r;rrr�new_pic_inlineRs
zCT_Inline.new_pic_inlinecCsdtdddd�S)Na
<wp:inline %s>
  <wp:extent cx="914400" cy="914400"/>
  <wp:docPr id="666" name="unnamed"/>
  <wp:cNvGraphicFramePr>
    <a:graphicFrameLocks noChangeAspect="1"/>
  </wp:cNvGraphicFramePr>
  <a:graphic>
    <a:graphicData uri="URI not set"/>
  </a:graphic>
</wp:inline>�wp�ar+�rr�r:rrrr3`s	��zCT_Inline._inline_xmlN)
r-rr.rr/r0r+r1r2r,)r/r0r=r>r?r>r-rr.rr2r,)rrrrrr4r5r8�classmethodr<rAr3rrrrr,<s
r,c@s$eZdZdZede�Zede�ZdS)�CT_NonVisualDrawingPropszpUsed for ``<wp:docPr>`` element, and perhaps others.

    Specifies the id and name of a DrawingML drawing.
    r6r7N)	rrrrrrr6rr7rrrrrGp�
rGc@r)�CT_NonVisualPicturePropertieszK``<pic:cNvPicPr>`` element, specifies picture locking and resize behaviors.NrrrrrrIzrrIc@s@eZdZdZed�Zed�Zed�Zedd��Z	edd��Z
d	S)
r1z+``<pic:pic>`` element, a DrawingML picture.zpic:nvPicPrzpic:blipFillzpic:spPrcCs>t|���}||jj_||jj_||jj_||j	_
||j	_|S)z�Return a new ``<pic:pic>`` element populated with the minimal contents
        required to define a viable picture element, based on the values passed as
        parameters.)r�_pic_xml�nvPicPr�cNvPrr6r7�blipFillr$r�spPrr-r.)r:r@r?r=r-r.r+rrrr<�s


zCT_Picture.newcCsdtddd�S)Naq<pic:pic %s>
  <pic:nvPicPr>
    <pic:cNvPr id="666" name="unnamed"/>
    <pic:cNvPicPr/>
  </pic:nvPicPr>
  <pic:blipFill>
    <a:blip/>
    <a:stretch>
      <a:fillRect/>
    </a:stretch>
  </pic:blipFill>
  <pic:spPr>
    <a:xfrm>
      <a:off x="0" y="0"/>
      <a:ext cx="914400" cy="914400"/>
    </a:xfrm>
    <a:prstGeom prst="rect"/>
  </pic:spPr>
</pic:pic>r+rCrDrrErrrrJ�s
��zCT_Picture._pic_xmlN)rrrrrrKrMrNrFr<rJrrrrr1~s
r1c@r%)�CT_PictureNonVisualz9``<pic:nvPicPr>`` element, non-visual picture properties.z	pic:cNvPrN)rrrrrrLrrrrrO�r(rOc@r)�
CT_Point2DzaUsed for ``<a:off>`` element, and perhaps others.

    Specifies an x, y coordinate (point).
    �x�yN)rrrrrrrQrRrrrrrP�rHrPc@r)�CT_PositiveSize2DzpUsed for ``<wp:extent>`` element, and perhaps others later.

    Specifies the size of a DrawingML drawing.
    r-r.N)rrrrrr	r-r.rrrrrS�rHrSc@r)�CT_PresetGeometry2DzW``<a:prstGeom>`` element, specifies an preset autoshape geometry, such as
    ``rect``.NrrrrrrT�rrTc@r)�CT_RelativeRectzX``<a:fillRect>`` element, specifying picture should fill containing rectangle
    shape.NrrrrrrU�rrUc@sPeZdZdZeddd�Zedd��Zejdd��Zedd	��Z	e	jd
d	��Z	dS)�CT_ShapePropertieszF``<pic:spPr>`` element, specifies size and shape of picture container.za:xfrm)z
a:custGeomz
a:prstGeomza:lnza:effectLstza:effectDagz	a:scene3dza:sp3dza:extLstr"cC�|j}|dur	dS|jS)z:Shape width as an instance of Emu, or None if not present.N)�xfrmr-��selfrXrrrr-��zCT_ShapeProperties.cxcC�|��}||_dS�N)�get_or_add_xfrmr-�rZ�valuerXrrrr-��
cCrW)z;Shape height as an instance of Emu, or None if not present.N)rXr.rYrrrr.�r[zCT_ShapeProperties.cycCr\r])r^r.r_rrrr.�raN)
rrrrrrX�propertyr-�setterr.rrrrrV�s�


rVc@r)�CT_StretchInfoPropertieszT``<a:stretch>`` element, specifies how picture should fill its containing
    shape.Nrrrrrrd�rrdc@s\eZdZdZeddd�Zeddd�Zedd��Zej	d	d��Zed
d��Z
e
j	dd��Z
d
S)�CT_Transform2DzD``<a:xfrm>`` element, specifies size and shape of picture container.za:off)�a:extr"rfrcC�|j}|dur	dS|jSr])�extr-�rZrhrrrr-�zCT_Transform2D.cxcCr\r])�get_or_add_extr-�rZr`rhrrrr-
racCrgr])rhr.rirrrr.rjzCT_Transform2D.cycCr\r])rkr.rlrrrr.raN)rrrrr�offrhrbr-rcr.rrrrres


reN))r�
__future__r�typingr�docx.oxml.nsr�docx.oxml.parserr�docx.oxml.simpletypesrrr	r
rr�docx.oxml.xmlchemyr
rrrr�docx.sharedrrrr!r&r)r,rGrIr1rOrPrSrTrUrVrdrerrrr�<module>s4 4
-

,