1use crate::{Layer, RelationSet, RelationType, Role, State, StateSet};
6use glib::{
7 prelude::*,
8 signal::{connect_raw, SignalHandlerId},
9 translate::*,
10};
11use std::{boxed::Box as Box_, fmt, mem::transmute};
12
13glib::wrapper! {
14 #[doc(alias = "AtkObject")]
190 pub struct Object(Object<ffi::AtkObject, ffi::AtkObjectClass>);
191
192 match fn {
193 type_ => || ffi::atk_object_get_type(),
194 }
195}
196
197impl Object {
198 pub const NONE: Option<&'static Object> = None;
199}
200
201mod sealed {
202 pub trait Sealed {}
203 impl<T: super::IsA<super::Object>> Sealed for T {}
204}
205
206pub trait AtkObjectExt: IsA<Object> + sealed::Sealed + 'static {
212 #[doc(alias = "atk_object_add_relationship")]
222 fn add_relationship(&self, relationship: RelationType, target: &impl IsA<Object>) -> bool {
223 unsafe {
224 from_glib(ffi::atk_object_add_relationship(
225 self.as_ref().to_glib_none().0,
226 relationship.into_glib(),
227 target.as_ref().to_glib_none().0,
228 ))
229 }
230 }
231
232 #[cfg(feature = "v2_34")]
239 #[cfg_attr(docsrs, doc(cfg(feature = "v2_34")))]
240 #[doc(alias = "atk_object_get_accessible_id")]
241 #[doc(alias = "get_accessible_id")]
242 fn accessible_id(&self) -> Option<glib::GString> {
243 unsafe {
244 from_glib_none(ffi::atk_object_get_accessible_id(
245 self.as_ref().to_glib_none().0,
246 ))
247 }
248 }
249
250 #[doc(alias = "atk_object_get_description")]
257 #[doc(alias = "get_description")]
258 fn description(&self) -> Option<glib::GString> {
259 unsafe {
260 from_glib_none(ffi::atk_object_get_description(
261 self.as_ref().to_glib_none().0,
262 ))
263 }
264 }
265
266 #[doc(alias = "atk_object_get_index_in_parent")]
273 #[doc(alias = "get_index_in_parent")]
274 fn index_in_parent(&self) -> i32 {
275 unsafe { ffi::atk_object_get_index_in_parent(self.as_ref().to_glib_none().0) }
276 }
277
278 #[doc(alias = "atk_object_get_layer")]
288 #[doc(alias = "get_layer")]
289 fn layer(&self) -> Layer {
290 unsafe { from_glib(ffi::atk_object_get_layer(self.as_ref().to_glib_none().0)) }
291 }
292
293 #[doc(alias = "atk_object_get_mdi_zorder")]
306 #[doc(alias = "get_mdi_zorder")]
307 fn mdi_zorder(&self) -> i32 {
308 unsafe { ffi::atk_object_get_mdi_zorder(self.as_ref().to_glib_none().0) }
309 }
310
311 #[doc(alias = "atk_object_get_n_accessible_children")]
318 #[doc(alias = "get_n_accessible_children")]
319 fn n_accessible_children(&self) -> i32 {
320 unsafe { ffi::atk_object_get_n_accessible_children(self.as_ref().to_glib_none().0) }
321 }
322
323 #[doc(alias = "atk_object_get_name")]
329 #[doc(alias = "get_name")]
330 fn name(&self) -> Option<glib::GString> {
331 unsafe { from_glib_none(ffi::atk_object_get_name(self.as_ref().to_glib_none().0)) }
332 }
333
334 #[doc(alias = "atk_object_get_object_locale")]
342 #[doc(alias = "get_object_locale")]
343 fn object_locale(&self) -> Option<glib::GString> {
344 unsafe {
345 from_glib_none(ffi::atk_object_get_object_locale(
346 self.as_ref().to_glib_none().0,
347 ))
348 }
349 }
350
351 #[doc(alias = "atk_object_get_parent")]
365 #[doc(alias = "get_parent")]
366 #[must_use]
367 fn parent(&self) -> Option<Object> {
368 unsafe { from_glib_none(ffi::atk_object_get_parent(self.as_ref().to_glib_none().0)) }
369 }
370
371 #[doc(alias = "atk_object_get_role")]
377 #[doc(alias = "get_role")]
378 fn role(&self) -> Role {
379 unsafe { from_glib(ffi::atk_object_get_role(self.as_ref().to_glib_none().0)) }
380 }
381
382 #[doc(alias = "atk_object_notify_state_change")]
396 fn notify_state_change(&self, state: State, value: bool) {
397 unsafe {
398 ffi::atk_object_notify_state_change(
399 self.as_ref().to_glib_none().0,
400 state,
401 value.into_glib(),
402 );
403 }
404 }
405
406 #[doc(alias = "atk_object_peek_parent")]
419 #[must_use]
420 fn peek_parent(&self) -> Option<Object> {
421 unsafe { from_glib_none(ffi::atk_object_peek_parent(self.as_ref().to_glib_none().0)) }
422 }
423
424 #[doc(alias = "atk_object_ref_accessible_child")]
435 #[must_use]
436 fn ref_accessible_child(&self, i: i32) -> Option<Object> {
437 unsafe {
438 from_glib_full(ffi::atk_object_ref_accessible_child(
439 self.as_ref().to_glib_none().0,
440 i,
441 ))
442 }
443 }
444
445 #[doc(alias = "atk_object_ref_relation_set")]
452 fn ref_relation_set(&self) -> Option<RelationSet> {
453 unsafe {
454 from_glib_full(ffi::atk_object_ref_relation_set(
455 self.as_ref().to_glib_none().0,
456 ))
457 }
458 }
459
460 #[doc(alias = "atk_object_ref_state_set")]
468 fn ref_state_set(&self) -> Option<StateSet> {
469 unsafe {
470 from_glib_full(ffi::atk_object_ref_state_set(
471 self.as_ref().to_glib_none().0,
472 ))
473 }
474 }
475
476 #[doc(alias = "atk_object_remove_relationship")]
486 fn remove_relationship(&self, relationship: RelationType, target: &impl IsA<Object>) -> bool {
487 unsafe {
488 from_glib(ffi::atk_object_remove_relationship(
489 self.as_ref().to_glib_none().0,
490 relationship.into_glib(),
491 target.as_ref().to_glib_none().0,
492 ))
493 }
494 }
495
496 #[cfg(feature = "v2_34")]
504 #[cfg_attr(docsrs, doc(cfg(feature = "v2_34")))]
505 #[doc(alias = "atk_object_set_accessible_id")]
506 fn set_accessible_id(&self, name: &str) {
507 unsafe {
508 ffi::atk_object_set_accessible_id(
509 self.as_ref().to_glib_none().0,
510 name.to_glib_none().0,
511 );
512 }
513 }
514
515 #[doc(alias = "atk_object_set_description")]
522 fn set_description(&self, description: &str) {
523 unsafe {
524 ffi::atk_object_set_description(
525 self.as_ref().to_glib_none().0,
526 description.to_glib_none().0,
527 );
528 }
529 }
530
531 #[doc(alias = "atk_object_set_name")]
538 fn set_name(&self, name: &str) {
539 unsafe {
540 ffi::atk_object_set_name(self.as_ref().to_glib_none().0, name.to_glib_none().0);
541 }
542 }
543
544 #[doc(alias = "atk_object_set_parent")]
548 fn set_parent(&self, parent: &impl IsA<Object>) {
549 unsafe {
550 ffi::atk_object_set_parent(
551 self.as_ref().to_glib_none().0,
552 parent.as_ref().to_glib_none().0,
553 );
554 }
555 }
556
557 #[doc(alias = "atk_object_set_role")]
561 fn set_role(&self, role: Role) {
562 unsafe {
563 ffi::atk_object_set_role(self.as_ref().to_glib_none().0, role.into_glib());
564 }
565 }
566
567 #[doc(alias = "accessible-component-layer")]
568 fn accessible_component_layer(&self) -> i32 {
569 ObjectExt::property(self.as_ref(), "accessible-component-layer")
570 }
571
572 #[doc(alias = "accessible-component-mdi-zorder")]
573 fn accessible_component_mdi_zorder(&self) -> i32 {
574 ObjectExt::property(self.as_ref(), "accessible-component-mdi-zorder")
575 }
576
577 #[doc(alias = "accessible-description")]
578 fn accessible_description(&self) -> Option<glib::GString> {
579 ObjectExt::property(self.as_ref(), "accessible-description")
580 }
581
582 #[doc(alias = "accessible-description")]
583 fn set_accessible_description(&self, accessible_description: Option<&str>) {
584 ObjectExt::set_property(
585 self.as_ref(),
586 "accessible-description",
587 accessible_description,
588 )
589 }
590
591 #[doc(alias = "accessible-hypertext-nlinks")]
592 fn accessible_hypertext_nlinks(&self) -> i32 {
593 ObjectExt::property(self.as_ref(), "accessible-hypertext-nlinks")
594 }
595
596 #[doc(alias = "accessible-name")]
597 fn accessible_name(&self) -> Option<glib::GString> {
598 ObjectExt::property(self.as_ref(), "accessible-name")
599 }
600
601 #[doc(alias = "accessible-name")]
602 fn set_accessible_name(&self, accessible_name: Option<&str>) {
603 ObjectExt::set_property(self.as_ref(), "accessible-name", accessible_name)
604 }
605
606 #[doc(alias = "accessible-parent")]
607 fn accessible_parent(&self) -> Option<Object> {
608 ObjectExt::property(self.as_ref(), "accessible-parent")
609 }
610
611 #[doc(alias = "accessible-parent")]
612 fn set_accessible_parent<P: IsA<Object>>(&self, accessible_parent: Option<&P>) {
613 ObjectExt::set_property(self.as_ref(), "accessible-parent", accessible_parent)
614 }
615
616 #[doc(alias = "accessible-role")]
617 fn accessible_role(&self) -> Role {
618 ObjectExt::property(self.as_ref(), "accessible-role")
619 }
620
621 #[doc(alias = "accessible-role")]
622 fn set_accessible_role(&self, accessible_role: Role) {
623 ObjectExt::set_property(self.as_ref(), "accessible-role", accessible_role)
624 }
625
626 #[doc(alias = "accessible-table-caption")]
632 fn accessible_table_caption(&self) -> Option<glib::GString> {
633 ObjectExt::property(self.as_ref(), "accessible-table-caption")
634 }
635
636 #[doc(alias = "accessible-table-caption")]
642 fn set_accessible_table_caption(&self, accessible_table_caption: Option<&str>) {
643 ObjectExt::set_property(
644 self.as_ref(),
645 "accessible-table-caption",
646 accessible_table_caption,
647 )
648 }
649
650 #[doc(alias = "accessible-table-caption-object")]
651 fn accessible_table_caption_object(&self) -> Option<Object> {
652 ObjectExt::property(self.as_ref(), "accessible-table-caption-object")
653 }
654
655 #[doc(alias = "accessible-table-caption-object")]
656 fn set_accessible_table_caption_object<P: IsA<Object>>(
657 &self,
658 accessible_table_caption_object: Option<&P>,
659 ) {
660 ObjectExt::set_property(
661 self.as_ref(),
662 "accessible-table-caption-object",
663 accessible_table_caption_object,
664 )
665 }
666
667 #[doc(alias = "accessible-table-column-description")]
674 fn accessible_table_column_description(&self) -> Option<glib::GString> {
675 ObjectExt::property(self.as_ref(), "accessible-table-column-description")
676 }
677
678 #[doc(alias = "accessible-table-column-description")]
685 fn set_accessible_table_column_description(
686 &self,
687 accessible_table_column_description: Option<&str>,
688 ) {
689 ObjectExt::set_property(
690 self.as_ref(),
691 "accessible-table-column-description",
692 accessible_table_column_description,
693 )
694 }
695
696 #[doc(alias = "accessible-table-column-header")]
703 fn accessible_table_column_header(&self) -> Option<Object> {
704 ObjectExt::property(self.as_ref(), "accessible-table-column-header")
705 }
706
707 #[doc(alias = "accessible-table-column-header")]
714 fn set_accessible_table_column_header<P: IsA<Object>>(
715 &self,
716 accessible_table_column_header: Option<&P>,
717 ) {
718 ObjectExt::set_property(
719 self.as_ref(),
720 "accessible-table-column-header",
721 accessible_table_column_header,
722 )
723 }
724
725 #[doc(alias = "accessible-table-row-description")]
732 fn accessible_table_row_description(&self) -> Option<glib::GString> {
733 ObjectExt::property(self.as_ref(), "accessible-table-row-description")
734 }
735
736 #[doc(alias = "accessible-table-row-description")]
743 fn set_accessible_table_row_description(&self, accessible_table_row_description: Option<&str>) {
744 ObjectExt::set_property(
745 self.as_ref(),
746 "accessible-table-row-description",
747 accessible_table_row_description,
748 )
749 }
750
751 #[doc(alias = "accessible-table-row-header")]
758 fn accessible_table_row_header(&self) -> Option<Object> {
759 ObjectExt::property(self.as_ref(), "accessible-table-row-header")
760 }
761
762 #[doc(alias = "accessible-table-row-header")]
769 fn set_accessible_table_row_header<P: IsA<Object>>(
770 &self,
771 accessible_table_row_header: Option<&P>,
772 ) {
773 ObjectExt::set_property(
774 self.as_ref(),
775 "accessible-table-row-header",
776 accessible_table_row_header,
777 )
778 }
779
780 #[doc(alias = "accessible-table-summary")]
781 fn accessible_table_summary(&self) -> Option<Object> {
782 ObjectExt::property(self.as_ref(), "accessible-table-summary")
783 }
784
785 #[doc(alias = "accessible-table-summary")]
786 fn set_accessible_table_summary<P: IsA<Object>>(&self, accessible_table_summary: Option<&P>) {
787 ObjectExt::set_property(
788 self.as_ref(),
789 "accessible-table-summary",
790 accessible_table_summary,
791 )
792 }
793
794 #[doc(alias = "accessible-value")]
802 fn accessible_value(&self) -> f64 {
803 ObjectExt::property(self.as_ref(), "accessible-value")
804 }
805
806 #[doc(alias = "accessible-value")]
814 fn set_accessible_value(&self, accessible_value: f64) {
815 ObjectExt::set_property(self.as_ref(), "accessible-value", accessible_value)
816 }
817
818 #[doc(alias = "active-descendant-changed")]
825 fn connect_active_descendant_changed<F: Fn(&Self, &Object) + 'static>(
826 &self,
827 detail: Option<&str>,
828 f: F,
829 ) -> SignalHandlerId {
830 unsafe extern "C" fn active_descendant_changed_trampoline<
831 P: IsA<Object>,
832 F: Fn(&P, &Object) + 'static,
833 >(
834 this: *mut ffi::AtkObject,
835 arg1: *mut ffi::AtkObject,
836 f: glib::ffi::gpointer,
837 ) {
838 let f: &F = &*(f as *const F);
839 f(
840 Object::from_glib_borrow(this).unsafe_cast_ref(),
841 &from_glib_borrow(arg1),
842 )
843 }
844 unsafe {
845 let f: Box_<F> = Box_::new(f);
846 let detailed_signal_name =
847 detail.map(|name| format!("active-descendant-changed::{name}\0"));
848 let signal_name: &[u8] = detailed_signal_name
849 .as_ref()
850 .map_or(&b"active-descendant-changed\0"[..], |n| n.as_bytes());
851 connect_raw(
852 self.as_ptr() as *mut _,
853 signal_name.as_ptr() as *const _,
854 Some(transmute::<_, unsafe extern "C" fn()>(
855 active_descendant_changed_trampoline::<Self, F> as *const (),
856 )),
857 Box_::into_raw(f),
858 )
859 }
860 }
861
862 #[cfg(feature = "v2_46")]
869 #[cfg_attr(docsrs, doc(cfg(feature = "v2_46")))]
870 #[doc(alias = "announcement")]
871 fn connect_announcement<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId {
872 unsafe extern "C" fn announcement_trampoline<P: IsA<Object>, F: Fn(&P, &str) + 'static>(
873 this: *mut ffi::AtkObject,
874 arg1: *mut libc::c_char,
875 f: glib::ffi::gpointer,
876 ) {
877 let f: &F = &*(f as *const F);
878 f(
879 Object::from_glib_borrow(this).unsafe_cast_ref(),
880 &glib::GString::from_glib_borrow(arg1),
881 )
882 }
883 unsafe {
884 let f: Box_<F> = Box_::new(f);
885 connect_raw(
886 self.as_ptr() as *mut _,
887 b"announcement\0".as_ptr() as *const _,
888 Some(transmute::<_, unsafe extern "C" fn()>(
889 announcement_trampoline::<Self, F> as *const (),
890 )),
891 Box_::into_raw(f),
892 )
893 }
894 }
895
896 #[doc(alias = "children-changed")]
909 fn connect_children_changed<F: Fn(&Self, u32, &Object) + 'static>(
910 &self,
911 detail: Option<&str>,
912 f: F,
913 ) -> SignalHandlerId {
914 unsafe extern "C" fn children_changed_trampoline<
915 P: IsA<Object>,
916 F: Fn(&P, u32, &Object) + 'static,
917 >(
918 this: *mut ffi::AtkObject,
919 arg1: libc::c_uint,
920 arg2: *mut ffi::AtkObject,
921 f: glib::ffi::gpointer,
922 ) {
923 let f: &F = &*(f as *const F);
924 f(
925 Object::from_glib_borrow(this).unsafe_cast_ref(),
926 arg1,
927 &from_glib_borrow(arg2),
928 )
929 }
930 unsafe {
931 let f: Box_<F> = Box_::new(f);
932 let detailed_signal_name = detail.map(|name| format!("children-changed::{name}\0"));
933 let signal_name: &[u8] = detailed_signal_name
934 .as_ref()
935 .map_or(&b"children-changed\0"[..], |n| n.as_bytes());
936 connect_raw(
937 self.as_ptr() as *mut _,
938 signal_name.as_ptr() as *const _,
939 Some(transmute::<_, unsafe extern "C" fn()>(
940 children_changed_trampoline::<Self, F> as *const (),
941 )),
942 Box_::into_raw(f),
943 )
944 }
945 }
946
947 #[cfg(feature = "v2_50")]
955 #[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
956 #[doc(alias = "notification")]
957 fn connect_notification<F: Fn(&Self, &str, i32) + 'static>(&self, f: F) -> SignalHandlerId {
958 unsafe extern "C" fn notification_trampoline<
959 P: IsA<Object>,
960 F: Fn(&P, &str, i32) + 'static,
961 >(
962 this: *mut ffi::AtkObject,
963 arg1: *mut libc::c_char,
964 arg2: libc::c_int,
965 f: glib::ffi::gpointer,
966 ) {
967 let f: &F = &*(f as *const F);
968 f(
969 Object::from_glib_borrow(this).unsafe_cast_ref(),
970 &glib::GString::from_glib_borrow(arg1),
971 arg2,
972 )
973 }
974 unsafe {
975 let f: Box_<F> = Box_::new(f);
976 connect_raw(
977 self.as_ptr() as *mut _,
978 b"notification\0".as_ptr() as *const _,
979 Some(transmute::<_, unsafe extern "C" fn()>(
980 notification_trampoline::<Self, F> as *const (),
981 )),
982 Box_::into_raw(f),
983 )
984 }
985 }
986
987 #[doc(alias = "state-change")]
1000 fn connect_state_change<F: Fn(&Self, &str, bool) + 'static>(
1001 &self,
1002 detail: Option<&str>,
1003 f: F,
1004 ) -> SignalHandlerId {
1005 unsafe extern "C" fn state_change_trampoline<
1006 P: IsA<Object>,
1007 F: Fn(&P, &str, bool) + 'static,
1008 >(
1009 this: *mut ffi::AtkObject,
1010 arg1: *mut libc::c_char,
1011 arg2: glib::ffi::gboolean,
1012 f: glib::ffi::gpointer,
1013 ) {
1014 let f: &F = &*(f as *const F);
1015 f(
1016 Object::from_glib_borrow(this).unsafe_cast_ref(),
1017 &glib::GString::from_glib_borrow(arg1),
1018 from_glib(arg2),
1019 )
1020 }
1021 unsafe {
1022 let f: Box_<F> = Box_::new(f);
1023 let detailed_signal_name = detail.map(|name| format!("state-change::{name}\0"));
1024 let signal_name: &[u8] = detailed_signal_name
1025 .as_ref()
1026 .map_or(&b"state-change\0"[..], |n| n.as_bytes());
1027 connect_raw(
1028 self.as_ptr() as *mut _,
1029 signal_name.as_ptr() as *const _,
1030 Some(transmute::<_, unsafe extern "C" fn()>(
1031 state_change_trampoline::<Self, F> as *const (),
1032 )),
1033 Box_::into_raw(f),
1034 )
1035 }
1036 }
1037
1038 #[doc(alias = "visible-data-changed")]
1041 fn connect_visible_data_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1042 unsafe extern "C" fn visible_data_changed_trampoline<
1043 P: IsA<Object>,
1044 F: Fn(&P) + 'static,
1045 >(
1046 this: *mut ffi::AtkObject,
1047 f: glib::ffi::gpointer,
1048 ) {
1049 let f: &F = &*(f as *const F);
1050 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1051 }
1052 unsafe {
1053 let f: Box_<F> = Box_::new(f);
1054 connect_raw(
1055 self.as_ptr() as *mut _,
1056 b"visible-data-changed\0".as_ptr() as *const _,
1057 Some(transmute::<_, unsafe extern "C" fn()>(
1058 visible_data_changed_trampoline::<Self, F> as *const (),
1059 )),
1060 Box_::into_raw(f),
1061 )
1062 }
1063 }
1064
1065 #[doc(alias = "accessible-component-layer")]
1066 fn connect_accessible_component_layer_notify<F: Fn(&Self) + 'static>(
1067 &self,
1068 f: F,
1069 ) -> SignalHandlerId {
1070 unsafe extern "C" fn notify_accessible_component_layer_trampoline<
1071 P: IsA<Object>,
1072 F: Fn(&P) + 'static,
1073 >(
1074 this: *mut ffi::AtkObject,
1075 _param_spec: glib::ffi::gpointer,
1076 f: glib::ffi::gpointer,
1077 ) {
1078 let f: &F = &*(f as *const F);
1079 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1080 }
1081 unsafe {
1082 let f: Box_<F> = Box_::new(f);
1083 connect_raw(
1084 self.as_ptr() as *mut _,
1085 b"notify::accessible-component-layer\0".as_ptr() as *const _,
1086 Some(transmute::<_, unsafe extern "C" fn()>(
1087 notify_accessible_component_layer_trampoline::<Self, F> as *const (),
1088 )),
1089 Box_::into_raw(f),
1090 )
1091 }
1092 }
1093
1094 #[doc(alias = "accessible-component-mdi-zorder")]
1095 fn connect_accessible_component_mdi_zorder_notify<F: Fn(&Self) + 'static>(
1096 &self,
1097 f: F,
1098 ) -> SignalHandlerId {
1099 unsafe extern "C" fn notify_accessible_component_mdi_zorder_trampoline<
1100 P: IsA<Object>,
1101 F: Fn(&P) + 'static,
1102 >(
1103 this: *mut ffi::AtkObject,
1104 _param_spec: glib::ffi::gpointer,
1105 f: glib::ffi::gpointer,
1106 ) {
1107 let f: &F = &*(f as *const F);
1108 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1109 }
1110 unsafe {
1111 let f: Box_<F> = Box_::new(f);
1112 connect_raw(
1113 self.as_ptr() as *mut _,
1114 b"notify::accessible-component-mdi-zorder\0".as_ptr() as *const _,
1115 Some(transmute::<_, unsafe extern "C" fn()>(
1116 notify_accessible_component_mdi_zorder_trampoline::<Self, F> as *const (),
1117 )),
1118 Box_::into_raw(f),
1119 )
1120 }
1121 }
1122
1123 #[doc(alias = "accessible-description")]
1124 fn connect_accessible_description_notify<F: Fn(&Self) + 'static>(
1125 &self,
1126 f: F,
1127 ) -> SignalHandlerId {
1128 unsafe extern "C" fn notify_accessible_description_trampoline<
1129 P: IsA<Object>,
1130 F: Fn(&P) + 'static,
1131 >(
1132 this: *mut ffi::AtkObject,
1133 _param_spec: glib::ffi::gpointer,
1134 f: glib::ffi::gpointer,
1135 ) {
1136 let f: &F = &*(f as *const F);
1137 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1138 }
1139 unsafe {
1140 let f: Box_<F> = Box_::new(f);
1141 connect_raw(
1142 self.as_ptr() as *mut _,
1143 b"notify::accessible-description\0".as_ptr() as *const _,
1144 Some(transmute::<_, unsafe extern "C" fn()>(
1145 notify_accessible_description_trampoline::<Self, F> as *const (),
1146 )),
1147 Box_::into_raw(f),
1148 )
1149 }
1150 }
1151
1152 #[doc(alias = "accessible-hypertext-nlinks")]
1153 fn connect_accessible_hypertext_nlinks_notify<F: Fn(&Self) + 'static>(
1154 &self,
1155 f: F,
1156 ) -> SignalHandlerId {
1157 unsafe extern "C" fn notify_accessible_hypertext_nlinks_trampoline<
1158 P: IsA<Object>,
1159 F: Fn(&P) + 'static,
1160 >(
1161 this: *mut ffi::AtkObject,
1162 _param_spec: glib::ffi::gpointer,
1163 f: glib::ffi::gpointer,
1164 ) {
1165 let f: &F = &*(f as *const F);
1166 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1167 }
1168 unsafe {
1169 let f: Box_<F> = Box_::new(f);
1170 connect_raw(
1171 self.as_ptr() as *mut _,
1172 b"notify::accessible-hypertext-nlinks\0".as_ptr() as *const _,
1173 Some(transmute::<_, unsafe extern "C" fn()>(
1174 notify_accessible_hypertext_nlinks_trampoline::<Self, F> as *const (),
1175 )),
1176 Box_::into_raw(f),
1177 )
1178 }
1179 }
1180
1181 #[doc(alias = "accessible-name")]
1182 fn connect_accessible_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1183 unsafe extern "C" fn notify_accessible_name_trampoline<
1184 P: IsA<Object>,
1185 F: Fn(&P) + 'static,
1186 >(
1187 this: *mut ffi::AtkObject,
1188 _param_spec: glib::ffi::gpointer,
1189 f: glib::ffi::gpointer,
1190 ) {
1191 let f: &F = &*(f as *const F);
1192 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1193 }
1194 unsafe {
1195 let f: Box_<F> = Box_::new(f);
1196 connect_raw(
1197 self.as_ptr() as *mut _,
1198 b"notify::accessible-name\0".as_ptr() as *const _,
1199 Some(transmute::<_, unsafe extern "C" fn()>(
1200 notify_accessible_name_trampoline::<Self, F> as *const (),
1201 )),
1202 Box_::into_raw(f),
1203 )
1204 }
1205 }
1206
1207 #[doc(alias = "accessible-parent")]
1208 fn connect_accessible_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1209 unsafe extern "C" fn notify_accessible_parent_trampoline<
1210 P: IsA<Object>,
1211 F: Fn(&P) + 'static,
1212 >(
1213 this: *mut ffi::AtkObject,
1214 _param_spec: glib::ffi::gpointer,
1215 f: glib::ffi::gpointer,
1216 ) {
1217 let f: &F = &*(f as *const F);
1218 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1219 }
1220 unsafe {
1221 let f: Box_<F> = Box_::new(f);
1222 connect_raw(
1223 self.as_ptr() as *mut _,
1224 b"notify::accessible-parent\0".as_ptr() as *const _,
1225 Some(transmute::<_, unsafe extern "C" fn()>(
1226 notify_accessible_parent_trampoline::<Self, F> as *const (),
1227 )),
1228 Box_::into_raw(f),
1229 )
1230 }
1231 }
1232
1233 #[doc(alias = "accessible-role")]
1234 fn connect_accessible_role_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1235 unsafe extern "C" fn notify_accessible_role_trampoline<
1236 P: IsA<Object>,
1237 F: Fn(&P) + 'static,
1238 >(
1239 this: *mut ffi::AtkObject,
1240 _param_spec: glib::ffi::gpointer,
1241 f: glib::ffi::gpointer,
1242 ) {
1243 let f: &F = &*(f as *const F);
1244 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1245 }
1246 unsafe {
1247 let f: Box_<F> = Box_::new(f);
1248 connect_raw(
1249 self.as_ptr() as *mut _,
1250 b"notify::accessible-role\0".as_ptr() as *const _,
1251 Some(transmute::<_, unsafe extern "C" fn()>(
1252 notify_accessible_role_trampoline::<Self, F> as *const (),
1253 )),
1254 Box_::into_raw(f),
1255 )
1256 }
1257 }
1258
1259 #[doc(alias = "accessible-table-caption")]
1260 fn connect_accessible_table_caption_notify<F: Fn(&Self) + 'static>(
1261 &self,
1262 f: F,
1263 ) -> SignalHandlerId {
1264 unsafe extern "C" fn notify_accessible_table_caption_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 let f: &F = &*(f as *const F);
1273 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1274 }
1275 unsafe {
1276 let f: Box_<F> = Box_::new(f);
1277 connect_raw(
1278 self.as_ptr() as *mut _,
1279 b"notify::accessible-table-caption\0".as_ptr() as *const _,
1280 Some(transmute::<_, unsafe extern "C" fn()>(
1281 notify_accessible_table_caption_trampoline::<Self, F> as *const (),
1282 )),
1283 Box_::into_raw(f),
1284 )
1285 }
1286 }
1287
1288 #[doc(alias = "accessible-table-caption-object")]
1289 fn connect_accessible_table_caption_object_notify<F: Fn(&Self) + 'static>(
1290 &self,
1291 f: F,
1292 ) -> SignalHandlerId {
1293 unsafe extern "C" fn notify_accessible_table_caption_object_trampoline<
1294 P: IsA<Object>,
1295 F: Fn(&P) + 'static,
1296 >(
1297 this: *mut ffi::AtkObject,
1298 _param_spec: glib::ffi::gpointer,
1299 f: glib::ffi::gpointer,
1300 ) {
1301 let f: &F = &*(f as *const F);
1302 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1303 }
1304 unsafe {
1305 let f: Box_<F> = Box_::new(f);
1306 connect_raw(
1307 self.as_ptr() as *mut _,
1308 b"notify::accessible-table-caption-object\0".as_ptr() as *const _,
1309 Some(transmute::<_, unsafe extern "C" fn()>(
1310 notify_accessible_table_caption_object_trampoline::<Self, F> as *const (),
1311 )),
1312 Box_::into_raw(f),
1313 )
1314 }
1315 }
1316
1317 #[doc(alias = "accessible-table-column-description")]
1318 fn connect_accessible_table_column_description_notify<F: Fn(&Self) + 'static>(
1319 &self,
1320 f: F,
1321 ) -> SignalHandlerId {
1322 unsafe extern "C" fn notify_accessible_table_column_description_trampoline<
1323 P: IsA<Object>,
1324 F: Fn(&P) + 'static,
1325 >(
1326 this: *mut ffi::AtkObject,
1327 _param_spec: glib::ffi::gpointer,
1328 f: glib::ffi::gpointer,
1329 ) {
1330 let f: &F = &*(f as *const F);
1331 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1332 }
1333 unsafe {
1334 let f: Box_<F> = Box_::new(f);
1335 connect_raw(
1336 self.as_ptr() as *mut _,
1337 b"notify::accessible-table-column-description\0".as_ptr() as *const _,
1338 Some(transmute::<_, unsafe extern "C" fn()>(
1339 notify_accessible_table_column_description_trampoline::<Self, F> as *const (),
1340 )),
1341 Box_::into_raw(f),
1342 )
1343 }
1344 }
1345
1346 #[doc(alias = "accessible-table-column-header")]
1347 fn connect_accessible_table_column_header_notify<F: Fn(&Self) + 'static>(
1348 &self,
1349 f: F,
1350 ) -> SignalHandlerId {
1351 unsafe extern "C" fn notify_accessible_table_column_header_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 let f: &F = &*(f as *const F);
1360 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1361 }
1362 unsafe {
1363 let f: Box_<F> = Box_::new(f);
1364 connect_raw(
1365 self.as_ptr() as *mut _,
1366 b"notify::accessible-table-column-header\0".as_ptr() as *const _,
1367 Some(transmute::<_, unsafe extern "C" fn()>(
1368 notify_accessible_table_column_header_trampoline::<Self, F> as *const (),
1369 )),
1370 Box_::into_raw(f),
1371 )
1372 }
1373 }
1374
1375 #[doc(alias = "accessible-table-row-description")]
1376 fn connect_accessible_table_row_description_notify<F: Fn(&Self) + 'static>(
1377 &self,
1378 f: F,
1379 ) -> SignalHandlerId {
1380 unsafe extern "C" fn notify_accessible_table_row_description_trampoline<
1381 P: IsA<Object>,
1382 F: Fn(&P) + 'static,
1383 >(
1384 this: *mut ffi::AtkObject,
1385 _param_spec: glib::ffi::gpointer,
1386 f: glib::ffi::gpointer,
1387 ) {
1388 let f: &F = &*(f as *const F);
1389 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1390 }
1391 unsafe {
1392 let f: Box_<F> = Box_::new(f);
1393 connect_raw(
1394 self.as_ptr() as *mut _,
1395 b"notify::accessible-table-row-description\0".as_ptr() as *const _,
1396 Some(transmute::<_, unsafe extern "C" fn()>(
1397 notify_accessible_table_row_description_trampoline::<Self, F> as *const (),
1398 )),
1399 Box_::into_raw(f),
1400 )
1401 }
1402 }
1403
1404 #[doc(alias = "accessible-table-row-header")]
1405 fn connect_accessible_table_row_header_notify<F: Fn(&Self) + 'static>(
1406 &self,
1407 f: F,
1408 ) -> SignalHandlerId {
1409 unsafe extern "C" fn notify_accessible_table_row_header_trampoline<
1410 P: IsA<Object>,
1411 F: Fn(&P) + 'static,
1412 >(
1413 this: *mut ffi::AtkObject,
1414 _param_spec: glib::ffi::gpointer,
1415 f: glib::ffi::gpointer,
1416 ) {
1417 let f: &F = &*(f as *const F);
1418 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1419 }
1420 unsafe {
1421 let f: Box_<F> = Box_::new(f);
1422 connect_raw(
1423 self.as_ptr() as *mut _,
1424 b"notify::accessible-table-row-header\0".as_ptr() as *const _,
1425 Some(transmute::<_, unsafe extern "C" fn()>(
1426 notify_accessible_table_row_header_trampoline::<Self, F> as *const (),
1427 )),
1428 Box_::into_raw(f),
1429 )
1430 }
1431 }
1432
1433 #[doc(alias = "accessible-table-summary")]
1434 fn connect_accessible_table_summary_notify<F: Fn(&Self) + 'static>(
1435 &self,
1436 f: F,
1437 ) -> SignalHandlerId {
1438 unsafe extern "C" fn notify_accessible_table_summary_trampoline<
1439 P: IsA<Object>,
1440 F: Fn(&P) + 'static,
1441 >(
1442 this: *mut ffi::AtkObject,
1443 _param_spec: glib::ffi::gpointer,
1444 f: glib::ffi::gpointer,
1445 ) {
1446 let f: &F = &*(f as *const F);
1447 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1448 }
1449 unsafe {
1450 let f: Box_<F> = Box_::new(f);
1451 connect_raw(
1452 self.as_ptr() as *mut _,
1453 b"notify::accessible-table-summary\0".as_ptr() as *const _,
1454 Some(transmute::<_, unsafe extern "C" fn()>(
1455 notify_accessible_table_summary_trampoline::<Self, F> as *const (),
1456 )),
1457 Box_::into_raw(f),
1458 )
1459 }
1460 }
1461
1462 #[doc(alias = "accessible-value")]
1463 fn connect_accessible_value_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1464 unsafe extern "C" fn notify_accessible_value_trampoline<
1465 P: IsA<Object>,
1466 F: Fn(&P) + 'static,
1467 >(
1468 this: *mut ffi::AtkObject,
1469 _param_spec: glib::ffi::gpointer,
1470 f: glib::ffi::gpointer,
1471 ) {
1472 let f: &F = &*(f as *const F);
1473 f(Object::from_glib_borrow(this).unsafe_cast_ref())
1474 }
1475 unsafe {
1476 let f: Box_<F> = Box_::new(f);
1477 connect_raw(
1478 self.as_ptr() as *mut _,
1479 b"notify::accessible-value\0".as_ptr() as *const _,
1480 Some(transmute::<_, unsafe extern "C" fn()>(
1481 notify_accessible_value_trampoline::<Self, F> as *const (),
1482 )),
1483 Box_::into_raw(f),
1484 )
1485 }
1486 }
1487}
1488
1489impl<O: IsA<Object>> AtkObjectExt for O {}
1490
1491impl fmt::Display for Object {
1492 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1493 f.write_str("Object")
1494 }
1495}