a
    §ˆcl  ã                   @   s4   d dl mZmZmZ d dlmZ G dd„ deƒZdS )é    )ÚQtCoreÚQtGuiÚQtSvg)ÚResourceFactoryc                   @   s"   e Zd ZdZdd„ Zddd„ZdS )ÚPyfaceResourceFactoryz2 The implementation of a shared resource manager. c                 C   sV   |  d¡rHt |¡}t | ¡ ¡}| tjj	j
¡ t |¡}| |¡ n
t |¡}|S )z; Creates an image from the data in the specified filename. )z.svgz.SVG)Úendswithr   ZQSvgRendererr   ÚQPixmapZdefaultSizeÚfillr   ZQtZGlobalColorZtransparentZQPainterÚrender)ÚselfÚfilenameZrendererZpixmapZpainter© r   úa/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pyface/ui/qt4/resource_manager.pyÚimage_from_file   s    



z%PyfaceResourceFactory.image_from_fileNc                 C   s   t  ¡ }| |¡ |S )z+ Creates an image from the specified data. )r   r   ZloadFromData)r   Údatar   Úimager   r   r   Úimage_from_data-   s    
z%PyfaceResourceFactory.image_from_data)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      s   r   N)Z	pyface.qtr   r   r   Zpyface.resource.apir   r   r   r   r   r   Ú<module>   s   