[comp.sources.games] v12i008: reve - an othello game, Patch3h

billr@saab.CNA.TEK.COM (Bill Randle) (12/22/90)

Submitted-by: Rich Burridge <rburridge@sun.COM>
Posting-number: Volume 12, Issue 8
Archive-name: reve/Patch3h
Patch-To: reve: Volume 11, Issue 52-58
Environment: SunView, XView, X11R4, termcap



#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 8 (of 9)."
# Contents:  patches03e
# Wrapped by billr@saab on Fri Dec 21 11:28:05 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'patches03e' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patches03e'\"
else
echo shar: Extracting \"'patches03e'\" \(41748 characters\)
sed "s/^X//" >'patches03e' <<'END_OF_FILE'
X
X------- sunview.c -------
X*** /tmp/da07669	Sun Dec  9 15:20:11 1990
X--- sunview.c	Sat Dec  8 13:28:38 1990
X***************
X*** 60,65 ****
X--- 60,67 ----
X  mpr_static(cycle_rinvert_pr,  64, 64, 1, cycle_rinvert_image) ;
X  mpr_static(icon_pr,           64, 64, 1, icon_image) ;
X  mpr_static(cicon_pr,          64, 64, 8, cicon_image) ;
X+ mpr_static(toggle_off_pr,     64, 64, 1, sch_off_image) ;
X+ mpr_static(toggle_on_pr,      64, 64, 1, sch_on_image) ;
X  mpr_static(white_icon_pr,     64, 64, 1, white_image) ;
X  mpr_static(black_icon_pr,     64, 64, 1, black_image) ;
X  
X***************
X*** 66,80 ****
X  mpr_static(hglass_pr,         16, 16, 1, hglass_image) ;
X  mpr_static(nocur_pr,          16, 16, 1, nocur_image) ;
X  
X! Canvas canvas ;
X  Cursor cursor[MAXCURSORS] ;
X  Event *cur_event ;
X! Frame frame ;
X  Icon reve_icon ;
X- Menu menus[MAXMENUS] ;
X  Pixfont *font[MAXFONTS] ;
X  Pixrect *images[MAXIMAGES] ;
X! Pixwin *cpw ;
X  
X  void pw_batch() ;
X  int opvals[3] ;         /* Pixrect rasterop values. */
X--- 68,81 ----
X  mpr_static(hglass_pr,         16, 16, 1, hglass_image) ;
X  mpr_static(nocur_pr,          16, 16, 1, nocur_image) ;
X  
X! Canvas canvas, pcanvas ;
X  Cursor cursor[MAXCURSORS] ;
X  Event *cur_event ;
X! Frame frame, pframe ;
X  Icon reve_icon ;
X  Pixfont *font[MAXFONTS] ;
X  Pixrect *images[MAXIMAGES] ;
X! Pixwin *cpw, *ppw ;
X  
X  void pw_batch() ;
X  int opvals[3] ;         /* Pixrect rasterop values. */
X***************
X*** 95,144 ****
X  
X  /*ARGSUSED*/
X  void
X! canvas_proc(canvas, event)
X! Canvas canvas ;
X  Event *event ;
X  {
X    cur_event = event ;
X-   process_event() ;       /* Determine what kind of event it is. */
X    handle_event() ;        /* And do the appropriate action. */
X  }
X  
X  
X  void
X! close_frame()        /* Iconise reve window. */
X  {
X!   WINDOW_SET(frame, FRAME_CLOSED, TRUE, 0) ;
X  }
X  
X  
X  void
X! color_area(x, y, width, height, color)
X  int x, y, width, height, color ;
X  {
X!   PW_WRITEBACKGROUND(cpw, x, y, width, height, PIX_SRC | PIX_COLOR(color)) ;
X! }
X  
X! 
X! void
X! create_menu(mtype, values)    /* Create popup menus for cycle items. */
X! enum panel_type mtype ;
X! char *values[] ;
X! {
X!   int i = 0 ;
X!   int menuno ;     /* Current menu number. */
X!   int more = 1 ;   /* Cleared when current menu is complete.*/
X! 
X!   menuno = (int) mtype - (int) BLACK_PLAYS ;
X!   menus[menuno] = menu_create(MENU_FONT, font[(int) NFONT], 0) ;
X!   do
X!     {
X!       if (values[i] != NULL)
X!         MENU_SET(menus[menuno], MENU_STRING_ITEM, values[i], i+1, 0) ;
X!       else more = 0 ;
X!       i++ ;
X!     }
X!   while (more) ;
X  }
X  
X  
X--- 96,134 ----
X  
X  /*ARGSUSED*/
X  void
X! canvas_proc(c, event)
X! Canvas c ;
X  Event *event ;
X  {
X+        if (c == canvas)  curwin = W_MAIN ;
X+   else if (c == pcanvas) curwin = W_PROPS ;
X+ 
X    cur_event = event ;
X    handle_event() ;        /* And do the appropriate action. */
X  }
X  
X  
X  void
X! close_frame(wtype)        /* Iconise reve window. */
X! enum win_type wtype ;
X  {
X!   Frame f ;
X! 
X!   if (wtype == W_MAIN) f = frame ;
X!   else                 f = pframe ;
X!   WINDOW_SET(f, FRAME_CLOSED, TRUE, 0) ;
X  }
X  
X  
X  void
X! color_area(wtype, x, y, width, height, color)
X! enum win_type wtype ;
X  int x, y, width, height, color ;
X  {
X!   Pixwin *pw ;
X  
X!   pw = (wtype == W_MAIN) ? cpw : ppw ;
X!   PW_WRITEBACKGROUND(pw, x, y, width, height, PIX_SRC | PIX_COLOR(color)) ;
X  }
X  
X  
X***************
X*** 149,210 ****
X  }
X  
X  
X- do_menu(mtype)      /* Popup appropriate cycle menu and get value. */
X- enum panel_type mtype ;
X- {
X-   int menuno ;
X- 
X-   menuno = (int) mtype - (int) BLACK_PLAYS ;
X-   return((int) menu_show(menus[menuno], canvas,
X-                           canvas_window_event(canvas, cur_event), 0)) ;
X- }
X- 
X- 
X  void
X! draw_image(x, y, width, height, image)
X  int x, y, width, height ;               
X  enum image_type image ;   
X  {                        
X!   PW_ROP(cpw, x, y, width, height, PIX_SRC | PIX_DST,
X           images[(int) image], 0, 0) ;
X  }
X  
X  
X  void
X! draw_line(x1, y1, x2, y2, op, color)
X  int x1, y1, x2, y2, color ;
X  enum optype op ;
X  {
X    int rop ;
X  
X    rop = opvals[(int) op] ;
X    if (!iscolor[(int) cur_dpyno] && color == C_WHITE)
X      rop = opvals[(int) RCLR] ;
X!   PW_VECTOR(cpw, x1, y1, x2, y2, rop | PIX_COLOR(color), 1) ;
X  }
X  
X  
X  void
X! draw_stencil(x, y, width, height, op, color, stencil, image)
X  int x, y, width, height, color ;
X  enum optype op ;
X  enum image_type stencil, image ;
X  {
X    int rop ;
X  
X    rop = opvals[(int) op] | PIX_COLOR(color) ;
X!   PW_STENCIL(cpw, x, y, width, height, rop,
X               images[(int) stencil], 0, 0, images[(int) image], 0, 0) ;
X  }
X  
X  
X  void
X! draw_text(x, y, ftype, color, str)
X  enum font_type ftype ;
X  int x, y, color ;
X  char *str ;
X  {
X!   PW_TTEXT(cpw, x, y, PIX_SRC | PIX_COLOR(color), font[(int) ftype], str) ;
X  }
X  
X  
X--- 139,203 ----
X  }
X  
X  
X  void
X! draw_image(wtype, x, y, width, height, image)
X! enum win_type wtype ;
X  int x, y, width, height ;               
X  enum image_type image ;   
X  {                        
X!   Pixwin *pw ;
X! 
X!   pw = (wtype == W_MAIN) ? cpw : ppw ;
X!   PW_ROP(pw, x, y, width, height, PIX_SRC | PIX_DST,
X           images[(int) image], 0, 0) ;
X  }
X  
X  
X  void
X! draw_line(wtype, x1, y1, x2, y2, op, color)
X! enum win_type wtype ;
X  int x1, y1, x2, y2, color ;
X  enum optype op ;
X  {
X+   Pixwin *pw ;
X    int rop ;
X  
X+   pw = (wtype == W_MAIN) ? cpw : ppw ;
X    rop = opvals[(int) op] ;
X    if (!iscolor[(int) cur_dpyno] && color == C_WHITE)
X      rop = opvals[(int) RCLR] ;
X!   PW_VECTOR(pw, x1, y1, x2, y2, rop | PIX_COLOR(color), 1) ;
X  }
X  
X  
X  void
X! draw_stencil(wtype, x, y, width, height, op, color, stencil, image)
X! enum win_type wtype ;
X  int x, y, width, height, color ;
X  enum optype op ;
X  enum image_type stencil, image ;
X  {
X+   Pixwin *pw ;
X    int rop ;
X  
X+   pw = (wtype == W_MAIN) ? cpw : ppw ;
X    rop = opvals[(int) op] | PIX_COLOR(color) ;
X!   PW_STENCIL(pw, x, y, width, height, rop,
X               images[(int) stencil], 0, 0, images[(int) image], 0, 0) ;
X  }
X  
X  
X  void
X! draw_text(wtype, x, y, ftype, color, str)
X! enum win_type wtype ;
X  enum font_type ftype ;
X  int x, y, color ;
X  char *str ;
X  {
X!   Pixwin *pw ;
X! 
X!   pw = (wtype == W_MAIN) ? cpw : ppw ;
X!   PW_TTEXT(pw, x, y, PIX_SRC | PIX_COLOR(color), font[(int) ftype], str) ;
X  }
X  
X  
X***************
X*** 225,230 ****
X--- 218,231 ----
X  }
X  
X  
X+ char *
X+ get_resource(rtype)      /* Null routine (currently only X11 and XView). */
X+ enum res_type rtype ;
X+ {
X+   return((char *) NULL) ;
X+ }
X+ 
X+ 
X  get_strwidth(ftype, str)    /* Get width in pixels of string value. */
X  enum font_type ftype ;
X  char *str ;
X***************
X*** 246,251 ****
X--- 247,259 ----
X  }
X  
X  
X+ init_graphics(argc, argv)
X+ int *argc ;
X+ char *argv[] ;
X+ {
X+ }
X+ 
X+ 
X  init_ws_type()
X  {
X    if (getenv("WINDOW_PARENT") == NULL)
X***************
X*** 284,289 ****
X--- 292,303 ----
X  
X  
X  void
X+ load_resources()     /* Dummy routine; used with X11 and XView versions. */
X+ {
X+ }
X+ 
X+ 
X+ void
X  lock_screen(state)   /* Turn graphics locking on or off. */
X  enum bltype state ;
X  {
X***************
X*** 306,312 ****
X                           WIN_HEIGHT,      TOTAL_HEIGHT,
X                           WIN_WIDTH,       TOTAL_WIDTH,
X                           WIN_CONSUME_PICK_EVENTS,
X!                            MS_LEFT, MS_MIDDLE, MS_RIGHT,
X                             LOC_MOVE, LOC_DRAG, LOC_TRAJECTORY,
X                             LOC_WINENTER, LOC_WINEXIT,
X                             0,
X--- 320,326 ----
X                           WIN_HEIGHT,      TOTAL_HEIGHT,
X                           WIN_WIDTH,       TOTAL_WIDTH,
X                           WIN_CONSUME_PICK_EVENTS,
X!                            MS_LEFT, MS_MIDDLE,
X                             LOC_MOVE, LOC_DRAG, LOC_TRAJECTORY,
X                             LOC_WINENTER, LOC_WINEXIT,
X                             0,
X***************
X*** 316,321 ****
X--- 330,350 ----
X                           WIN_EVENT_PROC, canvas_proc,
X                           0) ;
X    cpw = (Pixwin *) window_get(canvas, CANVAS_PIXWIN) ;
X+ 
X+   pcanvas = window_create(pframe, CANVAS,
X+                           CANVAS_RETAINED, FALSE,
X+                           WIN_HEIGHT,      PROPS_HEIGHT,
X+                           WIN_WIDTH,       PROPS_WIDTH,
X+                           WIN_CONSUME_PICK_EVENTS,
X+                             MS_LEFT, MS_MIDDLE,
X+                             0,
X+                           WIN_CONSUME_KBD_EVENTS,
X+                             KBD_USE, KBD_DONE, WIN_ASCII_EVENTS, WIN_UP_EVENTS,
X+                             0,
X+                           WIN_EVENT_PROC, canvas_proc,
X+                           0) ;
X+   ppw = (Pixwin *) window_get(pcanvas, CANVAS_PIXWIN) ;
X+ 
X    cursor[(int) CANVASCUR] = window_get(canvas, WIN_CURSOR) ;
X    CURSOR_SET(cursor[(int) CANVASCUR], CURSOR_OP, PIX_SRC ^ PIX_DST, 0) ;
X    cursor[(int) HOURGLASS] = cursor_create(CURSOR_IMAGE, &hglass_pr, 0) ;
X***************
X*** 333,338 ****
X--- 362,369 ----
X    images[(int) CY_RINVERT]  = &cycle_rinvert_pr ;
X    images[(int) P_WHITE]     = &white_icon_pr ;
X    images[(int) P_BLACK]     = &black_icon_pr ;
X+   images[(int) TOGGLE_OFF]  = &toggle_off_pr ;
X+   images[(int) TOGGLE_ON]   = &toggle_on_pr ;
X  }
X  
X  
X***************
X*** 352,357 ****
X--- 383,396 ----
X                           WIN_ERROR_MSG,    "Can't create window.",
X                           FRAME_ARGS,       argc, argv,
X                           0) ;
X+ 
X+   pframe = window_create((Window) NULL,     FRAME,
X+                           FRAME_ICON,       reve_icon,
X+                           FRAME_LABEL,      "reve properties",
X+                           FRAME_NO_CONFIRM, TRUE,
X+                           WIN_ERROR_MSG,    "Can't create window.",
X+                           FRAME_ARGS,       argc, argv,
X+                           0) ;
X  }
X  
X  
X***************
X*** 363,368 ****
X--- 402,419 ----
X  
X  
X  void
X+ open_frame(wtype)
X+ enum win_type wtype ;
X+ {
X+   Frame f ;
X+ 
X+   if (wtype == W_MAIN) f = frame ;
X+   else                 f = pframe ;
X+   WINDOW_SET(f, WIN_SHOW, TRUE, 0) ;
X+ }
X+ 
X+ 
X+ void
X  process_event()       /* Process the next canvas event. */
X  {
X    int id ;
X***************
X*** 393,399 ****
X    else if (id == LOC_WINENTER || id == LOC_RGNENTER) nextc = ENTER_WINDOW ;
X    else if (id == LOC_MOVE || id == LOC_DRAG || id == LOC_TRAJECTORY)
X      nextc = MOUSE_MOVING ;
X!   else if (id == WIN_REPAINT) nextc = FRAME_REPAINT ;
X  }
X  
X  
X--- 444,454 ----
X    else if (id == LOC_WINENTER || id == LOC_RGNENTER) nextc = ENTER_WINDOW ;
X    else if (id == LOC_MOVE || id == LOC_DRAG || id == LOC_TRAJECTORY)
X      nextc = MOUSE_MOVING ;
X!   else if (id == WIN_REPAINT)
X!     {
X!            if (curwin == W_MAIN) nextc = FRAME_REPAINT ;
X!       else if (curwin == W_PROPS) nextc = PROPS_REPAINT ;
X!     }
X  }
X  
X  
X***************
X*** 417,421 ****
X--- 472,477 ----
X        WINDOW_SET(frame, FRAME_ICON, reve_icon, 0) ;
X      }
X    window_fit(frame) ;
X+   window_fit(pframe) ;
X    window_main_loop(frame) ;
X  }
X
X------- tty.c -------
X*** /tmp/da07672	Sun Dec  9 15:20:12 1990
X--- tty.c	Sun Dec  9 12:44:57 1990
X***************
X*** 30,39 ****
X  #include <signal.h>
X  
X  #ifdef SYSV
X- #include <string.h>
X  #include <sgtty.h>
X- #else
X- #include <strings.h>
X  #endif /*SYSV*/
X  
X  #define  DRAW_STRING(col, row, str, v)  draw_string(col, row, str, v), return
X--- 30,36 ----
X***************
X*** 65,87 ****
X  } ;
X  
X  struct tty_info ttyvals[MAXITEMS] = {
X!       {  1,  1,  33,  33, },      /* Load */
X!       { 11,  1, 107,  33, },      /* New game */
X!       { 22,  1, 167,  33, },      /* Save */
X!       { 33,  1, 255,  33, },      /* Show all */
X!       { 44,  1, 318,  33, },      /* Suggest */
X!       { 55,  1, 403,  33, },      /* Undo */
X!       { -1, -1,  33,  75, },      /* Done   (not displayed). */
X!       { -1, -1, 318,  75, },      /* Cancel (not displayed). */
X!       { -1, -1, 403,  75, },      /* Quit   (not displayed). */
X!       { 38,  5,  15, 114, },      /* Black: */
X!       { 38,  7, 237, 114, },      /* White: */
X!       { 38,  9,  15, 156, },      /* Difficuly: */
X!       { 38, 11, 237, 156, },      /* Notes: */
X        { -1, -1,  -1,  -1, },      /* Panel message. */
X        { -1, -1,  -1,  -1, },      /* Notes message. */
X        { -1, -1,  -1,  -1, },      /* Score message. */
X        { -1, -1,  -1,  -1, },      /* Turn message. */
X  } ;
X  
X  struct other_info {   /* Information needed to place other text values. */
X--- 62,91 ----
X  } ;
X  
X  struct tty_info ttyvals[MAXITEMS] = {
X!       {  1,  1,  43,  32, },      /* Load */
X!       { 11,  1, 117,  32, },      /* Moves? */
X!       { 22,  1, 191,  32, },      /* New game */
X!       { 33,  1, 265,  32, },      /* Save */
X!       { 44,  1, 339,  32, },      /* Suggest */
X!       { 55,  1, 413,  32, },      /* Undo */
X!       { -1, -1,  43,  74, },      /* Props  (not displayed). */
X!       { -1, -1, 339,  74, },      /* Cancel (not displayed). */
X!       { -1, -1, 413,  74, },      /* Quit   (not displayed). */
X!       { 60,  5,  15, 111, },      /* Black: */
X!       { 60,  7, 237, 111, },      /* White: */
X        { -1, -1,  -1,  -1, },      /* Panel message. */
X        { -1, -1,  -1,  -1, },      /* Notes message. */
X        { -1, -1,  -1,  -1, },      /* Score message. */
X        { -1, -1,  -1,  -1, },      /* Turn message. */
X+       { -1, -1,  -1,  -1, },      /* Computer choice.: */
X+       { -1, -1,  -1,  -1, },      /* Difficulty. */
X+       { -1, -1,  -1,  -1, },      /* Maximum search depth. */
X+       { -1, -1,  -1,  -1, },      /* Animate option: */
X+       { -1, -1,  -1,  -1, },      /* Best computer move option. */
X+       { -1, -1,  -1,  -1, },      /* Last move option. */
X+       { -1, -1,  -1,  -1, },      /* Show evaluation option. */
X+       { -1, -1,  -1,  -1, },      /* Number move option. */
X+       { -1, -1,  -1,  -1, },      /* Quick game option. */
X  } ;
X  
X  struct other_info {   /* Information needed to place other text values. */
X***************
X*** 91,112 ****
X  
X  struct other_info othervals[MAXITEMS] = {
X        { -1, -1, },       /* Load     (ignored). */
X        { -1, -1, },       /* New game (ignored). */
X        { -1, -1, },       /* Save     (ignored). */
X-       { -1, -1, },       /* Show all (ignored). */
X        { -1, -1, },       /* Suggest  (ignored). */
X        { -1, -1, },       /* Undo     (ignored). */
X        { -1, -1, },       /* Done     (ignored). */
X        { -1, -1, },       /* Cancel   (ignored). */
X        { -1, -1, },       /* Quit     (ignored). */
X!       { 60,  5, },       /* Black: */
X!       { 60,  7, },       /* White: */
X!       { 60,  9, },       /* Difficuly: */
X!       { 60, 11, },       /* Notes: */
X        { 38, 13, },       /* Panel message. */
X        { 38, 15, },       /* Notes message. */
X        { 38, 17, },       /* Score message. */
X        { 38, 19, },       /* Turn message. */
X  } ;
X  
X  
X--- 95,123 ----
X  
X  struct other_info othervals[MAXITEMS] = {
X        { -1, -1, },       /* Load     (ignored). */
X+       { -1, -1, },       /* Moves?   (ignored). */
X        { -1, -1, },       /* New game (ignored). */
X        { -1, -1, },       /* Save     (ignored). */
X        { -1, -1, },       /* Suggest  (ignored). */
X        { -1, -1, },       /* Undo     (ignored). */
X        { -1, -1, },       /* Done     (ignored). */
X        { -1, -1, },       /* Cancel   (ignored). */
X        { -1, -1, },       /* Quit     (ignored). */
X!       { 38,  5, },       /* Black: */
X!       { 38,  7, },       /* White: */
X        { 38, 13, },       /* Panel message. */
X        { 38, 15, },       /* Notes message. */
X        { 38, 17, },       /* Score message. */
X        { 38, 19, },       /* Turn message. */
X+       { -1, -1, },       /* Computer choice. */
X+       { 60,  9, },       /* Difficulty. */
X+       { -1, -1, },       /* Maximum search depth. */
X+       { -1, -1, },       /* Animate option: */
X+       { -1, -1, },       /* Best computer move option. */
X+       { -1, -1, },       /* Last move option. */
X+       { 60, 11, },       /* Show evaluation option. */
X+       { -1, -1, },       /* Number move option. */
X+       { -1, -1, },       /* Quick game option. */
X  } ;
X  
X  
X***************
X*** 131,137 ****
X  
X  /*ARGSUSED*/
X  void
X! color_area(x, y, width, height, color)
X  int x, y, width, height, color ;
X  {
X    char nextline[MAXLINE] ;
X--- 142,149 ----
X  
X  /*ARGSUSED*/
X  void
X! color_area(wtype, x, y, width, height, color)
X! enum win_type wtype ;
X  int x, y, width, height, color ;
X  {
X    char nextline[MAXLINE] ;
X***************
X*** 175,189 ****
X  }
X  
X  
X- /*ARGSUSED*/
X  void
X- create_menu(mtype, values)     /* Create popup menus - null routine. */
X- enum panel_type mtype ;
X- char *values[] ;
X- {}
X- 
X- 
X- void
X  destroy_frame()       /* Destroy reve window. */
X  {
X    tputs(CL, 1, outc) ;
X--- 187,193 ----
X***************
X*** 200,213 ****
X  }
X  
X  
X- /*ARGSUSED*/
X- do_menu(mtype)                /* Popup appropriate menu - not used. */
X- enum panel_type mtype ;
X- {
X-   return 0 ;
X- }
X- 
X- 
X  static void
X  do_standend()                 /* Finish inverted area. */
X  {
X--- 204,209 ----
X***************
X*** 224,230 ****
X  
X  /*ARGSUSED*/
X  void
X! draw_image(x, y, width, height, image)    /* Null routine. */
X  int x, y, width, height ;
X  enum image_type image ;
X  {}
X--- 220,227 ----
X  
X  /*ARGSUSED*/
X  void
X! draw_image(wtype, x, y, width, height, image)    /* Null routine. */
X! enum win_type wtype ;
X  int x, y, width, height ;
X  enum image_type image ;
X  {}
X***************
X*** 232,238 ****
X  
X  /*ARGSUSED*/
X  void
X! draw_line(x1, y1, x2, y2, op, color)
X  int x1, y1, x2, y2, color ;
X  enum optype op ;
X  {
X--- 229,236 ----
X  
X  /*ARGSUSED*/
X  void
X! draw_line(wtype, x1, y1, x2, y2, op, color)
X! enum win_type wtype ;
X  int x1, y1, x2, y2, color ;
X  enum optype op ;
X  {
X***************
X*** 258,264 ****
X  
X  /*ARGSUSED*/
X  void
X! draw_stencil(x, y, width, height, op, color, stencil, image)
X  int x, y, width, height, color ;
X  enum optype op ;
X  enum image_type stencil, image ;
X--- 256,263 ----
X  
X  /*ARGSUSED*/
X  void
X! draw_stencil(wtype, x, y, width, height, op, color, stencil, image)
X! enum win_type wtype ;
X  int x, y, width, height, color ;
X  enum optype op ;
X  enum image_type stencil, image ;
X***************
X*** 317,323 ****
X  
X  /*ARGSUSED*/
X  void
X! draw_text(x, y, ftype, color, str)
X  enum font_type ftype ;
X  int x, y, color ;
X  char *str ;
X--- 316,323 ----
X  
X  /*ARGSUSED*/
X  void
X! draw_text(wtype, x, y, ftype, color, str)
X! enum win_type wtype ;
X  enum font_type ftype ;
X  int x, y, color ;
X  char *str ;
X***************
X*** 339,348 ****
X        return ;
X      }
X  
X! /* Check for the four panel message types. */
X  
X!   else if (x == 15 && y == 195)        /* Panel message. */
X      {
X        if (EQUAL(str, "Use left"))
X          STRCPY(str, "Select a letter/number pair for a move") ;
X        draw_string(othervals[(int) PANEL_MES].column,
X--- 339,360 ----
X        return ;
X      }
X  
X! /* Check for the six panel message types. */
X  
X!   else if (x == 15 && y == 111)        /* Black: message. */
X      {
X+       draw_string(othervals[(int) BLACK_PLAYS].column,
X+                   othervals[(int) BLACK_PLAYS].row, str, FALSE) ;
X+       return ;
X+     }
X+   else if (x == 237 && y == 111)       /* White: message. */
X+     {
X+       draw_string(othervals[(int) WHITE_PLAYS].column,
X+                   othervals[(int) WHITE_PLAYS].row, str, FALSE) ;
X+       return ;
X+     }
X+   else if (x == 15 && y == 153)        /* Panel message. */
X+     {
X        if (EQUAL(str, "Use left"))
X          STRCPY(str, "Select a letter/number pair for a move") ;
X        draw_string(othervals[(int) PANEL_MES].column,
X***************
X*** 349,361 ****
X                    othervals[(int) PANEL_MES].row, str, TRUE) ;
X        return ;
X      }
X!   else if (x == 15 && y == 237)       /* Note message. */
X      {
X        draw_string(othervals[(int) EVAL_MES].column,
X                    othervals[(int) EVAL_MES].row, str, TRUE) ;
X        return ;
X      }
X!   else if (x == 15 && y == 279)        /* Score message. */
X      {
X        if (sscanf(str, "Stones: Black: %d White: %d", &black, &white) == 2)
X          SPRINTF(str, "Black (O): %d, White (X): %d", black, white) ;
X--- 361,373 ----
X                    othervals[(int) PANEL_MES].row, str, TRUE) ;
X        return ;
X      }
X!   else if (x == 15 && y == 195)       /* Evaluation message. */
X      {
X        draw_string(othervals[(int) EVAL_MES].column,
X                    othervals[(int) EVAL_MES].row, str, TRUE) ;
X        return ;
X      }
X!   else if (x == 15 && y == 237)        /* Score message. */
X      {
X        if (sscanf(str, "Stones: Black: %d White: %d", &black, &white) == 2)
X          SPRINTF(str, "Black (O): %d, White (X): %d", black, white) ;
X***************
X*** 363,369 ****
X                    othervals[(int) SCORE_MES].row, str, TRUE) ;
X        return ;
X      }
X!   else if (x == 237 && y == 279)       /* Turn message. */
X      {
X        draw_string(othervals[(int) TURN_MES].column,
X                    othervals[(int) TURN_MES].row, str, TRUE) ;
X--- 375,381 ----
X                    othervals[(int) SCORE_MES].row, str, TRUE) ;
X        return ;
X      }
X!   else if (x == 237 && y == 237)       /* Turn message. */
X      {
X        draw_string(othervals[(int) TURN_MES].column,
X                    othervals[(int) TURN_MES].row, str, TRUE) ;
X***************
X*** 370,378 ****
X        return ;
X      }
X  
X  /* Check for panel and cyclic items. */
X  
X!   for (i = 0; i < MAXITEMS-4; i++)
X      if (EQUAL(str, items[i].text))
X        if (ttyvals[i].column != -1)
X          {
X--- 382,405 ----
X        return ;
X      }
X  
X+ /* Check for the two player strings. */
X+ 
X+   else if (x == 163 && y == 111)       /* Black plays: value. */
X+     {
X+       draw_string(ttyvals[(int) BLACK_PLAYS].column,
X+                   ttyvals[(int) BLACK_PLAYS].row, str, TRUE) ;
X+       return ;
X+     }
X+   else if (x == 385 && y == 111)       /* White plays: value. */
X+     {
X+       draw_string(ttyvals[(int) WHITE_PLAYS].column,
X+                   ttyvals[(int) WHITE_PLAYS].row, str, TRUE) ;
X+       return ;
X+     }
X+ 
X  /* Check for panel and cyclic items. */
X  
X!   for (i = 0; i < MAXITEMS-13; i++)
X      if (EQUAL(str, items[i].text))
X        if (ttyvals[i].column != -1)
X          {
X***************
X*** 389,399 ****
X  
X    switch (y)
X      {
X!       case 111  : if (x == 182) pt = BLACK_PLAYS ;      /* Black plays. */
X                    else          pt = WHITE_PLAYS ;      /* White plays. */
X                    break ;
X!       case 153  : if (x == 182) pt = DIFFICULTY ;       /* Difficulty. */
X!                   else          pt = NOTES ;            /* Notes. */
X                    break ;
X        default   : return ;   /* We're not interested in this piece of text. */
X      }
X--- 416,426 ----
X  
X    switch (y)
X      {
X!       case 111  : if (x == 163) pt = BLACK_PLAYS ;      /* Black plays. */
X                    else          pt = WHITE_PLAYS ;      /* White plays. */
X                    break ;
X!       case 153  : if (x == 163) pt = DIFF_CHOICE ;      /* Difficulty. */
X!                   else          pt = OPT_EVAL ;         /* Notes. */
X                    break ;
X        default   : return ;   /* We're not interested in this piece of text. */
X      }
X***************
X*** 413,418 ****
X--- 440,453 ----
X  }
X   
X   
X+ char *
X+ get_resource(rtype)      /* Null routine (currently only X11 and XView). */
X+ enum res_type rtype ;
X+ {
X+   return((char *) NULL) ;
X+ }
X+ 
X+ 
X  /*ARGSUSED*/
X  get_strwidth(ftype, str)    /* Get width in pixels of string value. */
X  enum font_type ftype ;
X***************
X*** 430,435 ****
X--- 465,477 ----
X  }
X  
X  
X+ init_graphics(argc, argv)
X+ int *argc ;
X+ char *argv[] ;
X+ {
X+ }
X+ 
X+ 
X  init_ws_type()
X  {
X    char bp[1024], termtype[MAXLINE] ;
X***************
X*** 456,461 ****
X--- 498,509 ----
X  }
X  
X  
X+ void
X+ load_resources()     /* Dummy routine; used with X11 and XView versions. */
X+ {
X+ }
X+ 
X+ 
X  /*ARGSUSED*/
X  void
X  lock_screen(state)     /* Graphics locking - null routine. */
X***************
X*** 489,494 ****
X--- 537,550 ----
X  {}
X  
X  
X+ /*ARGSUSED*/
X+ void
X+ open_frame(wtype)
X+ enum win_type wtype ;
X+ {
X+ }
X+ 
X+ 
X  static void
X  outc(c)                 /* Output the next character to the screen. */
X  register int c ;
X***************
X*** 532,539 ****
X    for (;;)
X      {
X        get_event() ;          /* Get next canvas event. */
X!       process_event() ;      /* Find out what kind it is. */
X!       handle_event() ;       /* And do the apropriate action. */
X      }
X  }
X  
X--- 588,594 ----
X    for (;;)
X      {
X        get_event() ;          /* Get next canvas event. */
X!       handle_event() ;       /* And do the appropriate action. */
X      }
X  }
X  
X
X------- x11.c -------
X*** /tmp/da07675	Sun Dec  9 15:20:14 1990
X--- x11.c	Sat Dec  8 19:50:52 1990
X***************
X*** 27,32 ****
X--- 27,34 ----
X  #include "color.h"
X  #include "extern.h"
X  #include "images.h"
X+ #include <ctype.h>
X+ #include <sys/param.h>
X  #include <sys/time.h>
X  
X  #include <X11/Xlib.h>
X***************
X*** 35,40 ****
X--- 37,43 ----
X  #include <X11/Xos.h>
X  #include <X11/cursorfont.h>
X  #include <X11/keysym.h>
X+ #include <X11/Xresource.h>
X  
X  #define  BOLDFONT    "lucidasanstypewriter-bold-12"
X  #define  DEFFONT     "fixed"
X***************
X*** 44,50 ****
X                        EnterWindowMask | KeyPressMask      | LeaveWindowMask | \
X                        PointerMotionMask)
X  
X! #define  OTHELLO_BORDER_WIDTH  2
X  
X  enum gr_type gtype = GX11 ;        /* Graphics type. */
X  
X--- 47,53 ----
X                        EnterWindowMask | KeyPressMask      | LeaveWindowMask | \
X                        PointerMotionMask)
X  
X! #define  REVE_BORDER_WIDTH  2
X  
X  enum gr_type gtype = GX11 ;        /* Graphics type. */
X  
X***************
X*** 60,71 ****
X  Pixmap images[MAXIMAGES] ;
X  Pixmap no_pixmap ;
X  Pixmap load_color_icon(), load_image(), reve_icon[MAXDPY] ;
X! Window frame[MAXDPY], root[MAXDPY] ;
X  XClassHint class_hint = { "reve", "Reve" } ;
X  XColor BGcolor, FGcolor ;
X  XEvent event ;
X  XFontStruct *font[MAXFONTS] ;
X! XSizeHints size ;
X  XWMHints wm_hints ;
X  XGCValues gc_val ;              /* Used to setup graphics context values. */
X  int gc_flags ;                  /* Used to set up graphics context flags. */
X--- 63,75 ----
X  Pixmap images[MAXIMAGES] ;
X  Pixmap no_pixmap ;
X  Pixmap load_color_icon(), load_image(), reve_icon[MAXDPY] ;
X! Window frame[MAXDPY], pframe[MAXDPY], root[MAXDPY] ;
X  XClassHint class_hint = { "reve", "Reve" } ;
X  XColor BGcolor, FGcolor ;
X  XEvent event ;
X  XFontStruct *font[MAXFONTS] ;
X! XrmDatabase reve_DB[MAXDPY] ;   /* Combined resources database. */
X! XSizeHints psize, size ;
X  XWMHints wm_hints ;
X  XGCValues gc_val ;              /* Used to setup graphics context values. */
X  int gc_flags ;                  /* Used to set up graphics context flags. */
X***************
X*** 139,154 ****
X  
X  
X  void
X! close_frame()            /* Iconise reve window. */
X  {
X    int d ;
X    XEvent event ;
X  
X    d = (int) cur_dpyno ;
X    iconic = 1 ;
X    event.xclient.type = ClientMessage ;
X    event.xclient.display = dpy[d] ;
X!   event.xclient.window = frame[d] ;
X    event.xclient.message_type = XInternAtom(dpy[d], "WM_CHANGE_STATE", False) ;
X    event.xclient.format = 32 ;
X    event.xclient.data.l[0] = IconicState ;
X--- 143,163 ----
X  
X  
X  void
X! close_frame(wtype)            /* Iconise reve window. */
X! enum win_type wtype ;
X  {
X    int d ;
X    XEvent event ;
X+   Window window ;
X  
X    d = (int) cur_dpyno ;
X+   if (wtype == W_MAIN) window = frame[d] ;
X+   else                 window = pframe[d] ;
X+ 
X    iconic = 1 ;
X    event.xclient.type = ClientMessage ;
X    event.xclient.display = dpy[d] ;
X!   event.xclient.window = window ;
X    event.xclient.message_type = XInternAtom(dpy[d], "WM_CHANGE_STATE", False) ;
X    event.xclient.format = 32 ;
X    event.xclient.data.l[0] = IconicState ;
X***************
X*** 158,169 ****
X  
X  
X  void
X! color_area(x, y, width, height, color)
X  int x, y, width, height, color ;
X  {
X    int d ;
X  
X    d = (int) cur_dpyno ;
X    if (iscolor[d]) gc_val.foreground = palette[color] ;
X    else
X      { 
X--- 167,181 ----
X  
X  
X  void
X! color_area(wtype, x, y, width, height, color)
X! enum win_type wtype ;
X  int x, y, width, height, color ;
X  {
X+   Window window ;
X    int d ;
X  
X    d = (int) cur_dpyno ;
X+   window = (wtype == W_MAIN) ? frame[d] : pframe[d] ;
X    if (iscolor[d]) gc_val.foreground = palette[color] ;
X    else
X      { 
X***************
X*** 172,191 ****
X      }
X    gc_val.function = GXcopy ;
X    XChangeGC(dpy[d], gc[d], GCForeground | GCFunction, &gc_val) ;
X!   XFillRectangle(dpy[d], frame[d], gc[d], x, y,
X                   (unsigned int) width, (unsigned int) height) ;
X  }
X  
X  
X- /*ARGSUSED*/
X  void
X- create_menu(mtype, values)    /* Create the various popup menus. */
X- enum panel_type mtype ;
X- char *values[] ;
X- {}
X- 
X- 
X- void
X  destroy_frame()          /* Destroy reve window. */
X  {
X    XDestroyWindow(dpy[(int) cur_dpyno], frame[(int) cur_dpyno]) ;
X--- 184,195 ----
X      }
X    gc_val.function = GXcopy ;
X    XChangeGC(dpy[d], gc[d], GCForeground | GCFunction, &gc_val) ;
X!   XFillRectangle(dpy[d], window, gc[d], x, y,
X                   (unsigned int) width, (unsigned int) height) ;
X  }
X  
X  
X  void
X  destroy_frame()          /* Destroy reve window. */
X  {
X    XDestroyWindow(dpy[(int) cur_dpyno], frame[(int) cur_dpyno]) ;
X***************
X*** 192,230 ****
X  }
X  
X  
X- /*ARGSUSED*/
X- do_menu(mtype)          /* Display popup menu for cyclic item. */
X- enum item_type mtype ;
X- {
X-   return(0) ;
X- }
X- 
X- 
X  void
X! draw_image(x, y, width, height, image)
X  int x, y, width, height ;
X  enum image_type image ;
X  {
X    int d ;
X  
X    d = (int) cur_dpyno ;
X    gc_mask = GCStipple | GCTileStipXOrigin | GCTileStipYOrigin ;
X    gc_val.stipple = images[(int) image] ;
X    gc_val.ts_x_origin = x ;
X    gc_val.ts_y_origin = y ;
X    XChangeGC(dpy[d], ropgc[d], gc_mask, &gc_val) ;
X!   XFillRectangle(dpy[d], frame[d], ropgc[d], x, y, width, height) ;
X  }
X  
X  
X  void
X! draw_line(x1, y1, x2, y2, op, color)
X  int x1, y1, x2, y2, color ;
X  enum optype op ;
X  {
X    int d ;
X  
X    d = (int) cur_dpyno ;
X    if (iscolor[d]) gc_val.foreground = palette[color] ;
X    else
X      {
X--- 196,232 ----
X  }
X  
X  
X  void
X! draw_image(wtype, x, y, width, height, image)
X! enum win_type wtype ;
X  int x, y, width, height ;
X  enum image_type image ;
X  {
X+   Window window ;
X    int d ;
X  
X    d = (int) cur_dpyno ;
X+   window = (wtype == W_MAIN) ? frame[d] : pframe[d] ;
X    gc_mask = GCStipple | GCTileStipXOrigin | GCTileStipYOrigin ;
X    gc_val.stipple = images[(int) image] ;
X    gc_val.ts_x_origin = x ;
X    gc_val.ts_y_origin = y ;
X    XChangeGC(dpy[d], ropgc[d], gc_mask, &gc_val) ;
X!   XFillRectangle(dpy[d], window, ropgc[d], x, y, width, height) ;
X  }
X  
X  
X  void
X! draw_line(wtype, x1, y1, x2, y2, op, color)
X! enum win_type wtype ;
X  int x1, y1, x2, y2, color ;
X  enum optype op ;
X  {
X+   Window window ;
X    int d ;
X  
X    d = (int) cur_dpyno ;
X+   window = (wtype == W_MAIN) ? frame[d] : pframe[d] ;
X    if (iscolor[d]) gc_val.foreground = palette[color] ;
X    else
X      {
X***************
X*** 233,251 ****
X      }
X    gc_val.function = opvals[(int) op] ;
X    XChangeGC(dpy[d], gc[d], GCForeground | GCFunction, &gc_val) ;
X!   XDrawLine(dpy[d], frame[d], gc[d], x1, y1, x2, y2) ;
X  }
X  
X  
X  void
X! draw_stencil(x, y, width, height, op, color, stencil, image)
X  int x, y, width, height, color ;
X  enum optype op ;
X  enum image_type stencil, image ;
X  {
X    int d ;
X  
X    d = (int) cur_dpyno ;
X    if (iscolor[d]) gc_val.foreground = palette[color] ;
X    else            gc_val.foreground = foregnd[d] ;
X    gc_val.function = opvals[(int) op] ;
X--- 235,256 ----
X      }
X    gc_val.function = opvals[(int) op] ;
X    XChangeGC(dpy[d], gc[d], GCForeground | GCFunction, &gc_val) ;
X!   XDrawLine(dpy[d], window, gc[d], x1, y1, x2, y2) ;
X  }
X  
X  
X  void
X! draw_stencil(wtype, x, y, width, height, op, color, stencil, image)
X! enum win_type wtype ;
X  int x, y, width, height, color ;
X  enum optype op ;
X  enum image_type stencil, image ;
X  {
X+   Window window ;
X    int d ;
X  
X    d = (int) cur_dpyno ;
X+   window = (wtype == W_MAIN) ? frame[d] : pframe[d] ;
X    if (iscolor[d]) gc_val.foreground = palette[color] ;
X    else            gc_val.foreground = foregnd[d] ;
X    gc_val.function = opvals[(int) op] ;
X***************
X*** 259,277 ****
X              GCClipXOrigin | GCClipYOrigin |
X              GCStipple | GCTileStipXOrigin | GCTileStipYOrigin ;
X    XChangeGC(dpy[d], stencilgc[d], gc_mask, &gc_val) ;
X!   XFillRectangle(dpy[d], frame[d], stencilgc[d], x, y, width, height) ;
X  }
X  
X  
X  void
X! draw_text(x, y, ftype, color, str)
X  enum font_type ftype ;
X  int x, y, color ;
X  char *str ;
X  {
X    int d ;
X  
X    d = (int) cur_dpyno ;
X    if (iscolor[d]) gc_val.foreground = palette[color] ;
X    else
X      { 
X--- 264,285 ----
X              GCClipXOrigin | GCClipYOrigin |
X              GCStipple | GCTileStipXOrigin | GCTileStipYOrigin ;
X    XChangeGC(dpy[d], stencilgc[d], gc_mask, &gc_val) ;
X!   XFillRectangle(dpy[d], window, stencilgc[d], x, y, width, height) ;
X  }
X  
X  
X  void
X! draw_text(wtype, x, y, ftype, color, str)
X! enum win_type wtype ;
X  enum font_type ftype ;
X  int x, y, color ;
X  char *str ;
X  {
X+   Window window ;
X    int d ;
X  
X    d = (int) cur_dpyno ;
X+   window = (wtype == W_MAIN) ? frame[d] : pframe[d] ;
X    if (iscolor[d]) gc_val.foreground = palette[color] ;
X    else
X      { 
X***************
X*** 281,287 ****
X    gc_val.font = font[(int) ftype]->fid ;
X    gc_val.function = GXcopy ;
X    XChangeGC(dpy[d], gc[d], GCFont | GCForeground | GCFunction, &gc_val) ;
X!   XDrawString(dpy[d], frame[d], gc[d], x, y, str, strlen(str)) ;
X  }
X   
X   
X--- 289,295 ----
X    gc_val.font = font[(int) ftype]->fid ;
X    gc_val.function = GXcopy ;
X    XChangeGC(dpy[d], gc[d], GCFont | GCForeground | GCFunction, &gc_val) ;
X!   XDrawString(dpy[d], window, gc[d], x, y, str, strlen(str)) ;
X  }
X   
X   
X***************
X*** 313,318 ****
X--- 321,346 ----
X  }
X  
X  
X+ char *
X+ get_resource(rtype)      /* Get Reve resource from merged databases. */
X+ enum res_type rtype ;
X+ {
X+   char cstr[MAXLINE], nstr[MAXLINE], str[MAXLINE] ;
X+   char *str_type[20] ;
X+   int d ;
X+   XrmValue value ;
X+ 
X+   d = (int) cur_dpyno ;
X+   STRCPY(str, resources[(int) rtype]) ;
X+   SPRINTF(nstr,  "reve.%s", str) ;
X+   if (islower(str[0])) str[0] = toupper(str[0]) ;
X+   SPRINTF(cstr, "Reve.%s", str) ;
X+   if (XrmGetResource(reve_DB[d], nstr, cstr, str_type, &value) == NULL)
X+     return((char *) NULL) ;
X+   else return(value.addr) ;
X+ }
X+ 
X+ 
X  get_strwidth(ftype, str)    /* Get width in pixels of string value. */
X  enum font_type ftype ;
X  char *str ;
X***************
X*** 357,362 ****
X--- 385,400 ----
X  }
X  
X  
X+ /*ARGSUSED*/
X+ init_graphics(argc, argv)
X+ int *argc ;
X+ char *argv[] ;
X+ {
X+   dpy[(int) DPY1] = XOpenDisplay((char *) NULL) ;
X+   reve_DB[(int) DPY1] = NULL ;
X+ }
X+ 
X+ 
X  init_ws_type()
X  {
X  #ifndef NOSELECT
X***************
X*** 382,387 ****
X--- 420,427 ----
X    images[(int) CY_STENCIL]  = load_image(cycle_stencil_image) ;
X    images[(int) CY_LINVERT]  = load_image(cycle_linvert_image) ;
X    images[(int) CY_RINVERT]  = load_image(cycle_rinvert_image) ;
X+   images[(int) TOGGLE_ON]   = load_image(sch_on_image) ;
X+   images[(int) TOGGLE_OFF]  = load_image(sch_off_image) ;
X    images[(int) P_WHITE]     = load_image(white_image) ;
X    images[(int) P_BLACK]     = load_image(black_image) ;
X  
X***************
X*** 472,477 ****
X--- 512,578 ----
X  }
X  
X  
X+ /*  Get the resource databases. These are looked for in the following ways:
X+  *
X+  *  Classname file in the app-defaults directory. In this case, Classname
X+  *  is Reve.
X+  *
X+  *  Classname file in the directory specified by the XUSERFILESEARCHPATH
X+  *  or XAPPLRESDIR environment variable.
X+  *
X+  *  Property set using xrdb, accessible through the XResourceManagerString
X+  *  macro or, if that is empty, the ~/.Xdefaults file.
X+  *
X+  *  XENVIRONMENT environment variable or, if not set, .Xdefaults-hostname
X+  *  file.
X+  */
X+ 
X+ void
X+ load_resources()
X+ { 
X+   XrmDatabase db ;
X+   char *home, name[MAXPATHLEN], *ptr ;
X+   int d, len ;
X+   
X+   d = (int) cur_dpyno ;
X+   home = getenv("HOME") ;
X+   XrmInitialize() ;
X+   STRCPY(name, "/usr/lib/X11/app-defaults/Reve") ;
X+   
X+ /* Get applications defaults file, if any. */
X+   
X+   db = XrmGetFileDatabase(name) ;
X+   XrmMergeDatabases(db, &reve_DB[d]) ;
X+ 
X+ /* Merge server defaults, created by xrdb. If nor defined, use ~/.Xdefaults. */
X+ 
X+ #ifndef X11R3
X+   if (XResourceManagerString(dpy[d]) != NULL)
X+     db = XrmGetStringDatabase(XResourceManagerString(dpy[d])) ;
X+   else
X+ #endif /*X11R3*/
X+     { 
X+       SPRINTF(name, "%s/.Xdefaults", home) ;
X+       db = XrmGetFileDatabase(name) ;
X+     }
X+   XrmMergeDatabases(db, &reve_DB[d]) ;
X+ 
X+ /*  Open XENVIRONMENT file or, if not defined, the .Xdefaults, and merge
X+  *  into existing database.
X+  */
X+ 
X+   if ((ptr = getenv("XENVIRONMENT")) == NULL)
X+     {
X+       SPRINTF(name, "%s/.Xdefaults-", home) ;
X+       len = strlen(name) ;
X+       GETHOSTNAME(name+len, 1024-len) ;
X+       db = XrmGetFileDatabase(name) ;
X+     }
X+   else db = XrmGetFileDatabase(ptr) ;
X+   XrmMergeDatabases(db, &reve_DB[d]) ;
X+ }
X+ 
X+ 
X  /*ARGSUSED*/
X  void
X  lock_screen(state)     /* Turn graphics locking on or off - null routine. */
X***************
X*** 528,534 ****
X  
X    frame[d] = XCreateSimpleWindow(dpy[d], root[d],
X                                   size.x, size.y, size.width, size.height,
X!                                  OTHELLO_BORDER_WIDTH, foregnd[d], backgnd[d]) ;
X  
X    protocol_atom[d] = XInternAtom(dpy[d], "WM_PROTOCOLS", False) ;
X    kill_atom[d]     = XInternAtom(dpy[d], "WM_DELETE_WINDOW", False) ;
X--- 629,635 ----
X  
X    frame[d] = XCreateSimpleWindow(dpy[d], root[d],
X                                   size.x, size.y, size.width, size.height,
X!                                  REVE_BORDER_WIDTH, foregnd[d], backgnd[d]) ;
X  
X    protocol_atom[d] = XInternAtom(dpy[d], "WM_PROTOCOLS", False) ;
X    kill_atom[d]     = XInternAtom(dpy[d], "WM_DELETE_WINDOW", False) ;
X***************
X*** 552,557 ****
X--- 653,676 ----
X  
X    XSetClassHint(dpy[d], frame[d], &class_hint) ;
X  
X+ /*  Setup property window. */
X+ 
X+   psize.flags = PMinSize | PMaxSize | PPosition | PSize ;
X+   psize.x = TOTAL_WIDTH + 10 ;
X+   psize.y = 0 ;
X+   psize.max_width = size.min_width = size.width = PROPS_WIDTH ;
X+   psize.max_height = size.min_height = size.height = PROPS_HEIGHT ;
X+ 
X+   pframe[d] = XCreateSimpleWindow(dpy[d], root[d],
X+                                   size.x + TOTAL_WIDTH + 10, size.y,
X+                                   PROPS_WIDTH, PROPS_HEIGHT,
X+                                   REVE_BORDER_WIDTH, foregnd[d], backgnd[d]) ;
X+ 
X+   XSetStandardProperties(dpy[d], pframe[d], "reve properties",
X+                          "Props", reve_icon[d], argv, argc, &psize) ;
X+ 
X+ /* Create graphics contexts. */
X+ 
X    gc_mask = GCForeground | GCBackground | GCGraphicsExposures ;
X    gc_val.foreground = foregnd[d] ;
X    gc_val.background = backgnd[d] ;
X***************
X*** 600,605 ****
X--- 719,739 ----
X  
X  
X  void
X+ open_frame(wtype)
X+ enum win_type wtype ;
X+ {
X+   int d ;
X+   Window window ;
X+ 
X+   d = (int) cur_dpyno ;
X+   if (wtype == W_MAIN) window = frame[d] ;
X+   else                 window = pframe[d] ;
X+   XSelectInput(dpy[0], window, FRAME_MASK) ;
X+   XMapWindow(dpy[0], window) ;
X+ }
X+ 
X+ 
X+ void
X  process_event()         /* Determine event type. */
X  {
X    XClientMessageEvent *ev ;
X***************
X*** 609,614 ****
X--- 743,751 ----
X    int d ;
X  
X    d = (int) cur_dpyno ; 
X+        if (event.xany.window == frame[(int) cur_dpyno])  curwin = W_MAIN ;
X+   else if (event.xany.window == pframe[(int) cur_dpyno]) curwin = W_PROPS ;
X+ 
X    switch (event.type)
X      {
X        case ClientMessage    : /* Catch ICCCM kill from WM. */
X***************
X*** 669,683 ****
X  XExposeEvent *event ;
X  {
X    int d ;
X!   int doframe = 0 ;
X  
X    d = (int) cur_dpyno ;
X    do
X!     if (event->count == 0 && event->window == frame[(int) cur_dpyno])
X!       doframe++ ;
X    while (XCheckMaskEvent(dpy[d], ExposureMask, (XEvent *) event)) ;
X  
X!   return(doframe ? FRAME_REPAINT : IGNORE_EVENT) ;
X  }
X  
X  
X--- 806,827 ----
X  XExposeEvent *event ;
X  {
X    int d ;
X!   int doframe  = 0 ;
X!   int dopframe = 0 ;
X  
X    d = (int) cur_dpyno ;
X    do
X!     {
X!       if (event->count == 0 && event->window == frame[(int) cur_dpyno])
X!         doframe++ ;
X!       if (event->count == 0 && event->window == pframe[(int) cur_dpyno])
X!         dopframe++ ;
X!     }
X    while (XCheckMaskEvent(dpy[d], ExposureMask, (XEvent *) event)) ;
X  
X!        if (doframe)  return(FRAME_REPAINT) ;
X!   else if (dopframe) return(PROPS_REPAINT) ;
X!   else               return(IGNORE_EVENT) ;
X  }
X  
X  
X***************
X*** 697,709 ****
X  start_tool(dtype)            /* Start event dispatcher and display. */
X  enum disp_type dtype ;
X  {
X!   XSelectInput(dpy[0], frame[0], FRAME_MASK) ;
X!   XMapWindow(dpy[0], frame[0]) ;
X  
X    if (dtype == XTWO)
X      {
X        XSelectInput(dpy[1], frame[1], FRAME_MASK) ;
X        XMapWindow(dpy[1], frame[1]) ;
X      }
X  
X    if (dtype == XTWO) Xselect_input() ;
X--- 841,854 ----
X  start_tool(dtype)            /* Start event dispatcher and display. */
X  enum disp_type dtype ;
X  {
X!   open_frame(W_MAIN) ;
X!   XSelectInput(dpy[0], pframe[0], FRAME_MASK) ;
X  
X    if (dtype == XTWO)
X      {
X        XSelectInput(dpy[1], frame[1], FRAME_MASK) ;
X        XMapWindow(dpy[1], frame[1]) ;
X+       XSelectInput(dpy[1], pframe[1], FRAME_MASK) ;
X      }
X  
X    if (dtype == XTWO) Xselect_input() ;
X
END_OF_FILE
if test 41748 -ne `wc -c <'patches03e'`; then
    echo shar: \"'patches03e'\" unpacked with wrong size!
fi
# end of 'patches03e'
fi
echo shar: End of archive 8 \(of 9\).
cp /dev/null ark8isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 9 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0