extern char *fontname_boldify(const char *);
extern Dimension nhFontHeight(Widget);
extern char key_event_to_char(XKeyEvent *);
-extern void msgkey(Widget, XtPointer, XEvent *);
+extern void msgkey(Widget, XtPointer, XEvent *, Boolean *);
extern void highlight_yn(boolean);
extern void nh_XtPopup(Widget, int, Widget);
extern void nh_XtPopdown(Widget);
X11_destroy_nhwindow(window);
*wp = window_list[new_win];
window_list[new_win].type = NHW_NONE; /* allow re-use */
- /* fall though to add text */
+ /* fall through */
case NHW_TEXT:
add_to_text_window(wp, attr, str);
break;
return 0;
}
+static void
+X11_error_handler(String str)
+{
+ nhUse(str);
+ hangup(1);
+}
+
+static int
+X11_io_error_handler(Display *display)
+{
+ nhUse(display);
+ hangup(1);
+ return 0;
+}
+
void
X11_init_nhwindows(int *argcp, char **argv)
{
savuid = geteuid();
(void) seteuid(getuid());
- XSetIOErrorHandler((XIOErrorHandler) hangup);
+ XSetIOErrorHandler((XIOErrorHandler) X11_io_error_handler);
num_args = 0;
XtSetArg(args[num_args], XtNallowShellResize, True); num_args++;
/*ARGSUSED*/
void
-msgkey(Widget w, XtPointer data, XEvent *event)
+msgkey(Widget w, XtPointer data, XEvent *event, Boolean *continue_to_dispatch)
{
Cardinal num = 0;
nhUse(w);
nhUse(data);
+ nhUse(continue_to_dispatch);
map_input(window_list[WIN_MAP].w, event, (String *) 0, &num);
}
set_message_slider(&window_list[message_win]);
/* attempt to catch fatal X11 errors before the program quits */
- (void) XtAppSetErrorHandler(app_context, (XtErrorHandler) hangup);
+ (void) XtAppSetErrorHandler(app_context, X11_error_handler);
highlight_yn(TRUE); /* switch foreground and background */
static void
map_update(struct xwindow *wp, int start_row, int stop_row, int start_col, int stop_col, boolean inverted)
{
- int win_start_row, win_start_col;
struct map_info_t *map_info = wp->map_information;
int row;
register int count;
printf("update: [0x%x] %d %d %d %d\n",
(int) wp->w, start_row, stop_row, start_col, stop_col);
#endif
- win_start_row = start_row;
- win_start_col = start_col;
if (map_info->is_tile) {
struct tile_map_info_t *tile_map = &map_info->tile_map;
#else /* !TEXTCOLOR */
{
int win_row, win_xstart;
+ int win_start_row, win_start_col;
+
+ win_start_row = start_row;
+ win_start_col = start_col;
/* We always start at the same x window position and have
the same character count. */
int nrole = plsel_n_roles;
int nrace = plsel_n_races;
int ro, ra, al, ge;
- boolean fully_specified_role, choose_race_first;
+ boolean choose_race_first;
boolean picksomething = (flags.initrole == ROLE_NONE
|| flags.initrace == ROLE_NONE
|| flags.initgend == ROLE_NONE
ro = flags.initrole;
if (ro == ROLE_NONE || ro == ROLE_RANDOM) {
ro = rn2(nrole);
- if (flags.initrole != ROLE_RANDOM) {
- fully_specified_role = FALSE;
- }
}
ra = flags.initrace;
if (ra == ROLE_NONE || ra == ROLE_RANDOM) {
ra = rn2(nrace);
if (flags.initrace != ROLE_RANDOM) {
- fully_specified_role = FALSE;
}
}
while (!validrace(ro, ra)) {
if (choose_race_first) {
ro = rn2(nrole);
- if (flags.initrole != ROLE_RANDOM) {
- fully_specified_role = FALSE;
- }
} else {
ra = rn2(nrace);
- if (flags.initrace != ROLE_RANDOM) {
- fully_specified_role = FALSE;
- }
}
}
ge = flags.initgend;
if (ge == ROLE_NONE) {
ge = rn2(ROLE_GENDERS);
- fully_specified_role = FALSE;
}
while (!validgend(ro, ra, ge)) {
ge = rn2(ROLE_GENDERS);
al = flags.initalign;
if (al == ROLE_NONE) {
al = rn2(ROLE_ALIGNS);
- fully_specified_role = FALSE;
}
while (!validalign(ro, ra, al)) {
al = rn2(ROLE_ALIGNS);