home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1994, by WATCOM International Inc. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of WATCOM International Inc. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- /*************************************************************************
- *
- * WPen -- Wrapper for the Windows 95 Pen object.
- *
- *************************************************************************/
-
- #ifndef _WPEN_HPP_INCLUDED
- #define _WPEN_HPP_INCLUDED
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #ifndef _WCOLOR_HPP_INCLUDED
- # include "wcolor.hpp"
- #endif
-
- enum WPStockPen {
- WPWhitePen = 6,
- WPBlackPen = 7,
- WPInvisiblePen = 8
- };
-
- enum WPStyle {
- WPStyleSolid,
- WPStyleDash,
- WPStyleDot,
- WPStyleDashDot,
- WPStyleDashDotDot,
- };
-
- class WPenReference;
-
- class WCMCLASS WPen : public WObject {
- WDeclareSubclass( WPen, WObject );
-
- public:
-
- /**********************************************************
- * Constructors and Destructors
- *********************************************************/
-
- WPen();
-
- WPen( WPStockPen pen );
- WPen( const WColor & color, WInt width=1,
- WPStyle style=WPStyleSolid );
- WPen( const WPenHandle handle, WBool deleteHandle=FALSE );
- WPen( const WPen & pen );
-
- ~WPen();
-
- /**********************************************************
- * Properties
- *********************************************************/
-
- // Handle
-
- WPenHandle GetHandle() const;
-
- /**********************************************************
- * Methods
- *********************************************************/
-
- // Clear
-
- void Clear();
-
- // Create
-
- WBool Create( WPStockPen pen );
- WBool Create( const WColor & color, WInt width=1,
- WPStyle style=WPStyleSolid );
- WBool Create( const WPenHandle handle, WBool deleteHandle=FALSE );
- WBool Create( const WPen & pen );
-
- /**********************************************************
- * Static Properties
- *********************************************************/
-
- // BlackPen
-
- static const WPen & GetBlackPen();
-
- // InvisiblePen
-
- static const WPen & GetInvisiblePen(); // NOT same as null pen!
-
- // NullPen
-
- static const WPen & GetNullPen();
-
- // WhitePen
-
- static const WPen & GetWhitePen();
-
- /**********************************************************
- * Static Methods
- *********************************************************/
-
- // IsValidHandle
- //
- // Returns TRUE if the given handle is valid. Can
- // optionally specify whether or not a null handle
- // is "valid".
-
- static WBool IsValidHandle( WPenHandle handle,
- WBool nullValid=FALSE );
-
- /**********************************************************
- * Operators
- *********************************************************/
-
- WPen & operator=( const WPen & p );
- WPen & operator=( WPStockPen p );
-
- int operator==( const WPen & p ) const;
- int operator!=( const WPen & p ) const;
-
- /**********************************************************
- * Data members
- *********************************************************/
-
- private:
-
- WPenReference * _penRef;
- };
-
- #ifdef _DEBUG
- #define W_ISPENHANDLE(h) CHECKGDI(WPen::IsValidHandle((WPenHandle)h))
- #else
- #define W_ISPENHANDLE(h)
- #endif
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WPEN_HPP_INCLUDED
-