+
    Ki  c                   s    ^ RI t ^ RIHt ^ RIHtHtHt ^ RIHt ^ RI	H
t
 ^ RIHtHt ^ RIHtHt ^ RIHt ^ R	IHt ^ R
IHtHt ^ RIHt ^ RIHt ^ RIHt  ! R R4      tR# )i    N)List)GdkGObjectGtk)get_game_for_service)ServiceGameCollection)
GAME_STARTGame)GameActionsget_game_actions)EMPTY_NOTIFICATION_REGISTRATION)ContextualMenu)MEDIA_CACHE_INVALIDATEDget_application)schedule_repeating_at_idle)logger)MISSING_GAMESc                   s  a  ] tR t^t o R]P
                  R]33R]P
                  R]33/tR t	R t
R tR tR tV 3R	 lR
 ltR tV 3R lR ltV 3R lR ltV 3R lR ltR tR tR tR tRR ltR tR tV 3R lR ltRtV tR# )GameViewzgame-selectedNzgame-activatedc                s    R V n         R V n        R V n        \        V n        \        V n        \        V n        R V n        R # N)
game_storeserviceservice_mediar
   cache_notification_registration"missing_games_updated_registrationgame_start_registrationimage_rendererself   &:/usr/lib/python3.14/site-packages/lutris/gui/views/base.py__init__ZGameView.__init__   s8    !/N,2Q/'F$"    c                s   \         P                  ! V P                  4      V n        \        P
                  P                  V P                  4      V n        V P                  RV P                  4       V P                  RV P                  4       V P                  RV P                  4       \        P                  ! V P                  4      V n        R# )z#Signal handlers common to all viewsZdestroyzbutton-press-eventzkey-press-eventN)r   Zregisteron_media_cache_invalidatedr   r   Zupdatedon_missing_games_updatedr   Zconnect
on_destroypopup_contextual_menuhandle_key_pressr   on_game_startr   r   r   r   connect_signalsZGameView.connect_signals"   s    /F/O/OPTPoPo/p,2?2G2G2P2PQUQnQn2o/Y0)4+E+EF&(=(=>'1':':4;M;M'N$r   c                s    Wn         VP                  V n        VP                  V n        V P                  '       d   V P                  V P                  n        R # R # r   )r   r   r   r   )r   r      &&r   set_game_storeZGameView.set_game_store-   sE    $!))'55*.,,D' r   c                s&    V P                  4        R # r   )
queue_drawr   r   r   r    Z#GameView.on_media_cache_invalidated5   s    r   c                s    V P                   '       d1   V P                   P                  '       d   V P                  4        R # R # R # r   )r   Zshow_badgesr)   r   r   r   r!   Z!GameView.on_missing_games_updated8   s2    4#6#6#B#B#BOO $Cr   c                s   < V ^8  d   QhRR/# )   returnN format__classdict__   "r   __annotate__GameView.__annotate__<   s     2 2T 2r   c                s    V P                   P                  4        V P                  P                  4        V P                  P                  4        R # r   )r   Z
unregisterr   r   )r   Z_widgetr'   r   r"   ZGameView.on_destroy<   s8    ,,779//::<$$//1r   c                sr   VP                   \        P                  8w  d   R# V P                  VP                  VP
                  4      pV'       dh   V P                  4       pW49  d   V.pV P                  V4       V P                  V4      p\        VP                  4       4      pVP                  W%4       R# R# )zContextual menu.NT)Zbuttonr   ZBUTTON_SECONDARYZget_path_atZxZyget_selectedset_selectedget_game_actions_for_pathsr   r	   Zpopup)r   ZvieweventZcurrent_pathZ	selectiongame_actionsZcontextual_menus   &&&    r   r#   ZGameView.popup_contextual_menuA   s    <<3///''9))+I,)N	!!),::9EL,\-J-J-LMO!!%6 r   c                    < V ^8  d   QhRS[ /# r*   r+   r   r-   r0   r   r1   r2   Q   s     D D; Dr   c                s@    V P                  V P                  4       4      # r   )r5   r3   r   r   r   get_selected_game_actionsZ"GameView.get_selected_game_actionsQ   s    ..t/@/@/BCCr   c                r8   r9   r:   r-   r0   r   r1   r2   T   s     C C; Cr   c                s    . pV F#  pVP                  V P                  V4      4       K%  	  V P                  V4      p\        W@P	                  4       R 7      # ))Zwindow)appendget_game_id_for_path_get_games_by_idsr	   get_toplevel)r   pathsgame_idspathgamess   &&   r   r5   Z#GameView.get_game_actions_for_pathsT   sL    DOOD55d;< &&x0.?.?.ABBr   c                sF   < V ^8  d   QhRS[ S[,          RS[ S[,          /# )r*   rA   r+   )r    strr   r-   r0   r   r1   r2   [   s#      $s) T
 r   c                s   R R lp. pV F  pV P                   '       d   \        V P                   P                  V4      pV'       d2   VR,          '       d!   VP                  V! VR,          4      4       Kl  Kn  \        P
                  ! V P                   P                  V4      pVP                  \        P                  ! WPP                   4      4       K  V'       g   K  VP                  V! V4      4       K  	  V# )zlResolves a list of game-ids to a list of game objects,
looking up running games, service games and all that.c                s0    V ^8  d   QhR\         R\        /# )r*   
id_to_findr+   )rD   r   )r.   s   "r   r1   Z0GameView._get_games_by_ids.<locals>.__annotate___   s     	_ 	_ 	_ 	_r   c                 s^    \        4       pV'       d   VP                  V 4      # \        V 4      # r   )r   Zget_game_by_idr   )rE   Zapplication   & r   _get_game_by_idZ3GameView._get_games_by_ids.<locals>._get_game_by_id_   s(    )+K=H;--j9^dS]N^^r   id)r   r   rH   r<   r   Zget_gamer   Zcreate_empty_service_game)r   rA   rG   rC   game_idZdb_games   &&    r   r>   ZGameView._get_games_by_ids[   s    	_ G|||.t||Ht}}_WT]%CD % 4<<T\\__gVGLL!?!?!VW_W56   r   c                sv    V P                  4       p\        V4      ^8X  d   V P                  V^ ,          4      # R# )zwReturns the ID of the selected game, if there is exactly one- or
None if there is no selection or a multiple-selection.N)r3   Zlenr=   )r   ZselectedrF   r   get_selected_game_idZGameView.get_selected_game_ids   s6     $$&x=A,,Xa[99r   c                s    VP                   pV\        P                  8X  d8   V P                  4       pVP                  '       d   VP                  V 4       R# R# V\        P                  8X  d8   V P                  4       pVP                  '       d   VP                  V 4       R# R# R#   \         d#   p\        P                  ! R T4        Rp?R# Rp?ii ; i)zUnable to handle key press: %sN)Zkeyvalr   Z
KEY_Deleter;   Zis_game_removableZon_remove_gameZ	KEY_BreakZis_game_runningZon_game_stopZ	Exceptionr   Z	exception)r   Zwidgetr6   Zkeyr7   Zexs   &&&   r   r$   ZGameView.handle_key_press{   s    	C,,Ccnn$#==?111 //5 2%#==?/// --d3 0 &  	C=rBB	Cs*   AB( B( 6B( B( (C3CCc                    \        4       hr   ZNotImplementedErrorr   r   r   r?   ZGameView.get_toplevel       !##r   c                s    . # r   r,   r   r   r   r3   ZGameView.get_selected   s    	r   c                rK   r   rL   )r   r@   Zscroll_into_views   &&&r   r4   ZGameView.set_selected   rM   r   c                rK   r   rL   )r   rB   r'   r   r=   ZGameView.get_game_id_for_path   rM   r   c                rK   r   rL   )r   rI   r'   r   get_path_for_game_idZGameView.get_path_for_game_id   rM   r   c                s$   < V ^8  d   QhRS[ RR/# )r*   gamer+   N)r   r-   r0   r   r1   r2      s     9H 9H$ 9H4 9Hr   c                s   a aaaaaaa \         P                  ! 4       oRoRoS P                  4       oRoV3R loVVVVVV V3R lpS P                  '       d   \	        VRR7       R# R# )	zOn game start, we trigger an animation to show the game is starting; it runs at least
one cycle, but continues until the game exits the STATE_LAUNCHING state.g      ?g?Fc                  s  < \         P                  P                  4        F^  p V S8w  g   K  \        V \         P                  4      '       g   K.  V P                  4       '       g   KF  V P                  4       S8X  g   K]   R # 	  R# )TN)r   ZWindowZlist_toplevelsZ
isinstanceZDialogZ	get_modalZget_transient_for)Zwtoplevels    r   is_modally_blockedZ2GameView.on_game_start.<locals>.is_modally_blocked   sQ     ZZ..0=Z3::%>%>{{}})<)<)>()J# 1r   c                  s  < \         P                  ! 4       p V S
,
          pVS8  dc   SP                  SP                  8w  d?   S	P                  P                  SP                  R 4      '       d   S	P                  4        R# V o
S! 4       oVS,          pVS^,          8  d
   SV,
          pS'       d   R pMSV^,          S,          ,          pS	P                  P                  SP                  V4      '       d   S	P                  4        R# )g        FT)time	monotonicZstateZSTATE_LAUNCHINGr   Z
inset_gamerH   r)   )ZnowZelapsedZcycleZfraction
cycle_timerO   rQ   
max_indentpausedr   
start_times       r   animateZ'GameView.on_game_start.<locals>.animate   s     .."CJ&G# ::!5!55**55dggsCC)  
+-j(E zA~%"U* %Z)?@""--dggx@@!r   g?)Zinterval_secondsN)rR   rS   r?   r   r   )	r   rO   rX   rT   rQ   rU   rV   rW   rP   s	   ff @@@@@@r   r%   ZGameView.on_game_start   s[     ^^%


$$&	$ 	  	D &wG r   )r   r   r   r   r   r   r   )F)Z__name__Z
__module__Z__qualname__Z__firstlineno__r   ZSIGNAL_RUN_FIRSTZobjectrD   Z__gsignals__r   r&   r(   r    r!   r"   r#   r;   r5   r>   rJ   r$   r?   r3   r4   r=   rN   r%   Z__static_attributes__Z__classdictcell__)r/   s   @r   r   r      s      	'22D6)D733TC6BL
#	O72 2
 D DC C 0C$$$$9H 9Hr   r   )rR   Ztypingr    Zgi.repositoryr   r   r   Zlutris.database.gamesr   Zlutris.database.servicesr   Zlutris.gamer   r   Zlutris.game_actionsr   r	   Zlutris.gui.widgetsr
   Z"lutris.gui.widgets.contextual_menur   Zlutris.gui.widgets.utilsr   r   Zlutris.util.jobsr   Zlutris.util.logr   Zlutris.util.path_cacher   r   r,   r   r   <module>rY      s=      + + 6 : ( = > = M 7 " 0H Hr   