4 * Copyright 1996 Ulrich Schmid
5 * 2002, 2008 Eric Pouech
6 * 2007 Kirill K. Smirnov
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
34 COLORREF sr_color
; /* color for scrollable region */
35 COLORREF nsr_color
; /* color for non scrollable region */
38 typedef struct tagHlpFileLink
40 enum {hlp_link_link
, hlp_link_popup
, hlp_link_macro
} cookie
;
41 LPCSTR string
; /* name of the file to for the link (NULL if same file) */
42 LONG hash
; /* topic index */
43 unsigned bClrChange
: 1; /* true if the link is green & underlined */
44 unsigned bHotSpot
: 1; /* true if the link is an hotspot (actually HLPFILE_HOTSPOTLINK) */
45 unsigned window
; /* window number for displaying the link (-1 is current) */
48 struct tagHlpFileLink
* next
;
51 typedef struct tagHlpFileHotSpotLink
58 } HLPFILE_HOTSPOTLINK
;
60 typedef struct tagHlpFileMacro
63 struct tagHlpFileMacro
* next
;
66 typedef struct tagHlpFilePage
69 HLPFILE_MACRO
* first_macro
;
71 HLPFILE_LINK
* first_link
;
76 struct tagHlpFilePage
* next
;
77 struct tagHlpFilePage
* prev
;
82 struct tagHlpFileFile
* file
;
98 typedef struct tagHlpFileFile
101 UINT file_buffer_size
;
105 HLPFILE_PAGE
* first_page
;
106 HLPFILE_PAGE
* last_page
;
107 HLPFILE_MACRO
* first_macro
;
115 unsigned long contents_start
;
117 struct tagHlpFileFile
* prev
;
118 struct tagHlpFileFile
* next
;
122 unsigned short version
;
123 unsigned short flags
;
124 unsigned short charset
;
125 unsigned short tbsize
; /* topic block size */
126 unsigned short dsize
; /* decompress size */
128 BOOL hasPhrases
; /* file has |Phrases */
129 BOOL hasPhrases40
; /* file has |PhrIndex/|PhrImage */
131 unsigned* phrases_offsets
;
132 char* phrases_buffer
;
145 HLPFILE_WINDOWINFO
* windows
;
148 BOOL has_popup_color
;
149 COLORREF popup_color
;
158 * Compare function type for HLPFILE_BPTreeSearch function.
161 * p [I] pointer to testing block (key + data)
162 * key [I] pointer to key value to look for
163 * leaf [I] whether this function called for index of leaf page
164 * next [O] pointer to pointer to next block
166 typedef int (*HLPFILE_BPTreeCompare
)(void *p
, const void *key
,
167 int leaf
, void **next
);
170 * Callback function type for HLPFILE_BPTreeEnum function.
173 * p [I] pointer to data block
174 * next [O] pointer to pointer to next block
175 * cookie [IO] cookie data
177 typedef void (*HLPFILE_BPTreeCallback
)(void *p
, void **next
, void *cookie
);
179 HLPFILE
* HLPFILE_ReadHlpFile(LPCSTR lpszPath
);
180 HLPFILE_PAGE
* HLPFILE_PageByHash(HLPFILE
* hlpfile
, LONG lHash
, ULONG
* relative
);
181 HLPFILE_PAGE
* HLPFILE_PageByMap(HLPFILE
* hlpfile
, LONG lMap
, ULONG
* relative
);
182 HLPFILE_PAGE
* HLPFILE_PageByOffset(HLPFILE
* hlpfile
, LONG offset
, ULONG
* relative
);
183 LONG
HLPFILE_Hash(LPCSTR lpszContext
);
184 void HLPFILE_FreeHlpFile(HLPFILE
*);
186 void HLPFILE_BPTreeEnum(BYTE
*, HLPFILE_BPTreeCallback cb
, void *cookie
);
190 char* data
; /* RTF stream start */
191 char* ptr
; /* current position in stream */
192 unsigned allocated
; /* overall allocated size */
193 unsigned char_pos
; /* current char position (in richedit) */
194 char* where
; /* pointer to feed back richedit */
195 unsigned font_scale
; /* how to scale fonts */
196 HLPFILE_LINK
*first_link
;
197 HLPFILE_LINK
*current_link
;
199 unsigned relative
; /* offset within page to lookup for */
200 unsigned char_pos_rel
; /* char_pos correspondinf to relative */
203 BOOL
HLPFILE_BrowsePage(HLPFILE_PAGE
*, struct RtfData
* rd
,
204 unsigned font_scale
, unsigned relative
);
206 #define HLP_DISPLAY30 0x01 /* version 3.0 displayable information */
207 #define HLP_TOPICHDR 0x02 /* topic header information */
208 #define HLP_DISPLAY 0x20 /* version 3.1 displayable information */
209 #define HLP_TABLE 0x23 /* version 3.1 table */