summaryrefslogtreecommitdiff
path: root/gphoto2
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2016-02-19 13:37:22 +0100
committerMarcus Meissner <marcus@jet.franken.de>2016-02-19 13:37:22 +0100
commiteb6e4dfedb4ffa3eca4f5517ecc109a9b4dfc269 (patch)
tree8a3191c00cc1be54bb569362ba2add3bbfc3b34b /gphoto2
parent90a73b898b2e25858ac4db3954a2b2be1113a9f9 (diff)
downloadlibgphoto2-eb6e4dfedb4ffa3eca4f5517ecc109a9b4dfc269.tar.gz
add new apis
gp_camera_list_config, gp_camera_set_single_config, gp_camera_get_single_config
Diffstat (limited to 'gphoto2')
-rw-r--r--gphoto2/gphoto2-camera.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/gphoto2/gphoto2-camera.h b/gphoto2/gphoto2-camera.h
index d03a94943..45f9e7976 100644
--- a/gphoto2/gphoto2-camera.h
+++ b/gphoto2/gphoto2-camera.h
@@ -136,6 +136,7 @@ typedef enum {
* \returns a gphoto error code
*/
typedef int (*CameraExitFunc) (Camera *camera, GPContext *context);
+
/**
* \brief Get a configuration tree for the camera and its driver
*
@@ -158,6 +159,55 @@ typedef int (*CameraExitFunc) (Camera *camera, GPContext *context);
typedef int (*CameraGetConfigFunc) (Camera *camera, CameraWidget **widget,
GPContext *context);
/**
+ * \brief Get a configuration widget for a specific configuration
+ *
+ * \param camera the current camera
+ * \param name the name of the widget
+ * \param widget pointer to store the toplevel widget of the tree
+ * \param context the active #GPContext
+ *
+ * A camera driver can support configuration of either its own behaviour
+ * or the camera device itself. To allow a flexible driver framework,
+ * the camera driver provides a generic configuration widget tree to the
+ * frontend, which then renders it, allows user input and sends it back
+ * via the #CameraSetConfigFunc function to have the driver configure itself
+ * or the camera.
+ *
+ * This specific function retrieves one specific named entry, and not the full
+ * tree to allow for querying specific settings faster.
+ *
+ * If you do not have configuration ability, there is no need to specify this
+ * function.
+ *
+ * \returns a gphoto error code
+ */
+typedef int (*CameraGetSingleConfigFunc) (Camera *camera, const char *name, CameraWidget **widget,
+ GPContext *context);
+/**
+ * \brief List all configuration widgets for a specific configuration
+ *
+ * \param camera the current camera
+ * \param list the list of widgets available
+ * \param context the active #GPContext
+ *
+ * A camera driver can support configuration of either its own behaviour
+ * or the camera device itself. To allow a flexible driver framework,
+ * the camera driver provides a generic configuration widget tree to the
+ * frontend, which then renders it, allows user input and sends it back
+ * via the #CameraSetConfigFunc function to have the driver configure itself
+ * or the camera.
+ *
+ * This specific function retrieves all the available configuration values in a flat list.
+ *
+ * This is different than the GetConfigFunc, which returns a configuration tree.
+ *
+ * If you do not have configuration ability, there is no need to specify this
+ * function.
+ *
+ * \returns a gphoto error code
+ */
+typedef int (*CameraListConfigFunc) (Camera *camera, CameraList *list, GPContext *context);
+/**
* \brief Set the configuration in the camera
*
* \param camera the current camera
@@ -172,6 +222,21 @@ typedef int (*CameraGetConfigFunc) (Camera *camera, CameraWidget **widget,
*/
typedef int (*CameraSetConfigFunc) (Camera *camera, CameraWidget *widget,
GPContext *context);
+/**
+ * \brief Set a single configuration variable in the camera
+ *
+ * \param camera the current camera
+ * \param name the widget to set
+ * \param widget the configuration widget tree that was changed
+ * \param context the active #GPContext
+ *
+ * This function is called in the driver after the configuration value is set.
+ *
+ * \returns a gphoto error code
+ */
+typedef int (*CameraSetSingleConfigFunc) (Camera *camera, const char *name, CameraWidget *widget,
+ GPContext *context);
+
typedef int (*CameraCaptureFunc) (Camera *camera, CameraCaptureType type,
CameraFilePath *path, GPContext *context);
typedef int (*CameraTriggerCaptureFunc) (Camera *camera, GPContext *context);
@@ -227,6 +292,10 @@ typedef struct _CameraFunctions {
CameraGetConfigFunc get_config; /**< \brief Called for requesting the configuration widgets. */
CameraSetConfigFunc set_config; /**< \brief Called after a configuration was changed */
+ CameraListConfigFunc list_config; /**< \brief Called for listing the available configuration widgets. */
+ CameraGetSingleConfigFunc get_single_config; /**< \brief Called for requesteing a single widget. */
+ CameraSetSingleConfigFunc set_single_config; /**< \brief Called for setting a single configuration widget. */
+
/* Capturing */
CameraCaptureFunc capture; /**< \brief Remote control the camera to capture */
CameraTriggerCaptureFunc trigger_capture;/**< \brief Remote control the camera to trigger capture */
@@ -316,8 +385,14 @@ int gp_camera_free (Camera *camera);
int gp_camera_get_config (Camera *camera, CameraWidget **window,
GPContext *context);
+int gp_camera_list_config (Camera *camera, CameraList *list,
+ GPContext *context);
+int gp_camera_get_single_config (Camera *camera, const char *name, CameraWidget **widget,
+ GPContext *context);
int gp_camera_set_config (Camera *camera, CameraWidget *window,
GPContext *context);
+int gp_camera_set_single_config (Camera *camera, const char *name, CameraWidget *widget,
+ GPContext *context);
int gp_camera_get_summary (Camera *camera, CameraText *summary,
GPContext *context);
int gp_camera_get_manual (Camera *camera, CameraText *manual,