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

Commit 1e9ce85

Browse files
Merge pull request #57 from EPashkin/fix_PixbufFormat_regen_Pixbuf
Fix PixbufFormat, regen Pixbuf
2 parents 4588882 + 4b8383d commit 1e9ce85

File tree

11 files changed

+373
-319
lines changed

11 files changed

+373
-319
lines changed

Gir.toml

Lines changed: 41 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ generate = [
1111
"GdkPixbuf.InterpType",
1212
"GdkPixbuf.PixbufAlphaMode",
1313
"GdkPixbuf.PixbufError",
14-
"GdkPixbuf.PixbufFormat",
1514
"GdkPixbuf.PixbufLoader",
1615
"GdkPixbuf.PixbufRotation",
1716
"GdkPixbuf.PixbufSimpleAnim",
@@ -22,113 +21,78 @@ manual = [
2221
"GdkPixbuf.PixbufAnimationIter",
2322
"GLib.Bytes",
2423
"GLib.Error",
24+
"Gio.AsyncReadyCallback",
2525
"Gio.Cancellable",
26+
"Gio.InputStream",
27+
"Gio.OutputStream",
2628
]
2729

2830
[[object]]
2931
name = "GdkPixbuf.Pixbuf"
3032
status = "generate"
31-
[[object.function]]
32-
name = "add_alpha"
33-
#const self
34-
ignore = true
35-
[[object.function]]
36-
name = "composite"
37-
#const self
38-
ignore = true
39-
[[object.function]]
40-
name = "composite_color"
41-
#const self
42-
ignore = true
43-
[[object.function]]
44-
name = "composite_color_simple"
45-
#const self
46-
ignore = true
47-
[[object.function]]
48-
name = "copy"
49-
#const self
50-
ignore = true
51-
[[object.function]]
52-
name = "copy_area"
53-
#const self
54-
ignore = true
55-
[[object.function]]
56-
name = "flip"
57-
#const self
58-
ignore = true
59-
[[object.function]]
60-
name = "get_bits_per_sample"
61-
#as property: const self
62-
ignore = true
63-
[[object.function]]
64-
name = "get_byte_length"
65-
#const self
66-
ignore = true
67-
[[object.function]]
68-
name = "get_colorspace"
69-
#as property: const self
70-
ignore = true
71-
[[object.function]]
72-
name = "get_has_alpha"
73-
#as property: const self
74-
ignore = true
75-
[[object.function]]
76-
name = "get_height"
77-
#as property: const self
78-
ignore = true
79-
[[object.function]]
80-
name = "get_n_channels"
81-
#as property: const self
82-
ignore = true
8333
[[object.function]]
8434
name = "get_pixels"
85-
#const self
35+
#manual array without length
8636
ignore = true
8737
[[object.function]]
8838
name = "get_pixels_with_length"
89-
#const self
39+
#manual as get_pixels
9040
ignore = true
9141
[[object.function]]
92-
name = "get_rowstride"
93-
#as property: const self
42+
name = "read_pixels"
43+
#unimplementable, use get_pixels instead
9444
ignore = true
9545
[[object.function]]
96-
name = "get_width"
97-
#as property: const self
46+
name = "new_from_file"
47+
#manual is_windows_utf8
9848
ignore = true
9949
[[object.function]]
100-
name = "read_pixels"
101-
#const self
50+
name = "new_from_file_at_size"
51+
#manual is_windows_utf8
10252
ignore = true
10353
[[object.function]]
104-
name = "read_pixel_bytes"
105-
#const self
54+
name = "new_from_file_at_scale"
55+
#manual is_windows_utf8
10656
ignore = true
10757
[[object.function]]
108-
name = "rotate_simple"
109-
#const self
58+
name = "new_from_stream_async"
59+
# wrong async return
11060
ignore = true
11161
[[object.function]]
112-
name = "saturate_and_pixelate"
113-
#const self
62+
name = "new_from_stream_at_scale_async"
63+
# wrong return and don't generated
11464
ignore = true
11565
[[object.function]]
116-
name = "scale"
117-
#const self
66+
name = "get_file_info"
67+
# wrong return
11868
ignore = true
11969
[[object.function]]
120-
name = "scale_simple"
121-
#const self
70+
name = "get_file_info_async"
71+
# wrong async return
12272
ignore = true
12373
[[object.function]]
124-
name = "new_from_file"
125-
#manual is_windows_utf8
74+
name = "save_to_bufferv"
75+
# manual complex param
12676
ignore = true
12777
[[object.function]]
128-
name = "new_from_file_at_size"
129-
#manual is_windows_utf8
78+
name = "save_to_streamv"
79+
# manual complex param
13080
ignore = true
13181
[[object.function]]
132-
name = "new_from_file_at_scale"
133-
#manual is_windows_utf8
82+
name = "savev"
83+
# manual complex param
13484
ignore = true
85+
86+
[[object]]
87+
name = "GdkPixbuf.PixbufFormat"
88+
status = "generate"
89+
[[object.function]]
90+
pattern = "get_.+"
91+
[[object.function.parameter]]
92+
name = "format"
93+
const = true
94+
[[object.function]]
95+
pattern = "is_.+"
96+
[[object.function.parameter]]
97+
name = "format"
98+
const = true

src/animation.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
44

55
use std::mem;
6+
use std::path::Path;
67
use std::ptr;
78
use glib::{Error, TimeVal};
89
use glib::object::IsA;
@@ -53,7 +54,7 @@ glib_wrapper! {
5354
}
5455

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

6364
unsafe {
6465
let mut error = ptr::null_mut();
65-
let ptr = gdk_pixbuf_animation_new_from_file(file.to_glib_none().0, &mut error);
66+
let ptr = gdk_pixbuf_animation_new_from_file(file.as_ref().to_glib_none().0, &mut error);
6667
if error.is_null() {
6768
Ok(from_glib_full(ptr))
6869
} else {

src/auto/enums.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file was generated by gir (d8a605d) from gir-files (469db10)
1+
// This file was generated by gir (5a68ad0) from gir-files (469db10)
22
// DO NOT EDIT
33

44
use ffi;

src/auto/flags.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file was generated by gir (d8a605d) from gir-files (469db10)
1+
// This file was generated by gir (5a68ad0) from gir-files (469db10)
22
// DO NOT EDIT
33

44
use ffi;

src/auto/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file was generated by gir (d8a605d) from gir-files (469db10)
1+
// This file was generated by gir (5a68ad0) from gir-files (469db10)
22
// DO NOT EDIT
33

44
mod pixbuf;

0 commit comments

Comments
 (0)