
56ic        "   @  s0  d  d l  m Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l	 Z	 d  d l
 Z
 d  d l Z d  d l Z d  d l Z d  d l Z e j   Z y d  d l Z Wn e Z n Xe j j d  Z e j j d  Z e j j d  Z e j j d  Z e e j j    Z e j e  e j e  e j e j e j e j e j  e j! e j" e j# e j$ e j% e j& e j' e j( e j) e j* e j+ e j, e j- e j. e j/ e j0 e j1 e j2 e j3 e j4 e j5 e j6 e j7 e j8 e j9 e e e e h" Z: d Z; d a< d	 a= d
   Z> d   Z? d   Z@ d eA f d     YZB d eA f d     YZC d eD f d     YZE d   ZF d e jG jH f d     YZI d e jG jH f d     YZJ d e jG jH f d     YZK d e jG jH f d     YZL d  d  ZM d eG f d     YZN d   ZO d ZP d  eG f d!     YZQ d S("   i(   t   print_functionNt	   TIMEEVENTt   PERIODICt   REDRAWt	   EVENTNAMEi2   g        g      ?c          C  s1   t  j j d d  }  t j   a t |   a d  S(   Nt   RENPY_TIMEWARPs   1.0(   t   ost   environt   gett   timet	   time_baset   floatt	   time_mult(   t   warp(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt	   init_timeo   s    c          C  s   t  j    }  t |  t t S(   N(   R	   R
   R   (   t   t(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   get_timey   s    c         C  s   t  j j   j j |  |  S(   sD   
    Get the displayable on the given layer with the given tag.
    (   t   renpyt   gamet   contextt   scene_listst   get_displayable_by_tag(   t   layert   tag(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   displayable_by_tag~   s    t   IgnoreEventc           B  s   e  Z d  Z RS(   so   
    Exception that is raised when we want to ignore an event, but
    also don't want to return anything.
    (   t   __name__t
   __module__t   __doc__(    (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR      s   t   EndInteractionc           B  s   e  Z d  Z d   Z RS(   s   
    Exception that can be raised (for example, during the render method of
    a displayable) to end the current interaction immediately.
    c         C  s   | |  _  d  S(   N(   t   value(   t   selfR   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   __init__   s    (   R   R   R   R    (    (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR      s   t   absolutec           B  s   e  Z d  Z g  Z RS(   s7   
    This represents an absolute float coordinate.
    (   R   R   R   t	   __slots__(    (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR!      s   c         C  s/  | \ } } } } }	 }
 } | d k r0 d } n  | d k rE d } n  | d k rZ d } n  | d k ro d } n  |	 d k r d }	 n  |
 d k r d }
 n  | j t k r | |  9} n  | j t k r | | 9} n  | |	 | } | j t k r | | 9} n  | j t k r| | 9} n  | |
 | } | | f S(   s  
    Performs the Ren'Py placement algorithm.

    `width`, `height`
        The width and height of the area the image will be
        placed in.

    `size`
        The size of the image to be placed.

    `placement`
        The tuple returned by Displayable.get_placement().
    i    N(   t   Nonet	   __class__R   (   t   widtht   heightt   swt   sht	   placementt   xpost   ypost   xanchort   yanchort   xoffsett   yoffsett	   _subpixelt   xt   y(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   place   s0    						t   DisplayableArgumentsc           B  s/   e  Z d  Z d Z d Z e Z d Z d   Z	 RS(   s[   
    Represents a set of arguments that can be passed to a duplicated
    displayable.
    c         K  s0   t    } | j j |  j  | j j |  | S(   s|   
        Returns a copy of this object with the various fields set to the
        values they were given in kwargs.
        (   R4   t   __dict__t   update(   R   t   kwargst   rv(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   copy   s    	(    (    N(
   R   R   R   t   namet   argst   Falset   consumedR#   t   prefixR9   (    (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR4      s   t   Displayablec           B  s  e  Z d  Z d# Z d# Z d Z d# Z e Z	 d# Z
 g  Z d# Z e Z e   Z e Z e Z d# e d d# d  Z d# d  Z d   Z d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z e d  Z e d  Z d   Z d   Z d   Z  d   Z! d   Z" d   Z# d   Z$ d   Z% d   Z& d   Z' e( d  Z) d   Z* d   Z+ d   Z, d   Z- d   Z. d   Z/ d# d   Z0 d!   Z1 d"   Z2 RS($   s   
    The base class for every object in Ren'Py that can be
    displayed to the screen.

    Drawables will be serialized to a savegame file. Therefore, they
    shouldn't store non-serializable things (like pygame surfaces) in
    their fields.
    t    t   defaultc         K  sF   t  j j | |  |  _ | |  _ | |  _ | d  k	 rB | |  _ n  d  S(   N(   R   t   stylet   Stylet
   focus_nameRA   R#   t   _args(   R   t   focusRA   RB   RE   t
   properties(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR    -  s
    		c         C  s+   t  j  |   } | d k	 r' | | _ n  | S(   s   
        Makes a shallow copy of the displayable. If `args` is provided,
        replaces the arguments with the stored copy.
        N(   R9   R#   RE   (   R   R;   R8   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   _copy5  s    c         C  s   |  S(   s7  
        Makes a duplicate copy of the following kids of displayables:

        * Displayables that can accept arguments.
        * Displayables that maintain state that should be reset before being
          shown to the user.
        * Containers that contain (including transitively) one of the other
          kinds of displayables.

        Displayables that contain state that can be manipulated by the user
        are never copied.

        This should call _unique on children that have been copied before
        setting its own _duplicatable flag.
        (    (   R   R;   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt
   _duplicateB  s    c         C  s   |  S(   sg   
        Returns a version of this displayable that will not change as it is
        rendered.
        (    (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   _in_current_storeU  s    c         C  s   d S(   s   
        This is called when a displayable is "born" unique, which occurs
        when there is only a single reference to it. What it does is to
        manage the _duplicatable flag - setting it false unless one of
        the displayable's children happens to be duplicatable.
        N(    (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   _unique]  s    c         C  s(   |  j  j d | d |  } |  j |  S(   s0   
        Obsolete alias for _duplicate.
        R:   R;   (   RE   R9   RI   (   R   R:   t
   parameterst   a(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   parameterizeg  s    c         C  sb   t  |   t  |  k	 r t S|  j | j k r2 t S|  j | j k rH t S|  j | j k r^ t St S(   s   
        This is a utility method that can be called by a Displayable's
        __eq__ method, to compare displayables for type and displayable
        component equality.
        (   t   typeR<   RD   RB   RA   t   True(   R   t   o(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   _equalso  s    c         C  s
   |  j  j S(   N(   R$   R   (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   __unicode__  s    c         C  s%   d j  t |   j d  t |    S(   Ns   <{} at {:x}>s   utf-8(   t   formatt   unicodet   encodet   id(   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   __repr__  s    c         C  s   |  j  p | } |  j r( | |  |  n |  j d  k	 rG | d  |  n  x6 |  j   D]( } | d  k rl qT n  | j | |  qT Wd  S(   N(   RD   t	   focusableR#   t   visitt   find_focusable(   R   t   callbackRD   t   i(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR[     s    	c         C  s:   |  j  |  j d t  | s6 t j j |  j j  n  d S(   sD   
        Called to indicate that this widget has the focus.
        t   hover_N(   t   set_style_prefixt   roleRP   R   t   exportst   playRB   t   hover_sound(   R   RA   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyRF     s    c         C  s   |  j  |  j d t  d S(   sK   
        Called to indicate that this widget has become unfocused.
        t   idle_N(   R_   R`   RP   (   R   RA   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   unfocus  s    c         C  sA   t  j j j r( t  j j j |  k	 r( d  St  j j   j j |  k S(   N(   R   t   displayRF   t   grabR   R   R   t   focused(   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt
   is_focused  s    $c         C  s@   | |  j  j k r d S|  j  j |  t j j j |  d  d S(   s   
        Called to set the style prefix of this widget and its child
        widgets, if any.

        `root` - True if this is the root of a style tree, False if this
        has been passed on to a child.
        Ni    (   RB   R>   t
   set_prefixR   Rf   t   rendert   redraw(   R   R>   t   root(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR_     s    	c         C  s   t  d   d S(   s   
        Called to display this displayable. This is called with width
        and height parameters, which give the largest width and height
        that this drawable can be drawn to without overflowing some
        bounding box. It's also given two times. It returns a Surface
        that is the current image of this drawable.

        @param st: The time since this widget was first shown, in seconds.
        @param at: The time since a similarly named widget was first shown,
        in seconds.
        s   Render not implemented.N(   t	   Exception(   R   R%   R&   t   stt   at(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyRk     s    c         C  s   d S(   s  
        Called to report than an event has occured. Ev is the raw
        pygame event object representing that event. If the event
        involves the mouse, x and y are the translation of the event
        into the coordinates of this displayable. st is the time this
        widget has been shown for.

        @returns A value that should be returned from Interact, or None if
        no value is appropriate.
        N(   R#   (   R   t   evR1   R2   Ro   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   event  s    c         C  s   |  j  j   S(   s   
        Returns a style object containing placement information for
        this Displayable. Children are expected to overload this
        to return something more sensible.
        (   RB   t   get_placement(   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyRs     s    c         C  s>   x- |  j    D] } | s q n  | j |  q W| |   d S(   so   
        Calls the callback on this displayable, and then on all children
        of this displayable.
        N(   RZ   t	   visit_all(   R   R\   t   d(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyRt     s
    c         C  s   g  S(   s   
        Called to ask the displayable to return a list of its children
        (including children taken from styles). For convenience, this
        list may also include None values.
        (    (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyRZ     s    c         C  s   d S(   s9   
        Called once per widget per interaction.
        N(   R#   (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   per_interact  s    c         C  s   d S(   sv   
        Called to ask this displayable to call the callback with all
        the images it may want to load.
        N(    (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   predict_one  s    c         C  s   d S(   s   
        Called to ask this displayable to cause image prediction
        to occur for images that may be loaded by its actions.
        N(    (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   predict_one_action  s    c         C  s   |  j    } | d }	 t | | | j | j |  \ }
 } |
 | 7}
 | | 7} |
 | f } | d k	 r |	 r | j | | | | d  q | j | | | | d  n  | S(   s  
        This places a render (which must be of this displayable)
        within a bounding area. Returns an (x, y) tuple giving the location
        the displayable was placed at.

        `dest`
            If not None, the `surf` will be blitted to `dest` at the
            computed coordinates.

        `x`, `y`, `width`, `height`
            The bounding area.

        `surf`
            The render to place.

        `main`
            This is passed to Render.blit().
        i   N(   Rs   R3   R%   R&   R#   t   subpixel_blitt   blit(   R   t   destR1   R2   R%   R&   t   surft   mainR)   t   subpixelR*   R+   t   pos(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR3     s    
$

c         C  sB   | |  j  k r d S| |  _  |  j r> t j j j |  d  n  d S(   sH   
        Sets the transform event of this displayable to event.
        Ni    (   t   transform_eventt   transform_event_responderR   Rf   Rk   Rl   (   R   Rr   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   set_transform_event9  s
    		c         C  s   d S(   s   
        Returns None if this displayable is ready to be hidden, or
        a replacement displayable if it doesn't want to be hidden
        quite yet. Kind is either "hide" or "replaced".
        N(   R#   (   R   Ro   Rp   t   kind(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   _hideF  s    c         C  s   d S(   sG   
        Called when the displayable is added to a scene list.
        N(    (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   _showO  s    c         C  s   |  S(   s   
        If this displayable is part of a chain of one or more references,
        returns the ultimate target of those references. Otherwise, returns
        the displayable.
        (    (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   _targetT  s    c         C  s   | S(   s   
        If this is a transform, makes a copy of the transform and sets
        the child of the innermost transform to this. Otherwise,
        simply returns child.
        (    (   R   t   child(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   _change_transform_child]  s    c         C  s   d S(   sF   
        Clears out the children of this displayable, if any.
        N(    (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   _clearf  s    c         C  s   g  } xK |  j    D]= } | d  k	 r | j   } | j   rP | j |  qP q q Wd j |  } | j d d  } | j d d  } |  j j } | d  k r | } n  | d  k	 r t	 j
 j | d i | d 6d } n  | S(   Ns   : s   ::t   :s   : :t   scopet   texti    (   RZ   R#   t   _ttst   stript   appendt   joint   replaceRB   t   altR   t   substitutionst
   substitute(   R   t   default_altR8   R]   t   speechR   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   _tts_commonm  s    	&c         C  s
   |  j    S(   s   
        Returns the self-voicing text of this displayable and all of its
        children that cannot take focus. If the displayable can take focus,
        returns the empty string.
        (   R   (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR     s    c         C  s
   |  j    S(   s{   
        Returns the self-voicing text of this displayable and all of its
        children that cannot take focus.
        (   R   (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   _tts_all  s    N(3   R   R   R   R#   RY   t   full_focus_nameR`   R   R<   R   t   _maint   _composite_partst	   _locationt   _uses_scopeR4   RE   t   _duplicatablet	   _clippingR    RH   RI   RJ   RK   RN   RR   RS   RX   R[   RF   Re   Ri   R_   Rk   Rr   Rs   Rt   RZ   Rv   Rw   Rx   RP   R3   R   R   R   R   R   R   R   R   R   (    (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR?      sZ   				
					
												&											t   SceneListEntryc           B  sD   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   s   
    Represents a scene list entry. Since this was replacing a tuple,
    it should be treated as immutable after its initial creation.
    c         C  s:   | |  _  | |  _ | |  _ | |  _ | |  _ | |  _ d  S(   N(   R   t   zordert	   show_timet   animation_timet   displayableR:   (   R   R   R   R   R   R   R:   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR      s    					c         C  s(   t  |  j |  j |  j |  j |  j f  S(   N(   t   iterR   R   R   R   R   (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   __iter__  s    c         C  s&   |  j  |  j |  j |  j |  j f | S(   N(   R   R   R   R   R   (   R   t   index(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   __getitem__  s    c         C  s   d |  j  |  j |  j f S(   Ns   <SLE: %r %r %r>(   R   R:   R   (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyRX     s    c         C  s+   t  |  j |  j |  j |  j |  j |  j  S(   N(   R   R   R   R   R   R   R:   (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR9     s    c         C  s[   |  } |  j  d  k s$ |  j d  k rW |  j   } | j  p< | | _  | j pN | | _ n  | S(   N(   R   R#   R   R9   (   R   R	   R8   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   update_time  s    (	   R   R   R   R    R   R   RX   R9   R   (    (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR     s   						t
   SceneListsc        
   B  s
  e  Z d  Z d Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d d	 g  g  d d d e e d
 	 Z d   Z d   Z d   Z d   Z e d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   sd   
    This stores the current scene lists that are being used to display
    things to the user.
    i   c         C  sd   x] t  j j t  j j D]E } | |  j k r g  |  j | <i  |  j | <d  g  f |  j | <q q Wd  S(   N(   R   t   configt   layerst
   top_layerst   at_listR#   t   layer_at_list(   R   R]   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   after_setstate  s
    c         C  s  | d k  rb i  |  _  i  |  _ xA t j j t j j D]& } i  |  j  | <d  g  f |  j | <q5 Wn  | d k  rz t |  _ n  | d k  r xB |  j D]7 } g  |  j | D] } t	 | d   ^ q |  j | <q Wg  |  _
 n  | d k  r d  |  _ n  | d k  r
|  j |  _ n  d  S(   Ni   i   i   i   i   (   N(   R   R   R   R   R   R   R#   R<   t   shown_windowR   t   additional_transientt
   drag_groupt   image_predict_infot   shown(   R   t   versionR]   t   k(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   after_upgrade  s     		5c         C  s  t  t |   j   t |  _ i  |  _ i  |  _ i  |  _ | |  _ g  |  _	 d  |  _ | rYx t j j t j j D] } y | j | |  j | <Wn t k
 r g  |  j | <n X| | j k r | j | j   |  j | <| j | |  j | <qo i  |  j | <d  g  f |  j | <qo Wx! t j j D] } |  j |  q W|  j   d  |  _ | j |  _ n` xK t j j t j j D]3 } g  |  j | <i  |  j | <d  g  f |  j | <qpWd  |  _ d  |  _ d  S(   N(   t   superR   R    R<   R   R   R   R   R   R   R#   R   R   R   R   t   KeyErrorR9   t   overlay_layerst   cleart   replace_transientRh   t   music(   R   t   oldslR   R]   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR      s<    							
		c         C  s^   x$ t  j j D] } |  j | t  q Wx' |  j D] \ } } |  j | |  q1 Wg  |  _ d S(   s   
        Replaces the contents of the transient display list with
        a copy of the master display list. This is used after a
        scene is displayed to get rid of transitions and interface
        elements.
        N(   R   R   t   transient_layersR   RP   R   t   remove(   R   R]   R   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR   *  s
    c         C  s,   x% t  j j D] } |  j | r t Sq Wt S(   s2  
        This returns True if all transient layers are empty. This is
        used by the rollback code, as we can't start a new rollback
        if there is something in a transient layer (as things in the
        transient layer may contain objects that cannot be pickled,
        like lambdas.)
        (   R   R   R   R   R<   RP   (   R   R]   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   transient_is_empty:  s    	c         C  s   | d k r | St | t j j j  r, | S| j   } t | t j j j  sT | S| j   } t | t j j j  s t j j j d |  } } n  | j	 |  | S(   sr   
        If the old thing is a transform, then move the state of that transform
        to the new thing.
        R   N(
   R#   t
   isinstanceR   Rf   t   screent   ScreenDisplayableR   t   motiont	   Transformt
   take_state(   R   t	   old_thingt	   new_thingt   old_transformt   new_transform(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   transform_stateI  s    c   	      C  sj  d } d } xx t |  j |  D]c \ } } | d k r  | j rP | j | k s_ | j | k r | } | d k r | j } q q q  q  W| d k r t j j j	 | d  } n  x t |  j |  D]u \ } } | d k r | j | k r| j r4| j | k s| j | k r4| } q4q7| j | k r7| } q7q q W| d k r]t
 |  j |  } n  | | | f S(   sk  
        This finds the spot in the named layer where we should insert the
        displayable. It returns two things: an index at which the new thing
        should be added, and an index at which the old thing should be hidden.
        (Note that the indexes are relative to the current state of the list,
        which may change on an add or remove.)
        i    N(   R#   t	   enumerateR   R   R   R   R   R   t
   tag_zorderR   t   len(	   R   R   R   R   t   behindt	   add_indext   remove_indexR]   t   sle(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt
   find_indexa  s(    	 ' 'i    c         C  su  t  | t  s( t d t |    n  | |  j k rJ t d |   n  | rt |  j | |  | |  j | | <n  | r | r |  j j | |  n  |
 r |  j	 j
 | | f  n  |  j | } | r t j j j | d | } n  |  j | | | |  \ } } } d } d } | d k	 r| | } | j } | j } | rM| j } n  | r| rt j j rt  | t j j j  r| j j |  } n |  j | | j |  } | j d  | j   nD t  | t j j j  s|  j |	 |  } n  | j d  | j   t | | | | | |  } | j | |  | d k	 rq| | k r[| d 7} n  |  j | | d  n  d S(	   s  
        Adds something to this scene list. Some of these names are quite a bit
        out of date.

        `thing` - The displayable to add.

        `key` - A string giving the tag associated with this thing.

        `zorder` - Where to place this thing in the zorder, an integer
        A greater value means closer to the user.

        `behind` - A list of tags to place the thing behind.

        `at_list` - The at_list associated with this
        displayable. Counterintunitively, this is not actually
        applied, but merely stored for future use.

        `name` - The full name of the image being displayed. This is used for
        image lookup.

        `atl` - If not None, an atl block applied to the thing. (This actually is
        applied here.)

        `default_transform` - The default transform that is used to initialized
        the values in the other transforms.

        `keep_st`
            If true, we preserve the shown time of a replaced displayable.
        s6   Attempting to show something that isn't a displayable:s3   Trying to add something to non-existent layer '%s'.R   R   t   showi   t   replacedN(   R   R?   Rn   t   reprR   t   remove_hide_replacedR   R   t   predict_showR   R   R   Rf   R   t   ATLTransformR   R#   R   R   R   R   t   keep_running_transformR   R   R   R   R   R   t   insertt   hide_or_replace(   R   R   t   thingt   keyR   R   R   R:   t   atlt   default_transformt	   transientt   keep_stt   lR   R   Rp   Ro   R   t   old(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   add  sR    *!
		
c         C  s   | d k r d S|  j | } | | } t   } | j p< | } | j pK | } | j r | j j | | | | |  }	 | j |  } |	 d k	 r t	 | d | j | j
 | | |	 d  }
 |
 | | <d Sn  | j |  d S(   s   
        Hides or replaces the scene list entry at the given
        index. `prefix` is a prefix that is used if the entry
        decides it doesn't want to be hidden quite yet.
        Nt   $(   R#   R   R   R   R   R   R   R   R   R   R   t   pop(   R   R   R   R>   R   t   oldslet   nowRo   Rp   Ru   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR     s*    
		 	
c         C  sE   g  } x8 |  j  j   D]' } x | D] } | j | j  q# Wq W| S(   sG   
        Gets all displayables reachable from this scene list.
        (   R   t
   itervaluesR   R   (   R   R8   R   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   get_all_displayables  s
    c         C  s   x t  t t |  j |    D]s } |  j | | } | rb | j | k s[ | j | k rb Pqb n  | j r d | j k r q  n  |  j | | d  q  Wd S(   s   
        Removes everything on the layer that is closer to the user
        than thing, which may be either a tag or a displayable. Thing must
        be displayed, or everything will be removed.
        R   t   hideN(   t   reversedt   xrangeR   R   R   R   R   (   R   R   R   R]   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   remove_above)  s    &c         C  s   | |  j  k r" t d |   n  |  j | | d g   \ } } } | d k	 r |  j  | | j } | r |  j j | | f  |  j | j | d  n  |  j	 | | d  n  d S(   s9  
        Thing is either a key or a displayable. This iterates through the
        named layer, searching for entries matching the thing.
        When they are found, they are removed from the displaylist.

        It's not an error to remove something that isn't in the layer in
        the first place.
        s8   Trying to remove something from non-existent layer '%s'.i    R   N(
   R   Rn   R   R#   R   R   t   predict_hideR   R   R   (   R   R   R   t
   _add_indexR   t   _zorderR   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR   =  s    
!c         C  s   | |  j  k r d S| s) g  |  j  | <n= x: t t t |  j  |    D] } |  j | | |  qI W|  j | j   |  j j |  d g  f |  j
 | <d S(   s   
        Clears the named layer, making it empty.

        If hide is True, then objects are hidden. Otherwise, they are
        totally wiped out.
        N(   R   R   R   R   R   R   R   R   t   predict_sceneR#   R   (   R   R   R   R]   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR   U  s    &c         C  s   d  t |  f |  j | <d  S(   N(   R#   t   listR   (   R   R   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   set_layer_at_listn  s    c         C  s   x< |  j  j   D]+ \ } \ } } | p+ | | f |  j  | <q WxF |  j j   D]5 \ } } g  | D] } | j |  ^ qb |  j | <qO Wd S(   sm   
        This finds entries with a time of None, and replaces that
        time with the given time.
        N(   R   t   itemsR   t	   iteritemsR   (   R   R	   R   R   R   t   llR]   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt	   set_timesq  s    "c         C  s   |  j  j | |  S(   sq   
        Returns true if something with the prefix of the given name
        is found in the scene list.
        (   R   t   showing(   R   R   R:   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR   }  s    c         C  s   |  j  j |  S(   N(   R   t   get_showing_tags(   R   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR     s    c         C  s   t  j j j d d d | |  } | j |  j |  | | _ t | _ |  j	 | \ } } | r xD | D]< } t
 | t  j j j  r | d |  } qg | |  } qg Wt  j j j d d  } | j | | |  | | _ | } n  | S(   sK   
        Creates a Fixed with the given layer name and scene_list.
        t   layoutt   fixedRF   R   (   R   Rf   R   t   MultiBoxt   append_scene_listR   t
   layer_nameR<   R   R   R   R   R   R   (   R   R   RG   R8   R	   R   RM   t   f(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt
   make_layer  s    !				c         C  sc   d | } d | } |  j  | } g  | D]* } | j | k r( | j | k r( | ^ q( |  j  | <d S(   s^   
        Removes things that are hiding or replaced, that have the given
        tag.
        s   hide$s	   replaced$N(   R   R   (   R   R   R   t   hide_tagt   replaced_tagR   R]   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR     s    

c         C  s   t    } x |  j D] } g  } x |  j | D] } | j r | j j d  r | j j | | j | | j d  } | s q- q q | j j d  r | j j | | j | | j d  } | s q- q q n  | j |  q- W| |  j | <q Wd S(   s   
        Goes through all of the layers, and removes things that are
        hidden and are no longer being kept alive by their hide
        methods.
        s   hide$R   s	   replaced$R   N(	   R   R   R   t
   startswithR   R   R   R   R   (   R   R   R   t   newlR   Ru   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   remove_hidden  s    		&	&c         C  sq   xj |  j  D]_ } g  } xC |  j  | D]4 } | j rK d | j k rK q$ qK n  | j |  q$ W| |  j  | <q
 Wd S(   sk   
        Removes everything hidden, even if it's not time yet. (Used when making a rollback copy).
        R   N(   R   R   R   (   R   R   R  R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   remove_all_hidden  s    		c         C  sT   | |  j  k r" t d |   n  x+ |  j  | D] } | j | k r0 | j Sq0 Wd S(   s   
        Returns the displayable on the layer with the given tag, or None
        if no such displayable exists. Note that this will usually return
        a Transform.
        s   Unknown layer %r.N(   R   Rn   R   R   R#   (   R   R   R   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR     s    c         C  sT   | |  j  k r" t d |   n  x+ |  j  | D] } | j | k r0 | j Sq0 Wd S(   s   
        Returns the displayable on the layer with the given name, or None
        if no such displayable exists. Note that this will usually return
        a Transform.
        s   Unknown layer %r.N(   R   Rn   R:   R   R#   (   R   R   R:   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   get_displayable_by_name  s    c         C  s  | |  j  k r" t d |   n  x, |  j  | D] } | j | k r0 Pq0 q0 Wd St   } | j d k	 ry | | j } n d } | j d k	 r | | j } n d } t j j	 j	 | j
 | | | |  }	 |	 j }
 |	 j } t | | |
 | | j
 j    \ } } |	 j   | | |
 | f S(   s6   
        Implements renpy.get_image_bounds().
        s   Unknown layer %r.i    N(   R   Rn   R   R#   R   R   R   R   Rf   Rk   R   R%   R&   R3   Rs   t   kill(   R   R   R   R%   R&   R   R   Ro   Rp   R|   R'   R(   R1   R2   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   get_image_bounds  s&    	$		'
N(   R   R   R   t   __version__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  (    (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR     sD   			>				+_	*													c         C  s   t  j j |   j S(   sj   
    Returns either the current scenelists object, or the one for the
    context at the given index.
    (   R   R   R   R   (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR   (  s    t	   MouseMovec           B  s    e  Z d  Z d   Z d   Z RS(   sA   
    This contains information about the current mouse move.
    c         C  sa   t    |  _ | d  k	 r$ | |  _ n	 d |  _ t j j j   \ |  _ |  _	 | |  _
 | |  _ d  S(   Ni    (   R   t   startR#   t   durationR   Rf   t   drawt   get_mouse_post   start_xt   start_yt   end_xt   end_y(   R   R1   R2   R  (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR    6  s    		c         C  s   t    |  j } | |  j k r? t j j j |  j |  j  t	 Sd | |  j } t
 |  j | |  j |  j  } t
 |  j | |  j |  j  } t j j j | |  t S(   s   
        Performs the mouse move. Returns True if this should be called
        again, or False if the move has finished.
        g      ?(   R   R  R  R   Rf   R  t   set_mouse_posR  R  R<   t   intR  R  RP   (   R   t   elapsedt   doneR1   R2   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   performC  s    !!(   R   R   R   R    R  (    (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR  1  s   	c          C  sx   t  j r t Sy\ t  j rd d d l }  d } |  j |  j j j _	 |  j j j |  d @r] t
 St Sn  t SWn t SXd S(   s6   
    Returns true if we should go into safe mode.
    iNi   i   (   R   t   safe_mode_checkedR<   t   windowst   ctypest   c_ushortt   windllt   user32t   GetKeyStatet   restypeRP   (   R  t   VK_SHIFT(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   get_safe_modeX  s    		t	   Interfacec           B  s  e  Z d  Z d   Z d   Z d   Z d   Z d   Z e d  Z	 d   Z
 d   Z d	   Z d
   Z e d  Z d   Z e d  Z d   Z d   Z d   Z d   Z d   Z e d  Z e d  Z e e d  Z d   Z d   Z d   Z d   Z d   Z d   Z  d   Z! d   Z" d   Z# d   Z$ d    Z% d!   Z& d"   Z' d#   Z( d$   Z) d%   Z* d&   Z+ d'   Z, e e e d(  Z- e e e e d) g  e d*  Z. d+   Z/ d,   Z0 RS(-   sN  
    This represents the user interface that interacts with the user.
    It manages the Display objects that display things to the user, and
    also handles accepting and responding to user input.

    @ivar display: The display that we used to display the screen.

    @ivar profile_time: The time of the last profiling.

    @ivar screenshot: A screenshot, or None if no screenshot has been
    taken.

    @ivar old_scene: The last thing that was displayed to the screen.

    @ivar transition: A map from layer name to the transition that will
    be applied the next time interact restarts.

    @ivar transition_time: A map from layer name to the time the transition
    involving that layer started.

    @ivar transition_from: A map from layer name to the scene that we're
    transitioning from on that layer.

    @ivar suppress_transition: If True, then the next transition will not
    happen.

    @ivar force_redraw: If True, a redraw is forced.

    @ivar restart_interaction: If True, the current interaction will
    be restarted.

    @ivar pushed_event: If not None, an event that was pushed back
    onto the stack.

    @ivar mouse: The name of the mouse cursor to use during the current
    interaction.

    @ivar ticks: The number of 20hz ticks.

    @ivar frame_time: The time at which we began drawing this frame.

    @ivar interact_time: The time of the start of the first frame of the current interact_core.

    @ivar time_event: A singleton ignored event.

    @ivar event_time: The time of the current event.

    @ivar timeout_time: The time at which the timeout will occur.
    c         C  s  d  |  _ d  |  _ i  |  _ i  |  _ i  |  _ i  |  _ i  |  _ t |  _	 t |  _
 t |  _ t |  _ d  |  _ d |  _ d |  _ d  |  _ d  |  _ d  |  _ d  |  _ g  |  _ d |  _ d  |  _ d |  _ t |  _ t j j t  |  _ t j j t  |  _ t  |  _! t  |  _" i  |  _# t |  _$ t |  _% t |  _& x t' j( j) t' j( j* D] } | t' j( j+ k rt' j( j+ | \ } } } } t, d | d d d | d d d | d | d	 | d
 | d t   	|  j# | <qFt,   |  j# | <qFWg  |  _- d |  _. d  |  _/ t  |  _0 t |  _1 d  |  _2 t3 j4   |  _5 t' j6 j6 j7   y t j8 j7   Wn n Xt9   t:   |  _; t:   |  _/ d  |  _< |  t' j= _> |  t' j8 _> t |  _? t |  _@ t3 j   |  _A d  |  _B d  |  _C d  |  _D d  |  _E d  |  _F t' jG jH d  |  _I t  |  _ t' j( jJ rt' j( jK jL t' j( jJ  n  t' j8 jM jN   t |  _O t |  _P tQ   |  _? t  t' _R |  jS   |  _T t' j8 jU jV d |  jT  d |  _W |  jX tY  t  |  _Z d  S(   Ni    RA   R*   R,   R+   R-   t   xmaximumt   ymaximumt   xminimumt   yminimumt   clippingt   touchs   DPI scale factor: %fg        ([   R#   t
   screenshott   screenshot_surfacet	   old_scenet
   transitiont   ongoing_transitiont   transition_timet   transition_fromR<   t   suppress_transitiont
   quick_quitt   force_redrawt   restart_interactiont   pushed_eventt   tickst   mouset   timeout_timet
   last_eventt   current_contextt   roll_forwardt   preloadst
   frame_timet   interact_timet	   quit_timet   in_quit_eventt   pygameRr   t   EventR   t
   time_eventR   t   redraw_eventRP   t   mouse_focusedt   keyboard_focusedt   layer_propertiesR   t
   fullscreent   ignore_touchR   R   R   R   t   layer_clippingt   dictt   transition_info_stackt
   event_timet   mouse_event_timet
   show_mouset   display_resett   last_resizet	   threadingt   current_threadt   threadt   audiot   initRf   R   R   t   profile_timet   window_captionR   t	   interfacet	   safe_modet   bgscreenshot_neededt   bgscreenshot_eventt   bgscreenshot_surfacet
   mouse_movet   text_editingt	   text_rectt   old_text_rectRa   t   variantR-  t   periodic_callbackt   periodic_callbacksR   t   emulatort   init_emulatort   startedt   fullscreen_videoR&  R  t   setup_dpi_scalingt	   dpi_scalet   logt   writet   maximum_framerate_timet   maximum_frameratet   initial_maximum_frameratet   start_interact(   R   R   R1   R2   t   wt   h(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR      s    																																																c   
      C  se  d t  j k r  t t  j d  St j s- d Syd d  l } d d l m } m } | j j	 j
   | j j	 j } | | _ | g | _ | j j	 j } | | g | _ | j j j } | | _ | | g | _ d } | d   } | | |  d }	 | d  |  |	 t j j k  r.t j j j d |	  d }	 n  |	 SWn+ t j j j d  t j j j   d SXd  S(	   Nt   RENPY_HIGHDPIg      ?i(   t   c_void_pt   c_intiX   g      X@s   De minimus DPI scale, was %rs%   Could not determine DPI scale factor:(   R   R   R   R   R  R  Rx  Ry  R!  R"  t   SetProcessDPIAwaret   GetDCR$  t   argtypest	   ReleaseDCt   gdi32t   GetDeviceCapsR#   R   t   de_minimus_dpi_scaleRf   Ro  Rp  t	   exception(
   R   R  Rx  Ry  R{  R}  R  t
   LOGPIXELSXt   dcR8   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyRm  [  s8    				c         C  s   |  j  r d St j j j   t j j j   t j j d  t	 |  _  |  j
   t j j j   t j j t t  t j j t  |  j s t j j j   n  d j t j   t  } t j j j |  t j r t j j r t  |  n  d S(   sQ   
        Starts the interface, by opening a window and setting the mode.
        Ns   Interface starts%   Total time until interface ready: {}s(!   Rk  R   Rf   Rk   t   render_readyt	   presplasht   endR}   t	   log_clockRP   t   set_modeR   t   fontt   load_image_fontsRE  R	   t	   set_timerR   t   PERIODIC_INTERVALRr   t   set_grabR<   R^  t
   controllerRZ  RT   t   import_timeRo  Rp  t   androidR   t   log_to_stdoutt   print(   R   t   s(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR    s     		
	c         C  s  t  j j p" t j j t j d  } | j d  t j	 d <|  j
 d t  |  j   t  j j d k	 r t  j j \ } } t j j t d |  t d |   n  t r t j t  n  xQ t j j   D]@ } | t k r q n  | t  j j k r q n  t j j |  q Wd S(   sV   
        This is called after display init, but before the window is created.
        i    s   utf-8t   SDL_VIDEO_X11_WMCLASSt   forcei  N(   R   R   t   save_directoryR   t   patht   basenamet   syst   argvRV   R   t   set_window_captionRP   t   set_icont
   key_repeatR#   RE  R   t
   set_repeatR  R  t   wakelockRr   t   get_standard_eventst   enabled_eventst   pygame_eventst   set_blocked(   R   t   wmclasst   delayt   repeat_delayR]   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt	   post_init  s    %
*c         C  s   t  j j } | r t  j j j t  j j |  |  } | j   \ } } t	 | |  } t  j j
 j | | f t  } | j | | | d | | d f  | } t j j |  n  d S(   s;   
        This is called to set up the window icon.
        i   N(   R   R   t   window_iconRf   t   scalet   image_load_unscaledt   loadert   loadt   get_sizet   maxt   pgrendert   surface_unscaledRP   Rz   RE  R  (   R   t   icont   imt   iwt   iht   imaxt	   square_im(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR    s    	&c         C  s   t  j j } | d  k r! d } n  t  j j |  t  j j } t  j j	   rY | d 7} n  | rs | |  j
 k rs d  S| |  _
 t j j | j d   d  S(   Ns   A Ren'Py Games    - autoreloads   utf-8(   R   R   t   window_titleR#   t   translationt   translate_stringt   storet   _window_subtitleRa   t   get_autoreloadR\  RE  Rf   t   set_captionRV   (   R   R  R  t   caption(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR    s    		c         C  s   t  j j   d  S(   N(   RE  Rf   t   iconify(   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR    s    c           s  t  j j j } t j j d |  } |  j r6 d } n  | t  j _ | d k rx t  j	 ri d d d g  q d d g  n | d g  i       f d   } t  j	 r | d d d  } n t
 } | d d	 d |  | d d
 d  g      f d   } x  D] } | |  qW S(   sC   
        Figures out the list of draw constructors to try.
        t   RENPY_RENDERERR'   t   autot   glt   anglec           s   |   k r t  Sy> t |  t j | } t | |  } | |     |  <t SWn4 t j j j	 d j
 |    t j j j   t  SXd  S(   Ns   Couldn't import {0} renderer:(   R<   t
   __import__R  t   modulest   getattrRP   R   Rf   Ro  Rp  RT   R  (   R:   t   modt   clsR;   t   modulet
   draw_class(   t   draw_objectst	   renderers(    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt	   make_draw  s    
s   renpy.angle.gldrawt   GLDraws   renpy.gl.gldraws   renpy.display.swdrawt   SWDrawc           s@   |    k r   j    |   n t j j j d j |    d  S(   Ns   Unknown renderer: {0}(   R   R   Rf   Ro  Rp  RT   (   R:   (   R  R8   (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   append_draw(  s    (   R   R   t   preferencest   rendererR   R   R   R^  R   R  R<   (   R   R  R  t	   has_angleR  R]   (    (   R  R  R8   sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   get_draw_constructors  s,    				c         C  s$   t  j j j   t  j j j   d  S(   N(   R   Rf   Rk   t   free_memoryR   t   layout_cache_clear(   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   kill_textures3  s    c         C  s0   |  j    t j j j j   d t j j _ d S(   sA   
        Kill all textures and surfaces that are loaded.
        N(	   R  R   Rf   R  t   cacheR   R#   R  t   bo_cache(   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   kill_textures_and_surfaces7  s    
c         C  s  t  j j r> t  j j j d d k r> t  j j j d t  n  |  j rt j	 j
   t j	 j d  d |  _ t  j j j   t  j j j d d k r t  j j j   t j j   n  t  j j j   t  j j j j   t  j j j   d t  j j _ |  j   n  d |  _ t |  _ t  j j t  j j f } | d k rtt  j sYt  j j  j! d k rbd } qtt  j j  j! } n  t  j j  j" } |  j" } | |  _" t# j$ j% d t  rt } t  j j  j" |  _" n  t  j j rt  j j g } n |  j&   } xN | D]+ } | j' | | |  r| t  j _ PqqWt t  j j  _" t( d   t  j j) rx| rx| rxt  j j j*   t  j j  _! n  t+ rt+ j,   n  t- |  _. t- |  _/ t- |  _0 t |  _1 t- |  _2 t |  _3 d S(	   sJ   
        This sets the video mode. It also picks the draw object.
        R  R'   R   R  t   RENPY_DISABLE_FULLSCREENs   Could not set video mode.N(   NN(4   R   Rf   R  t   infot   videot
   movie_stopR<   RT  RE  R   t   stop_text_inputt   set_text_input_rectR#   Rd  t   deinitt   quitRk   R  R  R  R   R   R  R  R  R  Re  R   t   screen_widtht   screen_heightt   mobileR   R  t   physical_sizeRL  R   R   R   R  R  Rn   t   save_physical_sizet   get_physical_sizeR  RZ  RP   R7  RI  RJ  t	   minimizedR8  t   profile_once(   R   R  t   virtual_sizeRL  t   old_fullscreent   drawsR  (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR  A  s`    %												c         C  s|   t  j j j | t  j j t  j j  } | rF t  j j j | |  n  t  j j j	   t  j j
 j   | |  _ | |  _ d  S(   N(   R   Rf   Rk   t   render_screenR   R  R  R  t   draw_screent
   mark_sweepRF   t   take_focusest   surftreeRl  (   R   t   root_widgetRl  R  R  (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR    s    		c         C  s   |  j  s d S| r_ |  j j   t |  _ |  j j d  sJ t d   n  |  j } d |  _ n t	 j
 j j |  j |  j  } t	 j
 j j | |  } t	 j
 j j |  | |  _ t j   } t	 j
 j j | | d  | j   |  _ | j   d S(   s  
        This takes a screenshot of the current screen, and stores it so
        that it can gotten using get_screenshot()

        `background`
           If true, we're in a background thread. So queue the request
           until it can be handled by the main thread.
        Ng      ?s   Screenshot timed out.i    (   Rk  R`  R   RP   R_  t   waitRn   Ra  R#   R   Rf   R  R.  R  Rl  R  t   smoothscaleRk   t   mutated_surfaceR/  t	   cStringIOt   StringIOR  t   save_pngt   getvaluet   close(   R   R  t
   backgroundR|   t   sio(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   take_screenshot  s"    				c         C  sG   |  j  rC t |  _  t j j j |  j |  j  |  _ |  j	 j
   n  d S(   s?   
        Handles requests for a background screenshot.
        N(   R_  R<   R   Rf   R  R.  R  Rl  Ra  R`  t   set(   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   check_background_screenshot  s    		!c         C  ss   |  j  s |  j   n  |  j } | so |  j t j j t j j f d t j	   |  j
 k	 |  j } |  j   n  | S(   su   
        Gets the current screenshot, as a string. Returns None if there isn't
        a current screenshot.
        R  (   Rk  R  R.  R  R   R   t   thumbnail_widtht   thumbnail_heightRV  RW  RX  t   lose_screenshot(   R   R8   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   get_screenshot  s    			c         C  s   d |  _ d |  _ d S(   s8   
        This deallocates the saved screenshot.
        N(   R#   R.  R/  (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR    s    	c         C  s|   t  j j j |  j |  j  } t  j j rB | j t  j j  } n  y t  j j	 j
 | |  Wn t  j j rx   qx n Xd S(   sE   
        Saves a full-size screenshot in the given filename.
        N(   R   Rf   R  R.  R  Rl  R   t   screenshot_cropt
   subsurfaceR  t   image_save_unscaledt   debug(   R   t   filenamet   window(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   save_screenshot  s    c         C  s   t  j j s d  St  j j j s# d  St  j j   j j r< d  St  j	 j
 r t  j j } t t  j _ z t  j	 j
   Wd  | t  j _ Xn  d  S(   N(   R   R  t   _windowR   R  t   show_empty_windowR   R   R   R   t   empty_windowt   _historyR<   (   R   t   old_history(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   show_window  s    c      	   C  s|   t  j j r$ t  j j | |  } n  | s4 |  j rB |  j   t S|  j |  |  j d t d t  j j	 d d d |  Sd  S(   Nt   trans_pauset   suppress_overlayR;  t   withR   (
   R   R   t   with_callbackR5  t	   with_noneR<   t   set_transitiont   interactRP   t   overlay_during_with(   R   t   transt   pairedR   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   do_with#  s    
c         C  s   d t j j   _ |  j   | r/ |  j   n  t j j   j } xB |  j |  j	   D]+ \ } } | |  j
 k rW | |  j | <qW qW Wx! t j j D] } | j |  q W| j   t | _ d S(   so   
        Implements the with None command, which sets the scene we will
        be transitioning from.
        N(   R#   R   R   R   t   say_attributesR  t   compute_overlayR   t   compute_sceneR   R1  R0  R   R   R   R   R<   R   (   R   t   overlayR   R   Ru   R]   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR  2  s    
"
c         C  sG   |  j  r | r d S| d k r6 |  j j | d  n | |  j | <d S(   se   
        Sets the transition that will be performed as part of the next
        interaction.
        N(   R5  R#   R1  R   (   R   R1  R   R  (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR  O  s
    c         C  sR   |  j  r |  j  St j j   } | j t j k rE t j j j	   d S| |  _  | S(   sP   
        This peeks the next event. It returns None if no event exists.
        N(   R9  RE  Rr   t   pollRO   t   NOEVENTR   Rf   R  t   event_peek_sleepR#   (   R   Rq   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt
   event_peek]  s    		c         C  s:   |  j  r |  j  } d |  _  n t j j   } | |  _ | S(   sa   
        Called to busy-wait for an event while we're waiting to
        redraw a frame.
        N(   R9  R#   RE  Rr   R!  R=  (   R   R8   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt
   event_pollp  s    			c         C  sN   |  j  r( |  j  } d |  _  | |  _ | S|  j   t j j   } | |  _ | S(   s~   
        This is in its own function so that we can track in the
        profiler how much time is spent in interact.
        N(   R9  R#   R=  R   RE  Rr   R  (   R   R8   Rq   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt
   event_wait  s    				
	c         C  s   t  j j r d  St  j j d  x t  j j D] } |   q- Wt  j j   j	 j
 rt x t  j j D] } |   q` Wn  t  j j   d  S(   NR   (   R   R  R  t   uiR   R   t   overlay_functionsR   R   R   R   t   window_overlay_functionsR  (   R   R]   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR    s    c         C  s   i  } x; t  j j t  j j D]# } | j | |  j |  | | <q Wt  j j j d d  } i  | _ x6 t  j j D]( } | | | j | <| j	 | |  qr W| | d <| S(   sz   
        This converts scene lists into a dictionary mapping layer
        name to a Fixed containing that layer.
        R   R   N(   R   R   R   R   R  RK  Rf   R   R   R   R#   (   R   R   R8   R   Rm   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR    s    !	
c         C  s   |  j  t j   d k r+ t j j    n  |  j rF t j j    n  t j j d k	 r t j   |  _  t j	 j
 d t  t t j _ z& t |  _ t j j j t j j  Wd t |  _ Xn t j j    d S(   sD   
        This is called to handle the user invoking a quit.
        g      ?t   only_fullscreenN(   RC  R	   R   R   t   QuitExceptionRD  R   t   quit_actionR#   Ra   R  RP   R  t   mouse_visibleRf   t   behaviort   runR<   (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt
   quit_event  s    		c         C  sW  t  j j d  k	 r@ |  j t  j j t  j j j   k  r@ t } n t  j	 j
 oV t  j j } | oe |  j } | s~ t d d d  f St  j j s t d d d  f S|  j s t d d d  f St  j j j   p |  j } | t  j j k r t  j j | } n t  j j t t  j	 d d  } | |  j t |  \ } } } t  j j j |  } t | | | f S(   Ni    t   default_mouseRA   (   R   R   t   mouse_hide_timeR#   RR  Rf   t   coreR   R<   R  R-  R   t
   less_mouseRS  R;  RP   RI  RF   t	   get_mouseR  R:  R   R  t
   load_image(   R   t   visiblet
   mouse_kindt   animt   imgR1   R2   t   tex(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   get_mouse_info  s"    7		 c         C  s"   t  | | |  |  _ t |  _ d S(   s_   
        Sets the mouse position. Duration can be a number of seconds or
        None.
        N(   R  Rb  RP   R7  (   R   R1   R2   R  (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR    s    c         C  s   t    |  j | k S(   ss   
        Returns true if the screen has been drawn in the last `seconds_ago`,
        and false otherwise.
        (   R   RA  (   R   t   seconds_ago(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   drawn_since  s    c         C  s  d   } | j  t j k r2 |   t j d  n  | j  t j k rH t St j j j	   t
 rn t
 j t  n  t j j t d  t j j t d  t j j t d  |   t j j r t j d  n  t j j   t d  xQ t r4t j j   } | j  t j k rPn  | j  t j k r t j d  q q Wt d  t j j d  t j j t t  t j j j   t
 rt
 j t  n  t |  _ t |  _ t S(   s3   
        Handles the SDL2 suspend process.
        c           S  s3   t  j j r t  j j d  n  t  j j t  d  S(   Ns	   _reload-1(   R   R   t   save_on_mobile_backgroundt   loadsavet   savet
   persistentR6   RP   (    (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyRA  	  s    i    s   Entered background.s   Entering foreground.s	   _reload-1(    RO   RE  t   APP_TERMINATINGR  t   exitt   APP_WILLENTERBACKGROUNDR<   R   RY  t	   pause_allR  R  R	   R  R   R   R   R   t   quit_on_mobile_backgroundRa   R  R  RP   Rr   R  t   APP_DIDENTERFOREGROUNDR@  t   unlink_saveR  t   unpause_allRT  R8  (   R   Rq   RA  (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   check_suspend	  s@    	
	
		c         C  s-   |  j  r d St |  _  t j j j d  d S(   s0   
        Called when we become an icon.
        Ns   The window was minimized.(   R  RP   R   Rf   Ro  Rp  (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt	   iconifiedI	  s    		c         C  sR   |  j  s d St |  _  t j j j d  t j rN t |  _ |  j	 |  j
  n  d S(   sA   
        Called when we are restored from being an icon.
        Ns   The window was restored.(   R  R<   R   Rf   Ro  Rp  R  RP   RT  R  RU  (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   restoredU	  s    				c         C  s+   |  j  j   |  j j   |  j j   d S(   s5   
        Called when we enter a new context.
        N(   R2  R   R4  R3  (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   enter_contexth	  s    c         C  s%   y t  j j |  j  Wn n Xd S(   s9   
        Posts a time_event object to the queue.
        N(   RE  Rr   t   postRG  (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   post_time_eventr	  s    c         C  s,   t  |  _ t j j j d d d d t d S(   sO   
        Called after a longpress, to ignore the mouse button release.
        iRA   N(   RP   RM  R   Rf   RF   t   mouse_handlerR#   R<   (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   after_longpress|	  s    	c         C  s9   |  j    } | d k r t S| j t j t j f k Sd S(   sV   
        Returns true if the next event in the queue is a text editing event.
        N(   R$  R#   R<   RO   RE  t	   TEXTINPUTt   TEXTEDITING(   R   Rq   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   text_event_in_queue	  s    c         C  sF  t  j j d k	 r$ t  j j |  _ n  |  j d k	 rt j j   oO t j j   } |  j	 sb | rr t j j
   n  |  j	 |  j k r6|  j \ } } } } t  j j j | |  \ } } t  j j j | | | |  \ } }	 | | | | |	 | f }
 t j j |
  q6n) |  j	 r6t j j   t j j d  n  |  j |  _	 d S(   sB   
        Updates the text input state and text rectangle.
        N(   R   R  t
   _text_rectR#   Rd  RE  R   t   has_screen_keyboard_supportt   is_screen_keyboard_shownRe  t   start_text_inputRf   R  t   untranslate_pointR  R  (   R   t	   not_shownR1   R2   Ru  Rv  t   x0t   y0t   x1t   y1t   rect(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   update_text_rect	  s     &	c         C  s8   | d k r d |  _ n t |  j t   |  |  _ d S(   s\   
        Forces Ren'Py to draw the screen at the maximum framerate for `t` seconds.
        i    N(   R#   Rq  R  R   (   R   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyRr  	  s    c         K  s[  |  j  s |  j   n  | |  _ d t j _ t j j   } | j	 rR t
 d   n  t | _	 | sn |  j   n  |  j } g  |  _ zl x t j j D] } |   q Wt } t |  _ x4 | r |  j d | d | |  \ } }	 t |  _ q W|	 SWd t | _	 | rt j j   j }
 |
 j   n  i  |  _ i  |  _ i  |  _ t |  _ t t j j   j _ Xd S(   s   
        This handles an interaction, restarting it if necessary. All of the
        keyword arguments are passed off to interact_core.
        s\   Cannot start an interaction in the middle of an interaction, without creating a new context.R@  R  N(   Rk  R  R  R#   R   t	   bootstrapt   report_errorR   R   t   interactingRn   RP   R  R@  R   t   start_interact_callbacksRt  t   interact_coreR<   R   R   R2  R3  R4  R8  R   (   R   R   t   suppress_windowR  R7   R   R@  R]   t   repeatR8   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR  	  s<    								!					RA   c   2        s  | p t  j j } |  _ |  _ |  _ t  j j j |  t  j j j   |  _	 |  _
 t  j j pw t  j j  t  _ xa  j D]V } |  j k r q n   j |  j | < j | j    j | <d  j | <q W j j    r$ j j    j j    j j   n  | r| j s=t d f Sd  j k rVt d f S rft d f S j s|t d f Sn  t  j j   t  _ |  _ t   }	 |	 }
 x t  j j D] } |   qW j   t  j j  j! j"   t  j# j# j$   t  j j% j&   t  j j' j( j   t  j j j) j   t* j+ j t* j, t- t. t/ f   j0   t  j j1   j2 } | j3   | s j4   n  t  j j' j5 d d  } i  | _6 g    | s"x. t  j j7 D]  } | j8 |    j9 |  qW| d k	 r"t  j j: j; |  } | j8 |    j9 |  q"n   j< |   t  j j= j>  d  x5  j?   D]' } y t  j j% j@ |  WqUqUXqUWt  j j' j5 d d  } i  | _6      f d   } x! t  j j6 D] } | | |  qW j jA d d  rf rft  j j' j5 d d  } i  | _6 xB t  j j6 D]4 }  j d j6 | } | | j6 | <| j8 |  q'W j d d | d |  } tB | tC  stD d |   n  | jE    j jA d d  } | j8 | | |  | rst  j jF rt  j j: jG   } n t  j j: jG d d  } | j8 |    j9 |  t  j j: jH | jI  } | j8 | | |    j9 |  qsn | j8 |  x! t  j jJ D] } | | |  qWx$ t  j jK jL D] } | j8 |  qW~ t  j j% jM |  } | jN d  t  j j: jO j   t  j jP jQ   t  j j: jR   | jS d	    t  j j: jT     _ t  j jU jV    t  j jW jX   tY } tY } d  _Z t } d } d } d } t  j[ j[ j\   d
 }  t }! t t  j _] zylxC| d k rt  j^ j_ d   j` t  j ja j` k s jb st  j jc d k r" jd   tY } n  t  je jf rJt t  je _f t  jg jh   n  x& t  j ji D] } |   rWtY } qWqWW jj s| st* j+ jk tl  r2
t  j jc jm | |  r2
t  _j t  j jP j\   }" d  _n t    _o  jZ s jo  _Z n  t  j[ j[ jp    jq | |" |" p|!  | rw| jr  jZ  x?  j js   D]+ \ } }# |# d k rE jZ  j | <qEqEWn  t  j jt d 7_t t  j ju s jv r	t   }$  jv s|$  jw d k rtx d d |$  jo  tx d d |$  jw  n  t  _v n  | r	 jy r	 jy jz t* j{ t* j| t* j, g k r	t  j jc j}   \ }% }& t  j jK jK  jy |% |&  \ }' }% }&  j~ r	d }% d }& n  t  j r	 jy jz t* j| k r	d }% d }& n  t  j jU j d |% |& d t n  t } t } t* j j t/ d  t* j+ j t/ g  d }  j   t  j j j   n   j d k	 r_
 j j   s_
d  _ q_
n  t  j jc j    j r
tY d f St  j jP j   r
tY } tY }! n  t  j jW jX   r
tY } n   j t   k r
tY } n  d
 }( t  j jW j   }) |) d k	 r| r|) | k r|) t   }* t |* d
  }* |* }  |* d k ruy t* j+ j  j  Wn n Xt* j j t/ d  n& t* j j t/ t t |* d  d   |) } qn d
 }  t* j j t/ d   j st* j j t. d  n  j t   }* t |* d
  }* |* }( |* d k r9d  _ t* j j t. d   j0   n<  j | k rut* j j t. t |* d d    j } n  xa | d k	 r| p j   pt  j[ j j d  }+ | jN |+  }, |, sd } Pn  |+ sxPqxqxW| s| r j   rt    _w qn  | s t  j j   tY } n  t  j j   | sN j sNt  j jP j   r] j   }' n  j   }' |' jz t* j k r| s j rt* j j d  qqn  t    _w  j |'  rqn  |' jz t. k rd } t* j+ j t. g  n  t r0|' jz t* j{ k s|' jz t* j| k r0t* j+ j |' jz  n  |' jz t/ k r^t* j+ j t/ g  d } qn  |' jz t- k rd t t* j+ jA t- g   }-  j |- 7_ x t  j j D] } |   qWt  j[ j[ j   t  j j= j   qn  |' jz t* j k r j   qn  |' jz t* j k r4|' j# r(|'  _ q|d  _ nH |' jz t* j k rRd  _ n*  j r||' jz t* j t* j g k r|qn  |' jz t* j k rtY t  j j _ tY t  j j _j tB t  j jc t  j j j  rtY t  j jc _ qqn  |' jz t* j k rt* j+ jA t* j g  }. t |.  r%|. d }' n  |' j d k rI|' j d k rIqn  |' j  j |' j  j f }/ t* j j   j   |' j k r jd |/  n   j` s|/  _ qqn   j~ r|' jz t* j| k r|' j d k rt  _~ qn  |' jz t* j, k rFt* j+ jA t* j, g  }. t |.  r.|. d }' n  t  j rFtY  _ qFn  |' jz t* j, k s||' jz t* j{ k s||' jz t* j| k rt  j j j    _  j~ rt  j jU j d d d d t qn  |' jz t* j k rh|' j d @r	|' j st  j jU j   n  |' j  _ n  |' j d @r%|' j  _ n  |' j d @rU|' j rH j   qU j   n  t* j j d  n  t  j jc j |'  \ }% }& t  j j j} |% |&  \ }% }& t  j jK jK |' |% |&  \ }' }% }& |' d k rqn   j s j~ rd }% d }& n  t  j j j+ |'  }' |' sqn  t  j j: j |'  t    _ }
 yi j rht  j j j j+ |' |% |&  n  t  j jU j |' |% |&  } | d k r| j+ |' |% |& d  } n  | d k rt  j jU j |'  } n  | d k	 rPn  t  j j rt  j j: j |' d  rP j j |% |& t  j j t  j j t  j j  }0 t  j j t  j j |0  qt  j j: j |' d  r j j |% |& t  j j6  }0 t  j j t  j j |0  qn  Wn- t k
 r|' jz t. k r j0   qn X| t  j jW jX   O}  j rtY d f SqW| r| rtY  _ n  t | f SWn t k
 rE}1 t |1 j f SXWd d t  j j1   _ x! t  j j D] } | j |  qiWt  j j  j! j   t* j j t. d  t* j j t/ d  t  j j1   j |
 |	 7_ tY  _ Xd S(   s  
        This handles one cycle of displaying an image to the user,
        and then responding to user input.

        @param show_mouse: Should the mouse be shown during this
        interaction? Only advisory, and usually doesn't work.

        @param trans_pause: If given, we must have a transition. Should we
        add a pause behavior during the transition?

        @param suppress_overlay: This suppresses the display of the overlay.
        @param suppress_underlay: This suppresses the display of the underlay.
        R   R   c           s    | }   j  |   j j | d   r  r  j | d  j | d |  } t | t  sx t d |   n   j j | d   } |  j	 | | |  | |  j
 | <n | |  j
 | <|  j	 |  d  S(   Nt
   old_widgett
   new_widgets1   Expected transition to be a displayable, not a %r(   R   R2  R   R#   R4  R   R?   Rn   R3  R   R   (   t   whereR   t   scene_layerR  R3  (   t   focus_rootst   sceneR   R5  (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt	   add_layer
  s    
	Ri  Rj  s1   Expected transition to be a displayable, not a %rt   dismisst   dismiss_hard_pausec         S  s
   |  j    S(   N(   Rv   (   R]   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   <lambda>
  s    i  i
   i   gQ?s   Profile: Redraw took %.3f ms.i  s#   Profile: %.3f ms to complete event.iRA   i    t   moviei   i   t	   inspectort   full_inspectorN(   R   R  R  t   suppress_underlayR  Rf   R   t   show_overlay_screenst   prepare_screensR?  RS  R   t   skippingR   t   less_updatesR<   R5  R1  R0  R2  RJ   R4  R#   R3  R   R  t   check_languageR8  R;  R   t   interact_callbacksR  R  R  t   tickR   t   layout_cache_tickt   predictt   resetR   t   size_groupst   updated_screensRE  Rr   t   MOUSEMOTIONR   R   R   RP  R   R   R	  R  R   R   t   underlayR   R   R.  t   RollForwardR  t   ttst   set_rootR   R   R   R   R?   Rn   R   t   _dismiss_pauset   SayBehaviort   PauseBehaviorR  R   Ri  R   t   prediction_coroutinet   sendt   adj_registeredR  t   early_interactt   input_pre_per_interactRt   t   input_post_per_interactRF   t   before_interactRk   t   process_redrawsRP   RB  RY  R  t   after_rollbackt	   executiont   not_infinite_loopRL  R  RT  R  R  R  t   needs_autoreloadRa   t   reload_scriptt   needs_redraw_callbacksR7  t   peekt
   ALL_EVENTSt   should_redrawRd  RA  t   advance_timeR  R   R   t   framest   profileR  R[  R  R=  RO   t   MOUSEBUTTONDOWNt   MOUSEBUTTONUPR  RM  R  RQ  R	   R  Ra  t   testt   testexecutiont   executeRb  R  t   update_mouset   frequentRq  t   redraw_timet   minRO  RH  R  R  R<  R$  R   t
   is_playingR@  t   autosaveRB  t   check_updatet   playingR%  R&  R"  R  RK  R   R:  Rh  t   periodict   QUITR0  RT  Rc  RS  t   KEYDOWNt   KEYUPt   VIDEOEXPOSER]  t   full_redrawt   swdrawR  t   VIDEORESIZERu  Rv  Rn  t   get_surfaceR  t   sizeRU  t   buttonR  RI  R3  RR  t   ACTIVEEVENTt   statet   gaint   clear_focusRJ  RM  RL  R   t   set_modst   mouse_eventt	   testmouseR  RQ  R-  t   gesturet
   recognizert   key_handlerRt  t	   map_eventR  t   main_displayables_at_pointR   t   context_clear_layersR   t   invoke_in_new_contextR   R   R   R  t   end_tickt   runtime(2   R   RS  R  R  Rv  R;  R@  R?  R   t
   start_timet   end_timeR]   R   R  t   rfwRu  t   layers_rootRo  R   t   old_rootRu   R  R3  t   sbt   pbR  t   needs_redrawt
   first_passt   did_autosavet   old_timeout_timet   old_redraw_timeR8   t
   _redraw_int   video_frame_drawnRl  t   vt   new_timeR1   R2   Rq   t   _timeout_inR  t	   time_leftt   expensive_predictt   resultt   eventst   evsR  R   t   e(    (   Rm  Rn  R   R5  sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyRf  	  s   							


				



				
		 
							3'			"
	
			&		!(	!*
	$ 					%		$		2#	c         C  sL   | d k  r d  S|  j  r8 t |  j | |  j   |  _  n |  j | |  _  d  S(   Ni    (   R<  R  RQ  (   R   t   offset(    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   timeout  s
    	c         C  s   |  j    d S(   st   
        Called before a quit or restart to finish any pending work that might
        block other threads.
        N(   R   (   R   (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   finish_pending  s    (1   R   R   R   R    Rm  R  R  R  R<   R  R  R  R  R  R#   R  R  R  R   R  R  R  R  R  RP   R  R  R$  R%  R&  R  R  R0  R<  R  R>  RK  RL  RM  RN  RP  RR  RU  Ra  Rr  R  Rf  R  R  (    (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyR'  w  sh   1		*	&				=		
]	'	
											"				B			
	
				
>  		(R   t
   __future__R    t   renpy.displayR   t   renpy.audiot
   renpy.textt
   renpy.testt   pygame_sdl2RE  R  R   R	   R  RV  R9   R  R  R#   Rr   t   registerR   R   R   R   R  R  R  R   R  RC  t   APP_LOWMEMORYRE  t   APP_DIDENTERBACKGROUNDt   APP_WILLENTERFOREGROUNDRH  t   WINDOWEVENTt
   SYSWMEVENTR  R  RT  RS  R  R  R  t
   MOUSEWHEELt   JOYAXISMOTIONt   JOYHATMOTIONt   JOYBALLMOTIONt   JOYBUTTONDOWNt   JOYBUTTONUPt   JOYDEVICEADDEDt   JOYDEVICEREMOVEDt   CONTROLLERAXISMOTIONt   CONTROLLERBUTTONDOWNt   CONTROLLERBUTTONUPt   CONTROLLERDEVICEADDEDt   CONTROLLERDEVICEREMOVEDt   RENDER_TARGETS_RESETR  R  R
   R   R   R   R   Rn   R   R   R   R!   R3   t   objectt   ObjectR4   R?   R   R   R   R  R&  Rs  R'  (    (    (    sa   Z:\home\souce\.local\share\Steam\steamapps\common\Doki Doki Literature Club\renpy\display\core.pyt   <module>   s   
		
			
	2  ,  g	'	