wpitypes.h

来自「开放源码的编译器open watcom 1.6.0版的源代码」· C头文件 代码 · 共 786 行 · 第 1/3 页

H
786
字号
/****************************************************************************
*
*                            Open Watcom Project
*
*    Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
*  ========================================================================
*
*    This file contains Original Code and/or Modifications of Original
*    Code as defined in and that are subject to the Sybase Open Watcom
*    Public License version 1.0 (the 'License'). You may not use this file
*    except in compliance with the License. BY USING THIS FILE YOU AGREE TO
*    ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
*    provided with the Original Code and Modifications, and is also
*    available at www.sybase.com/developer/opensource.
*
*    The Original Code and all software distributed under the License are
*    distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
*    EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
*    ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
*    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
*    NON-INFRINGEMENT. Please see the License for the specific language
*    governing rights and limitations under the License.
*
*  ========================================================================
*
* Description:  WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE
*               DESCRIBE IT HERE!
*
****************************************************************************/


#ifndef WPITYPE_H
#define WPITYPE_H
/*
 Description:
 ============
    Some stuff for windows development.
*/

#include <setjmp.h>
/*
 * For developers concerned about NT issues, win1632.h is included here
 * to macro from windows to nt.
 */
#if defined( __OS2_PM__ ) || defined( __OS2__ )
#include "pm1632.h"
#else
#include "win1632.h"
#endif

#ifdef __WINDOWS_386__
    #define _W386FAR                    __far
#else
    #define _W386FAR
#endif

#define WPI_SIZEWINBMPFILEHDR           14
#define WPI_SIZEWINBMPINFOHDR           40
#define WPI_SIZEOS2BMPFILEHDR           78
#define WPI_SIZEOS2BMPINFOHDR           64

#pragma pack( 1 )
/*************************/
/* new types - both ways */
/*************************/

#if defined( __OS2_PM__ ) || defined( __OS2__ )
    // PM Side
    #define WPI_ERROR_ON_CREATE         1
    #define WPI_ERRORID                 ERRORID
    #define WPI_MRESULT                 MRESULT
    #define WPI_MINMAXINFO              TRACKINFO
    #define WPI_CLASSPROC               PFNWP
    #define WPI_HICON                   LONG
    #define WPI_HCURSOR                 LONG
    #define WPI_TASK                    TID
    #define WPI_CATCHBUF                jmp_buf
    #define WPI_HLIB                    HLIB
    #define WPI_BITMAPINFO              PM1632_BITMAPINFO2
    #define WPI_BITMAP                  PM1632_BITMAPINFOHEADER2
    #define WPI_BITMAPINFOHEADER        PM1632_BITMAPINFOHEADER2
    #define WPI_BITMAPFILEHEADER        BITMAPFILEHEADER
    #define WPI_BMPBITS                 PBYTE
    #define WPI_TEXTMETRIC              FONTMETRICS
    #define WPI_LPTEXTMETRIC            FONTMETRICS*
    #define WPI_LOGFONT                 FONTMETRICS
    #define WPI_LPLOGFONT               FONTMETRICS*
    #define WPI_FONT                    FATTRS*
    #define WPI_F_FONT                  wpi_f_font
    #define WPI_PARAM1                  MPARAM
    #define WPI_PARAM2                  MPARAM
    #define WPI_HACCEL                  HACCEL
    #define WPI_MSG                     PM1632_WINDOW_MSG
    #define WPI_QMSG                    QMSG
    #define WPI_WNDPROC                 PFNWP 
    #define WPI_PROC                    PFNWP
    #define WPI_PRES                    HPS
    #define WPI_POINT                   POINTL
    #define WPI_PPOINT                  PPOINTL
    #define WPI_LPPOINT                 PPOINTL
    #define WPI_PRECT                   PRECTL
    #define WPI_RECT                    RECTL
    #define WPI_RECTDIM                 LONG
    #define WPI_COLOUR                  COLOR
    #define WPI_RGBQUAD                 PM1632_RGB2
    #define WPI_INT2ULONG               ULONG
    #define WPI_DLGRESULT               MRESULT
    #define WPI_DLGRESULT2              MRESULT
    typedef void (__export APIENTRY *WPI_LINEDDAPROC) ( int, int, WPI_PARAM2 );
    typedef BOOL (__export APIENTRY *WPI_ENUMPROC) ( HWND, LONG );
    typedef int (__export APIENTRY *WPI_ENUMFONTPROC) ( WPI_LPLOGFONT,
                                                        WPI_LPTEXTMETRIC,
                                                        unsigned int, PSZ );
    typedef struct WPI_INST {
        HAB                     hab;
        HMODULE                 mod_handle;
    } WPI_INST;
    #define WPI_MENUITEM                MENUITEM
    #define WPI_MENUSTATE               MENUITEM

    #define WC_GROUPBOX                 WC_STATIC
#else
    #define WPI_ERROR_ON_CREATE         -1
    #define WPI_ERRORID                 int
    #define WPI_MRESULT                 LONG
    #define WPI_MINMAXINFO              MINMAXINFO
    #define WPI_CLASSPROC               WNDPROC
    #define WPI_HICON                   HICON
    #define WPI_HCURSOR                 HCURSOR
    #define WPI_TASK                    HANDLE
    #define WPI_CATCHBUF                CATCHBUF
    #define WPI_BITMAP                  BITMAP
    #define WPI_BITMAPINFO              BITMAPINFO
    #define WPI_BITMAPINFOHEADER        BITMAPINFOHEADER
    #define WPI_BITMAPFILEHEADER        BITMAPFILEHEADER
    #define WPI_BMPBITS                 LPSTR
    #define WPI_HLIB                    HANDLE
    #define WPI_TEXTMETRIC              TEXTMETRIC
    #define WPI_LPTEXTMETRIC            LPTEXTMETRIC
    #define WPI_LOGFONT                 LOGFONT
    #define WPI_LPLOGFONT               LPLOGFONT
    #define WPI_FONT                    HFONT
    #define WPI_F_FONT                  LOGFONT
    #define WPI_PARAM1                  WPARAM
    #define WPI_PARAM2                  LPARAM
    #define WPI_INST                    HINSTANCE
    #define WPI_HACCEL                  HANDLE
    #define WPI_MSG                     UINT
    #define WPI_QMSG                    MSG
    #define WPI_PRES                    HDC
    #define WPI_POINT                   POINT
    #define WPI_PPOINT                  PPOINT
    #define WPI_LPPOINT                 LPPOINT
    #define WPI_RECT                    RECT
    #define WPI_PRECT                   LPRECT
    #define WPI_RECTDIM                 int
    #define WPI_COLOUR                  COLORREF
    #define WPI_WNDPROC                 WNDPROC
    #define WPI_PROC                    FARPROC
    #define WPI_ENUMFONTPROC            int CALLBACK
    #define WPI_LINEDDAPROC             LINEDDAPROC
    #define WPI_CHOOSEFONT              CHOOSEFONT
    #define WPI_LPCHOOSEFONT            LPCHOOSEFONT
    #define WPI_RGBQUAD                 RGBQUAD
    #define WPI_INT2ULONG               int
    #define WPI_DLGRESULT               int
    #define WPI_DLGRESULT2              BOOL
    #define WPI_ENUMPROC                WNDENUMPROC
    #define WPI_IDYES                   IDYES
    #define WPI_IDNO                    IDNO
    #define WPI_IDOK                    IDOK
    #define WPI_IDABORT                 IDABORT
    #define WPI_IDRETRY                 IDRETRY
    #define WPI_IDIGNORE                IDIGNORE
    #define WPI_IDCANCEL                IDCANCEL
    #define WPI_IDERROR                 0
    #define WPI_MENUSTATE               UINT
    #define WPI_HANDLE                  HANDLE
    #define WPI_WNDCLASS                WNDCLASS
    typedef struct WPI_MENUITEM {
        LONG            iPosition;
        unsigned long   afStyle;
        unsigned long   afAttribute;
        unsigned long   id;
        HWND            hwndSubMenu;
        unsigned long   hItem;
    } WPI_MENUITEM;
    #define WC_BUTTON                   "button"
    #define WC_COMBOBOX                 "combobox"
    #define WC_MLE                      "edit"
    #define WC_ENTRYFIELD               "edit"
    #define WC_LISTBOX                  "listbox"
    #define WC_SCROLLBAR                "scrollbar"
    #define WC_STATIC                   "static"
    #define WC_GROUPBOX                 "button"
#endif

/*******************************/
/* types from one to the other */
/*******************************/

#if defined( __OS2_PM__ ) || defined( __OS2__ )
    #ifndef NULLHANDLE
    #define NULLHANDLE                  (LHANDLE) 0
    #endif
    #define HINSTANCE                   HAB
    #define HPALETTE                    HPAL
    #define GMEM_SHARE                  0
    #define WA_ACTIVE                   TRUE
    #define WA_INACTIVE                 FALSE
    #define STARTDOC                    DEVESC_STARTDOC
    #define ENDDOC                      DEVESC_ENDDOC
    #define NEWFRAME                    DEVESC_NEWFRAME
    #define DT_SINGLELINE               0
    #define DT_CALCRECT                 DT_QUERYEXTENT
    #define KEY_ASYNC_DOWN              0x8000
    #define KEY_ASYNC_PRESSED           0x0002
    #define SB_HORZ                     SBS_HORZ
    #define SB_VERT                     SBS_VERT
    #define SB_BOTH                     SBS_HORZ|SBS_VERT
    #define SB_CTL                      SBS_HORZ|SBS_VERT
    #define SB_THUMBPOSITION            SB_SLIDERPOSITION
    #define SB_THUMBTRACK               SB_SLIDERTRACK
    #define SB_TOP                      SB_SLIDERPOSITION
    #define SB_LEFT                     SB_SLIDERPOSITION
    #define SB_BOTTOM                   SB_SLIDERPOSITION
    #define SB_RIGHT                    SB_SLIDERPOSITION
    #define LPINT                       int*
    #define HCURSOR                     HPOINTER
    #define R2_NOT                      FM_INVERT
    #define R2_NOP                      FM_LEAVEALONE
    #define R2_BLACK                    FM_ZERO
    #define R2_WHITE                    FM_ONE
    #define R2_COPYPEN                  FM_OVERPAINT
    #define R2_NOTCOPYPEN               FM_NOTCOPYSRC
    #define R2_MERGEPENNOT              FM_MERGSRCNOT
    #define R2_XORPEN                   FM_XOR
    #define R2_MASKPEN                  FM_AND
    #define R2_MERGEPEN                 FM_OR
    #define HELP_CONTEXT                0x0001
    #define HELP_QUIT                   0x0002
    #define HELP_INDEX                  0x0003
    #define HELP_CONTENTS               0x0006
    #define HELP_HELPONHELP             0x0004
    #define HELP_SETINDEX               0x0005
    #define HELP_SETCONTENTS            0x0007
    #define HELP_CONTEXTPOPUP           0x0008
    #define HELP_FORCEFILE              0x0009
    #define HELP_KEY                    0x0101
    #define HELP_COMMAND                0x0102
    #define HELP_PARTIALKEY             0x0105
    #define HELP_MULTIKEY               0x0201
    #define HELP_SETWINPOS              0x0203

    /* Many Windows CS flags simply have equivalent in OS/2, or are done
       at Window creation time. Note the comments below. */
    #define CS_BYTEALIGNWINDOW          0       // see FCF_NOBYTEALIGN
    #define CS_CLASSDC                  0       // no OS/2 equiv.
    #define CS_DBLCLKS                  0       // no OS/2 equiv.
    #define CS_GLOBALCLASS              CS_PUBLIC
    #define CS_HREDRAW                  CS_SIZEREDRAW

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?