lib: add some glib types to generate more functions
This commit is contained in:
parent
b44202fa90
commit
9e8192fec8
|
|
@ -54,16 +54,22 @@ generate = [
|
||||||
]
|
]
|
||||||
|
|
||||||
manual = [
|
manual = [
|
||||||
|
"Gio.AsyncReadyCallback",
|
||||||
|
"Gio.AsyncResult",
|
||||||
"Gio.Cancellable",
|
"Gio.Cancellable",
|
||||||
"Gio.File",
|
"Gio.File",
|
||||||
"Gio.FileInfo",
|
"Gio.FileInfo",
|
||||||
"Gio.FileQueryInfoFlags",
|
"Gio.FileQueryInfoFlags",
|
||||||
"Gio.InputStream",
|
"Gio.InputStream",
|
||||||
|
"Gio.VolumeMonitor",
|
||||||
"GLib.Bytes",
|
"GLib.Bytes",
|
||||||
"GLib.Error",
|
"GLib.Error",
|
||||||
"GLib.KeyFile",
|
"GLib.KeyFile",
|
||||||
|
"GLib.MainContext",
|
||||||
|
"GLib.Quark",
|
||||||
"GLib.String",
|
"GLib.String",
|
||||||
"GLib.Variant",
|
"GLib.Variant",
|
||||||
|
"GLib.VariantType",
|
||||||
|
|
||||||
"OSTree.RepoCheckoutAtOptions",
|
"OSTree.RepoCheckoutAtOptions",
|
||||||
"OSTree.RepoCheckoutFilter",
|
"OSTree.RepoCheckoutFilter",
|
||||||
|
|
|
||||||
|
|
@ -172,18 +172,22 @@ pub fn create_directory_metadata(dir_info: &gio::FileInfo, xattrs: Option<&glib:
|
||||||
// unsafe { TODO: call ostree_sys:ostree_diff_print() }
|
// unsafe { TODO: call ostree_sys:ostree_diff_print() }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//#[cfg(any(feature = "v2017_10", feature = "dox"))]
|
#[cfg(any(feature = "v2017_10", feature = "dox"))]
|
||||||
//pub fn gpg_error_quark() -> /*Ignored*/glib::Quark {
|
pub fn gpg_error_quark() -> glib::Quark {
|
||||||
// unsafe { TODO: call ostree_sys:ostree_gpg_error_quark() }
|
unsafe {
|
||||||
//}
|
from_glib(ostree_sys::ostree_gpg_error_quark())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//pub fn hash_object_name(a: /*Unimplemented*/Option<Fundamental: Pointer>) -> u32 {
|
//pub fn hash_object_name(a: /*Unimplemented*/Option<Fundamental: Pointer>) -> u32 {
|
||||||
// unsafe { TODO: call ostree_sys:ostree_hash_object_name() }
|
// unsafe { TODO: call ostree_sys:ostree_hash_object_name() }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//pub fn metadata_variant_type(objtype: ObjectType) -> /*Ignored*/Option<glib::VariantType> {
|
pub fn metadata_variant_type(objtype: ObjectType) -> Option<glib::VariantType> {
|
||||||
// unsafe { TODO: call ostree_sys:ostree_metadata_variant_type() }
|
unsafe {
|
||||||
//}
|
from_glib_none(ostree_sys::ostree_metadata_variant_type(objtype.to_glib()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn object_from_string(str: &str) -> (GString, ObjectType) {
|
pub fn object_from_string(str: &str) -> (GString, ObjectType) {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
||||||
|
|
@ -30,11 +30,8 @@ mod repo_finder;
|
||||||
pub use self::repo_finder::{RepoFinder, NONE_REPO_FINDER};
|
pub use self::repo_finder::{RepoFinder, NONE_REPO_FINDER};
|
||||||
pub use self::repo_finder::RepoFinderExt;
|
pub use self::repo_finder::RepoFinderExt;
|
||||||
|
|
||||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
|
||||||
mod repo_finder_avahi;
|
mod repo_finder_avahi;
|
||||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
|
||||||
pub use self::repo_finder_avahi::{RepoFinderAvahi, RepoFinderAvahiClass, NONE_REPO_FINDER_AVAHI};
|
pub use self::repo_finder_avahi::{RepoFinderAvahi, RepoFinderAvahiClass, NONE_REPO_FINDER_AVAHI};
|
||||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
|
||||||
pub use self::repo_finder_avahi::RepoFinderAvahiExt;
|
pub use self::repo_finder_avahi::RepoFinderAvahiExt;
|
||||||
|
|
||||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
|
|
@ -42,8 +39,11 @@ mod repo_finder_config;
|
||||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
pub use self::repo_finder_config::{RepoFinderConfig, RepoFinderConfigClass, NONE_REPO_FINDER_CONFIG};
|
pub use self::repo_finder_config::{RepoFinderConfig, RepoFinderConfigClass, NONE_REPO_FINDER_CONFIG};
|
||||||
|
|
||||||
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
mod repo_finder_mount;
|
mod repo_finder_mount;
|
||||||
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
pub use self::repo_finder_mount::{RepoFinderMount, RepoFinderMountClass, NONE_REPO_FINDER_MOUNT};
|
pub use self::repo_finder_mount::{RepoFinderMount, RepoFinderMountClass, NONE_REPO_FINDER_MOUNT};
|
||||||
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
pub use self::repo_finder_mount::RepoFinderMountExt;
|
pub use self::repo_finder_mount::RepoFinderMountExt;
|
||||||
|
|
||||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
|
|
@ -151,8 +151,8 @@ pub mod traits {
|
||||||
pub use super::MutableTreeExt;
|
pub use super::MutableTreeExt;
|
||||||
pub use super::RepoFileExt;
|
pub use super::RepoFileExt;
|
||||||
pub use super::RepoFinderExt;
|
pub use super::RepoFinderExt;
|
||||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
|
||||||
pub use super::RepoFinderAvahiExt;
|
pub use super::RepoFinderAvahiExt;
|
||||||
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
pub use super::RepoFinderMountExt;
|
pub use super::RepoFinderMountExt;
|
||||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
pub use super::RepoFinderOverrideExt;
|
pub use super::RepoFinderOverrideExt;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ use RepoCommitModifier;
|
||||||
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||||
use RepoCommitState;
|
use RepoCommitState;
|
||||||
use RepoFile;
|
use RepoFile;
|
||||||
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
|
use RepoFinderResult;
|
||||||
use RepoMode;
|
use RepoMode;
|
||||||
use RepoPruneFlags;
|
use RepoPruneFlags;
|
||||||
use RepoPullFlags;
|
use RepoPullFlags;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
use Error;
|
use Error;
|
||||||
use RepoFinder;
|
use RepoFinder;
|
||||||
|
use glib;
|
||||||
use glib::object::IsA;
|
use glib::object::IsA;
|
||||||
use glib::translate::*;
|
use glib::translate::*;
|
||||||
use ostree_sys;
|
use ostree_sys;
|
||||||
|
|
@ -21,9 +22,11 @@ glib_wrapper! {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RepoFinderAvahi {
|
impl RepoFinderAvahi {
|
||||||
//pub fn new(context: /*Ignored*/&glib::MainContext) -> RepoFinderAvahi {
|
pub fn new(context: &glib::MainContext) -> RepoFinderAvahi {
|
||||||
// unsafe { TODO: call ostree_sys:ostree_repo_finder_avahi_new() }
|
unsafe {
|
||||||
//}
|
from_glib_full(ostree_sys::ostree_repo_finder_avahi_new(context.to_glib_none().0))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const NONE_REPO_FINDER_AVAHI: Option<&RepoFinderAvahi> = None;
|
pub const NONE_REPO_FINDER_AVAHI: Option<&RepoFinderAvahi> = None;
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,16 @@
|
||||||
// DO NOT EDIT
|
// DO NOT EDIT
|
||||||
|
|
||||||
use RepoFinder;
|
use RepoFinder;
|
||||||
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
|
use gio;
|
||||||
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
|
use glib::StaticType;
|
||||||
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
|
use glib::Value;
|
||||||
use glib::object::IsA;
|
use glib::object::IsA;
|
||||||
use glib::translate::*;
|
use glib::translate::*;
|
||||||
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
|
use gobject_sys;
|
||||||
use ostree_sys;
|
use ostree_sys;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
|
|
@ -17,28 +25,30 @@ glib_wrapper! {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RepoFinderMount {
|
impl RepoFinderMount {
|
||||||
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
//pub fn new(monitor: /*Ignored*/Option<&gio::VolumeMonitor>) -> RepoFinderMount {
|
pub fn new<P: IsA<gio::VolumeMonitor>>(monitor: Option<&P>) -> RepoFinderMount {
|
||||||
// unsafe { TODO: call ostree_sys:ostree_repo_finder_mount_new() }
|
unsafe {
|
||||||
//}
|
from_glib_full(ostree_sys::ostree_repo_finder_mount_new(monitor.map(|p| p.as_ref()).to_glib_none().0))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const NONE_REPO_FINDER_MOUNT: Option<&RepoFinderMount> = None;
|
pub const NONE_REPO_FINDER_MOUNT: Option<&RepoFinderMount> = None;
|
||||||
|
|
||||||
pub trait RepoFinderMountExt: 'static {
|
pub trait RepoFinderMountExt: 'static {
|
||||||
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
//fn get_property_monitor(&self) -> /*Ignored*/Option<gio::VolumeMonitor>;
|
fn get_property_monitor(&self) -> Option<gio::VolumeMonitor>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<O: IsA<RepoFinderMount>> RepoFinderMountExt for O {
|
impl<O: IsA<RepoFinderMount>> RepoFinderMountExt for O {
|
||||||
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
//fn get_property_monitor(&self) -> /*Ignored*/Option<gio::VolumeMonitor> {
|
fn get_property_monitor(&self) -> Option<gio::VolumeMonitor> {
|
||||||
// unsafe {
|
unsafe {
|
||||||
// let mut value = Value::from_type(</*Unknown type*/ as StaticType>::static_type());
|
let mut value = Value::from_type(<gio::VolumeMonitor as StaticType>::static_type());
|
||||||
// gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"monitor\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"monitor\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
||||||
// value.get()
|
value.get()
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for RepoFinderMount {
|
impl fmt::Display for RepoFinderMount {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue