aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Layer.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/Layer.hh')
-rw-r--r--src/FbTk/Layer.hh14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/FbTk/Layer.hh b/src/FbTk/Layer.hh
index aabbe08..5836c9c 100644
--- a/src/FbTk/Layer.hh
+++ b/src/FbTk/Layer.hh
@@ -29,12 +29,12 @@
29namespace FbTk { 29namespace FbTk {
30 30
31template <typename ItemType, typename Container = std::vector<ItemType *> > 31template <typename ItemType, typename Container = std::vector<ItemType *> >
32class Layer { 32class LayerBase {
33public: 33public:
34 typedef Container ListType; 34 typedef Container ListType;
35 typedef typename Container::iterator iterator; 35 typedef typename Container::iterator iterator;
36 typedef typename Container::reverse_iterator reverse_iterator; 36 typedef typename Container::reverse_iterator reverse_iterator;
37 virtual ~Layer() { } 37 virtual ~LayerBase() { }
38 /// insert in top by default 38 /// insert in top by default
39 virtual iterator insert(ItemType &item, unsigned int pos=0); 39 virtual iterator insert(ItemType &item, unsigned int pos=0);
40 /// remove item from list 40 /// remove item from list
@@ -56,7 +56,7 @@ private:
56}; 56};
57 57
58template <typename ItemType, typename Container> 58template <typename ItemType, typename Container>
59typename Container::iterator Layer<ItemType, Container>::insert(ItemType &item, unsigned int position) { 59typename Container::iterator LayerBase<ItemType, Container>::insert(ItemType &item, unsigned int position) {
60 // make sure we don't alreay have it in the list 60 // make sure we don't alreay have it in the list
61 if (std::find(itemList().begin(), itemList().end(), &item) != itemList().end()) 61 if (std::find(itemList().begin(), itemList().end(), &item) != itemList().end())
62 return m_list.end(); 62 return m_list.end();
@@ -76,14 +76,14 @@ typename Container::iterator Layer<ItemType, Container>::insert(ItemType &item,
76 76
77 77
78template <typename ItemType, typename Container> 78template <typename ItemType, typename Container>
79void Layer<ItemType, Container>::remove(ItemType &item) { 79void LayerBase<ItemType, Container>::remove(ItemType &item) {
80 iterator it = std::find(itemList().begin(), itemList().end(), &item); 80 iterator it = std::find(itemList().begin(), itemList().end(), &item);
81 if (it != itemList().end()) 81 if (it != itemList().end())
82 m_list.erase(it); 82 m_list.erase(it);
83} 83}
84 84
85template <typename ItemType, typename Container> 85template <typename ItemType, typename Container>
86void Layer<ItemType, Container>::raise(ItemType &item) { 86void LayerBase<ItemType, Container>::raise(ItemType &item) {
87 if (&item == itemList().front()) // already at the bottom 87 if (&item == itemList().front()) // already at the bottom
88 return; 88 return;
89 remove(item); 89 remove(item);
@@ -92,7 +92,7 @@ void Layer<ItemType, Container>::raise(ItemType &item) {
92} 92}
93 93
94template <typename ItemType, typename Container> 94template <typename ItemType, typename Container>
95void Layer<ItemType, Container>::lower(ItemType &item) { 95void LayerBase<ItemType, Container>::lower(ItemType &item) {
96 if (&item == itemList().back()) // already at the bottom 96 if (&item == itemList().back()) // already at the bottom
97 return; 97 return;
98 remove(item); 98 remove(item);
@@ -101,7 +101,7 @@ void Layer<ItemType, Container>::lower(ItemType &item) {
101} 101}
102 102
103template <typename ItemType, typename Container> 103template <typename ItemType, typename Container>
104void Layer<ItemType, Container>::restack() { 104void LayerBase<ItemType, Container>::restack() {
105} 105}
106 106
107 107