diff options
-rw-r--r-- | src/FbTk/Layer.hh | 14 | ||||
-rw-r--r-- | src/FbTk/XLayer.hh | 2 |
2 files changed, 8 insertions, 8 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 @@ | |||
29 | namespace FbTk { | 29 | namespace FbTk { |
30 | 30 | ||
31 | template <typename ItemType, typename Container = std::vector<ItemType *> > | 31 | template <typename ItemType, typename Container = std::vector<ItemType *> > |
32 | class Layer { | 32 | class LayerBase { |
33 | public: | 33 | public: |
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 | ||
58 | template <typename ItemType, typename Container> | 58 | template <typename ItemType, typename Container> |
59 | typename Container::iterator Layer<ItemType, Container>::insert(ItemType &item, unsigned int position) { | 59 | typename 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 | ||
78 | template <typename ItemType, typename Container> | 78 | template <typename ItemType, typename Container> |
79 | void Layer<ItemType, Container>::remove(ItemType &item) { | 79 | void 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 | ||
85 | template <typename ItemType, typename Container> | 85 | template <typename ItemType, typename Container> |
86 | void Layer<ItemType, Container>::raise(ItemType &item) { | 86 | void 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 | ||
94 | template <typename ItemType, typename Container> | 94 | template <typename ItemType, typename Container> |
95 | void Layer<ItemType, Container>::lower(ItemType &item) { | 95 | void 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 | ||
103 | template <typename ItemType, typename Container> | 103 | template <typename ItemType, typename Container> |
104 | void Layer<ItemType, Container>::restack() { | 104 | void LayerBase<ItemType, Container>::restack() { |
105 | } | 105 | } |
106 | 106 | ||
107 | 107 | ||
diff --git a/src/FbTk/XLayer.hh b/src/FbTk/XLayer.hh index 6018b8a..ba5406b 100644 --- a/src/FbTk/XLayer.hh +++ b/src/FbTk/XLayer.hh | |||
@@ -31,7 +31,7 @@ namespace FbTk { | |||
31 | class MultLayers; | 31 | class MultLayers; |
32 | class XLayerItem; | 32 | class XLayerItem; |
33 | 33 | ||
34 | class XLayer : public FbTk::Layer<XLayerItem, std::list<XLayerItem *> > { | 34 | class XLayer : public FbTk::LayerBase<XLayerItem, std::list<XLayerItem *> > { |
35 | public: | 35 | public: |
36 | 36 | ||
37 | XLayer(MultLayers &manager, int layernum); | 37 | XLayer(MultLayers &manager, int layernum); |