libgphoto2 photo camera library (libgphoto2) API 2.4.14

- Main Page
- Related Pages
- Data Structures
- Files
- Directories

- File List
- Globals

# gphoto2-camera.h

Go to the documentation of this file.

    00001
    00026 #ifndef __GPHOTO2_CAMERA_H__
    00027 #define __GPHOTO2_CAMERA_H__
    00028
    00029 #ifdef __cplusplus
    00030 extern "C" {
    00031 #endif /* __cplusplus */
    00032
    00044 typedef struct _Camera Camera;
    00045 #ifdef __cplusplus
    00046 }
    00047 #endif /* __cplusplus */
    00048
    00049
    00050 #include <gphoto2/gphoto2-abilities-list.h>
    00051 #include <gphoto2/gphoto2-port.h>
    00052
    00053 #include <gphoto2/gphoto2-widget.h>
    00054 #include <gphoto2/gphoto2-filesys.h>
    00055 #include <gphoto2/gphoto2-result.h>
    00056
    00057 #ifdef __cplusplus
    00058 extern "C" {
    00059 #endif /* __cplusplus */
    00060
    00068 typedef struct {
    00069         char text [32 * 1024];
    00070 } CameraText;
    00071
    00079 typedef struct {
    00080         char name [128];
    00081         char folder [1024];
    00082 } CameraFilePath;
    00083
    00090 typedef enum {
    00091         GP_CAPTURE_IMAGE,
    00092         GP_CAPTURE_MOVIE,
    00093         GP_CAPTURE_SOUND
    00094 } CameraCaptureType;
    00095
    00104 typedef enum {
    00105         GP_EVENT_UNKNOWN,
    00106         GP_EVENT_TIMEOUT,
    00107         GP_EVENT_FILE_ADDED,
    00108         GP_EVENT_FOLDER_ADDED,
    00109         GP_EVENT_CAPTURE_COMPLETE
    00110 } CameraEventType;
    00111
    00138 typedef int (*CameraExitFunc)      (Camera *camera, GPContext *context);
    00158 typedef int (*CameraGetConfigFunc) (Camera *camera, CameraWidget **widget,
    00159                                     GPContext *context);
    00173 typedef int (*CameraSetConfigFunc) (Camera *camera, CameraWidget  *widget,
    00174                                     GPContext *context);
    00175 typedef int (*CameraCaptureFunc)   (Camera *camera, CameraCaptureType type,
    00176                                     CameraFilePath *path, GPContext *context);
    00177 typedef int (*CameraCapturePreviewFunc) (Camera *camera, CameraFile *file,
    00178                                          GPContext *context);
    00179 typedef int (*CameraSummaryFunc)   (Camera *camera, CameraText *text,
    00180                                     GPContext *context);
    00181 typedef int (*CameraManualFunc)    (Camera *camera, CameraText *text,
    00182                                     GPContext *context);
    00183 typedef int (*CameraAboutFunc)     (Camera *camera, CameraText *text,
    00184                                     GPContext *context);
    00185 typedef int (*CameraWaitForEvent)  (Camera *camera, int timeout,
    00186                                     CameraEventType *eventtype, void **eventdata,
    00187                                     GPContext *context);
    00205 typedef int (*CameraPrePostFunc) (Camera *camera, GPContext *context);
    00206
    00219 typedef struct _CameraFunctions {
    00220         CameraPrePostFunc pre_func;
    00221         CameraPrePostFunc post_func;
    00223         CameraExitFunc exit;
    00225         /* Configuration */
    00226         CameraGetConfigFunc       get_config;
    00227         CameraSetConfigFunc       set_config;
    00229         /* Capturing */
    00230         CameraCaptureFunc        capture;
    00231         CameraCapturePreviewFunc capture_preview;
    00233         /* Textual information */
    00234         CameraSummaryFunc summary;
    00235         CameraManualFunc  manual;
    00236         CameraAboutFunc   about;
    00238         /* Event Interface */
    00239         CameraWaitForEvent wait_for_event;
    00241         /* Reserved space to use in the future without changing the struct size */
    00242         void *reserved1;
    00243         void *reserved2;
    00244         void *reserved3;
    00245         void *reserved4;
    00246         void *reserved5;
    00247         void *reserved6;
    00248         void *reserved7;
    00249 } CameraFunctions;
    00250
    00251 /* Those are DEPRECATED */
    00252 typedef GPPort     CameraPort;
    00253 typedef GPPortInfo CameraPortInfo;
    00254
    00255 typedef struct _CameraPrivateLibrary  CameraPrivateLibrary;
    00256 typedef struct _CameraPrivateCore     CameraPrivateCore;
    00257
    00258 struct _Camera {
    00259
    00262         GPPort           *port;
    00263         CameraFilesystem *fs;
    00264         CameraFunctions  *functions;
    00267         CameraPrivateLibrary  *pl;
    00268         CameraPrivateCore     *pc;
    00269 };
    00270
    00271
    00273 int gp_camera_new               (Camera **camera);
    00274
    00275
    00279 int gp_camera_set_abilities     (Camera *camera, CameraAbilities  abilities);
    00280 int gp_camera_get_abilities     (Camera *camera, CameraAbilities *abilities);
    00281 int gp_camera_set_port_info     (Camera *camera, GPPortInfo  info);
    00282 int gp_camera_get_port_info     (Camera *camera, GPPortInfo *info);
    00283
    00295 int gp_camera_set_port_speed    (Camera *camera, int speed);
    00296 int gp_camera_get_port_speed    (Camera *camera);
    00297
    00304 int gp_camera_init               (Camera *camera, GPContext *context);
    00305 int gp_camera_exit               (Camera *camera, GPContext *context);
    00306
    00314 int gp_camera_ref                (Camera *camera);
    00315 int gp_camera_unref              (Camera *camera);
    00316 int gp_camera_free               (Camera *camera);
    00317
    00318 int gp_camera_get_config         (Camera *camera, CameraWidget **window,
    00319                                   GPContext *context);
    00320 int gp_camera_set_config         (Camera *camera, CameraWidget  *window,
    00321                                   GPContext *context);
    00322 int gp_camera_get_summary        (Camera *camera, CameraText *summary,
    00323                                   GPContext *context);
    00324 int gp_camera_get_manual         (Camera *camera, CameraText *manual,
    00325                                   GPContext *context);
    00326 int gp_camera_get_about          (Camera *camera, CameraText *about,
    00327                                   GPContext *context);
    00328 int gp_camera_capture            (Camera *camera, CameraCaptureType type,
    00329                                   CameraFilePath *path, GPContext *context);
    00330 int gp_camera_capture_preview    (Camera *camera, CameraFile *file,
    00331                                   GPContext *context);
    00332 int gp_camera_wait_for_event     (Camera *camera, int timeout,
    00333                                   CameraEventType *eventtype, void **eventdata,
    00334                                   GPContext *context);
    00335
    00336 int gp_camera_get_storageinfo    (Camera *camera, CameraStorageInformation**,
    00337                                    int *, GPContext *context);
    00338
    00345 int gp_camera_folder_list_files   (Camera *camera, const char *folder,
    00346                                    CameraList *list, GPContext *context);
    00347 int gp_camera_folder_list_folders (Camera *camera, const char *folder,
    00348                                    CameraList *list, GPContext *context);
    00349 int gp_camera_folder_delete_all   (Camera *camera, const char *folder,
    00350                                    GPContext *context);
    00351 int gp_camera_folder_put_file     (Camera *camera, const char *folder,
    00352                                    CameraFile *file, GPContext *context);
    00353 int gp_camera_folder_make_dir     (Camera *camera, const char *folder,
    00354                                    const char *name, GPContext *context);
    00355 int gp_camera_folder_remove_dir   (Camera *camera, const char *folder,
    00356                                    const char *name, GPContext *context);
    00363 int gp_camera_file_get_info     (Camera *camera, const char *folder,
    00364                                  const char *file, CameraFileInfo *info,
    00365                                  GPContext *context);
    00366 int gp_camera_file_set_info     (Camera *camera, const char *folder,
    00367                                  const char *file, CameraFileInfo info,
    00368                                  GPContext *context);
    00369 int gp_camera_file_get          (Camera *camera, const char *folder,
    00370                                  const char *file, CameraFileType type,
    00371                                  CameraFile *camera_file, GPContext *context);
    00372 int gp_camera_file_delete       (Camera *camera, const char *folder,
    00373                                  const char *file, GPContext *context);
    00381 typedef int          (* CameraTimeoutFunc)      (Camera *camera,
    00382                                                  GPContext *context);
    00383 typedef unsigned int (* CameraTimeoutStartFunc) (Camera *camera,
    00384                                                  unsigned int timeout,
    00385                                                  CameraTimeoutFunc func,
    00386                                                  void *data);
    00387 typedef void         (* CameraTimeoutStopFunc)  (Camera *camera,
    00388                                                  unsigned int id, void *data);
    00389 void         gp_camera_set_timeout_funcs (Camera *camera,
    00390                                           CameraTimeoutStartFunc start_func,
    00391                                           CameraTimeoutStopFunc  stop_func,
    00392                                           void *data);
    00393 int          gp_camera_start_timeout     (Camera *camera, unsigned int timeout,
    00394                                           CameraTimeoutFunc func);
    00395 void         gp_camera_stop_timeout      (Camera *camera, unsigned int id);
    00396
    00398 #ifdef __cplusplus
    00399 }
    00400 #endif /* __cplusplus */
    00401
    00402 #endif /* __GPHOTO2_CAMERA_H__ */