1999-01-01 19:45:39 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: readshg.h
|
|
|
|
// Purpose: Petr Smilauer's .SHG (Segmented Hypergraphics file) reading
|
|
|
|
// code.
|
|
|
|
// Note: .SHG is undocumented (anywhere!) so this is
|
|
|
|
// reverse-engineering
|
|
|
|
// and guesswork at its best.
|
|
|
|
// Author: Petr Smilauer
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/01/99
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Petr Smilauer
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef readshgh
|
|
|
|
#define readshgh
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
typedef enum { TypePopup = 0xE2, TypeJump = 0xE3, TypeMacro = 0xC8} HotspotType;
|
|
|
|
|
|
|
|
#define NOT_VISIBLE 0x04
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned char hotspotType;// combines HotspotType /w NOT_VISIBLE if appropriate
|
|
|
|
unsigned char flag; // NOT_VISIBLE or 0 ??
|
|
|
|
unsigned char skip; // 0, always??
|
|
|
|
unsigned short left,
|
|
|
|
top,
|
|
|
|
width, // left+width/top+height give right/bottom,
|
|
|
|
height; // =>right and bottom edge are not 'included'
|
|
|
|
unsigned char magic[4]; // wonderful numbers: for macros, this seems
|
|
|
|
// (at least first 2 bytes) to represent offset into macro-strings block.
|
|
|
|
} ShgInfoBlock; // whole block is just 15 bytes long. How weird!
|
|
|
|
|
|
|
|
#define OFF_OFFSET 0x20 // this is offset, where WORD (?) lies
|
|
|
|
#define OFFSET_DELTA 9 // we must add this to get real offset from file beginning
|
|
|
|
|
|
|
|
struct HotSpot
|
|
|
|
{
|
|
|
|
HotspotType type;
|
|
|
|
unsigned int left,
|
|
|
|
top,
|
|
|
|
right,
|
|
|
|
bottom;
|
2004-01-08 06:54:30 -05:00
|
|
|
wxChar szHlpTopic_Macro[65];
|
1999-01-01 19:45:39 -05:00
|
|
|
bool IsVisible;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Returns the number of hotspots, and the array of hotspots.
|
|
|
|
// E.g.
|
|
|
|
// HotSpots *array;
|
|
|
|
// int n = ParseSHG("thing.shg", &array);
|
|
|
|
|
2004-01-08 06:54:30 -05:00
|
|
|
extern int ParseSHG( const wxChar* fileName, HotSpot **hotspots);
|
1999-01-01 19:45:39 -05:00
|
|
|
|
|
|
|
// Converts Windows .SHG file to HTML map file
|
2004-01-08 06:54:30 -05:00
|
|
|
extern bool SHGToMap(wxChar *filename, wxChar *defaultFile);
|
1999-01-01 19:45:39 -05:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|