| 1 |
// python-gphoto2 - Python interface to libgphoto2 |
| 2 |
// http://github.com/jim-easterbrook/python-gphoto2 |
| 3 |
// Copyright (C) 2014-23 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") filesys |
| 21 |
|
| 22 |
%include "common/preamble.i" |
| 23 |
|
| 24 |
%import "file.i" |
| 25 |
|
| 26 |
// gp_camera_file_get_info() etc. return a pointer in an output parameter |
| 27 |
CALLOC_ARGOUT(CameraFileInfo *info) |
| 28 |
|
| 29 |
// Make docstring parameter types more Pythonic |
| 30 |
%typemap(doc) CameraFileInfo "$1_name: gphoto2.$1_type" |
| 31 |
|
| 32 |
// image dimensions use uint32_t and storage info uses uint64_t |
| 33 |
%include "stdint.i" |
| 34 |
|
| 35 |
// Add constructor to CameraFileInfo |
| 36 |
%defaultctor _CameraFileInfo; |
| 37 |
|
| 38 |
// Ignore functions only used by camera drivers |
| 39 |
%ignore gp_filesystem_append; |
| 40 |
%ignore gp_filesystem_count; |
| 41 |
%ignore gp_filesystem_delete_all; |
| 42 |
%ignore gp_filesystem_delete_file; |
| 43 |
%ignore gp_filesystem_delete_file_noop; |
| 44 |
%ignore gp_filesystem_dump; |
| 45 |
%ignore gp_filesystem_free; |
| 46 |
%ignore gp_filesystem_get_file; |
| 47 |
%ignore gp_filesystem_get_folder; |
| 48 |
%ignore gp_filesystem_get_info; |
| 49 |
%ignore gp_filesystem_get_storageinfo; |
| 50 |
%ignore gp_filesystem_list_files; |
| 51 |
%ignore gp_filesystem_list_folders; |
| 52 |
%ignore gp_filesystem_make_dir; |
| 53 |
%ignore gp_filesystem_name; |
| 54 |
%ignore gp_filesystem_new; |
| 55 |
%ignore gp_filesystem_number; |
| 56 |
%ignore gp_filesystem_put_file; |
| 57 |
%ignore gp_filesystem_read_file; |
| 58 |
%ignore gp_filesystem_remove_dir; |
| 59 |
%ignore gp_filesystem_reset; |
| 60 |
%ignore gp_filesystem_set_file_noop; |
| 61 |
%ignore gp_filesystem_set_funcs; |
| 62 |
%ignore gp_filesystem_set_info; |
| 63 |
%ignore gp_filesystem_set_info_noop; |
| 64 |
%ignore gp_filesystem_set_info_dirty; |
| 65 |
|
| 66 |
// Ignore internal structures |
| 67 |
%ignore CameraFilesystem; |
| 68 |
%ignore CameraFilesystemFuncs; |
| 69 |
%ignore _CameraFilesystemFuncs; |
| 70 |
|
| 71 |
// Camera storage is immutable |
| 72 |
%immutable _CameraStorageInformation::fields; |
| 73 |
%immutable _CameraStorageInformation::basedir; |
| 74 |
%immutable _CameraStorageInformation::label; |
| 75 |
%immutable _CameraStorageInformation::description; |
| 76 |
%immutable _CameraStorageInformation::type; |
| 77 |
%immutable _CameraStorageInformation::fstype; |
| 78 |
%immutable _CameraStorageInformation::access; |
| 79 |
%immutable _CameraStorageInformation::capacitykbytes; |
| 80 |
%immutable _CameraStorageInformation::freekbytes; |
| 81 |
%immutable _CameraStorageInformation::freeimages; |
| 82 |
|
| 83 |
// Top level of CameraFileInfo is immutable |
| 84 |
%immutable _CameraFileInfo::preview; |
| 85 |
%immutable _CameraFileInfo::file; |
| 86 |
%immutable _CameraFileInfo::audio; |
| 87 |
|
| 88 |
%include "gphoto2/gphoto2-filesys.h" |