;i"fdZddlmZddlmZmZddlmZddlm Z ddl m Z m Z m Z mZmZmZddlmZmZmZmZmZerddlmZGd d eZGd d eZGd deZGddeZGddeZGddeZGddeZGddeZ GddeZ!GddeZ"GddeZ#Gdd eZ$Gd!d"eZ%Gd#d$eZ&Gd%d&eZ'Gd'd(eZ(Gd)d*eZ)d+S),zDCustom element classes for shape-related elements like ``.) annotations) TYPE_CHECKINGcastnsdecls) parse_xml) ST_CoordinateST_DrawingElementIdST_PositiveCoordinateST_RelationshipId XsdStringXsdToken)BaseOxmlElement OneAndOnlyOneOptionalAttributeRequiredAttribute ZeroOrOne)LengthceZdZdZdS) CT_Anchorz8`` element, container for a "floating" shape.N__name__ __module__ __qualname____doc__CC:\PYTHON\MyICR_Workspace\venv\Lib\site-packages\docx/oxml/shape.pyrrsBBBBrrcXeZdZUdZedeZded<edeZded<dS)CT_BlipzX```` element, specifies image source and adjustments such as alpha and tint.zr:embedz str | Noneembedzr:linklinkN) rrrrrr r!__annotations__r"rrrr r !s|  *)$E)(#Drr c8eZdZUdZeddZded<dS)CT_BlipFillPropertiesz9```` element, specifies picture properties.za:blip)z a:srcRectza:tilez a:stretch successorsr blipN)rrrrrr(r#rrrr%r%-sLCCIADrr%c4eZdZUdZedZded<dS)CT_GraphicalObjectz:```` element, container for a DrawingML object.z a:graphicDataCT_GraphicalObjectData graphicDataN)rrrrrr,r#rrrr*r*5sDDD*7-++Krr*cVeZdZUdZedZded<edeZ ded<dS)r+zI```` element, container for the XML of a DrawingML object.zpic:pic CT_PicturepicuristrN) rrrrrr/r#rrr0rrrr+r+=sQSSi **C****  11C111111rr+ceZdZUdZedZded<edZded<edZd ed <e ddZ e ddZ e dZ dS) CT_Inlinez5`` element, container for an inline shape.z wp:extentCT_PositiveSize2Dextentzwp:docPrCT_NonVisualDrawingPropsdocPrz a:graphicr*graphiccxrcyshape_idintr/r.returnc4ttt|}||j_||j_||j_d|z|j_ d|j j _ |j j ||S)z\Return a new ```` element populated with the values passed as parameters.z Picture %dz8http://schemas.openxmlformats.org/drawingml/2006/picture)rr3r _inline_xmlr5r9r:r7idnamer8r,r0 _insert_pic)clsr9r:r;r/inlines rnewz CT_Inline.newOs|i3??+<+>  " (83 )c"&"..s333 rrIdr1filenamecvd}t|||||}|||||}|S)zCreate `wp:inline` element containing a `pic:pic` element. The contents of the `pic:pic` element is taken from the argument values. r)r.rE) rCr;rFrGr9r:pic_idr/rDs rnew_pic_inlinezCT_Inline.new_pic_inline\s>nnVXsB;;R3// rc,dtddddzS)Na  wpar/rrrCs rr?zCT_Inline._inline_xmlis$ %T3s;; < rN) r9rr:rr;r<r/r.r=r3) r;r<rFr1rGr1r9rr:rr=r3) rrrrrr5r#r7r8 classmethodrErJr?rrrr3r3Ds?? - k : :F::::&3m''E#0-##G   [    [    [    rr3cBeZdZdZedeZedeZdS)r6zpUsed for ```` element, and perhaps others. Specifies the id and name of a DrawingML drawing. r@rAN) rrrrrr r@r rArrrr6r6ys?  4!4 5 5B  VY / /DDDrr6ceZdZdZdS)CT_NonVisualPicturePropertieszK```` element, specifies picture locking and resize behaviors.NrrrrrSrSsUUUUrrSceZdZUdZedZded<edZded<edZd ed <e ddZ e dZ dS)r.z+```` element, a DrawingML picture.z pic:nvPicPrCT_PictureNonVisualnvPicPrz pic:blipFillr%blipFillzpic:spPrCT_ShapePropertiesspPrrIr<rGr1rFr9rr:r=ct|}||jj_||jj_||jj_||j _ ||j _ |S)z3A new minimum viable `` (picture) element.) r_pic_xmlrVcNvPrr@rArWr(r!rYr9r:)rCrIrGrFr9r:r/s rrEzCT_Picture.newsW ''% !) "%    rc*dtdddzS)Naq r/rMrNrrOs rr[zCT_Picture._pic_xmls" $#5#s33% 4 rN) rIr<rGr1rFr1r9rr:rr=r.) rrrrrrVr#rWrYrPrEr[rrrr.r.s55#0=$$G'4m''H -}Z88D8888[  [   rr.c(eZdZdZedZdS)rUz9```` element, non-visual picture properties.z pic:cNvPrN)rrrrrr\rrrrUrUs#CC M+ & &EEErrUcBeZdZdZedeZedeZdS) CT_Point2DzaUsed for ```` element, and perhaps others. Specifies an x, y coordinate (point). xyN)rrrrrr rarbrrrr`r`s> #}--A#}--AAArr`cXeZdZUdZedeZded<edeZded<dS)r4zpUsed for ```` element, and perhaps others later. Specifies the size of a DrawingML drawing. r9rr:N) rrrrrr r9r#r:rrrr4r4s| #" #B#" #Brr4ceZdZdZdS)CT_PresetGeometry2DzW```` element, specifies an preset autoshape geometry, such as ``rect``.NrrrrreresrreceZdZdZdS)CT_RelativeRectzX```` element, specifying picture should fill containing rectangle shape.NrrrrrgrgrrgceZdZdZeddZedZejdZedZ e jdZ d S) rXzF```` element, specifies size and shape of picture container.za:xfrm)z a:custGeomz a:prstGeomza:lnz a:effectLstz a:effectDagz a:scene3dza:sp3dza:extLstr&c&|j}|dS|jS)z:Shape width as an instance of Emu, or None if not present.N)xfrmr9selfrks rr9zCT_ShapeProperties.cxy <4wrc<|}||_dSN)get_or_add_xfrmr9rmvaluerks rr9zCT_ShapeProperties.cx##%%rc&|j}|dS|jS)z;Shape height as an instance of Emu, or None if not present.N)rkr:rls rr:zCT_ShapeProperties.cyrnrc<|}||_dSrp)rqr:rrs rr:zCT_ShapeProperties.cyrtrN) rrrrrrkpropertyr9setterr:rrrrXrXsPP 9     DXYYXYYrrXceZdZdZdS)CT_StretchInfoPropertieszT```` element, specifies how picture should fill its containing shape.Nrrrrrzrz rhrrzceZdZdZeddZeddZedZej dZed Z e j d Z d S) CT_Transform2DzD```` element, specifies size and shape of picture container.za:off)a:extr&r}rc&|j}|dS|jSrp)extr9rmrs rr9zCT_Transform2D.cxh ;4v rc<|}||_dSrp)get_or_add_extr9rmrsrs rr9zCT_Transform2D.cx!!##rc&|j}|dS|jSrp)rr:rs rr:zCT_Transform2D.cy!rrc<|}||_dSrp)rr:rs rr:zCT_Transform2D.cy(rrN) rrrrroffrrwr9rxr:rrrr|r|sNN )G 3 3 3C )G + + +C X YYX YYrr|N)*r __future__rtypingrr docx.oxml.nsrdocx.oxml.parserrdocx.oxml.simpletypesr r r r r rdocx.oxml.xmlchemyrrrrr docx.sharedrrr r%r*r+r3r6rSr.rUr`r4rergrXrzr|rrrrsJJ""""""&&&&&&&& &&&&&&#""""""CCCCCCCC     o   O22222_2222 2 2 2 2 2 2 2 j00000000VVVVVOVVV, , , , , , , , ^'''''/''' ........        / o ))))))))X _r