aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/CompareEqual.hh2
-rw-r--r--src/FbTk/Compose.hh12
-rw-r--r--src/FbTk/Container.cc14
-rw-r--r--src/FbTk/Container.hh2
-rw-r--r--src/FbTk/MemFun.hh4
-rw-r--r--src/FbTk/Select2nd.hh2
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
29template <typename ClassType, typename ValueType> 29template <typename ClassType, typename ValueType>
30class CompareEqual_base: public std::unary_function<ClassType, bool> { 30class CompareEqual_base {
31public: 31public:
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
31template <class A, class B> 31template <class A, class B>
32class Compose_base: public std::unary_function<typename B::argument_type, typename A::result_type> { 32class Compose_base {
33public: 33public:
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
44private: 40private:
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
35using namespace std::placeholders;
36
35namespace FbTk { 37namespace FbTk {
36 38
37typedef CompareEqual_base<FbWindow, Window> CompareWindow; 39typedef CompareEqual_base<FbWindow, Window> CompareWindow;
@@ -491,27 +493,27 @@ unsigned int Container::maxWidthPerClient() const {
491 return 1; 493 return 1;
492} 494}
493 495
494void Container::for_each(std::mem_fun_t<void, FbWindow> function) { 496void 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
498void Container::setAlpha(int alpha) { 500void 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
503void Container::parentMoved() { 505void 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
508void Container::invalidateBackground() { 510void 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
513void Container::clear() { 515void 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
517void Container::setOrientation(Orientation orient) { 519void 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
58template <typename ReturnType, typename Object, typename Arg1> 58template <typename ReturnType, typename Object, typename Arg1>
59class MemFun1: public std::unary_function<Arg1, ReturnType> { 59class MemFun1 {
60public: 60public:
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
85template <typename ReturnType, typename Object, typename Arg1, typename Arg2> 85template <typename ReturnType, typename Object, typename Arg1, typename Arg2>
86class MemFun2: public std::binary_function<Arg1, Arg2, ReturnType> { 86class MemFun2 {
87public: 87public:
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 @@
27namespace FbTk { 27namespace FbTk {
28 28
29template <class A> 29template <class A>
30class Select2nd:public std::unary_function<A, typename A::second_type> { 30class Select2nd {
31public: 31public:
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;