typedef struct NEWFONT /* structure located at DescriptorsOffset */
{
unsigned char unknown1;
short FontName;
unsigned char FGRGB[3];
unsigned char BGRGB[3];
unsigned char unknown5;
unsigned char unknown6;
unsigned char unknown7;
unsigned char unknown8;
unsigned char unknown9;
long Height;
unsigned char mostlyzero[12];
short Weight;
unsigned char unknown10;
unsigned char unknown11;
unsigned char Italic;
unsigned char Underline;
unsigned char StrikeOut;
unsigned char DoubleUnderline;
unsigned char SmallCaps;
unsigned char unknown17;
unsigned char unknown18;
unsigned char PitchAndFamily;
}
NEWFONT;
typedef struct
{
unsigned short StyleNum;
unsigned short BasedOn;
NEWFONT font;
char unknown[35];
char StyleName[65];
}
NEWSTYLE;
typedef struct MVBFONT /* structure located at DescriptorsOffset */
{
short FontName;
short expndtw;
unsigned short style;
unsigned char FGRGB[3];
unsigned char BGRGB[3];
long Height;
unsigned char mostlyzero[12];
short Weight;
unsigned char unknown10;
unsigned char unknown11;
unsigned char Italic;
unsigned char Underline;
unsigned char StrikeOut;
unsigned char DoubleUnderline;
unsigned char SmallCaps;
unsigned char unknown17;
unsigned char unknown18;
unsigned char PitchAndFamily;
unsigned char unknown20;
signed char up;
}
MVBFONT;
typedef struct
{
unsigned short StyleNum;
unsigned short BasedOn;
MVBFONT font;
char unknown[35];
char StyleName[65];
}
MVBSTYLE;
typedef struct
{
unsigned short Magic; /* 0x5555 */
unsigned short Size;
unsigned short Unknown1;
unsigned short Unknown2;
unsigned short Entries;
unsigned short Ligatures;
unsigned short LigLen;
unsigned short Unknown[13];
}
CHARMAPHEADER;
/* Font Attributes */
#define FONT_NORM 0x00 /* Normal */
#define FONT_BOLD 0x01 /* Bold */
#define FONT_ITAL 0x02 /* Italics */
#define FONT_UNDR 0x04 /* Underline */
#define FONT_STRK 0x08 /* Strike Through */
#define FONT_DBUN 0x10 /* Dbl Underline */
#define FONT_SMCP 0x20 /* Small Caps */
/* Font Families */
#define FAM_MODERN 0x01
#define FAM_ROMAN 0x02
#define FAM_SWISS 0x03
#define FAM_TECH 0x03
#define FAM_NIL 0x03
#define FAM_SCRIPT 0x04
#define FAM_DECOR 0x05
typedef struct KWMAPREC /* structure of |xWMAP leaf-page entries */
{
long FirstRec; /* index number of first keyword on leaf page */
unsigned short PageNum; /* page number that keywords are associated with */
}
KWMAPREC;
typedef long TOPICPOS; /* TOPICPOS/DecompressSize = block number, TOPICPOS%DecompressSize = offset into decompression buffer (including sizeof(TOPICBLOCKHEADER)) */
typedef long TOPICOFFSET; /* TOPICOFFSET/0x8000 = block number, TOPICOFFSET/0x8000 = number of characters and hotspots counting from first TOPICLINK of this block */
typedef struct /* structure every TopicBlockSize in |TOPIC */
{
TOPICPOS LastTopicLink; /* points to last TOPICLINK in previous block */
TOPICPOS FirstTopicLink; /* points to first TOPICLINK in this block */
TOPICPOS LastTopicHeader; /* points to TOPICLINK of last TOPICHEADER */
}
TOPICBLOCKHEADER;
typedef struct /* structure pointed to by FirstTopicLink */
{
long BlockSize; /* size of this link + LinkData1 + LinkData2 */
long DataLen2; /* length of decompressed LinkData2 */
TOPICPOS PrevBlock;
/* Windows 3.0 (HC30): number of bytes the TOPICLINK of the previous
// block is located before this TOPICLINK, that is the block size of
// the previous TOPICLINK plus eventually skipped TOPICBLOCKHEADER.
// Windows 3.1 (HC31): TOPICPOS of previous TOPICLINK */
TOPICPOS NextBlock;
/* Windows 3.0 (HC30): number of bytes the TOPICLINK of the next block
// is located behind this block, including skipped TOPICBLOCKHEADER.
// Windows 3.1 (HC31): TOPICPOS of next TOPICLINK */
long DataLen1; /* includes size of TOPICLINK */
unsigned char RecordType; /* See below */
}
TOPICLINK;
/* Known RecordTypes for TOPICLINK */
#define TL_DISPLAY30 0x01 /* version 3.0 displayable information */
#define TL_TOPICHDR 0x02 /* topic header information */
#define TL_DISPLAY 0x20 /* version 3.1 displayable information */
#define TL_TABLE 0x23 /* version 3.1 table */
typedef struct /* structure of LinkData1 of RecordType 2 */
{
long BlockSize; /* size of topic, including internal topic links */
TOPICOFFSET BrowseBck; /* topic offset for prev topic in browse sequence */
TOPICOFFSET BrowseFor; /* topic offset for next topic in browse sequence */
long TopicNum; /* topic Number */
TOPICPOS NonScroll; /* start of non-scrolling region (topic offset) or -1 */
TOPICPOS Scroll; /* start of scrolling region (topic offset) */
TOPICPOS NextTopic; /* start of next type 2 record */
}
TOPICHEADER;
typedef struct /* structure of LinkData1 of RecordType 2 */
{
long BlockSize;
short PrevTopicNum;
short unused1;
short NextTopicNum;
short unused2;
}
TOPICHEADER30;
typedef struct /* structure of |CTXOMAP file entries */
{
long MapID;
long TopicOffset;
}
CTXOMAPREC;
typedef struct /* structure of |CONTEXT leaf-page entry */
{
long HashValue; /* Hash value of context id */
TOPICOFFSET TopicOffset; /* Topic offset */
}
CONTEXTREC;
typedef struct /* structure of *.GRP file header */
{
unsigned long Magic; /* 0x000A3333 */
unsigned long BitmapSize;
unsigned long LastTopic;
unsigned long FirstTopic;
unsigned long TopicsUsed;
unsigned long TopicCount;
unsigned long GroupType;
unsigned long Unknown1;
unsigned long Unknown2;
unsigned long Unknown3;
}
GROUPHEADER;
typedef struct /* internal use */
{
GROUPHEADER GroupHeader;
char *Name;
unsigned char *Bitmap;
}
GROUP;
typedef struct /* structure of STOPn.STP header */
{
unsigned long Magic; /* 0x00082222 */
unsigned short BytesUsed;
unsigned short Unused[17];
}
STOPHEADER;
typedef struct /* structure of |VIOLA leaf-page entry */
{
TOPICOFFSET TopicOffset; /* topic offset */
long WindowNumber; /* number of window assigned to topic */
}
VIOLAREC;
typedef struct /* structure of |CATALOG header */
{
unsigned short magic; /* 0x1111 */
unsigned short always8;
unsigned short always4;
long entries;
unsigned char zero[30];
}
CATALOGHEADER;
typedef struct /* structure of Windows Bitmap BMP file */
{
unsigned short bfType;
unsigned long bfSize;
unsigned short bfReserved1;
unsigned short bfReserved2;
unsigned long bfOffBits;
}
BITMAPFILEHEADER;
typedef struct /* structure of Windows Bitmap header */
{
unsigned long biSize;
long biWidth;
long biHeight;
unsigned short biPlanes;
unsigned short biBitCount;
unsigned long biCompression;
unsigned long biSizeImage;
long biXPelsPerMeter;
long biYPelsPerMeter;
unsigned long biClrUsed;
unsigned long biClrImportant;
}
BITMAPINFOHEADER;
typedef struct tagRECT /* Windows rectangle */
{
short left;
short top;
short right;
short bottom;
}
RECT;
typedef struct /* Windows Aldus placeable metafile header */
{
unsigned long dwKey;
unsigned short hMF;
RECT rcBBox;
unsigned short wInch;
unsigned long dwReserved;
unsigned short wChecksum;
}
APMFILEHEADER;
typedef struct /* structure of hotspot info */
{
unsigned char id0,id1,id2;
unsigned short x,y,w,h;
unsigned long hash;
}
HOTSPOT;
typedef struct /* structure used as buf of GetFirstPage */