o
    tVg                     @   s*   d Z ddlZdd Zedkre  dS dS )z pygame.examples.dropfile

Drag and drop an image on here.

Uses these events:

* DROPBEGIN
* DROPCOMPLETE
* DROPTEXT
* DROPFILE
    Nc            
      C   s  t   d} t jd}t jdd}t j }|ddd}|	 }|	 j
|_
d }d }| rt j D ]}|jt jkr?d} q4|jt jkrNt| td	 q4|jt jkr]t| td
 q4|jt jkrzt| ||jdd}|	 }|	 j
|_
q4|jt jkrt| ||jdd}|	 }|	 j
|_
|jdd  }	|	dv rt j|j }|d |	 }|	 j
|_
q4|d ||| |r|d ur||| t j  |d | s/t   d S )NT)i  i  Arial   zDrag and drop a file or image!   )   r   r   FzFile drop begin!zFile drop complete!)pngbmpjpg   )r   r   r      )pginitdisplayset_modefontSysFonttimeClockrenderget_rectcentereventgettypeQUIT	DROPBEGINprintDROPCOMPLETEDROPTEXTtextDROPFILEfileimageloadconvert	set_alphafillblitfliptickquit)
goingsurfr   clockspr_file_textspr_file_text_rectspr_file_imagespr_file_image_rectevfiletype r4   M/home/ubuntu/.local/lib/python3.10/site-packages/pygame/examples/dropevent.pymain   sZ   






%r6   __main__)__doc__pygamer   r6   __name__r4   r4   r4   r5   <module>   s   7
