
    3j                     p    S r SSKrSSKrSSKJr  SSKJr  SrSrSr	Sr
S r\" 5         S rS	 r   SS
 jrg)a  Abstraction for the platform-specific code in PyOpenGL

Each supported platform has a module which provides the
specific functionality required to support the base OpenGL 
functionality on that platform.  These modules are 
registered using plugins in the:

    OpenGL.plugin.PlatformPlugin

objects.  To support a new platform you'll need to create
a new PlatformPlugin instance *before* you import 
OpenGL.platform .  Once you have a working platform 
module, please consider contributing it back to the project.

See baseplatform.BasePlatform for the core functionality 
of a platform implementation.  See the various platform 
specific modules for examples to use when porting.
    N)PlatformPlugin)_configflagsXDG_SESSION_TYPEWAYLAND_DISPLAYc                  &   Sn [         R                  S;   aA  S[        R                  ;  a-  S[        R                  ;   a  Sn OS[        R                  ;   a  Sn [        R                  R	                  S5      [        R                  R	                  SS	5      R                  5       U [         R                  [        R                  4n[        R                  " U5      nUR                  5       nS
Ul
        U" 5       nUR                  [        5       5        U$ )z6Load the os.name plugin for the platform functionalityN)linuxlinux2PYOPENGL_PLATFORMr   waylandDISPLAYr   r    T)sysplatformosenvirongetlowernamer   matchloadloadedinstallglobals)guessing_keykeypluginplugin_classs       R/home/wildlama/miniconda3/lib/python3.13/site-packages/OpenGL/platform/__init__.py_loadr      s     L
||**/B"**/T

*$L"**$"L 	

*+


)2.446
C !!#&F;;=LFM^F NN79M    c                    ^ ^ UU 4S jnU$ )z@Decorator to add returnType, argTypes and argNames to a functionc                 J  > TU l         TU l        [        U S5      (       a  U R                  R                  U l        OU R                  R                  U l        [        R                  (       a6  ST0U l	        [        U R
                  T5       H  u  pX R                  U'   M     U $ )zOAdds the given metadata to the function, introspects var names from declaration	func_codereturn)
resultTypeargTypeshasattrr#   co_varnamesargNames__code__r   TYPE_ANNOTATIONS__annotations__zip)functionr   typr&   r%   s      r   	add_typestypes.<locals>.add_typesA   s    ($8[)) ( 2 2 > >H ( 1 1 = =H((*(H$ !!2!2H=	14((. >r     )r%   r&   r0   s   `` r   typesr3   >   s      r    c                     SSK Jn  U R                  5        HJ  nU(       d  M  UR                  5       (       d  M#  UR                  5       u  pEU" U[	        US5      5      X'   ML     g)z)Create constants and add to the namespacer   )Constant   N)OpenGL.constantr5   
splitlinessplitint)	constants	namespacer5   liner   values         r   unpack_constantsr?   T   sH    ($$&4DJJLL**,KD&tS^<IO 'r    c                     [        U R                  U=(       d    [        R                  U R                  U R
                  SU R                  UUU R                  UU=(       d    [        U SU5      S9$ )zKAllows the more compact declaration format to use the old-style constructorNforce_extension)	r%   r&   docr)   	extension
deprecatedmoduleerror_checkerrA   )	nullFunction__name__PLATFORMGLr%   r&   r)   
__module__getattr)r.   dllrC   rD   rF   rA   s         r   createFunctionrN   ^   sl     x{{&&""""""#' A8.@ r    )FNF)__doc__r   r   OpenGL.pluginsr   OpenGLr   XDGr   rI   rG   r   r3   r?   rN   r2   r    r   <module>rS      sO   &  ) #8 ,= r    