swayipc_command_builder/commands/
focus.rs

1use super::*;
2
3impl Command<Valid<Focus>> {
4    pub fn up(self) -> Command<Valid> {
5        self.push_str("up").transmute()
6    }
7
8    pub fn right(self) -> Command<Valid> {
9        self.push_str("right").transmute()
10    }
11
12    pub fn down(self) -> Command<Valid> {
13        self.push_str("down").transmute()
14    }
15
16    pub fn left(self) -> Command<Valid> {
17        self.push_str("left").transmute()
18    }
19
20    pub fn prev(self) -> Command<Valid<Focus<With>>> {
21        self.push_str("prev").transmute()
22    }
23
24    pub fn next(self) -> Command<Valid<Focus<With>>> {
25        self.push_str("next").transmute()
26    }
27
28    pub fn child(self) -> Command<Valid> {
29        self.push_str("child").transmute()
30    }
31
32    pub fn parent(self) -> Command<Valid> {
33        self.push_str("parent").transmute()
34    }
35
36    pub fn output(self) -> Command<Focus<Output>> {
37        self.push_str("output").transmute()
38    }
39
40    //FIXME: sway(5)
41    pub fn tiling(self) -> Command<Valid> {
42        self.push_str("tiling").transmute()
43    }
44
45    //FIXME: sway(5)
46    pub fn mode_toggle(self) -> Command<Valid> {
47        self.push_str("mode_toggle").transmute()
48    }
49
50    pub fn floating(self) -> Command<Valid> {
51        self.push_str("floating").transmute()
52    }
53}
54
55impl Command<Valid<Focus<With>>> {
56    pub fn sibling(self) -> Command<Valid> {
57        self.push_str("sibling").transmute()
58    }
59}
60
61impl Command<Valid<Focus<Output>>> {
62    pub fn name(self, name: impl AsRef<str>) -> Command<Valid> {
63        self.push_str(name).transmute()
64    }
65
66    pub fn up(self) -> Command<Valid> {
67        self.push_str("up").transmute()
68    }
69
70    pub fn right(self) -> Command<Valid> {
71        self.push_str("right").transmute()
72    }
73
74    pub fn down(self) -> Command<Valid> {
75        self.push_str("down").transmute()
76    }
77
78    pub fn left(self) -> Command<Valid> {
79        self.push_str("left").transmute()
80    }
81}