Annotation of os232sdk/toolkt20/c/os2h/pmbitmap.h, revision 1.1

1.1     ! root        1: /***************************************************************************\
        !             2: *
        !             3: * Module Name: PMBITMAP.H
        !             4: *
        !             5: * OS/2 Presentation Manager Bit Map, Icon and Pointer type declarations.
        !             6: *
        !             7: * Copyright (c) International Business Machines Corporation 1981, 1988, 1989
        !             8: * Copyright (c) Microsoft Corporation 1981, 1988, 1989
        !             9: *
        !            10: \***************************************************************************/
        !            11: 
        !            12: /* XLATOFF */
        !            13: #ifndef BITMAPS_INCLUDED    /* multiple include protection */
        !            14: 
        !            15: #pragma pack(2)      /* pack on wordboundary */
        !            16: /* XLATON */
        !            17: 
        !            18: #define BITMAPS_INCLUDED
        !            19: 
        !            20: /* rastor operations defined for GpiBitBlt */
        !            21: #define ROP_SRCCOPY                0x00CCL
        !            22: #define ROP_SRCPAINT               0x00EEL
        !            23: #define ROP_SRCAND                 0x0088L
        !            24: #define ROP_SRCINVERT              0x0066L
        !            25: #define ROP_SRCERASE               0x0044L
        !            26: #define ROP_NOTSRCCOPY             0x0033L
        !            27: #define ROP_NOTSRCERASE            0x0011L
        !            28: #define ROP_MERGECOPY              0x00C0L
        !            29: #define ROP_MERGEPAINT             0x00BBL
        !            30: #define ROP_PATCOPY                0x00F0L
        !            31: #define ROP_PATPAINT               0x00FBL
        !            32: #define ROP_PATINVERT              0x005AL
        !            33: #define ROP_DSTINVERT              0x0055L
        !            34: #define ROP_ZERO                   0x0000L
        !            35: #define ROP_ONE                    0x00FFL
        !            36: 
        !            37: /* Blt options for GpiBitBlt */
        !            38: #define BBO_OR                          0L
        !            39: #define BBO_AND                         1L
        !            40: #define BBO_IGNORE                      2L
        !            41: 
        !            42: /* Fill options for GpiFloodFill */
        !            43: #define FF_BOUNDARY                     0L
        !            44: #define FF_SURFACE                      1L
        !            45: 
        !            46: /* error return for GpiSetBitmap */
        !            47: #define HBM_ERROR            ((HBITMAP)-1L)
        !            48: 
        !            49: #ifndef INCL_DDIDEFS
        !            50: 
        !            51: /*** bitmap and pel functions */
        !            52: /* XLATOFF */
        !            53: #ifdef INCL_16
        !            54:     #define GpiBitBlt Gpi16BitBlt
        !            55:     #define GpiDeleteBitmap Gpi16DeleteBitmap
        !            56:     #define GpiLoadBitmap Gpi16LoadBitmap
        !            57:     #define GpiSetBitmap Gpi16SetBitmap
        !            58:     #define GpiWCBitBlt Gpi16WCBitBlt
        !            59: #endif /* INCL_16 */
        !            60: /* XLATON */
        !            61: LONG     APIENTRY GpiBitBlt( HPS hpsTarget, HPS hpsSource, LONG lCount
        !            62:                            , PPOINTL aptlPoints, LONG lRop, ULONG flOptions );
        !            63: BOOL     APIENTRY GpiDeleteBitmap( HBITMAP hbm );
        !            64: HBITMAP  APIENTRY GpiLoadBitmap( HPS hps, HMODULE Resource, USHORT idBitmap
        !            65:                                , LONG lWidth, LONG lHeight );
        !            66: HBITMAP  APIENTRY GpiSetBitmap(HPS hps, HBITMAP hbm );
        !            67: LONG     APIENTRY GpiWCBitBlt( HPS hpsTarget, HBITMAP hbmSource, LONG lCount
        !            68:                              , PPOINTL aptlPoints, LONG lRop, ULONG flOptions );
        !            69: 
        !            70: #endif /* no INCL_DDIDEFS */
        !            71: 
        !            72: #ifdef INCL_GPIBITMAPS
        !            73: 
        !            74: /* usage flags for GpiCreateBitmap */
        !            75: #define CBM_INIT        0x0004L
        !            76: 
        !            77: /* bitmap parameterization used by GpiCreateBitmap and others */
        !            78: typedef struct _BITMAPINFOHEADER {      /* bmp */
        !            79:     ULONG  cbFix;
        !            80:     USHORT cx;
        !            81:     USHORT cy;
        !            82:     USHORT cPlanes;
        !            83:     USHORT cBitCount;
        !            84: } BITMAPINFOHEADER;
        !            85: typedef BITMAPINFOHEADER FAR *PBITMAPINFOHEADER;
        !            86: 
        !            87: /* RGB data for _BITMAPINFO struct */
        !            88: typedef struct _RGB {           /* rgb */
        !            89:     BYTE bBlue;
        !            90:     BYTE bGreen;
        !            91:     BYTE bRed;
        !            92: } RGB;
        !            93: 
        !            94: /* bitmap data used by GpiSetBitmapBits and others */
        !            95: typedef struct _BITMAPINFO {    /* bmi */
        !            96:     ULONG  cbFix;
        !            97:     USHORT cx;
        !            98:     USHORT cy;
        !            99:     USHORT cPlanes;
        !           100:     USHORT cBitCount;
        !           101:     RGB    argbColor[1];
        !           102: } BITMAPINFO;
        !           103: typedef BITMAPINFO FAR *PBITMAPINFO;
        !           104: 
        !           105: #define     BCA_UNCOMP      0L
        !           106: 
        !           107: #define     BRU_METRIC      0L
        !           108: 
        !           109: #define     BRA_BOTTOMUP    0L
        !           110: 
        !           111: #define     BRH_NOTHALFTONED    0L
        !           112: #define     BRH_ERRORDIFFUSION  1L
        !           113: #define     BRH_PANDA           2L
        !           114: #define     BRH_SUPERCIRCLE     3L
        !           115: 
        !           116: #define     BCE_RGB         0L
        !           117: 
        !           118: typedef struct _BITMAPINFOHEADER2 {     /* bmp2  */
        !           119:     ULONG  cbFix;            /* Length of structure                       */
        !           120:     ULONG  cx;               /* Bit-map width in pels                     */
        !           121:     ULONG  cy;               /* Bit-map height in pels                    */
        !           122:     USHORT cPlanes;          /* Number of bit planes                      */
        !           123:     USHORT cBitCount;        /* Number of bits per pel within a plane     */
        !           124:     ULONG  ulCompression;    /* Compression scheme used to store the bitmap */
        !           125:     ULONG  cbImage;          /* Length of bit-map storage data in bytes   */
        !           126:     ULONG  cxResolution;     /* x resolution of target device             */
        !           127:     ULONG  cyResolution;     /* y resolution of target device             */
        !           128:     ULONG  cclrUsed;         /* Number of color indices used              */
        !           129:     ULONG  cclrImportant;    /* Number of important color indices         */
        !           130:     USHORT usUnits;          /* Units of measure                          */
        !           131:     USHORT usReserved;       /* Reserved                                  */
        !           132:     USHORT usRecording;      /* Recording algorithm                       */
        !           133:     USHORT usRendering;      /* Halftoning algorithm                      */
        !           134:     ULONG  cSize1;           /* Size value 1                              */
        !           135:     ULONG  cSize2;           /* Size value 2                              */
        !           136:     ULONG  ulColorEncoding;  /* Color encoding                            */
        !           137:     ULONG  ulIdentifier;     /* Reserved for application use              */
        !           138: } BITMAPINFOHEADER2;
        !           139: typedef BITMAPINFOHEADER2 FAR *PBITMAPINFOHEADER2;
        !           140: 
        !           141: typedef struct _RGB2 {           /* rgb2 */
        !           142:     BYTE bBlue;                 /* Blue component of the color definition */
        !           143:     BYTE bGreen;                /* Green component of the color definition*/
        !           144:     BYTE bRed;                  /* Red component of the color definition  */
        !           145:     BYTE fcOptions;             /* Reserved, must be zero                 */
        !           146: } RGB2;
        !           147: typedef RGB2 FAR *PRGB2;
        !           148: 
        !           149: typedef struct _BITMAPINFO2 {   /* bmi2 */
        !           150:     ULONG  cbFix;            /* Length of fixed portion of structure      */
        !           151:     ULONG  cx;               /* Bit-map width in pels                     */
        !           152:     ULONG  cy;               /* Bit-map height in pels                    */
        !           153:     USHORT cPlanes;          /* Number of bit planes                      */
        !           154:     USHORT cBitCount;        /* Number of bits per pel within a plane     */
        !           155:     ULONG  ulCompression;    /* Compression scheme used to store the bitmap */
        !           156:     ULONG  cbImage;          /* Length of bit-map storage data in bytes   */
        !           157:     ULONG  cxResolution;     /* x resolution of target device             */
        !           158:     ULONG  cyResolution;     /* y resolution of target device             */
        !           159:     ULONG  cclrUsed;         /* Number of color indices used              */
        !           160:     ULONG  cclrImportant;    /* Number of important color indices         */
        !           161:     USHORT usUnits;          /* Units of measure                          */
        !           162:     USHORT usReserved;       /* Reserved                                  */
        !           163:     USHORT usRecording;      /* Recording algorithm                       */
        !           164:     USHORT usRendering;      /* Halftoning algorithm                      */
        !           165:     ULONG  cSize1;           /* Size value 1                              */
        !           166:     ULONG  cSize2;           /* Size value 2                              */
        !           167:     ULONG  ulColorEncoding;  /* Color encoding                            */
        !           168:     ULONG  ulIdentifier;     /* Reserved for application use              */
        !           169: } BITMAPINFO2;
        !           170: typedef BITMAPINFO2 FAR *PBITMAPINFO2;
        !           171: 
        !           172: /* error return code for GpiSet/QueryBitmapBits */
        !           173: #define BMB_ERROR                     (-1L)
        !           174: 
        !           175: #ifndef INCL_DDIDEFS
        !           176: 
        !           177: /*** bitmap and pel functions */
        !           178: /* XLATOFF */
        !           179: #ifdef INCL_16
        !           180:     #define GpiCreateBitmap Gpi16CreateBitmap
        !           181:     #define GpiSetBitmapBits Gpi16SetBitmapBits
        !           182:     #define GpiSetBitmapDimension Gpi16SetBitmapDimension
        !           183:     #define GpiSetBitmapId Gpi16SetBitmapId
        !           184:     #define GpiQueryBitmapBits Gpi16QueryBitmapBits
        !           185:     #define GpiQueryBitmapDimension Gpi16QueryBitmapDimension
        !           186:     #define GpiQueryBitmapHandle Gpi16QueryBitmapHandle
        !           187:     #define GpiQueryBitmapParameters Gpi16QueryBitmapParameters
        !           188:     #define GpiQueryBitmapInfoHeader Gpi16QueryBitmapInfoHeader
        !           189:     #define GpiQueryDeviceBitmapFormats Gpi16QueryDeviceBitmapFormats
        !           190:     #define GpiSetPel Gpi16SetPel
        !           191:     #define GpiQueryPel Gpi16QueryPel
        !           192:     #define GpiFloodFill Gpi16FloodFill
        !           193:     #define GpiDrawBits Gpi16DrawBits
        !           194: #endif /* INCL_16 */
        !           195: /* XLATON */
        !           196: HBITMAP APIENTRY GpiCreateBitmap( HPS hps, PBITMAPINFOHEADER2 pbmpNew
        !           197:                                 , ULONG flOptions, PBYTE pbInitData
        !           198:                                 , PBITMAPINFO2 pbmiInfoTable );
        !           199: LONG    APIENTRY GpiSetBitmapBits( HPS hps, LONG lScanStart, LONG lScans
        !           200:                                  , PBYTE pbBuffer, PBITMAPINFO2 pbmiInfoTable );
        !           201: BOOL    APIENTRY GpiSetBitmapDimension( HBITMAP hbm, PSIZEL psizlBitmapDimension );
        !           202: BOOL    APIENTRY GpiSetBitmapId( HPS hps, HBITMAP hbm, LONG lLcid );
        !           203: LONG    APIENTRY GpiQueryBitmapBits( HPS hps, LONG lScanStart, LONG lScans
        !           204:                                    , PBYTE pbBuffer, PBITMAPINFO2 pbmiInfoTable );
        !           205: BOOL    APIENTRY GpiQueryBitmapDimension( HBITMAP hbm, PSIZEL psizlBitmapDimension );
        !           206: HBITMAP APIENTRY GpiQueryBitmapHandle( HPS hps, LONG lLcid );
        !           207: BOOL    APIENTRY GpiQueryBitmapParameters( HBITMAP hbm
        !           208:                                          , PBITMAPINFOHEADER pbmpData );
        !           209: BOOL    APIENTRY GpiQueryBitmapInfoHeader( HBITMAP hbm
        !           210:                                          , PBITMAPINFOHEADER2 pbmpData );
        !           211: BOOL    APIENTRY GpiQueryDeviceBitmapFormats( HPS hps, LONG lCount
        !           212:                                             , PLONG alArray );
        !           213: 
        !           214: LONG    APIENTRY GpiSetPel( HPS hps, PPOINTL pptlPoint );
        !           215: LONG    APIENTRY GpiQueryPel( HPS hps, PPOINTL pptlPoint );
        !           216: 
        !           217: LONG    APIENTRY GpiFloodFill( HPS hps, LONG lOptions, LONG lColor );
        !           218: LONG    APIENTRY GpiDrawBits( HPS hps, PVOID pBits,
        !           219:                               PBITMAPINFO2 pbmiInfoTable, LONG lCount,
        !           220:                               PPOINTL aptlPoints, LONG lRop,
        !           221:                               ULONG flOptions );
        !           222: 
        !           223: #endif /* no INCL_DDIDEFS */
        !           224: 
        !           225: /*
        !           226:  * This is the file format structure for Bit Maps, Pointers and Icons
        !           227:  * as stored in the resource file of a PM application.
        !           228:  *
        !           229:  * Notes on file format:
        !           230: grepos2ch BITMAPFILEHEADER entry is immediately followed by the color table
        !           231:  *   for the bit map bits it references.
        !           232:  *   Icons and Pointers contain two BITMAPFILEHEADERs for each ARRAYHEADER
        !           233:  *   item.  The first one is for the ANDXOR mask, the second is for the
        !           234:  *   COLOR mask.  All offsets are absolute based on the start of the FILE.
        !           235:  */
        !           236: 
        !           237: typedef struct _BITMAPFILEHEADER { /* bfh */
        !           238:     USHORT    usType;
        !           239:     ULONG     cbSize;
        !           240:     SHORT     xHotspot;
        !           241:     SHORT     yHotspot;
        !           242:     ULONG     offBits;
        !           243:     BITMAPINFOHEADER bmp;
        !           244: } BITMAPFILEHEADER;
        !           245: typedef BITMAPFILEHEADER FAR *PBITMAPFILEHEADER;
        !           246: 
        !           247: /*
        !           248:  * This is the 1.2 device independent format header
        !           249:  */
        !           250: typedef struct _BITMAPARRAYFILEHEADER {    /* bafh */
        !           251:     USHORT    usType;
        !           252:     ULONG     cbSize;
        !           253:     ULONG     offNext;
        !           254:     USHORT    cxDisplay;
        !           255:     USHORT    cyDisplay;
        !           256:     BITMAPFILEHEADER bfh;
        !           257: } BITMAPARRAYFILEHEADER;
        !           258: typedef BITMAPARRAYFILEHEADER FAR *PBITMAPARRAYFILEHEADER;
        !           259: 
        !           260: 
        !           261: typedef struct _BITMAPFILEHEADER2 { /* bfh2 */
        !           262:     USHORT    usType;
        !           263:     ULONG     cbSize;
        !           264:     SHORT     xHotspot;
        !           265:     SHORT     yHotspot;
        !           266:     ULONG     offBits;
        !           267:     BITMAPINFOHEADER2 bmp2;
        !           268: } BITMAPFILEHEADER2;
        !           269: typedef BITMAPFILEHEADER2 FAR *PBITMAPFILEHEADER2;
        !           270: 
        !           271: 
        !           272: typedef struct _BITMAPARRAYFILEHEADER2 { /* bafh2 */
        !           273:     USHORT    usType;
        !           274:     ULONG     cbSize;
        !           275:     ULONG     offNext;
        !           276:     USHORT    cxDisplay;
        !           277:     USHORT    cyDisplay;
        !           278:     BITMAPFILEHEADER2 bfh2;
        !           279: } BITMAPARRAYFILEHEADER2;
        !           280: typedef BITMAPARRAYFILEHEADER2 FAR *PBITMAPARRAYFILEHEADER2;
        !           281: 
        !           282: /*
        !           283:  * These are the identifying values that go in the usType field of the
        !           284:  * BITMAPFILEHEADER(2) and BITMAPARRAYFILEHEADER(2).
        !           285:  * (BFT_ => Bit map File Type)
        !           286:  */
        !           287: #define BFT_ICON           0x4349   /* 'IC' */
        !           288: #define BFT_BMAP           0x4d42   /* 'BM' */
        !           289: #define BFT_POINTER        0x5450   /* 'PT' */
        !           290: #define BFT_COLORICON      0x4943   /* 'CI' */
        !           291: #define BFT_COLORPOINTER   0x5043   /* 'CP' */
        !           292: #define BFT_BITMAPARRAY    0x4142   /* 'BA' */
        !           293: 
        !           294: #endif /* INCL_GPIBITMAPS */
        !           295: 
        !           296: /* XLATOFF */
        !           297: #pragma pack()    /* reset to default packing */
        !           298: 
        !           299: #endif /* BITMAPS_INCLUDED */
        !           300: /* XLATON */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.