Resolved some TODOs (including one resolved a while ago on IRC but not removed until now; thanks various people in irc.freenode.net/#macdev).

This commit is contained in:
Pietro Gagliardi 2015-04-10 03:11:20 -04:00
parent 64b746c9a1
commit 948416d04d
4 changed files with 8 additions and 11 deletions

View File

@ -2,8 +2,6 @@
#import <stdio.h> #import <stdio.h>
#import "uipriv_darwin.h" #import "uipriv_darwin.h"
// TODO is there a better alternative to NSCAssert()? preferably a built-in allocator that panics on out of memory for us?
void *uiAlloc(size_t size, const char *type) void *uiAlloc(size_t size, const char *type)
{ {
void *out; void *out;

View File

@ -17,9 +17,9 @@ uiLogObjCClassAllocations
- (void)viewDidMoveToSuperview - (void)viewDidMoveToSuperview
{ {
if ([self superview] == nil) if ([self superview] == nil)
if (self.child != NULL) { if (self.uiChild != NULL) {
uiControlDestroy(self.child); uiControlDestroy(self.uiChild);
self.child = NULL; self.uiChild = NULL;
} }
[super viewDidMoveToSuperview]; [super viewDidMoveToSuperview];
} }
@ -42,7 +42,7 @@ uiLogObjCClassAllocations
uiSizing d; uiSizing d;
intmax_t x, y, width, height; intmax_t x, y, width, height;
if (self.child == NULL) if (self.uiChild == NULL)
return; return;
x = [self bounds].origin.x; x = [self bounds].origin.x;
y = [self bounds].origin.y; y = [self bounds].origin.y;
@ -56,7 +56,7 @@ uiLogObjCClassAllocations
} }
d.xPadding = macXPadding; d.xPadding = macXPadding;
d.yPadding = macYPadding; d.yPadding = macYPadding;
uiControlResize(self.child, x, y, width, height, &d); uiControlResize(self.uiChild, x, y, width, height, &d);
} }
- (BOOL)uiMargined - (BOOL)uiMargined

View File

@ -29,8 +29,7 @@ extern void setStandardControlFont(NSControl *);
// container_darwin.m // container_darwin.m
@interface uiContainer : NSView @interface uiContainer : NSView
// TODO rename to uiChild @property uiControl *uiChild;
@property uiControl *child;
- (void)uiUpdateNow; - (void)uiUpdateNow;
- (BOOL)uiMargined; - (BOOL)uiMargined;
- (void)uiSetMargined:(BOOL)margined; - (void)uiSetMargined:(BOOL)margined;

View File

@ -107,8 +107,8 @@ void uiWindowOnClosing(uiWindow *w, int (*f)(uiWindow *, void *), void *data)
void uiWindowSetChild(uiWindow *w, uiControl *c) void uiWindowSetChild(uiWindow *w, uiControl *c)
{ {
D.container.child = c; D.container.uiChild = c;
uiControlSetParent(D.container.child, (uintptr_t) (D.container)); uiControlSetParent(D.container.uiChild, (uintptr_t) (D.container));
} }
int uiWindowMargined(uiWindow *w) int uiWindowMargined(uiWindow *w)