blob: c8578b74706530d440c2b1a8d357cb704aa7891b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
use std::sync::mpsc::*;
use crate::runnable::*;
use swaystatus_plugin::*;
pub enum MessagesFromMain {
Quit,
Refresh
}
pub struct SenderForMain {
sender : Sender<MessagesFromMain>,
pulse_loop : std::sync::Arc<PulseMainLoop>
}
impl<'p> SenderForMain {
pub fn new(sender : Sender<MessagesFromMain>, pulse_loop : std::sync::Arc<PulseMainLoop>) -> Self {
SenderForMain{
sender,
pulse_loop
}
}
fn send(&self, message : MessagesFromMain) -> Result<(), PluginCommunicationError>
{
//TODO!!!!
Ok(())
}
}
impl MsgMainToModule for SenderForMain {
fn send_quit(&self) -> Result<(), PluginCommunicationError> {
self.send(MessagesFromMain::Quit)
}
fn send_refresh(&self) -> Result<(), PluginCommunicationError> {
self.send(MessagesFromMain::Refresh)
}
}
|