clang format, interaction updates.

This commit is contained in:
Kilian Hofmann 2016-03-23 12:36:10 +01:00
parent d2a0a7b04b
commit 6a67571360
5 changed files with 177 additions and 102 deletions

65
.clang-format Normal file
View File

@ -0,0 +1,65 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: true
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakTemplateDeclarations: false
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BinPackParameters: true
BinPackArguments: true
ColumnLimit: 80
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
DerivePointerAlignment: false
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: false
IndentWrappedFunctionNames: false
IndentFunctionDeclarationAfterType: false
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: true
NamespaceIndentation: None
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
SpacesBeforeTrailingComments: 1
Cpp11BracedListStyle: true
Standard: Cpp11
IndentWidth: 4
TabWidth: 8
UseTab: Never
BreakBeforeBraces: Attach
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterCStyleCast: false
SpacesInContainerLiterals: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
CommentPragmas: '^ IWYU pragma:'
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
SpaceBeforeParens: ControlStatements
DisableFormat: false
...

View File

@ -18,9 +18,9 @@
E22EE9EA1C9DB7B4001F5BC0 /* FMC_Planner_2Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = E22EE9E91C9DB7B4001F5BC0 /* FMC_Planner_2Tests.m */; };
E22EE9F51C9DB7B4001F5BC0 /* FMC_Planner_2UITests.m in Sources */ = {isa = PBXBuildFile; fileRef = E22EE9F41C9DB7B4001F5BC0 /* FMC_Planner_2UITests.m */; };
E28E106D1C9FF93D006E2C6B /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E28E106C1C9FF93D006E2C6B /* QuartzCore.framework */; };
E28E10711CA01EC9006E2C6B /* Menu.plist in Resources */ = {isa = PBXBuildFile; fileRef = E28E10701CA01EC9006E2C6B /* Menu.plist */; };
E28E10731CA0375F006E2C6B /* Route.plist in Resources */ = {isa = PBXBuildFile; fileRef = E28E10721CA0375F006E2C6B /* Route.plist */; };
E28E10751CA037F2006E2C6B /* Perf Init.plist in Resources */ = {isa = PBXBuildFile; fileRef = E28E10741CA037F2006E2C6B /* Perf Init.plist */; };
E28E10711CA01EC9006E2C6B /* MENU.plist in Resources */ = {isa = PBXBuildFile; fileRef = E28E10701CA01EC9006E2C6B /* MENU.plist */; };
E28E10731CA0375F006E2C6B /* ROUTE.plist in Resources */ = {isa = PBXBuildFile; fileRef = E28E10721CA0375F006E2C6B /* ROUTE.plist */; };
E28E10751CA037F2006E2C6B /* PERF INIT.plist in Resources */ = {isa = PBXBuildFile; fileRef = E28E10741CA037F2006E2C6B /* PERF INIT.plist */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -62,9 +62,9 @@
E22EE9F41C9DB7B4001F5BC0 /* FMC_Planner_2UITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FMC_Planner_2UITests.m; sourceTree = "<group>"; };
E22EE9F61C9DB7B4001F5BC0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E28E106C1C9FF93D006E2C6B /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
E28E10701CA01EC9006E2C6B /* Menu.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Menu.plist; sourceTree = "<group>"; };
E28E10721CA0375F006E2C6B /* Route.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Route.plist; sourceTree = "<group>"; };
E28E10741CA037F2006E2C6B /* Perf Init.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Perf Init.plist"; sourceTree = "<group>"; };
E28E10701CA01EC9006E2C6B /* MENU.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = MENU.plist; sourceTree = "<group>"; };
E28E10721CA0375F006E2C6B /* ROUTE.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = ROUTE.plist; sourceTree = "<group>"; };
E28E10741CA037F2006E2C6B /* PERF INIT.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "PERF INIT.plist"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -172,9 +172,9 @@
E28E106F1CA01EA1006E2C6B /* Screens */ = {
isa = PBXGroup;
children = (
E28E10701CA01EC9006E2C6B /* Menu.plist */,
E28E10721CA0375F006E2C6B /* Route.plist */,
E28E10741CA037F2006E2C6B /* Perf Init.plist */,
E28E10701CA01EC9006E2C6B /* MENU.plist */,
E28E10721CA0375F006E2C6B /* ROUTE.plist */,
E28E10741CA037F2006E2C6B /* PERF INIT.plist */,
);
name = Screens;
sourceTree = "<group>";
@ -285,11 +285,11 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E28E10751CA037F2006E2C6B /* Perf Init.plist in Resources */,
E28E10751CA037F2006E2C6B /* PERF INIT.plist in Resources */,
E22EE9DF1C9DB7B3001F5BC0 /* LaunchScreen.storyboard in Resources */,
E28E10711CA01EC9006E2C6B /* Menu.plist in Resources */,
E28E10711CA01EC9006E2C6B /* MENU.plist in Resources */,
E22EE9DC1C9DB7B3001F5BC0 /* Assets.xcassets in Resources */,
E28E10731CA0375F006E2C6B /* Route.plist in Resources */,
E28E10731CA0375F006E2C6B /* ROUTE.plist in Resources */,
E22EE9DA1C9DB7B3001F5BC0 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
@ -21,8 +21,8 @@
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6JY-wx-fWz">
<rect key="frame" x="20" y="348" width="280" height="205"/>
<constraints>
<constraint firstAttribute="width" constant="280" id="e41-RH-0Kp"/>
<constraint firstAttribute="height" constant="205" id="gDi-3X-8ir"/>
<constraint firstAttribute="width" constant="280" id="AFD-aL-Jhp"/>
<constraint firstAttribute="height" constant="205" id="jsn-LS-C1H"/>
</constraints>
<connections>
<segue destination="wIq-rl-lQa" kind="embed" identifier="keyboard" id="iRf-Lv-WlY"/>
@ -37,11 +37,11 @@
</subviews>
<color key="backgroundColor" white="0.33000000000000002" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="6JY-wx-fWz" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="BoO-h6-sdM"/>
<constraint firstItem="uVT-4Z-zN6" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="20" id="PSi-Ow-TcU"/>
<constraint firstItem="uVT-4Z-zN6" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" id="RA4-ch-Czz"/>
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="6JY-wx-fWz" secondAttribute="bottom" constant="15" id="W0b-Iv-8Gf"/>
<constraint firstItem="6JY-wx-fWz" firstAttribute="top" secondItem="uVT-4Z-zN6" secondAttribute="bottom" constant="8" id="ixg-ql-E0A"/>
<constraint firstItem="6JY-wx-fWz" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="kbH-th-QDl"/>
<constraint firstAttribute="trailing" secondItem="uVT-4Z-zN6" secondAttribute="trailing" constant="20" id="v0r-d2-OoH"/>
</constraints>
</view>
@ -446,6 +446,10 @@
<scene sceneID="yrV-d4-XU2">
<objects>
<viewController id="Ugt-3C-LsO" customClass="ViewControllerScreen" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="bgX-Bo-CkS"/>
<viewControllerLayoutGuide type="bottom" id="gQe-JE-c2y"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="2YN-Dg-9F2">
<rect key="frame" x="0.0" y="0.0" width="280" height="320"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>

View File

@ -53,11 +53,11 @@
} else if ([sender.restorationIdentifier isEqualToString:@"Delete"]) {
_main.screen.Scratchpad.text = @"DELETE";
} else if ([sender.restorationIdentifier isEqualToString:@"Top"]) {
[_main.screen loadScreen:@"Menu"];
[_main.screen loadScreen:@"MENU"];
} else if ([sender.restorationIdentifier isEqualToString:@"Mid"]) {
[_main.screen loadScreen:@"Perf Init"];
[_main.screen loadScreen:@"PERF INIT"];
} else if ([sender.restorationIdentifier isEqualToString:@"Bot"]) {
[_main.screen loadScreen:@"Route"];
[_main.screen loadScreen:@"ROUTE"];
} else {
_main.screen.Scratchpad.text = [_main.screen.Scratchpad.text
stringByAppendingString:sender.titleLabel.text];

View File

@ -22,9 +22,8 @@
// Tap gesture shit
for (UILabel *label in _LSK) {
label.adjustsFontSizeToFitWidth = YES;
label.userInteractionEnabled = YES;
UITapGestureRecognizer *reg =
[[UITapGestureRecognizer alloc] initWithTarget:self
UITapGestureRecognizer *reg = [[UITapGestureRecognizer alloc]
initWithTarget:self
action:@selector(enterLSK:)];
[reg setNumberOfTapsRequired:1];
[reg setNumberOfTouchesRequired:1];
@ -34,7 +33,7 @@
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:YES];
[self loadScreen:@"Menu"];
[self loadScreen:@"MENU"];
}
- (void)viewDidLayoutSubviews {
@ -45,7 +44,8 @@
withMinimumSize:5
withMod:0.7];
_Header.adjustsFontSizeToFitWidth = YES;
_Scratchpad.font = [self findAdaptiveFontForUILabelSize:_Scratchpad.frame.size
_Scratchpad.font =
[self findAdaptiveFontForUILabelSize:_Scratchpad.frame.size
withMinimumSize:5
withMod:0.7];
_Scratchpad.adjustsFontSizeToFitWidth = YES;
@ -91,8 +91,8 @@
difference =
labelSize.height / mod -
[testString
sizeWithAttributes:[NSDictionary
dictionaryWithObject:tempFont
sizeWithAttributes:
[NSDictionary dictionaryWithObject:tempFont
forKey:NSFontAttributeName]]
.height;
@ -118,11 +118,17 @@
- (void)loadScreen:(NSString *)screenName {
_Header.text = screenName;
NSArray *screen = [[NSArray alloc]
initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:screenName
NSArray *screen =
[[NSArray alloc] initWithContentsOfFile:[[NSBundle mainBundle]
pathForResource:screenName
ofType:@"plist"]];
for (int i = 0; i < _Desc.count; i++) {
((UILabel *)_Desc[i]).text = [NSString stringWithFormat:@"%@\n", screen[i]];
((UILabel *)_Desc[i]).text =
[NSString stringWithFormat:@"%@\n", screen[i]];
if (![screen[i] isEqualToString:@""] ||
[_Header.text isEqualToString:@"ROUTE"]) {
((UILabel *)_LSK[i]).userInteractionEnabled = YES;
}
}
}