// Generated by gir (https://github.com/gtk-rs/gir @ eb5be4f1bafe)
// from ../../ev-girs (@ e37ae592bf83+)
// from ../../gir-files (@ 20031a537e40)
// 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 cairo_sys as cairo;
use gdk_pixbuf_sys as gdk_pixbuf;
use gdk_sys as gdk;
use gio_sys as gio;
use glib_sys as glib;
use gobject_sys as gobject;
use gtk_sys as gtk;
use papers_document_sys as papers_document;
use papers_view_sys as papers_view;

#[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, off_t, size_t, ssize_t, time_t, uintptr_t, FILE,
};
#[cfg(unix)]
#[allow(unused_imports)]
use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t};

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

// Enums
pub type PpsWindowRunMode = c_int;
pub const PPS_WINDOW_MODE_NORMAL: PpsWindowRunMode = 0;
pub const PPS_WINDOW_MODE_FULLSCREEN: PpsWindowRunMode = 1;
pub const PPS_WINDOW_MODE_PRESENTATION: PpsWindowRunMode = 2;
pub const PPS_WINDOW_MODE_START_VIEW: PpsWindowRunMode = 3;
pub const PPS_WINDOW_MODE_ERROR_VIEW: PpsWindowRunMode = 4;
pub const PPS_WINDOW_MODE_PASSWORD_VIEW: PpsWindowRunMode = 5;
pub const PPS_WINDOW_MODE_LOADER_VIEW: PpsWindowRunMode = 6;

// Records
#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsFileMonitorClass {
    pub base_class: gobject::GObjectClass,
    pub changed: Option<unsafe extern "C" fn(*mut PpsFileMonitor)>,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsFindSidebarClass {
    pub base_class: adw::AdwBinClass,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsMessageAreaClass {
    pub parent_class: adw::AdwBinClass,
}

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

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

pub type PpsMetadataClass = _PpsMetadataClass;

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsObjectIface {
    pub parent_iface: gobject::GTypeInterface,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsObjectManagerClientClass {
    pub parent_class: gio::GDBusObjectManagerClientClass,
}

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

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

pub type PpsObjectManagerClientPrivate = _PpsObjectManagerClientPrivate;

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsObjectProxyClass {
    pub parent_class: gio::GDBusObjectProxyClass,
}

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

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

pub type PpsObjectProxyPrivate = _PpsObjectProxyPrivate;

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsObjectSkeletonClass {
    pub parent_class: gio::GDBusObjectSkeletonClass,
}

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

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

pub type PpsObjectSkeletonPrivate = _PpsObjectSkeletonPrivate;

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsPapersApplicationIface {
    pub parent_iface: gobject::GTypeInterface,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsPapersApplicationProxyClass {
    pub parent_class: gio::GDBusProxyClass,
}

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

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

pub type PpsPapersApplicationProxyPrivate = _PpsPapersApplicationProxyPrivate;

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsPapersApplicationSkeletonClass {
    pub parent_class: gio::GDBusInterfaceSkeletonClass,
}

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

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

pub type PpsPapersApplicationSkeletonPrivate = _PpsPapersApplicationSkeletonPrivate;

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

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

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

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

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

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsSidebarAnnotationsClass {
    pub base_class: PpsSidebarPageClass,
    pub annot_activated:
        Option<unsafe extern "C" fn(*mut PpsSidebarAnnotations, *mut papers_document::PpsMapping)>,
}

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

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

pub type PpsSidebarAnnotationsPrivate = _PpsSidebarAnnotationsPrivate;

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsSidebarPageClass {
    pub parent_class: adw::AdwBinClass,
    pub support_document: Option<
        unsafe extern "C" fn(*mut PpsSidebarPage, *mut papers_document::PpsDocument) -> gboolean,
    >,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsWindowClass {
    pub parent_class: adw::AdwApplicationWindowClass,
}

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

// Classes
#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsFileMonitor {
    pub base_instance: gobject::GObject,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsFindSidebar {
    pub base_instance: adw::AdwBin,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsMessageArea {
    pub parent_instance: adw::AdwBin,
}

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

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

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsObjectManagerClient {
    pub parent_instance: gio::GDBusObjectManagerClient,
    pub priv_: *mut PpsObjectManagerClientPrivate,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsObjectProxy {
    pub parent_instance: gio::GDBusObjectProxy,
    pub priv_: *mut PpsObjectProxyPrivate,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsObjectSkeleton {
    pub parent_instance: gio::GDBusObjectSkeleton,
    pub priv_: *mut PpsObjectSkeletonPrivate,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsPapersApplicationProxy {
    pub parent_instance: gio::GDBusProxy,
    pub priv_: *mut PpsPapersApplicationProxyPrivate,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsPapersApplicationSkeleton {
    pub parent_instance: gio::GDBusInterfaceSkeleton,
    pub priv_: *mut PpsPapersApplicationSkeletonPrivate,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsProgressMessageArea {
    pub parent_instance: PpsMessageArea,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsSearchContext {
    pub parent_instance: gobject::GObject,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsSearchResult {
    pub parent_instance: gobject::GObject,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsSidebarAnnotations {
    pub parent_instance: PpsSidebarPage,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsSidebarPage {
    pub parent_instance: adw::AdwBin,
}

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

#[derive(Copy, Clone)]
#[repr(C)]
pub struct PpsWindow {
    pub base_instance: adw::AdwApplicationWindow,
}

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

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

impl ::std::fmt::Debug for PpsObject {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        write!(f, "PpsObject @ {self:p}")
    }
}

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

impl ::std::fmt::Debug for PpsPapersApplication {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        write!(f, "PpsPapersApplication @ {self:p}")
    }
}

#[link(name = "ppsshell-4.0")]
#[link(name = "ppsview-4.0")]
#[link(name = "ppsdocument-4.0")]
extern "C" {

    //=========================================================================
    // PpsWindowRunMode
    //=========================================================================
    pub fn pps_window_run_mode_get_type() -> GType;

    //=========================================================================
    // PpsFileMonitor
    //=========================================================================
    pub fn pps_file_monitor_get_type() -> GType;
    pub fn pps_file_monitor_new(uri: *const c_char) -> *mut PpsFileMonitor;

    //=========================================================================
    // PpsFindSidebar
    //=========================================================================
    pub fn pps_find_sidebar_get_type() -> GType;
    pub fn pps_find_sidebar_new() -> *mut gtk::GtkWidget;
    pub fn pps_find_sidebar_clear(find_sidebar: *mut PpsFindSidebar);
    pub fn pps_find_sidebar_next(find_sidebar: *mut PpsFindSidebar);
    pub fn pps_find_sidebar_previous(find_sidebar: *mut PpsFindSidebar);
    pub fn pps_find_sidebar_restart(find_sidebar: *mut PpsFindSidebar, page: c_int);
    pub fn pps_find_sidebar_set_search_context(
        find_sidebar: *mut PpsFindSidebar,
        context: *mut PpsSearchContext,
    );
    pub fn pps_find_sidebar_update(find_sidebar: *mut PpsFindSidebar);

    //=========================================================================
    // PpsMessageArea
    //=========================================================================
    pub fn pps_message_area_get_type() -> GType;
    pub fn pps_message_area_new(
        type_: gtk::GtkMessageType,
        text: *const c_char,
        first_button_text: *const c_char,
        ...
    ) -> *mut gtk::GtkWidget;
    pub fn pps_message_area_get_info_bar(area: *mut PpsMessageArea) -> *mut gtk::GtkWidget;
    pub fn pps_message_area_set_image(area: *mut PpsMessageArea, image: *mut gtk::GtkWidget);
    pub fn pps_message_area_set_image_from_icon_name(
        area: *mut PpsMessageArea,
        icon_name: *const c_char,
    );
    pub fn pps_message_area_set_secondary_text(area: *mut PpsMessageArea, str: *const c_char);
    pub fn pps_message_area_set_text(area: *mut PpsMessageArea, str: *const c_char);

    //=========================================================================
    // PpsMetadata
    //=========================================================================
    pub fn pps_metadata_get_type() -> GType;
    pub fn pps_metadata_new(file: *mut gio::GFile) -> *mut PpsMetadata;
    pub fn pps_metadata_is_file_supported(file: *mut gio::GFile) -> gboolean;
    pub fn pps_metadata_get_boolean(
        metadata: *mut PpsMetadata,
        key: *const c_char,
        value: *mut gboolean,
    ) -> gboolean;
    pub fn pps_metadata_get_double(
        metadata: *mut PpsMetadata,
        key: *const c_char,
        value: *mut c_double,
    ) -> gboolean;
    pub fn pps_metadata_get_int(
        metadata: *mut PpsMetadata,
        key: *const c_char,
        value: *mut c_int,
    ) -> gboolean;
    pub fn pps_metadata_get_string(
        metadata: *mut PpsMetadata,
        key: *const c_char,
        value: *mut *const c_char,
    ) -> gboolean;
    pub fn pps_metadata_has_key(metadata: *mut PpsMetadata, key: *const c_char) -> gboolean;
    pub fn pps_metadata_is_empty(metadata: *mut PpsMetadata) -> gboolean;
    pub fn pps_metadata_set_boolean(
        metadata: *mut PpsMetadata,
        key: *const c_char,
        value: gboolean,
    ) -> gboolean;
    pub fn pps_metadata_set_double(
        metadata: *mut PpsMetadata,
        key: *const c_char,
        value: c_double,
    ) -> gboolean;
    pub fn pps_metadata_set_int(
        metadata: *mut PpsMetadata,
        key: *const c_char,
        value: c_int,
    ) -> gboolean;
    pub fn pps_metadata_set_string(
        metadata: *mut PpsMetadata,
        key: *const c_char,
        value: *const c_char,
    ) -> gboolean;

    //=========================================================================
    // PpsObjectManagerClient
    //=========================================================================
    pub fn pps_object_manager_client_get_type() -> GType;
    pub fn pps_object_manager_client_new_finish(
        res: *mut gio::GAsyncResult,
        error: *mut *mut glib::GError,
    ) -> *mut PpsObjectManagerClient;
    pub fn pps_object_manager_client_new_for_bus_finish(
        res: *mut gio::GAsyncResult,
        error: *mut *mut glib::GError,
    ) -> *mut PpsObjectManagerClient;
    pub fn pps_object_manager_client_new_for_bus_sync(
        bus_type: gio::GBusType,
        flags: gio::GDBusObjectManagerClientFlags,
        name: *const c_char,
        object_path: *const c_char,
        cancellable: *mut gio::GCancellable,
        error: *mut *mut glib::GError,
    ) -> *mut PpsObjectManagerClient;
    pub fn pps_object_manager_client_new_sync(
        connection: *mut gio::GDBusConnection,
        flags: gio::GDBusObjectManagerClientFlags,
        name: *const c_char,
        object_path: *const c_char,
        cancellable: *mut gio::GCancellable,
        error: *mut *mut glib::GError,
    ) -> *mut PpsObjectManagerClient;
    pub fn pps_object_manager_client_get_proxy_type(
        manager: *mut gio::GDBusObjectManagerClient,
        object_path: *const c_char,
        interface_name: *const c_char,
        user_data: gpointer,
    ) -> GType;
    pub fn pps_object_manager_client_new(
        connection: *mut gio::GDBusConnection,
        flags: gio::GDBusObjectManagerClientFlags,
        name: *const c_char,
        object_path: *const c_char,
        cancellable: *mut gio::GCancellable,
        callback: gio::GAsyncReadyCallback,
        user_data: gpointer,
    );
    pub fn pps_object_manager_client_new_for_bus(
        bus_type: gio::GBusType,
        flags: gio::GDBusObjectManagerClientFlags,
        name: *const c_char,
        object_path: *const c_char,
        cancellable: *mut gio::GCancellable,
        callback: gio::GAsyncReadyCallback,
        user_data: gpointer,
    );

    //=========================================================================
    // PpsObjectProxy
    //=========================================================================
    pub fn pps_object_proxy_get_type() -> GType;
    pub fn pps_object_proxy_new(
        connection: *mut gio::GDBusConnection,
        object_path: *const c_char,
    ) -> *mut PpsObjectProxy;

    //=========================================================================
    // PpsObjectSkeleton
    //=========================================================================
    pub fn pps_object_skeleton_get_type() -> GType;
    pub fn pps_object_skeleton_new(object_path: *const c_char) -> *mut PpsObjectSkeleton;
    pub fn pps_object_skeleton_set_papers_application(
        object: *mut PpsObjectSkeleton,
        interface_: *mut PpsPapersApplication,
    );

    //=========================================================================
    // PpsPapersApplicationProxy
    //=========================================================================
    pub fn pps_papers_application_proxy_get_type() -> GType;
    pub fn pps_papers_application_proxy_new_finish(
        res: *mut gio::GAsyncResult,
        error: *mut *mut glib::GError,
    ) -> *mut PpsPapersApplicationProxy;
    pub fn pps_papers_application_proxy_new_for_bus_finish(
        res: *mut gio::GAsyncResult,
        error: *mut *mut glib::GError,
    ) -> *mut PpsPapersApplicationProxy;
    pub fn pps_papers_application_proxy_new_for_bus_sync(
        bus_type: gio::GBusType,
        flags: gio::GDBusProxyFlags,
        name: *const c_char,
        object_path: *const c_char,
        cancellable: *mut gio::GCancellable,
        error: *mut *mut glib::GError,
    ) -> *mut PpsPapersApplicationProxy;
    pub fn pps_papers_application_proxy_new_sync(
        connection: *mut gio::GDBusConnection,
        flags: gio::GDBusProxyFlags,
        name: *const c_char,
        object_path: *const c_char,
        cancellable: *mut gio::GCancellable,
        error: *mut *mut glib::GError,
    ) -> *mut PpsPapersApplicationProxy;
    pub fn pps_papers_application_proxy_new(
        connection: *mut gio::GDBusConnection,
        flags: gio::GDBusProxyFlags,
        name: *const c_char,
        object_path: *const c_char,
        cancellable: *mut gio::GCancellable,
        callback: gio::GAsyncReadyCallback,
        user_data: gpointer,
    );
    pub fn pps_papers_application_proxy_new_for_bus(
        bus_type: gio::GBusType,
        flags: gio::GDBusProxyFlags,
        name: *const c_char,
        object_path: *const c_char,
        cancellable: *mut gio::GCancellable,
        callback: gio::GAsyncReadyCallback,
        user_data: gpointer,
    );

    //=========================================================================
    // PpsPapersApplicationSkeleton
    //=========================================================================
    pub fn pps_papers_application_skeleton_get_type() -> GType;
    pub fn pps_papers_application_skeleton_new() -> *mut PpsPapersApplicationSkeleton;

    //=========================================================================
    // PpsProgressMessageArea
    //=========================================================================
    pub fn pps_progress_message_area_get_type() -> GType;
    pub fn pps_progress_message_area_new(
        icon_name: *const c_char,
        text: *const c_char,
        first_button_text: *const c_char,
        ...
    ) -> *mut gtk::GtkWidget;
    pub fn pps_progress_message_area_set_fraction(
        area: *mut PpsProgressMessageArea,
        fraction: c_double,
    );
    pub fn pps_progress_message_area_set_status(
        area: *mut PpsProgressMessageArea,
        str: *const c_char,
    );

    //=========================================================================
    // PpsSearchContext
    //=========================================================================
    pub fn pps_search_context_get_type() -> GType;
    pub fn pps_search_context_new(
        model: *mut papers_view::PpsDocumentModel,
    ) -> *mut PpsSearchContext;
    pub fn pps_search_context_get_options(
        context: *mut PpsSearchContext,
    ) -> papers_document::PpsFindOptions;
    pub fn pps_search_context_get_result_model(
        context: *mut PpsSearchContext,
    ) -> *mut gio::GListModel;
    pub fn pps_search_context_get_search_term(context: *mut PpsSearchContext) -> *const c_char;
    pub fn pps_search_context_restart(context: *mut PpsSearchContext);
    pub fn pps_search_context_select_result(
        context: *mut PpsSearchContext,
        result: *mut PpsSearchResult,
    );
    pub fn pps_search_context_set_options(
        context: *mut PpsSearchContext,
        options: papers_document::PpsFindOptions,
    );
    pub fn pps_search_context_set_search_term(
        context: *mut PpsSearchContext,
        search_term: *const c_char,
    );

    //=========================================================================
    // PpsSearchResult
    //=========================================================================
    pub fn pps_search_result_get_type() -> GType;
    pub fn pps_search_result_new(
        markup: *mut c_char,
        label: *mut c_char,
        page: c_uint,
        index: c_uint,
    ) -> *mut PpsSearchResult;
    pub fn pps_search_result_get_index(self_: *mut PpsSearchResult) -> c_uint;
    pub fn pps_search_result_get_label(self_: *mut PpsSearchResult) -> *const c_char;
    pub fn pps_search_result_get_markup(self_: *mut PpsSearchResult) -> *const c_char;
    pub fn pps_search_result_get_page(self_: *mut PpsSearchResult) -> c_uint;

    //=========================================================================
    // PpsSidebarAnnotations
    //=========================================================================
    pub fn pps_sidebar_annotations_get_type() -> GType;
    pub fn pps_sidebar_annotations_new() -> *mut gtk::GtkWidget;
    pub fn pps_sidebar_annotations_annot_added(
        sidebar_annots: *mut PpsSidebarAnnotations,
        annot: *mut papers_document::PpsAnnotation,
    );
    pub fn pps_sidebar_annotations_annot_removed(sidebar_annots: *mut PpsSidebarAnnotations);

    //=========================================================================
    // PpsSidebarPage
    //=========================================================================
    pub fn pps_sidebar_page_get_type() -> GType;
    pub fn pps_sidebar_page_get_document_model(
        sidebar_page: *mut PpsSidebarPage,
    ) -> *mut papers_view::PpsDocumentModel;
    pub fn pps_sidebar_page_navigate_to_view(sidebar_page: *mut PpsSidebarPage);
    pub fn pps_sidebar_page_support_document(
        sidebar_page: *mut PpsSidebarPage,
        document: *mut papers_document::PpsDocument,
    ) -> gboolean;

    //=========================================================================
    // PpsWindow
    //=========================================================================
    pub fn pps_window_get_type() -> GType;
    pub fn pps_window_new() -> *mut PpsWindow;
    pub fn pps_window_focus_view(pps_window: *mut PpsWindow);
    pub fn pps_window_get_dbus_object_path(pps_window: *mut PpsWindow) -> *const c_char;
    pub fn pps_window_get_header_bar(pps_window: *mut PpsWindow) -> *mut adw::AdwHeaderBar;
    pub fn pps_window_get_metadata(pps_window: *mut PpsWindow) -> *mut PpsMetadata;
    pub fn pps_window_get_uri(pps_window: *mut PpsWindow) -> *const c_char;
    pub fn pps_window_handle_annot_popup(
        pps_window: *mut PpsWindow,
        annot: *mut papers_document::PpsAnnotation,
    );
    pub fn pps_window_is_empty(pps_window: *mut PpsWindow) -> gboolean;
    pub fn pps_window_open_uri(
        pps_window: *mut PpsWindow,
        uri: *const c_char,
        dest: *mut papers_document::PpsLinkDest,
        mode: PpsWindowRunMode,
    );
    pub fn pps_window_print_range(pps_window: *mut PpsWindow, first_page: c_int, last_page: c_int);

    //=========================================================================
    // PpsObject
    //=========================================================================
    pub fn pps_object_get_type() -> GType;
    pub fn pps_object_get_papers_application(object: *mut PpsObject) -> *mut PpsPapersApplication;
    pub fn pps_object_peek_papers_application(object: *mut PpsObject) -> *mut PpsPapersApplication;

    //=========================================================================
    // PpsPapersApplication
    //=========================================================================
    pub fn pps_papers_application_get_type() -> GType;
    pub fn pps_papers_application_interface_info() -> *mut gio::GDBusInterfaceInfo;
    pub fn pps_papers_application_override_properties(
        klass: *mut gobject::GObjectClass,
        property_id_begin: c_uint,
    ) -> c_uint;

    //=========================================================================
    // Other functions
    //=========================================================================
    pub fn pps_gdk_pixbuf_format_by_extension(
        uri: *const c_char,
    ) -> *mut gdk_pixbuf::GdkPixbufFormat;
    pub fn pps_get_resource() -> *mut gio::GResource;
    pub fn pps_print_region_contents(region: *mut cairo::cairo_region_t);
    pub fn pps_spawn(
        uri: *const c_char,
        dest: *mut papers_document::PpsLinkDest,
        mode: PpsWindowRunMode,
    );
    pub fn pps_spinner_map_cb(spinner: *mut gtk::GtkSpinner);
    pub fn pps_spinner_unmap_cb(spinner: *mut gtk::GtkSpinner);

}
