+
    Ki-  c                   s   R t ^ RIt^ RIt^ RIHt ^ RIHtHtHtH	t	H
t
Ht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HtHtHtHtHt ^ R	IH t  ^ R
I!H"t" ^ RI#H$t$H%t%H&t&H't'H(t(H)t)H*t*H+t+H,t,H-t-H.t. ^ RI/H0t0 ^ RI1H2t2 ^ RI3H4t4H5t5H6t6 ^ RI7H8t8H9t9 ^ RI:H;t; ^ RI<H=t= ^ RI>H?t? ^ RI@HAtA ^ RIBHCtC ^ RIDHEtE ^ RIFHGtG ^ RIHHItIHJtJ ^ RIKHLtL ^ RIMHNtNHOtO ^ RIPHQtQHRtRHStS ^ RITHUtU ^ RIVHWtWHXtXHYtYHZtZH[t[H\t\H]t]H^t^H_t_H`t`HataHbtbHctcHdtdHete R R ltfR R  ltgR! R" lthR# R$ ltiR% R& ltjR' R( ltkR) R* ltlR+ R, ltmR- R. ltnR/ R0 ltoR1 R2 ltpR3 R4 ltqR5 R6 ltrR7 ts ! R8 R9]04      ttR# ):zWine runnerN)gettext)AnyDictIterableListOptionalSetTuple)runtimesettings)format_runner_versionnormalize_version_architecture)LutrisConfig)get_game_by_field)EsyncLimitErrorFsyncUnsupportedErrorMisconfigurationErrorMissingExecutableErrorMissingGameExecutableErrorSymlinkNotUsableErrorUnspecifiedVersionError)Game)
FileDialog)create_prefixdelete_registry_key
eject_discinstall_cab_componentopen_wine_terminalset_regeditset_regedit_filewinecfgwineexecwinekill
winetricks)Runner)system)DISPLAY_MANAGERget_default_dpiis_display_x11)driversvkquery)LINUX_SYSTEM)logger)Process)split_arguments)proton)D3DExtrasManager)dgvoodoo2Manager)REQUIRED_VULKAN_API_VERSIONDXVKManager)DXVKNVAPIManager)PEFILE_AVAILABLEIconExtractor)DEFAULT_DLL_OVERRIDESWinePrefixManagerfind_prefix)VKD3DManager)GE_PROTON_LATESTWINE_DEFAULT_ARCH
WINE_PATHSdetect_archget_default_wine_versionget_installed_wine_versionsget_overrides_envget_real_executable get_runner_files_dir_for_versionget_system_wine_versionget_wine_path_for_versionis_esync_limit_setis_fsync_supportedis_gstreamer_buildis_winewayland_availablec                s0    V ^8  d   QhR\         R\        /# )   configreturn)r   boolformat   "8/usr/lib/python3.14/site-packages/lutris/runners/wine.py__annotate__rP   H   s     L Ll Lt L    c                 s    V P                   P                  R 4      pV\        8H  ;'       g    \        P                  ! V4      # version)runner_configgetr9   r-   is_proton_version)rI   rS      & rO   _is_proton_configrX   H   s7    ""&&y1G&&KK&*B*B7*KKrQ   c                <    V ^8  d   QhR\         R\        R\        /# rH   _option_keyrI   rJ   strr   rK   rL   rN   rO   rP   rP   M   s!     ) ) )\ )d )rQ   c                 s"    \        V4      '       * # N)rX   )r[   rI      &&rO   _is_pre_protonr`   M   s     (((rQ   c                rY   rZ   r\   rL   rN   rO   rP   rP   Q   s!      # |  rQ   c                 s    \        V4      '       d`   VP                  P                  R 4      p\        T;'       d2    \	        V4      ;'       d    VP                  P                  R4      R8H  4      # R# )rS   GraphicswaylandF)rX   rT   rU   rK   rG   )r[   rI   rS      && rO   _is_proton_hdr_availablerd   Q   s_      &&**95Gww 8 AwwfFZFZF^F^_iFjnwFwxxrQ   c                R    V ^8  d   QhR\         R\        R\        \         ,          /# rZ   r]   r   r   rL   rN   rO   rP   rP   Y   s%      c < HSM rQ   c                 s    VP                   P                  R 4      pVR8X  d   \        V4      '       d   \        R4      # R# )archwin32.Proton is not compatible with 32-bit prefixes.N)game_configrU   rX   _)r[   rI   rg   rc   rO   _get_version_warningrl   Y   s9    !!&)Dw,V44ABBrQ   c                re   rZ   rf   rL   rN   rO   rP   rP   a   s*     	m 	mS 	m, 	m8C= 	mrQ   c                 s    VP                   pVP                  R 4      '       d   R# VP                  R4      pV'       d   \        V4      '       d   R# \        R4      # )prefixNexez\<b>Warning</b> Some Wine configuration options cannot be applied, if no prefix can be found.)rj   rU   r7   rk   )r[   rI   rj   rn      &&  rO   _get_prefix_warningrp   a   sI    $$Kx  
//%
 C
{3kllrQ   c                re   rZ   rf   rL   rN   rO   rP   rP   m   s%      # |  rQ   c                 s   VP                   P                  R 4      ;'       g    RpVP                  4       pV'       g   \        R4      # W#8w  d   \        R4      # \        P
                  P                  V4      '       g   VP                   P                  R4      ;'       g&    VP                   P                  R4      ;'       g    Rp\        P
                  P                  \        P
                  P                  V4      \        P
                  P                  V4      4      p\        P                  ! V4      p\        P
                  P                  V4      '       g   \        R4      # R# )rn    z+<b>Warning</b> No executable path specifiedzK<b>Warning</b> Executable path has extra whitespace at the beginning or endworking_dirrm   z-<b>Warning</b> Executable file does not existN)rj   rU   Zstriprk   ospathisabsjoin
expanduserr#   fix_path_caseZisfile)r[   rI   rn   Zstripped_exerr      &&   rO   _get_exe_warningrz   m   s    



 
 
'
-
-2C99;L>??
^__77== ((,,];eev?Q?Q?U?UV^?_eeceggll277--k:BGG<N<Ns<ST


s
#C77>>#@AArQ   c                s:    V ^8  d   QhR\         \        ,          /# rH   rJ   r   r]   rL   rN   rO   rP   rP      s     	 	8C= 	rQ   c                  s    \         P                  ! 4       '       d0   \         P                  ! 4       p \        R 4      V R,          3,          # R# )z<b>Warning</b> Your NVIDIA driver is outdated.
You are currently running driver %s which does not fully support all features for Vulkan and DXVK games.rS   N)r'   Zis_outdatedZget_nvidia_driver_infork   )Zdriver_infos    rO   _get_dxvk_warningr}      sI    446D
 #%	& 	& rQ   c          	      s^    V ^8  d   QhR\         R\        R\         R\        \         ,          /# )rH   
option_keyrI   featurerJ   rf   rL   rN   rO   rP   rP      s0       l UX ]efi]j rQ   c                 s    \         P                  P                  R 4      '       d   R# VP                  P                  V 4      '       d.   \        P
                  ! 4       '       g   \        R4      V,          # R# )LUTRIS_NO_VKQUERYNz]<b>Error</b> Vulkan is not installed or is not supported by your system, %s is not available.)rs   environrU   rT   r)   is_vulkan_supportedrk   )r~   rI   r   s   &&&rO    _get_simple_vulkan_support_errorr      sW    	zz~~)**
++L4T4T4V4Vmnqxx	
 rQ   c                re   rZ   rf   rL   rN   rO   rP   rP      s&      3  RU rQ   c                 s@   \         P                  P                  R 4      '       d   R# VP                  pVP                  R4      '       EdS   \        P
                  ! 4       '       Ed7   VP                  R4      pV'       Ed   VP                  R4      '       Eg   \        P                  ! 4       pV'       dL   V\        8  dA   \        R4      \        P                  ! V4      \        P                  ! \        4      3,          # \        P                  ! 4       pV'       d   V^ ,          P                  \        8  dd   \        R4      V^ ,          P                  \        P                  ! V^ ,          P                  4      \        P                  ! \        4      3,          # R# )r   Ndxvkdxvk_versionzv1.z<b>Warning</b> Lutris has detected that Vulkan API version %s is installed, but to use the latest DXVK version, %s is required.z<b>Warning</b> Lutris has detected that the best device available ('%s') supports Vulkan API %s, but to use the latest DXVK version, %s is required.)rs   r   rU   rT   r)   r   
startswithr(   Zget_vulkan_api_versionr0   rk   Zformat_versionZget_device_infoZapi_versionname)r[   rI   rT   rS   Zlibrary_api_versionZdevicess   &&    rO   _get_dxvk_version_warningr      s:   	zz~~)**((M  \%E%E%G%G##N377--e44")"@"@"B"':=X'XJ ++,?@'BXBXYtBuvw w
 --/G71:114OOJ AJOO**71:+A+AB**+FG  rQ   c                re   rZ   rf   rL   rN   rO   rP   rP      s%     	 	C 	 	(3- 	rQ   c                     VP                   P                  R 4      '       d   \        4       pV'       g   \        R4      # R# )esyncz<b>Warning</b> Your limits are not set correctly. Please increase them as described here:
<a href='https://github.com/lutris/docs/blob/master/HowToEsync.md'>How-to-Esync (https://github.com/lutris/docs/blob/master/HowToEsync.md)</a>rq   )rT   rU   rD   rk   )r[   rI   Z
limits_setrc   rO   _get_esync_warningr      s<    ((')
^ 
 rQ   c                re   rZ   rf   rL   rN   rO   rP   rP      s%      C  (3- rQ   c                 r   )fsyncz4<b>Warning</b> Your kernel is not patched for fsync.N)rT   rU   rE   rk   )r[   rI   fsync_supportedrc   rO   _get_fsync_warningr      s3    ((,.KLLrQ   c                re   rZ   rf   rL   rN   rO   rP   rP      s&      c < HUXM rQ   c                 s   \        R 4      pVP                  pVP                  R4      '       dR   \        VP                  R4      4      P	                  4       pRV9   g   RV9   d   VR,          pV\        R4      ,          pV# )z+Wine virtual desktop is no longer supportedDesktoprS   z-ge-r-   Z
zAVirtual desktops cannot be enabled in Proton or GE Wine versions.)rk   rT   rU   r]   casefold)r[   rI   messagerT   rS   ry   rO   _get_virtual_desktop_warningr      st    =>G((M##m''	23<<>WG 3tOGq\]]GNrQ   c                re   rZ   rf   rL   rN   rO   rP   rP      s&      3  RU rQ   c                 s&   VP                   pVP                  R 4      R8X  do   VP                  R4      pV'       g   R# \        4       '       d   \        R4      # \	        V4      '       g(   \        V4      '       d   \        R4      # \        R4      # R# )ra   rb   rS   NzAYou cannot use winewayland driver when using an X11-based sessionz@Your Proton version does not support winewayland graphics driver>Your Wine version does not support winewayland graphics driver)rT   rU   r&   rk   rG   rX   )r[   rI   rT   runner_versionro   rO   _get_wine_wayland_warningr      s|    ((M$	1&**95XYY'77 (([\\YZZrQ   c            
      sb   \        R 4      R3.p R\        R4      R\        R4      R\        R4      R\        R	4      /p\        4       pV Fb  pV\        8X  d   \        R
4      pM6W19   d/   \        \        V,          4      pW,          P                  V4      pMTpV P                  WC34       Kd  	  V # )z Custom (select executable below)Zcustomzwinehq-develzWineHQ Devel ({})zwinehq-stagingzWineHQ Staging ({})zwine-developmentzWine Development ({})r#   zSystem ({})zGE-Proton (Latest))rk   r>   r9   rB   r;   rM   append)version_choicesZsystem_wine_labelsZversionsrS   labelZversion_numbers         rO   _get_wine_version_choicesr      s    <=xHIO-.!12A56!M"	 +,H&&*+E*4Z5HIN&/66~FEE/0  rQ   c            )       sF  a a ] tR t^t o]! R4      t]! R4      t]! R4      .tRtRt	RRRRR	]! R
4      R]! R4      R]
/RRRRR	]! R4      R]! R4      R]P                  /RRRRR	]! R4      R]! R4      /RRRRR	]! R4      R]R]! R4      /RRRRR	]! R4      R]R]! R4      R 3]! R!4      R"3]! R#4      R$3.R%R R]! R&4      /RR'RR(R	]! R)4      R%R*R+RR]! R,4      /.tRR-R	]! R.4      RRR]R%]R]R]! R/4      /RR0R	]! R14      RRR+RR]! R24      /RR3R	]! R44      RR(R%R*R+RR]! R54      /RR6R7]! R84      R	]! R94      RR(R%RR]R:R; R<RR]! R=4      /	RR>R7]! R84      R	]! R?4      R+RRR@R]RA]P*                  ! 4       RBR6RRC R%RD R]/RRER7]! R84      R	]! RF4      RR(R]R:RG R%RR<RR]! RH4      /	RRIR7]! R84      R	]! RJ4      R+RRR@R]RA]P*                  ! 4       RBRERRK R%RL /
RRMR7]! R84      R	]! RN4      RR(R%RR+RR]! RO4      /RRPR7]! R84      R	]! RQ4      R+RRBRMRR@RRR R%RS /RRTR7]! R84      R	]! RU4      RR(R:RV R%RR+RR]R]! RW4      /	RRXR7]! R84      R	]! RY4      R+RRBRTR]RR@RRZ R%R[ /	RR\R7]! R84      R	]! R]4      RR(R%R*R+RR]R]! R^4      /RR_R	]! R`4      RR(R]R<RR%RR]! Ra4      /RRbR	]! Rc4      RR(R%]! 4       R]R<RR]! Rd4      /RReR	]! Rf4      RR(R%RR]! Rg4      /RRhR	]! Ri4      RR(R%RR]! Rj4      /RRkR	]! Rl4      RR(R%RR]! Rm4      /RRnR7]! Ro4      R	]! Rp4      RR(R+RR]R]R%R*R]! Rq4      /	RRrR7]! Ro4      R	]! Rs4      RR@R]RBRnR+RR]P:                  R]! Rt4      /	RRuR7]! Rv4      R	]! Rw4      RR(R+RR%R*R]! Rx4      /RRyR7]! Rv4      R	]! Rv4      RRRBRuR+RR%]! ]! 4       4      R]! Rz4      /RR{R	]! R|4      RRR]! R}4      R~3]! R4      R3]! R4      R3.R%R~R+RR]! R4      /RRR	]! R4      RRR+RR]! R4      R 3RRR.R%R R]! R4      /RR8R	]! R4      RRR+RR]! R4      R 3RR.R%R R] R]! R4      /RRRRR	]! R4      R]! R4      /RRR	]! R4      RRR]! R4      R3]! R4      R3]! R4      R3]! R4      R3]! R4      R3.R%RR]! R4      /RRR	]! R4      RR(R%R*R+R/RRRR(R	]! R4      R+RR%R*R]! R4      /.t!Rt"RR]",          R8R]",          R{R]",          RnRRrRRR/t#Rt$RV 3R llt%]&R 4       t']&R 4       t(]&R 4       t)]&V 3R l4       t*]&R 4       t+]&R 4       t,RV3R lV 3R lllt-RV3R lR llt.V3R lR lt/RV 3R llt0R t1RV3R lR llt2V3R lV 3R llt3RV3R lR llt4R t5RV3R lR llt6V3R lR lt7]8V3R lR l4       t9]8RR l4       t:R t;R t<R t=R t>V3R lR lt?V3R lR lt@R tAR tBR tCR tDR tEV3R lR ltFR tGRR ltHR tIRV 3R lltJV3R lV 3R lltKR tLR tMR tNV3R lR ltOV3R lV 3R lltPV3R lV 3R lltQR tRV3R ltSRtTVtUV ;tV# )winezRuns Windows gamesZWineZWindowsTrn   ZoptionZtypeZfiler   Z
ExecutableZhelpzThe game's main EXE filewarningargsZstringZ	Argumentsz;Windows command line arguments used when launching the gameZ	validatorrr   Z	directoryzWorking directoryzaThe location where the game is run from.
By default, Lutris uses the directory of the executable.rm   zWine prefixzyThe prefix used by Wine.
It's a directory containing a set of files and folders making up a confined Windows environment.rg   ZchoicezPrefix architectureZvisibleZchoicesZAutoautoz32-bitrh   z64-bitwin64defaultz+The architecture of the Windows environmentdesktop_integrationrK   z$Integrate system files in the prefixFZadvancedzPlace 'Documents', 'Pictures', and similar files in your home folder, instead of keeping them in the game's prefix. This includes some saved games.rS   zWine versionzThe version of Wine used to launch the game.
Using the last version is generally recommended, but some games work better on older versions.Zcustom_wine_pathzCustom Wine executablezQThe Wine executable to be used if you have selected "Custom" as the Wine version.system_winetrickszUse system winetricksz4Switch on to use /usr/bin/winetricks for winetricks.r   Zsectionra   zEnable DXVKerrorc                ,    \        W\        R 4      4      # )ZDXVKr   rk   ZkZcr_   rO   <lambda>wine.<lambda>b  s    "B16"SrQ   Zactivez~Use DXVK to increase compatibility and performance in Direct3D 11, 10 and 9 applications by translating their calls to Vulkan.r   zDXVK versionZchoice_with_entryZ	conditionZconditional_onc                 *    \        4       P                  # r^   )r1   r    rQ   rO   r   r   s  s    {}<<rQ   c                 r   r^   )r1   rS   r   rQ   rO   r   r   t  s    {}44rQ   vkd3dzEnable VKD3Dc                r   )ZVKD3Dr   r   r_   rO   r   r   }  s    "B17"TrQ   z^Use VKD3D to enable support for Direct3D 12 applications by translating their calls to Vulkan.vkd3d_versionzVKD3D versionc                 r   r^   )r8   r   r   rQ   rO   r   r     s    |~==rQ   c                 r   r^   )r8   rS   r   rQ   rO   r   r     s    |~55rQ   
d3d_extraszEnable D3D Extrasz}Replace Wine's D3DX and D3DCOMPILER libraries with alternative ones. Needed for proper functionality of DXVK with some games.d3d_extras_versionzD3D Extras versionc                 r   r^   )r.   r   r   rQ   rO   r   r         /1AArQ   c                 r   r^   )r.   rS   r   rQ   rO   r   r         /199rQ   
dxvk_nvapizEnable DXVK-NVAPI / DLSSc                r   )zDXVK-NVAPI / DLSSr   r   r_   rO   r   r     s    "B1K^I_"`rQ   zFEnable emulation of Nvidia's NVAPI and add DLSS support, if available.dxvk_nvapi_versionzDXVK NVAPI versionc                 r   r^   )r2   r   r   rQ   rO   r   r     r   rQ   c                 r   r^   )r2   rS   r   rQ   rO   r   r     r   rQ   
proton_hdrzEnable HDR (Experimental)zgEnable Proton's support for High Dynamic Range graphics. Requires Wayland selected as Graphics backend.r   zEnable EsynczEnable eventfd-based synchronization (esync). This will increase performance in applications that take advantage of multi-core processors.r   zEnable FsynczEnable futex-based synchronization (fsync). This will increase performance in applications that take advantage of multi-core processors. Requires kernel 5.16 or above.fsrz,Enable AMD FidelityFX Super Resolution (FSR)zUse FSR to upscale the game window to native resolution.
Requires Lutris Wine FShack >= 6.13 and setting the game to a lower resolution.
Does not work with games running in borderless window mode or that perform their own upscaling.battleyezEnable BattlEye Anti-CheatzEnable support for BattlEye Anti-Cheat in supported games
Requires Lutris Wine 6.21-2 and newer or any other compatible Wine build.
eaczEnable Easy Anti-Cheatz}Enable support for Easy Anti-Cheat in supported games
Requires Lutris Wine 7.2 and newer or any other compatible Wine build.
r   zVirtual DesktopzWindowed (virtual desktop)z{Run the whole Windows desktop in a window.
Otherwise, run it fullscreen.
This corresponds to Wine's Virtual Desktop option.WineDesktopzVirtual desktop resolutionz*The size of the virtual desktop in pixels.DpiZDPIzEnable DPI Scalingz}Enables the Windows application's DPI scaling.
Otherwise, the Screen Resolution option in 'Wine configuration' controls this.ExplicitDpiz8The DPI to be used if 'Enable DPI Scaling' is turned on.ZMouseWarpOverridezMouse Warp OverrideZEnableZenableZDisableZdisableZForceZforcezOverride the default mouse pointer warping behavior
<b>Enable</b>: (Wine default) warp the pointer when the mouse is exclusively acquired 
<b>Disable</b>: never warp the mouse pointer 
<b>Force</b>: always warp the pointerZAudiozAudio driverz_Which audio backend to use.
By default, Wine automatically picks the right one for your system.zGraphics driverzbWhich graphics backend to use.
By default, Wine automatically picks the right one for your system.	overridesZmappingzDLL overridesz.Sets WINEDLLOVERRIDES when launching the game.
show_debugzOutput debugging infoZDisabled-allZEnabledrq   zInherit from environmentinheritzShow FPSz+fpsz+Full (CAUTION: Will cause MASSIVE slowdown)+allzGOutput debugging information in the game log (might affect performance)ShowCrashDialogzShow crash dialogsautoconf_joypadzAutoconfigure joypadsz[Automatically disables one of Wine's detected joypad to avoid having 2 controllers detectedzHKEY_CURRENT_USER/Software/Winez
%s/Driversz%s/DirectInputZMANAGEDc                s~   < \         SV `  V4       W n        W0n        W@n        \
        P                  ! 4       V n        R # r^   )super__init___prefix_working_dir
_wine_archr5   Zcopydll_overrides)selfrI   rm   rr   	wine_arch	__class__s   &&&&&rO   r   Zwine.__init__  s1     '#2779rQ   c                sz   R\        R4      V P                  3R\        R4      V P                  3R\        R4      V P                  3RR\        R4      V P                  3R	\        R
4      V P
                  3R\        R4      V P                  3R\        R4      V P                  3RR\        R4      V P                  3.
# )z*Return the contexual menu entries for winer   zRun EXE inside Wine prefixZ	wineshellzOpen Bash terminalwineconsolezOpen Wine consoler   zWine configurationzwine-regeditzWine registryZwinecplzWine Control PanelZwinetaskmgrzWine Task Managerr!   Z
Winetricks)NZ-N)	rk   run_wineexecrun_wine_terminalrun_wineconsolerun_winecfgrun_regeditrun_winecplrun_taskmgrrun_winetricksr      &rO   context_menu_entriesZwine.context_menu_entries  s     78$:K:KL!0143I3IJA12D4H4HI./1A1ABQ/1A1AB./1A1ABA12D4D4DE1\?D,?,?@
 	
rQ   c                s|   V P                   ;'       gC    V P                  P                  R4      ;'       g     \        P                  P                  R4      pV'       g7   V P                  P                  R4      '       d   \        V P                  4      pV'       d    \        P                  P                  V4      pV# )zOReturn the absolute path of the Wine prefix. Falls back to default WINE prefix.rm   
WINEPREFIXrn   )	r   rj   rU   rs   r   r7   game_exert   rw   )r   Z_prefix_pathrW   rO   prefix_pathZwine.prefix_path  s     ||eet'7'7';';H'EeeXdIe 0 0 4 4U ; ;&t}}5L77--l;LrQ   c                s   V P                   P                  R4      pV'       g   \        P                  ! R4       R# \        P
                  P                  V4      p\        P
                  P                  V4      '       d   \        P                  ! V4      # V P                  '       g   \        P                  ! R4       R# \        P                  ! \        P
                  P                  V P                  V4      4      # )z_Return the game's executable's path, which may not exist. None
if there is no exe path defined.rn   z#The game doesn't have an executableNz/The game has an executable, but not a game path)rj   rU   r*   r   rs   rt   rw   ru   r#   rx   	game_pathr   rv   )r   rn   rW   rO   r   Zwine.game_exe  s     ""5)LL>?gg  %77=='',,~~~NNLM##BGGLL$EFFrQ   c                s  < V P                   ;'       g    V P                  P                  R4      pV'       d    \        P                  P                  V4      # V P                  '       dQ   \        P                  P                  V P                  4      p\        P                  P                  V4      '       d   V# \        SV `(  # )z:Return the working directory to use when running the game.rr   )r   rj   rU   rs   rt   rw   r   dirnameZisdirr   rr   )r   r   Zgame_dirr   s   &  rO   rr   Zwine.working_dir  s     ((OOD,<,<,@,@,O77%%l33===wwt}}5Hww}}X&&w""rQ   c                sB    V P                   ;'       g    V P                  # )z<WINE should give each game its own shader cache if possible.)r   Zshader_cache_dirr   r   rO   nvidia_shader_cache_pathZwine.nvidia_shader_cache_path  s     ~~66!6!66rQ   c                s    V P                   ;'       g&    V P                  P                  R4      ;'       g    RpVR9  d6   V P                  pV'       d   \	        W P                  4       4      pV# \        pV# )zRReturn the wine architecture.

Get it from the config or detect it from the prefixrg   r   )rh   r   )r   rj   rU   r   r<   get_executabler:   )r   rg   r      &  rO   r   Zwine.wine_arch  sk    
 HH$"2"2"6"6v">HH&))**K";0C0C0EF  )rQ   c                s\   < V ^8  d   QhRS[ S[,          RS[ S[S[S[3,          ,          /# rH   rS   rJ   )r   r]   r   rM   __classdict__   "rO   rP   wine.__annotate__  s/     3 3(3- 38DQTVYQYNC[ 3rQ   c                s@   < V\         9   d   R V/# \        SV `	  V4      # rR   )r;   r   get_runner_version)r   rS   r      &&rO   r   Zwine.get_runner_version  s&    j w''w)'22rQ   c                s6   < V ^8  d   QhRS[ S[,          RS[/# )rH   r   rJ   r|   r   r   rO   rP   r     s     * * * *rQ   c                s   V P                   P                  V P                   P                  3 F=  pRV9   g   K  VR,          P                  R4      pV'       g   K.  V\        8w  g   K;  Vu # 	  V'       d   V# \        4       # )zReturn the Wine version to use. use_default can be set to false to
force the installation of a specific wine version. If no version is configured,
we return the default supplied, or the4 global Wine default if none is.r   rS   )rI   Z
game_levelrunner_levelrU   r9   r=   )r   r   Zlevelr   ro   rO   read_version_from_configZwine.read_version_from_config  si     kk,,dkk.F.FGE!&v!2!29!=!>n8H&H)) H N'))rQ   c                s&   < V ^8  d   QhRS[ RS[ /# r   r]   r   r   rO   rP   r     s     M MC MC MrQ   c                s.    \        WP                  R7      # )zAReturn the absolute path of a wine executable for a given version)rI   )rC   rT   )r   rS   r_   rO   get_path_for_versionZwine.get_path_for_version  s    (9K9KLLrQ   c                s  < \         SV `  W4      p\        P                  ! V4      p\        P
                  P                  V4      '       gA   R V9   d:   VP                  R R4      p\         SV `  WB4      p\        P                  ! V4      pV# V# )Z\/)r   resolve_config_pathr#   rx   rs   rt   existsZreplace)r   rt   Zrelative_toZresolvedZfixedZfixed_resolvedr   s   &&&   rO   r   Zwine.resolve_config_path  sw     7.tA''1ww~~h''DDLLLs+E"W8LN#11.AN!!rQ   c                s   VP                  R4      pV'       g   R# \        P                  P                  V4      p\        P                  P	                  V4      '       d   \
        P                  ! V4      # V P                  '       d?   \
        P                  ! \        P                  P                  V P                  V4      4      # V# )zDResolve launch config exe relative to game_path, like game_exe does.rn   N)	rU   rs   rt   rw   ru   r#   rx   r   rv   )r   Zlaunch_configrn   rc   rO   get_launch_config_exeZwine.get_launch_config_exe  s    &gg  %77=='',,>>>''T^^S(IJJ
rQ   c                s,   < V ^8  d   QhRS[ RS[RS[ /# )rH   rS   fallbackrJ   )r]   rK   r   r   rO   rP   r   )  s"     $ $c $$ $# $rQ   c                s   V'       g   V P                  4       pV\        8X  d   \        P                  ! 4       # \        P                  ! V4      '       d   \        P
                  ! V4      #  V P                  V4      p\        P                  ! V4      '       d   V#  V'       g   \        \        R4      X,          4      h\        4       pV P                  V4      p\        P                  ! V4      '       g   \        \        R4      V,          4      hWP                  P                  R4      8X  d   W@P                  R&   V#   \         d    T'       g   h  Li ; i)zWReturn the path to the Wine executable.
A specific version can be specified if needed.
z'The Wine executable at '%s' is missing.rS   )r   r9   r-   get_umu_pathrV   Zget_proton_wine_pathr   r#   path_existsr   rk   r=   rT   rU   )r   rS   r   	wine_pathZdefault_versions   &&&  rO   r   Zwine.get_executable)  s)    335G&&&&((##G,,..w77	11':I!!),,   - (+T)UXa)abb 34--o>	!!),,(+T)UXa)abb ((,,Y77,;y) + & 	 	s   ,,E  E   EEEc                s0   < V ^8  d   QhRS[ S[,          /# r{   )r   r]   r   r   rO   rP   r   O  s     	 	T#Y 	rQ   c                s  < \         SV `  4       pV'       d   \        P                  ! V^ ,          4      '       d<   \        P                  ! V^ ,          4      '       g   \        P
                  ! 4       V^ &   \        P                  ! V^ ,          4      '       d&   V P                  R8X  d   \        \        R4      4      hV# )i    rh   ri   )	r   get_commandr-   is_proton_pathis_umu_pathr   r   ZRuntimeErrorrk   )r   commandr      & rO   r   Zwine.get_commandO  s    '%'$$WQZ009K9KGTUJ9W9W#002
!!'!*--$..G2K"1%U#VWWrQ   c                s2   < V ^8  d   QhRS[ RS[RS[ RS[ /# )rH   flatpak_allowedrS   r   rJ   )rK   r]   r   r   rO   rP   r   Z  s+      D # X\ hl rQ   c                s     V'       d   V P                  W#4       R# \        \        4       4      #   \         d     R# i ; i)z`Check if Wine is installed.
If no version is passed, checks if any version of wine is available
TF)r   rK   r>   r   )r   r   rS   r   s   &&&&rO   is_installedZwine.is_installedZ  s<    	##G63566$ 		s   0 0 0 ??c                s     V P                  VP                  R R7      pV P                  VRR7      #   \         d     R# i ; i)T)use_apiF)rS   r   )get_installer_runner_version	installerr   r   )r   ZinterpreterrS   rc   rO   is_installed_forZwine.is_installed_forh  sK    	778M8MW[7\G$$Wu$EE$ 		s   /2 A Ac                s<   < V ^8  d   QhRS[ RS[ RS[S[,          /# )rH   use_runner_configr   rJ   )rK   r   r]   r   r   rO   rP   r   o  s)     # #,0#BF#	##rQ   c                sl   R pVP                   P                  VP                  4      '       d9   VP                   VP                  ,          P                  R4      p\        V4      pMVP                  '       d   \        VP                  RR7      pV'       g   \        VP                  RR7      pV'       g&   \        \        R4      VP                  ,          4      h\        VR,          4      pVP                  '       d   VP                  P                  R,          pMR pV'       g%   V'       d    \        P                  4       ^ ,          # V'       gQ   V'       dI   V P                  4       pV'       d1   RV9   d*   \        P                   ! RVR,          4       \#        V4      pV#   \         d     Lgi ; i)NrS   Zinstaller_slug)ZfieldZslugz*The required game '%s' could not be found.ZidzDefault wine version is %s)ZscriptrU   runnerr   Zrequiresr   r   rk   r   rI   rT   r   get_runner_version_and_configr   r   r*   debugr
   )r   r   r   r   rS   Zdb_gamegameZdefault_version_infos   &&&&    rO   r   Z!wine.get_installer_runner_versiono  sO    	 0 011&&y'7'78<<YGG4W=G'	(:(:BRSG+I,>,>fM+A.Z,[^g^p^p,pqq&D{{{++33I>,99;A>> 7#'#:#:#< #	5I(I9;OPY;Z[/0DE + s   0F% %F32F3c                s:   < V ^8  d   QhRS[ S[S[3,          RR/# )rH   installer_runner_configrJ   Nr   r]   r   r   r   rO   rP   r     s)     Y Yd3PS8n YY] YrQ   c                sX    VP                  R 4      pV'       d   \        V4      VR &   R# R# )rS   N)rU   r   )r   r   rS   rc   rO   adjust_installer_runner_configZ#wine.adjust_installer_runner_config  s+    )--i81OPW1X#I. rQ   c                6   < V ^8  d   QhRS[ S[S[3,          /# r{   )r   r]   r   r   r   rO   rP   r     s!     f feC4E.F frQ   c                s    \        R R7      pR VP                  9   d.   VP                  R ,          P                  R4      pV'       d   W!3# \        \	        R4      4      h)r   )Zrunner_slugrS   z9The runner configuration does not specify a Wine version.)r   r   rU   r   rk   )clsrT   Zconfig_versionr   rO   r   Z"wine.get_runner_version_and_config  sR    $8]///*77?CCINN%44%a(c&deerQ   c           	     sX    R V,          pV'       d
   VR,          p\        RVVVVVR7      # )z/i %sz /qZmsiexec)r   rm   r   rr   blocking)r   )r  Zmsi_fileZquietrm   r   rr   r  Zmsi_argss   &&&&&&& rO   msi_execZwine.msi_exec  s:     X%H#
 	
rQ   c                s    \        VV P                  4       V P                  V P                  V V P                  RR7      V R7       R# )z9Runs a Windows executable using this game's configurationTos_env)r   rm   rr   rI   envr   N)r   r   r   get_env)r   Z
executabler_   rO   _run_executableZwine._run_executable  s?    ))+##((D)	
rQ   c                s    \        \        R4      V P                  R7      pVP                  pV'       g   R# V P	                  4        V P                  V4       R# )zBAsk the user for an arbitrary exe file to run in the game's prefixzSelect an EXE or MSI file)Zdefault_pathN)r   rk   r   filename	prelaunchr  )r   r   Zdlgr     &*  rO   r   Zwine.run_wineexec  s?    67dnnU<<X&rQ   c                H    V P                  4        V P                  R4       R# )z$Runs wineconsole inside wine prefix.r   Nr  r  r   r      &*rO   r   Zwine.run_wineconsole  s    ]+rQ   c           
     s    V P                  4        \        V P                  4       V P                  V P                  V V P                  RR7      V R7       R# )z"Run winecfg in the current contextTr  )r   rm   rg   rI   r	  r   N)r  r   r   r   r   r
  r  r  rO   r   Zwine.run_winecfg  sD    ))+##D)	
rQ   c                   < V ^8  d   QhRR/# rH   rJ   Nr   r   r   rO   rP   r     s     ( (D (rQ   c                r  )z"Run regedit in the current contextZregeditNr  r  r  rO   r   Zwine.run_regedit      Y'rQ   c                r  r  r   r   r   rO   rP   r     s     	
 	
$ 	
rQ   c           	     s    V P                   P                  R 4      pV P                  P                  RR4      p\        VV P	                  4       V P
                  V P                  RR7      VR7       R# )Zterminal_appr   FTr  )terminalr   rm   r	  r   N)system_configrU   rT   r   r   r   r
  )r   r   r  r   r  rO   r   Zwine.run_wine_terminal  sc    %%)).9"&"4"4"8"89Le"T))+##D)/	
rQ   c                s   V P                  4        V P                  4       '       * pV P                  P                  R4      pV'       d   Rp\	        RV P
                  V P                  4       V VVV P                  RVR7      V R7       R# )z%Run winetricks in the current contextr   Trq   )r  disable_runtime)rm   r   rI   r  r   r	  r   N)r  Zuse_runtimerT   rU   r!   r   r   r
  )r   r   r  r   r  rO   r   Zwine.run_winetricks  s{    "..00 ..223FG #O##))++/D/J		
rQ   c                r  )zExecute Wine control panel.ZcontrolNr  r  r  rO   r   Zwine.run_winecpl  r  rQ   c                r  )zExecute Wine task managerZtaskmgrNr  r  r  rO   r   Zwine.run_taskmgr  r  rQ   c                s    \        V P                  V P                  V P                  4       V P	                  4       V P                  4       R7       R# )zRuns wineserver -k.rg   r   r	  Zinitial_pidsT)r    r   r   r   r
  get_wine_executable_pidsr  r  rO   run_winekillZwine.run_winekill  sB     	))+668	
 rQ   c                sB   \        V P                  4      pRVP                  RVP                  RVP                  /pV P
                  P                  4        EF  w  r4V P                  P                  V4      ;'       g    RpV'       d   VR8X  d   W29  d   VP                  WC4       KS  W0P                  9   g   Ke  V'       dr   VR8X  dk   VR8X  dd   \        V P                  4       4      '       g   \        P                  ! R4       K  \        P                  ! V P!                  4       4      '       d   K  W29   d   VR8X  d   RpV'       dm   VR9   df   R	V P!                  4       P#                  4       9   g+   \        P                  ! V P!                  4       4      '       d   \        P                  ! R
4       RpW#,          ! V4       EKr  VP%                  4       '       d   \'        V4      pVP)                  WCV4       EK  	  VP+                  V P-                  4       4       R# )z'Reset regedit keys according to config.r   r   r   r   ra   rb   r   Nzwine-gez:Wine Virtual Desktop can't be used with Wine-GE and Proton)r   r   )r6   r   Zset_crash_dialogsZset_virtual_desktopZset_desktop_sizereg_keysitemsrT   rU   Zclear_registry_subkeysrG   r   r*   r   r-   r   r   r   ZisdigitintZset_registry_keyZset_dpiget_dpi)r   prefix_managerZmanaged_keysZkeyrt   Zvalues   &     rO   set_regedit_keysZwine.set_regedit_keys  s   *4+;+;< ~??~99>::

 ,,.IC&&**3/996EUf_1H55d@***SJ.5I3E3D4Q4Q4STT'gh ,,T-@-@-BCC & $#==%)<)<)>)G)G)II%44T5H5H5JKK 'cd $ %e,==??JE//5AC /J 	t||~.rQ   c                s    < V ^8  d   QhRS[ /# r{   )r  r   r   rO   rP   r   J  s     ! ! !rQ   c                s    \        V P                  P                  R4      4      '       d/    \        V P                  P                  R\	        4       4      4      # \	        4       #    \	        4       u # ; i)zVReturn the DPI to be used by Wine; returns None to allow Wine's own
setting to govern.r   r   )rK   rT   rU   r  r%   r   r   rO   r  Zwine.get_dpiJ  sa     ""&&u-..)4--11-ARSTT   )&((s   ,A# #A1c                sD   V P                   pV'       Ed   \        P                  P                  V4      '       d7   \        P                  P	                  V4      '       g   \        R V R2VR7      h\        P                  ! \        P                  P                  VR4      4      '       g>   \        P                  ! RV4       \        WP                  4       V P                  V R7       \        V4      pVP                  4        V P                   P#                  RR4      '       d   VP%                  4        VP'                  4        V P)                  V4       V P+                  4        V P-                  4       P/                  4        F  w  r4VP1                  V4       K  	  R# R# )	zLink z; couldn't be used, please check permissions or broken link.)r   Zlinkzuser.regz/No valid prefix detected in %s, creating one...)r   rg   r   r   FN)r   rs   rt   Zislinkr   r   r#   r   rv   r*   r   r   r   r   r6   Zcleanup_broken_symlinksrT   rU   Zconfigure_joypadsZcreate_user_symlinksconfigure_desktop_integrationr!  get_dll_managersr  Zsetup)r   r   r   managerenableds   &    rO   r  Zwine.prelaunchT  s6   &&;ww~~k**277>>+3N3N+#K=0kl$  %%bggll;
&KLLPR]^k5H5H5JQUQ_Q_hlm.{;N224!!%%&7??002//1..~>!!#$($9$9$;$A$A$C g& %D% rQ   c                s2   \         RR3\        RR3\        RR3\        RR3\        R	R
3.p/ p\
        P                  ! V P                  4       4      pV F  w  rVp\        V P                  P                  V4      4      pV P                  P                  V4      p	V'       g   V'       d   KW  V! V P                  V P                  V	R7      p
V
P                  4       '       g   RpV
P                  '       g   V'       d   RpV'       g   V'       d   K  WV
&   K  	  V# )zReturns the DLL managers in a dict; the keys are the managers themselves,
and the values are the enabled flags for them. If 'enabled_only' is true,
only enabled managers are returned, so disabled managers are not created.r   r   r   r   r   r   r   r   Z	dgvoodoo2Zdgvoodoo2_version)rg   rS   F)r1   r8   r2   r.   r/   r-   r   r   rK   rT   rU   r   r   Z
can_enableZproton_compatible)r   enabled_onlyZmanager_classesZmanagers	is_protonZmanager_classZenabled_optionZversion_optionr%  rS   r$  s   &&         rO   r#  Zwine.get_dll_managersk  s    
 &.17O4|-AB|-AB{,?@
 ))$*=*=*?@	=L9M>4--11.ABG((,,^<Gll'(8(8t~~W^_))++#G000Y#G,,(/W% >M rQ   c                s     V P                   R,          p\        V\        4      '       g   \        P
                  ! RV4       / pV#   \         d    / p L@i ; i)z$Return the DLLs overriden at runtimer   z"DLL overrides is not a mapping: %s)rT   ZKeyErrorZ
isinstanceZdictr*   r   )r   r   rW   rO   get_dll_overridesZwine.get_dll_overrides  sV    	**;7I )T**NN?KI  	I	s   A AAc                s
  < \         SV `  WR7      pV P                  P                  RR4      pVR8w  d2   WCR&   RVR&   RVR	&   VR
8X  d   RVR&   RVR	&   MVR8X  d   RVR&   RVR	&   V P                  VR&   V P                  4       p\        P                  ! V4      pV P                  4       pV\        8X  d	   RVR&   RpM\        P                  ! V4      pWSR&   \        V4      p	V	'       dG   \        P                  P                  V	R4      VR&   \        P                  P                  V	R4      VR&   V	'       d   V'       g   \        V4      '       d   \        P                  P                  V	R4      p
\        P                  P                  V	R4      p\        P                  P!                  V
4      '       g&   \        P                  P!                  V4      '       d   V
R,           V,           VR&   V P"                  '       d   V P"                  VR&   RV9  d)   V P                  P                  R4      '       d   RMRVR&   R V9  d'   V P                  P                  R4      '       g   RVR &   R!V9  d)   V P                  P                  R"4      '       d   RMRVR!&   R#V9  d'   V P                  P                  R"4      '       g   RVR#&   V P                  P                  R$4      '       d   RVR%&   V P                  P                  R&4      '       d   RVR'&   RVR(&   V P                  P                  R)4      '       d2   \        P                  P                  \$        P&                  R*4      VR+&   V P                  P                  R,4      '       d2   \        P                  P                  \$        P&                  R-4      VR.&   V P                  P                  R/4      ;'       d    \(        P*                  pV'       g   RVR0&   R1V9  d   V'       d   RMRVR1&   V P                  P                  R24      R38X  dE   \-        V4      '       d4   V'       d,   RVR4&   V P                  P                  R54      '       d   RVR6&   V P/                  RR77       F,  pV P0                  P3                  VP5                  4       4       K.  	  V P7                  4       pV'       d   V P0                  P3                  V4       \9        V P0                  4      VR8&   V# )9z-Return environment variables used by the game)r  r   r   r   Z	WINEDEBUGr   ZDXVK_LOG_LEVEL1ZUMU_LOGrq   Zinfor   r   r   ZWINEARCHz	GE-ProtonZ
PROTONPATHTZWINEZmonoZWINE_MONO_CACHE_DIRZgeckoZWINE_GECKO_CACHE_DIRzlib64/gstreamer-1.0/zlib/gstreamer-1.0/Z:ZGST_PLUGIN_SYSTEM_PATH_1_0r   	WINEESYNCr   Z0ZPROTON_NO_ESYNC	WINEFSYNCr   ZPROTON_NO_FSYNCr   ZWINE_FULLSCREEN_FSRr   ZDXVK_NVAPIHACKZDXVK_ENABLE_NVAPIr   Zbattleye_runtimeZPROTON_BATTLEYE_RUNTIMEr   Zeac_runtimeZPROTON_EAC_RUNTIMEr   ZPROTON_USE_WINED3DZPROTON_DXVK_D3D8ra   rb   ZPROTON_ENABLE_WAYLANDr   ZPROTON_ENABLE_HDR)r&  ZWINEDLLOVERRIDES)r   r
  rT   rU   r   r   r-   r   r   r9   rV   rA   rs   rt   rv   rF   r   r   r	   ZRUNTIME_DIRr)   r   rG   r#  r   ZupdateZget_enabling_dll_overridesr(  r?   )r   r  r  r	  r   wine_exer'  Zwine_config_versionrV   Z	files_dirZpath_64Zpath_32
using_dxvkZdll_managerr   r   s   &&&            rO   r
  Zwine.get_env  sH   
 gofoF''++L&A
")$+C ! C	NR(.$%!*Iv%(/$%!(I..J&&())(3	";;="22 +C $ & 8 89L MF45HI	)+i)HC%&*,'',,y'*JC&' Y+=h+G+Gggll9.DEGggll9.BCGww~~g&&"''..*A*A4;cMG4K01 $ 0 0Cc!&*&8&8&<&<W&E&Es3C C'0B0B0F0Fw0O0O%(C!"c!&*&8&8&<&<W&E&Es3C C'0B0B0F0Fw0O0O%(C!"!!%((),C%&!!,//$'C !'*C#$!!*---/WW\\(:N:NPb-cC)*!!%(((*X5I5I=(YC$%''++F3XX8X8X
(+C$%S(-7cSC"# "":.);()<==!+.C'(!!%%l33+.'(00d0CK%%k&L&L&NO D **,	%%i0"3D4F4F"G
rQ   c                s:   < V ^8  d   QhRS[ S[S[3,          RR/# )rH   r	  rJ   N)r   r]   r   r   rO   rP   r     s'     E Ed38n Et ErQ   c                s  < \         SV `  W4       V P                  4       p\        P                  ! V4      '       g   \        P
                  ! V4      '       d1   \        P                  ! W!4      p\        P                  ! W1VR 7       R# R# ))game_idN)r   
finish_envr   r-   r   r   Zget_game_idZupdate_proton_env)r   r	  r   r,  r.  r   s   &&&  rO   r/  Zwine.finish_env  se    3%&&(  **f.@.@.J.J((3G$$XGD /KrQ   c                s$    \         P                  P                  \         P                  P                  V P                  4       4      4      p\
        P                  ! RV P                  P                  RR4      VR7      #   \         d    Rp LBi ; i)zHReturn runtime environment variables with path to wine for Lutris buildsNzUbuntu-18.04prefer_system_libsT)rS   r0  r   )	rs   rt   r   r   r   r   r
  r  rU   )r   r   rW   rO   get_runtime_envZwine.get_runtime_env  su    	8K8K8M(NOI "#11556JDQ
 	
 % 	I	s   A
A? ?BBc                s    V P                  4       p\        P                  ! V4      '       d!   \        P                  ! R4       \        4       # VP                  R4      '       g   \        P                  ! V4      p\        P                  ! V4      pV P                  R8X  dI   \        P                  P                  V4      R8X  d%   V\        P                  ! VR,           4      ,          pT\        P                  ! \        P                  P                  \        P                  P!                  T4      R4      4      ,          pT#   \         d    \        4       u # i ; i)z>Return a list of pids of processes using the current wine exe.z;Tracking PIDs of Proton games is not possible at the momentr   r   r   Z64Z
wineserver)r   r-   r   r*   r   setr   r#   Zfind_required_executableZget_pids_using_filer   rs   rt   Zbasenamer   rv   r   )r   rn   Zpidsr   rO   r  Zwine.get_wine_executable_pids  s    	%%'C$$S))Z[u>>#&&55c:--c2D~~(RWW-=-=c-Bf-Lf88tDD f00bggooc>RT`1abb % 	5L	s#   +E E E %BE EEc                s     V P                   P                  R R4      '       d   VP                  4        R# VP                  4        R#   \         d#   p\
        P                  ! RT4        Rp?R# Rp?ii ; i)r   FzDFailed to setup desktop integration, the prefix may not be valid: %sN)rj   rU   Zinstall_desktop_integrationZremove_desktop_integration	Exceptionr*   	exception)r   Zwine_prefixexrc   rO   r"  Z"wine.configure_desktop_integration$  sa    	i##$95AA779668 	iceghh	is!   !A A A A5A00A5c                r  r{   r  r   r   rO   rP   r   -  s     $ $d38n $rQ   c                s@   V P                   pV P                  P                  R R4      pRV P                  RR7      /pV P                  P                  R4      ;'       d    \
        P                  pV'       d   RVR,          R&   V'       d   \        P                  ! V4      '       g   \        VR7      hVR,          P                  R	4      R8X  d   \        4       pV'       g   \        4       hVR,          P                  R
4      R8X  d   \        4       pV'       g   \        4       hV P                  4       p\        WP                   4      w  rp	VP#                  V4       V'       d	   Wx,           pV'       d$   \%        V4       F  p
VP#                  V
4       K  	  WsR&   V# )r   rq   r	  Fr  r   r)  ZWINE_LARGE_ADDRESS_AWARE)r  r*  r+  r   )r   rj   rU   r
  rT   r)   r   r#   r   r   rD   r   rE   r   r   r@   rr   r   r,   )r   r   Z	argumentsZlaunch_infor-  Z	limit_setr   r   r   r   Zargs   &          rO   playZ	wine.play-  sJ   ==))--fb9	"DLLL$>?''++F3XX8X8X
=@K9:v11(;;,h??u!!+.#5*,I%''u!!+.#502O"+--""$':8EUEU'V$x nG&y1s# 2!(IrQ   c          	      sR   < V ^8  d   QhRS[ S[,          RS[RS[RS[S[,          /# )rH   candidate_pids	game_uuidgame_folderrJ   )r   r  r]   r   r   r   rO   rP   r   S  s;     T Tx} T T[^ Tcfgjck TrQ   c                sB  <a \         P                  ! V P                  4       4      '       d   \        4       p\        4       pV P                  P                  R4      pV F  p\        V4      pVP                  ;'       g    Rp	W99   g   RV	9   d   VP                  V4       V'       g   KL  VP                  ;'       g    RP                  R4      '       g   Ky  VP                  V4       K  	  \        V3R lV 4       4      p
WJ,          V,          # \        SV `1  VSV4      # )zChecks the pids given and returns a set containing only those that are part of the running game,
identified by its UUID and directory.Z	gamescoperq   zpressure-vesselc              3   s~   <"   T F2  p\        V4      P                  P                  R 4      S8X  g   K.  Vx  K4  	  R# 5i)ZLUTRIS_GAME_UUIDN)r+   r   rU   )Z.0pidr8  r   rO   Z	<genexpr>Z(wine.filter_game_pids.<locals>.<genexpr>f  s1     w>CWS\=Q=Q=U=UVh=imv=vCC>s   +=
=)r-   r   r   r2  r  rU   r+   cmdlineZaddr   r   r   filter_game_pids)r   r7  r8  r9  Zfolder_pidsZgamescope_pidsZhas_gamescoper:  Zprocr;  Z	uuid_pidsr   s   &&f&       rO   r<  Zwine.filter_game_pidsS  s       !4!4!677%K UN ..22;?M%s|,,,,")->'-IOOC( =diioo2%A%A+%N%N"&&s+ & w>wwI+~==7+NI{SSrQ   c                s4   < V ^8  d   QhRS[ S[,          RR/# )rH   	game_pidsrJ   N)r   r  r   r   rO   rP   r   l  s     + +# +4 +rQ   c                s   < \        V P                  V P                  V P                  4       V P	                  4       VR7       \
        SV `  V4       R# )zKill WINE with kindness, or at least with -k. This seems to leave a process
alive for some reason, but the caller will detect this and SIGKILL it.r  N)r    r   r   r   r
  r   force_stop_game)r   r=  r   r   rO   r>  Zwine.force_stop_gamel  sD     	))+"	
 		*rQ   c                s    Rp\         P                  R,           V,           R,           pV P                  pV'       d2   \        P                  P                  V4      '       g   \        '       g   R# \        V4      pVP                  4       pVP                  V8X  g   VP                  V4      pVP                  V4       R#   \         d$   p\        P                  ! RXT4        Rp?R# Rp?ii ; i)zExtracts the 128*128 icon from EXE and saves it, if not resizes the biggest icon found.
returns true if an icon is saved, false if notz/lutris_z.pngFTz"Unable to extract icon from %s: %sN)   r?  )r	   Z	ICON_PATHr   rs   rt   r   r3   r4   Zget_best_iconZsizeZresizeZsaver3  r*   r4  )r   Z	game_slugZ
wantedsizeZ
pathtoiconrn   Z	extractorZiconr5  s   &&      rO   extract_iconZwine.extract_icon{  s    	#J!++j89DvMJ--C"''..44<L<L%c*I**,D99
*{{:.IIj! 	A3K	s%   AC  "C  0AC   C.C))C.c                s&   < V ^8  d   Qh/ S[ ;R&   # )rH   descriptionr   r   r   rO   rP   r      s     . rQ   )r   r   r   r   )ZALSAZalsa)Z
PulseAudioZpulse)ZOSSZoss)ZWaylandrb   )ZX11Zx11)zservices.exezwinedevice.exezplugplay.exezexplorer.exez	rpcss.exezrundll32.exezwineboot.exe)NNNNr^   )rq   T)TNT)TF)FNNNF)F)FF)WZ__name__Z
__module__Z__qualname__Z__firstlineno__rk   rA  Z
human_nameZ	platformsZmultiple_versionsZentry_point_optionrz   shlexZsplitrp   r`   Zgame_optionsr   r=   rl   r}   r)   r   r   rd   r   rE   r   r   r$   Zget_resolutionsr]   r%   r   Zrunner_optionsZ
reg_prefixr  Zcore_processesr   Zpropertyr   r   r   rr   r   r   r   r   r   r   r   r   r   r   r   r   r  Zclassmethodr   r  r  r   r   r   r   r   r   r   r   r  r!  r  r  r#  r(  r
  r/  r1  r  r"  r6  r<  r>  r@  Z__annotate_func__Z__static_attributes__Z__classdictcell__Z__classcell__)r   r   s   @@rO   r   r      s
    -.K6J9I eFQ|_A01'	
 fHQ{^AST	
 mKQ*+At		
 hKQ}%*AD
	
 fHQ,-~6F+ak7-CakSZE[\vACD	
 +FQ=>uAU
	
W6Lt iQ~&H0/+A@	
 (Q/0FAij	
 )Q./FuALM	
 fq}Q}%Ft(SdAK	
  nq}Q~&'~99;f<40	
 gq}Q~&F~TtdAvw
	
 oq}Q''~99;g=5	
 lq}Q*+FtAK	
 *q}Q+,l'A9		
 lq}Q12F`t~A^_
	
 *q}Q+,l~'A9
	
 lq}Q23Fu/AA	
 gQ~&F)dtA@	
 gQ~&F)+)dA1	
 eQEFFtAr
	
 jQ34FtA^		
 eQ/0FtA[		
 iq*+Q34F~3uAE	
  mq*+Q34'~i66ABC
	
 eqxQ+,FuAa	
 mqxQuXHes?,-APQ		
 )Q,-H8h'9y)7W%
 xA8	
( gQ~&H6F# '	 vAr	
" jQ()H6F#&
 v0Au	
" kIQ'AFG		
 lQ./H:'9r"-.	::'@A6J vA_`	
 'Q+,Fu	
 'FQ./uAst	
C
INV
 3J+MJ..;9y9HN: 
 
   G G 	# 	# 7 7  3 3* *(M M"
$ $L	 	 # #JY Y
 f f 
 
*

',


( (
	
 	

((
(

//b! !'.@	aFE E
*i$ $LT T2+ +y#  rQ   r   )uZ__doc__rs   rB  r    rk   Ztypingr   r   r   r   r   r   r   Zlutrisr   r	   Z
lutris.apir
   r   Zlutris.configr   Zlutris.database.gamesr   Zlutris.exceptionsr   r   r   r   r   r   r   Zlutris.gamer   Zlutris.gui.dialogsr   Zlutris.runners.commands.winer   r   r   r   r   r   r   r   r   r    r!   Zlutris.runners.runnerr"   Zlutris.utilr#   Zlutris.util.displayr$   r%   r&   Zlutris.util.graphicsr'   r(   Zlutris.util.linuxr)   Zlutris.util.logr*   Zlutris.util.processr+   Zlutris.util.stringsr,   Zlutris.util.winer-   Zlutris.util.wine.d3d_extrasr.   Zlutris.util.wine.dgvoodoo2r/   Zlutris.util.wine.dxvkr0   r1   Zlutris.util.wine.dxvk_nvapir2   Zlutris.util.wine.extract_iconr3   r4   Zlutris.util.wine.prefixr5   r6   r7   Zlutris.util.wine.vkd3dr8   Zlutris.util.wine.winer9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rX   r`   rd   rl   rp   rz   r}   r   r   r   r   r   r   r   r   r   rQ   rO   <module>rC     s     
    B B B $ L & 3    )    )  P P 1 * " ' / # 8 7 J 8 I Y Y /    &L
)	m.	:	(*Q6 QrQ   