§
    ¡)ýfø  ã                   óˆ   — d Z dZddlmZ  e¦   «         Z G d„ de¦  «        Zd„ Zd„ Z	ddl
Z
d	„ Z e
j        e¦  «         [
[dS )
ar  
This module contains utility functions to handle custom previews.

It behaves as a high-level 'cached' previews manager.

This allows scripts to generate their own previews, and use them as icons in UI widgets
('icon_value' for UILayout functions).


Custom Icon Example
-------------------

.. literalinclude:: __/__/__/scripts/templates_py/ui_previews_custom_icon.py
)ÚnewÚremoveÚImagePreviewCollectioné    )Ú_utils_previewsc                   ó¤   ‡ — e Zd ZdZˆ fd„Zd„ Zd„ Zd„ Zej        j        e_        dd„Z	ej	        j        e	_        ˆ fd„Z
d	„ Zˆ fd
„Zˆ fd„Zˆ xZS )r   a3  
    Dictionary-like class of previews.

    This is a subclass of Python's built-in dict type,
    used to store multiple image previews.

    .. note::

        - instance with :mod:`bpy.utils.previews.new`
        - keys must be ``str`` type.
        - values will be :class:`bpy.types.ImagePreview`
    c                 óÈ   •— t          ¦   «                              ¦   «          t          t          | ¦  «        ¦  «        | _        t
                               | j        ¦  «         d S ©N)ÚsuperÚ__init__ÚhexÚidÚ_uuidÚ
_uuid_openÚadd©ÚselfÚ	__class__s    €úX/home/blender/git/blender-v430/install_release/4.3/scripts/modules/bpy/utils/previews.pyr   zImagePreviewCollection.__init__6   sF   ø€ Ý‰Œ×ÒÑÔÐÝ�˜D™œ‘]”]ˆŒ
Ý�Š�t”zÑ"Ô"Ð"Ð"Ð"ó    c                 óf   — | j         t          vrd S t          d                     | ¦  «        ¦  «        ‚)Nz:{!r}: left open, remove with 'bpy.utils.previews.remove()')r   r   ÚResourceWarningÚformatÚclose©r   s    r   Ú__del__zImagePreviewCollection.__del__;   s8   € ØŒ:�ZÐ'Ð'ØˆFåØH×OÒOÐPTÑUÔUñ
ô 
ð 	
r   c                 ó:   — d                      | j        |f¦  «        S )Nú:)Újoinr   )r   Únames     r   Ú_gen_keyzImagePreviewCollection._gen_keyD   s   € Ø�xŠx˜œ TÐ*Ñ+Ô+Ð+r   c                 óª   — || v r"t          d                     |¦  «        ¦  «        ‚t          j        |                      |¦  «        ¦  «        x}| |<   |S ©Nzkey {!r} already exists)ÚKeyErrorr   r   r   r    )r   r   Úps      r   r   zImagePreviewCollection.newG   sY   € Ø�4ˆ<ˆ<ÝÐ4×;Ò;¸DÑAÔAÑBÔBÐBÝ(Ô,Ø�MŠM˜$ÑÔñ!ô !ð 	!ˆˆD�‰Jàˆr   Fc                 ó°   — || v r"t          d                     |¦  «        ¦  «        ‚t          j        |                      |¦  «        |||¦  «        x}| |<   |S r"   )r#   r   r   Úloadr    )r   r   ÚpathÚ	path_typeÚforce_reloadr$   s         r   r&   zImagePreviewCollection.loadO   sb   € Ø�4ˆ<ˆ<ÝÐ4×;Ò;¸DÑAÔAÑBÔBÐBÝ(Ô-Ø�MŠM˜$ÑÔ  y°,ñ@ô @ð 	@ˆˆD�‰Jàˆr   c                 óÄ   •— |                       ¦   «         D ])}t          j        |                      |¦  «        ¦  «         Œ*t	          ¦   «                              ¦   «          dS )zClear all previews.N)Úkeysr   Úreleaser    r
   Úclear)r   r   r   s     €r   r-   zImagePreviewCollection.clearW   sO   ø€ à—I’I‘K”Kð 	9ð 	9ˆDÝÔ# D§M¢M°$Ñ$7Ô$7Ñ8Ô8Ð8Ð8Ý‰Œ�Š‰Œˆˆˆr   c                 ól   — |                       ¦   «          t                               | j        ¦  «         dS )z,Close the collection and clear all previews.N)r-   r   r   r   r   s    r   r   zImagePreviewCollection.close]   s+   € à�
Š
‰ŒˆÝ×Ò˜$œ*Ñ%Ô%Ð%Ð%Ð%r   c                 ó˜   •— t          j        |                      |¦  «        ¦  «         t          ¦   «                              |¦  «         d S r	   )r   r,   r    r
   Ú__delitem__)r   Úkeyr   s     €r   r0   z"ImagePreviewCollection.__delitem__b   s>   ø€ ÝÔ §¢¨cÑ 2Ô 2Ñ3Ô3Ð3Ý‰Œ×Ò˜CÑ Ô Ð Ð Ð r   c                 ó„   •— d                      | j        j        | j        t	          | ¦  «        t          ¦   «         ¦  «        S )Nz<{:s} id={:s}[{:d}], {!r}>)r   r   Ú__name__r   Úlenr
   r   s    €r   Ú__repr__zImagePreviewCollection.__repr__f   s5   ø€ Ø+×2Ò2ØŒNÔ# T¤Zµ°T±´½E¹G¼Gñ
ô 
ð 	
r   )F)r3   Ú
__module__Ú__qualname__Ú__doc__r   r   r    r   r   r&   r-   r   r0   r5   Ú__classcell__)r   s   @r   r   r   !   sû   ø€ € € € € ðð ð(#ð #ð #ð #ð #ð
ð ð ð,ð ,ð ,ðð ð ð "Ô%Ô-€C„Kðð ð ð ð #Ô'Ô/€D„Lðð ð ð ð ð&ð &ð &ð
!ð !ð !ð !ð !ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
r   r   c                  ó   — t          ¦   «         S )zX
    :return: a new preview collection.
    :rtype: :class:`ImagePreviewCollection`
    )r   © r   r   r   r   l   s   € õ "Ñ#Ô#Ð#r   c                 ó.   — |                       ¦   «          dS )z’
    Remove the specified previews collection.

    :arg pcoll: Preview collection to close.
    :type pcoll: :class:`ImagePreviewCollection`
    N)r   )Úpcolls    r   r   r   u   s   € ð 
‡K‚K�M„M€M€M€Mr   Nc                  ó   — t           `d S r	   )r   r   r;   r   r   Úexit_clear_warningr?   ƒ   s   € ÝÐ&Ð&Ð&r   )r8   Ú__all__Ú_bpyr   Úsetr   Údictr   r   r   Úatexitr?   Úregisterr;   r   r   ú<module>rF      sÁ   ðð
ð ð€ð !Ð  Ð  Ð  Ð  Ð  àˆS‰UŒU€
ð
H
ð H
ð H
ð H
ð H
˜Tñ H
ô H
ð H
ðV$ð $ð $ðð ð ð €€€ð'ð 'ð 'ð €„Ð"Ñ #Ô #Ð #Ø
ÐÐÐr   