From 960663d476d8a1391b8bcc4424f3f716147068ab Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Wed, 11 Nov 2026 21:03:30 -0700 Subject: all the xcb wrapper types are in individual files now the trait inheritance structure isn't THAT convoluted, but having more than one of these in a file was obscuring things. Change-Id: I5132a6304796654d778d731be1ecb1c7b4e77120 Force-Push: yes --- src/xcolor.rs | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 src/xcolor.rs (limited to 'src/xcolor.rs') diff --git a/src/xcolor.rs b/src/xcolor.rs deleted file mode 100644 index 0fab0c8..0000000 --- a/src/xcolor.rs +++ /dev/null @@ -1,46 +0,0 @@ -/* Color management in X has become an obscure topic because everyone prefers - * to assume they have 24-bit direct. In dealing with it, [1] has been an - * important resource. - * - * [1] https://xcb.freedesktop.org/xlibtoxcbtranslationguide/ - */ -use crate::xtypes::*; - -use xcb::x::{ AllocColor, Visualtype }; - - -pub trait DisplayColorExt: DisplayExt { - /* This is sufficiently obscure knowledge that it's worth keeping here - * even though it's unused. - */ - #[allow(dead_code)] - fn find_root_visual(&self) -> Option<&Visualtype> { - let visual_id = self.screen().root_visual(); - - for depth in self.screen().allowed_depths() { - for visual in depth.visuals() { - if visual_id == visual.visual_id() { - return Some(visual); - } - } - } - - None - } - - fn allocate_color(&self, red: u16, green: u16, blue: u16) - -> xcb::Result - { - let colormap = self.screen().default_colormap(); - - let cookie = self.send_request(&AllocColor { - cmap: colormap, - red, green, blue, - }); - - Ok(self.wait_for_reply(cookie)?.pixel()) - } -} - -impl DisplayColorExt for T { } - -- cgit 1.4.1