<s> """<STR_LIT>""" <EOL> __version__ = "<STR_LIT>" <EOL> import os <EOL> from ctypes import POINTER , WINFUNCTYPE , windll <EOL> from ctypes . wintypes import BOOL , HWND , RECT <EOL> import pygame <EOL> class PygameWindowInfo ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> """<STR_LIT>""" <EOL> sdlpos = os . getenv ( "<STR_LIT>" ) <EOL> if sdlpos is None : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> self . initPygameScreenPos = [ int ( i ) for i in sdlpos . split ( "<STR_LIT:U+002C>" ) ] <EOL> try : <EOL> self . hwnd = pygame . display . get_wm_info ( ) [ "<STR_LIT>" ] <EOL> except KeyError : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> self . prototype = WINFUNCTYPE ( BOOL , HWND , POINTER ( RECT ) ) <EOL> self . paramflags = ( <NUM_LIT:1> , "<STR_LIT>" ) , ( <NUM_LIT:2> , "<STR_LIT>" ) <EOL> self . GetWindowRect = self . prototype ( ( "<STR_LIT>" , windll . user32 ) , self . paramflags ) <EOL> rect = self . GetWindowRect ( self . hwnd ) <EOL> self . borderThickness = int ( self . initPygameScreenPos [ <NUM_LIT:0> ] ) - rect . left <EOL> self . titleThickness = int ( self . initPygameScreenPos [ <NUM_LIT:1> ] ) - rect . top <EOL> def getWindowPosition ( self ) : <EOL> """<STR_LIT>""" <EOL> rect = self . GetWindowRect ( self . hwnd ) <EOL> return { "<STR_LIT>" : rect . top , "<STR_LIT>" : rect . bottom , "<STR_LIT:left>" : rect . left , "<STR_LIT:right>" : rect . right } <EOL> def getScreenPosition ( self ) : <EOL> """<STR_LIT>""" <EOL> rect = self . GetWindowRect ( self . hwnd ) <EOL> return { "<STR_LIT>" : rect . top + self . titleThickness , "<STR_LIT>" : rect . bottom - self . borderThickness , <EOL> "<STR_LIT:left>" : rect . left + self . borderThickness , "<STR_LIT:right>" : rect . right - self . borderThickness } <EOL> def update ( self ) : <EOL> """<STR_LIT>""" <EOL> data = self . getScreenPosition ( ) <EOL> os . environ [ '<STR_LIT>' ] = "<STR_LIT>" % ( data [ "<STR_LIT:left>" ] , data [ "<STR_LIT>" ] ) </s>
