From 9b5fe800c7e95664a4fb2265c487353fb2fb5d2d Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 3 Jul 2015 23:32:01 -0400 Subject: [PATCH] More basic OS X backend functions work. --- redo/darwin/control.m | 4 ++-- redo/darwin/window.m | 2 +- redo/ui_darwin.h | 18 ++---------------- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/redo/darwin/control.m b/redo/darwin/control.m index c6a9e037..b4f87e8c 100644 --- a/redo/darwin/control.m +++ b/redo/darwin/control.m @@ -101,8 +101,8 @@ static int singleViewHasTabStops(uiControl *c) return 0; // keep compiler happy } -// called after creating the control's widget -void uiDarwinMakeSingleWidgetControl(uiControl *c, NSView *view) +// called after creating the control's NSView +void uiDarwinMakeSingleViewControl(uiControl *c, NSView *view) { // we have to retain the view so we can reparent it [view retain]; diff --git a/redo/darwin/window.m b/redo/darwin/window.m index 205795ea..e0a50dcc 100644 --- a/redo/darwin/window.m +++ b/redo/darwin/window.m @@ -165,7 +165,7 @@ uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar) [w->window setTitle:toNSString(title)]; // a NSWindow is not a NSView, but nothing we're doing in this function is view-specific - uiDarwinMakeSingleWidgetControl(uiControl(w), (NSView *) (w->window)); + uiDarwinMakeSingleViewControl(uiControl(w), (NSView *) (w->window)); // explicitly release when closed // the only thing that closes the window is us anyway diff --git a/redo/ui_darwin.h b/redo/ui_darwin.h index ea972828..bfe5425a 100644 --- a/redo/ui_darwin.h +++ b/redo/ui_darwin.h @@ -7,11 +7,8 @@ This file assumes that you have imported and "ui.h" beforehand. #ifndef __UI_UI_DARWIN_H__ #define __UI_UI_DARWIN_H__ -// uiDarwinMakeControl() initializes the given uiControl with the given Cocoa control inside. -// The second parameter should come from [RealControlType class]. -// The two scrollView parameters allow placing scrollbars on the new control. -// The two onDestroy parameters define a function and its parameter to call when the widget is destroyed. -_UI_EXTERN void uiDarwinMakeControl(uiControl *c, Class class, BOOL inScrollView, BOOL scrollViewHasBorder, void (*onDestroy)(void *), void *onDestroyData); +// TODO document +_UI_EXTERN void uiDarwinMakeSingleViewControl(uiControl *, NSView *); // You can use this function from within your control implementations to return text strings that can be freed with uiFreeText(). _UI_EXTERN char *uiDarwinNSStringToText(NSString *); @@ -20,15 +17,4 @@ struct uiSizingSys { // this structure currently left blank }; -struct uiControlSysFuncParams { - int Func; -}; - -enum { - // These should enable and disable the uiControl while preserving the user enable/disable setting. - // These are needed because enabling and disabling of views on OS X is available on a view-by-view basis, and is not transitive to subviews by default as a result. - uiDarwinSysFuncContainerEnable, - uiDarwinSysFuncContainerDisable, -}; - #endif