1 /* $Id: sxsame.h,v 1.1 1996/05/04 19:08:18 yoneyama Exp yoneyama $ 2 */ 3 /************************************************************************ 4 * SameGame for X Window (sxsame) * 5 * Copyleft (c) 1994-1996 Software Research Academy * 6 ************************************************************************/ 7 #include <X11/Xlib.h> 8 9 #define MAX_WIDTH 30 10 #define MAX_HEIGHT 20 11 #define MIN_WIDTH 10 12 #define MIN_HEIGHT 8 13 14 #define BUILTIN_NDATA 3 15 16 struct item_struct { 17 char *name; 18 int lock; 19 int (*func)(); 20 }; 21 22 typedef struct { 23 int box; 24 char *box_color; 25 int selected; 26 int pushed; 27 int width, height; 28 char **xpm_data[3][5]; 29 char **bg_data; 30 char **frame_data; 31 } SameData; 32 33 typedef struct { 34 int box; 35 char *box_color; 36 int selected; 37 int pushed; 38 int width, height; 39 char *xpm_data[3][5]; 40 char *bg_data; 41 char *frame_data; 42 } ImportSameData; 43 44 typedef struct { 45 int bit_width, bit_height; 46 int bit_box; 47 int bit_pat[3]; 48 Pixmap bits_xpm[3][5]; 49 Pixmap bg_xpm; 50 Pixmap frame_xpm; 51 } SameGame; 52 53 typedef struct { 54 char *title; 55 char *fname; 56 int lock; 57 } DataFile; 58 59 void main( 60 #if NeedFunctionPrototypes 61 int, char ** 62 #endif 63 ); 64 int sxs( 65 #if NeedFunctionPrototypes 66 void 67 #endif 68 ); 69 int CreateData( 70 #if NeedFunctionPrototypes 71 SameData * 72 #endif 73 ); 74 int CreateDataFromFile( 75 #if NeedFunctionPrototypes 76 char * 77 #endif 78 ); 79 void FreeData( 80 #if NeedFunctionPrototypes 81 void 82 #endif 83 ); 84 int DrawButton( 85 #if NeedFunctionPrototypes 86 int 87 #endif 88 ); 89 int EnterButton( 90 #if NeedFunctionPrototypes 91 int 92 #endif 93 ); 94 int DrawScore( 95 #if NeedFunctionPrototypes 96 void 97 #endif 98 ); 99 int DrawLastScore( 100 #if NeedFunctionPrototypes 101 void 102 #endif 103 ); 104 int DrawLastScoreButton( 105 #if NeedFunctionPrototypes 106 void 107 #endif 108 ); 109 int DrawAllBits( 110 #if NeedFunctionPrototypes 111 int, int, int 112 #endif 113 ); 114 int DrawBit( 115 #if NeedFunctionPrototypes 116 int, int, int 117 #endif 118 ); 119 int DrawSameBits( 120 #if NeedFunctionPrototypes 121 int, int, int 122 #endif 123 ); 124 int DrawRect( 125 #if NeedFunctionPrototypes 126 int, int 127 #endif 128 ); 129 int EraseSameRect( 130 #if NeedFunctionPrototypes 131 int, int 132 #endif 133 ); 134 int ScanSame( 135 #if NeedFunctionPrototypes 136 int, int 137 #endif 138 ); 139 int CheckSame( 140 #if NeedFunctionPrototypes 141 int, int, int, int 142 #endif 143 ); 144 int DrawSameRect( 145 #if NeedFunctionPrototypes 146 int, int, int, int 147 #endif 148 ); 149 int DrawNextSameRect( 150 #if NeedFunctionPrototypes 151 int, int, int, int 152 #endif 153 ); 154 int DeleteSame( 155 #if NeedFunctionPrototypes 156 int, int 157 #endif 158 ); 159 int DeleteBit( 160 #if NeedFunctionPrototypes 161 int, int 162 #endif 163 ); 164 int PushBits( 165 #if NeedFunctionPrototypes 166 int, int, int 167 #endif 168 ); 169 unsigned long GetColor( 170 #if NeedFunctionPrototypes 171 char * 172 #endif 173 ); 174 int SelectMenu( 175 #if NeedFunctionPrototypes 176 struct item_struct *, int, int 177 #endif 178 ); 179 int DrawMenuItem( 180 #if NeedFunctionPrototypes 181 Window, int, int, int, int, struct item_struct * 182 #endif 183 ); 184 void DrawSimpleMenuItem( 185 #if NeedFunctionPrototypes 186 Window, int, int, int, DataFile ** 187 #endif 188 ); 189 190 #ifdef DEBUG 191 int DisplayWindowName( 192 Window 193 ); 194 #endif 195