2003-01-13 01:51:01 +03:00
|
|
|
//------------------------------------------------------------------------------
|
2004-09-21 02:46:37 +04:00
|
|
|
// Copyright (c) 2001-2002, Haiku, Inc.
|
2003-01-13 01:51:01 +03:00
|
|
|
//
|
|
|
|
// 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: ServerCursor.h
|
|
|
|
// Author: DarkWyrm <bpmagic@columbus.rr.com>
|
2005-04-14 04:04:26 +04:00
|
|
|
// Stephan Aßmus <superstippi@gmx.de>
|
2003-01-13 01:51:01 +03:00
|
|
|
// Description: Glorified ServerBitmap used for cursor work.
|
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
#ifndef SERVERCURSOR_H_
|
|
|
|
#define SERVERCURSOR_H_
|
|
|
|
|
|
|
|
#include <Point.h>
|
2003-10-06 02:10:35 +04:00
|
|
|
#include <String.h>
|
2005-04-14 04:04:26 +04:00
|
|
|
|
2003-01-13 01:51:01 +03:00
|
|
|
#include "ServerBitmap.h"
|
|
|
|
|
2003-01-23 03:37:53 +03:00
|
|
|
class ServerApp;
|
2003-01-23 04:20:28 +03:00
|
|
|
class CursorManager;
|
2003-01-23 03:37:53 +03:00
|
|
|
|
2003-01-18 23:32:45 +03:00
|
|
|
/*!
|
|
|
|
\class ServerCursor ServerCursor.h
|
|
|
|
\brief Class to handle all cursor capabilities for the system
|
|
|
|
|
|
|
|
Although descended from ServerBitmaps, ServerCursors are not handled by
|
|
|
|
the BitmapManager - they are allocated like any other object. Unlike BeOS
|
|
|
|
R5, cursors can be any size or color space, and this class accomodates and
|
|
|
|
expands the R5 API.
|
|
|
|
*/
|
2005-04-14 04:04:26 +04:00
|
|
|
class ServerCursor : public ServerBitmap {
|
|
|
|
public:
|
|
|
|
ServerCursor(BRect r, color_space space,
|
|
|
|
int32 flags, BPoint hotspot,
|
|
|
|
int32 bytesperrow = -1,
|
|
|
|
screen_id screen = B_MAIN_SCREEN_ID);
|
|
|
|
ServerCursor(const int8* cursorDataFromR5);
|
|
|
|
ServerCursor(const uint8* alreadyPaddedData,
|
|
|
|
uint32 width, uint32 height,
|
|
|
|
color_space format);
|
|
|
|
ServerCursor(const ServerCursor* cursor);
|
|
|
|
|
|
|
|
virtual ~ServerCursor(void);
|
2003-01-13 01:51:01 +03:00
|
|
|
|
|
|
|
//! Returns the cursor's hot spot
|
2005-04-14 04:04:26 +04:00
|
|
|
void SetHotSpot(BPoint pt);
|
|
|
|
BPoint GetHotSpot(void)
|
|
|
|
{ return fHotSpot; }
|
|
|
|
|
|
|
|
void SetAppSignature(const char* signature);
|
|
|
|
const char* GetAppSignature() const
|
|
|
|
{ return fAppSignature.String(); }
|
|
|
|
|
|
|
|
void SetOwningTeam(team_id tid)
|
|
|
|
{ fOwningTeam=tid; }
|
|
|
|
team_id OwningTeam(void) const
|
|
|
|
{ return fOwningTeam; }
|
2003-02-24 18:47:06 +03:00
|
|
|
|
2003-02-20 23:14:57 +03:00
|
|
|
//! Returns the cursor's ID
|
2005-04-14 04:04:26 +04:00
|
|
|
int32 ID()
|
|
|
|
{ return fToken; }
|
|
|
|
private:
|
2003-06-23 06:54:52 +04:00
|
|
|
friend class CursorManager;
|
2003-01-23 04:20:28 +03:00
|
|
|
|
2005-04-14 04:04:26 +04:00
|
|
|
BPoint fHotSpot;
|
|
|
|
team_id fOwningTeam;
|
|
|
|
BString fAppSignature;
|
2003-01-13 01:51:01 +03:00
|
|
|
};
|
|
|
|
|
2005-04-14 04:04:26 +04:00
|
|
|
#endif // SERVERCURSOR_H_
|