1use crate::{Layer, RelationSet, RelationType, Role, State, StateSet, ffi};
6use glib::{
7 object::ObjectType as _,
8 prelude::*,
9 signal::{SignalHandlerId, connect_raw},
10 translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15 #[doc(alias = "AtkObject")]
206 pub struct Object(Object<ffi::AtkObject, ffi::AtkObjectClass>);
207
208 match fn {
209 type_ => || ffi::atk_object_get_type(),
210 }
211}
212
213impl Object {
214 pub const NONE: Option<&'static Object> = None;
215}
216
217pub trait AtkObjectExt: IsA<Object> + 'static {
223 #[doc(alias = "atk_object_add_relationship")]
233 fn add_relationship(&self, relationship: RelationType, target: &impl IsA<Object>) -> bool {
234 unsafe {
235 from_glib(ffi::atk_object_add_relationship(
236 self.as_ref().to_glib_none().0,
237 relationship.into_glib(),
238 target.as_ref().to_glib_none().0,
239 ))
240 }
241 }
242
243 #[cfg(feature = "v2_34")]
250 #[cfg_attr(docsrs, doc(cfg(feature = "v2_34")))]
251 #[doc(alias = "atk_object_get_accessible_id")]
252 #[doc(alias = "get_accessible_id")]
253 #[doc(alias = "accessible-id")]
254 fn accessible_id(&self) -> Option<glib::GString> {
255 unsafe {
256 from_glib_none(ffi::atk_object_get_accessible_id(
257 self.as_ref().to_glib_none().0,
258 ))
259 }
260 }
261
262 #[doc(alias = "atk_object_get_description")]
269 #[doc(alias = "get_description")]
270 fn description(&self) -> Option<glib::GString> {
271 unsafe {
272 from_glib_none(ffi::atk_object_get_description(
273 self.as_ref().to_glib_none().0,
274 ))
275 }
276 }
277
278 #[cfg(feature = "v2_52")]
285 #[cfg_attr(docsrs, doc(cfg(feature = "v2_52")))]
286 #[doc(alias = "atk_object_get_help_text")]
287 #[doc(alias = "get_help_text")]
288 fn help_text(&self) -> Option<glib::GString> {
289 unsafe {
290 from_glib_none(ffi::atk_object_get_help_text(
291 self.as_ref().to_glib_none().0,
292 ))
293 }
294 }
295
296 #[doc(alias = "atk_object_get_index_in_parent")]
303 #[doc(alias = "get_index_in_parent")]
304 fn index_in_parent(&self) -> i32 {
305 unsafe { ffi::atk_object_get_index_in_parent(self.as_ref().to_glib_none().0) }
306 }
307
308 #[doc(alias = "atk_object_get_layer")]
318 #[doc(alias = "get_layer")]
319 fn layer(&self) -> Layer {
320 unsafe { from_glib(ffi::atk_object_get_layer(self.as_ref().to_glib_none().0)) }
321 }
322
323 #[doc(alias = "atk_object_get_mdi_zorder")]
336 #[doc(alias = "get_mdi_zorder")]
337 fn mdi_zorder(&self) -> i32 {
338 unsafe { ffi::atk_object_get_mdi_zorder(self.as_ref().to_glib_none().0) }
339 }
340
341 #[doc(alias = "atk_object_get_n_accessible_children")]
348 #[doc(alias = "get_n_accessible_children")]
349 fn n_accessible_children(&self) -> i32 {
350 unsafe { ffi::atk_object_get_n_accessible_children(self.as_ref().to_glib_none().0) }
351 }
352
353 #[doc(alias = "atk_object_get_name")]
359 #[doc(alias = "get_name")]
360 fn name(&self) -> Option<glib::GString> {
361 unsafe { from_glib_none(ffi::atk_object_get_name(self.as_ref().to_glib_none().0)) }
362 }
363
364 #[doc(alias = "atk_object_get_object_locale")]
372 #[doc(alias = "get_object_locale")]
373 fn object_locale(&self) -> Option<glib::GString> {
374 unsafe {
375 from_glib_none(ffi::atk_object_get_object_locale(
376 self.as_ref().to_glib_none().0,
377 ))
378 }
379 }
380
381 #[doc(alias = "atk_object_get_parent")]
395 #[doc(alias = "get_parent")]
396 #[must_use]
397 fn parent(&self) -> Option<Object> {
398 unsafe { from_glib_none(ffi::atk_object_get_parent(self.as_ref().to_glib_none().0)) }
399 }
400
401 #[doc(alias = "atk_object_get_role")]
407 #[doc(alias = "get_role")]
408 fn role(&self) -> Role {
409 unsafe { from_glib(ffi::atk_object_get_role(self.as_ref().to_glib_none().0)) }
410 }
411
412 #[doc(alias = "atk_object_notify_state_change")]
426 fn notify_state_change(&self, state: State, value: bool) {
427 unsafe {
428 ffi::atk_object_notify_state_change(
429 self.as_ref().to_glib_none().0,
430 state,
431 value.into_glib(),
432 );
433 }
434 }
435
436 #[doc(alias = "atk_object_peek_parent")]
449 #[must_use]
450 fn peek_parent(&self) -> Option<Object> {
451 unsafe { from_glib_none(ffi::atk_object_peek_parent(self.as_ref().to_glib_none().0)) }
452 }
453
454 #[doc(alias = "atk_object_ref_accessible_child")]
465 #[must_use]
466 fn ref_accessible_child(&self, i: i32) -> Option<Object> {
467 unsafe {
468 from_glib_full(ffi::atk_object_ref_accessible_child(
469 self.as_ref().to_glib_none().0,
470 i,
471 ))
472 }
473 }
474
475 #[doc(alias = "atk_object_ref_relation_set")]
482 fn ref_relation_set(&self) -> Option<RelationSet> {
483 unsafe {
484 from_glib_full(ffi::atk_object_ref_relation_set(
485 self.as_ref().to_glib_none().0,
486 ))
487 }
488 }
489
490 #[doc(alias = "atk_object_ref_state_set")]
498 fn ref_state_set(&self) -> Option<StateSet> {
499 unsafe {
500 from_glib_full(ffi::atk_object_ref_state_set(
501 self.as_ref().to_glib_none().0,
502 ))
503 }
504 }
505
506 #[doc(alias = "atk_object_remove_relationship")]
516 fn remove_relationship(&self, relationship: RelationType, target: &impl IsA<Object>) -> bool {
517 unsafe {
518 from_glib(ffi::atk_object_remove_relationship(
519 self.as_ref().to_glib_none().0,
520 relationship.into_glib(),
521 target.as_ref().to_glib_none().0,
522 ))
523 }
524 }
525
526 #[cfg(feature = "v2_34")]
534 #[cfg_attr(docsrs, doc(cfg(feature = "v2_34")))]
535 #[doc(alias = "atk_object_set_accessible_id")]
536 #[doc(alias = "accessible-id")]
537 fn set_accessible_id(&self, id: &str) {
538 unsafe {
539 ffi::atk_object_set_accessible_id(self.as_ref().to_glib_none().0, id.to_glib_none().0);
540 }
541 }
542
543 #[doc(alias = "atk_object_set_description")]
550 fn set_description(&self, description: &str) {
551 unsafe {
552 ffi::atk_object_set_description(
553 self.as_ref().to_glib_none().0,
554 description.to_glib_none().0,
555 );
556 }
557 }
558
559 #[cfg(feature = "v2_52")]
567 #[cfg_attr(docsrs, doc(cfg(feature = "v2_52")))]
568 #[doc(alias = "atk_object_set_help_text")]
569 fn set_help_text(&self, help_text: &str) {
570 unsafe {
571 ffi::atk_object_set_help_text(
572 self.as_ref().to_glib_none().0,
573 help_text.to_glib_none().0,
574 );
575 }
576 }
577
578 #[doc(alias = "atk_object_set_name")]
585 fn set_name(&self, name: &str) {
586 unsafe {
587 ffi::atk_object_set_name(self.as_ref().to_glib_none().0, name.to_glib_none().0);
588 }
589 }
590
591 #[doc(alias = "atk_object_set_parent")]
595 fn set_parent(&self, parent: &impl IsA<Object>) {
596 unsafe {
597 ffi::atk_object_set_parent(
598 self.as_ref().to_glib_none().0,
599 parent.as_ref().to_glib_none().0,
600 );
601 }
602 }
603
604 #[doc(alias = "atk_object_set_role")]
608 fn set_role(&self, role: Role) {
609 unsafe {
610 ffi::atk_object_set_role(self.as_ref().to_glib_none().0, role.into_glib());
611 }
612 }
613
614 #[doc(alias = "accessible-component-layer")]
615 fn accessible_component_layer(&self) -> i32 {
616 ObjectExt::property(self.as_ref(), "accessible-component-layer")
617 }
618
619 #[doc(alias = "accessible-component-mdi-zorder")]
620 fn accessible_component_mdi_zorder(&self) -> i32 {
621 ObjectExt::property(self.as_ref(), "accessible-component-mdi-zorder")
622 }
623
624 #[doc(alias = "accessible-description")]
625 fn accessible_description(&self) -> Option<glib::GString> {
626 ObjectExt::property(self.as_ref(), "accessible-description")
627 }
628
629 #[doc(alias = "accessible-description")]
630 fn set_accessible_description(&self, accessible_description: Option<&str>) {
631 ObjectExt::set_property(
632 self.as_ref(),
633 "accessible-description",
634 accessible_description,
635 )
636 }
637
638 #[doc(alias = "accessible-help-text")]
639 fn accessible_help_text(&self) -> Option<glib::GString> {
640 ObjectExt::property(self.as_ref(), "accessible-help-text")
641 }
642
643 #[doc(alias = "accessible-help-text")]
644 fn set_accessible_help_text(&self, accessible_help_text: Option<&str>) {
645 ObjectExt::set_property(self.as_ref(), "accessible-help-text", accessible_help_text)
646 }
647
648 #[doc(alias = "accessible-hypertext-nlinks")]
649 fn accessible_hypertext_nlinks(&self) -> i32 {
650 ObjectExt::property(self.as_ref(), "accessible-hypertext-nlinks")
651 }
652
653 #[cfg(not(feature = "v2_34"))]
654 #[cfg_attr(docsrs, doc(cfg(not(feature = "v2_34"))))]
655 #[doc(alias = "accessible-id")]
656 fn accessible_id(&self) -> Option<glib::GString> {
657 ObjectExt::property(self.as_ref(), "accessible-id")
658 }
659
660 #[cfg(not(feature = "v2_34"))]
661 #[cfg_attr(docsrs, doc(cfg(not(feature = "v2_34"))))]
662 #[doc(alias = "accessible-id")]
663 fn set_accessible_id(&self, accessible_id: Option<&str>) {
664 ObjectExt::set_property(self.as_ref(), "accessible-id", accessible_id)
665 }
666
667 #[doc(alias = "accessible-name")]
668 fn accessible_name(&self) -> Option<glib::GString> {
669 ObjectExt::property(self.as_ref(), "accessible-name")
670 }
671
672 #[doc(alias = "accessible-name")]
673 fn set_accessible_name(&self, accessible_name: Option<&str>) {
674 ObjectExt::set_property(self.as_ref(), "accessible-name", accessible_name)
675 }
676
677 #[doc(alias = "accessible-parent")]
678 fn accessible_parent(&self) -> Option<Object> {
679 ObjectExt::property(self.as_ref(), "accessible-parent")
680 }
681
682 #[doc(alias = "accessible-parent")]
683 fn set_accessible_parent<P: IsA<Object>>(&self, accessible_parent: Option<&P>) {
684 ObjectExt::set_property(self.as_ref(), "accessible-parent", accessible_parent)
685 }
686
687 #[doc(alias = "accessible-role")]
688 fn accessible_role(&self) -> Role {
689 ObjectExt::property(self.as_ref(), "accessible-role")
690 }
691
692 #[doc(alias = "accessible-role")]
693 fn set_accessible_role(&self, accessible_role: Role) {
694 ObjectExt::set_property(self.as_ref(), "accessible-role", accessible_role)
695 }
696
697 #[doc(alias = "accessible-table-caption")]
703 fn accessible_table_caption(&self) -> Option<glib::GString> {
704 ObjectExt::property(self.as_ref(), "accessible-table-caption")
705 }
706
707 #[doc(alias = "accessible-table-caption")]
713 fn set_accessible_table_caption(&self, accessible_table_caption: Option<&str>) {
714 ObjectExt::set_property(
715 self.as_ref(),
716 "accessible-table-caption",
717 accessible_table_caption,
718 )
719 }
720
721 #[doc(alias = "accessible-table-caption-object")]
722 fn accessible_table_caption_object(&self) -> Option<Object> {
723 ObjectExt::property(self.as_ref(), "accessible-table-caption-object")
724 }
725
726 #[doc(alias = "accessible-table-caption-object")]
727 fn set_accessible_table_caption_object<P: IsA<Object>>(
728 &self,
729 accessible_table_caption_object: Option<&P>,
730 ) {
731 ObjectExt::set_property(
732 self.as_ref(),
733 "accessible-table-caption-object",
734 accessible_table_caption_object,
735 )
736 }
737
738 #[doc(alias = "accessible-table-column-description")]
745 fn accessible_table_column_description(&self) -> Option<glib::GString> {
746 ObjectExt::property(self.as_ref(), "accessible-table-column-description")
747 }
748
749 #[doc(alias = "accessible-table-column-description")]
756 fn set_accessible_table_column_description(
757 &self,
758 accessible_table_column_description: Option<&str>,
759 ) {
760 ObjectExt::set_property(
761 self.as_ref(),
762 "accessible-table-column-description",
763 accessible_table_column_description,
764 )
765 }
766
767 #[doc(alias = "accessible-table-column-header")]
774 fn accessible_table_column_header(&self) -> Option<Object> {
775 ObjectExt::property(self.as_ref(), "accessible-table-column-header")
776 }
777
778 #[doc(alias = "accessible-table-column-header")]
785 fn set_accessible_table_column_header<P: IsA<Object>>(
786 &self,
787 accessible_table_column_header: Option<&P>,
788 ) {
789 ObjectExt::set_property(
790 self.as_ref(),
791 "accessible-table-column-header",
792 accessible_table_column_header,
793 )
794 }
795
796 #[doc(alias = "accessible-table-row-description")]
803 fn accessible_table_row_description(&self) -> Option<glib::GString> {
804 ObjectExt::property(self.as_ref(), "accessible-table-row-description")
805 }
806
807 #[doc(alias = "accessible-table-row-description")]
814 fn set_accessible_table_row_description(&self, accessible_table_row_description: Option<&str>) {
815 ObjectExt::set_property(
816 self.as_ref(),
817 "accessible-table-row-description",
818 accessible_table_row_description,
819 )
820 }
821
822 #[doc(alias = "accessible-table-row-header")]
829 fn accessible_table_row_header(&self) -> Option<Object> {
830 ObjectExt::property(self.as_ref(), "accessible-table-row-header")
831 }
832
833 #[doc(alias = "accessible-table-row-header")]
840 fn set_accessible_table_row_header<P: IsA<Object>>(
841 &self,
842 accessible_table_row_header: Option<&P>,
843 ) {
844 ObjectExt::set_property(
845 self.as_ref(),
846 "accessible-table-row-header",
847 accessible_table_row_header,
848 )
849 }
850
851 #[doc(alias = "accessible-table-summary")]
852 fn accessible_table_summary(&self) -> Option<Object> {
853 ObjectExt::property(self.as_ref(), "accessible-table-summary")
854 }
855
856 #[doc(alias = "accessible-table-summary")]
857 fn set_accessible_table_summary<P: IsA<Object>>(&self, accessible_table_summary: Option<&P>) {
858 ObjectExt::set_property(
859 self.as_ref(),
860 "accessible-table-summary",
861 accessible_table_summary,
862 )
863 }
864
865 #[doc(alias = "accessible-value")]
873 fn accessible_value(&self) -> f64 {
874 ObjectExt::property(self.as_ref(), "accessible-value")
875 }
876
877 #[doc(alias = "accessible-value")]
885 fn set_accessible_value(&self, accessible_value: f64) {
886 ObjectExt::set_property(self.as_ref(), "accessible-value", accessible_value)
887 }
888
889 #[doc(alias = "active-descendant-changed")]
896 fn connect_active_descendant_changed<F: Fn(&Self, &Object) + 'static>(
897 &self,
898 detail: Option<&str>,
899 f: F,
900 ) -> SignalHandlerId {
901 unsafe extern "C" fn active_descendant_changed_trampoline<
902 P: IsA<Object>,
903 F: Fn(&P, &Object) + 'static,
904 >(
905 this: *mut ffi::AtkObject,
906 arg1: *mut ffi::AtkObject,
907 f: glib::ffi::gpointer,
908 ) {
909 unsafe {
910 let f: &F = &*(f as *const F);
911 f(
912 Object::from_glib_borrow(this).unsafe_cast_ref(),
913 &from_glib_borrow(arg1),
914 )
915 }
916 }
917 unsafe {
918 let f: Box_<F> = Box_::new(f);
919 let detailed_signal_name =
920 detail.map(|name| format!("active-descendant-changed::{name}\0"));
921 let signal_name = detailed_signal_name
922 .as_ref()
923 .map_or(c"active-descendant-changed", |n| {
924 std::ffi::CStr::from_bytes_with_nul_unchecked(n.as_bytes())
925 });
926 connect_raw(
927 self.as_ptr() as *mut _,
928 signal_name.as_ptr(),
929 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
930 active_descendant_changed_trampoline::<Self, F> as *const (),
931 )),
932 Box_::into_raw(f),
933 )
934 }
935 }
936
937 #[cfg(feature = "v2_46")]
944 #[cfg_attr(docsrs, doc(cfg(feature = "v2_46")))]
945 #[doc(alias = "announcement")]
946 fn connect_announcement<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId {
947 unsafe extern "C" fn announcement_trampoline<P: IsA<Object>, F: Fn(&P, &str) + 'static>(
948 this: *mut ffi::AtkObject,
949 arg1: *mut std::ffi::c_char,
950 f: glib::ffi::gpointer,
951 ) {
952 unsafe {
953 let f: &F = &*(f as *const F);
954 f(
955 Object::from_glib_borrow(this).unsafe_cast_ref(),
956 &glib::GString::from_glib_borrow(arg1),
957 )
958 }
959 }
960 unsafe {
961 let f: Box_<F> = Box_::new(f);
962 connect_raw(
963 self.as_ptr() as *mut _,
964 c"announcement".as_ptr(),
965 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
966 announcement_trampoline::<Self, F> as *const (),
967 )),
968 Box_::into_raw(f),
969 )
970 }
971 }
972
973 #[cfg(feature = "v2_52")]
981 #[cfg_attr(docsrs, doc(cfg(feature = "v2_52")))]
982 #[doc(alias = "attribute-changed")]
983 fn connect_attribute_changed<F: Fn(&Self, &str, &str) + 'static>(
984 &self,
985 f: F,
986 ) -> SignalHandlerId {
987 unsafe extern "C" fn attribute_changed_trampoline<
988 P: IsA<Object>,
989 F: Fn(&P, &str, &str) + 'static,
990 >(
991 this: *mut ffi::AtkObject,
992 arg1: *mut std::ffi::c_char,
993 arg2: *mut std::ffi::c_char,
994 f: glib::ffi::gpointer,
995 ) {
996 unsafe {
997 let f: &F = &*(f as *const F);
998 f(
999 Object::from_glib_borrow(this).unsafe_cast_ref(),
1000 &glib::GString::from_glib_borrow(arg1),
1001 &glib::GString::from_glib_borrow(arg2),
1002 )
1003 }
1004 }
1005 unsafe {
1006 let f: Box_<F> = Box_::new(f);
1007 connect_raw(
1008 self.as_ptr() as *mut _,
1009 c"attribute-changed".as_ptr(),
1010 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1011 attribute_changed_trampoline::<Self, F> as *const (),
1012 )),
1013 Box_::into_raw(f),
1014 )
1015 }
1016 }
1017
1018 #[doc(alias = "children-changed")]
1031 fn connect_children_changed<F: Fn(&Self, u32, &Object) + 'static>(
1032 &self,
1033 detail: Option<&str>,
1034 f: F,
1035 ) -> SignalHandlerId {
1036 unsafe extern "C" fn children_changed_trampoline<
1037 P: IsA<Object>,
1038 F: Fn(&P, u32, &Object) + 'static,
1039 >(
1040 this: *mut ffi::AtkObject,
1041 arg1: std::ffi::c_uint,
1042 arg2: *mut ffi::AtkObject,
1043 f: glib::ffi::gpointer,
1044 ) {
1045 unsafe {
1046 let f: &F = &*(f as *const F);
1047 f(
1048 Object::from_glib_borrow(this).unsafe_cast_ref(),
1049 arg1,
1050 &from_glib_borrow(arg2),
1051 )
1052 }
1053 }
1054 unsafe {
1055 let f: Box_<F> = Box_::new(f);
1056 let detailed_signal_name = detail.map(|name| format!("children-changed::{name}\0"));
1057 let signal_name = detailed_signal_name
1058 .as_ref()
1059 .map_or(c"children-changed", |n| {
1060 std::ffi::CStr::from_bytes_with_nul_unchecked(n.as_bytes())
1061 });
1062 connect_raw(
1063 self.as_ptr() as *mut _,
1064 signal_name.as_ptr(),
1065 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1066 children_changed_trampoline::<Self, F> as *const (),
1067 )),
1068 Box_::into_raw(f),
1069 )
1070 }
1071 }
1072
1073 #[cfg(feature = "v2_50")]
1081 #[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
1082 #[doc(alias = "notification")]
1083 fn connect_notification<F: Fn(&Self, &str, i32) + 'static>(&self, f: F) -> SignalHandlerId {
1084 unsafe extern "C" fn notification_trampoline<
1085 P: IsA<Object>,
1086 F: Fn(&P, &str, i32) + 'static,
1087 >(
1088 this: *mut ffi::AtkObject,
1089 arg1: *mut std::ffi::c_char,
1090 arg2: std::ffi::c_int,
1091 f: glib::ffi::gpointer,
1092 ) {
1093 unsafe {
1094 let f: &F = &*(f as *const F);
1095 f(
1096 Object::from_glib_borrow(this).unsafe_cast_ref(),
1097 &glib::GString::from_glib_borrow(arg1),
1098 arg2,
1099 )
1100 }
1101 }
1102 unsafe {
1103 let f: Box_<F> = Box_::new(f);
1104 connect_raw(
1105 self.as_ptr() as *mut _,
1106 c"notification".as_ptr(),
1107 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1108 notification_trampoline::<Self, F> as *const (),
1109 )),
1110 Box_::into_raw(f),
1111 )
1112 }
1113 }
1114
1115 #[doc(alias = "state-change")]
1128 fn connect_state_change<F: Fn(&Self, &str, bool) + 'static>(
1129 &self,
1130 detail: Option<&str>,
1131 f: F,
1132 ) -> SignalHandlerId {
1133 unsafe extern "C" fn state_change_trampoline<
1134 P: IsA<Object>,
1135 F: Fn(&P, &str, bool) + 'static,
1136 >(
1137 this: *mut ffi::AtkObject,
1138 arg1: *mut std::ffi::c_char,
1139 arg2: glib::ffi::gboolean,
1140 f: glib::ffi::gpointer,
1141 ) {
1142 unsafe {
1143 let f: &F = &*(f as *const F);
1144 f(
1145 Object::from_glib_borrow(this).unsafe_cast_ref(),
1146 &glib::GString::from_glib_borrow(arg1),
1147 from_glib(arg2),
1148 )
1149 }
1150 }
1151 unsafe {
1152 let f: Box_<F> = Box_::new(f);
1153 let detailed_signal_name = detail.map(|name| format!("state-change::{name}\0"));
1154 let signal_name = detailed_signal_name.as_ref().map_or(c"state-change", |n| {
1155 std::ffi::CStr::from_bytes_with_nul_unchecked(n.as_bytes())
1156 });
1157 connect_raw(
1158 self.as_ptr() as *mut _,
1159 signal_name.as_ptr(),
1160 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1161 state_change_trampoline::<Self, F> as *const (),
1162 )),
1163 Box_::into_raw(f),
1164 )
1165 }
1166 }
1167
1168 #[doc(alias = "visible-data-changed")]
1171 fn connect_visible_data_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1172 unsafe extern "C" fn visible_data_changed_trampoline<
1173 P: IsA<Object>,
1174 F: Fn(&P) + 'static,
1175 >(
1176 this: *mut ffi::AtkObject,
1177 f: glib::ffi::gpointer,
1178 ) {
1179 unsafe {
1180 let f: &F = &*(f as *const F);
1181 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1182 }
1183 }
1184 unsafe {
1185 let f: Box_<F> = Box_::new(f);
1186 connect_raw(
1187 self.as_ptr() as *mut _,
1188 c"visible-data-changed".as_ptr(),
1189 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1190 visible_data_changed_trampoline::<Self, F> as *const (),
1191 )),
1192 Box_::into_raw(f),
1193 )
1194 }
1195 }
1196
1197 #[doc(alias = "accessible-component-layer")]
1198 fn connect_accessible_component_layer_notify<F: Fn(&Self) + 'static>(
1199 &self,
1200 f: F,
1201 ) -> SignalHandlerId {
1202 unsafe extern "C" fn notify_accessible_component_layer_trampoline<
1203 P: IsA<Object>,
1204 F: Fn(&P) + 'static,
1205 >(
1206 this: *mut ffi::AtkObject,
1207 _param_spec: glib::ffi::gpointer,
1208 f: glib::ffi::gpointer,
1209 ) {
1210 unsafe {
1211 let f: &F = &*(f as *const F);
1212 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1213 }
1214 }
1215 unsafe {
1216 let f: Box_<F> = Box_::new(f);
1217 connect_raw(
1218 self.as_ptr() as *mut _,
1219 c"notify::accessible-component-layer".as_ptr(),
1220 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1221 notify_accessible_component_layer_trampoline::<Self, F> as *const (),
1222 )),
1223 Box_::into_raw(f),
1224 )
1225 }
1226 }
1227
1228 #[doc(alias = "accessible-component-mdi-zorder")]
1229 fn connect_accessible_component_mdi_zorder_notify<F: Fn(&Self) + 'static>(
1230 &self,
1231 f: F,
1232 ) -> SignalHandlerId {
1233 unsafe extern "C" fn notify_accessible_component_mdi_zorder_trampoline<
1234 P: IsA<Object>,
1235 F: Fn(&P) + 'static,
1236 >(
1237 this: *mut ffi::AtkObject,
1238 _param_spec: glib::ffi::gpointer,
1239 f: glib::ffi::gpointer,
1240 ) {
1241 unsafe {
1242 let f: &F = &*(f as *const F);
1243 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1244 }
1245 }
1246 unsafe {
1247 let f: Box_<F> = Box_::new(f);
1248 connect_raw(
1249 self.as_ptr() as *mut _,
1250 c"notify::accessible-component-mdi-zorder".as_ptr(),
1251 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1252 notify_accessible_component_mdi_zorder_trampoline::<Self, F> as *const (),
1253 )),
1254 Box_::into_raw(f),
1255 )
1256 }
1257 }
1258
1259 #[doc(alias = "accessible-description")]
1260 fn connect_accessible_description_notify<F: Fn(&Self) + 'static>(
1261 &self,
1262 f: F,
1263 ) -> SignalHandlerId {
1264 unsafe extern "C" fn notify_accessible_description_trampoline<
1265 P: IsA<Object>,
1266 F: Fn(&P) + 'static,
1267 >(
1268 this: *mut ffi::AtkObject,
1269 _param_spec: glib::ffi::gpointer,
1270 f: glib::ffi::gpointer,
1271 ) {
1272 unsafe {
1273 let f: &F = &*(f as *const F);
1274 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1275 }
1276 }
1277 unsafe {
1278 let f: Box_<F> = Box_::new(f);
1279 connect_raw(
1280 self.as_ptr() as *mut _,
1281 c"notify::accessible-description".as_ptr(),
1282 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1283 notify_accessible_description_trampoline::<Self, F> as *const (),
1284 )),
1285 Box_::into_raw(f),
1286 )
1287 }
1288 }
1289
1290 #[doc(alias = "accessible-help-text")]
1291 fn connect_accessible_help_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1292 unsafe extern "C" fn notify_accessible_help_text_trampoline<
1293 P: IsA<Object>,
1294 F: Fn(&P) + 'static,
1295 >(
1296 this: *mut ffi::AtkObject,
1297 _param_spec: glib::ffi::gpointer,
1298 f: glib::ffi::gpointer,
1299 ) {
1300 unsafe {
1301 let f: &F = &*(f as *const F);
1302 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1303 }
1304 }
1305 unsafe {
1306 let f: Box_<F> = Box_::new(f);
1307 connect_raw(
1308 self.as_ptr() as *mut _,
1309 c"notify::accessible-help-text".as_ptr(),
1310 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1311 notify_accessible_help_text_trampoline::<Self, F> as *const (),
1312 )),
1313 Box_::into_raw(f),
1314 )
1315 }
1316 }
1317
1318 #[doc(alias = "accessible-hypertext-nlinks")]
1319 fn connect_accessible_hypertext_nlinks_notify<F: Fn(&Self) + 'static>(
1320 &self,
1321 f: F,
1322 ) -> SignalHandlerId {
1323 unsafe extern "C" fn notify_accessible_hypertext_nlinks_trampoline<
1324 P: IsA<Object>,
1325 F: Fn(&P) + 'static,
1326 >(
1327 this: *mut ffi::AtkObject,
1328 _param_spec: glib::ffi::gpointer,
1329 f: glib::ffi::gpointer,
1330 ) {
1331 unsafe {
1332 let f: &F = &*(f as *const F);
1333 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1334 }
1335 }
1336 unsafe {
1337 let f: Box_<F> = Box_::new(f);
1338 connect_raw(
1339 self.as_ptr() as *mut _,
1340 c"notify::accessible-hypertext-nlinks".as_ptr(),
1341 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1342 notify_accessible_hypertext_nlinks_trampoline::<Self, F> as *const (),
1343 )),
1344 Box_::into_raw(f),
1345 )
1346 }
1347 }
1348
1349 #[doc(alias = "accessible-id")]
1350 fn connect_accessible_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1351 unsafe extern "C" fn notify_accessible_id_trampoline<
1352 P: IsA<Object>,
1353 F: Fn(&P) + 'static,
1354 >(
1355 this: *mut ffi::AtkObject,
1356 _param_spec: glib::ffi::gpointer,
1357 f: glib::ffi::gpointer,
1358 ) {
1359 unsafe {
1360 let f: &F = &*(f as *const F);
1361 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1362 }
1363 }
1364 unsafe {
1365 let f: Box_<F> = Box_::new(f);
1366 connect_raw(
1367 self.as_ptr() as *mut _,
1368 c"notify::accessible-id".as_ptr(),
1369 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1370 notify_accessible_id_trampoline::<Self, F> as *const (),
1371 )),
1372 Box_::into_raw(f),
1373 )
1374 }
1375 }
1376
1377 #[doc(alias = "accessible-name")]
1378 fn connect_accessible_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1379 unsafe extern "C" fn notify_accessible_name_trampoline<
1380 P: IsA<Object>,
1381 F: Fn(&P) + 'static,
1382 >(
1383 this: *mut ffi::AtkObject,
1384 _param_spec: glib::ffi::gpointer,
1385 f: glib::ffi::gpointer,
1386 ) {
1387 unsafe {
1388 let f: &F = &*(f as *const F);
1389 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1390 }
1391 }
1392 unsafe {
1393 let f: Box_<F> = Box_::new(f);
1394 connect_raw(
1395 self.as_ptr() as *mut _,
1396 c"notify::accessible-name".as_ptr(),
1397 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1398 notify_accessible_name_trampoline::<Self, F> as *const (),
1399 )),
1400 Box_::into_raw(f),
1401 )
1402 }
1403 }
1404
1405 #[doc(alias = "accessible-parent")]
1406 fn connect_accessible_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1407 unsafe extern "C" fn notify_accessible_parent_trampoline<
1408 P: IsA<Object>,
1409 F: Fn(&P) + 'static,
1410 >(
1411 this: *mut ffi::AtkObject,
1412 _param_spec: glib::ffi::gpointer,
1413 f: glib::ffi::gpointer,
1414 ) {
1415 unsafe {
1416 let f: &F = &*(f as *const F);
1417 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1418 }
1419 }
1420 unsafe {
1421 let f: Box_<F> = Box_::new(f);
1422 connect_raw(
1423 self.as_ptr() as *mut _,
1424 c"notify::accessible-parent".as_ptr(),
1425 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1426 notify_accessible_parent_trampoline::<Self, F> as *const (),
1427 )),
1428 Box_::into_raw(f),
1429 )
1430 }
1431 }
1432
1433 #[doc(alias = "accessible-role")]
1434 fn connect_accessible_role_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1435 unsafe extern "C" fn notify_accessible_role_trampoline<
1436 P: IsA<Object>,
1437 F: Fn(&P) + 'static,
1438 >(
1439 this: *mut ffi::AtkObject,
1440 _param_spec: glib::ffi::gpointer,
1441 f: glib::ffi::gpointer,
1442 ) {
1443 unsafe {
1444 let f: &F = &*(f as *const F);
1445 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1446 }
1447 }
1448 unsafe {
1449 let f: Box_<F> = Box_::new(f);
1450 connect_raw(
1451 self.as_ptr() as *mut _,
1452 c"notify::accessible-role".as_ptr(),
1453 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1454 notify_accessible_role_trampoline::<Self, F> as *const (),
1455 )),
1456 Box_::into_raw(f),
1457 )
1458 }
1459 }
1460
1461 #[doc(alias = "accessible-table-caption")]
1462 fn connect_accessible_table_caption_notify<F: Fn(&Self) + 'static>(
1463 &self,
1464 f: F,
1465 ) -> SignalHandlerId {
1466 unsafe extern "C" fn notify_accessible_table_caption_trampoline<
1467 P: IsA<Object>,
1468 F: Fn(&P) + 'static,
1469 >(
1470 this: *mut ffi::AtkObject,
1471 _param_spec: glib::ffi::gpointer,
1472 f: glib::ffi::gpointer,
1473 ) {
1474 unsafe {
1475 let f: &F = &*(f as *const F);
1476 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1477 }
1478 }
1479 unsafe {
1480 let f: Box_<F> = Box_::new(f);
1481 connect_raw(
1482 self.as_ptr() as *mut _,
1483 c"notify::accessible-table-caption".as_ptr(),
1484 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1485 notify_accessible_table_caption_trampoline::<Self, F> as *const (),
1486 )),
1487 Box_::into_raw(f),
1488 )
1489 }
1490 }
1491
1492 #[doc(alias = "accessible-table-caption-object")]
1493 fn connect_accessible_table_caption_object_notify<F: Fn(&Self) + 'static>(
1494 &self,
1495 f: F,
1496 ) -> SignalHandlerId {
1497 unsafe extern "C" fn notify_accessible_table_caption_object_trampoline<
1498 P: IsA<Object>,
1499 F: Fn(&P) + 'static,
1500 >(
1501 this: *mut ffi::AtkObject,
1502 _param_spec: glib::ffi::gpointer,
1503 f: glib::ffi::gpointer,
1504 ) {
1505 unsafe {
1506 let f: &F = &*(f as *const F);
1507 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1508 }
1509 }
1510 unsafe {
1511 let f: Box_<F> = Box_::new(f);
1512 connect_raw(
1513 self.as_ptr() as *mut _,
1514 c"notify::accessible-table-caption-object".as_ptr(),
1515 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1516 notify_accessible_table_caption_object_trampoline::<Self, F> as *const (),
1517 )),
1518 Box_::into_raw(f),
1519 )
1520 }
1521 }
1522
1523 #[doc(alias = "accessible-table-column-description")]
1524 fn connect_accessible_table_column_description_notify<F: Fn(&Self) + 'static>(
1525 &self,
1526 f: F,
1527 ) -> SignalHandlerId {
1528 unsafe extern "C" fn notify_accessible_table_column_description_trampoline<
1529 P: IsA<Object>,
1530 F: Fn(&P) + 'static,
1531 >(
1532 this: *mut ffi::AtkObject,
1533 _param_spec: glib::ffi::gpointer,
1534 f: glib::ffi::gpointer,
1535 ) {
1536 unsafe {
1537 let f: &F = &*(f as *const F);
1538 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1539 }
1540 }
1541 unsafe {
1542 let f: Box_<F> = Box_::new(f);
1543 connect_raw(
1544 self.as_ptr() as *mut _,
1545 c"notify::accessible-table-column-description".as_ptr(),
1546 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1547 notify_accessible_table_column_description_trampoline::<Self, F> as *const (),
1548 )),
1549 Box_::into_raw(f),
1550 )
1551 }
1552 }
1553
1554 #[doc(alias = "accessible-table-column-header")]
1555 fn connect_accessible_table_column_header_notify<F: Fn(&Self) + 'static>(
1556 &self,
1557 f: F,
1558 ) -> SignalHandlerId {
1559 unsafe extern "C" fn notify_accessible_table_column_header_trampoline<
1560 P: IsA<Object>,
1561 F: Fn(&P) + 'static,
1562 >(
1563 this: *mut ffi::AtkObject,
1564 _param_spec: glib::ffi::gpointer,
1565 f: glib::ffi::gpointer,
1566 ) {
1567 unsafe {
1568 let f: &F = &*(f as *const F);
1569 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1570 }
1571 }
1572 unsafe {
1573 let f: Box_<F> = Box_::new(f);
1574 connect_raw(
1575 self.as_ptr() as *mut _,
1576 c"notify::accessible-table-column-header".as_ptr(),
1577 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1578 notify_accessible_table_column_header_trampoline::<Self, F> as *const (),
1579 )),
1580 Box_::into_raw(f),
1581 )
1582 }
1583 }
1584
1585 #[doc(alias = "accessible-table-row-description")]
1586 fn connect_accessible_table_row_description_notify<F: Fn(&Self) + 'static>(
1587 &self,
1588 f: F,
1589 ) -> SignalHandlerId {
1590 unsafe extern "C" fn notify_accessible_table_row_description_trampoline<
1591 P: IsA<Object>,
1592 F: Fn(&P) + 'static,
1593 >(
1594 this: *mut ffi::AtkObject,
1595 _param_spec: glib::ffi::gpointer,
1596 f: glib::ffi::gpointer,
1597 ) {
1598 unsafe {
1599 let f: &F = &*(f as *const F);
1600 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1601 }
1602 }
1603 unsafe {
1604 let f: Box_<F> = Box_::new(f);
1605 connect_raw(
1606 self.as_ptr() as *mut _,
1607 c"notify::accessible-table-row-description".as_ptr(),
1608 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1609 notify_accessible_table_row_description_trampoline::<Self, F> as *const (),
1610 )),
1611 Box_::into_raw(f),
1612 )
1613 }
1614 }
1615
1616 #[doc(alias = "accessible-table-row-header")]
1617 fn connect_accessible_table_row_header_notify<F: Fn(&Self) + 'static>(
1618 &self,
1619 f: F,
1620 ) -> SignalHandlerId {
1621 unsafe extern "C" fn notify_accessible_table_row_header_trampoline<
1622 P: IsA<Object>,
1623 F: Fn(&P) + 'static,
1624 >(
1625 this: *mut ffi::AtkObject,
1626 _param_spec: glib::ffi::gpointer,
1627 f: glib::ffi::gpointer,
1628 ) {
1629 unsafe {
1630 let f: &F = &*(f as *const F);
1631 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1632 }
1633 }
1634 unsafe {
1635 let f: Box_<F> = Box_::new(f);
1636 connect_raw(
1637 self.as_ptr() as *mut _,
1638 c"notify::accessible-table-row-header".as_ptr(),
1639 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1640 notify_accessible_table_row_header_trampoline::<Self, F> as *const (),
1641 )),
1642 Box_::into_raw(f),
1643 )
1644 }
1645 }
1646
1647 #[doc(alias = "accessible-table-summary")]
1648 fn connect_accessible_table_summary_notify<F: Fn(&Self) + 'static>(
1649 &self,
1650 f: F,
1651 ) -> SignalHandlerId {
1652 unsafe extern "C" fn notify_accessible_table_summary_trampoline<
1653 P: IsA<Object>,
1654 F: Fn(&P) + 'static,
1655 >(
1656 this: *mut ffi::AtkObject,
1657 _param_spec: glib::ffi::gpointer,
1658 f: glib::ffi::gpointer,
1659 ) {
1660 unsafe {
1661 let f: &F = &*(f as *const F);
1662 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1663 }
1664 }
1665 unsafe {
1666 let f: Box_<F> = Box_::new(f);
1667 connect_raw(
1668 self.as_ptr() as *mut _,
1669 c"notify::accessible-table-summary".as_ptr(),
1670 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1671 notify_accessible_table_summary_trampoline::<Self, F> as *const (),
1672 )),
1673 Box_::into_raw(f),
1674 )
1675 }
1676 }
1677
1678 #[doc(alias = "accessible-value")]
1679 fn connect_accessible_value_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1680 unsafe extern "C" fn notify_accessible_value_trampoline<
1681 P: IsA<Object>,
1682 F: Fn(&P) + 'static,
1683 >(
1684 this: *mut ffi::AtkObject,
1685 _param_spec: glib::ffi::gpointer,
1686 f: glib::ffi::gpointer,
1687 ) {
1688 unsafe {
1689 let f: &F = &*(f as *const F);
1690 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1691 }
1692 }
1693 unsafe {
1694 let f: Box_<F> = Box_::new(f);
1695 connect_raw(
1696 self.as_ptr() as *mut _,
1697 c"notify::accessible-value".as_ptr(),
1698 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1699 notify_accessible_value_trampoline::<Self, F> as *const (),
1700 )),
1701 Box_::into_raw(f),
1702 )
1703 }
1704 }
1705}
1706
1707impl<O: IsA<Object>> AtkObjectExt for O {}