gdkx11-0.14.0/.cargo_vcs_info.json0000644000000001120000000000100122070ustar { "git": { "sha1": "ae4ccd1762fd1ea9aa951d593f6c6fa4cc9bbe82" } } gdkx11-0.14.0/COPYRIGHT000064400000000000000000000012130072674642500123250ustar 00000000000000The gtk-rs Project is licensed under the MIT license, see the LICENSE file or . Copyrights in the gtk-rs Project project are retained by their contributors. No copyright assignment is required to contribute to the gtk-rs Project project. For full authorship information, see the version control history. This project provides interoperability with various GNOME libraries but doesn't distribute any parts of them. Distributing compiled libraries and executables that link to those libraries may be subject to terms of the GNU LGPL or other licenses. For more information check the license of each GNOME library. gdkx11-0.14.0/Cargo.toml0000644000000026410000000000100102160ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] edition = "2018" name = "gdkx11" version = "0.14.0" authors = ["The gtk-rs Project Developers"] exclude = ["gir-files/*"] description = "Rust bindings for the GDK X11 library" homepage = "https://gtk-rs.org/" documentation = "https://gtk-rs.org/gtk3-rs/stable/latest/docs/gdkx11/" readme = "README.md" keywords = ["gdkx11", "gdk", "gtk-rs", "gnome", "GUI"] license = "MIT" repository = "https://github.com/gtk-rs/gtk3-rs" [package.metadata.docs.rs] features = ["dox"] [lib] name = "gdkx11" [dependencies.ffi] version = "0.14.0" package = "gdkx11-sys" [dependencies.gdk] version = "0.14.0" [dependencies.gio] version = "0.14.0" [dependencies.glib] version = "0.14.0" [dependencies.libc] version = "0.2" [dependencies.x11] version = "2.18" [dev-dependencies.gir-format-check] version = "^0.1" [features] dox = ["gdk/dox", "ffi/dox"] v3_22 = ["ffi/v3_22", "gdk/v3_22"] v3_24 = ["v3_22", "ffi/v3_24_2"] gdkx11-0.14.0/Cargo.toml.orig000064400000000000000000000014430072674642500137260ustar 00000000000000[package] name = "gdkx11" license = "MIT" homepage = "https://gtk-rs.org/" authors = ["The gtk-rs Project Developers"] keywords = ["gdkx11", "gdk", "gtk-rs", "gnome", "GUI"] readme = "README.md" documentation = "https://gtk-rs.org/gtk3-rs/stable/latest/docs/gdkx11/" version = "0.14.0" description = "Rust bindings for the GDK X11 library" repository = "https://github.com/gtk-rs/gtk3-rs" exclude = [ "gir-files/*", ] edition = "2018" [lib] name = "gdkx11" [features] dox = ["gdk/dox", "ffi/dox"] v3_22 = ["ffi/v3_22", "gdk/v3_22"] v3_24 = ["v3_22", "ffi/v3_24_2"] [package.metadata.docs.rs] features = ["dox"] [dependencies] libc = "0.2" x11 = "2.18" ffi = {package = "gdkx11-sys", version = "0.14.0"} glib = "0.14.0" gdk = "0.14.0" gio = "0.14.0" [dev-dependencies] gir-format-check = "^0.1" gdkx11-0.14.0/Gir.toml000064400000000000000000000051550072674642500124610ustar 00000000000000[options] girs_directories = ["../gir-files"] library = "GdkX11" version = "3.0" min_cfg_version = "3.18" target_path = "." work_mode = "normal" single_version_file = true generate_safety_asserts = true deprecate_by_min_version = true extra_versions = [ "3.22" ] generate = [ "GdkX11.X11AppLaunchContext", "GdkX11.X11DeviceCore", "GdkX11.X11DeviceManagerCore", "GdkX11.X11DisplayManager", "GdkX11.X11DragContext", "GdkX11.X11GLContext", "GdkX11.X11Keymap", "GdkX11.X11Window" ] ignore = [ ] manual = [ "Gdk.AppLaunchContext", "Gdk.Atom", "Gdk.Cursor", "Gdk.Device", "Gdk.DeviceManager", "Gdk.Display", "Gdk.DisplayManager", "Gdk.DragContext", "Gdk.GLContext", "Gdk.Keymap", "Gdk.Monitor", "Gdk.Screen", "Gdk.Visual", "Gdk.Window", "Gio.AppLaunchContext", "xlib.Atom", "xlib.Cursor", "xlib.Display", "xlib.Screen", "xlib.Visual", "xlib.VisualID", "xlib.Window", "xlib.XID", ] [[object]] name = "GdkX11.*" status = "generate" [[object.function]] name = "x11_free_compound_text" # manual, wrong annotations ignore = true [[object.function]] name = "x11_free_text_list" # manual, wrong annotations ignore = true [[object.function]] name = "x11_get_default_xdisplay" # manual, as xlib::Display doesn't implement glib traits ignore = true [[object.function]] name = "x11_lookup_xdisplay" # manual, as xlib::Display doesn't implement glib traits ignore = true [[object]] name = "GdkX11.X11Cursor" status = "generate" [[object.function]] name = "get_xdisplay" # manual, as xlib::Display doesn't implement glib traits ignore = true [[object]] name = "GdkX11.X11DeviceXI2" status = "generate" generate_builder = true [[object]] name = "GdkX11.X11DeviceManagerXI2" status = "generate" generate_builder = true [[object]] name = "GdkX11.X11Display" status = "generate" [[object.function]] name = "get_xdisplay" # manual, as xlib::Display doesn't implement glib traits ignore = true [[object.function]] name = "text_property_to_text_list" # manual, the annotations are wrong ignore = true [[object]] name = "GdkX11.X11Monitor" status = "generate" version = "3.22" [[object]] name = "GdkX11.X11Screen" status = "generate" [[object.function]] name = "get_xscreen" # manual, as xlib::Screen doesn't implement glib traits ignore = true [[object]] name = "GdkX11.X11Visual" status = "generate" [[object.function]] name = "get_xvisual" # manual, as xlib::Visual doesn't implement glib traits ignore = true gdkx11-0.14.0/LICENSE000064400000000000000000000020000072674642500120320ustar 00000000000000Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. gdkx11-0.14.0/README.md000064400000000000000000000022370072674642500123200ustar 00000000000000# gdkx11 __Rust__ bindings and wrappers for __GDKX11__, part of [gtk3-rs](https://github.com/gtk-rs/gtk3-rs). ## Minimum supported Rust version Currently, the minimum supported Rust version is `1.51.0`. ## Documentation * [Rust API - Stable](https://gtk-rs.org/gtk3-rs/stable/latest/docs/gdkx11/) * [Rust API - Development](https://gtk-rs.org/gtk3-rs/git/docs/gdkx11) * [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] gdkx11 = { git = "https://github.com/gtk-rs/gtk3-rs.git", package = "gdkx11" } ``` Avoid mixing versioned and git crates like this: ```toml # This will not compile [dependencies] gdkx11 = "0.13" gdkx11 = { git = "https://github.com/gtk-rs/gtk3-rs.git", package = "gdkx11" } ``` ### See Also * [glib](https://crates.io/crates/glib) * [gio](https://crates.io/crates/gio) * [gdk](https://crates.io/crates/gdk) ## License __gdkx11__ is available under the MIT License, please refer to it. gdkx11-0.14.0/src/auto/functions.rs000064400000000000000000000114740072674642500151610ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::X11DeviceCore; use crate::X11DeviceManagerCore; use crate::X11Display; use crate::X11Window; use glib::object::IsA; use glib::translate::*; use x11::xlib; #[doc(alias = "gdk_x11_atom_to_xatom")] pub fn x11_atom_to_xatom(atom: &gdk::Atom) -> xlib::Atom { assert_initialized_main_thread!(); unsafe { ffi::gdk_x11_atom_to_xatom(atom.to_glib_none().0) } } #[doc(alias = "gdk_x11_atom_to_xatom_for_display")] pub fn x11_atom_to_xatom_for_display(display: &X11Display, atom: &gdk::Atom) -> xlib::Atom { skip_assert_initialized!(); unsafe { ffi::gdk_x11_atom_to_xatom_for_display(display.to_glib_none().0, atom.to_glib_none().0) } } #[doc(alias = "gdk_x11_device_get_id")] pub fn x11_device_get_id(device: &X11DeviceCore) -> i32 { skip_assert_initialized!(); unsafe { ffi::gdk_x11_device_get_id(device.to_glib_none().0) } } #[doc(alias = "gdk_x11_device_manager_lookup")] pub fn x11_device_manager_lookup>( device_manager: &P, device_id: i32, ) -> Option { skip_assert_initialized!(); unsafe { from_glib_none(ffi::gdk_x11_device_manager_lookup( device_manager.as_ref().to_glib_none().0, device_id, )) } } #[doc(alias = "gdk_x11_get_default_root_xwindow")] pub fn x11_get_default_root_xwindow() -> xlib::Window { assert_initialized_main_thread!(); unsafe { ffi::gdk_x11_get_default_root_xwindow() } } #[doc(alias = "gdk_x11_get_default_screen")] pub fn x11_get_default_screen() -> i32 { assert_initialized_main_thread!(); unsafe { ffi::gdk_x11_get_default_screen() } } //#[cfg_attr(feature = "v3_24", deprecated = "Since 3.24")] //#[cfg(any(feature = "v3_24_2", feature = "dox"))] //#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_24_2")))] //#[doc(alias = "gdk_x11_get_parent_relative_pattern")] //pub fn x11_get_parent_relative_pattern() -> /*Ignored*/Option { // unsafe { TODO: call ffi:gdk_x11_get_parent_relative_pattern() } //} #[doc(alias = "gdk_x11_get_server_time")] pub fn x11_get_server_time(window: &X11Window) -> u32 { skip_assert_initialized!(); unsafe { ffi::gdk_x11_get_server_time(window.to_glib_none().0) } } #[doc(alias = "gdk_x11_get_xatom_by_name")] pub fn x11_get_xatom_by_name(atom_name: &str) -> xlib::Atom { assert_initialized_main_thread!(); unsafe { ffi::gdk_x11_get_xatom_by_name(atom_name.to_glib_none().0) } } #[doc(alias = "gdk_x11_get_xatom_by_name_for_display")] pub fn x11_get_xatom_by_name_for_display(display: &X11Display, atom_name: &str) -> xlib::Atom { skip_assert_initialized!(); unsafe { ffi::gdk_x11_get_xatom_by_name_for_display( display.to_glib_none().0, atom_name.to_glib_none().0, ) } } #[doc(alias = "gdk_x11_get_xatom_name")] pub fn x11_get_xatom_name(xatom: xlib::Atom) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::gdk_x11_get_xatom_name(xatom)) } } #[doc(alias = "gdk_x11_get_xatom_name_for_display")] pub fn x11_get_xatom_name_for_display( display: &X11Display, xatom: xlib::Atom, ) -> Option { skip_assert_initialized!(); unsafe { from_glib_none(ffi::gdk_x11_get_xatom_name_for_display( display.to_glib_none().0, xatom, )) } } #[doc(alias = "gdk_x11_grab_server")] pub fn x11_grab_server() { assert_initialized_main_thread!(); unsafe { ffi::gdk_x11_grab_server(); } } #[doc(alias = "gdk_x11_register_standard_event_type")] pub fn x11_register_standard_event_type(display: &X11Display, event_base: i32, n_events: i32) { skip_assert_initialized!(); unsafe { ffi::gdk_x11_register_standard_event_type(display.to_glib_none().0, event_base, n_events); } } #[doc(alias = "gdk_x11_set_sm_client_id")] pub fn x11_set_sm_client_id(sm_client_id: Option<&str>) { assert_initialized_main_thread!(); unsafe { ffi::gdk_x11_set_sm_client_id(sm_client_id.to_glib_none().0); } } #[doc(alias = "gdk_x11_ungrab_server")] pub fn x11_ungrab_server() { assert_initialized_main_thread!(); unsafe { ffi::gdk_x11_ungrab_server(); } } #[doc(alias = "gdk_x11_xatom_to_atom")] pub fn x11_xatom_to_atom(xatom: xlib::Atom) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::gdk_x11_xatom_to_atom(xatom)) } } #[doc(alias = "gdk_x11_xatom_to_atom_for_display")] pub fn x11_xatom_to_atom_for_display(display: &X11Display, xatom: xlib::Atom) -> Option { skip_assert_initialized!(); unsafe { from_glib_none(ffi::gdk_x11_xatom_to_atom_for_display( display.to_glib_none().0, xatom, )) } } gdkx11-0.14.0/src/auto/mod.rs000064400000000000000000000030160072674642500137210ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT mod x11_app_launch_context; pub use self::x11_app_launch_context::X11AppLaunchContext; mod x11_cursor; pub use self::x11_cursor::X11Cursor; mod x11_device_core; pub use self::x11_device_core::X11DeviceCore; mod x11_device_manager_core; pub use self::x11_device_manager_core::{X11DeviceManagerCore, NONE_X11_DEVICE_MANAGER_CORE}; mod x11_device_manager_xi2; pub use self::x11_device_manager_xi2::X11DeviceManagerXI2; pub use self::x11_device_manager_xi2::X11DeviceManagerXI2Builder; mod x11_device_xi2; pub use self::x11_device_xi2::X11DeviceXI2; pub use self::x11_device_xi2::X11DeviceXI2Builder; mod x11_display; pub use self::x11_display::X11Display; mod x11_display_manager; pub use self::x11_display_manager::X11DisplayManager; mod x11_drag_context; pub use self::x11_drag_context::X11DragContext; mod x11gl_context; pub use self::x11gl_context::X11GLContext; mod x11_keymap; pub use self::x11_keymap::X11Keymap; #[cfg(any(feature = "v3_22", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))] mod x11_monitor; #[cfg(any(feature = "v3_22", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))] pub use self::x11_monitor::X11Monitor; mod x11_screen; pub use self::x11_screen::X11Screen; mod x11_visual; pub use self::x11_visual::X11Visual; mod x11_window; pub use self::x11_window::X11Window; pub mod functions; #[doc(hidden)] pub mod traits {} gdkx11-0.14.0/src/auto/versions.txt000064400000000000000000000001720072674642500152050ustar 00000000000000Generated by gir (https://github.com/gtk-rs/gir @ 6ed30fc) from gir-files (https://github.com/gtk-rs/gir-files @ 7d95377) gdkx11-0.14.0/src/auto/x11_app_launch_context.rs000064400000000000000000000012100072674642500175030ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use std::fmt; glib::wrapper! { #[doc(alias = "GdkX11AppLaunchContext")] pub struct X11AppLaunchContext(Object) @extends gdk::AppLaunchContext, gio::AppLaunchContext; match fn { type_ => || ffi::gdk_x11_app_launch_context_get_type(), } } impl X11AppLaunchContext {} impl fmt::Display for X11AppLaunchContext { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("X11AppLaunchContext") } } gdkx11-0.14.0/src/auto/x11_cursor.rs000064400000000000000000000014140072674642500151500ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::translate::*; use std::fmt; use x11::xlib; glib::wrapper! { #[doc(alias = "GdkX11Cursor")] pub struct X11Cursor(Object) @extends gdk::Cursor; match fn { type_ => || ffi::gdk_x11_cursor_get_type(), } } impl X11Cursor { #[doc(alias = "gdk_x11_cursor_get_xcursor")] #[doc(alias = "get_xcursor")] pub fn xcursor(&self) -> xlib::Cursor { unsafe { ffi::gdk_x11_cursor_get_xcursor(self.to_glib_none().0) } } } impl fmt::Display for X11Cursor { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("X11Cursor") } } gdkx11-0.14.0/src/auto/x11_device_core.rs000064400000000000000000000010660072674642500161050ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use std::fmt; glib::wrapper! { #[doc(alias = "GdkX11DeviceCore")] pub struct X11DeviceCore(Object) @extends gdk::Device; match fn { type_ => || ffi::gdk_x11_device_core_get_type(), } } impl X11DeviceCore {} impl fmt::Display for X11DeviceCore { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("X11DeviceCore") } } gdkx11-0.14.0/src/auto/x11_device_manager_core.rs000064400000000000000000000013050072674642500175730ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use std::fmt; glib::wrapper! { #[doc(alias = "GdkX11DeviceManagerCore")] pub struct X11DeviceManagerCore(Object) @extends gdk::DeviceManager; match fn { type_ => || ffi::gdk_x11_device_manager_core_get_type(), } } impl X11DeviceManagerCore {} pub const NONE_X11_DEVICE_MANAGER_CORE: Option<&X11DeviceManagerCore> = None; impl fmt::Display for X11DeviceManagerCore { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("X11DeviceManagerCore") } } gdkx11-0.14.0/src/auto/x11_device_manager_xi2.rs000064400000000000000000000105730072674642500173540ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::X11DeviceManagerCore; use glib::object::Cast; use glib::object::IsA; use glib::object::ObjectType as ObjectType_; use glib::translate::*; use glib::StaticType; use glib::ToValue; use std::fmt; glib::wrapper! { #[doc(alias = "GdkX11DeviceManagerXI2")] pub struct X11DeviceManagerXI2(Object) @extends X11DeviceManagerCore, gdk::DeviceManager; match fn { type_ => || ffi::gdk_x11_device_manager_xi2_get_type(), } } impl X11DeviceManagerXI2 { // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`X11DeviceManagerXI2`] objects. /// /// This method returns an instance of [`X11DeviceManagerXI2Builder`] which can be used to create [`X11DeviceManagerXI2`] objects. pub fn builder() -> X11DeviceManagerXI2Builder { X11DeviceManagerXI2Builder::default() } pub fn major(&self) -> i32 { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"major\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `major` getter") } } pub fn minor(&self) -> i32 { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"minor\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `minor` getter") } } pub fn opcode(&self) -> i32 { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"opcode\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `opcode` getter") } } } #[derive(Clone, Default)] // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`X11DeviceManagerXI2`] objects. /// /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html pub struct X11DeviceManagerXI2Builder { major: Option, minor: Option, opcode: Option, display: Option, } impl X11DeviceManagerXI2Builder { // rustdoc-stripper-ignore-next /// Create a new [`X11DeviceManagerXI2Builder`]. pub fn new() -> Self { Self::default() } // rustdoc-stripper-ignore-next /// Build the [`X11DeviceManagerXI2`]. pub fn build(self) -> X11DeviceManagerXI2 { let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; if let Some(ref major) = self.major { properties.push(("major", major)); } if let Some(ref minor) = self.minor { properties.push(("minor", minor)); } if let Some(ref opcode) = self.opcode { properties.push(("opcode", opcode)); } if let Some(ref display) = self.display { properties.push(("display", display)); } glib::Object::new::(&properties) .expect("Failed to create an instance of X11DeviceManagerXI2") } pub fn major(mut self, major: i32) -> Self { self.major = Some(major); self } pub fn minor(mut self, minor: i32) -> Self { self.minor = Some(minor); self } pub fn opcode(mut self, opcode: i32) -> Self { self.opcode = Some(opcode); self } pub fn display>(mut self, display: &P) -> Self { self.display = Some(display.clone().upcast()); self } } impl fmt::Display for X11DeviceManagerXI2 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("X11DeviceManagerXI2") } } gdkx11-0.14.0/src/auto/x11_device_xi2.rs000064400000000000000000000116700072674642500156610ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::object::Cast; use glib::object::IsA; use glib::object::ObjectType as ObjectType_; use glib::translate::*; use glib::StaticType; use glib::ToValue; use std::fmt; glib::wrapper! { #[doc(alias = "GdkX11DeviceXI2")] pub struct X11DeviceXI2(Object) @extends gdk::Device; match fn { type_ => || ffi::gdk_x11_device_xi2_get_type(), } } impl X11DeviceXI2 { // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`X11DeviceXI2`] objects. /// /// This method returns an instance of [`X11DeviceXI2Builder`] which can be used to create [`X11DeviceXI2`] objects. pub fn builder() -> X11DeviceXI2Builder { X11DeviceXI2Builder::default() } #[doc(alias = "device-id")] pub fn device_id(&self) -> i32 { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"device-id\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `device-id` getter") } } } #[derive(Clone, Default)] // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`X11DeviceXI2`] objects. /// /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html pub struct X11DeviceXI2Builder { device_id: Option, device_manager: Option, display: Option, has_cursor: Option, //input-mode: /*Unknown type*/, //input-source: /*Unknown type*/, name: Option, #[cfg(any(feature = "v3_20", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))] num_touches: Option, product_id: Option, //seat: /*Unknown type*/, //type: /*Unknown type*/, vendor_id: Option, } impl X11DeviceXI2Builder { // rustdoc-stripper-ignore-next /// Create a new [`X11DeviceXI2Builder`]. pub fn new() -> Self { Self::default() } // rustdoc-stripper-ignore-next /// Build the [`X11DeviceXI2`]. pub fn build(self) -> X11DeviceXI2 { let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; if let Some(ref device_id) = self.device_id { properties.push(("device-id", device_id)); } if let Some(ref device_manager) = self.device_manager { properties.push(("device-manager", device_manager)); } if let Some(ref display) = self.display { properties.push(("display", display)); } if let Some(ref has_cursor) = self.has_cursor { properties.push(("has-cursor", has_cursor)); } if let Some(ref name) = self.name { properties.push(("name", name)); } #[cfg(any(feature = "v3_20", feature = "dox"))] if let Some(ref num_touches) = self.num_touches { properties.push(("num-touches", num_touches)); } if let Some(ref product_id) = self.product_id { properties.push(("product-id", product_id)); } if let Some(ref vendor_id) = self.vendor_id { properties.push(("vendor-id", vendor_id)); } glib::Object::new::(&properties) .expect("Failed to create an instance of X11DeviceXI2") } pub fn device_id(mut self, device_id: i32) -> Self { self.device_id = Some(device_id); self } pub fn device_manager>(mut self, device_manager: &P) -> Self { self.device_manager = Some(device_manager.clone().upcast()); self } pub fn display>(mut self, display: &P) -> Self { self.display = Some(display.clone().upcast()); self } pub fn has_cursor(mut self, has_cursor: bool) -> Self { self.has_cursor = Some(has_cursor); self } pub fn name(mut self, name: &str) -> Self { self.name = Some(name.to_string()); self } #[cfg(any(feature = "v3_20", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))] pub fn num_touches(mut self, num_touches: u32) -> Self { self.num_touches = Some(num_touches); self } pub fn product_id(mut self, product_id: &str) -> Self { self.product_id = Some(product_id.to_string()); self } pub fn vendor_id(mut self, vendor_id: &str) -> Self { self.vendor_id = Some(vendor_id.to_string()); self } } impl fmt::Display for X11DeviceXI2 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("X11DeviceXI2") } } gdkx11-0.14.0/src/auto/x11_display.rs000064400000000000000000000136160072674642500153070ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::object::IsA; use glib::translate::*; use std::fmt; use std::mem; use std::ptr; glib::wrapper! { #[doc(alias = "GdkX11Display")] pub struct X11Display(Object) @extends gdk::Display; match fn { type_ => || ffi::gdk_x11_display_get_type(), } } impl X11Display { //#[doc(alias = "gdk_x11_display_broadcast_startup_message")] //pub fn broadcast_startup_message(&self, message_type: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) { // unsafe { TODO: call ffi:gdk_x11_display_broadcast_startup_message() } //} #[doc(alias = "gdk_x11_display_error_trap_pop")] pub fn error_trap_pop(&self) -> i32 { unsafe { ffi::gdk_x11_display_error_trap_pop(self.to_glib_none().0) } } #[doc(alias = "gdk_x11_display_error_trap_pop_ignored")] pub fn error_trap_pop_ignored(&self) { unsafe { ffi::gdk_x11_display_error_trap_pop_ignored(self.to_glib_none().0); } } #[doc(alias = "gdk_x11_display_error_trap_push")] pub fn error_trap_push(&self) { unsafe { ffi::gdk_x11_display_error_trap_push(self.to_glib_none().0); } } #[doc(alias = "gdk_x11_display_get_startup_notification_id")] #[doc(alias = "get_startup_notification_id")] pub fn startup_notification_id(&self) -> Option { unsafe { from_glib_none(ffi::gdk_x11_display_get_startup_notification_id( self.to_glib_none().0, )) } } #[doc(alias = "gdk_x11_display_get_user_time")] #[doc(alias = "get_user_time")] pub fn user_time(&self) -> u32 { unsafe { ffi::gdk_x11_display_get_user_time(self.to_glib_none().0) } } #[doc(alias = "gdk_x11_display_grab")] pub fn grab(&self) { unsafe { ffi::gdk_x11_display_grab(self.to_glib_none().0); } } #[doc(alias = "gdk_x11_display_set_cursor_theme")] pub fn set_cursor_theme(&self, theme: Option<&str>, size: i32) { unsafe { ffi::gdk_x11_display_set_cursor_theme( self.to_glib_none().0, theme.to_glib_none().0, size, ); } } #[doc(alias = "gdk_x11_display_set_startup_notification_id")] pub fn set_startup_notification_id(&self, startup_id: &str) { unsafe { ffi::gdk_x11_display_set_startup_notification_id( self.to_glib_none().0, startup_id.to_glib_none().0, ); } } #[doc(alias = "gdk_x11_display_set_window_scale")] pub fn set_window_scale(&self, scale: i32) { unsafe { ffi::gdk_x11_display_set_window_scale(self.to_glib_none().0, scale); } } #[doc(alias = "gdk_x11_display_string_to_compound_text")] pub fn string_to_compound_text(&self, str: &str) -> (i32, gdk::Atom, i32, Vec) { unsafe { let mut encoding = gdk::Atom::uninitialized(); let mut format = mem::MaybeUninit::uninit(); let mut ctext = ptr::null_mut(); let mut length = mem::MaybeUninit::uninit(); let ret = ffi::gdk_x11_display_string_to_compound_text( self.to_glib_none().0, str.to_glib_none().0, encoding.to_glib_none_mut().0, format.as_mut_ptr(), &mut ctext, length.as_mut_ptr(), ); let format = format.assume_init(); ( ret, encoding, format, FromGlibContainer::from_glib_full_num(ctext, length.assume_init() as usize), ) } } #[doc(alias = "gdk_x11_display_ungrab")] pub fn ungrab(&self) { unsafe { ffi::gdk_x11_display_ungrab(self.to_glib_none().0); } } #[doc(alias = "gdk_x11_display_utf8_to_compound_text")] pub fn utf8_to_compound_text(&self, str: &str) -> Option<(gdk::Atom, i32, Vec)> { unsafe { let mut encoding = gdk::Atom::uninitialized(); let mut format = mem::MaybeUninit::uninit(); let mut ctext = ptr::null_mut(); let mut length = mem::MaybeUninit::uninit(); let ret = from_glib(ffi::gdk_x11_display_utf8_to_compound_text( self.to_glib_none().0, str.to_glib_none().0, encoding.to_glib_none_mut().0, format.as_mut_ptr(), &mut ctext, length.as_mut_ptr(), )); let format = format.assume_init(); if ret { Some(( encoding, format, FromGlibContainer::from_glib_full_num(ctext, length.assume_init() as usize), )) } else { None } } } #[doc(alias = "gdk_x11_display_get_glx_version")] #[doc(alias = "get_glx_version")] pub fn glx_version>(display: &P) -> Option<(i32, i32)> { assert_initialized_main_thread!(); unsafe { let mut major = mem::MaybeUninit::uninit(); let mut minor = mem::MaybeUninit::uninit(); let ret = from_glib(ffi::gdk_x11_display_get_glx_version( display.as_ref().to_glib_none().0, major.as_mut_ptr(), minor.as_mut_ptr(), )); let major = major.assume_init(); let minor = minor.assume_init(); if ret { Some((major, minor)) } else { None } } } } impl fmt::Display for X11Display { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("X11Display") } } gdkx11-0.14.0/src/auto/x11_display_manager.rs000064400000000000000000000011360072674642500167730ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use std::fmt; glib::wrapper! { #[doc(alias = "GdkX11DisplayManager")] pub struct X11DisplayManager(Object) @extends gdk::DisplayManager; match fn { type_ => || ffi::gdk_x11_display_manager_get_type(), } } impl X11DisplayManager {} impl fmt::Display for X11DisplayManager { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("X11DisplayManager") } } gdkx11-0.14.0/src/auto/x11_drag_context.rs000064400000000000000000000011030072674642500163070ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use std::fmt; glib::wrapper! { #[doc(alias = "GdkX11DragContext")] pub struct X11DragContext(Object) @extends gdk::DragContext; match fn { type_ => || ffi::gdk_x11_drag_context_get_type(), } } impl X11DragContext {} impl fmt::Display for X11DragContext { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("X11DragContext") } } gdkx11-0.14.0/src/auto/x11_keymap.rs000064400000000000000000000021020072674642500151140ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "GdkX11Keymap")] pub struct X11Keymap(Object) @extends gdk::Keymap; match fn { type_ => || ffi::gdk_x11_keymap_get_type(), } } impl X11Keymap { #[doc(alias = "gdk_x11_keymap_get_group_for_state")] #[doc(alias = "get_group_for_state")] pub fn group_for_state(&self, state: u32) -> i32 { unsafe { ffi::gdk_x11_keymap_get_group_for_state(self.to_glib_none().0, state) } } #[doc(alias = "gdk_x11_keymap_key_is_modifier")] pub fn key_is_modifier(&self, keycode: u32) -> bool { unsafe { from_glib(ffi::gdk_x11_keymap_key_is_modifier( self.to_glib_none().0, keycode, )) } } } impl fmt::Display for X11Keymap { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("X11Keymap") } } gdkx11-0.14.0/src/auto/x11_monitor.rs000064400000000000000000000015720072674642500153270ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::object::IsA; use glib::translate::*; use std::fmt; use x11::xlib; glib::wrapper! { #[doc(alias = "GdkX11Monitor")] pub struct X11Monitor(Object) @extends gdk::Monitor; match fn { type_ => || ffi::gdk_x11_monitor_get_type(), } } impl X11Monitor { #[doc(alias = "gdk_x11_monitor_get_output")] #[doc(alias = "get_output")] pub fn output>(monitor: &P) -> xlib::XID { assert_initialized_main_thread!(); unsafe { ffi::gdk_x11_monitor_get_output(monitor.as_ref().to_glib_none().0) } } } impl fmt::Display for X11Monitor { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("X11Monitor") } } gdkx11-0.14.0/src/auto/x11_screen.rs000064400000000000000000000066760072674642500151310ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::X11Visual; use glib::object::ObjectType as ObjectType_; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use std::boxed::Box as Box_; use std::fmt; use std::mem::transmute; use x11::xlib; glib::wrapper! { #[doc(alias = "GdkX11Screen")] pub struct X11Screen(Object) @extends gdk::Screen; match fn { type_ => || ffi::gdk_x11_screen_get_type(), } } impl X11Screen { #[doc(alias = "gdk_x11_screen_get_current_desktop")] #[doc(alias = "get_current_desktop")] pub fn current_desktop(&self) -> u32 { unsafe { ffi::gdk_x11_screen_get_current_desktop(self.to_glib_none().0) } } #[doc(alias = "gdk_x11_screen_get_monitor_output")] #[doc(alias = "get_monitor_output")] pub fn monitor_output(&self, monitor_num: i32) -> xlib::XID { unsafe { ffi::gdk_x11_screen_get_monitor_output(self.to_glib_none().0, monitor_num) } } #[doc(alias = "gdk_x11_screen_get_number_of_desktops")] #[doc(alias = "get_number_of_desktops")] pub fn number_of_desktops(&self) -> u32 { unsafe { ffi::gdk_x11_screen_get_number_of_desktops(self.to_glib_none().0) } } #[doc(alias = "gdk_x11_screen_get_screen_number")] #[doc(alias = "get_screen_number")] pub fn screen_number(&self) -> i32 { unsafe { ffi::gdk_x11_screen_get_screen_number(self.to_glib_none().0) } } #[doc(alias = "gdk_x11_screen_get_window_manager_name")] #[doc(alias = "get_window_manager_name")] pub fn window_manager_name(&self) -> Option { unsafe { from_glib_none(ffi::gdk_x11_screen_get_window_manager_name( self.to_glib_none().0, )) } } #[doc(alias = "gdk_x11_screen_lookup_visual")] pub fn lookup_visual(&self, xvisualid: xlib::VisualID) -> Option { unsafe { from_glib_none(ffi::gdk_x11_screen_lookup_visual( self.to_glib_none().0, xvisualid, )) } } #[doc(alias = "gdk_x11_screen_supports_net_wm_hint")] pub fn supports_net_wm_hint(&self, property: &gdk::Atom) -> bool { unsafe { from_glib(ffi::gdk_x11_screen_supports_net_wm_hint( self.to_glib_none().0, property.to_glib_none().0, )) } } #[doc(alias = "window-manager-changed")] pub fn connect_window_manager_changed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn window_manager_changed_trampoline( this: *mut ffi::GdkX11Screen, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"window-manager-changed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( window_manager_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl fmt::Display for X11Screen { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("X11Screen") } } gdkx11-0.14.0/src/auto/x11_visual.rs000064400000000000000000000010250072674642500151340ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use std::fmt; glib::wrapper! { #[doc(alias = "GdkX11Visual")] pub struct X11Visual(Object) @extends gdk::Visual; match fn { type_ => || ffi::gdk_x11_visual_get_type(), } } impl X11Visual {} impl fmt::Display for X11Visual { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("X11Visual") } } gdkx11-0.14.0/src/auto/x11_window.rs000064400000000000000000000072220072674642500151450ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::X11Display; use glib::object::Cast; use glib::translate::*; use std::fmt; use x11::xlib; glib::wrapper! { #[doc(alias = "GdkX11Window")] pub struct X11Window(Object) @extends gdk::Window; match fn { type_ => || ffi::gdk_x11_window_get_type(), } } impl X11Window { #[doc(alias = "gdk_x11_window_foreign_new_for_display")] pub fn foreign_new_for_display(display: &X11Display, window: xlib::Window) -> X11Window { skip_assert_initialized!(); unsafe { gdk::Window::from_glib_full(ffi::gdk_x11_window_foreign_new_for_display( display.to_glib_none().0, window, )) .unsafe_cast() } } #[doc(alias = "gdk_x11_window_get_desktop")] #[doc(alias = "get_desktop")] pub fn desktop(&self) -> u32 { unsafe { ffi::gdk_x11_window_get_desktop(self.to_glib_none().0) } } #[doc(alias = "gdk_x11_window_get_xid")] #[doc(alias = "get_xid")] pub fn xid(&self) -> xlib::Window { unsafe { ffi::gdk_x11_window_get_xid(self.to_glib_none().0) } } #[doc(alias = "gdk_x11_window_move_to_current_desktop")] pub fn move_to_current_desktop(&self) { unsafe { ffi::gdk_x11_window_move_to_current_desktop(self.to_glib_none().0); } } #[doc(alias = "gdk_x11_window_move_to_desktop")] pub fn move_to_desktop(&self, desktop: u32) { unsafe { ffi::gdk_x11_window_move_to_desktop(self.to_glib_none().0, desktop); } } #[doc(alias = "gdk_x11_window_set_frame_sync_enabled")] pub fn set_frame_sync_enabled(&self, frame_sync_enabled: bool) { unsafe { ffi::gdk_x11_window_set_frame_sync_enabled( self.to_glib_none().0, frame_sync_enabled.into_glib(), ); } } #[doc(alias = "gdk_x11_window_set_hide_titlebar_when_maximized")] pub fn set_hide_titlebar_when_maximized(&self, hide_titlebar_when_maximized: bool) { unsafe { ffi::gdk_x11_window_set_hide_titlebar_when_maximized( self.to_glib_none().0, hide_titlebar_when_maximized.into_glib(), ); } } #[doc(alias = "gdk_x11_window_set_theme_variant")] pub fn set_theme_variant(&self, variant: &str) { unsafe { ffi::gdk_x11_window_set_theme_variant(self.to_glib_none().0, variant.to_glib_none().0); } } #[doc(alias = "gdk_x11_window_set_user_time")] pub fn set_user_time(&self, timestamp: u32) { unsafe { ffi::gdk_x11_window_set_user_time(self.to_glib_none().0, timestamp); } } #[doc(alias = "gdk_x11_window_set_utf8_property")] pub fn set_utf8_property(&self, name: &str, value: Option<&str>) { unsafe { ffi::gdk_x11_window_set_utf8_property( self.to_glib_none().0, name.to_glib_none().0, value.to_glib_none().0, ); } } #[doc(alias = "gdk_x11_window_lookup_for_display")] pub fn lookup_for_display(display: &X11Display, window: xlib::Window) -> Option { skip_assert_initialized!(); unsafe { from_glib_none(ffi::gdk_x11_window_lookup_for_display( display.to_glib_none().0, window, )) } } } impl fmt::Display for X11Window { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("X11Window") } } gdkx11-0.14.0/src/auto/x11gl_context.rs000064400000000000000000000010610072674642500156400ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use std::fmt; glib::wrapper! { #[doc(alias = "GdkX11GLContext")] pub struct X11GLContext(Object) @extends gdk::GLContext; match fn { type_ => || ffi::gdk_x11_gl_context_get_type(), } } impl X11GLContext {} impl fmt::Display for X11GLContext { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("X11GLContext") } } gdkx11-0.14.0/src/lib.rs000064400000000000000000000004750072674642500127460ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. #![cfg_attr(feature = "dox", feature(doc_cfg))] #![allow(clippy::upper_case_acronyms)] pub use ffi; pub use gdk; pub use gio; pub use glib; pub use x11; #[macro_use] mod rt; #[allow(unused_imports)] mod auto; pub use crate::auto::*; gdkx11-0.14.0/src/rt.rs000064400000000000000000000021130072674642500126140ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use std::cell::Cell; use std::sync::atomic::{AtomicBool, Ordering}; thread_local! { static IS_MAIN_THREAD: Cell = Cell::new(false) } static INITIALIZED: AtomicBool = AtomicBool::new(false); macro_rules! assert_initialized_main_thread { () => { if !crate::rt::is_initialized_main_thread() { if crate::rt::is_initialized() { panic!("GDK may only be used from the main thread."); } else { panic!("GDK has not been initialized. Call `gdk::init` or `gtk::init` first."); } } }; } /// No-op. macro_rules! skip_assert_initialized { () => {}; } /// Returns `true` if GDK has been initialized. #[inline] pub fn is_initialized() -> bool { skip_assert_initialized!(); INITIALIZED.load(Ordering::Acquire) } /// Returns `true` if GDK has been initialized and this is the main thread. #[inline] pub fn is_initialized_main_thread() -> bool { skip_assert_initialized!(); IS_MAIN_THREAD.with(|c| c.get()) }