gphoto2-widget.h
Go to the documentation of this file.
#ifndef __GPHOTO2_WIDGET_H__
#define __GPHOTO2_WIDGET_H__
#include <gphoto2/gphoto2-context.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct _CameraWidget CameraWidget;
#ifdef __cplusplus
}
#endif /* __cplusplus */
#include <gphoto2/gphoto2-camera.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef enum { /* Value (get/set): */
GP_WIDGET_WINDOW,
GP_WIDGET_SECTION,
GP_WIDGET_TEXT, /* char * */
GP_WIDGET_RANGE, /* float */
GP_WIDGET_TOGGLE, /* int */
GP_WIDGET_RADIO, /* char * */
GP_WIDGET_MENU, /* char * */
GP_WIDGET_BUTTON, /* CameraWidgetCallback */
GP_WIDGET_DATE /* int */
} CameraWidgetType;
typedef int (* CameraWidgetCallback) (Camera *, CameraWidget *, GPContext *);
int gp_widget_new (CameraWidgetType type, const char *label,
CameraWidget **widget);
int gp_widget_free (CameraWidget *widget);
int gp_widget_ref (CameraWidget *widget);
int gp_widget_unref (CameraWidget *widget);
int gp_widget_append (CameraWidget *widget, CameraWidget *child);
int gp_widget_prepend (CameraWidget *widget, CameraWidget *child);
int gp_widget_count_children (CameraWidget *widget);
int gp_widget_get_child (CameraWidget *widget, int child_number,
CameraWidget **child);
/* Retrieve Widgets */
int gp_widget_get_child_by_label (CameraWidget *widget,
const char *label,
CameraWidget **child);
int gp_widget_get_child_by_id (CameraWidget *widget, int id,
CameraWidget **child);
int gp_widget_get_child_by_name (CameraWidget *widget,
const char *name,
CameraWidget **child);
int gp_widget_get_root (CameraWidget *widget,
CameraWidget **root);
int gp_widget_get_parent (CameraWidget *widget,
CameraWidget **parent);
int gp_widget_set_value (CameraWidget *widget, const void *value);
int gp_widget_get_value (CameraWidget *widget, void *value);
int gp_widget_set_name (CameraWidget *widget, const char *name);
int gp_widget_get_name (CameraWidget *widget, const char **name);
int gp_widget_set_info (CameraWidget *widget, const char *info);
int gp_widget_get_info (CameraWidget *widget, const char **info);
int gp_widget_get_id (CameraWidget *widget, int *id);
int gp_widget_get_type (CameraWidget *widget, CameraWidgetType *type);
int gp_widget_get_label (CameraWidget *widget, const char **label);
int gp_widget_set_range (CameraWidget *range,
float low, float high, float increment);
int gp_widget_get_range (CameraWidget *range,
float *min, float *max, float *increment);
int gp_widget_add_choice (CameraWidget *widget, const char *choice);
int gp_widget_count_choices (CameraWidget *widget);
int gp_widget_get_choice (CameraWidget *widget, int choice_number,
const char **choice);
int gp_widget_changed (CameraWidget *widget);
int gp_widget_set_changed (CameraWidget *widget, int changed);
int gp_widget_set_readonly (CameraWidget *widget, int readonly);
int gp_widget_get_readonly (CameraWidget *widget, int *readonly);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GPHOTO2_WIDGET_H__ */
GP_WIDGET_SECTION
Section widget (think Tab)
Definition: gphoto2-widget.h:58
GP_WIDGET_TOGGLE
Toggle widget (think check box)
Definition: gphoto2-widget.h:61
gp_widget_get_type
int gp_widget_get_type(CameraWidget *widget, CameraWidgetType *type)
Retrieves the type of the CameraWidget.
Definition: gphoto2-widget.c:349
gp_widget_changed
int gp_widget_changed(CameraWidget *widget)
Tells if the widget has been changed.
Definition: gphoto2-widget.c:859
gp_widget_get_child_by_id
int gp_widget_get_child_by_id(CameraWidget *widget, int id, CameraWidget **child)
Retrieves the child with id id of the widget.
Definition: gphoto2-widget.c:624
GP_WIDGET_RANGE
Slider widget.
Definition: gphoto2-widget.h:60
gp_widget_get_readonly
int gp_widget_get_readonly(CameraWidget *widget, int *readonly)
Retrieves the readonly state of the CameraWidget.
Definition: gphoto2-widget.c:332
gp_widget_get_child_by_name
int gp_widget_get_child_by_name(CameraWidget *widget, const char *name, CameraWidget **child)
Retrieves the child with name name of the widget.
Definition: gphoto2-widget.c:659
gp_widget_get_child_by_label
int gp_widget_get_child_by_label(CameraWidget *widget, const char *label, CameraWidget **child)
Retrieves the child with label label of the CameraWidget.
Definition: gphoto2-widget.c:587
gp_widget_set_range
int gp_widget_set_range(CameraWidget *range, float low, float high, float increment)
Sets some range parameters of the CameraWidget.
Definition: gphoto2-widget.c:736
gp_widget_free
int gp_widget_free(CameraWidget *widget)
Frees a CameraWidget.
Definition: gphoto2-widget.c:135
gp_widget_count_children
int gp_widget_count_children(CameraWidget *widget)
Counts the children of the CameraWidget.
Definition: gphoto2-widget.c:548
gp_widget_set_readonly
int gp_widget_set_readonly(CameraWidget *widget, int readonly)
Tells that the widget is readonly.
Definition: gphoto2-widget.c:315
_Camera
Definition: gphoto2-camera.h:258
_CameraWidget
Definition: gphoto2-widget.c:40
gp_widget_get_root
int gp_widget_get_root(CameraWidget *widget, CameraWidget **root)
Retrieves the root of the CameraWidget.
Definition: gphoto2-widget.c:713
CameraWidgetType
CameraWidgetType
Type of the widget to be created.
Definition: gphoto2-widget.h:54
gp_widget_set_changed
int gp_widget_set_changed(CameraWidget *widget, int changed)
Tells that the widget has been changed.
Definition: gphoto2-widget.c:294
gp_widget_add_choice
int gp_widget_add_choice(CameraWidget *widget, const char *choice)
Adds a choice to the CameraWidget.
Definition: gphoto2-widget.c:784
gp_widget_unref
int gp_widget_unref(CameraWidget *widget)
Decrements the reference count for the CameraWidget.
Definition: gphoto2-widget.c:182
gphoto2-context.h
Context callback operation functions.
gp_widget_get_choice
int gp_widget_get_choice(CameraWidget *widget, int choice_number, const char **choice)
Retrieves the choice number choice_number.
Definition: gphoto2-widget.c:833
gp_widget_new
int gp_widget_new(CameraWidgetType type, const char *label, CameraWidget **widget)
Create a new widget.
Definition: gphoto2-widget.c:95
GP_WIDGET_WINDOW
Window widget This is the toplevel configuration widget. It should likely contain multiple GP_WIDGET_...
Definition: gphoto2-widget.h:55
gp_widget_get_info
int gp_widget_get_info(CameraWidget *widget, const char **info)
Retrieves the information about the widget.
Definition: gphoto2-widget.c:203
gp_widget_get_parent
int gp_widget_get_parent(CameraWidget *widget, CameraWidget **parent)
Retrieves the parent of a CameraWidget.
Definition: gphoto2-widget.c:695
gp_widget_get_child
int gp_widget_get_child(CameraWidget *widget, int child_number, CameraWidget **child)
Retrieves the child number child_number of the parent.
Definition: gphoto2-widget.c:565
gp_widget_get_value
int gp_widget_get_value(CameraWidget *widget, void *value)
Retrieves the value of the CameraWidget.
Definition: gphoto2-widget.c:439
gp_widget_set_name
int gp_widget_set_name(CameraWidget *widget, const char *name)
Sets the name of the widget.
Definition: gphoto2-widget.c:255
GP_WIDGET_MENU
Menu widget (same as RADIO).
Definition: gphoto2-widget.h:63
gp_widget_count_choices
int gp_widget_count_choices(CameraWidget *widget)
Counts the choices of the CameraWidget.
Definition: gphoto2-widget.c:813
gp_widget_get_name
int gp_widget_get_name(CameraWidget *widget, const char **name)
Gets the name of the widget.
Definition: gphoto2-widget.c:238
gp_widget_ref
int gp_widget_ref(CameraWidget *widget)
Increments the reference count for the CameraWidget.
Definition: gphoto2-widget.c:165
gp_widget_prepend
int gp_widget_prepend(CameraWidget *widget, CameraWidget *child)
Prepends a CameraWidget to a CameraWidget.
Definition: gphoto2-widget.c:508
GP_WIDGET_DATE
Date entering widget.
Definition: gphoto2-widget.h:65
gphoto2-camera.h
Implement Camera object representing a camera attached to the system.
GP_WIDGET_TEXT
Text widget.
Definition: gphoto2-widget.h:59
gp_widget_get_id
int gp_widget_get_id(CameraWidget *widget, int *id)
Retrieves the unique id of the CameraWidget.
Definition: gphoto2-widget.c:274
gp_widget_set_info
int gp_widget_set_info(CameraWidget *widget, const char *info)
Sets the information about the widget.
Definition: gphoto2-widget.c:221
gp_widget_get_range
int gp_widget_get_range(CameraWidget *range, float *min, float *max, float *increment)
Retrieves some range parameters of the CameraWidget.
Definition: gphoto2-widget.c:761
CameraWidgetCallback
int(* CameraWidgetCallback)(Camera *, CameraWidget *, GPContext *)
Callback handler for Button widgets.
Definition: gphoto2-widget.h:71
GP_WIDGET_RADIO
Radio button widget.
Definition: gphoto2-widget.h:62
GP_WIDGET_BUTTON
Button press widget.
Definition: gphoto2-widget.h:64
gp_widget_append
int gp_widget_append(CameraWidget *widget, CameraWidget *child)
Appends a CameraWidget to a CameraWidget.
Definition: gphoto2-widget.c:475
_GPContext
Definition: gphoto2-context.c:35
gp_widget_set_value
int gp_widget_set_value(CameraWidget *widget, const void *value)
Sets the value of the widget.
Definition: gphoto2-widget.c:389
gp_widget_get_label
int gp_widget_get_label(CameraWidget *widget, const char **label)
Retrieves the label of the CameraWidget.
Definition: gphoto2-widget.c:366