
~YKc           @   s  d  d k  Z  d  d k Z d d g Z d d d d g Z h  Z d Z d Z d Z d Z	 d Z
 d Z d Z g  d  Z e d	 d
  e d d d g  e d d  e d d  e d d  e d d  e d d d g  e d d  e d d  e d d  d   Z d   Z e d d d d d d d d d d  Z d   Z e d e d d d  d d! e i i d" d d# d d$ d d% d d& e i i d' d d( d d) d d* d d+ e i i d, d d- e i i d. d d/ e i i d0 d d1 d d2 d d3 d d4 d d5 e d6 d d7 e i i d8 d d9 d d: d d; d d< d d= d d> d d? d d@ d dA d dB e dC d dD d dE d dF d dG d dH d dI d dJ d dK d dL d dM d dN d dO d dP d dQ e dR d dS e dT d dU d dV d dW d dX e dY d dZ d d[ d d\ d d] d d^ e d_ d d` d da d db d dc d  FZ e dd d= dD g de dU d( g df d] dX g dg dc d^ g dh d> dE g di dV d) g dj dA g dk dP g dl dI g dm g  dn d6 g do d g dp d6 g dq d g dr d5 g ds d g dt d5 g du d g dv dK g dw d1 g  Z h  Z h  Z h  Z dx a dy   Z e   h  a e  i e  a h  a  e! a" g  a# dz   Z$ d{ e% f d|     YZ& d}   Z' d~   Z( d   Z) d   Z* d   Z+ d   Z, d   Z- d e% f d     YZ. d   Z/ d   Z0 d S(   iNt	   selected_t    t   hover_t   idle_t   insensitive_t	   activate_c      
   C   s   x9 t  D]+ } | o |  i |  o | g } Pq q Wt  } x2 t D]$ } |  i |  o | g } PqC qC Wt } | | 7} g  } | D] } | D] }	 | | |	 q q ~ }
 | |
 f t |  <d  S(   N(   t   rolest
   startswitht   prefixest   endswitht   prefix_subs(   t   prefixt   priot   addprefixest   rt   alts1t   pt   alts2t   _[1]t   a1t   a2t   alts(    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   register_prefix,   s     		 		
2t   selected_activate_i   t   selected_hover_i   t   selected_idle_t   selected_insensitive_i   i   i   i   c         C   s5   |  d  j o t i i i   Sn t i i |   Sd  S(   N(   t   Nonet   renpyt   displayt   layoutt   Nullt   easyt   displayable(   t   d(    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   none_is_nullO   s    c         C   s   g  } x |  D] } t  |  d j o1 | i | d t i i | d  d d f  q | i | d t i i | d  | d | d f  q W| S(   Ni   i    i   i   (   t   lent   appendR   R    t   color(   t   lt   rvt   i(    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   expand_outlinesV   s     19t   leftg        t   rightg      ?t   centerg      ?t   topt   bottomc         C   s   t  i |  |   S(   s(   
    Turns an anchor into a number.
    (   t   anchorst   get(   t   v(    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   expand_anchorj   s    t   aft_bart
   aft_guttert	   antialiast
   backgroundt
   bar_invertt   bar_resizingt   unscrollablet   bar_verticalt   black_colort   boldt   bottom_margint   bottom_paddingt
   box_layoutt   childt   clippingR&   t   drop_shadowt   drop_shadow_colort   first_indentt   first_spacingt
   focus_maskt
   focus_rectt   fontt   fore_bart   fore_guttert
   foregroundt   soundt   italict   justifyt   languageR   t   left_margint   left_paddingt   line_spacingt   mouset	   min_widtht   outlinest   rest_indentt   right_margint   right_paddingt   sizet
   size_groupt   slow_abortablet   slow_cpst   slow_cps_multipliert   spacingt   strikethrought   subtitle_widtht   subpixelt   text_y_fudget
   text_alignt   thumbt   thumb_offsett   thumb_shadowt   time_policyt
   top_margint   top_paddingt	   underlinet   xanchort   xfillt   xmaximumt   xminimumt   xoffsett   xpost   yanchort   yfillt   ymaximumt   yminimumt   yoffsett   ypost   xmargint   ymargint   xalignt   yalignt   xpaddingt   ypaddingt   minwidtht	   textalignt
   slow_speedt   enable_hovert   left_guttert   right_guttert
   top_guttert   bottom_guttert   left_bart	   right_bart   top_bart
   bottom_bart   box_spacingt   box_first_spacingi    c          C   s  x$ t  t  D] \ }  } |  t | <q Wd a x= t D]5 } x, t D]$ } t t | | <t t t  7a qA Wq4 Wx t i	   D]s \ } \ } } x^ t i	   D]P \ } } t | } g  }	 | D] }
 |	 | | t |
 | f q ~	 t
 | | <q Wqz Wx t i   D]y } xp t D]h } x_ t d g D]P } g  } t | D]& } t
 | | | D] }
 | |
 qJq4~ t
 | | | <qWqWq Wx# d D] }  t |  t   d
 |  <qWd  S(   Ni    R   Rq   Rl   Rp   Rw   Rr   Rv   Rb   t   prop_(   s   xposs   xanchors   xoffsets   yposs   yanchors   yoffsets   subpixel(   t	   enumeratet   style_propertiest   property_numbert   property_numbersR   R   t   prefix_offsetR$   R
   t	   iteritemst
   expansionst   substitutest   keyst   globals(   R)   R   R   R   R   R   t   propt   propnt   funcR   t   at   kt   _[2]t   b(    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   init   s4         
B   V c           C   s+   h  a  h  a t i t  a t a g  a d S(   sV   
    This resets all of the data structures associated with style
    management.
    N(	   t	   style_mapt
   style_helpt   collectionst   defaultdictt   dictt   style_partst   Falset   styles_builtt   styles_pending(    (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   reset  s
    t   StyleManagerc           B   sG   e  Z d  Z d   Z d   Z d d  Z d   Z d   Z d   Z	 RS(   sS   
    This is the singleton object that is exported into the store
    as style
    c         C   s*   y t  | SWn t d |   n Xd  S(   Ns   The style %s does not exist.(   R   t	   Exception(   t   selft   name(    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   __getattr__.  s    c         C   sz   t  o t d   n t | t  o< | i d  j o | f | _ n | t | <| t | d <n t i	 |  | |  d  S(   Ns1   Cannot assign to style outside of the init phase.(    (
   R   R   t
   isinstancet   StyleR   R   R   R   t   objectt   __setattr__(   R   R   t   value(    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyR   4  s    
c         C   s/   t  | h  d t d | } t |  | |  d S(   s@  
        Creates a new style.

        @param name: The name of the new style, as a string.

        @param parent: The parent of the new style, as a string. This
        is either 'default' or something more specific.

        @param description: A description of the style, for
        documentation purposes.
        t   heavyt   helpN(   R   t   Truet   setattr(   R   R   t   parentt   descriptiont   s(    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   createB  s    c         C   s   t  i i   d  S(   N(   R   t   stylet   rebuild(   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyR   R  s    c         C   s
   | t  j S(   s<   
        This determines if the named style exists.
        (   R   (   R   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   existsU  s    c         C   sB   t  | t  p | f } n t } x | D] } | | } q* W| S(   N(   R   t   tupleR   (   R   R   R   R)   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyR1   \  s     N(
   t   __name__t
   __module__t   __doc__R   R   R   R   R   R   R1   (    (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyR   (  s   				c   
   	   C   s   g  } x |  i    D] \ } } d  } y t | } Wn# t j
 o t d |   n Xxa | D]Y \ } } } | o' | | j	 o | } | |  }	 q n | }	 | i | | |	 f  q` Wq W| i   | S(   Ns   Style property %s is unknown.(   R   R   R   t   KeyErrorR   R%   t   sort(
   t
   propertiesR(   R   t   valt   oldfunct   eR   R   R   t   newval(    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   expand_propertiesh  s$      
c         C   s|  |  i  d  j	 o d  Sn g  } |  i d  j	 o|  i } d  } x t o | d } | d } | o t | g } n g  } x_ | oW t | i | d   } | o Pn t | } | i d |  | i o | i d } q| W| o Pn | d  } q@ Wx | D] } | i o2 | i  d  j o t	 |  n | i
 | i  n xx | D]p } | i d  j o Pn | i i | d   } | d  j o Pn | i  d  j o t	 |  n | i
 | i  qFWq W| i  d  j o t	 |  n | i  }	 n d  g t }	 |  i d  j	 o t |  i  d j o t |  i d } | i  d  j o t	 |  n | i
 | i  x| |  i d d !D]f }
 | i d  j p |
 | i j o Pn | i |
 } | i  d  j o t	 |  n | i
 | i  qlWn g  |  _ } x$ |  i D] } | i
 t |   qW| p | oS |	 }	 x! | D] \ } } } | |	 | <q*Wx% | D] \ } } } | |	 | <qNWn |	 |  _  d  S(   Ni    i   i(   t   cacheR   R   R   R   R   R1   t   insertt   updatest   build_stylet   extendt   indexedR   R   R$   R   R   (   R   R   R   t	   left_baset   firstt   restt	   down_baset   sst   jR   R)   t
   my_updatesR   R   R   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyR     s    	




 
 &  
   c          C   s+   x t  D] }  t |   q Wd  a  t a d  S(   N(   R   R   R   R   R   (   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   build_styles  s
     c          C   s   t  i i o d  Sn t d  j o
 g  a n t g  }  t i   D]  } | i   D] } |  | qP q@ ~  7a t a x t D] } d  | _	 qw Wt
   d  S(   N(   R   t   gamet
   init_phaseR   R   R   t   valuesR   R   R   R   (   R   R)   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyR     s    
> c          C   sa   h  }  xT t  i   D]F \ } } x7 | i   D]) \ } } | i | i f |  | | f <q, Wq W|  S(   N(   R   R   R   R   (   R(   R   t   partsR   R2   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   backup  s      %c         C   su   g  a  t a xb |  i   D]T \ \ } } \ } } t | | i |  | t | | _ t  i t | |  q Wd  S(   N(   R   R   R   R   R   t
   set_parentR   R%   (   t   oR   R   R   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   restore   s     c   
      C   s   xB t  i   D]4 } | d  } | d  } t d  | |  | | <q WxT t i   D]F \ } } | d  } | d  } | d  }	 t | | |	  | | <qR Wt |  | |  S(   Nc         S   s   |  i  | |  d  S(   N(   R   (   R   R2   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   setter_a0  s    c         S   s   |  i  |  d  S(   N(   t   delattr(   R   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt	   deleter_a3  s    c         S   s   |  i  |  i | S(   N(   R   t   offset(   R   t   number(    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   getter_b9  s    c         S   s   |  i  | |  d  S(   N(   R   (   R   R2   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   setter_b<  s    c         S   s   |  i  |  d  S(   N(   R   (   R   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt	   deleter_b?  s    (   R   t   iterkeyst   propertyR   R   R   t   type(
   R   t   basest   attrsR   R   R   R   R   R   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   style_metaclass-  s      R   c           B   s   e  Z e Z d  d d d d d d d g Z d   Z d	   Z d
   Z d e	 d d d  Z
 d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   R   R   R   R   R   R   R   R   c         C   sI   t    } x$ |  i D] } t |  |  | | <q W| d =| d =| d =| S(   NR   R   R   (   R   t	   __slots__t   getattr(   R   R(   R)   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   __getstate__W  s    	
 c         C   s}   | i  d d   | i  d d   x* | i   D] \ } } t |  | |  q- Wd  |  _ d  |  _ t |  i |  _ t	 |   d  S(   NR   R   (
   t   popR   R   R   R   R   R   R   R   R   (   R   t   stateR   R2   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   __setstate__d  s     		c         C   so   | o[ t  | t  o | f } n t  | t  o* | i } | d  j o t d   q^ qb n | |  _ d  S(   Ns,   The parent of a style must be a named style.(   R   t
   basestringR   R   R   R   R   (   R   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyR   r  s    	c         C   s   d |  _  t d |  _ | d  j p t | t  o | |  _ n | f |  _ d  |  _ |  i |  d  |  _	 d  |  _
 d  |  _ g  |  _ | d  j	 o | t |  <n | o |  i i |  n | o& t o t |   q t i |   n d  S(   NR   (   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R%   R   R   R   (   R   R   R   R   R   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   __init__  s&    						c         C   s   | |  _  t | |  _ d  S(   N(   R   R   R   (   R   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt
   set_prefix  s    	c         C   s   |  i  i h  | | < d  S(   N(   R   R%   (   R   R   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyR     s    c         C   s0   x) |  i  D] } | | j o | | =q
 q
 Wd  S(   N(   R   (   R   R   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyR     s    
 c         C   s$   t  o t d   n
 g  |  _ d  S(   Ns2   Cannot clear a style after styles have been built.(   R   R   R   (   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   clear  s    c         C   s   | i  |  _  d  S(   N(   R   (   R   t   other(    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   take  s    c         K   s\   x: |  i  D]/ } x& | D] } | | j o | | =q q Wq
 W| o |  i  i |  n d S(   sx   
        This sets the default value of the given properties, if no more
        explicit values have been set.
        N(   R   R%   (   R   R   R   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt
   setdefault  s    
  c         C   s   |  i  d  j o h  |  _  n | |  i  j o |  i  | Sn |  i | f } t |  i | f d | d t } t p' | |  i  | <| t | d | d <n | S(   NR   R   i    i   (   R   R   R   R   R   R   R   (   R   t   indexR   R   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   __getitem__  s    #c      	   C   sc   |  i  } |  i } | | t | | t | | t | | t | | t | | t | | t f S(   N(	   R   R   t	   prop_xpost	   prop_ypost   prop_xanchort   prop_yanchort   prop_xoffsett   prop_yoffsett   prop_subpixel(   R   R   t   c(    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   get_placement  s    		N(   R   R   R   t   __metaclass__R   R   R   R   R   R   R   R   R   R   R   R   R   R   R  (    (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyR   I  s*   				!							c         C   s  d   } t  |  d  } t i   } | i   x| D]y\ } } t | t  p q5 n | | | i  I| i o | d I| | i  IJn | Jt g t	 } x; | i
 D]0 } x' t |  D] \ } }	 }
 t | |	 <q Wq Wg  } t i   D]L \ } } t i   D]3 \ } }	 | | | | i | |	 | | |	 f qq ~ } | i   xV | D]N \ } } } | o
 d } n d } | d I| Id It |  I| IJqXW| Jq5 W| i   d  S(   Nc         S   s1   |  d } x  |  d D] } | d | 7} q W| S(   Ni    i   s   [%r](    (   R   R(   R)   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt
   style_name  s
    
 t   ws   inherits froms   (inherited)R   s      t   =(   t   fileR   t   itemsR   R   R   R   R   R   R   R   R   R   R   R   R   R   t   reprt   close(   t   filenameR  t   ft   stylesR   t   styt	   inheritedR   R   R   R   R   R   t   prefixnR   t   propsR   t   inherit(    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt
   write_text  s<    	
 

  I
 
,c             s   g   h   xk t  i   D]] }  |  i d  j	 o( t  } x% |  i D] } | | } q? Wn d  }  i | g   i |   q W    f d       d  d   S(   Nc            sw   xp t   i |  g   d d   D]M } | t j o)   i | d | i d t | f  n  | | d  q" Wd  S(   Nt   keyc         S   s   |  i  S(    (   R   (   R)   (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   <lambda>-  s    s   style.i    i   (   t   sortedR1   R   R%   R   (   R   t   depthR   (   R(   t   recurset   children(    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyR  ,  s
    " )i    (   R   R   R   R   R   R%   (   R2   R   R)   (    (   R  R(   R  s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pyt   style_hierarchy  s     
 (1   R   R   R   R   R
   R   R   R   R   R   R  R  R  R   R#   R*   R   R0   R3   R    t   displayable_or_noneR&   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R  R  (    (    (    s3   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\style.pys   <module>   s$  				
														"	@		p			
			6