Commit 75792878 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

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

parent 21ec1d2a
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#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"
...@@ -77,7 +78,7 @@ FORMAT format = ...@@ -77,7 +78,7 @@ FORMAT format =
}; };
CHARMAP charmap = CHARMAP charmap =
{{'', "AElig"}, {{'', "AElig"},
{'', "Aacute"}, {'', "Aacute"},
{'', "Acirc"}, {'', "Acirc"},
{'', "Agrave"}, {'', "Agrave"},
...@@ -212,7 +213,7 @@ int main(int argc, char **argv) ...@@ -212,7 +213,7 @@ int main(int argc, char **argv)
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));
...@@ -232,31 +233,39 @@ int main(int argc, char **argv) ...@@ -232,31 +233,39 @@ int main(int argc, char **argv)
/* 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)
{ {
switch (paragraph->cookie)
{
case para_normal_text:
case para_debug_text:
/* New line; new paragraph */ /* New line; new paragraph */
if (paragraph->wVSpace == 1) if (paragraph->u.text.wVSpace == 1)
printf(format.newline); printf(format.newline);
else if (paragraph->wVSpace > 1) else if (paragraph->u.text.wVSpace > 1)
printf(format.next_paragraph); 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;
} }
/*********************************************************************** /***********************************************************************
...@@ -283,29 +292,57 @@ LONG WINAPI _hread( HFILE hFile, LPVOID buffer, LONG count ) ...@@ -283,29 +292,57 @@ 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 )
{
assert(flags == 0);
return malloc(size);
}
void* WINAPI HeapReAlloc( HANDLE heap, DWORD flags, void* ptr, DWORD size)
{
assert(flags == 0);
return realloc(ptr, size);
}
BOOL WINAPI HeapFree( HGLOBAL handle, DWORD flags, void* ptr )
{
free(ptr);
return TRUE;
}
char __wine_dbch_winhelp[] = "\003winhelp";
static char * const debug_channels[1] =
{ {
return (HGLOBAL) malloc(size); __wine_dbch_winhelp
};
int wine_dbg_log( int cls, const char *channel, const char *func, const char *format, ... )
{
return 1;
} }
LPVOID WINAPI GlobalLock( HGLOBAL handle ) HBITMAP WINAPI CreateDIBitmap(HDC hdc, CONST BITMAPINFOHEADER* bih, DWORD a, CONST void* ptr, CONST BITMAPINFO* bi, UINT c)
{ {
return (LPVOID) handle; return 0;
} }
HGLOBAL WINAPI GlobalFree( HGLOBAL handle ) HDC WINAPI GetDC(HWND h)
{ {
free((VOID*) handle); return 0;
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 );
} }
...@@ -323,7 +360,7 @@ INT WINAPI lstrcmpi( LPCSTR str1, LPCSTR str2 ) ...@@ -323,7 +360,7 @@ INT WINAPI lstrcmpi( LPCSTR str1, LPCSTR 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);
} }
...@@ -334,12 +371,3 @@ 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: */
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
* 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
...@@ -25,71 +26,86 @@ typedef struct ...@@ -25,71 +26,86 @@ 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;
UINT wFont;
UINT wIndent;
UINT wHSpace;
UINT wVSpace;
HLPFILE_LINK *link; union
{
struct tagHlpFileParagraph *next; struct
{
HGLOBAL hSelf; 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;
struct tagHlpFileParagraph* next;
} 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); ...@@ -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: */
...@@ -19,15 +19,20 @@ ...@@ -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++;
...@@ -131,45 +136,47 @@ UpdateWindow|UW yylval.void_function_2string = MACRO_UpdateWindow; return VOID ...@@ -131,45 +136,47 @@ UpdateWindow|UW yylval.void_function_2string = MACRO_UpdateWindow; return VOID
[-+]?[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) \' |
<quote>\` |
<quote>\" |
<quote>\' {
if (quote_stk_idx == 0 ||
(yytext[0] == '\"' && quote_stack[quote_stk_idx - 1] != '\"') ||
(yytext[0] == '`'))
{ {
hStringBuffer = GlobalAlloc(GMEM_FIXED, strlen(macroptr)); /* opening a new one */
strptr = GlobalLock(hStringBuffer); if (quote_stk_idx == 0)
} {
strptr = HeapAlloc(GetProcessHeap(), 0, strlen(macroptr) + 1);
yylval.string = strptr; yylval.string = strptr;
BEGIN (yytext[0] == '`' ? quote : dquote); BEGIN(quote);
} }
else *strptr++ = yytext[0];
<quote>\` { quote_stack[quote_stk_idx++] = yytext[0];
*strptr++ = yytext[0]; assert(quote_stk_idx < sizeof(quote_stack) / sizeof(quote_stack[0]));
nested_quotes++;
}
<quote>\' |
<dquote>\" {
if (nested_quotes)
{
nested_quotes--;
*strptr++ = yytext[0];
} }
else else
{ {
if (yytext[0] == '`') assert(0);
/* close the current quote */
if (--quote_stk_idx == 0)
{
BEGIN INITIAL; BEGIN INITIAL;
*strptr++ = '\0'; *strptr++ = '\0';
return tSTRING; return tSTRING;
} }
else *strptr++ = yytext[0];
}
} }
<quote,dquote>. *strptr++ = yytext[0]; <quote>. *strptr++ = yytext[0];
<quote,dquote>\\. *strptr++ = yytext[1]; <quote>\\. *strptr++ = yytext[1];
<quote><<EOF>> return 0;
<quote,dquote><<EOF>> return 0;
" " " "
. return yytext[0]; . return yytext[0];
%% %%
#include "winhelp.h" #include "winhelp.h"
...@@ -186,8 +193,9 @@ static LRESULT CALLBACK MACRO_TestDialogProc(HWND hDlg, UINT msg, WPARAM wParam, ...@@ -186,8 +193,9 @@ static LRESULT CALLBACK MACRO_TestDialogProc(HWND hDlg, UINT msg, WPARAM wParam,
return FALSE; return FALSE;
} }
VOID MACRO_ExecuteMacro(LPCSTR macro) void MACRO_ExecuteMacro(LPCSTR macro)
{ {
WINE_TRACE("%s\n", wine_dbgstr_a(macro));
if (!lstrcmpi(macro, "MacroTest")) if (!lstrcmpi(macro, "MacroTest"))
{ {
WNDPROC lpfnDlg = MakeProcInstance(MACRO_TestDialogProc, Globals.hInstance); WNDPROC lpfnDlg = MakeProcInstance(MACRO_TestDialogProc, Globals.hInstance);
...@@ -200,16 +208,25 @@ VOID MACRO_ExecuteMacro(LPCSTR macro) ...@@ -200,16 +208,25 @@ VOID MACRO_ExecuteMacro(LPCSTR 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
......
...@@ -97,83 +97,83 @@ macrosep: ';' | ...@@ -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
{ {
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
* *
* 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
...@@ -25,8 +26,8 @@ ...@@ -25,8 +26,8 @@
#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
...@@ -39,10 +40,22 @@ ...@@ -39,10 +40,22 @@
typedef struct tagHelpLinePart typedef struct tagHelpLinePart
{ {
RECT rect; RECT rect;
enum {hlp_line_part_text, hlp_line_part_image} cookie;
union
{
struct
{
LPCSTR lpsText; LPCSTR lpsText;
UINT wTextLen;
HFONT hFont; HFONT hFont;
COLORREF color; COLORREF color;
WORD wTextLen;
WORD wUnderline; /* 0 None, 1 simple, 2 double, 3 dotted */
} text;
struct
{
HBITMAP hBitmap;
} image;
} u;
struct struct
{ {
...@@ -51,7 +64,6 @@ typedef struct tagHelpLinePart ...@@ -51,7 +64,6 @@ typedef struct tagHelpLinePart
BOOL bPopup; BOOL bPopup;
} link; } link;
HGLOBAL hSelf;
struct tagHelpLinePart *next; struct tagHelpLinePart *next;
} WINHELP_LINE_PART; } WINHELP_LINE_PART;
...@@ -59,7 +71,7 @@ typedef struct tagHelpLine ...@@ -59,7 +71,7 @@ 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
...@@ -74,31 +86,29 @@ typedef struct tagHelpButton ...@@ -74,31 +86,29 @@ typedef struct tagHelpButton
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
...@@ -107,13 +117,14 @@ typedef struct ...@@ -107,13 +117,14 @@ typedef struct
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[]; ...@@ -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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment