headers/bsd: Add sys/queue.h.
[haiku.git] / src / servers / app / WindowList.h
blobfd11f7ac7892952a7dbbb9afc13f397a360e6fbf
1 /*
2 * Copyright (c) 2005-2008, Haiku, Inc.
3 * Distributed under the terms of the MIT license.
5 * Authors:
6 * Axel Dörfler, axeld@pinc-software.de
7 */
8 #ifndef WINDOW_LIST_H
9 #define WINDOW_LIST_H
12 #include <SupportDefs.h>
13 #include <Point.h>
16 class Window;
19 class WindowList {
20 public:
21 WindowList(int32 index = 0);
22 ~WindowList();
24 void SetIndex(int32 index);
25 int32 Index() const { return fIndex; }
27 Window* FirstWindow() const { return fFirstWindow; }
28 Window* LastWindow() const { return fLastWindow; }
30 void AddWindow(Window* window, Window* before = NULL);
31 void RemoveWindow(Window* window);
33 bool HasWindow(Window* window) const;
34 bool ValidateWindow(Window* window) const;
36 int32 Count() const;
37 // O(n)
39 private:
40 int32 fIndex;
41 Window* fFirstWindow;
42 Window* fLastWindow;
45 enum window_lists {
46 kAllWindowList = 32,
47 kSubsetList,
48 kFocusList,
49 kWorkingList,
51 kListCount
54 struct window_anchor {
55 window_anchor();
57 Window* next;
58 Window* previous;
59 BPoint position;
62 extern const BPoint kInvalidWindowPosition;
64 #endif // WINDOW_LIST_H