Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Fix invalid gio::InputStream generation #20

Merged
merged 1 commit into from Nov 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gir.toml
Expand Up @@ -69,7 +69,7 @@ manual = [
"Gio.Cancellable",
"Gio.File",
"Gio.Icon",
"Gio.InputStream",
# "Gio.InputStream",
"Pango.FontDescription",
"Pango.Underline",
]
Expand Down
24 changes: 10 additions & 14 deletions src/auto/file_loader.rs
Expand Up @@ -48,12 +48,10 @@ impl FileLoader {
}
}

#[cfg(any(feature = "v3_14", feature = "dox"))]
pub fn new_from_stream<P: IsA<gio::InputStream>>(buffer: &Buffer, file: &File, stream: &P) -> FileLoader {
unsafe {
from_glib_full(ffi::gtk_source_file_loader_new_from_stream(buffer.to_glib_none().0, file.to_glib_none().0, stream.to_glib_none().0))
}
}
//#[cfg(any(feature = "v3_14", feature = "dox"))]
//pub fn new_from_stream<P: IsA</*Ignored*/gio::InputStream>>(buffer: &Buffer, file: &File, stream: &P) -> FileLoader {
// unsafe { TODO: call ffi::gtk_source_file_loader_new_from_stream() }
//}
}

pub trait FileLoaderExt {
Expand All @@ -69,8 +67,8 @@ pub trait FileLoaderExt {
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_file(&self) -> Option<File>;

#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_input_stream(&self) -> Option<gio::InputStream>;
//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn get_input_stream(&self) -> /*Ignored*/Option<gio::InputStream>;

#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_location(&self) -> Option<gio::File>;
Expand Down Expand Up @@ -129,12 +127,10 @@ impl<O: IsA<FileLoader> + IsA<glib::object::Object>> FileLoaderExt for O {
}
}

#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_input_stream(&self) -> Option<gio::InputStream> {
unsafe {
from_glib_none(ffi::gtk_source_file_loader_get_input_stream(self.to_glib_none().0))
}
}
//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn get_input_stream(&self) -> /*Ignored*/Option<gio::InputStream> {
// unsafe { TODO: call ffi::gtk_source_file_loader_get_input_stream() }
//}

#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_location(&self) -> Option<gio::File> {
Expand Down