- SVN maintenance.

svn path=/trunk/; revision=38880
This commit is contained in:
Aleksey Bragin 2009-01-18 10:22:07 +00:00
parent d068ad2d69
commit ea435d7876
11 changed files with 8214 additions and 8214 deletions

View file

@ -1,180 +1,180 @@
/* /*
* Help Viewer - DLL callback into WineHelp * Help Viewer - DLL callback into WineHelp
* *
* Copyright 2004 Eric Pouech * Copyright 2004 Eric Pouech
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * 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, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <stdio.h> #include <stdio.h>
#include "windows.h" #include "windows.h"
#include "winhelp.h" #include "winhelp.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(winhelp); WINE_DEFAULT_DEBUG_CHANNEL(winhelp);
static WORD CALLBACK WHD_GetFSError(void) static WORD CALLBACK WHD_GetFSError(void)
{ {
WINE_FIXME("()\n"); WINE_FIXME("()\n");
return 0; return 0;
} }
static HANDLE CALLBACK WHD_Open(LPSTR name, BYTE flags) static HANDLE CALLBACK WHD_Open(LPSTR name, BYTE flags)
{ {
unsigned mode = 0; unsigned mode = 0;
WINE_FIXME("(%s %x)\n", wine_dbgstr_a(name), flags); WINE_FIXME("(%s %x)\n", wine_dbgstr_a(name), flags);
switch (flags) switch (flags)
{ {
case 0: mode = GENERIC_READ | GENERIC_WRITE; break; case 0: mode = GENERIC_READ | GENERIC_WRITE; break;
case 2: mode = GENERIC_READ; break; case 2: mode = GENERIC_READ; break;
default: WINE_FIXME("Undocumented flags %x\n", flags); default: WINE_FIXME("Undocumented flags %x\n", flags);
} }
return CreateFile(name, mode, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, return CreateFile(name, mode, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
} }
static WORD CALLBACK WHD_Close(HANDLE fs) static WORD CALLBACK WHD_Close(HANDLE fs)
{ {
WINE_FIXME("(%p)\n", fs); WINE_FIXME("(%p)\n", fs);
CloseHandle(fs); CloseHandle(fs);
return 0; return 0;
} }
static HANDLE CALLBACK WHD_OpenBag(HANDLE fs, LPSTR name, BYTE flags) static HANDLE CALLBACK WHD_OpenBag(HANDLE fs, LPSTR name, BYTE flags)
{ {
WINE_FIXME("(%p %s %x)\n", fs, name, flags); WINE_FIXME("(%p %s %x)\n", fs, name, flags);
return NULL; return NULL;
} }
static HANDLE CALLBACK WHD_CloseBag(HANDLE bag) static HANDLE CALLBACK WHD_CloseBag(HANDLE bag)
{ {
WINE_FIXME("()\n"); WINE_FIXME("()\n");
return NULL; return NULL;
} }
static LONG CALLBACK WHD_ReadBag(HANDLE bag, BYTE* ptr, LONG len) static LONG CALLBACK WHD_ReadBag(HANDLE bag, BYTE* ptr, LONG len)
{ {
WINE_FIXME("()\n"); WINE_FIXME("()\n");
return 0; return 0;
} }
static LONG CALLBACK WHD_TellBag(HANDLE bag) static LONG CALLBACK WHD_TellBag(HANDLE bag)
{ {
WINE_FIXME("()\n"); WINE_FIXME("()\n");
return 0; return 0;
} }
static LONG CALLBACK WHD_SeekBag(HANDLE bag, LONG offset, WORD whence) static LONG CALLBACK WHD_SeekBag(HANDLE bag, LONG offset, WORD whence)
{ {
WINE_FIXME("()\n"); WINE_FIXME("()\n");
return 0; return 0;
} }
static BOOL CALLBACK WHD_IsEofBag(HANDLE bag) static BOOL CALLBACK WHD_IsEofBag(HANDLE bag)
{ {
WINE_FIXME("()\n"); WINE_FIXME("()\n");
return FALSE; return FALSE;
} }
static LONG CALLBACK WHD_SizeBag(HANDLE bag) static LONG CALLBACK WHD_SizeBag(HANDLE bag)
{ {
WINE_FIXME("()\n"); WINE_FIXME("()\n");
return 0; return 0;
} }
static BOOL CALLBACK WHD_Access(HANDLE fs, LPSTR name, BYTE flags) static BOOL CALLBACK WHD_Access(HANDLE fs, LPSTR name, BYTE flags)
{ {
WINE_FIXME("()\n"); WINE_FIXME("()\n");
return FALSE; return FALSE;
} }
static WORD CALLBACK WHD_LLInfoFromBag(HANDLE bag, WORD opt, LPWORD p1, LPLONG p2, LPLONG p3) static WORD CALLBACK WHD_LLInfoFromBag(HANDLE bag, WORD opt, LPWORD p1, LPLONG p2, LPLONG p3)
{ {
WINE_FIXME("()\n"); WINE_FIXME("()\n");
return 0; return 0;
} }
static WORD CALLBACK WHD_LLInfoFromFile(HANDLE fs, LPSTR name, WORD opt, LPWORD p1, LPLONG p2, LPLONG p3) static WORD CALLBACK WHD_LLInfoFromFile(HANDLE fs, LPSTR name, WORD opt, LPWORD p1, LPLONG p2, LPLONG p3)
{ {
WINE_FIXME("()\n"); WINE_FIXME("()\n");
return 0; return 0;
} }
static void CALLBACK WHD_Error(int err) static void CALLBACK WHD_Error(int err)
{ {
WINE_FIXME("()\n"); WINE_FIXME("()\n");
} }
static void CALLBACK WHD_ErrorString(LPSTR err) static void CALLBACK WHD_ErrorString(LPSTR err)
{ {
WINE_FIXME("()\n"); WINE_FIXME("()\n");
} }
static ULONG_PTR CALLBACK WHD_GetInfo(WORD what, HWND hnd) static ULONG_PTR CALLBACK WHD_GetInfo(WORD what, HWND hnd)
{ {
ULONG_PTR ret = 0; ULONG_PTR ret = 0;
WINE_TRACE("(%x %p)\n", what, hnd); WINE_TRACE("(%x %p)\n", what, hnd);
switch (what) switch (what)
{ {
case 0: break; case 0: break;
case 1: /* instance */ ret = (ULONG_PTR)Globals.hInstance; break; case 1: /* instance */ ret = (ULONG_PTR)Globals.hInstance; break;
case 3: /* current window */ ret = (ULONG_PTR)Globals.active_win->hMainWnd; break; case 3: /* current window */ ret = (ULONG_PTR)Globals.active_win->hMainWnd; break;
case 2: /* main window */ case 2: /* main window */
case 4: /* handle to opened file */ case 4: /* handle to opened file */
case 5: /* foreground color */ case 5: /* foreground color */
case 6: /* background color */ case 6: /* background color */
case 7: /* topic number */ case 7: /* topic number */
case 8: /* current opened file name */ case 8: /* current opened file name */
WINE_FIXME("NIY %u\n", what); WINE_FIXME("NIY %u\n", what);
break; break;
default: default:
WINE_FIXME("Undocumented %u\n", what); WINE_FIXME("Undocumented %u\n", what);
break; break;
} }
return ret; return ret;
} }
static LONG CALLBACK WHD_API(LPSTR x, WORD xx, DWORD xxx) static LONG CALLBACK WHD_API(LPSTR x, WORD xx, DWORD xxx)
{ {
WINE_FIXME("()\n"); WINE_FIXME("()\n");
return 0; return 0;
} }
FARPROC Callbacks[] = FARPROC Callbacks[] =
{ {
(FARPROC)WHD_GetFSError, (FARPROC)WHD_GetFSError,
(FARPROC)WHD_Open, (FARPROC)WHD_Open,
(FARPROC)WHD_Close, (FARPROC)WHD_Close,
(FARPROC)WHD_OpenBag, (FARPROC)WHD_OpenBag,
(FARPROC)WHD_CloseBag, (FARPROC)WHD_CloseBag,
(FARPROC)WHD_ReadBag, (FARPROC)WHD_ReadBag,
(FARPROC)WHD_TellBag, (FARPROC)WHD_TellBag,
(FARPROC)WHD_SeekBag, (FARPROC)WHD_SeekBag,
(FARPROC)WHD_IsEofBag, (FARPROC)WHD_IsEofBag,
(FARPROC)WHD_SizeBag, (FARPROC)WHD_SizeBag,
(FARPROC)WHD_Access, (FARPROC)WHD_Access,
(FARPROC)WHD_LLInfoFromBag, (FARPROC)WHD_LLInfoFromBag,
(FARPROC)WHD_LLInfoFromFile, (FARPROC)WHD_LLInfoFromFile,
(FARPROC)WHD_Error, (FARPROC)WHD_Error,
(FARPROC)WHD_ErrorString, (FARPROC)WHD_ErrorString,
(FARPROC)WHD_GetInfo, (FARPROC)WHD_GetInfo,
(FARPROC)WHD_API (FARPROC)WHD_API
}; };

File diff suppressed because it is too large Load diff

View file

@ -1,191 +1,191 @@
/* /*
* Help Viewer * Help Viewer
* *
* Copyright 1996 Ulrich Schmid * Copyright 1996 Ulrich Schmid
* 2002, 2008 Eric Pouech * 2002, 2008 Eric Pouech
* 2007 Kirill K. Smirnov * 2007 Kirill K. Smirnov
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * 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, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
struct tagHelpFile; struct tagHelpFile;
typedef struct typedef struct
{ {
char type[10]; char type[10];
char name[9]; char name[9];
char caption[51]; char caption[51];
POINT origin; POINT origin;
SIZE size; SIZE size;
int style; int style;
DWORD win_style; DWORD win_style;
COLORREF sr_color; /* color for scrollable region */ COLORREF sr_color; /* color for scrollable region */
COLORREF nsr_color; /* color for non scrollable region */ COLORREF nsr_color; /* color for non scrollable region */
} HLPFILE_WINDOWINFO; } HLPFILE_WINDOWINFO;
typedef struct tagHlpFileLink typedef struct tagHlpFileLink
{ {
enum {hlp_link_link, hlp_link_popup, hlp_link_macro} cookie; enum {hlp_link_link, hlp_link_popup, hlp_link_macro} cookie;
LPCSTR string; /* name of the file to for the link (NULL if same file) */ LPCSTR string; /* name of the file to for the link (NULL if same file) */
LONG hash; /* topic index */ LONG hash; /* topic index */
unsigned bClrChange : 1; /* true if the link is green & underlined */ unsigned bClrChange : 1; /* true if the link is green & underlined */
unsigned window; /* window number for displaying the link (-1 is current) */ unsigned window; /* window number for displaying the link (-1 is current) */
DWORD cpMin; DWORD cpMin;
DWORD cpMax; DWORD cpMax;
struct tagHlpFileLink* next; struct tagHlpFileLink* next;
} HLPFILE_LINK; } HLPFILE_LINK;
typedef struct tagHlpFileMacro typedef struct tagHlpFileMacro
{ {
LPCSTR lpszMacro; LPCSTR lpszMacro;
struct tagHlpFileMacro* next; struct tagHlpFileMacro* next;
} HLPFILE_MACRO; } HLPFILE_MACRO;
typedef struct tagHlpFilePage typedef struct tagHlpFilePage
{ {
LPSTR lpszTitle; LPSTR lpszTitle;
HLPFILE_MACRO* first_macro; HLPFILE_MACRO* first_macro;
HLPFILE_LINK* first_link; HLPFILE_LINK* first_link;
unsigned wNumber; unsigned wNumber;
unsigned offset; unsigned offset;
DWORD reference; DWORD reference;
struct tagHlpFilePage* next; struct tagHlpFilePage* next;
struct tagHlpFilePage* prev; struct tagHlpFilePage* prev;
DWORD browse_bwd; DWORD browse_bwd;
DWORD browse_fwd; DWORD browse_fwd;
struct tagHlpFileFile* file; struct tagHlpFileFile* file;
} HLPFILE_PAGE; } HLPFILE_PAGE;
typedef struct typedef struct
{ {
LONG lMap; LONG lMap;
unsigned long offset; unsigned long offset;
} HLPFILE_MAP; } HLPFILE_MAP;
typedef struct typedef struct
{ {
LOGFONT LogFont; LOGFONT LogFont;
HFONT hFont; HFONT hFont;
COLORREF color; COLORREF color;
} HLPFILE_FONT; } HLPFILE_FONT;
typedef struct tagHlpFileFile typedef struct tagHlpFileFile
{ {
BYTE* file_buffer; BYTE* file_buffer;
UINT file_buffer_size; UINT file_buffer_size;
LPSTR lpszPath; LPSTR lpszPath;
LPSTR lpszTitle; LPSTR lpszTitle;
LPSTR lpszCopyright; LPSTR lpszCopyright;
HLPFILE_PAGE* first_page; HLPFILE_PAGE* first_page;
HLPFILE_PAGE* last_page; HLPFILE_PAGE* last_page;
HLPFILE_MACRO* first_macro; HLPFILE_MACRO* first_macro;
BYTE* Context; BYTE* Context;
BYTE* kwbtree; BYTE* kwbtree;
BYTE* kwdata; BYTE* kwdata;
unsigned wMapLen; unsigned wMapLen;
HLPFILE_MAP* Map; HLPFILE_MAP* Map;
unsigned wTOMapLen; unsigned wTOMapLen;
unsigned* TOMap; unsigned* TOMap;
unsigned long contents_start; unsigned long contents_start;
struct tagHlpFileFile* prev; struct tagHlpFileFile* prev;
struct tagHlpFileFile* next; struct tagHlpFileFile* next;
unsigned wRefCount; unsigned wRefCount;
unsigned short version; unsigned short version;
unsigned short flags; unsigned short flags;
unsigned short charset; unsigned short charset;
unsigned short tbsize; /* topic block size */ unsigned short tbsize; /* topic block size */
unsigned short dsize; /* decompress size */ unsigned short dsize; /* decompress size */
unsigned short compressed; unsigned short compressed;
unsigned hasPhrases; /* file has |Phrases */ unsigned hasPhrases; /* file has |Phrases */
unsigned hasPhrases40; /* file has |PhrIndex/|PhrImage */ unsigned hasPhrases40; /* file has |PhrIndex/|PhrImage */
UINT num_phrases; UINT num_phrases;
unsigned* phrases_offsets; unsigned* phrases_offsets;
char* phrases_buffer; char* phrases_buffer;
BYTE** topic_map; BYTE** topic_map;
BYTE* topic_end; BYTE* topic_end;
UINT topic_maplen; UINT topic_maplen;
unsigned numBmps; unsigned numBmps;
HBITMAP* bmps; HBITMAP* bmps;
unsigned numFonts; unsigned numFonts;
HLPFILE_FONT* fonts; HLPFILE_FONT* fonts;
unsigned numWindows; unsigned numWindows;
HLPFILE_WINDOWINFO* windows; HLPFILE_WINDOWINFO* windows;
HICON hIcon; HICON hIcon;
BOOL has_popup_color; BOOL has_popup_color;
COLORREF popup_color; COLORREF popup_color;
LPSTR help_on_file; LPSTR help_on_file;
} HLPFILE; } HLPFILE;
/* /*
* Compare function type for HLPFILE_BPTreeSearch function. * Compare function type for HLPFILE_BPTreeSearch function.
* *
* PARAMS * PARAMS
* p [I] pointer to testing block (key + data) * p [I] pointer to testing block (key + data)
* key [I] pointer to key value to look for * key [I] pointer to key value to look for
* leaf [I] whether this function called for index of leaf page * leaf [I] whether this function called for index of leaf page
* next [O] pointer to pointer to next block * next [O] pointer to pointer to next block
*/ */
typedef int (*HLPFILE_BPTreeCompare)(void *p, const void *key, typedef int (*HLPFILE_BPTreeCompare)(void *p, const void *key,
int leaf, void **next); int leaf, void **next);
/* /*
* Callback function type for HLPFILE_BPTreeEnum function. * Callback function type for HLPFILE_BPTreeEnum function.
* *
* PARAMS * PARAMS
* p [I] pointer to data block * p [I] pointer to data block
* next [O] pointer to pointer to next block * next [O] pointer to pointer to next block
* cookie [IO] cookie data * cookie [IO] cookie data
*/ */
typedef void (*HLPFILE_BPTreeCallback)(void *p, void **next, void *cookie); typedef void (*HLPFILE_BPTreeCallback)(void *p, void **next, void *cookie);
HLPFILE* HLPFILE_ReadHlpFile(LPCSTR lpszPath); HLPFILE* HLPFILE_ReadHlpFile(LPCSTR lpszPath);
HLPFILE_PAGE* HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash, ULONG* relative); HLPFILE_PAGE* HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash, ULONG* relative);
HLPFILE_PAGE* HLPFILE_PageByMap(HLPFILE* hlpfile, LONG lMap, ULONG* relative); HLPFILE_PAGE* HLPFILE_PageByMap(HLPFILE* hlpfile, LONG lMap, ULONG* relative);
HLPFILE_PAGE* HLPFILE_PageByOffset(HLPFILE* hlpfile, LONG offset, ULONG* relative); HLPFILE_PAGE* HLPFILE_PageByOffset(HLPFILE* hlpfile, LONG offset, ULONG* relative);
LONG HLPFILE_Hash(LPCSTR lpszContext); LONG HLPFILE_Hash(LPCSTR lpszContext);
void HLPFILE_FreeHlpFile(HLPFILE*); void HLPFILE_FreeHlpFile(HLPFILE*);
void HLPFILE_BPTreeEnum(BYTE*, HLPFILE_BPTreeCallback cb, void *cookie); void HLPFILE_BPTreeEnum(BYTE*, HLPFILE_BPTreeCallback cb, void *cookie);
struct RtfData { struct RtfData {
BOOL in_text; BOOL in_text;
char* data; /* RTF stream start */ char* data; /* RTF stream start */
char* ptr; /* current position in stream */ char* ptr; /* current position in stream */
unsigned allocated; /* overall allocated size */ unsigned allocated; /* overall allocated size */
unsigned char_pos; /* current char position (in richedit) */ unsigned char_pos; /* current char position (in richedit) */
char* where; /* pointer to feed back richedit */ char* where; /* pointer to feed back richedit */
unsigned font_scale; /* how to scale fonts */ unsigned font_scale; /* how to scale fonts */
HLPFILE_LINK*first_link; HLPFILE_LINK*first_link;
HLPFILE_LINK*current_link; HLPFILE_LINK*current_link;
BOOL force_color; BOOL force_color;
unsigned relative; /* offset within page to lookup for */ unsigned relative; /* offset within page to lookup for */
unsigned char_pos_rel; /* char_pos correspondinf to relative */ unsigned char_pos_rel; /* char_pos correspondinf to relative */
}; };
BOOL HLPFILE_BrowsePage(HLPFILE_PAGE*, struct RtfData* rd, BOOL HLPFILE_BrowsePage(HLPFILE_PAGE*, struct RtfData* rd,
unsigned font_scale, unsigned relative); unsigned font_scale, unsigned relative);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,62 +1,62 @@
/* /*
* Help Viewer * Help Viewer
* *
* Copyright 1996 Ulrich Schmid * Copyright 1996 Ulrich Schmid
* Copyright 2002 Eric Pouech * Copyright 2002 Eric Pouech
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * 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, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <stdarg.h> #include <stdarg.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
struct lexret { struct lexret {
LPCSTR proto; LPCSTR proto;
BOOL bool; BOOL bool;
LONG integer; LONG integer;
LPCSTR string; LPCSTR string;
FARPROC function; FARPROC function;
}; };
extern struct lexret yylval; extern struct lexret yylval;
BOOL MACRO_ExecuteMacro(LPCSTR); BOOL MACRO_ExecuteMacro(LPCSTR);
int MACRO_Lookup(const char* name, struct lexret* lr); int MACRO_Lookup(const char* name, struct lexret* lr);
enum token_types {EMPTY, VOID_FUNCTION, BOOL_FUNCTION, INTEGER, STRING, IDENTIFIER}; enum token_types {EMPTY, VOID_FUNCTION, BOOL_FUNCTION, INTEGER, STRING, IDENTIFIER};
void CALLBACK MACRO_About(void); void CALLBACK MACRO_About(void);
void CALLBACK MACRO_Annotate(void); void CALLBACK MACRO_Annotate(void);
void CALLBACK MACRO_BookmarkDefine(void); void CALLBACK MACRO_BookmarkDefine(void);
void CALLBACK MACRO_CopyDialog(void); void CALLBACK MACRO_CopyDialog(void);
void CALLBACK MACRO_CreateButton(LPCSTR, LPCSTR, LPCSTR); void CALLBACK MACRO_CreateButton(LPCSTR, LPCSTR, LPCSTR);
void CALLBACK MACRO_DisableButton(LPCSTR); void CALLBACK MACRO_DisableButton(LPCSTR);
void CALLBACK MACRO_Exit(void); void CALLBACK MACRO_Exit(void);
void CALLBACK MACRO_FileOpen(void); void CALLBACK MACRO_FileOpen(void);
void CALLBACK MACRO_HelpOn(void); void CALLBACK MACRO_HelpOn(void);
void CALLBACK MACRO_HelpOnTop(void); void CALLBACK MACRO_HelpOnTop(void);
void CALLBACK MACRO_History(void); void CALLBACK MACRO_History(void);
void CALLBACK MACRO_JumpContents(LPCSTR, LPCSTR); void CALLBACK MACRO_JumpContents(LPCSTR, LPCSTR);
void CALLBACK MACRO_JumpContext(LPCSTR, LPCSTR, LONG); void CALLBACK MACRO_JumpContext(LPCSTR, LPCSTR, LONG);
void CALLBACK MACRO_JumpHash(LPCSTR, LPCSTR, LONG); void CALLBACK MACRO_JumpHash(LPCSTR, LPCSTR, LONG);
void CALLBACK MACRO_PopupContext(LPCSTR, LONG); void CALLBACK MACRO_PopupContext(LPCSTR, LONG);
void CALLBACK MACRO_Print(void); void CALLBACK MACRO_Print(void);
void CALLBACK MACRO_PrinterSetup(void); void CALLBACK MACRO_PrinterSetup(void);
void CALLBACK MACRO_SetContents(LPCSTR, LONG); void CALLBACK MACRO_SetContents(LPCSTR, LONG);
/* Local Variables: */ /* Local Variables: */
/* c-file-style: "GNU" */ /* c-file-style: "GNU" */
/* End: */ /* End: */

View file

@ -1,316 +1,316 @@
%{ /* -*-C-*- */ %{ /* -*-C-*- */
/* /*
* Help Viewer * Help Viewer
* *
* Copyright 1996 Ulrich Schmid * Copyright 1996 Ulrich Schmid
* Copyright 2002,2008 Eric Pouech * Copyright 2002,2008 Eric Pouech
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * 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, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
%} %}
%option noinput nounput interactive 8bit %option noinput nounput interactive 8bit
%x quote %x quote
%{ %{
#include "config.h" #include "config.h"
#include <assert.h> #include <assert.h>
#ifndef HAVE_UNISTD_H #ifndef HAVE_UNISTD_H
#define YY_NO_UNISTD_H #define YY_NO_UNISTD_H
#endif #endif
#include "macro.h" #include "macro.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(winhelp); WINE_DEFAULT_DEBUG_CHANNEL(winhelp);
struct lex_data { struct lex_data {
LPCSTR macroptr; LPCSTR macroptr;
LPSTR strptr; LPSTR strptr;
int quote_stack[32]; int quote_stack[32];
unsigned quote_stk_idx; unsigned quote_stk_idx;
LPSTR cache_string[32]; LPSTR cache_string[32];
int cache_used; int cache_used;
}; };
static struct lex_data* lex_data = NULL; static struct lex_data* lex_data = NULL;
struct lexret yylval; struct lexret yylval;
#define YY_INPUT(buf,result,max_size)\ #define YY_INPUT(buf,result,max_size)\
if ((result = *lex_data->macroptr ? 1 : 0)) buf[0] = *lex_data->macroptr++; if ((result = *lex_data->macroptr ? 1 : 0)) buf[0] = *lex_data->macroptr++;
%} %}
%% %%
[-+]?[0-9]+ yylval.integer = strtol(yytext, NULL, 10); return INTEGER; [-+]?[0-9]+ yylval.integer = strtol(yytext, NULL, 10); return INTEGER;
[-+]?0[xX][0-9a-f]+ yylval.integer = strtol(yytext, NULL, 16); return INTEGER; [-+]?0[xX][0-9a-f]+ yylval.integer = strtol(yytext, NULL, 16); return INTEGER;
[a-zA-Z][_0-9a-zA-Z]* return MACRO_Lookup(yytext, &yylval); [a-zA-Z][_0-9a-zA-Z]* return MACRO_Lookup(yytext, &yylval);
\` | \` |
\" | \" |
\' | \' |
<quote>\` | <quote>\` |
<quote>\" | <quote>\" |
<quote>\' { <quote>\' {
if (lex_data->quote_stk_idx == 0 || if (lex_data->quote_stk_idx == 0 ||
(yytext[0] == '\"' && lex_data->quote_stack[lex_data->quote_stk_idx - 1] != '\"') || (yytext[0] == '\"' && lex_data->quote_stack[lex_data->quote_stk_idx - 1] != '\"') ||
(yytext[0] == '`')) (yytext[0] == '`'))
{ {
/* opening a new one */ /* opening a new one */
if (lex_data->quote_stk_idx == 0) if (lex_data->quote_stk_idx == 0)
{ {
assert(lex_data->cache_used < sizeof(lex_data->cache_string) / sizeof(lex_data->cache_string[0])); assert(lex_data->cache_used < sizeof(lex_data->cache_string) / sizeof(lex_data->cache_string[0]));
lex_data->strptr = lex_data->cache_string[lex_data->cache_used] = HeapAlloc(GetProcessHeap(), 0, strlen(lex_data->macroptr) + 1); lex_data->strptr = lex_data->cache_string[lex_data->cache_used] = HeapAlloc(GetProcessHeap(), 0, strlen(lex_data->macroptr) + 1);
yylval.string = lex_data->strptr; yylval.string = lex_data->strptr;
lex_data->cache_used++; lex_data->cache_used++;
BEGIN(quote); BEGIN(quote);
} }
else *lex_data->strptr++ = yytext[0]; else *lex_data->strptr++ = yytext[0];
lex_data->quote_stack[lex_data->quote_stk_idx++] = yytext[0]; lex_data->quote_stack[lex_data->quote_stk_idx++] = yytext[0];
assert(lex_data->quote_stk_idx < sizeof(lex_data->quote_stack) / sizeof(lex_data->quote_stack[0])); assert(lex_data->quote_stk_idx < sizeof(lex_data->quote_stack) / sizeof(lex_data->quote_stack[0]));
} }
else else
{ {
if (yytext[0] == '`') assert(0); if (yytext[0] == '`') assert(0);
/* close the current quote */ /* close the current quote */
if (--lex_data->quote_stk_idx == 0) if (--lex_data->quote_stk_idx == 0)
{ {
BEGIN INITIAL; BEGIN INITIAL;
*lex_data->strptr++ = '\0'; *lex_data->strptr++ = '\0';
return STRING; return STRING;
} }
else *lex_data->strptr++ = yytext[0]; else *lex_data->strptr++ = yytext[0];
} }
} }
<quote>. *lex_data->strptr++ = yytext[0]; <quote>. *lex_data->strptr++ = yytext[0];
<quote>\\. *lex_data->strptr++ = yytext[1]; <quote>\\. *lex_data->strptr++ = yytext[1];
<quote><<EOF>> return 0; <quote><<EOF>> return 0;
" " " "
. return yytext[0]; . return yytext[0];
%% %%
#if 0 #if 0
/* all code for testing macros */ /* all code for testing macros */
#include "winhelp.h" #include "winhelp.h"
static CHAR szTestMacro[256]; static CHAR szTestMacro[256];
static LRESULT CALLBACK MACRO_TestDialogProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) static LRESULT CALLBACK MACRO_TestDialogProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
if (msg == WM_COMMAND && wParam == IDOK) if (msg == WM_COMMAND && wParam == IDOK)
{ {
GetDlgItemText(hDlg, 99, szTestMacro, sizeof(szTestMacro)); GetDlgItemText(hDlg, 99, szTestMacro, sizeof(szTestMacro));
EndDialog(hDlg, IDOK); EndDialog(hDlg, IDOK);
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
} }
void macro_test(void) void macro_test(void)
{ {
WNDPROC lpfnDlg = MakeProcInstance(MACRO_TestDialogProc, Globals.hInstance); WNDPROC lpfnDlg = MakeProcInstance(MACRO_TestDialogProc, Globals.hInstance);
DialogBox(Globals.hInstance, STRING_DIALOG_TEST, Globals.active_win->hMainWnd, (DLGPROC)lpfnDlg); DialogBox(Globals.hInstance, STRING_DIALOG_TEST, Globals.active_win->hMainWnd, (DLGPROC)lpfnDlg);
FreeProcInstance(lpfnDlg); FreeProcInstance(lpfnDlg);
macro = szTestMacro; macro = szTestMacro;
} }
#endif #endif
/* small helper function for debug messages */ /* small helper function for debug messages */
static const char* ts(int t) static const char* ts(int t)
{ {
static char c[2] = {0,0}; static char c[2] = {0,0};
switch (t) switch (t)
{ {
case EMPTY: return "EMPTY"; case EMPTY: return "EMPTY";
case VOID_FUNCTION: return "VOID_FUNCTION"; case VOID_FUNCTION: return "VOID_FUNCTION";
case BOOL_FUNCTION: return "BOOL_FUNCTION"; case BOOL_FUNCTION: return "BOOL_FUNCTION";
case INTEGER: return "INTEGER"; case INTEGER: return "INTEGER";
case STRING: return "STRING"; case STRING: return "STRING";
case IDENTIFIER: return "IDENTIFIER"; case IDENTIFIER: return "IDENTIFIER";
default: c[0] = (char)t; return c; default: c[0] = (char)t; return c;
} }
} }
static int MACRO_CallBoolFunc(FARPROC fn, const char* args, void** ret); static int MACRO_CallBoolFunc(FARPROC fn, const char* args, void** ret);
/****************************************************************** /******************************************************************
* MACRO_CheckArgs * MACRO_CheckArgs
* *
* checks number of arguments against prototype, and stores arguments on * checks number of arguments against prototype, and stores arguments on
* stack pa for later call * stack pa for later call
* returns -1 on error, otherwise the number of pushed parameters * returns -1 on error, otherwise the number of pushed parameters
*/ */
static int MACRO_CheckArgs(void* pa[], unsigned max, const char* args) static int MACRO_CheckArgs(void* pa[], unsigned max, const char* args)
{ {
int t; int t;
unsigned int len = 0, idx = 0; unsigned int len = 0, idx = 0;
WINE_TRACE("Checking %s\n", args); WINE_TRACE("Checking %s\n", args);
if (yylex() != '(') {WINE_WARN("missing (\n");return -1;} if (yylex() != '(') {WINE_WARN("missing (\n");return -1;}
if (*args) if (*args)
{ {
len = strlen(args); len = strlen(args);
for (;;) for (;;)
{ {
t = yylex(); t = yylex();
WINE_TRACE("Got %s <=> %c\n", ts(t), *args); WINE_TRACE("Got %s <=> %c\n", ts(t), *args);
switch (*args) switch (*args)
{ {
case 'S': case 'S':
if (t != STRING) if (t != STRING)
{WINE_WARN("missing S\n");return -1;} {WINE_WARN("missing S\n");return -1;}
pa[idx] = (void*)yylval.string; pa[idx] = (void*)yylval.string;
break; break;
case 'U': case 'U':
case 'I': case 'I':
if (t != INTEGER) if (t != INTEGER)
{WINE_WARN("missing U\n");return -1;} {WINE_WARN("missing U\n");return -1;}
pa[idx] = LongToPtr(yylval.integer); pa[idx] = LongToPtr(yylval.integer);
break; break;
case 'B': case 'B':
if (t != BOOL_FUNCTION) if (t != BOOL_FUNCTION)
{WINE_WARN("missing B\n");return -1;} {WINE_WARN("missing B\n");return -1;}
if (MACRO_CallBoolFunc(yylval.function, yylval.proto, &pa[idx]) == 0) if (MACRO_CallBoolFunc(yylval.function, yylval.proto, &pa[idx]) == 0)
return -1; return -1;
break; break;
default: default:
WINE_WARN("unexpected %s while args is %c\n", ts(t), *args); WINE_WARN("unexpected %s while args is %c\n", ts(t), *args);
return -1; return -1;
} }
idx++; idx++;
if (*++args == '\0') break; if (*++args == '\0') break;
t = yylex(); t = yylex();
if (t == ')') goto CheckArgs_end; if (t == ')') goto CheckArgs_end;
if (t != ',') {WINE_WARN("missing ,\n");return -1;} if (t != ',') {WINE_WARN("missing ,\n");return -1;}
if (idx >= max) {WINE_FIXME("stack overflow (%d)\n", max);return -1;} if (idx >= max) {WINE_FIXME("stack overflow (%d)\n", max);return -1;}
} }
} }
if (yylex() != ')') {WINE_WARN("missing )\n");return -1;} if (yylex() != ')') {WINE_WARN("missing )\n");return -1;}
CheckArgs_end: CheckArgs_end:
while (len > idx) pa[--len] = NULL; while (len > idx) pa[--len] = NULL;
return idx; return idx;
} }
/****************************************************************** /******************************************************************
* MACRO_CallBoolFunc * MACRO_CallBoolFunc
* *
* Invokes boolean function fn, which arguments are defined by args * Invokes boolean function fn, which arguments are defined by args
* stores bool result into ret * stores bool result into ret
*/ */
static int MACRO_CallBoolFunc(FARPROC fn, const char* args, void** ret) static int MACRO_CallBoolFunc(FARPROC fn, const char* args, void** ret)
{ {
void* pa[2]; void* pa[2];
int idx = MACRO_CheckArgs(pa, sizeof(pa)/sizeof(pa[0]), args); int idx = MACRO_CheckArgs(pa, sizeof(pa)/sizeof(pa[0]), args);
if (idx < 0) return 0; if (idx < 0) return 0;
if (!fn) return 1; if (!fn) return 1;
WINE_TRACE("calling with %u pmts\n", idx); WINE_TRACE("calling with %u pmts\n", idx);
switch (strlen(args)) switch (strlen(args))
{ {
case 0: *ret = (void*)(fn)(); break; case 0: *ret = (void*)(fn)(); break;
case 1: *ret = (void*)(fn)(pa[0]); break; case 1: *ret = (void*)(fn)(pa[0]); break;
default: WINE_FIXME("NIY\n"); default: WINE_FIXME("NIY\n");
} }
return 1; return 1;
} }
/****************************************************************** /******************************************************************
* MACRO_CallVoidFunc * MACRO_CallVoidFunc
* *
* *
*/ */
static int MACRO_CallVoidFunc(FARPROC fn, const char* args) static int MACRO_CallVoidFunc(FARPROC fn, const char* args)
{ {
void* pa[6]; void* pa[6];
int idx = MACRO_CheckArgs(pa, sizeof(pa)/sizeof(pa[0]), args); int idx = MACRO_CheckArgs(pa, sizeof(pa)/sizeof(pa[0]), args);
if (idx < 0) return 0; if (idx < 0) return 0;
if (!fn) return 1; if (!fn) return 1;
WINE_TRACE("calling %p with %u pmts\n", fn, idx); WINE_TRACE("calling %p with %u pmts\n", fn, idx);
switch (strlen(args)) switch (strlen(args))
{ {
case 0: (fn)(); break; case 0: (fn)(); break;
case 1: (fn)(pa[0]); break; case 1: (fn)(pa[0]); break;
case 2: (fn)(pa[0],pa[1]); break; case 2: (fn)(pa[0],pa[1]); break;
case 3: (fn)(pa[0],pa[1],pa[2]); break; case 3: (fn)(pa[0],pa[1],pa[2]); break;
case 4: (fn)(pa[0],pa[1],pa[2],pa[3]); break; case 4: (fn)(pa[0],pa[1],pa[2],pa[3]); break;
case 5: (fn)(pa[0],pa[1],pa[2],pa[3],pa[4]); break; case 5: (fn)(pa[0],pa[1],pa[2],pa[3],pa[4]); break;
case 6: (fn)(pa[0],pa[1],pa[2],pa[3],pa[4],pa[5]); break; case 6: (fn)(pa[0],pa[1],pa[2],pa[3],pa[4],pa[5]); break;
default: WINE_FIXME("NIY\n"); default: WINE_FIXME("NIY\n");
} }
return 1; return 1;
} }
BOOL MACRO_ExecuteMacro(LPCSTR macro) BOOL MACRO_ExecuteMacro(LPCSTR macro)
{ {
struct lex_data curr_lex_data, *prev_lex_data; struct lex_data curr_lex_data, *prev_lex_data;
BOOL ret = TRUE; BOOL ret = TRUE;
int t; int t;
WINE_TRACE("%s\n", wine_dbgstr_a(macro)); WINE_TRACE("%s\n", wine_dbgstr_a(macro));
prev_lex_data = lex_data; prev_lex_data = lex_data;
lex_data = &curr_lex_data; lex_data = &curr_lex_data;
memset(lex_data, 0, sizeof(*lex_data)); memset(lex_data, 0, sizeof(*lex_data));
lex_data->macroptr = macro; lex_data->macroptr = macro;
while ((t = yylex()) != EMPTY) while ((t = yylex()) != EMPTY)
{ {
switch (t) switch (t)
{ {
case VOID_FUNCTION: case VOID_FUNCTION:
WINE_TRACE("got type void func(%s)\n", yylval.proto); WINE_TRACE("got type void func(%s)\n", yylval.proto);
MACRO_CallVoidFunc(yylval.function, yylval.proto); MACRO_CallVoidFunc(yylval.function, yylval.proto);
break; break;
case BOOL_FUNCTION: case BOOL_FUNCTION:
WINE_WARN("got type bool func(%s)\n", yylval.proto); WINE_WARN("got type bool func(%s)\n", yylval.proto);
break; break;
default: default:
WINE_WARN("got unexpected type %s\n", ts(t)); WINE_WARN("got unexpected type %s\n", ts(t));
return 0; return 0;
} }
switch (t = yylex()) switch (t = yylex())
{ {
case EMPTY: goto done; case EMPTY: goto done;
case ';': break; case ';': break;
default: ret = FALSE; goto done; default: ret = FALSE; goto done;
} }
} }
done: done:
for (t = 0; t < lex_data->cache_used; t++) for (t = 0; t < lex_data->cache_used; t++)
HeapFree(GetProcessHeap(), 0, lex_data->cache_string[t]); HeapFree(GetProcessHeap(), 0, lex_data->cache_string[t]);
lex_data = prev_lex_data; lex_data = prev_lex_data;
return ret; return ret;
} }
#ifndef yywrap #ifndef yywrap
int yywrap(void) { return 1; } int yywrap(void) { return 1; }
#endif #endif

View file

@ -1,34 +1,34 @@
/* /*
* Help Viewer * Help Viewer
* *
* Copyright 1996 Ulrich Schmid * Copyright 1996 Ulrich Schmid
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * 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, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/* Class names */ /* Class names */
const char MAIN_WIN_CLASS_NAME[] = "MS_WINHELP"; const char MAIN_WIN_CLASS_NAME[] = "MS_WINHELP";
const char BUTTON_BOX_WIN_CLASS_NAME[] = "WHButtonBox"; const char BUTTON_BOX_WIN_CLASS_NAME[] = "WHButtonBox";
const char SHADOW_WIN_CLASS_NAME[] = "WHShadow"; const char SHADOW_WIN_CLASS_NAME[] = "WHShadow";
const char HISTORY_WIN_CLASS_NAME[] = "WHHistory"; const char HISTORY_WIN_CLASS_NAME[] = "WHHistory";
const char STRING_BUTTON[] = "BUTTON"; const char STRING_BUTTON[] = "BUTTON";
/* Resource names */ /* Resource names */
const char STRING_DIALOG_TEST[] = "DIALOG_TEST"; const char STRING_DIALOG_TEST[] = "DIALOG_TEST";
/* Local Variables: */ /* Local Variables: */
/* c-file-style: "GNU" */ /* c-file-style: "GNU" */
/* End: */ /* End: */

File diff suppressed because it is too large Load diff

View file

@ -1,167 +1,167 @@
/* /*
* Help Viewer * Help Viewer
* *
* Copyright 1996 Ulrich Schmid * Copyright 1996 Ulrich Schmid
* Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr> * Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
* 2002 Eric Pouech * 2002 Eric Pouech
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * 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, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#define MAX_LANGUAGE_NUMBER 255 #define MAX_LANGUAGE_NUMBER 255
#define MAX_STRING_LEN 255 #define MAX_STRING_LEN 255
#define INTERNAL_BORDER_WIDTH 5 #define INTERNAL_BORDER_WIDTH 5
#define POPUP_YDISTANCE 20 #define POPUP_YDISTANCE 20
#define SHADOW_DX 10 #define SHADOW_DX 10
#define SHADOW_DY 10 #define SHADOW_DY 10
#define BUTTON_CX 6 #define BUTTON_CX 6
#define BUTTON_CY 6 #define BUTTON_CY 6
#ifndef RC_INVOKED #ifndef RC_INVOKED
#include <stdarg.h> #include <stdarg.h>
#include "hlpfile.h" #include "hlpfile.h"
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "macro.h" #include "macro.h"
#include "winhelp_res.h" #include "winhelp_res.h"
typedef struct tagHelpButton typedef struct tagHelpButton
{ {
HWND hWnd; HWND hWnd;
LPCSTR lpszID; LPCSTR lpszID;
LPCSTR lpszName; LPCSTR lpszName;
LPCSTR lpszMacro; LPCSTR lpszMacro;
WPARAM wParam; WPARAM wParam;
RECT rect; RECT rect;
struct tagHelpButton*next; struct tagHelpButton*next;
} WINHELP_BUTTON; } WINHELP_BUTTON;
typedef struct typedef struct
{ {
HLPFILE_PAGE* page; HLPFILE_PAGE* page;
HLPFILE_WINDOWINFO* wininfo; HLPFILE_WINDOWINFO* wininfo;
ULONG relative; ULONG relative;
} WINHELP_WNDPAGE; } WINHELP_WNDPAGE;
typedef struct tagPageSet typedef struct tagPageSet
{ {
/* FIXME: for now it's a fixed size */ /* FIXME: for now it's a fixed size */
WINHELP_WNDPAGE set[40]; WINHELP_WNDPAGE set[40];
unsigned index; unsigned index;
} WINHELP_PAGESET; } WINHELP_PAGESET;
typedef struct tagWinHelp typedef struct tagWinHelp
{ {
LPCSTR lpszName; LPCSTR lpszName;
WINHELP_BUTTON* first_button; WINHELP_BUTTON* first_button;
HLPFILE_PAGE* page; HLPFILE_PAGE* page;
HWND hMainWnd; HWND hMainWnd;
HWND hShadowWnd; HWND hShadowWnd;
HWND hHistoryWnd; HWND hHistoryWnd;
HFONT* fonts; HFONT* fonts;
UINT fonts_len; UINT fonts_len;
HCURSOR hHandCur; HCURSOR hHandCur;
HBRUSH hBrush; HBRUSH hBrush;
HLPFILE_WINDOWINFO* info; HLPFILE_WINDOWINFO* info;
HLPFILE_LINK* current_link; HLPFILE_LINK* current_link;
WINHELP_PAGESET back; WINHELP_PAGESET back;
unsigned font_scale; /* 0 = small, 1 = normal, 2 = large */ unsigned font_scale; /* 0 = small, 1 = normal, 2 = large */
struct tagWinHelp* next; struct tagWinHelp* next;
} WINHELP_WINDOW; } WINHELP_WINDOW;
#define DC_NOMSG 0x00000000 #define DC_NOMSG 0x00000000
#define DC_MINMAX 0x00000001 #define DC_MINMAX 0x00000001
#define DC_INITTERM 0x00000002 #define DC_INITTERM 0x00000002
#define DC_JUMP 0x00000004 #define DC_JUMP 0x00000004
#define DC_ACTIVATE 0x00000008 #define DC_ACTIVATE 0x00000008
#define DC_CALLBACKS 0x00000010 #define DC_CALLBACKS 0x00000010
#define DW_NOTUSED 0 #define DW_NOTUSED 0
#define DW_WHATMSG 1 #define DW_WHATMSG 1
#define DW_MINMAX 2 #define DW_MINMAX 2
#define DW_SIZE 3 #define DW_SIZE 3
#define DW_INIT 4 #define DW_INIT 4
#define DW_TERM 5 #define DW_TERM 5
#define DW_STARTJUMP 6 #define DW_STARTJUMP 6
#define DW_ENDJUMP 7 #define DW_ENDJUMP 7
#define DW_CHGFILE 8 #define DW_CHGFILE 8
#define DW_ACTIVATE 9 #define DW_ACTIVATE 9
#define DW_CALLBACKS 10 #define DW_CALLBACKS 10
typedef long (CALLBACK *WINHELP_LDLLHandler)(WORD, LONG, LONG); typedef long (CALLBACK *WINHELP_LDLLHandler)(WORD, LONG, LONG);
typedef struct tagDll typedef struct tagDll
{ {
HANDLE hLib; HANDLE hLib;
const char* name; const char* name;
WINHELP_LDLLHandler handler; WINHELP_LDLLHandler handler;
DWORD class; DWORD class;
struct tagDll* next; struct tagDll* next;
} WINHELP_DLL; } WINHELP_DLL;
typedef struct typedef struct
{ {
UINT wVersion; UINT wVersion;
HANDLE hInstance; HANDLE hInstance;
BOOL isBook; BOOL isBook;
WINHELP_WINDOW* active_win; WINHELP_WINDOW* active_win;
WINHELP_WINDOW* active_popup; WINHELP_WINDOW* active_popup;
WINHELP_WINDOW* win_list; WINHELP_WINDOW* win_list;
WNDPROC button_proc; WNDPROC button_proc;
WINHELP_DLL* dlls; WINHELP_DLL* dlls;
WINHELP_PAGESET history; WINHELP_PAGESET history;
HFONT hButtonFont; HFONT hButtonFont;
} WINHELP_GLOBALS; } WINHELP_GLOBALS;
extern WINHELP_GLOBALS Globals; extern WINHELP_GLOBALS Globals;
extern FARPROC Callbacks[]; extern FARPROC Callbacks[];
BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE*, int, BOOL); BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE*, int, BOOL);
BOOL WINHELP_OpenHelpWindow(HLPFILE_PAGE* (*)(HLPFILE*, LONG, ULONG*), BOOL WINHELP_OpenHelpWindow(HLPFILE_PAGE* (*)(HLPFILE*, LONG, ULONG*),
HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int); HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int);
BOOL WINHELP_GetOpenFileName(LPSTR, int); BOOL WINHELP_GetOpenFileName(LPSTR, int);
BOOL WINHELP_CreateIndexWindow(BOOL); BOOL WINHELP_CreateIndexWindow(BOOL);
void WINHELP_DeleteBackSet(WINHELP_WINDOW*); void WINHELP_DeleteBackSet(WINHELP_WINDOW*);
HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile); HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile);
HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name); HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name);
void WINHELP_LayoutMainWindow(WINHELP_WINDOW* win); void WINHELP_LayoutMainWindow(WINHELP_WINDOW* win);
extern const char MAIN_WIN_CLASS_NAME[]; extern const char MAIN_WIN_CLASS_NAME[];
extern const char BUTTON_BOX_WIN_CLASS_NAME[]; extern const char BUTTON_BOX_WIN_CLASS_NAME[];
extern const char TEXT_WIN_CLASS_NAME[]; extern const char TEXT_WIN_CLASS_NAME[];
extern const char SHADOW_WIN_CLASS_NAME[]; extern const char SHADOW_WIN_CLASS_NAME[];
extern const char HISTORY_WIN_CLASS_NAME[]; extern const char HISTORY_WIN_CLASS_NAME[];
extern const char STRING_BUTTON[]; extern const char STRING_BUTTON[];
extern const char STRING_MENU_Xx[]; extern const char STRING_MENU_Xx[];
extern const char STRING_DIALOG_TEST[]; extern const char STRING_DIALOG_TEST[];
#endif #endif
/* Buttons */ /* Buttons */
#define WH_FIRST_BUTTON 500 #define WH_FIRST_BUTTON 500

View file

@ -1,59 +1,59 @@
#define MNID_FILE_OPEN 0x101 #define MNID_FILE_OPEN 0x101
#define MNID_FILE_PRINT 0x104 #define MNID_FILE_PRINT 0x104
#define MNID_FILE_SETUP 0x106 #define MNID_FILE_SETUP 0x106
#define MNID_FILE_EXIT 0x108 #define MNID_FILE_EXIT 0x108
#define MNID_EDIT_COPYDLG 0x111 #define MNID_EDIT_COPYDLG 0x111
#define MNID_EDIT_ANNOTATE 0x112 #define MNID_EDIT_ANNOTATE 0x112
#define MNID_BKMK_DEFINE 0x121 #define MNID_BKMK_DEFINE 0x121
#define MNID_OPTS_HELP_DEFAULT 0x131 #define MNID_OPTS_HELP_DEFAULT 0x131
#define MNID_OPTS_HELP_VISIBLE 0x132 #define MNID_OPTS_HELP_VISIBLE 0x132
#define MNID_OPTS_HELP_NONVISIBLE 0x133 #define MNID_OPTS_HELP_NONVISIBLE 0x133
#define MNID_OPTS_HISTORY 0x134 #define MNID_OPTS_HISTORY 0x134
#define MNID_OPTS_FONTS_SMALL 0x135 #define MNID_OPTS_FONTS_SMALL 0x135
#define MNID_OPTS_FONTS_NORMAL 0x136 #define MNID_OPTS_FONTS_NORMAL 0x136
#define MNID_OPTS_FONTS_LARGE 0x137 #define MNID_OPTS_FONTS_LARGE 0x137
#define MNID_OPTS_SYSTEM_COLORS 0x138 #define MNID_OPTS_SYSTEM_COLORS 0x138
#define MNID_HELP_HELPON 0x141 #define MNID_HELP_HELPON 0x141
#define MNID_HELP_HELPTOP 0x142 #define MNID_HELP_HELPTOP 0x142
#define MNID_HELP_ABOUT 0x143 #define MNID_HELP_ABOUT 0x143
#define MNID_HELP_WINE 0x144 #define MNID_HELP_WINE 0x144
#define MNID_CTXT_ANNOTATE 0x200 #define MNID_CTXT_ANNOTATE 0x200
#define MNID_CTXT_COPY 0x201 #define MNID_CTXT_COPY 0x201
#define MNID_CTXT_PRINT 0x202 #define MNID_CTXT_PRINT 0x202
#define MNID_CTXT_FONTS_SMALL 0x210 #define MNID_CTXT_FONTS_SMALL 0x210
#define MNID_CTXT_FONTS_NORMAL 0x211 #define MNID_CTXT_FONTS_NORMAL 0x211
#define MNID_CTXT_FONTS_LARGE 0x212 #define MNID_CTXT_FONTS_LARGE 0x212
#define MNID_CTXT_HELP_DEFAULT 0x220 #define MNID_CTXT_HELP_DEFAULT 0x220
#define MNID_CTXT_HELP_VISIBLE 0x221 #define MNID_CTXT_HELP_VISIBLE 0x221
#define MNID_CTXT_HELP_NONVISIBLE 0x222 #define MNID_CTXT_HELP_NONVISIBLE 0x222
#define MNID_CTXT_SYSTEM_COLORS 0x230 #define MNID_CTXT_SYSTEM_COLORS 0x230
#define MAIN_MENU 0xF000 #define MAIN_MENU 0xF000
#define CONTEXT_MENU 0xF001 #define CONTEXT_MENU 0xF001
#define STID_WINE_HELP 0x120 #define STID_WINE_HELP 0x120
#define STID_WHERROR 0x121 #define STID_WHERROR 0x121
#define STID_WARNING 0x122 #define STID_WARNING 0x122
#define STID_INFO 0x123 #define STID_INFO 0x123
#define STID_NOT_IMPLEMENTED 0x124 #define STID_NOT_IMPLEMENTED 0x124
#define STID_HLPFILE_ERROR_s 0x125 #define STID_HLPFILE_ERROR_s 0x125
#define STID_CONTENTS 0x126 #define STID_CONTENTS 0x126
#define STID_INDEX 0x127 #define STID_INDEX 0x127
#define STID_BACK 0x128 #define STID_BACK 0x128
#define STID_ALL_FILES 0x12B #define STID_ALL_FILES 0x12B
#define STID_HELP_FILES_HLP 0x12C #define STID_HELP_FILES_HLP 0x12C
#define STID_DIALOG_TEST 0x12D #define STID_DIALOG_TEST 0x12D
#define STID_FILE_NOT_FOUND_s 0x12E #define STID_FILE_NOT_FOUND_s 0x12E
#define STID_NO_RICHEDIT 0x12F #define STID_NO_RICHEDIT 0x12F
#define STID_PSH_INDEX 0x130 #define STID_PSH_INDEX 0x130
#define IDD_INDEX 0x150 #define IDD_INDEX 0x150
#define IDC_INDEXLIST 0x151 #define IDC_INDEXLIST 0x151
#define IDD_SEARCH 0x152 #define IDD_SEARCH 0x152
#define IDI_WINHELP 0xF00 #define IDI_WINHELP 0xF00