ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

hlpfile.h
Go to the documentation of this file.
00001 /*
00002  * Help Viewer
00003  *
00004  * Copyright    1996 Ulrich Schmid
00005  *              2002, 2008 Eric Pouech
00006  *              2007 Kirill K. Smirnov
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2.1 of the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00021  */
00022 
00023 struct tagHelpFile;
00024 
00025 typedef struct 
00026 {
00027     char        type[10];
00028     char        name[9];
00029     char        caption[51];
00030     POINT       origin;
00031     SIZE        size;
00032     int         style;
00033     DWORD       win_style;
00034     COLORREF    sr_color;       /* color for scrollable region */
00035     COLORREF    nsr_color;      /* color for non scrollable region */
00036 } HLPFILE_WINDOWINFO;
00037 
00038 typedef struct tagHlpFileLink
00039 {
00040     enum {hlp_link_link, hlp_link_popup, hlp_link_macro} cookie;
00041     LPCSTR      string;         /* name of the file to for the link (NULL if same file) */
00042     LONG        hash;           /* topic index */
00043     unsigned    bClrChange : 1; /* true if the link is green & underlined */
00044     unsigned    bHotSpot : 1;   /* true if the link is an hotspot (actually HLPFILE_HOTSPOTLINK) */
00045     unsigned    window;         /* window number for displaying the link (-1 is current) */
00046     DWORD       cpMin;
00047     DWORD       cpMax;
00048     struct tagHlpFileLink* next;
00049 } HLPFILE_LINK;
00050 
00051 typedef struct tagHlpFileHotSpotLink
00052 {
00053     HLPFILE_LINK link;
00054     unsigned    x;
00055     unsigned    y;
00056     unsigned    width;
00057     unsigned    height;
00058 } HLPFILE_HOTSPOTLINK;
00059 
00060 typedef struct tagHlpFileMacro
00061 {
00062     LPCSTR                      lpszMacro;
00063     struct tagHlpFileMacro*     next;
00064 } HLPFILE_MACRO;
00065 
00066 typedef struct tagHlpFilePage
00067 {
00068     LPSTR                       lpszTitle;
00069     HLPFILE_MACRO*              first_macro;
00070 
00071     HLPFILE_LINK*               first_link;
00072 
00073     unsigned                    wNumber;
00074     unsigned                    offset;
00075     DWORD                       reference;
00076     struct tagHlpFilePage*      next;
00077     struct tagHlpFilePage*      prev;
00078 
00079     DWORD                       browse_bwd;
00080     DWORD                       browse_fwd;
00081 
00082     struct tagHlpFileFile*      file;
00083 } HLPFILE_PAGE;
00084 
00085 typedef struct
00086 {
00087     LONG                        lMap;
00088     unsigned long               offset;
00089 } HLPFILE_MAP;
00090 
00091 typedef struct
00092 {
00093     LOGFONT                     LogFont;
00094     HFONT                       hFont;
00095     COLORREF                    color;
00096 } HLPFILE_FONT;
00097 
00098 typedef struct tagHlpFileFile
00099 {
00100     BYTE*                       file_buffer;
00101     UINT                        file_buffer_size;
00102     LPSTR                       lpszPath;
00103     LPSTR                       lpszTitle;
00104     LPSTR                       lpszCopyright;
00105     HLPFILE_PAGE*               first_page;
00106     HLPFILE_PAGE*               last_page;
00107     HLPFILE_MACRO*              first_macro;
00108     BYTE*                       Context;
00109     BYTE*                       kwbtree;
00110     BYTE*                       kwdata;
00111     unsigned                    wMapLen;
00112     HLPFILE_MAP*                Map;
00113     unsigned                    wTOMapLen;
00114     unsigned*                   TOMap;
00115     unsigned long               contents_start;
00116 
00117     struct tagHlpFileFile*      prev;
00118     struct tagHlpFileFile*      next;
00119 
00120     unsigned                    wRefCount;
00121 
00122     unsigned short              version;
00123     unsigned short              flags;
00124     unsigned short              charset;
00125     unsigned short              tbsize;     /* topic block size */
00126     unsigned short              dsize;      /* decompress size */
00127     unsigned short              compressed;
00128     unsigned                    hasPhrases;   /* file has |Phrases */
00129     unsigned                    hasPhrases40; /* file has |PhrIndex/|PhrImage */
00130     UINT                        num_phrases;
00131     unsigned*                   phrases_offsets;
00132     char*                       phrases_buffer;
00133 
00134     BYTE**                      topic_map;
00135     BYTE*                       topic_end;
00136     UINT                        topic_maplen;
00137 
00138     unsigned                    numBmps;
00139     HBITMAP*                    bmps;
00140 
00141     unsigned                    numFonts;
00142     HLPFILE_FONT*               fonts;
00143 
00144     unsigned                    numWindows;
00145     HLPFILE_WINDOWINFO*         windows;
00146     HICON                       hIcon;
00147 
00148     BOOL                        has_popup_color;
00149     COLORREF                    popup_color;
00150 
00151     LPSTR                       help_on_file;
00152 } HLPFILE;
00153 
00154 /*
00155  * Compare function type for HLPFILE_BPTreeSearch function.
00156  *
00157  * PARAMS
00158  *     p       [I] pointer to testing block (key + data)
00159  *     key     [I] pointer to key value to look for
00160  *     leaf    [I] whether this function called for index of leaf page
00161  *     next    [O] pointer to pointer to next block
00162  */
00163 typedef int (*HLPFILE_BPTreeCompare)(void *p, const void *key,
00164                                      int leaf, void **next);
00165 
00166 /*
00167  * Callback function type for HLPFILE_BPTreeEnum function.
00168  *
00169  * PARAMS
00170  *     p       [I]  pointer to data block
00171  *     next    [O]  pointer to pointer to next block
00172  *     cookie  [IO] cookie data
00173  */
00174 typedef void (*HLPFILE_BPTreeCallback)(void *p, void **next, void *cookie);
00175 
00176 HLPFILE*      HLPFILE_ReadHlpFile(LPCSTR lpszPath);
00177 HLPFILE_PAGE* HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash, ULONG* relative);
00178 HLPFILE_PAGE* HLPFILE_PageByMap(HLPFILE* hlpfile, LONG lMap, ULONG* relative);
00179 HLPFILE_PAGE* HLPFILE_PageByOffset(HLPFILE* hlpfile, LONG offset, ULONG* relative);
00180 LONG          HLPFILE_Hash(LPCSTR lpszContext);
00181 void          HLPFILE_FreeHlpFile(HLPFILE*);
00182 
00183 void  HLPFILE_BPTreeEnum(BYTE*, HLPFILE_BPTreeCallback cb, void *cookie);
00184 
00185 struct RtfData {
00186     BOOL        in_text;
00187     char*       data;           /* RTF stream start */
00188     char*       ptr;            /* current position in stream */
00189     unsigned    allocated;      /* overall allocated size */
00190     unsigned    char_pos;       /* current char position (in richedit) */
00191     char*       where;          /* pointer to feed back richedit */
00192     unsigned    font_scale;     /* how to scale fonts */
00193     HLPFILE_LINK*first_link;
00194     HLPFILE_LINK*current_link;
00195     BOOL        force_color;
00196     unsigned    relative;       /* offset within page to lookup for */
00197     unsigned    char_pos_rel;   /* char_pos correspondinf to relative */
00198 };
00199 
00200 BOOL          HLPFILE_BrowsePage(HLPFILE_PAGE*, struct RtfData* rd,
00201                                  unsigned font_scale, unsigned relative);

Generated on Sun May 27 2012 04:17:47 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.