1 /* 2 * $Source: /cvsroot/cgoban1/cgoban1/src/editTool.h,v $ 3 * $Revision: 1.2 $ 4 * $Date: 2000/02/09 06:50:02 $ 5 * 6 * src/editTool.h, part of Complete Goban (game program) 7 * Copyright � 1995,2000 William Shubert. 8 * See "configure.h.in" for more copyright information. 9 */ 10 11 12 #ifndef _EDITTOOL_H_ 13 #define _EDITTOOL_H_ 1 14 15 #ifndef _CGOBAN_H_ 16 #include "cgoban.h" 17 #endif 18 #ifndef _SGF_H_ 19 #include "sgf.h" 20 #endif 21 22 23 /********************************************************************** 24 * Data types 25 **********************************************************************/ 26 typedef enum { 27 editTool_play, editTool_changeBoard, editTool_score, 28 editTool_triangle, editTool_square, editTool_circle, 29 editTool_letter, editTool_number 30 } EditTool; 31 #define editTool_min editTool_play 32 #define editTool_max (editTool_number + 1) 33 34 35 typedef struct EditToolWin_struct { 36 Cgoban *cg; 37 bool modified; 38 39 ButWin *toolWin, *toolIWin; 40 AbutSwin *mapWin; 41 But *toolBg, *toolIBg, *toolIPic; 42 43 But *toolSel, *selDesc[editTool_max]; 44 But *toolBox, *toolName, *toolDesc1, *toolDesc2; 45 But *help, *killNode, *moveNode; 46 47 But *mapBg, *sgfMap, *prevVar, *nextVar; 48 49 EditTool tool; 50 GoStone lastColor; /* Color of the editTool_play icon. */ 51 Sgf *sgf; 52 53 void (*quitRequested)(void *packet); 54 ButOut (*newToolCallback)(void *packet); 55 ButOut (*mapCallback)(void *packet, int nodeNum); 56 void *packet; 57 58 MAGIC_STRUCT 59 } EditToolWin; 60 61 62 /********************************************************************** 63 * Functions 64 **********************************************************************/ 65 extern void editToolWin_init(EditToolWin *etw, Cgoban *cg, Sgf *sgf, 66 void (*quitRequested)(void *packet), 67 ButOut (*newToolCallback)(void *packet), 68 ButOut (*newActiveNode)(void *packet, 69 int nodeNum), 70 void *packet); 71 extern void editToolWin_deinit(EditToolWin *etw); 72 extern void editToolWin_newColor(EditToolWin *etw, GoStone color); 73 extern void editToolWin_newTool(EditToolWin *etw, EditTool tool, 74 bool propagate); 75 extern void editToolWin_newActiveNode(EditToolWin *etw, SgfElem *newNode); 76 extern void editToolWin_nodeAdded(EditToolWin *etw, SgfElem *newNode); 77 extern ButOut editToolWin_shiftUpPressed(But *but, bool press); 78 extern ButOut editToolWin_shiftDownPressed(But *but, bool press); 79 80 #endif /* _EDITTOOL_H_ */ 81