diff options
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/CompareEqual.hh | 2 | ||||
-rw-r--r-- | src/FbTk/Compose.hh | 12 | ||||
-rw-r--r-- | src/FbTk/Container.cc | 14 | ||||
-rw-r--r-- | src/FbTk/Container.hh | 2 | ||||
-rw-r--r-- | src/FbTk/MemFun.hh | 4 | ||||
-rw-r--r-- | src/FbTk/Select2nd.hh | 2 |
6 files changed, 17 insertions, 19 deletions
diff --git a/src/FbTk/CompareEqual.hh b/src/FbTk/CompareEqual.hh index 8f251e4..71c4bec 100644 --- a/src/FbTk/CompareEqual.hh +++ b/src/FbTk/CompareEqual.hh | |||
@@ -27,7 +27,7 @@ namespace FbTk { | |||
27 | 27 | ||
28 | /// @brief compares one class function with a value type | 28 | /// @brief compares one class function with a value type |
29 | template <typename ClassType, typename ValueType> | 29 | template <typename ClassType, typename ValueType> |
30 | class CompareEqual_base: public std::unary_function<ClassType, bool> { | 30 | class CompareEqual_base { |
31 | public: | 31 | public: |
32 | typedef ValueType (ClassType::* Action)() const; | 32 | typedef ValueType (ClassType::* Action)() const; |
33 | typedef ValueType Value; | 33 | typedef ValueType Value; |
diff --git a/src/FbTk/Compose.hh b/src/FbTk/Compose.hh index 04267e6..5bca2cb 100644 --- a/src/FbTk/Compose.hh +++ b/src/FbTk/Compose.hh | |||
@@ -29,16 +29,12 @@ namespace FbTk { | |||
29 | /// Composes two functions into one. | 29 | /// Composes two functions into one. |
30 | /// Uses Arg for type B and then calls type A | 30 | /// Uses Arg for type B and then calls type A |
31 | template <class A, class B> | 31 | template <class A, class B> |
32 | class Compose_base: public std::unary_function<typename B::argument_type, typename A::result_type> { | 32 | class Compose_base { |
33 | public: | 33 | public: |
34 | typedef typename A::result_type ResultTypeA; | ||
35 | typedef typename A::argument_type ArgumentTypeA; | ||
36 | typedef typename B::result_type ResultTypeB; | ||
37 | typedef typename B::argument_type ArgumentTypeB; | ||
38 | |||
39 | Compose_base(const A &a, const B &b):m_a(a), m_b(b) { } | 34 | Compose_base(const A &a, const B &b):m_a(a), m_b(b) { } |
40 | ResultTypeA operator () (const ArgumentTypeB &arg) const { | 35 | template <class ARG> |
41 | return m_a(m_b(arg)); | 36 | auto operator () (const ARG& arg) const { |
37 | return m_a(m_b(arg)); | ||
42 | } | 38 | } |
43 | 39 | ||
44 | private: | 40 | private: |
diff --git a/src/FbTk/Container.cc b/src/FbTk/Container.cc index cea761b..713d36b 100644 --- a/src/FbTk/Container.cc +++ b/src/FbTk/Container.cc | |||
@@ -32,6 +32,8 @@ | |||
32 | #include <algorithm> | 32 | #include <algorithm> |
33 | #include <vector> | 33 | #include <vector> |
34 | 34 | ||
35 | using namespace std::placeholders; | ||
36 | |||
35 | namespace FbTk { | 37 | namespace FbTk { |
36 | 38 | ||
37 | typedef CompareEqual_base<FbWindow, Window> CompareWindow; | 39 | typedef CompareEqual_base<FbWindow, Window> CompareWindow; |
@@ -491,27 +493,27 @@ unsigned int Container::maxWidthPerClient() const { | |||
491 | return 1; | 493 | return 1; |
492 | } | 494 | } |
493 | 495 | ||
494 | void Container::for_each(std::mem_fun_t<void, FbWindow> function) { | 496 | void Container::for_each(std::function<void(Item)> function) { |
495 | std::for_each(begin(), end(), function); | 497 | std::for_each(begin(), end(), function); |
496 | } | 498 | } |
497 | 499 | ||
498 | void Container::setAlpha(int alpha) { | 500 | void Container::setAlpha(int alpha) { |
499 | FbWindow::setAlpha(alpha); | 501 | FbWindow::setAlpha(alpha); |
500 | STLUtil::forAll(m_item_list, std::bind2nd(std::mem_fun(&Button::setAlpha), alpha)); | 502 | STLUtil::forAll(m_item_list, std::bind(std::mem_fn(&Button::setAlpha), _1, alpha)); |
501 | } | 503 | } |
502 | 504 | ||
503 | void Container::parentMoved() { | 505 | void Container::parentMoved() { |
504 | FbWindow::parentMoved(); | 506 | FbWindow::parentMoved(); |
505 | STLUtil::forAll(m_item_list, std::mem_fun(&Button::parentMoved)); | 507 | STLUtil::forAll(m_item_list, std::mem_fn(&Button::parentMoved)); |
506 | } | 508 | } |
507 | 509 | ||
508 | void Container::invalidateBackground() { | 510 | void Container::invalidateBackground() { |
509 | FbWindow::invalidateBackground(); | 511 | FbWindow::invalidateBackground(); |
510 | STLUtil::forAll(m_item_list, std::mem_fun(&Button::invalidateBackground)); | 512 | STLUtil::forAll(m_item_list, std::mem_fn(&Button::invalidateBackground)); |
511 | } | 513 | } |
512 | 514 | ||
513 | void Container::clear() { | 515 | void Container::clear() { |
514 | STLUtil::forAll(m_item_list, std::mem_fun(&Button::clear)); | 516 | STLUtil::forAll(m_item_list, std::mem_fn(&Button::clear)); |
515 | } | 517 | } |
516 | 518 | ||
517 | void Container::setOrientation(Orientation orient) { | 519 | void Container::setOrientation(Orientation orient) { |
@@ -519,7 +521,7 @@ void Container::setOrientation(Orientation orient) { | |||
519 | return; | 521 | return; |
520 | 522 | ||
521 | FbWindow::invalidateBackground(); | 523 | FbWindow::invalidateBackground(); |
522 | STLUtil::forAll(m_item_list, std::bind2nd(std::mem_fun(&Button::setOrientation), orient)); | 524 | STLUtil::forAll(m_item_list, std::bind(std::mem_fn(&Button::setOrientation),_1, orient)); |
523 | 525 | ||
524 | if (((m_orientation == ROT0 || m_orientation == ROT180) && | 526 | if (((m_orientation == ROT0 || m_orientation == ROT180) && |
525 | (orient == ROT90 || orient == ROT270)) || | 527 | (orient == ROT90 || orient == ROT270)) || |
diff --git a/src/FbTk/Container.hh b/src/FbTk/Container.hh index 2dc6475..1d3547a 100644 --- a/src/FbTk/Container.hh +++ b/src/FbTk/Container.hh | |||
@@ -90,7 +90,7 @@ public: | |||
90 | unsigned int maxWidthPerClient() const; | 90 | unsigned int maxWidthPerClient() const; |
91 | bool updateLock() const { return m_update_lock; } | 91 | bool updateLock() const { return m_update_lock; } |
92 | 92 | ||
93 | void for_each(std::mem_fun_t<void, FbWindow> function); | 93 | void for_each(std::function<void(Item)> function); |
94 | void setAlpha(int alpha); // set alpha on all windows | 94 | void setAlpha(int alpha); // set alpha on all windows |
95 | 95 | ||
96 | ItemList::iterator begin() { return m_item_list.begin(); } | 96 | ItemList::iterator begin() { return m_item_list.begin(); } |
diff --git a/src/FbTk/MemFun.hh b/src/FbTk/MemFun.hh index 73134d2..bb13d3f 100644 --- a/src/FbTk/MemFun.hh +++ b/src/FbTk/MemFun.hh | |||
@@ -56,7 +56,7 @@ MemFun( Object& obj, ReturnType (Object:: *action)() ) { | |||
56 | 56 | ||
57 | /// One argument functor | 57 | /// One argument functor |
58 | template <typename ReturnType, typename Object, typename Arg1> | 58 | template <typename ReturnType, typename Object, typename Arg1> |
59 | class MemFun1: public std::unary_function<Arg1, ReturnType> { | 59 | class MemFun1 { |
60 | public: | 60 | public: |
61 | typedef ReturnType (Object:: *Action)(Arg1); | 61 | typedef ReturnType (Object:: *Action)(Arg1); |
62 | 62 | ||
@@ -83,7 +83,7 @@ MemFun( Object& obj, ReturnType (Object:: *action)(Arg1) ) { | |||
83 | 83 | ||
84 | /// Two argument functor | 84 | /// Two argument functor |
85 | template <typename ReturnType, typename Object, typename Arg1, typename Arg2> | 85 | template <typename ReturnType, typename Object, typename Arg1, typename Arg2> |
86 | class MemFun2: public std::binary_function<Arg1, Arg2, ReturnType> { | 86 | class MemFun2 { |
87 | public: | 87 | public: |
88 | typedef ReturnType (Object:: *Action)(Arg1,Arg2); | 88 | typedef ReturnType (Object:: *Action)(Arg1,Arg2); |
89 | 89 | ||
diff --git a/src/FbTk/Select2nd.hh b/src/FbTk/Select2nd.hh index b0437b7..217c656 100644 --- a/src/FbTk/Select2nd.hh +++ b/src/FbTk/Select2nd.hh | |||
@@ -27,7 +27,7 @@ | |||
27 | namespace FbTk { | 27 | namespace FbTk { |
28 | 28 | ||
29 | template <class A> | 29 | template <class A> |
30 | class Select2nd:public std::unary_function<A, typename A::second_type> { | 30 | class Select2nd { |
31 | public: | 31 | public: |
32 | typename A::second_type operator () (const A &arg) const { | 32 | typename A::second_type operator () (const A &arg) const { |
33 | return arg.second; | 33 | return arg.second; |