1 /** \file 2 * \brief Camery driver header. 3 * 4 * \author Copyright 2000 Scott Fritzinger 5 * 6 * \note 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public 9 * License as published by the Free Software Foundation; either 10 * version 2 of the License, or (at your option) any later version. 11 * 12 * \note 13 * This library is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * \note 19 * You should have received a copy of the GNU Lesser General Public 20 * License along with this library; if not, write to the 21 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 * Boston, MA 02110-1301 USA 23 */ 24 25 #ifndef __GPHOTO2_LIBRARY_H__ 26 #define __GPHOTO2_LIBRARY_H__ 27 28 #include <gphoto2/gphoto2-abilities-list.h> 29 #include <gphoto2/gphoto2-camera.h> 30 31 #ifdef __cplusplus 32 extern "C" { 33 #endif /* __cplusplus */ 34 35 /** 36 * \brief Returns a unique id for the camera driver. 37 * 38 * \param id a #CameraText 39 * \return a gphoto2 error code 40 * 41 **/ 42 typedef int (* CameraLibraryIdFunc) (CameraText *id); 43 44 /** 45 * \brief Adds the abilities of the supported models to the supplied list. 46 * 47 * \param list a #CameraAbilitiesList 48 * \return a gphoto2 error code 49 * 50 **/ 51 typedef int (* CameraLibraryAbilitiesFunc) (CameraAbilitiesList *list); 52 53 /** 54 * \brief Initializes the camera. 55 * 56 * \param camera a #Camera 57 * \param context a #GPContext 58 * \return a gphoto2 error code 59 * 60 * The camera driver will establish a first connection 61 * to the camera and configure the camera variable (i.e. using 62 * #gp_filesystem_set_list_funcs or #gp_port_get_settings). 63 * 64 **/ 65 typedef int (* CameraLibraryInitFunc) (Camera *camera, GPContext *context); 66 67 /* 68 * If you want to write a camera library, you need to implement 69 * the following three functions. Everything else should be declared 70 * as static. 71 */ 72 int camera_id (CameraText *id); 73 int camera_abilities (CameraAbilitiesList *list); 74 int camera_init (Camera *camera, GPContext *context); 75 76 #ifdef __cplusplus 77 } 78 #endif /* __cplusplus */ 79 80 #endif /* __GPHOTO2_LIBRARY_H__ */ 81