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 /* xscrab.h - includes, defines and structures for X interface */ 16 17 18 #include <X11/Intrinsic.h> 19 #include <X11/StringDefs.h> 20 #include <X11/cursorfont.h> 21 22 #include <X11/Xaw/Label.h> 23 #include <X11/Xaw/Command.h> 24 #include <X11/Xaw/Form.h> 25 #include <X11/Xaw/Toggle.h> 26 #include <X11/Xaw/AsciiText.h> 27 #include <X11/Xaw/MenuButton.h> 28 #include <X11/Xaw/SimpleMenu.h> 29 #include <X11/Xaw/Sme.h> 30 #include <X11/Xaw/SmeBSB.h> 31 32 #include <X11/Xatom.h> 33 #include <X11/Shell.h> 34 #include <X11/xpm.h> 35 36 #include "CircPerc.h" 37 #include <X11/Xc/BarGraf.h> 38 39 #include <stdio.h> 40 41 /* 42 * Version number is defined in config.h during the build process 43 * and is used to make sure that X resources are correctly settled 44 */ 45 #include "config.h" 46 47 #define SETBG(x) XtVaTypedArg,XtNbackground,XtRString,x,strlen((char *)x)+1 48 #define SETFG(x) XtVaTypedArg,XtNforeground,XtRString,x,strlen((char *)x)+1 49 #define LETTERCOL "black" 50 #define TILECOL "lightgoldenrodyellow" 51 #define BRIGHTCOL "white" 52 #define BARCOL "forestgreen" 53 #define LONGBAR 13 54 55 #define NUM_TYPES 8 56 57 #define MENU_ITEMS 7 58 enum { KEY, LETTVAL, RULES, HISCORES, BESTGOES, MESSAGE, ABOUT }; 59 60 #define HELP_ITEMS 6 61 enum { MANUAL, BAG, CHECK, PLACE, LIST, SUGGESTION }; 62 63 #define MESS_DELAY 4000 64 65 /* messages */ 66 #define LETTERSEQ 0 /* List of letters */ 67 #define FREQSEQ 1 /* List of letter frequencies */ 68 #define SCORESEQ 2 /* List of letter scores */ 69 #define BLANKTILES 3 /* List of blanktiles */ 70 #define LABLVMAIN 4 /* "Letters Scores Frequencies" */ 71 #define LABJOKER 5 /* "Joker letter" */ 72 #define WDPOINT 6 /* "point" */ 73 #define WDPOINTS 7 /* "points" */ 74 #define PLAYER 8 /* "Player" */ 75 #define NAME 9 /* "Name" */ 76 #define SCORE 10 /* "Score" */ 77 #define BAR 11 /* "Bar" */ 78 #define EMPTY 12 /* "EMPTY" */ 79 #define EMPTY_PAR 13 /* "(empty)" */ 80 #define YOUR_GO 14 /* "Your go %s." */ 81 #define START_GO_ALL 15 /* "%s's go." */ 82 #define GO_ACCEPTED 16 /* "Go accepted. You score %d %s." */ 83 #define GO_ALL 17 /* "%s scores %d %s." */ 84 #define WOULD_SCORE 18 /* "That go would score %d %s." */ 85 #define TILES_LEFT 19 /* "Tiles left: " */ 86 #define SPAM 20 /* "*** SPAM! ***" */ 87 #define LOST_GO 21 /* "Word is not valid - you lose your go." */ 88 #define LOST_GO_ALL 22 /* "%s makes an invalid word." */ 89 #define CANNOT_CHANGE 23 /* "Not enough tiles left to change that many." */ 90 #define PLAYER_CHANGE 24 /* "%s changes tiles." */ 91 #define USE_CENTRE 25 /* "You must use the centre square." */ 92 #define ARRANGEMENT 26 /* "Incorrect arrangement of tiles." */ 93 #define FIXED_TILE 27 /* "That tile can't be moved." */ 94 #define OCCUPIED 28 /* "Square is occupied." */ 95 #define PASS 29 /* "%s passes." */ 96 #define NOT_ON_BOARD 30 /* "Cannot access board - it is not your go." */ 97 #define GAME_OVER_LOSE 31 /* "Game Over. You lose %d %s." */ 98 #define GAME_OVER_WIN 32 /* "Game Over. You get %d bonus %s." */ 99 #define WINNER 33 /* "%s is the winner!" */ 100 #define DRAWN2 34 /* "%s and %s draw!" */ 101 #define DRAWN3 35 /* "%s, %s and %s draw!" */ 102 #define DRAW_ALL 36 /* "It is a complete draw!" */ 103 #define COMP_SCORE 37 /* "%s scores %d %s." */ 104 #define OUT_TIME_ALL 38 /* "%s runs out of time." */ 105 #define OUT_TIME 39 /* "You are out of time." */ 106 #define TO_END 40 /* "Select quit to end." */ 107 #define MESS_PING 41 /* "%s sends message. See Extras Menu." */ 108 #define STARTING_GAME 42 /* "Starting game" */ 109 #define DISMISS 43 /* "Dismiss" */ 110 #define PING_ALL 44 /* "Ping all" */ 111 #define THINKING 45 /* "Thinking" */ 112 #define HUMAN 46 /* "(Human)" */ 113 #define COMPUTER 47 /* "(computer level )" */ 114 #define START_PAUSE 48 /* "asks for a pause." */ 115 #define STOP_PAUSE 49 /* "comes back to the game." */ 116 #define SORTED_OUT 50 /* "%s has been sorted out to start." */ 117 #define READY 51 /* "%s, are you ready to start?" */ 118 #define OK_HE_STARTS 52 /* "Ok, %s will start the game..." */ 119 #define VALIDWORD 53 /* "Valid word" */ 120 #define INVALIDWORD 54 /* "Invalid word" */ 121 122 #define NUMPROMPTS 56 123