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