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