| 1 |
|
|---|
| 2 | /*
|
|---|
| 3 | *@@sourcefile shapewin.h:
|
|---|
| 4 | * header file for shapewin.h. See remarks there.
|
|---|
| 5 | *
|
|---|
| 6 | * Note: Version numbering in this file relates to XWorkplace version
|
|---|
| 7 | * numbering.
|
|---|
| 8 | *
|
|---|
| 9 | *@@include #define INCL_GPIBITMAPS
|
|---|
| 10 | *@@include #include <os2.h>
|
|---|
| 11 | *@@include #include "shapewin.h"
|
|---|
| 12 | */
|
|---|
| 13 |
|
|---|
| 14 | /* Copyright (C) 1998-2000
|
|---|
| 15 | * Ulrich Mller,
|
|---|
| 16 | * Akira Hatakeyama,
|
|---|
| 17 | * Takayuki Suwa.
|
|---|
| 18 | * This file is part of the "XWorkplace helpers" source package.
|
|---|
| 19 | * This is free software; you can redistribute it and/or modify
|
|---|
| 20 | * it under the terms of the GNU General Public License as published
|
|---|
| 21 | * by the Free Software Foundation, in version 2 as it comes in the
|
|---|
| 22 | * "COPYING" file of the XWorkplace main distribution.
|
|---|
| 23 | * This program is distributed in the hope that it will be useful,
|
|---|
| 24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 26 | * GNU General Public License for more details.
|
|---|
| 27 | */
|
|---|
| 28 |
|
|---|
| 29 | #if __cplusplus
|
|---|
| 30 | extern "C" {
|
|---|
| 31 | #endif
|
|---|
| 32 |
|
|---|
| 33 | #ifndef SHAPEWIN_HEADER_INCLUDED
|
|---|
| 34 | #define SHAPEWIN_HEADER_INCLUDED
|
|---|
| 35 |
|
|---|
| 36 | /*
|
|---|
| 37 | * Name of Control
|
|---|
| 38 | */
|
|---|
| 39 |
|
|---|
| 40 | #define WC_SHAPE_WINDOW "ShapeWin"
|
|---|
| 41 | #define WC_SHAPE_REGION "ShapeWinRegion"
|
|---|
| 42 |
|
|---|
| 43 | /*
|
|---|
| 44 | *@@ SHPCTLDATA:
|
|---|
| 45 | * shape window control data for use with
|
|---|
| 46 | * pCtlData of WinCreateWindow. This _must_
|
|---|
| 47 | * be initialized.
|
|---|
| 48 | */
|
|---|
| 49 |
|
|---|
| 50 | typedef struct _SHPCTLDATA
|
|---|
| 51 | {
|
|---|
| 52 | SHORT cx, cy ; // size of bitmap
|
|---|
| 53 | HPS hpsMask; // HPS with bitmap selected into
|
|---|
| 54 | HPS hpsDraw; // HPS used for drawing the bitmap;
|
|---|
| 55 | } SHPCTLDATA, *PSHPCTLDATA;
|
|---|
| 56 |
|
|---|
| 57 | /*
|
|---|
| 58 | * Window Messages Specific for Shape Window
|
|---|
| 59 | */
|
|---|
| 60 |
|
|---|
| 61 | #define SHAPEWIN_MSG_UPDATE (WM_USER + 1)
|
|---|
| 62 | /* SHAPEWIN_MSG_UPDATE Update Drawing Image */
|
|---|
| 63 | /* MP1 PRECTL Update Region, NULL for entire region */
|
|---|
| 64 | /* MP2 NULL not used */
|
|---|
| 65 |
|
|---|
| 66 | /*
|
|---|
| 67 | *@@ SHAPEFRAME:
|
|---|
| 68 | * common input/output structure for shape frame
|
|---|
| 69 | * windows below.
|
|---|
| 70 | */
|
|---|
| 71 |
|
|---|
| 72 | typedef struct _SHAPEFRAME
|
|---|
| 73 | {
|
|---|
| 74 | HDC hdc;
|
|---|
| 75 | HPS hps;
|
|---|
| 76 | HBITMAP hbm;
|
|---|
| 77 |
|
|---|
| 78 | HAB hab;
|
|---|
| 79 | HWND hwndShapeFrame;
|
|---|
| 80 | HWND hwndShape;
|
|---|
| 81 | PFNWP pfnFrame;
|
|---|
| 82 | BITMAPINFOHEADER2 bmi;
|
|---|
| 83 | SHPCTLDATA shpctrl;
|
|---|
| 84 |
|
|---|
| 85 | POINTL ptlLowerLeft; // added (V1.0)
|
|---|
| 86 | } SHAPEFRAME, *PSHAPEFRAME;
|
|---|
| 87 |
|
|---|
| 88 | BOOL shpLoadBitmap(HAB hab,
|
|---|
| 89 | PSZ pszBitmapFile,
|
|---|
| 90 | HMODULE hmodResource,
|
|---|
| 91 | ULONG idResource,
|
|---|
| 92 | PSHAPEFRAME psb);
|
|---|
| 93 |
|
|---|
| 94 | VOID shpFreeBitmap(PSHAPEFRAME psb);
|
|---|
| 95 |
|
|---|
| 96 | BOOL shp2RegisterClasses(HAB hab);
|
|---|
| 97 |
|
|---|
| 98 | BOOL shpCreateWindows(PSHAPEFRAME psb);
|
|---|
| 99 |
|
|---|
| 100 | #endif
|
|---|
| 101 |
|
|---|
| 102 | #if __cplusplus
|
|---|
| 103 | }
|
|---|
| 104 | #endif
|
|---|
| 105 |
|
|---|