📄 cwindows.h
字号:
/*
CW : Character Windows
cwindows.h
CC should be defined for compilation with Cmerge.
If defined, the following flags inhibit definition
of the indicated constants.
NOALL Defines all the following:
NOCOLOR colors or ISA's
NODRAW drawing macros / constants
NOMB MB_* & ID's
NOMEMMGR LMEM_*
NOMENUS menus
NOMINMAX Macros min(a,b) and max(a,b)
NOMSG typedef MSG
NOPROCS procedure definitions (always for CS)
NORECT typedefs ARC, RRC
NOSCROLL SB_*
NOSUBSTYLES BS_*, LBS_*, ES_*
NOSWAP non-swapped version (currently only for small model)
NOVIRTUALKEYCODES VK_*
NOWINMESSAGES WM_*
NOWINSTYLES WS_*
NOWND WND / PWND typedef's or macros
NOWNDMACROS window creation macros
-- Created Mon Dec 16 14:28:48 1991 */
#ifdef NOALL
#define NOCOLOR
#define NODRAW
#define NOKEYSTATE
#define NOMB
#define NOMEMMGR
#define NOMENUS
#define NOMINMAX
#define NOMSG
#define NOPROCS
#define NORECT
#define NOSCROLL
#define NOSUBSTYLES
#define NOSWAP
#define NOVIRTUALKEYCODES
#define NOWINMESSAGES
#define NOWINSTYLES
#define NOWND
#define NOWNDMACROS
#endif /*NOALL*/
#ifdef OS2_INCLUDED
/* defined in OS2.H */
#undef CHAR
#endif /* OS2_INCLUDED */
#ifndef CC
/* -- Pcode Specific Definitions -- */
#ifndef EXPORT
#define EXPORT export
#endif
#ifndef NATIVE
#define NATIVE native
#endif
#else
/* -- Cmerge Compiler -- */
#ifndef CDECL
#define CDECL cdecl
#endif
#endif /*CC*/
#ifndef PASCAL
#define PASCAL pascal
#endif
#define FALSE 0
#define TRUE 1
#define NULL 0
#ifndef VAP_API
#define FAR far
#else
#define FAR near
#endif
#define LONG long
#define VOID void
#ifdef CC
#define NEAR near
#else
#define NEAR
#endif
#define FARPUBLIC FAR PASCAL /* all interfaces FAR */
#ifndef OS2_INCLUDED
/* defined in OS2.H */
typedef unsigned char BYTE;
typedef int BOOL;
typedef int (FARPUBLIC *PFN)(); /* General Procedure */
#endif /* !OS2_INCLUDED */
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef BOOL (FARPUBLIC *PFFN)(); /* BOOL Procedure */
typedef VOID (FARPUBLIC *PVFN)(); /* Void Procedure */
typedef WORD (FARPUBLIC *PWFN)(); /* Word Procedure */
typedef DWORD (FARPUBLIC *PLFN)(); /* DWORD Procedure */
typedef VOID (FARPUBLIC *LPFN)(); /* explicit FAR procedure */
typedef BYTE FAR * (FARPUBLIC *LPFN_LPB)();
typedef WORD HANDLE;
typedef unsigned BIT;
typedef unsigned BITS;
/* special type for WndProc pointers */
// typedef DWORD (FARPUBLIC *PLFN_WNDPROC)(struct _wnd *, WORD, WORD, DWORD);
/* BYTE/WORD types */
#ifndef CC /* Pcode => WORD */
typedef WORD AX;
typedef WORD AY;
typedef WORD RX;
typedef WORD RY;
typedef WORD ISA;
#else
typedef BYTE AX;
typedef BYTE AY;
typedef BYTE RX;
typedef BYTE RY;
typedef BYTE ISA;
#endif /*CC*/
typedef struct szi_
{
char * sz;
ISA isa;
} SZI;
typedef char FAR *LPSTR;
typedef int FAR *LPINT;
#ifndef NOMINMAX
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef OS2_INCLUDED
/* defined in OS2.H */
#define MAKELONG(l, h) ((long)(((unsigned)(l)) | ((unsigned long)((unsigned)(h))) << 16))
#define LOBYTE(w) ((BYTE) ((w) & 0xff))
#define HIBYTE(w) ((BYTE)(((WORD)(w) >> 8) & 0xff))
#endif /* !OS2_INCLUDED */
#define MAKEWORD(l, h) ((WORD)(((BYTE)(l)) | ((WORD)((BYTE)(h))) << 8))
#define LOWORD(l) ((WORD)(l))
#define HIWORD(l) ((WORD)(((DWORD)(l) >> 16) & 0xffff))
/* DCHAR = Double Byte Character */
typedef WORD DCHAR;
/* CHAR = unsigned char */
typedef unsigned char CHAR;
/* ACHAR = either a DCHAR or a CHAR */
#ifdef KANJI
typedef DCHAR ACHAR;
extern BOOL PASCAL fKanaAccel; /* set by application to choose accelerators */
#else
typedef CHAR ACHAR;
#endif
/*****************************************************************************/
#ifndef NORECT
typedef struct _rrc
{
BYTE rxLeft;
BYTE ryTop;
BYTE rxRight;
BYTE ryBottom;
};
typedef struct _arc
{
BYTE axLeft;
BYTE ayTop;
BYTE axRight;
BYTE ayBottom;
};
typedef struct _box
{
char chTopLeftCorner;
char chTopRightCorner;
char chBottomLeftCorner;
char chBottomRightCorner;
char chTopSide;
char chBottomSide;
char chLeftSide;
char chRightSide;
} BOX;
typedef BOX *PBOX;
extern BOX PASCAL boxSingle, PASCAL boxDouble;
extern BOX PASCAL boxActiveWnd;
extern BOX PASCAL boxInactiveWnd;
extern BYTE PASCAL axMac;
extern BYTE PASCAL ayMac;
/* all CW applications should work with screens up to 254x254 */
#define axMax 254
#define ayMax 254
#endif /*!NORECT*/
#ifndef NOWND
#ifndef cwExtraWnd
#ifdef CC
/* -- for CC compiler : fixed length */
#define cwExtraWnd 1
#else
/* -- for CS compiler : variable length */
#define cwExtraWnd
#endif
#endif
#ifdef BASED
typedef struct _wnd _based(pWndSeg) WND;
typedef WND *PWND;
typedef DWORD (FARPUBLIC *PLFN_WNDPROC)(PWND, WORD, WORD, DWORD);
typedef struct _rrc RRC;
typedef struct _rrc *NPRRC;
typedef struct _rrc _based(pWndSeg) *PRRC;
typedef struct _arc ARC;
typedef struct _arc *NPARC;
typedef struct _arc _based(pWndSeg) *PARC;
typedef VOID _based(pWndSeg) *PVOID;
#else
typedef VOID *PVOID;
typedef struct _wnd WND;
typedef WND *PWND;
typedef DWORD (FARPUBLIC *PLFN_WNDPROC)(PWND, WORD, WORD, DWORD);
typedef struct _rrc RRC;
typedef RRC *PRRC;
typedef RRC *NPRRC;
typedef struct _arc ARC;
typedef ARC *PARC;
typedef ARC *NPARC;
#endif
#ifdef BLADE
#ifdef BROADSWORD
typedef struct _wnd
{
WORD id;
BITS style:14;
BITS fCursorOn:1;
BITS fEnabled:1;
WORD wExtStyle;
ARC arcWindow;
ARC arcClipping;
ARC rrcInvalid;
BYTE hbrDraw; // Color for drawing.
BYTE hbrBackGround; // Color for background.
PLFN_WNDPROC pfnWndProc;
PWND pwndParent;
PWND pwndSibling;
PWND pwndChild;
WORD pcls;
BYTE axCursor;
BYTE ayCursor;
};
#else
typedef struct _wnd
{
WORD id;
BITS style:14;
BITS fCursorOn:1;
BITS fEnabled:1;
WORD wExtStyle;
ARC arcWindow;
ARC arcClipping;
#ifndef REVIEW /* size issue */
RRC rrcInvalid; /* overlap update info */
#endif
PLFN_WNDPROC pfnWndProc; /* Medium Model */
PWND pwndParent;
PWND pwndSibling;
PWND pwndChild;
BYTE axCursor;
BYTE ayCursor;
BYTE wndBytes;
#ifdef MLE
WORD rgwExtra[cwExtraWnd];
BYTE Pad;
#endif
};
#endif //BROADSWORD
#else //BLADE
typedef struct _wnd
{
WORD id;
BITS style:14;
BITS fCursorOn:1;
BITS fEnabled:1;
#ifdef BLADE
WORD wExtStyle;
#endif
#ifdef PROJECT_PWB
WORD wExtStyle;
#endif
ARC arcWindow;
ARC arcClipping;
#ifndef REVIEW /* size issue */
RRC rrcInvalid; /* overlap update info */
#endif
PLFN_WNDPROC pfnWndProc; /* Medium Model */
struct _wnd *pwndParent;
struct _wnd *pwndSibling;
struct _wnd *pwndChild;
BYTE axCursor;
BYTE ayCursor;
#ifndef NO_WNDEXTRA
WORD rgwExtra[cwExtraWnd];
#endif
};
#endif //BLADE
#ifndef BROADSWORD
typedef struct wndClass
{
struct wndClass *next;
WORD wStyle;
WORD wExtStyle;
PLFN_WNDPROC pfnWndProc;
WORD cbClsExtra;
WORD cbWndExtra;
WORD wClass;
} WNDCLASS;
typedef WNDCLASS *PWNDCLASS;
#else
typedef struct tagWNDCLASS
{
WORD style;
PLFN_WNDPROC lpfnWndProc;
int cbClsExtra;
int cbWndExtra;
WORD hInstance;
WORD hIcon;
WORD hCursor;
WORD hbrBackground;
WORD lpszMenuName;
WORD lpszClassName;
} WNDCLASS;
typedef WNDCLASS *PWNDCLASS;
typedef WNDCLASS NEAR *NPWNDCLASS;
typedef WNDCLASS FAR *LPWNDCLASS;
// Window internal class structure
typedef struct tagCLS
{
// NOTE: The order of the following fields is assumed.
struct tagCLS *pclsNext;
int cWndReferenceCount; // The number of windows registered with this class
WORD style;
PLFN_WNDPROC lpfnWndProc;
int cbClsExtra;
int cbWndExtra;
WORD hInstance;
WORD hIcon;
WORD hCursor;
WORD hbrBackground;
WORD lpszMenuName;
WORD lpszClassName;
} CLS;
typedef CLS *PCLS;
typedef CLS far *LPCLS;
typedef PCLS *PPCLS;
#endif
typedef BOOL (FARPUBLIC *PWFN_ENUM)(WORD, WORD );
#ifndef REVIEW /* size issue */ /* for wnd static window construction macros */
#define rrcInvalidStd {0, 0, 0, 0},
#else
#define rrcInvalidStd
#endif
// typedef WND *PWND;
#endif /*!NOWND*/
extern BYTE PASCAL fMousePresent; /* valid after init */
#ifndef NOPROCS
VOID FARPUBLIC GetProgDir(char *); /*OPTIONAL*/
BOOL FARPUBLIC FInitCow(void); /*OPTIONAL*/
VOID FARPUBLIC LeaveCow(BOOL); /*OPTIONAL*/
VOID FARPUBLIC BackToCow(BOOL); /*OPTIONAL*/
VOID FARPUBLIC EndCow(BOOL); /*OPTIONAL*/
/* Swapped Cow exit */
#ifndef NOSWAP
#ifdef CC
VOID FAR CDECL exit(int); /*OPTIONAL*/
#endif
#endif
#endif /* NOPROCS */
/*** mcb - mouse cursor block */
typedef struct mcb
{
WORD colHot; // Hot Spot for
WORD rowHot; // graphics mouse cursor.
WORD rgwAndMaskGfx[16]; // Bit map masks for
WORD rgwXorMaskGfx[16]; // graphics mouse cursor.
WORD wAndMaskText; // Character and Attribute masks for
WORD wXorMaskText; // text mouse cursor.
} MCB;
/*** mcb - mouse conditional off block */
typedef struct mcob
{
WORD xLeft;
WORD yTop;
WORD xRight;
WORD yBottom;
} MCOB;
/* Key state masks for mouse messages (in wParam) */
#define MK_LBUTTON 0x0001
#define MK_RBUTTON 0x0002
#define MK_SHIFT 0x0004
#define MK_CONTROL 0x0008
#define MK_MBUTTON 0x0010
#define MK_NONCLIENT 0x0060 /* either X or Y outside */
#define MK_NONCLIENT_X 0x0020
#define MK_NONCLIENT_Y 0x0040
#define MK_ALT 0x8000
#define MK_MENU 0x8000
#ifndef NOPROCS
BOOL FARPUBLIC FEnableMouse(BOOL);
VOID FARPUBLIC SetMouseCursor(MCB FAR *); /*OPTIONAL*/
VOID FARPUBLIC MouseConditionalOff( MCOB *); /*OPTIONAL*/
VOID FARPUBLIC SetMousePos(WORD, WORD); /*OPTIONAL*/
VOID FARPUBLIC SetMouseDoubleSpeed(WORD); /*OPTIONAL*/
BOOL FARPUBLIC SwapMouseButton(BOOL); /*OPTIONAL*/
WORD FARPUBLIC CbSizeMouseState(void); /*OPTIONAL*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -