Skip to content

Commit 2d0781b

Browse files
authored
Bring in pre-Github changes for a compiling GUI. (#33)
* Bring in pre-Github changes for a compiling GUI. * Add building of bluepill-gui to the bluepill scheme.
1 parent f695b5a commit 2d0781b

File tree

12 files changed

+906
-2
lines changed

12 files changed

+906
-2
lines changed

Bluepill-gui/Bluepill-gui.xcodeproj/project.pbxproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
7AA919AB1DEE094C0031D0BC /* BPConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AA919A81DEE094C0031D0BC /* BPConfiguration.m */; };
2424
7AA919AC1DEE094C0031D0BC /* BPUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AA919AA1DEE094C0031D0BC /* BPUtils.m */; };
2525
7AAC808C1E01974A00EEBC97 /* CheckboxHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AAC808B1E01974A00EEBC97 /* CheckboxHeader.m */; };
26+
7ADA926E1E37CEE100730836 /* BPPrefs.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ADA926D1E37CEE100730836 /* BPPrefs.m */; };
2627
/* End PBXBuildFile section */
2728

2829
/* Begin PBXCopyFilesBuildPhase section */
@@ -70,6 +71,8 @@
7071
7AA919AD1DEE09DA0031D0BC /* BPConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BPConstants.h; sourceTree = "<group>"; };
7172
7AAC808A1E01974A00EEBC97 /* CheckboxHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CheckboxHeader.h; sourceTree = "<group>"; };
7273
7AAC808B1E01974A00EEBC97 /* CheckboxHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CheckboxHeader.m; sourceTree = "<group>"; };
74+
7ADA926C1E37CEE100730836 /* BPPrefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BPPrefs.h; sourceTree = "<group>"; };
75+
7ADA926D1E37CEE100730836 /* BPPrefs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BPPrefs.m; sourceTree = "<group>"; };
7376
/* End PBXFileReference section */
7477

7578
/* Begin PBXFrameworksBuildPhase section */
@@ -104,6 +107,7 @@
104107
isa = PBXGroup;
105108
children = (
106109
7AA919A61DEE09110031D0BC /* Shared */,
110+
7ADA926B1E37CEE100730836 /* Utils */,
107111
7A13E5AD1DD22A3A004034BC /* AppDelegate.h */,
108112
7A13E5AE1DD22A3A004034BC /* AppDelegate.m */,
109113
7A16C3A71DDF6D5F009B31E6 /* ConfigView.h */,
@@ -160,6 +164,15 @@
160164
path = ../../Source/Shared;
161165
sourceTree = "<group>";
162166
};
167+
7ADA926B1E37CEE100730836 /* Utils */ = {
168+
isa = PBXGroup;
169+
children = (
170+
7ADA926C1E37CEE100730836 /* BPPrefs.h */,
171+
7ADA926D1E37CEE100730836 /* BPPrefs.m */,
172+
);
173+
path = Utils;
174+
sourceTree = "<group>";
175+
};
163176
/* End PBXGroup section */
164177

165178
/* Begin PBXNativeTarget section */
@@ -243,6 +256,7 @@
243256
7AAC808C1E01974A00EEBC97 /* CheckboxHeader.m in Sources */,
244257
7A4FB8D81DF89AD60073F268 /* BPXCTestFile.m in Sources */,
245258
7A13E5AF1DD22A3A004034BC /* AppDelegate.m in Sources */,
259+
7ADA926E1E37CEE100730836 /* BPPrefs.m in Sources */,
246260
7A4FB8E31DF89B280073F268 /* BPTestCase.m in Sources */,
247261
);
248262
runOnlyForDeploymentPostprocessing = 0;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright 2016 LinkedIn Corp.
2+
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
3+
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
4+
//
5+
// Unless required by applicable law or agreed to in writing,
6+
// software distributed under the License is distributed on an "AS IS" BASIS,
7+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8+
9+
#import <Foundation/Foundation.h>
10+
11+
extern NSString * const BPErrorDomain;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 2016 LinkedIn Corporation
2+
// Licensed under the BSD 2-Clause License (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at https://opensource.org/licenses/BSD-2-Clause
5+
//
6+
// Unless required by applicable law or agreed to in writing, software
7+
// distributed under the License is distributed on an "AS IS" BASIS,
8+
// WITHOUT WARRANTIES OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
9+
10+
#import <Cocoa/Cocoa.h>
11+
12+
@class CheckboxHeader;
13+
14+
@protocol CheckboxHeaderDelegate <NSObject>
15+
16+
- (void)checkboxHeader:(CheckboxHeader *)checkboxHeader stateChanged:(NSInteger)newState;
17+
18+
@end
19+
20+
21+
@interface CheckboxHeader : NSTableHeaderCell
22+
@property (nonatomic, weak) id<CheckboxHeaderDelegate> delegate;
23+
24+
- (void)handleClick;
25+
- (void)setCheckboxState:(NSInteger)state;
26+
27+
@end
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Copyright 2016 LinkedIn Corporation
2+
// Licensed under the BSD 2-Clause License (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at https://opensource.org/licenses/BSD-2-Clause
5+
//
6+
// Unless required by applicable law or agreed to in writing, software
7+
// distributed under the License is distributed on an "AS IS" BASIS,
8+
// WITHOUT WARRANTIES OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
9+
10+
#import "CheckboxHeader.h"
11+
12+
@interface CheckboxHeader()
13+
@property (nonatomic, strong) NSButtonCell *checkbox;
14+
@end
15+
16+
@implementation CheckboxHeader
17+
18+
- (instancetype)init {
19+
self = [super init];
20+
21+
if (self) {
22+
[self setTitle:@""];
23+
24+
self.checkbox = [[NSButtonCell alloc] init];
25+
[self.checkbox setButtonType:NSButtonTypeSwitch];
26+
[self.checkbox setControlSize:self.controlSize];
27+
[self.checkbox setTitle:@""];
28+
[self.checkbox setImagePosition:NSImageLeft];
29+
[self.checkbox setAllowsMixedState:YES];
30+
}
31+
return self;
32+
}
33+
34+
- (void)handleClick {
35+
NSInteger newState = self.checkbox.state;
36+
switch (self.checkbox.state) {
37+
case NSOnState:
38+
case NSMixedState:
39+
newState = NSOffState;
40+
break;
41+
case NSOffState:
42+
newState = NSOnState;
43+
break;
44+
}
45+
self.checkbox.state = newState;
46+
[self.delegate checkboxHeader:self stateChanged:newState];
47+
}
48+
49+
- (void)setCheckboxState:(NSInteger)state {
50+
self.checkbox.state = state;
51+
[self.delegate checkboxHeader:self stateChanged:state];
52+
}
53+
54+
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
55+
[self.checkbox drawWithFrame:cellFrame inView:controlView];
56+
}
57+
58+
@end
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2016 LinkedIn Corporation
2+
// Licensed under the BSD 2-Clause License (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at https://opensource.org/licenses/BSD-2-Clause
5+
//
6+
// Unless required by applicable law or agreed to in writing, software
7+
// distributed under the License is distributed on an "AS IS" BASIS,
8+
// WITHOUT WARRANTIES OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
9+
10+
#import <Cocoa/Cocoa.h>
11+
12+
@protocol ConsoleOutputDelegate
13+
- (void)onConsoleOutput:(NSString *)output;
14+
@end
15+
16+
@class TestItem;
17+
18+
@interface ConfigView : NSView
19+
@property (nonatomic, weak) id<ConsoleOutputDelegate> delegate;
20+
21+
- (NSArray<TestItem *> *)getTestList;
22+
23+
@end
24+
25+
@interface TestItem : NSObject
26+
@property (nonatomic, assign) BOOL selected;
27+
@property (nonatomic, strong) NSString *testClass;
28+
@property (nonatomic, strong) NSString *testName;
29+
@end

0 commit comments

Comments
 (0)