Skip to content

Commit c7090ff

Browse files
committed
Fix UIKit pointer bounds
1 parent e0ed926 commit c7090ff

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

crates/objc2/src/topics/FRAMEWORKS_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
3939
- `Metal` / `objc2-metal`.
4040
- `QuartzCore` / `objc2-quartz-core`.
4141
- `SystemConfiguration` / `objc2-system-configuration`.
42+
- `UIKit` / `objc2-ui-kit`.
4243
* **BREAKING**: Made `NSWindow::delegate`/`NSWindow::setDelegate` `unsafe`, it breaks type-safety if used together with `NSSavePanel`.
4344

4445
### Removed

framework-crates/objc2-ui-kit/translation-config.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,42 @@ fn.UIApplicationMain.renamed = "__main"
145145
# TODO: Is it actually allowed to reset the view to NULL?
146146
class.UIViewController.methods."setView:".arguments.0.nullability = "nullable"
147147

148+
###
149+
### Fixing pointer bounds.
150+
###
151+
152+
fn.UIApplicationMain.arguments.1.bounds.counted-by = "argc"
153+
154+
class.UIBezierPath.methods."getLineDash:count:phase:".arguments.0.bounds = "unsafe" # call method twice to get size of this
155+
class.UIBezierPath.methods."getLineDash:count:phase:".arguments.1.bounds = "single"
156+
class.UIBezierPath.methods."getLineDash:count:phase:".arguments.2.bounds = "single"
157+
class.UIBezierPath.methods."setLineDash:count:phase:".arguments.0.bounds.counted-by = "count"
158+
159+
class.UIColor.methods."getWhite:alpha:".arguments.0.bounds = "single"
160+
class.UIColor.methods."getWhite:alpha:".arguments.1.bounds = "single"
161+
class.UIColor.methods."getHue:saturation:brightness:alpha:".arguments.0.bounds = "single"
162+
class.UIColor.methods."getHue:saturation:brightness:alpha:".arguments.1.bounds = "single"
163+
class.UIColor.methods."getHue:saturation:brightness:alpha:".arguments.2.bounds = "single"
164+
class.UIColor.methods."getHue:saturation:brightness:alpha:".arguments.3.bounds = "single"
165+
class.UIColor.methods."getRed:green:blue:alpha:".arguments.0.bounds = "single"
166+
class.UIColor.methods."getRed:green:blue:alpha:".arguments.1.bounds = "single"
167+
class.UIColor.methods."getRed:green:blue:alpha:".arguments.2.bounds = "single"
168+
class.UIColor.methods."getRed:green:blue:alpha:".arguments.3.bounds = "single"
169+
170+
protocol.UINavigationItemRenameDelegate.methods."navigationItem:willBeginRenamingWithSuggestedTitle:selectedRange:".arguments.2.bounds = "single"
171+
172+
protocol.UIPopoverControllerDelegate.methods."popoverController:willRepositionPopoverToRect:inView:".arguments.1.bounds = "single"
173+
protocol.UIPopoverPresentationControllerDelegate.methods."popoverPresentationController:willRepositionPopoverToRect:inView:".arguments.1.bounds = "single"
174+
175+
protocol.UIScrollViewDelegate.methods."scrollViewWillEndDragging:withVelocity:targetContentOffset:".arguments.2.bounds = "single"
176+
177+
class.UITextDragPreviewRenderer.methods."adjustFirstLineRect:bodyRect:lastLineRect:textOrigin:".arguments.0.bounds = "single"
178+
class.UITextDragPreviewRenderer.methods."adjustFirstLineRect:bodyRect:lastLineRect:textOrigin:".arguments.1.bounds = "single"
179+
class.UITextDragPreviewRenderer.methods."adjustFirstLineRect:bodyRect:lastLineRect:textOrigin:".arguments.2.bounds = "single"
180+
181+
# TODO: class.NSLayoutManager.methods.*.bounds = "...", probably same as in AppKit.
182+
class.NSTextContainer.methods."lineFragmentRectForProposedRect:atIndex:writingDirection:remainingRect:".arguments.3.bounds = "single"
183+
148184
###
149185
### Safety
150186
###

0 commit comments

Comments
 (0)