ReactOS  0.4.12-dev-14-gd0c8636
hlpfile.h
Go to the documentation of this file.
1 /*
2  * Help Viewer
3  *
4  * Copyright 1996 Ulrich Schmid
5  * 2002, 2008 Eric Pouech
6  * 2007 Kirill K. Smirnov
7  *
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.
12  *
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.
17  *
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
21  */
22 
23 #pragma once
24 
25 struct tagHelpFile;
26 
27 typedef struct
28 {
29  char type[10];
30  char name[9];
31  char caption[51];
34  int style;
36  COLORREF sr_color; /* color for scrollable region */
37  COLORREF nsr_color; /* color for non scrollable region */
39 
40 typedef struct tagHlpFileLink
41 {
42  enum {hlp_link_link, hlp_link_popup, hlp_link_macro} cookie;
43  LPCSTR string; /* name of the file to for the link (NULL if same file) */
44  LONG hash; /* topic index */
45  unsigned bClrChange : 1; /* true if the link is green & underlined */
46  unsigned bHotSpot : 1; /* true if the link is an hotspot (actually HLPFILE_HOTSPOTLINK) */
47  unsigned window; /* window number for displaying the link (-1 is current) */
51 } HLPFILE_LINK;
52 
53 typedef struct tagHlpFileHotSpotLink
54 {
56  unsigned x;
57  unsigned y;
58  unsigned width;
59  unsigned height;
61 
62 typedef struct tagHlpFileMacro
63 {
67 
68 typedef struct tagHlpFilePage
69 {
72 
74 
75  unsigned wNumber;
76  unsigned offset;
80 
83 
85 } HLPFILE_PAGE;
86 
87 typedef struct
88 {
90  unsigned long offset;
91 } HLPFILE_MAP;
92 
93 typedef struct
94 {
98 } HLPFILE_FONT;
99 
100 typedef struct tagHlpFileFile
101 {
113  unsigned wMapLen;
115  unsigned wTOMapLen;
116  unsigned* TOMap;
117  unsigned long contents_start;
118 
121 
122  unsigned wRefCount;
123 
124  unsigned short version;
125  unsigned short flags;
126  unsigned short charset;
127  unsigned short tbsize; /* topic block size */
128  unsigned short dsize; /* decompress size */
130  BOOL hasPhrases; /* file has |Phrases */
131  BOOL hasPhrases40; /* file has |PhrIndex/|PhrImage */
133  unsigned* phrases_offsets;
135 
139 
140  unsigned numBmps;
142 
143  unsigned numFonts;
145 
146  unsigned numWindows;
149 
152 
154 
155  int scale;
156  int rounderr;
157 } HLPFILE;
158 
159 /*
160  * Compare function type for HLPFILE_BPTreeSearch function.
161  *
162  * PARAMS
163  * p [I] pointer to testing block (key + data)
164  * key [I] pointer to key value to look for
165  * leaf [I] whether this function called for index of leaf page
166  * next [O] pointer to pointer to next block
167  */
168 typedef int (*HLPFILE_BPTreeCompare)(void *p, const void *key,
169  int leaf, void **next);
170 
171 /*
172  * Callback function type for HLPFILE_BPTreeEnum function.
173  *
174  * PARAMS
175  * p [I] pointer to data block
176  * next [O] pointer to pointer to next block
177  * cookie [IO] cookie data
178  */
179 typedef void (*HLPFILE_BPTreeCallback)(void *p, void **next, void *cookie);
180 
182 HLPFILE_PAGE* HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash, ULONG* relative);
183 HLPFILE_PAGE* HLPFILE_PageByMap(HLPFILE* hlpfile, LONG lMap, ULONG* relative);
185 LONG HLPFILE_Hash(LPCSTR lpszContext);
187 
188 void HLPFILE_BPTreeEnum(BYTE*, HLPFILE_BPTreeCallback cb, void *cookie);
189 
190 struct RtfData {
192  char* data; /* RTF stream start */
193  char* ptr; /* current position in stream */
194  unsigned allocated; /* overall allocated size */
195  unsigned char_pos; /* current char position (in richedit) */
196  char* where; /* pointer to feed back richedit */
197  unsigned font_scale; /* how to scale fonts */
201  unsigned relative; /* offset within page to lookup for */
202  unsigned char_pos_rel; /* char_pos correspondinf to relative */
203 };
204 
206  unsigned font_scale, unsigned relative);
207 
208 #define HLP_DISPLAY30 0x01 /* version 3.0 displayable information */
209 #define HLP_TOPICHDR 0x02 /* topic header information */
210 #define HLP_DISPLAY 0x20 /* version 3.1 displayable information */
211 #define HLP_TABLE 0x23 /* version 3.1 table */
unsigned short version
Definition: hlpfile.h:124
int rd
Definition: scanf.h:134
LOGFONTA LogFont
Definition: hlpfile.h:95
COLORREF color
Definition: hlpfile.h:97
HLPFILE_PAGE * last_page
Definition: hlpfile.h:108
BYTE * file_buffer
Definition: hlpfile.h:102
LPCSTR lpszMacro
Definition: hlpfile.h:64
static HICON
Definition: imagelist.c:84
void(* HLPFILE_BPTreeCallback)(void *p, void **next, void *cookie)
Definition: hlpfile.h:179
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
unsigned long offset
Definition: hlpfile.h:90
#define HBITMAP
Definition: msvc.h:28
HLPFILE_LINK * first_link
Definition: hlpfile.h:198
struct tagHlpFileLink HLPFILE_LINK
struct tagHlpFileFile * file
Definition: hlpfile.h:84
unsigned short tbsize
Definition: hlpfile.h:127
UINT topic_maplen
Definition: hlpfile.h:138
GLintptr offset
Definition: glext.h:5920
unsigned font_scale
Definition: hlpfile.h:197
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
void HLPFILE_FreeHlpFile(HLPFILE *)
Definition: hlpfile.c:2297
char * phrases_buffer
Definition: hlpfile.h:134
HBITMAP * bmps
Definition: hlpfile.h:141
unsigned short charset
Definition: hlpfile.h:126
char * LPSTR
Definition: xmlstorage.h:182
unsigned allocated
Definition: hlpfile.h:194
LONG lMap
Definition: hlpfile.h:89
char * where
Definition: hlpfile.h:196
unsigned numWindows
Definition: hlpfile.h:146
HLPFILE_LINK * first_link
Definition: hlpfile.h:73
BOOL in_text
Definition: hlpfile.h:191
HLPFILE_MACRO * first_macro
Definition: hlpfile.h:71
unsigned long contents_start
Definition: hlpfile.h:117
unsigned relative
Definition: hlpfile.h:201
LPSTR help_on_file
Definition: hlpfile.h:153
HLPFILE_LINK * current_link
Definition: hlpfile.h:199
long LONG
Definition: pedump.c:60
struct tagHlpFileMacro * next
Definition: hlpfile.h:65
HLPFILE_PAGE * first_page
Definition: hlpfile.h:107
BOOL has_popup_color
Definition: hlpfile.h:150
unsigned numBmps
Definition: hlpfile.h:140
DWORD browse_fwd
Definition: hlpfile.h:82
BOOL hasPhrases40
Definition: hlpfile.h:131
LPSTR lpszPath
Definition: hlpfile.h:104
BYTE ** topic_map
Definition: hlpfile.h:136
LONG HLPFILE_Hash(LPCSTR lpszContext)
Definition: hlpfile.c:547
struct tagHlpFileHotSpotLink HLPFILE_HOTSPOTLINK
struct tagHlpFileFile HLPFILE
const char * LPCSTR
Definition: xmlstorage.h:183
BYTE * topic_end
Definition: hlpfile.h:137
void HLPFILE_BPTreeEnum(BYTE *, HLPFILE_BPTreeCallback cb, void *cookie)
Definition: hlpfile.c:125
HLPFILE_MACRO * first_macro
Definition: hlpfile.h:109
unsigned * phrases_offsets
Definition: hlpfile.h:133
unsigned * TOMap
Definition: hlpfile.h:116
unsigned int BOOL
Definition: ntddk_ex.h:94
COLORREF sr_color
Definition: hlpfile.h:36
COLORREF nsr_color
Definition: hlpfile.h:37
unsigned offset
Definition: hlpfile.h:76
unsigned int UINT
Definition: ndis.h:50
LPSTR lpszCopyright
Definition: hlpfile.h:106
LPSTR lpszTitle
Definition: hlpfile.h:105
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char_pos
Definition: hlpfile.h:195
HLPFILE_PAGE * HLPFILE_PageByOffset(HLPFILE *hlpfile, LONG offset, ULONG *relative)
Definition: hlpfile.c:369
BYTE * kwdata
Definition: hlpfile.h:112
HLPFILE_MAP * Map
Definition: hlpfile.h:114
static DWORD cb
Definition: integrity.c:41
HLPFILE * HLPFILE_ReadHlpFile(LPCSTR lpszPath)
Definition: hlpfile.c:2759
BOOL compressed
Definition: hlpfile.h:129
struct tagHlpFilePage * prev
Definition: hlpfile.h:79
COLORREF popup_color
Definition: hlpfile.h:151
unsigned numFonts
Definition: hlpfile.h:143
struct tagHlpFileFile * prev
Definition: hlpfile.h:119
struct tagHlpFilePage HLPFILE_PAGE
LPSTR lpszTitle
Definition: hlpfile.h:70
BOOL hasPhrases
Definition: hlpfile.h:130
HKEY key
Definition: reg.c:42
struct tagHlpFileMacro HLPFILE_MACRO
HLPFILE_WINDOWINFO * windows
Definition: hlpfile.h:147
DWORD browse_bwd
Definition: hlpfile.h:81
HICON hIcon
Definition: hlpfile.h:148
unsigned char BYTE
Definition: ntddk_ex.h:96
HFONT hFont
Definition: hlpfile.h:96
static unsigned __int64 next
Definition: rand_nt.c:6
HLPFILE_PAGE * HLPFILE_PageByHash(HLPFILE *hlpfile, LONG lHash, ULONG *relative)
Definition: hlpfile.c:437
unsigned wMapLen
Definition: hlpfile.h:113
unsigned wRefCount
Definition: hlpfile.h:122
unsigned short flags
Definition: hlpfile.h:125
BOOL force_color
Definition: hlpfile.h:200
BYTE * Context
Definition: hlpfile.h:110
BYTE * kwbtree
Definition: hlpfile.h:111
char * ptr
Definition: hlpfile.h:193
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
DWORD reference
Definition: hlpfile.h:77
HLPFILE_PAGE * HLPFILE_PageByMap(HLPFILE *hlpfile, LONG lMap, ULONG *relative)
Definition: hlpfile.c:467
unsigned wTOMapLen
Definition: hlpfile.h:115
Definition: name.c:36
unsigned char_pos_rel
Definition: hlpfile.h:202
unsigned int ULONG
Definition: retypes.h:1
int(* HLPFILE_BPTreeCompare)(void *p, const void *key, int leaf, void **next)
Definition: hlpfile.h:168
unsigned short dsize
Definition: hlpfile.h:128
BOOL HLPFILE_BrowsePage(HLPFILE_PAGE *, struct RtfData *rd, unsigned font_scale, unsigned relative)
Definition: hlpfile.c:1703
GLfloat GLfloat p
Definition: glext.h:8902
unsigned wNumber
Definition: hlpfile.h:75
struct tagHlpFilePage * next
Definition: hlpfile.h:78
DWORD COLORREF
Definition: windef.h:290
HLPFILE_FONT * fonts
Definition: hlpfile.h:144
UINT num_phrases
Definition: hlpfile.h:132
UINT file_buffer_size
Definition: hlpfile.h:103
char * data
Definition: hlpfile.h:192
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:29
struct tagHlpFileFile * next
Definition: hlpfile.h:120