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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// This file was generated by gir (https://github.com/gtk-rs/gir)
// DO NOT EDIT

use crate::{Iterator};
use glib::{translate::*};

glib::wrapper! {
    #[derive(PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct Properties(Shared<ffi::WpProperties>);

    match fn {
        ref => |ptr| ffi::wp_properties_ref(ptr),
        unref => |ptr| ffi::wp_properties_unref(ptr),
        type_ => || ffi::wp_properties_get_type(),
    }
}

impl Properties {
    #[doc(alias = "wp_properties_new_empty")]
    #[doc(alias = "new_empty")]
    pub fn new() -> Properties {
        unsafe {
            from_glib_full(ffi::wp_properties_new_empty())
        }
    }

    #[doc(alias = "wp_properties_new_string")]
    pub fn new_string(str: &str) -> Properties {
        unsafe {
            from_glib_full(ffi::wp_properties_new_string(str.to_glib_none().0))
        }
    }

    #[doc(alias = "wp_properties_add")]
    pub fn add(&self, props: &Properties) -> i32 {
        unsafe {
            ffi::wp_properties_add(self.to_glib_none().0, props.to_glib_none().0)
        }
    }

    #[doc(alias = "wp_properties_add_keys_array")]
    #[doc(alias = "add_keys_array")]
    pub fn add_keys(&self, props: &Properties, keys: &[&str]) -> i32 {
        unsafe {
            ffi::wp_properties_add_keys_array(self.to_glib_none().0, props.to_glib_none().0, keys.to_glib_none().0)
        }
    }

    #[doc(alias = "wp_properties_copy")]
#[must_use]
    pub fn copy(&self) -> Option<Properties> {
        unsafe {
            from_glib_full(ffi::wp_properties_copy(self.to_glib_none().0))
        }
    }

    #[doc(alias = "wp_properties_ensure_unique_owner")]
#[must_use]
    pub fn ensure_unique_owner(self) -> Option<Properties> {
        unsafe {
            from_glib_full(ffi::wp_properties_ensure_unique_owner(self.into_glib_ptr()))
        }
    }

    #[doc(alias = "wp_properties_get")]
    pub fn get(&self, key: &str) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::wp_properties_get(self.to_glib_none().0, key.to_glib_none().0))
        }
    }

    #[cfg(feature = "v0_4_10")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v0_4_10")))]
    #[doc(alias = "wp_properties_get_count")]
    #[doc(alias = "get_count")]
    pub fn count(&self) -> u32 {
        unsafe {
            ffi::wp_properties_get_count(self.to_glib_none().0)
        }
    }

    #[doc(alias = "wp_properties_matches")]
    pub fn matches(&self, other: &Properties) -> bool {
        unsafe {
            from_glib(ffi::wp_properties_matches(self.to_glib_none().0, other.to_glib_none().0))
        }
    }

    #[doc(alias = "wp_properties_new_iterator")]
    #[doc(alias = "new_iterator")]
#[allow(dead_code)]    pub(crate) fn items_iterator(&self) -> Option<Iterator> {
        unsafe {
            from_glib_full(ffi::wp_properties_new_iterator(self.to_glib_none().0))
        }
    }

    #[doc(alias = "wp_properties_set")]
    pub fn set(&self, key: &str, value: Option<&str>) -> i32 {
        unsafe {
            ffi::wp_properties_set(self.to_glib_none().0, key.to_glib_none().0, value.to_glib_none().0)
        }
    }

    #[doc(alias = "wp_properties_sort")]
    pub fn sort(&self) {
        unsafe {
            ffi::wp_properties_sort(self.to_glib_none().0);
        }
    }

    #[doc(alias = "wp_properties_update")]
    pub fn update(&self, props: &Properties) -> i32 {
        unsafe {
            ffi::wp_properties_update(self.to_glib_none().0, props.to_glib_none().0)
        }
    }

    #[doc(alias = "wp_properties_update_keys_array")]
    #[doc(alias = "update_keys_array")]
    pub fn update_keys(&self, props: &Properties, keys: &[&str]) -> i32 {
        unsafe {
            ffi::wp_properties_update_keys_array(self.to_glib_none().0, props.to_glib_none().0, keys.to_glib_none().0)
        }
    }

    #[doc(alias = "wp_properties_iterator_item_get_key")]
    pub fn iterator_item_get_key(item: &glib::Value) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::wp_properties_iterator_item_get_key(item.to_glib_none().0))
        }
    }

    #[doc(alias = "wp_properties_iterator_item_get_value")]
    pub fn iterator_item_get_value(item: &glib::Value) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::wp_properties_iterator_item_get_value(item.to_glib_none().0))
        }
    }
}