@@ -61,6 +61,10 @@ pub trait IMContextImpl: IMContextImplExt + ObjectImpl {
61
61
fn set_use_preedit ( & self , use_preedit : bool ) {
62
62
self . parent_set_use_preedit ( use_preedit)
63
63
}
64
+ #[ cfg( any( feature = "v4_10" , feature = "dox" ) ) ]
65
+ fn activate_osk ( & self ) {
66
+ self . parent_activate_osk ( )
67
+ }
64
68
}
65
69
66
70
#[ allow( clippy:: upper_case_acronyms) ]
@@ -81,6 +85,8 @@ pub trait IMContextImplExt: ObjectSubclass {
81
85
fn parent_set_cursor_location ( & self , area : & gdk:: Rectangle ) ;
82
86
fn parent_set_surrounding ( & self , text : & str , cursor_index : i32 ) ;
83
87
fn parent_set_use_preedit ( & self , use_preedit : bool ) ;
88
+ #[ cfg( any( feature = "v4_10" , feature = "dox" ) ) ]
89
+ fn parent_activate_osk ( & self ) ;
84
90
}
85
91
86
92
impl < T : IMContextImpl > IMContextImplExt for T {
@@ -304,6 +310,17 @@ impl<T: IMContextImpl> IMContextImplExt for T {
304
310
}
305
311
}
306
312
}
313
+
314
+ #[ cfg( any( feature = "v4_10" , feature = "dox" ) ) ]
315
+ fn parent_activate_osk ( & self ) {
316
+ unsafe {
317
+ let data = T :: type_data ( ) ;
318
+ let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GtkIMContextClass ;
319
+ if let Some ( f) = ( * parent_class) . activate_osk {
320
+ f ( self . obj ( ) . unsafe_cast_ref :: < IMContext > ( ) . to_glib_none ( ) . 0 )
321
+ }
322
+ }
323
+ }
307
324
}
308
325
309
326
unsafe impl < T : IMContextImpl > IsSubclassable < T > for IMContext {
@@ -332,6 +349,10 @@ unsafe impl<T: IMContextImpl> IsSubclassable<T> for IMContext {
332
349
klass. set_cursor_location = Some ( im_context_set_cursor_location :: < T > ) ;
333
350
klass. set_surrounding = Some ( im_context_set_surrounding :: < T > ) ;
334
351
klass. set_use_preedit = Some ( im_context_set_use_preedit :: < T > ) ;
352
+ #[ cfg( any( feature = "v4_10" , feature = "dox" ) ) ]
353
+ {
354
+ klass. activate_osk = Some ( im_context_activate_osk :: < T > ) ;
355
+ } ;
335
356
}
336
357
}
337
358
@@ -504,3 +525,11 @@ unsafe extern "C" fn im_context_set_use_preedit<T: IMContextImpl>(
504
525
505
526
imp. set_use_preedit ( from_glib ( use_preedit) )
506
527
}
528
+
529
+ #[ cfg( any( feature = "v4_10" , feature = "dox" ) ) ]
530
+ unsafe extern "C" fn im_context_activate_osk < T : IMContextImpl > ( ptr : * mut ffi:: GtkIMContext ) {
531
+ let instance = & * ( ptr as * mut T :: Instance ) ;
532
+ let imp = instance. imp ( ) ;
533
+
534
+ imp. activate_osk ( )
535
+ }
0 commit comments