diff --git a/atk/Gir.toml b/atk/Gir.toml index 26ca92bce926..e1fb07a0e6fb 100644 --- a/atk/Gir.toml +++ b/atk/Gir.toml @@ -77,7 +77,7 @@ manual_traits = ["EditableTextExtManual"] [[object.function]] name = "insert_text" # Expected pointer, received integer - ignore = true + manual = true [[object]] name = "Atk.Image" @@ -110,10 +110,10 @@ status = "generate" manual_traits = ["TableExtManual"] [[object.function]] name = "get_selected_columns" - ignore = true + manual = true [[object.function]] name = "get_selected_rows" - ignore = true + manual = true [[object]] name = "Atk.Text" diff --git a/atk/src/auto/text.rs b/atk/src/auto/text.rs index 06aba1b02147..1280d9c5bdfc 100644 --- a/atk/src/auto/text.rs +++ b/atk/src/auto/text.rs @@ -145,10 +145,11 @@ impl> TextExt for O { fn get_character_at_offset(&self, offset: i32) -> char { unsafe { - from_glib(atk_sys::atk_text_get_character_at_offset( + std::convert::TryFrom::try_from(atk_sys::atk_text_get_character_at_offset( self.as_ref().to_glib_none().0, offset, )) + .expect("conversion from an invalid Unicode value attempted") } } diff --git a/atk/src/auto/versions.txt b/atk/src/auto/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/atk/src/auto/versions.txt +++ b/atk/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/atk/sys/Cargo.toml b/atk/sys/Cargo.toml index 7a7de381ada8..09908a74540b 100644 --- a/atk/sys/Cargo.toml +++ b/atk/sys/Cargo.toml @@ -1,5 +1,5 @@ [build-dependencies] -system-deps = "1.3" +system-deps = "2.0" [dependencies] libc = "0.2" @@ -40,7 +40,11 @@ features = ["dox"] name = "atk" version = "2.14" -[package.metadata.system-deps.atk.feature-versions] -v2_30 = "2.30" -v2_32 = "2.32" -v2_34 = "2.34" +[package.metadata.system-deps.atk.v2_30] +version = "2.30" + +[package.metadata.system-deps.atk.v2_32] +version = "2.32" + +[package.metadata.system-deps.atk.v2_34] +version = "2.34" diff --git a/atk/sys/versions.txt b/atk/sys/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/atk/sys/versions.txt +++ b/atk/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/gdk-pixbuf/Gir.toml b/gdk-pixbuf/Gir.toml index 624b2c01eac0..da23958db9f2 100644 --- a/gdk-pixbuf/Gir.toml +++ b/gdk-pixbuf/Gir.toml @@ -36,7 +36,7 @@ status = "generate" [[object.function]] name = "get_pixels" #manual array without length - ignore = true + manual = true [[object.function]] name = "get_pixels_with_length" #manual as get_pixels @@ -48,7 +48,7 @@ status = "generate" [[object.function]] name = "new_from_file" #manual is_windows_utf8 - ignore = true + manual = true [[object.function]] name = "new" [object.function.return] @@ -56,43 +56,43 @@ status = "generate" [[object.function]] name = "new_from_file_at_size" #manual is_windows_utf8 - ignore = true + manual = true [[object.function]] name = "new_from_file_at_scale" #manual is_windows_utf8 - ignore = true + manual = true [[object.function]] name = "new_from_stream_async" # wrong async return - ignore = true + manual = true [[object.function]] name = "new_from_stream_at_scale_async" # wrong return and don't generated - ignore = true + manual = true [[object.function]] name = "get_file_info" # wrong return - ignore = true + manual = true [[object.function]] name = "get_file_info_async" # wrong async return - ignore = true + manual = true [[object.function]] name = "save_to_bufferv" # manual complex param - ignore = true + manual = true [[object.function]] name = "save_to_streamv" # manual complex param - ignore = true + manual = true [[object.function]] name = "savev" # manual complex param - ignore = true + manual = true [[object.function]] name = "save_to_streamv_async" # manual complex param - ignore = true + manual = true [[object]] name = "GdkPixbuf.PixbufAnimation" @@ -100,7 +100,7 @@ status = "generate" [[object.function]] name = "get_iter" # TimeVal misses memory management functions - ignore = true + manual = true [[object]] name = "GdkPixbuf.PixbufFormat" diff --git a/gdk-pixbuf/src/auto/pixbuf.rs b/gdk-pixbuf/src/auto/pixbuf.rs index 8e5804ec26c2..6b2a9d0e8792 100644 --- a/gdk-pixbuf/src/auto/pixbuf.rs +++ b/gdk-pixbuf/src/auto/pixbuf.rs @@ -573,14 +573,6 @@ impl Pixbuf { } } - //pub fn get_property_pixels(&self) -> /*Unimplemented*/Fundamental: Pointer { - // unsafe { - // let mut value = Value::from_type(::static_type()); - // gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"pixels\0".as_ptr() as *const _, value.to_glib_none_mut().0); - // value.get().expect("Return Value for property `pixels` getter").unwrap() - // } - //} - #[cfg(any(feature = "v2_36_8", feature = "dox"))] pub fn calculate_rowstride( colorspace: Colorspace, diff --git a/gdk-pixbuf/src/auto/versions.txt b/gdk-pixbuf/src/auto/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/gdk-pixbuf/src/auto/versions.txt +++ b/gdk-pixbuf/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/gdk-pixbuf/sys/Cargo.toml b/gdk-pixbuf/sys/Cargo.toml index 2183b15cde48..48ac3ba0576b 100644 --- a/gdk-pixbuf/sys/Cargo.toml +++ b/gdk-pixbuf/sys/Cargo.toml @@ -1,5 +1,5 @@ [build-dependencies] -system-deps = "1.3" +system-deps = "2.0" [dependencies] libc = "0.2" @@ -44,8 +44,14 @@ features = ["dox"] name = "gdk-pixbuf-2.0" version = "2.30" -[package.metadata.system-deps.gdk_pixbuf_2_0.feature-versions] -v2_32 = "2.32" -v2_36 = "2.36" -v2_36_8 = "2.36.8" -v2_40 = "2.40" +[package.metadata.system-deps.gdk_pixbuf_2_0.v2_32] +version = "2.32" + +[package.metadata.system-deps.gdk_pixbuf_2_0.v2_36] +version = "2.36" + +[package.metadata.system-deps.gdk_pixbuf_2_0.v2_36_8] +version = "2.36.8" + +[package.metadata.system-deps.gdk_pixbuf_2_0.v2_40] +version = "2.40" diff --git a/gdk-pixbuf/sys/versions.txt b/gdk-pixbuf/sys/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/gdk-pixbuf/sys/versions.txt +++ b/gdk-pixbuf/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/gdk/Gir.toml b/gdk/Gir.toml index 8cf822cc3c01..07d44bbe24ae 100644 --- a/gdk/Gir.toml +++ b/gdk/Gir.toml @@ -220,7 +220,7 @@ status = "generate" ignore = true # cannot be used as is [[object.function]] name = "get_history" - ignore = true # need to call "free_history" function by hand + manual = true # need to call "free_history" function by hand [[object.property]] name = "tool" version = "3.22" @@ -302,7 +302,7 @@ status = "generate" [[object.function]] name = "get_refresh_info" #wrong gir: no out parameters - ignore = true + manual = true [[object]] name = "Gdk.FrameTimings" @@ -311,15 +311,15 @@ version = "3.8" [[object.function]] name = "get_predicted_presentation_time" # Use an `Option` for the return value - ignore = true + manual = true [[object.function]] name = "get_presentation_time" # Use an `Option` for the return value - ignore = true + manual = true [[object.function]] name = "get_refresh_interval" # Use an `Option` for the return value - ignore = true + manual = true [[object]] name = "Gdk.Keymap" @@ -327,19 +327,19 @@ status = "generate" [[object.function]] name = "get_entries_for_keycode" # Invalid generation of Vec - ignore = true + manual = true [[object.function]] name = "get_entries_for_keyval" # Invalid generation of Vec - ignore = true + manual = true [[object.function]] name = "add_virtual_modifiers" # Invalid usage of "&mut ModifierType" - ignore = true + manual = true [[object.function]] name = "map_virtual_modifiers" # Invalid usage of "&mut ModifierType" - ignore = true + manual = true [[object]] name = "Gdk.Monitor" @@ -368,11 +368,11 @@ status = "generate" nullable = false [[object.function]] name = "get_font_options" - ignore = true + manual = true [[object.function]] name = "get_setting" # bool return value signals success - ignore = true + manual = true [[object]] name = "Gdk.Seat" @@ -401,14 +401,14 @@ status = "generate" manual_traits = ["WindowExtManual"] [[object.function]] name = "new" - ignore = true + manual = true [[object.function]] pattern = "[gs]et_background_pattern" - ignore = true + manual = true doc_trait_name = "WindowExtManual" [[object.function]] pattern = "[gs]et_user_data" - ignore = true + manual = true doc_trait_name = "WindowExtManual" [[object.function]] name = "get_effective_toplevel" @@ -440,7 +440,7 @@ manual_traits = ["WindowExtManual"] version = "3.18" [[object.function]] name = "create_similar_surface" - ignore = true + manual = true [[object.function]] name = "set_opaque_region" [[object.function.parameter]] diff --git a/gdk/src/auto/screen.rs b/gdk/src/auto/screen.rs index 1491e5bd6b04..d891c039e8e3 100644 --- a/gdk/src/auto/screen.rs +++ b/gdk/src/auto/screen.rs @@ -199,14 +199,6 @@ impl Screen { } } - //pub fn get_property_font_options(&self) -> /*Unimplemented*/Fundamental: Pointer { - // unsafe { - // let mut value = Value::from_type(::static_type()); - // gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"font-options\0".as_ptr() as *const _, value.to_glib_none_mut().0); - // value.get().expect("Return Value for property `font-options` getter").unwrap() - // } - //} - pub fn get_default() -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(gdk_sys::gdk_screen_get_default()) } diff --git a/gdk/src/auto/versions.txt b/gdk/src/auto/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/gdk/src/auto/versions.txt +++ b/gdk/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/gdk/sys/Cargo.toml b/gdk/sys/Cargo.toml index ae64dc4e2f4c..59b7111eb1ab 100644 --- a/gdk/sys/Cargo.toml +++ b/gdk/sys/Cargo.toml @@ -1,6 +1,6 @@ [build-dependencies] pkg-config = "0.3.7" -system-deps = "1.3" +system-deps = "2.0" [dependencies] libc = "0.2" @@ -55,9 +55,17 @@ features = ["dox"] name = "gdk-3.0" version = "3.14" -[package.metadata.system-deps.gdk_3_0.feature-versions] -v3_16 = "3.16" -v3_18 = "3.18" -v3_20 = "3.20" -v3_22 = "3.22" -v3_24 = "3.24" +[package.metadata.system-deps.gdk_3_0.v3_16] +version = "3.16" + +[package.metadata.system-deps.gdk_3_0.v3_18] +version = "3.18" + +[package.metadata.system-deps.gdk_3_0.v3_20] +version = "3.20" + +[package.metadata.system-deps.gdk_3_0.v3_22] +version = "3.22" + +[package.metadata.system-deps.gdk_3_0.v3_24] +version = "3.24" diff --git a/gdk/sys/versions.txt b/gdk/sys/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/gdk/sys/versions.txt +++ b/gdk/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/gdkx11/src/auto/versions.txt b/gdkx11/src/auto/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/gdkx11/src/auto/versions.txt +++ b/gdkx11/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/gdkx11/sys/Cargo.toml b/gdkx11/sys/Cargo.toml index 03fa20e4fda2..cdf8e50d895e 100644 --- a/gdkx11/sys/Cargo.toml +++ b/gdkx11/sys/Cargo.toml @@ -15,10 +15,14 @@ features = ["dox"] name = "gdk-x11-3.0" version = "3.14" -[package.metadata.system-deps.gdk_x11_3_0.feature-versions] -v3_16 = "3.16" -v3_24 = "3.24" -v3_24_2 = "3.24.2" +[package.metadata.system-deps.gdk_x11_3_0.v3_16] +version = "3.16" + +[package.metadata.system-deps.gdk_x11_3_0.v3_24] +version = "3.24" + +[package.metadata.system-deps.gdk_x11_3_0.v3_24_2] +version = "3.24.2" [lib] name = "gdk_x11_sys" @@ -51,7 +55,7 @@ path = "../../cairo/sys" optional = true [build-dependencies] -system-deps = "1.3" +system-deps = "2.0" [dev-dependencies] shell-words = "1.0.0" diff --git a/gdkx11/sys/versions.txt b/gdkx11/sys/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/gdkx11/sys/versions.txt +++ b/gdkx11/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/gio/Gir.toml b/gio/Gir.toml index f779c43dc304..6d578f055692 100644 --- a/gio/Gir.toml +++ b/gio/Gir.toml @@ -229,7 +229,7 @@ manual_traits = ["AppInfoExtManual"] [[object.function]] name = "launch_uris_async" #in array of strings - ignore = true + manual = true [[object]] name = "Gio.AppInfoMonitor" @@ -262,11 +262,11 @@ manual_traits = ["ApplicationExtManual"] generate_builder = true [[object.signal]] name = "open" - ignore = true + manual = true doc_trait_name = "ApplicationExtManual" [[object.function]] name = "run" - ignore = true + manual = true doc_trait_name = "ApplicationExtManual" [[object]] @@ -336,7 +336,7 @@ status = "generate" manual_traits = ["ConverterExtManual"] [[object.function]] name = "convert" - ignore = true + manual = true doc_trait_name = "ConverterExtManual" [[object]] @@ -372,41 +372,41 @@ generate_builder = true [[object.function]] name = "read_line" #return vec of u8 - ignore = true + manual = true [[object.function]] name = "read_line_utf8" #redudant length returned - ignore = true + manual = true [[object.function]] name = "read_line_async" #return vec of u8 - ignore = true + manual = true [[object.function]] name = "read_until" #nullable return value and redundant length #return vec of u8 - ignore = true + manual = true [[object.function]] name = "read_until_async" #nullable return value and redundant length #return vec of u8 - ignore = true + manual = true [[object.function]] name = "read_upto" #nullable return value and redundant length #return vec of u8 - ignore = true + manual = true [[object.function]] name = "read_upto_async" #nullable return value and redundant length #return vec of u8 - ignore = true + manual = true [[object]] name = "Gio.DataOutputStream" @@ -426,27 +426,27 @@ status = "generate" [[object.function]] pattern = "register_object_with_closures" #wrapped with proper types manually - ignore = true + manual = true [[object.function]] name = "unregister_object" #wrapped with newtype manually - ignore = true + manual = true [[object.function]] pattern = ".*action_group.*" #wrapped with newtype manually - ignore = true + manual = true [[object.function]] pattern = ".*menu_model.*" #wrapped with newtype manually - ignore = true + manual = true [[object.function]] pattern = ".*filter.*" #wrapped with newtype manually - ignore = true + manual = true [[object.function]] pattern = "signal_.*subscribe" #wrapped with newtype manually - ignore = true + manual = true [[object]] name = "Gio.DBusInterface" @@ -492,11 +492,11 @@ status = "generate" [[object.function]] name = "return_gerror" # no need to borrow - ignore = true + manual = true [[object.function]] name = "return_error_literal" # glib::ErrorDomain - ignore = true + manual = true [[object]] @@ -517,11 +517,11 @@ cfg_condition = "all(not(windows),not(target_os = \"macos\"))" [[object.function]] name = "search" # returns vec of string - ignore = true + manual = true [[object.function]] name = "launch_uris_as_manager_with_fds" # has to use RawFd / SOCKET - ignore = true + manual = true [[object]] name = "Gio.Drive" @@ -580,7 +580,7 @@ manual_traits = ["FileExtManual"] [[object.function]] name = "replace_contents_async" # AsRef - ignore = true + manual = true doc_trait_name = "FileExtManual" [[object.function]] name = "get_uri_scheme" @@ -618,11 +618,11 @@ status = "generate" [[object.function]] name = "get_modification_time" # use SystemTime - ignore = true + manual = true [[object.function]] name = "set_modification_time" # use SystemTime - ignore = true + manual = true [[object]] name = "Gio.FilterOutputStream" @@ -648,12 +648,12 @@ concurrency = "send+sync" [[object.function]] name = "new_from_bytes" # broken and needs some closer integration with the corresponding std types - ignore = true + manual = true [[object.function]] name = "to_bytes" # broken and needs some closer integration with the corresponding std types - ignore = true + manual = true [[object]] name = "Gio.InetSocketAddress" @@ -667,7 +667,7 @@ manual_traits = ["InputStreamExtManual"] [[object.function]] pattern = "read(_all)?(_async)?" #mutable buffer - ignore = true + manual = true doc_trait_name = "InputStreamExtManual" [[object]] @@ -681,11 +681,11 @@ manual_traits = ["IOStreamExtManual"] [[object.property]] name = "input-stream" #readonly - ignore = true + manual = true [[object.property]] name = "output-stream" #readonly - ignore = true + manual = true [[object]] name = "Gio.ListModel" @@ -701,11 +701,11 @@ generate_builder = true manual_traits = ["ListStoreExtManual"] [[object.function]] name = "insert_sorted" - ignore = true + manual = true doc_trait_name = "ListStoreExtManual" [[object.function]] name = "sort" - ignore = true + manual = true doc_trait_name = "ListStoreExtManual" [[object]] @@ -796,17 +796,17 @@ manual_traits = ["OutputStreamExtManual"] [[object.function]] name = "write_async" #AsRef - ignore = true + manual = true doc_trait_name = "OutputStreamExtManual" [[object.function]] name = "write_all_async" #AsRef - ignore = true + manual = true doc_trait_name = "OutputStreamExtManual" [[object.function]] name = "write_all" # special return value - ignore = true + manual = true doc_trait_name = "OutputStreamExtManual" [[object]] @@ -816,12 +816,12 @@ manual_traits = ["PollableInputStreamExtManual"] [[object.function]] name = "create_source" # manual source implementation - ignore = true + manual = true doc_trait_name = "PollableInputStreamExtManual" [[object.function]] name = "read_nonblocking" # wrong mutability - ignore = true + manual = true doc_trait_name = "PollableInputStreamExtManual" [[object]] @@ -831,7 +831,7 @@ manual_traits = ["PollableOutputStreamExtManual"] [[object.function]] name = "create_source" # manual source implementation - ignore = true + manual = true doc_trait_name = "PollableOutputStreamExtManual" [[object]] @@ -854,7 +854,7 @@ status = "generate" name = "new_from_data" # Requires special alignment, see # https://bugzilla.gnome.org/show_bug.cgi?id=790030 - ignore = true + manual = true [[object]] name = "Gio.Settings" @@ -908,13 +908,13 @@ manual_traits = ["SocketExtManual"] [[object.function]] name = "new_from_fd" # has to use RawFd / SOCKET - ignore = true + manual = true doc_trait_name = "SocketExtManual" [[object.function]] name = "get_fd" # has to use RawFd / SOCKET - ignore = true + manual = true doc_trait_name = "SocketExtManual" [[object.property]] @@ -931,13 +931,13 @@ manual_traits = ["SocketExtManual"] [[object.function]] pattern = "receive.*" # &[u8] - ignore = true + manual = true doc_trait_name = "SocketExtManual" [[object.function]] pattern = "send.*" # &[u8] - ignore = true + manual = true doc_trait_name = "SocketExtManual" [[object]] @@ -955,7 +955,7 @@ status = "generate" string_type = "os_string" [[object.function]] name = "communicate_utf8_async" - ignore = true + manual = true [[object.function]] name = "send_signal" cfg_condition = "not(windows)" @@ -983,7 +983,7 @@ status = "generate" string_type = "os_string" [[object.function]] pattern = "take_.*" - ignore = true + manual = true [[object.function]] pattern = "set_std.*file_path" cfg_condition = "unix" @@ -1005,7 +1005,7 @@ status = "generate" [[object.function]] name = "new" # Better to provide None than -1 when you don't want to specify the number of threads - ignore = true + manual = true [[object]] name = "Gio.TlsConnection" @@ -1014,7 +1014,7 @@ manual_traits = ["TlsConnectionExtManual"] [[object.function]] name = "get_channel_binding_data" # Gir confuses the mutability of the data - ignore = true + manual = true [[object]] name = "Gio.TlsPassword" @@ -1037,30 +1037,30 @@ manual_traits = ["UnixFDListExtManual"] [[object.function]] name = "new_from_array" # has to use RawFd - ignore = true + manual = true [[object.function]] name = "append" # has to use RawFd - ignore = true + manual = true doc_trait_name = "UnixFDListExtManual" [[object.function]] name = "get" # has to use RawFd - ignore = true + manual = true doc_trait_name = "UnixFDListExtManual" [[object.function]] name = "peek_fds" # has to use RawFd - ignore = true + manual = true doc_trait_name = "UnixFDListExtManual" [[object.function]] name = "steal_fds" # has to use RawFd - ignore = true + manual = true doc_trait_name = "UnixFDListExtManual" @@ -1073,18 +1073,18 @@ manual_traits = ["UnixInputStreamExtManual"] [[object.function]] name = "new" # has to use RawFd - ignore = true + manual = true [[object.function]] name = "set_close_fd" # Can cause file descriptor leaks - ignore = true + manual = true doc_trait_name = "UnixInputStreamExtManual" [[object.function]] name = "get_fd" # has to use RawFd - ignore = true + manual = true doc_trait_name = "UnixInputStreamExtManual" [[object.property]] @@ -1141,18 +1141,18 @@ manual_traits = ["UnixOutputStreamExtManual"] [[object.function]] name = "new" # has to use RawFd - ignore = true + manual = true [[object.function]] name = "set_close_fd" # Can cause file descriptor leaks - ignore = true + manual = true doc_trait_name = "UnixOutputStreamExtManual" [[object.function]] name = "get_fd" # has to use RawFd - ignore = true + manual = true doc_trait_name = "UnixOutputStreamExtManual" [[object.property]] @@ -1172,10 +1172,10 @@ cfg_condition = "unix" manual_traits = ["UnixSocketAddressExtManual"] [[object.function]] name = "new" - ignore = true + manual = true [[object.function]] name = "get_path" - ignore = true + manual = true doc_trait_name = "UnixSocketAddressExtManual" [[object.property]] name = "path" diff --git a/gio/src/auto/versions.txt b/gio/src/auto/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/gio/src/auto/versions.txt +++ b/gio/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/gio/sys/Cargo.toml b/gio/sys/Cargo.toml index 0364581d0fa1..6abfd476c86c 100644 --- a/gio/sys/Cargo.toml +++ b/gio/sys/Cargo.toml @@ -1,5 +1,5 @@ [build-dependencies] -system-deps = "1.3" +system-deps = "2.0" [dependencies] libc = "0.2" @@ -52,16 +52,38 @@ features = ["dox"] name = "gio-2.0" version = "2.42" -[package.metadata.system-deps.gio_2_0.feature-versions] -v2_44 = "2.44" -v2_46 = "2.46" -v2_48 = "2.48" -v2_50 = "2.50" -v2_52 = "2.52" -v2_54 = "2.54" -v2_56 = "2.56" -v2_58 = "2.58" -v2_60 = "2.60" -v2_62 = "2.62" -v2_64 = "2.64" -v2_66 = "2.66" +[package.metadata.system-deps.gio_2_0.v2_44] +version = "2.44" + +[package.metadata.system-deps.gio_2_0.v2_46] +version = "2.46" + +[package.metadata.system-deps.gio_2_0.v2_48] +version = "2.48" + +[package.metadata.system-deps.gio_2_0.v2_50] +version = "2.50" + +[package.metadata.system-deps.gio_2_0.v2_52] +version = "2.52" + +[package.metadata.system-deps.gio_2_0.v2_54] +version = "2.54" + +[package.metadata.system-deps.gio_2_0.v2_56] +version = "2.56" + +[package.metadata.system-deps.gio_2_0.v2_58] +version = "2.58" + +[package.metadata.system-deps.gio_2_0.v2_60] +version = "2.60" + +[package.metadata.system-deps.gio_2_0.v2_62] +version = "2.62" + +[package.metadata.system-deps.gio_2_0.v2_64] +version = "2.64" + +[package.metadata.system-deps.gio_2_0.v2_66] +version = "2.66" diff --git a/gio/sys/tests/abi.rs b/gio/sys/tests/abi.rs index 477e4ff19ece..703b02899017 100644 --- a/gio/sys/tests/abi.rs +++ b/gio/sys/tests/abi.rs @@ -14,8 +14,7 @@ use std::process::Command; use std::str; use tempfile::Builder; -static PACKAGES_UNIX: &[&str] = &["gio-2.0", "gio-unix-2.0"]; -static PACKAGES_WINDOWS: &[&str] = &["gio-2.0"]; +static PACKAGES: &[&str] = &["gio-2.0"]; #[derive(Clone, Debug)] struct Compiler { @@ -23,14 +22,14 @@ struct Compiler { } impl Compiler { - pub fn new(packages: &[&str]) -> Result> { + pub fn new() -> Result> { let mut args = get_var("CC", "cc")?; args.push("-Wno-deprecated-declarations".to_owned()); // For %z support in printf when using MinGW. args.push("-D__USE_MINGW_ANSI_STDIO".to_owned()); args.extend(get_var("CFLAGS", "")?); args.extend(get_var("CPPFLAGS", "")?); - args.extend(pkg_config_cflags(packages)?); + args.extend(pkg_config_cflags(PACKAGES)?); Ok(Compiler { args }) } @@ -132,13 +131,7 @@ fn cross_validate_constants_with_c() { .prefix("abi") .tempdir() .expect("temporary directory"); - - let cc = if cfg!(target_family = "windows") { - Compiler::new(PACKAGES_WINDOWS) - } else { - Compiler::new(PACKAGES_UNIX) - } - .expect("configured compiler"); + let cc = Compiler::new().expect("configured compiler"); assert_eq!( "1", @@ -178,13 +171,7 @@ fn cross_validate_layout_with_c() { .prefix("abi") .tempdir() .expect("temporary directory"); - - let cc = if cfg!(target_family = "windows") { - Compiler::new(PACKAGES_WINDOWS) - } else { - Compiler::new(PACKAGES_UNIX) - } - .expect("configured compiler"); + let cc = Compiler::new().expect("configured compiler"); assert_eq!( Layout { diff --git a/gio/sys/versions.txt b/gio/sys/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/gio/sys/versions.txt +++ b/gio/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/gir b/gir index 7670e3da5a70..cea2f7c15c4f 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit 7670e3da5a70c3f9a84767589f6cc6f42d41d02d +Subproject commit cea2f7c15c4f0560635556474c66763941f98b5d diff --git a/glib/Gir.toml b/glib/Gir.toml index 9a70214f9fb4..869c44517025 100644 --- a/glib/Gir.toml +++ b/glib/Gir.toml @@ -447,11 +447,11 @@ concurrency = "send+sync" [[object.function]] name = "get_digest" #wrong array definition - ignore = true + manual = true [[object.function]] name = "get_string" #consume - ignore = true + manual = true [[object]] name = "GLib.ChecksumType" @@ -468,14 +468,14 @@ name = "GLib.KeyFile" status = "generate" [[object.function]] name = "load_from_data_dirs" - ignore = true + manual = true [[object.function]] name = "load_from_dirs" - ignore = true + manual = true [[object.function]] name = "save_to_file" # file parameter needs to be a PathBuf - ignore = true + manual = true [[object.function]] name = "set_locale_string_list" #[&str] to *mut i8 @@ -486,8 +486,7 @@ status = "generate" ignore = true [[object.function]] name = "to_data" - #manual - ignore = true + manual = true [[object.function]] name = "set_double_list" #wrong array type @@ -499,31 +498,31 @@ status = "generate" [[object.function]] name = "get_boolean" #boolean return value needs to be returned - ignore = true + manual = true [[object.function]] name = "has_key" #boolean return value needs to be returned - ignore = true + manual = true [[object.function]] name = "get_boolean_list" #boolean array needs to be converted to Vec - ignore = true + manual = true [[object.function]] name = "get_string" # can return an error but still a value to be freed - ignore = true + manual = true [[object.function]] name = "get_string_list" # can return an error but still a value to be freed - ignore = true + manual = true [[object.function]] name = "get_locale_string" # can return an error but still a value to be freed - ignore = true + manual = true [[object.function]] name = "get_locale_string_list" # can return an error but still a value to be freed - ignore = true + manual = true # Fixed in GLib 2.66.2 [[object.function]] @@ -543,16 +542,16 @@ concurrency = "send+sync" [[object.function]] name = "prepare" # out parameter not marked as such - ignore = true + manual = true [[object.function]] name = "find_source_by_id" # source id is a newtype - ignore = true + manual = true [[object.function]] name = "invoke" - ignore = true + manual = true [[object.function]] name = "invoke_full" ignore = true diff --git a/glib/gobject-sys/Cargo.toml b/glib/gobject-sys/Cargo.toml index b0983e209f1d..7f33baeba3ff 100644 --- a/glib/gobject-sys/Cargo.toml +++ b/glib/gobject-sys/Cargo.toml @@ -1,5 +1,5 @@ [build-dependencies] -system-deps = "1.3" +system-deps = "2.0" [dependencies] libc = "0.2" @@ -40,10 +40,20 @@ features = ["dox"] name = "gobject-2.0" version = "2.42" -[package.metadata.system-deps.gobject_2_0.feature-versions] -v2_44 = "2.44" -v2_46 = "2.46" -v2_54 = "2.54" -v2_58 = "2.58" -v2_62 = "2.62" -v2_66 = "2.66" +[package.metadata.system-deps.gobject_2_0.v2_44] +version = "2.44" + +[package.metadata.system-deps.gobject_2_0.v2_46] +version = "2.46" + +[package.metadata.system-deps.gobject_2_0.v2_54] +version = "2.54" + +[package.metadata.system-deps.gobject_2_0.v2_58] +version = "2.58" + +[package.metadata.system-deps.gobject_2_0.v2_62] +version = "2.62" + +[package.metadata.system-deps.gobject_2_0.v2_66] +version = "2.66" diff --git a/glib/gobject-sys/versions.txt b/glib/gobject-sys/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/glib/gobject-sys/versions.txt +++ b/glib/gobject-sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/glib/src/auto/functions.rs b/glib/src/auto/functions.rs index 64f464b0988d..ed8a64152428 100644 --- a/glib/src/auto/functions.rs +++ b/glib/src/auto/functions.rs @@ -194,7 +194,7 @@ pub fn clear_error() -> Result<(), Error> { } //#[cfg(any(feature = "v2_56", feature = "dox"))] -//pub fn clear_handle_id(tag_ptr: u32, clear_func: P) { +//pub fn clear_handle_id(tag_ptr: u32, clear_func: P) { // unsafe { TODO: call glib_sys:g_clear_handle_id() } //} @@ -1033,11 +1033,11 @@ pub fn set_application_name(application_name: &str) { // unsafe { TODO: call glib_sys:g_set_error() } //} -//pub fn set_print_handler(func: P) -> Fn(&str) + 'static { +//pub fn set_print_handler(func: P) -> Fn(&str) + 'static { // unsafe { TODO: call glib_sys:g_set_print_handler() } //} -//pub fn set_printerr_handler(func: P) -> Fn(&str) + 'static { +//pub fn set_printerr_handler(func: P) -> Fn(&str) + 'static { // unsafe { TODO: call glib_sys:g_set_printerr_handler() } //} diff --git a/glib/src/auto/versions.txt b/glib/src/auto/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/glib/src/auto/versions.txt +++ b/glib/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/glib/src/param_spec.rs b/glib/src/param_spec.rs index 0f0c936f4875..08d7a13f3542 100644 --- a/glib/src/param_spec.rs +++ b/glib/src/param_spec.rs @@ -10,6 +10,8 @@ use StaticType; use Type; use Value; +use std::char::CharTryFromError; +use std::convert::TryFrom; use std::ffi::CStr; // Can't use get_type here as this is not a boxed type but another fundamental type @@ -826,7 +828,7 @@ define_param_spec!( 9 ); -define_param_spec_default!(ParamSpecUnichar, char, |x| from_glib(x)); +define_param_spec_default!(ParamSpecUnichar, Result, TryFrom::try_from); define_param_spec!( ParamSpecEnum, diff --git a/glib/src/translate.rs b/glib/src/translate.rs index 9578c0933a7f..d98532e4e8d3 100644 --- a/glib/src/translate.rs +++ b/glib/src/translate.rs @@ -20,6 +20,72 @@ //! } //! ``` //! +//! Implementing [`OptionToGlib`] on a Rust type `T` allows specifying a sentinel to indicate +//! a `None` value and auto-implementing [`FromGlib`] for `Option`, which would not be +//! possible in dependent crates due to the [orphan rule](https://doc.rust-lang.org/book/ch10-02-traits.html#implementing-a-trait-on-a-type). +//! In the example below, [`ToGlib`] is auto-implemented for `Option`. +//! +//! ``` +//! # use glib::translate::*; +//! struct SpecialU32(u32); +//! impl ToGlib for SpecialU32 { +//! type GlibType = libc::c_uint; +//! fn to_glib(&self) -> libc::c_uint { +//! self.0 as libc::c_uint +//! } +//! } +//! impl OptionToGlib for SpecialU32 { +//! const GLIB_NONE: Self::GlibType = 0xFFFFFF; +//! } +//! ``` +//! +//! In order to auto-implement [`FromGlib`] for `Option`, proceed as follows: +//! +//! ``` +//! # use glib::translate::*; +//! # struct SpecialU32(u32); +//! # impl ToGlib for SpecialU32 { +//! # type GlibType = libc::c_uint; +//! # fn to_glib(&self) -> libc::c_uint { +//! # self.0 as libc::c_uint +//! # } +//! # } +//! # impl OptionToGlib for SpecialU32 { +//! # const GLIB_NONE: Self::GlibType = 0xFFFFFF; +//! # } +//! impl TryFromGlib for SpecialU32 { +//! type Error = GlibNoneError; +//! fn try_from_glib(val: libc::c_uint) -> Result { +//! if val == SpecialU32::GLIB_NONE { +//! return Err(GlibNoneError); +//! } +//! Ok(SpecialU32(val as u32)) +//! } +//! } +//! ``` +//! +//! The [`TryFromGlib`] trait can also be implemented when the Glib type range is larger than the +//! target Rust type's range. In the example below, the Rust type `U32` can be built from a signed +//! [`libc::c_long`], which means that the negative range is not valid. +//! +//! ``` +//! # use std::convert::TryFrom; +//! # use std::num::TryFromIntError; +//! # use glib::translate::*; +//! struct U32(u32); +//! impl TryFromGlib for U32 { +//! type Error = TryFromIntError; +//! fn try_from_glib(val: libc::c_long) -> Result { +//! Ok(U32(u32::try_from(val)?)) +//! } +//! } +//! ``` +//! +//! Finally, you can define [`TryFromGlib`] with both `None` and `Invalid` alternatives by setting +//! the associated `type Error = GlibNoneOrInvalidError` (where `I` is the `Error` type +//! when the value is invalid), which results in auto-implementing [`FromGlib`] for +//! `Result, I>`. +//! //! `ToGlibPtr`, `FromGlibPtrNone`, `FromGlibPtrFull` and `FromGlibPtrBorrow` work on `gpointer`s //! and ensure correct ownership of values //! according to [Glib ownership transfer rules](https://gi.readthedocs.io/en/latest/annotations/giannotations.html). @@ -68,10 +134,12 @@ use glib_sys; use libc::{c_char, size_t}; use std::char; -use std::cmp::Ordering; +use std::cmp::{Eq, Ordering, PartialEq}; use std::collections::HashMap; +use std::error::Error; use std::ffi::{CStr, CString}; use std::ffi::{OsStr, OsString}; +use std::fmt; use std::mem; #[cfg(not(windows))] use std::os::unix::prelude::*; @@ -228,7 +296,7 @@ impl std::ops::Deref for Borrowed { /// Translate a simple type. pub trait ToGlib { - type GlibType; + type GlibType: Copy; fn to_glib(&self) -> Self::GlibType; } @@ -277,6 +345,23 @@ impl ToGlib for Ordering { } } +/// A Rust type `T` for which `Option` translates to the same glib type as T. +pub trait OptionToGlib: ToGlib { + const GLIB_NONE: Self::GlibType; +} + +impl ToGlib for Option { + type GlibType = T::GlibType; + + #[inline] + fn to_glib(&self) -> Self::GlibType { + match self { + Some(t) => t.to_glib(), + None => T::GLIB_NONE, + } + } +} + /// Provides the default pointer type to be used in some container conversions. /// /// It's `*mut c_char` for `String`, `*mut GtkButton` for `gtk::Button`, etc. @@ -1064,13 +1149,13 @@ where } /// Translate a simple type. -pub trait FromGlib: Sized { - fn from_glib(val: T) -> Self; +pub trait FromGlib: Sized { + fn from_glib(val: G) -> Self; } /// Translate a simple type. #[inline] -pub fn from_glib>(val: G) -> T { +pub fn from_glib>(val: G) -> T { FromGlib::from_glib(val) } @@ -1081,13 +1166,6 @@ impl FromGlib for bool { } } -impl FromGlib for char { - #[inline] - fn from_glib(val: u32) -> char { - char::from_u32(val).expect("Valid Unicode character expected") - } -} - impl FromGlib for Ordering { #[inline] fn from_glib(val: i32) -> Ordering { @@ -1095,42 +1173,97 @@ impl FromGlib for Ordering { } } -impl FromGlib for Option { - #[inline] - fn from_glib(val: u32) -> Option { - match val { - 0 => None, - _ => char::from_u32(val), - } +/// Translate from a Glib type which can result in an undefined and/or invalid value. +pub trait TryFromGlib: Sized { + type Error; + fn try_from_glib(val: G) -> Result; +} + +/// Error type for [`TryFromGlib`] when the Glib value is None. +#[derive(Debug, PartialEq, Eq)] +pub struct GlibNoneError; + +impl fmt::Display for GlibNoneError { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(fmt, "glib value is None") } } -impl FromGlib for Option { +impl std::error::Error for GlibNoneError {} + +impl> FromGlib for Option { #[inline] - fn from_glib(val: i32) -> Option { - if val >= 0 { - Some(val as u32) - } else { - None + fn from_glib(val: G) -> Option { + T::try_from_glib(val).ok() + } +} + +/// Error type for [`TryFromGlib`] when the Glib value can be None or invalid. +#[derive(Debug, Eq, PartialEq)] +pub enum GlibNoneOrInvalidError { + Invalid(I), + None, +} + +impl GlibNoneOrInvalidError { + /// Builds the `None` variant. + pub fn none() -> Self { + GlibNoneOrInvalidError::None + } + + /// Returns `true` if `self` is the `None` variant. + // FIXME `matches!` was introduced in rustc 1.42.0, current MSRV is 1.40.0 + // FIXME uncomment when CI can upgrade to 1.47.1 + //#[allow(clippy::match_like_matches_macro)] + pub fn is_none(&self) -> bool { + match self { + GlibNoneOrInvalidError::None => true, + _ => false, + } + } + + /// Returns `true` if `self` is the `Invalid` variant. + // FIXME `matches!` was introduced in rustc 1.42.0, current MSRV is 1.40.0 + // FIXME uncomment when CI can upgrade to 1.47.1 + //#[allow(clippy::match_like_matches_macro)] + pub fn is_invalid(&self) -> bool { + match self { + GlibNoneOrInvalidError::Invalid(_) => true, + _ => false, } } } -impl FromGlib for Option { - #[inline] - fn from_glib(val: i64) -> Option { - if val >= 0 { - Some(val as u64) - } else { - None +impl From for GlibNoneOrInvalidError { + fn from(invalid: I) -> Self { + GlibNoneOrInvalidError::Invalid(invalid) + } +} + +impl fmt::Display for GlibNoneOrInvalidError { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + GlibNoneOrInvalidError::Invalid(err) => { + write!(fmt, "glib value is invalid: ")?; + fmt::Display::fmt(err, fmt) + } + GlibNoneOrInvalidError::None => write!(fmt, "glib value is None"), } } } -impl FromGlib for Option { +impl Error for GlibNoneOrInvalidError {} + +impl>> FromGlib + for Result, I> +{ #[inline] - fn from_glib(val: i32) -> Option { - FromGlib::from_glib(i64::from(val)) + fn from_glib(val: G) -> Result, I> { + match T::try_from_glib(val) { + Ok(value) => Ok(Some(value)), + Err(GlibNoneOrInvalidError::None) => Ok(None), + Err(GlibNoneOrInvalidError::Invalid(err)) => Err(err), + } } } @@ -2261,4 +2394,127 @@ mod tests { ::FileTest::EXISTS | ::FileTest::IS_DIR )); } + + #[test] + fn none_value() { + const CLONG_NONE: libc::c_long = -1; + + #[derive(Debug, PartialEq, Eq)] + struct SpecialU32(u32); + impl ToGlib for SpecialU32 { + type GlibType = libc::c_uint; + fn to_glib(&self) -> libc::c_uint { + self.0 as libc::c_uint + } + } + impl OptionToGlib for SpecialU32 { + const GLIB_NONE: Self::GlibType = CLONG_NONE as libc::c_uint; + } + + assert_eq!(SpecialU32(0).to_glib(), 0); + assert_eq!(SpecialU32(42).to_glib(), 42); + assert_eq!(Some(SpecialU32(0)).to_glib(), 0); + assert_eq!(Some(SpecialU32(42)).to_glib(), 42); + assert_eq!(Option::None::.to_glib(), SpecialU32::GLIB_NONE); + + impl TryFromGlib for SpecialU32 { + type Error = GlibNoneError; + fn try_from_glib(val: libc::c_uint) -> Result { + if val == SpecialU32::GLIB_NONE { + return Err(GlibNoneError); + } + + Ok(SpecialU32(val as u32)) + } + } + + assert_eq!(SpecialU32::try_from_glib(0), Ok(SpecialU32(0))); + assert_eq!(SpecialU32::try_from_glib(42), Ok(SpecialU32(42))); + assert_eq!( + SpecialU32::try_from_glib(SpecialU32::GLIB_NONE), + Err(GlibNoneError) + ); + + assert_eq!(Option::::from_glib(0), Some(SpecialU32(0))); + assert_eq!(Option::::from_glib(42), Some(SpecialU32(42))); + assert!(Option::::from_glib(SpecialU32::GLIB_NONE).is_none()); + } + + #[test] + fn invalid_value() { + use std::convert::TryFrom; + use std::num::TryFromIntError; + + #[derive(Debug, PartialEq, Eq)] + struct U32(u32); + + impl TryFromGlib for U32 { + type Error = TryFromIntError; + fn try_from_glib(val: libc::c_long) -> Result { + Ok(U32(u32::try_from(val)?)) + } + } + + assert_eq!(U32::try_from_glib(0), Ok(U32(0))); + assert_eq!(U32::try_from_glib(42), Ok(U32(42))); + assert!(U32::try_from_glib(-1).is_err()); + assert!(U32::try_from_glib(-42).is_err()); + } + + #[test] + fn none_or_invalid_value() { + use std::convert::TryFrom; + use std::num::TryFromIntError; + + #[derive(Debug, PartialEq, Eq)] + struct SpecialU32(u32); + impl ToGlib for SpecialU32 { + type GlibType = libc::c_long; + fn to_glib(&self) -> libc::c_long { + self.0 as libc::c_long + } + } + impl OptionToGlib for SpecialU32 { + const GLIB_NONE: Self::GlibType = -1; + } + + assert_eq!(SpecialU32(0).to_glib(), 0); + assert_eq!(SpecialU32(42).to_glib(), 42); + assert_eq!(Some(SpecialU32(42)).to_glib(), 42); + assert_eq!(Option::None::.to_glib(), SpecialU32::GLIB_NONE); + + impl TryFromGlib for SpecialU32 { + type Error = GlibNoneOrInvalidError; + fn try_from_glib( + val: libc::c_long, + ) -> Result> { + if val == SpecialU32::GLIB_NONE { + return Err(GlibNoneOrInvalidError::None); + } + + Ok(SpecialU32(u32::try_from(val)?)) + } + } + + assert_eq!(SpecialU32::try_from_glib(0), Ok(SpecialU32(0))); + assert_eq!(SpecialU32::try_from_glib(42), Ok(SpecialU32(42))); + assert!(SpecialU32::try_from_glib(SpecialU32::GLIB_NONE) + .unwrap_err() + .is_none()); + assert!(SpecialU32::try_from_glib(-42).unwrap_err().is_invalid()); + + assert_eq!( + Result::, _>::from_glib(0), + Ok(Some(SpecialU32(0))) + ); + assert_eq!( + Result::, _>::from_glib(42), + Ok(Some(SpecialU32(42))) + ); + assert_eq!( + Result::, _>::from_glib(SpecialU32::GLIB_NONE), + Ok(None) + ); + assert!(Result::, _>::from_glib(-42).is_err()); + } } diff --git a/glib/sys/Cargo.toml b/glib/sys/Cargo.toml index fbbcc3d1d64b..5a3a85544128 100644 --- a/glib/sys/Cargo.toml +++ b/glib/sys/Cargo.toml @@ -1,5 +1,5 @@ [build-dependencies] -system-deps = "1.3" +system-deps = "2.0" [dependencies] libc = "0.2" @@ -43,27 +43,57 @@ features = ["dox"] name = "glib-2.0" version = "2.42" -[package.metadata.system-deps.glib_2_0.feature-versions] -v2_44 = "2.44" -v2_46 = "2.46" -v2_48 = "2.48" -v2_50 = "2.50" -v2_52 = "2.52" -v2_54 = "2.54" -v2_56 = "2.56" -v2_58 = "2.58" -v2_60 = "2.60" -v2_62 = "2.62" -v2_64 = "2.64" -v2_66 = "2.66" +[package.metadata.system-deps.glib_2_0.v2_44] +version = "2.44" + +[package.metadata.system-deps.glib_2_0.v2_46] +version = "2.46" + +[package.metadata.system-deps.glib_2_0.v2_48] +version = "2.48" + +[package.metadata.system-deps.glib_2_0.v2_50] +version = "2.50" + +[package.metadata.system-deps.glib_2_0.v2_52] +version = "2.52" + +[package.metadata.system-deps.glib_2_0.v2_54] +version = "2.54" + +[package.metadata.system-deps.glib_2_0.v2_56] +version = "2.56" + +[package.metadata.system-deps.glib_2_0.v2_58] +version = "2.58" + +[package.metadata.system-deps.glib_2_0.v2_60] +version = "2.60" + +[package.metadata.system-deps.glib_2_0.v2_62] +version = "2.62" + +[package.metadata.system-deps.glib_2_0.v2_64] +version = "2.64" + +[package.metadata.system-deps.glib_2_0.v2_66] +version = "2.66" [package.metadata.system-deps.gobject_2_0] name = "gobject-2.0" version = "2.42" -[package.metadata.system-deps.gobject_2_0.feature-versions] -v2_44 = "2.44" -v2_46 = "2.46" -v2_54 = "2.54" -v2_58 = "2.58" -v2_62 = "2.62" +[package.metadata.system-deps.gobject_2_0.v2_44] +version = "2.44" + +[package.metadata.system-deps.gobject_2_0.v2_46] +version = "2.46" + +[package.metadata.system-deps.gobject_2_0.v2_54] +version = "2.54" + +[package.metadata.system-deps.gobject_2_0.v2_58] +version = "2.58" + +[package.metadata.system-deps.gobject_2_0.v2_62] +version = "2.62" diff --git a/glib/sys/versions.txt b/glib/sys/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/glib/sys/versions.txt +++ b/glib/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/graphene/Gir.toml b/graphene/Gir.toml index 422cee75c18e..5237b8d5abc2 100644 --- a/graphene/Gir.toml +++ b/graphene/Gir.toml @@ -41,7 +41,7 @@ clear_function_expression = "|_ptr| ()" [[object.function]] # array with size name = "init_from_points" - ignore = true + manual = true [object.function.return] type = "none" [[object.function]] @@ -51,7 +51,7 @@ clear_function_expression = "|_ptr| ()" [[object.function]] # array with size name = "init_from_vectors" - ignore = true + manual = true [object.function.return] type = "none" [[object.function]] @@ -439,13 +439,13 @@ clear_function_expression = "|_ptr| ()" [[object.function]] # array with size name = "init_from_points" - ignore = true + manual = true [object.function.return] type = "none" [[object.function]] # array with size name = "init_from_vectors" - ignore = true + manual = true [object.function.return] type = "none" diff --git a/graphene/src/auto/versions.txt b/graphene/src/auto/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/graphene/src/auto/versions.txt +++ b/graphene/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/graphene/sys/Cargo.toml b/graphene/sys/Cargo.toml index 5b4fb8c39a1d..502076cd5329 100644 --- a/graphene/sys/Cargo.toml +++ b/graphene/sys/Cargo.toml @@ -1,6 +1,6 @@ [build-dependencies] pkg-config = "0.3.7" -system-deps = "1.3" +system-deps = "2.0" [dependencies] libc = "0.2" @@ -41,5 +41,5 @@ features = ["dox"] name = "graphene-gobject-1.0" version = "1.9.2" -[package.metadata.system-deps.graphene_gobject_1_0.feature-versions] -v1_10 = "1.10" +[package.metadata.system-deps.graphene_gobject_1_0.v1_10] +version = "1.10" diff --git a/graphene/sys/versions.txt b/graphene/sys/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/graphene/sys/versions.txt +++ b/graphene/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/gtk/Gir.toml b/gtk/Gir.toml index 6a2bacdfe8ba..0d45cc6df643 100644 --- a/gtk/Gir.toml +++ b/gtk/Gir.toml @@ -327,12 +327,12 @@ manual_traits = ["AccelGroupExtManual"] ignore = true [[object.function]] name = "connect" - # Manual, more convenient implementation - ignore = true + # More convenient implementation + manual = true [[object.function]] name = "connect_by_path" - # Manual, more convenient implementation - ignore = true + # More convenient implementation + manual = true [[object]] name = "Gtk.AccelLabel" @@ -482,8 +482,8 @@ manual_traits = ["BuilderExtManual"] doc_trait_name = "BuilderExtManual" [[object.function]] name = "connect_signals_full" - #manual: connect object and swapped signal not supported - ignore = true + # Connect object and swapped signal not supported + manual = true [[object.function]] name = "get_object" #downcast @@ -732,11 +732,11 @@ manual_traits = ["ColorButtonExtManual"] doc_trait_name = "ColorButtonExtManual" [[object.function]] name = "get_color" - ignore = true + manual = true doc_trait_name = "ColorButtonExtManual" [[object.function]] name = "set_color" - ignore = true + manual = true doc_trait_name = "ColorButtonExtManual" [[object]] @@ -746,7 +746,7 @@ manual_traits = ["ColorChooserExtManual"] [[object.function]] name = "add_palette" #array with size - ignore = true + manual = true doc_trait_name = "ColorChooserExtManual" [[object]] @@ -771,11 +771,11 @@ manual_traits = ["ComboBoxExtManual"] const = true [[object.function]] name = "set_active" - ignore = true + manual = true doc_trait_name = "ComboBoxExtManual" [[object.function]] name = "get_active" - ignore = true + manual = true doc_trait_name = "ComboBoxExtManual" [[object.property]] name = "active" @@ -844,14 +844,15 @@ manual_traits = ["EditableSignals"] name = "Gtk.Entry" status = "generate" generate_builder = true +manual_traits = ["EntryExtManual"] [[object.function]] name = "get_buffer" [object.function.return] nullable = false [[object.function]] name = "get_invisible_char" - [object.function.return] - nullable = true + manual = true + doc_trait_name = "EntryExtManual" [[object.function]] name = "get_text" [object.function.return] @@ -898,7 +899,7 @@ manual_traits = ["EntryCompletionExtManual"] inhibit = true [[object.function]] name = "get_entry" - ignore = true + manual = true doc_trait_name = "EntryCompletionExtManual" [[object]] @@ -1097,8 +1098,7 @@ version = "3.24" manual_traits = ["GestureStylusExtManual"] [[object.function]] name = "get_axes" - # generated manually - ignore = true + manual = true [[object]] name = "Gtk.GestureSwipe" @@ -1265,7 +1265,7 @@ generate_builder = true manual_traits = ["IMContextSimpleExtManual"] [[object.function]] name = "add_compose_file" - ignore = true + manual = true doc_trait_name = "IMContextSimpleExtManual" [[object.function]] name = "add_table" @@ -1307,7 +1307,7 @@ generate_builder = true manual_traits = ["InvisibleExtManual"] [[object.function]] name = "get_screen" - ignore = true + manual = true doc_trait_name = "InvisibleExtManual" [[object]] @@ -1393,11 +1393,11 @@ manual_traits = ["GtkListStoreExtManual"] const = true [[object.function]] name = "reorder" - ignore = true + manual = true doc_trait_name = "GtkListStoreExtManual" [[object.function]] name = "set_value" - ignore = true + manual = true doc_trait_name = "GtkListStoreExtManual" [[object]] @@ -1495,55 +1495,55 @@ manual_traits = ["NotebookExtManual"] # The following functions need integer type adjustments [[object.function]] name = "append_page" - ignore = true + manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "append_page_menu" - ignore = true + manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "get_current_page" - ignore = true + manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "get_n_pages" - ignore = true + manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "get_nth_page" - ignore = true + manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "insert_page" - ignore = true + manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "insert_page_menu" - ignore = true + manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "page_num" - ignore = true + manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "prepend_page" - ignore = true + manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "prepend_page_menu" - ignore = true + manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "remove_page" - ignore = true + manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "reorder_child" - ignore = true + manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "set_current_page" - ignore = true + manual = true doc_trait_name = "NotebookExtManual" [[object.child_prop]] name = "detachable" @@ -1605,7 +1605,7 @@ generate_builder = true version = "3.22" [[object.function]] name = "set_action_entries" - ignore = true + manual = true [[object]] name = "Gtk.PageSetup" @@ -1714,7 +1714,7 @@ status = "generate" nullable = false [[object.function]] name = "set_page_ranges" - ignore = true + manual = true [[object.function]] name = "set_paper_size" [[object.function.parameter]] @@ -1737,13 +1737,13 @@ generate_builder = true nullable = false [[object.function]] name = "new" - ignore = true + manual = true [[object.function]] name = "new_with_label" - ignore = true + manual = true [[object.function]] name = "new_with_mnemonic" - ignore = true + manual = true [[object.function]] name = "set_group" ignore = true @@ -1762,13 +1762,13 @@ generate_builder = true nullable = false [[object.function]] name = "new" - ignore = true + manual = true [[object.function]] name = "new_with_label" - ignore = true + manual = true [[object.function]] name = "new_with_mnemonic" - ignore = true + manual = true [[object.function]] name = "set_group" ignore = true @@ -1787,10 +1787,10 @@ generate_builder = true nullable = false [[object.function]] name = "new" - ignore = true + manual = true [[object.function]] name = "new_from_stock" - ignore = true + manual = true [[object.function]] name = "set_group" ignore = true @@ -1924,7 +1924,7 @@ status = "generate" [[object.function]] name = "get_data" #array without length - ignore = true + manual = true [[object.function]] name = "get_data_with_length" ignore = true @@ -2099,7 +2099,7 @@ status = "generate" [[object.function]] name = "new" #array with size - ignore = true + manual = true [[object]] name = "Gtk.TextBuffer" @@ -2162,11 +2162,10 @@ clear_function_expression = "|_ptr| ()" [[object.function]] name = "get_attributes" - ignore = true + manual = true [[object.function]] name = "get_char" - [object.function.return] - nullable = true + manual = true [[object]] name = "Gtk.TextMark" @@ -2419,7 +2418,7 @@ status = "generate" const = true [[object.function]] name = "get_indices" - ignore = true + manual = true [[object.function]] name = "to_string" [[object.function.parameter]] @@ -2497,17 +2496,17 @@ status = "generate" manual_traits = ["TreeSortableExtManual"] [[object.function]] pattern = "[gs]et_sort_column_id" - ignore = true + manual = true doc_trait_name = "TreeSortableExtManual" [[object.function]] pattern = "set_sort_func" # return type u32 -> Ordering - ignore = true + manual = true doc_trait_name = "TreeSortableExtManual" [[object.function]] pattern = "set_default_sort_func" # return type u32 -> Ordering - ignore = true + manual = true doc_trait_name = "TreeSortableExtManual" [[object]] @@ -2542,11 +2541,11 @@ manual_traits = ["TreeStoreExtManual"] const = true [[object.function]] name = "reorder" - ignore = true + manual = true doc_trait_name = "TreeStoreExtManual" [[object.function]] name = "set_value" - ignore = true + manual = true doc_trait_name = "TreeStoreExtManual" [[object.function]] name = "swap" @@ -2617,12 +2616,12 @@ manual_traits = ["WidgetExtManual"] [[object.function]] name = "drag_dest_set" #array with size - ignore = true + manual = true doc_trait_name = "WidgetExtManual" [[object.function]] name = "drag_source_set" #array with size - ignore = true + manual = true doc_trait_name = "WidgetExtManual" [[object.function]] name = "enable_model_drag_source" @@ -2640,7 +2639,7 @@ manual_traits = ["WidgetExtManual"] nullable = false [[object.function]] name = "intersect" - ignore = true + manual = true doc_trait_name = "WidgetExtManual" [[object.function]] name = "override_font" @@ -2658,22 +2657,22 @@ manual_traits = ["WidgetExtManual"] nullable = false [[object.function]] name = "add_tick_callback" - ignore = true + manual = true doc_trait_name = "WidgetExtManual" [[object.function]] name = "remove_tick_callback" ignore = true [[object.function]] name = "add_events" - ignore = true + manual = true doc_trait_name = "WidgetExtManual" [[object.function]] name = "get_events" - ignore = true + manual = true doc_trait_name = "WidgetExtManual" [[object.function]] name = "set_events" - ignore = true + manual = true doc_trait_name = "WidgetExtManual" [[object.function]] name = "get_style_context" @@ -2687,7 +2686,7 @@ manual_traits = ["WidgetExtManual"] [[object.function]] name = "hide_on_delete" # return Inhibit instead of bool - ignore = true + manual = true doc_trait_name = "WidgetExtManual" [[object.signal]] name = "button-press-event" @@ -2822,7 +2821,7 @@ manual_traits = ["WidgetExtManual"] [[object.function]] name = "destroy" # needs to be marked as unsafe - ignore = true + manual = true [[object.function]] name = "create_pango_context" [object.function.return] @@ -2858,7 +2857,7 @@ manual_traits = ["GtkWindowExtManual"] const = true [[object.function]] name = "present" - ignore = true + manual = true doc_trait_name = "GtkWindowExtManual" [[object.function]] name = "set_geometry_hints" diff --git a/gtk/src/auto/entry.rs b/gtk/src/auto/entry.rs index 428b6323b10b..025be4a26429 100644 --- a/gtk/src/auto/entry.rs +++ b/gtk/src/auto/entry.rs @@ -821,8 +821,6 @@ pub trait EntryExt: 'static { fn get_input_purpose(&self) -> InputPurpose; - fn get_invisible_char(&self) -> Option; - fn get_layout(&self) -> Option; fn get_layout_offsets(&self) -> (i32, i32); @@ -1467,14 +1465,6 @@ impl> EntryExt for O { } } - fn get_invisible_char(&self) -> Option { - unsafe { - from_glib(gtk_sys::gtk_entry_get_invisible_char( - self.as_ref().to_glib_none().0, - )) - } - } - fn get_layout(&self) -> Option { unsafe { from_glib_none(gtk_sys::gtk_entry_get_layout( diff --git a/gtk/src/auto/functions.rs b/gtk/src/auto/functions.rs index 691b67fa89e9..6a6da4ecb8f0 100644 --- a/gtk/src/auto/functions.rs +++ b/gtk/src/auto/functions.rs @@ -356,7 +356,10 @@ pub fn print_run_page_setup_dialog>( } } -pub fn print_run_page_setup_dialog_async, Q: FnOnce(&PageSetup) + 'static>( +pub fn print_run_page_setup_dialog_async< + P: IsA, + Q: FnOnce(&PageSetup) + Send + Sync + 'static, +>( parent: Option<&P>, page_setup: Option<&PageSetup>, settings: &PrintSettings, @@ -364,7 +367,10 @@ pub fn print_run_page_setup_dialog_async, Q: FnOnce(&PageSetup) + ) { skip_assert_initialized!(); let done_cb_data: Box_ = Box_::new(done_cb); - unsafe extern "C" fn done_cb_func, Q: FnOnce(&PageSetup) + 'static>( + unsafe extern "C" fn done_cb_func< + P: IsA, + Q: FnOnce(&PageSetup) + Send + Sync + 'static, + >( page_setup: *mut gtk_sys::GtkPageSetup, data: glib_sys::gpointer, ) { diff --git a/gtk/src/auto/text_iter.rs b/gtk/src/auto/text_iter.rs index 3f768c5794a4..e0919dbbfb70 100644 --- a/gtk/src/auto/text_iter.rs +++ b/gtk/src/auto/text_iter.rs @@ -79,7 +79,8 @@ impl TextIter { ch: u32, user_data: glib_sys::gpointer, ) -> glib_sys::gboolean { - let ch = from_glib(ch); + let ch = std::convert::TryFrom::try_from(ch) + .expect("conversion from an invalid Unicode value attempted"); let callback: *mut P = user_data as *const _ as usize as *mut P; let res = (*callback)(ch); res.to_glib() @@ -338,7 +339,8 @@ impl TextIter { ch: u32, user_data: glib_sys::gpointer, ) -> glib_sys::gboolean { - let ch = from_glib(ch); + let ch = std::convert::TryFrom::try_from(ch) + .expect("conversion from an invalid Unicode value attempted"); let callback: *mut P = user_data as *const _ as usize as *mut P; let res = (*callback)(ch); res.to_glib() @@ -513,10 +515,6 @@ impl TextIter { unsafe { gtk_sys::gtk_text_iter_get_bytes_in_line(self.to_glib_none().0) } } - pub fn get_char(&self) -> Option { - unsafe { from_glib(gtk_sys::gtk_text_iter_get_char(self.to_glib_none().0)) } - } - pub fn get_chars_in_line(&self) -> i32 { unsafe { gtk_sys::gtk_text_iter_get_chars_in_line(self.to_glib_none().0) } } diff --git a/gtk/src/auto/versions.txt b/gtk/src/auto/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/gtk/src/auto/versions.txt +++ b/gtk/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/gtk/src/entry.rs b/gtk/src/entry.rs new file mode 100644 index 000000000000..bc9648e847eb --- /dev/null +++ b/gtk/src/entry.rs @@ -0,0 +1,21 @@ +use glib::object::IsA; +use glib::translate::ToGlibPtr; +use std::convert::TryFrom; + +use Entry; + +pub trait EntryExtManual: 'static { + fn get_invisible_char(&self) -> Option; +} + +impl> EntryExtManual for O { + fn get_invisible_char(&self) -> Option { + let ret = unsafe { gtk_sys::gtk_entry_get_invisible_char(self.as_ref().to_glib_none().0) }; + + if ret == 0 { + return None; + } + + Some(TryFrom::try_from(ret).expect("conversion from an invalid Unicode value attempted")) + } +} diff --git a/gtk/src/lib.rs b/gtk/src/lib.rs index cb98a97f4b61..07c294257c18 100644 --- a/gtk/src/lib.rs +++ b/gtk/src/lib.rs @@ -217,6 +217,7 @@ mod color_chooser; mod combo_box; mod dialog; mod drag_context; +mod entry; mod entry_buffer; mod entry_completion; mod enums; diff --git a/gtk/src/prelude.rs b/gtk/src/prelude.rs index 9ea3cecd53b5..8d8ad3002b3a 100644 --- a/gtk/src/prelude.rs +++ b/gtk/src/prelude.rs @@ -19,6 +19,7 @@ pub use color_chooser::ColorChooserExtManual; pub use combo_box::ComboBoxExtManual; pub use dialog::DialogExtManual; pub use drag_context::DragContextExtManual; +pub use entry::EntryExtManual; pub use entry_completion::EntryCompletionExtManual; pub use fixed::FixedExtManual; #[cfg(any(feature = "v3_18", feature = "dox"))] diff --git a/gtk/src/text_iter.rs b/gtk/src/text_iter.rs index d2e00cf4f755..9eafc48be322 100644 --- a/gtk/src/text_iter.rs +++ b/gtk/src/text_iter.rs @@ -4,6 +4,7 @@ use glib::translate::*; use gtk_sys; +use std::convert::TryFrom; use TextAttributes; use TextIter; @@ -16,4 +17,14 @@ impl TextIter { )) } } + + pub fn get_char(&self) -> Option { + let ret = unsafe { gtk_sys::gtk_text_iter_get_char(self.to_glib_none().0) }; + + if ret == 0 { + return None; + } + + Some(TryFrom::try_from(ret).expect("conversion from an invalid Unicode value attempted")) + } } diff --git a/gtk/sys/Cargo.toml b/gtk/sys/Cargo.toml index f7f3f1b75305..8580a65e3704 100644 --- a/gtk/sys/Cargo.toml +++ b/gtk/sys/Cargo.toml @@ -15,19 +15,41 @@ features = ["dox"] name = "gtk+-3.0" version = "3.14" -[package.metadata.system-deps."gtk+_3_0".feature-versions] -v3_16 = "3.16" -v3_18 = "3.18" -v3_20 = "3.20" -v3_22 = "3.22" -v3_22_6 = "3.22.6" -v3_22_26 = "3.22.26" -v3_22_27 = "3.22.27" -v3_22_29 = "3.22.29" -v3_22_30 = "3.22.30" -v3_24 = "3.24" -v3_24_8 = "3.24.8" -v3_24_9 = "3.24.9" +[package.metadata.system-deps."gtk+_3_0".v3_16] +version = "3.16" + +[package.metadata.system-deps."gtk+_3_0".v3_18] +version = "3.18" + +[package.metadata.system-deps."gtk+_3_0".v3_20] +version = "3.20" + +[package.metadata.system-deps."gtk+_3_0".v3_22] +version = "3.22" + +[package.metadata.system-deps."gtk+_3_0".v3_22_6] +version = "3.22.6" + +[package.metadata.system-deps."gtk+_3_0".v3_22_26] +version = "3.22.26" + +[package.metadata.system-deps."gtk+_3_0".v3_22_27] +version = "3.22.27" + +[package.metadata.system-deps."gtk+_3_0".v3_22_29] +version = "3.22.29" + +[package.metadata.system-deps."gtk+_3_0".v3_22_30] +version = "3.22.30" + +[package.metadata.system-deps."gtk+_3_0".v3_24] +version = "3.24" + +[package.metadata.system-deps."gtk+_3_0".v3_24_8] +version = "3.24.8" + +[package.metadata.system-deps."gtk+_3_0".v3_24_9] +version = "3.24.9" [lib] name = "gtk_sys" @@ -60,7 +82,7 @@ path = "../../pango/sys" path = "../../cairo/sys" [build-dependencies] -system-deps = "1.3" +system-deps = "2.0" [dev-dependencies] shell-words = "1.0.0" diff --git a/gtk/sys/versions.txt b/gtk/sys/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/gtk/sys/versions.txt +++ b/gtk/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/pango/Gir.toml b/pango/Gir.toml index 5ac57cb60ecf..0067fde690fe 100644 --- a/pango/Gir.toml +++ b/pango/Gir.toml @@ -131,7 +131,7 @@ name = "Pango.AttrIterator" status = "generate" [[object.function]] name = "get_font" - ignore = true + manual = true [[object.function]] name = "get_type" version = "1.44" @@ -143,16 +143,16 @@ status = "generate" name = "Debug" [[object.function]] name = "change" - ignore = true + manual = true [[object.function]] name = "insert" - ignore = true + manual = true [[object.function]] name = "insert_before" - ignore = true + manual = true [[object.function]] name = "equal" - ignore = true + manual = true [[object]] name = "Pango.Context" diff --git a/pango/src/auto/functions.rs b/pango/src/auto/functions.rs index ae9384849994..d0ea00cc466f 100644 --- a/pango/src/auto/functions.rs +++ b/pango/src/auto/functions.rs @@ -183,7 +183,8 @@ pub fn parse_markup( Ok(( from_glib_full(attr_list), from_glib_full(text), - from_glib(accel_char), + std::convert::TryFrom::try_from(accel_char) + .expect("conversion from an invalid Unicode value attempted"), )) } else { Err(from_glib_full(error)) diff --git a/pango/src/auto/layout.rs b/pango/src/auto/layout.rs index e2aa219df500..9c609b5ab88b 100644 --- a/pango/src/auto/layout.rs +++ b/pango/src/auto/layout.rs @@ -409,7 +409,8 @@ impl Layout { accel_char.as_mut_ptr(), ); let accel_char = accel_char.assume_init(); - from_glib(accel_char) + std::convert::TryFrom::try_from(accel_char) + .expect("conversion from an invalid Unicode value attempted") } } diff --git a/pango/src/auto/versions.txt b/pango/src/auto/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/pango/src/auto/versions.txt +++ b/pango/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/pango/sys/Cargo.toml b/pango/sys/Cargo.toml index dd9a1e3e4b78..b8a5f9ebfbc4 100644 --- a/pango/sys/Cargo.toml +++ b/pango/sys/Cargo.toml @@ -1,5 +1,5 @@ [build-dependencies] -system-deps = "1.3" +system-deps = "2.0" [dependencies] libc = "0.2" @@ -42,9 +42,17 @@ features = ["dox"] name = "pango" version = "1.36" -[package.metadata.system-deps.pango.feature-versions] -v1_36_7 = "1.36.7" -v1_38 = "1.38" -v1_42 = "1.42" -v1_44 = "1.44" -v1_46 = "1.46" +[package.metadata.system-deps.pango.v1_36_7] +version = "1.36.7" + +[package.metadata.system-deps.pango.v1_38] +version = "1.38" + +[package.metadata.system-deps.pango.v1_42] +version = "1.42" + +[package.metadata.system-deps.pango.v1_44] +version = "1.44" + +[package.metadata.system-deps.pango.v1_46] +version = "1.46" diff --git a/pango/sys/versions.txt b/pango/sys/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/pango/sys/versions.txt +++ b/pango/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/pangocairo/Gir.toml b/pangocairo/Gir.toml index 43dad339c93a..022310225ea8 100644 --- a/pangocairo/Gir.toml +++ b/pangocairo/Gir.toml @@ -106,14 +106,14 @@ status = "generate" manual_traits = ["FontMapExtManual"] [[object.function]] name = "get_font_type" - ignore = true + manual = true doc_trait_name = "FontMapExtManual" [[object.function]] name = "new_for_font_type" - ignore = true + manual = true [[object.function]] name = "new" - ignore = true + manual = true [[object.function]] name = "set_default" - ignore = true + manual = true diff --git a/pangocairo/src/auto/versions.txt b/pangocairo/src/auto/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/pangocairo/src/auto/versions.txt +++ b/pangocairo/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1) diff --git a/pangocairo/sys/Cargo.toml b/pangocairo/sys/Cargo.toml index 3bf4dfef6460..65372c78dc48 100644 --- a/pangocairo/sys/Cargo.toml +++ b/pangocairo/sys/Cargo.toml @@ -1,5 +1,5 @@ [build-dependencies] -system-deps = "1.3" +system-deps = "2.0" [dependencies] libc = "0.2" @@ -39,5 +39,3 @@ features = ["dox"] [package.metadata.system-deps.pangocairo] name = "pangocairo" version = "1.36" - -[package.metadata.system-deps.pangocairo.feature-versions] diff --git a/pangocairo/sys/versions.txt b/pangocairo/sys/versions.txt index 9ddeb977c259..8f042be52d08 100644 --- a/pangocairo/sys/versions.txt +++ b/pangocairo/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 7670e3d) +Generated by gir (https://github.com/gtk-rs/gir @ cea2f7c) from gir-files (https://github.com/gtk-rs/gir-files @ 8de1aa1)