libgphoto2 (libgphoto2): libgphoto2/gphoto2-camera.h Source File

Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

# gphoto2-camera.h

Go to the documentation of this file.

    00001
    00022 #ifndef __GPHOTO2_CAMERA_H__
    00023 #define __GPHOTO2_CAMERA_H__
    00024
    00025 #include <gphoto2-context.h>
    00026
    00027
    00039 typedef struct _Camera Camera;
    00040
    00041
    00042 #include <gphoto2-port.h>
    00043 #include <gphoto2-port-info-list.h>
    00044
    00045 #include <gphoto2-widget.h>
    00046 #include <gphoto2-list.h>
    00047 #include <gphoto2-file.h>
    00048 #include <gphoto2-filesys.h>
    00049 #include <gphoto2-abilities-list.h>
    00050 #include <gphoto2-result.h>
    00051 #include <gphoto2-context.h>
    00052
    00053 typedef struct {
    00054         char text [32 * 1024];
    00055 } CameraText;
    00056
    00057 typedef struct {
    00058         char name [128];
    00059         char folder [1024];
    00060 } CameraFilePath;
    00061
    00062 typedef enum {
    00063         GP_CAPTURE_IMAGE,
    00064         GP_CAPTURE_MOVIE,
    00065         GP_CAPTURE_SOUND
    00066 } CameraCaptureType;
    00067
    00068 typedef enum {
    00069         GP_EVENT_UNKNOWN,       /* unknown and unhandled event */
    00070         GP_EVENT_TIMEOUT,       /* timeout, no arguments */
    00071         GP_EVENT_FILE_ADDED,    /* CameraFilePath* = file path on camfs */
    00072         GP_EVENT_FOLDER_ADDED,  /* CameraFilePath* = folder on camfs */
    00073 } CameraEventType;
    00074
    00083 typedef int (*CameraExitFunc)      (Camera *camera, GPContext *context);
    00084 typedef int (*CameraGetConfigFunc) (Camera *camera, CameraWidget **widget,
    00085                                     GPContext *context);
    00086 typedef int (*CameraSetConfigFunc) (Camera *camera, CameraWidget  *widget,
    00087                                     GPContext *context);
    00088 typedef int (*CameraCaptureFunc)   (Camera *camera, CameraCaptureType type,
    00089                                     CameraFilePath *path, GPContext *context);
    00090 typedef int (*CameraCapturePreviewFunc) (Camera *camera, CameraFile *file,
    00091                                          GPContext *context);
    00092 typedef int (*CameraSummaryFunc)   (Camera *camera, CameraText *text,
    00093                                     GPContext *context);
    00094 typedef int (*CameraManualFunc)    (Camera *camera, CameraText *text,
    00095                                     GPContext *context);
    00096 typedef int (*CameraAboutFunc)     (Camera *camera, CameraText *text,
    00097                                     GPContext *context);
    00098 typedef int (*CameraWaitForEvent)  (Camera *camera, int timeout,
    00099                                     CameraEventType *eventtype, void **eventdata,
    00100                                     GPContext *context);
    00118 typedef int (*CameraPrePostFunc) (Camera *camera, GPContext *context);
    00119
    00120
    00121 typedef struct _CameraFunctions CameraFunctions;
    00122 struct _CameraFunctions {
    00123
    00124         /* Those will be called before and after each operation */
    00125         CameraPrePostFunc pre_func;
    00126         CameraPrePostFunc post_func;
    00127
    00128         CameraExitFunc exit;
    00129
    00130         /* Configuration */
    00131         CameraGetConfigFunc       get_config;
    00132         CameraSetConfigFunc       set_config;
    00133
    00134         /* Capturing */
    00135         CameraCaptureFunc        capture;
    00136         CameraCapturePreviewFunc capture_preview;
    00137
    00138         /* Textual information */
    00139         CameraSummaryFunc summary;
    00140         CameraManualFunc  manual;
    00141         CameraAboutFunc   about;
    00142
    00143         /* Event Interface */
    00144         CameraWaitForEvent wait_for_event;
    00145
    00146         /* Reserved space to use in the future without changing the struct size */
    00147         void *reserved1;
    00148         void *reserved2;
    00149         void *reserved3;
    00150         void *reserved4;
    00151         void *reserved5;
    00152         void *reserved6;
    00153         void *reserved7;
    00154 };
    00155
    00156 /* Those are DEPRECATED */
    00157 typedef GPPort     CameraPort;
    00158 typedef GPPortInfo CameraPortInfo;
    00159
    00160 typedef struct _CameraPrivateLibrary  CameraPrivateLibrary;
    00161 typedef struct _CameraPrivateCore     CameraPrivateCore;
    00162
    00163 struct _Camera {
    00164
    00167         GPPort           *port;
    00168         CameraFilesystem *fs;
    00169         CameraFunctions  *functions;
    00172         CameraPrivateLibrary  *pl;
    00173         CameraPrivateCore     *pc;
    00174 };
    00175
    00176
    00178 int gp_camera_new               (Camera **camera);
    00179
    00180
    00184 int gp_camera_set_abilities     (Camera *camera, CameraAbilities  abilities);
    00185 int gp_camera_get_abilities     (Camera *camera, CameraAbilities *abilities);
    00186 int gp_camera_set_port_info     (Camera *camera, GPPortInfo  info);
    00187 int gp_camera_get_port_info     (Camera *camera, GPPortInfo *info);
    00188
    00200 int gp_camera_set_port_speed    (Camera *camera, int speed);
    00201 int gp_camera_get_port_speed    (Camera *camera);
    00202
    00209 int gp_camera_init               (Camera *camera, GPContext *context);
    00210 int gp_camera_exit               (Camera *camera, GPContext *context);
    00211
    00218 int gp_camera_ref                (Camera *camera);
    00219 int gp_camera_unref              (Camera *camera);
    00220 int gp_camera_free               (Camera *camera);
    00221
    00222 int gp_camera_get_config         (Camera *camera, CameraWidget **window,
    00223                                   GPContext *context);
    00224 int gp_camera_set_config         (Camera *camera, CameraWidget  *window,
    00225                                   GPContext *context);
    00226 int gp_camera_get_summary        (Camera *camera, CameraText *summary,
    00227                                   GPContext *context);
    00228 int gp_camera_get_manual         (Camera *camera, CameraText *manual,
    00229                                   GPContext *context);
    00230 int gp_camera_get_about          (Camera *camera, CameraText *about,
    00231                                   GPContext *context);
    00232 int gp_camera_capture            (Camera *camera, CameraCaptureType type,
    00233                                   CameraFilePath *path, GPContext *context);
    00234 int gp_camera_capture_preview    (Camera *camera, CameraFile *file,
    00235                                   GPContext *context);
    00236 int gp_camera_wait_for_event     (Camera *camera, int timeout,
    00237                                   CameraEventType *eventtype, void **eventdata,
    00238                                   GPContext *context);
    00239
    00246 int gp_camera_folder_list_files   (Camera *camera, const char *folder,
    00247                                    CameraList *list, GPContext *context);
    00248 int gp_camera_folder_list_folders (Camera *camera, const char *folder,
    00249                                    CameraList *list, GPContext *context);
    00250 int gp_camera_folder_delete_all   (Camera *camera, const char *folder,
    00251                                    GPContext *context);
    00252 int gp_camera_folder_put_file     (Camera *camera, const char *folder,
    00253                                    CameraFile *file, GPContext *context);
    00254 int gp_camera_folder_make_dir     (Camera *camera, const char *folder,
    00255                                    const char *name, GPContext *context);
    00256 int gp_camera_folder_remove_dir   (Camera *camera, const char *folder,
    00257                                    const char *name, GPContext *context);
    00264 int gp_camera_file_get_info     (Camera *camera, const char *folder,
    00265                                  const char *file, CameraFileInfo *info,
    00266                                  GPContext *context);
    00267 int gp_camera_file_set_info     (Camera *camera, const char *folder,
    00268                                  const char *file, CameraFileInfo info,
    00269                                  GPContext *context);
    00270 int gp_camera_file_get          (Camera *camera, const char *folder,
    00271                                  const char *file, CameraFileType type,
    00272                                  CameraFile *camera_file, GPContext *context);
    00273 int gp_camera_file_delete       (Camera *camera, const char *folder,
    00274                                  const char *file, GPContext *context);
    00282 typedef int          (* CameraTimeoutFunc)      (Camera *camera,
    00283                                                  GPContext *context);
    00284 typedef unsigned int (* CameraTimeoutStartFunc) (Camera *camera,
    00285                                                  unsigned int timeout,
    00286                                                  CameraTimeoutFunc func,
    00287                                                  void *data);
    00288 typedef void         (* CameraTimeoutStopFunc)  (Camera *camera,
    00289                                                  unsigned int id, void *data);
    00290 void         gp_camera_set_timeout_funcs (Camera *camera,
    00291                                           CameraTimeoutStartFunc start_func,
    00292                                           CameraTimeoutStopFunc  stop_func,
    00293                                           void *data);
    00294 int          gp_camera_start_timeout     (Camera *camera, unsigned int timeout,
    00295                                           CameraTimeoutFunc func);
    00296 void         gp_camera_stop_timeout      (Camera *camera, unsigned int id);
    00297
    00300 #endif /* __GPHOTO2_CAMERA_H__ */