home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
yacl-012.zip
/
ui
/
cursor.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-04-08
|
3KB
|
141 lines
#ifndef _cursor_h_ /* Fri Apr 1 10:23:43 1994 */
#define _cursor_h_
/*
*
* Copyright (C) 1994, M. A. Sridhar
*
*
* This software is Copyright M. A. Sridhar, 1994. You are free
* to copy, modify or distribute this software as you see fit,
* and to use it for any purpose, provided this copyright
* notice and the following disclaimer are included with all
* copies.
*
* DISCLAIMER
*
* The author makes no warranties, either expressed or implied,
* with respect to this software, its quality, performance,
* merchantability, or fitness for any particular purpose. This
* software is distributed AS IS. The user of this software
* assumes all risks as to its quality and performance. In no
* event shall the author be liable for any direct, indirect or
* consequential damages, even if the author has been advised
* as to the possibility of such damages.
*
*/
// Author: M. A. Sridhar
// This is an encapsulation of a cursor, which is the shape displayed at
// the position of the mouse pointer ({\it sprite,} in X-windows
// terminology). This value of this object may be modified via the
// assignment operator it provides, thus changing
// the shape displayed.
#if defined(__GNUC__)
#pragma interface
#endif
enum UI_CursorType {
UICursor_Default
, UICursor_Arrow
, UICursor_Wait
, UICursor_CrossHairs
, UICursor_IBeam
};
typedef long UI_CursorHandle;
#include "base/string.h"
class CL_EXPORT UI_Cursor: public CL_Object {
public:
// ------------------ Construction and destruction --------------------
UI_Cursor (UI_CursorType type = UICursor_Default);
// Create a cursor with the given type.
~UI_Cursor ();
// ------------------------ Querying ---------------------------
UI_CursorHandle Handle ();
// ----------------------- Comparison -------------------------
bool operator== (const UI_Cursor&) const;
bool operator== (UI_CursorType t) const;
bool operator== (const CL_Object&) const;
bool operator!= (const UI_Cursor& c) const {return ! (*this == c);};
bool operator!= (UI_CursorType t) const {return ! (*this == t);};
bool operator!= (const CL_Object& o) const {return ! (*this == o);};
// --------------------- Modification --------------------
void operator= (UI_CursorType type);
// Change this cursor to be the given predefined type.
void operator= (const char* cursor_name);
// Change this cursor to be the one with the given name.
// [Not yet available under OS/2 or Motif.]
void operator= (const UI_Cursor&)
{NotImplemented ("op = (UI_Cursor&)");};
void operator= (const CL_Object& o)
{NotImplemented ("op = (CL_Object&)");};
protected:
void _Destroy ();
UI_CursorType _type;
CL_String _name;
UI_CursorHandle _handle;
};
inline UI_CursorHandle UI_Cursor::Handle ()
{
return _handle;
}
inline bool UI_Cursor::operator== (const CL_Object& o) const
{
return operator== ((const UI_Cursor&) o);
}
inline bool UI_Cursor::operator== (UI_CursorType t) const
{
return _type == t;
}
#endif /* _cursor_h_ */