2003-07-14 18:37:10 +04:00
|
|
|
//------------------------------------------------------------------------------
|
2005-07-18 04:22:08 +04:00
|
|
|
// Copyright (c) 2001-2005, Haiku
|
2003-07-14 18:37:10 +04: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.
|
|
|
|
//
|
2005-07-18 04:22:08 +04:00
|
|
|
// File Name: CursorSet.h
|
2003-07-14 18:37:10 +04:00
|
|
|
// Author: DarkWyrm <bpmagic@columbus.rr.com>
|
2005-07-18 04:22:08 +04:00
|
|
|
// Description: Private file encapsulating of the Haiku system cursor API
|
2003-07-14 18:37:10 +04:00
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------
|
2005-07-18 04:22:08 +04:00
|
|
|
#ifndef CURSORSET_H_
|
|
|
|
#define CURSORSET_H_
|
2003-07-14 18:37:10 +04:00
|
|
|
|
2003-07-25 19:30:18 +04:00
|
|
|
#include <Bitmap.h>
|
|
|
|
#include <Cursor.h>
|
|
|
|
#include <Message.h>
|
|
|
|
|
2003-07-14 18:37:10 +04:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
B_CURSOR_DEFAULT=0,
|
|
|
|
B_CURSOR_TEXT,
|
|
|
|
B_CURSOR_MOVE,
|
|
|
|
B_CURSOR_DRAG,
|
|
|
|
B_CURSOR_RESIZE,
|
|
|
|
B_CURSOR_RESIZE_NWSE,
|
|
|
|
B_CURSOR_RESIZE_NESW,
|
|
|
|
B_CURSOR_RESIZE_NS,
|
|
|
|
B_CURSOR_RESIZE_EW,
|
|
|
|
B_CURSOR_OTHER,
|
2003-10-10 06:33:38 +04:00
|
|
|
B_CURSOR_APP,
|
2003-07-14 18:37:10 +04:00
|
|
|
B_CURSOR_INVALID
|
|
|
|
} cursor_which;
|
|
|
|
|
2003-07-25 19:30:18 +04:00
|
|
|
class ServerCursor;
|
|
|
|
|
|
|
|
const char *CursorWhichToString(cursor_which which);
|
|
|
|
BBitmap *CursorDataToBitmap(int8 *data);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Class to manage system cursor sets
|
|
|
|
*/
|
2005-07-18 04:22:08 +04:00
|
|
|
class CursorSet : public BMessage {
|
2003-07-25 19:30:18 +04:00
|
|
|
public:
|
2005-07-18 04:22:08 +04:00
|
|
|
CursorSet(const char *name);
|
|
|
|
status_t Save(const char *path,int32 saveflags=0);
|
|
|
|
status_t Load(const char *path);
|
|
|
|
status_t AddCursor(cursor_which which,const BBitmap *cursor, const BPoint &hotspot);
|
|
|
|
status_t AddCursor(cursor_which which, int8 *data);
|
|
|
|
void RemoveCursor(cursor_which which);
|
|
|
|
status_t FindCursor(cursor_which which, BBitmap **cursor, BPoint *hotspot);
|
|
|
|
status_t FindCursor(cursor_which which, ServerCursor **cursor);
|
|
|
|
void SetName(const char *name);
|
|
|
|
const char *GetName(void);
|
2003-07-25 19:30:18 +04:00
|
|
|
};
|
|
|
|
|
2003-07-14 18:37:10 +04:00
|
|
|
#endif
|