gphoto2-library.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. #ifndef __GPHOTO2_LIBRARY_H__
  25. #define __GPHOTO2_LIBRARY_H__
  26. #include <gphoto2/gphoto2-abilities-list.h>
  27. #include <gphoto2/gphoto2-camera.h>
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif /* __cplusplus */
  31. /**
  32. * \brief Returns a unique id for the camera driver.
  33. *
  34. * \param id a #CameraText
  35. * \return a gphoto2 error code
  36. *
  37. **/
  38. typedef int (* CameraLibraryIdFunc) (CameraText *id);
  39. /**
  40. * \brief Adds the abilities of the supported models to the supplied list.
  41. *
  42. * \param list a #CameraAbilitiesList
  43. * \return a gphoto2 error code
  44. *
  45. **/
  46. typedef int (* CameraLibraryAbilitiesFunc) (CameraAbilitiesList *list);
  47. /**
  48. * \brief Initializes the camera.
  49. *
  50. * \param camera a #Camera
  51. * \param context a #GPContext
  52. * \return a gphoto2 error code
  53. *
  54. * The camera driver will establish a first connection
  55. * to the camera and configure the camera variable (i.e. using
  56. * #gp_filesystem_set_list_funcs or #gp_port_get_settings).
  57. *
  58. **/
  59. typedef int (* CameraLibraryInitFunc) (Camera *camera, GPContext *context);
  60. /*
  61. * If you want to write a camera library, you need to implement
  62. * the following three functions. Everything else should be declared
  63. * as static.
  64. */
  65. int camera_id (CameraText *id);
  66. int camera_abilities (CameraAbilitiesList *list);
  67. int camera_init (Camera *camera, GPContext *context);
  68. #ifdef __cplusplus
  69. }
  70. #endif /* __cplusplus */
  71. #endif /* __GPHOTO2_LIBRARY_H__ */