/******************************Module*Header*******************************\
* Module Name: mfedit.h
*
* Header file for mfedit
*
* Copyright 1996 - 1998 Microsoft Corporation
*
* Contains all the definitions, global variables, structures, etc
*
* Dependencies:
*
\**************************************************************************/
#define LIGHTGRAY RGB(192, 192, 192)
#define DARKGRAY RGB(128, 128, 128)
#define MAX_POINTS 256
#define MAX_POINTS_MF 3
#define MAX_POINTS_BMP 3
#define MAX_FRAME 800
#define MAX_FILE 800
#define MAX_ERR_STRING 128
//
// String ID's
//
#define IDS_INITAPPFAIL16
#define IDS_LOADACCFAIL17
#define IDS_MFDEMOCL18
#define IDS_NOMFFORCPY19
#define IDS_CNVEMFTO3X20
#define IDS_GETWMFBTSFAIL21
#define IDS_MALLOCFAIL22
#define IDS_GETWMFBTSFAIL223
#define IDS_MALLOCFAIL224
#define IDS_CPY3XMFTOCLP25
#define IDS_GETWMFBTSFAIL2X26
#define IDS_CNVFAIL27
#define IDS_CPYEMFTOCLP28
#define IDS_PST3XMF29
#define IDS_NOINFO3XMFX30
#define IDS_SAVEMF32
#define IDS_FILEOPNFAIL33
#define IDS_MAPFCREFAIL34
#define IDS_MAPVWMAPFOFAIL35
#define IDS_GET3XFRMCLPFAIL36
#define IDS_PSTEMF37
#define IDS_GETEMFFROMCLPFAIL38
#define IDS_ERROR39
#define IDS_NOMFLDFORHTST40
#define IDS_DLGABOUTCREFAIL41
#define IDS_LDMSKBM43
#define IDS_LDBM44
#define IDS_SVDRAWSFASBM45
#define IDS_LDMF46
#define IDS_MUSTESCHTSTMD47
#define IDS_REC48
#define IDS_CREMFDCFAIL49
#define IDS_ADDCMNTFAIL50
#define IDS_STOP55
#define IDS_FMT_PLAYMF56
#define IDS_CREPALFAIL57
#define IDS_NOMFFORPLAY61
#define IDS_ALDUSMF62
#define IDS_DRAWSFCLR63
#define IDS_PEN64
#define IDS_TXT65
#define IDS_RECT66
#define IDS_FILLRECT67
#define IDS_ELLIPSE68
#define IDS_FILLELLIPSE69
#define IDS_LN70
#define IDS_MSTLBCLKFORBZ71
#define IDS_MUST3CLKFORBM72
#define IDS_MUST3CLKFORXMF73
#define IDS_NOMFFORPRT74
#define IDS_CREPRTTHRDFAIL76
#define IDS_CREPNTFAIL77
#define IDS_CREPBYTEFAIL78
#define IDS_NOBMFOREMBED79
#define IDS_NOMFFOREMBED80
#define IDS_FT_DIB81
#define IDS_FM_DIB82
#define IDS_FT_RLE83
#define IDS_FM_RLE84
#define IDS_FT_EPS85
#define IDS_FM_EPS86
#define IDS_FT_EMF87
#define IDS_FM_EMF88
#define IDS_FT_WMF89
#define IDS_FM_WMF90
#define IDS_SAVEMFAS92
#define IDS_LDMFMTFILEFAIL93
#define IDS_CREMAPFILEFAIL94
#define IDS_MAPVWOFMAPFOFAIL95
#define IDS_NOTDIBBMFILE96
#define IDS_GETMFBTSXFAIL97
#define IDS_GETMFBTSXFAIL298
#define IDS_LDMSK99
#define IDS_MALLOCFAILNOHIT100
#define IDS_NULLRGNHTSTFAIL102
#define IDS_EMF103
#define IDS_NOHIT104
#define IDS_NOMFTOPRT105
#define IDS_ESCPRT106
#define IDS_CREPRTDCFAIL107
#define IDS_PRT108
#define IDS_PRTTHRDDONE111
#define IDS_ALLOCPALFAIL112
#define IDS_HFTONEPALNULL114
#define IDS_PALNULL115
#define IDS_MUSTMSKMCHROMEBM116
#define IDS_NOPALENTRYFORCPY117
#define IDS_CPYPALFAIL118
#define IDS_NULLPTR121
#define IDS_NOTADOBE122
#define IDS_SKPTOEOL123
#define IDS_MUSTNOTEOF124
#define IDS_GETBNDLFTFAIL125
#define IDS_GETBNDTOPFAIL126
#define IDS_GETBNDRGTFAIL127
#define IDS_GETBNDBOTFAIL128
#define IDS_SETADVGRPHMDFAIL129
#define IDS_FMT_HIT131
#define IDS_FMT_NOHTST132
#define IDS_FMT_PLAYEMFFAIL133
#define IDS_FMT_FILEOPNFAIL134
#define IDS_FMT_CREMAPFILEFAIL135
#define IDS_FMT_MAPVWMAPFOFAIL136
#define IDS_FMT_SETWMFBTSFAIL137
#define IDS_FMT_SETWMFBTSXFAIL138
#define IDS_FMT_PLAYMFFAIL139
#define IDS_FMT_GETMFFAIL140
//
// Menu ID's
//
#define MM_LOAD 7001
#define MM_RECORD 7002
#define MM_PRINT 7003
#define MM_PAGESETUP 7004
#define MM_PRINTSETUP 7005
#define MM_ABOUT 7006
#define MM_CUT 7007
#define MM_COPY 7008
#define MM_PASTE 7009
#define MM_DEL 7010
#define MM_LOAD_BMP 7011
#define MM_SAVE_BMP 7012
#define MM_LOAD_MASKBMP 7013
#define MM_REMOVE 7014
#define MM_INSERT 7015
#define MM_HITTEST 7016
#define MM_REPEAT 7017
#define MM_INCREASE 7018
#define MM_NORMAL 7019
#define MM_DECREASE 7020
#define MM_PEN 7021
#define MM_BRUSH 7022
#define MM_FONT 7023
#define MM_LEABOUT 7024
#define MM_FIT2WND 7025
#define MM_IMPORT_3X 7026
#define MM_EXPORT_3X 7027
#define MM_TTOUTLN_STROKEFILL 7028
#define MM_TTOUTLN_POLYDRAW 7029
#define MM_C_WND_MF 7030
#define MM_C_BEGIN_GP 7031
#define MM_C_END_GP 7032
#define MM_C_MLTFMTS 7033
#define SIZEOFCAPTIONTEXT20
#define ACCEL_ID 100
#define APP_ICON 100
//
// Control Panel ID's
//
#define OD_BTN_CNT 5
#define DID_CTRLPANEL 100
#define DID_ZERO 1000
#define DID_ONE 1001
#define DID_TWO 1002
#define DID_THREE 1003
#define DID_FOUR 1004
#define DID_FIVE 1005
#define DID_SIX 1006
#define DID_SEVEN 1007
#define DID_EIGHT 1008
#define DID_NINE 1009
#define DID_TEN_PLUS 1010
#define ID_OD_BTN_BASE 1011
#define DID_OPEN 1011
#define DID_RECORD 1012
#define DID_STOP 1013
#define DID_PLAY 1014
#define DID_FF 1015
#define DID_CLEAR 1016
#define DID_COUNTER 1017
#define DID_TMP 1018
//
// Control Panel's Owner draw bitmaps
//
#define BMID_BASED 1011
#define BMID_OPEND 1011
#define BMID_RECORDD 1012
#define BMID_STOPD 1013
#define BMID_PLAYD 1014
#define BMID_FFD 1015
#define BMID_BASEU 2011
#define BMID_OPENU 2011
#define BMID_RECORDU 2012
#define BMID_STOPU 2013
#define BMID_PLAYU 2014
#define BMID_FFU 2015
//
// Tools ID's
//
#define OD_TOOL_CNT 10
#define ID_OD_TOOL_BASE 3001
#define DID_PEN 3001
#define DID_TEXT 3002
#define DID_RECT 3003
#define DID_FILLRECT 3004
#define DID_ELLIPSE 3005
#define DID_FILLELLIPSE 3006
#define DID_LINE 3007
#define DID_BEZIER 3008
#define DID_BMPOBJ 3009
#define DID_METAF 3010
//
// Tools Owner Draw bitmaps
//
#define BMID_TOOLBASED 3001
#define BMID_PEND 3001
#define BMID_TEXTD 3002
#define BMID_RECTD 3003
#define BMID_FILLRECTD 3004
#define BMID_ELLIPSED 3005
#define BMID_FILLELLIPSED 3006
#define BMID_LINED 3007
#define BMID_BEZIERD 3008
#define BMID_BMPOBJD 3009
#define BMID_METAFD 3010
#define BMID_TOOLBASEU 4001
#define BMID_PENU 4001
#define BMID_TEXTU 4002
#define BMID_RECTU 4003
#define BMID_FILLRECTU 4004
#define BMID_ELLIPSEU 4005
#define BMID_FILLELLIPSEU 4006
#define BMID_LINEU 4007
#define BMID_BEZIERU 4008
#define BMID_BMPOBJU 4009
#define BMID_METAFU 4010
//
// some handy macros
//
#define GET_WM_CTLCOLOR_HDC(wp, lp, msg) (HDC)(wp)
#define GET_WM_CTLCOLOR_HWND(wp, lp, msg) (HWND)(lp)
#define GET_WM_CTLCOLOR_TYPE(wp, lp, msg) (WORD)(msg - WM_CTLCOLORMSGBOX)
#define META32_SIGNATURE 0x464D4520 // ' EMF'
#define ALDUS_ID0x9AC6CDD7
#define CARET_HEIGHT 16
typedef struct
{
DWORD key;
WORD hmf;
SMALL_RECT bbox;
WORD inch;
DWORD reserved;
WORD checksum;
} APMFILEHEADER;
typedef APMFILEHEADER * PAPMFILEHEADER;
#define APMSIZE 22
#ifndef RC_INVOKED
#pragma pack(2)
typedef struct tagMETA16HEADER
{
WORDmtType;
WORDmtHeaderSize;
WORDmtVersion;
DWORDmtSize;
WORDmtNoObjects;
DWORDmtMaxRecord;
WORDmtNoParameters;
} META16HEADER, LPMETA16HEADER;
#pragma pack()
#endif // RC_INVOKED
typedef struct _playinfo {
int iRecord;
BOOL bPlayContinuous;
} PLAYINFO;
typedef struct _metalookup {
LPSTR szGDIName;
int iMRNumber;
} METALOOKUP;
typedef struct _htdata {
POINT point;
int iRecord;
} HTDATA;
METALOOKUP rgMetaName[] =
{
{ " ", 0 },
{ "HEADER ", EMR_HEADER },
{ "POLYBEZIER ", EMR_POLYBEZIER },
{ "POLYGON ", EMR_POLYGON },
{ "POLYLINE ", EMR_POLYLINE },
{ "POLYBEZIERTO ", EMR_POLYBEZIERTO },
{ "POLYLINETO ", EMR_POLYLINETO },
{ "POLYPOLYLINE ", EMR_POLYPOLYLINE },
{ "POLYPOLYGON ", EMR_POLYPOLYGON },
{ "SETWINDOWEXTEX ", EMR_SETWINDOWEXTEX },
{ "SETWINDOWORGEX ", EMR_SETWINDOWORGEX },
{ "SETVIEWPORTEXTEX ", EMR_SETVIEWPORTEXTEX },
{ "SETVIEWPORTORGEX ", EMR_SETVIEWPORTORGEX },
{ "SETBRUSHORGEX ", EMR_SETBRUSHORGEX },
{ "EOF ", EMR_EOF },
{ "SETPIXELV ", EMR_SETPIXELV },
{ "SETMAPPERFLAGS ", EMR_SETMAPPERFLAGS },
{ "SETMAPMODE ", EMR_SETMAPMODE },
{ "SETBKMODE ", EMR_SETBKMODE },
{ "SETPOLYFILLMODE ", EMR_SETPOLYFILLMODE },
{ "SETROP2 ", EMR_SETROP2 },
{ "SETSTRETCHBLTMODE ", EMR_SETSTRETCHBLTMODE },
{ "SETTEXTALIGN ", EMR_SETTEXTALIGN },
{ "SETCOLORADJUSTMENT ", EMR_SETCOLORADJUSTMENT },
{ "SETTEXTCOLOR ", EMR_SETTEXTCOLOR },
{ "SETBKCOLOR ", EMR_SETBKCOLOR },
{ "OFFSETCLIPRGN ", EMR_OFFSETCLIPRGN },
{ "MOVETOEX ", EMR_MOVETOEX },
{ "SETMETARGN ", EMR_SETMETARGN },
{ "EXCLUDECLIPRECT ", EMR_EXCLUDECLIPRECT },
{ "INTERSECTCLIPRECT ", EMR_INTERSECTCLIPRECT },
{ "SCALEVIEWPORTEXTEX ", EMR_SCALEVIEWPORTEXTEX },
{ "SCALEWINDOWEXTEX ", EMR_SCALEWINDOWEXTEX },
{ "SAVEDC ", EMR_SAVEDC },
{ "RESTOREDC ", EMR_RESTOREDC },
{ "SETWORLDTRANSFORM ", EMR_SETWORLDTRANSFORM },
{ "MODIFYWORLDTRANSFORM ", EMR_MODIFYWORLDTRANSFORM },
{ "SELECTOBJECT ", EMR_SELECTOBJECT },
{ "CREATEPEN ", EMR_CREATEPEN },
{ "CREATEBRUSHINDIRECT ", EMR_CREATEBRUSHINDIRECT },
{ "DELETEOBJECT ", EMR_DELETEOBJECT },
{ "ANGLEARC ", EMR_ANGLEARC },
{ "ELLIPSE ", EMR_ELLIPSE },
{ "RECTANGLE ", EMR_RECTANGLE },
{ "ROUNDRECT ", EMR_ROUNDRECT },
{ "ARC ", EMR_ARC },
{ "CHORD ", EMR_CHORD },
{ "PIE ", EMR_PIE },
{ "SELECTPALETTE ", EMR_SELECTPALETTE },
{ "CREATEPALETTE ", EMR_CREATEPALETTE },
{ "SETPALETTEENTRIES ", EMR_SETPALETTEENTRIES },
{ "RESIZEPALETTE ", EMR_RESIZEPALETTE },
{ "REALIZEPALETTE ", EMR_REALIZEPALETTE },
{ "EXTFLOODFILL ", EMR_EXTFLOODFILL },
{ "LINETO ", EMR_LINETO },
{ "ARCTO ", EMR_ARCTO },
{ "POLYDRAW ", EMR_POLYDRAW },
{ "SETARCDIRECTION ", EMR_SETARCDIRECTION },
{ "SETMITERLIMIT ", EMR_SETMITERLIMIT },
{ "BEGINPATH ", EMR_BEGINPATH },
{ "ENDPATH ", EMR_ENDPATH },
{ "CLOSEFIGURE ", EMR_CLOSEFIGURE },
{ "FILLPATH ", EMR_FILLPATH },
{ "STROKEANDFILLPATH ", EMR_STROKEANDFILLPATH },
{ "STROKEPATH ", EMR_STROKEPATH },
{ "FLATTENPATH ", EMR_FLATTENPATH },
{ "WIDENPATH ", EMR_WIDENPATH },
{ "SELECTCLIPPATH ", EMR_SELECTCLIPPATH },
{ "ABORTPATH ", EMR_ABORTPATH },
{ "UNKNOWN ", 69 },
{ "GDICOMMENT ", EMR_GDICOMMENT },
{ "FILLRGN ", EMR_FILLRGN },
{ "FRAMERGN ", EMR_FRAMERGN },
{ "INVERTRGN ", EMR_INVERTRGN },
{ "PAINTRGN ", EMR_PAINTRGN },
{ "EXTSELECTCLIPRGN ", EMR_EXTSELECTCLIPRGN },
{ "BITBLT ", EMR_BITBLT },
{ "STRETCHBLT ", EMR_STRETCHBLT },
{ "MASKBLT ", EMR_MASKBLT },
{ "PLGBLT ", EMR_PLGBLT },
{ "SETDIBITSTODEVICE ", EMR_SETDIBITSTODEVICE },
{ "STRETCHDIBITS ", EMR_STRETCHDIBITS },
{ "EXTCREATEFONTINDIRECTW ", EMR_EXTCREATEFONTINDIRECTW },
{ "EXTTEXTOUTA ", EMR_EXTTEXTOUTA },
{ "EXTTEXTOUTW ", EMR_EXTTEXTOUTW },
{ "POLYBEZIER16 ", EMR_POLYBEZIER16 },
{ "POLYGON16 ", EMR_POLYGON16 },
{ "POLYLINE16 ", EMR_POLYLINE16 },
{ "POLYBEZIERTO16 ", EMR_POLYBEZIERTO16 },
{ "POLYLINETO16 ", EMR_POLYLINETO16 },
{ "POLYPOLYLINE16 ", EMR_POLYPOLYLINE16 },
{ "POLYPOLYGON16 ", EMR_POLYPOLYGON16 },
{ "POLYDRAW16 ", EMR_POLYDRAW16 },
{ "CREATEMONOBRUSH ", EMR_CREATEMONOBRUSH },
{ "CREATEDIBPATTERNBRUSHPT ", EMR_CREATEDIBPATTERNBRUSHPT },
{ "EXTCREATEPEN ", EMR_EXTCREATEPEN },
{ "POLYTEXTOUTA ", EMR_POLYTEXTOUTA },
{ "POLYTEXTOUTW ", EMR_POLYTEXTOUTW },
{ "SETICMMODE ", EMR_SETICMMODE },
{ "CREATECOLORSPACE ", EMR_CREATECOLORSPACE },
{ "SETCOLORSPACE ", EMR_SETCOLORSPACE },
{ "DELETECOLORSPACE ", EMR_DELETECOLORSPACE },
#ifdef OPENGL_EMF
{ "GLSRECORD ", EMR_GLSRECORD },
{ "GLSBOUNDEDRECORD ", EMR_GLSBOUNDEDRECORD },
{ "PIXELFORMAT ", EMR_PIXELFORMAT },
#endif
};
typedef struct _PRTDATA {
BOOL bFit2Wnd;
HENHMETAFILE hMetaf;
} PRTDATA, *PPRTDATA;
PROC gpfnGetEnhMetaFilePixelFormat = (PROC)NULL;
HANDLE ghModule;
HWND ghwndMain = NULL;
HWND ghwndClient = NULL;
HWND ghwndDrawSurf = NULL;
HWND ghwndCtrlPanel = NULL;
HWND ghwndTools = NULL;
HWND ghTextWnd = NULL;
HPALETTE ghPal = NULL;
HPALETTE ghHT = NULL;
LONG glcyStatus;
BOOL gbRecording = FALSE;
BOOL gbHitTest = FALSE;
#if 0 // STRICT doesn't like this
HWND grHwndCtrlBtn[OD_BTN_CNT];
HWND grHwndToolBtn[OD_TOOL_CNT];
#endif
PVOID grHwndCtrlBtn[OD_BTN_CNT];
PVOID grHwndToolBtn[OD_TOOL_CNT];
DWORD gdwCurCtrl = DID_STOP;
DWORD gdwCurTool = DID_PEN;
HFONT ghCurFont = (HFONT)NULL;
LOGFONT glf;
COLORREF gCrText=0; // Black
HMENU hMenu, hMenuWindow;
HMENU hChildMenu, hChildMenuWindow;
HDC ghDCMem;
HDC ghDCMetaf = (HDC) NULL;
HENHMETAFILE ghMetaf = NULL;
HMETAFILE ghmf=NULL;
HBITMAP ghBmp = NULL, ghBmpMask = NULL;
#if 0 // STRICT doesn't like this
HBITMAP ghBmpDn[OD_BTN_CNT], ghBmpUp[OD_BTN_CNT];
HBITMAP ghToolBmpDn[OD_TOOL_CNT], ghToolBmpUp[OD_TOOL_CNT];
#endif
PVOID ghBmpDn[OD_BTN_CNT], ghBmpUp[OD_BTN_CNT];
PVOID ghToolBmpDn[OD_TOOL_CNT], ghToolBmpUp[OD_TOOL_CNT];
HBRUSH ghbrRed;
HBRUSH ghbrCur = (HBRUSH)NULL;
HPEN ghpnCur = (HPEN)NULL;
HBRUSH ghbrAppBkgd;
HPEN ghpnWide;
HWND ghwndNext = NULL;
BOOL gbFit2Wnd = TRUE;
BOOL gbImport3X = FALSE;
BOOL gbExport3X = FALSE;
BOOL gbSFOutln = FALSE;
BOOL gbPDOutln = FALSE;
BOOL gbTT = FALSE;
BOOL gb3D = FALSE;
BOOL gbRCSet = FALSE;
BOOL gbDebug = FALSE;
BOOL gbUseMfPFD = TRUE;
BOOL gbDB = FALSE;
BOOL gbUseDIB = FALSE;
typedef struct _FileInfo{
HANDLE hFile;
HANDLE hMapFile;
LPVOID lpvMapView;
} FILEINFO, *PFILEINFO;
typedef struct _DIBDATA{
ULONG ulFiles;
ULONG ulFrames;
FILEINFO rgFileInfo[MAX_FILE];
PBYTE rgpjFrame[MAX_FRAME];
PBITMAPINFO rgpbmi[MAX_FILE];
BOOL rgbCoreHdr[MAX_FILE];
} DIBDATA, *PDIBDATA;
DIBDATA gDib;
typedef struct tagCMTMLTFMT {
DWORD ident;
DWORD iComment;
RECTL rclOutput;
DWORD nFormats;
EMRFORMAT aemrformat[1];
} CMTMLTFMT;
#define GDICOMMENT_IDENTIFIER 0x43494447
#define GDICOMMENT_MULTIFORMATS 0x40000004
#define BLACK PALETTERGB(0,0,0)
#define WHITE PALETTERGB(255,255,255)
#define NUM_STATIC_COLORS (COLOR_BTNHIGHLIGHT - COLOR_SCROLLBAR + 1)
// Maximum color distance with 8-bit components
#define MAX_COL_DIST (3*256*256L)
// Number of static colors
#define STATIC_COLORS 20
// Flags used when matching colors
#define EXACT_MATCH 1
#define COLOR_USED 1
// TRUE if app wants to take over palette
static BOOL gbUseStaticColors = FALSE;
// TRUE if static system color settings have been replaced with B&W settings.
static BOOL gbSystemColorsInUse = FALSE;
// TRUE if static colors have been saved
static BOOL gbStaticSaved = FALSE;
// saved system static colors
static COLORREF gacrSave[NUM_STATIC_COLORS];
// new B&W system static colors
static COLORREF gacrBlackAndWhite[NUM_STATIC_COLORS] = {
WHITE, // COLOR_SCROLLBAR
BLACK, // COLOR_BACKGROUND
BLACK, // COLOR_ACTIVECAPTION
WHITE, // COLOR_INACTIVECAPTION
WHITE, // COLOR_MENU
WHITE, // COLOR_WINDOW
BLACK, // COLOR_WINDOWFRAME
BLACK, // COLOR_MENUTEXT
BLACK, // COLOR_WINDOWTEXT
WHITE, // COLOR_CAPTIONTEXT
WHITE, // COLOR_ACTIVEBORDER
WHITE, // COLOR_INACTIVEBORDER
WHITE, // COLOR_APPWORKSPACE
BLACK, // COLOR_HIGHLIGHT
WHITE, // COLOR_HIGHLIGHTTEXT
WHITE, // COLOR_BTNFACE
BLACK, // COLOR_BTNSHADOW
BLACK, // COLOR_GRAYTEXT
BLACK, // COLOR_BTNTEXT
BLACK, // COLOR_INACTIVECAPTIONTEXT
BLACK // COLOR_BTNHIGHLIGHT
};
static INT gaiStaticIndex[NUM_STATIC_COLORS] = {
COLOR_SCROLLBAR ,
COLOR_BACKGROUND ,
COLOR_ACTIVECAPTION ,
COLOR_INACTIVECAPTION ,
COLOR_MENU ,
COLOR_WINDOW ,
COLOR_WINDOWFRAME ,
COLOR_MENUTEXT ,
COLOR_WINDOWTEXT ,
COLOR_CAPTIONTEXT ,
COLOR_ACTIVEBORDER ,
COLOR_INACTIVEBORDER ,
COLOR_APPWORKSPACE ,
COLOR_HIGHLIGHT ,
COLOR_HIGHLIGHTTEXT ,
COLOR_BTNFACE ,
COLOR_BTNSHADOW ,
COLOR_GRAYTEXT ,
COLOR_BTNTEXT ,
COLOR_INACTIVECAPTIONTEXT,
COLOR_BTNHIGHLIGHT
};
static VOID SaveStaticEntries(HDC);
static VOID UseStaticEntries(HDC);
//
// Forward declarations.
//
BOOL InitializeApp (void);
LONG APIENTRY MainWndProc (HWND, UINT, DWORD, LONG);
LONG APIENTRY DrawSurfWndProc (HWND, UINT, DWORD, LONG);
BOOL CALLBACK About (HWND, UINT, DWORD, LONG);
LONG APIENTRY TextWndProc (HWND, UINT, DWORD, LONG);
LONG APIENTRY CtrlPanelDlgProc(HWND, UINT, DWORD, LONG);
BOOL bDrawStuff (HDC, INT, INT, INT, INT, BOOL, BOOL, BOOL, LPSTR);
HENHMETAFILE hemfLoadMetafile(HWND);
HDC hDCRecordMetafileAs(HWND, LPSTR);
BOOL APIENTRY bPlayRecord(HDC, LPHANDLETABLE, LPENHMETARECORD, UINT, LPVOID);
BOOL APIENTRY bDoHitTest(HDC, LPHANDLETABLE, LPENHMETARECORD, UINT, LPVOID);
BOOL bHitTest(HDC, INT, INT);
HBITMAP hBmpLoadBitmapFile(HDC, PSTR);
BOOL bGetBMP(HWND, BOOL);
BOOL bChooseNewFont(HWND, PLOGFONT, COLORREF * );
BOOL bChooseNewColor(HWND, LPDWORD);
BOOL bPrintMf(PPRTDATA);
HBRUSH hBrCreateBrush(HDC, DWORD);
BOOL bSelectDIBPal(HDC, LPBITMAPINFO, BOOL);
BOOL bFreeDibFile(PDIBDATA);
BOOL bPlgBlt(HDC, LPPOINT);
HPALETTE CopyPalette(HPALETTE hPalSrc);
int CALLBACK iTT(LPLOGFONT, LPTEXTMETRIC, DWORD, LPARAM);
CMTMLTFMT *pLoadMltFmtFile(VOID);
HLOCAL Free(CMTMLTFMT *pMfmt);
BOOL bGetEPSBounds(LPVOID, RECTL *);
BOOL bIsAdobe(char *szStr);
BOOL bIsEPS(char *szStr);
BOOL bIsBndBox(char *szStr);
BOOL bIsEOF(char *szStr);
//BOOL bGetWord(LPVOID, char *, char **);
//BOOL bGoNextLine(LPVOID, char **);
BOOL bGetWord(LPVOID, char *, int*);
BOOL bGoNextLine(LPVOID, int*);
BOOL bSetAdvancedGraphics(HDC hdc);
extern unsigned char __stdcall ComponentFromIndex(INT, INT, INT);
extern int aiDefaultOverride[20];
extern PALETTEENTRY apeDefaultPalEntry[20];
BOOL bCleanUpRC(VOID);
BOOL bSetupRC(HDC hDC, PIXELFORMATDESCRIPTOR *ppfdIn);
//
// function prototype for looking up string resources
//
LPTSTR GetStringRes (int);
LPTSTR GetStringRes2 (int);
LPTSTR BuildFilterStrs(int);