mac: document MilskoFakePointer
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
dd67e42054
commit
3f84b0f868
1 changed files with 12 additions and 0 deletions
|
|
@ -39,6 +39,18 @@
|
||||||
- (MilskoCocoaWindowDelegate *)initWithWin:(MilskoCocoaWindow *)win;
|
- (MilskoCocoaWindowDelegate *)initWithWin:(MilskoCocoaWindow *)win;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
/*
|
||||||
|
So we want to associate each NSWindow with its corresponding MwLL handle. The
|
||||||
|
conventional way of doing this is through "associative pointers", however
|
||||||
|
this is a feature that Apple added in 10.6 (marketted back then as "Objective
|
||||||
|
C 2" iirc). For 10.4 compatibility, we have to do a bit of an ugly hack that
|
||||||
|
might seem like horrifically undefined behavior, but I've tested this on
|
||||||
|
both 10.4 and modern Mac OS and as long as we're careful there's no
|
||||||
|
problems: we override NSView, use NSView's "frame" property to store the
|
||||||
|
pointer, and then override functions appropriately so that this frame is never
|
||||||
|
actually used. This can then be attached to an NSWindow with addSubview and
|
||||||
|
retrieved appropriately.
|
||||||
|
*/
|
||||||
@interface MilskoFakePointer : NSView {
|
@interface MilskoFakePointer : NSView {
|
||||||
void *ptr;
|
void *ptr;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue