forked from analogdevicesinc/iio-oscilloscope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iio_widget.h
94 lines (79 loc) · 3.82 KB
/
iio_widget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/**
* Copyright 2012-2013(c) Analog Devices, Inc.
*
* Licensed under the GPL-2.
*
**/
#ifndef __IIO_WIDGET_H__
#define __IIO_WIDGET_H__
#include <gtk/gtk.h>
#include <iio.h>
struct iio_widget {
struct iio_device *dev;
struct iio_channel *chn;
const char *attr_name;
const char *attr_name_avail;
GtkWidget *widget;
void *priv;
void *priv_progress;
void *priv_convert_function;
void (*save)(struct iio_widget *);
void (*update)(struct iio_widget *);
void (*update_value)(struct iio_widget *, const char *, size_t);
};
void g_builder_connect_signal(GtkBuilder *builder, const gchar *name,
const gchar *signal, GCallback callback, gpointer data);
void g_builder_bind_property(GtkBuilder *builder,
const gchar *source_name, const gchar *source_property,
const gchar *target_name, const gchar *target_property,
GBindingFlags flags);
void iio_update_widgets(struct iio_widget *widgets, unsigned int num_widgets);
void iio_widget_update(struct iio_widget *widget);
void iio_update_widgets_of_device(struct iio_widget *widgets,
unsigned int num_widgets, struct iio_device *dev);
void iio_widget_save(struct iio_widget *widget);
void iio_save_widgets(struct iio_widget *widgets, unsigned int num_widgets);
void iio_spin_button_init(struct iio_widget *widget, struct iio_device *dev,
struct iio_channel *chn, const char *attr_name,
GtkWidget *spin_button, const gdouble *scale);
void iio_spin_button_init_from_builder(struct iio_widget *widget,
struct iio_device *dev, struct iio_channel *chn, const char *attr_name,
GtkBuilder *builder, const char *widget_name, const gdouble *scale);
void iio_combo_box_init(struct iio_widget *widget, struct iio_device *dev,
struct iio_channel *chn, const char *attr_name, const char *attr_name_avail,
GtkWidget *combo_box, int (*compare)(const char *a, const char *b));
void iio_combo_box_init_from_builder(struct iio_widget *widget,
struct iio_device *dev, struct iio_channel *chn, const char *attr_name,
const char *attr_name_avail,
GtkBuilder *builder, const char *widget_name,
int (*compare)(const char *a, const char *b));
void iio_toggle_button_init_from_builder(struct iio_widget *widget,
struct iio_device *dev, struct iio_channel *chn, const char *attr_name,
GtkBuilder *builder, const char *widget_name, const bool invert);
void iio_button_init_from_builder(struct iio_widget *widget,
struct iio_device *dev, struct iio_channel *chn, const char *attr_name,
GtkBuilder *builder, const char *widget_name);
void iio_spin_button_int_init_from_builder(struct iio_widget *widget,
struct iio_device *dev, struct iio_channel *chn, const char *attr_name,
GtkBuilder *builder, const char *widget_name, const gdouble *scale);
void iio_spin_button_int_init(struct iio_widget *widget, struct iio_device *dev,
struct iio_channel *chn, const char *attr_name,
GtkWidget *spin_button, const gdouble *scale);
void iio_spin_button_s64_init_from_builder(struct iio_widget *widget,
struct iio_device *dev, struct iio_channel *chn, const char *attr_name,
GtkBuilder *builder, const char *widget_name, const gdouble *scale);
void iio_spin_button_s64_init(struct iio_widget *widget, struct iio_device *dev,
struct iio_channel *chn, const char *attr_name,
GtkWidget *spin_button, const gdouble *scale);
void iio_spin_button_add_progress(struct iio_widget *iio_w);
void iio_spin_button_progress_activate(struct iio_widget *iio_w);
void iio_spin_button_set_on_complete_function(struct iio_widget *iio_w,
void(*on_complete)(void *), void *data);
void iio_spin_button_skip_save_on_complete(struct iio_widget *iio_w,
gboolean skip);
void iio_spin_button_progress_deactivate(struct iio_widget *iio_w);
void iio_spin_button_remove_progress(struct iio_widget *iio_w);
void iio_spin_button_set_convert_function(struct iio_widget *iio_w,
double (*convert)(double, bool inverse));
void iio_spin_button_save(struct iio_widget *widget);
#endif