mirror of
https://github.com/ostreedev/ostree.git
synced 2025-08-25 13:49:24 +03:00
lib: add some glib types to generate more functions
This commit is contained in:
committed by
Colin Walters
parent
b44202fa90
commit
9e8192fec8
@ -54,16 +54,22 @@ generate = [
|
||||
]
|
||||
|
||||
manual = [
|
||||
"Gio.AsyncReadyCallback",
|
||||
"Gio.AsyncResult",
|
||||
"Gio.Cancellable",
|
||||
"Gio.File",
|
||||
"Gio.FileInfo",
|
||||
"Gio.FileQueryInfoFlags",
|
||||
"Gio.InputStream",
|
||||
"Gio.VolumeMonitor",
|
||||
"GLib.Bytes",
|
||||
"GLib.Error",
|
||||
"GLib.KeyFile",
|
||||
"GLib.MainContext",
|
||||
"GLib.Quark",
|
||||
"GLib.String",
|
||||
"GLib.Variant",
|
||||
"GLib.VariantType",
|
||||
|
||||
"OSTree.RepoCheckoutAtOptions",
|
||||
"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() }
|
||||
//}
|
||||
|
||||
//#[cfg(any(feature = "v2017_10", feature = "dox"))]
|
||||
//pub fn gpg_error_quark() -> /*Ignored*/glib::Quark {
|
||||
// unsafe { TODO: call ostree_sys:ostree_gpg_error_quark() }
|
||||
//}
|
||||
#[cfg(any(feature = "v2017_10", feature = "dox"))]
|
||||
pub fn gpg_error_quark() -> glib::Quark {
|
||||
unsafe {
|
||||
from_glib(ostree_sys::ostree_gpg_error_quark())
|
||||
}
|
||||
}
|
||||
|
||||
//pub fn hash_object_name(a: /*Unimplemented*/Option<Fundamental: Pointer>) -> u32 {
|
||||
// unsafe { TODO: call ostree_sys:ostree_hash_object_name() }
|
||||
//}
|
||||
|
||||
//pub fn metadata_variant_type(objtype: ObjectType) -> /*Ignored*/Option<glib::VariantType> {
|
||||
// unsafe { TODO: call ostree_sys:ostree_metadata_variant_type() }
|
||||
//}
|
||||
pub fn metadata_variant_type(objtype: ObjectType) -> Option<glib::VariantType> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_metadata_variant_type(objtype.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn object_from_string(str: &str) -> (GString, ObjectType) {
|
||||
unsafe {
|
||||
|
@ -30,11 +30,8 @@ mod repo_finder;
|
||||
pub use self::repo_finder::{RepoFinder, NONE_REPO_FINDER};
|
||||
pub use self::repo_finder::RepoFinderExt;
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
mod repo_finder_avahi;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
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;
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
@ -42,8 +39,11 @@ mod repo_finder_config;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use self::repo_finder_config::{RepoFinderConfig, RepoFinderConfigClass, NONE_REPO_FINDER_CONFIG};
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
mod repo_finder_mount;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
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;
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
@ -151,8 +151,8 @@ pub mod traits {
|
||||
pub use super::MutableTreeExt;
|
||||
pub use super::RepoFileExt;
|
||||
pub use super::RepoFinderExt;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use super::RepoFinderAvahiExt;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use super::RepoFinderMountExt;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use super::RepoFinderOverrideExt;
|
||||
|
@ -19,6 +19,8 @@ use RepoCommitModifier;
|
||||
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
use RepoCommitState;
|
||||
use RepoFile;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use RepoFinderResult;
|
||||
use RepoMode;
|
||||
use RepoPruneFlags;
|
||||
use RepoPullFlags;
|
||||
|
@ -5,6 +5,7 @@
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use Error;
|
||||
use RepoFinder;
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use ostree_sys;
|
||||
@ -21,9 +22,11 @@ glib_wrapper! {
|
||||
}
|
||||
|
||||
impl RepoFinderAvahi {
|
||||
//pub fn new(context: /*Ignored*/&glib::MainContext) -> RepoFinderAvahi {
|
||||
// unsafe { TODO: call ostree_sys:ostree_repo_finder_avahi_new() }
|
||||
//}
|
||||
pub fn new(context: &glib::MainContext) -> RepoFinderAvahi {
|
||||
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;
|
||||
|
@ -3,8 +3,16 @@
|
||||
// DO NOT EDIT
|
||||
|
||||
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::translate::*;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use gobject_sys;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
|
||||
@ -17,28 +25,30 @@ glib_wrapper! {
|
||||
}
|
||||
|
||||
impl RepoFinderMount {
|
||||
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
//pub fn new(monitor: /*Ignored*/Option<&gio::VolumeMonitor>) -> RepoFinderMount {
|
||||
// unsafe { TODO: call ostree_sys:ostree_repo_finder_mount_new() }
|
||||
//}
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub fn new<P: IsA<gio::VolumeMonitor>>(monitor: Option<&P>) -> RepoFinderMount {
|
||||
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 trait RepoFinderMountExt: 'static {
|
||||
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
//fn get_property_monitor(&self) -> /*Ignored*/Option<gio::VolumeMonitor>;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn get_property_monitor(&self) -> Option<gio::VolumeMonitor>;
|
||||
}
|
||||
|
||||
impl<O: IsA<RepoFinderMount>> RepoFinderMountExt for O {
|
||||
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
//fn get_property_monitor(&self) -> /*Ignored*/Option<gio::VolumeMonitor> {
|
||||
// unsafe {
|
||||
// let mut value = Value::from_type(</*Unknown type*/ 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);
|
||||
// value.get()
|
||||
// }
|
||||
//}
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn get_property_monitor(&self) -> Option<gio::VolumeMonitor> {
|
||||
unsafe {
|
||||
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);
|
||||
value.get()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoFinderMount {
|
||||
|
Reference in New Issue
Block a user