Skip to content

Commit 205d5c8

Browse files
elmarcosdroege
authored andcommitted
Update to current git
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
1 parent d453eba commit 205d5c8

File tree

12 files changed

+26
-26
lines changed

12 files changed

+26
-26
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2018"
77
[dependencies]
88
bitflags = "1.0"
99
libc = "0.2"
10-
glib = { git = "https://github.com/gtk-rs/gtk-rs" }
10+
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" }
1111
once_cell = "1.0"
1212

1313
[lib]

src/bar/imp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl ObjectImpl for Bar {
5050
) {
5151
match pspec.name() {
5252
"number" => {
53-
let number = value.get().unwrap().unwrap();
53+
let number = value.get().unwrap();
5454
self.set_number(obj, number);
5555
}
5656
_ => unimplemented!(),
@@ -122,6 +122,6 @@ pub(crate) mod ffi {
122122

123123
#[no_mangle]
124124
pub extern "C" fn ex_bar_get_type() -> glib::ffi::GType {
125-
<super::Bar as glib::subclass::types::ObjectSubclassType>::type_().to_glib()
125+
<super::super::Bar as glib::StaticType>::static_type().into_glib()
126126
}
127127
}

src/bar/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl Bar {
5252
value.to_glib_none_mut().0,
5353
);
5454
}
55-
value.get().unwrap().unwrap()
55+
value.get().unwrap()
5656
}
5757

5858
pub fn set_property_number(&self, num: f64) {

src/color/imp.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use glib::translate::ToGlib;
1+
use glib::translate::IntoGlib;
22

33
#[derive(Debug, Copy, Clone, glib::GEnum)]
44
#[genum(type_name = "ExColor")]
@@ -12,14 +12,14 @@ pub(crate) mod ffi {
1212
use glib::translate::*;
1313
use glib::StaticType;
1414

15-
pub type ExColor = <super::Color as super::ToGlib>::GlibType;
15+
pub type ExColor = <super::Color as super::IntoGlib>::GlibType;
1616

1717
pub const EX_COLOR_RED: ExColor = super::Color::Red as i32;
1818
pub const EX_COLOR_GREEN: ExColor = super::Color::Green as i32;
1919
pub const EX_COLOR_BLUE: ExColor = super::Color::Blue as i32;
2020

2121
#[no_mangle]
2222
pub unsafe extern "C" fn ex_color_get_type() -> glib::ffi::GType {
23-
super::Color::static_type().to_glib()
23+
super::Color::static_type().into_glib()
2424
}
2525
}

src/color/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ pub enum Color {
1717
__Unknown(i32),
1818
}
1919

20-
impl ToGlib for Color {
20+
impl IntoGlib for Color {
2121
type GlibType = ffi::ExColor;
2222

23-
fn to_glib(&self) -> ffi::ExColor {
24-
match *self {
23+
fn into_glib(self) -> ffi::ExColor {
24+
match self {
2525
Color::Red => ffi::EX_COLOR_RED,
2626
Color::Green => ffi::EX_COLOR_GREEN,
2727
Color::Blue => ffi::EX_COLOR_BLUE,
@@ -54,7 +54,7 @@ mod tests {
5454
#[test]
5555
fn test_enum() {
5656
let c = Color::Blue;
57-
assert_eq!(c.to_glib(), 2);
57+
assert_eq!(c.into_glib(), 2);
5858

5959
let t = Color::static_type();
6060
assert!(t.is_a(glib::Type::ENUM));

src/flags/imp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ pub(crate) mod ffi {
99
use glib::translate::*;
1010
use glib::StaticType;
1111

12-
pub type ExFlags = <super::Flags as ToGlib>::GlibType;
12+
pub type ExFlags = <super::Flags as IntoGlib>::GlibType;
1313

1414
pub const EX_FLAGS_SOME: ExFlags = super::Flags::SOME.bits();
1515
pub const EX_FLAGS_ZING: ExFlags = super::Flags::ZING.bits();
1616
pub const EX_FLAGS_BONG: ExFlags = super::Flags::BONG.bits();
1717

1818
#[no_mangle]
1919
pub unsafe extern "C" fn ex_flags_get_type() -> glib::ffi::GType {
20-
super::Flags::static_type().to_glib()
20+
super::Flags::static_type().into_glib()
2121
}
2222
}

src/flags/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ bitflags! {
1818
}
1919
}
2020

21-
impl ToGlib for Flags {
21+
impl IntoGlib for Flags {
2222
type GlibType = ffi::ExFlags;
2323

24-
fn to_glib(&self) -> ffi::ExFlags {
24+
fn into_glib(self) -> ffi::ExFlags {
2525
self.bits()
2626
}
2727
}

src/foo/imp.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ impl ObjectImpl for Foo {
7171
glib::Type::UNIT.into(),
7272
)
7373
.class_handler(|_, args| {
74-
let obj = args[0].get::<glib::Object>().unwrap().unwrap();
75-
let val = args[1].get::<i32>().unwrap().unwrap();
76-
let inc = args[2].get::<i32>().unwrap().unwrap();
74+
let obj = args[0].get::<glib::Object>().unwrap();
75+
let val = args[1].get::<i32>().unwrap();
76+
let inc = args[2].get::<i32>().unwrap();
7777

7878
unsafe {
7979
let klass = &*(obj.object_class() as *const _ as *const FooClass);
@@ -219,7 +219,7 @@ pub(crate) mod ffi {
219219

220220
#[no_mangle]
221221
pub extern "C" fn ex_foo_get_type() -> glib::ffi::GType {
222-
<super::Foo as glib::subclass::types::ObjectSubclassType>::type_().to_glib()
222+
<super::super::Foo as glib::StaticType>::static_type().into_glib()
223223
}
224224
}
225225

src/foo/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl<O: IsA<Foo>> FooExt for O {
5959
}
6060

6161
fn property_name(&self) -> Option<String> {
62-
let mut value = glib::Value::from(None::<&str>);
62+
let mut value = glib::Value::for_value_type::<&str>();
6363
unsafe {
6464
glib::gobject_ffi::g_object_get_property(
6565
self.as_ptr() as *mut glib::gobject_ffi::GObject,

src/nameable/imp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl NameableInterface {
4848
}
4949

5050
pub(crate) mod ffi {
51-
use glib::translate::ToGlib;
51+
use glib::translate::IntoGlib;
5252
use libc::c_char;
5353
use std::ptr;
5454

@@ -58,7 +58,7 @@ pub(crate) mod ffi {
5858
#[no_mangle]
5959
pub extern "C" fn ex_nameable_get_type() -> glib::ffi::GType {
6060
<super::NameableInterface as glib::subclass::interface::ObjectInterfaceType>::type_()
61-
.to_glib()
61+
.into_glib()
6262
}
6363

6464
// Virtual method callers

0 commit comments

Comments
 (0)