�
�i� � �h � d dl Z d dlZd dlZd dl mZmZmZmZmZmZ de fd�Z
de fd�Z G d� d� Zy)� N)�c_char_p�c_float�c_int�c_uint�c_uint64�c_void_p�returnc �` � t j � j � } | dk( ry| dk( ryy)N�darwinzlibrust_widgets.dylib�windowszrust_widgets.dllzlibrust_widgets.so)�platform�system�lower)r s �examples/python/rust_widgets.py�_default_library_namer s0 � �
�_�_�
�
$�
$�
&�F�
���&�
���!�� c � � t j j d� } | r| S t j j t j j t j j
t � dd� � }t j j |ddt � � }t j j |� r|S t � S )N�RUST_WIDGETS_LIBz..�target�debug)
�os�environ�get�path�abspath�join�dirname�__file__r �exists)�env_path�root� candidates r �_resolve_library_pathr# s� � ��z�z�~�~�0�1�H����
�7�7�?�?�2�7�7�<�<�������(A�4��N�O�D������T�8�W�6K�6M�N�I� �w�w�~�~�i� ��� �"�"r c � � e Zd Zd,dedz fd�Zd-d�Zd-d�Zd-d�Zd-d�Zd ed
e de de d
e de fd�Z
de ded
e de de d
e de fd�Zde deddfd�Zde defd�Z
de fd�Zdefd�Zde de fd�Zde fd�Zde de fd�Zde fd�Zd.dede fd�Zdefd�Zdefd �Zde fd!�Zde fd"�Zde fd#�Zde fd$�Zd/d%ede fd&�Zde fd'�Zde fd(�Zde fd)�Z de fd*�Z!de fd+�Z"y)0�RustWidgetsN�library_pathc �p � t j |xs
t � � | _ | j � y �N)�ctypes�CDLLr# �_lib�_bind_signatures)�selfr&