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

Update to GNOME 3.14 versions #442

Merged
merged 3 commits into from
Feb 6, 2019
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
12 changes: 4 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,21 @@ lazy_static = "1.2"
libc = "0.2"
bitflags = "1.0"
futures-preview = { version = "0.2", optional = true }
glib-sys = { git = "https://github.com/gtk-rs/sys" }
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
glib-sys = { git = "https://github.com/gtk-rs/sys", features = ["v2_40"] }
gobject-sys = { git = "https://github.com/gtk-rs/sys", features = ["v2_42"] }
sdroege marked this conversation as resolved.
Show resolved Hide resolved

[dev-dependencies]
tempfile = "3"

[features]
v2_34 = ["glib-sys/v2_34", "gobject-sys/v2_34"]
v2_36 = ["v2_34", "glib-sys/v2_36", "gobject-sys/v2_36"]
v2_38 = ["v2_36", "glib-sys/v2_38", "gobject-sys/v2_38"]
v2_40 = ["v2_38", "glib-sys/v2_40"]
v2_44 = ["v2_40", "glib-sys/v2_44", "gobject-sys/v2_44"]
v2_44 = ["glib-sys/v2_44", "gobject-sys/v2_44"]
v2_46 = ["v2_44", "glib-sys/v2_46", "gobject-sys/v2_46"]
v2_48 = ["v2_46", "glib-sys/v2_48"]
v2_50 = ["v2_48", "glib-sys/v2_50"]
v2_52 = ["v2_50", "glib-sys/v2_52"]
v2_54 = ["v2_52", "glib-sys/v2_54", "gobject-sys/v2_54"]
v2_56 = ["v2_54", "glib-sys/v2_56"]
v2_58 = ["v2_56", "glib-sys/v2_58"]
futures = ["futures-preview", "v2_36"]
futures = ["futures-preview"]
subclassing = []
dox = ["glib-sys/dox", "gobject-sys/dox"]
3 changes: 2 additions & 1 deletion Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
girs_dir = "gir-files"
library = "GLib"
version = "2.0"
min_cfg_version = "2.32"
min_cfg_version = "2.42"
target_path = "."
work_mode = "normal"
single_version_file = true
deprecate_by_min_version = true

generate = [
"GLib.DateDay",
Expand Down
3 changes: 2 additions & 1 deletion Gir_GObject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
girs_dir = "gir-files"
library = "GObject"
version = "2.0"
min_cfg_version = "2.32"
min_cfg_version = "2.42"
target_path = "."
auto_path = "src/gobject/auto"
work_mode = "normal"
single_version_file = true
deprecate_by_min_version = true

generate = [
"GObject.BindingFlags",
Expand Down
2 changes: 1 addition & 1 deletion gir
Submodule gir updated 2 files
+150 −138 Cargo.lock
+3 −3 Cargo.toml
2 changes: 0 additions & 2 deletions src/auto/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ lazy_static! {
lazy_static! {
pub static ref KEY_FILE_DESKTOP_GROUP: &'static str = unsafe{CStr::from_ptr(ffi::G_KEY_FILE_DESKTOP_GROUP).to_str().unwrap()};
}
#[cfg(any(feature = "v2_38", feature = "dox"))]
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_ACTIONS: &'static str = unsafe{CStr::from_ptr(ffi::G_KEY_FILE_DESKTOP_KEY_ACTIONS).to_str().unwrap()};
}
Expand All @@ -30,7 +29,6 @@ lazy_static! {
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_COMMENT: &'static str = unsafe{CStr::from_ptr(ffi::G_KEY_FILE_DESKTOP_KEY_COMMENT).to_str().unwrap()};
}
#[cfg(any(feature = "v2_38", feature = "dox"))]
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE: &'static str = unsafe{CStr::from_ptr(ffi::G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE).to_str().unwrap()};
}
Expand Down
4 changes: 0 additions & 4 deletions src/auto/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pub enum ChecksumType {
Md5,
Sha1,
Sha256,
#[cfg(any(feature = "v2_36", feature = "dox"))]
Sha512,
#[cfg(any(feature = "v2_52", feature = "dox"))]
Sha384,
Expand All @@ -28,7 +27,6 @@ impl fmt::Display for ChecksumType {
ChecksumType::Md5 => "Md5",
ChecksumType::Sha1 => "Sha1",
ChecksumType::Sha256 => "Sha256",
#[cfg(any(feature = "v2_36", feature = "dox"))]
ChecksumType::Sha512 => "Sha512",
#[cfg(any(feature = "v2_52", feature = "dox"))]
ChecksumType::Sha384 => "Sha384",
Expand All @@ -46,7 +44,6 @@ impl ToGlib for ChecksumType {
ChecksumType::Md5 => ffi::G_CHECKSUM_MD5,
ChecksumType::Sha1 => ffi::G_CHECKSUM_SHA1,
ChecksumType::Sha256 => ffi::G_CHECKSUM_SHA256,
#[cfg(any(feature = "v2_36", feature = "dox"))]
ChecksumType::Sha512 => ffi::G_CHECKSUM_SHA512,
#[cfg(any(feature = "v2_52", feature = "dox"))]
ChecksumType::Sha384 => ffi::G_CHECKSUM_SHA384,
Expand All @@ -62,7 +59,6 @@ impl FromGlib<ffi::GChecksumType> for ChecksumType {
0 => ChecksumType::Md5,
1 => ChecksumType::Sha1,
2 => ChecksumType::Sha256,
#[cfg(any(feature = "v2_36", feature = "dox"))]
3 => ChecksumType::Sha512,
#[cfg(any(feature = "v2_52", feature = "dox"))]
4 => ChecksumType::Sha384,
Expand Down
37 changes: 0 additions & 37 deletions src/auto/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

#[cfg(any(feature = "v2_34", feature = "dox"))]
use Bytes;
use ChecksumType;
use Error;
Expand Down Expand Up @@ -56,11 +55,6 @@ pub fn assertion_message_expr<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&
}
}

//#[deprecated]
//pub fn atexit<P: FnOnce() + Send + Sync + 'static>(func: P) {
// unsafe { TODO: call ffi::g_atexit() }
//}

pub fn base64_decode(text: &str) -> Vec<u8> {
unsafe {
let mut out_len = mem::uninitialized();
Expand Down Expand Up @@ -92,13 +86,6 @@ pub fn base64_encode(data: &[u8]) -> Option<GString> {
// unsafe { TODO: call ffi::g_base64_encode_step() }
//}

#[deprecated]
pub fn basename<P: AsRef<std::path::Path>>(file_name: P) -> Option<std::path::PathBuf> {
unsafe {
from_glib_none(ffi::g_basename(file_name.as_ref().to_glib_none().0))
}
}

pub fn bit_nth_lsf(mask: libc::c_ulong, nth_bit: i32) -> i32 {
unsafe {
ffi::g_bit_nth_lsf(mask, nth_bit)
Expand Down Expand Up @@ -174,12 +161,10 @@ pub fn clear_error() -> Result<(), Error> {
// unsafe { TODO: call ffi::g_clear_handle_id() }
//}

//#[cfg(any(feature = "v2_34", feature = "dox"))]
//pub fn clear_pointer(pp: /*Unimplemented*/Fundamental: Pointer) {
// unsafe { TODO: call ffi::g_clear_pointer() }
//}

#[cfg(any(feature = "v2_34", feature = "dox"))]
pub fn compute_checksum_for_bytes(checksum_type: ChecksumType, data: &Bytes) -> Option<GString> {
unsafe {
from_glib_full(ffi::g_compute_checksum_for_bytes(checksum_type.to_glib(), data.to_glib_none().0))
Expand Down Expand Up @@ -243,7 +228,6 @@ pub fn compute_hmac_for_string(digest_type: ChecksumType, key: &[u8], str: &str)
// unsafe { TODO: call ffi::g_datalist_get_flags() }
//}

//#[cfg(any(feature = "v2_34", feature = "dox"))]
//pub fn datalist_id_dup_data(datalist: /*Ignored*/&mut Data, key_id: Quark, dup_func: /*Unimplemented*/FnMut(/*Unimplemented*/Fundamental: Pointer) -> /*Unimplemented*/Fundamental: Pointer, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> /*Unimplemented*/Option<Fundamental: Pointer> {
// unsafe { TODO: call ffi::g_datalist_id_dup_data() }
//}
Expand All @@ -256,7 +240,6 @@ pub fn compute_hmac_for_string(digest_type: ChecksumType, key: &[u8], str: &str)
// unsafe { TODO: call ffi::g_datalist_id_remove_no_notify() }
//}

//#[cfg(any(feature = "v2_34", feature = "dox"))]
//pub fn datalist_id_replace_data(datalist: /*Ignored*/&mut Data, key_id: Quark, oldval: /*Unimplemented*/Option<Fundamental: Pointer>, newval: /*Unimplemented*/Option<Fundamental: Pointer>) -> Option<Fn() + 'static> {
// unsafe { TODO: call ffi::g_datalist_id_replace_data() }
//}
Expand Down Expand Up @@ -412,13 +395,6 @@ pub fn format_size(size: u64) -> Option<GString> {
}
}

#[deprecated]
pub fn format_size_for_display(size: i64) -> Option<GString> {
unsafe {
from_glib_full(ffi::g_format_size_for_display(size))
}
}

pub fn format_size_full(size: u64, flags: FormatSizeFlags) -> Option<GString> {
unsafe {
from_glib_full(ffi::g_format_size_full(size, flags.to_glib()))
Expand Down Expand Up @@ -494,7 +470,6 @@ pub fn get_monotonic_time() -> i64 {
}
}

#[cfg(any(feature = "v2_36", feature = "dox"))]
pub fn get_num_processors() -> u32 {
unsafe {
ffi::g_get_num_processors()
Expand Down Expand Up @@ -1055,7 +1030,6 @@ pub fn spaced_primes_closest(num: u32) -> u32 {
// unsafe { TODO: call ffi::g_spawn_async_with_pipes() }
//}

#[cfg(any(feature = "v2_34", feature = "dox"))]
pub fn spawn_check_exit_status(exit_status: i32) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
Expand Down Expand Up @@ -1095,7 +1069,6 @@ pub fn stpcpy(dest: &str, src: &str) -> Option<GString> {
// unsafe { TODO: call ffi::g_test_add_data_func() }
//}

//#[cfg(any(feature = "v2_34", feature = "dox"))]
//pub fn test_add_data_func_full<P: Fn() + Send + Sync + 'static>(testpath: &str, test_data: /*Unimplemented*/Option<Fundamental: Pointer>, test_func: P) {
// unsafe { TODO: call ffi::g_test_add_data_func_full() }
//}
Expand Down Expand Up @@ -1126,7 +1099,6 @@ pub fn test_bug_base(uri_pattern: &str) {
}
}

//#[cfg(any(feature = "v2_38", feature = "dox"))]
//pub fn test_build_filename(file_type: /*Ignored*/TestFileType, first_path: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> Option<GString> {
// unsafe { TODO: call ffi::g_test_build_filename() }
//}
Expand All @@ -1139,7 +1111,6 @@ pub fn test_bug_base(uri_pattern: &str) {
// unsafe { TODO: call ffi::g_test_create_suite() }
//}

//#[cfg(any(feature = "v2_34", feature = "dox"))]
//pub fn test_expect_message<'a, P: Into<Option<&'a str>>>(log_domain: P, log_level: /*Ignored*/LogLevelFlags, pattern: &str) {
// unsafe { TODO: call ffi::g_test_expect_message() }
//}
Expand All @@ -1150,19 +1121,16 @@ pub fn test_fail() {
}
}

#[cfg(any(feature = "v2_38", feature = "dox"))]
pub fn test_failed() -> bool {
unsafe {
from_glib(ffi::g_test_failed())
}
}

//#[cfg(any(feature = "v2_38", feature = "dox"))]
//pub fn test_get_dir(file_type: /*Ignored*/TestFileType) -> Option<std::path::PathBuf> {
// unsafe { TODO: call ffi::g_test_get_dir() }
//}

//#[cfg(any(feature = "v2_38", feature = "dox"))]
//pub fn test_get_filename(file_type: /*Ignored*/TestFileType, first_path: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> Option<GString> {
// unsafe { TODO: call ffi::g_test_get_filename() }
//}
Expand All @@ -1171,7 +1139,6 @@ pub fn test_failed() -> bool {
// unsafe { TODO: call ffi::g_test_get_root() }
//}

#[cfg(any(feature = "v2_38", feature = "dox"))]
pub fn test_incomplete<'a, P: Into<Option<&'a str>>>(msg: P) {
let msg = msg.into();
unsafe {
Expand Down Expand Up @@ -1245,22 +1212,19 @@ pub fn test_run() -> i32 {
// unsafe { TODO: call ffi::g_test_run_suite() }
//}

#[cfg(any(feature = "v2_38", feature = "dox"))]
pub fn test_set_nonfatal_assertions() {
unsafe {
ffi::g_test_set_nonfatal_assertions();
}
}

#[cfg(any(feature = "v2_38", feature = "dox"))]
pub fn test_skip<'a, P: Into<Option<&'a str>>>(msg: P) {
let msg = msg.into();
unsafe {
ffi::g_test_skip(msg.to_glib_none().0);
}
}

#[cfg(any(feature = "v2_38", feature = "dox"))]
pub fn test_subprocess() -> bool {
unsafe {
from_glib(ffi::g_test_subprocess())
Expand Down Expand Up @@ -1307,7 +1271,6 @@ pub fn test_trap_reached_timeout() -> bool {
}
}

//#[cfg(any(feature = "v2_38", feature = "dox"))]
//pub fn test_trap_subprocess<'a, P: Into<Option<&'a str>>>(test_path: P, usec_timeout: u64, test_flags: /*Ignored*/TestSubprocessFlags) {
// unsafe { TODO: call ffi::g_test_trap_subprocess() }
//}
Expand Down
2 changes: 0 additions & 2 deletions src/auto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ pub use self::constants::CSET_DIGITS;
pub use self::constants::CSET_a_2_z;
pub use self::constants::KEY_FILE_DESKTOP_ACTION_GROUP_PREFIX;
pub use self::constants::KEY_FILE_DESKTOP_GROUP;
#[cfg(any(feature = "v2_38", feature = "dox"))]
pub use self::constants::KEY_FILE_DESKTOP_KEY_ACTIONS;
pub use self::constants::KEY_FILE_DESKTOP_KEY_CATEGORIES;
pub use self::constants::KEY_FILE_DESKTOP_KEY_COMMENT;
#[cfg(any(feature = "v2_38", feature = "dox"))]
pub use self::constants::KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE;
pub use self::constants::KEY_FILE_DESKTOP_KEY_EXEC;
pub use self::constants::KEY_FILE_DESKTOP_KEY_FULLNAME;
Expand Down
9 changes: 0 additions & 9 deletions src/auto/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ impl Source {
// unsafe { TODO: call ffi::g_source_add_poll() }
//}

//#[cfg(any(feature = "v2_36", feature = "dox"))]
//pub fn add_unix_fd(&self, fd: i32, events: IOCondition) -> /*Unimplemented*/Option<Fundamental: Pointer> {
// unsafe { TODO: call ffi::g_source_add_unix_fd() }
//}
Expand Down Expand Up @@ -63,11 +62,6 @@ impl Source {
}
}

//#[deprecated]
//pub fn get_current_time(&self, timeval: /*Ignored*/&mut TimeVal) {
// unsafe { TODO: call ffi::g_source_get_current_time() }
//}

pub fn get_id(&self) -> u32 {
unsafe {
ffi::g_source_get_id(self.to_glib_none().0)
Expand Down Expand Up @@ -104,12 +98,10 @@ impl Source {
}
}

//#[cfg(any(feature = "v2_36", feature = "dox"))]
//pub fn modify_unix_fd(&self, tag: /*Unimplemented*/Fundamental: Pointer, new_events: IOCondition) {
// unsafe { TODO: call ffi::g_source_modify_unix_fd() }
//}

//#[cfg(any(feature = "v2_36", feature = "dox"))]
//pub fn query_unix_fd(&self, tag: /*Unimplemented*/Fundamental: Pointer) -> IOCondition {
// unsafe { TODO: call ffi::g_source_query_unix_fd() }
//}
Expand All @@ -124,7 +116,6 @@ impl Source {
// unsafe { TODO: call ffi::g_source_remove_poll() }
//}

//#[cfg(any(feature = "v2_36", feature = "dox"))]
//pub fn remove_unix_fd(&self, tag: /*Unimplemented*/Fundamental: Pointer) {
// unsafe { TODO: call ffi::g_source_remove_unix_fd() }
//}
Expand Down
2 changes: 1 addition & 1 deletion src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ f5d3eab)
Generated by gir (https://github.com/gtk-rs/gir @ 4a198d9)
from gir-files (https://github.com/gtk-rs/gir-files @ 02dfee2)
1 change: 0 additions & 1 deletion src/gobject/auto/binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ impl Binding {
}
}

#[cfg(any(feature = "v2_38", feature = "dox"))]
pub fn unbind(&self) {
unsafe {
ffi::g_binding_unbind(self.to_glib_full());
Expand Down
1 change: 0 additions & 1 deletion src/key_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use gstring::GString;
use KeyFile;

impl KeyFile {
#[cfg(any(feature = "v2_40", feature = "dox"))]
pub fn save_to_file<T: AsRef<std::path::Path>>(&self, filename: T) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,7 @@ pub mod value;
pub mod variant;
mod variant_type;
mod main_context;
#[cfg(any(feature="v2_36", feature = "dox"))]
mod main_context_channel;
#[cfg(any(feature="v2_36", feature = "dox"))]
pub use main_context_channel::{Sender, SyncSender, Receiver};
mod date;
pub use date::Date;
Expand Down
2 changes: 0 additions & 2 deletions src/param_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//
// TODO: Implement custom subtyping here for things like GParamSpecInt to get
// default/min/max values and similar
#[cfg(any(feature = "v2_38", feature = "dox"))]
use Value;
use gobject_ffi as ffi;
use gobject_ffi;
Expand Down Expand Up @@ -51,7 +50,6 @@ impl ParamSpec {
}
}

#[cfg(any(feature = "v2_38", feature = "dox"))]
pub fn get_default_value(&self) -> Option<Value> {
unsafe {
from_glib_none(ffi::g_param_spec_get_default_value(self.to_glib_none().0))
Expand Down
Loading