pax_global_header00006660000000000000000000000064146750615040014522gustar00rootroot0000000000000052 comment=5ec53c7551b05e7c6def8104d808a3a8334b780b rust-atk-0.18-0.18.0/000077500000000000000000000000001467506150400137465ustar00rootroot00000000000000rust-atk-0.18-0.18.0/.cargo_vcs_info.json000066400000000000000000000001411467506150400176740ustar00rootroot00000000000000{ "git": { "sha1": "3ec2253489cded691d0ac63cba492c379287ee9a" }, "path_in_vcs": "atk" }rust-atk-0.18-0.18.0/COPYRIGHT000066400000000000000000000012131467506150400152360ustar00rootroot00000000000000The 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. rust-atk-0.18-0.18.0/Cargo.toml000066400000000000000000000030221467506150400156730ustar00rootroot00000000000000# 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 are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.70" name = "atk" version = "0.18.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" resolver = "1" [package.metadata.docs.rs] rustdoc-args = [ "--cfg", "docsrs", "--generate-link-to-definition", ] [lib] name = "atk" [dependencies.ffi] version = "0.18" package = "atk-sys" [dependencies.glib] version = "0.18" [dependencies.libc] version = "0.2" [dev-dependencies.gir-format-check] version = "^0.1" [features] v2_30 = ["ffi/v2_30"] v2_32 = [ "v2_30", "ffi/v2_32", ] v2_34 = [ "v2_32", "ffi/v2_34", ] v2_38 = [ "v2_34", "ffi/v2_38", ] v2_46 = [ "v2_38", "ffi/v2_46", ] v2_50 = [ "v2_46", "ffi/v2_50", ] rust-atk-0.18-0.18.0/Cargo.toml.orig000066400000000000000000000017671467506150400166500ustar00rootroot00000000000000[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.18.0" keywords = ["atk", "gtk-rs", "gnome", "accessibility"] repository = "https://github.com/gtk-rs/gtk3-rs" exclude = ["gir-files/*"] edition = "2021" rust-version = "1.70" [lib] name = "atk" [features] v2_30 = ["ffi/v2_30"] v2_32 = ["v2_30", "ffi/v2_32"] v2_34 = ["v2_32", "ffi/v2_34"] v2_38 = ["v2_34", "ffi/v2_38"] v2_46 = ["v2_38", "ffi/v2_46"] v2_50 = ["v2_46", "ffi/v2_50"] [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] [dependencies] libc = "0.2" ffi = { package = "atk-sys", version = "0.18", path = "sys" } glib = { branch = "0.18", version = "0.18", git = "https://github.com/gtk-rs/gtk-rs-core" } [dev-dependencies] gir-format-check = "^0.1" rust-atk-0.18-0.18.0/Gir.toml000066400000000000000000000075731467506150400154000ustar00rootroot00000000000000[options] girs_directories = ["../gir-files"] library = "Atk" version = "1.0" min_cfg_version = "2.28" target_path = "." work_mode = "normal" generate_safety_asserts = true deprecate_by_min_version = true single_version_file = true generate = [ "Atk.Component", "Atk.CoordType", "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.Document" status = "generate" [[object.function]] name = "get_attributes" ignore = true # TODO: re-enable once AttributeSet is properly handled [[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.Live" status = "generate" version = "2.50" [[object]] name = "Atk.Misc" status = "generate" trait_name = "AtkMiscExt" # duplicate with gtk [[object]] name = "Atk.Object" status = "generate" trait_name = "AtkObjectExt" [[object.function]] name = "get_attributes" ignore = true # TODO: re-enable once AttributeSet is properly handled [[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.function]] name = "get_default_attributes" ignore = true # TODO: re-enable once AttributeSet is properly handled [[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.member]] name = "collapsed" version = "2.38" [[object.member]] name = "last_defined" alias = true # not useful [[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 rust-atk-0.18-0.18.0/LICENSE000066400000000000000000000020001467506150400147430ustar00rootroot00000000000000Permission 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. rust-atk-0.18-0.18.0/README.md000066400000000000000000000023311467506150400152240ustar00rootroot00000000000000# Rust ATK bindings Project site is [here](https://gtk-rs.org/). __Rust__ bindings and wrappers for [ATK](https://developer.gnome.org/atk), part of [gtk3-rs](https://github.com/gtk-rs/gtk3-rs). ATK __2.28__ is the lowest supported version for the underlying library. ## Minimum supported Rust version Currently, the minimum supported Rust version is `1.70.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. rust-atk-0.18-0.18.0/src/000077500000000000000000000000001467506150400145355ustar00rootroot00000000000000rust-atk-0.18-0.18.0/src/attribute.rs000066400000000000000000000020221467506150400171020ustar00rootroot00000000000000// 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, } } } rust-atk-0.18-0.18.0/src/attribute_set.rs000066400000000000000000000002011467506150400177520ustar00rootroot00000000000000// Take a look at the license at the top of the repository in the LICENSE file. pub type AttributeSet = glib::translate::SList; rust-atk-0.18-0.18.0/src/auto/000077500000000000000000000000001467506150400155055ustar00rootroot00000000000000rust-atk-0.18-0.18.0/src/auto/action.rs000066400000000000000000000052161467506150400173340ustar00rootroot00000000000000// 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::{prelude::*, translate::*}; use std::fmt; glib::wrapper! { #[doc(alias = "AtkAction")] pub struct Action(Interface); match fn { type_ => || ffi::atk_action_get_type(), } } impl Action { pub const NONE: Option<&'static Action> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AtkActionExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_action_do_action")] fn do_action(&self, i: i32) -> bool { unsafe { from_glib(ffi::atk_action_do_action(self.as_ref().to_glib_none().0, i)) } } #[doc(alias = "atk_action_get_description")] #[doc(alias = "get_description")] fn description(&self, i: i32) -> Option { unsafe { from_glib_none(ffi::atk_action_get_description( self.as_ref().to_glib_none().0, i, )) } } #[doc(alias = "atk_action_get_keybinding")] #[doc(alias = "get_keybinding")] fn keybinding(&self, i: i32) -> Option { unsafe { from_glib_none(ffi::atk_action_get_keybinding( self.as_ref().to_glib_none().0, i, )) } } #[doc(alias = "atk_action_get_localized_name")] #[doc(alias = "get_localized_name")] 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, )) } } #[doc(alias = "atk_action_get_n_actions")] #[doc(alias = "get_n_actions")] fn n_actions(&self) -> i32 { unsafe { ffi::atk_action_get_n_actions(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_action_get_name")] #[doc(alias = "get_name")] fn name(&self, i: i32) -> Option { unsafe { from_glib_none(ffi::atk_action_get_name(self.as_ref().to_glib_none().0, i)) } } #[doc(alias = "atk_action_set_description")] 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> AtkActionExt for O {} impl fmt::Display for Action { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Action") } } rust-atk-0.18-0.18.0/src/auto/alias.rs000066400000000000000000000003161467506150400171440ustar00rootroot00000000000000// 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; rust-atk-0.18-0.18.0/src/auto/component.rs000066400000000000000000000164211467506150400200610ustar00rootroot00000000000000// 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 #[cfg(feature = "v2_30")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))] use crate::ScrollType; use crate::{CoordType, Layer, Object, Rectangle}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem, mem::transmute}; glib::wrapper! { #[doc(alias = "AtkComponent")] pub struct Component(Interface); match fn { type_ => || ffi::atk_component_get_type(), } } impl Component { pub const NONE: Option<&'static Component> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait ComponentExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_component_contains")] 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(), )) } } #[doc(alias = "atk_component_get_alpha")] #[doc(alias = "get_alpha")] fn alpha(&self) -> f64 { unsafe { ffi::atk_component_get_alpha(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_component_get_extents")] #[doc(alias = "get_extents")] 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(), ); ( x.assume_init(), y.assume_init(), width.assume_init(), height.assume_init(), ) } } #[doc(alias = "atk_component_get_layer")] #[doc(alias = "get_layer")] fn layer(&self) -> Layer { unsafe { from_glib(ffi::atk_component_get_layer(self.as_ref().to_glib_none().0)) } } #[doc(alias = "atk_component_get_mdi_zorder")] #[doc(alias = "get_mdi_zorder")] fn mdi_zorder(&self) -> i32 { unsafe { ffi::atk_component_get_mdi_zorder(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_component_get_position")] #[doc(alias = "get_position")] 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(), ); (x.assume_init(), y.assume_init()) } } #[doc(alias = "atk_component_get_size")] #[doc(alias = "get_size")] 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(), ); (width.assume_init(), height.assume_init()) } } #[doc(alias = "atk_component_grab_focus")] fn grab_focus(&self) -> bool { unsafe { from_glib(ffi::atk_component_grab_focus( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "atk_component_ref_accessible_at_point")] 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(feature = "v2_30")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))] #[doc(alias = "atk_component_scroll_to")] 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(feature = "v2_30")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))] #[doc(alias = "atk_component_scroll_to_point")] 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, )) } } #[doc(alias = "atk_component_set_extents")] 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(), )) } } #[doc(alias = "atk_component_set_position")] 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(), )) } } #[doc(alias = "atk_component_set_size")] 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, )) } } #[doc(alias = "bounds-changed")] 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> ComponentExt for O {} impl fmt::Display for Component { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Component") } } rust-atk-0.18-0.18.0/src/auto/document.rs000066400000000000000000000136451467506150400177020ustar00rootroot00000000000000// 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::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "AtkDocument")] pub struct Document(Interface); match fn { type_ => || ffi::atk_document_get_type(), } } impl Document { pub const NONE: Option<&'static Document> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait DocumentExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_document_get_attribute_value")] #[doc(alias = "get_attribute_value")] 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, )) } } #[doc(alias = "atk_document_get_current_page_number")] #[doc(alias = "get_current_page_number")] fn current_page_number(&self) -> i32 { unsafe { ffi::atk_document_get_current_page_number(self.as_ref().to_glib_none().0) } } //#[doc(alias = "atk_document_get_document")] //#[doc(alias = "get_document")] //fn document(&self) -> /*Unimplemented*/Option { // unsafe { TODO: call ffi:atk_document_get_document() } //} #[doc(alias = "atk_document_get_document_type")] #[doc(alias = "get_document_type")] fn document_type(&self) -> Option { unsafe { from_glib_none(ffi::atk_document_get_document_type( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "atk_document_get_page_count")] #[doc(alias = "get_page_count")] fn page_count(&self) -> i32 { unsafe { ffi::atk_document_get_page_count(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_document_set_attribute_value")] 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, )) } } #[doc(alias = "load-complete")] 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), ) } } #[doc(alias = "load-stopped")] 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), ) } } #[doc(alias = "page-changed")] 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), ) } } #[doc(alias = "reload")] 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> DocumentExt for O {} impl fmt::Display for Document { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Document") } } rust-atk-0.18-0.18.0/src/auto/editable_text.rs000066400000000000000000000044751467506150400207020ustar00rootroot00000000000000// 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::{prelude::*, translate::*}; use std::fmt; glib::wrapper! { #[doc(alias = "AtkEditableText")] pub struct EditableText(Interface); match fn { type_ => || ffi::atk_editable_text_get_type(), } } impl EditableText { pub const NONE: Option<&'static EditableText> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait EditableTextExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_editable_text_copy_text")] 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); } } #[doc(alias = "atk_editable_text_cut_text")] 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); } } #[doc(alias = "atk_editable_text_delete_text")] 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); } } #[doc(alias = "atk_editable_text_paste_text")] fn paste_text(&self, position: i32) { unsafe { ffi::atk_editable_text_paste_text(self.as_ref().to_glib_none().0, position); } } //#[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 { // unsafe { TODO: call ffi:atk_editable_text_set_run_attributes() } //} #[doc(alias = "atk_editable_text_set_text_contents")] 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> EditableTextExt for O {} impl fmt::Display for EditableText { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("EditableText") } } rust-atk-0.18-0.18.0/src/auto/enums.rs000066400000000000000000002673711467506150400172220ustar00rootroot00000000000000// 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::{prelude::*, translate::*}; 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; #[inline] 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 { #[inline] 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 { #[inline] fn static_type() -> glib::Type { unsafe { from_glib(ffi::atk_coord_type_get_type()) } } } impl glib::HasParamSpec for CoordType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { |name, default_value| Self::ParamSpec::builder_with_default(name, default_value) } } impl glib::value::ValueType for CoordType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for CoordType { type Checker = glib::value::GenericValueTypeChecker; #[inline] 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 { #[inline] 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 } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: CoordType) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[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; #[inline] 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 { #[inline] 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 { #[inline] fn static_type() -> glib::Type { unsafe { from_glib(ffi::atk_layer_get_type()) } } } impl glib::HasParamSpec for Layer { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { |name, default_value| Self::ParamSpec::builder_with_default(name, default_value) } } impl glib::value::ValueType for Layer { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for Layer { type Checker = glib::value::GenericValueTypeChecker; #[inline] 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 { #[inline] 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 } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: Layer) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[cfg(feature = "v2_50")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "AtkLive")] pub enum Live { #[doc(alias = "ATK_LIVE_NONE")] None, #[doc(alias = "ATK_LIVE_POLITE")] Polite, #[doc(alias = "ATK_LIVE_ASSERTIVE")] Assertive, #[doc(hidden)] __Unknown(i32), } #[cfg(feature = "v2_50")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] impl fmt::Display for Live { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "Live::{}", match *self { Self::None => "None", Self::Polite => "Polite", Self::Assertive => "Assertive", _ => "Unknown", } ) } } #[cfg(feature = "v2_50")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] #[doc(hidden)] impl IntoGlib for Live { type GlibType = ffi::AtkLive; #[inline] fn into_glib(self) -> ffi::AtkLive { match self { Self::None => ffi::ATK_LIVE_NONE, Self::Polite => ffi::ATK_LIVE_POLITE, Self::Assertive => ffi::ATK_LIVE_ASSERTIVE, Self::__Unknown(value) => value, } } } #[cfg(feature = "v2_50")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] #[doc(hidden)] impl FromGlib for Live { #[inline] unsafe fn from_glib(value: ffi::AtkLive) -> Self { skip_assert_initialized!(); match value { ffi::ATK_LIVE_NONE => Self::None, ffi::ATK_LIVE_POLITE => Self::Polite, ffi::ATK_LIVE_ASSERTIVE => Self::Assertive, value => Self::__Unknown(value), } } } #[cfg(feature = "v2_50")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] impl StaticType for Live { #[inline] fn static_type() -> glib::Type { unsafe { from_glib(ffi::atk_live_get_type()) } } } #[cfg(feature = "v2_50")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] impl glib::HasParamSpec for Live { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { |name, default_value| Self::ParamSpec::builder_with_default(name, default_value) } } #[cfg(feature = "v2_50")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] impl glib::value::ValueType for Live { type Type = Self; } #[cfg(feature = "v2_50")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] unsafe impl<'a> glib::value::FromValue<'a> for Live { type Checker = glib::value::GenericValueTypeChecker; #[inline] 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(feature = "v2_50")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] impl ToValue for Live { #[inline] 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 } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } #[cfg(feature = "v2_50")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] impl From for glib::Value { #[inline] fn from(v: Live) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[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 { #[inline] fn static_type() -> glib::Type { unsafe { from_glib(ffi::atk_relation_type_get_type()) } } } impl glib::HasParamSpec for RelationType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { |name, default_value| Self::ParamSpec::builder_with_default(name, default_value) } } impl glib::value::ValueType for RelationType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for RelationType { type Checker = glib::value::GenericValueTypeChecker; #[inline] 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 { #[inline] 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 } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: RelationType) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[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_PUSH_BUTTON_MENU")] PushButtonMenu, #[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::PushButtonMenu => "PushButtonMenu", 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::PushButtonMenu => ffi::ATK_ROLE_PUSH_BUTTON_MENU, 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_PUSH_BUTTON_MENU => Self::PushButtonMenu, ffi::ATK_ROLE_LAST_DEFINED => Self::LastDefined, value => Self::__Unknown(value), } } } impl StaticType for Role { #[inline] fn static_type() -> glib::Type { unsafe { from_glib(ffi::atk_role_get_type()) } } } impl glib::HasParamSpec for Role { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { |name, default_value| Self::ParamSpec::builder_with_default(name, default_value) } } impl glib::value::ValueType for Role { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for Role { type Checker = glib::value::GenericValueTypeChecker; #[inline] 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 { #[inline] 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 } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: Role) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[cfg(feature = "v2_30")] #[cfg_attr(docsrs, 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(feature = "v2_30")] #[cfg_attr(docsrs, 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(feature = "v2_30")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))] #[doc(hidden)] impl IntoGlib for ScrollType { type GlibType = ffi::AtkScrollType; #[inline] 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(feature = "v2_30")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))] #[doc(hidden)] impl FromGlib for ScrollType { #[inline] 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(feature = "v2_30")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))] impl StaticType for ScrollType { #[inline] fn static_type() -> glib::Type { unsafe { from_glib(ffi::atk_scroll_type_get_type()) } } } #[cfg(feature = "v2_30")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))] impl glib::HasParamSpec for ScrollType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { |name, default_value| Self::ParamSpec::builder_with_default(name, default_value) } } #[cfg(feature = "v2_30")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))] impl glib::value::ValueType for ScrollType { type Type = Self; } #[cfg(feature = "v2_30")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))] unsafe impl<'a> glib::value::FromValue<'a> for ScrollType { type Checker = glib::value::GenericValueTypeChecker; #[inline] 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(feature = "v2_30")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))] impl ToValue for ScrollType { #[inline] 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 } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } #[cfg(feature = "v2_30")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))] impl From for glib::Value { #[inline] fn from(v: ScrollType) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[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, #[cfg(feature = "v2_38")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_38")))] #[doc(alias = "ATK_STATE_COLLAPSED")] Collapsed, #[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", #[cfg(feature = "v2_38")] Self::Collapsed => "Collapsed", _ => "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, #[cfg(feature = "v2_38")] Self::Collapsed => ffi::ATK_STATE_COLLAPSED, 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, #[cfg(feature = "v2_38")] ffi::ATK_STATE_COLLAPSED => Self::Collapsed, value => Self::__Unknown(value), } } } impl StaticType for StateType { #[inline] fn static_type() -> glib::Type { unsafe { from_glib(ffi::atk_state_type_get_type()) } } } impl glib::HasParamSpec for StateType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { |name, default_value| Self::ParamSpec::builder_with_default(name, default_value) } } impl glib::value::ValueType for StateType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StateType { type Checker = glib::value::GenericValueTypeChecker; #[inline] 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 { #[inline] 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 } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StateType) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[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 { #[inline] fn static_type() -> glib::Type { unsafe { from_glib(ffi::atk_text_attribute_get_type()) } } } impl glib::HasParamSpec for TextAttribute { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { |name, default_value| Self::ParamSpec::builder_with_default(name, default_value) } } impl glib::value::ValueType for TextAttribute { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for TextAttribute { type Checker = glib::value::GenericValueTypeChecker; #[inline] 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 { #[inline] 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 } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: TextAttribute) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[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; #[inline] 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 { #[inline] 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 { #[inline] fn static_type() -> glib::Type { unsafe { from_glib(ffi::atk_text_boundary_get_type()) } } } impl glib::HasParamSpec for TextBoundary { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { |name, default_value| Self::ParamSpec::builder_with_default(name, default_value) } } impl glib::value::ValueType for TextBoundary { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for TextBoundary { type Checker = glib::value::GenericValueTypeChecker; #[inline] 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 { #[inline] 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 } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: TextBoundary) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[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; #[inline] 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 { #[inline] 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 { #[inline] fn static_type() -> glib::Type { unsafe { from_glib(ffi::atk_text_clip_type_get_type()) } } } impl glib::HasParamSpec for TextClipType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { |name, default_value| Self::ParamSpec::builder_with_default(name, default_value) } } impl glib::value::ValueType for TextClipType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for TextClipType { type Checker = glib::value::GenericValueTypeChecker; #[inline] 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 { #[inline] 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 } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: TextClipType) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[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; #[inline] 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 { #[inline] 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 { #[inline] fn static_type() -> glib::Type { unsafe { from_glib(ffi::atk_text_granularity_get_type()) } } } impl glib::HasParamSpec for TextGranularity { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { |name, default_value| Self::ParamSpec::builder_with_default(name, default_value) } } impl glib::value::ValueType for TextGranularity { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for TextGranularity { type Checker = glib::value::GenericValueTypeChecker; #[inline] 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 { #[inline] 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 } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: TextGranularity) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[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 { #[inline] fn static_type() -> glib::Type { unsafe { from_glib(ffi::atk_value_type_get_type()) } } } impl glib::HasParamSpec for ValueType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { |name, default_value| Self::ParamSpec::builder_with_default(name, default_value) } } impl glib::value::ValueType for ValueType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for ValueType { type Checker = glib::value::GenericValueTypeChecker; #[inline] 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 { #[inline] 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 } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: ValueType) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } rust-atk-0.18-0.18.0/src/auto/flags.rs000066400000000000000000000047611467506150400171570ustar00rootroot00000000000000// 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::{bitflags::bitflags, prelude::*, translate::*}; use std::fmt; bitflags! { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "AtkHyperlinkStateFlags")] pub struct HyperlinkStateFlags: u32 { #[doc(alias = "ATK_HYPERLINK_IS_INLINE")] const INLINE = ffi::ATK_HYPERLINK_IS_INLINE as _; } } 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; #[inline] fn into_glib(self) -> ffi::AtkHyperlinkStateFlags { self.bits() } } #[doc(hidden)] impl FromGlib for HyperlinkStateFlags { #[inline] unsafe fn from_glib(value: ffi::AtkHyperlinkStateFlags) -> Self { skip_assert_initialized!(); Self::from_bits_truncate(value) } } impl StaticType for HyperlinkStateFlags { #[inline] fn static_type() -> glib::Type { unsafe { from_glib(ffi::atk_hyperlink_state_flags_get_type()) } } } impl glib::HasParamSpec for HyperlinkStateFlags { type ParamSpec = glib::ParamSpecFlags; type SetValue = Self; type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder; fn param_spec_builder() -> Self::BuilderFn { |name| Self::ParamSpec::builder(name) } } impl glib::value::ValueType for HyperlinkStateFlags { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for HyperlinkStateFlags { type Checker = glib::value::GenericValueTypeChecker; #[inline] 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 { #[inline] 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 } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: HyperlinkStateFlags) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } rust-atk-0.18-0.18.0/src/auto/gobject_accessible.rs000066400000000000000000000031021467506150400216410ustar00rootroot00000000000000// 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::{prelude::*, 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 { pub const NONE: Option<&'static GObjectAccessible> = None; #[doc(alias = "atk_gobject_accessible_for_object")] pub fn for_object(obj: &impl IsA) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::atk_gobject_accessible_for_object( obj.as_ref().to_glib_none().0, )) } } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait GObjectAccessibleExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_gobject_accessible_get_object")] #[doc(alias = "get_object")] fn object(&self) -> Option { unsafe { from_glib_none(ffi::atk_gobject_accessible_get_object( self.as_ref().to_glib_none().0, )) } } } impl> GObjectAccessibleExt for O {} impl fmt::Display for GObjectAccessible { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("GObjectAccessible") } } rust-atk-0.18-0.18.0/src/auto/hyperlink.rs000066400000000000000000000142431467506150400200640ustar00rootroot00000000000000// 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, Object}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "AtkHyperlink")] pub struct Hyperlink(Object) @implements Action; match fn { type_ => || ffi::atk_hyperlink_get_type(), } } impl Hyperlink { pub const NONE: Option<&'static Hyperlink> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait HyperlinkExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_hyperlink_get_end_index")] #[doc(alias = "get_end_index")] fn end_index(&self) -> i32 { unsafe { ffi::atk_hyperlink_get_end_index(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_hyperlink_get_n_anchors")] #[doc(alias = "get_n_anchors")] fn n_anchors(&self) -> i32 { unsafe { ffi::atk_hyperlink_get_n_anchors(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_hyperlink_get_object")] #[doc(alias = "get_object")] fn object(&self, i: i32) -> Option { unsafe { from_glib_none(ffi::atk_hyperlink_get_object( self.as_ref().to_glib_none().0, i, )) } } #[doc(alias = "atk_hyperlink_get_start_index")] #[doc(alias = "get_start_index")] fn start_index(&self) -> i32 { unsafe { ffi::atk_hyperlink_get_start_index(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_hyperlink_get_uri")] #[doc(alias = "get_uri")] fn uri(&self, i: i32) -> Option { unsafe { from_glib_full(ffi::atk_hyperlink_get_uri( self.as_ref().to_glib_none().0, i, )) } } #[doc(alias = "atk_hyperlink_is_inline")] fn is_inline(&self) -> bool { unsafe { from_glib(ffi::atk_hyperlink_is_inline(self.as_ref().to_glib_none().0)) } } #[doc(alias = "atk_hyperlink_is_valid")] fn is_valid(&self) -> bool { unsafe { from_glib(ffi::atk_hyperlink_is_valid(self.as_ref().to_glib_none().0)) } } #[doc(alias = "number-of-anchors")] fn number_of_anchors(&self) -> i32 { ObjectExt::property(self.as_ref(), "number-of-anchors") } #[doc(alias = "link-activated")] 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), ) } } #[doc(alias = "end-index")] 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), ) } } #[doc(alias = "number-of-anchors")] 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), ) } } #[doc(alias = "start-index")] 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> HyperlinkExt for O {} impl fmt::Display for Hyperlink { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Hyperlink") } } rust-atk-0.18-0.18.0/src/auto/hyperlink_impl.rs000066400000000000000000000022631467506150400211040ustar00rootroot00000000000000// 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::{prelude::*, translate::*}; use std::fmt; glib::wrapper! { #[doc(alias = "AtkHyperlinkImpl")] pub struct HyperlinkImpl(Interface); match fn { type_ => || ffi::atk_hyperlink_impl_get_type(), } } impl HyperlinkImpl { pub const NONE: Option<&'static HyperlinkImpl> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait HyperlinkImplExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_hyperlink_impl_get_hyperlink")] #[doc(alias = "get_hyperlink")] fn hyperlink(&self) -> Option { unsafe { from_glib_full(ffi::atk_hyperlink_impl_get_hyperlink( self.as_ref().to_glib_none().0, )) } } } impl> HyperlinkImplExt for O {} impl fmt::Display for HyperlinkImpl { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("HyperlinkImpl") } } rust-atk-0.18-0.18.0/src/auto/hypertext.rs000066400000000000000000000050611467506150400201110ustar00rootroot00000000000000// 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::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "AtkHypertext")] pub struct Hypertext(Interface); match fn { type_ => || ffi::atk_hypertext_get_type(), } } impl Hypertext { pub const NONE: Option<&'static Hypertext> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait HypertextExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_hypertext_get_link")] #[doc(alias = "get_link")] 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, )) } } #[doc(alias = "atk_hypertext_get_link_index")] #[doc(alias = "get_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) } } #[doc(alias = "atk_hypertext_get_n_links")] #[doc(alias = "get_n_links")] fn n_links(&self) -> i32 { unsafe { ffi::atk_hypertext_get_n_links(self.as_ref().to_glib_none().0) } } #[doc(alias = "link-selected")] 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> HypertextExt for O {} impl fmt::Display for Hypertext { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Hypertext") } } rust-atk-0.18-0.18.0/src/auto/image.rs000066400000000000000000000053701467506150400171420ustar00rootroot00000000000000// 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::{prelude::*, translate::*}; use std::{fmt, mem}; glib::wrapper! { #[doc(alias = "AtkImage")] pub struct Image(Interface); match fn { type_ => || ffi::atk_image_get_type(), } } impl Image { pub const NONE: Option<&'static Image> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AtkImageExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_image_get_image_description")] #[doc(alias = "get_image_description")] fn image_description(&self) -> Option { unsafe { from_glib_none(ffi::atk_image_get_image_description( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "atk_image_get_image_locale")] #[doc(alias = "get_image_locale")] fn image_locale(&self) -> Option { unsafe { from_glib_none(ffi::atk_image_get_image_locale( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "atk_image_get_image_position")] #[doc(alias = "get_image_position")] 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(), ); (x.assume_init(), y.assume_init()) } } #[doc(alias = "atk_image_get_image_size")] #[doc(alias = "get_image_size")] 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(), ); (width.assume_init(), height.assume_init()) } } #[doc(alias = "atk_image_set_image_description")] 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> AtkImageExt for O {} impl fmt::Display for Image { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Image") } } rust-atk-0.18-0.18.0/src/auto/misc.rs000066400000000000000000000025111467506150400170050ustar00rootroot00000000000000// 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::{prelude::*, translate::*}; use std::fmt; glib::wrapper! { #[doc(alias = "AtkMisc")] pub struct Misc(Object); match fn { type_ => || ffi::atk_misc_get_type(), } } impl Misc { pub const NONE: Option<&'static Misc> = None; #[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()) } } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AtkMiscExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_misc_threads_enter")] fn threads_enter(&self) { unsafe { ffi::atk_misc_threads_enter(self.as_ref().to_glib_none().0); } } #[doc(alias = "atk_misc_threads_leave")] fn threads_leave(&self) { unsafe { ffi::atk_misc_threads_leave(self.as_ref().to_glib_none().0); } } } impl> AtkMiscExt for O {} impl fmt::Display for Misc { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Misc") } } rust-atk-0.18-0.18.0/src/auto/mod.rs000066400000000000000000000066751467506150400166500ustar00rootroot00000000000000// 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; mod component; pub use self::component::Component; mod document; pub use self::document::Document; mod editable_text; pub use self::editable_text::EditableText; mod gobject_accessible; pub use self::gobject_accessible::GObjectAccessible; mod hyperlink; pub use self::hyperlink::Hyperlink; mod hyperlink_impl; pub use self::hyperlink_impl::HyperlinkImpl; mod hypertext; pub use self::hypertext::Hypertext; mod image; pub use self::image::Image; mod misc; pub use self::misc::Misc; mod no_op_object; pub use self::no_op_object::NoOpObject; mod no_op_object_factory; pub use self::no_op_object_factory::NoOpObjectFactory; mod object; pub use self::object::Object; mod object_factory; pub use self::object_factory::ObjectFactory; mod plug; pub use self::plug::Plug; mod registry; pub use self::registry::Registry; mod relation; pub use self::relation::Relation; mod relation_set; pub use self::relation_set::RelationSet; mod selection; pub use self::selection::Selection; mod socket; pub use self::socket::Socket; mod state_set; pub use self::state_set::StateSet; mod streamable_content; pub use self::streamable_content::StreamableContent; mod table; pub use self::table::Table; mod table_cell; pub use self::table_cell::TableCell; mod text; pub use self::text::Text; mod util; pub use self::util::Util; mod value; pub use self::value::Value; mod window; pub use self::window::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; #[cfg(feature = "v2_50")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] pub use self::enums::Live; pub use self::enums::RelationType; pub use self::enums::Role; #[cfg(feature = "v2_30")] #[cfg_attr(docsrs, 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; } rust-atk-0.18-0.18.0/src/auto/no_op_object.rs000066400000000000000000000022631467506150400205160ustar00rootroot00000000000000// 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, Component, Document, EditableText, Hypertext, Image, Object, Selection, Table, TableCell, Text, Value, Window, }; use glib::{prelude::*, 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 { pub const NONE: Option<&'static NoOpObject> = None; #[doc(alias = "atk_no_op_object_new")] pub fn new(obj: &impl IsA) -> 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() } } } impl fmt::Display for NoOpObject { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("NoOpObject") } } rust-atk-0.18-0.18.0/src/auto/no_op_object_factory.rs000066400000000000000000000020471467506150400222450ustar00rootroot00000000000000// 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::{prelude::*, 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 { pub const NONE: Option<&'static NoOpObjectFactory> = None; #[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() } } impl fmt::Display for NoOpObjectFactory { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("NoOpObjectFactory") } } rust-atk-0.18-0.18.0/src/auto/object.rs000066400000000000000000001056521467506150400173320ustar00rootroot00000000000000// 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, RelationSet, RelationType, Role, State, StateSet}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "AtkObject")] pub struct Object(Object); match fn { type_ => || ffi::atk_object_get_type(), } } impl Object { pub const NONE: Option<&'static Object> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AtkObjectExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_object_add_relationship")] fn add_relationship(&self, relationship: RelationType, target: &impl IsA) -> 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(feature = "v2_34")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_34")))] #[doc(alias = "atk_object_get_accessible_id")] #[doc(alias = "get_accessible_id")] fn accessible_id(&self) -> Option { unsafe { from_glib_none(ffi::atk_object_get_accessible_id( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "atk_object_get_description")] #[doc(alias = "get_description")] fn description(&self) -> Option { unsafe { from_glib_none(ffi::atk_object_get_description( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "atk_object_get_index_in_parent")] #[doc(alias = "get_index_in_parent")] fn index_in_parent(&self) -> i32 { unsafe { ffi::atk_object_get_index_in_parent(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_object_get_layer")] #[doc(alias = "get_layer")] fn layer(&self) -> Layer { unsafe { from_glib(ffi::atk_object_get_layer(self.as_ref().to_glib_none().0)) } } #[doc(alias = "atk_object_get_mdi_zorder")] #[doc(alias = "get_mdi_zorder")] fn mdi_zorder(&self) -> i32 { unsafe { ffi::atk_object_get_mdi_zorder(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_object_get_n_accessible_children")] #[doc(alias = "get_n_accessible_children")] fn n_accessible_children(&self) -> i32 { unsafe { ffi::atk_object_get_n_accessible_children(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_object_get_name")] #[doc(alias = "get_name")] fn name(&self) -> Option { unsafe { from_glib_none(ffi::atk_object_get_name(self.as_ref().to_glib_none().0)) } } #[doc(alias = "atk_object_get_object_locale")] #[doc(alias = "get_object_locale")] fn object_locale(&self) -> Option { unsafe { from_glib_none(ffi::atk_object_get_object_locale( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "atk_object_get_parent")] #[doc(alias = "get_parent")] #[must_use] fn parent(&self) -> Option { unsafe { from_glib_none(ffi::atk_object_get_parent(self.as_ref().to_glib_none().0)) } } #[doc(alias = "atk_object_get_role")] #[doc(alias = "get_role")] fn role(&self) -> Role { unsafe { from_glib(ffi::atk_object_get_role(self.as_ref().to_glib_none().0)) } } //#[doc(alias = "atk_object_initialize")] //fn initialize(&self, data: /*Unimplemented*/Option) { // unsafe { TODO: call ffi:atk_object_initialize() } //} #[doc(alias = "atk_object_notify_state_change")] 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(), ); } } #[doc(alias = "atk_object_peek_parent")] #[must_use] fn peek_parent(&self) -> Option { unsafe { from_glib_none(ffi::atk_object_peek_parent(self.as_ref().to_glib_none().0)) } } #[doc(alias = "atk_object_ref_accessible_child")] #[must_use] 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, )) } } #[doc(alias = "atk_object_ref_relation_set")] fn ref_relation_set(&self) -> Option { unsafe { from_glib_full(ffi::atk_object_ref_relation_set( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "atk_object_ref_state_set")] fn ref_state_set(&self) -> Option { unsafe { from_glib_full(ffi::atk_object_ref_state_set( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "atk_object_remove_relationship")] fn remove_relationship(&self, relationship: RelationType, target: &impl IsA) -> 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(feature = "v2_34")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_34")))] #[doc(alias = "atk_object_set_accessible_id")] 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, ); } } #[doc(alias = "atk_object_set_description")] fn set_description(&self, description: &str) { unsafe { ffi::atk_object_set_description( self.as_ref().to_glib_none().0, description.to_glib_none().0, ); } } #[doc(alias = "atk_object_set_name")] fn set_name(&self, name: &str) { unsafe { ffi::atk_object_set_name(self.as_ref().to_glib_none().0, name.to_glib_none().0); } } #[doc(alias = "atk_object_set_parent")] fn set_parent(&self, parent: &impl IsA) { unsafe { ffi::atk_object_set_parent( self.as_ref().to_glib_none().0, parent.as_ref().to_glib_none().0, ); } } #[doc(alias = "atk_object_set_role")] fn set_role(&self, role: Role) { unsafe { ffi::atk_object_set_role(self.as_ref().to_glib_none().0, role.into_glib()); } } #[doc(alias = "accessible-component-layer")] fn accessible_component_layer(&self) -> i32 { ObjectExt::property(self.as_ref(), "accessible-component-layer") } #[doc(alias = "accessible-component-mdi-zorder")] fn accessible_component_mdi_zorder(&self) -> i32 { ObjectExt::property(self.as_ref(), "accessible-component-mdi-zorder") } #[doc(alias = "accessible-description")] fn accessible_description(&self) -> Option { ObjectExt::property(self.as_ref(), "accessible-description") } #[doc(alias = "accessible-description")] fn set_accessible_description(&self, accessible_description: Option<&str>) { ObjectExt::set_property( self.as_ref(), "accessible-description", accessible_description, ) } #[doc(alias = "accessible-hypertext-nlinks")] fn accessible_hypertext_nlinks(&self) -> i32 { ObjectExt::property(self.as_ref(), "accessible-hypertext-nlinks") } #[doc(alias = "accessible-name")] fn accessible_name(&self) -> Option { ObjectExt::property(self.as_ref(), "accessible-name") } #[doc(alias = "accessible-name")] fn set_accessible_name(&self, accessible_name: Option<&str>) { ObjectExt::set_property(self.as_ref(), "accessible-name", accessible_name) } #[doc(alias = "accessible-parent")] fn accessible_parent(&self) -> Option { ObjectExt::property(self.as_ref(), "accessible-parent") } #[doc(alias = "accessible-parent")] fn set_accessible_parent>(&self, accessible_parent: Option<&P>) { ObjectExt::set_property(self.as_ref(), "accessible-parent", accessible_parent) } #[doc(alias = "accessible-role")] fn accessible_role(&self) -> Role { ObjectExt::property(self.as_ref(), "accessible-role") } #[doc(alias = "accessible-role")] fn set_accessible_role(&self, accessible_role: Role) { ObjectExt::set_property(self.as_ref(), "accessible-role", accessible_role) } #[doc(alias = "accessible-table-caption")] fn accessible_table_caption(&self) -> Option { ObjectExt::property(self.as_ref(), "accessible-table-caption") } #[doc(alias = "accessible-table-caption")] fn set_accessible_table_caption(&self, accessible_table_caption: Option<&str>) { ObjectExt::set_property( self.as_ref(), "accessible-table-caption", accessible_table_caption, ) } #[doc(alias = "accessible-table-caption-object")] fn accessible_table_caption_object(&self) -> Option { ObjectExt::property(self.as_ref(), "accessible-table-caption-object") } #[doc(alias = "accessible-table-caption-object")] fn set_accessible_table_caption_object>( &self, accessible_table_caption_object: Option<&P>, ) { ObjectExt::set_property( self.as_ref(), "accessible-table-caption-object", accessible_table_caption_object, ) } #[doc(alias = "accessible-table-column-description")] fn accessible_table_column_description(&self) -> Option { ObjectExt::property(self.as_ref(), "accessible-table-column-description") } #[doc(alias = "accessible-table-column-description")] fn set_accessible_table_column_description( &self, accessible_table_column_description: Option<&str>, ) { ObjectExt::set_property( self.as_ref(), "accessible-table-column-description", accessible_table_column_description, ) } #[doc(alias = "accessible-table-column-header")] fn accessible_table_column_header(&self) -> Option { ObjectExt::property(self.as_ref(), "accessible-table-column-header") } #[doc(alias = "accessible-table-column-header")] fn set_accessible_table_column_header>( &self, accessible_table_column_header: Option<&P>, ) { ObjectExt::set_property( self.as_ref(), "accessible-table-column-header", accessible_table_column_header, ) } #[doc(alias = "accessible-table-row-description")] fn accessible_table_row_description(&self) -> Option { ObjectExt::property(self.as_ref(), "accessible-table-row-description") } #[doc(alias = "accessible-table-row-description")] fn set_accessible_table_row_description(&self, accessible_table_row_description: Option<&str>) { ObjectExt::set_property( self.as_ref(), "accessible-table-row-description", accessible_table_row_description, ) } #[doc(alias = "accessible-table-row-header")] fn accessible_table_row_header(&self) -> Option { ObjectExt::property(self.as_ref(), "accessible-table-row-header") } #[doc(alias = "accessible-table-row-header")] fn set_accessible_table_row_header>( &self, accessible_table_row_header: Option<&P>, ) { ObjectExt::set_property( self.as_ref(), "accessible-table-row-header", accessible_table_row_header, ) } #[doc(alias = "accessible-table-summary")] fn accessible_table_summary(&self) -> Option { ObjectExt::property(self.as_ref(), "accessible-table-summary") } #[doc(alias = "accessible-table-summary")] fn set_accessible_table_summary>(&self, accessible_table_summary: Option<&P>) { ObjectExt::set_property( self.as_ref(), "accessible-table-summary", accessible_table_summary, ) } #[doc(alias = "accessible-value")] fn accessible_value(&self) -> f64 { ObjectExt::property(self.as_ref(), "accessible-value") } #[doc(alias = "accessible-value")] fn set_accessible_value(&self, accessible_value: f64) { ObjectExt::set_property(self.as_ref(), "accessible-value", accessible_value) } #[doc(alias = "active-descendant-changed")] 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::{name}\0")); 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), ) } } #[cfg(feature = "v2_46")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_46")))] #[doc(alias = "announcement")] fn connect_announcement(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn announcement_trampoline, F: Fn(&P, &str) + 'static>( this: *mut ffi::AtkObject, arg1: *mut libc::c_char, 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), ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"announcement\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( announcement_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "children-changed")] 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::{name}\0")); 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), ) } } #[cfg(feature = "v2_50")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] #[doc(alias = "notification")] fn connect_notification(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notification_trampoline< P: IsA, F: Fn(&P, &str, i32) + 'static, >( this: *mut ffi::AtkObject, arg1: *mut libc::c_char, arg2: libc::c_int, 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), arg2, ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notification\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notification_trampoline:: as *const (), )), Box_::into_raw(f), ) } } //#[doc(alias = "property-change")] //fn connect_property_change(&self, detail: Option<&str>, f: F) -> SignalHandlerId { // Ignored arg1: Atk.PropertyValues //} #[doc(alias = "state-change")] 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::{name}\0")); 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), ) } } #[doc(alias = "visible-data-changed")] 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), ) } } #[doc(alias = "accessible-component-layer")] 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), ) } } #[doc(alias = "accessible-component-mdi-zorder")] 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), ) } } #[doc(alias = "accessible-description")] 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), ) } } #[doc(alias = "accessible-hypertext-nlinks")] 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), ) } } #[doc(alias = "accessible-name")] 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), ) } } #[doc(alias = "accessible-parent")] 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), ) } } #[doc(alias = "accessible-role")] 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), ) } } #[doc(alias = "accessible-table-caption")] 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), ) } } #[doc(alias = "accessible-table-caption-object")] 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), ) } } #[doc(alias = "accessible-table-column-description")] 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), ) } } #[doc(alias = "accessible-table-column-header")] 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), ) } } #[doc(alias = "accessible-table-row-description")] 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), ) } } #[doc(alias = "accessible-table-row-header")] 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), ) } } #[doc(alias = "accessible-table-summary")] 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), ) } } #[doc(alias = "accessible-value")] 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> AtkObjectExt for O {} impl fmt::Display for Object { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Object") } } rust-atk-0.18-0.18.0/src/auto/object_factory.rs000066400000000000000000000033441467506150400210540ustar00rootroot00000000000000// 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::{prelude::*, translate::*}; use std::fmt; glib::wrapper! { #[doc(alias = "AtkObjectFactory")] pub struct ObjectFactory(Object); match fn { type_ => || ffi::atk_object_factory_get_type(), } } impl ObjectFactory { pub const NONE: Option<&'static ObjectFactory> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait ObjectFactoryExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_object_factory_create_accessible")] fn create_accessible(&self, obj: &impl IsA) -> 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, )) } } #[doc(alias = "atk_object_factory_get_accessible_type")] #[doc(alias = "get_accessible_type")] fn accessible_type(&self) -> glib::types::Type { unsafe { from_glib(ffi::atk_object_factory_get_accessible_type( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "atk_object_factory_invalidate")] fn invalidate(&self) { unsafe { ffi::atk_object_factory_invalidate(self.as_ref().to_glib_none().0); } } } impl> ObjectFactoryExt for O {} impl fmt::Display for ObjectFactory { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("ObjectFactory") } } rust-atk-0.18-0.18.0/src/auto/plug.rs000066400000000000000000000024261467506150400170260ustar00rootroot00000000000000// 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, Object}; use glib::{prelude::*, 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 { pub const NONE: Option<&'static Plug> = None; #[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() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AtkPlugExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_plug_get_id")] #[doc(alias = "get_id")] fn id(&self) -> Option { unsafe { from_glib_full(ffi::atk_plug_get_id(self.as_ref().to_glib_none().0)) } } } impl> AtkPlugExt for O {} impl fmt::Display for Plug { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Plug") } } rust-atk-0.18-0.18.0/src/auto/range.rs000066400000000000000000000027501467506150400171530ustar00rootroot00000000000000// 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) } } } rust-atk-0.18-0.18.0/src/auto/rectangle.rs000066400000000000000000000010711467506150400200160ustar00rootroot00000000000000// 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(), } } rust-atk-0.18-0.18.0/src/auto/registry.rs000066400000000000000000000035551467506150400177330ustar00rootroot00000000000000// 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::{prelude::*, translate::*}; use std::fmt; glib::wrapper! { #[doc(alias = "AtkRegistry")] pub struct Registry(Object); match fn { type_ => || ffi::atk_registry_get_type(), } } impl Registry { pub const NONE: Option<&'static Registry> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait RegistryExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_registry_get_factory")] #[doc(alias = "get_factory")] 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(), )) } } #[doc(alias = "atk_registry_get_factory_type")] #[doc(alias = "get_factory_type")] 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(), )) } } #[doc(alias = "atk_registry_set_factory_type")] 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> RegistryExt for O {} impl fmt::Display for Registry { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Registry") } } rust-atk-0.18-0.18.0/src/auto/relation.rs000066400000000000000000000110631467506150400176710ustar00rootroot00000000000000// 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, RelationType}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "AtkRelation")] pub struct Relation(Object); match fn { type_ => || ffi::atk_relation_get_type(), } } impl Relation { pub const NONE: Option<&'static Relation> = None; #[doc(alias = "atk_relation_new")] pub fn new(targets: &[Object], relationship: RelationType) -> Relation { assert_initialized_main_thread!(); let n_targets = targets.len() as _; unsafe { from_glib_full(ffi::atk_relation_new( targets.to_glib_none().0, n_targets, relationship.into_glib(), )) } } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait RelationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_relation_add_target")] fn add_target(&self, target: &impl IsA) { unsafe { ffi::atk_relation_add_target( self.as_ref().to_glib_none().0, target.as_ref().to_glib_none().0, ); } } #[doc(alias = "atk_relation_get_relation_type")] #[doc(alias = "get_relation_type")] fn relation_type(&self) -> RelationType { unsafe { from_glib(ffi::atk_relation_get_relation_type( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "atk_relation_get_target")] #[doc(alias = "get_target")] fn target(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_none(ffi::atk_relation_get_target( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "atk_relation_remove_target")] fn remove_target(&self, target: &impl IsA) -> bool { unsafe { from_glib(ffi::atk_relation_remove_target( self.as_ref().to_glib_none().0, target.as_ref().to_glib_none().0, )) } } #[doc(alias = "relation-type")] fn set_relation_type(&self, relation_type: RelationType) { ObjectExt::set_property(self.as_ref(), "relation-type", relation_type) } fn set_target(&self, target: Option<&glib::ValueArray>) { ObjectExt::set_property(self.as_ref(), "target", target) } #[doc(alias = "relation-type")] 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), ) } } #[doc(alias = "target")] 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> RelationExt for O {} impl fmt::Display for Relation { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Relation") } } rust-atk-0.18-0.18.0/src/auto/relation_set.rs000066400000000000000000000073041467506150400205470ustar00rootroot00000000000000// 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, Relation, RelationType}; use glib::{prelude::*, translate::*}; use std::fmt; glib::wrapper! { #[doc(alias = "AtkRelationSet")] pub struct RelationSet(Object); match fn { type_ => || ffi::atk_relation_set_get_type(), } } impl RelationSet { pub const NONE: Option<&'static RelationSet> = None; #[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() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait RelationSetExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_relation_set_add")] fn add(&self, relation: &impl IsA) { unsafe { ffi::atk_relation_set_add( self.as_ref().to_glib_none().0, relation.as_ref().to_glib_none().0, ); } } #[doc(alias = "atk_relation_set_add_relation_by_type")] fn add_relation_by_type(&self, relationship: RelationType, target: &impl IsA) { 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, ); } } #[doc(alias = "atk_relation_set_contains")] fn contains(&self, relationship: RelationType) -> bool { unsafe { from_glib(ffi::atk_relation_set_contains( self.as_ref().to_glib_none().0, relationship.into_glib(), )) } } #[doc(alias = "atk_relation_set_contains_target")] fn contains_target(&self, relationship: RelationType, target: &impl IsA) -> 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, )) } } #[doc(alias = "atk_relation_set_get_n_relations")] #[doc(alias = "get_n_relations")] fn n_relations(&self) -> i32 { unsafe { ffi::atk_relation_set_get_n_relations(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_relation_set_get_relation")] #[doc(alias = "get_relation")] fn relation(&self, i: i32) -> Option { unsafe { from_glib_none(ffi::atk_relation_set_get_relation( self.as_ref().to_glib_none().0, i, )) } } #[doc(alias = "atk_relation_set_get_relation_by_type")] #[doc(alias = "get_relation_by_type")] 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(), )) } } #[doc(alias = "atk_relation_set_remove")] fn remove(&self, relation: &impl IsA) { unsafe { ffi::atk_relation_set_remove( self.as_ref().to_glib_none().0, relation.as_ref().to_glib_none().0, ); } } } impl> RelationSetExt for O {} impl fmt::Display for RelationSet { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("RelationSet") } } rust-atk-0.18-0.18.0/src/auto/selection.rs000066400000000000000000000071251467506150400200450ustar00rootroot00000000000000// 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::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "AtkSelection")] pub struct Selection(Interface); match fn { type_ => || ffi::atk_selection_get_type(), } } impl Selection { pub const NONE: Option<&'static Selection> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait SelectionExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_selection_add_selection")] fn add_selection(&self, i: i32) -> bool { unsafe { from_glib(ffi::atk_selection_add_selection( self.as_ref().to_glib_none().0, i, )) } } #[doc(alias = "atk_selection_clear_selection")] fn clear_selection(&self) -> bool { unsafe { from_glib(ffi::atk_selection_clear_selection( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "atk_selection_get_selection_count")] #[doc(alias = "get_selection_count")] fn selection_count(&self) -> i32 { unsafe { ffi::atk_selection_get_selection_count(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_selection_is_child_selected")] 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, )) } } #[doc(alias = "atk_selection_ref_selection")] fn ref_selection(&self, i: i32) -> Option { unsafe { from_glib_full(ffi::atk_selection_ref_selection( self.as_ref().to_glib_none().0, i, )) } } #[doc(alias = "atk_selection_remove_selection")] fn remove_selection(&self, i: i32) -> bool { unsafe { from_glib(ffi::atk_selection_remove_selection( self.as_ref().to_glib_none().0, i, )) } } #[doc(alias = "atk_selection_select_all_selection")] fn select_all_selection(&self) -> bool { unsafe { from_glib(ffi::atk_selection_select_all_selection( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "selection-changed")] 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> SelectionExt for O {} impl fmt::Display for Selection { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Selection") } } rust-atk-0.18-0.18.0/src/auto/socket.rs000066400000000000000000000027511467506150400173500ustar00rootroot00000000000000// 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, Object}; use glib::{prelude::*, 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 { pub const NONE: Option<&'static Socket> = None; #[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() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AtkSocketExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_socket_embed")] fn embed(&self, plug_id: &str) { unsafe { ffi::atk_socket_embed(self.as_ref().to_glib_none().0, plug_id.to_glib_none().0); } } #[doc(alias = "atk_socket_is_occupied")] fn is_occupied(&self) -> bool { unsafe { from_glib(ffi::atk_socket_is_occupied(self.as_ref().to_glib_none().0)) } } } impl> AtkSocketExt for O {} impl fmt::Display for Socket { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Socket") } } rust-atk-0.18-0.18.0/src/auto/state_set.rs000066400000000000000000000073461467506150400200600ustar00rootroot00000000000000// 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::{prelude::*, translate::*}; use std::fmt; glib::wrapper! { #[doc(alias = "AtkStateSet")] pub struct StateSet(Object); match fn { type_ => || ffi::atk_state_set_get_type(), } } impl StateSet { pub const NONE: Option<&'static StateSet> = None; #[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() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait StateSetExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_state_set_add_state")] 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(), )) } } //#[doc(alias = "atk_state_set_add_states")] //fn add_states(&self, types: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 69 }) { // unsafe { TODO: call ffi:atk_state_set_add_states() } //} #[doc(alias = "atk_state_set_and_sets")] #[must_use] fn and_sets(&self, compare_set: &impl IsA) -> 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, )) } } #[doc(alias = "atk_state_set_clear_states")] fn clear_states(&self) { unsafe { ffi::atk_state_set_clear_states(self.as_ref().to_glib_none().0); } } #[doc(alias = "atk_state_set_contains_state")] 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(), )) } } //#[doc(alias = "atk_state_set_contains_states")] //fn contains_states(&self, types: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 69 }) -> bool { // unsafe { TODO: call ffi:atk_state_set_contains_states() } //} #[doc(alias = "atk_state_set_is_empty")] fn is_empty(&self) -> bool { unsafe { from_glib(ffi::atk_state_set_is_empty(self.as_ref().to_glib_none().0)) } } #[doc(alias = "atk_state_set_or_sets")] #[must_use] fn or_sets(&self, compare_set: &impl IsA) -> 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, )) } } #[doc(alias = "atk_state_set_remove_state")] 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(), )) } } #[doc(alias = "atk_state_set_xor_sets")] #[must_use] fn xor_sets(&self, compare_set: &impl IsA) -> 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> StateSetExt for O {} impl fmt::Display for StateSet { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("StateSet") } } rust-atk-0.18-0.18.0/src/auto/streamable_content.rs000066400000000000000000000041101467506150400217200ustar00rootroot00000000000000// 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::{prelude::*, translate::*}; use std::fmt; glib::wrapper! { #[doc(alias = "AtkStreamableContent")] pub struct StreamableContent(Interface); match fn { type_ => || ffi::atk_streamable_content_get_type(), } } impl StreamableContent { pub const NONE: Option<&'static StreamableContent> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait StreamableContentExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_streamable_content_get_mime_type")] #[doc(alias = "get_mime_type")] 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, )) } } #[doc(alias = "atk_streamable_content_get_n_mime_types")] #[doc(alias = "get_n_mime_types")] fn n_mime_types(&self) -> i32 { unsafe { ffi::atk_streamable_content_get_n_mime_types(self.as_ref().to_glib_none().0) } } //#[doc(alias = "atk_streamable_content_get_stream")] //#[doc(alias = "get_stream")] //fn stream(&self, mime_type: &str) -> /*Ignored*/Option { // unsafe { TODO: call ffi:atk_streamable_content_get_stream() } //} #[doc(alias = "atk_streamable_content_get_uri")] #[doc(alias = "get_uri")] 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> StreamableContentExt for O {} impl fmt::Display for StreamableContent { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("StreamableContent") } } rust-atk-0.18-0.18.0/src/auto/table.rs000066400000000000000000000346511467506150400171530ustar00rootroot00000000000000// 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::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "AtkTable")] pub struct Table(Interface); match fn { type_ => || ffi::atk_table_get_type(), } } impl Table { pub const NONE: Option<&'static Table> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait TableExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_table_add_column_selection")] 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, )) } } #[doc(alias = "atk_table_add_row_selection")] 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, )) } } #[doc(alias = "atk_table_get_caption")] #[doc(alias = "get_caption")] fn caption(&self) -> Option { unsafe { from_glib_none(ffi::atk_table_get_caption(self.as_ref().to_glib_none().0)) } } #[doc(alias = "atk_table_get_column_at_index")] #[doc(alias = "get_column_at_index")] fn column_at_index(&self, index_: i32) -> i32 { unsafe { ffi::atk_table_get_column_at_index(self.as_ref().to_glib_none().0, index_) } } #[doc(alias = "atk_table_get_column_description")] #[doc(alias = "get_column_description")] 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, )) } } #[doc(alias = "atk_table_get_column_extent_at")] #[doc(alias = "get_column_extent_at")] 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) } } #[doc(alias = "atk_table_get_column_header")] #[doc(alias = "get_column_header")] 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, )) } } #[doc(alias = "atk_table_get_index_at")] #[doc(alias = "get_index_at")] 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) } } #[doc(alias = "atk_table_get_n_columns")] #[doc(alias = "get_n_columns")] fn n_columns(&self) -> i32 { unsafe { ffi::atk_table_get_n_columns(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_table_get_n_rows")] #[doc(alias = "get_n_rows")] fn n_rows(&self) -> i32 { unsafe { ffi::atk_table_get_n_rows(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_table_get_row_at_index")] #[doc(alias = "get_row_at_index")] fn row_at_index(&self, index_: i32) -> i32 { unsafe { ffi::atk_table_get_row_at_index(self.as_ref().to_glib_none().0, index_) } } #[doc(alias = "atk_table_get_row_description")] #[doc(alias = "get_row_description")] 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, )) } } #[doc(alias = "atk_table_get_row_extent_at")] #[doc(alias = "get_row_extent_at")] 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) } } #[doc(alias = "atk_table_get_row_header")] #[doc(alias = "get_row_header")] 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, )) } } #[doc(alias = "atk_table_get_summary")] #[doc(alias = "get_summary")] fn summary(&self) -> Option { unsafe { from_glib_full(ffi::atk_table_get_summary(self.as_ref().to_glib_none().0)) } } #[doc(alias = "atk_table_is_column_selected")] 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, )) } } #[doc(alias = "atk_table_is_row_selected")] 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, )) } } #[doc(alias = "atk_table_is_selected")] 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, )) } } #[doc(alias = "atk_table_ref_at")] 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, )) } } #[doc(alias = "atk_table_remove_column_selection")] 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, )) } } #[doc(alias = "atk_table_remove_row_selection")] 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, )) } } #[doc(alias = "atk_table_set_caption")] fn set_caption(&self, caption: &impl IsA) { unsafe { ffi::atk_table_set_caption( self.as_ref().to_glib_none().0, caption.as_ref().to_glib_none().0, ); } } #[doc(alias = "atk_table_set_column_description")] 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, ); } } #[doc(alias = "atk_table_set_column_header")] fn set_column_header(&self, column: i32, header: &impl IsA) { unsafe { ffi::atk_table_set_column_header( self.as_ref().to_glib_none().0, column, header.as_ref().to_glib_none().0, ); } } #[doc(alias = "atk_table_set_row_description")] 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, ); } } #[doc(alias = "atk_table_set_row_header")] fn set_row_header(&self, row: i32, header: &impl IsA) { unsafe { ffi::atk_table_set_row_header( self.as_ref().to_glib_none().0, row, header.as_ref().to_glib_none().0, ); } } #[doc(alias = "atk_table_set_summary")] fn set_summary(&self, accessible: &impl IsA) { unsafe { ffi::atk_table_set_summary( self.as_ref().to_glib_none().0, accessible.as_ref().to_glib_none().0, ); } } #[doc(alias = "column-deleted")] 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), ) } } #[doc(alias = "column-inserted")] 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), ) } } #[doc(alias = "column-reordered")] 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), ) } } #[doc(alias = "model-changed")] 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), ) } } #[doc(alias = "row-deleted")] 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), ) } } #[doc(alias = "row-inserted")] 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), ) } } #[doc(alias = "row-reordered")] 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> TableExt for O {} impl fmt::Display for Table { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Table") } } rust-atk-0.18-0.18.0/src/auto/table_cell.rs000066400000000000000000000074531467506150400201520ustar00rootroot00000000000000// 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::{prelude::*, translate::*}; use std::{fmt, mem}; glib::wrapper! { #[doc(alias = "AtkTableCell")] pub struct TableCell(Interface) @requires Object; match fn { type_ => || ffi::atk_table_cell_get_type(), } } impl TableCell { pub const NONE: Option<&'static TableCell> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait TableCellExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_table_cell_get_column_header_cells")] #[doc(alias = "get_column_header_cells")] 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, )) } } #[doc(alias = "atk_table_cell_get_column_span")] #[doc(alias = "get_column_span")] fn column_span(&self) -> i32 { unsafe { ffi::atk_table_cell_get_column_span(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_table_cell_get_position")] #[doc(alias = "get_position")] 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(), )); if ret { Some((row.assume_init(), column.assume_init())) } else { None } } } #[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)> { 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(), )); if ret { Some(( row.assume_init(), column.assume_init(), row_span.assume_init(), column_span.assume_init(), )) } else { None } } } #[doc(alias = "atk_table_cell_get_row_header_cells")] #[doc(alias = "get_row_header_cells")] 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, )) } } #[doc(alias = "atk_table_cell_get_row_span")] #[doc(alias = "get_row_span")] fn row_span(&self) -> i32 { unsafe { ffi::atk_table_cell_get_row_span(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_table_cell_get_table")] #[doc(alias = "get_table")] fn table(&self) -> Option { unsafe { from_glib_full(ffi::atk_table_cell_get_table( self.as_ref().to_glib_none().0, )) } } } impl> TableCellExt for O {} impl fmt::Display for TableCell { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("TableCell") } } rust-atk-0.18-0.18.0/src/auto/text.rs000066400000000000000000000361351467506150400170470ustar00rootroot00000000000000// 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 #[cfg(feature = "v2_32")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_32")))] use crate::ScrollType; use crate::{CoordType, TextBoundary, TextClipType, TextGranularity, TextRange, TextRectangle}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem, mem::transmute}; glib::wrapper! { #[doc(alias = "AtkText")] pub struct Text(Interface); match fn { type_ => || ffi::atk_text_get_type(), } } impl Text { pub const NONE: Option<&'static Text> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait TextExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_text_add_selection")] 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, )) } } #[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 { 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(), )) } } #[doc(alias = "atk_text_get_caret_offset")] #[doc(alias = "get_caret_offset")] fn caret_offset(&self) -> i32 { unsafe { ffi::atk_text_get_caret_offset(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_text_get_character_at_offset")] #[doc(alias = "get_character_at_offset")] 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") } } #[doc(alias = "atk_text_get_character_count")] #[doc(alias = "get_character_count")] fn character_count(&self) -> i32 { unsafe { ffi::atk_text_get_character_count(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_text_get_character_extents")] #[doc(alias = "get_character_extents")] 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(), ); ( x.assume_init(), y.assume_init(), width.assume_init(), height.assume_init(), ) } } //#[doc(alias = "atk_text_get_default_attributes")] //#[doc(alias = "get_default_attributes")] //fn default_attributes(&self) -> /*Ignored*/Option { // unsafe { TODO: call ffi:atk_text_get_default_attributes() } //} #[doc(alias = "atk_text_get_n_selections")] #[doc(alias = "get_n_selections")] fn n_selections(&self) -> i32 { unsafe { ffi::atk_text_get_n_selections(self.as_ref().to_glib_none().0) } } #[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 { unsafe { ffi::atk_text_get_offset_at_point( self.as_ref().to_glib_none().0, x, y, coords.into_glib(), ) } } #[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 { 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 } } //#[doc(alias = "atk_text_get_run_attributes")] //#[doc(alias = "get_run_attributes")] //fn run_attributes(&self, offset: i32) -> (/*Ignored*/AttributeSet, i32, i32) { // unsafe { TODO: call ffi:atk_text_get_run_attributes() } //} #[doc(alias = "atk_text_get_selection")] #[doc(alias = "get_selection")] 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(), )); (ret, start_offset.assume_init(), end_offset.assume_init()) } } #[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) { 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(), )); (ret, start_offset.assume_init(), end_offset.assume_init()) } } #[doc(alias = "atk_text_get_text")] #[doc(alias = "get_text")] 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, )) } } #[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) { 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(), )); (ret, start_offset.assume_init(), end_offset.assume_init()) } } #[doc(alias = "atk_text_remove_selection")] 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(feature = "v2_32")] #[cfg_attr(docsrs, 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 { unsafe { from_glib(ffi::atk_text_scroll_substring_to( self.as_ref().to_glib_none().0, start_offset, end_offset, type_.into_glib(), )) } } #[cfg(feature = "v2_32")] #[cfg_attr(docsrs, 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 { 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, )) } } #[doc(alias = "atk_text_set_caret_offset")] 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, )) } } #[doc(alias = "atk_text_set_selection")] 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, )) } } #[doc(alias = "text-attributes-changed")] 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), ) } } #[doc(alias = "text-caret-moved")] 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), ) } } #[doc(alias = "text-insert")] 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::{name}\0")); 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), ) } } #[doc(alias = "text-remove")] 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::{name}\0")); 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), ) } } #[doc(alias = "text-selection-changed")] 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> TextExt for O {} impl fmt::Display for Text { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Text") } } rust-atk-0.18-0.18.0/src/auto/text_range.rs000066400000000000000000000010741467506150400202150ustar00rootroot00000000000000// 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(), } } rust-atk-0.18-0.18.0/src/auto/util.rs000066400000000000000000000010121467506150400170220ustar00rootroot00000000000000// 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: Option<&'static Util> = None; } impl fmt::Display for Util { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Util") } } rust-atk-0.18-0.18.0/src/auto/value.rs000066400000000000000000000122421467506150400171700ustar00rootroot00000000000000// 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::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem, mem::transmute, ptr}; glib::wrapper! { #[doc(alias = "AtkValue")] pub struct Value(Interface); match fn { type_ => || ffi::atk_value_get_type(), } } impl Value { pub const NONE: Option<&'static Value> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait ValueExt: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_value_get_current_value")] #[doc(alias = "get_current_value")] 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 } } #[doc(alias = "atk_value_get_increment")] #[doc(alias = "get_increment")] fn increment(&self) -> f64 { unsafe { ffi::atk_value_get_increment(self.as_ref().to_glib_none().0) } } #[doc(alias = "atk_value_get_maximum_value")] #[doc(alias = "get_maximum_value")] 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 } } #[doc(alias = "atk_value_get_minimum_increment")] #[doc(alias = "get_minimum_increment")] 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 } } #[doc(alias = "atk_value_get_minimum_value")] #[doc(alias = "get_minimum_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 } } #[doc(alias = "atk_value_get_range")] #[doc(alias = "get_range")] fn range(&self) -> Option { unsafe { from_glib_full(ffi::atk_value_get_range(self.as_ref().to_glib_none().0)) } } #[doc(alias = "atk_value_get_sub_ranges")] #[doc(alias = "get_sub_ranges")] fn sub_ranges(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::atk_value_get_sub_ranges( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "atk_value_get_value_and_text")] #[doc(alias = "get_value_and_text")] 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, ); (value.assume_init(), from_glib_full(text)) } } #[doc(alias = "atk_value_set_current_value")] 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, )) } } #[doc(alias = "atk_value_set_value")] fn set_value(&self, new_value: f64) { unsafe { ffi::atk_value_set_value(self.as_ref().to_glib_none().0, new_value); } } #[doc(alias = "value-changed")] 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> ValueExt for O {} impl fmt::Display for Value { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Value") } } rust-atk-0.18-0.18.0/src/auto/versions.txt000066400000000000000000000002041467506150400201120ustar00rootroot00000000000000Generated by gir (https://github.com/gtk-rs/gir @ 76bbe9b90aaa) from gir-files (https://github.com/gtk-rs/gir-files @ 307566e1ab58) rust-atk-0.18-0.18.0/src/auto/window.rs000066400000000000000000000175261467506150400173750ustar00rootroot00000000000000// 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::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "AtkWindow")] pub struct Window(Interface) @requires Object; match fn { type_ => || ffi::atk_window_get_type(), } } impl Window { pub const NONE: Option<&'static Window> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AtkWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "activate")] 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), ) } } #[doc(alias = "create")] 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), ) } } #[doc(alias = "deactivate")] 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), ) } } #[doc(alias = "destroy")] 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), ) } } #[doc(alias = "maximize")] 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), ) } } #[doc(alias = "minimize")] 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), ) } } #[doc(alias = "move")] 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), ) } } #[doc(alias = "resize")] 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), ) } } #[doc(alias = "restore")] 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> AtkWindowExt for O {} impl fmt::Display for Window { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Window") } } rust-atk-0.18-0.18.0/src/editable_text.rs000066400000000000000000000014561467506150400177260ustar00rootroot00000000000000// 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::*; mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait EditableTextExtManual: IsA + sealed::Sealed + 'static { #[doc(alias = "atk_editable_text_insert_text")] 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 } } impl> EditableTextExtManual for O {} rust-atk-0.18-0.18.0/src/lib.rs000066400000000000000000000007651467506150400156610ustar00rootroot00000000000000// Take a look at the license at the top of the repository in the LICENSE file. #![doc = include_str!("../README.md")] #![cfg_attr(docsrs, 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; rust-atk-0.18-0.18.0/src/prelude.rs000066400000000000000000000004371467506150400165470ustar00rootroot00000000000000// 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::*; rust-atk-0.18-0.18.0/src/rt.rs000066400000000000000000000003351467506150400155310ustar00rootroot00000000000000// 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 { () => {}; } rust-atk-0.18-0.18.0/src/table.rs000066400000000000000000000025201467506150400161710ustar00rootroot00000000000000// 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::*; mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait TableExtManual: IsA
+ sealed::Sealed + 'static { #[doc(alias = "atk_table_get_selected_columns")] #[doc(alias = "get_selected_columns")] 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) } } } #[doc(alias = "atk_table_get_selected_rows")] #[doc(alias = "get_selected_rows")] 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) } } } } impl> TableExtManual for O {} rust-atk-0.18-0.18.0/src/text_rectangle.rs000066400000000000000000000031121467506150400201100ustar00rootroot00000000000000// 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, } } }