diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-11 07:41:22 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-11 07:41:22 (GMT) |
commit | 9f2f65a698c4cc71373a7fe9d73a0889e0d3487b (patch) | |
tree | 4ad67db771d73ea3c48f80a1244037fc9754edd2 /src/WorkspaceCmd.hh | |
parent | 1f01d84c080d607a91eb417efcaf5e500b5f1d7e (diff) | |
download | fluxbox-9f2f65a698c4cc71373a7fe9d73a0889e0d3487b.zip fluxbox-9f2f65a698c4cc71373a7fe9d73a0889e0d3487b.tar.bz2 |
make FbTk::Command a template class, split parsing information out of ObjectRegistry
Diffstat (limited to 'src/WorkspaceCmd.hh')
-rw-r--r-- | src/WorkspaceCmd.hh | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/WorkspaceCmd.hh b/src/WorkspaceCmd.hh index f094894..d50c0bf 100644 --- a/src/WorkspaceCmd.hh +++ b/src/WorkspaceCmd.hh | |||
@@ -28,45 +28,45 @@ | |||
28 | #include "ClientPattern.hh" | 28 | #include "ClientPattern.hh" |
29 | #include "FocusControl.hh" | 29 | #include "FocusControl.hh" |
30 | 30 | ||
31 | class WindowListCmd: public FbTk::Command { | 31 | class WindowListCmd: public FbTk::Command<void> { |
32 | public: | 32 | public: |
33 | WindowListCmd(FbTk::RefCount<FbTk::Command> cmd, int opts, | 33 | WindowListCmd(FbTk::RefCount<FbTk::Command<void> > cmd, int opts, |
34 | FbTk::RefCount<FbTk::BoolCommand> filter): | 34 | FbTk::RefCount<FbTk::Command<bool> > filter): |
35 | m_cmd(cmd), m_opts(opts), m_filter(filter) { } | 35 | m_cmd(cmd), m_opts(opts), m_filter(filter) { } |
36 | 36 | ||
37 | void execute(); | 37 | void execute(); |
38 | static FbTk::Command *parse(const std::string &command, | 38 | static FbTk::Command<void> *parse(const std::string &command, |
39 | const std::string &args, bool trusted); | 39 | const std::string &args, bool trusted); |
40 | 40 | ||
41 | private: | 41 | private: |
42 | FbTk::RefCount<FbTk::Command> m_cmd; | 42 | FbTk::RefCount<FbTk::Command<void> > m_cmd; |
43 | int m_opts; | 43 | int m_opts; |
44 | FbTk::RefCount<FbTk::BoolCommand> m_filter; | 44 | FbTk::RefCount<FbTk::Command<bool> > m_filter; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | class SomeCmd: public FbTk::BoolCommand { | 47 | class SomeCmd: public FbTk::Command<bool> { |
48 | public: | 48 | public: |
49 | SomeCmd(FbTk::RefCount<FbTk::BoolCommand> cmd): m_cmd(cmd) { } | 49 | SomeCmd(FbTk::RefCount<FbTk::Command<bool> > cmd): m_cmd(cmd) { } |
50 | 50 | ||
51 | bool bool_execute(); | 51 | bool execute(); |
52 | static FbTk::BoolCommand *parse(const std::string &command, | 52 | static FbTk::Command<bool> *parse(const std::string &command, |
53 | const std::string &args, bool trusted); | 53 | const std::string &args, bool trusted); |
54 | 54 | ||
55 | private: | 55 | private: |
56 | FbTk::RefCount<FbTk::BoolCommand> m_cmd; | 56 | FbTk::RefCount<FbTk::Command<bool> > m_cmd; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | class EveryCmd: public FbTk::BoolCommand { | 59 | class EveryCmd: public FbTk::Command<bool> { |
60 | public: | 60 | public: |
61 | EveryCmd(FbTk::RefCount<FbTk::BoolCommand> cmd): m_cmd(cmd) { } | 61 | EveryCmd(FbTk::RefCount<FbTk::Command<bool> > cmd): m_cmd(cmd) { } |
62 | 62 | ||
63 | bool bool_execute(); | 63 | bool execute(); |
64 | 64 | ||
65 | private: | 65 | private: |
66 | FbTk::RefCount<FbTk::BoolCommand> m_cmd; | 66 | FbTk::RefCount<FbTk::Command<bool> > m_cmd; |
67 | }; | 67 | }; |
68 | 68 | ||
69 | class AttachCmd: public FbTk::Command { | 69 | class AttachCmd: public FbTk::Command<void> { |
70 | public: | 70 | public: |
71 | explicit AttachCmd(const std::string &pat): m_pat(pat.c_str()) { } | 71 | explicit AttachCmd(const std::string &pat): m_pat(pat.c_str()) { } |
72 | void execute(); | 72 | void execute(); |
@@ -74,7 +74,7 @@ private: | |||
74 | const ClientPattern m_pat; | 74 | const ClientPattern m_pat; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | class NextWindowCmd: public FbTk::Command { | 77 | class NextWindowCmd: public FbTk::Command<void> { |
78 | public: | 78 | public: |
79 | explicit NextWindowCmd(int option, std::string &pat): | 79 | explicit NextWindowCmd(int option, std::string &pat): |
80 | m_option(option), m_pat(pat.c_str()) { } | 80 | m_option(option), m_pat(pat.c_str()) { } |
@@ -84,7 +84,7 @@ private: | |||
84 | const ClientPattern m_pat; | 84 | const ClientPattern m_pat; |
85 | }; | 85 | }; |
86 | 86 | ||
87 | class PrevWindowCmd: public FbTk::Command { | 87 | class PrevWindowCmd: public FbTk::Command<void> { |
88 | public: | 88 | public: |
89 | explicit PrevWindowCmd(int option, std::string &pat): | 89 | explicit PrevWindowCmd(int option, std::string &pat): |
90 | m_option(option), m_pat(pat.c_str()) { } | 90 | m_option(option), m_pat(pat.c_str()) { } |
@@ -94,12 +94,12 @@ private: | |||
94 | const ClientPattern m_pat; | 94 | const ClientPattern m_pat; |
95 | }; | 95 | }; |
96 | 96 | ||
97 | class GoToWindowCmd: public FbTk::Command { | 97 | class GoToWindowCmd: public FbTk::Command<void> { |
98 | public: | 98 | public: |
99 | GoToWindowCmd(int num, int option, std::string &pat): | 99 | GoToWindowCmd(int num, int option, std::string &pat): |
100 | m_num(num), m_option(option), m_pat(pat.c_str()) { } | 100 | m_num(num), m_option(option), m_pat(pat.c_str()) { } |
101 | void execute(); | 101 | void execute(); |
102 | static FbTk::Command *parse(const std::string &command, | 102 | static FbTk::Command<void> *parse(const std::string &command, |
103 | const std::string &args, bool trusted); | 103 | const std::string &args, bool trusted); |
104 | private: | 104 | private: |
105 | const int m_num; | 105 | const int m_num; |
@@ -107,27 +107,27 @@ private: | |||
107 | const ClientPattern m_pat; | 107 | const ClientPattern m_pat; |
108 | }; | 108 | }; |
109 | 109 | ||
110 | class DirFocusCmd: public FbTk::Command { | 110 | class DirFocusCmd: public FbTk::Command<void> { |
111 | public: | 111 | public: |
112 | explicit DirFocusCmd(const FocusControl::FocusDir dir): m_dir(dir) { } | 112 | explicit DirFocusCmd(const FocusControl::FocusDir dir): m_dir(dir) { } |
113 | void execute(); | 113 | void execute(); |
114 | static FbTk::Command *parse(const std::string &command, | 114 | static FbTk::Command<void> *parse(const std::string &command, |
115 | const std::string &args, bool trusted); | 115 | const std::string &args, bool trusted); |
116 | private: | 116 | private: |
117 | const FocusControl::FocusDir m_dir; | 117 | const FocusControl::FocusDir m_dir; |
118 | }; | 118 | }; |
119 | 119 | ||
120 | class AddWorkspaceCmd: public FbTk::Command { | 120 | class AddWorkspaceCmd: public FbTk::Command<void> { |
121 | public: | 121 | public: |
122 | void execute(); | 122 | void execute(); |
123 | }; | 123 | }; |
124 | 124 | ||
125 | class RemoveLastWorkspaceCmd: public FbTk::Command { | 125 | class RemoveLastWorkspaceCmd: public FbTk::Command<void> { |
126 | public: | 126 | public: |
127 | void execute(); | 127 | void execute(); |
128 | }; | 128 | }; |
129 | 129 | ||
130 | class NextWorkspaceCmd: public FbTk::Command { | 130 | class NextWorkspaceCmd: public FbTk::Command<void> { |
131 | public: | 131 | public: |
132 | explicit NextWorkspaceCmd(int option):m_option(option) { } | 132 | explicit NextWorkspaceCmd(int option):m_option(option) { } |
133 | void execute(); | 133 | void execute(); |
@@ -135,7 +135,7 @@ private: | |||
135 | const int m_option; | 135 | const int m_option; |
136 | }; | 136 | }; |
137 | 137 | ||
138 | class PrevWorkspaceCmd: public FbTk::Command { | 138 | class PrevWorkspaceCmd: public FbTk::Command<void> { |
139 | public: | 139 | public: |
140 | explicit PrevWorkspaceCmd(int option):m_option(option) { } | 140 | explicit PrevWorkspaceCmd(int option):m_option(option) { } |
141 | void execute(); | 141 | void execute(); |
@@ -143,7 +143,7 @@ private: | |||
143 | const int m_option; | 143 | const int m_option; |
144 | }; | 144 | }; |
145 | 145 | ||
146 | class LeftWorkspaceCmd: public FbTk::Command { | 146 | class LeftWorkspaceCmd: public FbTk::Command<void> { |
147 | public: | 147 | public: |
148 | explicit LeftWorkspaceCmd(int num=1):m_param(num == 0 ? 1 : num) { } | 148 | explicit LeftWorkspaceCmd(int num=1):m_param(num == 0 ? 1 : num) { } |
149 | void execute(); | 149 | void execute(); |
@@ -151,7 +151,7 @@ private: | |||
151 | const int m_param; | 151 | const int m_param; |
152 | }; | 152 | }; |
153 | 153 | ||
154 | class RightWorkspaceCmd: public FbTk::Command { | 154 | class RightWorkspaceCmd: public FbTk::Command<void> { |
155 | public: | 155 | public: |
156 | explicit RightWorkspaceCmd(int num=1):m_param(num == 0 ? 1 : num) { } | 156 | explicit RightWorkspaceCmd(int num=1):m_param(num == 0 ? 1 : num) { } |
157 | void execute(); | 157 | void execute(); |
@@ -159,7 +159,7 @@ private: | |||
159 | const int m_param; | 159 | const int m_param; |
160 | }; | 160 | }; |
161 | 161 | ||
162 | class JumpToWorkspaceCmd: public FbTk::Command { | 162 | class JumpToWorkspaceCmd: public FbTk::Command<void> { |
163 | public: | 163 | public: |
164 | explicit JumpToWorkspaceCmd(int workspace_num); | 164 | explicit JumpToWorkspaceCmd(int workspace_num); |
165 | void execute(); | 165 | void execute(); |
@@ -168,17 +168,17 @@ private: | |||
168 | }; | 168 | }; |
169 | 169 | ||
170 | /// arranges windows in current workspace to rows and columns | 170 | /// arranges windows in current workspace to rows and columns |
171 | class ArrangeWindowsCmd: public FbTk::Command { | 171 | class ArrangeWindowsCmd: public FbTk::Command<void> { |
172 | public: | 172 | public: |
173 | void execute(); | 173 | void execute(); |
174 | }; | 174 | }; |
175 | 175 | ||
176 | class ShowDesktopCmd: public FbTk::Command { | 176 | class ShowDesktopCmd: public FbTk::Command<void> { |
177 | public: | 177 | public: |
178 | void execute(); | 178 | void execute(); |
179 | }; | 179 | }; |
180 | 180 | ||
181 | class CloseAllWindowsCmd: public FbTk::Command { | 181 | class CloseAllWindowsCmd: public FbTk::Command<void> { |
182 | public: | 182 | public: |
183 | void execute(); | 183 | void execute(); |
184 | }; | 184 | }; |