pub struct Root { /* private fields */ }Implementations§
Source§impl Root
impl Root
Sourcepub fn new(
globals: &GlobalList,
event_queue: &mut EventQueue<Root>,
bar: Option<Bar>,
) -> Result<Root>
pub fn new( globals: &GlobalList, event_queue: &mut EventQueue<Root>, bar: Option<Bar>, ) -> Result<Root>
Examples found in repository?
examples/toml_config/main.rs (line 11)
5fn main() -> Result<()> {
6 let config = Config::parse_toml("./examples/toml_config/config.toml".into())?;
7
8 let conn = Connection::connect_to_env()?;
9 let (globals, mut event_queue) = registry_queue_init(&conn)?;
10
11 let mut capybar = Root::new(&globals, &mut event_queue, None)?;
12 capybar.apply_config(config)?;
13
14 capybar.run(&mut event_queue)?;
15
16 Ok(())
17}More examples
examples/basic/main.rs (line 115)
21fn main() -> Result<(), Box<dyn std::error::Error>> {
22 let catpuccin_mocha = Palete {
23 background: Color::from_hex(0x1e1e2eff),
24 border: Color::from_hex(0x74c7ecff),
25 font: Color::from_hex(0xf5e0dcff),
26 };
27
28 let conn = Connection::connect_to_env()?;
29 let (globals, mut event_queue) = registry_queue_init(&conn)?;
30
31 let mut bar = Bar::new(
32 None,
33 BarSettings {
34 default_data: WidgetData {
35 width: 1920,
36 ..WidgetData::default()
37 },
38 padding: (10, 10, 10),
39
40 style: Style {
41 background: Some(catpuccin_mocha.background),
42 border: Some((1, catpuccin_mocha.border)),
43
44 ..Style::default()
45 },
46
47 ..BarSettings::default()
48 },
49 )?;
50
51 // Left widgets
52 bar.create_widget_left(
53 CPU::new,
54 CPUSettings {
55 update_rate: 1000,
56 text_settings: TextSettings {
57 font_color: catpuccin_mocha.font,
58 size: 25.0,
59
60 ..TextSettings::default()
61 },
62 default_data: WidgetData {
63 ..WidgetData::default()
64 },
65 style: Style {
66 margin: Margin {
67 left: 10,
68 right: 0,
69 up: 0,
70 down: 0,
71 },
72 ..Default::default()
73 },
74 ..CPUSettings::default()
75 },
76 )?;
77
78 //Center widgets
79 bar.create_widget_center(
80 Clock::new,
81 ClockSettings {
82 font_color: catpuccin_mocha.font,
83 size: 25.0,
84
85 ..ClockSettings::default()
86 },
87 )?;
88
89 // Right widgets
90 bar.create_widget_right(
91 Battery::new,
92 BatterySettings {
93 text_settings: TextSettings {
94 font_color: catpuccin_mocha.font,
95 size: 25.0,
96
97 ..TextSettings::default()
98 },
99 default_data: WidgetData {
100 ..WidgetData::default()
101 },
102 style: Style {
103 margin: Margin {
104 left: 0,
105 right: 10,
106 up: 0,
107 down: 0,
108 },
109 ..Default::default()
110 },
111 ..BatterySettings::default()
112 },
113 )?;
114
115 let mut capybar = Root::new(&globals, &mut event_queue, Some(bar))?;
116
117 // Fonts can be replaces by your liking. The first font added will be used for normal text, the
118 // second for emoji
119 //capybar.add_font_by_name("mono")?;
120 capybar.add_font_by_name("jetbrainsmononerdfont")?;
121 capybar.add_font_by_name("jetbrainsmononerdfont")?;
122
123 capybar.run(&mut event_queue)?;
124
125 Ok(())
126}Sourcepub fn apply_config(&mut self, config: Config) -> Result<()>
pub fn apply_config(&mut self, config: Config) -> Result<()>
Examples found in repository?
examples/toml_config/main.rs (line 12)
5fn main() -> Result<()> {
6 let config = Config::parse_toml("./examples/toml_config/config.toml".into())?;
7
8 let conn = Connection::connect_to_env()?;
9 let (globals, mut event_queue) = registry_queue_init(&conn)?;
10
11 let mut capybar = Root::new(&globals, &mut event_queue, None)?;
12 capybar.apply_config(config)?;
13
14 capybar.run(&mut event_queue)?;
15
16 Ok(())
17}Sourcepub fn run(&mut self, event_queue: &mut EventQueue<Root>) -> Result<&mut Self>
pub fn run(&mut self, event_queue: &mut EventQueue<Root>) -> Result<&mut Self>
Examples found in repository?
examples/toml_config/main.rs (line 14)
5fn main() -> Result<()> {
6 let config = Config::parse_toml("./examples/toml_config/config.toml".into())?;
7
8 let conn = Connection::connect_to_env()?;
9 let (globals, mut event_queue) = registry_queue_init(&conn)?;
10
11 let mut capybar = Root::new(&globals, &mut event_queue, None)?;
12 capybar.apply_config(config)?;
13
14 capybar.run(&mut event_queue)?;
15
16 Ok(())
17}More examples
examples/basic/main.rs (line 123)
21fn main() -> Result<(), Box<dyn std::error::Error>> {
22 let catpuccin_mocha = Palete {
23 background: Color::from_hex(0x1e1e2eff),
24 border: Color::from_hex(0x74c7ecff),
25 font: Color::from_hex(0xf5e0dcff),
26 };
27
28 let conn = Connection::connect_to_env()?;
29 let (globals, mut event_queue) = registry_queue_init(&conn)?;
30
31 let mut bar = Bar::new(
32 None,
33 BarSettings {
34 default_data: WidgetData {
35 width: 1920,
36 ..WidgetData::default()
37 },
38 padding: (10, 10, 10),
39
40 style: Style {
41 background: Some(catpuccin_mocha.background),
42 border: Some((1, catpuccin_mocha.border)),
43
44 ..Style::default()
45 },
46
47 ..BarSettings::default()
48 },
49 )?;
50
51 // Left widgets
52 bar.create_widget_left(
53 CPU::new,
54 CPUSettings {
55 update_rate: 1000,
56 text_settings: TextSettings {
57 font_color: catpuccin_mocha.font,
58 size: 25.0,
59
60 ..TextSettings::default()
61 },
62 default_data: WidgetData {
63 ..WidgetData::default()
64 },
65 style: Style {
66 margin: Margin {
67 left: 10,
68 right: 0,
69 up: 0,
70 down: 0,
71 },
72 ..Default::default()
73 },
74 ..CPUSettings::default()
75 },
76 )?;
77
78 //Center widgets
79 bar.create_widget_center(
80 Clock::new,
81 ClockSettings {
82 font_color: catpuccin_mocha.font,
83 size: 25.0,
84
85 ..ClockSettings::default()
86 },
87 )?;
88
89 // Right widgets
90 bar.create_widget_right(
91 Battery::new,
92 BatterySettings {
93 text_settings: TextSettings {
94 font_color: catpuccin_mocha.font,
95 size: 25.0,
96
97 ..TextSettings::default()
98 },
99 default_data: WidgetData {
100 ..WidgetData::default()
101 },
102 style: Style {
103 margin: Margin {
104 left: 0,
105 right: 10,
106 up: 0,
107 down: 0,
108 },
109 ..Default::default()
110 },
111 ..BatterySettings::default()
112 },
113 )?;
114
115 let mut capybar = Root::new(&globals, &mut event_queue, Some(bar))?;
116
117 // Fonts can be replaces by your liking. The first font added will be used for normal text, the
118 // second for emoji
119 //capybar.add_font_by_name("mono")?;
120 capybar.add_font_by_name("jetbrainsmononerdfont")?;
121 capybar.add_font_by_name("jetbrainsmononerdfont")?;
122
123 capybar.run(&mut event_queue)?;
124
125 Ok(())
126}Sourcepub fn add_font_by_name(&mut self, name: &'static str) -> Result<(), FontsError>
pub fn add_font_by_name(&mut self, name: &'static str) -> Result<(), FontsError>
Examples found in repository?
examples/basic/main.rs (line 120)
21fn main() -> Result<(), Box<dyn std::error::Error>> {
22 let catpuccin_mocha = Palete {
23 background: Color::from_hex(0x1e1e2eff),
24 border: Color::from_hex(0x74c7ecff),
25 font: Color::from_hex(0xf5e0dcff),
26 };
27
28 let conn = Connection::connect_to_env()?;
29 let (globals, mut event_queue) = registry_queue_init(&conn)?;
30
31 let mut bar = Bar::new(
32 None,
33 BarSettings {
34 default_data: WidgetData {
35 width: 1920,
36 ..WidgetData::default()
37 },
38 padding: (10, 10, 10),
39
40 style: Style {
41 background: Some(catpuccin_mocha.background),
42 border: Some((1, catpuccin_mocha.border)),
43
44 ..Style::default()
45 },
46
47 ..BarSettings::default()
48 },
49 )?;
50
51 // Left widgets
52 bar.create_widget_left(
53 CPU::new,
54 CPUSettings {
55 update_rate: 1000,
56 text_settings: TextSettings {
57 font_color: catpuccin_mocha.font,
58 size: 25.0,
59
60 ..TextSettings::default()
61 },
62 default_data: WidgetData {
63 ..WidgetData::default()
64 },
65 style: Style {
66 margin: Margin {
67 left: 10,
68 right: 0,
69 up: 0,
70 down: 0,
71 },
72 ..Default::default()
73 },
74 ..CPUSettings::default()
75 },
76 )?;
77
78 //Center widgets
79 bar.create_widget_center(
80 Clock::new,
81 ClockSettings {
82 font_color: catpuccin_mocha.font,
83 size: 25.0,
84
85 ..ClockSettings::default()
86 },
87 )?;
88
89 // Right widgets
90 bar.create_widget_right(
91 Battery::new,
92 BatterySettings {
93 text_settings: TextSettings {
94 font_color: catpuccin_mocha.font,
95 size: 25.0,
96
97 ..TextSettings::default()
98 },
99 default_data: WidgetData {
100 ..WidgetData::default()
101 },
102 style: Style {
103 margin: Margin {
104 left: 0,
105 right: 10,
106 up: 0,
107 down: 0,
108 },
109 ..Default::default()
110 },
111 ..BatterySettings::default()
112 },
113 )?;
114
115 let mut capybar = Root::new(&globals, &mut event_queue, Some(bar))?;
116
117 // Fonts can be replaces by your liking. The first font added will be used for normal text, the
118 // second for emoji
119 //capybar.add_font_by_name("mono")?;
120 capybar.add_font_by_name("jetbrainsmononerdfont")?;
121 capybar.add_font_by_name("jetbrainsmononerdfont")?;
122
123 capybar.run(&mut event_queue)?;
124
125 Ok(())
126}pub fn create_service<W, F>(
&mut self,
f: F,
settings: W::Settings,
) -> Result<()>where
W: ServiceNew + Service + 'static,
F: FnOnce(Option<Rc<Environment>>, W::Settings) -> Result<W, ServiceError>,
pub fn bar(&self) -> &Option<Bar>
Trait Implementations§
Source§impl CompositorHandler for Root
impl CompositorHandler for Root
Source§fn scale_factor_changed(
&mut self,
_conn: &Connection,
_qh: &QueueHandle<Self>,
_surface: &WlSurface,
_new_factor: i32,
)
fn scale_factor_changed( &mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _surface: &WlSurface, _new_factor: i32, )
The surface has either been moved into or out of an output and the output has a different scale factor.
Source§fn transform_changed(
&mut self,
_conn: &Connection,
_qh: &QueueHandle<Self>,
_surface: &WlSurface,
_new_transform: Transform,
)
fn transform_changed( &mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _surface: &WlSurface, _new_transform: Transform, )
The surface has either been moved into or out of an output and the output has different transform.
Source§fn frame(
&mut self,
_conn: &Connection,
qh: &QueueHandle<Self>,
_surface: &WlSurface,
_time: u32,
)
fn frame( &mut self, _conn: &Connection, qh: &QueueHandle<Self>, _surface: &WlSurface, _time: u32, )
A frame callback has been completed. Read more
Source§fn surface_enter(
&mut self,
_conn: &Connection,
_qh: &QueueHandle<Self>,
_surface: &WlSurface,
_output: &WlOutput,
)
fn surface_enter( &mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _surface: &WlSurface, _output: &WlOutput, )
The surface has entered an output.
Source§fn surface_leave(
&mut self,
_conn: &Connection,
_qh: &QueueHandle<Self>,
_surface: &WlSurface,
_output: &WlOutput,
)
fn surface_leave( &mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _surface: &WlSurface, _output: &WlOutput, )
The surface has left an output.
Source§impl Dispatch<WlCallback, WlSurface> for Root
impl Dispatch<WlCallback, WlSurface> for Root
Source§fn event(
state: &mut Self,
proxy: &WlCallback,
event: <WlCallback as Proxy>::Event,
data: &WlSurface,
conn: &Connection,
qhandle: &QueueHandle<Self>,
)
fn event( state: &mut Self, proxy: &WlCallback, event: <WlCallback as Proxy>::Event, data: &WlSurface, conn: &Connection, qhandle: &QueueHandle<Self>, )
Called when an event from the server is processed Read more
Source§fn event_created_child(
opcode: u16,
qhandle: &QueueHandle<Self>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>
Method used to initialize the user-data of objects created by events Read more
Source§impl Dispatch<WlCompositor, GlobalData> for Root
impl Dispatch<WlCompositor, GlobalData> for Root
Source§fn event(
state: &mut Self,
proxy: &WlCompositor,
event: <WlCompositor as Proxy>::Event,
data: &GlobalData,
conn: &Connection,
qhandle: &QueueHandle<Self>,
)
fn event( state: &mut Self, proxy: &WlCompositor, event: <WlCompositor as Proxy>::Event, data: &GlobalData, conn: &Connection, qhandle: &QueueHandle<Self>, )
Called when an event from the server is processed Read more
Source§fn event_created_child(
opcode: u16,
qhandle: &QueueHandle<Self>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>
Method used to initialize the user-data of objects created by events Read more
Source§impl Dispatch<WlKeyboard, KeyboardData<Root>> for Root
impl Dispatch<WlKeyboard, KeyboardData<Root>> for Root
Source§fn event(
state: &mut Self,
proxy: &WlKeyboard,
event: <WlKeyboard as Proxy>::Event,
data: &KeyboardData<Root>,
conn: &Connection,
qhandle: &QueueHandle<Self>,
)
fn event( state: &mut Self, proxy: &WlKeyboard, event: <WlKeyboard as Proxy>::Event, data: &KeyboardData<Root>, conn: &Connection, qhandle: &QueueHandle<Self>, )
Called when an event from the server is processed Read more
Source§fn event_created_child(
opcode: u16,
qhandle: &QueueHandle<Self>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>
Method used to initialize the user-data of objects created by events Read more
Source§impl Dispatch<WlOutput, OutputData> for Root
impl Dispatch<WlOutput, OutputData> for Root
Source§fn event(
state: &mut Self,
proxy: &WlOutput,
event: <WlOutput as Proxy>::Event,
data: &OutputData,
conn: &Connection,
qhandle: &QueueHandle<Self>,
)
fn event( state: &mut Self, proxy: &WlOutput, event: <WlOutput as Proxy>::Event, data: &OutputData, conn: &Connection, qhandle: &QueueHandle<Self>, )
Called when an event from the server is processed Read more
Source§fn event_created_child(
opcode: u16,
qhandle: &QueueHandle<Self>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>
Method used to initialize the user-data of objects created by events Read more
Source§impl Dispatch<WlPointer, PointerData> for Root
impl Dispatch<WlPointer, PointerData> for Root
Source§fn event(
state: &mut Self,
proxy: &WlPointer,
event: <WlPointer as Proxy>::Event,
data: &PointerData,
conn: &Connection,
qhandle: &QueueHandle<Self>,
)
fn event( state: &mut Self, proxy: &WlPointer, event: <WlPointer as Proxy>::Event, data: &PointerData, conn: &Connection, qhandle: &QueueHandle<Self>, )
Called when an event from the server is processed Read more
Source§fn event_created_child(
opcode: u16,
qhandle: &QueueHandle<Self>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>
Method used to initialize the user-data of objects created by events Read more
Source§impl Dispatch<WlRegistry, GlobalListContents> for Root
impl Dispatch<WlRegistry, GlobalListContents> for Root
Source§fn event(
state: &mut Self,
proxy: &WlRegistry,
event: <WlRegistry as Proxy>::Event,
data: &GlobalListContents,
conn: &Connection,
qhandle: &QueueHandle<Self>,
)
fn event( state: &mut Self, proxy: &WlRegistry, event: <WlRegistry as Proxy>::Event, data: &GlobalListContents, conn: &Connection, qhandle: &QueueHandle<Self>, )
Called when an event from the server is processed Read more
Source§fn event_created_child(
opcode: u16,
qhandle: &QueueHandle<Self>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>
Method used to initialize the user-data of objects created by events Read more
Source§impl Dispatch<WlSeat, SeatData> for Root
impl Dispatch<WlSeat, SeatData> for Root
Source§fn event(
state: &mut Self,
proxy: &WlSeat,
event: <WlSeat as Proxy>::Event,
data: &SeatData,
conn: &Connection,
qhandle: &QueueHandle<Self>,
)
fn event( state: &mut Self, proxy: &WlSeat, event: <WlSeat as Proxy>::Event, data: &SeatData, conn: &Connection, qhandle: &QueueHandle<Self>, )
Called when an event from the server is processed Read more
Source§fn event_created_child(
opcode: u16,
qhandle: &QueueHandle<Self>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>
Method used to initialize the user-data of objects created by events Read more
Source§impl Dispatch<WlShm, GlobalData> for Root
impl Dispatch<WlShm, GlobalData> for Root
Source§fn event(
state: &mut Self,
proxy: &WlShm,
event: <WlShm as Proxy>::Event,
data: &GlobalData,
conn: &Connection,
qhandle: &QueueHandle<Self>,
)
fn event( state: &mut Self, proxy: &WlShm, event: <WlShm as Proxy>::Event, data: &GlobalData, conn: &Connection, qhandle: &QueueHandle<Self>, )
Called when an event from the server is processed Read more
Source§fn event_created_child(
opcode: u16,
qhandle: &QueueHandle<Self>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>
Method used to initialize the user-data of objects created by events Read more
Source§impl Dispatch<WlSurface, SurfaceData> for Root
impl Dispatch<WlSurface, SurfaceData> for Root
Source§fn event(
state: &mut Self,
proxy: &WlSurface,
event: <WlSurface as Proxy>::Event,
data: &SurfaceData,
conn: &Connection,
qhandle: &QueueHandle<Self>,
)
fn event( state: &mut Self, proxy: &WlSurface, event: <WlSurface as Proxy>::Event, data: &SurfaceData, conn: &Connection, qhandle: &QueueHandle<Self>, )
Called when an event from the server is processed Read more
Source§fn event_created_child(
opcode: u16,
qhandle: &QueueHandle<Self>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>
Method used to initialize the user-data of objects created by events Read more
Source§impl Dispatch<WpCursorShapeDeviceV1, GlobalData> for Root
impl Dispatch<WpCursorShapeDeviceV1, GlobalData> for Root
Source§fn event(
state: &mut Self,
proxy: &WpCursorShapeDeviceV1,
event: <WpCursorShapeDeviceV1 as Proxy>::Event,
data: &GlobalData,
conn: &Connection,
qhandle: &QueueHandle<Self>,
)
fn event( state: &mut Self, proxy: &WpCursorShapeDeviceV1, event: <WpCursorShapeDeviceV1 as Proxy>::Event, data: &GlobalData, conn: &Connection, qhandle: &QueueHandle<Self>, )
Called when an event from the server is processed Read more
Source§fn event_created_child(
opcode: u16,
qhandle: &QueueHandle<Self>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>
Method used to initialize the user-data of objects created by events Read more
Source§impl Dispatch<WpCursorShapeManagerV1, GlobalData> for Root
impl Dispatch<WpCursorShapeManagerV1, GlobalData> for Root
Source§fn event(
state: &mut Self,
proxy: &WpCursorShapeManagerV1,
event: <WpCursorShapeManagerV1 as Proxy>::Event,
data: &GlobalData,
conn: &Connection,
qhandle: &QueueHandle<Self>,
)
fn event( state: &mut Self, proxy: &WpCursorShapeManagerV1, event: <WpCursorShapeManagerV1 as Proxy>::Event, data: &GlobalData, conn: &Connection, qhandle: &QueueHandle<Self>, )
Called when an event from the server is processed Read more
Source§fn event_created_child(
opcode: u16,
qhandle: &QueueHandle<Self>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>
Method used to initialize the user-data of objects created by events Read more
Source§impl Dispatch<ZwlrLayerShellV1, GlobalData> for Root
impl Dispatch<ZwlrLayerShellV1, GlobalData> for Root
Source§fn event(
state: &mut Self,
proxy: &ZwlrLayerShellV1,
event: <ZwlrLayerShellV1 as Proxy>::Event,
data: &GlobalData,
conn: &Connection,
qhandle: &QueueHandle<Self>,
)
fn event( state: &mut Self, proxy: &ZwlrLayerShellV1, event: <ZwlrLayerShellV1 as Proxy>::Event, data: &GlobalData, conn: &Connection, qhandle: &QueueHandle<Self>, )
Called when an event from the server is processed Read more
Source§fn event_created_child(
opcode: u16,
qhandle: &QueueHandle<Self>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>
Method used to initialize the user-data of objects created by events Read more
Source§impl Dispatch<ZwlrLayerSurfaceV1, LayerSurfaceData> for Root
impl Dispatch<ZwlrLayerSurfaceV1, LayerSurfaceData> for Root
Source§fn event(
state: &mut Self,
proxy: &ZwlrLayerSurfaceV1,
event: <ZwlrLayerSurfaceV1 as Proxy>::Event,
data: &LayerSurfaceData,
conn: &Connection,
qhandle: &QueueHandle<Self>,
)
fn event( state: &mut Self, proxy: &ZwlrLayerSurfaceV1, event: <ZwlrLayerSurfaceV1 as Proxy>::Event, data: &LayerSurfaceData, conn: &Connection, qhandle: &QueueHandle<Self>, )
Called when an event from the server is processed Read more
Source§fn event_created_child(
opcode: u16,
qhandle: &QueueHandle<Self>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>
Method used to initialize the user-data of objects created by events Read more
Source§impl Dispatch<ZxdgOutputManagerV1, GlobalData> for Root
impl Dispatch<ZxdgOutputManagerV1, GlobalData> for Root
Source§fn event(
state: &mut Self,
proxy: &ZxdgOutputManagerV1,
event: <ZxdgOutputManagerV1 as Proxy>::Event,
data: &GlobalData,
conn: &Connection,
qhandle: &QueueHandle<Self>,
)
fn event( state: &mut Self, proxy: &ZxdgOutputManagerV1, event: <ZxdgOutputManagerV1 as Proxy>::Event, data: &GlobalData, conn: &Connection, qhandle: &QueueHandle<Self>, )
Called when an event from the server is processed Read more
Source§fn event_created_child(
opcode: u16,
qhandle: &QueueHandle<Self>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>
Method used to initialize the user-data of objects created by events Read more
Source§impl Dispatch<ZxdgOutputV1, OutputData> for Root
impl Dispatch<ZxdgOutputV1, OutputData> for Root
Source§fn event(
state: &mut Self,
proxy: &ZxdgOutputV1,
event: <ZxdgOutputV1 as Proxy>::Event,
data: &OutputData,
conn: &Connection,
qhandle: &QueueHandle<Self>,
)
fn event( state: &mut Self, proxy: &ZxdgOutputV1, event: <ZxdgOutputV1 as Proxy>::Event, data: &OutputData, conn: &Connection, qhandle: &QueueHandle<Self>, )
Called when an event from the server is processed Read more
Source§fn event_created_child(
opcode: u16,
qhandle: &QueueHandle<Self>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, qhandle: &QueueHandle<Self>, ) -> Arc<dyn ObjectData>
Method used to initialize the user-data of objects created by events Read more
Source§impl KeyboardHandler for Root
impl KeyboardHandler for Root
Source§fn enter(
&mut self,
_: &Connection,
_: &QueueHandle<Self>,
_: &WlKeyboard,
surface: &WlSurface,
_: u32,
_: &[u32],
_: &[Keysym],
)
fn enter( &mut self, _: &Connection, _: &QueueHandle<Self>, _: &WlKeyboard, surface: &WlSurface, _: u32, _: &[u32], _: &[Keysym], )
The keyboard has entered a surface. Read more
Source§fn leave(
&mut self,
_: &Connection,
_: &QueueHandle<Self>,
_: &WlKeyboard,
surface: &WlSurface,
_: u32,
)
fn leave( &mut self, _: &Connection, _: &QueueHandle<Self>, _: &WlKeyboard, surface: &WlSurface, _: u32, )
The keyboard has left a surface. Read more
Source§fn press_key(
&mut self,
_conn: &Connection,
_qh: &QueueHandle<Self>,
_: &WlKeyboard,
_: u32,
_: KeyEvent,
)
fn press_key( &mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _: &WlKeyboard, _: u32, _: KeyEvent, )
A key has been pressed on the keyboard. Read more
Source§fn release_key(
&mut self,
_: &Connection,
_: &QueueHandle<Self>,
_: &WlKeyboard,
_: u32,
_: KeyEvent,
)
fn release_key( &mut self, _: &Connection, _: &QueueHandle<Self>, _: &WlKeyboard, _: u32, _: KeyEvent, )
A key has been released. Read more
Source§fn update_modifiers(
&mut self,
_: &Connection,
_: &QueueHandle<Self>,
_: &WlKeyboard,
_serial: u32,
_: Modifiers,
_layout: u32,
)
fn update_modifiers( &mut self, _: &Connection, _: &QueueHandle<Self>, _: &WlKeyboard, _serial: u32, _: Modifiers, _layout: u32, )
Keyboard modifiers have been updated. Read more
Source§fn update_repeat_info(
&mut self,
_conn: &Connection,
_qh: &QueueHandle<Self>,
_keyboard: &WlKeyboard,
_info: RepeatInfo,
)
fn update_repeat_info( &mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _keyboard: &WlKeyboard, _info: RepeatInfo, )
The keyboard has updated the rate and delay between repeating key inputs. Read more
Source§fn update_keymap(
&mut self,
_conn: &Connection,
_qh: &QueueHandle<Self>,
_keyboard: &WlKeyboard,
_keymap: Keymap<'_>,
)
fn update_keymap( &mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _keyboard: &WlKeyboard, _keymap: Keymap<'_>, )
Keyboard keymap has been updated. Read more
Source§impl LayerShellHandler for Root
impl LayerShellHandler for Root
Source§fn closed(
&mut self,
_conn: &Connection,
_qh: &QueueHandle<Self>,
_layer: &LayerSurface,
)
fn closed( &mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _layer: &LayerSurface, )
The layer surface has been closed. Read more
Source§fn configure(
&mut self,
_conn: &Connection,
qh: &QueueHandle<Self>,
_layer: &LayerSurface,
configure: LayerSurfaceConfigure,
_serial: u32,
)
fn configure( &mut self, _conn: &Connection, qh: &QueueHandle<Self>, _layer: &LayerSurface, configure: LayerSurfaceConfigure, _serial: u32, )
Apply a suggested surface change. Read more
Source§impl OutputHandler for Root
impl OutputHandler for Root
fn output_state(&mut self) -> &mut OutputState
Source§fn new_output(
&mut self,
_conn: &Connection,
_qh: &QueueHandle<Self>,
_output: WlOutput,
)
fn new_output( &mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _output: WlOutput, )
A new output has been advertised.
Source§fn update_output(
&mut self,
_conn: &Connection,
_qh: &QueueHandle<Self>,
_output: WlOutput,
)
fn update_output( &mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _output: WlOutput, )
An existing output has changed.
Source§fn output_destroyed(
&mut self,
_conn: &Connection,
_qh: &QueueHandle<Self>,
_output: WlOutput,
)
fn output_destroyed( &mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _output: WlOutput, )
An output is no longer advertised. Read more
Source§impl PointerHandler for Root
impl PointerHandler for Root
Source§fn pointer_frame(
&mut self,
_conn: &Connection,
_qh: &QueueHandle<Self>,
_pointer: &WlPointer,
events: &[PointerEvent],
)
fn pointer_frame( &mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _pointer: &WlPointer, events: &[PointerEvent], )
One or more pointer events are available. Read more
Source§impl ProvidesRegistryState for Root
impl ProvidesRegistryState for Root
Source§fn registry(&mut self) -> &mut RegistryState
fn registry(&mut self) -> &mut RegistryState
Returns a mutable reference to the registry state.
Source§fn runtime_add_global(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
name: u32,
interface: &str,
version: u32,
)
fn runtime_add_global( &mut self, conn: &Connection, qh: &QueueHandle<Self>, name: u32, interface: &str, version: u32, )
Called when a new global has been advertised by the compositor. Read more
Source§fn runtime_remove_global(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
name: u32,
interface: &str,
)
fn runtime_remove_global( &mut self, conn: &Connection, qh: &QueueHandle<Self>, name: u32, interface: &str, )
Called when a global has been destroyed by the compositor.
Source§impl SeatHandler for Root
impl SeatHandler for Root
fn seat_state(&mut self) -> &mut SeatState
Source§fn new_seat(&mut self, _: &Connection, _: &QueueHandle<Self>, _: WlSeat)
fn new_seat(&mut self, _: &Connection, _: &QueueHandle<Self>, _: WlSeat)
A new seat has been created. Read more
Source§fn new_capability(
&mut self,
_conn: &Connection,
qh: &QueueHandle<Self>,
seat: WlSeat,
capability: Capability,
)
fn new_capability( &mut self, _conn: &Connection, qh: &QueueHandle<Self>, seat: WlSeat, capability: Capability, )
A new capability is available on the seat. Read more
Source§fn remove_capability(
&mut self,
_conn: &Connection,
_: &QueueHandle<Self>,
_: WlSeat,
capability: Capability,
)
fn remove_capability( &mut self, _conn: &Connection, _: &QueueHandle<Self>, _: WlSeat, capability: Capability, )
A capability has been removed from the seat. Read more
Source§fn remove_seat(&mut self, _: &Connection, _: &QueueHandle<Self>, _: WlSeat)
fn remove_seat(&mut self, _: &Connection, _: &QueueHandle<Self>, _: WlSeat)
A seat has been removed. Read more
Auto Trait Implementations§
impl !Freeze for Root
impl !RefUnwindSafe for Root
impl !Send for Root
impl !Sync for Root
impl !UnwindSafe for Root
impl Unpin for Root
impl UnsafeUnpin for Root
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more