1996-05-06 16:06:24 +00:00
|
|
|
/*
|
|
|
|
* Help Viewer
|
|
|
|
*
|
2002-07-16 01:46:29 +00:00
|
|
|
* Copyright 1996 Ulrich Schmid
|
|
|
|
* Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
|
|
|
|
* 2002 Eric Pouech
|
|
|
|
*
|
2002-03-09 23:29:33 +00:00
|
|
|
* 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
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
1996-05-06 16:06:24 +00:00
|
|
|
*/
|
|
|
|
|
2002-07-16 01:46:29 +00:00
|
|
|
#define MAX_LANGUAGE_NUMBER 255
|
|
|
|
#define MAX_STRING_LEN 255
|
1996-05-06 16:06:24 +00:00
|
|
|
|
2002-07-16 01:46:29 +00:00
|
|
|
#define INTERNAL_BORDER_WIDTH 5
|
|
|
|
#define POPUP_YDISTANCE 20
|
|
|
|
#define SHADOW_DX 10
|
|
|
|
#define SHADOW_DY 10
|
|
|
|
#define BUTTON_CX 6
|
|
|
|
#define BUTTON_CY 6
|
1996-05-06 16:06:24 +00:00
|
|
|
|
|
|
|
#ifndef RC_INVOKED
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
1996-05-06 16:06:24 +00:00
|
|
|
#include "hlpfile.h"
|
2003-09-05 23:08:26 +00:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
1996-05-06 16:06:24 +00:00
|
|
|
#include "macro.h"
|
2002-05-14 03:48:10 +00:00
|
|
|
#include "winhelp_res.h"
|
1996-05-06 16:06:24 +00:00
|
|
|
|
|
|
|
typedef struct tagHelpButton
|
|
|
|
{
|
2002-07-16 01:46:29 +00:00
|
|
|
HWND hWnd;
|
1996-05-06 16:06:24 +00:00
|
|
|
|
2002-07-16 01:46:29 +00:00
|
|
|
LPCSTR lpszID;
|
|
|
|
LPCSTR lpszName;
|
|
|
|
LPCSTR lpszMacro;
|
1996-05-06 16:06:24 +00:00
|
|
|
|
2002-07-16 01:46:29 +00:00
|
|
|
WPARAM wParam;
|
1996-05-06 16:06:24 +00:00
|
|
|
|
2002-07-16 01:46:29 +00:00
|
|
|
RECT rect;
|
1996-05-06 16:06:24 +00:00
|
|
|
|
2002-07-16 01:46:29 +00:00
|
|
|
struct tagHelpButton*next;
|
1996-05-06 16:06:24 +00:00
|
|
|
} WINHELP_BUTTON;
|
|
|
|
|
2008-04-22 19:59:38 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
HLPFILE_PAGE* page;
|
|
|
|
HLPFILE_WINDOWINFO* wininfo;
|
2008-04-22 20:00:56 +00:00
|
|
|
ULONG relative;
|
2008-04-22 19:59:38 +00:00
|
|
|
} WINHELP_WNDPAGE;
|
|
|
|
|
|
|
|
typedef struct tagPageSet
|
|
|
|
{
|
|
|
|
/* FIXME: for now it's a fixed size */
|
|
|
|
WINHELP_WNDPAGE set[40];
|
|
|
|
unsigned index;
|
|
|
|
} WINHELP_PAGESET;
|
|
|
|
|
1996-05-06 16:06:24 +00:00
|
|
|
typedef struct tagWinHelp
|
|
|
|
{
|
2009-05-30 12:27:04 +00:00
|
|
|
unsigned ref_count;
|
2002-07-16 01:46:29 +00:00
|
|
|
WINHELP_BUTTON* first_button;
|
|
|
|
HLPFILE_PAGE* page;
|
1996-05-06 16:06:24 +00:00
|
|
|
|
2002-07-16 01:46:29 +00:00
|
|
|
HWND hMainWnd;
|
2002-11-20 19:46:18 +00:00
|
|
|
HWND hHistoryWnd;
|
1996-05-06 16:06:24 +00:00
|
|
|
|
2009-03-10 19:19:59 +00:00
|
|
|
WNDPROC origRicheditWndProc;
|
|
|
|
|
2002-07-16 01:46:29 +00:00
|
|
|
HFONT* fonts;
|
|
|
|
UINT fonts_len;
|
1996-05-06 16:06:24 +00:00
|
|
|
|
2002-07-16 01:46:29 +00:00
|
|
|
HCURSOR hHandCur;
|
2000-10-13 23:07:43 +00:00
|
|
|
|
2006-10-13 12:19:48 +00:00
|
|
|
HBRUSH hBrush;
|
|
|
|
|
2002-11-18 19:48:11 +00:00
|
|
|
HLPFILE_WINDOWINFO* info;
|
|
|
|
|
2008-04-22 19:59:38 +00:00
|
|
|
WINHELP_PAGESET back;
|
2008-05-01 19:17:29 +00:00
|
|
|
unsigned font_scale; /* 0 = small, 1 = normal, 2 = large */
|
2002-11-20 19:46:18 +00:00
|
|
|
|
2002-07-16 01:46:29 +00:00
|
|
|
struct tagWinHelp* next;
|
1996-05-06 16:06:24 +00:00
|
|
|
} WINHELP_WINDOW;
|
|
|
|
|
2004-12-13 21:06:46 +00:00
|
|
|
#define DC_NOMSG 0x00000000
|
|
|
|
#define DC_MINMAX 0x00000001
|
|
|
|
#define DC_INITTERM 0x00000002
|
|
|
|
#define DC_JUMP 0x00000004
|
|
|
|
#define DC_ACTIVATE 0x00000008
|
|
|
|
#define DC_CALLBACKS 0x00000010
|
|
|
|
|
|
|
|
#define DW_NOTUSED 0
|
|
|
|
#define DW_WHATMSG 1
|
|
|
|
#define DW_MINMAX 2
|
|
|
|
#define DW_SIZE 3
|
|
|
|
#define DW_INIT 4
|
|
|
|
#define DW_TERM 5
|
|
|
|
#define DW_STARTJUMP 6
|
|
|
|
#define DW_ENDJUMP 7
|
|
|
|
#define DW_CHGFILE 8
|
|
|
|
#define DW_ACTIVATE 9
|
|
|
|
#define DW_CALLBACKS 10
|
|
|
|
|
2009-10-07 11:31:32 +00:00
|
|
|
typedef LONG (CALLBACK *WINHELP_LDLLHandler)(WORD, LONG_PTR, LONG_PTR);
|
2004-12-13 21:06:46 +00:00
|
|
|
|
|
|
|
typedef struct tagDll
|
|
|
|
{
|
|
|
|
HANDLE hLib;
|
|
|
|
const char* name;
|
|
|
|
WINHELP_LDLLHandler handler;
|
|
|
|
DWORD class;
|
|
|
|
struct tagDll* next;
|
|
|
|
} WINHELP_DLL;
|
|
|
|
|
1996-05-06 16:06:24 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2002-07-16 01:46:29 +00:00
|
|
|
UINT wVersion;
|
|
|
|
HANDLE hInstance;
|
2002-11-15 01:34:57 +00:00
|
|
|
BOOL isBook;
|
2002-07-16 01:46:29 +00:00
|
|
|
WINHELP_WINDOW* active_win;
|
2008-04-22 20:01:14 +00:00
|
|
|
WINHELP_WINDOW* active_popup;
|
2002-07-16 01:46:29 +00:00
|
|
|
WINHELP_WINDOW* win_list;
|
2004-09-07 20:42:05 +00:00
|
|
|
WNDPROC button_proc;
|
2004-12-13 21:06:46 +00:00
|
|
|
WINHELP_DLL* dlls;
|
2008-04-22 19:59:38 +00:00
|
|
|
WINHELP_PAGESET history;
|
2008-07-12 08:36:49 +00:00
|
|
|
HFONT hButtonFont;
|
1996-05-06 16:06:24 +00:00
|
|
|
} WINHELP_GLOBALS;
|
|
|
|
|
2009-10-07 11:31:32 +00:00
|
|
|
extern const struct winhelp_callbacks
|
|
|
|
{
|
|
|
|
WORD (WINAPI *GetFSError)(void);
|
|
|
|
HANDLE (WINAPI *HfsOpenSz)(LPSTR,BYTE);
|
|
|
|
WORD (WINAPI *RcCloseHfs)(HANDLE);
|
|
|
|
HANDLE (WINAPI *HfOpenHfs)(HANDLE,LPSTR,BYTE);
|
|
|
|
HANDLE (WINAPI *RcCloseHf)(HANDLE);
|
|
|
|
LONG (WINAPI *LcbReadHf)(HANDLE,BYTE*,LONG);
|
|
|
|
LONG (WINAPI *LTellHf)(HANDLE);
|
|
|
|
LONG (WINAPI *LSeekHf)(HANDLE,LONG,WORD);
|
|
|
|
BOOL (WINAPI *FEofHf)(HANDLE);
|
|
|
|
LONG (WINAPI *LcbSizeHf)(HANDLE);
|
|
|
|
BOOL (WINAPI *FAccessHfs)(HANDLE,LPSTR,BYTE);
|
|
|
|
WORD (WINAPI *RcLLInfoFromHf)(HANDLE,WORD,LPWORD,LPLONG,LPLONG);
|
|
|
|
WORD (WINAPI *RcLLInfoFromHfs)(HANDLE,LPSTR,WORD,LPWORD,LPLONG,LPLONG);
|
|
|
|
void (WINAPI *ErrorW)(int);
|
|
|
|
void (WINAPI *ErrorSz)(LPSTR);
|
|
|
|
ULONG_PTR (WINAPI *GetInfo)(WORD,HWND);
|
|
|
|
LONG (WINAPI *API)(LPSTR,WORD,DWORD);
|
|
|
|
} Callbacks;
|
|
|
|
|
1996-05-06 16:06:24 +00:00
|
|
|
extern WINHELP_GLOBALS Globals;
|
|
|
|
|
2008-04-22 20:00:20 +00:00
|
|
|
BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE*, int, BOOL);
|
2008-04-22 20:01:08 +00:00
|
|
|
BOOL WINHELP_OpenHelpWindow(HLPFILE_PAGE* (*)(HLPFILE*, LONG, ULONG*),
|
|
|
|
HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int);
|
2006-11-06 12:07:01 +00:00
|
|
|
BOOL WINHELP_GetOpenFileName(LPSTR, int);
|
2008-07-05 19:33:19 +00:00
|
|
|
BOOL WINHELP_CreateIndexWindow(BOOL);
|
2008-04-22 19:59:57 +00:00
|
|
|
void WINHELP_DeleteBackSet(WINHELP_WINDOW*);
|
2002-11-18 19:48:11 +00:00
|
|
|
HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile);
|
|
|
|
HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name);
|
2008-04-18 19:33:51 +00:00
|
|
|
void WINHELP_LayoutMainWindow(WINHELP_WINDOW* win);
|
2009-05-30 12:27:04 +00:00
|
|
|
WINHELP_WINDOW* WINHELP_GrabWindow(WINHELP_WINDOW*);
|
|
|
|
BOOL WINHELP_ReleaseWindow(WINHELP_WINDOW*);
|
1996-05-06 16:06:24 +00:00
|
|
|
|
2004-05-04 04:13:05 +00:00
|
|
|
extern const char MAIN_WIN_CLASS_NAME[];
|
|
|
|
extern const char BUTTON_BOX_WIN_CLASS_NAME[];
|
|
|
|
extern const char TEXT_WIN_CLASS_NAME[];
|
|
|
|
extern const char SHADOW_WIN_CLASS_NAME[];
|
|
|
|
extern const char HISTORY_WIN_CLASS_NAME[];
|
|
|
|
extern const char STRING_BUTTON[];
|
|
|
|
extern const char STRING_MENU_Xx[];
|
|
|
|
extern const char STRING_DIALOG_TEST[];
|
1996-05-06 16:06:24 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Buttons */
|
|
|
|
#define WH_FIRST_BUTTON 500
|