home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
games
/
volume11
/
reve
/
patch4b
/
patches04b
Wrap
Text File
|
1991-01-03
|
50KB
|
1,617 lines
------- sunview.c -------
*** /tmp/da06711 Tue Dec 18 10:04:12 1990
--- sunview.c Sat Dec 15 19:14:12 1990
***************
*** 49,54 ****
--- 49,55 ----
#define WINDOW_SET (void) window_set
#define NORMALFONT "/usr/lib/fonts/fixedwidthfonts/screen.r.12"
+ #define HELPFONT "/usr/lib/fonts/fixedwidthfonts/screen.r.10"
#define BOLDFONT "/usr/lib/fonts/fixedwidthfonts/screen.b.12"
mpr_static(button_stencil_pr, 64, 64, 1, button_stencil_image) ;
***************
*** 68,81 ****
mpr_static(hglass_pr, 16, 16, 1, hglass_image) ;
mpr_static(nocur_pr, 16, 16, 1, nocur_image) ;
! Canvas canvas, pcanvas ;
Cursor cursor[MAXCURSORS] ;
Event *cur_event ;
! Frame frame, pframe ;
Icon reve_icon ;
Pixfont *font[MAXFONTS] ;
Pixrect *images[MAXIMAGES] ;
! Pixwin *cpw, *ppw ;
void pw_batch() ;
int opvals[3] ; /* Pixrect rasterop values. */
--- 69,82 ----
mpr_static(hglass_pr, 16, 16, 1, hglass_image) ;
mpr_static(nocur_pr, 16, 16, 1, nocur_image) ;
! Canvas canvas, hcanvas, pcanvas ;
Cursor cursor[MAXCURSORS] ;
Event *cur_event ;
! Frame frame, hframe, pframe ;
Icon reve_icon ;
Pixfont *font[MAXFONTS] ;
Pixrect *images[MAXIMAGES] ;
! Pixwin *cpw, *hpw, *ppw ;
void pw_batch() ;
int opvals[3] ; /* Pixrect rasterop values. */
***************
*** 101,106 ****
--- 102,108 ----
Event *event ;
{
if (c == canvas) curwin = W_MAIN ;
+ else if (c == hcanvas) curwin = W_HELP ;
else if (c == pcanvas) curwin = W_PROPS ;
cur_event = event ;
***************
*** 109,126 ****
void
- close_frame(wtype) /* Iconise reve window. */
- enum win_type wtype ;
- {
- Frame f ;
-
- if (wtype == W_MAIN) f = frame ;
- else f = pframe ;
- WINDOW_SET(f, FRAME_CLOSED, TRUE, 0) ;
- }
-
-
- void
color_area(wtype, x, y, width, height, color)
enum win_type wtype ;
int x, y, width, height, color ;
--- 111,116 ----
***************
*** 127,133 ****
{
Pixwin *pw ;
! pw = (wtype == W_MAIN) ? cpw : ppw ;
PW_WRITEBACKGROUND(pw, x, y, width, height, PIX_SRC | PIX_COLOR(color)) ;
}
--- 117,125 ----
{
Pixwin *pw ;
! if (wtype == W_MAIN) pw = cpw ;
! else if (wtype == W_HELP) pw = hpw ;
! else if (wtype == W_PROPS) pw = ppw ;
PW_WRITEBACKGROUND(pw, x, y, width, height, PIX_SRC | PIX_COLOR(color)) ;
}
***************
*** 147,153 ****
{
Pixwin *pw ;
! pw = (wtype == W_MAIN) ? cpw : ppw ;
PW_ROP(pw, x, y, width, height, PIX_SRC | PIX_DST,
images[(int) image], 0, 0) ;
}
--- 139,147 ----
{
Pixwin *pw ;
! if (wtype == W_MAIN) pw = cpw ;
! else if (wtype == W_HELP) pw = hpw ;
! else if (wtype == W_PROPS) pw = ppw ;
PW_ROP(pw, x, y, width, height, PIX_SRC | PIX_DST,
images[(int) image], 0, 0) ;
}
***************
*** 162,168 ****
Pixwin *pw ;
int rop ;
! pw = (wtype == W_MAIN) ? cpw : ppw ;
rop = opvals[(int) op] ;
if (!iscolor[(int) cur_dpyno] && color == C_WHITE)
rop = opvals[(int) RCLR] ;
--- 156,164 ----
Pixwin *pw ;
int rop ;
! if (wtype == W_MAIN) pw = cpw ;
! else if (wtype == W_HELP) pw = hpw ;
! else if (wtype == W_PROPS) pw = ppw ;
rop = opvals[(int) op] ;
if (!iscolor[(int) cur_dpyno] && color == C_WHITE)
rop = opvals[(int) RCLR] ;
***************
*** 180,186 ****
Pixwin *pw ;
int rop ;
! pw = (wtype == W_MAIN) ? cpw : ppw ;
rop = opvals[(int) op] | PIX_COLOR(color) ;
PW_STENCIL(pw, x, y, width, height, rop,
images[(int) stencil], 0, 0, images[(int) image], 0, 0) ;
--- 176,184 ----
Pixwin *pw ;
int rop ;
! if (wtype == W_MAIN) pw = cpw ;
! else if (wtype == W_HELP) pw = hpw ;
! else if (wtype == W_PROPS) pw = ppw ;
rop = opvals[(int) op] | PIX_COLOR(color) ;
PW_STENCIL(pw, x, y, width, height, rop,
images[(int) stencil], 0, 0, images[(int) image], 0, 0) ;
***************
*** 196,202 ****
{
Pixwin *pw ;
! pw = (wtype == W_MAIN) ? cpw : ppw ;
PW_TTEXT(pw, x, y, PIX_SRC | PIX_COLOR(color), font[(int) ftype], str) ;
}
--- 194,202 ----
{
Pixwin *pw ;
! if (wtype == W_MAIN) pw = cpw ;
! else if (wtype == W_HELP) pw = hpw ;
! else if (wtype == W_PROPS) pw = ppw ;
PW_TTEXT(pw, x, y, PIX_SRC | PIX_COLOR(color), font[(int) ftype], str) ;
}
***************
*** 218,223 ****
--- 218,224 ----
}
+ /*ARGSUSED*/
char *
get_resource(rtype) /* Null routine (currently only X11 and XView). */
enum res_type rtype ;
***************
*** 241,252 ****
--- 242,256 ----
init_fonts() /* Open the normal and bold fonts. */
{
font[(int) BFONT] = get_font(BOLDFONT) ;
+ font[(int) HFONT] = get_font(HELPFONT) ;
font[(int) NFONT] = get_font(NORMALFONT) ;
bfont_height = font[(int) BFONT]->pf_defaultsize.y ;
+ hfont_height = font[(int) HFONT]->pf_defaultsize.y ;
nfont_height = font[(int) NFONT]->pf_defaultsize.y ;
}
+ /*ARGSUSED*/
init_graphics(argc, argv)
int *argc ;
char *argv[] ;
***************
*** 272,292 ****
{
Pixwin *frame_pw ;
char colorname[CMS_NAMESIZE] ;
- u_char red[OTH_COLORSIZE], green[OTH_COLORSIZE], blue[OTH_COLORSIZE] ;
iscolor[(int) cur_dpyno] = (cpw->pw_pixrect->pr_depth == 8) ? 1 : 0 ;
! SPRINTF(colorname, "%s%D", OTH_COLOR, getpid()) ;
PW_SETCMSNAME(cpw, colorname) ;
! oth_colorsetup(red, green, blue) ;
! PW_PUTCOLORMAP(cpw, 0, OTH_COLORSIZE, red, green, blue) ;
! if (inv_video) PW_REVERSEVIDEO(cpw, 0, OTH_COLORSIZE) ;
if (iscolor[(int) cur_dpyno])
{
frame_pw = (Pixwin *) window_get(frame, WIN_PIXWIN) ;
PW_SETCMSNAME(frame_pw, colorname) ;
! PW_PUTCOLORMAP(frame_pw, 0, OTH_COLORSIZE, red, green, blue) ;
}
}
--- 276,294 ----
{
Pixwin *frame_pw ;
char colorname[CMS_NAMESIZE] ;
iscolor[(int) cur_dpyno] = (cpw->pw_pixrect->pr_depth == 8) ? 1 : 0 ;
! SPRINTF(colorname, "%s%D", REVE_COLOR, getpid()) ;
PW_SETCMSNAME(cpw, colorname) ;
! PW_PUTCOLORMAP(cpw, 0, REVE_COLORSIZE, rcols, gcols, bcols) ;
! if (inv_video) PW_REVERSEVIDEO(cpw, 0, REVE_COLORSIZE) ;
if (iscolor[(int) cur_dpyno])
{
frame_pw = (Pixwin *) window_get(frame, WIN_PIXWIN) ;
PW_SETCMSNAME(frame_pw, colorname) ;
! PW_PUTCOLORMAP(frame_pw, 0, REVE_COLORSIZE, rcols, gcols, bcols) ;
}
}
***************
*** 315,321 ****
void
make_canvas() /* Create canvas for game board. */
{
! canvas = window_create(frame, CANVAS,
CANVAS_RETAINED, FALSE,
WIN_HEIGHT, TOTAL_HEIGHT,
WIN_WIDTH, TOTAL_WIDTH,
--- 317,323 ----
void
make_canvas() /* Create canvas for game board. */
{
! canvas = window_create(frame, CANVAS,
CANVAS_RETAINED, FALSE,
WIN_HEIGHT, TOTAL_HEIGHT,
WIN_WIDTH, TOTAL_WIDTH,
***************
*** 331,337 ****
0) ;
cpw = (Pixwin *) window_get(canvas, CANVAS_PIXWIN) ;
! pcanvas = window_create(pframe, CANVAS,
CANVAS_RETAINED, FALSE,
WIN_HEIGHT, PROPS_HEIGHT,
WIN_WIDTH, PROPS_WIDTH,
--- 333,339 ----
0) ;
cpw = (Pixwin *) window_get(canvas, CANVAS_PIXWIN) ;
! pcanvas = window_create(pframe, CANVAS,
CANVAS_RETAINED, FALSE,
WIN_HEIGHT, PROPS_HEIGHT,
WIN_WIDTH, PROPS_WIDTH,
***************
*** 395,415 ****
void
! make_icon()
{
! reve_icon = icon_create(ICON_IMAGE, &icon_pr, 0) ;
}
void
! open_frame(wtype)
! enum win_type wtype ;
{
! Frame f ;
!
! if (wtype == W_MAIN) f = frame ;
! else f = pframe ;
! WINDOW_SET(f, WIN_SHOW, TRUE, 0) ;
}
--- 397,440 ----
void
! make_help_window(argc, argv)
! int argc ;
! char *argv[] ;
{
! int fontwidth ;
!
! hframe = window_create((Window) NULL, FRAME,
! FRAME_ICON, reve_icon,
! FRAME_LABEL, "reve help",
! FRAME_NO_CONFIRM, TRUE,
! WIN_ERROR_MSG, "Can't create window.",
! FRAME_ARGS, argc, argv,
! 0) ;
!
! fontwidth = font[(int) HFONT]->pf_defaultsize.x ;
! help_height = ((hfont_height + 1) * HELP_ROWS) + (4 * CGAP) + CHEIGHT ;
! help_width = (fontwidth * HELP_COLS) + (2 * CGAP) ;
!
! hcanvas = window_create(hframe, CANVAS,
! CANVAS_RETAINED, FALSE,
! WIN_HEIGHT, help_height,
! WIN_WIDTH, help_width,
! WIN_CONSUME_PICK_EVENTS,
! MS_LEFT, MS_MIDDLE,
! 0,
! WIN_CONSUME_KBD_EVENTS,
! KBD_USE, KBD_DONE, WIN_ASCII_EVENTS, WIN_UP_EVENTS,
! 0,
! WIN_EVENT_PROC, canvas_proc,
! 0) ;
! hpw = (Pixwin *) window_get(hcanvas, CANVAS_PIXWIN) ;
}
void
! make_icon()
{
! reve_icon = icon_create(ICON_IMAGE, &icon_pr, 0) ;
}
***************
*** 446,452 ****
nextc = MOUSE_MOVING ;
else if (id == WIN_REPAINT)
{
! if (curwin == W_MAIN) nextc = FRAME_REPAINT ;
else if (curwin == W_PROPS) nextc = PROPS_REPAINT ;
}
}
--- 471,478 ----
nextc = MOUSE_MOVING ;
else if (id == WIN_REPAINT)
{
! if (curwin == W_MAIN) nextc = FRAME_REPAINT ;
! else if (curwin == W_HELP) nextc = HELP_REPAINT ;
else if (curwin == W_PROPS) nextc = PROPS_REPAINT ;
}
}
***************
*** 460,465 ****
--- 486,504 ----
}
+ void
+ set_frame(wtype, showing)
+ enum win_type wtype ;
+ int showing ;
+ {
+ Frame f ;
+
+ if (wtype == W_HELP) f = hframe ;
+ else if (wtype == W_PROPS) f = pframe ;
+ WINDOW_SET(f, WIN_SHOW, showing, 0) ;
+ }
+
+
/*ARGSUSED*/
void
start_tool(dtype) /* Display window and start the notifier. */
***************
*** 472,477 ****
--- 511,517 ----
WINDOW_SET(frame, FRAME_ICON, reve_icon, 0) ;
}
window_fit(frame) ;
+ window_fit(hframe) ;
window_fit(pframe) ;
window_main_loop(frame) ;
}
------- tty.c -------
*** /tmp/da06714 Tue Dec 18 10:04:13 1990
--- tty.c Sat Dec 15 19:42:20 1990
***************
*** 65,74 ****
{ 1, 1, 43, 32, }, /* Load */
{ 11, 1, 117, 32, }, /* Moves? */
{ 22, 1, 191, 32, }, /* New game */
! { 33, 1, 265, 32, }, /* Save */
! { 44, 1, 339, 32, }, /* Suggest */
! { 55, 1, 413, 32, }, /* Undo */
! { -1, -1, 43, 74, }, /* Props (not displayed). */
{ -1, -1, 339, 74, }, /* Cancel (not displayed). */
{ -1, -1, 413, 74, }, /* Quit (not displayed). */
{ 60, 5, 15, 111, }, /* Black: */
--- 65,78 ----
{ 1, 1, 43, 32, }, /* Load */
{ 11, 1, 117, 32, }, /* Moves? */
{ 22, 1, 191, 32, }, /* New game */
! { -1, -1, 265, 32, }, /* Help (not displayed). */
! { -1, -1, 339, 32, }, /* Redo (not displayed). */
! { -1, -1, 413, 32, }, /* Props (not displayed). */
! { 33, 1, 43, 74, }, /* Save */
! { 44, 1, 117, 74, }, /* Suggest */
! { -1, -1, 191, 74, }, /* Edit (not displayed). */
! { -1, -1, 265, 74, }, /* Stop (not displayed). */
! { 55, 1, 339, 74, }, /* Undo */
{ -1, -1, 339, 74, }, /* Cancel (not displayed). */
{ -1, -1, 413, 74, }, /* Quit (not displayed). */
{ 60, 5, 15, 111, }, /* Black: */
***************
*** 86,91 ****
--- 90,96 ----
{ -1, -1, -1, -1, }, /* Show evaluation option. */
{ -1, -1, -1, -1, }, /* Number move option. */
{ -1, -1, -1, -1, }, /* Quick game option. */
+ { -1, -1, -1, -1, }, /* Help window page cycle.*/
} ;
struct other_info { /* Information needed to place other text values. */
***************
*** 97,106 ****
{ -1, -1, }, /* Load (ignored). */
{ -1, -1, }, /* Moves? (ignored). */
{ -1, -1, }, /* New game (ignored). */
{ -1, -1, }, /* Save (ignored). */
{ -1, -1, }, /* Suggest (ignored). */
{ -1, -1, }, /* Undo (ignored). */
- { -1, -1, }, /* Done (ignored). */
{ -1, -1, }, /* Cancel (ignored). */
{ -1, -1, }, /* Quit (ignored). */
{ 38, 5, }, /* Black: */
--- 102,115 ----
{ -1, -1, }, /* Load (ignored). */
{ -1, -1, }, /* Moves? (ignored). */
{ -1, -1, }, /* New game (ignored). */
+ { -1, -1, }, /* Help (ignored). */
+ { -1, -1, }, /* Redo (ignored). */
+ { -1, -1, }, /* Props (ignored). */
{ -1, -1, }, /* Save (ignored). */
{ -1, -1, }, /* Suggest (ignored). */
+ { -1, -1, }, /* Edit (ignored). */
+ { -1, -1, }, /* Stop (ignored). */
{ -1, -1, }, /* Undo (ignored). */
{ -1, -1, }, /* Cancel (ignored). */
{ -1, -1, }, /* Quit (ignored). */
{ 38, 5, }, /* Black: */
***************
*** 118,123 ****
--- 127,133 ----
{ 60, 11, }, /* Show evaluation option. */
{ -1, -1, }, /* Number move option. */
{ -1, -1, }, /* Quick game option. */
+ { -1, -1, }, /* Help window page cycle. */
} ;
***************
*** 135,145 ****
{}
- void
- close_frame() /* This option does nothing with termcap. */
- {}
-
-
/*ARGSUSED*/
void
color_area(wtype, x, y, width, height, color)
--- 145,150 ----
***************
*** 532,550 ****
}
- void
- make_icon() /* Null routine - no icon in termcap version. */
- {}
-
-
/*ARGSUSED*/
void
! open_frame(wtype)
! enum win_type wtype ;
{
}
static void
outc(c) /* Output the next character to the screen. */
register int c ;
--- 537,556 ----
}
/*ARGSUSED*/
void
! make_help_window(argc, argv)
! int argc ;
! char *argv[] ;
{
}
+ void
+ make_icon() /* Null routine - no icon in termcap version. */
+ {}
+
+
static void
outc(c) /* Output the next character to the screen. */
register int c ;
***************
*** 575,580 ****
--- 581,594 ----
void
set_cursor(cursor) /* No cursors in termcap version. */
enum curtype cursor ;
+ {}
+
+
+ /*ARGSUSED*/
+ void
+ set_frame(wtype, showing)
+ enum win_type wtype ;
+ int showing ;
{}
------- x11.c -------
*** /tmp/da06717 Tue Dec 18 10:04:15 1990
--- x11.c Mon Dec 17 10:26:26 1990
***************
*** 41,46 ****
--- 41,47 ----
#define BOLDFONT "lucidasanstypewriter-bold-12"
#define DEFFONT "fixed"
+ #define HELPFONT "lucidasanstypewriter-10"
#define NORMALFONT "lucidasanstypewriter-12"
#define FRAME_MASK (ButtonPressMask | ButtonReleaseMask | ExposureMask | \
***************
*** 63,75 ****
Pixmap images[MAXIMAGES] ;
Pixmap no_pixmap ;
Pixmap load_color_icon(), load_image(), reve_icon[MAXDPY] ;
! Window frame[MAXDPY], pframe[MAXDPY], root[MAXDPY] ;
XClassHint class_hint = { "reve", "Reve" } ;
XColor BGcolor, FGcolor ;
XEvent event ;
XFontStruct *font[MAXFONTS] ;
XrmDatabase reve_DB[MAXDPY] ; /* Combined resources database. */
! XSizeHints psize, size ;
XWMHints wm_hints ;
XGCValues gc_val ; /* Used to setup graphics context values. */
int gc_flags ; /* Used to set up graphics context flags. */
--- 64,76 ----
Pixmap images[MAXIMAGES] ;
Pixmap no_pixmap ;
Pixmap load_color_icon(), load_image(), reve_icon[MAXDPY] ;
! Window frame[MAXDPY], hframe[MAXDPY], pframe[MAXDPY], root[MAXDPY] ;
XClassHint class_hint = { "reve", "Reve" } ;
XColor BGcolor, FGcolor ;
XEvent event ;
XFontStruct *font[MAXFONTS] ;
XrmDatabase reve_DB[MAXDPY] ; /* Combined resources database. */
! XSizeHints size ;
XWMHints wm_hints ;
XGCValues gc_val ; /* Used to setup graphics context values. */
int gc_flags ; /* Used to set up graphics context flags. */
***************
*** 78,84 ****
unsigned long backgnd[MAXDPY] ; /* Default background color. */
unsigned long foregnd[MAXDPY] ; /* Default foreground color. */
unsigned long gc_mask ; /* Mask for setting graphic context values. */
! unsigned long palette[OTH_COLORSIZE] ; /* Xlib color palette. */
#ifndef NOSELECT
#ifdef NO_43SELECT
--- 79,85 ----
unsigned long backgnd[MAXDPY] ; /* Default background color. */
unsigned long foregnd[MAXDPY] ; /* Default foreground color. */
unsigned long gc_mask ; /* Mask for setting graphic context values. */
! unsigned long palette[REVE_COLORSIZE] ; /* Xlib color palette. */
#ifndef NOSELECT
#ifdef NO_43SELECT
***************
*** 143,172 ****
void
- close_frame(wtype) /* Iconise reve window. */
- enum win_type wtype ;
- {
- int d ;
- XEvent event ;
- Window window ;
-
- d = (int) cur_dpyno ;
- if (wtype == W_MAIN) window = frame[d] ;
- else window = pframe[d] ;
-
- iconic = 1 ;
- event.xclient.type = ClientMessage ;
- event.xclient.display = dpy[d] ;
- event.xclient.window = window ;
- event.xclient.message_type = XInternAtom(dpy[d], "WM_CHANGE_STATE", False) ;
- event.xclient.format = 32 ;
- event.xclient.data.l[0] = IconicState ;
- XSendEvent(dpy[d], DefaultRootWindow(dpy[d]), False,
- SubstructureRedirectMask | SubstructureNotifyMask, &event) ;
- }
-
-
- void
color_area(wtype, x, y, width, height, color)
enum win_type wtype ;
int x, y, width, height, color ;
--- 144,149 ----
***************
*** 175,181 ****
int d ;
d = (int) cur_dpyno ;
! window = (wtype == W_MAIN) ? frame[d] : pframe[d] ;
if (iscolor[d]) gc_val.foreground = palette[color] ;
else
{
--- 152,161 ----
int d ;
d = (int) cur_dpyno ;
! if (wtype == W_MAIN) window = frame[d] ;
! else if (wtype == W_HELP) window = hframe[d] ;
! else if (wtype == W_PROPS) window = pframe[d] ;
!
if (iscolor[d]) gc_val.foreground = palette[color] ;
else
{
***************
*** 206,212 ****
int d ;
d = (int) cur_dpyno ;
! window = (wtype == W_MAIN) ? frame[d] : pframe[d] ;
gc_mask = GCStipple | GCTileStipXOrigin | GCTileStipYOrigin ;
gc_val.stipple = images[(int) image] ;
gc_val.ts_x_origin = x ;
--- 186,195 ----
int d ;
d = (int) cur_dpyno ;
! if (wtype == W_MAIN) window = frame[d] ;
! else if (wtype == W_HELP) window = hframe[d] ;
! else if (wtype == W_PROPS) window = pframe[d] ;
!
gc_mask = GCStipple | GCTileStipXOrigin | GCTileStipYOrigin ;
gc_val.stipple = images[(int) image] ;
gc_val.ts_x_origin = x ;
***************
*** 226,232 ****
int d ;
d = (int) cur_dpyno ;
! window = (wtype == W_MAIN) ? frame[d] : pframe[d] ;
if (iscolor[d]) gc_val.foreground = palette[color] ;
else
{
--- 209,218 ----
int d ;
d = (int) cur_dpyno ;
! if (wtype == W_MAIN) window = frame[d] ;
! else if (wtype == W_HELP) window = hframe[d] ;
! else if (wtype == W_PROPS) window = pframe[d] ;
!
if (iscolor[d]) gc_val.foreground = palette[color] ;
else
{
***************
*** 250,256 ****
int d ;
d = (int) cur_dpyno ;
! window = (wtype == W_MAIN) ? frame[d] : pframe[d] ;
if (iscolor[d]) gc_val.foreground = palette[color] ;
else gc_val.foreground = foregnd[d] ;
gc_val.function = opvals[(int) op] ;
--- 236,245 ----
int d ;
d = (int) cur_dpyno ;
! if (wtype == W_MAIN) window = frame[d] ;
! else if (wtype == W_HELP) window = hframe[d] ;
! else if (wtype == W_PROPS) window = pframe[d] ;
!
if (iscolor[d]) gc_val.foreground = palette[color] ;
else gc_val.foreground = foregnd[d] ;
gc_val.function = opvals[(int) op] ;
***************
*** 279,285 ****
int d ;
d = (int) cur_dpyno ;
! window = (wtype == W_MAIN) ? frame[d] : pframe[d] ;
if (iscolor[d]) gc_val.foreground = palette[color] ;
else
{
--- 268,277 ----
int d ;
d = (int) cur_dpyno ;
! if (wtype == W_MAIN) window = frame[d] ;
! else if (wtype == W_HELP) window = hframe[d] ;
! else if (wtype == W_PROPS) window = pframe[d] ;
!
if (iscolor[d]) gc_val.foreground = palette[color] ;
else
{
***************
*** 377,385 ****
--- 369,380 ----
init_fonts() /* Open the normal and bold fonts. */
{
font[(int) BFONT] = get_font(BOLDFONT) ;
+ font[(int) HFONT] = get_font(HELPFONT) ;
font[(int) NFONT] = get_font(NORMALFONT) ;
bfont_height = font[(int) BFONT]->max_bounds.ascent +
font[(int) BFONT]->max_bounds.descent ;
+ hfont_height = font[(int) HFONT]->max_bounds.ascent +
+ font[(int) HFONT]->max_bounds.descent ;
nfont_height = font[(int) NFONT]->max_bounds.ascent +
font[(int) NFONT]->max_bounds.descent ;
}
***************
*** 439,445 ****
load_colors() /* Create and load reve color map. */
{
XColor ccol ;
- u_char red[OTH_COLORSIZE], green[OTH_COLORSIZE], blue[OTH_COLORSIZE] ;
int d, i, numcolors ;
d = (int) cur_dpyno ;
--- 434,439 ----
***************
*** 446,465 ****
iscolor[d] = 0 ;
if (DisplayCells(dpy[d], screen[d]) > 2)
{
- oth_colorsetup(red, green, blue) ;
iscolor[d] = 1 ;
numcolors = 0 ;
! for (i = 0; i < OTH_COLORSIZE; i++)
{
! ccol.flags = DoRed | DoGreen | DoBlue ;
! ccol.red = (unsigned short) (red[i] << 8) ;
! ccol.green = (unsigned short) (green[i] << 8) ;
! ccol.blue = (unsigned short) (blue[i] << 8) ;
if (XAllocColor(dpy[d],
DefaultColormap(dpy[d], screen[d]), &ccol) == True)
palette[numcolors++] = ccol.pixel ;
}
! if (numcolors < 2)
{
FPRINTF(stderr, "%s: cannot allocate colors.\n", progname) ;
exit(1) ;
--- 440,463 ----
iscolor[d] = 0 ;
if (DisplayCells(dpy[d], screen[d]) > 2)
{
iscolor[d] = 1 ;
numcolors = 0 ;
! for (i = 0; i < REVE_COLORSIZE; i++)
{
! if (colstr[i] == NULL ||
! (XParseColor(dpy[d], DefaultColormap(dpy[d], screen[d]),
! colstr[i], &ccol) == 0))
! {
! ccol.flags = DoRed | DoGreen | DoBlue ;
! ccol.red = (unsigned short) (rcols[i] << 8) ;
! ccol.green = (unsigned short) (gcols[i] << 8) ;
! ccol.blue = (unsigned short) (bcols[i] << 8) ;
! }
if (XAllocColor(dpy[d],
DefaultColormap(dpy[d], screen[d]), &ccol) == True)
palette[numcolors++] = ccol.pixel ;
}
! if (numcolors < REVE_COLORSIZE)
{
FPRINTF(stderr, "%s: cannot allocate colors.\n", progname) ;
exit(1) ;
***************
*** 525,530 ****
--- 523,530 ----
*
* XENVIRONMENT environment variable or, if not set, .Xdefaults-hostname
* file.
+ *
+ * REVEDEFAULTS environment variable or, if not set, the ~/.reverc file.
*/
void
***************
*** 570,575 ****
--- 570,587 ----
}
else db = XrmGetFileDatabase(ptr) ;
XrmMergeDatabases(db, &reve_DB[d]) ;
+
+ /* Finally merge in Reve defaults via REVEDEFAULTS or, if not defined, the
+ * ~/.reverc file.
+ */
+
+ if ((ptr = getenv("REVEDEFAULTS")) == NULL)
+ {
+ SPRINTF(name, "%s/.reverc", home) ;
+ db = XrmGetFileDatabase(name) ;
+ }
+ else db = XrmGetFileDatabase(ptr) ;
+ XrmMergeDatabases(db, &reve_DB[d]) ;
}
***************
*** 655,673 ****
/* Setup property window. */
! psize.flags = PMinSize | PMaxSize | PPosition | PSize ;
! psize.x = TOTAL_WIDTH + 10 ;
! psize.y = 0 ;
! psize.max_width = size.min_width = size.width = PROPS_WIDTH ;
! psize.max_height = size.min_height = size.height = PROPS_HEIGHT ;
pframe[d] = XCreateSimpleWindow(dpy[d], root[d],
! size.x + TOTAL_WIDTH + 10, size.y,
! PROPS_WIDTH, PROPS_HEIGHT,
REVE_BORDER_WIDTH, foregnd[d], backgnd[d]) ;
XSetStandardProperties(dpy[d], pframe[d], "reve properties",
! "Props", reve_icon[d], argv, argc, &psize) ;
/* Create graphics contexts. */
--- 667,685 ----
/* Setup property window. */
! size.flags = PMinSize | PMaxSize | PPosition | PSize ;
! size.x = TOTAL_WIDTH + 10 ;
! size.y = 0 ;
! size.max_width = size.min_width = size.width = PROPS_WIDTH ;
! size.max_height = size.min_height = size.height = PROPS_HEIGHT ;
pframe[d] = XCreateSimpleWindow(dpy[d], root[d],
! size.x, size.y,
! size.max_width, size.max_height,
REVE_BORDER_WIDTH, foregnd[d], backgnd[d]) ;
XSetStandardProperties(dpy[d], pframe[d], "reve properties",
! "Props", reve_icon[d], argv, argc, &size) ;
/* Create graphics contexts. */
***************
*** 682,691 ****
--- 694,733 ----
stencilgc[d] = XCreateGC(dpy[d], root[d], gc_mask, &gc_val) ;
XSetFillStyle(dpy[d], stencilgc[d], FillOpaqueStippled) ;
+ XSynchronize(dpy[d], TRUE) ;
}
void
+ make_help_window(argc, argv)
+ int argc ;
+ char *argv[] ;
+ {
+ int d, fontwidth ;
+
+ d = (int) cur_dpyno ;
+ fontwidth = font[(int) HFONT]->max_bounds.rbearing +
+ font[(int) HFONT]->min_bounds.lbearing ;
+ help_height = ((hfont_height + 1) * HELP_ROWS) + (4 * CGAP) + CHEIGHT ;
+ help_width = (fontwidth * HELP_COLS) + (2 * CGAP) ;
+
+ size.flags = PMinSize | PMaxSize | PPosition | PSize ;
+ size.x = TOTAL_WIDTH + 10 ;
+ size.y = 0 ;
+ size.max_width = size.min_width = size.width = help_width ;
+ size.max_height = size.min_height = size.height = help_height ;
+
+ hframe[d] = XCreateSimpleWindow(dpy[d], root[d],
+ size.x, size.y,
+ size.max_width, size.max_height,
+ REVE_BORDER_WIDTH, foregnd[d], backgnd[d]) ;
+
+ XSetStandardProperties(dpy[d], hframe[d], "reve help",
+ "Help", reve_icon[d], argv, argc, &size) ;
+ }
+
+
+ void
make_icon() {} /* Null routine - icon created in make_frame. */
***************
*** 719,739 ****
void
- open_frame(wtype)
- enum win_type wtype ;
- {
- int d ;
- Window window ;
-
- d = (int) cur_dpyno ;
- if (wtype == W_MAIN) window = frame[d] ;
- else window = pframe[d] ;
- XSelectInput(dpy[0], window, FRAME_MASK) ;
- XMapWindow(dpy[0], window) ;
- }
-
-
- void
process_event() /* Determine event type. */
{
XClientMessageEvent *ev ;
--- 761,766 ----
***************
*** 743,749 ****
int d ;
d = (int) cur_dpyno ;
! if (event.xany.window == frame[(int) cur_dpyno]) curwin = W_MAIN ;
else if (event.xany.window == pframe[(int) cur_dpyno]) curwin = W_PROPS ;
switch (event.type)
--- 770,777 ----
int d ;
d = (int) cur_dpyno ;
! if (event.xany.window == frame[(int) cur_dpyno]) curwin = W_MAIN ;
! else if (event.xany.window == hframe[(int) cur_dpyno]) curwin = W_HELP ;
else if (event.xany.window == pframe[(int) cur_dpyno]) curwin = W_PROPS ;
switch (event.type)
***************
*** 807,812 ****
--- 835,841 ----
{
int d ;
int doframe = 0 ;
+ int dohframe = 0 ;
int dopframe = 0 ;
d = (int) cur_dpyno ;
***************
*** 814,819 ****
--- 843,850 ----
{
if (event->count == 0 && event->window == frame[(int) cur_dpyno])
doframe++ ;
+ if (event->count == 0 && event->window == hframe[(int) cur_dpyno])
+ dohframe++ ;
if (event->count == 0 && event->window == pframe[(int) cur_dpyno])
dopframe++ ;
}
***************
*** 820,825 ****
--- 851,857 ----
while (XCheckMaskEvent(dpy[d], ExposureMask, (XEvent *) event)) ;
if (doframe) return(FRAME_REPAINT) ;
+ else if (dohframe) return(HELP_REPAINT) ;
else if (dopframe) return(PROPS_REPAINT) ;
else return(IGNORE_EVENT) ;
}
***************
*** 838,847 ****
void
start_tool(dtype) /* Start event dispatcher and display. */
enum disp_type dtype ;
{
! open_frame(W_MAIN) ;
XSelectInput(dpy[0], pframe[0], FRAME_MASK) ;
if (dtype == XTWO)
--- 870,898 ----
void
+ set_frame(wtype, showing)
+ enum win_type wtype ;
+ int showing ;
+ {
+ Window window ;
+ int d ;
+
+ d = (int) cur_dpyno ;
+ if (wtype == W_HELP) window = hframe[d] ;
+ else if (wtype == W_PROPS) window = pframe[d] ;
+
+ if (showing) XMapWindow(dpy[d], window) ;
+ else XUnmapWindow(dpy[d], window) ;
+ }
+
+
+ void
start_tool(dtype) /* Start event dispatcher and display. */
enum disp_type dtype ;
{
! XSelectInput(dpy[0], frame[0], FRAME_MASK) ;
! XMapWindow(dpy[0], frame[0]) ;
! XSelectInput(dpy[0], hframe[0], FRAME_MASK) ;
XSelectInput(dpy[0], pframe[0], FRAME_MASK) ;
if (dtype == XTWO)
***************
*** 848,853 ****
--- 899,905 ----
{
XSelectInput(dpy[1], frame[1], FRAME_MASK) ;
XMapWindow(dpy[1], frame[1]) ;
+ XSelectInput(dpy[1], hframe[1], FRAME_MASK) ;
XSelectInput(dpy[1], pframe[1], FRAME_MASK) ;
}
------- xview.c -------
*** /tmp/da06720 Tue Dec 18 10:04:16 1990
--- xview.c Sun Dec 16 11:57:06 1990
***************
*** 38,43 ****
--- 38,44 ----
#include <xview/cms.h>
#include <xview/cursor.h>
#include <xview/svrimage.h>
+ #include <xview/textsw.h>
#include <xview/xv_xrect.h>
#include <X11/Xlib.h>
#include <X11/Xresource.h>
***************
*** 46,52 ****
enum gr_type gtype = GXVIEW ; /* Graphics type. */
! enum popup_pos {P_BELOW, P_RIGHT } ; /* Positions relative to main frame. */
#define CLIENT_NO 10
#define DEPTH_MENU_ENTRY 9
--- 47,53 ----
enum gr_type gtype = GXVIEW ; /* Graphics type. */
! enum popup_pos { P_BELOW, P_RIGHT } ; /* Positions relative to main frame. */
#define CLIENT_NO 10
#define DEPTH_MENU_ENTRY 9
***************
*** 59,64 ****
--- 60,66 ----
#define BOLDFONT "lucidasanstypewriter-bold-12"
#define DEFFONT "fixed"
+ #define HELPFONT "lucidasanstypewriter-12"
#define NORMALFONT "lucidasanstypewriter-12"
Canvas canvas ;
***************
*** 71,76 ****
--- 73,81 ----
Notify_client client = (Notify_client) CLIENT_NO ;
+ Frame h_frame ; /* Help window frame. */
+ Textsw h_textsw ; /* Text sub-window for help file. */
+
Frame ls_frame ; /* Frame for load/save pop-up window. */
Panel ls_panel ; /* Panel for load/save operations. */
Panel_item ls_button ; /* Button to start load/save operation. */
***************
*** 111,117 ****
unsigned long backgnd ; /* Default background color. */
unsigned long foregnd ; /* Default foreground color. */
unsigned long gc_mask ; /* Mask for setting graphic context values. */
! unsigned long palette[OTH_COLORSIZE] ; /* Xlib color palette. */
int opvals[3] ; /* Pixrect rasterop values. */
int pid ; /* Process id of the reve_proc process. */
--- 116,122 ----
unsigned long backgnd ; /* Default background color. */
unsigned long foregnd ; /* Default foreground color. */
unsigned long gc_mask ; /* Mask for setting graphic context values. */
! unsigned long palette[REVE_COLORSIZE] ; /* Xlib color palette. */
int opvals[3] ; /* Pixrect rasterop values. */
int pid ; /* Process id of the reve_proc process. */
***************
*** 121,128 ****
Notify_value read_from_reve(), sigchldcatcher() ;
void destroy_frame() ;
! static void menu_proc(), set_depth(), set_player() ;
! static void xv_load_game(), xv_new_game(), xv_save_game(), xv_set_props() ;
void
--- 126,134 ----
Notify_value read_from_reve(), sigchldcatcher() ;
void destroy_frame() ;
! static void menu_proc(), set_depth(), set_player() ;
! static void xv_do_help(), xv_load_game(), xv_new_game() ;
! static void xv_save_game(), xv_set_props() ;
void
***************
*** 158,170 ****
}
- void
- close_frame() /* Iconise reve window. */
- {
- XV_SET(frame, FRAME_CLOSED, TRUE, 0) ;
- }
-
-
/*ARGSUSED*/
void
color_area(wtype, x, y, width, height, color)
--- 164,169 ----
***************
*** 427,435 ****
--- 426,437 ----
init_fonts() /* Open the normal and bold fonts. */
{
font[(int) BFONT] = get_font(BOLDFONT) ;
+ font[(int) HFONT] = get_font(HELPFONT) ;
font[(int) NFONT] = get_font(NORMALFONT) ;
bfont_height = font[(int) BFONT]->max_bounds.ascent +
font[(int) BFONT]->max_bounds.descent ;
+ hfont_height = font[(int) HFONT]->max_bounds.ascent +
+ font[(int) HFONT]->max_bounds.descent ;
nfont_height = font[(int) NFONT]->max_bounds.ascent +
font[(int) NFONT]->max_bounds.descent ;
}
***************
*** 460,482 ****
load_colors() /* Create and load reve color map. */
{
XColor ccol ;
- u_char red[OTH_COLORSIZE], green[OTH_COLORSIZE], blue[OTH_COLORSIZE] ;
int i, numcolors ;
if (iscolor[(int) cur_dpyno])
{
- oth_colorsetup(red, green, blue) ;
numcolors = 0 ;
! for (i = 0; i < OTH_COLORSIZE; i++)
{
! ccol.flags = DoRed | DoGreen | DoBlue ;
! ccol.red = (unsigned short) (red[i] << 8) ;
! ccol.green = (unsigned short) (green[i] << 8) ;
! ccol.blue = (unsigned short) (blue[i] << 8) ;
if (XAllocColor(dpy, DefaultColormap(dpy, screen), &ccol) == True)
palette[numcolors++] = ccol.pixel ;
}
! if (numcolors < 2)
{
FPRINTF(stderr, "%s: cannot allocate colors.\n", progname) ;
exit(1) ;
--- 462,487 ----
load_colors() /* Create and load reve color map. */
{
XColor ccol ;
int i, numcolors ;
if (iscolor[(int) cur_dpyno])
{
numcolors = 0 ;
! for (i = 0; i < REVE_COLORSIZE; i++)
{
! if (colstr[i] == NULL ||
! (XParseColor(dpy, DefaultColormap(dpy, screen),
! colstr[i], &ccol) == 0))
! {
! ccol.flags = DoRed | DoGreen | DoBlue ;
! ccol.red = (unsigned short) (rcols[i] << 8) ;
! ccol.green = (unsigned short) (gcols[i] << 8) ;
! ccol.blue = (unsigned short) (bcols[i] << 8) ;
! }
if (XAllocColor(dpy, DefaultColormap(dpy, screen), &ccol) == True)
palette[numcolors++] = ccol.pixel ;
}
! if (numcolors < REVE_COLORSIZE)
{
FPRINTF(stderr, "%s: cannot allocate colors.\n", progname) ;
exit(1) ;
***************
*** 498,503 ****
--- 503,510 ----
*
* XENVIRONMENT environment variable or, if not set, .Xdefaults-hostname
* file.
+ *
+ * REVEDEFAULTS environment variable or, if not set, the ~/.reverc file.
*/
void
***************
*** 541,546 ****
--- 548,565 ----
}
else db = XrmGetFileDatabase(ptr) ;
XrmMergeDatabases(db, &reve_DB[d]) ;
+
+ /* Finally merge in Reve defaults via REVEDEFAULTS or, if not defined, the
+ * ~/.reverc file.
+ */
+
+ if ((ptr = getenv("REVEDEFAULTS")) == NULL)
+ {
+ SPRINTF(name, "%s/.reverc", home) ;
+ db = XrmGetFileDatabase(name) ;
+ }
+ else db = XrmGetFileDatabase(ptr) ;
+ XrmMergeDatabases(db, &reve_DB[d]) ;
}
***************
*** 652,659 ****
XV_CREATE(panel, PANEL_BUTTON,
PANEL_ITEM_X, xv_col(panel, 0),
PANEL_ITEM_Y, xv_row(panel, 0),
! PANEL_LABEL_STRING, "Load Game...",
! PANEL_NOTIFY_PROC, xv_load_game,
0) ;
XV_CREATE(panel, PANEL_BUTTON,
--- 671,678 ----
XV_CREATE(panel, PANEL_BUTTON,
PANEL_ITEM_X, xv_col(panel, 0),
PANEL_ITEM_Y, xv_row(panel, 0),
! PANEL_NOTIFY_PROC, xv_new_game,
! PANEL_LABEL_STRING, " New Game ",
0) ;
XV_CREATE(panel, PANEL_BUTTON,
***************
*** 666,687 ****
XV_CREATE(panel, PANEL_BUTTON,
PANEL_ITEM_X, xv_col(panel, 30),
PANEL_ITEM_Y, xv_row(panel, 0),
! PANEL_NOTIFY_PROC, xv_new_game,
! PANEL_LABEL_STRING, " New Game ",
0) ;
XV_CREATE(panel, PANEL_BUTTON,
PANEL_ITEM_X, xv_col(panel, 45),
PANEL_ITEM_Y, xv_row(panel, 0),
! PANEL_LABEL_STRING, " Props... ",
! PANEL_NOTIFY_PROC, xv_set_props,
0) ;
XV_CREATE(panel, PANEL_BUTTON,
PANEL_ITEM_X, xv_col(panel, 0),
PANEL_ITEM_Y, xv_row(panel, 1),
! PANEL_LABEL_STRING, "Save Game...",
! PANEL_NOTIFY_PROC, xv_save_game,
0) ;
XV_CREATE(panel, PANEL_BUTTON,
--- 685,706 ----
XV_CREATE(panel, PANEL_BUTTON,
PANEL_ITEM_X, xv_col(panel, 30),
PANEL_ITEM_Y, xv_row(panel, 0),
! PANEL_LABEL_STRING, " Redo ",
! PANEL_NOTIFY_PROC, redo,
0) ;
XV_CREATE(panel, PANEL_BUTTON,
PANEL_ITEM_X, xv_col(panel, 45),
PANEL_ITEM_Y, xv_row(panel, 0),
! PANEL_LABEL_STRING, " Help... ",
! PANEL_NOTIFY_PROC, xv_do_help,
0) ;
XV_CREATE(panel, PANEL_BUTTON,
PANEL_ITEM_X, xv_col(panel, 0),
PANEL_ITEM_Y, xv_row(panel, 1),
! PANEL_LABEL_STRING, "Load Game...",
! PANEL_NOTIFY_PROC, xv_load_game,
0) ;
XV_CREATE(panel, PANEL_BUTTON,
***************
*** 689,695 ****
PANEL_ITEM_Y, xv_row(panel, 1),
PANEL_LABEL_STRING, " Suggest ",
PANEL_NOTIFY_PROC, suggest,
! 0) ;
XV_CREATE(panel, PANEL_BUTTON,
PANEL_ITEM_X, xv_col(panel, 30),
--- 708,714 ----
PANEL_ITEM_Y, xv_row(panel, 1),
PANEL_LABEL_STRING, " Suggest ",
PANEL_NOTIFY_PROC, suggest,
! 0) ;
XV_CREATE(panel, PANEL_BUTTON,
PANEL_ITEM_X, xv_col(panel, 30),
***************
*** 696,706 ****
PANEL_ITEM_Y, xv_row(panel, 1),
PANEL_LABEL_STRING, " Undo ",
PANEL_NOTIFY_PROC, undo,
! 0) ;
XV_CREATE(panel, PANEL_BUTTON,
PANEL_ITEM_X, xv_col(panel, 45),
PANEL_ITEM_Y, xv_row(panel, 1),
PANEL_LABEL_STRING, " Quit ",
PANEL_NOTIFY_PROC, destroy_frame,
0) ;
--- 715,739 ----
PANEL_ITEM_Y, xv_row(panel, 1),
PANEL_LABEL_STRING, " Undo ",
PANEL_NOTIFY_PROC, undo,
! 0) ;
XV_CREATE(panel, PANEL_BUTTON,
PANEL_ITEM_X, xv_col(panel, 45),
PANEL_ITEM_Y, xv_row(panel, 1),
+ PANEL_LABEL_STRING, " Props... ",
+ PANEL_NOTIFY_PROC, xv_set_props,
+ 0) ;
+
+ XV_CREATE(panel, PANEL_BUTTON,
+ PANEL_ITEM_X, xv_col(panel, 0),
+ PANEL_ITEM_Y, xv_row(panel, 2),
+ PANEL_LABEL_STRING, "Save Game...",
+ PANEL_NOTIFY_PROC, xv_save_game,
+ 0) ;
+
+ XV_CREATE(panel, PANEL_BUTTON,
+ PANEL_ITEM_X, xv_col(panel, 45),
+ PANEL_ITEM_Y, xv_row(panel, 2),
PANEL_LABEL_STRING, " Quit ",
PANEL_NOTIFY_PROC, destroy_frame,
0) ;
***************
*** 707,713 ****
XV_CREATE(panel, PANEL_MESSAGE,
PANEL_ITEM_X, xv_col(panel, 0),
! PANEL_ITEM_Y, xv_row(panel, 2),
PANEL_LABEL_BOLD, TRUE,
PANEL_LABEL_STRING, "Black:",
0) ;
--- 740,746 ----
XV_CREATE(panel, PANEL_MESSAGE,
PANEL_ITEM_X, xv_col(panel, 0),
! PANEL_ITEM_Y, xv_row(panel, 3),
PANEL_LABEL_BOLD, TRUE,
PANEL_LABEL_STRING, "Black:",
0) ;
***************
*** 714,720 ****
val = items[(int) BLACK_PLAYS].value ;
black_item = xv_create(panel, PANEL_MESSAGE,
PANEL_ITEM_X, xv_col(panel, 7),
! PANEL_ITEM_Y, xv_row(panel, 2),
PANEL_LABEL_BOLD, FALSE,
PANEL_LABEL_STRING, player_values[val],
0) ;
--- 747,753 ----
val = items[(int) BLACK_PLAYS].value ;
black_item = xv_create(panel, PANEL_MESSAGE,
PANEL_ITEM_X, xv_col(panel, 7),
! PANEL_ITEM_Y, xv_row(panel, 3),
PANEL_LABEL_BOLD, FALSE,
PANEL_LABEL_STRING, player_values[val],
0) ;
***************
*** 721,727 ****
XV_CREATE(panel, PANEL_MESSAGE,
PANEL_ITEM_X, xv_col(panel, 30),
! PANEL_ITEM_Y, xv_row(panel, 2),
PANEL_LABEL_BOLD, TRUE,
PANEL_LABEL_STRING, "White:",
0) ;
--- 754,760 ----
XV_CREATE(panel, PANEL_MESSAGE,
PANEL_ITEM_X, xv_col(panel, 30),
! PANEL_ITEM_Y, xv_row(panel, 3),
PANEL_LABEL_BOLD, TRUE,
PANEL_LABEL_STRING, "White:",
0) ;
***************
*** 728,734 ****
val = items[(int) WHITE_PLAYS].value ;
white_item = xv_create(panel, PANEL_MESSAGE,
PANEL_ITEM_X, xv_col(panel, 37),
! PANEL_ITEM_Y, xv_row(panel, 2),
PANEL_LABEL_BOLD, FALSE,
PANEL_LABEL_STRING, player_values[val],
0) ;
--- 761,767 ----
val = items[(int) WHITE_PLAYS].value ;
white_item = xv_create(panel, PANEL_MESSAGE,
PANEL_ITEM_X, xv_col(panel, 37),
! PANEL_ITEM_Y, xv_row(panel, 3),
PANEL_LABEL_BOLD, FALSE,
PANEL_LABEL_STRING, player_values[val],
0) ;
***************
*** 735,759 ****
mes_items[(int) (PANEL_MES - PANEL_MES)] = xv_create(panel, PANEL_MESSAGE,
PANEL_ITEM_X, xv_col(panel, 0),
! PANEL_ITEM_Y, xv_row(panel, 3),
PANEL_LABEL_STRING, "",
0) ;
mes_items[(int) (EVAL_MES - PANEL_MES)] = xv_create(panel, PANEL_MESSAGE,
PANEL_ITEM_X, xv_col(panel, 0),
! PANEL_ITEM_Y, xv_row(panel, 4),
PANEL_LABEL_STRING, "",
0) ;
mes_items[(int) (SCORE_MES - PANEL_MES)] = xv_create(panel, PANEL_MESSAGE,
PANEL_ITEM_X, xv_col(panel, 0),
! PANEL_ITEM_Y, xv_row(panel, 5),
PANEL_LABEL_STRING, "",
0) ;
mes_items[(int) (TURN_MES - PANEL_MES)] = xv_create(panel, PANEL_MESSAGE,
PANEL_ITEM_X, xv_col(panel, 30),
! PANEL_ITEM_Y, xv_row(panel, 5),
PANEL_LABEL_STRING, "Black to move",
0) ;
window_fit(panel) ;
--- 768,792 ----
mes_items[(int) (PANEL_MES - PANEL_MES)] = xv_create(panel, PANEL_MESSAGE,
PANEL_ITEM_X, xv_col(panel, 0),
! PANEL_ITEM_Y, xv_row(panel, 4),
PANEL_LABEL_STRING, "",
0) ;
mes_items[(int) (EVAL_MES - PANEL_MES)] = xv_create(panel, PANEL_MESSAGE,
PANEL_ITEM_X, xv_col(panel, 0),
! PANEL_ITEM_Y, xv_row(panel, 5),
PANEL_LABEL_STRING, "",
0) ;
mes_items[(int) (SCORE_MES - PANEL_MES)] = xv_create(panel, PANEL_MESSAGE,
PANEL_ITEM_X, xv_col(panel, 0),
! PANEL_ITEM_Y, xv_row(panel, 6),
PANEL_LABEL_STRING, "",
0) ;
mes_items[(int) (TURN_MES - PANEL_MES)] = xv_create(panel, PANEL_MESSAGE,
PANEL_ITEM_X, xv_col(panel, 30),
! PANEL_ITEM_Y, xv_row(panel, 6),
PANEL_LABEL_STRING, "Black to move",
0) ;
window_fit(panel) ;
***************
*** 905,911 ****
--- 938,977 ----
}
+ /*ARGSUSED*/
void
+ make_help_window(argc, argv)
+ int argc ;
+ char *argv[] ;
+ {
+ h_frame = (Frame) xv_create(frame, FRAME_CMD,
+ FRAME_ICON, reve_icon,
+ FRAME_LABEL, "Reve Help",
+ FRAME_CMD_PUSHPIN_IN, TRUE,
+ FRAME_NO_CONFIRM, TRUE,
+ XV_X, 0,
+ XV_Y, 0,
+ XV_WIDTH, 500,
+ XV_HEIGHT, 700,
+ XV_SHOW, help_showing,
+ FRAME_SHOW_RESIZE_CORNER, FALSE,
+ 0) ;
+ h_textsw = (Textsw) xv_create(h_frame, TEXTSW,
+ XV_X, 0,
+ XV_Y, 0,
+ XV_WIDTH, 500,
+ XV_HEIGHT, 700,
+ TEXTSW_FILE_CONTENTS, helpfile,
+ TEXTSW_READ_ONLY, TRUE,
+ TEXTSW_FIRST, 0,
+ TEXTSW_BROWSING, TRUE,
+ 0) ;
+ window_fit(h_textsw) ;
+ window_fit(h_frame) ;
+ }
+
+
+ void
make_icon()
{
***************
*** 973,985 ****
void
! open_frame(wtype) /* **DUMMY ROUTINE** */
! enum win_type wtype ;
{
}
void
paint_prop_sheet() /* **DUMMY ROUTINE** */
{
}
--- 1039,1056 ----
void
! paint_help() /* **DUMMY ROUTINE** */
{
}
void
+ paint_help_text() /* **DUMMY ROUTINE** */
+ {
+ }
+
+
+ void
paint_prop_sheet() /* **DUMMY ROUTINE** */
{
}
***************
*** 1160,1165 ****
--- 1231,1245 ----
/*ARGSUSED*/
void
+ set_frame(wtype, showing) /* **DUMMY ROUTINE** */
+ enum win_type wtype ;
+ int showing ;
+ {
+ }
+
+
+ /*ARGSUSED*/
+ void
set_cycle(wtype, mtype, str) /* **DUMMY ROUTINE** */
enum win_type wtype ;
enum panel_type mtype ;
***************
*** 1326,1331 ****
--- 1406,1423 ----
reve_player = player ;
processing = TRUE ;
WRITE(pipe_io[0][1], (char *) &in, sizeof(struct reve_in)) ;
+ }
+
+
+ /*ARGSUSED*/
+ static void
+ xv_do_help(item, value, event) /* Callback for online help window. */
+ Panel_item item ;
+ int value ;
+ Event *event ;
+ {
+ position_popup(frame, h_frame, P_RIGHT) ;
+ XV_SET(h_frame, XV_SHOW, TRUE, 0) ;
}