1#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
7#![allow(
8 clippy::approx_constant,
9 clippy::type_complexity,
10 clippy::unreadable_literal,
11 clippy::upper_case_acronyms
12)]
13#![cfg_attr(docsrs, feature(doc_cfg))]
14
15use gio_sys as gio;
16use glib_sys as glib;
17use gobject_sys as gobject;
18use gtk_sys as gtk;
19
20#[cfg(unix)]
21#[allow(unused_imports)]
22use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t};
23#[allow(unused_imports)]
24use libc::{intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE};
25#[allow(unused_imports)]
26use std::ffi::{
27 c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
28};
29
30#[allow(unused_imports)]
31use glib::{gboolean, gconstpointer, gpointer, GType};
32
33#[derive(Copy, Clone)]
35#[repr(C)]
36pub struct SpellingCheckerClass {
37 pub parent_class: gobject::GObjectClass,
38}
39
40impl ::std::fmt::Debug for SpellingCheckerClass {
41 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
42 f.debug_struct(&format!("SpellingCheckerClass @ {self:p}"))
43 .field("parent_class", &self.parent_class)
44 .finish()
45 }
46}
47
48#[repr(C)]
49#[allow(dead_code)]
50pub struct _SpellingDictionaryClass {
51 _data: [u8; 0],
52 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
53}
54
55pub type SpellingDictionaryClass = _SpellingDictionaryClass;
56
57#[derive(Copy, Clone)]
58#[repr(C)]
59pub struct SpellingLanguageClass {
60 pub parent_class: gobject::GObjectClass,
61}
62
63impl ::std::fmt::Debug for SpellingLanguageClass {
64 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
65 f.debug_struct(&format!("SpellingLanguageClass @ {self:p}"))
66 .field("parent_class", &self.parent_class)
67 .finish()
68 }
69}
70
71#[repr(C)]
72#[allow(dead_code)]
73pub struct _SpellingProviderClass {
74 _data: [u8; 0],
75 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
76}
77
78pub type SpellingProviderClass = _SpellingProviderClass;
79
80#[derive(Copy, Clone)]
81#[repr(C)]
82pub struct SpellingTextBufferAdapterClass {
83 pub parent_class: gobject::GObjectClass,
84}
85
86impl ::std::fmt::Debug for SpellingTextBufferAdapterClass {
87 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
88 f.debug_struct(&format!("SpellingTextBufferAdapterClass @ {self:p}"))
89 .field("parent_class", &self.parent_class)
90 .finish()
91 }
92}
93
94#[repr(C)]
96#[allow(dead_code)]
97pub struct SpellingChecker {
98 _data: [u8; 0],
99 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
100}
101
102impl ::std::fmt::Debug for SpellingChecker {
103 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
104 f.debug_struct(&format!("SpellingChecker @ {self:p}"))
105 .finish()
106 }
107}
108
109#[repr(C)]
110#[allow(dead_code)]
111pub struct SpellingDictionary {
112 _data: [u8; 0],
113 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
114}
115
116impl ::std::fmt::Debug for SpellingDictionary {
117 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
118 f.debug_struct(&format!("SpellingDictionary @ {self:p}"))
119 .finish()
120 }
121}
122
123#[repr(C)]
124#[allow(dead_code)]
125pub struct SpellingLanguage {
126 _data: [u8; 0],
127 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
128}
129
130impl ::std::fmt::Debug for SpellingLanguage {
131 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
132 f.debug_struct(&format!("SpellingLanguage @ {self:p}"))
133 .finish()
134 }
135}
136
137#[repr(C)]
138#[allow(dead_code)]
139pub struct SpellingProvider {
140 _data: [u8; 0],
141 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
142}
143
144impl ::std::fmt::Debug for SpellingProvider {
145 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
146 f.debug_struct(&format!("SpellingProvider @ {self:p}"))
147 .finish()
148 }
149}
150
151#[repr(C)]
152#[allow(dead_code)]
153pub struct SpellingTextBufferAdapter {
154 _data: [u8; 0],
155 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
156}
157
158impl ::std::fmt::Debug for SpellingTextBufferAdapter {
159 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
160 f.debug_struct(&format!("SpellingTextBufferAdapter @ {self:p}"))
161 .finish()
162 }
163}
164
165extern "C" {
166
167 pub fn spelling_checker_get_type() -> GType;
171 pub fn spelling_checker_new(
172 provider: *mut SpellingProvider,
173 language: *const c_char,
174 ) -> *mut SpellingChecker;
175 pub fn spelling_checker_get_default() -> *mut SpellingChecker;
176 pub fn spelling_checker_add_word(self_: *mut SpellingChecker, word: *const c_char);
177 pub fn spelling_checker_check_word(
178 self_: *mut SpellingChecker,
179 word: *const c_char,
180 word_len: ssize_t,
181 ) -> gboolean;
182 pub fn spelling_checker_get_extra_word_chars(self_: *mut SpellingChecker) -> *const c_char;
183 pub fn spelling_checker_get_language(self_: *mut SpellingChecker) -> *const c_char;
184 pub fn spelling_checker_get_provider(self_: *mut SpellingChecker) -> *mut SpellingProvider;
185 pub fn spelling_checker_ignore_word(self_: *mut SpellingChecker, word: *const c_char);
186 pub fn spelling_checker_list_corrections(
187 self_: *mut SpellingChecker,
188 word: *const c_char,
189 ) -> *mut *mut c_char;
190 pub fn spelling_checker_set_language(self_: *mut SpellingChecker, language: *const c_char);
191
192 pub fn spelling_dictionary_get_type() -> GType;
196 pub fn spelling_dictionary_add_word(self_: *mut SpellingDictionary, word: *const c_char);
197 pub fn spelling_dictionary_contains_word(
198 self_: *mut SpellingDictionary,
199 word: *const c_char,
200 word_len: ssize_t,
201 ) -> gboolean;
202 pub fn spelling_dictionary_get_code(self_: *mut SpellingDictionary) -> *const c_char;
203 pub fn spelling_dictionary_get_extra_word_chars(
204 self_: *mut SpellingDictionary,
205 ) -> *const c_char;
206 pub fn spelling_dictionary_ignore_word(self_: *mut SpellingDictionary, word: *const c_char);
207 pub fn spelling_dictionary_list_corrections(
208 self_: *mut SpellingDictionary,
209 word: *const c_char,
210 word_len: ssize_t,
211 ) -> *mut *mut c_char;
212
213 pub fn spelling_language_get_type() -> GType;
217 pub fn spelling_language_get_code(self_: *mut SpellingLanguage) -> *const c_char;
218 pub fn spelling_language_get_group(self_: *mut SpellingLanguage) -> *const c_char;
219 pub fn spelling_language_get_name(self_: *mut SpellingLanguage) -> *const c_char;
220
221 pub fn spelling_provider_get_type() -> GType;
225 pub fn spelling_provider_get_default() -> *mut SpellingProvider;
226 pub fn spelling_provider_get_default_code(self_: *mut SpellingProvider) -> *const c_char;
227 pub fn spelling_provider_get_display_name(self_: *mut SpellingProvider) -> *const c_char;
228 pub fn spelling_provider_list_languages(self_: *mut SpellingProvider) -> *mut gio::GListModel;
229 pub fn spelling_provider_load_dictionary(
230 self_: *mut SpellingProvider,
231 language: *const c_char,
232 ) -> *mut SpellingDictionary;
233 pub fn spelling_provider_supports_language(
234 self_: *mut SpellingProvider,
235 language: *const c_char,
236 ) -> gboolean;
237
238 pub fn spelling_text_buffer_adapter_get_type() -> GType;
242 pub fn spelling_text_buffer_adapter_new(
243 buffer: *mut gtk_source::GtkSourceBuffer,
244 checker: *mut SpellingChecker,
245 ) -> *mut SpellingTextBufferAdapter;
246 pub fn spelling_text_buffer_adapter_get_buffer(
247 self_: *mut SpellingTextBufferAdapter,
248 ) -> *mut gtk_source::GtkSourceBuffer;
249 pub fn spelling_text_buffer_adapter_get_checker(
250 self_: *mut SpellingTextBufferAdapter,
251 ) -> *mut SpellingChecker;
252 pub fn spelling_text_buffer_adapter_get_enabled(
253 self_: *mut SpellingTextBufferAdapter,
254 ) -> gboolean;
255 pub fn spelling_text_buffer_adapter_get_language(
256 self_: *mut SpellingTextBufferAdapter,
257 ) -> *const c_char;
258 pub fn spelling_text_buffer_adapter_get_menu_model(
259 self_: *mut SpellingTextBufferAdapter,
260 ) -> *mut gio::GMenuModel;
261 pub fn spelling_text_buffer_adapter_get_tag(
262 self_: *mut SpellingTextBufferAdapter,
263 ) -> *mut gtk::GtkTextTag;
264 pub fn spelling_text_buffer_adapter_invalidate_all(self_: *mut SpellingTextBufferAdapter);
265 pub fn spelling_text_buffer_adapter_set_checker(
266 self_: *mut SpellingTextBufferAdapter,
267 checker: *mut SpellingChecker,
268 );
269 pub fn spelling_text_buffer_adapter_set_enabled(
270 self_: *mut SpellingTextBufferAdapter,
271 enabled: gboolean,
272 );
273 pub fn spelling_text_buffer_adapter_set_language(
274 self_: *mut SpellingTextBufferAdapter,
275 language: *const c_char,
276 );
277 pub fn spelling_text_buffer_adapter_update_corrections(self_: *mut SpellingTextBufferAdapter);
278
279 pub fn spelling_init();
283
284}