Permalink
Browse files

WIP extending TUINSView to support (indirectly) hosting NSViews

  • Loading branch information...
1 parent df38eb2 commit b156b3ef5644c4075515196f45d5731f1fdfce38 @jspahrsummers jspahrsummers committed Jul 17, 2012
Showing with 344 additions and 7 deletions.
  1. +2 −0 TwUI.xcodeproj/project.pbxproj
  2. +37 −0 lib/UIKit/TUINSView+Private.h
  3. +2 −1 lib/UIKit/TUINSView.h
  4. +302 −6 lib/UIKit/TUINSView.m
  5. +1 −0 lib/UIKit/TUIView.h
@@ -480,6 +480,7 @@
D0C7655A15B6297200E7AC2C /* NSClipView+TUIExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSClipView+TUIExtensions.m"; sourceTree = "<group>"; };
D0C7655B15B6297300E7AC2C /* NSScrollView+TUIExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSScrollView+TUIExtensions.h"; sourceTree = "<group>"; };
D0C7655C15B6297300E7AC2C /* NSScrollView+TUIExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSScrollView+TUIExtensions.m"; sourceTree = "<group>"; };
+ D0C7656915B62EFA00E7AC2C /* TUINSView+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TUINSView+Private.h"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -691,6 +692,7 @@
CBB74C5E13BE6E1900C85CB5 /* TUINSView+Hyperfocus.h */,
CBB74C5F13BE6E1900C85CB5 /* TUINSView+Hyperfocus.m */,
CBB74C6013BE6E1900C85CB5 /* TUINSView+NSTextInputClient.m */,
+ D0C7656915B62EFA00E7AC2C /* TUINSView+Private.h */,
CBB74C6113BE6E1900C85CB5 /* TUINSView.h */,
CBB74C6213BE6E1900C85CB5 /* TUINSView.m */,
CBB74C6313BE6E1900C85CB5 /* TUINSWindow.h */,
@@ -0,0 +1,37 @@
+//
+// TUINSView+Private.h
+// TwUI
+//
+// Created by Justin Spahr-Summers on 17.07.12.
+//
+// Portions of this code were taken from Velvet,
+// which is copyright (c) 2012 Bitswift, Inc.
+// See LICENSE.txt for more information.
+//
+
+#import "TUINSView.h"
+
+/*
+ * Private functionality of TUINSView that needs to be exposed to other parts of
+ * the framework.
+ */
+@interface TUINSView ()
+
+/*
+ * The layer-backed view which actually holds the AppKit hierarchy.
+ */
+@property (nonatomic, readonly, strong) NSView *appKitHostView;
+
+/*
+ * Informs the receiver that the clipping of a TUIViewNSViewContainer it is hosting has
+ * changed, and asks it to update clipping paths accordingly.
+ */
+- (void)recalculateNSViewClipping;
+
+/*
+ * Informs the receiver that the ordering of a TUIViewNSViewContainer it is hosting has
+ * changed, and asks it to reorder its subviews to match TwUI.
+ */
+- (void)recalculateNSViewOrdering;
+
+@end
View
@@ -15,12 +15,13 @@
*/
#import <Cocoa/Cocoa.h>
+#import "TUIView+TUIBridgedView.h"
#import "TUIKit.h"
/**
TUINSView is the bridge that hosts a TUIView-based interface heirarchy. You may add it as the contentView of your window if you want to build a pure TwUI-based UI, or you can use it for a small part.
*/
-@interface TUINSView : NSView <NSTextInputClient>
+@interface TUINSView : NSView <NSTextInputClient, TUIHostView>
{
TUIView *rootView;
TUIView *_hoverView;
Oops, something went wrong.

0 comments on commit b156b3e

Please sign in to comment.