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

Fix PixbufFormat, regen Pixbuf #57

Merged
merged 8 commits into from
Dec 30, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 41 additions & 77 deletions Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ generate = [
"GdkPixbuf.InterpType",
"GdkPixbuf.PixbufAlphaMode",
"GdkPixbuf.PixbufError",
"GdkPixbuf.PixbufFormat",
"GdkPixbuf.PixbufLoader",
"GdkPixbuf.PixbufRotation",
"GdkPixbuf.PixbufSimpleAnim",
Expand All @@ -22,113 +21,78 @@ manual = [
"GdkPixbuf.PixbufAnimationIter",
"GLib.Bytes",
"GLib.Error",
"Gio.AsyncReadyCallback",
"Gio.Cancellable",
"Gio.InputStream",
"Gio.OutputStream",
]

[[object]]
name = "GdkPixbuf.Pixbuf"
status = "generate"
[[object.function]]
name = "add_alpha"
#const self
ignore = true
[[object.function]]
name = "composite"
#const self
ignore = true
[[object.function]]
name = "composite_color"
#const self
ignore = true
[[object.function]]
name = "composite_color_simple"
#const self
ignore = true
[[object.function]]
name = "copy"
#const self
ignore = true
[[object.function]]
name = "copy_area"
#const self
ignore = true
[[object.function]]
name = "flip"
#const self
ignore = true
[[object.function]]
name = "get_bits_per_sample"
#as property: const self
ignore = true
[[object.function]]
name = "get_byte_length"
#const self
ignore = true
[[object.function]]
name = "get_colorspace"
#as property: const self
ignore = true
[[object.function]]
name = "get_has_alpha"
#as property: const self
ignore = true
[[object.function]]
name = "get_height"
#as property: const self
ignore = true
[[object.function]]
name = "get_n_channels"
#as property: const self
ignore = true
[[object.function]]
name = "get_pixels"
#const self
#manual array without length
ignore = true
[[object.function]]
name = "get_pixels_with_length"
#const self
#manual as get_pixels
ignore = true
[[object.function]]
name = "get_rowstride"
#as property: const self
name = "read_pixels"
#unimplementable, use get_pixels instead
ignore = true
[[object.function]]
name = "get_width"
#as property: const self
name = "new_from_file"
#manual is_windows_utf8
ignore = true
[[object.function]]
name = "read_pixels"
#const self
name = "new_from_file_at_size"
#manual is_windows_utf8
ignore = true
[[object.function]]
name = "read_pixel_bytes"
#const self
name = "new_from_file_at_scale"
#manual is_windows_utf8
ignore = true
[[object.function]]
name = "rotate_simple"
#const self
name = "new_from_stream_async"
# wrong async return
ignore = true
[[object.function]]
name = "saturate_and_pixelate"
#const self
name = "new_from_stream_at_scale_async"
# wrong return and don't generated
ignore = true
[[object.function]]
name = "scale"
#const self
name = "get_file_info"
# wrong return
ignore = true
[[object.function]]
name = "scale_simple"
#const self
name = "get_file_info_async"
# wrong async return
ignore = true
[[object.function]]
name = "new_from_file"
#manual is_windows_utf8
name = "save_to_bufferv"
# manual complex param
ignore = true
[[object.function]]
name = "new_from_file_at_size"
#manual is_windows_utf8
name = "save_to_streamv"
# manual complex param
ignore = true
[[object.function]]
name = "new_from_file_at_scale"
#manual is_windows_utf8
name = "savev"
# manual complex param
ignore = true

[[object]]
name = "GdkPixbuf.PixbufFormat"
status = "generate"
[[object.function]]
pattern = "get_.+"
[[object.function.parameter]]
name = "format"
const = true
[[object.function]]
pattern = "is_.+"
[[object.function.parameter]]
name = "format"
const = true
5 changes: 3 additions & 2 deletions src/animation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>

use std::mem;
use std::path::Path;
use std::ptr;
use glib::{Error, TimeVal};
use glib::object::IsA;
Expand Down Expand Up @@ -53,7 +54,7 @@ glib_wrapper! {
}

impl PixbufAnimation {
pub fn new_from_file(file: &str) -> Result<PixbufAnimation, Error> {
pub fn new_from_file<T: AsRef<Path>>(file: T) -> Result<PixbufAnimation, Error> {
#[cfg(windows)]
use ffi::gdk_pixbuf_animation_new_from_file_utf8
as gdk_pixbuf_animation_new_from_file;
Expand All @@ -62,7 +63,7 @@ impl PixbufAnimation {

unsafe {
let mut error = ptr::null_mut();
let ptr = gdk_pixbuf_animation_new_from_file(file.to_glib_none().0, &mut error);
let ptr = gdk_pixbuf_animation_new_from_file(file.as_ref().to_glib_none().0, &mut error);
if error.is_null() {
Ok(from_glib_full(ptr))
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/auto/enums.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (d8a605d) from gir-files (469db10)
// This file was generated by gir (5a68ad0) from gir-files (469db10)
// DO NOT EDIT

use ffi;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/flags.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (d8a605d) from gir-files (469db10)
// This file was generated by gir (5a68ad0) from gir-files (469db10)
// DO NOT EDIT

use ffi;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (d8a605d) from gir-files (469db10)
// This file was generated by gir (5a68ad0) from gir-files (469db10)
// DO NOT EDIT

mod pixbuf;
Expand Down
Loading