atk-0.14.0/.cargo_vcs_info.json0000644000000001120000000000100116670ustar { "git": { "sha1": "ae4ccd1762fd1ea9aa951d593f6c6fa4cc9bbe82" } } atk-0.14.0/COPYRIGHT000064400000000000000000000012130072674642500120050ustar 00000000000000The gtk-rs Project is licensed under the MIT license, see the LICENSE file or . Copyrights in the gtk-rs Project project are retained by their contributors. No copyright assignment is required to contribute to the gtk-rs Project project. For full authorship information, see the version control history. This project provides interoperability with various GNOME libraries but doesn't distribute any parts of them. Distributing compiled libraries and executables that link to those libraries may be subject to terms of the GNU LGPL or other licenses. For more information check the license of each GNOME library. atk-0.14.0/Cargo.toml0000644000000025610000000000100076770ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] edition = "2018" name = "atk" version = "0.14.0" authors = ["The gtk-rs Project Developers"] exclude = ["gir-files/*"] description = "Rust bindings for the ATK library" homepage = "https://gtk-rs.org/" documentation = "https://gtk-rs.org/gtk3-rs/stable/latest/docs/atk/" readme = "README.md" keywords = ["atk", "gtk-rs", "gnome", "accessibility"] categories = ["api-bindings", "gui"] license = "MIT" repository = "https://github.com/gtk-rs/gtk3-rs" [package.metadata.docs.rs] features = ["dox"] [lib] name = "atk" [dependencies.bitflags] version = "1.0" [dependencies.ffi] version = "0.14.0" package = "atk-sys" [dependencies.glib] version = "0.14.0" [dependencies.libc] version = "0.2" [dev-dependencies.gir-format-check] version = "^0.1" [features] dox = ["ffi/dox"] v2_30 = ["ffi/v2_30"] v2_32 = ["v2_30", "ffi/v2_32"] v2_34 = ["v2_32", "ffi/v2_34"] atk-0.14.0/Cargo.toml.orig000064400000000000000000000014430072674642500134060ustar 00000000000000[package] documentation = "https://gtk-rs.org/gtk3-rs/stable/latest/docs/atk/" categories = ["api-bindings", "gui"] license = "MIT" description = "Rust bindings for the ATK library" name = "atk" homepage = "https://gtk-rs.org/" authors = ["The gtk-rs Project Developers"] readme = "README.md" version = "0.14.0" keywords = ["atk", "gtk-rs", "gnome", "accessibility"] repository = "https://github.com/gtk-rs/gtk3-rs" exclude = [ "gir-files/*", ] edition = "2018" [lib] name = "atk" [features] dox = ["ffi/dox"] v2_30 = ["ffi/v2_30"] v2_32 = ["v2_30", "ffi/v2_32"] v2_34 = ["v2_32", "ffi/v2_34"] [package.metadata.docs.rs] features = ["dox"] [dependencies] libc = "0.2" bitflags = "1.0" ffi = {package = "atk-sys", version = "0.14.0"} glib = "0.14.0" [dev-dependencies] gir-format-check = "^0.1" atk-0.14.0/Gir.toml000064400000000000000000000064040072674642500121370ustar 00000000000000[options] girs_directories = ["../gir-files"] library = "Atk" version = "1.0" min_cfg_version = "2.18" target_path = "." work_mode = "normal" generate_safety_asserts = true deprecate_by_min_version = true single_version_file = true generate = [ "Atk.Component", "Atk.CoordType", "Atk.Document", "Atk.EventListener", "Atk.EventListenerInit", "Atk.FocusHandler", "Atk.GObjectAccessible", "Atk.Hyperlink", "Atk.HyperlinkImpl", "Atk.HyperlinkStateFlags", "Atk.Hypertext", # "Atk.Implementor", # "Atk.KeyEventStruct", "Atk.Layer", "Atk.NoOpObject", "Atk.NoOpObjectFactory", "Atk.ObjectFactory", "Atk.PropertyChangeHandler", # "Atk.PropertyValues", "Atk.Rectangle", "Atk.Registry", "Atk.Relation", "Atk.RelationSet", "Atk.ScrollType", "Atk.Selection", "Atk.State", "Atk.StateSet", "Atk.StreamableContent", "Atk.TableCell", "Atk.TextBoundary", "Atk.TextClipType", "Atk.TextGranularity", "Atk.TextRange", "Atk.Util", "Atk.Value", "Atk.ValueType", ] ignore = [ ] manual = [ "Atk.Attribute", "Atk.AttributeSet", "Atk.TextRectangle", # "GLib.SList", # "GLib.IOChannel", "GObject.Object", "GObject.Value", "GObject.ValueArray", ] [[object]] name = "Atk.Action" status = "generate" trait_name = "AtkActionExt" # duplicate with gio [[object]] name = "Atk.EditableText" status = "generate" manual_traits = ["EditableTextExtManual"] [[object.function]] name = "insert_text" # Expected pointer, received integer manual = true [[object]] name = "Atk.Image" status = "generate" trait_name = "AtkImageExt" # duplicate with gtk [[object]] name = "Atk.Misc" status = "generate" trait_name = "AtkMiscExt" # duplicate with gtk [[object]] name = "Atk.Object" status = "generate" trait_name = "AtkObjectExt" [[object]] name = "Atk.Range" status = "generate" trait_name = "AtkRangeExt" # duplicate with gtk [[object]] name = "Atk.Table" status = "generate" manual_traits = ["TableExtManual"] [[object.function]] name = "get_selected_columns" manual = true [[object.function]] name = "get_selected_rows" manual = true [[object]] name = "Atk.Text" status = "generate" [[object.function]] name = "free_ranges" ignore = true # don't know yet how to give back memory... [[object]] name = "Atk.Window" status = "generate" trait_name = "AtkWindowExt" # duplicate with gtk [[object]] name = "Atk.Plug" status = "generate" trait_name = "AtkPlugExt" [[object]] name = "Atk.Socket" status = "generate" trait_name = "AtkSocketExt" [[object]] name = "Atk.RelationType" status = "generate" [[object.function]] name = "register" # Problematic function needs manual implementation ignore = true [[object]] name = "Atk.Role" status = "generate" [[object.function]] name = "register" # Problematic function needs manual implementation ignore = true [[object]] name = "Atk.StateType" status = "generate" [[object.function]] name = "register" # Problematic function needs manual implementation ignore = true [[object]] name = "Atk.TextAttribute" status = "generate" [[object.function]] name = "register" # Problematic function needs manual implementation ignore = true atk-0.14.0/LICENSE000064400000000000000000000020000072674642500115120ustar 00000000000000Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. atk-0.14.0/README.md000064400000000000000000000021320072674642500117720ustar 00000000000000# atk [Project site](https://gtk-rs.org/) __Rust__ bindings and wrappers for __Atk__, part of [gtk3-rs](https://github.com/gtk-rs/gtk3-rs). ## Minimum supported Rust version Currently, the minimum supported Rust version is `1.51.0`. ## Documentation * [Rust API - Stable](https://gtk-rs.org/gtk3-rs/stable/latest/docs/atk/) * [Rust API - Development](https://gtk-rs.org/gtk3-rs/git/docs/atk) * [GTK Installation instructions](https://www.gtk.org/docs/installations/) ## Using We recommend using [crates from crates.io](https://crates.io/keywords/gtk-rs), as [demonstrated here](https://gtk-rs.org/#using). If you want to track the bleeding edge, use the git dependency instead: ```toml [dependencies] atk = { git = "https://github.com/gtk-rs/gtk3-rs.git", package = "atk" } ``` Avoid mixing versioned and git crates like this: ```toml # This will not compile [dependencies] atk = "0.13" atk = { git = "https://github.com/gtk-rs/gtk3-rs.git", package = "atk" } ``` ### See Also * [glib](https://crates.io/crates/glib) ## License __atk__ is available under the MIT License, please refer to it. atk-0.14.0/src/attribute.rs000064400000000000000000000020220072674642500136510ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use glib::translate::*; use glib::GString; use std::fmt; #[doc(alias = "AtkAttribute")] pub struct Attribute { pub name: GString, pub value: GString, } impl fmt::Display for Attribute { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Attribute") .field("name", &self.name) .field("value", &self.value) .finish() } } #[doc(hidden)] impl FromGlib for Attribute { unsafe fn from_glib(value: ffi::AtkAttribute) -> Self { skip_assert_initialized!(); Self { name: from_glib_full(value.name), value: from_glib_full(value.value), } } } #[doc(hidden)] impl IntoGlib for Attribute { type GlibType = ffi::AtkAttribute; fn into_glib(self) -> ffi::AtkAttribute { ffi::AtkAttribute { name: self.name.to_glib_none().0, value: self.value.to_glib_none().0, } } } atk-0.14.0/src/attribute_set.rs000064400000000000000000000002010072674642500145210ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. pub type AttributeSet = glib::translate::SList; atk-0.14.0/src/auto/action.rs000064400000000000000000000055720072674642500141100ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::object::IsA; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "AtkAction")] pub struct Action(Interface); match fn { type_ => || ffi::atk_action_get_type(), } } pub const NONE_ACTION: Option<&Action> = None; pub trait AtkActionExt: 'static { #[doc(alias = "atk_action_do_action")] fn do_action(&self, i: i32) -> bool; #[doc(alias = "atk_action_get_description")] #[doc(alias = "get_description")] fn description(&self, i: i32) -> Option; #[doc(alias = "atk_action_get_keybinding")] #[doc(alias = "get_keybinding")] fn keybinding(&self, i: i32) -> Option; #[doc(alias = "atk_action_get_localized_name")] #[doc(alias = "get_localized_name")] fn localized_name(&self, i: i32) -> Option; #[doc(alias = "atk_action_get_n_actions")] #[doc(alias = "get_n_actions")] fn n_actions(&self) -> i32; #[doc(alias = "atk_action_get_name")] #[doc(alias = "get_name")] fn name(&self, i: i32) -> Option; #[doc(alias = "atk_action_set_description")] fn set_description(&self, i: i32, desc: &str) -> bool; } impl> AtkActionExt for O { fn do_action(&self, i: i32) -> bool { unsafe { from_glib(ffi::atk_action_do_action(self.as_ref().to_glib_none().0, i)) } } fn description(&self, i: i32) -> Option { unsafe { from_glib_none(ffi::atk_action_get_description( self.as_ref().to_glib_none().0, i, )) } } fn keybinding(&self, i: i32) -> Option { unsafe { from_glib_none(ffi::atk_action_get_keybinding( self.as_ref().to_glib_none().0, i, )) } } fn localized_name(&self, i: i32) -> Option { unsafe { from_glib_none(ffi::atk_action_get_localized_name( self.as_ref().to_glib_none().0, i, )) } } fn n_actions(&self) -> i32 { unsafe { ffi::atk_action_get_n_actions(self.as_ref().to_glib_none().0) } } fn name(&self, i: i32) -> Option { unsafe { from_glib_none(ffi::atk_action_get_name(self.as_ref().to_glib_none().0, i)) } } fn set_description(&self, i: i32, desc: &str) -> bool { unsafe { from_glib(ffi::atk_action_set_description( self.as_ref().to_glib_none().0, i, desc.to_glib_none().0, )) } } } impl fmt::Display for Action { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Action") } } atk-0.14.0/src/auto/alias.rs000064400000000000000000000003160072674642500137130ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #[allow(unused_imports)] use crate::auto::*; pub type State = u64; atk-0.14.0/src/auto/component.rs000064400000000000000000000211120072674642500146210ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::CoordType; use crate::Layer; use crate::Object; use crate::Rectangle; #[cfg(any(feature = "v2_30", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))] use crate::ScrollType; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use std::boxed::Box as Box_; use std::fmt; use std::mem; use std::mem::transmute; glib::wrapper! { #[doc(alias = "AtkComponent")] pub struct Component(Interface); match fn { type_ => || ffi::atk_component_get_type(), } } pub const NONE_COMPONENT: Option<&Component> = None; pub trait ComponentExt: 'static { #[doc(alias = "atk_component_contains")] fn contains(&self, x: i32, y: i32, coord_type: CoordType) -> bool; #[doc(alias = "atk_component_get_alpha")] #[doc(alias = "get_alpha")] fn alpha(&self) -> f64; #[doc(alias = "atk_component_get_extents")] #[doc(alias = "get_extents")] fn extents(&self, coord_type: CoordType) -> (i32, i32, i32, i32); #[doc(alias = "atk_component_get_layer")] #[doc(alias = "get_layer")] fn layer(&self) -> Layer; #[doc(alias = "atk_component_get_mdi_zorder")] #[doc(alias = "get_mdi_zorder")] fn mdi_zorder(&self) -> i32; #[doc(alias = "atk_component_get_position")] #[doc(alias = "get_position")] fn position(&self, coord_type: CoordType) -> (i32, i32); #[doc(alias = "atk_component_get_size")] #[doc(alias = "get_size")] fn size(&self) -> (i32, i32); #[doc(alias = "atk_component_grab_focus")] fn grab_focus(&self) -> bool; #[doc(alias = "atk_component_ref_accessible_at_point")] fn ref_accessible_at_point(&self, x: i32, y: i32, coord_type: CoordType) -> Option; #[cfg(any(feature = "v2_30", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))] #[doc(alias = "atk_component_scroll_to")] fn scroll_to(&self, type_: ScrollType) -> bool; #[cfg(any(feature = "v2_30", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))] #[doc(alias = "atk_component_scroll_to_point")] fn scroll_to_point(&self, coords: CoordType, x: i32, y: i32) -> bool; #[doc(alias = "atk_component_set_extents")] fn set_extents(&self, x: i32, y: i32, width: i32, height: i32, coord_type: CoordType) -> bool; #[doc(alias = "atk_component_set_position")] fn set_position(&self, x: i32, y: i32, coord_type: CoordType) -> bool; #[doc(alias = "atk_component_set_size")] fn set_size(&self, width: i32, height: i32) -> bool; #[doc(alias = "bounds-changed")] fn connect_bounds_changed(&self, f: F) -> SignalHandlerId; } impl> ComponentExt for O { fn contains(&self, x: i32, y: i32, coord_type: CoordType) -> bool { unsafe { from_glib(ffi::atk_component_contains( self.as_ref().to_glib_none().0, x, y, coord_type.into_glib(), )) } } fn alpha(&self) -> f64 { unsafe { ffi::atk_component_get_alpha(self.as_ref().to_glib_none().0) } } fn extents(&self, coord_type: CoordType) -> (i32, i32, i32, i32) { unsafe { let mut x = mem::MaybeUninit::uninit(); let mut y = mem::MaybeUninit::uninit(); let mut width = mem::MaybeUninit::uninit(); let mut height = mem::MaybeUninit::uninit(); ffi::atk_component_get_extents( self.as_ref().to_glib_none().0, x.as_mut_ptr(), y.as_mut_ptr(), width.as_mut_ptr(), height.as_mut_ptr(), coord_type.into_glib(), ); let x = x.assume_init(); let y = y.assume_init(); let width = width.assume_init(); let height = height.assume_init(); (x, y, width, height) } } fn layer(&self) -> Layer { unsafe { from_glib(ffi::atk_component_get_layer(self.as_ref().to_glib_none().0)) } } fn mdi_zorder(&self) -> i32 { unsafe { ffi::atk_component_get_mdi_zorder(self.as_ref().to_glib_none().0) } } fn position(&self, coord_type: CoordType) -> (i32, i32) { unsafe { let mut x = mem::MaybeUninit::uninit(); let mut y = mem::MaybeUninit::uninit(); ffi::atk_component_get_position( self.as_ref().to_glib_none().0, x.as_mut_ptr(), y.as_mut_ptr(), coord_type.into_glib(), ); let x = x.assume_init(); let y = y.assume_init(); (x, y) } } fn size(&self) -> (i32, i32) { unsafe { let mut width = mem::MaybeUninit::uninit(); let mut height = mem::MaybeUninit::uninit(); ffi::atk_component_get_size( self.as_ref().to_glib_none().0, width.as_mut_ptr(), height.as_mut_ptr(), ); let width = width.assume_init(); let height = height.assume_init(); (width, height) } } fn grab_focus(&self) -> bool { unsafe { from_glib(ffi::atk_component_grab_focus( self.as_ref().to_glib_none().0, )) } } fn ref_accessible_at_point(&self, x: i32, y: i32, coord_type: CoordType) -> Option { unsafe { from_glib_full(ffi::atk_component_ref_accessible_at_point( self.as_ref().to_glib_none().0, x, y, coord_type.into_glib(), )) } } #[cfg(any(feature = "v2_30", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))] fn scroll_to(&self, type_: ScrollType) -> bool { unsafe { from_glib(ffi::atk_component_scroll_to( self.as_ref().to_glib_none().0, type_.into_glib(), )) } } #[cfg(any(feature = "v2_30", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))] fn scroll_to_point(&self, coords: CoordType, x: i32, y: i32) -> bool { unsafe { from_glib(ffi::atk_component_scroll_to_point( self.as_ref().to_glib_none().0, coords.into_glib(), x, y, )) } } fn set_extents(&self, x: i32, y: i32, width: i32, height: i32, coord_type: CoordType) -> bool { unsafe { from_glib(ffi::atk_component_set_extents( self.as_ref().to_glib_none().0, x, y, width, height, coord_type.into_glib(), )) } } fn set_position(&self, x: i32, y: i32, coord_type: CoordType) -> bool { unsafe { from_glib(ffi::atk_component_set_position( self.as_ref().to_glib_none().0, x, y, coord_type.into_glib(), )) } } fn set_size(&self, width: i32, height: i32) -> bool { unsafe { from_glib(ffi::atk_component_set_size( self.as_ref().to_glib_none().0, width, height, )) } } fn connect_bounds_changed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn bounds_changed_trampoline< P: IsA, F: Fn(&P, &Rectangle) + 'static, >( this: *mut ffi::AtkComponent, arg1: *mut ffi::AtkRectangle, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( Component::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(arg1), ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"bounds-changed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( bounds_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl fmt::Display for Component { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Component") } } atk-0.14.0/src/auto/document.rs000064400000000000000000000155060072674642500144470ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use std::boxed::Box as Box_; use std::fmt; use std::mem::transmute; glib::wrapper! { #[doc(alias = "AtkDocument")] pub struct Document(Interface); match fn { type_ => || ffi::atk_document_get_type(), } } pub const NONE_DOCUMENT: Option<&Document> = None; pub trait DocumentExt: 'static { #[doc(alias = "atk_document_get_attribute_value")] #[doc(alias = "get_attribute_value")] fn attribute_value(&self, attribute_name: &str) -> Option; //#[doc(alias = "atk_document_get_attributes")] //#[doc(alias = "get_attributes")] //fn attributes(&self) -> /*Ignored*/Option; #[doc(alias = "atk_document_get_current_page_number")] #[doc(alias = "get_current_page_number")] fn current_page_number(&self) -> i32; //#[doc(alias = "atk_document_get_document")] //#[doc(alias = "get_document")] //fn document(&self) -> /*Unimplemented*/Option; #[doc(alias = "atk_document_get_document_type")] #[doc(alias = "get_document_type")] fn document_type(&self) -> Option; #[doc(alias = "atk_document_get_page_count")] #[doc(alias = "get_page_count")] fn page_count(&self) -> i32; #[doc(alias = "atk_document_set_attribute_value")] fn set_attribute_value(&self, attribute_name: &str, attribute_value: &str) -> bool; #[doc(alias = "load-complete")] fn connect_load_complete(&self, f: F) -> SignalHandlerId; #[doc(alias = "load-stopped")] fn connect_load_stopped(&self, f: F) -> SignalHandlerId; #[doc(alias = "page-changed")] fn connect_page_changed(&self, f: F) -> SignalHandlerId; #[doc(alias = "reload")] fn connect_reload(&self, f: F) -> SignalHandlerId; } impl> DocumentExt for O { fn attribute_value(&self, attribute_name: &str) -> Option { unsafe { from_glib_none(ffi::atk_document_get_attribute_value( self.as_ref().to_glib_none().0, attribute_name.to_glib_none().0, )) } } //fn attributes(&self) -> /*Ignored*/Option { // unsafe { TODO: call ffi:atk_document_get_attributes() } //} fn current_page_number(&self) -> i32 { unsafe { ffi::atk_document_get_current_page_number(self.as_ref().to_glib_none().0) } } //fn document(&self) -> /*Unimplemented*/Option { // unsafe { TODO: call ffi:atk_document_get_document() } //} fn document_type(&self) -> Option { unsafe { from_glib_none(ffi::atk_document_get_document_type( self.as_ref().to_glib_none().0, )) } } fn page_count(&self) -> i32 { unsafe { ffi::atk_document_get_page_count(self.as_ref().to_glib_none().0) } } fn set_attribute_value(&self, attribute_name: &str, attribute_value: &str) -> bool { unsafe { from_glib(ffi::atk_document_set_attribute_value( self.as_ref().to_glib_none().0, attribute_name.to_glib_none().0, attribute_value.to_glib_none().0, )) } } fn connect_load_complete(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn load_complete_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkDocument, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Document::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"load-complete\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( load_complete_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_load_stopped(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn load_stopped_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkDocument, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Document::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"load-stopped\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( load_stopped_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_page_changed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn page_changed_trampoline, F: Fn(&P, i32) + 'static>( this: *mut ffi::AtkDocument, page_number: libc::c_int, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( Document::from_glib_borrow(this).unsafe_cast_ref(), page_number, ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"page-changed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( page_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_reload(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn reload_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkDocument, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Document::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"reload\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( reload_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl fmt::Display for Document { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Document") } } atk-0.14.0/src/auto/editable_text.rs000064400000000000000000000050460072674642500154440ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::object::IsA; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "AtkEditableText")] pub struct EditableText(Interface); match fn { type_ => || ffi::atk_editable_text_get_type(), } } pub const NONE_EDITABLE_TEXT: Option<&EditableText> = None; pub trait EditableTextExt: 'static { #[doc(alias = "atk_editable_text_copy_text")] fn copy_text(&self, start_pos: i32, end_pos: i32); #[doc(alias = "atk_editable_text_cut_text")] fn cut_text(&self, start_pos: i32, end_pos: i32); #[doc(alias = "atk_editable_text_delete_text")] fn delete_text(&self, start_pos: i32, end_pos: i32); #[doc(alias = "atk_editable_text_paste_text")] fn paste_text(&self, position: i32); //#[doc(alias = "atk_editable_text_set_run_attributes")] //fn set_run_attributes(&self, attrib_set: /*Ignored*/&mut AttributeSet, start_offset: i32, end_offset: i32) -> bool; #[doc(alias = "atk_editable_text_set_text_contents")] fn set_text_contents(&self, string: &str); } impl> EditableTextExt for O { fn copy_text(&self, start_pos: i32, end_pos: i32) { unsafe { ffi::atk_editable_text_copy_text(self.as_ref().to_glib_none().0, start_pos, end_pos); } } fn cut_text(&self, start_pos: i32, end_pos: i32) { unsafe { ffi::atk_editable_text_cut_text(self.as_ref().to_glib_none().0, start_pos, end_pos); } } fn delete_text(&self, start_pos: i32, end_pos: i32) { unsafe { ffi::atk_editable_text_delete_text(self.as_ref().to_glib_none().0, start_pos, end_pos); } } fn paste_text(&self, position: i32) { unsafe { ffi::atk_editable_text_paste_text(self.as_ref().to_glib_none().0, position); } } //fn set_run_attributes(&self, attrib_set: /*Ignored*/&mut AttributeSet, start_offset: i32, end_offset: i32) -> bool { // unsafe { TODO: call ffi:atk_editable_text_set_run_attributes() } //} fn set_text_contents(&self, string: &str) { unsafe { ffi::atk_editable_text_set_text_contents( self.as_ref().to_glib_none().0, string.to_glib_none().0, ); } } } impl fmt::Display for EditableText { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("EditableText") } } atk-0.14.0/src/auto/enums.rs000064400000000000000000002432730072674642500137640ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::translate::*; use glib::value::FromValue; use glib::value::ToValue; use glib::StaticType; use glib::Type; use std::fmt; #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "AtkCoordType")] pub enum CoordType { #[doc(alias = "ATK_XY_SCREEN")] Screen, #[doc(alias = "ATK_XY_WINDOW")] Window, #[doc(alias = "ATK_XY_PARENT")] Parent, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for CoordType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "CoordType::{}", match *self { Self::Screen => "Screen", Self::Window => "Window", Self::Parent => "Parent", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for CoordType { type GlibType = ffi::AtkCoordType; fn into_glib(self) -> ffi::AtkCoordType { match self { Self::Screen => ffi::ATK_XY_SCREEN, Self::Window => ffi::ATK_XY_WINDOW, Self::Parent => ffi::ATK_XY_PARENT, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for CoordType { unsafe fn from_glib(value: ffi::AtkCoordType) -> Self { skip_assert_initialized!(); match value { ffi::ATK_XY_SCREEN => Self::Screen, ffi::ATK_XY_WINDOW => Self::Window, ffi::ATK_XY_PARENT => Self::Parent, value => Self::__Unknown(value), } } } impl StaticType for CoordType { fn static_type() -> Type { unsafe { from_glib(ffi::atk_coord_type_get_type()) } } } impl glib::value::ValueType for CoordType { type Type = Self; } unsafe impl<'a> FromValue<'a> for CoordType { type Checker = glib::value::GenericValueTypeChecker; unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for CoordType { fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } fn value_type(&self) -> glib::Type { Self::static_type() } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "AtkLayer")] pub enum Layer { #[doc(alias = "ATK_LAYER_INVALID")] Invalid, #[doc(alias = "ATK_LAYER_BACKGROUND")] Background, #[doc(alias = "ATK_LAYER_CANVAS")] Canvas, #[doc(alias = "ATK_LAYER_WIDGET")] Widget, #[doc(alias = "ATK_LAYER_MDI")] Mdi, #[doc(alias = "ATK_LAYER_POPUP")] Popup, #[doc(alias = "ATK_LAYER_OVERLAY")] Overlay, #[doc(alias = "ATK_LAYER_WINDOW")] Window, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for Layer { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "Layer::{}", match *self { Self::Invalid => "Invalid", Self::Background => "Background", Self::Canvas => "Canvas", Self::Widget => "Widget", Self::Mdi => "Mdi", Self::Popup => "Popup", Self::Overlay => "Overlay", Self::Window => "Window", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for Layer { type GlibType = ffi::AtkLayer; fn into_glib(self) -> ffi::AtkLayer { match self { Self::Invalid => ffi::ATK_LAYER_INVALID, Self::Background => ffi::ATK_LAYER_BACKGROUND, Self::Canvas => ffi::ATK_LAYER_CANVAS, Self::Widget => ffi::ATK_LAYER_WIDGET, Self::Mdi => ffi::ATK_LAYER_MDI, Self::Popup => ffi::ATK_LAYER_POPUP, Self::Overlay => ffi::ATK_LAYER_OVERLAY, Self::Window => ffi::ATK_LAYER_WINDOW, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for Layer { unsafe fn from_glib(value: ffi::AtkLayer) -> Self { skip_assert_initialized!(); match value { ffi::ATK_LAYER_INVALID => Self::Invalid, ffi::ATK_LAYER_BACKGROUND => Self::Background, ffi::ATK_LAYER_CANVAS => Self::Canvas, ffi::ATK_LAYER_WIDGET => Self::Widget, ffi::ATK_LAYER_MDI => Self::Mdi, ffi::ATK_LAYER_POPUP => Self::Popup, ffi::ATK_LAYER_OVERLAY => Self::Overlay, ffi::ATK_LAYER_WINDOW => Self::Window, value => Self::__Unknown(value), } } } impl StaticType for Layer { fn static_type() -> Type { unsafe { from_glib(ffi::atk_layer_get_type()) } } } impl glib::value::ValueType for Layer { type Type = Self; } unsafe impl<'a> FromValue<'a> for Layer { type Checker = glib::value::GenericValueTypeChecker; unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for Layer { fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } fn value_type(&self) -> glib::Type { Self::static_type() } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "AtkRelationType")] pub enum RelationType { #[doc(alias = "ATK_RELATION_NULL")] Null, #[doc(alias = "ATK_RELATION_CONTROLLED_BY")] ControlledBy, #[doc(alias = "ATK_RELATION_CONTROLLER_FOR")] ControllerFor, #[doc(alias = "ATK_RELATION_LABEL_FOR")] LabelFor, #[doc(alias = "ATK_RELATION_LABELLED_BY")] LabelledBy, #[doc(alias = "ATK_RELATION_MEMBER_OF")] MemberOf, #[doc(alias = "ATK_RELATION_NODE_CHILD_OF")] NodeChildOf, #[doc(alias = "ATK_RELATION_FLOWS_TO")] FlowsTo, #[doc(alias = "ATK_RELATION_FLOWS_FROM")] FlowsFrom, #[doc(alias = "ATK_RELATION_SUBWINDOW_OF")] SubwindowOf, #[doc(alias = "ATK_RELATION_EMBEDS")] Embeds, #[doc(alias = "ATK_RELATION_EMBEDDED_BY")] EmbeddedBy, #[doc(alias = "ATK_RELATION_POPUP_FOR")] PopupFor, #[doc(alias = "ATK_RELATION_PARENT_WINDOW_OF")] ParentWindowOf, #[doc(alias = "ATK_RELATION_DESCRIBED_BY")] DescribedBy, #[doc(alias = "ATK_RELATION_DESCRIPTION_FOR")] DescriptionFor, #[doc(alias = "ATK_RELATION_NODE_PARENT_OF")] NodeParentOf, #[doc(alias = "ATK_RELATION_DETAILS")] Details, #[doc(alias = "ATK_RELATION_DETAILS_FOR")] DetailsFor, #[doc(alias = "ATK_RELATION_ERROR_MESSAGE")] ErrorMessage, #[doc(alias = "ATK_RELATION_ERROR_FOR")] ErrorFor, #[doc(alias = "ATK_RELATION_LAST_DEFINED")] LastDefined, #[doc(hidden)] __Unknown(i32), } impl RelationType { #[doc(alias = "atk_relation_type_for_name")] pub fn for_name(name: &str) -> RelationType { assert_initialized_main_thread!(); unsafe { from_glib(ffi::atk_relation_type_for_name(name.to_glib_none().0)) } } #[doc(alias = "atk_relation_type_get_name")] #[doc(alias = "get_name")] pub fn name(self) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::atk_relation_type_get_name(self.into_glib())) } } } impl fmt::Display for RelationType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "RelationType::{}", match *self { Self::Null => "Null", Self::ControlledBy => "ControlledBy", Self::ControllerFor => "ControllerFor", Self::LabelFor => "LabelFor", Self::LabelledBy => "LabelledBy", Self::MemberOf => "MemberOf", Self::NodeChildOf => "NodeChildOf", Self::FlowsTo => "FlowsTo", Self::FlowsFrom => "FlowsFrom", Self::SubwindowOf => "SubwindowOf", Self::Embeds => "Embeds", Self::EmbeddedBy => "EmbeddedBy", Self::PopupFor => "PopupFor", Self::ParentWindowOf => "ParentWindowOf", Self::DescribedBy => "DescribedBy", Self::DescriptionFor => "DescriptionFor", Self::NodeParentOf => "NodeParentOf", Self::Details => "Details", Self::DetailsFor => "DetailsFor", Self::ErrorMessage => "ErrorMessage", Self::ErrorFor => "ErrorFor", Self::LastDefined => "LastDefined", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for RelationType { type GlibType = ffi::AtkRelationType; fn into_glib(self) -> ffi::AtkRelationType { match self { Self::Null => ffi::ATK_RELATION_NULL, Self::ControlledBy => ffi::ATK_RELATION_CONTROLLED_BY, Self::ControllerFor => ffi::ATK_RELATION_CONTROLLER_FOR, Self::LabelFor => ffi::ATK_RELATION_LABEL_FOR, Self::LabelledBy => ffi::ATK_RELATION_LABELLED_BY, Self::MemberOf => ffi::ATK_RELATION_MEMBER_OF, Self::NodeChildOf => ffi::ATK_RELATION_NODE_CHILD_OF, Self::FlowsTo => ffi::ATK_RELATION_FLOWS_TO, Self::FlowsFrom => ffi::ATK_RELATION_FLOWS_FROM, Self::SubwindowOf => ffi::ATK_RELATION_SUBWINDOW_OF, Self::Embeds => ffi::ATK_RELATION_EMBEDS, Self::EmbeddedBy => ffi::ATK_RELATION_EMBEDDED_BY, Self::PopupFor => ffi::ATK_RELATION_POPUP_FOR, Self::ParentWindowOf => ffi::ATK_RELATION_PARENT_WINDOW_OF, Self::DescribedBy => ffi::ATK_RELATION_DESCRIBED_BY, Self::DescriptionFor => ffi::ATK_RELATION_DESCRIPTION_FOR, Self::NodeParentOf => ffi::ATK_RELATION_NODE_PARENT_OF, Self::Details => ffi::ATK_RELATION_DETAILS, Self::DetailsFor => ffi::ATK_RELATION_DETAILS_FOR, Self::ErrorMessage => ffi::ATK_RELATION_ERROR_MESSAGE, Self::ErrorFor => ffi::ATK_RELATION_ERROR_FOR, Self::LastDefined => ffi::ATK_RELATION_LAST_DEFINED, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for RelationType { unsafe fn from_glib(value: ffi::AtkRelationType) -> Self { skip_assert_initialized!(); match value { ffi::ATK_RELATION_NULL => Self::Null, ffi::ATK_RELATION_CONTROLLED_BY => Self::ControlledBy, ffi::ATK_RELATION_CONTROLLER_FOR => Self::ControllerFor, ffi::ATK_RELATION_LABEL_FOR => Self::LabelFor, ffi::ATK_RELATION_LABELLED_BY => Self::LabelledBy, ffi::ATK_RELATION_MEMBER_OF => Self::MemberOf, ffi::ATK_RELATION_NODE_CHILD_OF => Self::NodeChildOf, ffi::ATK_RELATION_FLOWS_TO => Self::FlowsTo, ffi::ATK_RELATION_FLOWS_FROM => Self::FlowsFrom, ffi::ATK_RELATION_SUBWINDOW_OF => Self::SubwindowOf, ffi::ATK_RELATION_EMBEDS => Self::Embeds, ffi::ATK_RELATION_EMBEDDED_BY => Self::EmbeddedBy, ffi::ATK_RELATION_POPUP_FOR => Self::PopupFor, ffi::ATK_RELATION_PARENT_WINDOW_OF => Self::ParentWindowOf, ffi::ATK_RELATION_DESCRIBED_BY => Self::DescribedBy, ffi::ATK_RELATION_DESCRIPTION_FOR => Self::DescriptionFor, ffi::ATK_RELATION_NODE_PARENT_OF => Self::NodeParentOf, ffi::ATK_RELATION_DETAILS => Self::Details, ffi::ATK_RELATION_DETAILS_FOR => Self::DetailsFor, ffi::ATK_RELATION_ERROR_MESSAGE => Self::ErrorMessage, ffi::ATK_RELATION_ERROR_FOR => Self::ErrorFor, ffi::ATK_RELATION_LAST_DEFINED => Self::LastDefined, value => Self::__Unknown(value), } } } impl StaticType for RelationType { fn static_type() -> Type { unsafe { from_glib(ffi::atk_relation_type_get_type()) } } } impl glib::value::ValueType for RelationType { type Type = Self; } unsafe impl<'a> FromValue<'a> for RelationType { type Checker = glib::value::GenericValueTypeChecker; unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for RelationType { fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } fn value_type(&self) -> glib::Type { Self::static_type() } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "AtkRole")] pub enum Role { #[doc(alias = "ATK_ROLE_INVALID")] Invalid, #[doc(alias = "ATK_ROLE_ACCEL_LABEL")] AcceleratorLabel, #[doc(alias = "ATK_ROLE_ALERT")] Alert, #[doc(alias = "ATK_ROLE_ANIMATION")] Animation, #[doc(alias = "ATK_ROLE_ARROW")] Arrow, #[doc(alias = "ATK_ROLE_CALENDAR")] Calendar, #[doc(alias = "ATK_ROLE_CANVAS")] Canvas, #[doc(alias = "ATK_ROLE_CHECK_BOX")] CheckBox, #[doc(alias = "ATK_ROLE_CHECK_MENU_ITEM")] CheckMenuItem, #[doc(alias = "ATK_ROLE_COLOR_CHOOSER")] ColorChooser, #[doc(alias = "ATK_ROLE_COLUMN_HEADER")] ColumnHeader, #[doc(alias = "ATK_ROLE_COMBO_BOX")] ComboBox, #[doc(alias = "ATK_ROLE_DATE_EDITOR")] DateEditor, #[doc(alias = "ATK_ROLE_DESKTOP_ICON")] DesktopIcon, #[doc(alias = "ATK_ROLE_DESKTOP_FRAME")] DesktopFrame, #[doc(alias = "ATK_ROLE_DIAL")] Dial, #[doc(alias = "ATK_ROLE_DIALOG")] Dialog, #[doc(alias = "ATK_ROLE_DIRECTORY_PANE")] DirectoryPane, #[doc(alias = "ATK_ROLE_DRAWING_AREA")] DrawingArea, #[doc(alias = "ATK_ROLE_FILE_CHOOSER")] FileChooser, #[doc(alias = "ATK_ROLE_FILLER")] Filler, #[doc(alias = "ATK_ROLE_FONT_CHOOSER")] FontChooser, #[doc(alias = "ATK_ROLE_FRAME")] Frame, #[doc(alias = "ATK_ROLE_GLASS_PANE")] GlassPane, #[doc(alias = "ATK_ROLE_HTML_CONTAINER")] HtmlContainer, #[doc(alias = "ATK_ROLE_ICON")] Icon, #[doc(alias = "ATK_ROLE_IMAGE")] Image, #[doc(alias = "ATK_ROLE_INTERNAL_FRAME")] InternalFrame, #[doc(alias = "ATK_ROLE_LABEL")] Label, #[doc(alias = "ATK_ROLE_LAYERED_PANE")] LayeredPane, #[doc(alias = "ATK_ROLE_LIST")] List, #[doc(alias = "ATK_ROLE_LIST_ITEM")] ListItem, #[doc(alias = "ATK_ROLE_MENU")] Menu, #[doc(alias = "ATK_ROLE_MENU_BAR")] MenuBar, #[doc(alias = "ATK_ROLE_MENU_ITEM")] MenuItem, #[doc(alias = "ATK_ROLE_OPTION_PANE")] OptionPane, #[doc(alias = "ATK_ROLE_PAGE_TAB")] PageTab, #[doc(alias = "ATK_ROLE_PAGE_TAB_LIST")] PageTabList, #[doc(alias = "ATK_ROLE_PANEL")] Panel, #[doc(alias = "ATK_ROLE_PASSWORD_TEXT")] PasswordText, #[doc(alias = "ATK_ROLE_POPUP_MENU")] PopupMenu, #[doc(alias = "ATK_ROLE_PROGRESS_BAR")] ProgressBar, #[doc(alias = "ATK_ROLE_PUSH_BUTTON")] PushButton, #[doc(alias = "ATK_ROLE_RADIO_BUTTON")] RadioButton, #[doc(alias = "ATK_ROLE_RADIO_MENU_ITEM")] RadioMenuItem, #[doc(alias = "ATK_ROLE_ROOT_PANE")] RootPane, #[doc(alias = "ATK_ROLE_ROW_HEADER")] RowHeader, #[doc(alias = "ATK_ROLE_SCROLL_BAR")] ScrollBar, #[doc(alias = "ATK_ROLE_SCROLL_PANE")] ScrollPane, #[doc(alias = "ATK_ROLE_SEPARATOR")] Separator, #[doc(alias = "ATK_ROLE_SLIDER")] Slider, #[doc(alias = "ATK_ROLE_SPLIT_PANE")] SplitPane, #[doc(alias = "ATK_ROLE_SPIN_BUTTON")] SpinButton, #[doc(alias = "ATK_ROLE_STATUSBAR")] Statusbar, #[doc(alias = "ATK_ROLE_TABLE")] Table, #[doc(alias = "ATK_ROLE_TABLE_CELL")] TableCell, #[doc(alias = "ATK_ROLE_TABLE_COLUMN_HEADER")] TableColumnHeader, #[doc(alias = "ATK_ROLE_TABLE_ROW_HEADER")] TableRowHeader, #[doc(alias = "ATK_ROLE_TEAR_OFF_MENU_ITEM")] TearOffMenuItem, #[doc(alias = "ATK_ROLE_TERMINAL")] Terminal, #[doc(alias = "ATK_ROLE_TEXT")] Text, #[doc(alias = "ATK_ROLE_TOGGLE_BUTTON")] ToggleButton, #[doc(alias = "ATK_ROLE_TOOL_BAR")] ToolBar, #[doc(alias = "ATK_ROLE_TOOL_TIP")] ToolTip, #[doc(alias = "ATK_ROLE_TREE")] Tree, #[doc(alias = "ATK_ROLE_TREE_TABLE")] TreeTable, #[doc(alias = "ATK_ROLE_UNKNOWN")] Unknown, #[doc(alias = "ATK_ROLE_VIEWPORT")] Viewport, #[doc(alias = "ATK_ROLE_WINDOW")] Window, #[doc(alias = "ATK_ROLE_HEADER")] Header, #[doc(alias = "ATK_ROLE_FOOTER")] Footer, #[doc(alias = "ATK_ROLE_PARAGRAPH")] Paragraph, #[doc(alias = "ATK_ROLE_RULER")] Ruler, #[doc(alias = "ATK_ROLE_APPLICATION")] Application, #[doc(alias = "ATK_ROLE_AUTOCOMPLETE")] Autocomplete, #[doc(alias = "ATK_ROLE_EDITBAR")] EditBar, #[doc(alias = "ATK_ROLE_EMBEDDED")] Embedded, #[doc(alias = "ATK_ROLE_ENTRY")] Entry, #[doc(alias = "ATK_ROLE_CHART")] Chart, #[doc(alias = "ATK_ROLE_CAPTION")] Caption, #[doc(alias = "ATK_ROLE_DOCUMENT_FRAME")] DocumentFrame, #[doc(alias = "ATK_ROLE_HEADING")] Heading, #[doc(alias = "ATK_ROLE_PAGE")] Page, #[doc(alias = "ATK_ROLE_SECTION")] Section, #[doc(alias = "ATK_ROLE_REDUNDANT_OBJECT")] RedundantObject, #[doc(alias = "ATK_ROLE_FORM")] Form, #[doc(alias = "ATK_ROLE_LINK")] Link, #[doc(alias = "ATK_ROLE_INPUT_METHOD_WINDOW")] InputMethodWindow, #[doc(alias = "ATK_ROLE_TABLE_ROW")] TableRow, #[doc(alias = "ATK_ROLE_TREE_ITEM")] TreeItem, #[doc(alias = "ATK_ROLE_DOCUMENT_SPREADSHEET")] DocumentSpreadsheet, #[doc(alias = "ATK_ROLE_DOCUMENT_PRESENTATION")] DocumentPresentation, #[doc(alias = "ATK_ROLE_DOCUMENT_TEXT")] DocumentText, #[doc(alias = "ATK_ROLE_DOCUMENT_WEB")] DocumentWeb, #[doc(alias = "ATK_ROLE_DOCUMENT_EMAIL")] DocumentEmail, #[doc(alias = "ATK_ROLE_COMMENT")] Comment, #[doc(alias = "ATK_ROLE_LIST_BOX")] ListBox, #[doc(alias = "ATK_ROLE_GROUPING")] Grouping, #[doc(alias = "ATK_ROLE_IMAGE_MAP")] ImageMap, #[doc(alias = "ATK_ROLE_NOTIFICATION")] Notification, #[doc(alias = "ATK_ROLE_INFO_BAR")] InfoBar, #[doc(alias = "ATK_ROLE_LEVEL_BAR")] LevelBar, #[doc(alias = "ATK_ROLE_TITLE_BAR")] TitleBar, #[doc(alias = "ATK_ROLE_BLOCK_QUOTE")] BlockQuote, #[doc(alias = "ATK_ROLE_AUDIO")] Audio, #[doc(alias = "ATK_ROLE_VIDEO")] Video, #[doc(alias = "ATK_ROLE_DEFINITION")] Definition, #[doc(alias = "ATK_ROLE_ARTICLE")] Article, #[doc(alias = "ATK_ROLE_LANDMARK")] Landmark, #[doc(alias = "ATK_ROLE_LOG")] Log, #[doc(alias = "ATK_ROLE_MARQUEE")] Marquee, #[doc(alias = "ATK_ROLE_MATH")] Math, #[doc(alias = "ATK_ROLE_RATING")] Rating, #[doc(alias = "ATK_ROLE_TIMER")] Timer, #[doc(alias = "ATK_ROLE_DESCRIPTION_LIST")] DescriptionList, #[doc(alias = "ATK_ROLE_DESCRIPTION_TERM")] DescriptionTerm, #[doc(alias = "ATK_ROLE_DESCRIPTION_VALUE")] DescriptionValue, #[doc(alias = "ATK_ROLE_STATIC")] Static, #[doc(alias = "ATK_ROLE_MATH_FRACTION")] MathFraction, #[doc(alias = "ATK_ROLE_MATH_ROOT")] MathRoot, #[doc(alias = "ATK_ROLE_SUBSCRIPT")] Subscript, #[doc(alias = "ATK_ROLE_SUPERSCRIPT")] Superscript, #[doc(alias = "ATK_ROLE_FOOTNOTE")] Footnote, #[doc(alias = "ATK_ROLE_CONTENT_DELETION")] ContentDeletion, #[doc(alias = "ATK_ROLE_CONTENT_INSERTION")] ContentInsertion, #[doc(alias = "ATK_ROLE_MARK")] Mark, #[doc(alias = "ATK_ROLE_SUGGESTION")] Suggestion, #[doc(alias = "ATK_ROLE_LAST_DEFINED")] LastDefined, #[doc(hidden)] __Unknown(i32), } impl Role { #[doc(alias = "atk_role_for_name")] pub fn for_name(name: &str) -> Role { assert_initialized_main_thread!(); unsafe { from_glib(ffi::atk_role_for_name(name.to_glib_none().0)) } } #[doc(alias = "atk_role_get_localized_name")] #[doc(alias = "get_localized_name")] pub fn localized_name(self) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::atk_role_get_localized_name(self.into_glib())) } } #[doc(alias = "atk_role_get_name")] #[doc(alias = "get_name")] pub fn name(self) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::atk_role_get_name(self.into_glib())) } } } impl fmt::Display for Role { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "Role::{}", match *self { Self::Invalid => "Invalid", Self::AcceleratorLabel => "AcceleratorLabel", Self::Alert => "Alert", Self::Animation => "Animation", Self::Arrow => "Arrow", Self::Calendar => "Calendar", Self::Canvas => "Canvas", Self::CheckBox => "CheckBox", Self::CheckMenuItem => "CheckMenuItem", Self::ColorChooser => "ColorChooser", Self::ColumnHeader => "ColumnHeader", Self::ComboBox => "ComboBox", Self::DateEditor => "DateEditor", Self::DesktopIcon => "DesktopIcon", Self::DesktopFrame => "DesktopFrame", Self::Dial => "Dial", Self::Dialog => "Dialog", Self::DirectoryPane => "DirectoryPane", Self::DrawingArea => "DrawingArea", Self::FileChooser => "FileChooser", Self::Filler => "Filler", Self::FontChooser => "FontChooser", Self::Frame => "Frame", Self::GlassPane => "GlassPane", Self::HtmlContainer => "HtmlContainer", Self::Icon => "Icon", Self::Image => "Image", Self::InternalFrame => "InternalFrame", Self::Label => "Label", Self::LayeredPane => "LayeredPane", Self::List => "List", Self::ListItem => "ListItem", Self::Menu => "Menu", Self::MenuBar => "MenuBar", Self::MenuItem => "MenuItem", Self::OptionPane => "OptionPane", Self::PageTab => "PageTab", Self::PageTabList => "PageTabList", Self::Panel => "Panel", Self::PasswordText => "PasswordText", Self::PopupMenu => "PopupMenu", Self::ProgressBar => "ProgressBar", Self::PushButton => "PushButton", Self::RadioButton => "RadioButton", Self::RadioMenuItem => "RadioMenuItem", Self::RootPane => "RootPane", Self::RowHeader => "RowHeader", Self::ScrollBar => "ScrollBar", Self::ScrollPane => "ScrollPane", Self::Separator => "Separator", Self::Slider => "Slider", Self::SplitPane => "SplitPane", Self::SpinButton => "SpinButton", Self::Statusbar => "Statusbar", Self::Table => "Table", Self::TableCell => "TableCell", Self::TableColumnHeader => "TableColumnHeader", Self::TableRowHeader => "TableRowHeader", Self::TearOffMenuItem => "TearOffMenuItem", Self::Terminal => "Terminal", Self::Text => "Text", Self::ToggleButton => "ToggleButton", Self::ToolBar => "ToolBar", Self::ToolTip => "ToolTip", Self::Tree => "Tree", Self::TreeTable => "TreeTable", Self::Unknown => "Unknown", Self::Viewport => "Viewport", Self::Window => "Window", Self::Header => "Header", Self::Footer => "Footer", Self::Paragraph => "Paragraph", Self::Ruler => "Ruler", Self::Application => "Application", Self::Autocomplete => "Autocomplete", Self::EditBar => "EditBar", Self::Embedded => "Embedded", Self::Entry => "Entry", Self::Chart => "Chart", Self::Caption => "Caption", Self::DocumentFrame => "DocumentFrame", Self::Heading => "Heading", Self::Page => "Page", Self::Section => "Section", Self::RedundantObject => "RedundantObject", Self::Form => "Form", Self::Link => "Link", Self::InputMethodWindow => "InputMethodWindow", Self::TableRow => "TableRow", Self::TreeItem => "TreeItem", Self::DocumentSpreadsheet => "DocumentSpreadsheet", Self::DocumentPresentation => "DocumentPresentation", Self::DocumentText => "DocumentText", Self::DocumentWeb => "DocumentWeb", Self::DocumentEmail => "DocumentEmail", Self::Comment => "Comment", Self::ListBox => "ListBox", Self::Grouping => "Grouping", Self::ImageMap => "ImageMap", Self::Notification => "Notification", Self::InfoBar => "InfoBar", Self::LevelBar => "LevelBar", Self::TitleBar => "TitleBar", Self::BlockQuote => "BlockQuote", Self::Audio => "Audio", Self::Video => "Video", Self::Definition => "Definition", Self::Article => "Article", Self::Landmark => "Landmark", Self::Log => "Log", Self::Marquee => "Marquee", Self::Math => "Math", Self::Rating => "Rating", Self::Timer => "Timer", Self::DescriptionList => "DescriptionList", Self::DescriptionTerm => "DescriptionTerm", Self::DescriptionValue => "DescriptionValue", Self::Static => "Static", Self::MathFraction => "MathFraction", Self::MathRoot => "MathRoot", Self::Subscript => "Subscript", Self::Superscript => "Superscript", Self::Footnote => "Footnote", Self::ContentDeletion => "ContentDeletion", Self::ContentInsertion => "ContentInsertion", Self::Mark => "Mark", Self::Suggestion => "Suggestion", Self::LastDefined => "LastDefined", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for Role { type GlibType = ffi::AtkRole; fn into_glib(self) -> ffi::AtkRole { match self { Self::Invalid => ffi::ATK_ROLE_INVALID, Self::AcceleratorLabel => ffi::ATK_ROLE_ACCEL_LABEL, Self::Alert => ffi::ATK_ROLE_ALERT, Self::Animation => ffi::ATK_ROLE_ANIMATION, Self::Arrow => ffi::ATK_ROLE_ARROW, Self::Calendar => ffi::ATK_ROLE_CALENDAR, Self::Canvas => ffi::ATK_ROLE_CANVAS, Self::CheckBox => ffi::ATK_ROLE_CHECK_BOX, Self::CheckMenuItem => ffi::ATK_ROLE_CHECK_MENU_ITEM, Self::ColorChooser => ffi::ATK_ROLE_COLOR_CHOOSER, Self::ColumnHeader => ffi::ATK_ROLE_COLUMN_HEADER, Self::ComboBox => ffi::ATK_ROLE_COMBO_BOX, Self::DateEditor => ffi::ATK_ROLE_DATE_EDITOR, Self::DesktopIcon => ffi::ATK_ROLE_DESKTOP_ICON, Self::DesktopFrame => ffi::ATK_ROLE_DESKTOP_FRAME, Self::Dial => ffi::ATK_ROLE_DIAL, Self::Dialog => ffi::ATK_ROLE_DIALOG, Self::DirectoryPane => ffi::ATK_ROLE_DIRECTORY_PANE, Self::DrawingArea => ffi::ATK_ROLE_DRAWING_AREA, Self::FileChooser => ffi::ATK_ROLE_FILE_CHOOSER, Self::Filler => ffi::ATK_ROLE_FILLER, Self::FontChooser => ffi::ATK_ROLE_FONT_CHOOSER, Self::Frame => ffi::ATK_ROLE_FRAME, Self::GlassPane => ffi::ATK_ROLE_GLASS_PANE, Self::HtmlContainer => ffi::ATK_ROLE_HTML_CONTAINER, Self::Icon => ffi::ATK_ROLE_ICON, Self::Image => ffi::ATK_ROLE_IMAGE, Self::InternalFrame => ffi::ATK_ROLE_INTERNAL_FRAME, Self::Label => ffi::ATK_ROLE_LABEL, Self::LayeredPane => ffi::ATK_ROLE_LAYERED_PANE, Self::List => ffi::ATK_ROLE_LIST, Self::ListItem => ffi::ATK_ROLE_LIST_ITEM, Self::Menu => ffi::ATK_ROLE_MENU, Self::MenuBar => ffi::ATK_ROLE_MENU_BAR, Self::MenuItem => ffi::ATK_ROLE_MENU_ITEM, Self::OptionPane => ffi::ATK_ROLE_OPTION_PANE, Self::PageTab => ffi::ATK_ROLE_PAGE_TAB, Self::PageTabList => ffi::ATK_ROLE_PAGE_TAB_LIST, Self::Panel => ffi::ATK_ROLE_PANEL, Self::PasswordText => ffi::ATK_ROLE_PASSWORD_TEXT, Self::PopupMenu => ffi::ATK_ROLE_POPUP_MENU, Self::ProgressBar => ffi::ATK_ROLE_PROGRESS_BAR, Self::PushButton => ffi::ATK_ROLE_PUSH_BUTTON, Self::RadioButton => ffi::ATK_ROLE_RADIO_BUTTON, Self::RadioMenuItem => ffi::ATK_ROLE_RADIO_MENU_ITEM, Self::RootPane => ffi::ATK_ROLE_ROOT_PANE, Self::RowHeader => ffi::ATK_ROLE_ROW_HEADER, Self::ScrollBar => ffi::ATK_ROLE_SCROLL_BAR, Self::ScrollPane => ffi::ATK_ROLE_SCROLL_PANE, Self::Separator => ffi::ATK_ROLE_SEPARATOR, Self::Slider => ffi::ATK_ROLE_SLIDER, Self::SplitPane => ffi::ATK_ROLE_SPLIT_PANE, Self::SpinButton => ffi::ATK_ROLE_SPIN_BUTTON, Self::Statusbar => ffi::ATK_ROLE_STATUSBAR, Self::Table => ffi::ATK_ROLE_TABLE, Self::TableCell => ffi::ATK_ROLE_TABLE_CELL, Self::TableColumnHeader => ffi::ATK_ROLE_TABLE_COLUMN_HEADER, Self::TableRowHeader => ffi::ATK_ROLE_TABLE_ROW_HEADER, Self::TearOffMenuItem => ffi::ATK_ROLE_TEAR_OFF_MENU_ITEM, Self::Terminal => ffi::ATK_ROLE_TERMINAL, Self::Text => ffi::ATK_ROLE_TEXT, Self::ToggleButton => ffi::ATK_ROLE_TOGGLE_BUTTON, Self::ToolBar => ffi::ATK_ROLE_TOOL_BAR, Self::ToolTip => ffi::ATK_ROLE_TOOL_TIP, Self::Tree => ffi::ATK_ROLE_TREE, Self::TreeTable => ffi::ATK_ROLE_TREE_TABLE, Self::Unknown => ffi::ATK_ROLE_UNKNOWN, Self::Viewport => ffi::ATK_ROLE_VIEWPORT, Self::Window => ffi::ATK_ROLE_WINDOW, Self::Header => ffi::ATK_ROLE_HEADER, Self::Footer => ffi::ATK_ROLE_FOOTER, Self::Paragraph => ffi::ATK_ROLE_PARAGRAPH, Self::Ruler => ffi::ATK_ROLE_RULER, Self::Application => ffi::ATK_ROLE_APPLICATION, Self::Autocomplete => ffi::ATK_ROLE_AUTOCOMPLETE, Self::EditBar => ffi::ATK_ROLE_EDITBAR, Self::Embedded => ffi::ATK_ROLE_EMBEDDED, Self::Entry => ffi::ATK_ROLE_ENTRY, Self::Chart => ffi::ATK_ROLE_CHART, Self::Caption => ffi::ATK_ROLE_CAPTION, Self::DocumentFrame => ffi::ATK_ROLE_DOCUMENT_FRAME, Self::Heading => ffi::ATK_ROLE_HEADING, Self::Page => ffi::ATK_ROLE_PAGE, Self::Section => ffi::ATK_ROLE_SECTION, Self::RedundantObject => ffi::ATK_ROLE_REDUNDANT_OBJECT, Self::Form => ffi::ATK_ROLE_FORM, Self::Link => ffi::ATK_ROLE_LINK, Self::InputMethodWindow => ffi::ATK_ROLE_INPUT_METHOD_WINDOW, Self::TableRow => ffi::ATK_ROLE_TABLE_ROW, Self::TreeItem => ffi::ATK_ROLE_TREE_ITEM, Self::DocumentSpreadsheet => ffi::ATK_ROLE_DOCUMENT_SPREADSHEET, Self::DocumentPresentation => ffi::ATK_ROLE_DOCUMENT_PRESENTATION, Self::DocumentText => ffi::ATK_ROLE_DOCUMENT_TEXT, Self::DocumentWeb => ffi::ATK_ROLE_DOCUMENT_WEB, Self::DocumentEmail => ffi::ATK_ROLE_DOCUMENT_EMAIL, Self::Comment => ffi::ATK_ROLE_COMMENT, Self::ListBox => ffi::ATK_ROLE_LIST_BOX, Self::Grouping => ffi::ATK_ROLE_GROUPING, Self::ImageMap => ffi::ATK_ROLE_IMAGE_MAP, Self::Notification => ffi::ATK_ROLE_NOTIFICATION, Self::InfoBar => ffi::ATK_ROLE_INFO_BAR, Self::LevelBar => ffi::ATK_ROLE_LEVEL_BAR, Self::TitleBar => ffi::ATK_ROLE_TITLE_BAR, Self::BlockQuote => ffi::ATK_ROLE_BLOCK_QUOTE, Self::Audio => ffi::ATK_ROLE_AUDIO, Self::Video => ffi::ATK_ROLE_VIDEO, Self::Definition => ffi::ATK_ROLE_DEFINITION, Self::Article => ffi::ATK_ROLE_ARTICLE, Self::Landmark => ffi::ATK_ROLE_LANDMARK, Self::Log => ffi::ATK_ROLE_LOG, Self::Marquee => ffi::ATK_ROLE_MARQUEE, Self::Math => ffi::ATK_ROLE_MATH, Self::Rating => ffi::ATK_ROLE_RATING, Self::Timer => ffi::ATK_ROLE_TIMER, Self::DescriptionList => ffi::ATK_ROLE_DESCRIPTION_LIST, Self::DescriptionTerm => ffi::ATK_ROLE_DESCRIPTION_TERM, Self::DescriptionValue => ffi::ATK_ROLE_DESCRIPTION_VALUE, Self::Static => ffi::ATK_ROLE_STATIC, Self::MathFraction => ffi::ATK_ROLE_MATH_FRACTION, Self::MathRoot => ffi::ATK_ROLE_MATH_ROOT, Self::Subscript => ffi::ATK_ROLE_SUBSCRIPT, Self::Superscript => ffi::ATK_ROLE_SUPERSCRIPT, Self::Footnote => ffi::ATK_ROLE_FOOTNOTE, Self::ContentDeletion => ffi::ATK_ROLE_CONTENT_DELETION, Self::ContentInsertion => ffi::ATK_ROLE_CONTENT_INSERTION, Self::Mark => ffi::ATK_ROLE_MARK, Self::Suggestion => ffi::ATK_ROLE_SUGGESTION, Self::LastDefined => ffi::ATK_ROLE_LAST_DEFINED, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for Role { unsafe fn from_glib(value: ffi::AtkRole) -> Self { skip_assert_initialized!(); match value { ffi::ATK_ROLE_INVALID => Self::Invalid, ffi::ATK_ROLE_ACCEL_LABEL => Self::AcceleratorLabel, ffi::ATK_ROLE_ALERT => Self::Alert, ffi::ATK_ROLE_ANIMATION => Self::Animation, ffi::ATK_ROLE_ARROW => Self::Arrow, ffi::ATK_ROLE_CALENDAR => Self::Calendar, ffi::ATK_ROLE_CANVAS => Self::Canvas, ffi::ATK_ROLE_CHECK_BOX => Self::CheckBox, ffi::ATK_ROLE_CHECK_MENU_ITEM => Self::CheckMenuItem, ffi::ATK_ROLE_COLOR_CHOOSER => Self::ColorChooser, ffi::ATK_ROLE_COLUMN_HEADER => Self::ColumnHeader, ffi::ATK_ROLE_COMBO_BOX => Self::ComboBox, ffi::ATK_ROLE_DATE_EDITOR => Self::DateEditor, ffi::ATK_ROLE_DESKTOP_ICON => Self::DesktopIcon, ffi::ATK_ROLE_DESKTOP_FRAME => Self::DesktopFrame, ffi::ATK_ROLE_DIAL => Self::Dial, ffi::ATK_ROLE_DIALOG => Self::Dialog, ffi::ATK_ROLE_DIRECTORY_PANE => Self::DirectoryPane, ffi::ATK_ROLE_DRAWING_AREA => Self::DrawingArea, ffi::ATK_ROLE_FILE_CHOOSER => Self::FileChooser, ffi::ATK_ROLE_FILLER => Self::Filler, ffi::ATK_ROLE_FONT_CHOOSER => Self::FontChooser, ffi::ATK_ROLE_FRAME => Self::Frame, ffi::ATK_ROLE_GLASS_PANE => Self::GlassPane, ffi::ATK_ROLE_HTML_CONTAINER => Self::HtmlContainer, ffi::ATK_ROLE_ICON => Self::Icon, ffi::ATK_ROLE_IMAGE => Self::Image, ffi::ATK_ROLE_INTERNAL_FRAME => Self::InternalFrame, ffi::ATK_ROLE_LABEL => Self::Label, ffi::ATK_ROLE_LAYERED_PANE => Self::LayeredPane, ffi::ATK_ROLE_LIST => Self::List, ffi::ATK_ROLE_LIST_ITEM => Self::ListItem, ffi::ATK_ROLE_MENU => Self::Menu, ffi::ATK_ROLE_MENU_BAR => Self::MenuBar, ffi::ATK_ROLE_MENU_ITEM => Self::MenuItem, ffi::ATK_ROLE_OPTION_PANE => Self::OptionPane, ffi::ATK_ROLE_PAGE_TAB => Self::PageTab, ffi::ATK_ROLE_PAGE_TAB_LIST => Self::PageTabList, ffi::ATK_ROLE_PANEL => Self::Panel, ffi::ATK_ROLE_PASSWORD_TEXT => Self::PasswordText, ffi::ATK_ROLE_POPUP_MENU => Self::PopupMenu, ffi::ATK_ROLE_PROGRESS_BAR => Self::ProgressBar, ffi::ATK_ROLE_PUSH_BUTTON => Self::PushButton, ffi::ATK_ROLE_RADIO_BUTTON => Self::RadioButton, ffi::ATK_ROLE_RADIO_MENU_ITEM => Self::RadioMenuItem, ffi::ATK_ROLE_ROOT_PANE => Self::RootPane, ffi::ATK_ROLE_ROW_HEADER => Self::RowHeader, ffi::ATK_ROLE_SCROLL_BAR => Self::ScrollBar, ffi::ATK_ROLE_SCROLL_PANE => Self::ScrollPane, ffi::ATK_ROLE_SEPARATOR => Self::Separator, ffi::ATK_ROLE_SLIDER => Self::Slider, ffi::ATK_ROLE_SPLIT_PANE => Self::SplitPane, ffi::ATK_ROLE_SPIN_BUTTON => Self::SpinButton, ffi::ATK_ROLE_STATUSBAR => Self::Statusbar, ffi::ATK_ROLE_TABLE => Self::Table, ffi::ATK_ROLE_TABLE_CELL => Self::TableCell, ffi::ATK_ROLE_TABLE_COLUMN_HEADER => Self::TableColumnHeader, ffi::ATK_ROLE_TABLE_ROW_HEADER => Self::TableRowHeader, ffi::ATK_ROLE_TEAR_OFF_MENU_ITEM => Self::TearOffMenuItem, ffi::ATK_ROLE_TERMINAL => Self::Terminal, ffi::ATK_ROLE_TEXT => Self::Text, ffi::ATK_ROLE_TOGGLE_BUTTON => Self::ToggleButton, ffi::ATK_ROLE_TOOL_BAR => Self::ToolBar, ffi::ATK_ROLE_TOOL_TIP => Self::ToolTip, ffi::ATK_ROLE_TREE => Self::Tree, ffi::ATK_ROLE_TREE_TABLE => Self::TreeTable, ffi::ATK_ROLE_UNKNOWN => Self::Unknown, ffi::ATK_ROLE_VIEWPORT => Self::Viewport, ffi::ATK_ROLE_WINDOW => Self::Window, ffi::ATK_ROLE_HEADER => Self::Header, ffi::ATK_ROLE_FOOTER => Self::Footer, ffi::ATK_ROLE_PARAGRAPH => Self::Paragraph, ffi::ATK_ROLE_RULER => Self::Ruler, ffi::ATK_ROLE_APPLICATION => Self::Application, ffi::ATK_ROLE_AUTOCOMPLETE => Self::Autocomplete, ffi::ATK_ROLE_EDITBAR => Self::EditBar, ffi::ATK_ROLE_EMBEDDED => Self::Embedded, ffi::ATK_ROLE_ENTRY => Self::Entry, ffi::ATK_ROLE_CHART => Self::Chart, ffi::ATK_ROLE_CAPTION => Self::Caption, ffi::ATK_ROLE_DOCUMENT_FRAME => Self::DocumentFrame, ffi::ATK_ROLE_HEADING => Self::Heading, ffi::ATK_ROLE_PAGE => Self::Page, ffi::ATK_ROLE_SECTION => Self::Section, ffi::ATK_ROLE_REDUNDANT_OBJECT => Self::RedundantObject, ffi::ATK_ROLE_FORM => Self::Form, ffi::ATK_ROLE_LINK => Self::Link, ffi::ATK_ROLE_INPUT_METHOD_WINDOW => Self::InputMethodWindow, ffi::ATK_ROLE_TABLE_ROW => Self::TableRow, ffi::ATK_ROLE_TREE_ITEM => Self::TreeItem, ffi::ATK_ROLE_DOCUMENT_SPREADSHEET => Self::DocumentSpreadsheet, ffi::ATK_ROLE_DOCUMENT_PRESENTATION => Self::DocumentPresentation, ffi::ATK_ROLE_DOCUMENT_TEXT => Self::DocumentText, ffi::ATK_ROLE_DOCUMENT_WEB => Self::DocumentWeb, ffi::ATK_ROLE_DOCUMENT_EMAIL => Self::DocumentEmail, ffi::ATK_ROLE_COMMENT => Self::Comment, ffi::ATK_ROLE_LIST_BOX => Self::ListBox, ffi::ATK_ROLE_GROUPING => Self::Grouping, ffi::ATK_ROLE_IMAGE_MAP => Self::ImageMap, ffi::ATK_ROLE_NOTIFICATION => Self::Notification, ffi::ATK_ROLE_INFO_BAR => Self::InfoBar, ffi::ATK_ROLE_LEVEL_BAR => Self::LevelBar, ffi::ATK_ROLE_TITLE_BAR => Self::TitleBar, ffi::ATK_ROLE_BLOCK_QUOTE => Self::BlockQuote, ffi::ATK_ROLE_AUDIO => Self::Audio, ffi::ATK_ROLE_VIDEO => Self::Video, ffi::ATK_ROLE_DEFINITION => Self::Definition, ffi::ATK_ROLE_ARTICLE => Self::Article, ffi::ATK_ROLE_LANDMARK => Self::Landmark, ffi::ATK_ROLE_LOG => Self::Log, ffi::ATK_ROLE_MARQUEE => Self::Marquee, ffi::ATK_ROLE_MATH => Self::Math, ffi::ATK_ROLE_RATING => Self::Rating, ffi::ATK_ROLE_TIMER => Self::Timer, ffi::ATK_ROLE_DESCRIPTION_LIST => Self::DescriptionList, ffi::ATK_ROLE_DESCRIPTION_TERM => Self::DescriptionTerm, ffi::ATK_ROLE_DESCRIPTION_VALUE => Self::DescriptionValue, ffi::ATK_ROLE_STATIC => Self::Static, ffi::ATK_ROLE_MATH_FRACTION => Self::MathFraction, ffi::ATK_ROLE_MATH_ROOT => Self::MathRoot, ffi::ATK_ROLE_SUBSCRIPT => Self::Subscript, ffi::ATK_ROLE_SUPERSCRIPT => Self::Superscript, ffi::ATK_ROLE_FOOTNOTE => Self::Footnote, ffi::ATK_ROLE_CONTENT_DELETION => Self::ContentDeletion, ffi::ATK_ROLE_CONTENT_INSERTION => Self::ContentInsertion, ffi::ATK_ROLE_MARK => Self::Mark, ffi::ATK_ROLE_SUGGESTION => Self::Suggestion, ffi::ATK_ROLE_LAST_DEFINED => Self::LastDefined, value => Self::__Unknown(value), } } } impl StaticType for Role { fn static_type() -> Type { unsafe { from_glib(ffi::atk_role_get_type()) } } } impl glib::value::ValueType for Role { type Type = Self; } unsafe impl<'a> FromValue<'a> for Role { type Checker = glib::value::GenericValueTypeChecker; unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for Role { fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } fn value_type(&self) -> glib::Type { Self::static_type() } } #[cfg(any(feature = "v2_30", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "AtkScrollType")] pub enum ScrollType { #[doc(alias = "ATK_SCROLL_TOP_LEFT")] TopLeft, #[doc(alias = "ATK_SCROLL_BOTTOM_RIGHT")] BottomRight, #[doc(alias = "ATK_SCROLL_TOP_EDGE")] TopEdge, #[doc(alias = "ATK_SCROLL_BOTTOM_EDGE")] BottomEdge, #[doc(alias = "ATK_SCROLL_LEFT_EDGE")] LeftEdge, #[doc(alias = "ATK_SCROLL_RIGHT_EDGE")] RightEdge, #[doc(alias = "ATK_SCROLL_ANYWHERE")] Anywhere, #[doc(hidden)] __Unknown(i32), } #[cfg(any(feature = "v2_30", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))] impl fmt::Display for ScrollType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "ScrollType::{}", match *self { Self::TopLeft => "TopLeft", Self::BottomRight => "BottomRight", Self::TopEdge => "TopEdge", Self::BottomEdge => "BottomEdge", Self::LeftEdge => "LeftEdge", Self::RightEdge => "RightEdge", Self::Anywhere => "Anywhere", _ => "Unknown", } ) } } #[cfg(any(feature = "v2_30", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))] #[doc(hidden)] impl IntoGlib for ScrollType { type GlibType = ffi::AtkScrollType; fn into_glib(self) -> ffi::AtkScrollType { match self { Self::TopLeft => ffi::ATK_SCROLL_TOP_LEFT, Self::BottomRight => ffi::ATK_SCROLL_BOTTOM_RIGHT, Self::TopEdge => ffi::ATK_SCROLL_TOP_EDGE, Self::BottomEdge => ffi::ATK_SCROLL_BOTTOM_EDGE, Self::LeftEdge => ffi::ATK_SCROLL_LEFT_EDGE, Self::RightEdge => ffi::ATK_SCROLL_RIGHT_EDGE, Self::Anywhere => ffi::ATK_SCROLL_ANYWHERE, Self::__Unknown(value) => value, } } } #[cfg(any(feature = "v2_30", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))] #[doc(hidden)] impl FromGlib for ScrollType { unsafe fn from_glib(value: ffi::AtkScrollType) -> Self { skip_assert_initialized!(); match value { ffi::ATK_SCROLL_TOP_LEFT => Self::TopLeft, ffi::ATK_SCROLL_BOTTOM_RIGHT => Self::BottomRight, ffi::ATK_SCROLL_TOP_EDGE => Self::TopEdge, ffi::ATK_SCROLL_BOTTOM_EDGE => Self::BottomEdge, ffi::ATK_SCROLL_LEFT_EDGE => Self::LeftEdge, ffi::ATK_SCROLL_RIGHT_EDGE => Self::RightEdge, ffi::ATK_SCROLL_ANYWHERE => Self::Anywhere, value => Self::__Unknown(value), } } } #[cfg(any(feature = "v2_30", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))] impl StaticType for ScrollType { fn static_type() -> Type { unsafe { from_glib(ffi::atk_scroll_type_get_type()) } } } #[cfg(any(feature = "v2_30", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))] impl glib::value::ValueType for ScrollType { type Type = Self; } #[cfg(any(feature = "v2_30", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))] unsafe impl<'a> FromValue<'a> for ScrollType { type Checker = glib::value::GenericValueTypeChecker; unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } #[cfg(any(feature = "v2_30", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))] impl ToValue for ScrollType { fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } fn value_type(&self) -> glib::Type { Self::static_type() } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "AtkStateType")] pub enum StateType { #[doc(alias = "ATK_STATE_INVALID")] Invalid, #[doc(alias = "ATK_STATE_ACTIVE")] Active, #[doc(alias = "ATK_STATE_ARMED")] Armed, #[doc(alias = "ATK_STATE_BUSY")] Busy, #[doc(alias = "ATK_STATE_CHECKED")] Checked, #[doc(alias = "ATK_STATE_DEFUNCT")] Defunct, #[doc(alias = "ATK_STATE_EDITABLE")] Editable, #[doc(alias = "ATK_STATE_ENABLED")] Enabled, #[doc(alias = "ATK_STATE_EXPANDABLE")] Expandable, #[doc(alias = "ATK_STATE_EXPANDED")] Expanded, #[doc(alias = "ATK_STATE_FOCUSABLE")] Focusable, #[doc(alias = "ATK_STATE_FOCUSED")] Focused, #[doc(alias = "ATK_STATE_HORIZONTAL")] Horizontal, #[doc(alias = "ATK_STATE_ICONIFIED")] Iconified, #[doc(alias = "ATK_STATE_MODAL")] Modal, #[doc(alias = "ATK_STATE_MULTI_LINE")] MultiLine, #[doc(alias = "ATK_STATE_MULTISELECTABLE")] Multiselectable, #[doc(alias = "ATK_STATE_OPAQUE")] Opaque, #[doc(alias = "ATK_STATE_PRESSED")] Pressed, #[doc(alias = "ATK_STATE_RESIZABLE")] Resizable, #[doc(alias = "ATK_STATE_SELECTABLE")] Selectable, #[doc(alias = "ATK_STATE_SELECTED")] Selected, #[doc(alias = "ATK_STATE_SENSITIVE")] Sensitive, #[doc(alias = "ATK_STATE_SHOWING")] Showing, #[doc(alias = "ATK_STATE_SINGLE_LINE")] SingleLine, #[doc(alias = "ATK_STATE_STALE")] Stale, #[doc(alias = "ATK_STATE_TRANSIENT")] Transient, #[doc(alias = "ATK_STATE_VERTICAL")] Vertical, #[doc(alias = "ATK_STATE_VISIBLE")] Visible, #[doc(alias = "ATK_STATE_MANAGES_DESCENDANTS")] ManagesDescendants, #[doc(alias = "ATK_STATE_INDETERMINATE")] Indeterminate, #[doc(alias = "ATK_STATE_TRUNCATED")] Truncated, #[doc(alias = "ATK_STATE_REQUIRED")] Required, #[doc(alias = "ATK_STATE_INVALID_ENTRY")] InvalidEntry, #[doc(alias = "ATK_STATE_SUPPORTS_AUTOCOMPLETION")] SupportsAutocompletion, #[doc(alias = "ATK_STATE_SELECTABLE_TEXT")] SelectableText, #[doc(alias = "ATK_STATE_DEFAULT")] Default, #[doc(alias = "ATK_STATE_ANIMATED")] Animated, #[doc(alias = "ATK_STATE_VISITED")] Visited, #[doc(alias = "ATK_STATE_CHECKABLE")] Checkable, #[doc(alias = "ATK_STATE_HAS_POPUP")] HasPopup, #[doc(alias = "ATK_STATE_HAS_TOOLTIP")] HasTooltip, #[doc(alias = "ATK_STATE_READ_ONLY")] ReadOnly, #[doc(alias = "ATK_STATE_LAST_DEFINED")] LastDefined, #[doc(hidden)] __Unknown(i32), } impl StateType { #[doc(alias = "atk_state_type_for_name")] pub fn for_name(name: &str) -> StateType { assert_initialized_main_thread!(); unsafe { from_glib(ffi::atk_state_type_for_name(name.to_glib_none().0)) } } #[doc(alias = "atk_state_type_get_name")] #[doc(alias = "get_name")] pub fn name(self) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::atk_state_type_get_name(self.into_glib())) } } } impl fmt::Display for StateType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "StateType::{}", match *self { Self::Invalid => "Invalid", Self::Active => "Active", Self::Armed => "Armed", Self::Busy => "Busy", Self::Checked => "Checked", Self::Defunct => "Defunct", Self::Editable => "Editable", Self::Enabled => "Enabled", Self::Expandable => "Expandable", Self::Expanded => "Expanded", Self::Focusable => "Focusable", Self::Focused => "Focused", Self::Horizontal => "Horizontal", Self::Iconified => "Iconified", Self::Modal => "Modal", Self::MultiLine => "MultiLine", Self::Multiselectable => "Multiselectable", Self::Opaque => "Opaque", Self::Pressed => "Pressed", Self::Resizable => "Resizable", Self::Selectable => "Selectable", Self::Selected => "Selected", Self::Sensitive => "Sensitive", Self::Showing => "Showing", Self::SingleLine => "SingleLine", Self::Stale => "Stale", Self::Transient => "Transient", Self::Vertical => "Vertical", Self::Visible => "Visible", Self::ManagesDescendants => "ManagesDescendants", Self::Indeterminate => "Indeterminate", Self::Truncated => "Truncated", Self::Required => "Required", Self::InvalidEntry => "InvalidEntry", Self::SupportsAutocompletion => "SupportsAutocompletion", Self::SelectableText => "SelectableText", Self::Default => "Default", Self::Animated => "Animated", Self::Visited => "Visited", Self::Checkable => "Checkable", Self::HasPopup => "HasPopup", Self::HasTooltip => "HasTooltip", Self::ReadOnly => "ReadOnly", Self::LastDefined => "LastDefined", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for StateType { type GlibType = ffi::AtkStateType; fn into_glib(self) -> ffi::AtkStateType { match self { Self::Invalid => ffi::ATK_STATE_INVALID, Self::Active => ffi::ATK_STATE_ACTIVE, Self::Armed => ffi::ATK_STATE_ARMED, Self::Busy => ffi::ATK_STATE_BUSY, Self::Checked => ffi::ATK_STATE_CHECKED, Self::Defunct => ffi::ATK_STATE_DEFUNCT, Self::Editable => ffi::ATK_STATE_EDITABLE, Self::Enabled => ffi::ATK_STATE_ENABLED, Self::Expandable => ffi::ATK_STATE_EXPANDABLE, Self::Expanded => ffi::ATK_STATE_EXPANDED, Self::Focusable => ffi::ATK_STATE_FOCUSABLE, Self::Focused => ffi::ATK_STATE_FOCUSED, Self::Horizontal => ffi::ATK_STATE_HORIZONTAL, Self::Iconified => ffi::ATK_STATE_ICONIFIED, Self::Modal => ffi::ATK_STATE_MODAL, Self::MultiLine => ffi::ATK_STATE_MULTI_LINE, Self::Multiselectable => ffi::ATK_STATE_MULTISELECTABLE, Self::Opaque => ffi::ATK_STATE_OPAQUE, Self::Pressed => ffi::ATK_STATE_PRESSED, Self::Resizable => ffi::ATK_STATE_RESIZABLE, Self::Selectable => ffi::ATK_STATE_SELECTABLE, Self::Selected => ffi::ATK_STATE_SELECTED, Self::Sensitive => ffi::ATK_STATE_SENSITIVE, Self::Showing => ffi::ATK_STATE_SHOWING, Self::SingleLine => ffi::ATK_STATE_SINGLE_LINE, Self::Stale => ffi::ATK_STATE_STALE, Self::Transient => ffi::ATK_STATE_TRANSIENT, Self::Vertical => ffi::ATK_STATE_VERTICAL, Self::Visible => ffi::ATK_STATE_VISIBLE, Self::ManagesDescendants => ffi::ATK_STATE_MANAGES_DESCENDANTS, Self::Indeterminate => ffi::ATK_STATE_INDETERMINATE, Self::Truncated => ffi::ATK_STATE_TRUNCATED, Self::Required => ffi::ATK_STATE_REQUIRED, Self::InvalidEntry => ffi::ATK_STATE_INVALID_ENTRY, Self::SupportsAutocompletion => ffi::ATK_STATE_SUPPORTS_AUTOCOMPLETION, Self::SelectableText => ffi::ATK_STATE_SELECTABLE_TEXT, Self::Default => ffi::ATK_STATE_DEFAULT, Self::Animated => ffi::ATK_STATE_ANIMATED, Self::Visited => ffi::ATK_STATE_VISITED, Self::Checkable => ffi::ATK_STATE_CHECKABLE, Self::HasPopup => ffi::ATK_STATE_HAS_POPUP, Self::HasTooltip => ffi::ATK_STATE_HAS_TOOLTIP, Self::ReadOnly => ffi::ATK_STATE_READ_ONLY, Self::LastDefined => ffi::ATK_STATE_LAST_DEFINED, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for StateType { unsafe fn from_glib(value: ffi::AtkStateType) -> Self { skip_assert_initialized!(); match value { ffi::ATK_STATE_INVALID => Self::Invalid, ffi::ATK_STATE_ACTIVE => Self::Active, ffi::ATK_STATE_ARMED => Self::Armed, ffi::ATK_STATE_BUSY => Self::Busy, ffi::ATK_STATE_CHECKED => Self::Checked, ffi::ATK_STATE_DEFUNCT => Self::Defunct, ffi::ATK_STATE_EDITABLE => Self::Editable, ffi::ATK_STATE_ENABLED => Self::Enabled, ffi::ATK_STATE_EXPANDABLE => Self::Expandable, ffi::ATK_STATE_EXPANDED => Self::Expanded, ffi::ATK_STATE_FOCUSABLE => Self::Focusable, ffi::ATK_STATE_FOCUSED => Self::Focused, ffi::ATK_STATE_HORIZONTAL => Self::Horizontal, ffi::ATK_STATE_ICONIFIED => Self::Iconified, ffi::ATK_STATE_MODAL => Self::Modal, ffi::ATK_STATE_MULTI_LINE => Self::MultiLine, ffi::ATK_STATE_MULTISELECTABLE => Self::Multiselectable, ffi::ATK_STATE_OPAQUE => Self::Opaque, ffi::ATK_STATE_PRESSED => Self::Pressed, ffi::ATK_STATE_RESIZABLE => Self::Resizable, ffi::ATK_STATE_SELECTABLE => Self::Selectable, ffi::ATK_STATE_SELECTED => Self::Selected, ffi::ATK_STATE_SENSITIVE => Self::Sensitive, ffi::ATK_STATE_SHOWING => Self::Showing, ffi::ATK_STATE_SINGLE_LINE => Self::SingleLine, ffi::ATK_STATE_STALE => Self::Stale, ffi::ATK_STATE_TRANSIENT => Self::Transient, ffi::ATK_STATE_VERTICAL => Self::Vertical, ffi::ATK_STATE_VISIBLE => Self::Visible, ffi::ATK_STATE_MANAGES_DESCENDANTS => Self::ManagesDescendants, ffi::ATK_STATE_INDETERMINATE => Self::Indeterminate, ffi::ATK_STATE_TRUNCATED => Self::Truncated, ffi::ATK_STATE_REQUIRED => Self::Required, ffi::ATK_STATE_INVALID_ENTRY => Self::InvalidEntry, ffi::ATK_STATE_SUPPORTS_AUTOCOMPLETION => Self::SupportsAutocompletion, ffi::ATK_STATE_SELECTABLE_TEXT => Self::SelectableText, ffi::ATK_STATE_DEFAULT => Self::Default, ffi::ATK_STATE_ANIMATED => Self::Animated, ffi::ATK_STATE_VISITED => Self::Visited, ffi::ATK_STATE_CHECKABLE => Self::Checkable, ffi::ATK_STATE_HAS_POPUP => Self::HasPopup, ffi::ATK_STATE_HAS_TOOLTIP => Self::HasTooltip, ffi::ATK_STATE_READ_ONLY => Self::ReadOnly, ffi::ATK_STATE_LAST_DEFINED => Self::LastDefined, value => Self::__Unknown(value), } } } impl StaticType for StateType { fn static_type() -> Type { unsafe { from_glib(ffi::atk_state_type_get_type()) } } } impl glib::value::ValueType for StateType { type Type = Self; } unsafe impl<'a> FromValue<'a> for StateType { type Checker = glib::value::GenericValueTypeChecker; unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for StateType { fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } fn value_type(&self) -> glib::Type { Self::static_type() } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "AtkTextAttribute")] pub enum TextAttribute { #[doc(alias = "ATK_TEXT_ATTR_INVALID")] Invalid, #[doc(alias = "ATK_TEXT_ATTR_LEFT_MARGIN")] LeftMargin, #[doc(alias = "ATK_TEXT_ATTR_RIGHT_MARGIN")] RightMargin, #[doc(alias = "ATK_TEXT_ATTR_INDENT")] Indent, #[doc(alias = "ATK_TEXT_ATTR_INVISIBLE")] Invisible, #[doc(alias = "ATK_TEXT_ATTR_EDITABLE")] Editable, #[doc(alias = "ATK_TEXT_ATTR_PIXELS_ABOVE_LINES")] PixelsAboveLines, #[doc(alias = "ATK_TEXT_ATTR_PIXELS_BELOW_LINES")] PixelsBelowLines, #[doc(alias = "ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP")] PixelsInsideWrap, #[doc(alias = "ATK_TEXT_ATTR_BG_FULL_HEIGHT")] BgFullHeight, #[doc(alias = "ATK_TEXT_ATTR_RISE")] Rise, #[doc(alias = "ATK_TEXT_ATTR_UNDERLINE")] Underline, #[doc(alias = "ATK_TEXT_ATTR_STRIKETHROUGH")] Strikethrough, #[doc(alias = "ATK_TEXT_ATTR_SIZE")] Size, #[doc(alias = "ATK_TEXT_ATTR_SCALE")] Scale, #[doc(alias = "ATK_TEXT_ATTR_WEIGHT")] Weight, #[doc(alias = "ATK_TEXT_ATTR_LANGUAGE")] Language, #[doc(alias = "ATK_TEXT_ATTR_FAMILY_NAME")] FamilyName, #[doc(alias = "ATK_TEXT_ATTR_BG_COLOR")] BgColor, #[doc(alias = "ATK_TEXT_ATTR_FG_COLOR")] FgColor, #[doc(alias = "ATK_TEXT_ATTR_BG_STIPPLE")] BgStipple, #[doc(alias = "ATK_TEXT_ATTR_FG_STIPPLE")] FgStipple, #[doc(alias = "ATK_TEXT_ATTR_WRAP_MODE")] WrapMode, #[doc(alias = "ATK_TEXT_ATTR_DIRECTION")] Direction, #[doc(alias = "ATK_TEXT_ATTR_JUSTIFICATION")] Justification, #[doc(alias = "ATK_TEXT_ATTR_STRETCH")] Stretch, #[doc(alias = "ATK_TEXT_ATTR_VARIANT")] Variant, #[doc(alias = "ATK_TEXT_ATTR_STYLE")] Style, #[doc(alias = "ATK_TEXT_ATTR_TEXT_POSITION")] TextPosition, #[doc(alias = "ATK_TEXT_ATTR_LAST_DEFINED")] LastDefined, #[doc(hidden)] __Unknown(i32), } impl TextAttribute { #[doc(alias = "atk_text_attribute_for_name")] pub fn for_name(name: &str) -> TextAttribute { assert_initialized_main_thread!(); unsafe { from_glib(ffi::atk_text_attribute_for_name(name.to_glib_none().0)) } } #[doc(alias = "atk_text_attribute_get_name")] #[doc(alias = "get_name")] pub fn name(self) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::atk_text_attribute_get_name(self.into_glib())) } } #[doc(alias = "atk_text_attribute_get_value")] #[doc(alias = "get_value")] pub fn value(self, index_: i32) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::atk_text_attribute_get_value(self.into_glib(), index_)) } } } impl fmt::Display for TextAttribute { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "TextAttribute::{}", match *self { Self::Invalid => "Invalid", Self::LeftMargin => "LeftMargin", Self::RightMargin => "RightMargin", Self::Indent => "Indent", Self::Invisible => "Invisible", Self::Editable => "Editable", Self::PixelsAboveLines => "PixelsAboveLines", Self::PixelsBelowLines => "PixelsBelowLines", Self::PixelsInsideWrap => "PixelsInsideWrap", Self::BgFullHeight => "BgFullHeight", Self::Rise => "Rise", Self::Underline => "Underline", Self::Strikethrough => "Strikethrough", Self::Size => "Size", Self::Scale => "Scale", Self::Weight => "Weight", Self::Language => "Language", Self::FamilyName => "FamilyName", Self::BgColor => "BgColor", Self::FgColor => "FgColor", Self::BgStipple => "BgStipple", Self::FgStipple => "FgStipple", Self::WrapMode => "WrapMode", Self::Direction => "Direction", Self::Justification => "Justification", Self::Stretch => "Stretch", Self::Variant => "Variant", Self::Style => "Style", Self::TextPosition => "TextPosition", Self::LastDefined => "LastDefined", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for TextAttribute { type GlibType = ffi::AtkTextAttribute; fn into_glib(self) -> ffi::AtkTextAttribute { match self { Self::Invalid => ffi::ATK_TEXT_ATTR_INVALID, Self::LeftMargin => ffi::ATK_TEXT_ATTR_LEFT_MARGIN, Self::RightMargin => ffi::ATK_TEXT_ATTR_RIGHT_MARGIN, Self::Indent => ffi::ATK_TEXT_ATTR_INDENT, Self::Invisible => ffi::ATK_TEXT_ATTR_INVISIBLE, Self::Editable => ffi::ATK_TEXT_ATTR_EDITABLE, Self::PixelsAboveLines => ffi::ATK_TEXT_ATTR_PIXELS_ABOVE_LINES, Self::PixelsBelowLines => ffi::ATK_TEXT_ATTR_PIXELS_BELOW_LINES, Self::PixelsInsideWrap => ffi::ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP, Self::BgFullHeight => ffi::ATK_TEXT_ATTR_BG_FULL_HEIGHT, Self::Rise => ffi::ATK_TEXT_ATTR_RISE, Self::Underline => ffi::ATK_TEXT_ATTR_UNDERLINE, Self::Strikethrough => ffi::ATK_TEXT_ATTR_STRIKETHROUGH, Self::Size => ffi::ATK_TEXT_ATTR_SIZE, Self::Scale => ffi::ATK_TEXT_ATTR_SCALE, Self::Weight => ffi::ATK_TEXT_ATTR_WEIGHT, Self::Language => ffi::ATK_TEXT_ATTR_LANGUAGE, Self::FamilyName => ffi::ATK_TEXT_ATTR_FAMILY_NAME, Self::BgColor => ffi::ATK_TEXT_ATTR_BG_COLOR, Self::FgColor => ffi::ATK_TEXT_ATTR_FG_COLOR, Self::BgStipple => ffi::ATK_TEXT_ATTR_BG_STIPPLE, Self::FgStipple => ffi::ATK_TEXT_ATTR_FG_STIPPLE, Self::WrapMode => ffi::ATK_TEXT_ATTR_WRAP_MODE, Self::Direction => ffi::ATK_TEXT_ATTR_DIRECTION, Self::Justification => ffi::ATK_TEXT_ATTR_JUSTIFICATION, Self::Stretch => ffi::ATK_TEXT_ATTR_STRETCH, Self::Variant => ffi::ATK_TEXT_ATTR_VARIANT, Self::Style => ffi::ATK_TEXT_ATTR_STYLE, Self::TextPosition => ffi::ATK_TEXT_ATTR_TEXT_POSITION, Self::LastDefined => ffi::ATK_TEXT_ATTR_LAST_DEFINED, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for TextAttribute { unsafe fn from_glib(value: ffi::AtkTextAttribute) -> Self { skip_assert_initialized!(); match value { ffi::ATK_TEXT_ATTR_INVALID => Self::Invalid, ffi::ATK_TEXT_ATTR_LEFT_MARGIN => Self::LeftMargin, ffi::ATK_TEXT_ATTR_RIGHT_MARGIN => Self::RightMargin, ffi::ATK_TEXT_ATTR_INDENT => Self::Indent, ffi::ATK_TEXT_ATTR_INVISIBLE => Self::Invisible, ffi::ATK_TEXT_ATTR_EDITABLE => Self::Editable, ffi::ATK_TEXT_ATTR_PIXELS_ABOVE_LINES => Self::PixelsAboveLines, ffi::ATK_TEXT_ATTR_PIXELS_BELOW_LINES => Self::PixelsBelowLines, ffi::ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP => Self::PixelsInsideWrap, ffi::ATK_TEXT_ATTR_BG_FULL_HEIGHT => Self::BgFullHeight, ffi::ATK_TEXT_ATTR_RISE => Self::Rise, ffi::ATK_TEXT_ATTR_UNDERLINE => Self::Underline, ffi::ATK_TEXT_ATTR_STRIKETHROUGH => Self::Strikethrough, ffi::ATK_TEXT_ATTR_SIZE => Self::Size, ffi::ATK_TEXT_ATTR_SCALE => Self::Scale, ffi::ATK_TEXT_ATTR_WEIGHT => Self::Weight, ffi::ATK_TEXT_ATTR_LANGUAGE => Self::Language, ffi::ATK_TEXT_ATTR_FAMILY_NAME => Self::FamilyName, ffi::ATK_TEXT_ATTR_BG_COLOR => Self::BgColor, ffi::ATK_TEXT_ATTR_FG_COLOR => Self::FgColor, ffi::ATK_TEXT_ATTR_BG_STIPPLE => Self::BgStipple, ffi::ATK_TEXT_ATTR_FG_STIPPLE => Self::FgStipple, ffi::ATK_TEXT_ATTR_WRAP_MODE => Self::WrapMode, ffi::ATK_TEXT_ATTR_DIRECTION => Self::Direction, ffi::ATK_TEXT_ATTR_JUSTIFICATION => Self::Justification, ffi::ATK_TEXT_ATTR_STRETCH => Self::Stretch, ffi::ATK_TEXT_ATTR_VARIANT => Self::Variant, ffi::ATK_TEXT_ATTR_STYLE => Self::Style, ffi::ATK_TEXT_ATTR_TEXT_POSITION => Self::TextPosition, ffi::ATK_TEXT_ATTR_LAST_DEFINED => Self::LastDefined, value => Self::__Unknown(value), } } } impl StaticType for TextAttribute { fn static_type() -> Type { unsafe { from_glib(ffi::atk_text_attribute_get_type()) } } } impl glib::value::ValueType for TextAttribute { type Type = Self; } unsafe impl<'a> FromValue<'a> for TextAttribute { type Checker = glib::value::GenericValueTypeChecker; unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for TextAttribute { fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } fn value_type(&self) -> glib::Type { Self::static_type() } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "AtkTextBoundary")] pub enum TextBoundary { #[doc(alias = "ATK_TEXT_BOUNDARY_CHAR")] Char, #[doc(alias = "ATK_TEXT_BOUNDARY_WORD_START")] WordStart, #[doc(alias = "ATK_TEXT_BOUNDARY_WORD_END")] WordEnd, #[doc(alias = "ATK_TEXT_BOUNDARY_SENTENCE_START")] SentenceStart, #[doc(alias = "ATK_TEXT_BOUNDARY_SENTENCE_END")] SentenceEnd, #[doc(alias = "ATK_TEXT_BOUNDARY_LINE_START")] LineStart, #[doc(alias = "ATK_TEXT_BOUNDARY_LINE_END")] LineEnd, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for TextBoundary { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "TextBoundary::{}", match *self { Self::Char => "Char", Self::WordStart => "WordStart", Self::WordEnd => "WordEnd", Self::SentenceStart => "SentenceStart", Self::SentenceEnd => "SentenceEnd", Self::LineStart => "LineStart", Self::LineEnd => "LineEnd", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for TextBoundary { type GlibType = ffi::AtkTextBoundary; fn into_glib(self) -> ffi::AtkTextBoundary { match self { Self::Char => ffi::ATK_TEXT_BOUNDARY_CHAR, Self::WordStart => ffi::ATK_TEXT_BOUNDARY_WORD_START, Self::WordEnd => ffi::ATK_TEXT_BOUNDARY_WORD_END, Self::SentenceStart => ffi::ATK_TEXT_BOUNDARY_SENTENCE_START, Self::SentenceEnd => ffi::ATK_TEXT_BOUNDARY_SENTENCE_END, Self::LineStart => ffi::ATK_TEXT_BOUNDARY_LINE_START, Self::LineEnd => ffi::ATK_TEXT_BOUNDARY_LINE_END, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for TextBoundary { unsafe fn from_glib(value: ffi::AtkTextBoundary) -> Self { skip_assert_initialized!(); match value { ffi::ATK_TEXT_BOUNDARY_CHAR => Self::Char, ffi::ATK_TEXT_BOUNDARY_WORD_START => Self::WordStart, ffi::ATK_TEXT_BOUNDARY_WORD_END => Self::WordEnd, ffi::ATK_TEXT_BOUNDARY_SENTENCE_START => Self::SentenceStart, ffi::ATK_TEXT_BOUNDARY_SENTENCE_END => Self::SentenceEnd, ffi::ATK_TEXT_BOUNDARY_LINE_START => Self::LineStart, ffi::ATK_TEXT_BOUNDARY_LINE_END => Self::LineEnd, value => Self::__Unknown(value), } } } impl StaticType for TextBoundary { fn static_type() -> Type { unsafe { from_glib(ffi::atk_text_boundary_get_type()) } } } impl glib::value::ValueType for TextBoundary { type Type = Self; } unsafe impl<'a> FromValue<'a> for TextBoundary { type Checker = glib::value::GenericValueTypeChecker; unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for TextBoundary { fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } fn value_type(&self) -> glib::Type { Self::static_type() } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "AtkTextClipType")] pub enum TextClipType { #[doc(alias = "ATK_TEXT_CLIP_NONE")] None, #[doc(alias = "ATK_TEXT_CLIP_MIN")] Min, #[doc(alias = "ATK_TEXT_CLIP_MAX")] Max, #[doc(alias = "ATK_TEXT_CLIP_BOTH")] Both, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for TextClipType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "TextClipType::{}", match *self { Self::None => "None", Self::Min => "Min", Self::Max => "Max", Self::Both => "Both", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for TextClipType { type GlibType = ffi::AtkTextClipType; fn into_glib(self) -> ffi::AtkTextClipType { match self { Self::None => ffi::ATK_TEXT_CLIP_NONE, Self::Min => ffi::ATK_TEXT_CLIP_MIN, Self::Max => ffi::ATK_TEXT_CLIP_MAX, Self::Both => ffi::ATK_TEXT_CLIP_BOTH, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for TextClipType { unsafe fn from_glib(value: ffi::AtkTextClipType) -> Self { skip_assert_initialized!(); match value { ffi::ATK_TEXT_CLIP_NONE => Self::None, ffi::ATK_TEXT_CLIP_MIN => Self::Min, ffi::ATK_TEXT_CLIP_MAX => Self::Max, ffi::ATK_TEXT_CLIP_BOTH => Self::Both, value => Self::__Unknown(value), } } } impl StaticType for TextClipType { fn static_type() -> Type { unsafe { from_glib(ffi::atk_text_clip_type_get_type()) } } } impl glib::value::ValueType for TextClipType { type Type = Self; } unsafe impl<'a> FromValue<'a> for TextClipType { type Checker = glib::value::GenericValueTypeChecker; unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for TextClipType { fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } fn value_type(&self) -> glib::Type { Self::static_type() } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "AtkTextGranularity")] pub enum TextGranularity { #[doc(alias = "ATK_TEXT_GRANULARITY_CHAR")] Char, #[doc(alias = "ATK_TEXT_GRANULARITY_WORD")] Word, #[doc(alias = "ATK_TEXT_GRANULARITY_SENTENCE")] Sentence, #[doc(alias = "ATK_TEXT_GRANULARITY_LINE")] Line, #[doc(alias = "ATK_TEXT_GRANULARITY_PARAGRAPH")] Paragraph, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for TextGranularity { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "TextGranularity::{}", match *self { Self::Char => "Char", Self::Word => "Word", Self::Sentence => "Sentence", Self::Line => "Line", Self::Paragraph => "Paragraph", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for TextGranularity { type GlibType = ffi::AtkTextGranularity; fn into_glib(self) -> ffi::AtkTextGranularity { match self { Self::Char => ffi::ATK_TEXT_GRANULARITY_CHAR, Self::Word => ffi::ATK_TEXT_GRANULARITY_WORD, Self::Sentence => ffi::ATK_TEXT_GRANULARITY_SENTENCE, Self::Line => ffi::ATK_TEXT_GRANULARITY_LINE, Self::Paragraph => ffi::ATK_TEXT_GRANULARITY_PARAGRAPH, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for TextGranularity { unsafe fn from_glib(value: ffi::AtkTextGranularity) -> Self { skip_assert_initialized!(); match value { ffi::ATK_TEXT_GRANULARITY_CHAR => Self::Char, ffi::ATK_TEXT_GRANULARITY_WORD => Self::Word, ffi::ATK_TEXT_GRANULARITY_SENTENCE => Self::Sentence, ffi::ATK_TEXT_GRANULARITY_LINE => Self::Line, ffi::ATK_TEXT_GRANULARITY_PARAGRAPH => Self::Paragraph, value => Self::__Unknown(value), } } } impl StaticType for TextGranularity { fn static_type() -> Type { unsafe { from_glib(ffi::atk_text_granularity_get_type()) } } } impl glib::value::ValueType for TextGranularity { type Type = Self; } unsafe impl<'a> FromValue<'a> for TextGranularity { type Checker = glib::value::GenericValueTypeChecker; unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for TextGranularity { fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } fn value_type(&self) -> glib::Type { Self::static_type() } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "AtkValueType")] pub enum ValueType { #[doc(alias = "ATK_VALUE_VERY_WEAK")] VeryWeak, #[doc(alias = "ATK_VALUE_WEAK")] Weak, #[doc(alias = "ATK_VALUE_ACCEPTABLE")] Acceptable, #[doc(alias = "ATK_VALUE_STRONG")] Strong, #[doc(alias = "ATK_VALUE_VERY_STRONG")] VeryStrong, #[doc(alias = "ATK_VALUE_VERY_LOW")] VeryLow, #[doc(alias = "ATK_VALUE_LOW")] Low, #[doc(alias = "ATK_VALUE_MEDIUM")] Medium, #[doc(alias = "ATK_VALUE_HIGH")] High, #[doc(alias = "ATK_VALUE_VERY_HIGH")] VeryHigh, #[doc(alias = "ATK_VALUE_VERY_BAD")] VeryBad, #[doc(alias = "ATK_VALUE_BAD")] Bad, #[doc(alias = "ATK_VALUE_GOOD")] Good, #[doc(alias = "ATK_VALUE_VERY_GOOD")] VeryGood, #[doc(alias = "ATK_VALUE_BEST")] Best, #[doc(alias = "ATK_VALUE_LAST_DEFINED")] LastDefined, #[doc(hidden)] __Unknown(i32), } impl ValueType { #[doc(alias = "atk_value_type_get_localized_name")] #[doc(alias = "get_localized_name")] pub fn localized_name(self) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::atk_value_type_get_localized_name(self.into_glib())) } } #[doc(alias = "atk_value_type_get_name")] #[doc(alias = "get_name")] pub fn name(self) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::atk_value_type_get_name(self.into_glib())) } } } impl fmt::Display for ValueType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "ValueType::{}", match *self { Self::VeryWeak => "VeryWeak", Self::Weak => "Weak", Self::Acceptable => "Acceptable", Self::Strong => "Strong", Self::VeryStrong => "VeryStrong", Self::VeryLow => "VeryLow", Self::Low => "Low", Self::Medium => "Medium", Self::High => "High", Self::VeryHigh => "VeryHigh", Self::VeryBad => "VeryBad", Self::Bad => "Bad", Self::Good => "Good", Self::VeryGood => "VeryGood", Self::Best => "Best", Self::LastDefined => "LastDefined", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for ValueType { type GlibType = ffi::AtkValueType; fn into_glib(self) -> ffi::AtkValueType { match self { Self::VeryWeak => ffi::ATK_VALUE_VERY_WEAK, Self::Weak => ffi::ATK_VALUE_WEAK, Self::Acceptable => ffi::ATK_VALUE_ACCEPTABLE, Self::Strong => ffi::ATK_VALUE_STRONG, Self::VeryStrong => ffi::ATK_VALUE_VERY_STRONG, Self::VeryLow => ffi::ATK_VALUE_VERY_LOW, Self::Low => ffi::ATK_VALUE_LOW, Self::Medium => ffi::ATK_VALUE_MEDIUM, Self::High => ffi::ATK_VALUE_HIGH, Self::VeryHigh => ffi::ATK_VALUE_VERY_HIGH, Self::VeryBad => ffi::ATK_VALUE_VERY_BAD, Self::Bad => ffi::ATK_VALUE_BAD, Self::Good => ffi::ATK_VALUE_GOOD, Self::VeryGood => ffi::ATK_VALUE_VERY_GOOD, Self::Best => ffi::ATK_VALUE_BEST, Self::LastDefined => ffi::ATK_VALUE_LAST_DEFINED, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for ValueType { unsafe fn from_glib(value: ffi::AtkValueType) -> Self { skip_assert_initialized!(); match value { ffi::ATK_VALUE_VERY_WEAK => Self::VeryWeak, ffi::ATK_VALUE_WEAK => Self::Weak, ffi::ATK_VALUE_ACCEPTABLE => Self::Acceptable, ffi::ATK_VALUE_STRONG => Self::Strong, ffi::ATK_VALUE_VERY_STRONG => Self::VeryStrong, ffi::ATK_VALUE_VERY_LOW => Self::VeryLow, ffi::ATK_VALUE_LOW => Self::Low, ffi::ATK_VALUE_MEDIUM => Self::Medium, ffi::ATK_VALUE_HIGH => Self::High, ffi::ATK_VALUE_VERY_HIGH => Self::VeryHigh, ffi::ATK_VALUE_VERY_BAD => Self::VeryBad, ffi::ATK_VALUE_BAD => Self::Bad, ffi::ATK_VALUE_GOOD => Self::Good, ffi::ATK_VALUE_VERY_GOOD => Self::VeryGood, ffi::ATK_VALUE_BEST => Self::Best, ffi::ATK_VALUE_LAST_DEFINED => Self::LastDefined, value => Self::__Unknown(value), } } } impl StaticType for ValueType { fn static_type() -> Type { unsafe { from_glib(ffi::atk_value_type_get_type()) } } } impl glib::value::ValueType for ValueType { type Type = Self; } unsafe impl<'a> FromValue<'a> for ValueType { type Checker = glib::value::GenericValueTypeChecker; unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for ValueType { fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } fn value_type(&self) -> glib::Type { Self::static_type() } } atk-0.14.0/src/auto/flags.rs000064400000000000000000000037130072674642500137220ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use bitflags::bitflags; use glib::translate::*; use glib::value::FromValue; use glib::value::ToValue; use glib::StaticType; use glib::Type; use std::fmt; bitflags! { #[doc(alias = "AtkHyperlinkStateFlags")] pub struct HyperlinkStateFlags: u32 { #[doc(alias = "ATK_HYPERLINK_IS_INLINE")] const INLINE = ffi::ATK_HYPERLINK_IS_INLINE as u32; } } impl fmt::Display for HyperlinkStateFlags { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ::fmt(self, f) } } #[doc(hidden)] impl IntoGlib for HyperlinkStateFlags { type GlibType = ffi::AtkHyperlinkStateFlags; fn into_glib(self) -> ffi::AtkHyperlinkStateFlags { self.bits() } } #[doc(hidden)] impl FromGlib for HyperlinkStateFlags { unsafe fn from_glib(value: ffi::AtkHyperlinkStateFlags) -> Self { skip_assert_initialized!(); Self::from_bits_truncate(value) } } impl StaticType for HyperlinkStateFlags { fn static_type() -> Type { unsafe { from_glib(ffi::atk_hyperlink_state_flags_get_type()) } } } impl glib::value::ValueType for HyperlinkStateFlags { type Type = Self; } unsafe impl<'a> FromValue<'a> for HyperlinkStateFlags { type Checker = glib::value::GenericValueTypeChecker; unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) } } impl ToValue for HyperlinkStateFlags { fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib()); } value } fn value_type(&self) -> glib::Type { Self::static_type() } } atk-0.14.0/src/auto/gobject_accessible.rs000064400000000000000000000027560072674642500164260ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Object; use glib::object::IsA; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "AtkGObjectAccessible")] pub struct GObjectAccessible(Object) @extends Object; match fn { type_ => || ffi::atk_gobject_accessible_get_type(), } } impl GObjectAccessible { #[doc(alias = "atk_gobject_accessible_for_object")] pub fn for_object>(obj: &P) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::atk_gobject_accessible_for_object( obj.as_ref().to_glib_none().0, )) } } } pub const NONE_GOBJECT_ACCESSIBLE: Option<&GObjectAccessible> = None; pub trait GObjectAccessibleExt: 'static { #[doc(alias = "atk_gobject_accessible_get_object")] #[doc(alias = "get_object")] fn object(&self) -> Option; } impl> GObjectAccessibleExt for O { fn object(&self) -> Option { unsafe { from_glib_none(ffi::atk_gobject_accessible_get_object( self.as_ref().to_glib_none().0, )) } } } impl fmt::Display for GObjectAccessible { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("GObjectAccessible") } } atk-0.14.0/src/auto/hyperlink.rs000064400000000000000000000162600072674642500146340ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Action; use crate::Object; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; use std::boxed::Box as Box_; use std::fmt; use std::mem::transmute; glib::wrapper! { #[doc(alias = "AtkHyperlink")] pub struct Hyperlink(Object) @implements Action; match fn { type_ => || ffi::atk_hyperlink_get_type(), } } pub const NONE_HYPERLINK: Option<&Hyperlink> = None; pub trait HyperlinkExt: 'static { #[doc(alias = "atk_hyperlink_get_end_index")] #[doc(alias = "get_end_index")] fn end_index(&self) -> i32; #[doc(alias = "atk_hyperlink_get_n_anchors")] #[doc(alias = "get_n_anchors")] fn n_anchors(&self) -> i32; #[doc(alias = "atk_hyperlink_get_object")] #[doc(alias = "get_object")] fn object(&self, i: i32) -> Option; #[doc(alias = "atk_hyperlink_get_start_index")] #[doc(alias = "get_start_index")] fn start_index(&self) -> i32; #[doc(alias = "atk_hyperlink_get_uri")] #[doc(alias = "get_uri")] fn uri(&self, i: i32) -> Option; #[doc(alias = "atk_hyperlink_is_inline")] fn is_inline(&self) -> bool; #[doc(alias = "atk_hyperlink_is_valid")] fn is_valid(&self) -> bool; #[doc(alias = "number-of-anchors")] fn number_of_anchors(&self) -> i32; #[doc(alias = "link-activated")] fn connect_link_activated(&self, f: F) -> SignalHandlerId; #[doc(alias = "end-index")] fn connect_end_index_notify(&self, f: F) -> SignalHandlerId; #[doc(alias = "number-of-anchors")] fn connect_number_of_anchors_notify(&self, f: F) -> SignalHandlerId; #[doc(alias = "start-index")] fn connect_start_index_notify(&self, f: F) -> SignalHandlerId; } impl> HyperlinkExt for O { fn end_index(&self) -> i32 { unsafe { ffi::atk_hyperlink_get_end_index(self.as_ref().to_glib_none().0) } } fn n_anchors(&self) -> i32 { unsafe { ffi::atk_hyperlink_get_n_anchors(self.as_ref().to_glib_none().0) } } fn object(&self, i: i32) -> Option { unsafe { from_glib_none(ffi::atk_hyperlink_get_object( self.as_ref().to_glib_none().0, i, )) } } fn start_index(&self) -> i32 { unsafe { ffi::atk_hyperlink_get_start_index(self.as_ref().to_glib_none().0) } } fn uri(&self, i: i32) -> Option { unsafe { from_glib_full(ffi::atk_hyperlink_get_uri( self.as_ref().to_glib_none().0, i, )) } } fn is_inline(&self) -> bool { unsafe { from_glib(ffi::atk_hyperlink_is_inline(self.as_ref().to_glib_none().0)) } } fn is_valid(&self) -> bool { unsafe { from_glib(ffi::atk_hyperlink_is_valid(self.as_ref().to_glib_none().0)) } } fn number_of_anchors(&self) -> i32 { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"number-of-anchors\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `number-of-anchors` getter") } } fn connect_link_activated(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn link_activated_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkHyperlink, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Hyperlink::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"link-activated\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( link_activated_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_end_index_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_end_index_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkHyperlink, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Hyperlink::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::end-index\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_end_index_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_number_of_anchors_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_number_of_anchors_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkHyperlink, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Hyperlink::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::number-of-anchors\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_number_of_anchors_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_start_index_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_start_index_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkHyperlink, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Hyperlink::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::start-index\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_start_index_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl fmt::Display for Hyperlink { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Hyperlink") } } atk-0.14.0/src/auto/hyperlink_impl.rs000064400000000000000000000021130072674642500156450ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Hyperlink; use glib::object::IsA; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "AtkHyperlinkImpl")] pub struct HyperlinkImpl(Interface); match fn { type_ => || ffi::atk_hyperlink_impl_get_type(), } } pub const NONE_HYPERLINK_IMPL: Option<&HyperlinkImpl> = None; pub trait HyperlinkImplExt: 'static { #[doc(alias = "atk_hyperlink_impl_get_hyperlink")] #[doc(alias = "get_hyperlink")] fn hyperlink(&self) -> Option; } impl> HyperlinkImplExt for O { fn hyperlink(&self) -> Option { unsafe { from_glib_full(ffi::atk_hyperlink_impl_get_hyperlink( self.as_ref().to_glib_none().0, )) } } } impl fmt::Display for HyperlinkImpl { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("HyperlinkImpl") } } atk-0.14.0/src/auto/hypertext.rs000064400000000000000000000052750072674642500146670ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Hyperlink; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use std::boxed::Box as Box_; use std::fmt; use std::mem::transmute; glib::wrapper! { #[doc(alias = "AtkHypertext")] pub struct Hypertext(Interface); match fn { type_ => || ffi::atk_hypertext_get_type(), } } pub const NONE_HYPERTEXT: Option<&Hypertext> = None; pub trait HypertextExt: 'static { #[doc(alias = "atk_hypertext_get_link")] #[doc(alias = "get_link")] fn link(&self, link_index: i32) -> Option; #[doc(alias = "atk_hypertext_get_link_index")] #[doc(alias = "get_link_index")] fn link_index(&self, char_index: i32) -> i32; #[doc(alias = "atk_hypertext_get_n_links")] #[doc(alias = "get_n_links")] fn n_links(&self) -> i32; #[doc(alias = "link-selected")] fn connect_link_selected(&self, f: F) -> SignalHandlerId; } impl> HypertextExt for O { fn link(&self, link_index: i32) -> Option { unsafe { from_glib_none(ffi::atk_hypertext_get_link( self.as_ref().to_glib_none().0, link_index, )) } } fn link_index(&self, char_index: i32) -> i32 { unsafe { ffi::atk_hypertext_get_link_index(self.as_ref().to_glib_none().0, char_index) } } fn n_links(&self) -> i32 { unsafe { ffi::atk_hypertext_get_n_links(self.as_ref().to_glib_none().0) } } fn connect_link_selected(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn link_selected_trampoline< P: IsA, F: Fn(&P, i32) + 'static, >( this: *mut ffi::AtkHypertext, arg1: libc::c_int, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Hypertext::from_glib_borrow(this).unsafe_cast_ref(), arg1) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"link-selected\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( link_selected_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl fmt::Display for Hypertext { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Hypertext") } } atk-0.14.0/src/auto/image.rs000064400000000000000000000060040072674642500137040ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::CoordType; use glib::object::IsA; use glib::translate::*; use std::fmt; use std::mem; glib::wrapper! { #[doc(alias = "AtkImage")] pub struct Image(Interface); match fn { type_ => || ffi::atk_image_get_type(), } } pub const NONE_IMAGE: Option<&Image> = None; pub trait AtkImageExt: 'static { #[doc(alias = "atk_image_get_image_description")] #[doc(alias = "get_image_description")] fn image_description(&self) -> Option; #[doc(alias = "atk_image_get_image_locale")] #[doc(alias = "get_image_locale")] fn image_locale(&self) -> Option; #[doc(alias = "atk_image_get_image_position")] #[doc(alias = "get_image_position")] fn image_position(&self, coord_type: CoordType) -> (i32, i32); #[doc(alias = "atk_image_get_image_size")] #[doc(alias = "get_image_size")] fn image_size(&self) -> (i32, i32); #[doc(alias = "atk_image_set_image_description")] fn set_image_description(&self, description: &str) -> bool; } impl> AtkImageExt for O { fn image_description(&self) -> Option { unsafe { from_glib_none(ffi::atk_image_get_image_description( self.as_ref().to_glib_none().0, )) } } fn image_locale(&self) -> Option { unsafe { from_glib_none(ffi::atk_image_get_image_locale( self.as_ref().to_glib_none().0, )) } } fn image_position(&self, coord_type: CoordType) -> (i32, i32) { unsafe { let mut x = mem::MaybeUninit::uninit(); let mut y = mem::MaybeUninit::uninit(); ffi::atk_image_get_image_position( self.as_ref().to_glib_none().0, x.as_mut_ptr(), y.as_mut_ptr(), coord_type.into_glib(), ); let x = x.assume_init(); let y = y.assume_init(); (x, y) } } fn image_size(&self) -> (i32, i32) { unsafe { let mut width = mem::MaybeUninit::uninit(); let mut height = mem::MaybeUninit::uninit(); ffi::atk_image_get_image_size( self.as_ref().to_glib_none().0, width.as_mut_ptr(), height.as_mut_ptr(), ); let width = width.assume_init(); let height = height.assume_init(); (width, height) } } fn set_image_description(&self, description: &str) -> bool { unsafe { from_glib(ffi::atk_image_set_image_description( self.as_ref().to_glib_none().0, description.to_glib_none().0, )) } } } impl fmt::Display for Image { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Image") } } atk-0.14.0/src/auto/misc.rs000064400000000000000000000024150072674642500135570ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::object::IsA; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "AtkMisc")] pub struct Misc(Object); match fn { type_ => || ffi::atk_misc_get_type(), } } impl Misc { #[doc(alias = "atk_misc_get_instance")] #[doc(alias = "get_instance")] pub fn instance() -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::atk_misc_get_instance()) } } } pub const NONE_MISC: Option<&Misc> = None; pub trait AtkMiscExt: 'static { #[doc(alias = "atk_misc_threads_enter")] fn threads_enter(&self); #[doc(alias = "atk_misc_threads_leave")] fn threads_leave(&self); } impl> AtkMiscExt for O { fn threads_enter(&self) { unsafe { ffi::atk_misc_threads_enter(self.as_ref().to_glib_none().0); } } fn threads_leave(&self) { unsafe { ffi::atk_misc_threads_leave(self.as_ref().to_glib_none().0); } } } impl fmt::Display for Misc { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Misc") } } atk-0.14.0/src/auto/mod.rs000064400000000000000000000075610072674642500134120ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT mod action; pub use self::action::{Action, NONE_ACTION}; mod component; pub use self::component::{Component, NONE_COMPONENT}; mod document; pub use self::document::{Document, NONE_DOCUMENT}; mod editable_text; pub use self::editable_text::{EditableText, NONE_EDITABLE_TEXT}; mod gobject_accessible; pub use self::gobject_accessible::{GObjectAccessible, NONE_GOBJECT_ACCESSIBLE}; mod hyperlink; pub use self::hyperlink::{Hyperlink, NONE_HYPERLINK}; mod hyperlink_impl; pub use self::hyperlink_impl::{HyperlinkImpl, NONE_HYPERLINK_IMPL}; mod hypertext; pub use self::hypertext::{Hypertext, NONE_HYPERTEXT}; mod image; pub use self::image::{Image, NONE_IMAGE}; mod misc; pub use self::misc::{Misc, NONE_MISC}; mod no_op_object; pub use self::no_op_object::{NoOpObject, NONE_NO_OP_OBJECT}; mod no_op_object_factory; pub use self::no_op_object_factory::{NoOpObjectFactory, NONE_NO_OP_OBJECT_FACTORY}; mod object; pub use self::object::{Object, NONE_OBJECT}; mod object_factory; pub use self::object_factory::{ObjectFactory, NONE_OBJECT_FACTORY}; mod plug; pub use self::plug::{Plug, NONE_PLUG}; mod registry; pub use self::registry::{Registry, NONE_REGISTRY}; mod relation; pub use self::relation::{Relation, NONE_RELATION}; mod relation_set; pub use self::relation_set::{RelationSet, NONE_RELATION_SET}; mod selection; pub use self::selection::{Selection, NONE_SELECTION}; mod socket; pub use self::socket::{Socket, NONE_SOCKET}; mod state_set; pub use self::state_set::{StateSet, NONE_STATE_SET}; mod streamable_content; pub use self::streamable_content::{StreamableContent, NONE_STREAMABLE_CONTENT}; mod table; pub use self::table::{Table, NONE_TABLE}; mod table_cell; pub use self::table_cell::{TableCell, NONE_TABLE_CELL}; mod text; pub use self::text::{Text, NONE_TEXT}; mod util; pub use self::util::{Util, NONE_UTIL}; mod value; pub use self::value::{Value, NONE_VALUE}; mod window; pub use self::window::{Window, NONE_WINDOW}; mod range; pub use self::range::Range; mod rectangle; pub use self::rectangle::Rectangle; mod text_range; pub use self::text_range::TextRange; mod enums; pub use self::enums::CoordType; pub use self::enums::Layer; pub use self::enums::RelationType; pub use self::enums::Role; #[cfg(any(feature = "v2_30", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))] pub use self::enums::ScrollType; pub use self::enums::StateType; pub use self::enums::TextAttribute; pub use self::enums::TextBoundary; pub use self::enums::TextClipType; pub use self::enums::TextGranularity; pub use self::enums::ValueType; mod flags; pub use self::flags::HyperlinkStateFlags; mod alias; pub use self::alias::State; #[doc(hidden)] pub mod traits { pub use super::action::AtkActionExt; pub use super::component::ComponentExt; pub use super::document::DocumentExt; pub use super::editable_text::EditableTextExt; pub use super::gobject_accessible::GObjectAccessibleExt; pub use super::hyperlink::HyperlinkExt; pub use super::hyperlink_impl::HyperlinkImplExt; pub use super::hypertext::HypertextExt; pub use super::image::AtkImageExt; pub use super::misc::AtkMiscExt; pub use super::object::AtkObjectExt; pub use super::object_factory::ObjectFactoryExt; pub use super::plug::AtkPlugExt; pub use super::registry::RegistryExt; pub use super::relation::RelationExt; pub use super::relation_set::RelationSetExt; pub use super::selection::SelectionExt; pub use super::socket::AtkSocketExt; pub use super::state_set::StateSetExt; pub use super::streamable_content::StreamableContentExt; pub use super::table::TableExt; pub use super::table_cell::TableCellExt; pub use super::text::TextExt; pub use super::value::ValueExt; pub use super::window::AtkWindowExt; } atk-0.14.0/src/auto/no_op_object.rs000064400000000000000000000025150072674642500152650ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Action; use crate::Component; use crate::Document; use crate::EditableText; use crate::Hypertext; use crate::Image; use crate::Object; use crate::Selection; use crate::Table; use crate::TableCell; use crate::Text; use crate::Value; use crate::Window; use glib::object::Cast; use glib::object::IsA; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "AtkNoOpObject")] pub struct NoOpObject(Object) @extends Object, @implements Action, Component, Document, EditableText, Hypertext, Image, Selection, Table, TableCell, Text, Value, Window; match fn { type_ => || ffi::atk_no_op_object_get_type(), } } impl NoOpObject { #[doc(alias = "atk_no_op_object_new")] pub fn new>(obj: &P) -> NoOpObject { assert_initialized_main_thread!(); unsafe { Object::from_glib_full(ffi::atk_no_op_object_new(obj.as_ref().to_glib_none().0)) .unsafe_cast() } } } pub const NONE_NO_OP_OBJECT: Option<&NoOpObject> = None; impl fmt::Display for NoOpObject { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("NoOpObject") } } atk-0.14.0/src/auto/no_op_object_factory.rs000064400000000000000000000020720072674642500170120ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ObjectFactory; use glib::object::Cast; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "AtkNoOpObjectFactory")] pub struct NoOpObjectFactory(Object) @extends ObjectFactory; match fn { type_ => || ffi::atk_no_op_object_factory_get_type(), } } impl NoOpObjectFactory { #[doc(alias = "atk_no_op_object_factory_new")] pub fn new() -> NoOpObjectFactory { assert_initialized_main_thread!(); unsafe { ObjectFactory::from_glib_full(ffi::atk_no_op_object_factory_new()).unsafe_cast() } } } impl Default for NoOpObjectFactory { fn default() -> Self { Self::new() } } pub const NONE_NO_OP_OBJECT_FACTORY: Option<&NoOpObjectFactory> = None; impl fmt::Display for NoOpObjectFactory { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("NoOpObjectFactory") } } atk-0.14.0/src/auto/object.rs000064400000000000000000001366760072674642500141130ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Layer; use crate::RelationSet; use crate::RelationType; use crate::Role; use crate::State; use crate::StateSet; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; use glib::ToValue; use std::boxed::Box as Box_; use std::fmt; use std::mem::transmute; glib::wrapper! { #[doc(alias = "AtkObject")] pub struct Object(Object); match fn { type_ => || ffi::atk_object_get_type(), } } pub const NONE_OBJECT: Option<&Object> = None; pub trait AtkObjectExt: 'static { #[doc(alias = "atk_object_add_relationship")] fn add_relationship>(&self, relationship: RelationType, target: &P) -> bool; #[cfg(any(feature = "v2_34", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_34")))] #[doc(alias = "atk_object_get_accessible_id")] #[doc(alias = "get_accessible_id")] fn accessible_id(&self) -> Option; //#[doc(alias = "atk_object_get_attributes")] //#[doc(alias = "get_attributes")] //fn attributes(&self) -> /*Ignored*/Option; #[doc(alias = "atk_object_get_description")] #[doc(alias = "get_description")] fn description(&self) -> Option; #[doc(alias = "atk_object_get_index_in_parent")] #[doc(alias = "get_index_in_parent")] fn index_in_parent(&self) -> i32; #[doc(alias = "atk_object_get_layer")] #[doc(alias = "get_layer")] fn layer(&self) -> Layer; #[doc(alias = "atk_object_get_mdi_zorder")] #[doc(alias = "get_mdi_zorder")] fn mdi_zorder(&self) -> i32; #[doc(alias = "atk_object_get_n_accessible_children")] #[doc(alias = "get_n_accessible_children")] fn n_accessible_children(&self) -> i32; #[doc(alias = "atk_object_get_name")] #[doc(alias = "get_name")] fn name(&self) -> Option; #[doc(alias = "atk_object_get_object_locale")] #[doc(alias = "get_object_locale")] fn object_locale(&self) -> Option; #[doc(alias = "atk_object_get_parent")] #[doc(alias = "get_parent")] fn parent(&self) -> Option; #[doc(alias = "atk_object_get_role")] #[doc(alias = "get_role")] fn role(&self) -> Role; //#[doc(alias = "atk_object_initialize")] //fn initialize(&self, data: /*Unimplemented*/Option); #[doc(alias = "atk_object_notify_state_change")] fn notify_state_change(&self, state: State, value: bool); #[doc(alias = "atk_object_peek_parent")] fn peek_parent(&self) -> Option; #[doc(alias = "atk_object_ref_accessible_child")] fn ref_accessible_child(&self, i: i32) -> Option; #[doc(alias = "atk_object_ref_relation_set")] fn ref_relation_set(&self) -> Option; #[doc(alias = "atk_object_ref_state_set")] fn ref_state_set(&self) -> Option; #[doc(alias = "atk_object_remove_relationship")] fn remove_relationship>(&self, relationship: RelationType, target: &P) -> bool; #[cfg(any(feature = "v2_34", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_34")))] #[doc(alias = "atk_object_set_accessible_id")] fn set_accessible_id(&self, name: &str); #[doc(alias = "atk_object_set_description")] fn set_description(&self, description: &str); #[doc(alias = "atk_object_set_name")] fn set_name(&self, name: &str); #[doc(alias = "atk_object_set_parent")] fn set_parent>(&self, parent: &P); #[doc(alias = "atk_object_set_role")] fn set_role(&self, role: Role); #[doc(alias = "accessible-component-layer")] fn accessible_component_layer(&self) -> i32; #[doc(alias = "accessible-component-mdi-zorder")] fn accessible_component_mdi_zorder(&self) -> i32; #[doc(alias = "accessible-description")] fn accessible_description(&self) -> Option; #[doc(alias = "accessible-description")] fn set_accessible_description(&self, accessible_description: Option<&str>); #[doc(alias = "accessible-hypertext-nlinks")] fn accessible_hypertext_nlinks(&self) -> i32; #[doc(alias = "accessible-name")] fn accessible_name(&self) -> Option; #[doc(alias = "accessible-name")] fn set_accessible_name(&self, accessible_name: Option<&str>); #[doc(alias = "accessible-parent")] fn accessible_parent(&self) -> Option; #[doc(alias = "accessible-parent")] fn set_accessible_parent>(&self, accessible_parent: Option<&P>); #[doc(alias = "accessible-role")] fn accessible_role(&self) -> Role; #[doc(alias = "accessible-role")] fn set_accessible_role(&self, accessible_role: Role); #[doc(alias = "accessible-table-caption")] fn accessible_table_caption(&self) -> Option; #[doc(alias = "accessible-table-caption")] fn set_accessible_table_caption(&self, accessible_table_caption: Option<&str>); #[doc(alias = "accessible-table-caption-object")] fn accessible_table_caption_object(&self) -> Option; #[doc(alias = "accessible-table-caption-object")] fn set_accessible_table_caption_object>( &self, accessible_table_caption_object: Option<&P>, ); #[doc(alias = "accessible-table-column-description")] fn accessible_table_column_description(&self) -> Option; #[doc(alias = "accessible-table-column-description")] fn set_accessible_table_column_description( &self, accessible_table_column_description: Option<&str>, ); #[doc(alias = "accessible-table-column-header")] fn accessible_table_column_header(&self) -> Option; #[doc(alias = "accessible-table-column-header")] fn set_accessible_table_column_header>( &self, accessible_table_column_header: Option<&P>, ); #[doc(alias = "accessible-table-row-description")] fn accessible_table_row_description(&self) -> Option; #[doc(alias = "accessible-table-row-description")] fn set_accessible_table_row_description(&self, accessible_table_row_description: Option<&str>); #[doc(alias = "accessible-table-row-header")] fn accessible_table_row_header(&self) -> Option; #[doc(alias = "accessible-table-row-header")] fn set_accessible_table_row_header>( &self, accessible_table_row_header: Option<&P>, ); #[doc(alias = "accessible-table-summary")] fn accessible_table_summary(&self) -> Option; #[doc(alias = "accessible-table-summary")] fn set_accessible_table_summary>(&self, accessible_table_summary: Option<&P>); #[doc(alias = "accessible-value")] fn accessible_value(&self) -> f64; #[doc(alias = "accessible-value")] fn set_accessible_value(&self, accessible_value: f64); #[doc(alias = "active-descendant-changed")] fn connect_active_descendant_changed( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId; #[doc(alias = "children-changed")] fn connect_children_changed( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId; //#[doc(alias = "property-change")] //fn connect_property_change(&self, detail: Option<&str>, f: F) -> SignalHandlerId; #[doc(alias = "state-change")] fn connect_state_change( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId; #[doc(alias = "visible-data-changed")] fn connect_visible_data_changed(&self, f: F) -> SignalHandlerId; #[doc(alias = "accessible-component-layer")] fn connect_accessible_component_layer_notify( &self, f: F, ) -> SignalHandlerId; #[doc(alias = "accessible-component-mdi-zorder")] fn connect_accessible_component_mdi_zorder_notify( &self, f: F, ) -> SignalHandlerId; #[doc(alias = "accessible-description")] fn connect_accessible_description_notify( &self, f: F, ) -> SignalHandlerId; #[doc(alias = "accessible-hypertext-nlinks")] fn connect_accessible_hypertext_nlinks_notify( &self, f: F, ) -> SignalHandlerId; #[doc(alias = "accessible-name")] fn connect_accessible_name_notify(&self, f: F) -> SignalHandlerId; #[doc(alias = "accessible-parent")] fn connect_accessible_parent_notify(&self, f: F) -> SignalHandlerId; #[doc(alias = "accessible-role")] fn connect_accessible_role_notify(&self, f: F) -> SignalHandlerId; #[doc(alias = "accessible-table-caption")] fn connect_accessible_table_caption_notify( &self, f: F, ) -> SignalHandlerId; #[doc(alias = "accessible-table-caption-object")] fn connect_accessible_table_caption_object_notify( &self, f: F, ) -> SignalHandlerId; #[doc(alias = "accessible-table-column-description")] fn connect_accessible_table_column_description_notify( &self, f: F, ) -> SignalHandlerId; #[doc(alias = "accessible-table-column-header")] fn connect_accessible_table_column_header_notify( &self, f: F, ) -> SignalHandlerId; #[doc(alias = "accessible-table-row-description")] fn connect_accessible_table_row_description_notify( &self, f: F, ) -> SignalHandlerId; #[doc(alias = "accessible-table-row-header")] fn connect_accessible_table_row_header_notify( &self, f: F, ) -> SignalHandlerId; #[doc(alias = "accessible-table-summary")] fn connect_accessible_table_summary_notify( &self, f: F, ) -> SignalHandlerId; #[doc(alias = "accessible-value")] fn connect_accessible_value_notify(&self, f: F) -> SignalHandlerId; } impl> AtkObjectExt for O { fn add_relationship>(&self, relationship: RelationType, target: &P) -> bool { unsafe { from_glib(ffi::atk_object_add_relationship( self.as_ref().to_glib_none().0, relationship.into_glib(), target.as_ref().to_glib_none().0, )) } } #[cfg(any(feature = "v2_34", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_34")))] fn accessible_id(&self) -> Option { unsafe { from_glib_none(ffi::atk_object_get_accessible_id( self.as_ref().to_glib_none().0, )) } } //fn attributes(&self) -> /*Ignored*/Option { // unsafe { TODO: call ffi:atk_object_get_attributes() } //} fn description(&self) -> Option { unsafe { from_glib_none(ffi::atk_object_get_description( self.as_ref().to_glib_none().0, )) } } fn index_in_parent(&self) -> i32 { unsafe { ffi::atk_object_get_index_in_parent(self.as_ref().to_glib_none().0) } } fn layer(&self) -> Layer { unsafe { from_glib(ffi::atk_object_get_layer(self.as_ref().to_glib_none().0)) } } fn mdi_zorder(&self) -> i32 { unsafe { ffi::atk_object_get_mdi_zorder(self.as_ref().to_glib_none().0) } } fn n_accessible_children(&self) -> i32 { unsafe { ffi::atk_object_get_n_accessible_children(self.as_ref().to_glib_none().0) } } fn name(&self) -> Option { unsafe { from_glib_none(ffi::atk_object_get_name(self.as_ref().to_glib_none().0)) } } fn object_locale(&self) -> Option { unsafe { from_glib_none(ffi::atk_object_get_object_locale( self.as_ref().to_glib_none().0, )) } } fn parent(&self) -> Option { unsafe { from_glib_none(ffi::atk_object_get_parent(self.as_ref().to_glib_none().0)) } } fn role(&self) -> Role { unsafe { from_glib(ffi::atk_object_get_role(self.as_ref().to_glib_none().0)) } } //fn initialize(&self, data: /*Unimplemented*/Option) { // unsafe { TODO: call ffi:atk_object_initialize() } //} fn notify_state_change(&self, state: State, value: bool) { unsafe { ffi::atk_object_notify_state_change( self.as_ref().to_glib_none().0, state, value.into_glib(), ); } } fn peek_parent(&self) -> Option { unsafe { from_glib_none(ffi::atk_object_peek_parent(self.as_ref().to_glib_none().0)) } } fn ref_accessible_child(&self, i: i32) -> Option { unsafe { from_glib_full(ffi::atk_object_ref_accessible_child( self.as_ref().to_glib_none().0, i, )) } } fn ref_relation_set(&self) -> Option { unsafe { from_glib_full(ffi::atk_object_ref_relation_set( self.as_ref().to_glib_none().0, )) } } fn ref_state_set(&self) -> Option { unsafe { from_glib_full(ffi::atk_object_ref_state_set( self.as_ref().to_glib_none().0, )) } } fn remove_relationship>(&self, relationship: RelationType, target: &P) -> bool { unsafe { from_glib(ffi::atk_object_remove_relationship( self.as_ref().to_glib_none().0, relationship.into_glib(), target.as_ref().to_glib_none().0, )) } } #[cfg(any(feature = "v2_34", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_34")))] fn set_accessible_id(&self, name: &str) { unsafe { ffi::atk_object_set_accessible_id( self.as_ref().to_glib_none().0, name.to_glib_none().0, ); } } fn set_description(&self, description: &str) { unsafe { ffi::atk_object_set_description( self.as_ref().to_glib_none().0, description.to_glib_none().0, ); } } fn set_name(&self, name: &str) { unsafe { ffi::atk_object_set_name(self.as_ref().to_glib_none().0, name.to_glib_none().0); } } fn set_parent>(&self, parent: &P) { unsafe { ffi::atk_object_set_parent( self.as_ref().to_glib_none().0, parent.as_ref().to_glib_none().0, ); } } fn set_role(&self, role: Role) { unsafe { ffi::atk_object_set_role(self.as_ref().to_glib_none().0, role.into_glib()); } } fn accessible_component_layer(&self) -> i32 { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-component-layer\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `accessible-component-layer` getter") } } fn accessible_component_mdi_zorder(&self) -> i32 { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-component-mdi-zorder\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `accessible-component-mdi-zorder` getter") } } fn accessible_description(&self) -> Option { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-description\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `accessible-description` getter") } } fn set_accessible_description(&self, accessible_description: Option<&str>) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-description\0".as_ptr() as *const _, accessible_description.to_value().to_glib_none().0, ); } } fn accessible_hypertext_nlinks(&self) -> i32 { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-hypertext-nlinks\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `accessible-hypertext-nlinks` getter") } } fn accessible_name(&self) -> Option { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-name\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `accessible-name` getter") } } fn set_accessible_name(&self, accessible_name: Option<&str>) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-name\0".as_ptr() as *const _, accessible_name.to_value().to_glib_none().0, ); } } fn accessible_parent(&self) -> Option { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-parent\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `accessible-parent` getter") } } fn set_accessible_parent>(&self, accessible_parent: Option<&P>) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-parent\0".as_ptr() as *const _, accessible_parent.to_value().to_glib_none().0, ); } } fn accessible_role(&self) -> Role { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-role\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `accessible-role` getter") } } fn set_accessible_role(&self, accessible_role: Role) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-role\0".as_ptr() as *const _, accessible_role.to_value().to_glib_none().0, ); } } fn accessible_table_caption(&self) -> Option { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-table-caption\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `accessible-table-caption` getter") } } fn set_accessible_table_caption(&self, accessible_table_caption: Option<&str>) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-table-caption\0".as_ptr() as *const _, accessible_table_caption.to_value().to_glib_none().0, ); } } fn accessible_table_caption_object(&self) -> Option { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-table-caption-object\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `accessible-table-caption-object` getter") } } fn set_accessible_table_caption_object>( &self, accessible_table_caption_object: Option<&P>, ) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-table-caption-object\0".as_ptr() as *const _, accessible_table_caption_object.to_value().to_glib_none().0, ); } } fn accessible_table_column_description(&self) -> Option { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-table-column-description\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `accessible-table-column-description` getter") } } fn set_accessible_table_column_description( &self, accessible_table_column_description: Option<&str>, ) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-table-column-description\0".as_ptr() as *const _, accessible_table_column_description .to_value() .to_glib_none() .0, ); } } fn accessible_table_column_header(&self) -> Option { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-table-column-header\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `accessible-table-column-header` getter") } } fn set_accessible_table_column_header>( &self, accessible_table_column_header: Option<&P>, ) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-table-column-header\0".as_ptr() as *const _, accessible_table_column_header.to_value().to_glib_none().0, ); } } fn accessible_table_row_description(&self) -> Option { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-table-row-description\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `accessible-table-row-description` getter") } } fn set_accessible_table_row_description(&self, accessible_table_row_description: Option<&str>) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-table-row-description\0".as_ptr() as *const _, accessible_table_row_description.to_value().to_glib_none().0, ); } } fn accessible_table_row_header(&self) -> Option { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-table-row-header\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `accessible-table-row-header` getter") } } fn set_accessible_table_row_header>( &self, accessible_table_row_header: Option<&P>, ) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-table-row-header\0".as_ptr() as *const _, accessible_table_row_header.to_value().to_glib_none().0, ); } } fn accessible_table_summary(&self) -> Option { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-table-summary\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `accessible-table-summary` getter") } } fn set_accessible_table_summary>(&self, accessible_table_summary: Option<&P>) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-table-summary\0".as_ptr() as *const _, accessible_table_summary.to_value().to_glib_none().0, ); } } fn accessible_value(&self) -> f64 { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-value\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `accessible-value` getter") } } fn set_accessible_value(&self, accessible_value: f64) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-value\0".as_ptr() as *const _, accessible_value.to_value().to_glib_none().0, ); } } fn connect_active_descendant_changed( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId { unsafe extern "C" fn active_descendant_changed_trampoline< P: IsA, F: Fn(&P, &Object) + 'static, >( this: *mut ffi::AtkObject, arg1: *mut ffi::AtkObject, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( Object::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(arg1), ) } unsafe { let f: Box_ = Box_::new(f); let detailed_signal_name = detail.map(|name| format!("active-descendant-changed::{}\0", name)); let signal_name: &[u8] = detailed_signal_name .as_ref() .map_or(&b"active-descendant-changed\0"[..], |n| n.as_bytes()); connect_raw( self.as_ptr() as *mut _, signal_name.as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( active_descendant_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_children_changed( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId { unsafe extern "C" fn children_changed_trampoline< P: IsA, F: Fn(&P, u32, &Object) + 'static, >( this: *mut ffi::AtkObject, arg1: libc::c_uint, arg2: *mut ffi::AtkObject, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( Object::from_glib_borrow(this).unsafe_cast_ref(), arg1, &from_glib_borrow(arg2), ) } unsafe { let f: Box_ = Box_::new(f); let detailed_signal_name = detail.map(|name| format!("children-changed::{}\0", name)); let signal_name: &[u8] = detailed_signal_name .as_ref() .map_or(&b"children-changed\0"[..], |n| n.as_bytes()); connect_raw( self.as_ptr() as *mut _, signal_name.as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( children_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } //fn connect_property_change(&self, detail: Option<&str>, f: F) -> SignalHandlerId { // Ignored arg1: Atk.PropertyValues //} fn connect_state_change( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId { unsafe extern "C" fn state_change_trampoline< P: IsA, F: Fn(&P, &str, bool) + 'static, >( this: *mut ffi::AtkObject, arg1: *mut libc::c_char, arg2: glib::ffi::gboolean, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( Object::from_glib_borrow(this).unsafe_cast_ref(), &glib::GString::from_glib_borrow(arg1), from_glib(arg2), ) } unsafe { let f: Box_ = Box_::new(f); let detailed_signal_name = detail.map(|name| format!("state-change::{}\0", name)); let signal_name: &[u8] = detailed_signal_name .as_ref() .map_or(&b"state-change\0"[..], |n| n.as_bytes()); connect_raw( self.as_ptr() as *mut _, signal_name.as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( state_change_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_visible_data_changed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn visible_data_changed_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkObject, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Object::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"visible-data-changed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( visible_data_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_accessible_component_layer_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_accessible_component_layer_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Object::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accessible-component-layer\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accessible_component_layer_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_accessible_component_mdi_zorder_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_accessible_component_mdi_zorder_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Object::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accessible-component-mdi-zorder\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accessible_component_mdi_zorder_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_accessible_description_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_accessible_description_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Object::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accessible-description\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accessible_description_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_accessible_hypertext_nlinks_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_accessible_hypertext_nlinks_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Object::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accessible-hypertext-nlinks\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accessible_hypertext_nlinks_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_accessible_name_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_accessible_name_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Object::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accessible-name\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accessible_name_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_accessible_parent_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_accessible_parent_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Object::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accessible-parent\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accessible_parent_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_accessible_role_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_accessible_role_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Object::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accessible-role\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accessible_role_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_accessible_table_caption_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_accessible_table_caption_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Object::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accessible-table-caption\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accessible_table_caption_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_accessible_table_caption_object_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_accessible_table_caption_object_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Object::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accessible-table-caption-object\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accessible_table_caption_object_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_accessible_table_column_description_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_accessible_table_column_description_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Object::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accessible-table-column-description\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accessible_table_column_description_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_accessible_table_column_header_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_accessible_table_column_header_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Object::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accessible-table-column-header\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accessible_table_column_header_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_accessible_table_row_description_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_accessible_table_row_description_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Object::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accessible-table-row-description\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accessible_table_row_description_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_accessible_table_row_header_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_accessible_table_row_header_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Object::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accessible-table-row-header\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accessible_table_row_header_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_accessible_table_summary_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_accessible_table_summary_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Object::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accessible-table-summary\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accessible_table_summary_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_accessible_value_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_accessible_value_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Object::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accessible-value\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accessible_value_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl fmt::Display for Object { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Object") } } atk-0.14.0/src/auto/object_factory.rs000064400000000000000000000033610072674642500156220ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Object; use glib::object::IsA; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "AtkObjectFactory")] pub struct ObjectFactory(Object); match fn { type_ => || ffi::atk_object_factory_get_type(), } } pub const NONE_OBJECT_FACTORY: Option<&ObjectFactory> = None; pub trait ObjectFactoryExt: 'static { #[doc(alias = "atk_object_factory_create_accessible")] fn create_accessible>(&self, obj: &P) -> Option; #[doc(alias = "atk_object_factory_get_accessible_type")] #[doc(alias = "get_accessible_type")] fn accessible_type(&self) -> glib::types::Type; #[doc(alias = "atk_object_factory_invalidate")] fn invalidate(&self); } impl> ObjectFactoryExt for O { fn create_accessible>(&self, obj: &P) -> Option { unsafe { from_glib_full(ffi::atk_object_factory_create_accessible( self.as_ref().to_glib_none().0, obj.as_ref().to_glib_none().0, )) } } fn accessible_type(&self) -> glib::types::Type { unsafe { from_glib(ffi::atk_object_factory_get_accessible_type( self.as_ref().to_glib_none().0, )) } } fn invalidate(&self) { unsafe { ffi::atk_object_factory_invalidate(self.as_ref().to_glib_none().0); } } } impl fmt::Display for ObjectFactory { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("ObjectFactory") } } atk-0.14.0/src/auto/plug.rs000064400000000000000000000023530072674642500135740ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Component; use crate::Object; use glib::object::Cast; use glib::object::IsA; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "AtkPlug")] pub struct Plug(Object) @extends Object, @implements Component; match fn { type_ => || ffi::atk_plug_get_type(), } } impl Plug { #[doc(alias = "atk_plug_new")] pub fn new() -> Plug { assert_initialized_main_thread!(); unsafe { Object::from_glib_full(ffi::atk_plug_new()).unsafe_cast() } } } impl Default for Plug { fn default() -> Self { Self::new() } } pub const NONE_PLUG: Option<&Plug> = None; pub trait AtkPlugExt: 'static { #[doc(alias = "atk_plug_get_id")] #[doc(alias = "get_id")] fn id(&self) -> Option; } impl> AtkPlugExt for O { fn id(&self) -> Option { unsafe { from_glib_full(ffi::atk_plug_get_id(self.as_ref().to_glib_none().0)) } } } impl fmt::Display for Plug { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Plug") } } atk-0.14.0/src/auto/range.rs000064400000000000000000000027500072674642500137220ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Range(Boxed); match fn { copy => |ptr| ffi::atk_range_copy(mut_override(ptr)), free => |ptr| ffi::atk_range_free(ptr), type_ => || ffi::atk_range_get_type(), } } impl Range { #[doc(alias = "atk_range_new")] pub fn new(lower_limit: f64, upper_limit: f64, description: &str) -> Range { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::atk_range_new( lower_limit, upper_limit, description.to_glib_none().0, )) } } #[doc(alias = "atk_range_get_description")] #[doc(alias = "get_description")] pub fn description(&mut self) -> Option { unsafe { from_glib_none(ffi::atk_range_get_description(self.to_glib_none_mut().0)) } } #[doc(alias = "atk_range_get_lower_limit")] #[doc(alias = "get_lower_limit")] pub fn lower_limit(&mut self) -> f64 { unsafe { ffi::atk_range_get_lower_limit(self.to_glib_none_mut().0) } } #[doc(alias = "atk_range_get_upper_limit")] #[doc(alias = "get_upper_limit")] pub fn upper_limit(&mut self) -> f64 { unsafe { ffi::atk_range_get_upper_limit(self.to_glib_none_mut().0) } } } atk-0.14.0/src/auto/rectangle.rs000064400000000000000000000010710072674642500145650ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Rectangle(Boxed); match fn { copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::atk_rectangle_get_type(), ptr as *mut _) as *mut ffi::AtkRectangle, free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::atk_rectangle_get_type(), ptr as *mut _), type_ => || ffi::atk_rectangle_get_type(), } } atk-0.14.0/src/auto/registry.rs000064400000000000000000000037220072674642500144760ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ObjectFactory; use glib::object::IsA; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "AtkRegistry")] pub struct Registry(Object); match fn { type_ => || ffi::atk_registry_get_type(), } } pub const NONE_REGISTRY: Option<&Registry> = None; pub trait RegistryExt: 'static { #[doc(alias = "atk_registry_get_factory")] #[doc(alias = "get_factory")] fn factory(&self, type_: glib::types::Type) -> Option; #[doc(alias = "atk_registry_get_factory_type")] #[doc(alias = "get_factory_type")] fn factory_type(&self, type_: glib::types::Type) -> glib::types::Type; #[doc(alias = "atk_registry_set_factory_type")] fn set_factory_type(&self, type_: glib::types::Type, factory_type: glib::types::Type); } impl> RegistryExt for O { fn factory(&self, type_: glib::types::Type) -> Option { unsafe { from_glib_none(ffi::atk_registry_get_factory( self.as_ref().to_glib_none().0, type_.into_glib(), )) } } fn factory_type(&self, type_: glib::types::Type) -> glib::types::Type { unsafe { from_glib(ffi::atk_registry_get_factory_type( self.as_ref().to_glib_none().0, type_.into_glib(), )) } } fn set_factory_type(&self, type_: glib::types::Type, factory_type: glib::types::Type) { unsafe { ffi::atk_registry_set_factory_type( self.as_ref().to_glib_none().0, type_.into_glib(), factory_type.into_glib(), ); } } } impl fmt::Display for Registry { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Registry") } } atk-0.14.0/src/auto/relation.rs000064400000000000000000000126470072674642500144510ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Object; use crate::RelationType; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::ToValue; use std::boxed::Box as Box_; use std::fmt; use std::mem::transmute; glib::wrapper! { #[doc(alias = "AtkRelation")] pub struct Relation(Object); match fn { type_ => || ffi::atk_relation_get_type(), } } impl Relation { #[doc(alias = "atk_relation_new")] pub fn new(targets: &[Object], relationship: RelationType) -> Relation { assert_initialized_main_thread!(); let n_targets = targets.len() as i32; unsafe { from_glib_full(ffi::atk_relation_new( targets.to_glib_none().0, n_targets, relationship.into_glib(), )) } } } pub const NONE_RELATION: Option<&Relation> = None; pub trait RelationExt: 'static { #[doc(alias = "atk_relation_add_target")] fn add_target>(&self, target: &P); #[doc(alias = "atk_relation_get_relation_type")] #[doc(alias = "get_relation_type")] fn relation_type(&self) -> RelationType; #[doc(alias = "atk_relation_get_target")] #[doc(alias = "get_target")] fn target(&self) -> Vec; #[doc(alias = "atk_relation_remove_target")] fn remove_target>(&self, target: &P) -> bool; #[doc(alias = "relation-type")] fn set_relation_type(&self, relation_type: RelationType); fn set_target(&self, target: Option<&glib::ValueArray>); #[doc(alias = "relation-type")] fn connect_relation_type_notify(&self, f: F) -> SignalHandlerId; #[doc(alias = "target")] fn connect_target_notify(&self, f: F) -> SignalHandlerId; } impl> RelationExt for O { fn add_target>(&self, target: &P) { unsafe { ffi::atk_relation_add_target( self.as_ref().to_glib_none().0, target.as_ref().to_glib_none().0, ); } } fn relation_type(&self) -> RelationType { unsafe { from_glib(ffi::atk_relation_get_relation_type( self.as_ref().to_glib_none().0, )) } } fn target(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_none(ffi::atk_relation_get_target( self.as_ref().to_glib_none().0, )) } } fn remove_target>(&self, target: &P) -> bool { unsafe { from_glib(ffi::atk_relation_remove_target( self.as_ref().to_glib_none().0, target.as_ref().to_glib_none().0, )) } } fn set_relation_type(&self, relation_type: RelationType) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"relation-type\0".as_ptr() as *const _, relation_type.to_value().to_glib_none().0, ); } } fn set_target(&self, target: Option<&glib::ValueArray>) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"target\0".as_ptr() as *const _, target.to_value().to_glib_none().0, ); } } fn connect_relation_type_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_relation_type_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkRelation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Relation::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::relation-type\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_relation_type_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_target_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_target_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkRelation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Relation::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::target\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_target_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl fmt::Display for Relation { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Relation") } } atk-0.14.0/src/auto/relation_set.rs000064400000000000000000000101540072674642500153130ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Object; use crate::Relation; use crate::RelationType; use glib::object::IsA; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "AtkRelationSet")] pub struct RelationSet(Object); match fn { type_ => || ffi::atk_relation_set_get_type(), } } impl RelationSet { #[doc(alias = "atk_relation_set_new")] pub fn new() -> RelationSet { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::atk_relation_set_new()) } } } impl Default for RelationSet { fn default() -> Self { Self::new() } } pub const NONE_RELATION_SET: Option<&RelationSet> = None; pub trait RelationSetExt: 'static { #[doc(alias = "atk_relation_set_add")] fn add>(&self, relation: &P); #[doc(alias = "atk_relation_set_add_relation_by_type")] fn add_relation_by_type>(&self, relationship: RelationType, target: &P); #[doc(alias = "atk_relation_set_contains")] fn contains(&self, relationship: RelationType) -> bool; #[doc(alias = "atk_relation_set_contains_target")] fn contains_target>(&self, relationship: RelationType, target: &P) -> bool; #[doc(alias = "atk_relation_set_get_n_relations")] #[doc(alias = "get_n_relations")] fn n_relations(&self) -> i32; #[doc(alias = "atk_relation_set_get_relation")] #[doc(alias = "get_relation")] fn relation(&self, i: i32) -> Option; #[doc(alias = "atk_relation_set_get_relation_by_type")] #[doc(alias = "get_relation_by_type")] fn relation_by_type(&self, relationship: RelationType) -> Option; #[doc(alias = "atk_relation_set_remove")] fn remove>(&self, relation: &P); } impl> RelationSetExt for O { fn add>(&self, relation: &P) { unsafe { ffi::atk_relation_set_add( self.as_ref().to_glib_none().0, relation.as_ref().to_glib_none().0, ); } } fn add_relation_by_type>(&self, relationship: RelationType, target: &P) { unsafe { ffi::atk_relation_set_add_relation_by_type( self.as_ref().to_glib_none().0, relationship.into_glib(), target.as_ref().to_glib_none().0, ); } } fn contains(&self, relationship: RelationType) -> bool { unsafe { from_glib(ffi::atk_relation_set_contains( self.as_ref().to_glib_none().0, relationship.into_glib(), )) } } fn contains_target>(&self, relationship: RelationType, target: &P) -> bool { unsafe { from_glib(ffi::atk_relation_set_contains_target( self.as_ref().to_glib_none().0, relationship.into_glib(), target.as_ref().to_glib_none().0, )) } } fn n_relations(&self) -> i32 { unsafe { ffi::atk_relation_set_get_n_relations(self.as_ref().to_glib_none().0) } } fn relation(&self, i: i32) -> Option { unsafe { from_glib_none(ffi::atk_relation_set_get_relation( self.as_ref().to_glib_none().0, i, )) } } fn relation_by_type(&self, relationship: RelationType) -> Option { unsafe { from_glib_none(ffi::atk_relation_set_get_relation_by_type( self.as_ref().to_glib_none().0, relationship.into_glib(), )) } } fn remove>(&self, relation: &P) { unsafe { ffi::atk_relation_set_remove( self.as_ref().to_glib_none().0, relation.as_ref().to_glib_none().0, ); } } } impl fmt::Display for RelationSet { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("RelationSet") } } atk-0.14.0/src/auto/selection.rs000064400000000000000000000076300072674642500146150ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Object; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use std::boxed::Box as Box_; use std::fmt; use std::mem::transmute; glib::wrapper! { #[doc(alias = "AtkSelection")] pub struct Selection(Interface); match fn { type_ => || ffi::atk_selection_get_type(), } } pub const NONE_SELECTION: Option<&Selection> = None; pub trait SelectionExt: 'static { #[doc(alias = "atk_selection_add_selection")] fn add_selection(&self, i: i32) -> bool; #[doc(alias = "atk_selection_clear_selection")] fn clear_selection(&self) -> bool; #[doc(alias = "atk_selection_get_selection_count")] #[doc(alias = "get_selection_count")] fn selection_count(&self) -> i32; #[doc(alias = "atk_selection_is_child_selected")] fn is_child_selected(&self, i: i32) -> bool; #[doc(alias = "atk_selection_ref_selection")] fn ref_selection(&self, i: i32) -> Option; #[doc(alias = "atk_selection_remove_selection")] fn remove_selection(&self, i: i32) -> bool; #[doc(alias = "atk_selection_select_all_selection")] fn select_all_selection(&self) -> bool; #[doc(alias = "selection-changed")] fn connect_selection_changed(&self, f: F) -> SignalHandlerId; } impl> SelectionExt for O { fn add_selection(&self, i: i32) -> bool { unsafe { from_glib(ffi::atk_selection_add_selection( self.as_ref().to_glib_none().0, i, )) } } fn clear_selection(&self) -> bool { unsafe { from_glib(ffi::atk_selection_clear_selection( self.as_ref().to_glib_none().0, )) } } fn selection_count(&self) -> i32 { unsafe { ffi::atk_selection_get_selection_count(self.as_ref().to_glib_none().0) } } fn is_child_selected(&self, i: i32) -> bool { unsafe { from_glib(ffi::atk_selection_is_child_selected( self.as_ref().to_glib_none().0, i, )) } } fn ref_selection(&self, i: i32) -> Option { unsafe { from_glib_full(ffi::atk_selection_ref_selection( self.as_ref().to_glib_none().0, i, )) } } fn remove_selection(&self, i: i32) -> bool { unsafe { from_glib(ffi::atk_selection_remove_selection( self.as_ref().to_glib_none().0, i, )) } } fn select_all_selection(&self) -> bool { unsafe { from_glib(ffi::atk_selection_select_all_selection( self.as_ref().to_glib_none().0, )) } } fn connect_selection_changed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn selection_changed_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkSelection, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Selection::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"selection-changed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( selection_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl fmt::Display for Selection { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Selection") } } atk-0.14.0/src/auto/socket.rs000064400000000000000000000027310072674642500141150ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Component; use crate::Object; use glib::object::Cast; use glib::object::IsA; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "AtkSocket")] pub struct Socket(Object) @extends Object, @implements Component; match fn { type_ => || ffi::atk_socket_get_type(), } } impl Socket { #[doc(alias = "atk_socket_new")] pub fn new() -> Socket { assert_initialized_main_thread!(); unsafe { Object::from_glib_full(ffi::atk_socket_new()).unsafe_cast() } } } impl Default for Socket { fn default() -> Self { Self::new() } } pub const NONE_SOCKET: Option<&Socket> = None; pub trait AtkSocketExt: 'static { #[doc(alias = "atk_socket_embed")] fn embed(&self, plug_id: &str); #[doc(alias = "atk_socket_is_occupied")] fn is_occupied(&self) -> bool; } impl> AtkSocketExt for O { fn embed(&self, plug_id: &str) { unsafe { ffi::atk_socket_embed(self.as_ref().to_glib_none().0, plug_id.to_glib_none().0); } } fn is_occupied(&self) -> bool { unsafe { from_glib(ffi::atk_socket_is_occupied(self.as_ref().to_glib_none().0)) } } } impl fmt::Display for Socket { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Socket") } } atk-0.14.0/src/auto/state_set.rs000064400000000000000000000103200072674642500146110ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::StateType; use glib::object::IsA; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "AtkStateSet")] pub struct StateSet(Object); match fn { type_ => || ffi::atk_state_set_get_type(), } } impl StateSet { #[doc(alias = "atk_state_set_new")] pub fn new() -> StateSet { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::atk_state_set_new()) } } } impl Default for StateSet { fn default() -> Self { Self::new() } } pub const NONE_STATE_SET: Option<&StateSet> = None; pub trait StateSetExt: 'static { #[doc(alias = "atk_state_set_add_state")] fn add_state(&self, type_: StateType) -> bool; //#[doc(alias = "atk_state_set_add_states")] //fn add_states(&self, types: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 68 }); #[doc(alias = "atk_state_set_and_sets")] fn and_sets>(&self, compare_set: &P) -> Option; #[doc(alias = "atk_state_set_clear_states")] fn clear_states(&self); #[doc(alias = "atk_state_set_contains_state")] fn contains_state(&self, type_: StateType) -> bool; //#[doc(alias = "atk_state_set_contains_states")] //fn contains_states(&self, types: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 68 }) -> bool; #[doc(alias = "atk_state_set_is_empty")] fn is_empty(&self) -> bool; #[doc(alias = "atk_state_set_or_sets")] fn or_sets>(&self, compare_set: &P) -> Option; #[doc(alias = "atk_state_set_remove_state")] fn remove_state(&self, type_: StateType) -> bool; #[doc(alias = "atk_state_set_xor_sets")] fn xor_sets>(&self, compare_set: &P) -> Option; } impl> StateSetExt for O { fn add_state(&self, type_: StateType) -> bool { unsafe { from_glib(ffi::atk_state_set_add_state( self.as_ref().to_glib_none().0, type_.into_glib(), )) } } //fn add_states(&self, types: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 68 }) { // unsafe { TODO: call ffi:atk_state_set_add_states() } //} fn and_sets>(&self, compare_set: &P) -> Option { unsafe { from_glib_full(ffi::atk_state_set_and_sets( self.as_ref().to_glib_none().0, compare_set.as_ref().to_glib_none().0, )) } } fn clear_states(&self) { unsafe { ffi::atk_state_set_clear_states(self.as_ref().to_glib_none().0); } } fn contains_state(&self, type_: StateType) -> bool { unsafe { from_glib(ffi::atk_state_set_contains_state( self.as_ref().to_glib_none().0, type_.into_glib(), )) } } //fn contains_states(&self, types: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 68 }) -> bool { // unsafe { TODO: call ffi:atk_state_set_contains_states() } //} fn is_empty(&self) -> bool { unsafe { from_glib(ffi::atk_state_set_is_empty(self.as_ref().to_glib_none().0)) } } fn or_sets>(&self, compare_set: &P) -> Option { unsafe { from_glib_full(ffi::atk_state_set_or_sets( self.as_ref().to_glib_none().0, compare_set.as_ref().to_glib_none().0, )) } } fn remove_state(&self, type_: StateType) -> bool { unsafe { from_glib(ffi::atk_state_set_remove_state( self.as_ref().to_glib_none().0, type_.into_glib(), )) } } fn xor_sets>(&self, compare_set: &P) -> Option { unsafe { from_glib_full(ffi::atk_state_set_xor_sets( self.as_ref().to_glib_none().0, compare_set.as_ref().to_glib_none().0, )) } } } impl fmt::Display for StateSet { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("StateSet") } } atk-0.14.0/src/auto/streamable_content.rs000064400000000000000000000042260072674642500164770ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::object::IsA; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "AtkStreamableContent")] pub struct StreamableContent(Interface); match fn { type_ => || ffi::atk_streamable_content_get_type(), } } pub const NONE_STREAMABLE_CONTENT: Option<&StreamableContent> = None; pub trait StreamableContentExt: 'static { #[doc(alias = "atk_streamable_content_get_mime_type")] #[doc(alias = "get_mime_type")] fn mime_type(&self, i: i32) -> Option; #[doc(alias = "atk_streamable_content_get_n_mime_types")] #[doc(alias = "get_n_mime_types")] fn n_mime_types(&self) -> i32; //#[doc(alias = "atk_streamable_content_get_stream")] //#[doc(alias = "get_stream")] //fn stream(&self, mime_type: &str) -> /*Ignored*/Option; #[doc(alias = "atk_streamable_content_get_uri")] #[doc(alias = "get_uri")] fn uri(&self, mime_type: &str) -> Option; } impl> StreamableContentExt for O { fn mime_type(&self, i: i32) -> Option { unsafe { from_glib_none(ffi::atk_streamable_content_get_mime_type( self.as_ref().to_glib_none().0, i, )) } } fn n_mime_types(&self) -> i32 { unsafe { ffi::atk_streamable_content_get_n_mime_types(self.as_ref().to_glib_none().0) } } //fn stream(&self, mime_type: &str) -> /*Ignored*/Option { // unsafe { TODO: call ffi:atk_streamable_content_get_stream() } //} fn uri(&self, mime_type: &str) -> Option { unsafe { from_glib_none(ffi::atk_streamable_content_get_uri( self.as_ref().to_glib_none().0, mime_type.to_glib_none().0, )) } } } impl fmt::Display for StreamableContent { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("StreamableContent") } } atk-0.14.0/src/auto/table.rs000064400000000000000000000407420072674642500137200ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Object; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use std::boxed::Box as Box_; use std::fmt; use std::mem::transmute; glib::wrapper! { #[doc(alias = "AtkTable")] pub struct Table(Interface); match fn { type_ => || ffi::atk_table_get_type(), } } pub const NONE_TABLE: Option<&Table> = None; pub trait TableExt: 'static { #[doc(alias = "atk_table_add_column_selection")] fn add_column_selection(&self, column: i32) -> bool; #[doc(alias = "atk_table_add_row_selection")] fn add_row_selection(&self, row: i32) -> bool; #[doc(alias = "atk_table_get_caption")] #[doc(alias = "get_caption")] fn caption(&self) -> Option; #[doc(alias = "atk_table_get_column_at_index")] #[doc(alias = "get_column_at_index")] fn column_at_index(&self, index_: i32) -> i32; #[doc(alias = "atk_table_get_column_description")] #[doc(alias = "get_column_description")] fn column_description(&self, column: i32) -> Option; #[doc(alias = "atk_table_get_column_extent_at")] #[doc(alias = "get_column_extent_at")] fn column_extent_at(&self, row: i32, column: i32) -> i32; #[doc(alias = "atk_table_get_column_header")] #[doc(alias = "get_column_header")] fn column_header(&self, column: i32) -> Option; #[doc(alias = "atk_table_get_index_at")] #[doc(alias = "get_index_at")] fn index_at(&self, row: i32, column: i32) -> i32; #[doc(alias = "atk_table_get_n_columns")] #[doc(alias = "get_n_columns")] fn n_columns(&self) -> i32; #[doc(alias = "atk_table_get_n_rows")] #[doc(alias = "get_n_rows")] fn n_rows(&self) -> i32; #[doc(alias = "atk_table_get_row_at_index")] #[doc(alias = "get_row_at_index")] fn row_at_index(&self, index_: i32) -> i32; #[doc(alias = "atk_table_get_row_description")] #[doc(alias = "get_row_description")] fn row_description(&self, row: i32) -> Option; #[doc(alias = "atk_table_get_row_extent_at")] #[doc(alias = "get_row_extent_at")] fn row_extent_at(&self, row: i32, column: i32) -> i32; #[doc(alias = "atk_table_get_row_header")] #[doc(alias = "get_row_header")] fn row_header(&self, row: i32) -> Option; #[doc(alias = "atk_table_get_summary")] #[doc(alias = "get_summary")] fn summary(&self) -> Option; #[doc(alias = "atk_table_is_column_selected")] fn is_column_selected(&self, column: i32) -> bool; #[doc(alias = "atk_table_is_row_selected")] fn is_row_selected(&self, row: i32) -> bool; #[doc(alias = "atk_table_is_selected")] fn is_selected(&self, row: i32, column: i32) -> bool; #[doc(alias = "atk_table_ref_at")] fn ref_at(&self, row: i32, column: i32) -> Option; #[doc(alias = "atk_table_remove_column_selection")] fn remove_column_selection(&self, column: i32) -> bool; #[doc(alias = "atk_table_remove_row_selection")] fn remove_row_selection(&self, row: i32) -> bool; #[doc(alias = "atk_table_set_caption")] fn set_caption>(&self, caption: &P); #[doc(alias = "atk_table_set_column_description")] fn set_column_description(&self, column: i32, description: &str); #[doc(alias = "atk_table_set_column_header")] fn set_column_header>(&self, column: i32, header: &P); #[doc(alias = "atk_table_set_row_description")] fn set_row_description(&self, row: i32, description: &str); #[doc(alias = "atk_table_set_row_header")] fn set_row_header>(&self, row: i32, header: &P); #[doc(alias = "atk_table_set_summary")] fn set_summary>(&self, accessible: &P); #[doc(alias = "column-deleted")] fn connect_column_deleted(&self, f: F) -> SignalHandlerId; #[doc(alias = "column-inserted")] fn connect_column_inserted(&self, f: F) -> SignalHandlerId; #[doc(alias = "column-reordered")] fn connect_column_reordered(&self, f: F) -> SignalHandlerId; #[doc(alias = "model-changed")] fn connect_model_changed(&self, f: F) -> SignalHandlerId; #[doc(alias = "row-deleted")] fn connect_row_deleted(&self, f: F) -> SignalHandlerId; #[doc(alias = "row-inserted")] fn connect_row_inserted(&self, f: F) -> SignalHandlerId; #[doc(alias = "row-reordered")] fn connect_row_reordered(&self, f: F) -> SignalHandlerId; } impl> TableExt for O { fn add_column_selection(&self, column: i32) -> bool { unsafe { from_glib(ffi::atk_table_add_column_selection( self.as_ref().to_glib_none().0, column, )) } } fn add_row_selection(&self, row: i32) -> bool { unsafe { from_glib(ffi::atk_table_add_row_selection( self.as_ref().to_glib_none().0, row, )) } } fn caption(&self) -> Option { unsafe { from_glib_none(ffi::atk_table_get_caption(self.as_ref().to_glib_none().0)) } } fn column_at_index(&self, index_: i32) -> i32 { unsafe { ffi::atk_table_get_column_at_index(self.as_ref().to_glib_none().0, index_) } } fn column_description(&self, column: i32) -> Option { unsafe { from_glib_none(ffi::atk_table_get_column_description( self.as_ref().to_glib_none().0, column, )) } } fn column_extent_at(&self, row: i32, column: i32) -> i32 { unsafe { ffi::atk_table_get_column_extent_at(self.as_ref().to_glib_none().0, row, column) } } fn column_header(&self, column: i32) -> Option { unsafe { from_glib_none(ffi::atk_table_get_column_header( self.as_ref().to_glib_none().0, column, )) } } fn index_at(&self, row: i32, column: i32) -> i32 { unsafe { ffi::atk_table_get_index_at(self.as_ref().to_glib_none().0, row, column) } } fn n_columns(&self) -> i32 { unsafe { ffi::atk_table_get_n_columns(self.as_ref().to_glib_none().0) } } fn n_rows(&self) -> i32 { unsafe { ffi::atk_table_get_n_rows(self.as_ref().to_glib_none().0) } } fn row_at_index(&self, index_: i32) -> i32 { unsafe { ffi::atk_table_get_row_at_index(self.as_ref().to_glib_none().0, index_) } } fn row_description(&self, row: i32) -> Option { unsafe { from_glib_none(ffi::atk_table_get_row_description( self.as_ref().to_glib_none().0, row, )) } } fn row_extent_at(&self, row: i32, column: i32) -> i32 { unsafe { ffi::atk_table_get_row_extent_at(self.as_ref().to_glib_none().0, row, column) } } fn row_header(&self, row: i32) -> Option { unsafe { from_glib_none(ffi::atk_table_get_row_header( self.as_ref().to_glib_none().0, row, )) } } fn summary(&self) -> Option { unsafe { from_glib_full(ffi::atk_table_get_summary(self.as_ref().to_glib_none().0)) } } fn is_column_selected(&self, column: i32) -> bool { unsafe { from_glib(ffi::atk_table_is_column_selected( self.as_ref().to_glib_none().0, column, )) } } fn is_row_selected(&self, row: i32) -> bool { unsafe { from_glib(ffi::atk_table_is_row_selected( self.as_ref().to_glib_none().0, row, )) } } fn is_selected(&self, row: i32, column: i32) -> bool { unsafe { from_glib(ffi::atk_table_is_selected( self.as_ref().to_glib_none().0, row, column, )) } } fn ref_at(&self, row: i32, column: i32) -> Option { unsafe { from_glib_full(ffi::atk_table_ref_at( self.as_ref().to_glib_none().0, row, column, )) } } fn remove_column_selection(&self, column: i32) -> bool { unsafe { from_glib(ffi::atk_table_remove_column_selection( self.as_ref().to_glib_none().0, column, )) } } fn remove_row_selection(&self, row: i32) -> bool { unsafe { from_glib(ffi::atk_table_remove_row_selection( self.as_ref().to_glib_none().0, row, )) } } fn set_caption>(&self, caption: &P) { unsafe { ffi::atk_table_set_caption( self.as_ref().to_glib_none().0, caption.as_ref().to_glib_none().0, ); } } fn set_column_description(&self, column: i32, description: &str) { unsafe { ffi::atk_table_set_column_description( self.as_ref().to_glib_none().0, column, description.to_glib_none().0, ); } } fn set_column_header>(&self, column: i32, header: &P) { unsafe { ffi::atk_table_set_column_header( self.as_ref().to_glib_none().0, column, header.as_ref().to_glib_none().0, ); } } fn set_row_description(&self, row: i32, description: &str) { unsafe { ffi::atk_table_set_row_description( self.as_ref().to_glib_none().0, row, description.to_glib_none().0, ); } } fn set_row_header>(&self, row: i32, header: &P) { unsafe { ffi::atk_table_set_row_header( self.as_ref().to_glib_none().0, row, header.as_ref().to_glib_none().0, ); } } fn set_summary>(&self, accessible: &P) { unsafe { ffi::atk_table_set_summary( self.as_ref().to_glib_none().0, accessible.as_ref().to_glib_none().0, ); } } fn connect_column_deleted(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn column_deleted_trampoline< P: IsA, F: Fn(&P, i32, i32) + 'static, >( this: *mut ffi::AtkTable, arg1: libc::c_int, arg2: libc::c_int, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Table::from_glib_borrow(this).unsafe_cast_ref(), arg1, arg2) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"column-deleted\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( column_deleted_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_column_inserted(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn column_inserted_trampoline< P: IsA
, F: Fn(&P, i32, i32) + 'static, >( this: *mut ffi::AtkTable, arg1: libc::c_int, arg2: libc::c_int, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Table::from_glib_borrow(this).unsafe_cast_ref(), arg1, arg2) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"column-inserted\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( column_inserted_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_column_reordered(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn column_reordered_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkTable, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Table::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"column-reordered\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( column_reordered_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_model_changed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn model_changed_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkTable, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Table::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"model-changed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( model_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_row_deleted(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn row_deleted_trampoline< P: IsA
, F: Fn(&P, i32, i32) + 'static, >( this: *mut ffi::AtkTable, arg1: libc::c_int, arg2: libc::c_int, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Table::from_glib_borrow(this).unsafe_cast_ref(), arg1, arg2) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"row-deleted\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( row_deleted_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_row_inserted(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn row_inserted_trampoline< P: IsA
, F: Fn(&P, i32, i32) + 'static, >( this: *mut ffi::AtkTable, arg1: libc::c_int, arg2: libc::c_int, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Table::from_glib_borrow(this).unsafe_cast_ref(), arg1, arg2) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"row-inserted\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( row_inserted_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_row_reordered(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn row_reordered_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkTable, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Table::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"row-reordered\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( row_reordered_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl fmt::Display for Table { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Table") } } atk-0.14.0/src/auto/table_cell.rs000064400000000000000000000101050072674642500147050ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Object; use glib::object::IsA; use glib::translate::*; use std::fmt; use std::mem; glib::wrapper! { #[doc(alias = "AtkTableCell")] pub struct TableCell(Interface) @requires Object; match fn { type_ => || ffi::atk_table_cell_get_type(), } } pub const NONE_TABLE_CELL: Option<&TableCell> = None; pub trait TableCellExt: 'static { #[doc(alias = "atk_table_cell_get_column_header_cells")] #[doc(alias = "get_column_header_cells")] fn column_header_cells(&self) -> Vec; #[doc(alias = "atk_table_cell_get_column_span")] #[doc(alias = "get_column_span")] fn column_span(&self) -> i32; #[doc(alias = "atk_table_cell_get_position")] #[doc(alias = "get_position")] fn position(&self) -> Option<(i32, i32)>; #[doc(alias = "atk_table_cell_get_row_column_span")] #[doc(alias = "get_row_column_span")] fn row_column_span(&self) -> Option<(i32, i32, i32, i32)>; #[doc(alias = "atk_table_cell_get_row_header_cells")] #[doc(alias = "get_row_header_cells")] fn row_header_cells(&self) -> Vec; #[doc(alias = "atk_table_cell_get_row_span")] #[doc(alias = "get_row_span")] fn row_span(&self) -> i32; #[doc(alias = "atk_table_cell_get_table")] #[doc(alias = "get_table")] fn table(&self) -> Option; } impl> TableCellExt for O { fn column_header_cells(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::atk_table_cell_get_column_header_cells( self.as_ref().to_glib_none().0, )) } } fn column_span(&self) -> i32 { unsafe { ffi::atk_table_cell_get_column_span(self.as_ref().to_glib_none().0) } } fn position(&self) -> Option<(i32, i32)> { unsafe { let mut row = mem::MaybeUninit::uninit(); let mut column = mem::MaybeUninit::uninit(); let ret = from_glib(ffi::atk_table_cell_get_position( self.as_ref().to_glib_none().0, row.as_mut_ptr(), column.as_mut_ptr(), )); let row = row.assume_init(); let column = column.assume_init(); if ret { Some((row, column)) } else { None } } } fn row_column_span(&self) -> Option<(i32, i32, i32, i32)> { unsafe { let mut row = mem::MaybeUninit::uninit(); let mut column = mem::MaybeUninit::uninit(); let mut row_span = mem::MaybeUninit::uninit(); let mut column_span = mem::MaybeUninit::uninit(); let ret = from_glib(ffi::atk_table_cell_get_row_column_span( self.as_ref().to_glib_none().0, row.as_mut_ptr(), column.as_mut_ptr(), row_span.as_mut_ptr(), column_span.as_mut_ptr(), )); let row = row.assume_init(); let column = column.assume_init(); let row_span = row_span.assume_init(); let column_span = column_span.assume_init(); if ret { Some((row, column, row_span, column_span)) } else { None } } } fn row_header_cells(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::atk_table_cell_get_row_header_cells( self.as_ref().to_glib_none().0, )) } } fn row_span(&self) -> i32 { unsafe { ffi::atk_table_cell_get_row_span(self.as_ref().to_glib_none().0) } } fn table(&self) -> Option { unsafe { from_glib_full(ffi::atk_table_cell_get_table( self.as_ref().to_glib_none().0, )) } } } impl fmt::Display for TableCell { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("TableCell") } } atk-0.14.0/src/auto/text.rs000064400000000000000000000440140072674642500136110ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::CoordType; #[cfg(any(feature = "v2_32", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_32")))] use crate::ScrollType; use crate::TextBoundary; use crate::TextClipType; use crate::TextGranularity; use crate::TextRange; use crate::TextRectangle; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use std::boxed::Box as Box_; use std::fmt; use std::mem; use std::mem::transmute; glib::wrapper! { #[doc(alias = "AtkText")] pub struct Text(Interface); match fn { type_ => || ffi::atk_text_get_type(), } } pub const NONE_TEXT: Option<&Text> = None; pub trait TextExt: 'static { #[doc(alias = "atk_text_add_selection")] fn add_selection(&self, start_offset: i32, end_offset: i32) -> bool; #[doc(alias = "atk_text_get_bounded_ranges")] #[doc(alias = "get_bounded_ranges")] fn bounded_ranges( &self, rect: &mut TextRectangle, coord_type: CoordType, x_clip_type: TextClipType, y_clip_type: TextClipType, ) -> Vec; #[doc(alias = "atk_text_get_caret_offset")] #[doc(alias = "get_caret_offset")] fn caret_offset(&self) -> i32; #[doc(alias = "atk_text_get_character_at_offset")] #[doc(alias = "get_character_at_offset")] fn character_at_offset(&self, offset: i32) -> char; #[doc(alias = "atk_text_get_character_count")] #[doc(alias = "get_character_count")] fn character_count(&self) -> i32; #[doc(alias = "atk_text_get_character_extents")] #[doc(alias = "get_character_extents")] fn character_extents(&self, offset: i32, coords: CoordType) -> (i32, i32, i32, i32); //#[doc(alias = "atk_text_get_default_attributes")] //#[doc(alias = "get_default_attributes")] //fn default_attributes(&self) -> /*Ignored*/Option; #[doc(alias = "atk_text_get_n_selections")] #[doc(alias = "get_n_selections")] fn n_selections(&self) -> i32; #[doc(alias = "atk_text_get_offset_at_point")] #[doc(alias = "get_offset_at_point")] fn offset_at_point(&self, x: i32, y: i32, coords: CoordType) -> i32; #[doc(alias = "atk_text_get_range_extents")] #[doc(alias = "get_range_extents")] fn range_extents( &self, start_offset: i32, end_offset: i32, coord_type: CoordType, ) -> TextRectangle; //#[doc(alias = "atk_text_get_run_attributes")] //#[doc(alias = "get_run_attributes")] //fn run_attributes(&self, offset: i32) -> (/*Ignored*/AttributeSet, i32, i32); #[doc(alias = "atk_text_get_selection")] #[doc(alias = "get_selection")] fn selection(&self, selection_num: i32) -> (glib::GString, i32, i32); #[doc(alias = "atk_text_get_string_at_offset")] #[doc(alias = "get_string_at_offset")] fn string_at_offset( &self, offset: i32, granularity: TextGranularity, ) -> (Option, i32, i32); #[doc(alias = "atk_text_get_text")] #[doc(alias = "get_text")] fn text(&self, start_offset: i32, end_offset: i32) -> Option; #[doc(alias = "atk_text_get_text_at_offset")] #[doc(alias = "get_text_at_offset")] fn text_at_offset(&self, offset: i32, boundary_type: TextBoundary) -> (glib::GString, i32, i32); #[doc(alias = "atk_text_remove_selection")] fn remove_selection(&self, selection_num: i32) -> bool; #[cfg(any(feature = "v2_32", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_32")))] #[doc(alias = "atk_text_scroll_substring_to")] fn scroll_substring_to(&self, start_offset: i32, end_offset: i32, type_: ScrollType) -> bool; #[cfg(any(feature = "v2_32", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_32")))] #[doc(alias = "atk_text_scroll_substring_to_point")] fn scroll_substring_to_point( &self, start_offset: i32, end_offset: i32, coords: CoordType, x: i32, y: i32, ) -> bool; #[doc(alias = "atk_text_set_caret_offset")] fn set_caret_offset(&self, offset: i32) -> bool; #[doc(alias = "atk_text_set_selection")] fn set_selection(&self, selection_num: i32, start_offset: i32, end_offset: i32) -> bool; #[doc(alias = "text-attributes-changed")] fn connect_text_attributes_changed(&self, f: F) -> SignalHandlerId; #[doc(alias = "text-caret-moved")] fn connect_text_caret_moved(&self, f: F) -> SignalHandlerId; #[doc(alias = "text-insert")] fn connect_text_insert( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId; #[doc(alias = "text-remove")] fn connect_text_remove( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId; #[doc(alias = "text-selection-changed")] fn connect_text_selection_changed(&self, f: F) -> SignalHandlerId; } impl> TextExt for O { fn add_selection(&self, start_offset: i32, end_offset: i32) -> bool { unsafe { from_glib(ffi::atk_text_add_selection( self.as_ref().to_glib_none().0, start_offset, end_offset, )) } } fn bounded_ranges( &self, rect: &mut TextRectangle, coord_type: CoordType, x_clip_type: TextClipType, y_clip_type: TextClipType, ) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::atk_text_get_bounded_ranges( self.as_ref().to_glib_none().0, rect.to_glib_none_mut().0, coord_type.into_glib(), x_clip_type.into_glib(), y_clip_type.into_glib(), )) } } fn caret_offset(&self) -> i32 { unsafe { ffi::atk_text_get_caret_offset(self.as_ref().to_glib_none().0) } } fn character_at_offset(&self, offset: i32) -> char { unsafe { std::convert::TryFrom::try_from(ffi::atk_text_get_character_at_offset( self.as_ref().to_glib_none().0, offset, )) .expect("conversion from an invalid Unicode value attempted") } } fn character_count(&self) -> i32 { unsafe { ffi::atk_text_get_character_count(self.as_ref().to_glib_none().0) } } fn character_extents(&self, offset: i32, coords: CoordType) -> (i32, i32, i32, i32) { unsafe { let mut x = mem::MaybeUninit::uninit(); let mut y = mem::MaybeUninit::uninit(); let mut width = mem::MaybeUninit::uninit(); let mut height = mem::MaybeUninit::uninit(); ffi::atk_text_get_character_extents( self.as_ref().to_glib_none().0, offset, x.as_mut_ptr(), y.as_mut_ptr(), width.as_mut_ptr(), height.as_mut_ptr(), coords.into_glib(), ); let x = x.assume_init(); let y = y.assume_init(); let width = width.assume_init(); let height = height.assume_init(); (x, y, width, height) } } //fn default_attributes(&self) -> /*Ignored*/Option { // unsafe { TODO: call ffi:atk_text_get_default_attributes() } //} fn n_selections(&self) -> i32 { unsafe { ffi::atk_text_get_n_selections(self.as_ref().to_glib_none().0) } } fn offset_at_point(&self, x: i32, y: i32, coords: CoordType) -> i32 { unsafe { ffi::atk_text_get_offset_at_point( self.as_ref().to_glib_none().0, x, y, coords.into_glib(), ) } } fn range_extents( &self, start_offset: i32, end_offset: i32, coord_type: CoordType, ) -> TextRectangle { unsafe { let mut rect = TextRectangle::uninitialized(); ffi::atk_text_get_range_extents( self.as_ref().to_glib_none().0, start_offset, end_offset, coord_type.into_glib(), rect.to_glib_none_mut().0, ); rect } } //fn run_attributes(&self, offset: i32) -> (/*Ignored*/AttributeSet, i32, i32) { // unsafe { TODO: call ffi:atk_text_get_run_attributes() } //} fn selection(&self, selection_num: i32) -> (glib::GString, i32, i32) { unsafe { let mut start_offset = mem::MaybeUninit::uninit(); let mut end_offset = mem::MaybeUninit::uninit(); let ret = from_glib_full(ffi::atk_text_get_selection( self.as_ref().to_glib_none().0, selection_num, start_offset.as_mut_ptr(), end_offset.as_mut_ptr(), )); let start_offset = start_offset.assume_init(); let end_offset = end_offset.assume_init(); (ret, start_offset, end_offset) } } fn string_at_offset( &self, offset: i32, granularity: TextGranularity, ) -> (Option, i32, i32) { unsafe { let mut start_offset = mem::MaybeUninit::uninit(); let mut end_offset = mem::MaybeUninit::uninit(); let ret = from_glib_full(ffi::atk_text_get_string_at_offset( self.as_ref().to_glib_none().0, offset, granularity.into_glib(), start_offset.as_mut_ptr(), end_offset.as_mut_ptr(), )); let start_offset = start_offset.assume_init(); let end_offset = end_offset.assume_init(); (ret, start_offset, end_offset) } } fn text(&self, start_offset: i32, end_offset: i32) -> Option { unsafe { from_glib_full(ffi::atk_text_get_text( self.as_ref().to_glib_none().0, start_offset, end_offset, )) } } fn text_at_offset( &self, offset: i32, boundary_type: TextBoundary, ) -> (glib::GString, i32, i32) { unsafe { let mut start_offset = mem::MaybeUninit::uninit(); let mut end_offset = mem::MaybeUninit::uninit(); let ret = from_glib_full(ffi::atk_text_get_text_at_offset( self.as_ref().to_glib_none().0, offset, boundary_type.into_glib(), start_offset.as_mut_ptr(), end_offset.as_mut_ptr(), )); let start_offset = start_offset.assume_init(); let end_offset = end_offset.assume_init(); (ret, start_offset, end_offset) } } fn remove_selection(&self, selection_num: i32) -> bool { unsafe { from_glib(ffi::atk_text_remove_selection( self.as_ref().to_glib_none().0, selection_num, )) } } #[cfg(any(feature = "v2_32", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_32")))] fn scroll_substring_to(&self, start_offset: i32, end_offset: i32, type_: ScrollType) -> bool { unsafe { from_glib(ffi::atk_text_scroll_substring_to( self.as_ref().to_glib_none().0, start_offset, end_offset, type_.into_glib(), )) } } #[cfg(any(feature = "v2_32", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_32")))] fn scroll_substring_to_point( &self, start_offset: i32, end_offset: i32, coords: CoordType, x: i32, y: i32, ) -> bool { unsafe { from_glib(ffi::atk_text_scroll_substring_to_point( self.as_ref().to_glib_none().0, start_offset, end_offset, coords.into_glib(), x, y, )) } } fn set_caret_offset(&self, offset: i32) -> bool { unsafe { from_glib(ffi::atk_text_set_caret_offset( self.as_ref().to_glib_none().0, offset, )) } } fn set_selection(&self, selection_num: i32, start_offset: i32, end_offset: i32) -> bool { unsafe { from_glib(ffi::atk_text_set_selection( self.as_ref().to_glib_none().0, selection_num, start_offset, end_offset, )) } } fn connect_text_attributes_changed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn text_attributes_changed_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkText, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Text::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"text-attributes-changed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( text_attributes_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_text_caret_moved(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn text_caret_moved_trampoline, F: Fn(&P, i32) + 'static>( this: *mut ffi::AtkText, arg1: libc::c_int, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Text::from_glib_borrow(this).unsafe_cast_ref(), arg1) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"text-caret-moved\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( text_caret_moved_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_text_insert( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId { unsafe extern "C" fn text_insert_trampoline< P: IsA, F: Fn(&P, i32, i32, &str) + 'static, >( this: *mut ffi::AtkText, arg1: libc::c_int, arg2: libc::c_int, arg3: *mut libc::c_char, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( Text::from_glib_borrow(this).unsafe_cast_ref(), arg1, arg2, &glib::GString::from_glib_borrow(arg3), ) } unsafe { let f: Box_ = Box_::new(f); let detailed_signal_name = detail.map(|name| format!("text-insert::{}\0", name)); let signal_name: &[u8] = detailed_signal_name .as_ref() .map_or(&b"text-insert\0"[..], |n| n.as_bytes()); connect_raw( self.as_ptr() as *mut _, signal_name.as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( text_insert_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_text_remove( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId { unsafe extern "C" fn text_remove_trampoline< P: IsA, F: Fn(&P, i32, i32, &str) + 'static, >( this: *mut ffi::AtkText, arg1: libc::c_int, arg2: libc::c_int, arg3: *mut libc::c_char, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( Text::from_glib_borrow(this).unsafe_cast_ref(), arg1, arg2, &glib::GString::from_glib_borrow(arg3), ) } unsafe { let f: Box_ = Box_::new(f); let detailed_signal_name = detail.map(|name| format!("text-remove::{}\0", name)); let signal_name: &[u8] = detailed_signal_name .as_ref() .map_or(&b"text-remove\0"[..], |n| n.as_bytes()); connect_raw( self.as_ptr() as *mut _, signal_name.as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( text_remove_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_text_selection_changed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn text_selection_changed_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::AtkText, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Text::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"text-selection-changed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( text_selection_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl fmt::Display for Text { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Text") } } atk-0.14.0/src/auto/text_range.rs000064400000000000000000000010740072674642500147640ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct TextRange(Boxed); match fn { copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::atk_text_range_get_type(), ptr as *mut _) as *mut ffi::AtkTextRange, free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::atk_text_range_get_type(), ptr as *mut _), type_ => || ffi::atk_text_range_get_type(), } } atk-0.14.0/src/auto/util.rs000064400000000000000000000010030072674642500135710ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use std::fmt; glib::wrapper! { #[doc(alias = "AtkUtil")] pub struct Util(Object); match fn { type_ => || ffi::atk_util_get_type(), } } impl Util {} pub const NONE_UTIL: Option<&Util> = None; impl fmt::Display for Util { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Util") } } atk-0.14.0/src/auto/value.rs000064400000000000000000000132510072674642500137400ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Range; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use std::boxed::Box as Box_; use std::fmt; use std::mem; use std::mem::transmute; use std::ptr; glib::wrapper! { #[doc(alias = "AtkValue")] pub struct Value(Interface); match fn { type_ => || ffi::atk_value_get_type(), } } pub const NONE_VALUE: Option<&Value> = None; pub trait ValueExt: 'static { #[doc(alias = "atk_value_get_current_value")] #[doc(alias = "get_current_value")] fn current_value(&self) -> glib::Value; #[doc(alias = "atk_value_get_increment")] #[doc(alias = "get_increment")] fn increment(&self) -> f64; #[doc(alias = "atk_value_get_maximum_value")] #[doc(alias = "get_maximum_value")] fn maximum_value(&self) -> glib::Value; #[doc(alias = "atk_value_get_minimum_increment")] #[doc(alias = "get_minimum_increment")] fn minimum_increment(&self) -> glib::Value; #[doc(alias = "atk_value_get_minimum_value")] #[doc(alias = "get_minimum_value")] fn minimum_value(&self) -> glib::Value; #[doc(alias = "atk_value_get_range")] #[doc(alias = "get_range")] fn range(&self) -> Option; #[doc(alias = "atk_value_get_sub_ranges")] #[doc(alias = "get_sub_ranges")] fn sub_ranges(&self) -> Vec; #[doc(alias = "atk_value_get_value_and_text")] #[doc(alias = "get_value_and_text")] fn value_and_text(&self) -> (f64, glib::GString); #[doc(alias = "atk_value_set_current_value")] fn set_current_value(&self, value: &glib::Value) -> bool; #[doc(alias = "atk_value_set_value")] fn set_value(&self, new_value: f64); #[doc(alias = "value-changed")] fn connect_value_changed(&self, f: F) -> SignalHandlerId; } impl> ValueExt for O { fn current_value(&self) -> glib::Value { unsafe { let mut value = glib::Value::uninitialized(); ffi::atk_value_get_current_value( self.as_ref().to_glib_none().0, value.to_glib_none_mut().0, ); value } } fn increment(&self) -> f64 { unsafe { ffi::atk_value_get_increment(self.as_ref().to_glib_none().0) } } fn maximum_value(&self) -> glib::Value { unsafe { let mut value = glib::Value::uninitialized(); ffi::atk_value_get_maximum_value( self.as_ref().to_glib_none().0, value.to_glib_none_mut().0, ); value } } fn minimum_increment(&self) -> glib::Value { unsafe { let mut value = glib::Value::uninitialized(); ffi::atk_value_get_minimum_increment( self.as_ref().to_glib_none().0, value.to_glib_none_mut().0, ); value } } fn minimum_value(&self) -> glib::Value { unsafe { let mut value = glib::Value::uninitialized(); ffi::atk_value_get_minimum_value( self.as_ref().to_glib_none().0, value.to_glib_none_mut().0, ); value } } fn range(&self) -> Option { unsafe { from_glib_full(ffi::atk_value_get_range(self.as_ref().to_glib_none().0)) } } fn sub_ranges(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::atk_value_get_sub_ranges( self.as_ref().to_glib_none().0, )) } } fn value_and_text(&self) -> (f64, glib::GString) { unsafe { let mut value = mem::MaybeUninit::uninit(); let mut text = ptr::null_mut(); ffi::atk_value_get_value_and_text( self.as_ref().to_glib_none().0, value.as_mut_ptr(), &mut text, ); let value = value.assume_init(); (value, from_glib_full(text)) } } fn set_current_value(&self, value: &glib::Value) -> bool { unsafe { from_glib(ffi::atk_value_set_current_value( self.as_ref().to_glib_none().0, value.to_glib_none().0, )) } } fn set_value(&self, new_value: f64) { unsafe { ffi::atk_value_set_value(self.as_ref().to_glib_none().0, new_value); } } fn connect_value_changed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn value_changed_trampoline< P: IsA, F: Fn(&P, f64, &str) + 'static, >( this: *mut ffi::AtkValue, value: libc::c_double, text: *mut libc::c_char, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( Value::from_glib_borrow(this).unsafe_cast_ref(), value, &glib::GString::from_glib_borrow(text), ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"value-changed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( value_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl fmt::Display for Value { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Value") } } atk-0.14.0/src/auto/versions.txt000064400000000000000000000001720072674642500146650ustar 00000000000000Generated by gir (https://github.com/gtk-rs/gir @ 6ed30fc) from gir-files (https://github.com/gtk-rs/gir-files @ 7d95377) atk-0.14.0/src/auto/window.rs000064400000000000000000000207310072674642500141340ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Object; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use std::boxed::Box as Box_; use std::fmt; use std::mem::transmute; glib::wrapper! { #[doc(alias = "AtkWindow")] pub struct Window(Interface) @requires Object; match fn { type_ => || ffi::atk_window_get_type(), } } pub const NONE_WINDOW: Option<&Window> = None; pub trait AtkWindowExt: 'static { #[doc(alias = "activate")] fn connect_activate(&self, f: F) -> SignalHandlerId; #[doc(alias = "create")] fn connect_create(&self, f: F) -> SignalHandlerId; #[doc(alias = "deactivate")] fn connect_deactivate(&self, f: F) -> SignalHandlerId; #[doc(alias = "destroy")] fn connect_destroy(&self, f: F) -> SignalHandlerId; #[doc(alias = "maximize")] fn connect_maximize(&self, f: F) -> SignalHandlerId; #[doc(alias = "minimize")] fn connect_minimize(&self, f: F) -> SignalHandlerId; #[doc(alias = "move")] fn connect_move(&self, f: F) -> SignalHandlerId; #[doc(alias = "resize")] fn connect_resize(&self, f: F) -> SignalHandlerId; #[doc(alias = "restore")] fn connect_restore(&self, f: F) -> SignalHandlerId; } impl> AtkWindowExt for O { fn connect_activate(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn activate_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkWindow, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Window::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"activate\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( activate_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_create(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn create_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkWindow, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Window::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"create\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( create_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_deactivate(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn deactivate_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkWindow, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Window::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"deactivate\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( deactivate_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_destroy(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn destroy_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkWindow, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Window::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"destroy\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( destroy_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_maximize(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn maximize_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkWindow, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Window::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"maximize\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( maximize_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_minimize(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn minimize_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkWindow, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Window::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"minimize\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( minimize_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_move(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn move_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkWindow, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Window::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"move\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( move_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_resize(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn resize_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkWindow, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Window::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"resize\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( resize_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_restore(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn restore_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::AtkWindow, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Window::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"restore\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( restore_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl fmt::Display for Window { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Window") } } atk-0.14.0/src/editable_text.rs000064400000000000000000000013450072674642500144720ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::EditableText; use glib::object::IsA; use glib::translate::*; pub trait EditableTextExtManual: 'static { #[doc(alias = "atk_editable_text_insert_text")] fn insert_text(&self, string: &str, position: i32) -> i32; } impl> EditableTextExtManual for O { fn insert_text(&self, string: &str, mut position: i32) -> i32 { let length = string.len() as i32; unsafe { ffi::atk_editable_text_insert_text( self.as_ref().to_glib_none().0, string.to_glib_none().0, length, &mut position, ); } position } } atk-0.14.0/src/lib.rs000064400000000000000000000013140072674642500124170ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. //! # Rust ATK bindings //! //! This library contains safe Rust bindings for [ATK](https://developer.gnome.org/atk). //! It is a part of [gtk-rs](https://gtk-rs.org/). //! //! ATK 2.18 is the lowest supported version for the underlying library. #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; pub use glib; #[macro_use] mod rt; #[allow(unused_imports)] mod auto; pub use crate::auto::*; pub mod prelude; pub use crate::attribute::Attribute; pub use crate::attribute_set::AttributeSet; pub use crate::text_rectangle::TextRectangle; mod attribute; mod attribute_set; mod editable_text; mod table; mod text_rectangle; atk-0.14.0/src/prelude.rs000064400000000000000000000004370072674642500133160ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. //! Traits intended for blanket imports. pub use crate::auto::traits::*; pub use crate::editable_text::EditableTextExtManual; pub use crate::table::TableExtManual; #[doc(hidden)] pub use glib::prelude::*; atk-0.14.0/src/rt.rs000064400000000000000000000003350072674642500123000ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. /// No-op. macro_rules! assert_initialized_main_thread { () => {}; } /// No-op. macro_rules! skip_assert_initialized { () => {}; } atk-0.14.0/src/table.rs000064400000000000000000000024540072674642500127460ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::Table; use glib::object::IsA; use glib::translate::*; pub trait TableExtManual: 'static { #[doc(alias = "atk_table_get_selected_columns")] #[doc(alias = "get_selected_columns")] fn selected_columns(&self) -> Vec; #[doc(alias = "atk_table_get_selected_rows")] #[doc(alias = "get_selected_rows")] fn selected_rows(&self) -> Vec; } impl> TableExtManual for O { fn selected_columns(&self) -> Vec { unsafe { let mut selected = ::std::ptr::null_mut(); let nb = ffi::atk_table_get_selected_columns(self.as_ref().to_glib_none().0, &mut selected); if nb <= 0 { Vec::new() } else { Vec::from_raw_parts(selected, nb as usize, nb as usize) } } } fn selected_rows(&self) -> Vec { unsafe { let mut selected = ::std::ptr::null_mut(); let nb = ffi::atk_table_get_selected_rows(self.as_ref().to_glib_none().0, &mut selected); if nb <= 0 { Vec::new() } else { Vec::from_raw_parts(selected, nb as usize, nb as usize) } } } } atk-0.14.0/src/text_rectangle.rs000064400000000000000000000031120072674642500146570ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use glib::translate::*; use std::fmt; #[derive(Debug)] #[doc(alias = "AtkTextRectangle")] pub struct TextRectangle { pub x: i32, pub y: i32, pub width: i32, pub height: i32, } impl TextRectangle { pub fn uninitialized() -> Self { Self { x: 0, y: 0, width: 0, height: 0, } } #[doc(hidden)] #[inline] #[allow(clippy::wrong_self_convention)] pub fn to_glib_none_mut(&mut self) -> (*mut ffi::AtkTextRectangle, i32) { (self as *mut TextRectangle as usize as *mut _, 0) } } impl fmt::Display for TextRectangle { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("TextRectangle") .field("x", &self.x) .field("y", &self.y) .field("width", &self.width) .field("height", &self.height) .finish() } } #[doc(hidden)] impl FromGlib for TextRectangle { unsafe fn from_glib(value: ffi::AtkTextRectangle) -> Self { skip_assert_initialized!(); Self { x: value.x, y: value.y, width: value.width, height: value.height, } } } #[doc(hidden)] impl IntoGlib for TextRectangle { type GlibType = ffi::AtkTextRectangle; fn into_glib(self) -> ffi::AtkTextRectangle { ffi::AtkTextRectangle { x: self.x, y: self.y, width: self.width, height: self.height, } } }