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

Commit 051511a

Browse files
committed
Add bindings for GInitiallyUnowned
This will never directly appear anywhere in use apart from defining new subclasses that inherit from GInitiallyUnowned directly, i.e. classes that use floating references. This should only really ever be used for compatibility with C code. Floating references cause hard to debug problems and are meaningless for bindings.
1 parent 300fa04 commit 051511a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ pub use object::{
104104
Object,
105105
ObjectExt,
106106
ObjectClass,
107+
InitiallyUnowned,
108+
InitiallyUnownedClass,
107109
WeakRef,
108110
SendWeakRef,
109111
};

src/object.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,6 +1303,14 @@ impl ObjectClass {
13031303
}
13041304
}
13051305

1306+
glib_wrapper! {
1307+
pub struct InitiallyUnowned(Object<gobject_ffi::GInitiallyUnowned, gobject_ffi::GInitiallyUnownedClass, InitiallyUnownedClass>);
1308+
1309+
match fn {
1310+
get_type => || gobject_ffi::g_initially_unowned_get_type(),
1311+
}
1312+
}
1313+
13061314
pub struct WeakRef<T: ObjectType>(Box<gobject_ffi::GWeakRef>, PhantomData<*const T>);
13071315

13081316
impl<T: ObjectType> WeakRef<T> {

0 commit comments

Comments
 (0)