libgphoto2 photo camera library (libgphoto2) API  2.5.10.1
gphoto2-widget.h
Go to the documentation of this file.
1 
24 #ifndef __GPHOTO2_WIDGET_H__
25 #define __GPHOTO2_WIDGET_H__
26 
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif /* __cplusplus */
32 
34 typedef struct _CameraWidget CameraWidget;
35 
36 #ifdef __cplusplus
37 }
38 #endif /* __cplusplus */
39 
40 
41 
42 #include <gphoto2/gphoto2-camera.h>
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif /* __cplusplus */
47 
54 typedef enum { /* Value (get/set): */
59  GP_WIDGET_TEXT, /* char * */
60  GP_WIDGET_RANGE, /* float */
61  GP_WIDGET_TOGGLE, /* int */
62  GP_WIDGET_RADIO, /* char * */
63  GP_WIDGET_MENU, /* char * */
64  GP_WIDGET_BUTTON, /* CameraWidgetCallback */
65  GP_WIDGET_DATE /* int */
67 
72 
73 int gp_widget_new (CameraWidgetType type, const char *label,
74  CameraWidget **widget);
75 int gp_widget_free (CameraWidget *widget);
76 int gp_widget_ref (CameraWidget *widget);
77 int gp_widget_unref (CameraWidget *widget);
78 
79 int gp_widget_append (CameraWidget *widget, CameraWidget *child);
80 int gp_widget_prepend (CameraWidget *widget, CameraWidget *child);
81 
82 int gp_widget_count_children (CameraWidget *widget);
83 int gp_widget_get_child (CameraWidget *widget, int child_number,
84  CameraWidget **child);
85 
86 /* Retrieve Widgets */
87 int gp_widget_get_child_by_label (CameraWidget *widget,
88  const char *label,
89  CameraWidget **child);
90 int gp_widget_get_child_by_id (CameraWidget *widget, int id,
91  CameraWidget **child);
92 int gp_widget_get_child_by_name (CameraWidget *widget,
93  const char *name,
94  CameraWidget **child);
95 int gp_widget_get_root (CameraWidget *widget,
96  CameraWidget **root);
97 int gp_widget_get_parent (CameraWidget *widget,
98  CameraWidget **parent);
99 
100 int gp_widget_set_value (CameraWidget *widget, const void *value);
101 int gp_widget_get_value (CameraWidget *widget, void *value);
102 
103 int gp_widget_set_name (CameraWidget *widget, const char *name);
104 int gp_widget_get_name (CameraWidget *widget, const char **name);
105 
106 int gp_widget_set_info (CameraWidget *widget, const char *info);
107 int gp_widget_get_info (CameraWidget *widget, const char **info);
108 
109 int gp_widget_get_id (CameraWidget *widget, int *id);
110 int gp_widget_get_type (CameraWidget *widget, CameraWidgetType *type);
111 int gp_widget_get_label (CameraWidget *widget, const char **label);
112 
113 int gp_widget_set_range (CameraWidget *range,
114  float low, float high, float increment);
115 int gp_widget_get_range (CameraWidget *range,
116  float *min, float *max, float *increment);
117 
118 int gp_widget_add_choice (CameraWidget *widget, const char *choice);
119 int gp_widget_count_choices (CameraWidget *widget);
120 int gp_widget_get_choice (CameraWidget *widget, int choice_number,
121  const char **choice);
122 
123 int gp_widget_changed (CameraWidget *widget);
124 int gp_widget_set_changed (CameraWidget *widget, int changed);
125 
126 int gp_widget_set_readonly (CameraWidget *widget, int readonly);
127 int gp_widget_get_readonly (CameraWidget *widget, int *readonly);
128 
129 #ifdef __cplusplus
130 }
131 #endif /* __cplusplus */
132 
133 #endif /* __GPHOTO2_WIDGET_H__ */
Section widget (think Tab)
Definition: gphoto2-widget.h:58
Toggle widget (think check box)
Definition: gphoto2-widget.h:61
int gp_widget_get_type(CameraWidget *widget, CameraWidgetType *type)
Retrieves the type of the CameraWidget.
Definition: gphoto2-widget.c:344
int gp_widget_changed(CameraWidget *widget)
Tells if the widget has been changed.
Definition: gphoto2-widget.c:822
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:603
Slider widget.
Definition: gphoto2-widget.h:60
int gp_widget_get_readonly(CameraWidget *widget, int *readonly)
Retrieves the readonly state of the CameraWidget.
Definition: gphoto2-widget.c:327
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:638
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:566
int(* CameraWidgetCallback)(Camera *, CameraWidget *, GPContext *)
Callback handler for Button widgets.
Definition: gphoto2-widget.h:71
int gp_widget_set_range(CameraWidget *range, float low, float high, float increment)
Sets some range parameters of the CameraWidget.
Definition: gphoto2-widget.c:715
int gp_widget_free(CameraWidget *widget)
Frees a CameraWidget.
Definition: gphoto2-widget.c:132
int gp_widget_count_children(CameraWidget *widget)
Counts the children of the CameraWidget.
Definition: gphoto2-widget.c:529
int gp_widget_set_readonly(CameraWidget *widget, int readonly)
Tells that the widget is readonly.
Definition: gphoto2-widget.c:310
Definition: gphoto2-camera.h:325
Definition: gphoto2-widget.c:38
int gp_widget_get_root(CameraWidget *widget, CameraWidget **root)
Retrieves the root of the CameraWidget.
Definition: gphoto2-widget.c:692
CameraWidgetType
Type of the widget to be created.
Definition: gphoto2-widget.h:54
int gp_widget_set_changed(CameraWidget *widget, int changed)
Tells that the widget has been changed.
Definition: gphoto2-widget.c:289
int gp_widget_add_choice(CameraWidget *widget, const char *choice)
Adds a choice to the CameraWidget.
Definition: gphoto2-widget.c:760
int gp_widget_unref(CameraWidget *widget)
Decrements the reference count for the CameraWidget.
Definition: gphoto2-widget.c:177
Context callback operation functions.
int gp_widget_get_choice(CameraWidget *widget, int choice_number, const char **choice)
Retrieves the choice number choice_number.
Definition: gphoto2-widget.c:799
int gp_widget_new(CameraWidgetType type, const char *label, CameraWidget **widget)
Create a new widget.
Definition: gphoto2-widget.c:93
Window widget This is the toplevel configuration widget. It should likely contain multiple GP_WIDGET_...
Definition: gphoto2-widget.h:55
int gp_widget_get_info(CameraWidget *widget, const char **info)
Retrieves the information about the widget.
Definition: gphoto2-widget.c:198
int gp_widget_get_parent(CameraWidget *widget, CameraWidget **parent)
Retrieves the parent of a CameraWidget.
Definition: gphoto2-widget.c:674
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:546
int gp_widget_get_value(CameraWidget *widget, void *value)
Retrieves the value of the CameraWidget.
Definition: gphoto2-widget.c:434
int gp_widget_set_name(CameraWidget *widget, const char *name)
Sets the name of the widget.
Definition: gphoto2-widget.c:250
Menu widget (same as RADIO).
Definition: gphoto2-widget.h:63
int gp_widget_count_choices(CameraWidget *widget)
Counts the choices of the CameraWidget.
Definition: gphoto2-widget.c:780
int gp_widget_get_name(CameraWidget *widget, const char **name)
Gets the name of the widget.
Definition: gphoto2-widget.c:233
int gp_widget_ref(CameraWidget *widget)
Increments the reference count for the CameraWidget.
Definition: gphoto2-widget.c:160
int gp_widget_prepend(CameraWidget *widget, CameraWidget *child)
Prepends a CameraWidget to a CameraWidget.
Definition: gphoto2-widget.c:496
Date entering widget.
Definition: gphoto2-widget.h:65
Implement Camera object representing a camera attached to the system.
Text widget.
Definition: gphoto2-widget.h:59
int gp_widget_get_id(CameraWidget *widget, int *id)
Retrieves the unique id of the CameraWidget.
Definition: gphoto2-widget.c:269
int gp_widget_set_info(CameraWidget *widget, const char *info)
Sets the information about the widget.
Definition: gphoto2-widget.c:216
int gp_widget_get_range(CameraWidget *range, float *min, float *max, float *increment)
Retrieves some range parameters of the CameraWidget.
Definition: gphoto2-widget.c:738
Radio button widget.
Definition: gphoto2-widget.h:62
Button press widget.
Definition: gphoto2-widget.h:64
int gp_widget_append(CameraWidget *widget, CameraWidget *child)
Appends a CameraWidget to a CameraWidget.
Definition: gphoto2-widget.c:470
Definition: gphoto2-context.c:38
int gp_widget_set_value(CameraWidget *widget, const void *value)
Sets the value of the widget.
Definition: gphoto2-widget.c:384
int gp_widget_get_label(CameraWidget *widget, const char **label)
Retrieves the label of the CameraWidget.
Definition: gphoto2-widget.c:361