CursorManager is initialized with default system cursors - need to add move cursor.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3990 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm 2003-07-15 23:27:50 +00:00
parent 910d993921
commit 07dec7c1ca
5 changed files with 124 additions and 34 deletions

View File

@ -116,17 +116,8 @@ AppServer::AppServer(void)
// Create the cursor manager. Object declared in CursorManager.cpp
cursormanager=new CursorManager();
// Default cursor data stored in CursorData.cpp
// TODO: fix the cursor display
extern int8 default_cursor_data[];
ServerCursor *sc=new ServerCursor(default_cursor_data);
cursormanager->AddCursor(sc);
cursormanager->ChangeCursor(B_CURSOR_DEFAULT, sc->ID());
cursormanager->SetCursor(B_CURSOR_DEFAULT);
// Create the bitmap allocator. Object declared in BitmapManager.cpp
bitmapmanager=new BitmapManager();

View File

@ -1,3 +1,29 @@
//------------------------------------------------------------------------------
// Copyright (c) 2001-2002, OpenBeOS
//
// 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: CursorData.cpp
// Author: DarkWyrm <bpmagic@columbus.rr.com>
// Description: File containing default cursor data
//
//------------------------------------------------------------------------------
#include <SupportDefs.h>
/*
@ -64,6 +90,56 @@ int8 default_cursor_data[] = {
0,0
};
int8 default_text_data[] = {
0x10, 0x01, 0x07, 0x07, 0x00, 0x00, 0x06, 0xC0, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0xC0, 0x00, 0x00, 0x06, 0xC0, 0x0F, 0xE0, 0x07, 0xC0, 0x03, 0x80,
0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x07, 0xC0, 0x0F, 0xE0,
0x06, 0xC0
};
int8 default_drag_data[] = {
0x10, 0x01, 0x00, 0x00, 0xFF, 0x00, 0x81, 0x00, 0x82, 0x00, 0x82, 0x00, 0x81, 0xFF, 0x80, 0x81, 0xB0, 0x41, 0xC8, 0x41, 0x04, 0x81,
0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0xFF, 0xFF, 0x00, 0xFF, 0x00, 0xFE, 0x00, 0xFE, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0x07, 0xFF, 0x03, 0xFF, 0x03, 0xFF, 0x03, 0xFF, 0x03, 0xFF, 0x03, 0xFF, 0x03, 0xFF,
0x03, 0xFF
};
int8 default_resize_data[] = {
0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x3E, 0x78, 0x1E, 0x70, 0x0E, 0x68, 0x16, 0x44, 0x22, 0x02, 0x40, 0x01, 0x80, 0x01, 0x80,
0x02, 0x40, 0x44, 0x22, 0x68, 0x16, 0x70, 0x0E, 0x78, 0x1E, 0x7C, 0x3E, 0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0xFC, 0x3F, 0xF8, 0x1F,
0xFC, 0x3F, 0xEE, 0x77, 0xC7, 0xE3, 0x03, 0xC0, 0x03, 0xC0, 0xC7, 0xE3, 0xEE, 0x77, 0xFC, 0x3F, 0xF8, 0x1F, 0xFC, 0x3F, 0xFE, 0x7F,
0xFE, 0x7F
};
int8 default_resize_ew_data[] = {
0x10, 0x01, 0x07, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x11, 0x10, 0x31, 0x18, 0x71, 0x1C, 0x71, 0x1C,
0x31, 0x18, 0x11, 0x10, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x80, 0x03, 0x80, 0x0B, 0xA0,
0x1B, 0xB0, 0x3B, 0xB8, 0x7B, 0xBC, 0xFB, 0xBE, 0xFB, 0xBE, 0x7B, 0xBC, 0x3B, 0xB8, 0x1B, 0xB0, 0x0B, 0xA0, 0x03, 0x80, 0x03, 0x80,
0x01, 0x00
};
int8 default_resize_ns_data[] = {
0x10, 0x01, 0x07, 0x07, 0x00, 0x00, 0x01, 0x80, 0x03, 0xC0, 0x07, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFE, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x07, 0xE0, 0x03, 0xC0, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x03, 0xC0, 0x07, 0xE0, 0x0F, 0xF0,
0x1F, 0xF8, 0x00, 0x00, 0x7F, 0xFE, 0xFF, 0xFF, 0x7F, 0xFE, 0x00, 0x00, 0x1F, 0xF8, 0x0F, 0xF0, 0x07, 0xE0, 0x03, 0xC0, 0x01, 0x80,
0x00, 0x00
};
int8 default_resize_nwse_data[] = {
0x10, 0x01, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x08, 0x1E, 0x10, 0x1C, 0x20, 0x18, 0x40, 0x10, 0x80, 0x01, 0x08,
0x02, 0x18, 0x04, 0x38, 0x08, 0x78, 0x10, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xCC, 0x3F, 0x9C,
0x3F, 0x38, 0x3E, 0x70, 0x3C, 0xE4, 0x39, 0xCC, 0x33, 0x9C, 0x27, 0x3C, 0x0E, 0x7C, 0x1C, 0xFC, 0x39, 0xFC, 0x33, 0xFC, 0x00, 0x00,
0x00, 0x00
};
int8 default_resize_nesw_data[] = {
0x10, 0x01, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xF8, 0x08, 0x78, 0x04, 0x38, 0x02, 0x18, 0x01, 0x08, 0x10, 0x80,
0x18, 0x40, 0x1C, 0x20, 0x1E, 0x10, 0x1F, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0xFC, 0x39, 0xFC,
0x1C, 0xFC, 0x0E, 0x7C, 0x27, 0x3C, 0x33, 0x9C, 0x39, 0xCC, 0x3C, 0xE4, 0x3E, 0x70, 0x3F, 0x38, 0x3F, 0x9C, 0x3F, 0xCC, 0x00, 0x00,
0x00, 0x00
};
// known good cursor data for testing rest of system
int8 cross_cursor[] = {16,1,5,5,
14,0,4,0,4,0,4,0,128,32,241,224,128,32,4,0,

View File

@ -0,0 +1,13 @@
#ifndef CURSORDATA_H_
#define CURSORDATA_H_
extern int8 default_cursor_data[];
extern int8 default_text_data[];
extern int8 default_drag_data[];
extern int8 default_resize_data[];
extern int8 default_resize_ew_data[];
extern int8 default_resize_ns_data[];
extern int8 default_resize_nwse_data[];
extern int8 default_resize_nesw_data[];
#endif

View File

@ -28,6 +28,7 @@
#include "Desktop.h"
#include "CursorManager.h"
#include "ServerCursor.h"
#include "CursorData.h"
#include <Errors.h>
#include <string.h>
@ -44,15 +45,39 @@ CursorManager::CursorManager(void)
_tokenizer.ExcludeValue(B_ERROR);
// Set system cursors to "unassigned"
_defaultcsr=NULL;
_textcsr=NULL;
ServerCursor *cdefault=new ServerCursor(default_cursor_data);
AddCursor(cdefault);
_defaultcsr=cdefault;
ServerCursor *ctext=new ServerCursor(default_text_data);
AddCursor(ctext);
_textcsr=ctext;
ServerCursor *cdrag=new ServerCursor(default_drag_data);
AddCursor(cdrag);
_dragcsr=cdrag;
_movecsr=NULL;
_dragcsr=NULL;
_resizecsr=NULL;
_resize_nwse_csr=NULL;
_resize_nesw_csr=NULL;
_resize_ns_csr=NULL;
_resize_ew_csr=NULL;
ServerCursor *cresize=new ServerCursor(default_resize_data);
AddCursor(cresize);
_resizecsr=cresize;
ServerCursor *cresizeew=new ServerCursor(default_resize_ew_data);
AddCursor(cresizeew);
_resize_ew_csr=cresizeew;
ServerCursor *cresizenesw=new ServerCursor(default_resize_nesw_data);
AddCursor(cresizenesw);
_resize_nesw_csr=cresizenesw;
ServerCursor *cresizens=new ServerCursor(default_resize_ns_data);
AddCursor(cresizens);
_resize_ns_csr=cresizens;
ServerCursor *cresizenwse=new ServerCursor(default_resize_nwse_data);
AddCursor(cresizenwse);
_resize_nwse_csr=cresizenwse;
}
//! Does all the teardown

View File

@ -29,26 +29,11 @@
#include <List.h>
#include <OS.h>
#include <SysCursor.h>
#include "TokenHandler.h"
class ServerCursor;
// Duplicate definition - do NOT include <Cursor.h> or errors will abound...
// We do this so that we don't have to modify R5's headers in order to compile
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
} cursor_which;
/*!
\class CursorManager CursorManager.h
\brief Handles almost all cursor management functions for the system