summaryrefslogtreecommitdiff
path: root/libgphoto2/gphoto2-camera.c
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 /libgphoto2/gphoto2-camera.c
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 'libgphoto2/gphoto2-camera.c')
-rw-r--r--libgphoto2/gphoto2-camera.c98
1 files changed, 98 insertions, 0 deletions
diff --git a/libgphoto2/gphoto2-camera.c b/libgphoto2/gphoto2-camera.c
index 2ff39fcb6..80effe435 100644
--- a/libgphoto2/gphoto2-camera.c
+++ b/libgphoto2/gphoto2-camera.c
@@ -876,6 +876,71 @@ gp_camera_get_config (Camera *camera, CameraWidget **window, GPContext *context)
/**
+ * Retrieve a single configuration \c widget for the \c camera.
+ *
+ * @param camera a #Camera
+ * @param name the name of a configuration widget
+ * @param widget a #CameraWidget
+ * @param context a #GPContext
+ * @return gphoto2 error code
+ *
+ * This \c widget will then contain the current and the possible values and the type.
+ *
+ */
+int
+gp_camera_get_single_config (Camera *camera, const char *name, CameraWidget **widget, GPContext *context)
+{
+ C_PARAMS (camera);
+ CHECK_INIT (camera, context);
+
+ if (!camera->functions->get_single_config) {
+ gp_context_error (context, _("This camera does "
+ "not provide any configuration options."));
+ CAMERA_UNUSED (camera, context);
+ return (GP_ERROR_NOT_SUPPORTED);
+ }
+
+ CHECK_RESULT_OPEN_CLOSE (camera, camera->functions->get_single_config (
+ camera, name, widget, context), context);
+
+ CAMERA_UNUSED (camera, context);
+ return (GP_OK);
+}
+
+
+/**
+ * Retrieve a configuration \c list for the \c camera.
+ *
+ * @param camera a #Camera
+ * @param list a #CameraList
+ * @param context a #GPContext
+ * @return gphoto2 error code
+ *
+ * The names in list can be used for the single set and get configuration calls.
+ *
+ */
+int
+gp_camera_list_config (Camera *camera, CameraList *list, GPContext *context)
+{
+ C_PARAMS (camera);
+ CHECK_INIT (camera, context);
+
+ if (!camera->functions->list_config) {
+ gp_context_error (context, _("This camera does "
+ "not provide any configuration options."));
+ CAMERA_UNUSED (camera, context);
+ return (GP_ERROR_NOT_SUPPORTED);
+ }
+
+ CHECK_RESULT_OPEN_CLOSE (camera, camera->functions->list_config (
+ camera, list, context), context);
+
+ CAMERA_UNUSED (camera, context);
+ return (GP_OK);
+}
+
+
+/**
* Sets the configuration.
*
* @param camera a #Camera
@@ -908,6 +973,39 @@ gp_camera_set_config (Camera *camera, CameraWidget *window, GPContext *context)
}
/**
+ * Set a single configuration \c widget for the \c camera.
+ *
+ * @param camera a #Camera
+ * @param name the name of a configuration widget
+ * @param widget a #CameraWidget
+ * @param context a #GPContext
+ * @return gphoto2 error code
+ *
+ * This \c widget contains the new value of the widget to set.
+ *
+ */
+int
+gp_camera_set_single_config (Camera *camera, const char *name, CameraWidget *widget, GPContext *context)
+{
+ C_PARAMS (camera);
+ CHECK_INIT (camera, context);
+
+ if (!camera->functions->set_single_config) {
+ gp_context_error (context, _("This camera does "
+ "not provide any configuration options."));
+ CAMERA_UNUSED (camera, context);
+ return (GP_ERROR_NOT_SUPPORTED);
+ }
+
+ CHECK_RESULT_OPEN_CLOSE (camera, camera->functions->set_single_config (
+ camera, name, widget, context), context);
+
+ CAMERA_UNUSED (camera, context);
+ return (GP_OK);
+}
+
+
+/**
* Retrieves a camera summary.
*
* @param camera a #Camera