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/FbCommands.hh | |
parent | 1f01d84c080d607a91eb417efcaf5e500b5f1d7e (diff) | |
download | fluxbox_pavel-9f2f65a698c4cc71373a7fe9d73a0889e0d3487b.zip fluxbox_pavel-9f2f65a698c4cc71373a7fe9d73a0889e0d3487b.tar.bz2 |
make FbTk::Command a template class, split parsing information out of ObjectRegistry
Diffstat (limited to 'src/FbCommands.hh')
-rw-r--r-- | src/FbCommands.hh | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/FbCommands.hh b/src/FbCommands.hh index d784a75..f9c33af 100644 --- a/src/FbCommands.hh +++ b/src/FbCommands.hh | |||
@@ -34,7 +34,7 @@ | |||
34 | namespace FbCommands { | 34 | namespace FbCommands { |
35 | 35 | ||
36 | /// executes a system command | 36 | /// executes a system command |
37 | class ExecuteCmd: public FbTk::Command { | 37 | class ExecuteCmd: public FbTk::Command<void> { |
38 | public: | 38 | public: |
39 | ExecuteCmd(const std::string &cmd, int screen_num = -1); | 39 | ExecuteCmd(const std::string &cmd, int screen_num = -1); |
40 | void execute(); | 40 | void execute(); |
@@ -48,11 +48,11 @@ private: | |||
48 | }; | 48 | }; |
49 | 49 | ||
50 | /// sets environment | 50 | /// sets environment |
51 | class ExportCmd : public FbTk::Command { | 51 | class ExportCmd : public FbTk::Command<void> { |
52 | public: | 52 | public: |
53 | ExportCmd(const std::string& name, const std::string& value); | 53 | ExportCmd(const std::string& name, const std::string& value); |
54 | void execute(); | 54 | void execute(); |
55 | static FbTk::Command *parse(const std::string &command, | 55 | static FbTk::Command<void> *parse(const std::string &command, |
56 | const std::string &args, bool trusted); | 56 | const std::string &args, bool trusted); |
57 | private: | 57 | private: |
58 | std::string m_name; | 58 | std::string m_name; |
@@ -60,19 +60,19 @@ private: | |||
60 | }; | 60 | }; |
61 | 61 | ||
62 | /// exit fluxbox | 62 | /// exit fluxbox |
63 | class ExitFluxboxCmd: public FbTk::Command { | 63 | class ExitFluxboxCmd: public FbTk::Command<void> { |
64 | public: | 64 | public: |
65 | void execute(); | 65 | void execute(); |
66 | }; | 66 | }; |
67 | 67 | ||
68 | /// saves resources | 68 | /// saves resources |
69 | class SaveResources: public FbTk::Command { | 69 | class SaveResources: public FbTk::Command<void> { |
70 | public: | 70 | public: |
71 | void execute(); | 71 | void execute(); |
72 | }; | 72 | }; |
73 | 73 | ||
74 | /// restarts fluxbox | 74 | /// restarts fluxbox |
75 | class RestartFluxboxCmd: public FbTk::Command { | 75 | class RestartFluxboxCmd: public FbTk::Command<void> { |
76 | public: | 76 | public: |
77 | RestartFluxboxCmd(const std::string &cmd); | 77 | RestartFluxboxCmd(const std::string &cmd); |
78 | void execute(); | 78 | void execute(); |
@@ -81,17 +81,17 @@ private: | |||
81 | }; | 81 | }; |
82 | 82 | ||
83 | /// reconfigures fluxbox | 83 | /// reconfigures fluxbox |
84 | class ReconfigureFluxboxCmd: public FbTk::Command { | 84 | class ReconfigureFluxboxCmd: public FbTk::Command<void> { |
85 | public: | 85 | public: |
86 | void execute(); | 86 | void execute(); |
87 | }; | 87 | }; |
88 | 88 | ||
89 | class ReloadStyleCmd: public FbTk::Command { | 89 | class ReloadStyleCmd: public FbTk::Command<void> { |
90 | public: | 90 | public: |
91 | void execute(); | 91 | void execute(); |
92 | }; | 92 | }; |
93 | 93 | ||
94 | class SetStyleCmd: public FbTk::Command { | 94 | class SetStyleCmd: public FbTk::Command<void> { |
95 | public: | 95 | public: |
96 | explicit SetStyleCmd(const std::string &filename); | 96 | explicit SetStyleCmd(const std::string &filename); |
97 | void execute(); | 97 | void execute(); |
@@ -99,7 +99,7 @@ private: | |||
99 | std::string m_filename; | 99 | std::string m_filename; |
100 | }; | 100 | }; |
101 | 101 | ||
102 | class KeyModeCmd: public FbTk::Command { | 102 | class KeyModeCmd: public FbTk::Command<void> { |
103 | public: | 103 | public: |
104 | explicit KeyModeCmd(const std::string &arguments); | 104 | explicit KeyModeCmd(const std::string &arguments); |
105 | void execute(); | 105 | void execute(); |
@@ -108,17 +108,17 @@ private: | |||
108 | std::string m_end_args; | 108 | std::string m_end_args; |
109 | }; | 109 | }; |
110 | 110 | ||
111 | class HideMenuCmd: public FbTk::Command { | 111 | class HideMenuCmd: public FbTk::Command<void> { |
112 | public: | 112 | public: |
113 | void execute(); | 113 | void execute(); |
114 | }; | 114 | }; |
115 | 115 | ||
116 | class ShowClientMenuCmd: public FbTk::Command { | 116 | class ShowClientMenuCmd: public FbTk::Command<void> { |
117 | public: | 117 | public: |
118 | ShowClientMenuCmd(int option, std::string &pat): | 118 | ShowClientMenuCmd(int option, std::string &pat): |
119 | m_option(option|FocusableList::LIST_GROUPS), m_pat(pat.c_str()) { } | 119 | m_option(option|FocusableList::LIST_GROUPS), m_pat(pat.c_str()) { } |
120 | void execute(); | 120 | void execute(); |
121 | static FbTk::Command *parse(const std::string &command, | 121 | static FbTk::Command<void> *parse(const std::string &command, |
122 | const std::string &args, bool trusted); | 122 | const std::string &args, bool trusted); |
123 | private: | 123 | private: |
124 | const int m_option; | 124 | const int m_option; |
@@ -127,7 +127,7 @@ private: | |||
127 | FbTk::RefCount<ClientMenu> m_menu; | 127 | FbTk::RefCount<ClientMenu> m_menu; |
128 | }; | 128 | }; |
129 | 129 | ||
130 | class ShowCustomMenuCmd: public FbTk::Command { | 130 | class ShowCustomMenuCmd: public FbTk::Command<void> { |
131 | public: | 131 | public: |
132 | explicit ShowCustomMenuCmd(const std::string &arguments); | 132 | explicit ShowCustomMenuCmd(const std::string &arguments); |
133 | void execute(); | 133 | void execute(); |
@@ -136,17 +136,17 @@ private: | |||
136 | FbTk::RefCount<FbTk::Menu> m_menu; | 136 | FbTk::RefCount<FbTk::Menu> m_menu; |
137 | }; | 137 | }; |
138 | 138 | ||
139 | class ShowRootMenuCmd: public FbTk::Command { | 139 | class ShowRootMenuCmd: public FbTk::Command<void> { |
140 | public: | 140 | public: |
141 | void execute(); | 141 | void execute(); |
142 | }; | 142 | }; |
143 | 143 | ||
144 | class ShowWorkspaceMenuCmd: public FbTk::Command { | 144 | class ShowWorkspaceMenuCmd: public FbTk::Command<void> { |
145 | public: | 145 | public: |
146 | void execute(); | 146 | void execute(); |
147 | }; | 147 | }; |
148 | 148 | ||
149 | class SetWorkspaceNameCmd: public FbTk::Command { | 149 | class SetWorkspaceNameCmd: public FbTk::Command<void> { |
150 | public: | 150 | public: |
151 | SetWorkspaceNameCmd(const std::string &name, int spaceid = -1); | 151 | SetWorkspaceNameCmd(const std::string &name, int spaceid = -1); |
152 | void execute(); | 152 | void execute(); |
@@ -155,18 +155,18 @@ private: | |||
155 | int m_workspace; | 155 | int m_workspace; |
156 | }; | 156 | }; |
157 | 157 | ||
158 | class WorkspaceNameDialogCmd: public FbTk::Command { | 158 | class WorkspaceNameDialogCmd: public FbTk::Command<void> { |
159 | public: | 159 | public: |
160 | void execute(); | 160 | void execute(); |
161 | }; | 161 | }; |
162 | 162 | ||
163 | class CommandDialogCmd: public FbTk::Command { | 163 | class CommandDialogCmd: public FbTk::Command<void> { |
164 | public: | 164 | public: |
165 | void execute(); | 165 | void execute(); |
166 | }; | 166 | }; |
167 | 167 | ||
168 | 168 | ||
169 | class SetResourceValueCmd: public FbTk::Command { | 169 | class SetResourceValueCmd: public FbTk::Command<void> { |
170 | public: | 170 | public: |
171 | SetResourceValueCmd(const std::string &resourcename, const std::string &value); | 171 | SetResourceValueCmd(const std::string &resourcename, const std::string &value); |
172 | void execute(); | 172 | void execute(); |
@@ -175,12 +175,12 @@ private: | |||
175 | const std::string m_value; | 175 | const std::string m_value; |
176 | }; | 176 | }; |
177 | 177 | ||
178 | class SetResourceValueDialogCmd: public FbTk::Command { | 178 | class SetResourceValueDialogCmd: public FbTk::Command<void> { |
179 | public: | 179 | public: |
180 | void execute(); | 180 | void execute(); |
181 | }; | 181 | }; |
182 | 182 | ||
183 | class BindKeyCmd: public FbTk::Command { | 183 | class BindKeyCmd: public FbTk::Command<void> { |
184 | public: | 184 | public: |
185 | BindKeyCmd(const std::string &keybind); | 185 | BindKeyCmd(const std::string &keybind); |
186 | void execute(); | 186 | void execute(); |
@@ -189,7 +189,7 @@ private: | |||
189 | }; | 189 | }; |
190 | 190 | ||
191 | /// deiconifies iconified windows | 191 | /// deiconifies iconified windows |
192 | class DeiconifyCmd: public FbTk::Command { | 192 | class DeiconifyCmd: public FbTk::Command<void> { |
193 | public: | 193 | public: |
194 | enum Mode { | 194 | enum Mode { |
195 | LAST, | 195 | LAST, |
@@ -207,7 +207,7 @@ public: | |||
207 | DeiconifyCmd(Mode mode= LASTWORKSPACE, | 207 | DeiconifyCmd(Mode mode= LASTWORKSPACE, |
208 | Destination dest= CURRENT); | 208 | Destination dest= CURRENT); |
209 | void execute(); | 209 | void execute(); |
210 | static FbTk::Command *parse(const std::string &command, | 210 | static FbTk::Command<void> *parse(const std::string &command, |
211 | const std::string &args, bool trusted); | 211 | const std::string &args, bool trusted); |
212 | private: | 212 | private: |
213 | Mode m_mode; | 213 | Mode m_mode; |