1 /* 2 * XScrabble - X version of the popular board game, for 1 to 4 players. 3 * 4 * This software comes with NO warranty whatsoever. I therefore take no 5 * responsibility for any damages, losses or problems caused through use 6 * or misuse of this program. 7 * 8 * I hereby grant permission for this program to be freely copied and 9 * distributed by any means, provided no charge is made for it. 10 * 11 * Matthew Chapman, csuoq@csv.warwick.ac.uk 12 * Oct 1994. 13 */ 14 15 /* xinit.c - global declarations */ 16 17 #include "scrab.h" 18 19 XtAppContext app_context; 20 Widget topLevel,sq[MAXPLAYERS][BOARDSIZE][BOARDSIZE]; 21 Widget br[MAXPLAYERS][LONGBAR]; 22 Widget message[MAXPLAYERS]; 23 Widget all,title; 24 Widget barw[MAXPLAYERS],tilesleft[MAXPLAYERS]; 25 Widget timeleft[MAXPLAYERS],scoretitle,scorebox[MAXPLAYERS]; 26 Widget pauseButton[MAXPLAYERS],exitButton[MAXPLAYERS]; 27 Widget helpgameButton[MAXPLAYERS],helpgame[MAXPLAYERS]; 28 Widget helpgame_item[MAXPLAYERS][HELP_ITEMS]; 29 Widget menuButton[MAXPLAYERS],menu[MAXPLAYERS]; 30 Widget menu_item[MAXPLAYERS][MENU_ITEMS]; 31 32 /* 33 struct AppData { 34 int version,players,bell,timelim,t[4]; 35 String disp[4],name[4]; 36 Boolean load; 37 String dictfile,scorefile,rulesfile; 38 } app_data; 39 */ 40 41 /* buttons */ 42 Widget finish[MAXPLAYERS],change[MAXPLAYERS]; 43 Widget pass[MAXPLAYERS],evaluate[MAXPLAYERS]; 44 45 Widget title; 46 Widget blankshell,hi_scoretop[MAXPLAYERS],blankf,blanktitle,a2z[NUMLETTERS_MAX]; 47 Widget changeshell,changef,changetitle,changeconfirm,changecancel; 48 Widget changeletts[BARLEN],topl[MAXPLAYERS],lvtop[MAXPLAYERS],lvdismiss[MAXPLAYERS]; 49 Widget hi_score_ent[MAXPLAYERS][MAXPLAYERS],hi_dismiss[MAXPLAYERS]; 50 Widget rulestop[MAXPLAYERS],rulesdismiss[MAXPLAYERS],rulesmain[MAXPLAYERS]; 51 Widget showbagtop[MAXPLAYERS],showbagmain[MAXPLAYERS], 52 showbagupdate[MAXPLAYERS], showbagdismiss[MAXPLAYERS]; 53 Widget selectbagtop[MAXPLAYERS],selectbagmain[MAXPLAYERS], 54 selectbagupdate[MAXPLAYERS], selectbagdismiss[MAXPLAYERS]; 55 Widget checkwordtop[MAXPLAYERS], checkwordmain[MAXPLAYERS], 56 checkwordresult[MAXPLAYERS], 57 checkwordupdate[MAXPLAYERS], checkworddismiss[MAXPLAYERS]; 58 Widget placewordtop[MAXPLAYERS], placewordupdate[MAXPLAYERS], 59 placeworddismiss[MAXPLAYERS]; 60 Widget listwordtop[MAXPLAYERS], listwordupdate[MAXPLAYERS], 61 listworddismiss[MAXPLAYERS]; 62 Widget suggestiontop[MAXPLAYERS], suggestionupdate[MAXPLAYERS], 63 suggestiondismiss[MAXPLAYERS]; 64 Widget bestgotop[MAXPLAYERS],bestgodismiss[MAXPLAYERS],bestgomain[MAXPLAYERS]; 65 Widget keytop[MAXPLAYERS],keydismiss[MAXPLAYERS]; 66 Widget abouttop[MAXPLAYERS],aboutdismiss[MAXPLAYERS]; 67 Widget messtop[MAXPLAYERS]; 68 Widget compw[MAXPLAYERS], compshowbar[MAXPLAYERS], comphidebar[MAXPLAYERS]; 69 70 /* extra buttons */ 71 Widget lastgo[MAXPLAYERS],revert[MAXPLAYERS],juggle[MAXPLAYERS]; 72 73 Display *dpy[MAXPLAYERS]; 74 75 char bar[MAXPLAYERS][LONGBAR]; 76 Pixmap bgxpm, markhelp[MAXPLAYERS], markmenu[MAXPLAYERS]; 77 Boolean menu_status[MAXPLAYERS][MENU_ITEMS]; 78 Boolean helpgame_status[MAXPLAYERS][HELP_ITEMS]; 79 80 char *colours[] = 81 { 82 "green","skyblue","blue2","orange","red" 83 }; 84 85 Boolean is_perm[BOARDSIZE][BOARDSIZE]; 86 Boolean waiting=False,waiting_for_blank,waiting_for_change,finished_go; 87 char blank_letter; 88 89 char cboard[BOARDSIZE][BOARDSIZE]; 90 91 /* to check for everyone passing */ 92 int num_passed=0; 93 94 int type[MAXPLAYERS]; 95 96 /* for the timer */ 97 int comp,time_limit; 98 99 /* for the sound level */ 100 int bell_level; 101 102 char modestart[80], modepause[80]; 103 104