forked from fulldecent/kibitz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameWindowController.h
99 lines (91 loc) · 4.36 KB
/
GameWindowController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
$Id$
Copyright 2006 Klaus Thul ([email protected])
This file is part of Kibitz.
Kibitz is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Kibitz is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Kibitz; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#import "global.h"
#import "ChessServerConnection.h"
#import "PlayView.h"
@interface GameWindowController : NSWindowController <NSToolbarDelegate> {
ChessServerConnection *serverConnection;
IBOutlet NSTextField *serverInput;
IBOutlet NSDrawer *seekDrawer;
IBOutlet NSTableView *tableView, *serverOutput;
IBOutlet ChessView *chessView;
IBOutlet NSTextField *upperClock, *lowerClock, *upperName, *lowerName, *result, *resultReason, *gameType, *messageField;
IBOutlet NSTableView *seekTable, *movesTable;
IBOutlet NSPopUpButton *gameSelector;
IBOutlet NSSplitView *verticalSplit, *horizontalSplit;
IBOutlet NSView *playView, *chatView, *movesView, *upperView;
IBOutlet PlayView *playInnerView;
IBOutlet NSArrayController *moveListController;
char move[10];
NSTimer *timer;
Game *activeGame;
NSDictionary *gameList;
NSToolbar *toolbar;
NSMutableDictionary *toolbarItems;
NSString *message;
}
- (id) initWithServerConnection: (ChessServerConnection *) sc;
- (void) updateWindowTitle;
- (void) dealloc;
- (IBAction) toggleSeekDrawer: (id) sender;
- (void) updateClock: (NSTimer *) aTimer;
- (int) numberOfRowsInTableView: (NSTableView *) aTableView;
- (id) tableView:(NSTableView *) aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex;
- (void) seekTableNeedsDisplay;
- (void) setShowBoard: (ChessMove *) board;
- (IBAction) selectGame: (id) sender;
- (void) setGameList: (NSDictionary *) gl;
- (void) updateGame: (Game *) g;
- (void) setActiveGame: (Game *) g;
- (Game *) activeGame;
- (void) userMoveFrom: (struct ChessField) from to: (struct ChessField) to promotion: (int) promotion;
+ (NSString *) stringWithClock: (int) seconds;
- (void) updateClocks;
- (IBAction) takeback: (id) sender;
- (IBAction) takeback2: (id) sender;
- (IBAction) draw: (id) sender;
- (IBAction) resign: (id) sender;
- (IBAction) adjourn: (id) sender;
- (IBAction) abort: (id) sender;
- (IBAction) match: (id) sender;
- (IBAction) accept: (id) sender;
- (IBAction) decline: (id) sender;
- (IBAction) flipBoard: (id) sender;
- (IBAction) hideMoves: (id) sender;
- (IBAction) hideDialog: (id) sender;
- (IBAction) logout: (id) sender;
- (IBAction) reconnect: (id) sender;
- (IBAction) exportGame: (id) sender;
- (IBAction) newPlayWindow: (id) sender;
- (IBAction) newChatWindow: (id) sender;
- (BOOL)splitView: (NSSplitView *) sender canCollapseSubview: (NSView *) subview;
- (float)splitView: (NSSplitView *) sender constrainMaxCoordinate: (float) proposedMax ofSubviewAt:(int)offset;
- (float)splitView: (NSSplitView *) sender constrainMinCoordinate: (float) proposedMin ofSubviewAt:(int)offset;
- (void) awakeFromNib;
- (NSToolbarItem *) toolbar: (NSToolbar *) toolbar itemForItemIdentifier: (NSString *) itemIdentifier willBeInsertedIntoToolbar: (BOOL) flag;
- (NSArray *) toolbarAllowedItemIdentifiers: (NSToolbar *) toolbar;
- (NSArray *) toolbarDefaultItemIdentifiers: (NSToolbar *) toolbar;
- (void) updateGameInfo;
- (void) showMessage: (NSString *) text;
- (void) clearMessage;
- (NSSize) windowWillResize:(NSWindow *) sender toSize: (NSSize) proposedFrameSize;
- (enum Color) sideShownOnBottom;
- (void) observeValueForKeyPath: (NSString *) keyPath ofObject: (id) object change: (NSDictionary *) change context: (void *) context;
- (BOOL) windowShouldClose: (id)sender;
- (void) logoutWarningDidEnd: (NSWindow *) sheet returnCode: (int) returnCode contextInfo: (void *) contextInfo;
- (void) windowWillClose: (NSNotification *) aNotification;
- (IBAction) newSeek: (id) sender;
- (IBAction) togglePlaySound: (id) sender;
- (IBAction) sendSeekToServer: (id) sender;
- (void) commandEntered: (NSString *) command;
- (BOOL) validateMenuItem: (NSMenuItem *) menuItem;
@end