Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 19 additions & 23 deletions PeyeDF.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -985,24 +985,26 @@
A91CB9431B332EDB00671868 = {
CreatedOnToolsVersion = 6.3.2;
DevelopmentTeam = XXXXXXXXXX;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
};
A91CB9571B332EDB00671868 = {
CreatedOnToolsVersion = 6.3.2;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
TestTargetID = A91CB9431B332EDB00671868;
};
A964E0FC1CD8F23D00EE72B5 = {
CreatedOnToolsVersion = 7.3;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
TestTargetID = A91CB9431B332EDB00671868;
};
A9E8F7741DA27E8C004FBA51 = {
DevelopmentTeam = XXXXXXXXXX;
LastSwiftMigration = 1000;
};
A9E8F7F01DA297A2004FBA51 = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeam = XXXXXXXXXX;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
TestTargetID = A9E8F7741DA27E8C004FBA51;
};
Expand Down Expand Up @@ -1460,7 +1462,7 @@
OTHER_SWIFT_FLAGS = "-DDEBUG";
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand Down Expand Up @@ -1509,7 +1511,7 @@
OTHER_SWIFT_FLAGS = "-DRELEASE";
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down Expand Up @@ -1537,8 +1539,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SWIFT_OBJC_BRIDGING_HEADER = "PeyeDF/Utility/PeyeDF-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -1562,8 +1563,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SWIFT_OBJC_BRIDGING_HEADER = "PeyeDF/Utility/PeyeDF-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -1585,8 +1585,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "HIIT.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "PeyeDF/Utility/PeyeDF-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PeyeDF.app/Contents/MacOS/PeyeDF";
};
name = Debug;
Expand All @@ -1605,8 +1604,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "HIIT.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "PeyeDF/Utility/PeyeDF-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PeyeDF.app/Contents/MacOS/PeyeDF";
};
name = Release;
Expand All @@ -1621,8 +1619,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = mf.PeyeDFUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_TARGET_NAME = PeyeDF;
};
name = Debug;
Expand All @@ -1637,8 +1634,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = mf.PeyeDFUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_TARGET_NAME = PeyeDF;
};
name = Release;
Expand All @@ -1663,13 +1659,13 @@
"$(PROJECT_DIR)/PeyeDF/LSL",
"$(PROJECT_DIR)/PeyeDF/ZeroMQ",
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.12;
OTHER_SWIFT_FLAGS = "-DDEBUG -DQUESTIONS";
PRODUCT_BUNDLE_IDENTIFIER = fi.aalto.org.PeyeDF;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SWIFT_OBJC_BRIDGING_HEADER = "PeyeDF/Utility/PeyeDF-Bridging-Header.h";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -1689,13 +1685,13 @@
"$(PROJECT_DIR)/PeyeDF/LSL",
"$(PROJECT_DIR)/PeyeDF/ZeroMQ",
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.12;
OTHER_SWIFT_FLAGS = "-DRELEASE -DQUESTIONS";
PRODUCT_BUNDLE_IDENTIFIER = fi.aalto.org.PeyeDF;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SWIFT_OBJC_BRIDGING_HEADER = "PeyeDF/Utility/PeyeDF-Bridging-Header.h";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -1714,7 +1710,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.aalto.PeyeDF-Questions-UITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_TARGET_NAME = "PeyeDF Questions";
};
name = Debug;
Expand All @@ -1734,7 +1730,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.aalto.PeyeDF-Questions-UITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_TARGET_NAME = "PeyeDF Questions";
};
name = Release;
Expand Down
2 changes: 1 addition & 1 deletion PeyeDF/Collaboration/AllPeersController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AllPeersController: NSViewController {

func addPeer(_ peer: MCPeerID) {
DispatchQueue.main.async {
let vc = AppSingleton.collaborationStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "PeerViewController")) as! PeerViewController
let vc = AppSingleton.collaborationStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier("PeerViewController")) as! PeerViewController
self.stackView.animateViewIn(vc.view)
vc.setPeer(peer)
self.connectedPeers[peer.hash] = vc
Expand Down
4 changes: 2 additions & 2 deletions PeyeDF/Collaboration/Multipeer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Multipeer: NSObject {

/// Peer window, showing list of all peers we are connected to (normally, one)
static let peerWindow: NSWindowController = {
let win = AppSingleton.collaborationStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "AllPeersWindowController"))
let win = AppSingleton.collaborationStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier("AllPeersWindowController"))
return win as! NSWindowController
}()

Expand Down Expand Up @@ -158,7 +158,7 @@ class Multipeer: NSObject {
return
}

let newController = AppSingleton.collaborationStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "PeerOverviewController")) as! PeerOverviewController
let newController = AppSingleton.collaborationStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier("PeerOverviewController")) as! PeerOverviewController
overviewControllers[cHash] = newController

DispatchQueue.main.async {
Expand Down
10 changes: 5 additions & 5 deletions PeyeDF/Extensions/NS+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ extension NSBezierPath {
for i in 0 ..< self.elementCount {
let type = self.element(at: i, associatedPoints: &points)
switch type {
case .moveToBezierPathElement:
case .moveTo:
path.move(to: points[0])
case .lineToBezierPathElement:
case .lineTo:
path.addLine(to: points[0])
case .curveToBezierPathElement:
case .curveTo:
path.addCurve(to: points[2], control1: points[0], control2: points[1])
case .closePathBezierPathElement:
case .closePath:
path.closeSubpath()
}
}

}
return path
}
}
Expand Down
2 changes: 1 addition & 1 deletion PeyeDF/Extensions/PDFDocument+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ extension PDFDocument {

var textInfo = [(size: CGFloat, range: NSRange)]()

astring!.enumerateAttribute(NSAttributedStringKey.font, in: fullRange, options: NSAttributedString.EnumerationOptions()) {
astring!.enumerateAttribute(NSAttributedString.Key.font, in: fullRange, options: NSAttributedString.EnumerationOptions()) {
obj, range, stop in
if let font = obj as? NSFont {
textInfo.append((size: font.pointSize, range: range))
Expand Down
2 changes: 1 addition & 1 deletion PeyeDF/Eye Tracking/MidasManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class MidasManager: EyeDataProvider {
} else if self.fetchTimer == nil {
MidasManager.sharedQueue.async {
self.fetchTimer = Timer(timeInterval: self.kFetchInterval, target: self, selector: #selector(self.fetchTimerHit(_:)), userInfo: nil, repeats: true)
RunLoop.current.add(self.fetchTimer!, forMode: RunLoopMode.commonModes)
RunLoop.current.add(self.fetchTimer!, forMode: RunLoop.Mode.common)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion PeyeDF/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>391</string>
<string>391.3</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSAppTransportSecurity</key>
Expand Down
2 changes: 1 addition & 1 deletion PeyeDF/Main UI/AnimatedStack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import Cocoa
/// Implementation of a stack view that automates animations when adding / removing items
class AnimatedStack: NSStackView {

static let timingFunc = CAMediaTimingFunction(name: kCAMediaTimingFunctionDefault)
static let timingFunc = CAMediaTimingFunction(name: CAMediaTimingFunctionName.default)

func animateViewIn(_ theView: NSView) {
theView.alphaValue = 0
Expand Down
4 changes: 2 additions & 2 deletions PeyeDF/Main UI/Reading/DocumentSplitController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class DocumentSplitController: NSSplitViewController {

override func viewDidLoad() {
super.viewDidLoad()
myThumbController = self.childViewControllers[0] as? ThumbSideController
myPDFSideController = self.childViewControllers[1] as? PDFSideController
myThumbController = self.children[0] as? ThumbSideController
myPDFSideController = self.children[1] as? PDFSideController
}

// MARK: - Thumbnail side collapse / uncollapse
Expand Down
24 changes: 12 additions & 12 deletions PeyeDF/Main UI/Reading/DocumentWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class DocumentWindowController: NSWindowController, NSWindowDelegate, SideCollap
lazy var popover: NSPopover = {
let pop = NSPopover()
pop.behavior = NSPopover.Behavior.transient
let tvc = AppSingleton.tagsStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "TagViewController"))
let tvc = AppSingleton.tagsStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier("TagViewController"))
pop.contentViewController = tvc as! TagViewController
pop.delegate = self
return pop
Expand Down Expand Up @@ -407,9 +407,9 @@ class DocumentWindowController: NSWindowController, NSWindowDelegate, SideCollap

func searchCollapseAction(_ wasCollapsed: Bool) {
if wasCollapsed {
searchTB.image = NSImage(named: NSImage.Name(rawValue: PeyeConstants.searchButton_UP))
searchTB.image = NSImage(named: NSImage.Name(PeyeConstants.searchButton_UP))
} else {
searchTB.image = NSImage(named: NSImage.Name(rawValue: PeyeConstants.searchButton_DOWN))
searchTB.image = NSImage(named: NSImage.Name(PeyeConstants.searchButton_DOWN))
}
}

Expand All @@ -422,9 +422,9 @@ class DocumentWindowController: NSWindowController, NSWindowDelegate, SideCollap

func sideCollapseAction(_ wasCollapsed: Bool) {
if wasCollapsed {
thumbTB.image = NSImage(named: NSImage.Name(rawValue: PeyeConstants.thumbButton_UP))
thumbTB.image = NSImage(named: NSImage.Name(PeyeConstants.thumbButton_UP))
} else {
thumbTB.image = NSImage(named: NSImage.Name(rawValue: PeyeConstants.thumbButton_DOWN))
thumbTB.image = NSImage(named: NSImage.Name(PeyeConstants.thumbButton_DOWN))
}
}

Expand All @@ -449,10 +449,10 @@ class DocumentWindowController: NSWindowController, NSWindowDelegate, SideCollap
if let annotateTB = tbAnnotate, let delegate = readerDelegate {
if toState {
delegate.setRecognizersTo(true)
annotateTB.image = NSImage(named: NSImage.Name(rawValue: PeyeConstants.annotateButton_DOWN))
annotateTB.image = NSImage(named: NSImage.Name(PeyeConstants.annotateButton_DOWN))
} else {
delegate.setRecognizersTo(false)
annotateTB.image = NSImage(named: NSImage.Name(rawValue: PeyeConstants.annotateButton_UP))
annotateTB.image = NSImage(named: NSImage.Name(PeyeConstants.annotateButton_UP))
}
}
}
Expand Down Expand Up @@ -584,7 +584,7 @@ class DocumentWindowController: NSWindowController, NSWindowDelegate, SideCollap
@IBAction func thisDocMdata(_ sender: AnyObject?) {
// create metadata window, if currently nil
if metadataWindowController == nil {
metadataWindowController = AppSingleton.mainStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "MetadataWindow")) as? MetadataWindowController
metadataWindowController = AppSingleton.mainStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier("MetadataWindow")) as? MetadataWindowController
}

// show window controller for metadata and send data
Expand Down Expand Up @@ -634,7 +634,7 @@ class DocumentWindowController: NSWindowController, NSWindowDelegate, SideCollap

// Set reference to pdfReader for convenience by using references to children of this window
let splV: NSSplitViewController = self.window?.contentViewController as! NSSplitViewController
docSplitController = splV.childViewControllers[1] as? DocumentSplitController
docSplitController = splV.children[1] as? DocumentSplitController
docSplitController?.sideCollapseDelegate = self
pdfReader = docSplitController?.myPDFSideController?.pdfReader

Expand Down Expand Up @@ -778,7 +778,7 @@ class DocumentWindowController: NSWindowController, NSWindowDelegate, SideCollap
DocumentWindowController.timerQueue.sync {
if self.regularTimer == nil {
self.regularTimer = Timer(timeInterval: PeyeConstants.regularSummaryEventInterval, target: self, selector: #selector(self.regularTimerFire(_:)), userInfo: nil, repeats: true)
RunLoop.current.add(self.regularTimer!, forMode: RunLoopMode.commonModes)
RunLoop.current.add(self.regularTimer!, forMode: RunLoop.Mode.common)
}
}
}
Expand Down Expand Up @@ -838,7 +838,7 @@ class DocumentWindowController: NSWindowController, NSWindowDelegate, SideCollap
// otherwise call the callback right now
if pdfr.status == .trackable && DiMeSession.dimeAvailable {
let ww = NSWindow()
let wvc = AppSingleton.mainStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "WaitVC")) as! WaitViewController
let wvc = AppSingleton.mainStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier("WaitVC")) as! WaitViewController
ww.contentViewController = wvc
wvc.someText = "Sending data to DiMe..."
self.window!.beginSheet(ww, completionHandler: nil)
Expand Down Expand Up @@ -943,7 +943,7 @@ class DocumentWindowController: NSWindowController, NSWindowDelegate, SideCollap
DocumentWindowController.timerQueue.sync {
if self.regularTimer == nil {
self.regularTimer = Timer(timeInterval: PeyeConstants.regularSummaryEventInterval, target: self, selector: #selector(self.regularTimerFire(_:)), userInfo: nil, repeats: true)
RunLoop.current.add(self.regularTimer!, forMode: RunLoopMode.commonModes)
RunLoop.current.add(self.regularTimer!, forMode: RunLoop.Mode.common)
}
}

Expand Down
2 changes: 1 addition & 1 deletion PeyeDF/Main UI/Reading/MainSplitController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MainSplitController: NSSplitViewController {
override func viewDidLoad() {
super.viewDidLoad()

searchPanelController = self.childViewControllers[0] as? SearchPanelController
searchPanelController = self.children[0] as? SearchPanelController
searchProvider = searchPanelController
}

Expand Down
8 changes: 4 additions & 4 deletions PeyeDF/Main UI/Reading/PDFReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ enum TrackingStatus: CustomStringConvertible {
var image: NSImage { get {
switch self {
case .unknown:
return NSImage(named: NSImage.Name.statusNone)!
return NSImage(named: NSImage.statusNoneName)!
case .trackable:
return NSImage(named: NSImage.Name.statusAvailable)!
return NSImage(named: NSImage.statusAvailableName)!
case .blocked:
return NSImage(named: NSImage.Name.statusPartiallyAvailable)!
return NSImage(named: NSImage.statusPartiallyAvailableName)!
case .impossible:
return NSImage(named: NSImage.Name.statusUnavailable)!
return NSImage(named: NSImage.statusUnavailableName)!
}
} }

Expand Down
2 changes: 1 addition & 1 deletion PeyeDF/Main UI/Reading/SearchPanelController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ class SearchPanelController: NSViewController, NSTableViewDataSource, NSTableVie
let rangeOfQuery = lineString.range(of: foundString!, options: NSString.CompareOptions.caseInsensitive)
let boldFont = NSFont.boldSystemFont(ofSize: 12.0)
attrString.beginEditing()
attrString.addAttribute(NSAttributedStringKey.font, value: boldFont, range: rangeOfQuery)
attrString.addAttribute(NSAttributedString.Key.font, value: boldFont, range: rangeOfQuery)
attrString.endEditing()
return attrString
}
Expand Down
2 changes: 1 addition & 1 deletion PeyeDF/Main UI/Reading/eyeBox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class eyeBox: NSBox {
let innerPath = NSBezierPath(rect: NSRect(origin: NSPoint(x: boxMargin, y: boxMargin), size: NSSize(width: innerPathSize, height: innerPathSize)))

innerPath.lineWidth = 1
innerPath.lineJoinStyle = .roundLineJoinStyle
innerPath.lineJoinStyle = .round

// only draw circle if all positions are != 0

Expand Down
Loading