haiku/src/servers/app/CursorManager.h
Michael Lotz 2213782534 All cursor related changes:
* Moved setting the default cursor from ServerScreen to Desktop
* Getting the default cursor is now done using the CursorManager
* Removed outdated setcursor from SysCursor.cpp (we have a new implementation by now)
* Renamed SysCursor.cpp to CursorSet.cpp as that's what it is
* Moved  headers/private/app/SysCursor.h to headers/private/servers/app/CursorSet.h
* Removed some unneeded header includes along the way

There remains {set|get}_syscursor now in CursorSet.cpp. Serverside for these are not implemented
and they are obvious hacks. Do we need to keep them?
Also this commit _would_ break Appearance, but 1) all the related code is currently commented out
with the comment "cursor set management belongs in another app" and 2) it is already broken
because of ColorSet.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13726 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-18 00:22:08 +00:00

77 lines
2.6 KiB
C++

//------------------------------------------------------------------------------
// Copyright (c) 2001-2002, Haiku, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// File Name: CursorManager.h
// Author: DarkWyrm <bpmagic@columbus.rr.com>
// Description: Handles the system's cursor infrastructure
//
//------------------------------------------------------------------------------
#ifndef CURSORMANAGER_H_
#define CURSORMANAGER_H_
#include <List.h>
#include <Locker.h>
#include "CursorSet.h"
#include "TokenHandler.h"
class ServerCursor;
/*!
\class CursorManager CursorManager.h
\brief Handles almost all cursor management functions for the system
The Cursor manager provides system cursor support, previous unseen on
any BeOS platform. It also provides tokens for BCursors and frees all
of an application's cursors whenever an application closes.
*/
class CursorManager : public BLocker {
public:
CursorManager();
~CursorManager();
int32 AddCursor(ServerCursor *sc);
void DeleteCursor(int32 token);
void RemoveAppCursors(team_id team);
void SetCursorSet(const char *path);
ServerCursor *GetCursor(cursor_which which);
cursor_which GetCursorWhich();
void ChangeCursor(cursor_which which, int32 token);
void SetDefaults();
ServerCursor *FindCursor(int32 token);
private:
BList fCursorList;
TokenHandler fTokenizer;
// System cursor members
ServerCursor *fDefaultCursor,
*fTextCursor,
*fMoveCursor,
*fDragCursor,
*fResizeCursor,
*fNWSECursor,
*fNESWCursor,
*fNSCursor,
*fEWCursor;
cursor_which fCurrentWhich;
};
#endif