@@ -20,7 +20,7 @@ glib::wrapper! {
2020 pub struct Foo ( Object <ffi:: ExFoo , ffi:: ExFooClass >) @implements Nameable ;
2121
2222 match fn {
23- get_type => || ffi:: ex_foo_get_type( ) ,
23+ type_ => || ffi:: ex_foo_get_type( ) ,
2424 }
2525}
2626
@@ -37,10 +37,10 @@ impl Foo {
3737
3838pub trait FooExt {
3939 fn increment ( & self , inc : i32 ) -> i32 ;
40- fn get_counter ( & self ) -> i32 ;
41- fn get_name ( & self ) -> Option < String > ;
40+ fn counter ( & self ) -> i32 ;
41+ fn name ( & self ) -> Option < String > ;
4242
43- fn get_property_name ( & self ) -> Option < String > ;
43+ fn property_name ( & self ) -> Option < String > ;
4444
4545 fn connect_incremented < F : Fn ( & Self , i32 , i32 ) + ' static > ( & self , f : F ) -> SignalHandlerId ;
4646}
@@ -50,15 +50,15 @@ impl<O: IsA<Foo>> FooExt for O {
5050 unsafe { ffi:: ex_foo_increment ( self . as_ref ( ) . to_glib_none ( ) . 0 , inc) }
5151 }
5252
53- fn get_counter ( & self ) -> i32 {
53+ fn counter ( & self ) -> i32 {
5454 unsafe { ffi:: ex_foo_get_counter ( self . as_ref ( ) . to_glib_none ( ) . 0 ) }
5555 }
5656
57- fn get_name ( & self ) -> Option < String > {
57+ fn name ( & self ) -> Option < String > {
5858 unsafe { from_glib_full ( ffi:: ex_foo_get_name ( self . as_ref ( ) . to_glib_none ( ) . 0 ) ) }
5959 }
6060
61- fn get_property_name ( & self ) -> Option < String > {
61+ fn property_name ( & self ) -> Option < String > {
6262 let mut value = glib:: Value :: from ( None :: < & str > ) ;
6363 unsafe {
6464 glib:: gobject_ffi:: g_object_get_property (
@@ -112,7 +112,7 @@ pub trait FooImpl: ObjectImpl + 'static {
112112 fn parent_increment ( & self , obj : & Foo , inc : i32 ) -> i32 {
113113 unsafe {
114114 let data = Self :: type_data ( ) ;
115- let parent_class = data. as_ref ( ) . get_parent_class ( ) as * mut ffi:: ExFooClass ;
115+ let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: ExFooClass ;
116116 if let Some ( ref f) = ( * parent_class) . increment {
117117 f ( obj. to_glib_none ( ) . 0 , inc)
118118 } else {
@@ -124,7 +124,7 @@ pub trait FooImpl: ObjectImpl + 'static {
124124 fn parent_incremented ( & self , obj : & Foo , val : i32 , inc : i32 ) {
125125 unsafe {
126126 let data = Self :: type_data ( ) ;
127- let parent_class = data. as_ref ( ) . get_parent_class ( ) as * mut ffi:: ExFooClass ;
127+ let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: ExFooClass ;
128128 if let Some ( ref f) = ( * parent_class) . incremented {
129129 f ( obj. to_glib_none ( ) . 0 , val, inc)
130130 }
@@ -151,7 +151,7 @@ where
151151 T : FooImpl ,
152152{
153153 let instance = & * ( this as * const T :: Instance ) ;
154- let imp = instance. get_impl ( ) ;
154+ let imp = instance. impl_ ( ) ;
155155 imp. increment ( & from_glib_borrow ( this) , inc)
156156}
157157
@@ -163,7 +163,7 @@ unsafe extern "C" fn incremented_trampoline<T: ObjectSubclass>(
163163 T : FooImpl ,
164164{
165165 let instance = & * ( this as * const T :: Instance ) ;
166- let imp = instance. get_impl ( ) ;
166+ let imp = instance. impl_ ( ) ;
167167 imp. incremented ( & from_glib_borrow ( this) , val, inc) ;
168168}
169169
@@ -190,20 +190,20 @@ mod tests {
190190 * incremented_clone. borrow_mut ( ) = ( val, inc) ;
191191 } ) ;
192192
193- assert_eq ! ( foo. get_counter ( ) , 0 ) ;
193+ assert_eq ! ( foo. counter ( ) , 0 ) ;
194194 assert_eq ! ( foo. increment( 1 ) , 1 ) ;
195195 assert_eq ! ( * incremented. borrow( ) , ( 1 , 1 ) ) ;
196- assert_eq ! ( foo. get_counter ( ) , 1 ) ;
196+ assert_eq ! ( foo. counter ( ) , 1 ) ;
197197 assert_eq ! ( foo. increment( 10 ) , 11 ) ;
198198 assert_eq ! ( * incremented. borrow( ) , ( 11 , 10 ) ) ;
199- assert_eq ! ( foo. get_counter ( ) , 11 ) ;
199+ assert_eq ! ( foo. counter ( ) , 11 ) ;
200200 }
201201
202202 #[ test]
203203 fn test_name ( ) {
204204 let foo = Foo :: new ( Some ( "foo's name" ) ) ;
205205
206- assert_eq ! ( foo. get_name ( ) , Some ( "foo's name" . into( ) ) ) ;
207- assert_eq ! ( foo. get_property_name ( ) , Some ( "foo's name" . into( ) ) ) ;
206+ assert_eq ! ( foo. name ( ) , Some ( "foo's name" . into( ) ) ) ;
207+ assert_eq ! ( foo. property_name ( ) , Some ( "foo's name" . into( ) ) ) ;
208208 }
209209}
0 commit comments