ó
    pyüi
  ã                   óŠ   • S r SSKrSSKrSSKJr  SSKJr  SSK	J
r
  \R                  " S5      r " S S\R                  5      rg))ÚPdfUnspHandleré    N)ÚPdfiumErrorÚ	pypdfium2c                   óH   • \ rS rSrSrSrS rS r\S 5       r	S r
S
S jrS	rg)r   é   aM  
Unsupported feature handler helper class.

Attributes:
    raw (UNSUPPORT_INFO):
       The underlying pdfium ``UNSUPPORT_INFO`` struct.
    handlers (dict[str, typing.Callable]):
        A dictionary of named handler functions to be called with an unsupported code (:attr:`FPDF_UNSP_*`) when PDFium detects an unsupported feature.
Nc                 óD   • 0 U l         [        R                  " SS9U l        g )Né   )Úversion)ÚhandlersÚpdfium_cÚUNSUPPORT_INFOÚraw©Úselfs    Ú[/home/mande/repo/quber/.venv/lib/python3.13/site-packages/pypdfium2/_helpers/unsupported.pyÚ__init__ÚPdfUnspHandler.__init__   s   € ØˆŒÜ×*Ò*°1Ñ5ˆ�ó    c                 óV   • U R                   R                  5        H  nU" U5        M     g ©N)r   Úvalues)r   Ú_ÚtypeÚhandlers       r   Ú__call__ÚPdfUnspHandler.__call__    s    € Ø—}‘}×+Ñ+Ö-ˆGÙ�DŽMò .r   c                 ón   • [         R                  S[        R                  R	                  U 5       35        g )NzUnsupported PDF feature: )Ú
lib_loggerÚwarningÚpdfium_iÚUnsupportedInfoToStrÚget)r   s    r   Ú_defaultÚPdfUnspHandler._default$   s+   € ä×ÑÐ6´x×7TÑ7T×7XÑ7XÐY]Ó7^Ð6_Ð`Õar   c                 óX   • [        U R                  5        [        U R                  5        g r   )Úidr   r   r   s    r   Ú_keepÚPdfUnspHandler._keep(   s   € Ü
ˆ4�=‰=ÔÜ
ˆ4�8‰8�r   c                 óŒ  • [         R                  (       a  [        S5      e[        R                  " U R
                  SU 5        [        R                  " U R
                  5      nU(       d  [        S5      eU [         l        [        R                  " U R                  5        U(       a  [         R                  U R                  S'   gg)a2  
Register the handler with PDFium, and install an exit function that will keep the object alive until the end of session.

Once set up, a :class:`.PdfUnspHandler` cannot be removed. It stands and falls with the library.
Thus, this function can only be called once in a session.
However, you may change the wrapped :attr:`.handlers` callbacks.
Call ``.handlers.clear()`` to remove all handlers, thereby effectively disabling the instance.

Parameters:
    add_default (bool):
        If True, add a default callback that will log unsupported features as warning.
zAOnly one PdfUnspHandler instance can be registered for a session.ÚFSDK_UnSupport_Handlerz)Failed to register PdfUnspHandler object.ÚdefaultN)r   Ú	SINGLETONÚRuntimeErrorr    Úset_callbackr   r   ÚFSDK_SetUnSpObjProcessHandlerr   ÚatexitÚregisterr'   r#   r   )r   Úadd_defaultÚoks      r   ÚsetupÚPdfUnspHandler.setup,   s‰   € ô ×#×#ÜÐbÓcÐcä×Ò˜dŸh™hÐ(@À$ÔGÜ×3Ò3°D·H±HÓ=ˆÞÜÐIÓJÐJØ#'ŒÔ ô 	�Š˜Ÿ
™
Ô#ÞÜ'5×'>Ñ'>ˆD�M‰M˜)Ò$ð r   )r   r   )T)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r,   r   r   Ústaticmethodr#   r'   r4   Ú__static_attributes__© r   r   r   r      s8   † ñð €Iò6òð ñbó ðbò÷?r   r   )Ú__all__r0   ÚloggingÚpypdfium2.rawr   r   Úpypdfium2.internalÚinternalr    Úpypdfium2._helpers.miscr   Ú	getLoggerr   ÚAutoCastabler   r=   r   r   Ú<module>rF      s=   ðð €ã Û Ý  Ý %Ý /à×Ò˜{Ó+€
ô6?�h×+Ñ+õ 6?r   