"""
 Python wrapper for libui.

"""

import ctypes
import os
import platform


if platform.system() == 'Darwin':
    libname = 'libui.dylib'
elif platform.system() == 'Windows':
    libname = 'libui.dll'
elif platform.system() == 'Linux':
    libname = 'libui.so'


CURR_PATH = os.path.dirname(os.path.realpath(__file__))
SHARED_LIBS_PATH = os.path.join(CURR_PATH, 'sharedlibs')
SHARED_LIBS = os.path.join(SHARED_LIBS_PATH, libname)


ctypes.cdll.LoadLibrary(SHARED_LIBS)
clibui = ctypes.CDLL(SHARED_LIBS)


from .box import *
from .button import *
from .control import *
from .combobox import *
from .checkbox import *
from .datetimepicker import *
from .dialogs import *
from .entry import *
from .group import *
from .label import *
from .main import *
from .progressbar import *
from .radiobuttons import *
from .separator import *
from .slider import *
from .spinbox import *
from .tab import *
from .window import *

"""
 Python wrapper for libui.

"""

import ctypes
import ctypes.util
import os

# Find system library
lib = ctypes.util.find_library('ui')

# If system library is not available, use embedded one
if not lib:
    curr_path = os.path.dirname(os.path.realpath(__file__))
    lib_dir = os.path.join(curr_path, 'sharedlibs')
    lib = os.path.join(lib_dir, libname)

ctypes.cdll.LoadLibrary(lib)
clibui = ctypes.CDLL(lib)


from .box import *
from .button import *
from .control import *
from .combobox import *
from .checkbox import *
from .datetimepicker import *
from .dialogs import *
from .entry import *
from .group import *
from .label import *
from .main import *
from .progressbar import *
from .radiobuttons import *
from .separator import *
from .slider import *
from .spinbox import *
from .tab import *
from .window import *

use system library (if found)