1 /* 2 * Copyright 2001-2005, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * DarkWyrm <bpmagic@columbus.rr.com> 7 */ 8 #ifndef CURSOR_MANAGER_H 9 #define CURSOR_MANAGER_H 10 11 12 #include <List.h> 13 #include <Locker.h> 14 15 #include <TokenSpace.h> 16 17 #include "CursorSet.h" 18 19 using BPrivate::BTokenSpace; 20 class ServerCursor; 21 22 23 /*! 24 \class CursorManager CursorManager.h 25 \brief Handles almost all cursor management functions for the system 26 27 The Cursor manager provides system cursor support, previous unseen on 28 any BeOS platform. It also provides tokens for BCursors and frees all 29 of an application's cursors whenever an application closes. 30 */ 31 class CursorManager : public BLocker { 32 public: 33 CursorManager(); 34 virtual ~CursorManager(); 35 36 int32 AddCursor(ServerCursor* cursor); 37 void DeleteCursor(int32 token); 38 void RemoveAppCursors(team_id team); 39 40 void SetCursorSet(const char* path); 41 ServerCursor* GetCursor(cursor_which which); 42 cursor_which GetCursorWhich(); 43 void ChangeCursor(cursor_which which, int32 token); 44 void SetDefaults(); 45 ServerCursor* FindCursor(int32 token); 46 47 private: 48 BList fCursorList; 49 BTokenSpace fTokenSpace; 50 51 // System cursor members 52 ServerCursor *fDefaultCursor, 53 *fTextCursor, 54 *fMoveCursor, 55 *fDragCursor, 56 *fResizeCursor, 57 *fNWSECursor, 58 *fNESWCursor, 59 *fNSCursor, 60 *fEWCursor; 61 cursor_which fCurrentWhich; 62 }; 63 64 #endif /* CURSOR_MANAGER_H */ 65