1 /* 2 * Copyright (c) 2005-2008, Haiku, Inc. 3 * Distributed under the terms of the MIT license. 4 * 5 * Authors: 6 * Axel Dörfler, axeld@pinc-software.de 7 */ 8 #ifndef WINDOW_LIST_H 9 #define WINDOW_LIST_H 10 11 12 #include <SupportDefs.h> 13 #include <Point.h> 14 15 16 class Window; 17 18 19 class WindowList { 20 public: 21 WindowList(int32 index = 0); 22 ~WindowList(); 23 24 void SetIndex(int32 index); 25 int32 Index() const { return fIndex; } 26 27 Window* FirstWindow() const { return fFirstWindow; } 28 Window* LastWindow() const { return fLastWindow; } 29 30 void AddWindow(Window* window, Window* before = NULL); 31 void RemoveWindow(Window* window); 32 33 bool HasWindow(Window* window) const; 34 bool ValidateWindow(Window* window) const; 35 36 int32 Count() const; 37 // O(n) 38 39 private: 40 int32 fIndex; 41 Window* fFirstWindow; 42 Window* fLastWindow; 43 }; 44 45 enum window_lists { 46 kAllWindowList = 32, 47 kSubsetList, 48 kFocusList, 49 kWorkingList, 50 51 kListCount 52 }; 53 54 struct window_anchor { 55 window_anchor(); 56 57 Window* next; 58 Window* previous; 59 BPoint position; 60 }; 61 62 extern const BPoint kInvalidWindowPosition; 63 64 #endif // WINDOW_LIST_H 65