diff --git a/darwin/OLD_uipriv_darwin.h b/darwin/OLD_uipriv_darwin.h index 2cb8d640..5a9ef4ce 100644 --- a/darwin/OLD_uipriv_darwin.h +++ b/darwin/OLD_uipriv_darwin.h @@ -1,14 +1,4 @@ -// label.m -extern NSTextField *newLabel(NSString *str); - -// image.m -extern NSImage *imageImage(uiImage *); - -// winmoveresize.m -extern void doManualMove(NSWindow *w, NSEvent *initialEvent); -extern void doManualResize(NSWindow *w, NSEvent *initialEvent, uiWindowResizeEdge edge); - // future.m extern CFStringRef *FUTURE_kCTFontOpenTypeFeatureTag; extern CFStringRef *FUTURE_kCTFontOpenTypeFeatureValue; diff --git a/darwin/form.m b/darwin/form.m index 148dd17e..af50e363 100644 --- a/darwin/form.m +++ b/darwin/form.m @@ -347,7 +347,7 @@ struct uiForm { NSLayoutAttribute attribute; int oldnStretchy; - fc = [[formChild alloc] initWithLabel:newLabel(label)]; + fc = [[formChild alloc] initWithLabel:uiprivNewLabel(label)]; fc.c = c; fc.stretchy = stretchy; fc.oldHorzHuggingPri = uiDarwinControlHuggingPriority(uiDarwinControl(fc.c), NSLayoutConstraintOrientationHorizontal); diff --git a/darwin/image.m b/darwin/image.m index aa1b945b..ae5be6d9 100644 --- a/darwin/image.m +++ b/darwin/image.m @@ -76,7 +76,7 @@ void uiImageAppend(uiImage *i, void *pixels, int pixelWidth, int pixelHeight, in [i->swizzled addObject:[NSValue valueWithPointer:swizzled]]; } -NSImage *imageImage(uiImage *i) +NSImage *uiprivImageNSImage(uiImage *i) { return i->i; } diff --git a/darwin/label.m b/darwin/label.m index c5dde802..2e2772dc 100644 --- a/darwin/label.m +++ b/darwin/label.m @@ -18,7 +18,7 @@ void uiLabelSetText(uiLabel *l, const char *text) [l->textfield setStringValue:uiprivToNSString(text)]; } -NSTextField *newLabel(NSString *str) +NSTextField *uiprivNewLabel(NSString *str) { NSTextField *tf; diff --git a/darwin/uipriv_darwin.h b/darwin/uipriv_darwin.h index 32dfd42a..363f22c7 100644 --- a/darwin/uipriv_darwin.h +++ b/darwin/uipriv_darwin.h @@ -8,6 +8,9 @@ #import "../ui_darwin.h" #import "../common/uipriv.h" +// TODO should we rename the uiprivMk things or not +// TODO what about renaming class wrapper functions that return the underlying class (like uiprivNewLabel()) + #if __has_feature(objc_arc) #error Sorry, libui cannot be compiled with ARC. #endif @@ -138,4 +141,14 @@ extern NSScrollView *uiprivMkScrollView(uiprivScrollViewCreateParams *p, uiprivS extern void uiprivScrollViewSetScrolling(NSScrollView *sv, uiprivScrollViewData *d, BOOL hscroll, BOOL vscroll); extern void uiprivScrollViewFreeData(NSScrollView *sv, uiprivScrollViewData *d); +// label.m +extern NSTextField *uiprivNewLabel(NSString *str); + +// image.m +extern NSImage *uiprivImageNSImage(uiImage *); + +// winmoveresize.m +extern void uiprivDoManualMove(NSWindow *w, NSEvent *initialEvent); +extern void uiprivDoManualResize(NSWindow *w, NSEvent *initialEvent, uiWindowResizeEdge edge); + #import "OLD_uipriv_darwin.h" diff --git a/darwin/window.m b/darwin/window.m index 9ca8dd9f..1a048207 100644 --- a/darwin/window.m +++ b/darwin/window.m @@ -22,12 +22,12 @@ struct uiWindow { - (void)uiprivDoMove:(NSEvent *)initialEvent { - doManualMove(self, initialEvent); + uiprivDoManualMove(self, initialEvent); } - (void)uiprivDoResize:(NSEvent *)initialEvent on:(uiWindowResizeEdge)edge { - doManualResize(self, initialEvent, edge); + uiprivDoManualResize(self, initialEvent, edge); } @end diff --git a/darwin/winmoveresize.m b/darwin/winmoveresize.m index 671ad203..4ea98dca 100644 --- a/darwin/winmoveresize.m +++ b/darwin/winmoveresize.m @@ -43,7 +43,7 @@ void onMoveDrag(struct onMoveDragParams *p, NSEvent *e) [p->w setFrameOrigin:frame.origin]; } -void doManualMove(NSWindow *w, NSEvent *initialEvent) +void uiprivDoManualMove(NSWindow *w, NSEvent *initialEvent) { __block struct onMoveDragParams mdp; uiprivNextEventArgs nea; @@ -220,7 +220,7 @@ static void onResizeDrag(struct onResizeDragParams *p, NSEvent *e) } // TODO do our events get fired with this? *should* they? -void doManualResize(NSWindow *w, NSEvent *initialEvent, uiWindowResizeEdge edge) +void uiprivDoManualResize(NSWindow *w, NSEvent *initialEvent, uiWindowResizeEdge edge) { __block struct onResizeDragParams rdp; uiprivNextEventArgs nea;