Merge branch 'NetHack-3.6.2'
This commit is contained in:
+7
-6
@@ -1,4 +1,4 @@
|
|||||||
.\" $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.271 $ $NHDT-Date: 1535668900 2018/08/30 22:41:40 $
|
.\" $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.278 $ $NHDT-Date: 1539507753 2018/10/14 09:02:33 $
|
||||||
.\"
|
.\"
|
||||||
.\" This is an excerpt from the 'roff' man page from the 'groff' package.
|
.\" This is an excerpt from the 'roff' man page from the 'groff' package.
|
||||||
.\" NetHack's Guidebook.mn currently does *not* adhere to these guidelines.
|
.\" NetHack's Guidebook.mn currently does *not* adhere to these guidelines.
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
.ds vr "NetHack 3.6
|
.ds vr "NetHack 3.6
|
||||||
.ds f0 "\*(vr
|
.ds f0 "\*(vr
|
||||||
.ds f1
|
.ds f1
|
||||||
.ds f2 "September 26, 2018
|
.ds f2 "October 14, 2018
|
||||||
.
|
.
|
||||||
.\" labeled paragraph start (should be part of tmac.n, but I don't want to
|
.\" labeled paragraph start (should be part of tmac.n, but I don't want to
|
||||||
.\" make changes to that file)
|
.\" make changes to that file)
|
||||||
@@ -2257,13 +2257,14 @@ you are carrying (shopkeepers aside).
|
|||||||
Persistence of Objects
|
Persistence of Objects
|
||||||
.pg
|
.pg
|
||||||
Normally, if you have seen an object at a particular map location and
|
Normally, if you have seen an object at a particular map location and
|
||||||
move to another location which can't directly see that object any
|
move to another location where you can't directly see that object any
|
||||||
more, if will continue to be displayed on your map.
|
more, if will continue to be displayed on your map.
|
||||||
That remains the case even if it is not actually there any more \(em
|
That remains the case even if it is not actually there any more \(em
|
||||||
perhaps a monster has picked it up or it has rotted away \(em
|
perhaps a monster has picked it up or it has rotted away \(em
|
||||||
until you can see or feel that location again.
|
until you can see or feel that location again.
|
||||||
One notable exception is that if the object gets covered by the
|
One notable exception is that if the object gets covered by the
|
||||||
``remembered, unseen monster'' marker and that marker is later removed
|
``remembered, unseen monster'' marker.
|
||||||
|
When that marker is later removed
|
||||||
after you've verified that no monster is there, you will forget that
|
after you've verified that no monster is there, you will forget that
|
||||||
there was any object there regardless of whether the unseen monster
|
there was any object there regardless of whether the unseen monster
|
||||||
actually took the object.
|
actually took the object.
|
||||||
@@ -2274,7 +2275,7 @@ The situation is the same for a pile of objects, except that only the
|
|||||||
top item of the pile is displayed.
|
top item of the pile is displayed.
|
||||||
The
|
The
|
||||||
.op hilite_pile
|
.op hilite_pile
|
||||||
option can be enabled in order to show an item differently when is
|
option can be enabled in order to show an item differently when it is
|
||||||
the top one of a pile.
|
the top one of a pile.
|
||||||
.
|
.
|
||||||
.hn 1
|
.hn 1
|
||||||
@@ -2663,7 +2664,7 @@ new players if it detects some anticipated mistakes (default on).
|
|||||||
Have user confirm attacks on pets, shopkeepers, and other
|
Have user confirm attacks on pets, shopkeepers, and other
|
||||||
peaceable creatures (default on). Persistent.
|
peaceable creatures (default on). Persistent.
|
||||||
.lp dark_room
|
.lp dark_room
|
||||||
Show out-of-sight areas of lit rooms (default off). Persistent.
|
Show out-of-sight areas of lit rooms (default on). Persistent.
|
||||||
.lp disclose
|
.lp disclose
|
||||||
Controls what information the program reveals when the game ends.
|
Controls what information the program reveals when the game ends.
|
||||||
Value is a space separated list of prompting/category pairs
|
Value is a space separated list of prompting/category pairs
|
||||||
|
|||||||
+6
-5
@@ -45,7 +45,7 @@
|
|||||||
%.au
|
%.au
|
||||||
\author{Original version - Eric S. Raymond\\
|
\author{Original version - Eric S. Raymond\\
|
||||||
(Edited and expanded for 3.6 by Mike Stephenson and others)}
|
(Edited and expanded for 3.6 by Mike Stephenson and others)}
|
||||||
\date{September 26, 2018}
|
\date{October 14, 2018}
|
||||||
|
|
||||||
\maketitle
|
\maketitle
|
||||||
|
|
||||||
@@ -2619,13 +2619,14 @@ you are carrying (shopkeepers aside).
|
|||||||
|
|
||||||
%.pg
|
%.pg
|
||||||
Normally, if you have seen an object at a particular map location and
|
Normally, if you have seen an object at a particular map location and
|
||||||
move to another location which can't directly see that object any
|
move to another location where you can't directly see that object any
|
||||||
more, if will continue to be displayed on your map.
|
more, if will continue to be displayed on your map.
|
||||||
That remains the case even if it is not actually there any more--
|
That remains the case even if it is not actually there any more--
|
||||||
perhaps a monster has picked it up or it has rotted away--
|
perhaps a monster has picked it up or it has rotted away--
|
||||||
until you can see or feel that location again.
|
until you can see or feel that location again.
|
||||||
One notable exception is that if the object gets covered by the
|
One notable exception is that if the object gets covered by the
|
||||||
``remembered, unseen monster'' marker and that marker is later removed
|
``remembered, unseen monster'' marker.
|
||||||
|
When that marker is later removed
|
||||||
after you've verified that no monster is there, you will forget that
|
after you've verified that no monster is there, you will forget that
|
||||||
there was any object there regardless of whether the unseen monster
|
there was any object there regardless of whether the unseen monster
|
||||||
actually took the object.
|
actually took the object.
|
||||||
@@ -2637,7 +2638,7 @@ The situation is the same for a pile of objects, except that only the
|
|||||||
top item of the pile is displayed.
|
top item of the pile is displayed.
|
||||||
The
|
The
|
||||||
{\it hilite\verb+_+pile\/}
|
{\it hilite\verb+_+pile\/}
|
||||||
option can be enabled in order to show an item differently when is
|
option can be enabled in order to show an item differently when it is
|
||||||
the top one of a pile.
|
the top one of a pile.
|
||||||
|
|
||||||
%.hn 1
|
%.hn 1
|
||||||
@@ -3109,7 +3110,7 @@ peaceable creatures (default on). Persistent.
|
|||||||
%.lp
|
%.lp
|
||||||
%.lp
|
%.lp
|
||||||
\item[\ib{dark\verb+_+room}]
|
\item[\ib{dark\verb+_+room}]
|
||||||
Show out-of-sight areas of lit rooms (default off). Persistent.
|
Show out-of-sight areas of lit rooms (default on). Persistent.
|
||||||
\item[\ib{disclose}]
|
\item[\ib{disclose}]
|
||||||
Controls what information the program reveals when the game ends.
|
Controls what information the program reveals when the game ends.
|
||||||
Value is a space separated list of prompting/category pairs
|
Value is a space separated list of prompting/category pairs
|
||||||
|
|||||||
+7
-1
@@ -158,6 +158,11 @@ being trapped (bear trap, web, molten or solidified lava, chained to buried
|
|||||||
iron ball) blocks both levitation and flight (note: being stuck in a
|
iron ball) blocks both levitation and flight (note: being stuck in a
|
||||||
pit ends when either of those starts so doesn't apply)
|
pit ends when either of those starts so doesn't apply)
|
||||||
change default value for the 'autodescribe' option to 'on'
|
change default value for the 'autodescribe' option to 'on'
|
||||||
|
Elbereth hypocrisy penalty doesn't apply if attacking a monster which isn't
|
||||||
|
frightened by Elbereth; normal scuffing of engravings still applies
|
||||||
|
Elbereth hypocrisy penalty reduced when alignment is already low
|
||||||
|
during character creation, don't unset alternate weapon when a shield gets
|
||||||
|
worn (was preventing knight from having lance set up as uswapwep)
|
||||||
|
|
||||||
|
|
||||||
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
||||||
@@ -220,11 +225,12 @@ Qt: add Qt5 specific hints file for linux and Mac OS X (Ray Chason)
|
|||||||
Qt: enable compiling Qt5 on Windows (Ray Chason)
|
Qt: enable compiling Qt5 on Windows (Ray Chason)
|
||||||
Qt: entering extended commands, hide non-matching ones
|
Qt: entering extended commands, hide non-matching ones
|
||||||
Qt: remember tile and font size
|
Qt: remember tile and font size
|
||||||
X11: implement menucolors and allow menus to obey inverse attribute
|
X11: implement menucolors and allow menus to obey some attributes
|
||||||
X11: make key translations work with menus on Linux
|
X11: make key translations work with menus on Linux
|
||||||
X11: allow mouse wheel scrolling to work in menus by default
|
X11: allow mouse wheel scrolling to work in menus by default
|
||||||
X11: handle paged menu control keys
|
X11: handle paged menu control keys
|
||||||
X11: remember perm_invent window geometry
|
X11: remember perm_invent window geometry
|
||||||
|
X11: handle X errors via panic
|
||||||
|
|
||||||
|
|
||||||
General New Features
|
General New Features
|
||||||
|
|||||||
@@ -157,6 +157,8 @@ struct menu_info_t {
|
|||||||
XColor nh_colors[CLR_MAX];
|
XColor nh_colors[CLR_MAX];
|
||||||
|
|
||||||
XFontStruct *fs; /* Font for the window. */
|
XFontStruct *fs; /* Font for the window. */
|
||||||
|
XFontStruct *boldfs; /* Bold font */
|
||||||
|
Display *boldfs_dpy;
|
||||||
long menu_count; /* number entered by user */
|
long menu_count; /* number entered by user */
|
||||||
Dimension line_height; /* Total height of a line of text. */
|
Dimension line_height; /* Total height of a line of text. */
|
||||||
Dimension internal_height; /* Internal height between widget & border */
|
Dimension internal_height; /* Internal height between widget & border */
|
||||||
@@ -297,6 +299,7 @@ E void FDECL(positionpopup, (Widget, BOOLEAN_P));
|
|||||||
E struct xwindow *FDECL(find_widget, (Widget));
|
E struct xwindow *FDECL(find_widget, (Widget));
|
||||||
E Boolean FDECL(nhApproxColor, (Screen *, Colormap, char *, XColor *));
|
E Boolean FDECL(nhApproxColor, (Screen *, Colormap, char *, XColor *));
|
||||||
E void FDECL(get_widget_window_geometry, (Widget, int *, int *, int *, int *));
|
E void FDECL(get_widget_window_geometry, (Widget, int *, int *, int *, int *));
|
||||||
|
E char *FDECL(fontname_boldify, (const char *));
|
||||||
E Dimension FDECL(nhFontHeight, (Widget));
|
E Dimension FDECL(nhFontHeight, (Widget));
|
||||||
E char FDECL(key_event_to_char, (XKeyEvent *));
|
E char FDECL(key_event_to_char, (XKeyEvent *));
|
||||||
E void FDECL(msgkey, (Widget, XtPointer, XEvent *));
|
E void FDECL(msgkey, (Widget, XtPointer, XEvent *));
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 mon.c $NHDT-Date: 1526132509 2018/05/12 13:41:49 $ $NHDT-Branch: master $:$NHDT-Revision: 1.252 $ */
|
/* NetHack 3.6 mon.c $NHDT-Date: 1539479657 2018/10/14 01:14:17 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.260 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -2659,7 +2659,10 @@ setmangry(mtmp, via_attack)
|
|||||||
struct monst *mtmp;
|
struct monst *mtmp;
|
||||||
boolean via_attack;
|
boolean via_attack;
|
||||||
{
|
{
|
||||||
if (via_attack && sengr_at("Elbereth", u.ux, u.uy, TRUE)) {
|
if (via_attack && sengr_at("Elbereth", u.ux, u.uy, TRUE)
|
||||||
|
/* only hypocritical if monster is vulnerable to Elbereth (or
|
||||||
|
peaceful--not vulnerable but attacking it is hypocritical) */
|
||||||
|
&& (onscary(u.ux, u.uy, mtmp) || mtmp->mpeaceful)) {
|
||||||
You_feel("like a hypocrite.");
|
You_feel("like a hypocrite.");
|
||||||
/* AIS: Yes, I know alignment penalties and bonuses aren't balanced
|
/* AIS: Yes, I know alignment penalties and bonuses aren't balanced
|
||||||
at the moment. This is about correct relative to other "small"
|
at the moment. This is about correct relative to other "small"
|
||||||
@@ -2668,7 +2671,8 @@ boolean via_attack;
|
|||||||
violating your own request. I know 5 isn't actually large, but
|
violating your own request. I know 5 isn't actually large, but
|
||||||
it's intentionally larger than the 1s and 2s that are normally
|
it's intentionally larger than the 1s and 2s that are normally
|
||||||
given for this sort of thing. */
|
given for this sort of thing. */
|
||||||
adjalign(-5);
|
/* reduce to 3 (average) when alignment is already very low */
|
||||||
|
adjalign((u.ualign.record > 5) ? -5 : -rnd(5));
|
||||||
|
|
||||||
if (!Blind)
|
if (!Blind)
|
||||||
pline("The engraving beneath you fades.");
|
pline("The engraving beneath you fades.");
|
||||||
|
|||||||
+10
-6
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 u_init.c $NHDT-Date: 1526755625 2018/05/19 18:47:05 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.42 $ */
|
/* NetHack 3.6 u_init.c $NHDT-Date: 1539510426 2018/10/14 09:47:06 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.43 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2017. */
|
/*-Copyright (c) Robert Patrick Rankin, 2017. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -1112,10 +1112,13 @@ register struct trobj *trop;
|
|||||||
discover_object(POT_OIL, TRUE, FALSE);
|
discover_object(POT_OIL, TRUE, FALSE);
|
||||||
|
|
||||||
if (obj->oclass == ARMOR_CLASS) {
|
if (obj->oclass == ARMOR_CLASS) {
|
||||||
if (is_shield(obj) && !uarms) {
|
if (is_shield(obj) && !uarms && !(uwep && bimanual(uwep))) {
|
||||||
setworn(obj, W_ARMS);
|
setworn(obj, W_ARMS);
|
||||||
if (uswapwep)
|
/* 3.6.2: this used to unset uswapwep if it was set, but
|
||||||
setuswapwep((struct obj *) 0);
|
wearing a shield doesn't prevent having an alternate
|
||||||
|
weapon ready to swap with the primary; just make sure we
|
||||||
|
aren't two-weaponing (academic; no one starts that way) */
|
||||||
|
u.twoweap = FALSE;
|
||||||
} else if (is_helmet(obj) && !uarmh)
|
} else if (is_helmet(obj) && !uarmh)
|
||||||
setworn(obj, W_ARMH);
|
setworn(obj, W_ARMH);
|
||||||
else if (is_gloves(obj) && !uarmg)
|
else if (is_gloves(obj) && !uarmg)
|
||||||
@@ -1135,10 +1138,11 @@ register struct trobj *trop;
|
|||||||
if (is_ammo(obj) || is_missile(obj)) {
|
if (is_ammo(obj) || is_missile(obj)) {
|
||||||
if (!uquiver)
|
if (!uquiver)
|
||||||
setuqwep(obj);
|
setuqwep(obj);
|
||||||
} else if (!uwep)
|
} else if (!uwep && (!uarms || !bimanual(obj))) {
|
||||||
setuwep(obj);
|
setuwep(obj);
|
||||||
else if (!uswapwep)
|
} else if (!uswapwep) {
|
||||||
setuswapwep(obj);
|
setuswapwep(obj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (obj->oclass == SPBOOK_CLASS && obj->otyp != SPE_BLANK_PAPER)
|
if (obj->oclass == SPBOOK_CLASS && obj->otyp != SPE_BLANK_PAPER)
|
||||||
initialspell(obj);
|
initialspell(obj);
|
||||||
|
|||||||
@@ -966,7 +966,7 @@ $(DAT)/porthelp: $(MSWSYS)/porthelp
|
|||||||
$(subst /,\,@copy $(MSWSYS)/porthelp $@ >nul)
|
$(subst /,\,@copy $(MSWSYS)/porthelp $@ >nul)
|
||||||
|
|
||||||
nhdat: $(U)dlb_main.exe $(DAT)/data $(DAT)/oracles $(OPTIONS_FILE) \
|
nhdat: $(U)dlb_main.exe $(DAT)/data $(DAT)/oracles $(OPTIONS_FILE) \
|
||||||
$(DAT)/quest.dat $(DAT)/rumors $(DAT)/help $(DAT)/hh $(DAT)/cmdhelp \
|
$(DAT)/quest.dat $(DAT)/rumors $(DAT)/help $(DAT)/hh $(DAT)/cmdhelp $(DAT)/keyhelp \
|
||||||
$(DAT)/history $(DAT)/opthelp $(DAT)/wizhelp $(DAT)/dungeon \
|
$(DAT)/history $(DAT)/opthelp $(DAT)/wizhelp $(DAT)/dungeon \
|
||||||
$(DAT)/porthelp $(DAT)/license $(DAT)/engrave $(DAT)/epitaph $(DAT)/bogusmon $(DAT)/tribute $(O)sp_lev.tag
|
$(DAT)/porthelp $(DAT)/license $(DAT)/engrave $(DAT)/epitaph $(DAT)/bogusmon $(DAT)/tribute $(O)sp_lev.tag
|
||||||
$(subst /,\,echo data >$(DAT)/dlb.lst)
|
$(subst /,\,echo data >$(DAT)/dlb.lst)
|
||||||
@@ -980,6 +980,7 @@ nhdat: $(U)dlb_main.exe $(DAT)/data $(DAT)/oracles $(OPTIONS_FILE) \
|
|||||||
$(subst /,\,echo help >>$(DAT)/dlb.lst)
|
$(subst /,\,echo help >>$(DAT)/dlb.lst)
|
||||||
$(subst /,\,echo hh >>$(DAT)/dlb.lst)
|
$(subst /,\,echo hh >>$(DAT)/dlb.lst)
|
||||||
$(subst /,\,echo cmdhelp >>$(DAT)/dlb.lst)
|
$(subst /,\,echo cmdhelp >>$(DAT)/dlb.lst)
|
||||||
|
$(subst /,\,echo keyhelp >>$(DAT)/dlb.lst)
|
||||||
$(subst /,\,echo history >>$(DAT)/dlb.lst)
|
$(subst /,\,echo history >>$(DAT)/dlb.lst)
|
||||||
$(subst /,\,echo opthelp >>$(DAT)/dlb.lst)
|
$(subst /,\,echo opthelp >>$(DAT)/dlb.lst)
|
||||||
$(subst /,\,echo wizhelp >>$(DAT)/dlb.lst)
|
$(subst /,\,echo wizhelp >>$(DAT)/dlb.lst)
|
||||||
|
|||||||
@@ -1033,7 +1033,7 @@ $(DAT)\porthelp: $(MSWSYS)\porthelp
|
|||||||
@copy $(MSWSYS)\porthelp $@ >nul
|
@copy $(MSWSYS)\porthelp $@ >nul
|
||||||
|
|
||||||
nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \
|
nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \
|
||||||
$(DAT)\quest.dat $(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp \
|
$(DAT)\quest.dat $(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp $(DAT)\keyhelp \
|
||||||
$(DAT)\history $(DAT)\opthelp $(DAT)\wizhelp $(DAT)\dungeon $(DAT)\porthelp \
|
$(DAT)\history $(DAT)\opthelp $(DAT)\wizhelp $(DAT)\dungeon $(DAT)\porthelp \
|
||||||
$(DAT)\license $(DAT)\engrave $(DAT)\epitaph $(DAT)\bogusmon $(DAT)\tribute $(O)sp_lev.tag
|
$(DAT)\license $(DAT)\engrave $(DAT)\epitaph $(DAT)\bogusmon $(DAT)\tribute $(O)sp_lev.tag
|
||||||
cd $(DAT)
|
cd $(DAT)
|
||||||
@@ -1052,6 +1052,7 @@ nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \
|
|||||||
echo help >>dlb.lst
|
echo help >>dlb.lst
|
||||||
echo hh >>dlb.lst
|
echo hh >>dlb.lst
|
||||||
echo cmdhelp >>dlb.lst
|
echo cmdhelp >>dlb.lst
|
||||||
|
echo keyhelp >>dlb.lst
|
||||||
echo history >>dlb.lst
|
echo history >>dlb.lst
|
||||||
echo opthelp >>dlb.lst
|
echo opthelp >>dlb.lst
|
||||||
echo wizhelp >>dlb.lst
|
echo wizhelp >>dlb.lst
|
||||||
|
|||||||
+51
-3
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 winX.c $NHDT-Date: 1526429314 2018/05/16 00:08:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.50 $ */
|
/* NetHack 3.6 winX.c $NHDT-Date: 1539392992 2018/10/13 01:09:52 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.57 $ */
|
||||||
/* Copyright (c) Dean Luick, 1992 */
|
/* Copyright (c) Dean Luick, 1992 */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -85,6 +85,8 @@ int click_x, click_y, click_button; /* Click position on a map window */
|
|||||||
/* (filled by set_button_values()). */
|
/* (filled by set_button_values()). */
|
||||||
int updated_inventory;
|
int updated_inventory;
|
||||||
|
|
||||||
|
static int (*old_error_handler) (Display *, XErrorEvent *);
|
||||||
|
|
||||||
#if !defined(NO_SIGNAL) && defined(SAFERHANGUP)
|
#if !defined(NO_SIGNAL) && defined(SAFERHANGUP)
|
||||||
#if XtSpecificationRelease >= 6
|
#if XtSpecificationRelease >= 6
|
||||||
#define X11_HANGUP_SIGNAL
|
#define X11_HANGUP_SIGNAL
|
||||||
@@ -148,6 +150,7 @@ static void FDECL(nhFreePixel, (XtAppContext, XrmValuePtr, XtPointer,
|
|||||||
static boolean FDECL(new_resource_macro, (String, unsigned));
|
static boolean FDECL(new_resource_macro, (String, unsigned));
|
||||||
static void NDECL(load_default_resources);
|
static void NDECL(load_default_resources);
|
||||||
static void NDECL(release_default_resources);
|
static void NDECL(release_default_resources);
|
||||||
|
static int FDECL(panic_on_error, (Display *, XErrorEvent *));
|
||||||
#ifdef X11_HANGUP_SIGNAL
|
#ifdef X11_HANGUP_SIGNAL
|
||||||
static void FDECL(X11_sig, (int));
|
static void FDECL(X11_sig, (int));
|
||||||
static void FDECL(X11_sig_cb, (XtPointer, XtSignalId *));
|
static void FDECL(X11_sig_cb, (XtPointer, XtSignalId *));
|
||||||
@@ -484,6 +487,34 @@ int *x, *y, *width, *height;
|
|||||||
*y -= top;
|
*y -= top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Change the full font name string so the weight is "bold" */
|
||||||
|
char *
|
||||||
|
fontname_boldify(fontname)
|
||||||
|
const char *fontname;
|
||||||
|
{
|
||||||
|
static char buf[BUFSZ];
|
||||||
|
char *bufp = buf;
|
||||||
|
int idx = 0;
|
||||||
|
|
||||||
|
while (*fontname) {
|
||||||
|
if (*fontname == '-')
|
||||||
|
idx++;
|
||||||
|
*bufp = *fontname;
|
||||||
|
if (idx == 3) {
|
||||||
|
strcat(buf, "bold");
|
||||||
|
bufp += 5;
|
||||||
|
do {
|
||||||
|
fontname++;
|
||||||
|
} while (*fontname && *fontname != '-');
|
||||||
|
} else {
|
||||||
|
bufp++;
|
||||||
|
fontname++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*bufp = '\0';
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef TEXTCOLOR
|
#ifdef TEXTCOLOR
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
@@ -1245,6 +1276,21 @@ static XtResource resources[] = {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int
|
||||||
|
panic_on_error(display, error)
|
||||||
|
Display *display;
|
||||||
|
XErrorEvent *error;
|
||||||
|
{
|
||||||
|
char buf[BUFSZ];
|
||||||
|
XGetErrorText(display, error->error_code, buf, BUFSZ);
|
||||||
|
fprintf(stderr, "X Error: code %i (%s), request %i, minor %i, serial %lu\n",
|
||||||
|
error->error_code, buf,
|
||||||
|
error->request_code, error->minor_code,
|
||||||
|
error->serial);
|
||||||
|
panic("X Error");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
X11_init_nhwindows(argcp, argv)
|
X11_init_nhwindows(argcp, argv)
|
||||||
int *argcp;
|
int *argcp;
|
||||||
@@ -1290,6 +1336,8 @@ char **argv;
|
|||||||
|
|
||||||
/* We don't need to realize the top level widget. */
|
/* We don't need to realize the top level widget. */
|
||||||
|
|
||||||
|
old_error_handler = XSetErrorHandler(panic_on_error);
|
||||||
|
|
||||||
#ifdef TEXTCOLOR
|
#ifdef TEXTCOLOR
|
||||||
/* add new color converter to deal with overused colormaps */
|
/* add new color converter to deal with overused colormaps */
|
||||||
XtSetTypeConverter(XtRString, XtRPixel, nhCvtStringToPixel,
|
XtSetTypeConverter(XtRString, XtRPixel, nhCvtStringToPixel,
|
||||||
@@ -2511,7 +2559,7 @@ String *params;
|
|||||||
Cardinal *num_params;
|
Cardinal *num_params;
|
||||||
{
|
{
|
||||||
Arg arg[2];
|
Arg arg[2];
|
||||||
Widget horiz_sb, vert_sb;
|
Widget horiz_sb, vert_sb, scrollw;
|
||||||
float top, shown;
|
float top, shown;
|
||||||
Boolean do_call;
|
Boolean do_call;
|
||||||
int direction;
|
int direction;
|
||||||
@@ -2524,7 +2572,7 @@ Cardinal *num_params;
|
|||||||
|
|
||||||
direction = atoi(params[0]);
|
direction = atoi(params[0]);
|
||||||
|
|
||||||
Widget scrollw = viewport;
|
scrollw = viewport;
|
||||||
do {
|
do {
|
||||||
horiz_sb = XtNameToWidget(scrollw, "*horizontal");
|
horiz_sb = XtNameToWidget(scrollw, "*horizontal");
|
||||||
vert_sb = XtNameToWidget(scrollw, "*vertical");
|
vert_sb = XtNameToWidget(scrollw, "*vertical");
|
||||||
|
|||||||
@@ -778,6 +778,31 @@ Widget form,under;
|
|||||||
return all;
|
return all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
load_boldfont(wp, w)
|
||||||
|
struct xwindow *wp;
|
||||||
|
Widget w;
|
||||||
|
{
|
||||||
|
Arg args[1];
|
||||||
|
XFontStruct *fs;
|
||||||
|
unsigned long ret;
|
||||||
|
char *fontname;
|
||||||
|
Display *dpy;
|
||||||
|
|
||||||
|
if (wp->menu_information->boldfs)
|
||||||
|
return;
|
||||||
|
|
||||||
|
XtSetArg(args[0], nhStr(XtNfont), &fs);
|
||||||
|
XtGetValues(w, args, 1);
|
||||||
|
|
||||||
|
if (!XGetFontProperty(fs, XA_FONT, &ret))
|
||||||
|
return;
|
||||||
|
|
||||||
|
wp->menu_information->boldfs_dpy = dpy = XtDisplay(w);
|
||||||
|
fontname = fontname_boldify(XGetAtomName(dpy, (Atom)ret));
|
||||||
|
wp->menu_information->boldfs = XLoadQueryFont(dpy, fontname);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
menu_create_entries(wp, curr_menu)
|
menu_create_entries(wp, curr_menu)
|
||||||
struct xwindow *wp;
|
struct xwindow *wp;
|
||||||
@@ -843,6 +868,13 @@ struct menu *curr_menu;
|
|||||||
: labelWidgetClass,
|
: labelWidgetClass,
|
||||||
wp->w, args, num_args);
|
wp->w, args, num_args);
|
||||||
|
|
||||||
|
if (attr == ATR_BOLD) {
|
||||||
|
load_boldfont(wp, curr->w);
|
||||||
|
num_args = 0;
|
||||||
|
XtSetArg(args[num_args], nhStr(XtNfont), wp->menu_information->boldfs); num_args++;
|
||||||
|
XtSetValues(curr->w, args, num_args);
|
||||||
|
}
|
||||||
|
|
||||||
if (canpick)
|
if (canpick)
|
||||||
XtAddCallback(linewidget, XtNcallback, menu_select,
|
XtAddCallback(linewidget, XtNcallback, menu_select,
|
||||||
(XtPointer) curr);
|
(XtPointer) curr);
|
||||||
@@ -1001,6 +1033,13 @@ menu_item **menu_list;
|
|||||||
if (menu_info->is_up && permi && menu_info->curr_menu.base) {
|
if (menu_info->is_up && permi && menu_info->curr_menu.base) {
|
||||||
/* perm_invent window - explicitly destroy old menu entry widgets,
|
/* perm_invent window - explicitly destroy old menu entry widgets,
|
||||||
without recreating whole window */
|
without recreating whole window */
|
||||||
|
WidgetList wlist;
|
||||||
|
Cardinal numchild;
|
||||||
|
num_args = 0;
|
||||||
|
XtSetArg(args[num_args], XtNchildren, &wlist); num_args++;
|
||||||
|
XtSetArg(args[num_args], XtNnumChildren, &numchild); num_args++;
|
||||||
|
XtGetValues(wp->w, args, num_args);
|
||||||
|
XtUnmanageChildren(wlist, numchild);
|
||||||
for (curr = menu_info->curr_menu.base; curr; curr = curr->next)
|
for (curr = menu_info->curr_menu.base; curr; curr = curr->next)
|
||||||
if (curr->w)
|
if (curr->w)
|
||||||
XtDestroyWidget(curr->w);
|
XtDestroyWidget(curr->w);
|
||||||
@@ -1285,6 +1324,8 @@ destroy_menu_window(wp)
|
|||||||
struct xwindow *wp;
|
struct xwindow *wp;
|
||||||
{
|
{
|
||||||
clear_old_menu(wp); /* this will also destroy the widgets */
|
clear_old_menu(wp); /* this will also destroy the widgets */
|
||||||
|
if (wp->menu_information->boldfs)
|
||||||
|
XFreeFont(wp->menu_information->boldfs_dpy, wp->menu_information->boldfs);
|
||||||
free((genericptr_t) wp->menu_information);
|
free((genericptr_t) wp->menu_information);
|
||||||
wp->menu_information = (struct menu_info_t *) 0;
|
wp->menu_information = (struct menu_info_t *) 0;
|
||||||
wp->type = NHW_NONE; /* allow re-use */
|
wp->type = NHW_NONE; /* allow re-use */
|
||||||
|
|||||||
@@ -218,6 +218,7 @@
|
|||||||
<DlbList Include = "$(DatDir)porthelp"/>
|
<DlbList Include = "$(DatDir)porthelp"/>
|
||||||
<DlbList Include = "$(DatDir)hh"/>
|
<DlbList Include = "$(DatDir)hh"/>
|
||||||
<DlbList Include = "$(DatDir)cmdhelp"/>
|
<DlbList Include = "$(DatDir)cmdhelp"/>
|
||||||
|
<DlbList Include = "$(DatDir)keyhelp"/>
|
||||||
<DlbList Include = "$(DatDir)history"/>
|
<DlbList Include = "$(DatDir)history"/>
|
||||||
<DlbList Include = "$(DatDir)opthelp"/>
|
<DlbList Include = "$(DatDir)opthelp"/>
|
||||||
<DlbList Include = "$(DatDir)wizhelp"/>
|
<DlbList Include = "$(DatDir)wizhelp"/>
|
||||||
@@ -225,4 +226,4 @@
|
|||||||
<DlbList Include = "$(DatDir)license"/>
|
<DlbList Include = "$(DatDir)license"/>
|
||||||
<DlbList Include = "$(DatDir)*.lev"/>
|
<DlbList Include = "$(DatDir)*.lev"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -218,6 +218,7 @@
|
|||||||
<DlbList Include = "$(DatDir)porthelp"/>
|
<DlbList Include = "$(DatDir)porthelp"/>
|
||||||
<DlbList Include = "$(DatDir)hh"/>
|
<DlbList Include = "$(DatDir)hh"/>
|
||||||
<DlbList Include = "$(DatDir)cmdhelp"/>
|
<DlbList Include = "$(DatDir)cmdhelp"/>
|
||||||
|
<DlbList Include = "$(DatDir)keyhelp"/>
|
||||||
<DlbList Include = "$(DatDir)history"/>
|
<DlbList Include = "$(DatDir)history"/>
|
||||||
<DlbList Include = "$(DatDir)opthelp"/>
|
<DlbList Include = "$(DatDir)opthelp"/>
|
||||||
<DlbList Include = "$(DatDir)wizhelp"/>
|
<DlbList Include = "$(DatDir)wizhelp"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user