Module penrose_ui::core
source · Expand description
The core Draw
and Context
structs for rendering UI elements.
Module penrose_ui::core
source · Expand description
The core Draw
and Context
structs for rendering UI elements.
If you are only interested in adding functionality to the penrose StatusBar then you
do not need to worry about the use and implementation of Draw
and Context
: the abstractions
provided by the Widget trait should be sufficient for your needs. If however you wish
diff --git a/rustdoc/penrose_ui/core/struct.Context.html b/rustdoc/penrose_ui/core/struct.Context.html
index 722acc5e..112d9853 100644
--- a/rustdoc/penrose_ui/core/struct.Context.html
+++ b/rustdoc/penrose_ui/core/struct.Context.html
@@ -9,7 +9,7 @@
handles rendering child widgets for a real example of how to make use of the offseting
functionality of this struct.
Implementations§
source§impl<'a> Context<'a>
impl<'a> Context<'a>
sourcepub fn clear(&mut self) -> Result<()>
pub fn clear(&mut self) -> Result<()>
Clear the underlying surface, restoring it to the background color.
+Implementations§
source§impl<'a> Context<'a>
impl<'a> Context<'a>
sourcepub fn clear(&mut self) -> Result<()>
pub fn clear(&mut self) -> Result<()>
Clear the underlying surface, restoring it to the background color.
sourcepub fn translate(&mut self, dx: i32, dy: i32)
pub fn translate(&mut self, dx: i32, dy: i32)
Offset future drawing operations by an additional (dx, dy)
sourcepub fn reset_offset(&mut self)
pub fn reset_offset(&mut self)
Set future drawing operations to apply from the origin.
sourcepub fn set_x_offset(&mut self, x: i32)
pub fn set_x_offset(&mut self, x: i32)
Set an absolute x offset for future drawing operations.
@@ -18,15 +18,15 @@sourcepub fn fill_rect(&mut self, _: Rect, color: Color) -> Result<()>
pub fn fill_rect(&mut self, _: Rect, color: Color) -> Result<()>
Render a filled rectangle using the supplied color.
sourcepub fn fill_polygon(&mut self, points: &[Point], color: Color) -> Result<()>
pub fn fill_polygon(&mut self, points: &[Point], color: Color) -> Result<()>
Render a filled rectangle using the supplied color.
sourcepub fn draw_text(
&mut self,
txt: &str,
h_offset: u32,
padding: (u32, u32),
c: Color
) -> Result<(u32, u32)>
pub fn draw_text( &mut self, txt: &str, h_offset: u32, padding: (u32, u32), c: Color ) -> Result<(u32, u32)>
Render the provided text at the current context offset using the supplied color.
-sourcepub fn text_extent(&mut self, txt: &str) -> Result<(u32, u32)>
pub fn text_extent(&mut self, txt: &str) -> Result<(u32, u32)>
Determine the width and height taken up by a given string in pixels.
-Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Context<'a>
impl<'a> RefUnwindSafe for Context<'a>
impl<'a> !Send for Context<'a>
impl<'a> !Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> !UnwindSafe for Context<'a>
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/rustdoc/src/penrose_ui/core/fontset.rs.html b/rustdoc/src/penrose_ui/core/fontset.rs.html
index c62d90d9..7cdb98bf 100644
--- a/rustdoc/src/penrose_ui/core/fontset.rs.html
+++ b/rustdoc/src/penrose_ui/core/fontset.rs.html
@@ -267,6 +267,9 @@ Files
265
266
267
+268
+269
+270
impl<T> Any for Twhere
diff --git a/rustdoc/src/penrose_ui/core/fontset.rs.html b/rustdoc/src/penrose_ui/core/fontset.rs.html
index c62d90d9..7cdb98bf 100644
--- a/rustdoc/src/penrose_ui/core/fontset.rs.html
+++ b/rustdoc/src/penrose_ui/core/fontset.rs.html
@@ -267,6 +267,9 @@ Files
265
266
267
+268
+269
+270
Files
use crate::{core::SCREEN, Error, Result};
use fontconfig_sys::{
constants::{FC_CHARSET, FC_SCALABLE},
@@ -385,7 +388,7 @@ Files