# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.7
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.





from sys import version_info
if version_info >= (3, 0, 0):
    new_instancemethod = lambda func, inst, cls: _port.SWIG_PyInstanceMethod_New(func)
else:
    from new import instancemethod as new_instancemethod
if version_info >= (2, 6, 0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_port', [dirname(__file__)])
        except ImportError:
            import _port
            return _port
        if fp is not None:
            try:
                _mod = imp.load_module('_port', fp, pathname, description)
            finally:
                fp.close()
            return _mod
    _port = swig_import_helper()
    del swig_import_helper
else:
    import _port
del version_info
try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.


def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if (name == "thisown"):
        return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if (not static):
        object.__setattr__(self, name, value)
    else:
        raise AttributeError("You cannot add attributes to %s" % self)


def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)


def _swig_getattr_nondynamic(self, class_type, name, static=1):
    if (name == "thisown"):
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    if (not static):
        return object.__getattr__(self, name)
    else:
        raise AttributeError(name)

def _swig_getattr(self, class_type, name):
    return _swig_getattr_nondynamic(self, class_type, name, 0)


def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)

try:
    _object = object
    _newclass = 1
except AttributeError:
    class _object:
        pass
    _newclass = 0



def _swig_setattr_nondynamic_method(set):
    def set_attr(self, name, value):
        if (name == "thisown"):
            return self.this.own(value)
        if hasattr(self, name) or (name == "this"):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add attributes to %s" % self)
    return set_attr


import gphoto2.port_info_list

_port.TRUE_swigconstant(_port)
TRUE = _port.TRUE

_port.FALSE_swigconstant(_port)
FALSE = _port.FALSE

_port.GP_PORT_SERIAL_PARITY_OFF_swigconstant(_port)
GP_PORT_SERIAL_PARITY_OFF = _port.GP_PORT_SERIAL_PARITY_OFF

_port.GP_PORT_SERIAL_PARITY_EVEN_swigconstant(_port)
GP_PORT_SERIAL_PARITY_EVEN = _port.GP_PORT_SERIAL_PARITY_EVEN

_port.GP_PORT_SERIAL_PARITY_ODD_swigconstant(_port)
GP_PORT_SERIAL_PARITY_ODD = _port.GP_PORT_SERIAL_PARITY_ODD

_port.GP_PORT_MAX_BUF_LEN_swigconstant(_port)
GP_PORT_MAX_BUF_LEN = _port.GP_PORT_MAX_BUF_LEN
class GPPortSettingsDisk(object):
    """Proxy of C _GPPortSettingsDisk struct"""
    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    mountpoint = _swig_property(_port.GPPortSettingsDisk_mountpoint_get, _port.GPPortSettingsDisk_mountpoint_set)
    __swig_destroy__ = _port.delete_GPPortSettingsDisk
GPPortSettingsDisk_swigregister = _port.GPPortSettingsDisk_swigregister
GPPortSettingsDisk_swigregister(GPPortSettingsDisk)


_port.GP_PORT_USB_ENDPOINT_IN_swigconstant(_port)
GP_PORT_USB_ENDPOINT_IN = _port.GP_PORT_USB_ENDPOINT_IN

_port.GP_PORT_USB_ENDPOINT_OUT_swigconstant(_port)
GP_PORT_USB_ENDPOINT_OUT = _port.GP_PORT_USB_ENDPOINT_OUT

_port.GP_PORT_USB_ENDPOINT_INT_swigconstant(_port)
GP_PORT_USB_ENDPOINT_INT = _port.GP_PORT_USB_ENDPOINT_INT
class GPPort(object):
    """Proxy of C _GPPort struct"""
    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr

    def __init__(self):
        """__init__(self) -> GPPort"""
        _port.GPPort_swiginit(self, _port.new_GPPort())
    __swig_destroy__ = _port.delete_GPPort
GPPort_swigregister = _port.GPPort_swigregister
GPPort_swigregister(GPPort)


def gp_port_new():
    """
    gp_port_new() -> int

    See also: gphoto2.GPPort
    """
    return _port.gp_port_new()

def gp_port_set_info(port, info):
    """
    gp_port_set_info(port, info) -> int

    Parameters:
        port: GPPort *
        info: GPPortInfo

    """
    return _port.gp_port_set_info(port, info)

def gp_port_get_info(port):
    """
    gp_port_get_info(port) -> int

    Parameters:
        port: GPPort *

    """
    return _port.gp_port_get_info(port)

def gp_port_open(port):
    """
    gp_port_open(port) -> int

    Parameters:
        port: GPPort *

    """
    return _port.gp_port_open(port)

def gp_port_close(port):
    """
    gp_port_close(port) -> int

    Parameters:
        port: GPPort *

    """
    return _port.gp_port_close(port)

def gp_port_write(port, data, size):
    """
    gp_port_write(port, data, size) -> int

    Parameters:
        port: GPPort *
        data: char const *
        size: int

    """
    return _port.gp_port_write(port, data, size)

def gp_port_read(port, data, size):
    """
    gp_port_read(port, data, size) -> int

    Parameters:
        port: GPPort *
        data: char *
        size: int

    """
    return _port.gp_port_read(port, data, size)

def gp_port_check_int(port, data, size):
    """
    gp_port_check_int(port, data, size) -> int

    Parameters:
        port: GPPort *
        data: char *
        size: int

    """
    return _port.gp_port_check_int(port, data, size)

def gp_port_check_int_fast(port, data, size):
    """
    gp_port_check_int_fast(port, data, size) -> int

    Parameters:
        port: GPPort *
        data: char *
        size: int

    """
    return _port.gp_port_check_int_fast(port, data, size)

def gp_port_get_timeout(port, timeout):
    """
    gp_port_get_timeout(port, timeout) -> int

    Parameters:
        port: GPPort *
        timeout: int *

    """
    return _port.gp_port_get_timeout(port, timeout)

def gp_port_set_timeout(port, timeout):
    """
    gp_port_set_timeout(port, timeout) -> int

    Parameters:
        port: GPPort *
        timeout: int

    """
    return _port.gp_port_set_timeout(port, timeout)

def gp_port_set_settings(port, settings):
    """
    gp_port_set_settings(port, settings) -> int

    Parameters:
        port: GPPort *
        settings: GPPortSettings

    """
    return _port.gp_port_set_settings(port, settings)

def gp_port_get_settings(port, settings):
    """
    gp_port_get_settings(port, settings) -> int

    Parameters:
        port: GPPort *
        settings: GPPortSettings *

    """
    return _port.gp_port_get_settings(port, settings)

_port.GP_PIN_RTS_swigconstant(_port)
GP_PIN_RTS = _port.GP_PIN_RTS

_port.GP_PIN_DTR_swigconstant(_port)
GP_PIN_DTR = _port.GP_PIN_DTR

_port.GP_PIN_CTS_swigconstant(_port)
GP_PIN_CTS = _port.GP_PIN_CTS

_port.GP_PIN_DSR_swigconstant(_port)
GP_PIN_DSR = _port.GP_PIN_DSR

_port.GP_PIN_CD_swigconstant(_port)
GP_PIN_CD = _port.GP_PIN_CD

_port.GP_PIN_RING_swigconstant(_port)
GP_PIN_RING = _port.GP_PIN_RING

_port.GP_LEVEL_LOW_swigconstant(_port)
GP_LEVEL_LOW = _port.GP_LEVEL_LOW

_port.GP_LEVEL_HIGH_swigconstant(_port)
GP_LEVEL_HIGH = _port.GP_LEVEL_HIGH

def gp_port_get_pin(port, pin, level):
    """
    gp_port_get_pin(port, pin, level) -> int

    Parameters:
        port: GPPort *
        pin: enum GPPin
        level: GPLevel *

    """
    return _port.gp_port_get_pin(port, pin, level)

def gp_port_set_pin(port, pin, level):
    """
    gp_port_set_pin(port, pin, level) -> int

    Parameters:
        port: GPPort *
        pin: enum GPPin
        level: enum GPLevel

    """
    return _port.gp_port_set_pin(port, pin, level)

def gp_port_send_break(port, duration):
    """
    gp_port_send_break(port, duration) -> int

    Parameters:
        port: GPPort *
        duration: int

    """
    return _port.gp_port_send_break(port, duration)

def gp_port_flush(port, direction):
    """
    gp_port_flush(port, direction) -> int

    Parameters:
        port: GPPort *
        direction: int

    """
    return _port.gp_port_flush(port, direction)

def gp_port_usb_find_device(port, idvendor, idproduct):
    """
    gp_port_usb_find_device(port, idvendor, idproduct) -> int

    Parameters:
        port: GPPort *
        idvendor: int
        idproduct: int

    """
    return _port.gp_port_usb_find_device(port, idvendor, idproduct)

def gp_port_usb_find_device_by_class(port, mainclass, subclass, protocol):
    """
    gp_port_usb_find_device_by_class(port, mainclass, subclass, protocol) -> int

    Parameters:
        port: GPPort *
        mainclass: int
        subclass: int
        protocol: int

    """
    return _port.gp_port_usb_find_device_by_class(port, mainclass, subclass, protocol)

def gp_port_usb_clear_halt(port, ep):
    """
    gp_port_usb_clear_halt(port, ep) -> int

    Parameters:
        port: GPPort *
        ep: int

    """
    return _port.gp_port_usb_clear_halt(port, ep)

def gp_port_usb_msg_write(port, request, value, index, bytes, size):
    """
    gp_port_usb_msg_write(port, request, value, index, bytes, size) -> int

    Parameters:
        port: GPPort *
        request: int
        value: int
        index: int
        bytes: char *
        size: int

    """
    return _port.gp_port_usb_msg_write(port, request, value, index, bytes, size)

def gp_port_usb_msg_read(port, request, value, index, bytes, size):
    """
    gp_port_usb_msg_read(port, request, value, index, bytes, size) -> int

    Parameters:
        port: GPPort *
        request: int
        value: int
        index: int
        bytes: char *
        size: int

    """
    return _port.gp_port_usb_msg_read(port, request, value, index, bytes, size)

def gp_port_usb_msg_interface_write(port, request, value, index, bytes, size):
    """
    gp_port_usb_msg_interface_write(port, request, value, index, bytes, size) -> int

    Parameters:
        port: GPPort *
        request: int
        value: int
        index: int
        bytes: char *
        size: int

    """
    return _port.gp_port_usb_msg_interface_write(port, request, value, index, bytes, size)

def gp_port_usb_msg_interface_read(port, request, value, index, bytes, size):
    """
    gp_port_usb_msg_interface_read(port, request, value, index, bytes, size) -> int

    Parameters:
        port: GPPort *
        request: int
        value: int
        index: int
        bytes: char *
        size: int

    """
    return _port.gp_port_usb_msg_interface_read(port, request, value, index, bytes, size)

def gp_port_usb_msg_class_write(port, request, value, index, bytes, size):
    """
    gp_port_usb_msg_class_write(port, request, value, index, bytes, size) -> int

    Parameters:
        port: GPPort *
        request: int
        value: int
        index: int
        bytes: char *
        size: int

    """
    return _port.gp_port_usb_msg_class_write(port, request, value, index, bytes, size)

def gp_port_usb_msg_class_read(port, request, value, index, bytes, size):
    """
    gp_port_usb_msg_class_read(port, request, value, index, bytes, size) -> int

    Parameters:
        port: GPPort *
        request: int
        value: int
        index: int
        bytes: char *
        size: int

    """
    return _port.gp_port_usb_msg_class_read(port, request, value, index, bytes, size)

def gp_port_seek(port, offset, whence):
    """
    gp_port_seek(port, offset, whence) -> int

    Parameters:
        port: GPPort *
        offset: int
        whence: int

    """
    return _port.gp_port_seek(port, offset, whence)

def gp_port_send_scsi_cmd(port, to_dev, cmd, cmd_size, sense, sense_size, data, data_size):
    """
    gp_port_send_scsi_cmd(port, to_dev, cmd, cmd_size, sense, sense_size, data, data_size) -> int

    Parameters:
        port: GPPort *
        to_dev: int
        cmd: char *
        cmd_size: int
        sense: char *
        sense_size: int
        data: char *
        data_size: int

    """
    return _port.gp_port_send_scsi_cmd(port, to_dev, cmd, cmd_size, sense, sense_size, data, data_size)

def gp_port_set_error(port, format):
    """
    gp_port_set_error(port, format) -> int

    Parameters:
        port: GPPort *
        format: char const *

    """
    return _port.gp_port_set_error(port, format)

def gp_port_get_error(port):
    """
    gp_port_get_error(port) -> char const *

    Parameters:
        port: GPPort *

    """
    return _port.gp_port_get_error(port)


