1996-05-06 18:06:24 +02:00
|
|
|
/*
|
|
|
|
* Help Viewer
|
|
|
|
*
|
2002-07-16 03:46:29 +02:00
|
|
|
* Copyright 1996 Ulrich Schmid
|
|
|
|
* Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
|
|
|
|
* 2002 Eric Pouech
|
|
|
|
*
|
2002-03-10 00:29:33 +01: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
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
1996-05-06 18:06:24 +02:00
|
|
|
*/
|
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
#define MAX_LANGUAGE_NUMBER 255
|
|
|
|
#define MAX_PATHNAME_LEN 1024
|
|
|
|
#define MAX_STRING_LEN 255
|
1996-05-06 18:06:24 +02:00
|
|
|
|
2002-07-16 03:46:29 +02: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 18:06:24 +02:00
|
|
|
|
|
|
|
#ifndef RC_INVOKED
|
|
|
|
|
|
|
|
#include "hlpfile.h"
|
|
|
|
#include "macro.h"
|
2002-05-14 05:48:10 +02:00
|
|
|
#include "winhelp_res.h"
|
1996-05-06 18:06:24 +02:00
|
|
|
|
|
|
|
typedef struct tagHelpLinePart
|
|
|
|
{
|
2002-07-16 03:46:29 +02:00
|
|
|
RECT rect;
|
2002-12-16 23:11:11 +01:00
|
|
|
enum {hlp_line_part_text, hlp_line_part_bitmap, hlp_line_part_metafile} cookie;
|
2002-07-16 03:46:29 +02:00
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
LPCSTR lpsText;
|
|
|
|
HFONT hFont;
|
|
|
|
COLORREF color;
|
|
|
|
WORD wTextLen;
|
|
|
|
WORD wUnderline; /* 0 None, 1 simple, 2 double, 3 dotted */
|
|
|
|
} text;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
HBITMAP hBitmap;
|
2002-12-16 23:11:11 +01:00
|
|
|
} bitmap;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
HMETAFILE hMetaFile;
|
|
|
|
} metafile;
|
2002-07-16 03:46:29 +02:00
|
|
|
} u;
|
2002-12-16 23:11:11 +01:00
|
|
|
HLPFILE_LINK* link;
|
2002-07-16 03:46:29 +02:00
|
|
|
|
|
|
|
struct tagHelpLinePart *next;
|
1996-05-06 18:06:24 +02:00
|
|
|
} WINHELP_LINE_PART;
|
|
|
|
|
|
|
|
typedef struct tagHelpLine
|
|
|
|
{
|
2002-07-16 03:46:29 +02:00
|
|
|
RECT rect;
|
|
|
|
WINHELP_LINE_PART first_part;
|
|
|
|
struct tagHelpLine* next;
|
1996-05-06 18:06:24 +02:00
|
|
|
} WINHELP_LINE;
|
|
|
|
|
|
|
|
typedef struct tagHelpButton
|
|
|
|
{
|
2002-07-16 03:46:29 +02:00
|
|
|
HWND hWnd;
|
1996-05-06 18:06:24 +02:00
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
LPCSTR lpszID;
|
|
|
|
LPCSTR lpszName;
|
|
|
|
LPCSTR lpszMacro;
|
1996-05-06 18:06:24 +02:00
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
WPARAM wParam;
|
1996-05-06 18:06:24 +02:00
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
RECT rect;
|
1996-05-06 18:06:24 +02:00
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
struct tagHelpButton*next;
|
1996-05-06 18:06:24 +02:00
|
|
|
} WINHELP_BUTTON;
|
|
|
|
|
|
|
|
typedef struct tagWinHelp
|
|
|
|
{
|
2002-11-18 20:48:11 +01:00
|
|
|
LPCSTR lpszName;
|
1996-05-06 18:06:24 +02:00
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
WINHELP_BUTTON* first_button;
|
|
|
|
HLPFILE_PAGE* page;
|
|
|
|
WINHELP_LINE* first_line;
|
1996-05-06 18:06:24 +02:00
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
HWND hMainWnd;
|
|
|
|
HWND hButtonBoxWnd;
|
|
|
|
HWND hTextWnd;
|
|
|
|
HWND hShadowWnd;
|
2002-11-20 20:46:18 +01:00
|
|
|
HWND hHistoryWnd;
|
1996-05-06 18:06:24 +02:00
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
HFONT* fonts;
|
|
|
|
UINT fonts_len;
|
1996-05-06 18:06:24 +02:00
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
HCURSOR hArrowCur;
|
|
|
|
HCURSOR hHandCur;
|
2000-10-14 01:07:43 +02:00
|
|
|
|
2002-11-18 20:48:11 +01:00
|
|
|
HLPFILE_WINDOWINFO* info;
|
|
|
|
|
2002-11-20 20:46:18 +01:00
|
|
|
/* FIXME: for now it's a fixed size */
|
|
|
|
HLPFILE_PAGE* history[40];
|
|
|
|
unsigned histIndex;
|
|
|
|
HLPFILE_PAGE* back[40];
|
|
|
|
unsigned backIndex;
|
|
|
|
|
2002-07-16 03:46:29 +02:00
|
|
|
struct tagWinHelp* next;
|
1996-05-06 18:06:24 +02:00
|
|
|
} WINHELP_WINDOW;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2002-07-16 03:46:29 +02:00
|
|
|
UINT wVersion;
|
|
|
|
HANDLE hInstance;
|
|
|
|
HWND hPopupWnd;
|
|
|
|
UINT wStringTableOffset;
|
2002-11-15 02:34:57 +01:00
|
|
|
BOOL isBook;
|
2002-07-16 03:46:29 +02:00
|
|
|
WINHELP_WINDOW* active_win;
|
|
|
|
WINHELP_WINDOW* win_list;
|
1996-05-06 18:06:24 +02:00
|
|
|
} WINHELP_GLOBALS;
|
|
|
|
|
|
|
|
extern WINHELP_GLOBALS Globals;
|
|
|
|
|
2002-11-18 20:48:11 +01:00
|
|
|
BOOL WINHELP_CreateHelpWindowByHash(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int);
|
|
|
|
BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE*, HLPFILE_WINDOWINFO*, int);
|
1996-05-06 18:06:24 +02:00
|
|
|
INT WINHELP_MessageBoxIDS(UINT, UINT, WORD);
|
|
|
|
INT WINHELP_MessageBoxIDS_s(UINT, LPCSTR, UINT, WORD);
|
2002-11-18 20:48:11 +01:00
|
|
|
HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile);
|
|
|
|
HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name);
|
1996-05-06 18:06:24 +02:00
|
|
|
|
2002-11-15 02:34:57 +01:00
|
|
|
extern char MAIN_WIN_CLASS_NAME[];
|
|
|
|
extern char BUTTON_BOX_WIN_CLASS_NAME[];
|
|
|
|
extern char TEXT_WIN_CLASS_NAME[];
|
|
|
|
extern char SHADOW_WIN_CLASS_NAME[];
|
2002-11-20 20:46:18 +01:00
|
|
|
extern char HISTORY_WIN_CLASS_NAME[];
|
2002-11-15 02:34:57 +01:00
|
|
|
extern char STRING_BUTTON[];
|
|
|
|
extern char STRING_MENU_Xx[];
|
|
|
|
extern char STRING_DIALOG_TEST[];
|
1996-05-06 18:06:24 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Buttons */
|
|
|
|
#define WH_FIRST_BUTTON 500
|