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>
|
|
|
|
// 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>
|
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.
|
|
|
|
*/
|
2003-01-13 01:51:01 +03:00
|
|
|
class ServerCursor : public ServerBitmap
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ServerCursor(BRect r, color_space cspace, int32 flags, BPoint hotspot, int32 bytesperrow=-1, screen_id screen=B_MAIN_SCREEN_ID);
|
|
|
|
ServerCursor(int8 *data);
|
|
|
|
ServerCursor(const ServerCursor *cursor);
|
|
|
|
~ServerCursor(void);
|
|
|
|
|
|
|
|
//! Returns the cursor's hot spot
|
2004-09-21 02:46:37 +04:00
|
|
|
BPoint GetHotSpot(void) { return fHotSpot; }
|
2003-01-13 01:51:01 +03:00
|
|
|
void SetHotSpot(BPoint pt);
|
2004-09-21 02:46:37 +04:00
|
|
|
const char *GetAppSignature(void) { return fAppSignature.String(); }
|
2003-02-24 18:47:06 +03:00
|
|
|
void SetAppSignature(const char *signature);
|
2004-10-06 03:01:37 +04:00
|
|
|
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
|
2004-09-21 02:46:37 +04:00
|
|
|
int32 ID(void) { return fToken; }
|
2003-01-13 01:51:01 +03:00
|
|
|
private:
|
2003-06-23 06:54:52 +04:00
|
|
|
friend class CursorManager;
|
2003-01-23 04:20:28 +03:00
|
|
|
|
2004-09-21 02:46:37 +04:00
|
|
|
BPoint fHotSpot;
|
2004-10-06 03:01:37 +04:00
|
|
|
team_id fOwningTeam;
|
2004-09-21 02:46:37 +04:00
|
|
|
BString fAppSignature;
|
2003-01-13 01:51:01 +03:00
|
|
|
};
|
|
|
|
|
2003-02-07 20:30:17 +03:00
|
|
|
#endif
|