Bring winhelp back to life, with mainly support for Win95 help files.

This commit is contained in:
Eric Pouech 2002-07-16 01:46:29 +00:00 committed by Alexandre Julliard
parent 21ec1d2a4c
commit 757928781e
8 changed files with 2993 additions and 2051 deletions

View file

@ -22,157 +22,158 @@
#include <time.h> #include <time.h>
#include <ctype.h> #include <ctype.h>
#include <fcntl.h> #include <fcntl.h>
#include <assert.h>
#include "windows.h" #include "windows.h"
#include "hlpfile.h" #include "hlpfile.h"
typedef struct typedef struct
{ {
const char *header1; const char *header1;
const char *header2; const char *header2;
const char *section; const char *section;
const char *first_paragraph; const char *first_paragraph;
const char *newline; const char *newline;
const char *next_paragraph; const char *next_paragraph;
const char *special_char; const char *special_char;
const char *begin_italic; const char *begin_italic;
const char *end_italic; const char *end_italic;
const char *begin_boldface; const char *begin_boldface;
const char *end_boldface; const char *end_boldface;
const char *begin_typewriter; const char *begin_typewriter;
const char *end_typewriter; const char *end_typewriter;
const char *tail; const char *tail;
} FORMAT; } FORMAT;
typedef struct typedef struct
{ {
const char ch; const char ch;
const char *subst; const char *subst;
} CHARMAP[]; } CHARMAP[];
FORMAT format = FORMAT format =
{ {
"<!doctype linuxdoc system>\n" "<!doctype linuxdoc system>\n"
"<article>\n" "<article>\n"
"<title>\n", "<title>\n",
"\n<author>\n%s\n" "\n<author>\n%s\n"
"<date>\n%s\n", "<date>\n%s\n",
"\n<sect>\n", "\n<sect>\n",
"\n<p>\n", "\n<p>\n",
"\n<newline>\n", "\n<newline>\n",
"\n\n", "\n\n",
"&%s;", "&%s;",
"<em>", "<em>",
"</em>", "</em>",
"<bf>", "<bf>",
"</bf>", "</bf>",
"<tt>", "<tt>",
"</tt>", "</tt>",
"\n</article>\n" "\n</article>\n"
}; };
CHARMAP charmap = CHARMAP charmap =
{{'Æ', "AElig"}, {{'Æ', "AElig"},
{'Á', "Aacute"}, {'Á', "Aacute"},
{'Â', "Acirc"}, {'Â', "Acirc"},
{'À', "Agrave"}, {'À', "Agrave"},
{'Ã', "Atilde"}, {'Ã', "Atilde"},
{'Ç', "Ccedil"}, {'Ç', "Ccedil"},
{'É', "Eacute"}, {'É', "Eacute"},
{'È', "Egrave"}, {'È', "Egrave"},
{'Ë', "Euml"}, {'Ë', "Euml"},
{'Í', "Iacute"}, {'Í', "Iacute"},
{'Î', "Icirc"}, {'Î', "Icirc"},
{'Ì', "Igrave"}, {'Ì', "Igrave"},
{'Ï', "Iuml"}, {'Ï', "Iuml"},
{'Ñ', "Ntilde"}, {'Ñ', "Ntilde"},
{'Ó', "Oacute"}, {'Ó', "Oacute"},
{'Ô', "Ocirc"}, {'Ô', "Ocirc"},
{'Ò', "Ograve"}, {'Ò', "Ograve"},
{'Ø', "Oslash"}, {'Ø', "Oslash"},
{'Ú', "Uacute"}, {'Ú', "Uacute"},
{'Ù', "Ugrave"}, {'Ù', "Ugrave"},
{'Ý', "Yacute"}, {'Ý', "Yacute"},
{'á', "aacute"}, {'á', "aacute"},
{'â', "acirc"}, {'â', "acirc"},
{'æ', "aelig"}, {'æ', "aelig"},
{'à', "agrave"}, {'à', "agrave"},
{'å', "aring"}, {'å', "aring"},
{'ã', "atilde"}, {'ã', "atilde"},
{'ç', "ccedil"}, {'ç', "ccedil"},
{'é', "eacute"}, {'é', "eacute"},
{'ê', "ecirc"}, {'ê', "ecirc"},
{'è', "egrave"}, {'è', "egrave"},
{'ë', "euml"}, {'ë', "euml"},
{'í', "iacute"}, {'í', "iacute"},
{'î', "icirc"}, {'î', "icirc"},
{'ì', "igrave"}, {'ì', "igrave"},
{'ï', "iuml"}, {'ï', "iuml"},
{'ñ', "ntilde"}, {'ñ', "ntilde"},
{'ó', "oacute"}, {'ó', "oacute"},
{'ÿ', "yuml"}, {'ÿ', "yuml"},
{'ô', "ocirc"}, {'ô', "ocirc"},
{'ò', "ograve"}, {'ò', "ograve"},
{'ø', "oslash"}, {'ø', "oslash"},
{'õ', "otilde"}, {'õ', "otilde"},
{'ú', "uacute"}, {'ú', "uacute"},
{'û', "ucirc"}, {'û', "ucirc"},
{'ù', "ugrave"}, {'ù', "ugrave"},
{'ý', "yacute"}, {'ý', "yacute"},
{'<', "lt"}, {'<', "lt"},
{'&', "amp"}, {'&', "amp"},
{'"', "dquot"}, {'"', "dquot"},
{'#', "num"}, {'#', "num"},
{'%', "percnt"}, {'%', "percnt"},
{'\'', "quot"}, {'\'', "quot"},
#if 0 #if 0
{'(', "lpar"}, {'(', "lpar"},
{')', "rpar"}, {')', "rpar"},
{'*', "ast"}, {'*', "ast"},
{'+', "plus"}, {'+', "plus"},
{',', "comma"}, {',', "comma"},
{'-', "hyphen"}, {'-', "hyphen"},
{':', "colon"}, {':', "colon"},
{';', "semi"}, {';', "semi"},
{'=', "equals"}, {'=', "equals"},
{'@', "commat"}, {'@', "commat"},
{'[', "lsqb"}, {'[', "lsqb"},
{']', "rsqb"}, {']', "rsqb"},
{'^', "circ"}, {'^', "circ"},
{'_', "lowbar"}, {'_', "lowbar"},
{'{', "lcub"}, {'{', "lcub"},
{'|', "verbar"}, {'|', "verbar"},
{'}', "rcub"}, {'}', "rcub"},
{'~', "tilde"}, {'~', "tilde"},
#endif #endif
{'\\', "bsol"}, {'\\', "bsol"},
{'$', "dollar"}, {'$', "dollar"},
{'Ä', "Auml"}, {'Ä', "Auml"},
{'ä', "auml"}, {'ä', "auml"},
{'Ö', "Ouml"}, {'Ö', "Ouml"},
{'ö', "ouml"}, {'ö', "ouml"},
{'Ü', "Uuml"}, {'Ü', "Uuml"},
{'ü', "uuml"}, {'ü', "uuml"},
{'ß', "szlig"}, {'ß', "szlig"},
{'>', "gt"}, {'>', "gt"},
{'§', "sect"}, {'§', "sect"},
{'', "para"}, {'', "para"},
{'©', "copy"}, {'©', "copy"},
{'¡', "iexcl"}, {'¡', "iexcl"},
{'¿', "iquest"}, {'¿', "iquest"},
{'¢', "cent"}, {'¢', "cent"},
{'£', "pound"}, {'£', "pound"},
{'×', "times"}, {'×', "times"},
{'±', "plusmn"}, {'±', "plusmn"},
{'÷', "divide"}, {'÷', "divide"},
{'¬', "not"}, {'¬', "not"},
{'µ', "mu"}, {'µ', "mu"},
{0,0}}; {0,0}};
/*********************************************************************** /***********************************************************************
* *
@ -181,18 +182,18 @@ CHARMAP charmap =
static void print_text(const char *p) static void print_text(const char *p)
{ {
int i; int i;
for (; *p; p++) for (; *p; p++)
{ {
for (i = 0; charmap[i].ch; i++) for (i = 0; charmap[i].ch; i++)
if (*p == charmap[i].ch) if (*p == charmap[i].ch)
{ {
printf(format.special_char, charmap[i].subst); printf(format.special_char, charmap[i].subst);
break; break;
} }
if (!charmap[i].ch) if (!charmap[i].ch)
printf("%c", *p); printf("%c", *p);
} }
} }
@ -203,60 +204,68 @@ static void print_text(const char *p)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
HLPFILE *hlpfile; HLPFILE *hlpfile;
HLPFILE_PAGE *page; HLPFILE_PAGE *page;
HLPFILE_PARAGRAPH *paragraph; HLPFILE_PARAGRAPH *paragraph;
time_t t; time_t t;
char date[50]; char date[50];
char *filename; char *filename;
hlpfile = HLPFILE_ReadHlpFile(argc > 1 ? argv[1] : ""); hlpfile = HLPFILE_ReadHlpFile(argc > 1 ? argv[1] : "");
if (!hlpfile) return(2); if (!hlpfile) return 2;
time(&t); time(&t);
strftime(date, sizeof(date), "%x", localtime(&t)); strftime(date, sizeof(date), "%x", localtime(&t));
filename = strrchr(hlpfile->lpszPath, '/'); filename = strrchr(hlpfile->lpszPath, '/');
if (filename) filename++; if (filename) filename++;
else filename = hlpfile->lpszPath; else filename = hlpfile->lpszPath;
/* Header */ /* Header */
printf(format.header1); printf(format.header1);
print_text(hlpfile->lpszTitle); print_text(hlpfile->lpszTitle);
printf(format.header2, filename, date); printf(format.header2, filename, date);
for (page = hlpfile->first_page; page; page = page->next) for (page = hlpfile->first_page; page; page = page->next)
{ {
paragraph = page->first_paragraph; paragraph = page->first_paragraph;
if (!paragraph) continue; if (!paragraph) continue;
/* Section */ /* Section */
printf(format.section); printf(format.section);
for (; paragraph && !paragraph->wVSpace; paragraph = paragraph->next) for (; paragraph && !paragraph->u.text.wVSpace; paragraph = paragraph->next)
print_text(paragraph->lpszText); print_text(paragraph->u.text.lpszText);
printf(format.first_paragraph); printf(format.first_paragraph);
for (; paragraph; paragraph = paragraph->next) for (; paragraph; paragraph = paragraph->next)
{ {
/* New line; new paragraph */ switch (paragraph->cookie)
if (paragraph->wVSpace == 1) {
printf(format.newline); case para_normal_text:
else if (paragraph->wVSpace > 1) case para_debug_text:
printf(format.next_paragraph); /* New line; new paragraph */
if (paragraph->u.text.wVSpace == 1)
printf(format.newline);
else if (paragraph->u.text.wVSpace > 1)
printf(format.next_paragraph);
if (paragraph->wFont) if (paragraph->u.text.wFont)
printf(format.begin_boldface); printf(format.begin_boldface);
print_text(paragraph->lpszText); print_text(paragraph->u.text.lpszText);
if (paragraph->wFont) if (paragraph->u.text.wFont)
printf(format.end_boldface); printf(format.end_boldface);
break;
case para_image:
break;
}
} }
} }
printf(format.tail); printf(format.tail);
return(0); return 0;
} }
/*********************************************************************** /***********************************************************************
@ -268,64 +277,92 @@ static FILE *file = 0;
HFILE WINAPI OpenFile( LPCSTR path, OFSTRUCT *ofs, UINT mode ) HFILE WINAPI OpenFile( LPCSTR path, OFSTRUCT *ofs, UINT mode )
{ {
file = *path ? fopen(path, "r") : stdin; file = *path ? fopen(path, "r") : stdin;
return file ? (HFILE)1 : HFILE_ERROR; return file ? (HFILE)1 : HFILE_ERROR;
} }
HFILE WINAPI _lclose( HFILE hFile ) HFILE WINAPI _lclose( HFILE hFile )
{ {
fclose(file); fclose(file);
return 0; return 0;
} }
LONG WINAPI _hread( HFILE hFile, LPVOID buffer, LONG count ) LONG WINAPI _hread( HFILE hFile, LPVOID buffer, LONG count )
{ {
return fread(buffer, 1, count, file); return fread(buffer, 1, count, file);
} }
HGLOBAL WINAPI GlobalAlloc( UINT flags, DWORD size ) void* WINAPI HeapAlloc( HANDLE heap, DWORD flags, DWORD size )
{ {
return (HGLOBAL) malloc(size); assert(flags == 0);
return malloc(size);
} }
LPVOID WINAPI GlobalLock( HGLOBAL handle ) void* WINAPI HeapReAlloc( HANDLE heap, DWORD flags, void* ptr, DWORD size)
{ {
return (LPVOID) handle; assert(flags == 0);
return realloc(ptr, size);
} }
HGLOBAL WINAPI GlobalFree( HGLOBAL handle ) BOOL WINAPI HeapFree( HGLOBAL handle, DWORD flags, void* ptr )
{ {
free((VOID*) handle); free(ptr);
return(0); return TRUE;
} }
char __wine_dbch_winhelp[] = "\003winhelp";
static char * const debug_channels[1] =
{
__wine_dbch_winhelp
};
int wine_dbg_log( int cls, const char *channel, const char *func, const char *format, ... )
{
return 1;
}
HBITMAP WINAPI CreateDIBitmap(HDC hdc, CONST BITMAPINFOHEADER* bih, DWORD a, CONST void* ptr, CONST BITMAPINFO* bi, UINT c)
{
return 0;
}
HDC WINAPI GetDC(HWND h)
{
return 0;
}
BOOL WINAPI DeleteObject(HGDIOBJ h)
{
return TRUE;
}
/* /*
* String functions * String functions
* *
* Copyright 1993 Yngvi Sigurjonsson (yngvi@hafro.is) * Copyright 1993 Yngvi Sigurjonsson (yngvi@hafro.is)
*/ */
INT WINAPI lstrcmp(LPCSTR str1,LPCSTR str2) INT WINAPI lstrcmp( LPCSTR str1, LPCSTR str2 )
{ {
return strcmp( str1, str2 ); return strcmp( str1, str2 );
} }
INT WINAPI lstrcmpi( LPCSTR str1, LPCSTR str2 ) INT WINAPI lstrcmpi( LPCSTR str1, LPCSTR str2 )
{ {
INT res; INT res;
while (*str1) while (*str1)
{ {
if ((res = toupper(*str1) - toupper(*str2)) != 0) return res; if ((res = toupper(*str1) - toupper(*str2)) != 0) return res;
str1++; str1++;
str2++; str2++;
} }
return toupper(*str1) - toupper(*str2); return toupper(*str1) - toupper(*str2);
} }
INT WINAPI lstrlen(LPCSTR str) INT WINAPI lstrlen( LPCSTR str )
{ {
return strlen(str); return strlen(str);
} }
LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src ) LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src )
@ -334,12 +371,3 @@ LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src )
strcpy( dst, src ); strcpy( dst, src );
return dst; return dst;
} }
void WINAPI hmemcpy16(LPVOID hpvDest, LPCVOID hpvSource, LONG cbCopy)
{
memcpy(hpvDest, hpvSource, cbCopy);
}
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,8 @@
/* /*
* Help Viewer * Help Viewer
* *
* Copyright 1996 Ulrich Schmid * Copyright 1996 Ulrich Schmid
* 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
@ -22,74 +23,89 @@ struct tagHelpFile;
typedef struct typedef struct
{ {
LPCSTR lpszPath; LPCSTR lpszPath;
LONG lHash; LONG lHash;
BOOL bPopup; BOOL bPopup;
HGLOBAL hSelf;
} HLPFILE_LINK; } HLPFILE_LINK;
enum para_type {para_normal_text, para_debug_text, para_image};
typedef struct tagHlpFileParagraph typedef struct tagHlpFileParagraph
{ {
LPSTR lpszText; enum para_type cookie;
UINT bDebug; union
UINT wFont; {
UINT wIndent; struct
UINT wHSpace; {
UINT wVSpace; LPSTR lpszText;
unsigned wFont;
unsigned wIndent;
unsigned wHSpace;
unsigned wVSpace;
} text;
struct
{
HBITMAP hBitmap;
unsigned pos; /* 0: center, 1: left, 2: right */
} image;
} u;
HLPFILE_LINK *link; HLPFILE_LINK* link;
struct tagHlpFileParagraph *next; struct tagHlpFileParagraph* next;
HGLOBAL hSelf;
} HLPFILE_PARAGRAPH; } HLPFILE_PARAGRAPH;
typedef struct tagHlpFilePage typedef struct tagHlpFilePage
{ {
LPSTR lpszTitle; LPSTR lpszTitle;
HLPFILE_PARAGRAPH *first_paragraph; HLPFILE_PARAGRAPH* first_paragraph;
UINT wNumber; unsigned wNumber;
unsigned offset;
struct tagHlpFilePage *next; struct tagHlpFilePage* next;
struct tagHlpFileFile *file; struct tagHlpFilePage* prev;
struct tagHlpFileFile* file;
HGLOBAL hSelf;
} HLPFILE_PAGE; } HLPFILE_PAGE;
typedef struct typedef struct
{ {
LONG lHash; LONG lHash;
UINT wPage; unsigned long offset;
} HLPFILE_CONTEXT; } HLPFILE_CONTEXT;
typedef struct tagHlpFileMacro typedef struct tagHlpFileMacro
{ {
LPCSTR lpszMacro; LPCSTR lpszMacro;
struct tagHlpFileMacro* next;
HGLOBAL hSelf;
struct tagHlpFileMacro *next;
} HLPFILE_MACRO; } HLPFILE_MACRO;
typedef struct
{
LOGFONT LogFont;
HFONT hFont;
COLORREF color;
} HLPFILE_FONT;
typedef struct tagHlpFileFile typedef struct tagHlpFileFile
{ {
LPSTR lpszPath; LPSTR lpszPath;
LPSTR lpszTitle; LPSTR lpszTitle;
HLPFILE_PAGE *first_page; HLPFILE_PAGE* first_page;
HLPFILE_MACRO *first_macro; HLPFILE_MACRO* first_macro;
UINT wContextLen; unsigned wContextLen;
HLPFILE_CONTEXT *Context; HLPFILE_CONTEXT* Context;
struct tagHlpFileFile* prev;
struct tagHlpFileFile* next;
struct tagHlpFileFile *prev; unsigned wRefCount;
struct tagHlpFileFile *next;
UINT wRefCount; unsigned short version;
unsigned short flags;
unsigned hasPhrases; /* Phrases or PhrIndex/PhrImage */
HGLOBAL hTitle; unsigned numFonts;
HGLOBAL hContext; HLPFILE_FONT* fonts;
HGLOBAL hSelf;
} HLPFILE; } HLPFILE;
HLPFILE *HLPFILE_ReadHlpFile(LPCSTR lpszPath); HLPFILE *HLPFILE_ReadHlpFile(LPCSTR lpszPath);
@ -98,7 +114,3 @@ HLPFILE_PAGE *HLPFILE_PageByHash(LPCSTR lpszPath, LONG wNum);
LONG HLPFILE_Hash(LPCSTR lpszContext); LONG HLPFILE_Hash(LPCSTR lpszContext);
VOID HLPFILE_FreeHlpFilePage(HLPFILE_PAGE*); VOID HLPFILE_FreeHlpFilePage(HLPFILE_PAGE*);
VOID HLPFILE_FreeHlpFile(HLPFILE*); VOID HLPFILE_FreeHlpFile(HLPFILE*);
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */

View file

@ -18,460 +18,462 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <stdio.h>
#include "windows.h" #include "windows.h"
#include "commdlg.h" #include "commdlg.h"
#include "winhelp.h" #include "winhelp.h"
#include "macro.h" #include "macro.h"
VOID MACRO_About(VOID) #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(winhelp);
void MACRO_About(void)
{ {
fprintf(stderr, "About()\n"); WINE_FIXME("About()\n");
} }
VOID MACRO_AddAccelerator(LONG u1, LONG u2, LPCSTR str) void MACRO_AddAccelerator(LONG u1, LONG u2, LPCSTR str)
{ {
fprintf(stderr, "AddAccelerator(%lu, %lu, \"%s\")\n", u1, u2, str); WINE_FIXME("AddAccelerator(%lu, %lu, \"%s\")\n", u1, u2, str);
} }
VOID MACRO_ALink(LPCSTR str1, LONG u, LPCSTR str2) void MACRO_ALink(LPCSTR str1, LONG u, LPCSTR str2)
{ {
fprintf(stderr, "ALink(\"%s\", %lu, \"%s\")\n", str1, u, str2); WINE_FIXME("ALink(\"%s\", %lu, \"%s\")\n", str1, u, str2);
} }
VOID MACRO_Annotate(VOID) void MACRO_Annotate(void)
{ {
fprintf(stderr, "Annotate()\n"); WINE_FIXME("Annotate()\n");
} }
VOID MACRO_AppendItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4) void MACRO_AppendItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4)
{ {
fprintf(stderr, "AppendItem(\"%s\", \"%s\", \"%s\", \"%s\")\n", str1, str2, str3, str4); WINE_FIXME("AppendItem(\"%s\", \"%s\", \"%s\", \"%s\")\n", str1, str2, str3, str4);
} }
VOID MACRO_Back(VOID) void MACRO_Back(void)
{ {
fprintf(stderr, "Back()\n"); WINE_FIXME("Back()\n");
} }
VOID MACRO_BackFlush(VOID) void MACRO_BackFlush(void)
{ {
fprintf(stderr, "BackFlush()\n"); WINE_FIXME("BackFlush()\n");
} }
VOID MACRO_BookmarkDefine(VOID) void MACRO_BookmarkDefine(void)
{ {
fprintf(stderr, "BookmarkDefine()\n"); WINE_FIXME("BookmarkDefine()\n");
} }
VOID MACRO_BookmarkMore(VOID) void MACRO_BookmarkMore(void)
{ {
fprintf(stderr, "BookmarkMore()\n"); WINE_FIXME("BookmarkMore()\n");
} }
VOID MACRO_BrowseButtons(VOID) void MACRO_BrowseButtons(void)
{ {
MACRO_CreateButton("BTN_PREV", "&<<", "Prev()"); MACRO_CreateButton("BTN_PREV", "&<<", "Prev()");
MACRO_CreateButton("BTN_NEXT", "&>>", "Next()"); MACRO_CreateButton("BTN_NEXT", "&>>", "Next()");
} }
VOID MACRO_ChangeButtonBinding(LPCSTR str1, LPCSTR str2) void MACRO_ChangeButtonBinding(LPCSTR str1, LPCSTR str2)
{ {
fprintf(stderr, "ChangeButtonBinding(\"%s\", \"%s\")\n", str1, str2); WINE_FIXME("ChangeButtonBinding(\"%s\", \"%s\")\n", str1, str2);
} }
VOID MACRO_ChangeEnable(LPCSTR str1, LPCSTR str2) void MACRO_ChangeEnable(LPCSTR str1, LPCSTR str2)
{ {
fprintf(stderr, "ChangeEnable(\"%s\", \"%s\")\n", str1, str2); WINE_FIXME("ChangeEnable(\"%s\", \"%s\")\n", str1, str2);
} }
VOID MACRO_ChangeItemBinding(LPCSTR str1, LPCSTR str2) void MACRO_ChangeItemBinding(LPCSTR str1, LPCSTR str2)
{ {
fprintf(stderr, "ChangeItemBinding(\"%s\", \"%s\")\n", str1, str2); WINE_FIXME("ChangeItemBinding(\"%s\", \"%s\")\n", str1, str2);
} }
VOID MACRO_CheckItem(LPCSTR str) void MACRO_CheckItem(LPCSTR str)
{ {
fprintf(stderr, "CheckItem(\"%s\")\n", str); WINE_FIXME("CheckItem(\"%s\")\n", str);
} }
VOID MACRO_CloseSecondarys(VOID) void MACRO_CloseSecondarys(void)
{ {
WINHELP_WINDOW *win; WINHELP_WINDOW *win;
for (win = Globals.win_list; win; win = win->next) for (win = Globals.win_list; win; win = win->next)
if (win->lpszName && lstrcmpi(win->lpszName, "main")) if (win->lpszName && lstrcmpi(win->lpszName, "main"))
DestroyWindow(win->hMainWnd); DestroyWindow(win->hMainWnd);
} }
VOID MACRO_CloseWindow(LPCSTR lpszWindow) void MACRO_CloseWindow(LPCSTR lpszWindow)
{ {
WINHELP_WINDOW *win; WINHELP_WINDOW *win;
if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main"; if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main";
for (win = Globals.win_list; win; win = win->next) for (win = Globals.win_list; win; win = win->next)
if (win->lpszName && !lstrcmpi(win->lpszName, lpszWindow)) if (win->lpszName && !lstrcmpi(win->lpszName, lpszWindow))
DestroyWindow(win->hMainWnd); DestroyWindow(win->hMainWnd);
} }
VOID MACRO_Compare(LPCSTR str) void MACRO_Compare(LPCSTR str)
{ {
fprintf(stderr, "Compare(\"%s\")\n", str); WINE_FIXME("Compare(\"%s\")\n", str);
} }
VOID MACRO_Contents(VOID) void MACRO_Contents(void)
{ {
if (Globals.active_win->page) if (Globals.active_win->page)
MACRO_JumpContents(Globals.active_win->page->file->lpszPath, NULL); MACRO_JumpContents(Globals.active_win->page->file->lpszPath, NULL);
} }
VOID MACRO_ControlPanel(LPCSTR str1, LPCSTR str2, LONG u) void MACRO_ControlPanel(LPCSTR str1, LPCSTR str2, LONG u)
{ {
fprintf(stderr, "ControlPanel(\"%s\", \"%s\", %lu)\n", str1, str2, u); WINE_FIXME("ControlPanel(\"%s\", \"%s\", %lu)\n", str1, str2, u);
} }
VOID MACRO_CopyDialog(VOID) void MACRO_CopyDialog(void)
{ {
fprintf(stderr, "CopyDialog()\n"); WINE_FIXME("CopyDialog()\n");
} }
VOID MACRO_CopyTopic(VOID) void MACRO_CopyTopic(void)
{ {
fprintf(stderr, "CopyTopic()\n"); WINE_FIXME("CopyTopic()\n");
} }
VOID MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro) void MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro)
{ {
WINHELP_WINDOW *win = Globals.active_win; WINHELP_WINDOW *win = Globals.active_win;
WINHELP_BUTTON *button, **b; WINHELP_BUTTON *button, **b;
LONG size; LONG size;
HGLOBAL handle; LPSTR ptr;
LPSTR ptr;
size = sizeof(WINHELP_BUTTON) + lstrlen(id) + lstrlen(name) + lstrlen(macro) + 3; size = sizeof(WINHELP_BUTTON) + lstrlen(id) + lstrlen(name) + lstrlen(macro) + 3;
handle = GlobalAlloc(GMEM_FIXED, size);
if (!handle) return;
button = GlobalLock(handle); button = HeapAlloc(GetProcessHeap(), 0, size);
button->hSelf = handle; if (!button) return;
button->next = 0;
button->hWnd = 0;
ptr = GlobalLock(handle); button->next = 0;
ptr += sizeof(WINHELP_BUTTON); button->hWnd = 0;
lstrcpy(ptr, (LPSTR) id); ptr = (char*)button + sizeof(WINHELP_BUTTON);
button->lpszID = ptr;
ptr += lstrlen(id) + 1;
lstrcpy(ptr, (LPSTR) name); lstrcpy(ptr, (LPSTR) id);
button->lpszName = ptr; button->lpszID = ptr;
ptr += lstrlen(name) + 1; ptr += lstrlen(id) + 1;
lstrcpy(ptr, (LPSTR) macro); lstrcpy(ptr, (LPSTR) name);
button->lpszMacro = ptr; button->lpszName = ptr;
ptr += lstrlen(name) + 1;
button->wParam = WH_FIRST_BUTTON; lstrcpy(ptr, (LPSTR) macro);
for (b = &win->first_button; *b; b = &(*b)->next) button->lpszMacro = ptr;
button->wParam = max(button->wParam, (*b)->wParam + 1);
*b = button;
SendMessage(win->hMainWnd, WM_USER, 0, 0); button->wParam = WH_FIRST_BUTTON;
for (b = &win->first_button; *b; b = &(*b)->next)
button->wParam = max(button->wParam, (*b)->wParam + 1);
*b = button;
SendMessage(win->hMainWnd, WM_USER, 0, 0);
} }
VOID MACRO_DeleteItem(LPCSTR str) void MACRO_DeleteItem(LPCSTR str)
{ {
fprintf(stderr, "DeleteItem(\"%s\")\n", str); WINE_FIXME("DeleteItem(\"%s\")\n", str);
} }
VOID MACRO_DeleteMark(LPCSTR str) void MACRO_DeleteMark(LPCSTR str)
{ {
fprintf(stderr, "DeleteMark(\"%s\")\n", str); WINE_FIXME("DeleteMark(\"%s\")\n", str);
} }
VOID MACRO_DestroyButton(LPCSTR str) void MACRO_DestroyButton(LPCSTR str)
{ {
fprintf(stderr, "DestroyButton(\"%s\")\n", str); WINE_FIXME("DestroyButton(\"%s\")\n", str);
} }
VOID MACRO_DisableButton(LPCSTR str) void MACRO_DisableButton(LPCSTR str)
{ {
fprintf(stderr, "DisableButton(\"%s\")\n", str); WINE_FIXME("DisableButton(\"%s\")\n", str);
} }
VOID MACRO_DisableItem(LPCSTR str) void MACRO_DisableItem(LPCSTR str)
{ {
fprintf(stderr, "DisableItem(\"%s\")\n", str); WINE_FIXME("DisableItem(\"%s\")\n", str);
} }
VOID MACRO_EnableButton(LPCSTR str) void MACRO_EnableButton(LPCSTR str)
{ {
fprintf(stderr, "EnableButton(\"%s\")\n", str); WINE_FIXME("EnableButton(\"%s\")\n", str);
} }
VOID MACRO_EnableItem(LPCSTR str) void MACRO_EnableItem(LPCSTR str)
{ {
fprintf(stderr, "EnableItem(\"%s\")\n", str); WINE_FIXME("EnableItem(\"%s\")\n", str);
} }
VOID MACRO_EndMPrint(VOID) void MACRO_EndMPrint(void)
{ {
fprintf(stderr, "EndMPrint()\n"); WINE_FIXME("EndMPrint()\n");
} }
VOID MACRO_ExecFile(LPCSTR str1, LPCSTR str2, LONG u, LPCSTR str3) void MACRO_ExecFile(LPCSTR str1, LPCSTR str2, LONG u, LPCSTR str3)
{ {
fprintf(stderr, "ExecFile(\"%s\", \"%s\", %lu, \"%s\")\n", str1, str2, u, str3); WINE_FIXME("ExecFile(\"%s\", \"%s\", %lu, \"%s\")\n", str1, str2, u, str3);
} }
VOID MACRO_ExecProgram(LPCSTR str, LONG u) void MACRO_ExecProgram(LPCSTR str, LONG u)
{ {
fprintf(stderr, "ExecProgram(\"%s\", %lu)\n", str, u); WINE_FIXME("ExecProgram(\"%s\", %lu)\n", str, u);
} }
VOID MACRO_Exit(VOID) void MACRO_Exit(void)
{ {
while(Globals.win_list) while (Globals.win_list)
DestroyWindow(Globals.win_list->hMainWnd); DestroyWindow(Globals.win_list->hMainWnd);
} }
VOID MACRO_ExtAbleItem(LPCSTR str, LONG u) void MACRO_ExtAbleItem(LPCSTR str, LONG u)
{ {
fprintf(stderr, "ExtAbleItem(\"%s\", %lu)\n", str, u); WINE_FIXME("ExtAbleItem(\"%s\", %lu)\n", str, u);
} }
VOID MACRO_ExtInsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u1, LONG u2) void MACRO_ExtInsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u1, LONG u2)
{ {
fprintf(stderr, "ExtInsertItem(\"%s\", \"%s\", \"%s\", \"%s\", %lu, %lu)\n", str1, str2, str3, str4, u1, u2); WINE_FIXME("ExtInsertItem(\"%s\", \"%s\", \"%s\", \"%s\", %lu, %lu)\n", str1, str2, str3, str4, u1, u2);
} }
VOID MACRO_ExtInsertMenu(LPCSTR str1, LPCSTR str2, LPCSTR str3, LONG u1, LONG u2) void MACRO_ExtInsertMenu(LPCSTR str1, LPCSTR str2, LPCSTR str3, LONG u1, LONG u2)
{ {
fprintf(stderr, "ExtInsertMenu(\"%s\", \"%s\", \"%s\", %lu, %lu)\n", str1, str2, str3, u1, u2); WINE_FIXME("ExtInsertMenu(\"%s\", \"%s\", \"%s\", %lu, %lu)\n", str1, str2, str3, u1, u2);
} }
BOOL MACRO_FileExist(LPCSTR str) BOOL MACRO_FileExist(LPCSTR str)
{ {
fprintf(stderr, "FileExist(\"%s\")\n", str); WINE_FIXME("FileExist(\"%s\")\n", str);
return TRUE; return TRUE;
} }
VOID MACRO_FileOpen(VOID) void MACRO_FileOpen(void)
{ {
OPENFILENAME openfilename; OPENFILENAME openfilename;
CHAR szPath[MAX_PATHNAME_LEN]; CHAR szPath[MAX_PATHNAME_LEN];
CHAR szDir[MAX_PATHNAME_LEN]; CHAR szDir[MAX_PATHNAME_LEN];
CHAR szzFilter[2 * MAX_STRING_LEN + 100]; CHAR szzFilter[2 * MAX_STRING_LEN + 100];
LPSTR p = szzFilter; LPSTR p = szzFilter;
LoadString(Globals.hInstance, 0X12B, p, MAX_STRING_LEN); LoadString(Globals.hInstance, 0X12B, p, MAX_STRING_LEN);
p += strlen(p) + 1; p += strlen(p) + 1;
lstrcpy(p, "*.hlp"); lstrcpy(p, "*.hlp");
p += strlen(p) + 1; p += strlen(p) + 1;
LoadString(Globals.hInstance, 0x12A, p, MAX_STRING_LEN); LoadString(Globals.hInstance, 0x12A, p, MAX_STRING_LEN);
p += strlen(p) + 1; p += strlen(p) + 1;
lstrcpy(p, "*.*"); lstrcpy(p, "*.*");
p += strlen(p) + 1; p += strlen(p) + 1;
*p = '\0'; *p = '\0';
GetCurrentDirectory(sizeof(szDir), szDir); GetCurrentDirectory(sizeof(szDir), szDir);
szPath[0]='\0'; szPath[0]='\0';
openfilename.lStructSize = 0; openfilename.lStructSize = 0;
openfilename.hwndOwner = Globals.active_win->hMainWnd; openfilename.hwndOwner = Globals.active_win->hMainWnd;
openfilename.hInstance = Globals.hInstance; openfilename.hInstance = Globals.hInstance;
openfilename.lpstrFilter = szzFilter; openfilename.lpstrFilter = szzFilter;
openfilename.lpstrCustomFilter = 0; openfilename.lpstrCustomFilter = 0;
openfilename.nMaxCustFilter = 0; openfilename.nMaxCustFilter = 0;
openfilename.nFilterIndex = 1; openfilename.nFilterIndex = 1;
openfilename.lpstrFile = szPath; openfilename.lpstrFile = szPath;
openfilename.nMaxFile = sizeof(szPath); openfilename.nMaxFile = sizeof(szPath);
openfilename.lpstrFileTitle = 0; openfilename.lpstrFileTitle = 0;
openfilename.nMaxFileTitle = 0; openfilename.nMaxFileTitle = 0;
openfilename.lpstrInitialDir = szDir; openfilename.lpstrInitialDir = szDir;
openfilename.lpstrTitle = 0; openfilename.lpstrTitle = 0;
openfilename.Flags = 0; openfilename.Flags = 0;
openfilename.nFileOffset = 0; openfilename.nFileOffset = 0;
openfilename.nFileExtension = 0; openfilename.nFileExtension = 0;
openfilename.lpstrDefExt = 0; openfilename.lpstrDefExt = 0;
openfilename.lCustData = 0; openfilename.lCustData = 0;
openfilename.lpfnHook = 0; openfilename.lpfnHook = 0;
openfilename.lpTemplateName = 0; openfilename.lpTemplateName = 0;
if (GetOpenFileName(&openfilename)) if (GetOpenFileName(&openfilename))
WINHELP_CreateHelpWindow(szPath, 0, "main", FALSE, 0, NULL, SW_SHOWNORMAL); WINHELP_CreateHelpWindowByHash(szPath, 0, "main", FALSE, 0, NULL, SW_SHOWNORMAL);
} }
VOID MACRO_Find(VOID) void MACRO_Find(void)
{ {
fprintf(stderr, "Find()\n"); WINE_FIXME("Find()\n");
} }
VOID MACRO_Finder(VOID) void MACRO_Finder(void)
{ {
fprintf(stderr, "Finder()\n"); WINE_FIXME("Finder()\n");
} }
VOID MACRO_FloatingMenu(VOID) void MACRO_FloatingMenu(void)
{ {
fprintf(stderr, "FloatingMenu()\n"); WINE_FIXME("FloatingMenu()\n");
} }
VOID MACRO_Flush(VOID) void MACRO_Flush(void)
{ {
fprintf(stderr, "Flush()\n"); WINE_FIXME("Flush()\n");
} }
VOID MACRO_FocusWindow(LPCSTR str) void MACRO_FocusWindow(LPCSTR str)
{ {
fprintf(stderr, "FocusWindow(\"%s\")\n", str); WINE_FIXME("FocusWindow(\"%s\")\n", str);
} }
VOID MACRO_Generate(LPCSTR str, WPARAM w, LPARAM l) void MACRO_Generate(LPCSTR str, WPARAM w, LPARAM l)
{ {
fprintf(stderr, "Generate(\"%s\", %x, %lx)\n", str, w, l); WINE_FIXME("Generate(\"%s\", %x, %lx)\n", str, w, l);
} }
VOID MACRO_GotoMark(LPCSTR str) void MACRO_GotoMark(LPCSTR str)
{ {
fprintf(stderr, "GotoMark(\"%s\")\n", str); WINE_FIXME("GotoMark(\"%s\")\n", str);
} }
VOID MACRO_HelpOn(VOID) void MACRO_HelpOn(void)
{ {
MACRO_JumpContents((Globals.wVersion > 4) ? "winhelp32.hlp" : "winhelp.hlp", NULL); MACRO_JumpContents((Globals.wVersion > 4) ? "winhelp32.hlp" : "winhelp.hlp", NULL);
} }
VOID MACRO_HelpOnTop(VOID) void MACRO_HelpOnTop(void)
{ {
fprintf(stderr, "HelpOnTop()\n"); WINE_FIXME("HelpOnTop()\n");
} }
VOID MACRO_History(VOID) void MACRO_History(void)
{ {
fprintf(stderr, "History()\n"); WINE_FIXME("History()\n");
} }
BOOL MACRO_InitMPrint(VOID) BOOL MACRO_InitMPrint(void)
{ {
fprintf(stderr, "InitMPrint()\n"); WINE_FIXME("InitMPrint()\n");
return FALSE; return FALSE;
} }
VOID MACRO_InsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u) void MACRO_InsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u)
{ {
fprintf(stderr, "InsertItem(\"%s\", \"%s\", \"%s\", \"%s\", %lu)\n", str1, str2, str3, str4, u); WINE_FIXME("InsertItem(\"%s\", \"%s\", \"%s\", \"%s\", %lu)\n", str1, str2, str3, str4, u);
} }
VOID MACRO_InsertMenu(LPCSTR str1, LPCSTR str2, LONG u) void MACRO_InsertMenu(LPCSTR str1, LPCSTR str2, LONG u)
{ {
fprintf(stderr, "InsertMenu(\"%s\", \"%s\", %lu)\n", str1, str2, u); WINE_FIXME("InsertMenu(\"%s\", \"%s\", %lu)\n", str1, str2, u);
} }
BOOL MACRO_IsBook(VOID) BOOL MACRO_IsBook(void)
{ {
fprintf(stderr, "IsBook()\n"); WINE_FIXME("IsBook()\n");
return TRUE; return TRUE;
} }
BOOL MACRO_IsMark(LPCSTR str) BOOL MACRO_IsMark(LPCSTR str)
{ {
fprintf(stderr, "IsMark(\"%s\")\n", str); WINE_FIXME("IsMark(\"%s\")\n", str);
return FALSE; return FALSE;
} }
BOOL MACRO_IsNotMark(LPCSTR str) BOOL MACRO_IsNotMark(LPCSTR str)
{ {
fprintf(stderr, "IsNotMark(\"%s\")\n", str); WINE_FIXME("IsNotMark(\"%s\")\n", str);
return TRUE; return TRUE;
} }
VOID MACRO_JumpContents(LPCSTR lpszPath, LPCSTR lpszWindow) void MACRO_JumpContents(LPCSTR lpszPath, LPCSTR lpszWindow)
{ {
WINHELP_CreateHelpWindow(lpszPath, 0, lpszWindow, FALSE, 0, NULL, SW_NORMAL); WINHELP_CreateHelpWindowByHash(lpszPath, 0, lpszWindow, FALSE, 0, NULL, SW_NORMAL);
} }
VOID MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context) void MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context)
{ {
fprintf(stderr, "JumpContext(\"%s\", \"%s\", %lu)\n", lpszPath, lpszWindow, context); WINE_FIXME("JumpContext(\"%s\", \"%s\", %lu)\n", lpszPath, lpszWindow, context);
} }
VOID MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash) void MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash)
{ {
WINHELP_CreateHelpWindow(lpszPath, lHash, lpszWindow, FALSE, 0, NULL, SW_NORMAL); WINHELP_CreateHelpWindowByHash(lpszPath, lHash, lpszWindow, FALSE, 0, NULL, SW_NORMAL);
} }
VOID MACRO_JumpHelpOn(VOID) void MACRO_JumpHelpOn(void)
{ {
fprintf(stderr, "JumpHelpOn()\n"); WINE_FIXME("JumpHelpOn()\n");
} }
VOID MACRO_JumpID(LPCSTR lpszPath, LPCSTR lpszWindow, LPCSTR topic_id) void MACRO_JumpID(LPCSTR lpszPath, LPCSTR lpszWindow, LPCSTR topic_id)
{ {
MACRO_JumpHash(lpszPath, lpszWindow, HLPFILE_Hash(topic_id)); MACRO_JumpHash(lpszPath, lpszWindow, HLPFILE_Hash(topic_id));
} }
VOID MACRO_JumpKeyword(LPCSTR lpszPath, LPCSTR lpszWindow, LPCSTR keyword) void MACRO_JumpKeyword(LPCSTR lpszPath, LPCSTR lpszWindow, LPCSTR keyword)
{ {
fprintf(stderr, "JumpKeyword(\"%s\", \"%s\", \"%s\")\n", lpszPath, lpszWindow, keyword); WINE_FIXME("JumpKeyword(\"%s\", \"%s\", \"%s\")\n", lpszPath, lpszWindow, keyword);
} }
VOID MACRO_KLink(LPCSTR str1, LONG u, LPCSTR str2, LPCSTR str3) void MACRO_KLink(LPCSTR str1, LONG u, LPCSTR str2, LPCSTR str3)
{ {
fprintf(stderr, "KLink(\"%s\", %lu, \"%s\", \"%s\")\n", str1, u, str2, str3); WINE_FIXME("KLink(\"%s\", %lu, \"%s\", \"%s\")\n", str1, u, str2, str3);
} }
VOID MACRO_Menu(VOID) void MACRO_Menu(void)
{ {
fprintf(stderr, "Menu()\n"); WINE_FIXME("Menu()\n");
} }
VOID MACRO_MPrintHash(LONG u) void MACRO_MPrintHash(LONG u)
{ {
fprintf(stderr, "MPrintHash(%lu)\n", u); WINE_FIXME("MPrintHash(%lu)\n", u);
} }
VOID MACRO_MPrintID(LPCSTR str) void MACRO_MPrintID(LPCSTR str)
{ {
fprintf(stderr, "MPrintID(\"%s\")\n", str); WINE_FIXME("MPrintID(\"%s\")\n", str);
} }
VOID MACRO_Next(VOID) void MACRO_Next(void)
{ {
fprintf(stderr, "Next()\n"); if (Globals.active_win->page->next)
WINHELP_CreateHelpWindowByPage(Globals.active_win->page->next, "main", FALSE, 0, NULL, SW_NORMAL);
} }
VOID MACRO_NoShow(VOID) void MACRO_NoShow(void)
{ {
fprintf(stderr, "NoShow()\n"); WINE_FIXME("NoShow()\n");
} }
VOID MACRO_PopupContext(LPCSTR str, LONG u) void MACRO_PopupContext(LPCSTR str, LONG u)
{ {
fprintf(stderr, "PopupContext(\"%s\", %lu)\n", str, u); WINE_FIXME("PopupContext(\"%s\", %lu)\n", str, u);
} }
VOID MACRO_PopupHash(LPCSTR str, LONG u) void MACRO_PopupHash(LPCSTR str, LONG u)
{ {
fprintf(stderr, "PopupHash(\"%s\", %lu)\n", str, u); WINE_FIXME("PopupHash(\"%s\", %lu)\n", str, u);
} }
VOID MACRO_PopupId(LPCSTR str1, LPCSTR str2) void MACRO_PopupId(LPCSTR str1, LPCSTR str2)
{ {
fprintf(stderr, "PopupId(\"%s\", \"%s\")\n", str1, str2); WINE_FIXME("PopupId(\"%s\", \"%s\")\n", str1, str2);
} }
VOID MACRO_PositionWindow(LONG i1, LONG i2, LONG u1, LONG u2, LONG u3, LPCSTR str) void MACRO_PositionWindow(LONG i1, LONG i2, LONG u1, LONG u2, LONG u3, LPCSTR str)
{ {
fprintf(stderr, "PositionWindow(%li, %li, %lu, %lu, %lu, \"%s\")\n", i1, i2, u1, u2, u3, str); WINE_FIXME("PositionWindow(%li, %li, %lu, %lu, %lu, \"%s\")\n", i1, i2, u1, u2, u3, str);
} }
VOID MACRO_Prev(VOID) void MACRO_Prev(void)
{ {
fprintf(stderr, "Prev()\n"); if (Globals.active_win->page->prev)
WINHELP_CreateHelpWindowByPage(Globals.active_win->page->prev, "main", FALSE, 0, NULL, SW_NORMAL);
} }
VOID MACRO_Print(VOID) void MACRO_Print(void)
{ {
PRINTDLG printer; PRINTDLG printer;
@ -496,97 +498,93 @@ VOID MACRO_Print(VOID)
printer.hSetupTemplate = 0; printer.hSetupTemplate = 0;
if (PrintDlgA(&printer)) { if (PrintDlgA(&printer)) {
fprintf(stderr, "Print()\n"); WINE_FIXME("Print()\n");
}; }
} }
VOID MACRO_PrinterSetup(VOID) void MACRO_PrinterSetup(void)
{ {
fprintf(stderr, "PrinterSetup()\n"); WINE_FIXME("PrinterSetup()\n");
} }
VOID MACRO_RegisterRoutine(LPCSTR str1, LPCSTR str2, LPCSTR str3) void MACRO_RegisterRoutine(LPCSTR str1, LPCSTR str2, LPCSTR str3)
{ {
fprintf(stderr, "RegisterRoutine(\"%s\", \"%s\", \"%s\")\n", str1, str2, str3); WINE_FIXME("RegisterRoutine(\"%s\", \"%s\", \"%s\")\n", str1, str2, str3);
} }
VOID MACRO_RemoveAccelerator(LONG u1, LONG u2) void MACRO_RemoveAccelerator(LONG u1, LONG u2)
{ {
fprintf(stderr, "RemoveAccelerator(%lu, %lu)\n", u1, u2); WINE_FIXME("RemoveAccelerator(%lu, %lu)\n", u1, u2);
} }
VOID MACRO_ResetMenu(VOID) void MACRO_ResetMenu(void)
{ {
fprintf(stderr, "ResetMenu()\n"); WINE_FIXME("ResetMenu()\n");
} }
VOID MACRO_SaveMark(LPCSTR str) void MACRO_SaveMark(LPCSTR str)
{ {
fprintf(stderr, "SaveMark(\"%s\")\n", str); WINE_FIXME("SaveMark(\"%s\")\n", str);
} }
VOID MACRO_Search(VOID) void MACRO_Search(void)
{ {
fprintf(stderr, "Search()\n"); WINE_FIXME("Search()\n");
} }
VOID MACRO_SetContents(LPCSTR str, LONG u) void MACRO_SetContents(LPCSTR str, LONG u)
{ {
fprintf(stderr, "SetContents(\"%s\", %lu)\n", str, u); WINE_FIXME("SetContents(\"%s\", %lu)\n", str, u);
} }
VOID MACRO_SetHelpOnFile(LPCSTR str) void MACRO_SetHelpOnFile(LPCSTR str)
{ {
fprintf(stderr, "SetHelpOnFile(\"%s\")\n", str); WINE_FIXME("SetHelpOnFile(\"%s\")\n", str);
} }
VOID MACRO_SetPopupColor(LONG u1, LONG u2, LONG u3) void MACRO_SetPopupColor(LONG u1, LONG u2, LONG u3)
{ {
fprintf(stderr, "SetPopupColor(%lu, %lu, %lu)\n", u1, u2, u3); WINE_FIXME("SetPopupColor(%lu, %lu, %lu)\n", u1, u2, u3);
} }
VOID MACRO_ShellExecute(LPCSTR str1, LPCSTR str2, LONG u1, LONG u2, LPCSTR str3, LPCSTR str4) void MACRO_ShellExecute(LPCSTR str1, LPCSTR str2, LONG u1, LONG u2, LPCSTR str3, LPCSTR str4)
{ {
fprintf(stderr, "ShellExecute(\"%s\", \"%s\", %lu, %lu, \"%s\", \"%s\")\n", str1, str2, u1, u2, str3, str4); WINE_FIXME("ShellExecute(\"%s\", \"%s\", %lu, %lu, \"%s\", \"%s\")\n", str1, str2, u1, u2, str3, str4);
} }
VOID MACRO_ShortCut(LPCSTR str1, LPCSTR str2, WPARAM w, LPARAM l, LPCSTR str) void MACRO_ShortCut(LPCSTR str1, LPCSTR str2, WPARAM w, LPARAM l, LPCSTR str)
{ {
fprintf(stderr, "ShortCut(\"%s\", \"%s\", %x, %lx, \"%s\")\n", str1, str2, w, l, str); WINE_FIXME("ShortCut(\"%s\", \"%s\", %x, %lx, \"%s\")\n", str1, str2, w, l, str);
} }
VOID MACRO_TCard(LONG u) void MACRO_TCard(LONG u)
{ {
fprintf(stderr, "TCard(%lu)\n", u); WINE_FIXME("TCard(%lu)\n", u);
} }
VOID MACRO_Test(LONG u) void MACRO_Test(LONG u)
{ {
fprintf(stderr, "Test(%lu)\n", u); WINE_FIXME("Test(%lu)\n", u);
} }
BOOL MACRO_TestALink(LPCSTR str) BOOL MACRO_TestALink(LPCSTR str)
{ {
fprintf(stderr, "TestALink(\"%s\")\n", str); WINE_FIXME("TestALink(\"%s\")\n", str);
return FALSE; return FALSE;
} }
BOOL MACRO_TestKLink(LPCSTR str) BOOL MACRO_TestKLink(LPCSTR str)
{ {
fprintf(stderr, "TestKLink(\"%s\")\n", str); WINE_FIXME("TestKLink(\"%s\")\n", str);
return FALSE; return FALSE;
} }
VOID MACRO_UncheckItem(LPCSTR str) void MACRO_UncheckItem(LPCSTR str)
{ {
fprintf(stderr, "UncheckItem(\"%s\")\n", str); WINE_FIXME("UncheckItem(\"%s\")\n", str);
} }
VOID MACRO_UpdateWindow(LPCSTR str1, LPCSTR str2) void MACRO_UpdateWindow(LPCSTR str1, LPCSTR str2)
{ {
fprintf(stderr, "UpdateWindow(\"%s\", \"%s\")\n", str1, str2); WINE_FIXME("UpdateWindow(\"%s\", \"%s\")\n", str1, str2);
} }
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */

View file

@ -19,15 +19,20 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
%} %}
%x quote dquote %x quote
%{ %{
#include <assert.h>
#include "macro.h" #include "macro.h"
#include "y.tab.h" #include "y.tab.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(winhelp);
static LPCSTR macroptr; static LPCSTR macroptr;
static LPSTR strptr; static LPSTR strptr;
static HGLOBAL hStringBuffer = 0; static int quote_stack[32];
static INT nested_quotes = 0; static int quote_stk_idx = 0;
#define YY_INPUT(buf,result,max_size)\ #define YY_INPUT(buf,result,max_size)\
if ((result = *macroptr ? 1 : 0)) buf[0] = *macroptr++; if ((result = *macroptr ? 1 : 0)) buf[0] = *macroptr++;
@ -35,181 +40,193 @@ static INT nested_quotes = 0;
#define YY_NO_UNPUT #define YY_NO_UNPUT
%} %}
%% %%
About yylval.void_function_void = MACRO_About; return VOID_FUNCTION_VOID; About yylval.void_function_void = MACRO_About; return VOID_FUNCTION_VOID;
AddAccelerator|AA yylval.void_function_2uint_string = MACRO_AddAccelerator; return VOID_FUNCTION_2UINT_STRING; AddAccelerator|AA yylval.void_function_2uint_string = MACRO_AddAccelerator; return VOID_FUNCTION_2UINT_STRING;
ALink|AL yylval.void_function_string_uint_string = MACRO_ALink; return VOID_FUNCTION_STRING_UINT_STRING; ALink|AL yylval.void_function_string_uint_string = MACRO_ALink; return VOID_FUNCTION_STRING_UINT_STRING;
Annotate yylval.void_function_void = MACRO_Annotate; return VOID_FUNCTION_VOID; Annotate yylval.void_function_void = MACRO_Annotate; return VOID_FUNCTION_VOID;
AppendItem yylval.void_function_4string = MACRO_AppendItem; return VOID_FUNCTION_4STRING; AppendItem yylval.void_function_4string = MACRO_AppendItem; return VOID_FUNCTION_4STRING;
Back yylval.void_function_void = MACRO_Back; return VOID_FUNCTION_VOID; Back yylval.void_function_void = MACRO_Back; return VOID_FUNCTION_VOID;
BackFlush|BF yylval.void_function_void = MACRO_BackFlush; return VOID_FUNCTION_VOID; BackFlush|BF yylval.void_function_void = MACRO_BackFlush; return VOID_FUNCTION_VOID;
BookmarkDefine yylval.void_function_void = MACRO_BookmarkDefine; return VOID_FUNCTION_VOID; BookmarkDefine yylval.void_function_void = MACRO_BookmarkDefine; return VOID_FUNCTION_VOID;
BookmarkMore yylval.void_function_void = MACRO_BookmarkMore; return VOID_FUNCTION_VOID; BookmarkMore yylval.void_function_void = MACRO_BookmarkMore; return VOID_FUNCTION_VOID;
BrowseButtons yylval.void_function_void = MACRO_BrowseButtons; return VOID_FUNCTION_VOID; BrowseButtons yylval.void_function_void = MACRO_BrowseButtons; return VOID_FUNCTION_VOID;
ChangeButtonBinding|CBB yylval.void_function_2string = MACRO_ChangeButtonBinding; return VOID_FUNCTION_2STRING; ChangeButtonBinding|CBB yylval.void_function_2string = MACRO_ChangeButtonBinding; return VOID_FUNCTION_2STRING;
ChangeEnable|CE yylval.void_function_2string = MACRO_ChangeEnable; return VOID_FUNCTION_2STRING; ChangeEnable|CE yylval.void_function_2string = MACRO_ChangeEnable; return VOID_FUNCTION_2STRING;
ChangeItemBinding|CIB yylval.void_function_2string = MACRO_ChangeItemBinding; return VOID_FUNCTION_2STRING; ChangeItemBinding|CIB yylval.void_function_2string = MACRO_ChangeItemBinding; return VOID_FUNCTION_2STRING;
CheckItem|CI yylval.void_function_string = MACRO_CheckItem; return VOID_FUNCTION_STRING; CheckItem|CI yylval.void_function_string = MACRO_CheckItem; return VOID_FUNCTION_STRING;
CloseSecondarys|CS yylval.void_function_void = MACRO_CloseSecondarys; return VOID_FUNCTION_VOID; CloseSecondarys|CS yylval.void_function_void = MACRO_CloseSecondarys; return VOID_FUNCTION_VOID;
CloseWindow|CW yylval.void_function_string = MACRO_CloseWindow; return VOID_FUNCTION_STRING; CloseWindow|CW yylval.void_function_string = MACRO_CloseWindow; return VOID_FUNCTION_STRING;
Compare yylval.void_function_string = MACRO_Compare; return VOID_FUNCTION_STRING; Compare yylval.void_function_string = MACRO_Compare; return VOID_FUNCTION_STRING;
Contents yylval.void_function_void = MACRO_Contents; return VOID_FUNCTION_VOID; Contents yylval.void_function_void = MACRO_Contents; return VOID_FUNCTION_VOID;
ControlPanel yylval.void_function_2string_uint = MACRO_ControlPanel; return VOID_FUNCTION_2STRING_UINT; ControlPanel yylval.void_function_2string_uint = MACRO_ControlPanel; return VOID_FUNCTION_2STRING_UINT;
CopyDialog yylval.void_function_void = MACRO_CopyDialog; return VOID_FUNCTION_VOID; CopyDialog yylval.void_function_void = MACRO_CopyDialog; return VOID_FUNCTION_VOID;
CopyTopic|CT yylval.void_function_void = MACRO_CopyTopic; return VOID_FUNCTION_VOID; CopyTopic|CT yylval.void_function_void = MACRO_CopyTopic; return VOID_FUNCTION_VOID;
CreateButton|CB yylval.void_function_3string = MACRO_CreateButton; return VOID_FUNCTION_3STRING; CreateButton|CB yylval.void_function_3string = MACRO_CreateButton; return VOID_FUNCTION_3STRING;
DeleteItem yylval.void_function_string = MACRO_DeleteItem; return VOID_FUNCTION_STRING; DeleteItem yylval.void_function_string = MACRO_DeleteItem; return VOID_FUNCTION_STRING;
DeleteMark yylval.void_function_string = MACRO_DeleteMark; return VOID_FUNCTION_STRING; DeleteMark yylval.void_function_string = MACRO_DeleteMark; return VOID_FUNCTION_STRING;
DestroyButton yylval.void_function_string = MACRO_DestroyButton; return VOID_FUNCTION_STRING; DestroyButton yylval.void_function_string = MACRO_DestroyButton; return VOID_FUNCTION_STRING;
DisableButton|DB yylval.void_function_string = MACRO_DisableButton; return VOID_FUNCTION_STRING; DisableButton|DB yylval.void_function_string = MACRO_DisableButton; return VOID_FUNCTION_STRING;
DisableItem|DI yylval.void_function_string = MACRO_DisableItem; return VOID_FUNCTION_STRING; DisableItem|DI yylval.void_function_string = MACRO_DisableItem; return VOID_FUNCTION_STRING;
EnableButton|EB yylval.void_function_string = MACRO_EnableButton; return VOID_FUNCTION_STRING; EnableButton|EB yylval.void_function_string = MACRO_EnableButton; return VOID_FUNCTION_STRING;
EnableItem|EI yylval.void_function_string = MACRO_EnableItem; return VOID_FUNCTION_STRING; EnableItem|EI yylval.void_function_string = MACRO_EnableItem; return VOID_FUNCTION_STRING;
EndMPrint yylval.void_function_void = MACRO_EndMPrint; return VOID_FUNCTION_VOID; EndMPrint yylval.void_function_void = MACRO_EndMPrint; return VOID_FUNCTION_VOID;
ExecFile|EF yylval.void_function_2string_uint_string = MACRO_ExecFile; return VOID_FUNCTION_2STRING_UINT_STRING; ExecFile|EF yylval.void_function_2string_uint_string = MACRO_ExecFile; return VOID_FUNCTION_2STRING_UINT_STRING;
ExecProgram|EP yylval.void_function_string_uint = MACRO_ExecProgram; return VOID_FUNCTION_STRING_UINT; ExecProgram|EP yylval.void_function_string_uint = MACRO_ExecProgram; return VOID_FUNCTION_STRING_UINT;
Exit yylval.void_function_void = MACRO_Exit; return VOID_FUNCTION_VOID; Exit yylval.void_function_void = MACRO_Exit; return VOID_FUNCTION_VOID;
ExtAbleItem yylval.void_function_string_uint = MACRO_ExtAbleItem; return VOID_FUNCTION_STRING_UINT; ExtAbleItem yylval.void_function_string_uint = MACRO_ExtAbleItem; return VOID_FUNCTION_STRING_UINT;
ExtInsertItem yylval.void_function_4string_2uint = MACRO_ExtInsertItem; return VOID_FUNCTION_4STRING_2UINT; ExtInsertItem yylval.void_function_4string_2uint = MACRO_ExtInsertItem; return VOID_FUNCTION_4STRING_2UINT;
ExtInsertMenu yylval.void_function_3string_2uint = MACRO_ExtInsertMenu; return VOID_FUNCTION_3STRING_2UINT; ExtInsertMenu yylval.void_function_3string_2uint = MACRO_ExtInsertMenu; return VOID_FUNCTION_3STRING_2UINT;
FileExist|FE yylval.bool_function_string = MACRO_FileExist; return BOOL_FUNCTION_STRING; FileExist|FE yylval.bool_function_string = MACRO_FileExist; return BOOL_FUNCTION_STRING;
FileOpen|FO yylval.void_function_void = MACRO_FileOpen; return VOID_FUNCTION_VOID; FileOpen|FO yylval.void_function_void = MACRO_FileOpen; return VOID_FUNCTION_VOID;
Find yylval.void_function_void = MACRO_Find; return VOID_FUNCTION_VOID; Find yylval.void_function_void = MACRO_Find; return VOID_FUNCTION_VOID;
Finder|FD yylval.void_function_void = MACRO_Finder; return VOID_FUNCTION_VOID; Finder|FD yylval.void_function_void = MACRO_Finder; return VOID_FUNCTION_VOID;
FloatingMenu yylval.void_function_void = MACRO_FloatingMenu; return VOID_FUNCTION_VOID; FloatingMenu yylval.void_function_void = MACRO_FloatingMenu; return VOID_FUNCTION_VOID;
Flush|FH yylval.void_function_void = MACRO_Flush; return VOID_FUNCTION_VOID; Flush|FH yylval.void_function_void = MACRO_Flush; return VOID_FUNCTION_VOID;
FocusWindow yylval.void_function_string = MACRO_FocusWindow; return VOID_FUNCTION_STRING; FocusWindow yylval.void_function_string = MACRO_FocusWindow; return VOID_FUNCTION_STRING;
Generate yylval.void_function_string_wparam_lparam = MACRO_Generate; return VOID_FUNCTION_STRING_WPARAM_LPARAM; Generate yylval.void_function_string_wparam_lparam = MACRO_Generate; return VOID_FUNCTION_STRING_WPARAM_LPARAM;
GotoMark yylval.void_function_string = MACRO_GotoMark; return VOID_FUNCTION_STRING; GotoMark yylval.void_function_string = MACRO_GotoMark; return VOID_FUNCTION_STRING;
HelpOn yylval.void_function_void = MACRO_HelpOn; return VOID_FUNCTION_VOID; HelpOn yylval.void_function_void = MACRO_HelpOn; return VOID_FUNCTION_VOID;
HelpOnTop yylval.void_function_void = MACRO_HelpOnTop; return VOID_FUNCTION_VOID; HelpOnTop yylval.void_function_void = MACRO_HelpOnTop; return VOID_FUNCTION_VOID;
History yylval.void_function_void = MACRO_History; return VOID_FUNCTION_VOID; History yylval.void_function_void = MACRO_History; return VOID_FUNCTION_VOID;
IfThen|IF return IF_THEN; IfThen|IF return IF_THEN;
IfThenElse|IE return IF_THEN_ELSE; IfThenElse|IE return IF_THEN_ELSE;
InitMPrint yylval.bool_function_void = MACRO_InitMPrint; return BOOL_FUNCTION_VOID; InitMPrint yylval.bool_function_void = MACRO_InitMPrint; return BOOL_FUNCTION_VOID;
InsertItem yylval.void_function_4string_uint = MACRO_InsertItem; return VOID_FUNCTION_4STRING_UINT; InsertItem yylval.void_function_4string_uint = MACRO_InsertItem; return VOID_FUNCTION_4STRING_UINT;
InsertMenu yylval.void_function_2string_uint = MACRO_InsertMenu; return VOID_FUNCTION_2STRING_UINT; InsertMenu yylval.void_function_2string_uint = MACRO_InsertMenu; return VOID_FUNCTION_2STRING_UINT;
IsBook yylval.bool_function_void = MACRO_IsBook; return BOOL_FUNCTION_VOID; IsBook yylval.bool_function_void = MACRO_IsBook; return BOOL_FUNCTION_VOID;
IsMark yylval.bool_function_string = MACRO_IsMark; return BOOL_FUNCTION_STRING; IsMark yylval.bool_function_string = MACRO_IsMark; return BOOL_FUNCTION_STRING;
IsNotMark|NM yylval.bool_function_string = MACRO_IsNotMark; return BOOL_FUNCTION_STRING; IsNotMark|NM yylval.bool_function_string = MACRO_IsNotMark; return BOOL_FUNCTION_STRING;
JumpContents yylval.void_function_2string = MACRO_JumpContents; return VOID_FUNCTION_FILE_WIN; JumpContents yylval.void_function_2string = MACRO_JumpContents; return VOID_FUNCTION_FILE_WIN;
JumpContext|JC yylval.void_function_2string_uint = MACRO_JumpContext; return VOID_FUNCTION_FILE_WIN_UINT; JumpContext|JC yylval.void_function_2string_uint = MACRO_JumpContext; return VOID_FUNCTION_FILE_WIN_UINT;
JumpHash|JH yylval.void_function_2string_uint = MACRO_JumpHash; return VOID_FUNCTION_FILE_WIN_UINT; JumpHash|JH yylval.void_function_2string_uint = MACRO_JumpHash; return VOID_FUNCTION_FILE_WIN_UINT;
JumpHelpOn yylval.void_function_void = MACRO_JumpHelpOn; return VOID_FUNCTION_VOID; JumpHelpOn yylval.void_function_void = MACRO_JumpHelpOn; return VOID_FUNCTION_VOID;
JumpID|JI yylval.void_function_3string = MACRO_JumpID; return VOID_FUNCTION_FILE_WIN_STRING; JumpID|JI yylval.void_function_3string = MACRO_JumpID; return VOID_FUNCTION_FILE_WIN_STRING;
JumpKeyword|JK yylval.void_function_3string = MACRO_JumpKeyword; return VOID_FUNCTION_FILE_WIN_STRING; JumpKeyword|JK yylval.void_function_3string = MACRO_JumpKeyword; return VOID_FUNCTION_FILE_WIN_STRING;
KLink|KL yylval.void_function_string_uint_2string = MACRO_KLink; return VOID_FUNCTION_STRING_UINT_2STRING; KLink|KL yylval.void_function_string_uint_2string = MACRO_KLink; return VOID_FUNCTION_STRING_UINT_2STRING;
Menu|MU yylval.void_function_void = MACRO_Menu; return VOID_FUNCTION_VOID; Menu|MU yylval.void_function_void = MACRO_Menu; return VOID_FUNCTION_VOID;
MPrintHash yylval.void_function_uint = MACRO_MPrintHash; return VOID_FUNCTION_UINT; MPrintHash yylval.void_function_uint = MACRO_MPrintHash; return VOID_FUNCTION_UINT;
MPrintID yylval.void_function_string = MACRO_MPrintID; return VOID_FUNCTION_STRING; MPrintID yylval.void_function_string = MACRO_MPrintID; return VOID_FUNCTION_STRING;
Next yylval.void_function_void = MACRO_Next; return VOID_FUNCTION_VOID; Next yylval.void_function_void = MACRO_Next; return VOID_FUNCTION_VOID;
NoShow yylval.void_function_void = MACRO_NoShow; return VOID_FUNCTION_VOID; NoShow yylval.void_function_void = MACRO_NoShow; return VOID_FUNCTION_VOID;
Not return NOT; Not return NOT;
PopupContext|PC yylval.void_function_string_uint = MACRO_PopupContext; return VOID_FUNCTION_STRING_UINT; PopupContext|PC yylval.void_function_string_uint = MACRO_PopupContext; return VOID_FUNCTION_STRING_UINT;
PopupHash yylval.void_function_string_uint = MACRO_PopupHash; return VOID_FUNCTION_STRING_UINT; PopupHash yylval.void_function_string_uint = MACRO_PopupHash; return VOID_FUNCTION_STRING_UINT;
PopupId|PI yylval.void_function_2string = MACRO_PopupId; return VOID_FUNCTION_2STRING; PopupId|PI yylval.void_function_2string = MACRO_PopupId; return VOID_FUNCTION_2STRING;
PositionWindow|PW yylval.void_function_2int_3uint_string = MACRO_PositionWindow; return VOID_FUNCTION_2INT_3UINT_STRING; PositionWindow|PW yylval.void_function_2int_3uint_string = MACRO_PositionWindow; return VOID_FUNCTION_2INT_3UINT_STRING;
Prev yylval.void_function_void = MACRO_Prev; return VOID_FUNCTION_VOID; Prev yylval.void_function_void = MACRO_Prev; return VOID_FUNCTION_VOID;
Print yylval.void_function_void = MACRO_Print; return VOID_FUNCTION_VOID; Print yylval.void_function_void = MACRO_Print; return VOID_FUNCTION_VOID;
PrinterSetup yylval.void_function_void = MACRO_PrinterSetup; return VOID_FUNCTION_VOID; PrinterSetup yylval.void_function_void = MACRO_PrinterSetup; return VOID_FUNCTION_VOID;
RegisterRoutine|RR yylval.void_function_3string = MACRO_RegisterRoutine; return VOID_FUNCTION_3STRING; RegisterRoutine|RR yylval.void_function_3string = MACRO_RegisterRoutine; return VOID_FUNCTION_3STRING;
RemoveAccelerator|RA yylval.void_function_2uint = MACRO_RemoveAccelerator; return VOID_FUNCTION_2UINT; RemoveAccelerator|RA yylval.void_function_2uint = MACRO_RemoveAccelerator; return VOID_FUNCTION_2UINT;
ResetMenu yylval.void_function_void = MACRO_ResetMenu; return VOID_FUNCTION_VOID; ResetMenu yylval.void_function_void = MACRO_ResetMenu; return VOID_FUNCTION_VOID;
SaveMark yylval.void_function_string = MACRO_SaveMark; return VOID_FUNCTION_STRING; SaveMark yylval.void_function_string = MACRO_SaveMark; return VOID_FUNCTION_STRING;
Search yylval.void_function_void = MACRO_Search; return VOID_FUNCTION_VOID; Search yylval.void_function_void = MACRO_Search; return VOID_FUNCTION_VOID;
SetContents yylval.void_function_string_uint = MACRO_SetContents; return VOID_FUNCTION_STRING_UINT; SetContents yylval.void_function_string_uint = MACRO_SetContents; return VOID_FUNCTION_STRING_UINT;
SetHelpOnFile yylval.void_function_string = MACRO_SetHelpOnFile; return VOID_FUNCTION_STRING; SetHelpOnFile yylval.void_function_string = MACRO_SetHelpOnFile; return VOID_FUNCTION_STRING;
SetPopupColor|SPC yylval.void_function_3uint = MACRO_SetPopupColor; return VOID_FUNCTION_3UINT; SetPopupColor|SPC yylval.void_function_3uint = MACRO_SetPopupColor; return VOID_FUNCTION_3UINT;
ShellExecute|SE yylval.void_function_2string_2uint_2string = MACRO_ShellExecute; return VOID_FUNCTION_2STRING_2UINT_2STRING; ShellExecute|SE yylval.void_function_2string_2uint_2string = MACRO_ShellExecute; return VOID_FUNCTION_2STRING_2UINT_2STRING;
ShortCut|SH yylval.void_function_2string_wparam_lparam_string = MACRO_ShortCut; return VOID_FUNCTION_2STRING_WPARAM_LPARAM_STRING; ShortCut|SH yylval.void_function_2string_wparam_lparam_string = MACRO_ShortCut; return VOID_FUNCTION_2STRING_WPARAM_LPARAM_STRING;
TCard yylval.void_function_uint = MACRO_TCard; return VOID_FUNCTION_UINT; TCard yylval.void_function_uint = MACRO_TCard; return VOID_FUNCTION_UINT;
Test yylval.void_function_uint = MACRO_Test; return VOID_FUNCTION_UINT; Test yylval.void_function_uint = MACRO_Test; return VOID_FUNCTION_UINT;
TestALink yylval.bool_function_string = MACRO_TestALink; return BOOL_FUNCTION_STRING; TestALink yylval.bool_function_string = MACRO_TestALink; return BOOL_FUNCTION_STRING;
TestKLink yylval.bool_function_string = MACRO_TestKLink; return BOOL_FUNCTION_STRING; TestKLink yylval.bool_function_string = MACRO_TestKLink; return BOOL_FUNCTION_STRING;
UncheckItem|UI yylval.void_function_string = MACRO_UncheckItem; return VOID_FUNCTION_STRING; UncheckItem|UI yylval.void_function_string = MACRO_UncheckItem; return VOID_FUNCTION_STRING;
UpdateWindow|UW yylval.void_function_2string = MACRO_UpdateWindow; return VOID_FUNCTION_2STRING; UpdateWindow|UW yylval.void_function_2string = MACRO_UpdateWindow; return VOID_FUNCTION_2STRING;
[-+]?[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;
\` |
\" {
if (!hStringBuffer)
{
hStringBuffer = GlobalAlloc(GMEM_FIXED, strlen(macroptr));
strptr = GlobalLock(hStringBuffer);
}
yylval.string = strptr;
BEGIN (yytext[0] == '`' ? quote : dquote);
}
<quote>\` { \` |
*strptr++ = yytext[0]; \" |
nested_quotes++; \' |
} <quote>\` |
<quote>\" |
<quote>\' | <quote>\' {
<dquote>\" { if (quote_stk_idx == 0 ||
if (nested_quotes) (yytext[0] == '\"' && quote_stack[quote_stk_idx - 1] != '\"') ||
{ (yytext[0] == '`'))
nested_quotes--; {
*strptr++ = yytext[0]; /* opening a new one */
} if (quote_stk_idx == 0)
else {
{ strptr = HeapAlloc(GetProcessHeap(), 0, strlen(macroptr) + 1);
BEGIN INITIAL; yylval.string = strptr;
*strptr++ = '\0'; BEGIN(quote);
return tSTRING; }
} else *strptr++ = yytext[0];
} quote_stack[quote_stk_idx++] = yytext[0];
assert(quote_stk_idx < sizeof(quote_stack) / sizeof(quote_stack[0]));
<quote,dquote>. *strptr++ = yytext[0]; }
<quote,dquote>\\. *strptr++ = yytext[1]; else
{
<quote,dquote><<EOF>> return 0; if (yytext[0] == '`') assert(0);
/* close the current quote */
if (--quote_stk_idx == 0)
{
BEGIN INITIAL;
*strptr++ = '\0';
return tSTRING;
}
else *strptr++ = yytext[0];
}
}
<quote>. *strptr++ = yytext[0];
<quote>\\. *strptr++ = yytext[1];
<quote><<EOF>> return 0;
" " " "
. return yytext[0];
. return yytext[0];
%% %%
#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_ExecuteMacro(LPCSTR macro) void MACRO_ExecuteMacro(LPCSTR macro)
{ {
if (!lstrcmpi(macro, "MacroTest")) WINE_TRACE("%s\n", wine_dbgstr_a(macro));
if (!lstrcmpi(macro, "MacroTest"))
{ {
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;
} }
macroptr = macro; macroptr = macro;
yyparse(); yyparse();
if (hStringBuffer) GlobalFree(hStringBuffer); if (strptr)
hStringBuffer = 0; {
HeapFree(GetProcessHeap(), 0, strptr);
strptr = NULL;
}
quote_stk_idx = 0;
} }
void yyerror (const char *s) void yyerror(const char *s)
{ {
fprintf(stderr, "%s\n", s); WINE_WARN("Error while parsing: %s\n", s);
nested_quotes = 0; BEGIN INITIAL;
BEGIN INITIAL; yyrestart(yyin);
yyrestart(yyin); if (strptr)
{
HeapFree(GetProcessHeap(), 0, strptr);
strptr = NULL;
}
quote_stk_idx = 0;
} }
#ifndef yywrap #ifndef yywrap

View file

@ -97,83 +97,83 @@ macrosep: ';' |
':' ; ':' ;
macro: /* Empty */ | macro: /* Empty */ |
IF_THEN '(' bool_macro ',' {if (! $3) skip++;} IF_THEN '(' bool_macro ',' {if (!$3) skip++;}
macrostring ')' {if (! $3) skip--;} | macrostring ')' {if (!$3) skip--;} |
IF_THEN_ELSE '(' bool_macro ',' {if (! $3) skip++;} IF_THEN_ELSE '(' bool_macro ',' {if (!$3) skip++;}
macrostring ',' {if (! $3) skip--; else skip++;} macrostring ',' {if (!$3) skip--; else skip++;}
macrostring ')' {if ( $3) skip--;} | macrostring ')' {if ( $3) skip--;} |
VOID_FUNCTION_VOID VOID_FUNCTION_VOID
'(' ')' '(' ')'
{if (! skip) (*$1)();} | {if (!skip) (*$1)();} |
VOID_FUNCTION_STRING VOID_FUNCTION_STRING
'(' tSTRING ')' '(' tSTRING ')'
{if (! skip) (*$1)($3);} | {if (!skip) (*$1)($3);} |
VOID_FUNCTION_2STRING VOID_FUNCTION_2STRING
'(' tSTRING ',' tSTRING ')' '(' tSTRING ',' tSTRING ')'
{if (! skip) (*$1)($3, $5);} | {if (!skip) (*$1)($3, $5);} |
VOID_FUNCTION_2STRING_UINT VOID_FUNCTION_2STRING_UINT
'(' tSTRING ',' tSTRING ',' INTEGER ')' '(' tSTRING ',' tSTRING ',' INTEGER ')'
{if (! skip) (*$1)($3, $5, $7);} | {if (!skip) (*$1)($3, $5, $7);} |
VOID_FUNCTION_2STRING_UINT_STRING VOID_FUNCTION_2STRING_UINT_STRING
'(' tSTRING ',' tSTRING ',' INTEGER ',' tSTRING ')' '(' tSTRING ',' tSTRING ',' INTEGER ',' tSTRING ')'
{if (! skip) (*$1)($3, $5, $7, $9);} | {if (!skip) (*$1)($3, $5, $7, $9);} |
VOID_FUNCTION_2STRING_2UINT_2STRING VOID_FUNCTION_2STRING_2UINT_2STRING
'(' tSTRING ',' tSTRING ',' INTEGER ',' INTEGER ',' tSTRING ',' tSTRING ')' '(' tSTRING ',' tSTRING ',' INTEGER ',' INTEGER ',' tSTRING ',' tSTRING ')'
{if (! skip) (*$1)($3, $5, $7, $9, $11, $13);} | {if (!skip) (*$1)($3, $5, $7, $9, $11, $13);} |
VOID_FUNCTION_2STRING_WPARAM_LPARAM_STRING VOID_FUNCTION_2STRING_WPARAM_LPARAM_STRING
'(' tSTRING ',' tSTRING ',' INTEGER ',' INTEGER ',' tSTRING ')' '(' tSTRING ',' tSTRING ',' INTEGER ',' INTEGER ',' tSTRING ')'
{if (! skip) (*$1)($3, $5, $7, $9, $11);} | {if (!skip) (*$1)($3, $5, $7, $9, $11);} |
VOID_FUNCTION_3STRING VOID_FUNCTION_3STRING
'(' tSTRING ',' tSTRING ',' tSTRING ')' '(' tSTRING ',' tSTRING ',' tSTRING ')'
{if (! skip) (*$1)($3, $5, $7);} | {if (!skip) (*$1)($3, $5, $7);} |
VOID_FUNCTION_3STRING_2UINT VOID_FUNCTION_3STRING_2UINT
'(' tSTRING ',' tSTRING ',' tSTRING ',' INTEGER ',' INTEGER ')' '(' tSTRING ',' tSTRING ',' tSTRING ',' INTEGER ',' INTEGER ')'
{if (! skip) (*$1)($3, $5, $7, $9, $11);} | {if (!skip) (*$1)($3, $5, $7, $9, $11);} |
VOID_FUNCTION_4STRING VOID_FUNCTION_4STRING
'(' tSTRING ',' tSTRING ',' tSTRING ',' tSTRING ')' '(' tSTRING ',' tSTRING ',' tSTRING ',' tSTRING ')'
{if (! skip) (*$1)($3, $5, $7, $9);} | {if (!skip) (*$1)($3, $5, $7, $9);} |
VOID_FUNCTION_4STRING_UINT VOID_FUNCTION_4STRING_UINT
'(' tSTRING ',' tSTRING ',' tSTRING ',' tSTRING ',' INTEGER')' '(' tSTRING ',' tSTRING ',' tSTRING ',' tSTRING ',' INTEGER')'
{if (! skip) (*$1)($3, $5, $7, $9, $11);} | {if (!skip) (*$1)($3, $5, $7, $9, $11);} |
VOID_FUNCTION_4STRING_2UINT VOID_FUNCTION_4STRING_2UINT
'(' tSTRING ',' tSTRING ',' tSTRING ',' tSTRING ',' INTEGER ',' INTEGER')' '(' tSTRING ',' tSTRING ',' tSTRING ',' tSTRING ',' INTEGER ',' INTEGER')'
{if (! skip) (*$1)($3, $5, $7, $9, $11, $13);} | {if (!skip) (*$1)($3, $5, $7, $9, $11, $13);} |
VOID_FUNCTION_STRING_UINT VOID_FUNCTION_STRING_UINT
'(' tSTRING ',' INTEGER ')' '(' tSTRING ',' INTEGER ')'
{if (! skip) (*$1)($3, $5);} | {if (!skip) (*$1)($3, $5);} |
VOID_FUNCTION_STRING_UINT_STRING VOID_FUNCTION_STRING_UINT_STRING
'(' tSTRING ',' INTEGER ',' tSTRING ')' '(' tSTRING ',' INTEGER ',' tSTRING ')'
{if (! skip) (*$1)($3, $5, $7);} | {if (!skip) (*$1)($3, $5, $7);} |
VOID_FUNCTION_STRING_UINT_2STRING VOID_FUNCTION_STRING_UINT_2STRING
'(' tSTRING ',' INTEGER ',' tSTRING ',' tSTRING ')' '(' tSTRING ',' INTEGER ',' tSTRING ',' tSTRING ')'
{if (! skip) (*$1)($3, $5, $7, $9);} | {if (!skip) (*$1)($3, $5, $7, $9);} |
VOID_FUNCTION_STRING_WPARAM_LPARAM VOID_FUNCTION_STRING_WPARAM_LPARAM
'(' tSTRING ',' INTEGER ',' INTEGER ')' '(' tSTRING ',' INTEGER ',' INTEGER ')'
{if (! skip) (*$1)($3, $5, $7);} | {if (!skip) (*$1)($3, $5, $7);} |
VOID_FUNCTION_UINT VOID_FUNCTION_UINT
'(' INTEGER ')' '(' INTEGER ')'
{if (! skip) (*$1)($3);} | {if (!skip) (*$1)($3);} |
VOID_FUNCTION_2UINT VOID_FUNCTION_2UINT
'(' INTEGER ',' INTEGER ')' '(' INTEGER ',' INTEGER ')'
{if (! skip) (*$1)($3, $5);} | {if (!skip) (*$1)($3, $5);} |
VOID_FUNCTION_2UINT_STRING VOID_FUNCTION_2UINT_STRING
'(' INTEGER ',' INTEGER ',' tSTRING ')' '(' INTEGER ',' INTEGER ',' tSTRING ')'
{if (! skip) (*$1)($3, $5, $7);} | {if (!skip) (*$1)($3, $5, $7);} |
VOID_FUNCTION_3UINT VOID_FUNCTION_3UINT
'(' INTEGER ',' INTEGER ',' INTEGER ')' '(' INTEGER ',' INTEGER ',' INTEGER ')'
{if (! skip) (*$1)($3, $5, $7);} | {if (!skip) (*$1)($3, $5, $7);} |
VOID_FUNCTION_2INT_3UINT_STRING VOID_FUNCTION_2INT_3UINT_STRING
'(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ',' tSTRING ')' '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ',' tSTRING ')'
{if (! skip) (*$1)($3, $5, $7, $9, $11, $13);} | {if (!skip) (*$1)($3, $5, $7, $9, $11, $13);} |
VOID_FUNCTION_FILE_WIN VOID_FUNCTION_FILE_WIN
'(' file_win ')' '(' file_win ')'
{if (! skip) (*$1)(filename, windowname);} | {if (!skip) (*$1)(filename, windowname);} |
VOID_FUNCTION_FILE_WIN_STRING VOID_FUNCTION_FILE_WIN_STRING
'(' file_win ',' tSTRING ')' '(' file_win ',' tSTRING ')'
{if (! skip) (*$1)(filename, windowname, $5);} | {if (!skip) (*$1)(filename, windowname, $5);} |
VOID_FUNCTION_FILE_WIN_UINT VOID_FUNCTION_FILE_WIN_UINT
'(' file_win ',' INTEGER ')' '(' file_win ',' INTEGER ')'
{if (! skip) (*$1)(filename, windowname, $5);} ; {if (!skip) (*$1)(filename, windowname, $5);} ;
file_win: tSTRING file_win: tSTRING
{ {

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,10 @@
/* /*
* 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
*
* 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
@ -19,16 +20,16 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#define MAX_LANGUAGE_NUMBER 255 #define MAX_LANGUAGE_NUMBER 255
#define MAX_PATHNAME_LEN 1024 #define MAX_PATHNAME_LEN 1024
#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 20 #define SHADOW_DX 10
#define SHADOW_DY 20 #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
@ -38,82 +39,92 @@
typedef struct tagHelpLinePart typedef struct tagHelpLinePart
{ {
RECT rect; RECT rect;
LPCSTR lpsText; enum {hlp_line_part_text, hlp_line_part_image} cookie;
UINT wTextLen; union
HFONT hFont; {
COLORREF color; struct
{
LPCSTR lpsText;
HFONT hFont;
COLORREF color;
WORD wTextLen;
WORD wUnderline; /* 0 None, 1 simple, 2 double, 3 dotted */
} text;
struct
{
HBITMAP hBitmap;
} image;
} u;
struct struct
{ {
LPCSTR lpszPath; LPCSTR lpszPath;
LONG lHash; LONG lHash;
BOOL bPopup; BOOL bPopup;
} link; } link;
HGLOBAL hSelf; struct tagHelpLinePart *next;
struct tagHelpLinePart *next;
} WINHELP_LINE_PART; } WINHELP_LINE_PART;
typedef struct tagHelpLine typedef struct tagHelpLine
{ {
RECT rect; RECT rect;
WINHELP_LINE_PART first_part; WINHELP_LINE_PART first_part;
struct tagHelpLine *next; struct tagHelpLine* next;
} WINHELP_LINE; } WINHELP_LINE;
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;
HGLOBAL hSelf; struct tagHelpButton*next;
struct tagHelpButton *next;
} WINHELP_BUTTON; } WINHELP_BUTTON;
typedef struct tagWinHelp typedef struct tagWinHelp
{ {
LPCSTR lpszName; LPCSTR lpszName;
WINHELP_BUTTON *first_button; WINHELP_BUTTON* first_button;
HLPFILE_PAGE *page; HLPFILE_PAGE* page;
WINHELP_LINE *first_line; WINHELP_LINE* first_line;
HWND hMainWnd; HWND hMainWnd;
HWND hButtonBoxWnd; HWND hButtonBoxWnd;
HWND hTextWnd; HWND hTextWnd;
HWND hShadowWnd; HWND hShadowWnd;
HFONT (*fonts)[2]; HFONT* fonts;
UINT fonts_len; UINT fonts_len;
HCURSOR hArrowCur; HCURSOR hArrowCur;
HCURSOR hHandCur; HCURSOR hHandCur;
HGLOBAL hSelf; struct tagWinHelp* next;
struct tagWinHelp *next;
} WINHELP_WINDOW; } WINHELP_WINDOW;
typedef struct typedef struct
{ {
UINT wVersion; UINT wVersion;
HANDLE hInstance; HANDLE hInstance;
HWND hPopupWnd; HWND hPopupWnd;
UINT wStringTableOffset; UINT wStringTableOffset;
WINHELP_WINDOW *active_win; WINHELP_WINDOW* active_win;
WINHELP_WINDOW *win_list; WINHELP_WINDOW* win_list;
} WINHELP_GLOBALS; } WINHELP_GLOBALS;
extern WINHELP_GLOBALS Globals; extern WINHELP_GLOBALS Globals;
VOID WINHELP_CreateHelpWindow(LPCSTR, LONG, LPCSTR, BOOL, HWND, LPPOINT, INT); BOOL WINHELP_CreateHelpWindowByHash(LPCSTR, LONG, LPCSTR, BOOL, HWND, LPPOINT, INT);
BOOL WINHELP_CreateHelpWindowByPage(HLPFILE_PAGE*, LPCSTR, BOOL, HWND, LPPOINT, INT);
INT WINHELP_MessageBoxIDS(UINT, UINT, WORD); INT WINHELP_MessageBoxIDS(UINT, UINT, WORD);
INT WINHELP_MessageBoxIDS_s(UINT, LPCSTR, UINT, WORD); INT WINHELP_MessageBoxIDS_s(UINT, LPCSTR, UINT, WORD);
@ -128,7 +139,3 @@ extern CHAR STRING_DIALOG_TEST[];
/* Buttons */ /* Buttons */
#define WH_FIRST_BUTTON 500 #define WH_FIRST_BUTTON 500
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */