Some work on cursors:
* Fixed a myriad of bugs all over the place, ranging from locking errors to deleting objects that don't belong to the one deleting them (hello HWInterface!) * Almost all ServerWindow cursor stuff was broken; I've replaced all commands to set a cursor with a single one AS_SET_CURSOR. * Renamed some cursor commands. * Changed the (broken) way ServerApp::fAppCursor was maintained - the application cursor is now NULL as long as possible. * Removed superfluous ServerCursor app signature stuff. * The BApplication will no longer duplicate the default/I-beam cursors, it will just reuse the default ones which now have fixed tokens. * As a result, changing the cursor is now working as expected, closing bug #102. * Rewrote Cursor.h, renamed private members to match our style guide. * Minor cleanup. What's still left to be done is reference counting the cursor objects to make them work right and reliable. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16237 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+22
-64
@@ -1,82 +1,40 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// 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: Cursor.h
|
||||
// Author: Frans van Nispen ([email protected])
|
||||
// Description: BCursor describes a view-wide or application-wide cursor.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
* Copyright 2006, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _CURSOR_H
|
||||
#define _CURSOR_H
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
#include <Archivable.h>
|
||||
#include <BeBuild.h>
|
||||
#include <InterfaceDefs.h>
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
|
||||
// Local Includes --------------------------------------------------------------
|
||||
|
||||
// Local Defines ---------------------------------------------------------------
|
||||
|
||||
// Globals ---------------------------------------------------------------------
|
||||
|
||||
// BCursor class ---------------------------------------------------------------
|
||||
class BCursor : BArchivable {
|
||||
public:
|
||||
BCursor(const void* cursorData);
|
||||
BCursor(BMessage* data);
|
||||
virtual ~BCursor();
|
||||
public:
|
||||
BCursor(const void* cursorData);
|
||||
BCursor(BMessage* data);
|
||||
virtual ~BCursor();
|
||||
|
||||
virtual status_t Archive(BMessage* into, bool deep = true) const;
|
||||
static BArchivable* Instantiate(BMessage* data);
|
||||
virtual status_t Archive(BMessage* archive, bool deep = true) const;
|
||||
static BArchivable* Instantiate(BMessage* archive);
|
||||
|
||||
// Private or reserved ---------------------------------------------------------
|
||||
virtual status_t Perform(perform_code d, void* arg);
|
||||
private:
|
||||
virtual status_t Perform(perform_code d, void* arg);
|
||||
|
||||
private:
|
||||
virtual void _ReservedCursor1();
|
||||
virtual void _ReservedCursor2();
|
||||
virtual void _ReservedCursor3();
|
||||
virtual void _ReservedCursor4();
|
||||
|
||||
virtual void _ReservedCursor1();
|
||||
virtual void _ReservedCursor2();
|
||||
virtual void _ReservedCursor3();
|
||||
virtual void _ReservedCursor4();
|
||||
private:
|
||||
friend class BApplication;
|
||||
friend class BView;
|
||||
|
||||
friend class BApplication;
|
||||
friend class BView;
|
||||
int32 fServerToken;
|
||||
bool fNeedToFree;
|
||||
|
||||
int32 m_serverToken;
|
||||
int32 m_needToFree;
|
||||
uint32 _reserved[6];
|
||||
uint32 _reserved[6];
|
||||
};
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endif // _CURSOR_H
|
||||
|
||||
/*
|
||||
* $Log $
|
||||
*
|
||||
* $Id $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user