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/FbTk/SimpleCommand.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/FbTk/SimpleCommand.hh')
-rw-r--r-- | src/FbTk/SimpleCommand.hh | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/FbTk/SimpleCommand.hh b/src/FbTk/SimpleCommand.hh index 7ae91a5..1c4c39a 100644 --- a/src/FbTk/SimpleCommand.hh +++ b/src/FbTk/SimpleCommand.hh | |||
@@ -26,9 +26,9 @@ | |||
26 | 26 | ||
27 | namespace FbTk { | 27 | namespace FbTk { |
28 | 28 | ||
29 | /// a simple command | 29 | /// a simple command |
30 | template <typename Receiver, typename ReturnType=void> | 30 | template <typename Receiver, typename ReturnType=void> |
31 | class SimpleCommand: public Command { | 31 | class SimpleCommand: public Command<ReturnType> { |
32 | public: | 32 | public: |
33 | typedef ReturnType (Receiver::* Action)(); | 33 | typedef ReturnType (Receiver::* Action)(); |
34 | SimpleCommand(Receiver &r, Action a): | 34 | SimpleCommand(Receiver &r, Action a): |
@@ -39,18 +39,6 @@ private: | |||
39 | Action m_action; | 39 | Action m_action; |
40 | }; | 40 | }; |
41 | 41 | ||
42 | template <typename Receiver, typename ReturnType=bool> | ||
43 | class SimpleBoolCommand: public BoolCommand { | ||
44 | public: | ||
45 | typedef ReturnType (Receiver::* Action)(); | ||
46 | SimpleBoolCommand(Receiver &r, Action a): | ||
47 | m_receiver(r), m_action(a) { } | ||
48 | bool bool_execute() { return (bool)(m_receiver.*m_action)(); } | ||
49 | private: | ||
50 | Receiver &m_receiver; | ||
51 | Action m_action; | ||
52 | }; | ||
53 | |||
54 | } // end namespace FbTk | 42 | } // end namespace FbTk |
55 | 43 | ||
56 | #endif // FBTK_SIMPLECOMMAND_HH | 44 | #endif // FBTK_SIMPLECOMMAND_HH |