diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-16 12:54:07 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-16 12:54:07 (GMT) |
commit | 38654bae459716409ad2ee7975671fc2f131c869 (patch) | |
tree | 6f2f3c662f8317f47a422db02d17bff378266817 /src/FbTk/XLayer.cc | |
parent | 06837ba8642b8a126de92f60ae05d5f84bba8bfe (diff) | |
download | fluxbox-38654bae459716409ad2ee7975671fc2f131c869.zip fluxbox-38654bae459716409ad2ee7975671fc2f131c869.tar.bz2 |
some cleanup
Diffstat (limited to 'src/FbTk/XLayer.cc')
-rw-r--r-- | src/FbTk/XLayer.cc | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/src/FbTk/XLayer.cc b/src/FbTk/XLayer.cc index 51a0fe0..0d878d3 100644 --- a/src/FbTk/XLayer.cc +++ b/src/FbTk/XLayer.cc | |||
@@ -174,100 +174,6 @@ void XLayer::remove(XLayerItem &item) { | |||
174 | } | 174 | } |
175 | } | 175 | } |
176 | 176 | ||
177 | #ifdef NOT_USED | ||
178 | void XLayer::cycleUp() { | ||
179 | // need to find highest visible window, and move it to bottom | ||
180 | iterator it = itemList().begin(); | ||
181 | iterator it_end = itemList().end(); | ||
182 | while (it != it_end && !(*it)->visible()) | ||
183 | ++it; | ||
184 | |||
185 | // if there is something to do | ||
186 | if (it != it_end) | ||
187 | lower(**it); | ||
188 | |||
189 | } | ||
190 | |||
191 | void XLayer::cycleDown() { | ||
192 | // need to find lowest visible window, and move it to top | ||
193 | // so use a reverse iterator, and the same logic as cycleUp() | ||
194 | reverse_iterator it = itemList().rbegin(); | ||
195 | reverse_iterator it_end = itemList().rend(); | ||
196 | while (it != it_end && !(*it)->visible()) | ||
197 | ++it; | ||
198 | |||
199 | // if there is something to do | ||
200 | if (it != it_end) | ||
201 | raise(**it); | ||
202 | |||
203 | } | ||
204 | |||
205 | void XLayer::stepUp(XLayerItem &item) { | ||
206 | // need to find next visible window upwards, and put it above that | ||
207 | |||
208 | if (&item == itemList().front()) | ||
209 | return; // nothing to do | ||
210 | |||
211 | // TODO: is there a better way of doing this? | ||
212 | |||
213 | // get our item | ||
214 | iterator myit = find(itemList().begin(), itemList().end(), &item); | ||
215 | iterator it = myit; | ||
216 | |||
217 | // go to the one above it in our layer (top is front, so we decrement) | ||
218 | --it; | ||
219 | |||
220 | // keep going until we find one that is currently visible to the user | ||
221 | while (it != itemList().begin() && !(*it)->visible()) | ||
222 | --it; | ||
223 | |||
224 | if (it == itemList().begin() && !(*it)->visible()) { | ||
225 | // reached front item, but it wasn't visible, therefore it was already raised | ||
226 | } else { | ||
227 | // it is the next visible item down, we need to be above it. | ||
228 | // remove that item from the list and add it back to before it (the one we want to go above) | ||
229 | |||
230 | itemList().erase(myit); | ||
231 | itemList().insert(it, &item); | ||
232 | |||
233 | // if we've reached the top of the layer, we need to stack below the next one up | ||
234 | if (it == itemList().begin()) { | ||
235 | stackBelowItem(&item, m_manager.getLowestItemAboveLayer(m_layernum)); | ||
236 | } else { | ||
237 | // otherwise go up one in this layer (i.e. above the one we want to go above) | ||
238 | --it; | ||
239 | // and stack below that. | ||
240 | stackBelowItem(&item, *it); | ||
241 | } | ||
242 | } | ||
243 | } | ||
244 | |||
245 | void XLayer::stepDown(XLayerItem &item) { | ||
246 | // need to find next visible window down, and put it below that | ||
247 | |||
248 | // if we're already the bottom of the layer | ||
249 | if (&item == itemList().back()) | ||
250 | return; // nothing to do | ||
251 | |||
252 | // get our position | ||
253 | iterator it = find(itemList().begin(), itemList().end(), &item); | ||
254 | |||
255 | // go one below it (top is front, so we must increment) | ||
256 | it++; | ||
257 | iterator it_end = itemList().end(); | ||
258 | |||
259 | // keep going down until we find a visible one | ||
260 | while (it != it_end && !(*it)->visible()) | ||
261 | it++; | ||
262 | |||
263 | // if we didn't reach the end, then stack below the | ||
264 | // item that we found. | ||
265 | if (it != it_end) | ||
266 | stackBelowItem(&item, *it); | ||
267 | // if we did reach the end, then there are no visible windows, so we don't do anything | ||
268 | } | ||
269 | #endif // NOT_USED | ||
270 | |||
271 | void XLayer::raise(XLayerItem &item) { | 177 | void XLayer::raise(XLayerItem &item) { |
272 | // assume it is already in this layer | 178 | // assume it is already in this layer |
273 | 179 | ||