-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify .gitignore and add Xcode Project
- Loading branch information
Showing
46 changed files
with
2,560 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
78 changes: 78 additions & 0 deletions
78
Capturinator/Capturinator.xcodeproj/xcshareddata/xcschemes/Capturinator.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1310" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "565E3EAA26CE667F00E5FE4D" | ||
BuildableName = "Capturinator.app" | ||
BlueprintName = "Capturinator" | ||
ReferencedContainer = "container:Capturinator.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "565E3EAA26CE667F00E5FE4D" | ||
BuildableName = "Capturinator.app" | ||
BlueprintName = "Capturinator" | ||
ReferencedContainer = "container:Capturinator.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "565E3EAA26CE667F00E5FE4D" | ||
BuildableName = "Capturinator.app" | ||
BlueprintName = "Capturinator" | ||
ReferencedContainer = "container:Capturinator.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// AppDelegate.swift | ||
// Object Capture Create | ||
// | ||
// Created by Bertan on 26.06.2021. | ||
// | ||
|
||
import SwiftUI | ||
import AppKit | ||
import UserNotifications | ||
|
||
class AppDelegate: NSObject, NSApplicationDelegate { | ||
@AppStorage("userSuppressedQuitAlert") private var userSuppressedQuitAlert = false | ||
private var shouldAskBeforeQuitting = true | ||
|
||
func applicationDidFinishLaunching(_ notification: Notification) { | ||
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge]) { success, error in | ||
if success { | ||
print("User granted notifications access :)") | ||
}else if let e = error { | ||
print(e.localizedDescription) | ||
} | ||
} | ||
} | ||
|
||
|
||
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { | ||
shouldAskBeforeQuitting = false | ||
return true | ||
} | ||
|
||
func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply { | ||
if shouldAskBeforeQuitting, !userSuppressedQuitAlert { | ||
let alert = NSAlert() | ||
alert.alertStyle = .warning | ||
alert.messageText = String(localized: "QuitAppAlertTitle", comment: "Title of the app termination confirmation dialog") | ||
alert.informativeText = String(localized: "QuitAppAlertBody", comment: "Body of the app termination confirmation dialog") | ||
alert.addButton(withTitle: String(localized: "Quit", comment: "Button: Quits app")) | ||
alert.addButton(withTitle: String(localized: "Cancel", comment: "General purpose cancel button")) | ||
alert.showsSuppressionButton = true | ||
|
||
let response = alert.runModal() | ||
|
||
if let suppressionResponse = alert.suppressionButton?.state { | ||
if suppressionResponse == NSControl.StateValue.on { | ||
userSuppressedQuitAlert = true | ||
} | ||
} | ||
|
||
if response == .alertSecondButtonReturn { | ||
return .terminateCancel | ||
} | ||
} | ||
return .terminateNow | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
Capturinator/Capturinator/App/CloseAlertWindowDelegate.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// CloseAlertWindowDelegate.swift | ||
// Object Capture Create | ||
// | ||
// Created by Bertan on 28.06.2021. | ||
// | ||
|
||
import AppKit | ||
import SwiftUI | ||
|
||
class CloseAlertWindowDelegate: NSObject, NSWindowDelegate { | ||
@AppStorage("userSuppressedWindowCloseAlert") private var userSuppressedWindowCloseAlert = false | ||
|
||
func windowShouldClose(_ sender: NSWindow) -> Bool { | ||
if !userSuppressedWindowCloseAlert { | ||
let alert = NSAlert() | ||
alert.alertStyle = .warning | ||
alert.messageText = String(localized: "CloseWindowAlertTitle", comment: "Title of the window closing confirmation dialog") | ||
alert.informativeText = String(localized: "CloseWindowAlertBody", comment: "Body of the window closing confirmation dialog") | ||
alert.addButton(withTitle: NSLocalizedString("Close", comment: "Button: Closes window")) | ||
alert.addButton(withTitle: String(localized: "Cancel")) | ||
alert.showsSuppressionButton = true | ||
|
||
let response = alert.runModal() | ||
|
||
if let suppressionResponse = alert.suppressionButton?.state { | ||
if suppressionResponse == NSControl.StateValue.on { | ||
userSuppressedWindowCloseAlert = true | ||
} | ||
} | ||
|
||
if response == .alertSecondButtonReturn { | ||
return false | ||
} | ||
} | ||
return true | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
Capturinator/Capturinator/App/Object_Capture_CreateApp.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// | ||
// Object_Capture_CreateApp.swift | ||
// Object Capture Create | ||
// | ||
// Created by Bertan on 22.06.2021. | ||
// | ||
|
||
import SwiftUI | ||
|
||
@main | ||
struct Object_Capture_CreateApp: App { | ||
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate | ||
@StateObject private var sharedData = SharedData() | ||
@AppStorage("onboardingShown") private var onboardingShown = false | ||
@State private var showingOnboarding = false | ||
var supportsObjectCapture = CompatibilityChecker().checkObjectCaptureSupport() | ||
|
||
var body: some Scene { | ||
WindowGroup { | ||
if supportsObjectCapture { | ||
ContentView() | ||
.frame(minWidth: 1280, maxWidth: .infinity, minHeight: 720, maxHeight: .infinity) | ||
.environmentObject(sharedData) | ||
.onAppear { | ||
if !onboardingShown { | ||
showingOnboarding = true | ||
onboardingShown = true | ||
} | ||
} | ||
.sheet(isPresented: $showingOnboarding) { | ||
OnboardingView() | ||
|
||
} | ||
}else { | ||
NotSupportedView() | ||
.frame(minWidth: 1280, maxWidth: .infinity, minHeight: 720, maxHeight: .infinity) | ||
} | ||
} | ||
.commands { | ||
CommandGroup(replacing: .appInfo) { | ||
Button(String(localized: "AboutMenuCommandTtitle", comment: "Menu Command: Shows the about this app window")){ | ||
NSApplication.shared.orderFrontStandardAboutPanel( | ||
options: [ | ||
NSApplication.AboutPanelOptionKey.credits: NSAttributedString(string: String(localized: "AboutWindowText", comment: "Short description of the app") + "\n" + String(localized: "MadeWithLove"), attributes: [ NSAttributedString.Key.font: NSFont.labelFont(ofSize: 12)]), | ||
NSApplication.AboutPanelOptionKey(rawValue: "Copyright"): Bundle.main.object(forInfoDictionaryKey: "NSHumanReadableCopyright") ?? "" | ||
]) | ||
|
||
} | ||
} | ||
CommandGroup(replacing: .help) { | ||
Button(String(localized: "GettingStartedMenuCommandTittle", comment: "Menu Command: Shows the onboarding screen")) { | ||
showingOnboarding.toggle() | ||
} | ||
.keyboardShortcut("?") | ||
} | ||
CommandGroup(after: .help) { | ||
Button(String(localized: "SupportMenuCommandTitle", comment: "Menu Command: Opens the Capturinator Support Website")) { | ||
if let url = URL(string: "http://www.capturinator.bertan.codes/support") { | ||
NSWorkspace.shared.open(url) | ||
} | ||
} | ||
} | ||
SidebarCommands() | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
Capturinator/Capturinator/Assets.xcassets/AccentColor.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"color" : { | ||
"platform" : "universal", | ||
"reference" : "systemMintColor" | ||
}, | ||
"idiom" : "universal" | ||
}, | ||
{ | ||
"appearances" : [ | ||
{ | ||
"appearance" : "luminosity", | ||
"value" : "dark" | ||
} | ||
], | ||
"color" : { | ||
"platform" : "universal", | ||
"reference" : "systemMintColor" | ||
}, | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
Capturinator/Capturinator/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "icon_16x16.png", | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "16x16" | ||
}, | ||
{ | ||
"filename" : "icon_16x16@[email protected]", | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "16x16" | ||
}, | ||
{ | ||
"filename" : "icon_32x32.png", | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "32x32" | ||
}, | ||
{ | ||
"filename" : "icon_32x32@[email protected]", | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "32x32" | ||
}, | ||
{ | ||
"filename" : "icon_128x128.png", | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "128x128" | ||
}, | ||
{ | ||
"filename" : "icon_128x128@[email protected]", | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "128x128" | ||
}, | ||
{ | ||
"filename" : "icon_256x256.png", | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "256x256" | ||
}, | ||
{ | ||
"filename" : "icon_256x256@[email protected]", | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "256x256" | ||
}, | ||
{ | ||
"filename" : "icon_512x512.png", | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "512x512" | ||
}, | ||
{ | ||
"filename" : "icon_512x512@[email protected]", | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "512x512" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+14.5 KB
Capturinator/Capturinator/Assets.xcassets/AppIcon.appiconset/icon_128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+43 KB
...urinator/Capturinator/Assets.xcassets/AppIcon.appiconset/icon_128x128@[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+785 Bytes
Capturinator/Capturinator/Assets.xcassets/AppIcon.appiconset/icon_16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2 KB
Capturinator/Capturinator/Assets.xcassets/AppIcon.appiconset/icon_16x16@[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42.4 KB
Capturinator/Capturinator/Assets.xcassets/AppIcon.appiconset/icon_256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+130 KB
...urinator/Capturinator/Assets.xcassets/AppIcon.appiconset/icon_256x256@[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2 KB
Capturinator/Capturinator/Assets.xcassets/AppIcon.appiconset/icon_32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.91 KB
Capturinator/Capturinator/Assets.xcassets/AppIcon.appiconset/icon_32x32@[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+130 KB
Capturinator/Capturinator/Assets.xcassets/AppIcon.appiconset/icon_512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+414 KB
...urinator/Capturinator/Assets.xcassets/AppIcon.appiconset/icon_512x512@[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>com.apple.security.app-sandbox</key> | ||
<true/> | ||
<key>com.apple.security.files.user-selected.read-write</key> | ||
<true/> | ||
</dict> | ||
</plist> |
Oops, something went wrong.