-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPZWindowController.h
80 lines (58 loc) · 2.11 KB
/
PZWindowController.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
//
// PZWindowController.h
// PzzApp
//
// Created by Ana Ca–izares on 27.03.12.
// Copyright 2012 Pil Pel Soft. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "PZModel.h"
extern NSString* PZWindowPreferencesUpdated;
typedef enum {
none, restartSheet, shuffleSheet,
changeLevelSheet, changeSizeSheet,
chooseEmptyBlockSheet, chooseImageSheet
} SheetModes;
// This is a block (an Obj-C closure)
// We use them for the sheet dialogs;ü
typedef void (^AlertBlock)(void);
@interface PZButtonCell : NSButtonCell {
CGFloat imageAlpha; // 1.0 = no transparency
}
@property CGFloat imageAlpha;
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
@end
/*!
*/
@interface PZWindowController : NSWindowController <NSAnimationDelegate> {
PZModel* puzz;
NSMutableDictionary* puzzlePrefs;
IBOutlet NSMatrix* matrix;
NSColor* matrixBgColor;
IBOutlet NSPanel* alertSheet;
IBOutlet NSButton* alertSheetCheck;
SheetModes currSheetMode;
}
- (id) initWithPrefs: (NSMutableDictionary*) prefs;
- (void) changeSizeWithRows: (int) r columns: (int) c;
//- (IBAction) changeImage: (id) sender;
- (BOOL) changeImage: (NSImage*) newImage; // still necessary?
//// UI actions fired through the responder chain
- (void) doShuffle: (id) sender;
- (void) doRestart: (id) sender;
- (void) doChangeSize: (id) sender;
- (void) doChangeLevel: (id) sender;
//// These two together implement "empty cell editing mode"
- (void) doChangeEmptyCell: (id) sender;
- (void) doTakePieceOff: (id) sender;
- (void) doChangeBackgroundColor: (id) sender;
//// The matrix has this as an action (WARNING! don't set the action of the
// cells or the matrix' action won't get called after a click.)
- (void) doMovePiece: (id) sender;
- (IBAction) showOrNotAgain: (id) sender;
- (IBAction) alertSheetOK: (id) sender;
- (IBAction) alertSheetCancel: (id) sender;
- (void) openAlertSheet: (AlertBlock) code;
- (void) alertSheetDidEnd: (NSWindow *) sheet
returnCode: (int) returnCode contextInfo: (void *) contextInfo;
@end