;i dZddlmZddlmZddlmZddlmZddl m Z erddl m Z ddl mZdd lmZdd l mZGd d e ZGd dZdS)zhObjects related to shapes. A shape is a visual object that appears on the drawing layer of a document. ) annotations) TYPE_CHECKING)WD_INLINE_SHAPE)nsmap)Parented)CT_Body) CT_Inline) StoryPart)LengthcNeZdZdZd fd Zdd Zd Zd Zed Z xZ S) InlineShapeszUSequence of |InlineShape| instances, supporting len(), iteration, and indexed access.body_elmrparentr cftt||||_dSN)superr __init___body)selfrr __class__s >C:\PYTHON\MyICR_Workspace\venv\Lib\site-packages\docx/shape.pyrzInlineShapes.__init__s, lD!!**6222 idxintc |j|}n"#t$rd|z}t|wxYwt|S)z2Provide indexed access, e.g. 'inline_shapes[idx]'.z$inline shape index [%d] out of range) _inline_lst IndexError InlineShape)rrinlinemsgs r __getitem__zInlineShapes.__getitem__sW "%c*FF " " "83>CS// ! "6"""s /c$d|jDS)Nc34K|]}t|VdSr)r).0rs r z(InlineShapes.__iter__..'s*CC F##CCCCCCr)rrs r__iter__zInlineShapes.__iter__&sCC$2BCCCCrc*t|jSr)lenrr&s r__len__zInlineShapes.__len__)s4#$$$rc>|j}d}||S)Nz//w:p/w:r/w:drawing/wp:inline)rxpath)rbodyr,s rrzInlineShapes._inline_lst,s z/zz%   r)rrrr )rr) __name__ __module__ __qualname____doc__rr!r'r*propertyr __classcell__rs@rr r s__####DDD%%%!!X!!!!!rr ceZdZdZdfd ZeddZejdd Zed Zed Z e jdd Z xZ S)rzdProxy for an ```` element, representing the container for an inline graphical object.rr cdtt|||_dSr)rrr_inline)rrrs rrzInlineShape.__init__7s* k4  ))+++ rreturnr c$|jjjS)z[Read/write. The display height of this inline shape as an |Emu| instance. )r7extentcyr&s rheightzInlineShape.height; |"%%rr;ch||jj_||jjjjj_dSr)r7r:r;graphic graphicDatapicspPr)rr;s rr<zInlineShape.heightC+!# 79 (,1444rc@|jjj}|j}|tdkr0|jjj}|j tj Stj S|tdkr tj S|tdkr tj StjS)zThe type of this inline shape as a member of ``docx.enum.shape.WD_INLINE_SHAPE``, e.g. ``LINKED_PICTURE``. Read-only. rANcdgm)r7r?r@urirrAblipFillbliplinkrLINKED_PICTUREPICTURECHART SMART_ARTNOT_IMPLEMENTED)rr@rGrIs rtypezInlineShape.typeHsl*6 o %,  ?+0Dy$&55"* * %*  "( ( %,  ", ,..rc$|jjjS)zZRead/write. The display width of this inline shape as an |Emu| instance. )r7r:cxr&s rwidthzInlineShape.width\r=rrRch||jj_||jjjjj_dSr)r7r:rRr?r@rArB)rrRs rrSzInlineShape.widthdrCr)rr )r8r )r;r )rRr ) r.r/r0r1rr2r<setterrPrSr3r4s@rrr3s&&&X& ]:::]://X/&&&X& \:::\:::::rrN)r1 __future__rtypingrdocx.enum.shaper docx.oxml.nsr docx.sharedrdocx.oxml.documentrdocx.oxml.shaper docx.parts.storyr r r rrrr_s #""""" ++++++ #******))))))******""""""!!!!!8!!!<4:4:4:4:4:4:4:4:4:4:r