zlgcan_rs/native/device/
property.rs

1#[doc = "  \\struct Options\n 节点mata的可选项。"]
2#[repr(C)]
3#[derive(Debug, Copy, Clone)]
4pub struct Options {
5    #[doc = " 可选项的数据类型"]
6    pub type_: *const ::core::ffi::c_char,
7    #[doc = " 可选项的值"]
8    pub value: *const ::core::ffi::c_char,
9    #[doc = " 可选项的描述信息"]
10    pub desc: *const ::core::ffi::c_char,
11}
12
13#[doc = "  \\struct Meta\n 节点mata信息。"]
14#[repr(C)]
15#[derive(Debug, Copy, Clone)]
16pub struct Meta {
17    #[doc = " 配置项的数据类型"]
18    pub type_: *const ::core::ffi::c_char,
19    #[doc = " 配置项的说明性信息"]
20    pub desc: *const ::core::ffi::c_char,
21    #[doc = " 配置项是否是只读的,缺省为可读写"]
22    pub read_only: ::core::ffi::c_int,
23    #[doc = " 配置项输入格式的提示"]
24    pub format: *const ::core::ffi::c_char,
25    #[doc = " 对于数值类型的配置项来说是最小值,对字符串的配置项来说是最小长度(字节数)。"]
26    pub min_value: f64,
27    #[doc = " 对于数值类型的配置项来说是最大值,对字符串的配置项来说是最大长度(字节数)。"]
28    pub max_value: f64,
29    #[doc = " 配置项的单位"]
30    pub unit: *const ::core::ffi::c_char,
31    #[doc = " 通过旋钮/滚轮等方式修改配置项时的增量"]
32    pub delta: f64,
33    #[doc = " 配置项是否可见, true可见,false不可见,也可以绑定表达式(表达式使用参考demo3),缺省可见"]
34    pub visible: *const ::core::ffi::c_char,
35    #[doc = " 该配置项是否使能, true使能,false不使能,也可以绑定表达式(表达式使用参考demo3)。缺省使能"]
36    pub enable: *const ::core::ffi::c_char,
37    #[doc = " 配置项的可选值,仅但『type』为间接类型时有效"]
38    pub editable: ::core::ffi::c_int,
39    #[doc = " 配置项的可选值,仅但『type』为间接类型时有效,以NULL结束"]
40    pub options: *mut *mut Options,
41}
42
43#[doc = "  \\struct Pair\n  属性的KeyValue对。"]
44#[repr(C)]
45#[derive(Debug, Copy, Clone)]
46pub struct Pair {
47    pub key: *const ::core::ffi::c_char,
48    pub value: *const ::core::ffi::c_char,
49}
50
51#[doc = "  \\struct ConfigNode\n  ConfigNode"]
52#[repr(C)]
53#[derive(Debug, Copy, Clone)]
54pub struct ConfigNode {
55    #[doc = " 节点的名字"]
56    pub name: *const ::core::ffi::c_char,
57    #[doc = " 节点的值 同样可以绑定表达式"]
58    pub value: *const ::core::ffi::c_char,
59    #[doc = " 节点值的表达式,当有该表达式时,value由此表达式计算而来"]
60    pub binding_value: *const ::core::ffi::c_char,
61    #[doc = " 该节点的路径"]
62    pub path: *const ::core::ffi::c_char,
63    #[doc = " 配置项信息"]
64    pub meta_info: *mut Meta,
65    #[doc = " 该节点的子节点, 以NULL结束"]
66    pub children: *mut *mut ConfigNode,
67    #[doc = " 该节点的属性, 以NULL结束"]
68    pub attributes: *mut *mut Pair,
69}
70
71#[doc = " \\brief 设置指定路径的属性的值。\n \\param[in] path  : 属性的路径。\n \\param[in] value : 属性的值。\n\n \\retval 成功返回1,失败返回0。"]
72pub type SetValueFunc = ::core::option::Option<
73    unsafe extern "C" fn(
74        path: *const ::core::ffi::c_char,
75        value: *const ::core::ffi::c_char,
76    ) -> ::core::ffi::c_int,
77>;
78
79#[doc = " \\brief 获取指定路径的属性的值。\n \\param[in] path  : 属性的路径。\n \\retval 成功返回属性的值,失败返回NULL。"]
80pub type GetValueFunc = ::core::option::Option<
81    unsafe extern "C" fn(path: *const ::core::ffi::c_char) -> *const ::core::ffi::c_char,
82>;
83
84#[doc = " \\brief 获取属性的描述信息。\n\n \\retval ConfigNode"]
85pub type GetPropertiesFunc = ::core::option::Option<unsafe extern "C" fn() -> *const ConfigNode>;
86
87#[allow(non_snake_case)]
88#[repr(C)]
89#[derive(Debug, Default, Copy, Clone)]
90pub struct IProperty {
91    pub SetValue: SetValueFunc,
92    pub GetValue: GetValueFunc,
93    pub GetProperties: GetPropertiesFunc,
94}
95
96
97