³ò
~×YKc           @   sÑ  d  d k  Z  d  d k l Z l Z d „  Z d e  i i i f d „  ƒ  YZ d e  i i i f d „  ƒ  YZ	 d „  Z
 d	 e	 f d
 „  ƒ  YZ d e	 f d „  ƒ  YZ d e	 f d „  ƒ  YZ d „  Z d e  i i f d „  ƒ  YZ e ƒ  Z d e	 f d „  ƒ  YZ d „  Z d e  i i i f d „  ƒ  YZ d „  Z d „  Z d „  Z d „  Z d „  Z d e	 f d „  ƒ  YZ d e	 f d „  ƒ  YZ d  „  Z d! e	 f d" „  ƒ  YZ d# e  i i i f d$ „  ƒ  YZ  d% e	 f d& „  ƒ  YZ! d S('   iÿÿÿÿN(   t   rendert   Renderc         C   s$   t  |  t ƒ o |  | Sn |  Sd S(   sj   
    If num is a float, multiplies it by base and returns that. Otherwise,
    returns num unchanged.
    N(   t
   isinstancet   float(   t   numt   base(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   scale   s    t   Nullc           B   s)   e  Z d  Z d d d d „ Z d „  Z RS(   sÆ   
    This is a displayable that doesn't actually display anything. It's
    useful, I guess, when you need to wrap something with a behavior,
    but don't want to actually have anything there.
    i    t   defaultc         K   s2   t  t |  ƒ i d | |  | |  _ | |  _ d  S(   Nt   style(   t   superR   t   __init__t   widtht   height(   t   selfR   R   R	   t
   properties(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR   /   s    	c         C   sL   t  i i i |  i |  i ƒ } |  i o  | i |  d  d  d  d  d  ƒ n | S(   N(	   t   renpyt   displayR    R   R   R   t	   focusablet	   add_focust   None(   R   R   R   t   stt   att   rv(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR    4   s    
 (   t   __name__t
   __module__t   __doc__R   R    (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR   (   s   t	   Containerc           B   sn   e  Z d  Z e Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z d	 „  Z d
 „  Z RS(   s‡  
    This is the base class for containers that can have one or more
    children.

    @ivar children: A list giving the children that have been added to
    this container, in the order that they were added in.

    @ivar child: The last child added to this container. This is also
    used to access the sole child in containers that can only hold
    one child.

    @ivar offsets: A list giving offsets for each of our children.
    It's expected that render will set this up each time it is called.

    @ivar sizes: A list giving sizes for each of our children. It's
    also expected that render will set this each time it is called.

    c         O   s_   |  i  ƒ  |  _ d  |  _ |  i  ƒ  |  _ x | D] } |  i | ƒ q. Wt t |  ƒ i |   d  S(   N(	   t
   _list_typet   childrenR   t   childt   offsetst   addR
   R   R   (   R   t   argsR   t   i(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR   U   s    	 c         C   sA   t  t |  ƒ i | | ƒ x! |  i D] } | i | t ƒ q# Wd  S(   N(   R
   R   t   set_style_prefixR   t   False(   R   t   prefixt   rootR"   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR#   `   s    
 c         C   s>   t  i i | ƒ } |  i i | ƒ | |  _ |  i ƒ  |  _ d S(   s1   
        Adds a child to this container.
        N(   R   t   easyt   displayableR   t   appendR   R   R   (   R   t   dR   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR    f   s    	c         C   s€   x3 t  |  i ƒ D] \ } } | | j o Pq q Wd S|  i i | ƒ |  i ƒ  |  _ |  i o |  i d |  _ n
 d |  _ d S(   st   
        Removes the first instance of child from this container. May
        not work with all containers.
        Niÿÿÿÿ(   t	   enumerateR   t   popR   R   R   R   (   R   R*   R"   t   c(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   removeq   s     	
c         C   s   t  i i i |  ƒ d S(   sw   
        This should be called if a child is added to this
        displayable outside of the render function.
        N(   R   R   R    t
   invalidate(   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   update†   s    c   	      C   s|   t  | | ƒ } |  i ƒ  |  _ xW |  i D]L } t | | | | | ƒ } | i | d d | | | ƒ } |  i i | ƒ q( W| S(   Ni    (   R   R   R   R   R    t   placeR)   (	   R   R   R   R   R   R   R-   t   crt   offset(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR       s    
 c         C   sŒ   |  i  } |  i } xs t t | ƒ d d d ƒ D]U } | | } | | \ }	 }
 | i | | |	 | |
 | ƒ } | d  j	 o | Sq/ q/ Wd  S(   Ni   iÿÿÿÿ(   R   R   t   xranget   lent   eventR   (   R   t   evt   xt   yR   R   R   R"   R*   t   xot   yoR   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR6   œ   s    		 
 c         C   s   |  i  S(   N(   R   (   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   visit­   s    c         C   sE   t  i i |  j o t  i i o |  Sn t d t |  ƒ i ƒ ‚ d  S(   Ns'   %r cannot be used as a context manager.(   R   t   uit   currentt   current_oncet	   Exceptiont   typeR   (   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt	   __enter__³   s    !c         C   sC   | o t  Sn t i i |  j	 o t d ƒ ‚ n t i i ƒ  t  S(   Ns$   Widget %r left open at end of block.(   R$   R   R=   R>   R@   t   close(   R   t   exc_typet   exc_valt   exc_tb(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   __exit__»   s    (   R   R   R   t   listR   R   R#   R    R.   R0   R    R6   R<   RB   RG   (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR   =   s   										c   
      O   sè   | i  d d ƒ |  \ } } t d | d | d | d | |  } t | ƒ d d j o t d	 ƒ ‚ n xz t | d d
 d … | d d
 d … ƒ D]O \ } } | \ } }	 | i t t i i	 | ƒ d | d d d |	 d d ƒƒ q‘ W| S(   sˆ  
    This is similar to im.Composite, but can be used with displayables
    instead of images. This allows it to be used to composite, for
    example, an animation on top of the image.

    This is less efficient then im.Composite, as it needs to draw all
    of the displayables on the screen. On the other hand, it allows
    displayables to change while they are on the screen, which is
    necessary for animation.
    
    This takes a variable number of arguments. The first argument is
    size, which must be a tuple giving the width and height of the
    composited widgets, for layout purposes.

    It then takes an even number of further arguments. (For an odd
    number of total arguments.) The second and other even numbered
    arguments contain position tuples, while the third and further
    odd-numbered arguments give displayables. A position argument
    gives the position of the displayable immediately following it,
    with the position expressed as a tuple giving an offset from the
    upper-left corner of the LiveComposite.  The displayables are
    drawn in bottom-to-top order, with the last being closest to the
    user.
    R	   t   image_placementt   xmaximumt   ymaximumt   xminimumt   yminimumi   i    s2   LiveComposite requires an odd number of arguments.Ni   t   xpost   xanchort   ypost   yanchor(
   t
   setdefaultt   FixedR5   R@   t   zipR    t   PositionR   R'   R(   (
   t   sizeR!   R   R   R   R   t   post   widgetRN   RP   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   LiveCompositeÉ   s    $*  RU   c           B   s,   e  Z d  Z d d „ Z d „  Z d „  Z RS(   s  
    Controls the placement of a displayable on the screen, using
    supplied position properties. This is the non-curried form of
    Position, which should be used when the user has directly created
    the displayable that will be shown on the screen.
    RI   c         K   s-   t  t |  ƒ i d | |  |  i | ƒ d S(   sè   
        @param child: The child that is being laid out.

        @param style: The base style of this position.

        @param properties: Position properties that control where the
        child of this widget is placed.
        R	   N(   R
   RU   R   R    (   R   R   R	   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR   û   s    
c   	      C   sk   t  |  i | | | | ƒ } | i ƒ  \ } } d g |  _ t i i  i | i | i ƒ } | i	 | d ƒ | S(   Ni    (   i    i    (   i    i    (
   R    R   t   get_sizeR   R   R   R   R   R   t   blit(	   R   R   R   R   R   t   surft   cwt   chR   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR      s    c   	      C   s2  |  i  i ƒ  \ } } } } } } } |  i i } | d  j	 o
 | } n |  i i } | d  j	 o
 | } n |  i i } | d  j	 o
 | } n |  i i } | d  j	 o
 | } n |  i i } | d  j	 o
 | } n |  i i	 } | d  j	 o
 | } n |  i i
 } | d  j	 o
 | } n | | | | | | | f S(   N(   R   t   get_placementR	   RN   R   RP   RO   RQ   t   xoffsett   yoffsett   subpixel(	   R   RN   RP   RO   RQ   R`   Ra   Rb   t   v(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR_     s.    $






(   R   R   R   R   R    R_   (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyRU   ó   s   	t   Gridc           B   s)   e  Z d  Z d e d d „ Z d „  Z RS(   sÊ   
    A grid is a widget that evenly allocates space to its children.
    The child widgets should not be greedy, but should instead be
    widgets that only use part of the space available to them.
    R   c         K   s\   | d j	 o | i d | ƒ n t t |  ƒ i d | |  | |  _ | |  _ | |  _ d S(   sÁ   
        @param cols: The number of columns in this widget.

        @params rows: The number of rows in this widget.

        @params transpose: True if the grid should be transposed.
        t   spacingR	   N(   R   RR   R
   Rd   R   t   colst   rowst	   transpose(   R   Rf   Rg   t   paddingRh   R	   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR   >  s    		c         C   sÚ  |  i  i } |  i } |  i } t |  i ƒ | | j o t d ƒ ‚ n |  i ol t |  _ |  i } xV t	 d | ƒ D]A }	 x8 t	 d | ƒ D]' }
 | |	 |
 | |  i |
 |	 | <q‹ Wqu Wn | } | } |  i  i
 o | | d | | } n |  i  i o | | d | | } n g  } |  i D] } | t | | | | | ƒ q&~ } g  } | D] } | | i ƒ  qY~ } d } d } x2 | D]* \ } } t | | ƒ } t | | ƒ } qˆW|  i  i
 o
 | } n |  i  i o
 | } n | | | | d } | | | | d } t i i i | | ƒ } g  |  _ x¢ t	 d | ƒ D]‘ }	 xˆ t	 d | ƒ D]w }
 |  i |
 |	 | } | |
 |	 | } |
 | | } |	 | | } | i | | | | | | ƒ } |  i i | ƒ qWWqAW| S(   Ns   Grid not completely full.i    i   (   R	   Re   Rf   Rg   R5   R   R@   Rh   R$   t   ranget   xfillt   yfillR    RZ   t   maxR   R   R   R   R1   R)   (   R   R   R   R   R   Ri   Rf   Rg   t   old_childrenR9   R8   t   renwidtht	   renheightt   _[1]R"   t   renderst   _[2]t   sizest   cwidtht   cheightt   wt   hR   R   R\   RN   RP   R3   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR    S  s\    		
	
  -6' 

	  N(   R   R   R   R   R$   R   R    (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyRd   7  s
   t   MultiBoxc           B   sP   e  Z d Z e Z d d d  d „ Z d d d „ Z d „  Z d „  Z	 d „  Z
 RS(   R   c         K   sh   | d  j	 o | | d <n t t |  ƒ i d | |  | |  _ g  |  _ g  |  _ d  |  _ d  |  _ d  S(   NRe   R	   (	   R   R
   Ry   R   t   default_layoutt   start_timest
   anim_timest   layerst
   scene_list(   R   Re   t   layoutR	   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR   œ  s    				c         C   s:   t  t |  ƒ i | ƒ |  i i | ƒ |  i i | ƒ d  S(   N(   R
   Ry   R    R{   R)   R|   (   R   RX   t
   start_timet	   anim_time(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR    ±  s    c         C   sd   x0 | D]( \ } } } } } |  i  | | | ƒ q W|  i d  j o g  |  _ n |  i i | ƒ d  S(   N(   R    R~   R   t   extend(   R   t   lt   tagt   zot   startt   animR*   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   append_scene_list¶  s     c   ,      C   s4  |  i  p |  i d  j	 o
 t } n t } |  i i } | d  j	 o t | t | | ƒ ƒ } n |  i i	 } | d  j	 o t | t | | ƒ ƒ } n |  i
 o² t |  _
 | oo t i i i } g  }	 |  i D] }
 |	 |
 p | qË ~	 |  _ g  } |  i D] }
 | |
 p | qù ~ |  _ n |  i i } | d  j o |  i } n | |  _ n
 |  i } | oc t i i i } g  } |  i D] } | | | q}~ } g  } |  i D] } | | | q¥~ } n- | g t |  i ƒ } | g t |  i ƒ } | d j o¼ g  |  _ t i i i | | d |  i  ƒ} x‡ t |  i | | ƒ D]p \ } } } t | | | | | ƒ } | o2 | i | d d | | | ƒ } |  i i | ƒ q<|  i i d ƒ q<W| Sn | d j o/|  i i } |  i i } | d  j o
 | } n | g | g t |  i ƒ d } g  |  _ g  } g  } | } d }  d }! d }" x¡ t |  i | | | ƒ D]‡ \ }
 }" } } | i |  ƒ t |
 | | | | ƒ } | i  ƒ  \ }# }$ | |# 8} | |" 8} |  |# |" 7}  t |$ |! ƒ }! | i | ƒ q[W|  i i! o
 | }! n |  i i" p |  |" } d }% nJ | |" t | ƒ }% g  }& t# | ƒ D] \ }
 }  |& |  |
 |% qC~& } t i i i | |! ƒ } xj t | |  i | ƒ D]S \ } } }  | i  ƒ  \ }# }$ | i | |  d |# |% |! | ƒ } |  i i | ƒ q•W| Sn=| d j o/|  i i } |  i i } | d  j o
 | } n | g | g t |  i ƒ d } g  |  _ g  } g  }' | }( d }) d }* d }" x¡ t |  i | | | ƒ D]‡ \ }
 }" } } |' i |) ƒ t |
 | |( | | ƒ } | i  ƒ  \ }# }$ |( |$ 8}( |( |" 8}( |) |$ |" 7}) t |# |* ƒ }* | i | ƒ q—W|  i i" o
 | }* n |  i i! p |) |" } d }% nJ |( |" t |' ƒ }% g  }+ t# |' ƒ D] \ }
 }) |+ |) |
 |% q~+ }' t i i i |* | ƒ } xj t | |  i |' ƒ D]S \ } } }) | i  ƒ  \ }# }$ | i | d |) |* |$ |% | ƒ } |  i i | ƒ qÑW| Sn d  S(   Nt   fixedt
   layer_namei    t
   horizontali   t   vertical(   i    i    ($   RŠ   R}   R   t   TrueR$   R	   RL   Rm   R   RM   t   firstR   t   gamet	   interfacet   interact_timeR{   R|   t
   box_layoutRz   R   t
   frame_timeR5   R   R   R   R    R   RT   R1   R)   Re   t   first_spacingRZ   Rl   Rk   R+   (,   R   R   R   R   R   t   adjust_timesRL   RM   t   itRq   R"   Rs   R   t   tt   _[3]R†   t   cstst   _[4]R‡   t   catsR   R   t   cstt   catR\   R3   Re   R”   t   spacingst   surfacest   xoffsetst   remwidthR:   t   myheightRi   t   swt   sht   bonust   _[5]t   yoffsetst	   remheightR;   t   mywidtht   _[6](    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR    ¿  sÞ    

	.2	(,	! 
!	 




5 "
!	 




5 "c         C   s¨   t  |  i |  i |  i ƒ } | i ƒ  x| | D]t \ } \ } } }	 |	 d  j o
 | }
 n t i i i	 |	 }
 | i
 | | | | | |
 ƒ } | d  j	 o | Sq, q, Wd  S(   N(   RT   R   R   R{   t   reverseR   R   R   R   t
   event_timeR6   (   R   R7   R8   R9   R   t   children_offsetsR"   R:   R;   R—   Rœ   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR6   |  s    
 
 N(   R   R   R   RŠ   R   RŽ   R   R    Rˆ   R    R6   (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyRy   —  s   			½c          K   s   t  d d |   S(   NR   R‰   (   Ry   (   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyRS     s    t	   SizeGroupc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s2   t  t |  ƒ i ƒ  g  |  _ d  |  _ t |  _ d  S(   N(   R
   R®   R   t   membersR   t   _widthR$   t   computing_width(   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR   ’  s    		c         C   s£   |  i  d  j	 o |  i  Sn |  i o d Sn t |  _ d } xN |  i D]C } t i i i | | | | | ƒ } t | i	 | ƒ } | i
 ƒ  qF W| |  _  t |  _ | S(   Ni    (   R°   R   R±   R   R¯   R   R   R    Rm   R   t   killR$   (   R   R   R   R   R   t   maxwidthR"   t   rend(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR   š  s    
	
 !		(   R   R   R   R   (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR®     s   	t   Windowc           B   s>   e  Z d  Z d d „ Z d „  Z d „  Z d „  Z d „  Z RS(   s©  
    A window is a container that holds a single Displayable in it. A window
    is responsable for displaying the displayable on top of a background.

    Margin is space that is left empty by the window, and does not
    have the background displayed in it. Padding is space that is
    filled with the background, but does not contain the widget in it.

    If fill in a dimension is True, then the window expands to the
    maximum size possible in that dimension, and the child is place at
    the left or top of the space. Otherwise, the window will shrink to
    fit the child, but on no account will the size of child area +
    2*padding shrink below the minimum.    
    t   windowc         K   s>   t  t |  ƒ i d | |  | d  j	 o |  i | ƒ n d  S(   NR	   (   R
   Rµ   R   R   R    (   R   R   R	   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR   Â  s    c         C   s   |  i  i g |  i S(   N(   R	   t
   backgroundR   (   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR<   È  s    c         C   s   |  i  i p |  i S(   N(   R	   R   (   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt	   get_childË  s    c         C   s_   |  i  i } | oH t i | d  ƒ } | d  j o t ƒ  } t | <n | i i |  ƒ n d  S(   N(   R	   t
   size_groupt   size_groupst   getR   R®   R¯   R)   (   R   R¹   t   group(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   per_interactÎ  s    c      	   C   sâ  |  i  } t | i | ƒ } t | i | ƒ } |  i  i } | o) t | t | i | | | | ƒ ƒ } n t | i | ƒ }	 t | i	 | ƒ }
 t | i
 | ƒ } t | i | ƒ } t | i | ƒ } t | i | ƒ } t | i | ƒ } t | i | ƒ } |	 | } | | } |
 | } | | } |  i ƒ  } t | | | | | | | | | ƒ } | i ƒ  \ } } | i p t | | | | ƒ } n | i p t | | | | ƒ } n t i i i | | ƒ } | i oX | | } | | } t | i | | | | ƒ } | i i | |	 | | | | d t ƒn | i | |	 |
 | | | | | | | | | ƒ } | i oX | | } | | } t | i | | | | ƒ } | i i | |	 | | | | d t ƒn | g |  _ | | f |  _ | S(   Nt   main(   R	   R   RL   RM   R¹   Rm   Rº   R   t   left_margint   left_paddingt   right_margint   right_paddingt
   top_margint   top_paddingt   bottom_margint   bottom_paddingR¸   R    RZ   Rk   Rl   R   R   R   R·   R1   R$   t
   foregroundR   t   window_size(   R   R   R   R   R   R	   RL   RM   R¹   R¿   RÀ   RÁ   RÂ   RÃ   RÄ   RÅ   RÆ   t   cxmargint   cymargint	   cxpaddingt	   cypaddingR   R\   R£   R¤   R   t   bwt   bht   backR   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR    Ù  s`    	)








)		


)(   R   R   R   R   R<   R¸   R½   R    (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyRµ   ²  s   			c         C   s   t  i i | ƒ } | d  f S(   N(   R   t   pythont   py_evalR   (   R   R   t   exprR   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   dynamic_displayable_compat.  s    t   DynamicDisplayablec           B   sY   e  Z d  g Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   R   c         C   s   d  |  _ d  S(   N(   R   R   (   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   after_setstate6  s    c         O   sy   t  t |  ƒ i ƒ  d  |  _ t | t ƒ o | f } h  } t } n | i d d  ƒ |  _	 | |  _
 | |  _ | |  _ d  S(   Nt   _predict_function(   R
   RÔ   R   R   R   R   t
   basestringRÓ   R,   t   predict_functiont   functionR!   t   kwargs(   R   RÙ   R!   RÚ   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR   9  s    		
		c         C   s   g  S(   N(    (   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR<   G  s    c         C   s   t  i i i |  d ƒ d  S(   Ni    (   R   R   R    t   redraw(   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR½   J  s    c         C   s˜   |  i  | | |  i |  i Ž \ } } t i i | ƒ } | |  _ | i d „  ƒ | d  j	 o t i	 i
 i |  | ƒ n t i	 i
 i
 |  i | | | | ƒ S(   Nc         S   s
   |  i  ƒ  S(    (   R½   (   R-   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   <lambda>S  s    (   RÙ   R!   RÚ   R   R'   R(   R   t	   visit_allR   R   R    RÛ   (   R   Rw   Rx   R   R   R   RÛ   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR    M  s    $	c         C   sW   |  i  p d  Sn x> |  i  |  i |  i Ž  D]$ } | d  j	 o | i | ƒ q+ q+ Wd  S(   N(   RØ   R!   RÚ   R   t   predict(   R   t   callbackR"   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   predict_oneZ  s    
 c         C   s   |  i  i ƒ  S(   N(   R   R_   (   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR_   c  s    c         C   s+   |  i  o |  i  i | | | | ƒ Sn d  S(   N(   R   R6   (   R   R7   R8   R9   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR6   f  s    
(   R   R   t   nosaveRÕ   R   R<   R½   R    Rà   R_   R6   (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyRÔ   2  s   									c         C   sO   x< |  D]4 \ } } | d  j p t i i | ƒ o | Sq q Wt d ƒ ‚ d  S(   Ns&   Switch could not choose a displayable.(   R   R   RÐ   RÑ   R@   (   t   switcht   condR*   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   condition_switch_pickl  s
      c         C   s   t  | ƒ d  f S(   N(   Rä   R   (   R   R   Râ   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   condition_switch_shows  s    c         C   sC   t  i i o) g  } |  D] \ } } | | q ~ Sn t |  ƒ g S(   N(   R   R   t   lintRä   (   Râ   Rq   Rã   R*   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   condition_switch_predictv  s    )c          O   s¾   | i  d d ƒ g  } t |  ƒ d d j o t d ƒ ‚ n x\ t |  d d  d … |  d d  d … ƒ D]1 \ } } t i i | ƒ } | i | | f ƒ qg Wt t	 | d t
 ƒ} t | |  S(   NR	   R   i   i    s1   ConditionSwitch takes an even number of argumentsi   RÖ   (   RR   R5   R@   RT   R   R'   R(   R)   RÔ   Rå   Rç   RU   (   R!   RÚ   Râ   Rã   R*   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   ConditionSwitch}  s    * 	c          O   sí   | i  d d ƒ } t |  ƒ d d j o t d ƒ ‚ n g  } xž t |  d d  d … |  d d  d … ƒ D]s \ } } | d  j	 o: t | t ƒ p t | i ƒ  ƒ } n d | | f } n d  } | i | ƒ | i | ƒ qi Wt	 | | Ž  S(   Nt   layert   masteri   i    s1   ConditionSwitch takes an even number of argumentsi   s   renpy.showing(%r, layer=%r)(
   R,   R5   R@   RT   R   R   t   tuplet   splitR)   Rè   (   R!   RÚ   Ré   t   condargst   nameR*   Rã   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   ShowingSwitch’  s    * t   IgnoresEventsc           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s*   t  t |  ƒ i d d ƒ |  i | ƒ d  S(   NR	   R   (   R
   Rð   R   R    (   R   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR   ®  s    c   	      C   sh   t  i i i |  i | | | | ƒ } | i ƒ  \ } } t  i i i | | ƒ } | i | d d t ƒ| S(   Ni    t   focus(   i    i    (   R   R   R    R   RZ   R   R[   R$   (	   R   Rw   Rx   R   R   R2   R]   R^   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR    ²  s
    $c         C   s   |  i  i ƒ  S(   N(   R   R_   (   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR_   º  s    c         C   s   d  S(   N(   R   (   R   R7   R8   R9   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR6   ¾  s    (   R   R   R   R    R_   R6   (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyRð   ¬  s   			t   Viewportc        
   B   sh   e  Z d  Z d „  Z d	 d
 d d	 d	 e e e d d „	 Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z RS(   i   c         C   sx   | d j  og t  i i i d d ƒ |  _ t  i i i d d ƒ |  _ t |  _ t |  _ t |  _	 d |  _
 d |  _ n d  S(   Ni   i    (   R   R   t   behaviort
   Adjustmentt   xadjustmentt   yadjustmentR$   t   set_adjustmentst
   mousewheelt	   draggableR   R   (   R   t   version(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   after_upgradeÈ  s    				t   viewportc
         K   sù   t  t |  ƒ i d |	 |
  | d  j	 o |  i | ƒ n | d  j o t i i i d d ƒ |  _	 n
 | |  _	 | d  j o t i i i d d ƒ |  _
 n
 | |  _
 | |  _ | \ |  _ |  _ | \ |  _ |  _ | |  _ | |  _ d |  _ d |  _ d  S(   NR	   i   i    (   R
   Rò   R   R   R    R   R   Ró   Rô   Rõ   Rö   R÷   t   child_widtht   child_heightR`   Ra   Rø   Rù   R   R   (   R   R   t
   child_sizeR   Rõ   Rö   R÷   Rø   Rù   R	   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR   Ò  s     						c         C   s$   |  i  i |  ƒ |  i i |  ƒ d  S(   N(   Rõ   t   registerRö   (   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR½   ö  s    c         C   sç  | |  _  | |  _ |  i p | } |  i p | } t |  i | | | | ƒ } | i ƒ  \ } }	 |  i oN t | | d ƒ |  i	 _
 | |  i	 _ t |	 | d ƒ |  i _
 | |  i _ n |  i d  j	 oS t |  i t ƒ o |  i }
 n t | | d ƒ |  i }
 |
 |  i	 _ d  |  _ n |  i d  j	 oS t |  i t ƒ o |  i }
 n t |	 | d ƒ |  i }
 |
 |  i _ d  |  _ n t |  i	 i ƒ } t |  i i ƒ } | | f g |  _ t i i i | | ƒ } | i | | | f ƒ | S(   Ni    (   R   R   Rý   Rþ   R    R   RZ   R÷   Rm   Rõ   Rj   t   pageRö   R`   R   R   t   intt   valueRa   R   R   R   R   R[   (   R   R   R   R   R   Rý   Rþ   R\   R]   R^   R  t   cxot   cyoR   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR    ú  s:    		
c   
      C   sŒ  t  t |  ƒ i | | | | ƒ } | d  j	 o | Sn |  i oÅ t i i i ƒ  |  j o¬ |  i	 \ } } | | } | | }	 |  i
 i |  i
 i | ƒ |  i i |  i i |	 ƒ | | f |  _	 t i i i | d ƒ o) t i i i d  ƒ t i i i ƒ  ‚ qn d | j o |  i j  n o d | j o |  i j n p d  Sn |  i oÐ t i i i | d ƒ oM |  i i |  i i |  i i ƒ } | d  j	 o | Sq¿t i i i ƒ  ‚ n t i i i | d ƒ oM |  i i |  i i |  i i ƒ } | d  j	 o | Sq%t i i i ƒ  ‚ q)n |  i oU t i i i | d ƒ o8 | | f |  _	 t i i i |  ƒ t i i i ƒ  ‚ qˆn d  S(   Nt   viewport_drag_endi    t   viewport_upt   viewport_downt   viewport_drag_start(   R
   Rò   R6   R   Rù   R   R   Rñ   t   get_grabt   drag_positionRõ   t   changeR  Rö   Ró   t	   map_eventt   set_grabt   coret   IgnoreEventR   R   Rø   t   step(
   R   R7   R8   R9   R   R   t   oldxt   oldyt   dxt   dy(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR6   +  s@    !#

B
""
c         C   s#   | |  _  t i i i |  d ƒ d  S(   Ni    (   R`   R   R   R    RÛ   (   R   R3   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   set_xoffset\  s    	c         C   s#   | |  _  t i i i |  d ƒ d  S(   Ni    (   Ra   R   R   R    RÛ   (   R   R3   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   set_yoffset`  s    	N(   NN(   NN(   R   R   t   __version__Rû   R   R   R$   R   R½   R    R6   R  R  (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyRò   Ä  s    			1	1	c      	   K   s7   |  \ } } } } t  | d | | f d | d | | S(   NR   RJ   RK   (   Rò   (   t   rectR   R   R8   R9   Rw   Rx   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   LiveCropd  s    t   Sidec        
   B   sM   e  Z e d  d d d d d d d d g	 ƒ Z d	 „  Z d
 d „ Z d „  Z RS(   t   tlR—   t   trt   rt   brt   bt   blRƒ   R-   c         C   s   t  |  _ d  S(   N(   R$   t   sized(   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyRÕ   m  s    R   c         K   s   t  t |  ƒ i d | |  t | t ƒ o | i ƒ  } n x5 | D]- } | t i j o t d | f ƒ ‚ qC qC Wt | ƒ |  _	 t
 |  _ d  S(   NR	   s(   Side used with impossible position '%s'.(   R
   R  R   R   R×   Rì   t   possible_positionsR@   Rë   t	   positionsR$   R"  (   R   R$  R	   R   R"   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR   p  s     c            s‘  h  ‰ h  ‰ xC t  t ˆ i ˆ i ƒ ƒ D]& \ } \ } } | ˆ | <| ˆ | <q( Wˆ i p t ˆ _ ˆ i i ‰ ‡ ‡ f d †  } | d d d | ƒ \ ˆ _ } | d d d | ƒ \ ˆ _	 } | d d d | ƒ \ ˆ _
 } | d d	 d | ƒ \ ˆ _ } d
 }	 d
 }
 d
 } d
 } d
 } d
 } ‡  ‡ ‡ f d †  } | d | | d
 d
 ƒ \ } } | d | | | | ƒ \ } } | d	 | | | | ƒ \ } } | d | | |	 | ƒ \ }	 } | d | | |
 | ƒ \ }
 } | d |	 | |	 | ƒ \ }	 } | d |	 | |	 | ƒ \ }	 } | d |
 | |
 | ƒ \ }
 } | d |
 | |
 | ƒ \ }
 } | ˆ _ | ˆ _ | ˆ _ | ˆ _ |	 ˆ _ |
 ˆ _ n7 ˆ i } ˆ i } ˆ i } ˆ i } ˆ i }	 ˆ i }
 d  g t ˆ i ƒ ˆ _ ˆ i } ˆ i	 } ˆ i
 } ˆ i } t | | |	 | |
 | ƒ } t | | | | | | ƒ } t i i i |	 | | | |
 | | | | | ƒ ‰ ‡ ‡ ‡ ‡ ‡  ‡ f d †  } d
 } |	 | } |	 | | | } d
 } | | } | | | | } | d | | | | ƒ | d | | | | ƒ | d | | |
 | ƒ | d	 | | | | ƒ | d | | |	 | ƒ | d | | |	 | ƒ | d | | |
 | ƒ | d | | |
 | ƒ | d | | |	 | ƒ ˆ S(   Nc            sG   |  ˆ j p | ˆ j p | ˆ j o ˆ  | ˆ  f Sn d | f Sd  S(   Ni    (    (   t   aR   R-   t   axis(   Re   t   pos_d(    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   spacer  s    'R  Rƒ   R!  R  R  R  R—   R   i    c            si   |  ˆ j o | | f Sn t  ˆ |  | | ˆ ˆ  ƒ } t | | i ƒ t | | i ƒ f } | i ƒ  | S(   N(   R    Rm   R   R   R²   (   RW   R   R   t   owidtht   oheightR´   R   (   R   R   R'  (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyt   sizeit£  s    $
R-   c            sn   |  ˆ j o d  Sn ˆ |  } ˆ |  } t  | | | ˆ ˆ ƒ } ˆ |  i ˆ  | | | | | ƒ ˆ i | <d  S(   N(   R    R1   R   (   RW   R8   R9   Rw   Rx   R*   R"   R´   (   R   R   R   t   pos_iR   R'  (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR1   ×  s    

(   R+   RT   R$  R   R"  R   R	   Re   t
   left_spacet   right_spacet	   top_spacet   bottom_spaceRu   Rv   t   topt   bottomt   leftt   rightR   R5   R   t   minR   R   R    R   (   R   R   R   R   R   R"   RW   R*   R(  R3  R4  R1  R2  Ru   Rv   R+  t   leftst   rightst   topst   bottomsR1   t   col1t   col2t   col3t   row1t   row2t   row3(    (   R   R   R   Re   R   R,  R'  s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR    ~  sˆ     

																	


(   R   R   t   setR#  RÕ   R   R    (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR  i  s   '	t   Alphac           B   s2   e  Z d e e e d d  „ Z d „  Z d „  Z RS(   c	   
      K   se   t  t |  ƒ i |	   | |  _ | |  _ | |  _ t i i | ƒ |  _	 | |  _
 | |  _ | |  _ d  S(   N(   R
   RA  R   R†   t   endt   timeR   R'   R(   R   t   repeatt   anim_timebaset	   time_warp(
   R   R†   RB  RC  R   RD  t   bounceRE  RF  R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR   ø  s    					c         C   s
   |  i  g S(   N(   R   (   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR<     s    c         C   sS  |  i  o
 | } n | } |  i o t | |  i d ƒ } n d } t i i o
 d } nV |  i o$ | d } t i i i	 |  d ƒ n( | d j o t i i i	 |  d ƒ n |  i
 o |  i
 | ƒ } n |  i | |  i |  i } t i i i |  i | | | | ƒ } | i ƒ  \ }	 }
 t i i i |	 |
 ƒ } | i | d ƒ | | _ | S(   Ng      ð?i    (   i    i    (   RE  RC  R5  R   R   t   less_updatesRD  R   R    RÛ   RF  R†   RB  R   RZ   R   R[   t   alpha(   R   R   R   R   R   R—   t   doneRI  R´   Rw   Rx   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR      s,    






$	N(   R   R   R   R$   R   R<   R    (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyRA  ÷  s   		t   AdjustTimesc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s<   t  t |  ƒ i d d ƒ | |  _ | |  _ |  i | ƒ d  S(   NR	   R   (   R
   RK  R   R€   R   R    (   R   R   R€   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR   ,  s    		c   	      C   sæ   |  i  d  j o t i i i |  _  n |  i d  j o t i i i |  _ n t i i i |  i  } t i i i |  i } t i i i |  i	 | | | | ƒ } | i
 ƒ  \ } } t i i i | | ƒ } | i | d ƒ d g |  _ | S(   Ni    (   i    i    (   i    i    (   R€   R   R   R   R   R“   R   R   R    R   RZ   R   R[   R   (	   R   Rw   Rx   R   R   R2   R]   R^   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR    4  s    $c         C   s   |  i  i ƒ  S(   N(   R   R_   (   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyR_   H  s    (   R   R   R   R    R_   (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pyRK  *  s   		("   R   t   renpy.display.renderR    R   R   R   R  t   DisplayableR   R   RY   RU   Rd   Ry   RS   t   objectt   ObjectR®   t   dictRº   Rµ   RÓ   RÔ   Rä   Rå   Rç   Rè   Rï   Rð   Rò   R  R  RA  RK  (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\layout.pys   <module>   s2   	Œ	*D`ö	 	|	:					 	Ž3