@@ -462,90 +462,6 @@ impl<'a> ToGlibPtr<'a, *mut gobject_ffi::GObject> for ObjectRef {
462
462
}
463
463
}
464
464
465
- #[ doc( hidden) ]
466
- impl < ' a > ToGlibContainerFromSlice < ' a , * mut * mut gobject_ffi:: GObject > for ObjectRef {
467
- type Storage = (
468
- Vec < Stash < ' a , * mut gobject_ffi:: GObject , ObjectRef > > ,
469
- Option < Vec < * mut gobject_ffi:: GObject > > ,
470
- ) ;
471
-
472
- fn to_glib_none_from_slice (
473
- t : & ' a [ ObjectRef ] ,
474
- ) -> ( * mut * mut gobject_ffi:: GObject , Self :: Storage ) {
475
- let v: Vec < _ > = t. iter ( ) . map ( |s| s. to_glib_none ( ) ) . collect ( ) ;
476
- let mut v_ptr: Vec < _ > = v. iter ( ) . map ( |s| s. 0 ) . collect ( ) ;
477
- v_ptr. push ( ptr:: null_mut ( ) as * mut gobject_ffi:: GObject ) ;
478
-
479
- (
480
- v_ptr. as_ptr ( ) as * mut * mut gobject_ffi:: GObject ,
481
- ( v, Some ( v_ptr) ) ,
482
- )
483
- }
484
-
485
- fn to_glib_container_from_slice (
486
- t : & ' a [ ObjectRef ] ,
487
- ) -> ( * mut * mut gobject_ffi:: GObject , Self :: Storage ) {
488
- let v: Vec < _ > = t. iter ( ) . map ( |s| s. to_glib_none ( ) ) . collect ( ) ;
489
-
490
- let v_ptr = unsafe {
491
- let v_ptr = ffi:: g_malloc0 ( mem:: size_of :: < * mut gobject_ffi:: GObject > ( ) * ( t. len ( ) + 1 ) )
492
- as * mut * mut gobject_ffi:: GObject ;
493
-
494
- for ( i, s) in v. iter ( ) . enumerate ( ) {
495
- ptr:: write ( v_ptr. add ( i) , s. 0 ) ;
496
- }
497
-
498
- v_ptr
499
- } ;
500
-
501
- ( v_ptr, ( v, None ) )
502
- }
503
-
504
- fn to_glib_full_from_slice ( t : & [ ObjectRef ] ) -> * mut * mut gobject_ffi:: GObject {
505
- unsafe {
506
- let v_ptr =
507
- ffi:: g_malloc0 ( std:: mem:: size_of :: < * mut gobject_ffi:: GObject > ( ) * ( t. len ( ) + 1 ) )
508
- as * mut * mut gobject_ffi:: GObject ;
509
-
510
- for ( i, s) in t. iter ( ) . enumerate ( ) {
511
- ptr:: write ( v_ptr. add ( i) , s. to_glib_full ( ) ) ;
512
- }
513
-
514
- v_ptr
515
- }
516
- }
517
- }
518
-
519
- #[ doc( hidden) ]
520
- impl < ' a > ToGlibContainerFromSlice < ' a , * const * mut gobject_ffi:: GObject > for ObjectRef {
521
- type Storage = (
522
- Vec < Stash < ' a , * mut gobject_ffi:: GObject , ObjectRef > > ,
523
- Option < Vec < * mut gobject_ffi:: GObject > > ,
524
- ) ;
525
-
526
- fn to_glib_none_from_slice (
527
- t : & ' a [ ObjectRef ] ,
528
- ) -> ( * const * mut gobject_ffi:: GObject , Self :: Storage ) {
529
- let ( ptr, stash) =
530
- ToGlibContainerFromSlice :: < ' a , * mut * mut gobject_ffi:: GObject > :: to_glib_none_from_slice (
531
- t,
532
- ) ;
533
- ( ptr as * const * mut gobject_ffi:: GObject , stash)
534
- }
535
-
536
- fn to_glib_container_from_slice (
537
- _: & ' a [ ObjectRef ] ,
538
- ) -> ( * const * mut gobject_ffi:: GObject , Self :: Storage ) {
539
- // Can't have consumer free a *const pointer
540
- unimplemented ! ( )
541
- }
542
-
543
- fn to_glib_full_from_slice ( _: & [ ObjectRef ] ) -> * const * mut gobject_ffi:: GObject {
544
- // Can't have consumer free a *const pointer
545
- unimplemented ! ( )
546
- }
547
- }
548
-
549
465
#[ doc( hidden) ]
550
466
impl FromGlibPtrNone < * mut gobject_ffi:: GObject > for ObjectRef {
551
467
#[ inline]
@@ -603,122 +519,6 @@ impl FromGlibPtrBorrow<*const gobject_ffi::GObject> for ObjectRef {
603
519
}
604
520
}
605
521
606
- #[ doc( hidden) ]
607
- impl FromGlibContainerAsVec < * mut gobject_ffi:: GObject , * mut * mut gobject_ffi:: GObject >
608
- for ObjectRef
609
- {
610
- unsafe fn from_glib_none_num_as_vec (
611
- ptr : * mut * mut gobject_ffi:: GObject ,
612
- num : usize ,
613
- ) -> Vec < Self > {
614
- if num == 0 || ptr. is_null ( ) {
615
- return Vec :: new ( ) ;
616
- }
617
-
618
- // Attention: This takes ownership of floating references!
619
- let mut res = Vec :: with_capacity ( num) ;
620
- for i in 0 ..num {
621
- res. push ( from_glib_none ( ptr:: read ( ptr. add ( i) ) ) ) ;
622
- }
623
- res
624
- }
625
-
626
- unsafe fn from_glib_container_num_as_vec (
627
- ptr : * mut * mut gobject_ffi:: GObject ,
628
- num : usize ,
629
- ) -> Vec < Self > {
630
- // Attention: This takes ownership of floating references!
631
- let res = FromGlibContainerAsVec :: from_glib_none_num_as_vec ( ptr, num) ;
632
- ffi:: g_free ( ptr as * mut _ ) ;
633
- res
634
- }
635
-
636
- unsafe fn from_glib_full_num_as_vec (
637
- ptr : * mut * mut gobject_ffi:: GObject ,
638
- num : usize ,
639
- ) -> Vec < Self > {
640
- if num == 0 || ptr. is_null ( ) {
641
- ffi:: g_free ( ptr as * mut _ ) ;
642
- return Vec :: new ( ) ;
643
- }
644
-
645
- let mut res = Vec :: with_capacity ( num) ;
646
- for i in 0 ..num {
647
- res. push ( from_glib_full ( ptr:: read ( ptr. add ( i) ) ) ) ;
648
- }
649
- ffi:: g_free ( ptr as * mut _ ) ;
650
- res
651
- }
652
- }
653
-
654
- #[ doc( hidden) ]
655
- impl FromGlibPtrArrayContainerAsVec < * mut gobject_ffi:: GObject , * mut * mut gobject_ffi:: GObject >
656
- for ObjectRef
657
- {
658
- unsafe fn from_glib_none_as_vec ( ptr : * mut * mut gobject_ffi:: GObject ) -> Vec < Self > {
659
- // Attention: This takes ownership of floating references!
660
- FromGlibContainerAsVec :: from_glib_none_num_as_vec ( ptr, c_ptr_array_len ( ptr) )
661
- }
662
-
663
- unsafe fn from_glib_container_as_vec ( ptr : * mut * mut gobject_ffi:: GObject ) -> Vec < Self > {
664
- // Attention: This takes ownership of floating references!
665
- FromGlibContainerAsVec :: from_glib_container_num_as_vec ( ptr, c_ptr_array_len ( ptr) )
666
- }
667
-
668
- unsafe fn from_glib_full_as_vec ( ptr : * mut * mut gobject_ffi:: GObject ) -> Vec < Self > {
669
- FromGlibContainerAsVec :: from_glib_full_num_as_vec ( ptr, c_ptr_array_len ( ptr) )
670
- }
671
- }
672
-
673
- #[ doc( hidden) ]
674
- impl FromGlibContainerAsVec < * mut gobject_ffi:: GObject , * const * mut gobject_ffi:: GObject >
675
- for ObjectRef
676
- {
677
- unsafe fn from_glib_none_num_as_vec (
678
- ptr : * const * mut gobject_ffi:: GObject ,
679
- num : usize ,
680
- ) -> Vec < Self > {
681
- // Attention: This takes ownership of floating references!
682
- FromGlibContainerAsVec :: from_glib_none_num_as_vec ( ptr as * mut * mut _ , num)
683
- }
684
-
685
- unsafe fn from_glib_container_num_as_vec (
686
- _: * const * mut gobject_ffi:: GObject ,
687
- _: usize ,
688
- ) -> Vec < Self > {
689
- // Can't free a *const
690
- unimplemented ! ( )
691
- }
692
-
693
- unsafe fn from_glib_full_num_as_vec (
694
- _: * const * mut gobject_ffi:: GObject ,
695
- _: usize ,
696
- ) -> Vec < Self > {
697
- // Can't free a *const
698
- unimplemented ! ( )
699
- }
700
- }
701
-
702
- #[ doc( hidden) ]
703
- impl FromGlibPtrArrayContainerAsVec < * mut gobject_ffi:: GObject , * const * mut gobject_ffi:: GObject >
704
- for ObjectRef
705
- {
706
- unsafe fn from_glib_none_as_vec ( ptr : * const * mut gobject_ffi:: GObject ) -> Vec < Self > {
707
- // Attention: This takes ownership of floating references!
708
- FromGlibPtrArrayContainerAsVec :: from_glib_none_as_vec ( ptr as * mut * mut _ )
709
- }
710
-
711
- unsafe fn from_glib_container_as_vec ( _: * const * mut gobject_ffi:: GObject ) -> Vec < Self > {
712
- // Can't free a *const
713
- unimplemented ! ( )
714
- }
715
-
716
- unsafe fn from_glib_full_as_vec ( _: * const * mut gobject_ffi:: GObject ) -> Vec < Self > {
717
- // Can't free a *const
718
- unimplemented ! ( )
719
- }
720
- }
721
-
722
522
#[ repr( transparent) ]
723
523
pub struct TypedObjectRef < T , P > {
724
524
inner : ObjectRef ,
0 commit comments