aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/SimpleCommand.hh
diff options
context:
space:
mode:
authormarkt <markt>2007-11-22 04:07:57 (GMT)
committermarkt <markt>2007-11-22 04:07:57 (GMT)
commit675bc5d66aa08311e99cb00cf836d16a910a73df (patch)
tree9118f77bcc38631f944cdf4a07d2173011a29a9b /src/FbTk/SimpleCommand.hh
parent08ebff4b319f51b4263cded0bb9c04103bcd9c3a (diff)
downloadfluxbox-675bc5d66aa08311e99cb00cf836d16a910a73df.zip
fluxbox-675bc5d66aa08311e99cb00cf836d16a910a73df.tar.bz2
added conditional statements to keys file
Diffstat (limited to 'src/FbTk/SimpleCommand.hh')
-rw-r--r--src/FbTk/SimpleCommand.hh12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/FbTk/SimpleCommand.hh b/src/FbTk/SimpleCommand.hh
index 8cc7283..7ae91a5 100644
--- a/src/FbTk/SimpleCommand.hh
+++ b/src/FbTk/SimpleCommand.hh
@@ -39,6 +39,18 @@ private:
39 Action m_action; 39 Action m_action;
40}; 40};
41 41
42template <typename Receiver, typename ReturnType=bool>
43class SimpleBoolCommand: public BoolCommand {
44public:
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)(); }
49private:
50 Receiver &m_receiver;
51 Action m_action;
52};
53
42} // end namespace FbTk 54} // end namespace FbTk
43 55
44#endif // FBTK_SIMPLECOMMAND_HH 56#endif // FBTK_SIMPLECOMMAND_HH