Struct winit::platform_impl::platform::x11::xdisplay::XConnection
source · pub(crate) struct XConnection {
pub xlib: Xlib,
pub xrandr: Xrandr_2_2_0,
pub xcursor: Xcursor,
pub xinput2: XInput2,
pub xlib_xcb: Xlib_xcb,
pub display: *mut Display,
pub x11_fd: c_int,
pub latest_error: Mutex<Option<XError>>,
pub cursor_cache: Mutex<HashMap<Option<CursorIcon>, Cursor>>,
}
Expand description
A connection to an X server.
Fields§
§xlib: Xlib
§xrandr: Xrandr_2_2_0
Exposes XRandR functions from version < 1.5
xcursor: Xcursor
§xinput2: XInput2
§xlib_xcb: Xlib_xcb
§display: *mut Display
§x11_fd: c_int
§latest_error: Mutex<Option<XError>>
§cursor_cache: Mutex<HashMap<Option<CursorIcon>, Cursor>>
Implementations§
source§impl XConnection
impl XConnection
pub fn get_monitor_for_window( &self, window_rect: Option<AaRect> ) -> MonitorHandle
fn query_monitor_list(&self) -> Vec<MonitorHandle>
pub fn available_monitors(&self) -> Vec<MonitorHandle>
pub fn primary_monitor(&self) -> MonitorHandle
pub fn select_xrandr_input(&self, root: Window) -> Result<c_int, XError>
source§impl XConnection
impl XConnection
source§impl XConnection
impl XConnection
source§impl XConnection
impl XConnection
pub fn set_cursor_icon(&self, window: Window, cursor: Option<CursorIcon>)
fn create_empty_cursor(&self) -> Cursor
fn load_cursor(&self, name: &[u8]) -> Cursor
fn load_first_existing_cursor(&self, names: &[&[u8]]) -> Cursor
fn get_cursor(&self, cursor: Option<CursorIcon>) -> Cursor
fn update_cursor(&self, window: Window, cursor: Cursor)
source§impl XConnection
impl XConnection
pub fn translate_coords( &self, window: Window, root: Window ) -> Result<TranslatedCoords, XError>
pub fn get_geometry(&self, window: Window) -> Result<Geometry, XError>
fn get_frame_extents(&self, window: Window) -> Option<FrameExtents>
pub fn is_top_level(&self, window: Window, root: Window) -> Option<bool>
fn get_parent_window(&self, window: Window) -> Result<Window, XError>
fn climb_hierarchy( &self, window: Window, root: Window ) -> Result<Window, XError>
pub fn get_frame_extents_heuristic( &self, window: Window, root: Window ) -> FrameExtentsHeuristic
source§impl XConnection
impl XConnection
pub fn get_wm_hints( &self, window: Window ) -> Result<XSmartPointer<'_, XWMHints>, XError>
pub fn set_wm_hints( &self, window: Window, wm_hints: XSmartPointer<'_, XWMHints> ) -> Flusher<'_>
pub fn get_normal_hints( &self, window: Window ) -> Result<NormalHints<'_>, XError>
pub fn set_normal_hints( &self, window: Window, normal_hints: NormalHints<'_> ) -> Flusher<'_>
pub fn get_motif_hints(&self, window: Window) -> MotifHints
pub fn set_motif_hints(&self, window: Window, hints: &MotifHints) -> Flusher<'_>
source§impl XConnection
impl XConnection
pub fn select_xinput_events( &self, window: c_ulong, device_id: c_int, mask: i32 ) -> Flusher<'_>
pub fn select_xkb_events( &self, device_id: c_uint, mask: c_ulong ) -> Option<Flusher<'_>>
pub fn query_pointer( &self, window: Window, device_id: c_int ) -> Result<PointerState<'_>, XError>
fn lookup_utf8_inner( &self, ic: XIC, key_event: &mut XKeyEvent, buffer: *mut u8, size: usize ) -> (KeySym, Status, c_int)
pub fn lookup_utf8(&self, ic: XIC, key_event: &mut XKeyEvent) -> String
source§impl XConnection
impl XConnection
pub fn keycode_to_keysym(&self, keycode: KeyCode) -> KeySym
pub fn lookup_keysym(&self, xkev: &mut XKeyEvent) -> KeySym
pub fn query_keymap(&self) -> Keymap
source§impl XConnection
impl XConnection
pub fn alloc_class_hint(&self) -> XSmartPointer<'_, XClassHint>
pub fn alloc_size_hints(&self) -> XSmartPointer<'_, XSizeHints>
pub fn alloc_wm_hints(&self) -> XSmartPointer<'_, XWMHints>
source§impl XConnection
impl XConnection
pub unsafe fn get_xft_dpi(&self) -> Option<f64>
pub unsafe fn get_output_info( &self, resources: *mut XRRScreenResources, crtc: *mut XRRCrtcInfo ) -> Option<(String, f64, Vec<VideoMode>)>
pub fn set_crtc_config(&self, crtc_id: RRCrtc, mode_id: RRMode) -> Option<()>
pub fn get_crtc_mode(&self, crtc_id: RRCrtc) -> RRMode
source§impl XConnection
impl XConnection
pub fn get_property<T: Formattable>( &self, window: c_ulong, property: Atom, property_type: Atom ) -> Result<Vec<T>, GetPropertyError>
pub fn change_property<'a, T: Formattable>( &'a self, window: c_ulong, property: Atom, property_type: Atom, mode: PropMode, new_value: &[T] ) -> Flusher<'a>
source§impl XConnection
impl XConnection
pub fn update_cached_wm_info(&self, root: Window)
fn get_supported_hints(&self, root: Window) -> Vec<Atom>
fn get_wm_name(&self, root: Window) -> Option<String>
source§impl XConnection
impl XConnection
pub fn flush_requests(&self) -> Result<(), XError>
pub fn sync_with_server(&self) -> Result<(), XError>
source§impl XConnection
impl XConnection
pub fn new( error_handler: Option<unsafe extern "C" fn(_: *mut Display, _: *mut XErrorEvent) -> c_int> ) -> Result<XConnection, XNotSupported>
sourcepub fn check_errors(&self) -> Result<(), XError>
pub fn check_errors(&self) -> Result<(), XError>
Checks whether an error has been triggered by the previous function calls.
Trait Implementations§
source§impl Debug for XConnection
impl Debug for XConnection
source§impl Drop for XConnection
impl Drop for XConnection
impl Send for XConnection
impl Sync for XConnection
Auto Trait Implementations§
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more