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,6 +22,7 @@
#include <time.h>
#include <ctype.h>
#include <fcntl.h>
#include <assert.h>
#include "windows.h"
#include "hlpfile.h"
@ -212,7 +213,7 @@ int main(int argc, char **argv)
hlpfile = HLPFILE_ReadHlpFile(argc > 1 ? argv[1] : "");
if (!hlpfile) return(2);
if (!hlpfile) return 2;
time(&t);
strftime(date, sizeof(date), "%x", localtime(&t));
@ -232,31 +233,39 @@ int main(int argc, char **argv)
/* Section */
printf(format.section);
for (; paragraph && !paragraph->wVSpace; paragraph = paragraph->next)
print_text(paragraph->lpszText);
for (; paragraph && !paragraph->u.text.wVSpace; paragraph = paragraph->next)
print_text(paragraph->u.text.lpszText);
printf(format.first_paragraph);
for (; paragraph; paragraph = paragraph->next)
{
switch (paragraph->cookie)
{
case para_normal_text:
case para_debug_text:
/* New line; new paragraph */
if (paragraph->wVSpace == 1)
if (paragraph->u.text.wVSpace == 1)
printf(format.newline);
else if (paragraph->wVSpace > 1)
else if (paragraph->u.text.wVSpace > 1)
printf(format.next_paragraph);
if (paragraph->wFont)
if (paragraph->u.text.wFont)
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);
break;
case para_image:
break;
}
}
}
printf(format.tail);
return(0);
return 0;
}
/***********************************************************************
@ -283,22 +292,50 @@ LONG WINAPI _hread( HFILE hFile, LPVOID buffer, LONG count )
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);
return(0);
free(ptr);
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
*
@ -334,12 +371,3 @@ LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src )
strcpy( dst, src );
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

@ -2,6 +2,7 @@
* Help Viewer
*
* Copyright 1996 Ulrich Schmid
* 2002 Eric Pouech
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -25,25 +26,34 @@ typedef struct
LPCSTR lpszPath;
LONG lHash;
BOOL bPopup;
HGLOBAL hSelf;
} HLPFILE_LINK;
enum para_type {para_normal_text, para_debug_text, para_image};
typedef struct tagHlpFileParagraph
{
LPSTR lpszText;
enum para_type cookie;
UINT bDebug;
UINT wFont;
UINT wIndent;
UINT wHSpace;
UINT wVSpace;
union
{
struct
{
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;
HGLOBAL hSelf;
} HLPFILE_PARAGRAPH;
typedef struct tagHlpFilePage
@ -51,45 +61,51 @@ typedef struct tagHlpFilePage
LPSTR lpszTitle;
HLPFILE_PARAGRAPH* first_paragraph;
UINT wNumber;
unsigned wNumber;
unsigned offset;
struct tagHlpFilePage* next;
struct tagHlpFilePage* prev;
struct tagHlpFileFile* file;
HGLOBAL hSelf;
} HLPFILE_PAGE;
typedef struct
{
LONG lHash;
UINT wPage;
unsigned long offset;
} HLPFILE_CONTEXT;
typedef struct tagHlpFileMacro
{
LPCSTR lpszMacro;
HGLOBAL hSelf;
struct tagHlpFileMacro* next;
} HLPFILE_MACRO;
typedef struct
{
LOGFONT LogFont;
HFONT hFont;
COLORREF color;
} HLPFILE_FONT;
typedef struct tagHlpFileFile
{
LPSTR lpszPath;
LPSTR lpszTitle;
HLPFILE_PAGE* first_page;
HLPFILE_MACRO* first_macro;
UINT wContextLen;
unsigned wContextLen;
HLPFILE_CONTEXT* Context;
struct tagHlpFileFile* prev;
struct tagHlpFileFile* next;
UINT wRefCount;
unsigned wRefCount;
HGLOBAL hTitle;
HGLOBAL hContext;
HGLOBAL hSelf;
unsigned short version;
unsigned short flags;
unsigned hasPhrases; /* Phrases or PhrIndex/PhrImage */
unsigned numFonts;
HLPFILE_FONT* fonts;
} HLPFILE;
HLPFILE *HLPFILE_ReadHlpFile(LPCSTR lpszPath);
@ -98,7 +114,3 @@ HLPFILE_PAGE *HLPFILE_PageByHash(LPCSTR lpszPath, LONG wNum);
LONG HLPFILE_Hash(LPCSTR lpszContext);
VOID HLPFILE_FreeHlpFilePage(HLPFILE_PAGE*);
VOID HLPFILE_FreeHlpFile(HLPFILE*);
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */

View File

@ -18,84 +18,87 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include "windows.h"
#include "commdlg.h"
#include "winhelp.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_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;
for (win = Globals.win_list; win; win = win->next)
@ -103,7 +106,7 @@ VOID MACRO_CloseSecondarys(VOID)
DestroyWindow(win->hMainWnd);
}
VOID MACRO_CloseWindow(LPCSTR lpszWindow)
void MACRO_CloseWindow(LPCSTR lpszWindow)
{
WINHELP_WINDOW *win;
if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main";
@ -113,51 +116,48 @@ VOID MACRO_CloseWindow(LPCSTR lpszWindow)
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)
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_BUTTON *button, **b;
LONG size;
HGLOBAL handle;
LPSTR ptr;
size = sizeof(WINHELP_BUTTON) + lstrlen(id) + lstrlen(name) + lstrlen(macro) + 3;
handle = GlobalAlloc(GMEM_FIXED, size);
if (!handle) return;
button = GlobalLock(handle);
button->hSelf = handle;
button = HeapAlloc(GetProcessHeap(), 0, size);
if (!button) return;
button->next = 0;
button->hWnd = 0;
ptr = GlobalLock(handle);
ptr += sizeof(WINHELP_BUTTON);
ptr = (char*)button + sizeof(WINHELP_BUTTON);
lstrcpy(ptr, (LPSTR) id);
button->lpszID = ptr;
@ -178,84 +178,84 @@ VOID MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro)
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)
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)
{
fprintf(stderr, "FileExist(\"%s\")\n", str);
WINE_FIXME("FileExist(\"%s\")\n", str);
return TRUE;
}
VOID MACRO_FileOpen(VOID)
void MACRO_FileOpen(void)
{
OPENFILENAME openfilename;
CHAR szPath[MAX_PATHNAME_LEN];
@ -299,179 +299,181 @@ VOID MACRO_FileOpen(VOID)
openfilename.lpTemplateName = 0;
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);
}
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;
}
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;
}
BOOL MACRO_IsMark(LPCSTR str)
{
fprintf(stderr, "IsMark(\"%s\")\n", str);
WINE_FIXME("IsMark(\"%s\")\n", str);
return FALSE;
}
BOOL MACRO_IsNotMark(LPCSTR str)
{
fprintf(stderr, "IsNotMark(\"%s\")\n", str);
WINE_FIXME("IsNotMark(\"%s\")\n", str);
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));
}
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;
@ -496,97 +498,93 @@ VOID MACRO_Print(VOID)
printer.hSetupTemplate = 0;
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)
{
fprintf(stderr, "TestALink(\"%s\")\n", str);
WINE_FIXME("TestALink(\"%s\")\n", str);
return FALSE;
}
BOOL MACRO_TestKLink(LPCSTR str)
{
fprintf(stderr, "TestKLink(\"%s\")\n", str);
WINE_FIXME("TestKLink(\"%s\")\n", str);
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
*/
%}
%x quote dquote
%x quote
%{
#include <assert.h>
#include "macro.h"
#include "y.tab.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(winhelp);
static LPCSTR macroptr;
static LPSTR strptr;
static HGLOBAL hStringBuffer = 0;
static INT nested_quotes = 0;
static int quote_stack[32];
static int quote_stk_idx = 0;
#define YY_INPUT(buf,result,max_size)\
if ((result = *macroptr ? 1 : 0)) buf[0] = *macroptr++;
@ -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[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));
strptr = GlobalLock(hStringBuffer);
}
/* opening a new one */
if (quote_stk_idx == 0)
{
strptr = HeapAlloc(GetProcessHeap(), 0, strlen(macroptr) + 1);
yylval.string = strptr;
BEGIN (yytext[0] == '`' ? quote : dquote);
BEGIN(quote);
}
<quote>\` {
*strptr++ = yytext[0];
nested_quotes++;
}
<quote>\' |
<dquote>\" {
if (nested_quotes)
{
nested_quotes--;
*strptr++ = yytext[0];
else *strptr++ = yytext[0];
quote_stack[quote_stk_idx++] = yytext[0];
assert(quote_stk_idx < sizeof(quote_stack) / sizeof(quote_stack[0]));
}
else
{
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,dquote>. *strptr++ = yytext[0];
<quote,dquote>\\. *strptr++ = yytext[1];
<quote,dquote><<EOF>> return 0;
<quote>. *strptr++ = yytext[0];
<quote>\\. *strptr++ = yytext[1];
<quote><<EOF>> return 0;
" "
. return yytext[0];
%%
#include "winhelp.h"
@ -186,8 +193,9 @@ static LRESULT CALLBACK MACRO_TestDialogProc(HWND hDlg, UINT msg, WPARAM wParam,
return FALSE;
}
VOID MACRO_ExecuteMacro(LPCSTR macro)
void MACRO_ExecuteMacro(LPCSTR macro)
{
WINE_TRACE("%s\n", wine_dbgstr_a(macro));
if (!lstrcmpi(macro, "MacroTest"))
{
WNDPROC lpfnDlg = MakeProcInstance(MACRO_TestDialogProc, Globals.hInstance);
@ -200,16 +208,25 @@ VOID MACRO_ExecuteMacro(LPCSTR macro)
yyparse();
if (hStringBuffer) GlobalFree(hStringBuffer);
hStringBuffer = 0;
if (strptr)
{
HeapFree(GetProcessHeap(), 0, strptr);
strptr = NULL;
}
quote_stk_idx = 0;
}
void yyerror(const char *s)
{
fprintf(stderr, "%s\n", s);
nested_quotes = 0;
WINE_WARN("Error while parsing: %s\n", s);
BEGIN INITIAL;
yyrestart(yyin);
if (strptr)
{
HeapFree(GetProcessHeap(), 0, strptr);
strptr = NULL;
}
quote_stk_idx = 0;
}
#ifndef yywrap

View File

@ -2,7 +2,8 @@
* Help Viewer
*
* Copyright 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
* Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
* 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
* 2002 Eric Pouech <eric.pouech@wanadoo.fr>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -22,23 +23,25 @@
#include <stdio.h>
#include <string.h>
#include "winbase.h"
#include "wingdi.h"
#include "windowsx.h"
#include "winhelp.h"
#include "winhelp_res.h"
static BOOL WINHELP_RegisterWinClasses();
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(winhelp);
static BOOL WINHELP_RegisterWinClasses(void);
static LRESULT CALLBACK WINHELP_MainWndProc(HWND, UINT, WPARAM, LPARAM);
static LRESULT CALLBACK WINHELP_TextWndProc(HWND, UINT, WPARAM, LPARAM);
static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND, UINT, WPARAM, LPARAM);
static VOID WINHELP_CheckPopup(UINT);
static void WINHELP_CheckPopup(UINT);
static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE);
static VOID WINHELP_InitFonts(HWND hWnd);
static VOID WINHELP_DeleteLines(WINHELP_WINDOW*);
static VOID WINHELP_DeleteWindow(WINHELP_WINDOW*);
static VOID WINHELP_SetupText(HWND hWnd);
static BOOL WINHELP_AppendText(WINHELP_LINE***, WINHELP_LINE_PART***,
LPSIZE, LPSIZE, INT*, INT, LPCSTR, UINT,
HFONT, COLORREF, HLPFILE_LINK*);
static void WINHELP_InitFonts(HWND hWnd);
static void WINHELP_DeleteLines(WINHELP_WINDOW*);
static void WINHELP_DeleteWindow(WINHELP_WINDOW*);
static void WINHELP_SetupText(HWND hWnd);
static WINHELP_LINE_PART* WINHELP_IsOverLink(HWND hWnd, WPARAM wParam, LPARAM lParam);
WINHELP_GLOBALS Globals = {3, 0, 0, 0, 0, 0};
@ -49,7 +52,6 @@ static BOOL MacroTest = FALSE;
*
* WinMain
*/
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
{
MSG msg;
@ -90,7 +92,7 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
/* Create primary window */
WINHELP_RegisterWinClasses();
WINHELP_CreateHelpWindow(cmdline, lHash, "main", FALSE, NULL, NULL, show);
WINHELP_CreateHelpWindowByHash(cmdline, lHash, "main", FALSE, NULL, NULL, show);
/* Message loop */
while (GetMessage(&msg, 0, 0, 0))
@ -105,8 +107,7 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
*
* RegisterWinClasses
*/
static BOOL WINHELP_RegisterWinClasses()
static BOOL WINHELP_RegisterWinClasses(void)
{
WNDCLASS class_main, class_button_box, class_text, class_shadow;
@ -146,7 +147,7 @@ static BOOL WINHELP_RegisterWinClasses()
* WINHELP_CreateHelpWindow
*/
VOID WINHELP_CreateHelpWindow(LPCSTR lpszFile, LONG lHash, LPCSTR lpszWindow,
static BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE* page, LPCSTR lpszWindow,
BOOL bPopup, HWND hParentWnd, LPPOINT mouse, INT nCmdShow)
{
CHAR szCaption[MAX_STRING_LEN];
@ -154,12 +155,10 @@ VOID WINHELP_CreateHelpWindow(LPCSTR lpszFile, LONG lHash, LPCSTR lpszWindow,
CHAR szSearch[MAX_STRING_LEN];
CHAR szBack[MAX_STRING_LEN];
CHAR szHistory[MAX_STRING_LEN];
SIZE size = {CW_USEDEFAULT, CW_USEDEFAULT};
SIZE size = {CW_USEDEFAULT, 0/*CW_USEDEFAULT*/};
POINT origin = {240, 0};
LPSTR ptr;
HGLOBAL handle;
WINHELP_WINDOW *win, *oldwin;
HLPFILE_PAGE *page;
HLPFILE_MACRO *macro;
HWND hWnd;
BOOL bPrimary;
@ -170,36 +169,13 @@ VOID WINHELP_CreateHelpWindow(LPCSTR lpszFile, LONG lHash, LPCSTR lpszWindow,
lpszWindow = Globals.active_win->lpszName;
bPrimary = lpszWindow && !lstrcmpi(lpszWindow, "main");
/* Read help file */
if (lpszFile[0])
{
page = lHash ? HLPFILE_PageByHash(lpszFile, lHash) : HLPFILE_Contents(lpszFile);
/* Add Suffix `.hlp' */
if (!page && lstrcmpi(lpszFile + strlen(lpszFile) - 4, ".hlp"))
{
CHAR szFile_hlp[MAX_PATHNAME_LEN];
lstrcpyn(szFile_hlp, lpszFile, sizeof(szFile_hlp) - 4);
szFile_hlp[sizeof(szFile_hlp) - 5] = '\0';
lstrcat(szFile_hlp, ".hlp");
page = lHash ? HLPFILE_PageByHash(szFile_hlp, lHash) : HLPFILE_Contents(szFile_hlp);
if (!page)
{
WINHELP_MessageBoxIDS_s(HLPFILE_ERROR_s, lpszFile, WHERROR, MB_OK);
if (Globals.win_list) return;
}
}
}
else page = 0;
/* Calculate horizontal size and position of a popup window */
if (bPopup)
{
RECT parent_rect;
GetWindowRect(hParentWnd, &parent_rect);
size.cx = (parent_rect.right - parent_rect.left) / 2;
size.cy = 10; /* need a non null value, so that border are taken into account while computing */
origin = *mouse;
ClientToScreen(hParentWnd, &origin);
@ -209,17 +185,15 @@ VOID WINHELP_CreateHelpWindow(LPCSTR lpszFile, LONG lHash, LPCSTR lpszWindow,
}
/* Initialize WINHELP_WINDOW struct */
handle = GlobalAlloc(GMEM_FIXED, sizeof(WINHELP_WINDOW) +
(lpszWindow ? strlen(lpszWindow) + 1 : 0));
if (!handle) return;
win = GlobalLock(handle);
win->hSelf = handle;
win = HeapAlloc(GetProcessHeap(), 0,
sizeof(WINHELP_WINDOW) + (lpszWindow ? strlen(lpszWindow) + 1 : 0));
if (!win) return FALSE;
win->next = Globals.win_list;
Globals.win_list = win;
if (lpszWindow)
{
ptr = GlobalLock(handle);
ptr += sizeof(WINHELP_WINDOW);
ptr = (char*)win + sizeof(WINHELP_WINDOW);
lstrcpy(ptr, (LPSTR) lpszWindow);
win->lpszName = ptr;
}
@ -290,7 +264,7 @@ VOID WINHELP_CreateHelpWindow(LPCSTR lpszFile, LONG lHash, LPCSTR lpszWindow,
DestroyWindow(button->hWnd);
WINHELP_DeleteWindow(oldwin);
return;
return TRUE;
}
/* Create main Window */
@ -304,13 +278,60 @@ VOID WINHELP_CreateHelpWindow(LPCSTR lpszFile, LONG lHash, LPCSTR lpszWindow,
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
/***********************************************************************
*
* WINHELP_CreateHelpWindowByPage
*/
BOOL WINHELP_CreateHelpWindowByPage(HLPFILE_PAGE* page, LPCSTR lpszWindow,
BOOL bPopup, HWND hParentWnd, LPPOINT mouse, INT nCmdShow)
{
if (page) page->file->wRefCount++;
return WINHELP_CreateHelpWindow(page, lpszWindow, bPopup, hParentWnd, mouse, nCmdShow);
}
/***********************************************************************
*
* WINHELP_CreateHelpWindowByHash
*/
BOOL WINHELP_CreateHelpWindowByHash(LPCSTR lpszFile, LONG lHash, LPCSTR lpszWindow,
BOOL bPopup, HWND hParentWnd, LPPOINT mouse, INT nCmdShow)
{
HLPFILE_PAGE* page;
/* Read help file */
if (lpszFile[0])
{
page = lHash ? HLPFILE_PageByHash(lpszFile, lHash) : HLPFILE_Contents(lpszFile);
/* Add Suffix `.hlp' */
if (!page && lstrcmpi(lpszFile + strlen(lpszFile) - 4, ".hlp"))
{
CHAR szFile_hlp[MAX_PATHNAME_LEN];
lstrcpyn(szFile_hlp, lpszFile, sizeof(szFile_hlp) - 4);
szFile_hlp[sizeof(szFile_hlp) - 5] = '\0';
lstrcat(szFile_hlp, ".hlp");
page = lHash ? HLPFILE_PageByHash(szFile_hlp, lHash) : HLPFILE_Contents(szFile_hlp);
if (!page)
{
WINHELP_MessageBoxIDS_s(HLPFILE_ERROR_s, lpszFile, WHERROR, MB_OK);
if (Globals.win_list) return FALSE;
}
}
}
else page = NULL;
return WINHELP_CreateHelpWindowByPage(page, lpszWindow, bPopup, hParentWnd, mouse, nCmdShow);
}
/***********************************************************************
*
* WINHELP_MainWndProc
*/
static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
WINHELP_WINDOW *win;
@ -399,6 +420,9 @@ static LRESULT CALLBACK WINHELP_MainWndProc (HWND hWnd, UINT msg, WPARAM wParam,
break;
}
break;
case WM_DESTROY:
if (Globals.hPopupWnd) DestroyWindow(Globals.hPopupWnd);
break;
}
return DefWindowProc(hWnd, msg, wParam, lParam);
@ -408,7 +432,6 @@ static LRESULT CALLBACK WINHELP_MainWndProc (HWND hWnd, UINT msg, WPARAM wParam,
*
* WINHELP_ButtonBoxWndProc
*/
static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
WINDOWPOS *winpos;
@ -472,14 +495,13 @@ static LRESULT CALLBACK WINHELP_ButtonBoxWndProc (HWND hWnd, UINT msg, WPARAM wP
break;
}
return(DefWindowProc(hWnd, msg, wParam, lParam));
return DefWindowProc(hWnd, msg, wParam, lParam);
}
/***********************************************************************
*
* WINHELP_TextWndProc
*/
static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
WINHELP_WINDOW *win;
@ -542,20 +564,23 @@ static LRESULT CALLBACK WINHELP_TextWndProc (HWND hWnd, UINT msg, WPARAM wParam,
new_window_size.cy = old_window_size.cy - old_client_size.cy + new_client_size.cy;
win->hShadowWnd =
CreateWindow(SHADOW_WIN_CLASS_NAME, "", WS_POPUP | WS_VISIBLE,
CreateWindow(SHADOW_WIN_CLASS_NAME, "", WS_POPUP,
origin.x + SHADOW_DX, origin.y + SHADOW_DY,
new_window_size.cx, new_window_size.cy,
0, 0, Globals.hInstance, 0);
SetWindowPos(hWnd, HWND_TOP, origin.x, origin.y,
new_window_size.cx, new_window_size.cy,
SWP_NOZORDER | SWP_NOACTIVATE);
0);
SetWindowPos(win->hShadowWnd, hWnd, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
ShowWindow(win->hShadowWnd, SW_NORMAL);
SetActiveWindow(hWnd);
}
break;
case WM_WINDOWPOSCHANGED:
winpos = (WINDOWPOS*) lParam;
if (!(winpos->flags & SWP_NOSIZE)) WINHELP_SetupText(hWnd);
break;
@ -596,12 +621,59 @@ static LRESULT CALLBACK WINHELP_TextWndProc (HWND hWnd, UINT msg, WPARAM wParam,
scroll_pos = GetScrollPos(hWnd, SB_VERT);
for (line = win->first_line; line; line = line->next)
{
for (part = &line->first_part; part; part = part->next)
{
SelectObject(hDc, part->hFont);
SetTextColor(hDc, part->color);
switch (part->cookie)
{
case hlp_line_part_text:
SelectObject(hDc, part->u.text.hFont);
SetTextColor(hDc, part->u.text.color);
TextOut(hDc, part->rect.left, part->rect.top - scroll_pos,
(LPSTR) part->lpsText, part->wTextLen);
part->u.text.lpsText, part->u.text.wTextLen);
if (part->u.text.wUnderline)
{
HPEN hPen;
switch (part->u.text.wUnderline)
{
case 1: /* simple */
case 2: /* double */
hPen = CreatePen(PS_SOLID, 1, part->u.text.color);
break;
case 3: /* dotted */
hPen = CreatePen(PS_DOT, 1, part->u.text.color);
break;
default:
WINE_FIXME("Unknow underline type\n");
continue;
}
SelectObject(hDc, hPen);
MoveToEx(hDc, part->rect.left, part->rect.bottom - scroll_pos - 1, NULL);
LineTo(hDc, part->rect.right, part->rect.bottom - scroll_pos - 1);
if (part->u.text.wUnderline == 2)
{
MoveToEx(hDc, part->rect.left, part->rect.bottom - scroll_pos + 1, NULL);
LineTo(hDc, part->rect.right, part->rect.bottom - scroll_pos + 1);
}
DeleteObject(hPen);
}
break;
case hlp_line_part_image:
{
HDC hMemDC;
hMemDC = CreateCompatibleDC(hDc);
SelectObject(hMemDC, part->u.image.hBitmap);
BitBlt(hDc, part->rect.left, part->rect.top - scroll_pos,
part->rect.right - part->rect.left, part->rect.bottom - part->rect.top,
hMemDC, 0, 0, SRCCOPY);
DeleteDC(hMemDC);
}
break;
}
}
}
EndPaint(hWnd, &ps);
@ -629,7 +701,7 @@ static LRESULT CALLBACK WINHELP_TextWndProc (HWND hWnd, UINT msg, WPARAM wParam,
mouse.x = LOWORD(lParam);
mouse.y = HIWORD(lParam);
WINHELP_CreateHelpWindow(part->link.lpszPath, part->link.lHash, NULL,
WINHELP_CreateHelpWindowByHash(part->link.lpszPath, part->link.lHash, NULL,
part->link.bPopup, hWnd, &mouse, SW_NORMAL);
}
@ -641,6 +713,7 @@ static LRESULT CALLBACK WINHELP_TextWndProc (HWND hWnd, UINT msg, WPARAM wParam,
win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0);
if (hWnd == Globals.hPopupWnd) Globals.hPopupWnd = 0;
if (win->hShadowWnd) DestroyWindow(win->hShadowWnd);
bExit = (Globals.wVersion >= 4 && !lstrcmpi(win->lpszName, "main"));
@ -660,8 +733,7 @@ static LRESULT CALLBACK WINHELP_TextWndProc (HWND hWnd, UINT msg, WPARAM wParam,
*
* SetupText
*/
static VOID WINHELP_SetupText(HWND hWnd)
static void WINHELP_SetupText(HWND hWnd)
{
HDC hDc = GetDC(hWnd);
RECT rect;
@ -681,11 +753,185 @@ static VOID WINHELP_SetupText(HWND hWnd)
ReleaseDC(hWnd, hDc);
}
/***********************************************************************
*
* WINHELP_AppendText
*/
static BOOL WINHELP_AppendText(WINHELP_LINE ***linep, WINHELP_LINE_PART ***partp,
LPSIZE space, LPSIZE textsize,
INT *line_ascent, INT ascent,
LPCSTR text, UINT textlen,
HFONT font, COLORREF color, HLPFILE_LINK *link,
unsigned underline)
{
WINHELP_LINE *line;
WINHELP_LINE_PART *part;
LPSTR ptr;
if (!*partp) /* New line */
{
*line_ascent = ascent;
line = HeapAlloc(GetProcessHeap(), 0,
sizeof(WINHELP_LINE) + textlen + (link ? lstrlen(link->lpszPath) + 1 : 0));
if (!line) return FALSE;
line->next = 0;
part = &line->first_part;
ptr = (char*)line + sizeof(WINHELP_LINE);
line->rect.top = (**linep ? (**linep)->rect.bottom : 0) + space->cy;
line->rect.bottom = line->rect.top;
line->rect.left = space->cx;
line->rect.right = space->cx;
if (**linep) *linep = &(**linep)->next;
**linep = line;
space->cy = 0;
}
else /* Same line */
{
line = **linep;
if (*line_ascent < ascent)
{
WINHELP_LINE_PART *p;
for (p = &line->first_part; p; p = p->next)
{
p->rect.top += ascent - *line_ascent;
p->rect.bottom += ascent - *line_ascent;
}
line->rect.bottom += ascent - *line_ascent;
*line_ascent = ascent;
}
part = HeapAlloc(GetProcessHeap(), 0,
sizeof(WINHELP_LINE_PART) + textlen +
(link ? lstrlen(link->lpszPath) + 1 : 0));
if (!part) return FALSE;
**partp = part;
ptr = (char*)part + sizeof(WINHELP_LINE_PART);
}
memcpy(ptr, text, textlen);
part->cookie = hlp_line_part_text;
part->rect.left = line->rect.right + (*partp ? space->cx : 0);
part->rect.right = part->rect.left + textsize->cx;
line->rect.right = part->rect.right;
part->rect.top =
((*partp) ? line->rect.top : line->rect.bottom) + *line_ascent - ascent;
part->rect.bottom = part->rect.top + textsize->cy;
line->rect.bottom = max(line->rect.bottom, part->rect.bottom);
part->u.text.lpsText = ptr;
part->u.text.wTextLen = textlen;
part->u.text.hFont = font;
part->u.text.color = color;
part->u.text.wUnderline = underline;
WINE_TRACE("Appended text '%*.*s'[%d] @ (%d,%d-%d,%d)\n",
part->u.text.wTextLen,
part->u.text.wTextLen,
part->u.text.lpsText,
part->u.text.wTextLen,
part->rect.left, part->rect.top, part->rect.right, part->rect.bottom);
if (link)
{
strcpy(ptr + textlen, link->lpszPath);
part->link.lpszPath = ptr + textlen;
part->link.lHash = link->lHash;
part->link.bPopup = link->bPopup;
}
else part->link.lpszPath = 0;
part->next = 0;
*partp = &part->next;
space->cx = 0;
return TRUE;
}
/***********************************************************************
*
* WINHELP_AppendBitmap
*/
static BOOL WINHELP_AppendBitmap(WINHELP_LINE ***linep, WINHELP_LINE_PART ***partp,
LPSIZE space,
HBITMAP hBmp, LPSIZE bmpSize,
HLPFILE_LINK *link, unsigned pos)
{
WINHELP_LINE *line;
WINHELP_LINE_PART *part;
LPSTR ptr;
if (!*partp || pos == 1) /* New line */
{
line = HeapAlloc(GetProcessHeap(), 0,
sizeof(WINHELP_LINE) + (link ? lstrlen(link->lpszPath) + 1 : 0));
if (!line) return FALSE;
line->next = NULL;
part = &line->first_part;
line->rect.top = (**linep ? (**linep)->rect.bottom : 0) + space->cy;
line->rect.bottom = line->rect.top;
line->rect.left = space->cx;
line->rect.right = space->cx;
if (**linep) *linep = &(**linep)->next;
**linep = line;
space->cy = 0;
ptr = (char*)line + sizeof(WINHELP_LINE);
}
else /* Same line */
{
if (pos == 2) WINE_FIXME("Left alignment not handled\n");
line = **linep;
part = HeapAlloc(GetProcessHeap(), 0,
sizeof(WINHELP_LINE_PART) +
(link ? lstrlen(link->lpszPath) + 1 : 0));
if (!part) return FALSE;
**partp = part;
ptr = (char*)part + sizeof(WINHELP_LINE_PART);
}
part->cookie = hlp_line_part_image;
part->rect.left = line->rect.right + (*partp ? space->cx : 0);
part->rect.right = part->rect.left + bmpSize->cx;
line->rect.right = part->rect.right;
part->rect.top =
((*partp) ? line->rect.top : line->rect.bottom);
part->rect.bottom = part->rect.top + bmpSize->cy;
line->rect.bottom = max(line->rect.bottom, part->rect.bottom);
part->u.image.hBitmap = hBmp;
WINE_TRACE("Appended bitmap '%d' @ (%d,%d-%d,%d)\n",
(unsigned)part->u.image.hBitmap,
part->rect.left, part->rect.top, part->rect.right, part->rect.bottom);
if (link)
{
strcpy(ptr, link->lpszPath);
part->link.lpszPath = ptr;
part->link.lHash = link->lHash;
part->link.bPopup = link->bPopup;
}
else part->link.lpszPath = 0;
part->next = NULL;
*partp = &part->next;
space->cx = 0;
return TRUE;
}
/***********************************************************************
*
* WINHELP_SplitLines
*/
static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE newsize)
{
WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0);
@ -710,51 +956,76 @@ static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE newsize)
rect.right -= INTERNAL_BORDER_WIDTH;
rect.bottom -= INTERNAL_BORDER_WIDTH;
space.cy = rect.top;
space.cx = rect.left;
hDc = GetDC(hWnd);
for (p = win->page->first_paragraph; p; p = p->next)
{
switch (p->cookie)
{
case para_normal_text:
case para_debug_text:
{
TEXTMETRIC tm;
SIZE textsize = {0, 0};
LPCSTR text = p->lpszText;
UINT len = strlen(text);
LPCSTR text = p->u.text.lpszText;
UINT indent = 0;
UINT len = strlen(text);
unsigned underline = 0;
UINT wFont = (p->wFont < win->fonts_len) ? p->wFont : 0;
BOOL bUnderline = p->link && !p->link->bPopup;
HFONT hFont = win->fonts[wFont][bUnderline ? 1 : 0];
HFONT hFont = 0;
COLORREF color = RGB(0, 0, 0);
if (p->link) color = RGB(0, 0x80, 0);
if (p->bDebug) color = RGB(0xff, 0, 0);
if (p->u.text.wFont < win->page->file->numFonts)
{
HLPFILE* hlpfile = win->page->file;
if (!hlpfile->fonts[p->u.text.wFont].hFont)
hlpfile->fonts[p->u.text.wFont].hFont = CreateFontIndirect(&hlpfile->fonts[p->u.text.wFont].LogFont);
hFont = hlpfile->fonts[p->u.text.wFont].hFont;
color = hlpfile->fonts[p->u.text.wFont].color;
}
else
{
UINT wFont = (p->u.text.wFont < win->fonts_len) ? p->u.text.wFont : 0;
hFont = win->fonts[wFont];
}
if (p->link)
{
underline = (p->link->bPopup) ? 3 : 1;
color = RGB(0, 0x80, 0);
}
if (p->cookie == para_debug_text) color = RGB(0xff, 0, 0);
SelectObject(hDc, hFont);
GetTextMetrics(hDc, &tm);
if (p->wIndent)
if (p->u.text.wIndent)
{
indent = p->wIndent * 5 * tm.tmAveCharWidth;
indent = p->u.text.wIndent * 5 * tm.tmAveCharWidth;
if (!part)
space.cx = rect.left + indent - 2 * tm.tmAveCharWidth;
}
if (p->wVSpace)
if (p->u.text.wVSpace)
{
part = 0;
space.cx = rect.left + indent;
space.cy += (p->wVSpace - 1) * tm.tmHeight;
space.cy += (p->u.text.wVSpace - 1) * tm.tmHeight;
}
if (p->wHSpace)
if (p->u.text.wHSpace)
{
space.cx += p->wHSpace * 2 * tm.tmAveCharWidth;
space.cx += p->u.text.wHSpace * 2 * tm.tmAveCharWidth;
}
WINE_TRACE("splitting text %s\n", text);
while (len)
{
INT free_width = rect.right - (part ? (*line)->rect.right : rect.left) - space.cx;
@ -788,9 +1059,11 @@ static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE newsize)
continue;
}
WINE_TRACE("\t => %d %*s\n", textlen, textlen, text);
if (!WINHELP_AppendText(&line, &part, &space, &textsize,
&line_ascent, tm.tmAscent,
text, textlen, hFont, color, p->link) ||
text, textlen, hFont, color, p->link, underline) ||
(!newsize && (*line)->rect.bottom > rect.bottom))
{
ReleaseDC(hWnd, hDc);
@ -805,6 +1078,43 @@ static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE newsize)
if (text[0] == ' ') text++, len--;
}
}
break;
case para_image:
{
DIBSECTION dibs;
SIZE bmpSize;
INT free_width;
if (p->u.image.pos & 0x8000)
{
space.cx = rect.left;
space.cy += (*line)->rect.bottom - (*line)->rect.top;
part = 0;
}
GetObject(p->u.image.hBitmap, sizeof(dibs), &dibs);
bmpSize.cx = dibs.dsBm.bmWidth;
bmpSize.cy = dibs.dsBm.bmHeight;
free_width = rect.right - (part ? (*line)->rect.right : rect.left) - space.cx;
if (free_width <= 0)
{
part = NULL;
space.cx = rect.left;
space.cx = min(space.cx, rect.right - rect.left - 1);
}
if (!WINHELP_AppendBitmap(&line, &part, &space,
p->u.image.hBitmap, &bmpSize,
p->link, p->u.image.pos) ||
(!newsize && (*line)->rect.bottom > rect.bottom))
{
return FALSE;
}
}
break;
}
}
if (newsize)
newsize->cy = (*line)->rect.bottom + INTERNAL_BORDER_WIDTH;
@ -813,105 +1123,11 @@ static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE newsize)
return TRUE;
}
/***********************************************************************
*
* WINHELP_AppendText
*/
static BOOL WINHELP_AppendText(WINHELP_LINE ***linep, WINHELP_LINE_PART ***partp,
LPSIZE space, LPSIZE textsize,
INT *line_ascent, INT ascent,
LPCSTR text, UINT textlen,
HFONT font, COLORREF color, HLPFILE_LINK *link)
{
HGLOBAL handle;
WINHELP_LINE *line;
WINHELP_LINE_PART *part;
LPSTR ptr;
if (!*partp) /* New line */
{
*line_ascent = ascent;
handle = GlobalAlloc(GMEM_FIXED, sizeof(WINHELP_LINE) + textlen +
(link ? lstrlen(link->lpszPath) + 1 : 0));
if (!handle) return FALSE;
line = GlobalLock(handle);
line->next = 0;
part = &line->first_part;
ptr = GlobalLock(handle);
ptr += sizeof(WINHELP_LINE);
line->rect.top = (**linep ? (**linep)->rect.bottom : 0) + space->cy;
line->rect.bottom = line->rect.top;
line->rect.left = space->cx;
line->rect.right = space->cx;
if (**linep) *linep = &(**linep)->next;
**linep = line;
space->cy = 0;
}
else /* Same line */
{
line = **linep;
if (*line_ascent < ascent)
{
WINHELP_LINE_PART *p;
for (p = &line->first_part; p; p = p->next)
{
p->rect.top += ascent - *line_ascent;
p->rect.bottom += ascent - *line_ascent;
}
line->rect.bottom += ascent - *line_ascent;
*line_ascent = ascent;
}
handle = GlobalAlloc(GMEM_FIXED, sizeof(WINHELP_LINE_PART) + textlen +
(link ? lstrlen(link->lpszPath) + 1 : 0));
if (!handle) return FALSE;
part = GlobalLock(handle);
**partp = part;
ptr = GlobalLock(handle);
ptr += sizeof(WINHELP_LINE_PART);
}
memcpy(ptr, text, textlen);
part->rect.left = line->rect.right + (*partp ? space->cx : 0);
part->rect.right = part->rect.left + textsize->cx;
line->rect.right = part->rect.right;
part->rect.top =
((*partp) ? line->rect.top : line->rect.bottom) + *line_ascent - ascent;
part->rect.bottom = part->rect.top + textsize->cy;
line->rect.bottom = max(line->rect.bottom, part->rect.bottom);
part->hSelf = handle;
part->lpsText = ptr;
part->wTextLen = textlen;
part->hFont = font;
part->color = color;
if (link)
{
strcpy(ptr + textlen, link->lpszPath);
part->link.lpszPath = ptr + textlen;
part->link.lHash = link->lHash;
part->link.bPopup = link->bPopup;
}
else part->link.lpszPath = 0;
part->next = 0;
*partp = &part->next;
space->cx = 0;
return TRUE;
}
/***********************************************************************
*
* WINHELP_CheckPopup
*/
static VOID WINHELP_CheckPopup(UINT msg)
static void WINHELP_CheckPopup(UINT msg)
{
if (!Globals.hPopupWnd) return;
@ -933,8 +1149,7 @@ static VOID WINHELP_CheckPopup(UINT msg)
*
* WINHELP_DeleteLines
*/
static VOID WINHELP_DeleteLines(WINHELP_WINDOW *win)
static void WINHELP_DeleteLines(WINHELP_WINDOW *win)
{
WINHELP_LINE *line, *next_line;
WINHELP_LINE_PART *part, *next_part;
@ -944,7 +1159,7 @@ static VOID WINHELP_DeleteLines(WINHELP_WINDOW *win)
for (part = &line->first_part; part; part = next_part)
{
next_part = part->next;
GlobalFree(part->hSelf);
HeapFree(GetProcessHeap(), 0, part);
}
}
win->first_line = 0;
@ -954,8 +1169,7 @@ static VOID WINHELP_DeleteLines(WINHELP_WINDOW *win)
*
* WINHELP_DeleteWindow
*/
static VOID WINHELP_DeleteWindow(WINHELP_WINDOW *win)
static void WINHELP_DeleteWindow(WINHELP_WINDOW *win)
{
WINHELP_WINDOW **w;
@ -969,15 +1183,14 @@ static VOID WINHELP_DeleteWindow(WINHELP_WINDOW *win)
if (win->hShadowWnd) DestroyWindow(win->hShadowWnd);
HLPFILE_FreeHlpFilePage(win->page);
WINHELP_DeleteLines(win);
GlobalFree(win->hSelf);
HeapFree(GetProcessHeap(), 0, win);
}
/***********************************************************************
*
* WINHELP_InitFonts
*/
static VOID WINHELP_InitFonts(HWND hWnd)
static void WINHELP_InitFonts(HWND hWnd)
{
WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0);
LOGFONT logfontlist[] = {
@ -990,7 +1203,7 @@ static VOID WINHELP_InitFonts(HWND hWnd)
{ -8, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"}};
#define FONTS_LEN (sizeof(logfontlist)/sizeof(*logfontlist))
static HFONT fonts[FONTS_LEN][2];
static HFONT fonts[FONTS_LEN];
static BOOL init = 0;
win->fonts_len = FONTS_LEN;
@ -1002,11 +1215,7 @@ static VOID WINHELP_InitFonts(HWND hWnd)
for(i = 0; i < FONTS_LEN; i++)
{
LOGFONT logfont = logfontlist[i];
fonts[i][0] = CreateFontIndirect(&logfont);
logfont.lfUnderline = 1;
fonts[i][1] = CreateFontIndirect(&logfont);
fonts[i] = CreateFontIndirect(&logfontlist[i]);
}
init = 1;
@ -1017,7 +1226,6 @@ static VOID WINHELP_InitFonts(HWND hWnd)
*
* WINHELP_MessageBoxIDS
*/
INT WINHELP_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type)
{
CHAR text[MAX_STRING_LEN];
@ -1026,14 +1234,13 @@ INT WINHELP_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type)
LoadString(Globals.hInstance, ids_text, text, sizeof(text));
LoadString(Globals.hInstance, ids_title, title, sizeof(title));
return(MessageBox(0, text, title, type));
return MessageBox(0, text, title, type);
}
/***********************************************************************
*
* MAIN_MessageBoxIDS_s
*/
INT WINHELP_MessageBoxIDS_s(UINT ids_text, LPCSTR str, UINT ids_title, WORD type)
{
CHAR text[MAX_STRING_LEN];
@ -1044,9 +1251,14 @@ INT WINHELP_MessageBoxIDS_s(UINT ids_text, LPCSTR str, UINT ids_title, WORD type
LoadString(Globals.hInstance, ids_title, title, sizeof(title));
wsprintf(newtext, text, str);
return(MessageBox(0, newtext, title, type));
return MessageBox(0, newtext, title, type);
}
/******************************************************************
* WINHELP_IsOverLink
*
*
*/
WINHELP_LINE_PART* WINHELP_IsOverLink(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
WINHELP_WINDOW* win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0);
@ -1074,7 +1286,3 @@ WINHELP_LINE_PART* WINHELP_IsOverLink(HWND hWnd, WPARAM wParam, LPARAM lParam)
return NULL;
}
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */

View File

@ -3,7 +3,8 @@
*
* Copyright 1996 Ulrich Schmid
* Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
* 2002 Eric Pouech
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -25,8 +26,8 @@
#define INTERNAL_BORDER_WIDTH 5
#define POPUP_YDISTANCE 20
#define SHADOW_DX 20
#define SHADOW_DY 20
#define SHADOW_DX 10
#define SHADOW_DY 10
#define BUTTON_CX 6
#define BUTTON_CY 6
@ -39,10 +40,22 @@
typedef struct tagHelpLinePart
{
RECT rect;
enum {hlp_line_part_text, hlp_line_part_image} cookie;
union
{
struct
{
LPCSTR lpsText;
UINT wTextLen;
HFONT hFont;
COLORREF color;
WORD wTextLen;
WORD wUnderline; /* 0 None, 1 simple, 2 double, 3 dotted */
} text;
struct
{
HBITMAP hBitmap;
} image;
} u;
struct
{
@ -51,7 +64,6 @@ typedef struct tagHelpLinePart
BOOL bPopup;
} link;
HGLOBAL hSelf;
struct tagHelpLinePart *next;
} WINHELP_LINE_PART;
@ -74,7 +86,6 @@ typedef struct tagHelpButton
RECT rect;
HGLOBAL hSelf;
struct tagHelpButton*next;
} WINHELP_BUTTON;
@ -91,13 +102,12 @@ typedef struct tagWinHelp
HWND hTextWnd;
HWND hShadowWnd;
HFONT (*fonts)[2];
HFONT* fonts;
UINT fonts_len;
HCURSOR hArrowCur;
HCURSOR hHandCur;
HGLOBAL hSelf;
struct tagWinHelp* next;
} WINHELP_WINDOW;
@ -113,7 +123,8 @@ typedef struct
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_s(UINT, LPCSTR, UINT, WORD);
@ -128,7 +139,3 @@ extern CHAR STRING_DIALOG_TEST[];
/* Buttons */
#define WH_FIRST_BUTTON 500
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */