home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1995 by Watcom International Corp. 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 Corp.
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- #ifndef _WDEF_HPP_INCLUDED
- #define _WDEF_HPP_INCLUDED
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,4);
- #pragma enum int;
- #endif
-
- // Include basic stuff...
-
- #ifndef _WDECL_HPP_INCLUDED
- #include "wdecl.hpp"
- #endif
-
- //
- // Get rid of conflicts...
- //
-
- #undef FindWindow
- #undef SendMessage
- #undef GetClassName
- #if defined( _UNICODE )
- #define FindWindow FindWindowW
- #define SendMessage SendMessageW
- #define GetClassName GetClassNameW
- #else
- #define FindWindow FindWindowA
- #define SendMessage SendMessageA
- #define GetClassName GetClassNameA
- #endif
-
- //
- // Forward declarations for classes
- //
-
- class WObject;
- class WToolItem;
- class WScrollBar;
-
- class WMessage;
- class WWindow;
- struct WInstance;
-
- //
- // General type definitions
- //
-
- #define LAST_32BIT 0xFFFFFFFF
- #define LAST_16BIT 0xFFFF
-
- #define LAST_16TO32BIT 0xFFFFFFFF
-
- typedef unsigned long WDialogID;
- typedef unsigned long WNotifyInfo;
-
- #if defined( HDWP )
- typedef HDWP WDeferMoveHandle;
- #else
- enum WDeferMoveHandle { NULLHDWP = 0, LASTHDWP = LAST_16TO32BIT };
- #endif
- #if defined( HWND )
- typedef HWND WWindowHandle;
- #else
- enum WWindowHandle { NULLHWND = 0, LASTHWND = LAST_16TO32BIT };
- #endif
- #if defined( HMENU )
- typedef HMENU WMenuHandle;
- #else
- enum WMenuHandle { NULLHMNU = 0, LASTHMNU = LAST_16TO32BIT };
- #endif
- #if defined( HDC )
- typedef HDC WDeviceHandle;
- #else
- enum WDeviceHandle { NULLHDEV = 0, LASTHDEV = LAST_16TO32BIT };
- #endif
- #if defined( HBITMAP )
- typedef HBITMAP WBitmapHandle;
- #else
- enum WBitmapHandle { NULLHBMP = 0, LASTHBMP = LAST_16TO32BIT };
- #endif
- #if defined( HICON )
- typedef HICON WIconHandle;
- #else
- enum WIconHandle { NULLHICON = 0, LASTHICON = LAST_16TO32BIT };
- #endif
- #if defined( HCURSOR )
- typedef HCURSOR WCursorHandle;
- #else
- enum WCursorHandle { NULLHCURSOR = 0, LASTHCURSOR =LAST_16TO32BIT };
- #endif
- #if defined( HBRUSH )
- typedef HPEN WBrushHandle;
- #else
- enum WBrushHandle { NULLHBRUSH = 0, LASTHBRUSH = LAST_16TO32BIT };
- #endif
- #if defined( HPEN )
- typedef HPEN WPenHandle;
- #else
- enum WPenHandle { NULLHPEN = 0, LASTHPEN = LAST_16TO32BIT };
- #endif
- #if defined( HFONT )
- typedef HFONT WFontHandle;
- #else
- enum WFontHandle { NULLHFONT = 0, LASTHFONT = LAST_16TO32BIT };
- #endif
- #if defined( HIMAGELIST )
- typedef HIMAGELIST WImageListHandle;
- #else
- enum WImageListHandle { NULLHIMAGELIST = 0, LASTHIMAGELIST = LAST_16TO32BIT };
- #endif
- #if defined( HMODULE )
- typedef HMODULE WModuleHandle;
- #else
- enum WModuleHandle { NULLHMODULE = 0, LASTHMODULE = LAST_16TO32BIT };
- #endif
- #if defined( HGLOBAL )
- typedef HGLOBAL WMemoryHandle;
- #else
- enum WMemoryHandle { NULLHMEM = 0, LASTHMEM = LAST_16TO32BIT };
- #endif
- #if defined( HKL )
- typedef HKL WKeyboardHandle;
- #else
- enum WKeyboardHandle { NULLKEYBOARD = 0, LASTHKEYBOARD = LAST_16TO32BIT };
- #endif
- enum WNotify { NULLNOTIFY = 0, LASTNOTIFY = LAST_16BIT };
- enum WCallbackProc { NULLCALLBACK = 0, LASTCALLBACK = LAST_32BIT };
-
- //
- // _ApplicationModule
- //
- // This global variable must be defined by any program that uses
- // classes that require resources.
-
- extern WModuleHandle _ApplicationModule;
-
-
- typedef struct WInstance * WINSTANCE;
-
- class WWindow;
-
- class WCMCLASS WRange {
-
- public:
-
- /***************************************************************
- * Constructors and Destructors
- ***************************************************************/
-
- WRange();
- WRange( WLong s, WLong e );
- WRange( const WRange & r );
-
- ~WRange();
-
- /***************************************************************
- * Properties
- ***************************************************************/
-
- WInt GetDistance() const;
-
- public:
-
- /***************************************************************
- * Data Members
- ***************************************************************/
-
- WLong start;
- WLong end;
- };
-
- enum WStyle { NULLWSTYLE = 0, LASTWSTYLE = LAST_32BIT };
-
- inline WStyle operator|( WStyle lhs, WStyle rhs )
- { return (WStyle)((unsigned long)lhs | (unsigned long)rhs); }
-
- inline WStyle operator&( WStyle lhs, WStyle rhs )
- { return (WStyle)((unsigned long)lhs & (unsigned long)rhs); }
-
- inline WStyle operator~( WStyle style )
- { return (WStyle)(~(unsigned long)style); }
-
- inline WStyle & operator|=( WStyle & lhs, WStyle rhs )
- { lhs = (WStyle)((unsigned long)lhs | (unsigned long)rhs); return lhs; }
-
- inline WStyle & operator&=( WStyle & lhs, WStyle rhs )
- { lhs = (WStyle)((unsigned long)lhs & (unsigned long)rhs); return lhs; }
-
- #ifndef _WCHAR_HPP_INCLUDED
- # include "wchar.hpp"
- #endif
- #ifndef _WBASECL_HPP_INCLUDED
- # include "wbasecl.hpp"
- #endif
- #ifndef _WMEMORY_HPP_INCLUDED
- # include "wmemory.hpp"
- #endif
- #ifndef _WDEBUG_HPP_INCLUDED
- # include "wdebug.hpp"
- #endif
-
- inline int WMin( int a, int b ) { return (a<b) ? a : b; }
- inline int WMax( int a, int b ) { return (a>b) ? a : b; }
- inline int WAbs( int a ) { return (a<0) ? -a : a; }
-
- extern unsigned long WProcessID;
- extern WBool WDraggingMode;
-
- enum WShowStyle {
- WWinStateHide = 0,
- WWinStateShowNormal = 1,
- WWinStateNormal = WWinStateShowNormal,
- WWinStateMinimized = 2,
- WWinStateShowMinimized = WWinStateMinimized,
- WWinStateMaximized = 3,
- WWinStateShowMaximized = WWinStateMaximized,
- WWinStateMaximize = WWinStateMaximized,
- WWinStateShowNoActivate = 4,
- WWinStateShow = 5,
- WWinStateMinimize = 6,
- WWinStateShowMinNoActivate = 7,
- WWinStateShowNA = 8,
- WWinStateShowRestore = 9,
- WWinStateShowDefault = 10,
- WWinStateMax = WWinStateShowDefault
- };
-
- // ------ Scrollbar Definitions ------- //
-
- enum WScrollMessage {
- WLineUp = 0,
- WLineLeft = WLineUp,
- WLineDown = 1,
- WLineRight = WLineDown,
- WPageUp = 2,
- WPageLeft = WPageUp,
- WPageDown = 3,
- WPageRight = WPageDown,
- WPosition = 4,
- WTrack = 5,
- WTop = 6,
- WLeft = WTop,
- WBottom = 7,
- WRight = WBottom,
- WEndScroll = 8,
- };
-
- enum WScrollDir {
- WScrollHorizontal = 0,
- WScrollVertical = 1,
- };
-
- enum WMouseFlagValues {
- WMKNone = 0x0000,
- WMKLeftDown = 0x0001,
- WMKLeftButton = WMKLeftDown,
- WMKRightDown = 0x0002,
- WMKRightButton = WMKRightDown,
- WMKShift = 0x0004,
- WMKControl = 0x0008,
- WMKMiddleDown = 0x0010,
- WMKMiddleButton = WMKMiddleDown,
- WMKAlt = 0x0020
- };
- typedef WULong WMouseFlags;
-
- #define WClass_SendMessage(type,msg,wp,lp) \
- (type)SendMessage(WMessage(msg,wp,lp))
-
- #define inline_win32 inline
- #define inline_win inline
- #define inline_win16
- #define inline_os2
-
- #if defined( DECLARE_HANDLE )
- typedef HWND _WHWND;
- #else
- typedef void *_WHWND;
- #endif
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WDEF_HPP_INCLUDED
-