Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.6.0 // Maintenance. #491

Merged
merged 40 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
bd24617
Preferences // Use ObjC instead.
ShikiSuen Sep 19, 2023
4ff1856
TDKCandidates // Patch `.kern` for macOS 14.
ShikiSuen Sep 25, 2023
3a98021
Repo // Deprecating Theme Color.
ShikiSuen Sep 23, 2023
8eb7406
Repo // Use Xcode 15 recommended settings.
ShikiSuen Sep 19, 2023
f69d1d8
Repo // Xcode 14.2 comaptibility.
ShikiSuen Sep 23, 2023
8910ac4
NSAttributedTextView // Compatibility tweaks.
ShikiSuen Sep 19, 2023
70bd7f8
IMKHelper // Fix an error while freeing a pointer.
ShikiSuen Sep 20, 2023
2454676
GitHub // Force Xcode 15.x in Github CI.
ShikiSuen Sep 20, 2023
87aba4a
InfoPlist // Remove TISDoubleSpaceSubstitution.
ShikiSuen Sep 20, 2023
7fe6cd5
TDKCandidates // Removing SwiftUI support for now.
ShikiSuen Sep 20, 2023
1a7a3cd
PrefUI // Trim settings for toggling SwiftUI in TDKCandidates.
ShikiSuen Sep 20, 2023
f43a6b4
PCB // Fix errors in manipulating text attributes.
ShikiSuen Sep 20, 2023
92e220e
Prefs // Trim .enableSwiftUIForTDKCandidates().
ShikiSuen Sep 20, 2023
3b03d49
PrefWindow // Add options for handling Shift-key toggles.
ShikiSuen Sep 20, 2023
feaba86
TooltipUI // Maintenance.
ShikiSuen Sep 20, 2023
ea869d3
Prefs // +.securityHardenedCompositionBuffer().
ShikiSuen Sep 20, 2023
67ae796
SessionCtl // Bind .securityHardenedCompositionBuffer().
ShikiSuen Sep 20, 2023
ee92e21
PrefWindow // +.securityHardenedCompositionBuffer().
ShikiSuen Sep 20, 2023
64f0795
PrefUI // +.securityHardenedCompositionBuffer().
ShikiSuen Sep 20, 2023
f51dbf4
SessionCtl // Sync some syntax preferences from vC-Aqua branch.
ShikiSuen Sep 21, 2023
ddcf3ee
Repo // Don't check update if serving `com.apple.SecurityAgent`.
ShikiSuen Sep 21, 2023
691c411
SessionCtl_Menu // Hide some items if serving `com.apple.SecurityAgent`.
ShikiSuen Sep 21, 2023
25f7388
PrefWindow // Add toggle for CapsLock notifications.
ShikiSuen Sep 22, 2023
9e42ae7
Localizable // Grammar fix, etc.
ShikiSuen Sep 21, 2023
6739799
AppProperty // Implement `DynamicProperty` protocol.
ShikiSuen Sep 24, 2023
6bdf6bf
PrefMgr // Add observability.
ShikiSuen Sep 24, 2023
b5b6915
UpdateInfo // Add links for the legacy branch.
ShikiSuen Sep 24, 2023
0c1fb1b
UpdateSputnik // Change macOS version threshold.
ShikiSuen Sep 24, 2023
1932964
NotifierUI // Share changes across releases.
ShikiSuen Sep 24, 2023
41452a4
CtlPrefWindow // Add tooltip for navigation items.
ShikiSuen Sep 25, 2023
5622f78
UpdateSputnik // Implement cross-distro upgrade.
ShikiSuen Sep 25, 2023
f84522f
PathControl // Fix constraint behavior in SwiftUI.
ShikiSuen Sep 25, 2023
7b3ffe2
PrefUI // Massive renovation - phase 1.
ShikiSuen Sep 21, 2023
0750a89
Repo // Deprecating Sindresorhus's Preferences package.
ShikiSuen Sep 23, 2023
a3cdba8
PrefUI // Massive renovation - phase 2.
ShikiSuen Sep 23, 2023
0b1c3e8
PrefUI // Boost SwiftUI requirements to macOS 13.
ShikiSuen Sep 24, 2023
b6e2fe5
Repo // Deprecating `SwiftUIBackports`.
ShikiSuen Sep 24, 2023
102bcef
Repo // Putting SettingsUI into MainAssembly.
ShikiSuen Sep 26, 2023
3fb14c1
Update Data - 20230928
ShikiSuen Sep 28, 2023
dace67c
[VersionUp] 3.6.0 GM Build 3600.
ShikiSuen Sep 28, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
xcode-version: '^15.0'
- uses: actions/checkout@v1
- name: Clean
run: make clean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ public class FolderMonitor {
// Define the block to call when a file change is detected.
folderMonitorSource?.setEventHandler { [weak self] in
guard let self = self else { return }
folderDidChange?()
self.folderDidChange?()
}
// Define a cancel handler to ensure the directory is closed when the source is cancelled.
folderMonitorSource?.setCancelHandler { [weak self] in
guard let self = self else { return }
close(monitoredFolderFileDescriptor)
monitoredFolderFileDescriptor = -1
folderMonitorSource = nil
close(self.monitoredFolderFileDescriptor)
self.monitoredFolderFileDescriptor = -1
self.folderMonitorSource = nil
}
// Start monitoring the directory via the source.
folderMonitorSource?.resume()
Expand Down
4 changes: 4 additions & 0 deletions Packages/Fuziki_NSAttributedTextView/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ let package = Package(
.product(name: "CocoaExtension", package: "vChewing_CocoaExtension"),
]
),
.testTarget(
name: "NSAttributedTextViewTests",
dependencies: ["NSAttributedTextView"]
),
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ public class NSAttributedTextView: NSView {
}
}

public init() {
super.init(frame: .zero)
#if compiler(>=5.9) && canImport(AppKit, _version: "14.0")
clipsToBounds = true // 得手動聲明該特性,否則該 View 的尺寸會失控。
#endif
}

@available(*, unavailable)
required init?(coder _: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

public func attributedStringValue(areaCalculation: Bool = false) -> NSAttributedString {
var newAttributes = attributes
let isVertical: Bool = !(direction == .horizontal)
Expand Down Expand Up @@ -131,8 +143,7 @@ public class NSAttributedTextView: NSView {
}

override public func draw(_ rect: CGRect) {
let context = NSGraphicsContext.current?.cgContext
guard let context = context else { return }
guard let currentNSGraphicsContext = NSGraphicsContext.current else { return }
let setter = CTFramesetterCreateWithAttributedString(attributedStringValue())
let path = CGPath(rect: rect, transform: nil)
let theCTFrameProgression: CTFrameProgression = {
Expand All @@ -152,7 +163,16 @@ public class NSAttributedTextView: NSView {
let bgPath: NSBezierPath = .init(roundedRect: rect, xRadius: 0, yRadius: 0)
bgPath.fill()
currentRect = rect
CTFrameDraw(newFrame, context)
if #unavailable(macOS 10.10) {
// 由於 NSGraphicsContext.current?.cgContext 僅對 macOS 10.10 Yosemite 開始的系統開放,
// 所以這裡必須直接從記憶體位置拿取原始資料來處理。
let contextPtr: Unmanaged<CGContext>? = Unmanaged.fromOpaque(currentNSGraphicsContext.graphicsPort)
let theContext: CGContext? = contextPtr?.takeUnretainedValue()
guard let theContext = theContext else { return }
CTFrameDraw(newFrame, theContext)
} else {
CTFrameDraw(newFrame, currentNSGraphicsContext.cgContext)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// (c) 2021 and onwards The vChewing Project (MIT-NTL License).
// ====================
// This code is released under the MIT license (SPDX-License-Identifier: MIT)
// ... with NTL restriction stating that:
// No trademark license is granted to use the trade names, trademarks, service
// marks, or product names of Contributor, except as required to fulfill notice
// requirements defined in MIT License.

import AppKit
import CocoaExtension
import Foundation
@testable import NSAttributedTextView
import Shared
import XCTest

class MainAssemblyTests: XCTestCase {
func testView() throws {
let testCtl: testController = .init()
var rect = testCtl.attrView.shrinkFrame()
var bigRect = rect
bigRect.size.width += NSFont.systemFontSize
bigRect.size.height += NSFont.systemFontSize
rect.origin.x += ceil(NSFont.systemFontSize / 2)
rect.origin.y += ceil(NSFont.systemFontSize / 2)
testCtl.attrView.frame = rect
testCtl.window?.setFrame(bigRect, display: true)
testCtl.window?.orderFront(nil)
testCtl.attrView.draw(testCtl.attrView.frame)
testCtl.window?.setIsVisible(true)
}
}

class testController: NSWindowController {
var attrView: NSAttributedTextView
init() {
let contentRect = NSRect(x: 128.0, y: 128.0, width: 300.0, height: 20.0)
let styleMask: NSWindow.StyleMask = [.borderless, .nonactivatingPanel]
let panel = NSPanel(
contentRect: contentRect, styleMask: styleMask, backing: .buffered, defer: false
)
panel.level = NSWindow.Level(Int(max(CGShieldingWindowLevel(), kCGPopUpMenuWindowLevel)) + 2)
panel.hasShadow = true
panel.backgroundColor = NSColor.clear
panel.isOpaque = false
panel.isMovable = false
panel.contentView?.wantsLayer = true
panel.contentView?.layer?.cornerRadius = 7
panel.contentView?.layer?.backgroundColor = NSColor.controlBackgroundColor.cgColor
attrView = NSAttributedTextView()
attrView.backgroundColor = NSColor.clear
attrView.textColor = NSColor.textColor
attrView.needsDisplay = true
attrView.text = "114514"
panel.contentView?.addSubview(attrView)
super.init(window: panel)
}

@available(*, unavailable)
required init?(coder _: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
9 changes: 0 additions & 9 deletions Packages/ShapsBenkau_SwiftUIBackports/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions Packages/ShapsBenkau_SwiftUIBackports/.spi.yml

This file was deleted.

9 changes: 0 additions & 9 deletions Packages/ShapsBenkau_SwiftUIBackports/LICENSE.md

This file was deleted.

22 changes: 0 additions & 22 deletions Packages/ShapsBenkau_SwiftUIBackports/Package.swift

This file was deleted.

131 changes: 0 additions & 131 deletions Packages/ShapsBenkau_SwiftUIBackports/README.md

This file was deleted.

This file was deleted.

Loading
Loading