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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
// Generated by gir (https://github.com/gtk-rs/gir @ 0e476ab5c1de)
// from
// from gir-files (https://github.com/gtk-rs/gir-files @ cfc0305f903b)
// DO NOT EDIT

#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
#![allow(
    clippy::approx_constant,
    clippy::type_complexity,
    clippy::unreadable_literal,
    clippy::upper_case_acronyms
)]
#![cfg_attr(docsrs, feature(doc_cfg))]

use gio_sys as gio;
use glib_sys as glib;
use gobject_sys as gobject;
use gtk_sys as gtk;

#[allow(unused_imports)]
use libc::{
    c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
    intptr_t, size_t, ssize_t, uintptr_t, FILE,
};

#[allow(unused_imports)]
use glib::{gboolean, gconstpointer, gpointer, GType};

// Records
#[derive(Copy, Clone)]
#[repr(C)]
pub struct SpellingCheckerClass {
    pub parent_class: gobject::GObjectClass,
}

impl ::std::fmt::Debug for SpellingCheckerClass {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("SpellingCheckerClass @ {self:p}"))
            .field("parent_class", &self.parent_class)
            .finish()
    }
}

#[repr(C)]
pub struct _SpellingLanguageClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type SpellingLanguageClass = _SpellingLanguageClass;

#[derive(Copy, Clone)]
#[repr(C)]
pub struct SpellingLanguageInfoClass {
    pub parent_class: gobject::GObjectClass,
}

impl ::std::fmt::Debug for SpellingLanguageInfoClass {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("SpellingLanguageInfoClass @ {self:p}"))
            .field("parent_class", &self.parent_class)
            .finish()
    }
}

#[repr(C)]
pub struct _SpellingProviderClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type SpellingProviderClass = _SpellingProviderClass;

#[derive(Copy, Clone)]
#[repr(C)]
pub struct SpellingTextBufferAdapterClass {
    pub parent_class: gobject::GObjectClass,
}

impl ::std::fmt::Debug for SpellingTextBufferAdapterClass {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("SpellingTextBufferAdapterClass @ {self:p}"))
            .field("parent_class", &self.parent_class)
            .finish()
    }
}

// Classes
#[repr(C)]
pub struct SpellingChecker {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

impl ::std::fmt::Debug for SpellingChecker {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("SpellingChecker @ {self:p}"))
            .finish()
    }
}

#[repr(C)]
pub struct SpellingLanguage {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

impl ::std::fmt::Debug for SpellingLanguage {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("SpellingLanguage @ {self:p}"))
            .finish()
    }
}

#[repr(C)]
pub struct SpellingLanguageInfo {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

impl ::std::fmt::Debug for SpellingLanguageInfo {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("SpellingLanguageInfo @ {self:p}"))
            .finish()
    }
}

#[repr(C)]
pub struct SpellingProvider {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

impl ::std::fmt::Debug for SpellingProvider {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("SpellingProvider @ {self:p}"))
            .finish()
    }
}

#[repr(C)]
pub struct SpellingTextBufferAdapter {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

impl ::std::fmt::Debug for SpellingTextBufferAdapter {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("SpellingTextBufferAdapter @ {self:p}"))
            .finish()
    }
}

#[link(name = "spelling-1")]
extern "C" {

    //=========================================================================
    // SpellingChecker
    //=========================================================================
    pub fn spelling_checker_get_type() -> GType;
    pub fn spelling_checker_new(
        provider: *mut SpellingProvider,
        language: *const c_char,
    ) -> *mut SpellingChecker;
    pub fn spelling_checker_get_default() -> *mut SpellingChecker;
    pub fn spelling_checker_add_word(self_: *mut SpellingChecker, word: *const c_char);
    pub fn spelling_checker_check_word(
        self_: *mut SpellingChecker,
        word: *const c_char,
        word_len: ssize_t,
    ) -> gboolean;
    pub fn spelling_checker_get_extra_word_chars(self_: *mut SpellingChecker) -> *const c_char;
    pub fn spelling_checker_get_language(self_: *mut SpellingChecker) -> *const c_char;
    pub fn spelling_checker_get_provider(self_: *mut SpellingChecker) -> *mut SpellingProvider;
    pub fn spelling_checker_ignore_word(self_: *mut SpellingChecker, word: *const c_char);
    pub fn spelling_checker_list_corrections(
        self_: *mut SpellingChecker,
        word: *const c_char,
    ) -> *mut *mut c_char;
    pub fn spelling_checker_set_language(self_: *mut SpellingChecker, language: *const c_char);

    //=========================================================================
    // SpellingLanguage
    //=========================================================================
    pub fn spelling_language_get_type() -> GType;
    pub fn spelling_language_add_word(self_: *mut SpellingLanguage, word: *const c_char);
    pub fn spelling_language_contains_word(
        self_: *mut SpellingLanguage,
        word: *const c_char,
        word_len: ssize_t,
    ) -> gboolean;
    pub fn spelling_language_get_code(self_: *mut SpellingLanguage) -> *const c_char;
    pub fn spelling_language_get_extra_word_chars(self_: *mut SpellingLanguage) -> *const c_char;
    pub fn spelling_language_ignore_word(self_: *mut SpellingLanguage, word: *const c_char);
    pub fn spelling_language_list_corrections(
        self_: *mut SpellingLanguage,
        word: *const c_char,
        word_len: ssize_t,
    ) -> *mut *mut c_char;

    //=========================================================================
    // SpellingLanguageInfo
    //=========================================================================
    pub fn spelling_language_info_get_type() -> GType;
    pub fn spelling_language_info_get_code(self_: *mut SpellingLanguageInfo) -> *const c_char;
    pub fn spelling_language_info_get_group(self_: *mut SpellingLanguageInfo) -> *const c_char;
    pub fn spelling_language_info_get_name(self_: *mut SpellingLanguageInfo) -> *const c_char;

    //=========================================================================
    // SpellingProvider
    //=========================================================================
    pub fn spelling_provider_get_type() -> GType;
    pub fn spelling_provider_get_default() -> *mut SpellingProvider;
    pub fn spelling_provider_get_default_code(self_: *mut SpellingProvider) -> *const c_char;
    pub fn spelling_provider_get_display_name(self_: *mut SpellingProvider) -> *const c_char;
    pub fn spelling_provider_get_language(
        self_: *mut SpellingProvider,
        language: *const c_char,
    ) -> *mut SpellingLanguage;
    pub fn spelling_provider_list_languages(self_: *mut SpellingProvider) -> *mut glib::GPtrArray;
    pub fn spelling_provider_supports_language(
        self_: *mut SpellingProvider,
        language: *const c_char,
    ) -> gboolean;

    //=========================================================================
    // SpellingTextBufferAdapter
    //=========================================================================
    pub fn spelling_text_buffer_adapter_get_type() -> GType;
    pub fn spelling_text_buffer_adapter_new(
        buffer: *mut gtk_source::GtkSourceBuffer,
        checker: *mut SpellingChecker,
    ) -> *mut SpellingTextBufferAdapter;
    pub fn spelling_text_buffer_adapter_get_buffer(
        self_: *mut SpellingTextBufferAdapter,
    ) -> *mut gtk_source::GtkSourceBuffer;
    pub fn spelling_text_buffer_adapter_get_checker(
        self_: *mut SpellingTextBufferAdapter,
    ) -> *mut SpellingChecker;
    pub fn spelling_text_buffer_adapter_get_enabled(
        self_: *mut SpellingTextBufferAdapter,
    ) -> gboolean;
    pub fn spelling_text_buffer_adapter_get_language(
        self_: *mut SpellingTextBufferAdapter,
    ) -> *const c_char;
    pub fn spelling_text_buffer_adapter_get_menu_model(
        self_: *mut SpellingTextBufferAdapter,
    ) -> *mut gio::GMenuModel;
    pub fn spelling_text_buffer_adapter_get_tag(
        self_: *mut SpellingTextBufferAdapter,
    ) -> *mut gtk::GtkTextTag;
    pub fn spelling_text_buffer_adapter_invalidate_all(self_: *mut SpellingTextBufferAdapter);
    pub fn spelling_text_buffer_adapter_set_checker(
        self_: *mut SpellingTextBufferAdapter,
        checker: *mut SpellingChecker,
    );
    pub fn spelling_text_buffer_adapter_set_enabled(
        self_: *mut SpellingTextBufferAdapter,
        enabled: gboolean,
    );
    pub fn spelling_text_buffer_adapter_set_language(
        self_: *mut SpellingTextBufferAdapter,
        language: *const c_char,
    );

    //=========================================================================
    // Other functions
    //=========================================================================
    pub fn spelling_init();

}