Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 Nebî+ã@sTdZdZdZddlZejdƒZdZddlmZej Z Gdd„dƒZ Gdd„dƒZ dS)z3.5.14z.A frame is a container for content on a page. ÚShowBoundaryValueÚFrameéNzreportlab.platypusÚx1Úy1ÚwidthÚheightÚ leftPaddingÚ bottomPaddingÚ rightPaddingÚ topPadding)Ú rl_configc@seZdZd dd„Zdd„ZdS) rrçš™™™™™¹?NcCs||_||_||_dS)N)ÚcolorrÚ dashArray)Úselfrrr©rú:/tmp/tmp4i9tl1d3/lib64/python/reportlab/platypus/frames.pyÚ__init__szShowBoundaryValue.__init__cCs|jdk o|jdkS)Nr)rr)rrrrÚ__bool__szShowBoundaryValue.__bool__©rrr)rr N)Ú__name__Ú __module__Ú __qualname__rrrrrrrs c@s–eZdZdZd#dd„Zdd„Zd d „Zd d „Zd d„Zdd„Z dd„Z dd„Z d$dd„Z e Z dd„Zedd„ƒZd%dd„Zdd„Zdd „Zd!d"„ZdS)&rah A Frame is a piece of space in a document that is filled by the "flowables" in the story. For example in a book like document most pages have the text paragraphs in one or two frames. For generality a page might have several frames (for example for 3 column text or for text that wraps around a graphic). After creation a Frame is not usually manipulated directly by the applications program -- it is used internally by the platypus modules. Here is a diagramatid abstraction for the definitional part of a Frame:: width x2,y2 +---------------------------------+ | l top padding r | h | e +-------------------------+ i | e | f | | g | i | t | | h | g | | | t | h | p | | | t | a | | p | | d | | a | | | | d | | +-------------------------+ | | bottom padding | +---------------------------------+ (x1,y1) <-- lower left corner NOTE!! Frames are stateful objects. No single frame should be used in two documents at the same time (especially in the presence of multithreading. éNrc CsŠ| |_| |_||jd<||jd<||jd<||jd<||jd<||jd<||jd<||jd<| |_| dkrptj} | |_|jƒ|jƒdS) NÚ_x1Ú_y1Ú_widthÚ_heightÚ _leftPaddingÚ_bottomPaddingÚ _rightPaddingÚ _topPadding) ÚidÚ_debugÚ__dict__Ú showBoundaryr ÚoverlapAttachedSpaceÚ_oASpaceÚ_geomÚ_reset) rrrrrrr r r r"r%r&r#rrrr@s         zFrame.__init__cCs"|tkr|jd|St|ƒ‚dS)NÚ_)Ú _geomAttrr$ÚAttributeError)rÚarrrÚ __getattr__ZszFrame.__getattr__cCs.|tkr ||jd|<|jƒn ||j|<dS)Nr*)r+r$r()rr-ÚvrrrÚ __setattr__^s zFrame.__setattr__cKs^|jjdiƒs8x(tD] }d|}|j||jd|<qWx |jƒD]\}}t|||ƒqBWdS)NÚ _savedGeomr*)r$Ú setdefaultr+ÚitemsÚsetattr)rÚkwdsÚgaÚkr/rrrÚ _saveGeomes  zFrame._saveGeomcCsL|jjddƒrHx0tD](}d|}|j|d|j|<|jd=qW|jƒdS)Nr1r*)r$Úgetr+r()rr6rrrÚ _restoreGeomms   zFrame._restoreGeomcCs\|j|j|_|j|j|_|j|j|_|j|j|j|j |_ |j|j|j |_ dS)N) rrÚ_x2rrÚ_y2rÚ_y1prr Ú_aWr!Ú_aH)rrrrr(us z Frame._geomcCs@|jƒ|j|j|_|j|j|_d|_d|_d|_ d|_ dS)Nérg) r:rrÚ_xr<r!Ú_yÚ_atTopÚ _prevASpaceÚ_leftExtraIndentÚ_rightExtraIndent)rrrrr)~sz Frame._resetcCs|j|j|jS)N)r>rErF)rrrrÚ_getAvailableWidthŒszFrame._getAvailableWidthc Cs||_||_�zÊt|ddƒr*|j|ƒdS|j}|j}d}|jƒ}t|ddƒ}|jsˆ|jƒ}|j rˆt|ddƒsr|rx|j }t ||j dƒ}|||} | dks |r²|j || ƒ\} } ndS| |7} || 8}||t k�r tj oò| |jksî| |koò| �rddlm} | d |j| | ||jfƒ‚dS|jƒ} t|d dƒ} | �rR| dj�rR| d}|j}|j}|j}|j||}|j|}|�s¨|| | }t ||| ƒ}t d||ƒ}n„|| |}||j|jk}|d k�sè|d k�sè|�r |d k�r t d|�rø|jn||jƒ}|j}|d k�r,d | d_n d}}}|j||||||ƒ|d k�rR| jƒ|j ||j!|j"||| d�||_|j#�r�t$j%d|j&ƒƒ|| 8}|j �rºt|ddƒ�r´|j } | |_ ||jk�rÌd|_||_dSWdx$dD]}t'||ƒ�ràt(||ƒ�qàWXdS)zô Draws the flowable at the current position. Returns 1 if successful, 0 if it would not fit. Raises a LayoutError if the object is too wide, or if it is too high for a totally empty frame, to avoid infinite loopsÚ frameActionNr@rÚ _ZEROSIZEFZ_SPACETRANSFER)Ú LayoutErrorz>Flowable %s (%sx%s points) too large for frame (%sx%s points).Z _frameBGsÚframezframe-permanentzframe-permanent-1)Z_sWzdrew %sÚcanvÚ_frameéÿÿÿÿrNrN)rLrM))rMrLÚgetattrrHrBr=rGrCÚgetSpaceBeforer'rDÚmaxÚwrapÚ_FUZZr ZallowTableBoundsErrorsr?Zreportlab.platypus.doctemplaterJÚ __class__Z getSpaceAfterZactiveÚleftÚrightÚstartrrr<r!rZrenderÚpopZdrawOnrArEr#ÚloggerÚdebugÚidentityÚhasattrÚdelattr)rÚflowablerLÚtrySplitÚyÚpÚsZaWZzeroSizeÚhÚwrJÚsaZfbgÚbgZfbglZfbgrZbgmZfbwZfbxZfbhZfbyZattr-rrrÚ_add�sŠ     "     $       z Frame._addc Cs¢|j}|j}d}|js4|jƒ}|jr4t||jdƒ}|||}|dkrZt|ddƒ rZgS||_||_ z|j |j |ƒ}Wdx dD]}t ||ƒr€t ||ƒq€WX|S)z7Ask the flowable to split using up the available space.rrIFNrLrM)rLrM)rBr=rCrPr'rQrDrOrMrLÚsplitr>r\r]) rr^rLr`rarbrcÚrr-rrrrhçs$   z Frame.splitc CsÒddlm}m}t|tttfƒp(t||ƒ}d} d} |rJ||dƒ} | dk}n2t|tƒr||r|||jdƒ} | d k}|r||j } |j } |r²|j ƒ|j | ƒ| dkr¤|j | ƒ| r²|j| ƒ|j||||ƒ|rÎ|jƒdS) zAdraw the frame boundary as a rectangle (primarily for debugging).r)ÚColorÚtoColorr@NrNrNrNrNrN)Zreportlab.lib.colorsrjrkÚ isinstanceÚstrÚtupleÚlistrrrrZ saveStateZsetStrokeColorZ setLineWidthZsetDashZrectZ restoreState) rLZsbrrrrrjrkÚssrdÚdaÚcrrrÚ _drawBoundaryÿs.      zFrame._drawBoundarycCs2|j||p|j|j|j|j|j|j|jƒdS)N)rsr%rrr;r<)rrLZ __boundary__rrrÚ drawBoundaryszFrame.drawBoundarycCs^|jrtjd|jƒ|jr&|j|ƒx2t|ƒdkrX|d}|j||dd�rT|d=q(Pq(WdS)z‡Consumes objects from the front of the list until the frame is full. If it cannot fit one object, raises an exception.z&enter Frame.addFromlist() for frame %sr)r_N)r#rYrZr"r%rtÚlenÚadd)rZdrawlistrLÚheadrrrÚ addFromLists zFrame.addFromListcGs|jjdgƒj|ƒdS)NZ_generated_content)r$r2Úextend)rÚCrrrÚadd_generated_content,szFrame.add_generated_contentcCsd|jƒ|j|jrdpdfS)Nz (%s x %s%s)Ú*Ú)rGr?rC)rrrrÚ _aSpaceString/szFrame._aSpaceString)rrrrNrNN)r)N)rrrÚ__doc__rr.r0r8r:r(r)rGrgrvrhÚ staticmethodrsrtrxr{r~rrrrr s&   V  )rr)rrrrrr r r ) Ú __version__rÚ__all__ÚloggingÚ getLoggerrYr+Ú reportlabr rSrrrrrrÚs