aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Layer.hh
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-08-16 12:54:07 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-08-16 12:54:07 (GMT)
commit38654bae459716409ad2ee7975671fc2f131c869 (patch)
tree6f2f3c662f8317f47a422db02d17bff378266817 /src/FbTk/Layer.hh
parent06837ba8642b8a126de92f60ae05d5f84bba8bfe (diff)
downloadfluxbox-38654bae459716409ad2ee7975671fc2f131c869.zip
fluxbox-38654bae459716409ad2ee7975671fc2f131c869.tar.bz2
some cleanup
Diffstat (limited to 'src/FbTk/Layer.hh')
-rw-r--r--src/FbTk/Layer.hh79
1 files changed, 0 insertions, 79 deletions
diff --git a/src/FbTk/Layer.hh b/src/FbTk/Layer.hh
index 954449d..405285c 100644
--- a/src/FbTk/Layer.hh
+++ b/src/FbTk/Layer.hh
@@ -39,22 +39,10 @@ public:
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
41 virtual void remove(ItemType &item); 41 virtual void remove(ItemType &item);
42#ifdef NOT_USED
43 /// cycle all item upwards
44 virtual void cycleUp();
45 /// cycle all items downwards
46 virtual void cycleDown();
47#endif // NOT_USED
48 /// move item to top 42 /// move item to top
49 virtual void raise(ItemType &item); 43 virtual void raise(ItemType &item);
50 /// move item to bottom 44 /// move item to bottom
51 virtual void lower(ItemType &item); 45 virtual void lower(ItemType &item);
52#ifdef NOT_USED
53 /// raise a specific item one step
54 virtual void stepUp(ItemType &item);
55 /// lower a specific item one step
56 virtual void stepDown(ItemType &item);
57#endif // NOT_USED
58 virtual void restack(); 46 virtual void restack();
59 /// @return layer item on specific position, on failure 0 47 /// @return layer item on specific position, on failure 0
60 ItemType *getItem(unsigned int position); 48 ItemType *getItem(unsigned int position);
@@ -95,73 +83,6 @@ void Layer<ItemType, Container>::remove(ItemType &item) {
95 m_list.erase(it); 83 m_list.erase(it);
96} 84}
97 85
98#ifdef NOT_USED
99template <typename ItemType, typename Container>
100void Layer<ItemType, Container>::cycleUp() {
101 if (size() == 0)
102 return;
103 iterator it = itemList().begin();
104 it++;
105 rotate(itemList().begin(), it, itemList().end());
106 restack();
107}
108
109
110template <typename ItemType, typename Container>
111void Layer<ItemType, Container>::cycleDown() {
112 if (size() == 0)
113 return;
114 // save last item and remove it from list
115 ItemType *last_item = itemList().back();
116 itemList().pop_back();
117 // add last item to front
118 itemList().insert(itemList().begin(), last_item);
119 restack();
120}
121
122template <typename ItemType, typename Container>
123void Layer<ItemType, Container>::stepUp(ItemType &item) {
124 iterator it =
125 find(itemList().begin(), itemList().end(), &item);
126
127 if (it == itemList().end())
128 return;
129
130 if (it == itemList().begin()) // we can't raise it more
131 return;
132
133 iterator new_pos = it;
134 new_pos--;
135 ItemType *textitem = *it;
136 // remove item from list
137 itemList().erase(it);
138 // insert above last pos
139 itemList().insert(new_pos, textitem);
140 restack();
141}
142
143template <typename ItemType, typename Container>
144void Layer<ItemType, Container>::stepDown(ItemType &item) {
145 iterator it =
146 find(itemList().begin(), itemList().end(), &item);
147
148 if (it == itemList().end()) // we didn't find the item in our list
149 return;
150
151 if (*it == itemList().back()) // it's already at the bottom
152 return;
153
154 iterator new_pos = it;
155 new_pos++;
156 ItemType *textitem = *it;
157 // remove from list
158 itemList().erase(it);
159 // insert on the new place
160 itemList().insert(new_pos, textitem);
161 restack();
162}
163#endif // NOT_USED
164
165template <typename ItemType, typename Container> 86template <typename ItemType, typename Container>
166void Layer<ItemType, Container>::raise(ItemType &item) { 87void Layer<ItemType, Container>::raise(ItemType &item) {
167 if (&item == itemList().front()) // already at the bottom 88 if (&item == itemList().front()) // already at the bottom