285 Iterator Find(Window *w); |
285 Iterator Find(Window *w); |
286 Iterator FindFirstVitalWindow(); |
286 Iterator FindFirstVitalWindow(); |
287 Iterator FindByClass(WindowClass cls); |
287 Iterator FindByClass(WindowClass cls); |
288 Iterator FindById(WindowClass cls, WindowNumber num); |
288 Iterator FindById(WindowClass cls, WindowNumber num); |
289 |
289 |
290 template <class Tmatch> Iterator EnumT(Tmatch match) |
290 Iterator EnumT(bool (*enum_proc)(Iterator)) |
291 { |
291 { |
292 for (Iterator it = m_list.begin(); it != m_list.end(); ++it) { |
292 for (Iterator it = m_list.begin(); it != m_list.end(); ++it) { |
293 if (match.EnumProc(it)) return it; |
293 if (enum_proc(it)) return it; |
294 } |
294 } |
295 return m_list.end(); |
295 return m_list.end(); |
296 } |
296 } |
297 |
297 |
298 template <class Tmatch> Iterator ReverseEnumT(Tmatch match) |
298 template <class Tmatch_1> Iterator EnumT(bool (*enum_proc)(Iterator, Tmatch_1), Tmatch_1 match) |
|
299 { |
|
300 for (Iterator it = m_list.begin(); it != m_list.end(); ++it) { |
|
301 if (enum_proc(it, match)) return it; |
|
302 } |
|
303 return m_list.end(); |
|
304 } |
|
305 |
|
306 template <class Tmatch_1, class Tmatch_2> Iterator EnumT(bool (*enum_proc)(Iterator, Tmatch_1, Tmatch_2), Tmatch_1 match_1, Tmatch_2 match_2) |
|
307 { |
|
308 for (Iterator it = m_list.begin(); it != m_list.end(); ++it) { |
|
309 if (enum_proc(it, match_1, match_2)) return it; |
|
310 } |
|
311 return m_list.end(); |
|
312 } |
|
313 |
|
314 Iterator ReverseEnumT(bool (*enum_proc)(Iterator)) |
299 { |
315 { |
300 for (Iterator it = m_list.end(); it != m_list.begin(); ) { |
316 for (Iterator it = m_list.end(); it != m_list.begin(); ) { |
301 --it; |
317 --it; |
302 if (match.EnumProc(it)) return it; |
318 if (enum_proc(it)) return it; |
|
319 } |
|
320 return m_list.end(); |
|
321 } |
|
322 |
|
323 template <class Tmatch_1> Iterator ReverseEnumT(bool (*enum_proc)(Iterator, Tmatch_1), Tmatch_1 match) |
|
324 { |
|
325 for (Iterator it = m_list.end(); it != m_list.begin(); ) { |
|
326 --it; |
|
327 if (enum_proc(it, match)) return it; |
303 } |
328 } |
304 return m_list.end(); |
329 return m_list.end(); |
305 } |
330 } |
306 }; |
331 }; |
307 |
332 |
399 { |
424 { |
400 return m_match->EnumProc((*it).w); |
425 return m_match->EnumProc((*it).w); |
401 } |
426 } |
402 }; |
427 }; |
403 |
428 |
404 template <class Tmatch> Window* EnumT(Tmatch m) |
429 //template <class Tmatch> Window* EnumT(Tmatch m) |
405 { |
430 //{ |
406 WindowList::Iterator it = Window::s_list.EnumT(EnumMatch(m)); |
431 // WindowList::Iterator it = Window::s_list.EnumT(EnumMatch<Tmatch>(m)); |
407 return (it == Window::s_list.m_list.end()) ? NULL : (*it).w; |
432 // return (it == Window::s_list.m_list.end()) ? NULL : (*it).w; |
408 } |
433 //} |
409 |
434 |
410 template <class Tmatch> Window* ReverseEnumT(Tmatch m) |
435 //template <class Tmatch> Window* ReverseEnumT(Tmatch m) |
411 { |
436 //{ |
412 WindowList::Iterator it = Window::s_list.ReverseEnumT(EnumMatch(m)); |
437 // WindowList::Iterator it = Window::s_list.ReverseEnumT(EnumMatch<Tmatch>(m)); |
413 return (it == Window::s_list.m_list.end()) ? NULL : (*it).w; |
438 // return (it == Window::s_list.m_list.end()) ? NULL : (*it).w; |
414 } |
439 //} |
415 |
440 |
416 }; |
441 }; |
417 |
442 |
418 |
443 |
419 |
444 |