Files
QuickDrop/NearDrop/LicenseWindow.swift
T
2025-05-03 11:49:06 +02:00

378 lines
18 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//
// LicenseWindow.swift
// QuickDrop
//
// Created by Leon Böttger on 05.03.25.
//
import SwiftUI
struct LicensePage: View {
var body: some View {
ZStack {
Color.defaultBackground
.edgesIgnoringSafeArea(.all)
ScrollView {
Text("""
NearDrop
https://github.com/grishka/NearDrop
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>
ASN1
https://github.com/leif-ibsen/ASN1
Copyright (c) 2021 Leif Ibsen
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
BigInt
https://github.com/leif-ibsen/BigInt
Copyright (c) 2021 Leif Ibsen
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SwiftECC
https://github.com/leif-ibsen/SwiftECC
Copyright (c) 2021 Leif Ibsen
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
swift-protobuf
https://github.com/apple/swift-protobuf
Copyright 2024 Apple Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
BezelNotification
https://github.com/BlueHuskyStudios/BezelNotification
BLUE HUSKY LICENSE 1 - PUBLIC SHARE - OPUS 2
0: LAYMAN'S TERMS
This section is meant to explain the purpose of this license in Layman's
terms, and should thusly never be seen as legally binding. This disclaimer does
not apply to further sections of this license.
If you made this:
1. This is your product and you can do what you want with it
a. You must make sure that if you use anyone else's stuff in it, you do so
with their permission, or under Fair Use
b. If you do include someone else's stuff, you can't claim you made that
c. You guarantee you're providing this product for free
2. You must let others do what they want with it
a. They still have to say you made it in the first place
b. You have to include this license along with your product for it to count
c. They have to include this license when they redistribute your product
3. This license is overridden by governmental laws
4. You're not responsible for bad things that might happen because someone
used your product
If you got this:
1. This is not your product, and you need to respect that
a. You must make sure that if you put anyone else's stuff in it, you do so
with their permission, or under Fair Use
b. If you do include someone else's stuff, you can't claim you made that
c. You are guaranteed you're getting this product for free
2. You can still do what you want with this
a. You still have to say who made it in the first place
b. You get all the freedoms in this license along with this product
c. You have to include this license when you redistribute this product
3. This license is overridden by governmental laws
4. The original creator is not responsible for bad things that might happen
because you used this product
1: DECLARATION OF COPYRIGHT
This Product is copyright Ben Leggiero (c) 2017 BH-1-PS
2: DEFINITIONS
- "License": this text
- "Product": the product with which this License was distributed, and any
assets necessary for its use
- "Creator": any entity or entities who originally invented the Product,
withstanding related and contributing parties
- "Licensee": any entity or entities involved in consumption of the Product
- "Licensor": any entity or entities involved in distribution of the Product
and of this License
3: NOTICE OF PERMISSIONS
Permission is hereby granted to any entity obtaining a copy of the Product,
to use, copy, modify, host, redistribute, sublicense, sell copies of, and/or
otherwise handle the Product, and to permit Licensees to also do so, given the
following conditions are obeyed:
- The above copyright notice and this permission notice shall be included in
all copies and/or substantial portions of the Product.
- This License shall be blatantly provided, unmodified, along with the Product
- Attribution to the Creator must be blatantly stated, modifications of the
Product notwithstanding
4: DECLARATION OF OWNERSHIP
The Creator hereby declares that the Product is the intellectual property
solely of the Creator, and of no other party. The Creator maintains that any
intellectual property which falls under § 5.1 of this License is considered
fair use as described in § 5.4 of this License.
5: THE RIGHTS OF THE CREATOR
1. The Creator reserves no rights to any previously-established intellectual
property contained within the Product which is implicitly or explicitly
owned by any other entity or entities.
2. The Creator will not gain any profit through the creation or distribution
of the Product.
a. The Creator forfeits the right to request compensation for any use of the
Product which adheres to the restrictions described by this License.
3. The Creator reserves the right to freely create, edit, distribute, destroy,
or otherwise interact with the whole of, or any part of, the Product.
4. In the case that any entity other than the Creator claims to own
intellectual property contained within the Product and wishes to be
compensated for the use of such, the Creator reserves the right to refuse
such compensation as allowed by the following legal documents:
a. Amendment I of the United States Constitution
b. Article 19 of the Universal Declaration of Human Rights
c. 17 USC § 107 - Limitations on exclusive rights: Fair use
5. In cases where all of the documents listed under § 5.4 of this
License are not legally recognized, the Creator agrees to pay the owner of
the disputed intellectual property a sum which equals the proportion of the
prevalence that the disputed intellectual property maintains in the Product
out of the total sum of profits garnered by the Creator for creating the
Product.
6. The Creator reserves the right to waive any conditions of this License at
the Creator's discretion.
7. The Licensor reserves the right to edit this License at any time.
a. The Licensor agrees to update the Opus number of this License to
correspond with version changes.
b. The Licensor agrees to never publish two or more versions of this License
under the same Opus number.
8. In no way are any of the Creator's moral rights affected by this License
6: RIGHTS AND RESTRICTIONS OF LICENSEES AND LICENSORS ("YOU")
1. You maintain the following rights and restrictions:
a. You are free to copy, distribute and transmit the work.
i. For any reuse or distribution, You must make clear to others the
License terms of the License.
b. You are free to adapt the work.
i. If You alter, transform, or build upon the Product, You may distribute
the resulting work only under this License.
c. You are free to make commercial use of the work.
d. You must attribute the work in the manner specified by the Creator (but
not in any way that suggests that the Creator endorses You or such use of
the work).
e. The Creator and any Licensors or Licensees previous to You are not
responsible for any changes made to the Product, or any effects arising
thereof.
f. You can be granted special rights by the Creator as described in
section 5.6 of the License
2. In no way are any of the following rights affected by the License:
a. The fair dealing or fair use rights afforded to You, or other applicable
copyright exceptions and limitations.
b. Rights another entity may have, either in the Product itself or in how
the Product is used, such as publicity or privacy rights.
7: ACCORDANCE WITH THE LAW
The terms that make up the whole and parts of this License shall not apply
where local, state, provincial, federal, national, or any other law prohibits
such terms.
8: DISCLAIMER
THE PRODUCT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED. IN NO EVENT SHALL THE CREATORS, LICENSEES, OR LICENSORS BE LIABLE FOR
ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT,
OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE PRODUCT OR THE
USE OR OTHER DEALINGS IN OR WITH THE PRODUCT.
ukey2
https://github.com/google/ukey2
Copyright 2023 Google
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
offline_wire_formats.pb
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
wire_format.proto
Copyright 2020 The Chromium Authors
Use of this source code is governed by a BSD-style license:
BSD License
Copyright (c) 2013, Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
All of the sounds listed below are provided under the Creative Commons Attribution 4.0 International License.
https://creativecommons.org/licenses/by/4.0/legalcode
Creative Commons Attribution 4.0 International Public License (2020/14/09)
[...]
Section 5 – Disclaimer of Warranties and Limitation of Liability.
Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
[...]
All sounds are copyrighted material of https://notificationsounds.com
Terms of use: https://notificationsounds.com/terms-of-use
Sound files:
https://notificationsounds.com/notification-sounds/time-is-now-585
Modifications to sound files: Volume and length, no previous modifications.
""")
.padding()
}
}
}
}
func openLicenseWindow() -> NSWindow {
// Create a new NSWindow and retain it in the `newWindow` property
let window = NSWindow(
contentRect: NSRect(x: 0, y: 0, width: 500, height: 400),
styleMask: [.titled, .closable, .resizable],
backing: .buffered,
defer: false
)
window.center()
window.isReleasedWhenClosed = false
window.title = NSLocalizedString("Acknowledgements", value: "Acknowledgements", comment: "")
window.contentView = NSHostingView(rootView: LicensePage())
// Ensure the window is always on top
NSApp.activate(ignoringOtherApps: true) // Brings the whole app to the front
window.makeKeyAndOrderFront(nil)
window.level = .normal
// Retain the window to prevent deallocation
return window
}