@@ -522,6 +522,19 @@ pub(crate) unsafe fn add_signal(
522
522
) ;
523
523
}
524
524
525
+ #[ repr( C ) ]
526
+ pub struct SignalInvocationHint ( gobject_ffi:: GSignalInvocationHint ) ;
527
+
528
+ impl SignalInvocationHint {
529
+ pub fn detail ( & self ) -> :: Quark {
530
+ from_glib ( self . 0 . detail )
531
+ }
532
+
533
+ pub fn run_type ( & self ) -> SignalFlags {
534
+ from_glib ( self . 0 . run_type )
535
+ }
536
+ }
537
+
525
538
pub ( crate ) unsafe fn add_signal_with_accumulator < F > (
526
539
type_ : ffi:: GType ,
527
540
name : & str ,
@@ -530,22 +543,23 @@ pub(crate) unsafe fn add_signal_with_accumulator<F>(
530
543
ret_type : Type ,
531
544
accumulator : F ,
532
545
) where
533
- F : Fn ( & mut Value , & Value ) -> bool + Send + Sync + ' static ,
546
+ F : Fn ( & SignalInvocationHint , & mut Value , & Value ) -> bool + Send + Sync + ' static ,
534
547
{
535
548
let arg_types = arg_types. iter ( ) . map ( |t| t. to_glib ( ) ) . collect :: < Vec < _ > > ( ) ;
536
549
537
550
let accumulator: Box < F > = Box :: new ( accumulator) ;
538
551
539
552
unsafe extern "C" fn accumulator_trampoline <
540
- F : Fn ( & mut Value , & Value ) -> bool + Send + Sync + ' static ,
553
+ F : Fn ( & SignalInvocationHint , & mut Value , & Value ) -> bool + Send + Sync + ' static ,
541
554
> (
542
- _ihint : * mut gobject_ffi:: GSignalInvocationHint ,
555
+ ihint : * mut gobject_ffi:: GSignalInvocationHint ,
543
556
return_accu : * mut gobject_ffi:: GValue ,
544
557
handler_return : * const gobject_ffi:: GValue ,
545
558
data : ffi:: gpointer ,
546
559
) -> ffi:: gboolean {
547
560
let accumulator: & F = & * ( data as * const & F ) ;
548
561
accumulator (
562
+ & SignalInvocationHint ( * ihint) ,
549
563
& mut * ( return_accu as * mut Value ) ,
550
564
& * ( handler_return as * const Value ) ,
551
565
)
@@ -603,23 +617,24 @@ pub(crate) unsafe fn add_signal_with_class_handler_and_accumulator<F, G>(
603
617
accumulator : G ,
604
618
) where
605
619
F : Fn ( & [ Value ] ) -> Option < Value > + Send + Sync + ' static ,
606
- G : Fn ( & mut Value , & Value ) -> bool + Send + Sync + ' static ,
620
+ G : Fn ( & SignalInvocationHint , & mut Value , & Value ) -> bool + Send + Sync + ' static ,
607
621
{
608
622
let arg_types = arg_types. iter ( ) . map ( |t| t. to_glib ( ) ) . collect :: < Vec < _ > > ( ) ;
609
623
610
624
let class_handler = Closure :: new ( class_handler) ;
611
625
let accumulator: Box < G > = Box :: new ( accumulator) ;
612
626
613
627
unsafe extern "C" fn accumulator_trampoline <
614
- G : Fn ( & mut Value , & Value ) -> bool + Send + Sync + ' static ,
628
+ G : Fn ( & SignalInvocationHint , & mut Value , & Value ) -> bool + Send + Sync + ' static ,
615
629
> (
616
- _ihint : * mut gobject_ffi:: GSignalInvocationHint ,
630
+ ihint : * mut gobject_ffi:: GSignalInvocationHint ,
617
631
return_accu : * mut gobject_ffi:: GValue ,
618
632
handler_return : * const gobject_ffi:: GValue ,
619
633
data : ffi:: gpointer ,
620
634
) -> ffi:: gboolean {
621
635
let accumulator: & G = & * ( data as * const & G ) ;
622
636
accumulator (
637
+ & SignalInvocationHint ( * ihint) ,
623
638
& mut * ( return_accu as * mut Value ) ,
624
639
& * ( handler_return as * const Value ) ,
625
640
)
0 commit comments