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
15#[allow(unused_imports)]
16use libc::{
17 c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
18 intptr_t, size_t, ssize_t, uintptr_t, FILE,
19};
20
21#[allow(unused_imports)]
22use glib::{gboolean, gconstpointer, gpointer, GType};
23
24pub type GspellCheckerError = c_int;
26pub const GSPELL_CHECKER_ERROR_DICTIONARY: GspellCheckerError = 0;
27pub const GSPELL_CHECKER_ERROR_NO_LANGUAGE_SET: GspellCheckerError = 1;
28
29#[derive(Copy, Clone)]
31#[repr(C)]
32pub struct GspellCheckerClass {
33 pub parent_class: gobject::GObjectClass,
34 pub word_added_to_personal: Option<unsafe extern "C" fn(*mut GspellChecker, *const c_char)>,
35 pub word_added_to_session: Option<unsafe extern "C" fn(*mut GspellChecker, *const c_char)>,
36 pub session_cleared: Option<unsafe extern "C" fn(*mut GspellChecker)>,
37 pub padding: [gpointer; 12],
38}
39
40impl ::std::fmt::Debug for GspellCheckerClass {
41 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
42 f.debug_struct(&format!("GspellCheckerClass @ {self:p}"))
43 .field("parent_class", &self.parent_class)
44 .field("word_added_to_personal", &self.word_added_to_personal)
45 .field("word_added_to_session", &self.word_added_to_session)
46 .field("session_cleared", &self.session_cleared)
47 .field("padding", &self.padding)
48 .finish()
49 }
50}
51
52#[derive(Copy, Clone)]
53#[repr(C)]
54pub struct GspellCheckerDialogClass {
55 pub parent_class: gtk::GtkDialogClass,
56 pub padding: [gpointer; 8],
57}
58
59impl ::std::fmt::Debug for GspellCheckerDialogClass {
60 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
61 f.debug_struct(&format!("GspellCheckerDialogClass @ {self:p}"))
62 .field("parent_class", &self.parent_class)
63 .field("padding", &self.padding)
64 .finish()
65 }
66}
67
68#[derive(Copy, Clone)]
69#[repr(C)]
70pub struct GspellEntryBufferClass {
71 pub parent_class: gobject::GObjectClass,
72}
73
74impl ::std::fmt::Debug for GspellEntryBufferClass {
75 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
76 f.debug_struct(&format!("GspellEntryBufferClass @ {self:p}"))
77 .field("parent_class", &self.parent_class)
78 .finish()
79 }
80}
81
82#[derive(Copy, Clone)]
83#[repr(C)]
84pub struct GspellEntryClass {
85 pub parent_class: gobject::GObjectClass,
86}
87
88impl ::std::fmt::Debug for GspellEntryClass {
89 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
90 f.debug_struct(&format!("GspellEntryClass @ {self:p}"))
91 .field("parent_class", &self.parent_class)
92 .finish()
93 }
94}
95
96#[repr(C)]
97pub struct GspellLanguage {
98 _data: [u8; 0],
99 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
100}
101
102impl ::std::fmt::Debug for GspellLanguage {
103 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
104 f.debug_struct(&format!("GspellLanguage @ {self:p}"))
105 .finish()
106 }
107}
108
109#[derive(Copy, Clone)]
110#[repr(C)]
111pub struct GspellLanguageChooserButtonClass {
112 pub parent_class: gtk::GtkButtonClass,
113 pub padding: [gpointer; 8],
114}
115
116impl ::std::fmt::Debug for GspellLanguageChooserButtonClass {
117 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
118 f.debug_struct(&format!("GspellLanguageChooserButtonClass @ {self:p}"))
119 .field("parent_class", &self.parent_class)
120 .field("padding", &self.padding)
121 .finish()
122 }
123}
124
125#[derive(Copy, Clone)]
126#[repr(C)]
127pub struct GspellLanguageChooserDialogClass {
128 pub parent_class: gtk::GtkDialogClass,
129 pub padding: [gpointer; 8],
130}
131
132impl ::std::fmt::Debug for GspellLanguageChooserDialogClass {
133 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
134 f.debug_struct(&format!("GspellLanguageChooserDialogClass @ {self:p}"))
135 .field("parent_class", &self.parent_class)
136 .field("padding", &self.padding)
137 .finish()
138 }
139}
140
141#[derive(Copy, Clone)]
142#[repr(C)]
143pub struct GspellLanguageChooserInterface {
144 pub parent_interface: gobject::GTypeInterface,
145 pub get_language_full: Option<
146 unsafe extern "C" fn(*mut GspellLanguageChooser, *mut gboolean) -> *const GspellLanguage,
147 >,
148 pub set_language:
149 Option<unsafe extern "C" fn(*mut GspellLanguageChooser, *const GspellLanguage)>,
150}
151
152impl ::std::fmt::Debug for GspellLanguageChooserInterface {
153 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
154 f.debug_struct(&format!("GspellLanguageChooserInterface @ {self:p}"))
155 .field("parent_interface", &self.parent_interface)
156 .field("get_language_full", &self.get_language_full)
157 .field("set_language", &self.set_language)
158 .finish()
159 }
160}
161
162#[derive(Copy, Clone)]
163#[repr(C)]
164pub struct GspellNavigatorInterface {
165 pub parent_interface: gobject::GTypeInterface,
166 pub goto_next: Option<
167 unsafe extern "C" fn(
168 *mut GspellNavigator,
169 *mut *mut c_char,
170 *mut *mut GspellChecker,
171 *mut *mut glib::GError,
172 ) -> gboolean,
173 >,
174 pub change: Option<unsafe extern "C" fn(*mut GspellNavigator, *const c_char, *const c_char)>,
175 pub change_all:
176 Option<unsafe extern "C" fn(*mut GspellNavigator, *const c_char, *const c_char)>,
177}
178
179impl ::std::fmt::Debug for GspellNavigatorInterface {
180 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
181 f.debug_struct(&format!("GspellNavigatorInterface @ {self:p}"))
182 .field("parent_interface", &self.parent_interface)
183 .field("goto_next", &self.goto_next)
184 .field("change", &self.change)
185 .field("change_all", &self.change_all)
186 .finish()
187 }
188}
189
190#[derive(Copy, Clone)]
191#[repr(C)]
192pub struct GspellNavigatorTextViewClass {
193 pub parent_class: gobject::GInitiallyUnownedClass,
194 pub padding: [gpointer; 8],
195}
196
197impl ::std::fmt::Debug for GspellNavigatorTextViewClass {
198 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
199 f.debug_struct(&format!("GspellNavigatorTextViewClass @ {self:p}"))
200 .field("parent_class", &self.parent_class)
201 .field("padding", &self.padding)
202 .finish()
203 }
204}
205
206#[derive(Copy, Clone)]
207#[repr(C)]
208pub struct GspellTextBufferClass {
209 pub parent_class: gobject::GObjectClass,
210}
211
212impl ::std::fmt::Debug for GspellTextBufferClass {
213 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
214 f.debug_struct(&format!("GspellTextBufferClass @ {self:p}"))
215 .field("parent_class", &self.parent_class)
216 .finish()
217 }
218}
219
220#[derive(Copy, Clone)]
221#[repr(C)]
222pub struct GspellTextViewClass {
223 pub parent_class: gobject::GObjectClass,
224 pub padding: [gpointer; 8],
225}
226
227impl ::std::fmt::Debug for GspellTextViewClass {
228 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
229 f.debug_struct(&format!("GspellTextViewClass @ {self:p}"))
230 .field("parent_class", &self.parent_class)
231 .field("padding", &self.padding)
232 .finish()
233 }
234}
235
236#[derive(Copy, Clone)]
238#[repr(C)]
239pub struct GspellChecker {
240 pub parent_instance: gobject::GObject,
241}
242
243impl ::std::fmt::Debug for GspellChecker {
244 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
245 f.debug_struct(&format!("GspellChecker @ {self:p}"))
246 .field("parent_instance", &self.parent_instance)
247 .finish()
248 }
249}
250
251#[derive(Copy, Clone)]
252#[repr(C)]
253pub struct GspellCheckerDialog {
254 pub parent_instance: gtk::GtkDialog,
255}
256
257impl ::std::fmt::Debug for GspellCheckerDialog {
258 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
259 f.debug_struct(&format!("GspellCheckerDialog @ {self:p}"))
260 .field("parent_instance", &self.parent_instance)
261 .finish()
262 }
263}
264
265#[repr(C)]
266pub struct GspellEntry {
267 _data: [u8; 0],
268 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
269}
270
271impl ::std::fmt::Debug for GspellEntry {
272 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
273 f.debug_struct(&format!("GspellEntry @ {self:p}")).finish()
274 }
275}
276
277#[repr(C)]
278pub struct GspellEntryBuffer {
279 _data: [u8; 0],
280 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
281}
282
283impl ::std::fmt::Debug for GspellEntryBuffer {
284 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
285 f.debug_struct(&format!("GspellEntryBuffer @ {self:p}"))
286 .finish()
287 }
288}
289
290#[derive(Copy, Clone)]
291#[repr(C)]
292pub struct GspellLanguageChooserButton {
293 pub parent_instance: gtk::GtkButton,
294}
295
296impl ::std::fmt::Debug for GspellLanguageChooserButton {
297 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
298 f.debug_struct(&format!("GspellLanguageChooserButton @ {self:p}"))
299 .field("parent_instance", &self.parent_instance)
300 .finish()
301 }
302}
303
304#[derive(Copy, Clone)]
305#[repr(C)]
306pub struct GspellLanguageChooserDialog {
307 pub parent_instance: gtk::GtkDialog,
308}
309
310impl ::std::fmt::Debug for GspellLanguageChooserDialog {
311 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
312 f.debug_struct(&format!("GspellLanguageChooserDialog @ {self:p}"))
313 .field("parent_instance", &self.parent_instance)
314 .finish()
315 }
316}
317
318#[derive(Copy, Clone)]
319#[repr(C)]
320pub struct GspellNavigatorTextView {
321 pub parent_instance: gobject::GInitiallyUnowned,
322}
323
324impl ::std::fmt::Debug for GspellNavigatorTextView {
325 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
326 f.debug_struct(&format!("GspellNavigatorTextView @ {self:p}"))
327 .field("parent_instance", &self.parent_instance)
328 .finish()
329 }
330}
331
332#[repr(C)]
333pub struct GspellTextBuffer {
334 _data: [u8; 0],
335 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
336}
337
338impl ::std::fmt::Debug for GspellTextBuffer {
339 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
340 f.debug_struct(&format!("GspellTextBuffer @ {self:p}"))
341 .finish()
342 }
343}
344
345#[derive(Copy, Clone)]
346#[repr(C)]
347pub struct GspellTextView {
348 pub parent_instance: gobject::GObject,
349}
350
351impl ::std::fmt::Debug for GspellTextView {
352 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
353 f.debug_struct(&format!("GspellTextView @ {self:p}"))
354 .field("parent_instance", &self.parent_instance)
355 .finish()
356 }
357}
358
359#[repr(C)]
361pub struct GspellLanguageChooser {
362 _data: [u8; 0],
363 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
364}
365
366impl ::std::fmt::Debug for GspellLanguageChooser {
367 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
368 write!(f, "GspellLanguageChooser @ {self:p}")
369 }
370}
371
372#[repr(C)]
373pub struct GspellNavigator {
374 _data: [u8; 0],
375 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
376}
377
378impl ::std::fmt::Debug for GspellNavigator {
379 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
380 write!(f, "GspellNavigator @ {self:p}")
381 }
382}
383
384#[link(name = "gspell-1")]
385extern "C" {
386
387 pub fn gspell_checker_error_get_type() -> GType;
391 pub fn gspell_checker_error_quark() -> glib::GQuark;
392
393 pub fn gspell_language_get_type() -> GType;
397 pub fn gspell_language_compare(
398 language_a: *const GspellLanguage,
399 language_b: *const GspellLanguage,
400 ) -> c_int;
401 pub fn gspell_language_copy(language: *const GspellLanguage) -> *mut GspellLanguage;
402 pub fn gspell_language_free(language: *mut GspellLanguage);
403 pub fn gspell_language_get_code(language: *const GspellLanguage) -> *const c_char;
404 pub fn gspell_language_get_name(language: *const GspellLanguage) -> *const c_char;
405 pub fn gspell_language_get_available() -> *const glib::GList;
406 pub fn gspell_language_get_default() -> *const GspellLanguage;
407 pub fn gspell_language_lookup(language_code: *const c_char) -> *const GspellLanguage;
408
409 pub fn gspell_checker_get_type() -> GType;
413 pub fn gspell_checker_new(language: *const GspellLanguage) -> *mut GspellChecker;
414 pub fn gspell_checker_add_word_to_personal(
415 checker: *mut GspellChecker,
416 word: *const c_char,
417 word_length: ssize_t,
418 );
419 pub fn gspell_checker_add_word_to_session(
420 checker: *mut GspellChecker,
421 word: *const c_char,
422 word_length: ssize_t,
423 );
424 pub fn gspell_checker_check_word(
425 checker: *mut GspellChecker,
426 word: *const c_char,
427 word_length: ssize_t,
428 error: *mut *mut glib::GError,
429 ) -> gboolean;
430 pub fn gspell_checker_clear_session(checker: *mut GspellChecker);
431 pub fn gspell_checker_get_language(checker: *mut GspellChecker) -> *const GspellLanguage;
432 pub fn gspell_checker_get_suggestions(
433 checker: *mut GspellChecker,
434 word: *const c_char,
435 word_length: ssize_t,
436 ) -> *mut glib::GSList;
437 pub fn gspell_checker_set_correction(
438 checker: *mut GspellChecker,
439 word: *const c_char,
440 word_length: ssize_t,
441 replacement: *const c_char,
442 replacement_length: ssize_t,
443 );
444 pub fn gspell_checker_set_language(
445 checker: *mut GspellChecker,
446 language: *const GspellLanguage,
447 );
448
449 pub fn gspell_checker_dialog_get_type() -> GType;
453 pub fn gspell_checker_dialog_new(
454 parent: *mut gtk::GtkWindow,
455 navigator: *mut GspellNavigator,
456 ) -> *mut gtk::GtkWidget;
457 pub fn gspell_checker_dialog_get_spell_navigator(
458 dialog: *mut GspellCheckerDialog,
459 ) -> *mut GspellNavigator;
460
461 pub fn gspell_entry_get_type() -> GType;
465 pub fn gspell_entry_get_from_gtk_entry(gtk_entry: *mut gtk::GtkEntry) -> *mut GspellEntry;
466 pub fn gspell_entry_basic_setup(gspell_entry: *mut GspellEntry);
467 pub fn gspell_entry_get_entry(gspell_entry: *mut GspellEntry) -> *mut gtk::GtkEntry;
468 pub fn gspell_entry_get_inline_spell_checking(gspell_entry: *mut GspellEntry) -> gboolean;
469 pub fn gspell_entry_set_inline_spell_checking(gspell_entry: *mut GspellEntry, enable: gboolean);
470
471 pub fn gspell_entry_buffer_get_type() -> GType;
475 pub fn gspell_entry_buffer_get_from_gtk_entry_buffer(
476 gtk_buffer: *mut gtk::GtkEntryBuffer,
477 ) -> *mut GspellEntryBuffer;
478 pub fn gspell_entry_buffer_get_buffer(
479 gspell_buffer: *mut GspellEntryBuffer,
480 ) -> *mut gtk::GtkEntryBuffer;
481 pub fn gspell_entry_buffer_get_spell_checker(
482 gspell_buffer: *mut GspellEntryBuffer,
483 ) -> *mut GspellChecker;
484 pub fn gspell_entry_buffer_set_spell_checker(
485 gspell_buffer: *mut GspellEntryBuffer,
486 spell_checker: *mut GspellChecker,
487 );
488
489 pub fn gspell_language_chooser_button_get_type() -> GType;
493 pub fn gspell_language_chooser_button_new(
494 current_language: *const GspellLanguage,
495 ) -> *mut gtk::GtkWidget;
496
497 pub fn gspell_language_chooser_dialog_get_type() -> GType;
501 pub fn gspell_language_chooser_dialog_new(
502 parent: *mut gtk::GtkWindow,
503 current_language: *const GspellLanguage,
504 flags: gtk::GtkDialogFlags,
505 ) -> *mut gtk::GtkWidget;
506
507 pub fn gspell_navigator_text_view_get_type() -> GType;
511 pub fn gspell_navigator_text_view_new(view: *mut gtk::GtkTextView) -> *mut GspellNavigator;
512 pub fn gspell_navigator_text_view_get_view(
513 navigator: *mut GspellNavigatorTextView,
514 ) -> *mut gtk::GtkTextView;
515
516 pub fn gspell_text_buffer_get_type() -> GType;
520 pub fn gspell_text_buffer_get_from_gtk_text_buffer(
521 gtk_buffer: *mut gtk::GtkTextBuffer,
522 ) -> *mut GspellTextBuffer;
523 pub fn gspell_text_buffer_get_buffer(
524 gspell_buffer: *mut GspellTextBuffer,
525 ) -> *mut gtk::GtkTextBuffer;
526 pub fn gspell_text_buffer_get_spell_checker(
527 gspell_buffer: *mut GspellTextBuffer,
528 ) -> *mut GspellChecker;
529 pub fn gspell_text_buffer_set_spell_checker(
530 gspell_buffer: *mut GspellTextBuffer,
531 spell_checker: *mut GspellChecker,
532 );
533
534 pub fn gspell_text_view_get_type() -> GType;
538 pub fn gspell_text_view_get_from_gtk_text_view(
539 gtk_view: *mut gtk::GtkTextView,
540 ) -> *mut GspellTextView;
541 pub fn gspell_text_view_basic_setup(gspell_view: *mut GspellTextView);
542 pub fn gspell_text_view_get_enable_language_menu(gspell_view: *mut GspellTextView) -> gboolean;
543 pub fn gspell_text_view_get_inline_spell_checking(gspell_view: *mut GspellTextView)
544 -> gboolean;
545 pub fn gspell_text_view_get_view(gspell_view: *mut GspellTextView) -> *mut gtk::GtkTextView;
546 pub fn gspell_text_view_set_enable_language_menu(
547 gspell_view: *mut GspellTextView,
548 enable_language_menu: gboolean,
549 );
550 pub fn gspell_text_view_set_inline_spell_checking(
551 gspell_view: *mut GspellTextView,
552 enable: gboolean,
553 );
554
555 pub fn gspell_language_chooser_get_type() -> GType;
559 pub fn gspell_language_chooser_get_language(
560 chooser: *mut GspellLanguageChooser,
561 ) -> *const GspellLanguage;
562 pub fn gspell_language_chooser_get_language_code(
563 chooser: *mut GspellLanguageChooser,
564 ) -> *const c_char;
565 pub fn gspell_language_chooser_set_language(
566 chooser: *mut GspellLanguageChooser,
567 language: *const GspellLanguage,
568 );
569 pub fn gspell_language_chooser_set_language_code(
570 chooser: *mut GspellLanguageChooser,
571 language_code: *const c_char,
572 );
573
574 pub fn gspell_navigator_get_type() -> GType;
578 pub fn gspell_navigator_change(
579 navigator: *mut GspellNavigator,
580 word: *const c_char,
581 change_to: *const c_char,
582 );
583 pub fn gspell_navigator_change_all(
584 navigator: *mut GspellNavigator,
585 word: *const c_char,
586 change_to: *const c_char,
587 );
588 pub fn gspell_navigator_goto_next(
589 navigator: *mut GspellNavigator,
590 word: *mut *mut c_char,
591 spell_checker: *mut *mut GspellChecker,
592 error: *mut *mut glib::GError,
593 ) -> gboolean;
594
595}