Xj dZddlmZddlmZddlmZddlmZddl m Z erddl m Z ddl mZdd lmZdd l mZGd d e ZGd dZy)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)LengthcHeZdZdZdfd ZddZdZdZedZ xZ S) InlineShapeszUSequence of |InlineShape| instances, supporting len(), iteration, and indexed access.c:tt| |||_yN)superr __init___body)selfbody_elmparent __class__s ^/mnt/ssd/data/Dropbox/adrian/vault-secondbrain/venv/lib/python3.12/site-packages/docx/shape.pyrzInlineShapes.__init__s lD*62 cr |j|}t|S#t$rd|z}t|wxYw)z2Provide indexed access, e.g. 'inline_shapes[idx]'.z$inline shape index [%d] out of range) _inline_lst IndexError InlineShape)ridxinlinemsgs r __getitem__zInlineShapes.__getitem__sI "%%c*F 6""  "83>CS/ ! "s6c(d|jDS)Nc32K|]}t|ywr)r).0rs r z(InlineShapes.__iter__..'sC F#Cs)rrs r__iter__zInlineShapes.__iter__&sC$2B2BCCrc,t|jSr)lenrr%s r__len__zInlineShapes.__len__)s4##$$rc@|j}d}|j|S)Nz//w:p/w:r/w:drawing/wp:inline)rxpath)rbodyr+s rrzInlineShapes._inline_lst,szz/zz%  r)rrrr )rint) __name__ __module__ __qualname____doc__rr r&r)propertyr __classcell__rs@rr r s/_#D%!!rr ceZdZdZdfd Zed dZejd dZedZedZ e jd dZ xZ S) rzdProxy for an ```` element, representing the container for an inline graphical object.c8tt| ||_yr)rrr_inline)rrrs rrzInlineShape.__init__7s k4)+ rcB|jjjS)z[Read/write. The display height of this inline shape as an |Emu| instance. )r7extentcyr%s rheightzInlineShape.height; ||""%%%rc||jj_||jjjj j _yr)r7r9r:graphic graphicDatapicspPr)rr:s rr;zInlineShape.heightC8!# 79 ((,,114rc|jjj}|j}|tdk(rL|j j j}|jtjStjS|tdk(rtjS|tdk(rtjStjS)zThe type of this inline shape as a member of ``docx.enum.shape.WD_INLINE_SHAPE``, e.g. ``LINKED_PICTURE``. Read-only. r@cdgm)r7r>r?urirr@blipFillbliplinkrLINKED_PICTUREPICTURECHART SMART_ARTNOT_IMPLEMENTED)rr?rFrHs rtypezInlineShape.typeHsll**66 oo %, ??++00Dyy$&555"** * %* "(( ( %, ",, ,...rcB|jjjS)zZRead/write. The display width of this inline shape as an |Emu| instance. )r7r9cxr%s rwidthzInlineShape.width\r<rc||jj_||jjjj j _yr)r7r9rQr>r?r@rA)rrQs rrRzInlineShape.widthdrBr)rr )returnr )r:r )rQr ) r.r/r0r1rr2r;setterrOrRr3r4s@rrr3sy&& ]]:://&&& \\::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:r