// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// 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;

mod manual;

pub use manual::*;

#[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 GWin32InputStreamClass {
    pub parent_class: gio::GInputStreamClass,
    pub _g_reserved1: Option<unsafe extern "C" fn()>,
    pub _g_reserved2: Option<unsafe extern "C" fn()>,
    pub _g_reserved3: Option<unsafe extern "C" fn()>,
    pub _g_reserved4: Option<unsafe extern "C" fn()>,
    pub _g_reserved5: Option<unsafe extern "C" fn()>,
}

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

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

pub type GWin32InputStreamPrivate = _GWin32InputStreamPrivate;

#[derive(Copy, Clone)]
#[repr(C)]
pub struct GWin32NetworkMonitor {
    pub parent_instance: GNetworkMonitorBase,
    pub priv_: *mut GWin32NetworkMonitorPrivate,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct GWin32NetworkMonitorClass {
    pub parent_class: GNetworkMonitorBaseClass,
}

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

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

pub type GWin32NetworkMonitorPrivate = _GWin32NetworkMonitorPrivate;

#[derive(Copy, Clone)]
#[repr(C)]
pub struct GWin32OutputStreamClass {
    pub parent_class: gio::GOutputStreamClass,
    pub _g_reserved1: Option<unsafe extern "C" fn()>,
    pub _g_reserved2: Option<unsafe extern "C" fn()>,
    pub _g_reserved3: Option<unsafe extern "C" fn()>,
    pub _g_reserved4: Option<unsafe extern "C" fn()>,
    pub _g_reserved5: Option<unsafe extern "C" fn()>,
}

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

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

pub type GWin32OutputStreamPrivate = _GWin32OutputStreamPrivate;

// Classes
#[derive(Copy, Clone)]
#[repr(C)]
pub struct GWin32InputStream {
    pub parent_instance: gio::GInputStream,
    pub priv_: *mut GWin32InputStreamPrivate,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct GWin32OutputStream {
    pub parent_instance: gio::GOutputStream,
    pub priv_: *mut GWin32OutputStreamPrivate,
}

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

unsafe extern "C" {

    //=========================================================================
    // GWin32InputStream
    //=========================================================================
    pub fn g_win32_input_stream_get_type() -> GType;
    pub fn g_win32_input_stream_new(
        handle: *mut c_void,
        close_handle: gboolean,
    ) -> *mut gio::GInputStream;
    pub fn g_win32_input_stream_get_close_handle(stream: *mut GWin32InputStream) -> gboolean;
    pub fn g_win32_input_stream_get_handle(stream: *mut GWin32InputStream) -> *mut c_void;
    pub fn g_win32_input_stream_set_close_handle(
        stream: *mut GWin32InputStream,
        close_handle: gboolean,
    );

    //=========================================================================
    // GWin32OutputStream
    //=========================================================================
    pub fn g_win32_output_stream_get_type() -> GType;
    pub fn g_win32_output_stream_new(
        handle: *mut c_void,
        close_handle: gboolean,
    ) -> *mut gio::GOutputStream;
    pub fn g_win32_output_stream_get_close_handle(stream: *mut GWin32OutputStream) -> gboolean;
    pub fn g_win32_output_stream_get_handle(stream: *mut GWin32OutputStream) -> *mut c_void;
    pub fn g_win32_output_stream_set_close_handle(
        stream: *mut GWin32OutputStream,
        close_handle: gboolean,
    );

    //=========================================================================
    // Other functions
    //=========================================================================
    #[cfg(feature = "v2_78")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v2_78")))]
    pub fn g_registry_settings_backend_new(
        registry_key: *const c_char,
    ) -> *mut gio::GSettingsBackend;

}
