1996-05-06 18:06:24 +02:00
|
|
|
/*
|
|
|
|
* Help Viewer
|
|
|
|
*
|
2002-07-16 03:46:29 +02:00
|
|
|
* Copyright 1996 Ulrich Schmid
|
|
|
|
* 2002 Eric Pouech
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
1996-05-06 18:06:24 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
struct tagHelpFile;
|
|
|
|
|
2002-11-18 20:48:11 +01:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char type[10];
|
|
|
|
char name[9];
|
|
|
|
char caption[51];
|
|
|
|
POINT origin;
|
|
|
|
SIZE size;
|
|
|
|
int style;
|
|
|
|
DWORD win_style;
|
2002-12-16 23:11:11 +01:00
|
|
|
COLORREF sr_color; /* color for scrollable region */
|
2002-11-18 20:48:11 +01:00
|
|
|
COLORREF nsr_color; /* color for non scrollable region */
|
|
|
|
} HLPFILE_WINDOWINFO;
|
|
|
|
|
1996-05-06 18:06:24 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
2002-12-16 23:11:11 +01:00
|
|
|
enum {hlp_link_link, hlp_link_popup, hlp_link_macro} cookie;
|
|
|
|
LPCSTR lpszString; /* name of the file to for the link (NULL if same file) */
|
|
|
|
LONG lHash; /* topic index */
|
|
|
|
unsigned bClrChange : 1, /* true if the link is green & underlined */
|
|
|
|
wRefCount; /* number of internal references to this object */
|
|
|
|
unsigned window; /* window number for displaying the link (-1 is current) */
|
1996-05-06 18:06:24 +02:00
|
|
|
} HLPFILE_LINK;
|
|
|
|
|
2002-12-16 23:11:11 +01:00
|
|
|
enum para_type {para_normal_text, para_debug_text, para_bitmap, para_metafile};
|
2002-07-16 03:46:29 +02:00
|
|
|
|
1996-05-06 18:06:24 +02:00
|
|
|
typedef struct tagHlpFileParagraph
|
|
|
|
{
|
2002-07-16 03:46:29 +02:00
|
|
|
enum para_type cookie;
|
|
|
|
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
LPSTR lpszText;
|
|
|
|
unsigned wFont;
|
|
|
|
unsigned wIndent;
|
|
|
|
unsigned wHSpace;
|
|
|
|
unsigned wVSpace;
|
|
|
|
} text;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned pos; /* 0: center, 1: left, 2: right */
|
2002-12-16 23:11:11 +01:00
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
HBITMAP hBitmap;
|
|
|
|
} bmp;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
HMETAFILE hMetaFile;
|
|
|
|
SIZE mfSize;
|
|
|
|
} mf;
|
|
|
|
} u;
|
|
|
|
} gfx; /* for bitmaps and metafiles */
|
2002-07-16 03:46:29 +02:00
|
|
|
} u;
|
|
|
|
|
|
|
|
HLPFILE_LINK* link;
|
|
|
|
|
|
|
|
struct tagHlpFileParagraph* next;
|
1996-05-06 18:06:24 +02:00
|
|
|
} HLPFILE_PARAGRAPH;
|
|
|
|
|
2002-11-20 20:46:18 +01:00
|
|
|
typedef struct tagHlpFileMacro
|
|
|
|
{
|
|
|
|
LPCSTR lpszMacro;
|
|
|
|
struct tagHlpFileMacro* next;
|
|
|
|
} HLPFILE_MACRO;
|
|
|
|
|
1996-05-06 18:06:24 +02:00
|
|
|
typedef struct tagHlpFilePage
|
|
|
|
{
|
2002-07-16 03:46:29 +02:00
|
|
|
LPSTR lpszTitle;
|
|
|
|
HLPFILE_PARAGRAPH* first_paragraph;
|
2002-11-20 20:46:18 +01:00
|
|
|
HLPFILE_MACRO* first_macro;
|
2002-07-16 03:46:29 +02:00
|
|
|
|
|
|
|
unsigned wNumber;
|
|
|
|
unsigned offset;
|
|
|
|
struct tagHlpFilePage* next;
|
|
|
|
struct tagHlpFilePage* prev;
|
2002-11-20 20:46:18 +01:00
|
|
|
|
|
|
|
DWORD browse_bwd;
|
|
|
|
DWORD browse_fwd;
|
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
struct tagHlpFileFile* file;
|
1996-05-06 18:06:24 +02:00
|
|
|
} HLPFILE_PAGE;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2002-07-16 03:46:29 +02:00
|
|
|
LONG lHash;
|
|
|
|
unsigned long offset;
|
1996-05-06 18:06:24 +02:00
|
|
|
} HLPFILE_CONTEXT;
|
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
typedef struct
|
1996-05-06 18:06:24 +02:00
|
|
|
{
|
2002-07-16 03:46:29 +02:00
|
|
|
LOGFONT LogFont;
|
|
|
|
HFONT hFont;
|
|
|
|
COLORREF color;
|
|
|
|
} HLPFILE_FONT;
|
1996-05-06 18:06:24 +02:00
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
typedef struct tagHlpFileFile
|
|
|
|
{
|
|
|
|
LPSTR lpszPath;
|
|
|
|
LPSTR lpszTitle;
|
2002-11-13 05:09:34 +01:00
|
|
|
LPSTR lpszCopyright;
|
2002-07-16 03:46:29 +02:00
|
|
|
HLPFILE_PAGE* first_page;
|
|
|
|
HLPFILE_MACRO* first_macro;
|
|
|
|
unsigned wContextLen;
|
|
|
|
HLPFILE_CONTEXT* Context;
|
2002-11-13 05:09:34 +01:00
|
|
|
unsigned long contents_start;
|
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
struct tagHlpFileFile* prev;
|
|
|
|
struct tagHlpFileFile* next;
|
|
|
|
|
|
|
|
unsigned wRefCount;
|
|
|
|
|
|
|
|
unsigned short version;
|
|
|
|
unsigned short flags;
|
|
|
|
unsigned hasPhrases; /* Phrases or PhrIndex/PhrImage */
|
|
|
|
|
2002-11-13 05:09:34 +01:00
|
|
|
unsigned numBmps;
|
|
|
|
HBITMAP* bmps;
|
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
unsigned numFonts;
|
|
|
|
HLPFILE_FONT* fonts;
|
2002-11-18 20:48:11 +01:00
|
|
|
|
|
|
|
unsigned numWindows;
|
|
|
|
HLPFILE_WINDOWINFO* windows;
|
1996-05-06 18:06:24 +02:00
|
|
|
} HLPFILE;
|
|
|
|
|
2002-11-20 20:46:18 +01:00
|
|
|
HLPFILE* HLPFILE_ReadHlpFile(LPCSTR lpszPath);
|
|
|
|
HLPFILE_PAGE* HLPFILE_Contents(HLPFILE* hlpfile);
|
|
|
|
HLPFILE_PAGE* HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash);
|
|
|
|
HLPFILE_PAGE* HLPFILE_PageByOffset(HLPFILE* hlpfile, LONG offset);
|
1996-05-06 18:06:24 +02:00
|
|
|
LONG HLPFILE_Hash(LPCSTR lpszContext);
|
2002-12-16 23:11:11 +01:00
|
|
|
void HLPFILE_FreeLink(HLPFILE_LINK* link);
|
2002-11-20 20:46:18 +01:00
|
|
|
void HLPFILE_FreeHlpFile(HLPFILE*);
|