libspelling-sys 0.5.0

FFI bindings for libspelling
Documentation
// Generated by gir (https://github.com/gtk-rs/gir @ 640cfe45966f)
// from
// from gir-files (https://github.com/gtk-rs/gir-files @ 6ea02da9b1f6)
// 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::{FILE, intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t};
#[cfg(unix)]
#[allow(unused_imports)]
use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t};
#[allow(unused_imports)]
use std::ffi::{
    c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
};

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

// 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)]
#[allow(dead_code)]
pub struct _SpellingDictionaryClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type SpellingDictionaryClass = _SpellingDictionaryClass;

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

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

#[repr(C)]
#[allow(dead_code)]
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)]
#[allow(dead_code)]
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)]
#[allow(dead_code)]
pub struct SpellingDictionary {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
#[allow(dead_code)]
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)]
#[allow(dead_code)]
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)]
#[allow(dead_code)]
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()
    }
}

unsafe 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);

    //=========================================================================
    // SpellingDictionary
    //=========================================================================
    pub fn spelling_dictionary_get_type() -> GType;
    pub fn spelling_dictionary_add_word(self_: *mut SpellingDictionary, word: *const c_char);
    pub fn spelling_dictionary_contains_word(
        self_: *mut SpellingDictionary,
        word: *const c_char,
        word_len: ssize_t,
    ) -> gboolean;
    pub fn spelling_dictionary_get_code(self_: *mut SpellingDictionary) -> *const c_char;
    pub fn spelling_dictionary_get_extra_word_chars(
        self_: *mut SpellingDictionary,
    ) -> *const c_char;
    pub fn spelling_dictionary_ignore_word(self_: *mut SpellingDictionary, word: *const c_char);
    pub fn spelling_dictionary_list_corrections(
        self_: *mut SpellingDictionary,
        word: *const c_char,
        word_len: ssize_t,
    ) -> *mut *mut c_char;

    //=========================================================================
    // SpellingLanguage
    //=========================================================================
    pub fn spelling_language_get_type() -> GType;
    pub fn spelling_language_get_code(self_: *mut SpellingLanguage) -> *const c_char;
    pub fn spelling_language_get_group(self_: *mut SpellingLanguage) -> *const c_char;
    pub fn spelling_language_get_name(self_: *mut SpellingLanguage) -> *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_list_languages(self_: *mut SpellingProvider) -> *mut gio::GListModel;
    pub fn spelling_provider_load_dictionary(
        self_: *mut SpellingProvider,
        language: *const c_char,
    ) -> *mut SpellingDictionary;
    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,
    );
    pub fn spelling_text_buffer_adapter_update_corrections(self_: *mut SpellingTextBufferAdapter);

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

}