Debian Codegraph @

src/gphoto2/port.i

raw
1 // python-gphoto2 - Python interface to libgphoto2
2 // http://github.com/jim-easterbrook/python-gphoto2
3 // Copyright (C) 2023-25 Jim Easterbrook [email protected]
4 //
5 // This file is part of python-gphoto2.
6 //
7 // python-gphoto2 is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Lesser General Public License as published
9 // by the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // python-gphoto2 is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Lesser General Public License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public License
18 // along with python-gphoto2. If not, see <https://www.gnu.org/licenses/>.
19
20 %module(package="gphoto2") port
21 #pragma SWIG nowarn=321
22
23 %include "common/preamble.i"
24
25 %import "port_info_list.i"
26
27 // Turn on default exception handling
28 DEFAULT_EXCEPTION
29
30 // gp_port_new() returns a pointer in an output parameter
31 PLAIN_ARGOUT(GPPort **)
32
33 // Add default constructor and destructor to _GPPort
34 DEFAULT_CTOR(_GPPort, gp_port_new)
35 DEFAULT_DTOR(_GPPort, gp_port_free)
36
37 // Add member methods to _GPPort
38 MEMBER_FUNCTION(_GPPort,
39 void, close, (),
40 gp_port_close, ($self), )
41 MEMBER_FUNCTION(_GPPort,
42 void, get_info, (GPPortInfo *info),
43 gp_port_get_info, ($self, info), )
44 MEMBER_FUNCTION(_GPPort,
45 void, open, (),
46 gp_port_open, ($self), )
47 MEMBER_FUNCTION(_GPPort,
48 void, reset, (),
49 gp_port_reset, ($self), )
50 MEMBER_FUNCTION(_GPPort,
51 void, set_info, (GPPortInfo info),
52 gp_port_set_info, ($self, info), )
53
54 // Don't wrap internal functions
55 %ignore gp_port_check_int;
56 %ignore gp_port_check_int_fast;
57 %ignore gp_port_flush;
58 %ignore gp_port_free;
59 %ignore gp_port_get_error;
60 %ignore gp_port_get_pin;
61 %ignore gp_port_get_settings;
62 %ignore gp_port_get_timeout;
63 %ignore gp_port_read;
64 %ignore gp_port_seek;
65 %ignore gp_port_send_break;
66 %ignore gp_port_send_scsi_cmd;
67 %ignore gp_port_set_error;
68 %ignore gp_port_set_pin;
69 %ignore gp_port_set_settings;
70 %ignore gp_port_set_timeout;
71 %ignore gp_port_usb_clear_halt;
72 %ignore gp_port_usb_find_device;
73 %ignore gp_port_usb_find_device_by_class;
74 %ignore gp_port_usb_get_sys_device;
75 %ignore gp_port_usb_msg_class_read;
76 %ignore gp_port_usb_msg_class_write;
77 %ignore gp_port_usb_msg_interface_read;
78 %ignore gp_port_usb_msg_interface_write;
79 %ignore gp_port_usb_msg_read;
80 %ignore gp_port_usb_msg_write;
81 %ignore gp_port_usb_set_sys_device;
82 %ignore gp_port_write;
83
84 %ignore _GPPort::type;
85 %ignore _GPPort::settings;
86 %ignore _GPPort::settings_pending;
87 %ignore _GPPort::timeout;
88 %ignore _GPPort::pl;
89 %ignore _GPPort::pc;
90
91 %ignore _GPPortSettings;
92 %ignore _GPPortSettingsSerial;
93 %ignore _GPPortSettingsUSB;
94 %ignore _GPPortSettingsUsbDiskDirect;
95 %ignore _GPPortSettingsUsbScsi;
96
97 // Turn off default exception handling
98 %noexception;
99
100 %include "gphoto2/gphoto2-port.h"