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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
use DomElement;
use DomNode;
use GcNode;
use aravis_sys;
use glib;
use glib::GString;
use glib::object::IsA;
use glib::translate::*;
use std::fmt;
use std::ptr;
glib_wrapper! {
pub struct GcFeatureNode(Object<aravis_sys::ArvGcFeatureNode, aravis_sys::ArvGcFeatureNodeClass, GcFeatureNodeClass>) @extends GcNode, DomElement, DomNode;
match fn {
get_type => || aravis_sys::arv_gc_feature_node_get_type(),
}
}
pub const NONE_GC_FEATURE_NODE: Option<&GcFeatureNode> = None;
pub trait GcFeatureNodeExt: 'static {
fn get_description(&self) -> Result<GString, glib::Error>;
fn get_display_name(&self) -> Result<GString, glib::Error>;
fn get_name(&self) -> Option<GString>;
fn get_tooltip(&self) -> Result<GString, glib::Error>;
fn get_value_as_string(&self) -> Result<GString, glib::Error>;
fn is_available(&self) -> Result<(), glib::Error>;
fn is_implemented(&self) -> Result<(), glib::Error>;
fn is_locked(&self) -> Result<(), glib::Error>;
fn set_value_from_string(&self, string: &str) -> Result<(), glib::Error>;
}
impl<O: IsA<GcFeatureNode>> GcFeatureNodeExt for O {
fn get_description(&self) -> Result<GString, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = aravis_sys::arv_gc_feature_node_get_description(self.as_ref().to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) }
}
}
fn get_display_name(&self) -> Result<GString, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = aravis_sys::arv_gc_feature_node_get_display_name(self.as_ref().to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) }
}
}
fn get_name(&self) -> Option<GString> {
unsafe {
from_glib_none(aravis_sys::arv_gc_feature_node_get_name(self.as_ref().to_glib_none().0))
}
}
fn get_tooltip(&self) -> Result<GString, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = aravis_sys::arv_gc_feature_node_get_tooltip(self.as_ref().to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) }
}
}
fn get_value_as_string(&self) -> Result<GString, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = aravis_sys::arv_gc_feature_node_get_value_as_string(self.as_ref().to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) }
}
}
fn is_available(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = aravis_sys::arv_gc_feature_node_is_available(self.as_ref().to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
fn is_implemented(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = aravis_sys::arv_gc_feature_node_is_implemented(self.as_ref().to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
fn is_locked(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = aravis_sys::arv_gc_feature_node_is_locked(self.as_ref().to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
fn set_value_from_string(&self, string: &str) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = aravis_sys::arv_gc_feature_node_set_value_from_string(self.as_ref().to_glib_none().0, string.to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
}
impl fmt::Display for GcFeatureNode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "GcFeatureNode")
}
}