mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
Add NO_HTMLHELP and turn it on by default in Makefile.cyg.
[originally from svn r7033]
This commit is contained in:
@ -487,7 +487,7 @@ if (defined $makefiles{'cygwin'}) {
|
|||||||
"# RCINC = --include-dir c:\\cygwin\\include\\\n".
|
"# RCINC = --include-dir c:\\cygwin\\include\\\n".
|
||||||
"\n".
|
"\n".
|
||||||
&splitline("CFLAGS = -mno-cygwin -Wall -O2 -D_WINDOWS -DDEBUG -DWIN32S_COMPAT".
|
&splitline("CFLAGS = -mno-cygwin -Wall -O2 -D_WINDOWS -DDEBUG -DWIN32S_COMPAT".
|
||||||
" -D_NO_OLDNAMES -DNO_MULTIMON " .
|
" -D_NO_OLDNAMES -DNO_MULTIMON -DNO_HTMLHELP " .
|
||||||
(join " ", map {"-I$dirpfx$_"} @srcdirs)) .
|
(join " ", map {"-I$dirpfx$_"} @srcdirs)) .
|
||||||
"\n".
|
"\n".
|
||||||
"LDFLAGS = -mno-cygwin -s\n".
|
"LDFLAGS = -mno-cygwin -s\n".
|
||||||
|
14
windows.c
14
windows.c
@ -4,7 +4,9 @@
|
|||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
|
#ifndef NO_HTMLHELP
|
||||||
#include <htmlhelp.h>
|
#include <htmlhelp.h>
|
||||||
|
#endif /* NO_HTMLHELP */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -36,12 +38,16 @@
|
|||||||
|
|
||||||
#define HELP_FILE_NAME "puzzles.hlp"
|
#define HELP_FILE_NAME "puzzles.hlp"
|
||||||
#define HELP_CNT_NAME "puzzles.cnt"
|
#define HELP_CNT_NAME "puzzles.cnt"
|
||||||
|
#ifndef NO_HTMLHELP
|
||||||
#define CHM_FILE_NAME "puzzles.chm"
|
#define CHM_FILE_NAME "puzzles.chm"
|
||||||
|
#endif /* NO_HTMLHELP */
|
||||||
|
|
||||||
|
#ifndef NO_HTMLHELP
|
||||||
typedef HWND (CALLBACK *htmlhelp_t)(HWND, LPCSTR, UINT, DWORD);
|
typedef HWND (CALLBACK *htmlhelp_t)(HWND, LPCSTR, UINT, DWORD);
|
||||||
static DWORD html_help_cookie;
|
static DWORD html_help_cookie;
|
||||||
static htmlhelp_t htmlhelp;
|
static htmlhelp_t htmlhelp;
|
||||||
static HINSTANCE hh_dll;
|
static HINSTANCE hh_dll;
|
||||||
|
#endif /* NO_HTMLHELP */
|
||||||
enum { NONE, HLP, CHM } help_type;
|
enum { NONE, HLP, CHM } help_type;
|
||||||
char *help_path;
|
char *help_path;
|
||||||
const char *help_topic;
|
const char *help_topic;
|
||||||
@ -1009,6 +1015,7 @@ static void init_help(void)
|
|||||||
q = strrchr(b, ':');
|
q = strrchr(b, ':');
|
||||||
if (q && q >= r) r = q+1;
|
if (q && q >= r) r = q+1;
|
||||||
|
|
||||||
|
#ifndef NO_HTMLHELP
|
||||||
/*
|
/*
|
||||||
* Try HTML Help first.
|
* Try HTML Help first.
|
||||||
*/
|
*/
|
||||||
@ -1033,6 +1040,7 @@ static void init_help(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* NO_HTMLHELP */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now try old-style .HLP.
|
* Now try old-style .HLP.
|
||||||
@ -1086,6 +1094,7 @@ static void start_help(frontend *fe, const char *topic)
|
|||||||
fe->help_running = TRUE;
|
fe->help_running = TRUE;
|
||||||
break;
|
break;
|
||||||
case CHM:
|
case CHM:
|
||||||
|
#ifndef NO_HTMLHELP
|
||||||
assert(help_path);
|
assert(help_path);
|
||||||
assert(htmlhelp);
|
assert(htmlhelp);
|
||||||
if (topic) {
|
if (topic) {
|
||||||
@ -1097,6 +1106,7 @@ static void start_help(frontend *fe, const char *topic)
|
|||||||
htmlhelp(fe->hwnd, str, HH_DISPLAY_TOPIC, 0);
|
htmlhelp(fe->hwnd, str, HH_DISPLAY_TOPIC, 0);
|
||||||
fe->help_running = TRUE;
|
fe->help_running = TRUE;
|
||||||
break;
|
break;
|
||||||
|
#endif /* NO_HTMLHELP */
|
||||||
case NONE:
|
case NONE:
|
||||||
assert(!"This shouldn't happen");
|
assert(!"This shouldn't happen");
|
||||||
break;
|
break;
|
||||||
@ -1116,9 +1126,11 @@ static void stop_help(frontend *fe)
|
|||||||
WinHelp(fe->hwnd, help_path, HELP_QUIT, 0);
|
WinHelp(fe->hwnd, help_path, HELP_QUIT, 0);
|
||||||
break;
|
break;
|
||||||
case CHM:
|
case CHM:
|
||||||
|
#ifndef NO_HTMLHELP
|
||||||
assert(htmlhelp);
|
assert(htmlhelp);
|
||||||
htmlhelp(NULL, NULL, HH_CLOSE_ALL, 0);
|
htmlhelp(NULL, NULL, HH_CLOSE_ALL, 0);
|
||||||
break;
|
break;
|
||||||
|
#endif /* NO_HTMLHELP */
|
||||||
case NONE:
|
case NONE:
|
||||||
assert(!"This shouldn't happen");
|
assert(!"This shouldn't happen");
|
||||||
break;
|
break;
|
||||||
@ -1132,10 +1144,12 @@ static void stop_help(frontend *fe)
|
|||||||
*/
|
*/
|
||||||
static void cleanup_help(void)
|
static void cleanup_help(void)
|
||||||
{
|
{
|
||||||
|
#ifndef NO_HTMLHELP
|
||||||
if (help_type == CHM) {
|
if (help_type == CHM) {
|
||||||
assert(htmlhelp);
|
assert(htmlhelp);
|
||||||
htmlhelp(NULL, NULL, HH_UNINITIALIZE, html_help_cookie);
|
htmlhelp(NULL, NULL, HH_UNINITIALIZE, html_help_cookie);
|
||||||
}
|
}
|
||||||
|
#endif /* NO_HTMLHELP */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void check_window_size(frontend *fe, int *px, int *py)
|
static void check_window_size(frontend *fe, int *px, int *py)
|
||||||
|
Reference in New Issue
Block a user