o
    ¥Àvh	  ã                   @   sX   d dl Z d dlmZ d dlmZ d dlmZ ddgZG dd„ de jƒZ	G dd„ dƒZ
dS )	é    N)ÚOptional)Úgeneric)Úpdf_nameÚCoordinateSystemÚAnnotAppearancesc                   @   s   e Zd ZdZdZ	 dZdS )r   z,
    Positioning convention for stamps.
    é   é   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚPAGE_DEFAULTÚAMBIENT© r   r   úW/var/www/html/hyperkenya/venv/lib/python3.10/site-packages/pyhanko/stamp/appearances.pyr   
   s    c                   @   sJ   e Zd ZdZ		ddejdeej deej fdd„Zdejfd	d
„Z	dS )r   up  
    Convenience abstraction to set up an appearance dictionary for a PDF
    annotation.

    Annotations can have three appearance streams, which can be roughly
    characterised as follows:

    * *normal*: the only required one, and the default one;
    * *rollover*: used when mousing over the annotation;
    * *down*: used when clicking the annotation.

    These are given as references to form XObjects.

    .. note::
        This class only covers the simple case of an appearance dictionary
        for an annotation with only one appearance state.

    See Â§ 12.5.5 in ISO 32000-1 for further information.
    NÚnormalÚrolloverÚdownc                 C   s   || _ || _|| _d S )N)r   r   r   )Úselfr   r   r   r   r   r   Ú__init__8   s   
zAnnotAppearances.__init__Úreturnc                 C   sH   t  tdƒ| ji¡}| jdur| j|tdƒ< | jdur"| j|tdƒ< |S )a  
        Convert the :class:`.AnnotationAppearances` instance to a PDF
        dictionary.

        :return:
            A :class:`~.pdf_utils.generic.DictionaryObject` that can be plugged
            into the ``/AP`` entry of an annotation dictionary.
        z/NNz/Rz/D)r   ÚDictionaryObjectr   r   r   r   )r   Úresr   r   r   Úas_pdf_objectB   s   


zAnnotAppearances.as_pdf_object)NN)
r	   r
   r   r   r   ÚIndirectObjectr   r   r   r   r   r   r   r   r   #   s    üþý
ü
)ÚenumÚtypingr   Úpyhanko.pdf_utilsr   Úpyhanko.pdf_utils.genericr   Ú__all__ÚEnumr   r   r   r   r   r   Ú<module>   s    