Permalink
Browse files

Merge pull request #20 from github/imports-cleanup

Removed unnecessary #imports to reduce compilation time
  • Loading branch information...
2 parents 19ae557 + 6ae2f1a commit 763133bf7adbaad43da2115f53a17cb590473ea7 @joshaber joshaber committed Jul 24, 2012
Showing with 288 additions and 193 deletions.
  1. +30 −18 TwUI.xcodeproj/project.pbxproj
  2. +1 −1 lib/UIKit/NSView+TUIExtensions.h
  3. +1 −0 lib/UIKit/TUIActivityIndicatorView.m
  4. +5 −1 lib/UIKit/TUIButton.m
  5. +25 −0 lib/UIKit/TUICGAdditions.h
  6. +88 −0 lib/UIKit/TUICGAdditions.m
  7. +2 −1 lib/UIKit/TUIColor.m
  8. +2 −1 lib/UIKit/TUIImage+Drawing.m
  9. +2 −1 lib/UIKit/TUIImage.m
  10. +0 −1 lib/UIKit/TUIImageView.m
  11. +2 −22 lib/UIKit/TUIKit.h
  12. +0 −88 lib/UIKit/TUIKit.m
  13. +0 −1 lib/UIKit/TUILabel.h
  14. +3 −1 lib/UIKit/TUILabel.m
  15. +1 −0 lib/UIKit/TUILayoutConstraint.m
  16. +1 −2 lib/UIKit/TUILayoutManager.h
  17. +1 −0 lib/UIKit/TUILayoutManager.m
  18. +1 −0 lib/UIKit/TUINSView+Hyperfocus.m
  19. +20 −0 lib/UIKit/TUINSView+NSTextInputClient.h
  20. +7 −2 lib/UIKit/TUINSView+NSTextInputClient.m
  21. +3 −0 lib/UIKit/TUINSView+Private.h
  22. +4 −4 lib/UIKit/TUINSView.h
  23. +2 −5 lib/UIKit/TUINSView.m
  24. +2 −1 lib/UIKit/TUINSWindow.h
  25. +3 −0 lib/UIKit/TUINSWindow.m
  26. +4 −4 lib/UIKit/TUIPopover.m
  27. +2 −1 lib/UIKit/TUIProgressBar.m
  28. +2 −2 lib/UIKit/TUIScrollKnob.m
  29. +2 −1 lib/UIKit/TUIScrollView.m
  30. +3 −3 lib/UIKit/TUIStringDrawing.m
  31. +3 −3 lib/UIKit/TUIStyledView.m
  32. +1 −0 lib/UIKit/TUITableView+Cell.m
  33. +2 −1 lib/UIKit/TUITableView.h
  34. +3 −1 lib/UIKit/TUITableView.m
  35. +2 −1 lib/UIKit/TUITableViewCell.h
  36. +3 −2 lib/UIKit/TUITableViewCell.m
  37. +3 −1 lib/UIKit/TUITextEditor.m
  38. +2 −1 lib/UIKit/TUITextField.m
  39. +7 −3 lib/UIKit/TUITextRenderer+Event.m
  40. +1 −1 lib/UIKit/TUITextRenderer.h
  41. +7 −4 lib/UIKit/TUITextRenderer.m
  42. +5 −1 lib/UIKit/TUITextView.m
  43. +4 −1 lib/UIKit/TUITooltipWindow.m
  44. +5 −4 lib/UIKit/TUIView+Event.m
  45. +3 −1 lib/UIKit/TUIView+Layout.h
  46. +1 −0 lib/UIKit/TUIView+Layout.m
  47. +1 −1 lib/UIKit/TUIView+PasteboardDragging.h
  48. +3 −1 lib/UIKit/TUIView+PasteboardDragging.m
  49. +2 −1 lib/UIKit/TUIView+Private.h
  50. +2 −2 lib/UIKit/TUIView.h
  51. +5 −1 lib/UIKit/TUIView.m
  52. +2 −1 lib/UIKit/TUIViewController.h
  53. +2 −0 lib/UIKit/TUIViewController.m

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -11,9 +11,9 @@
#import <AppKit/AppKit.h>
#import "TUIBridgedView.h"
-#import "TUIHostView.h"
@class TUIViewNSViewContainer;
+@protocol TUIHostView;
/**
* Implements <TUIBridgedView> for NSView.
@@ -15,6 +15,7 @@
*/
#import "TUIActivityIndicatorView.h"
+#import "TUIColor.h"
@implementation TUIActivityIndicatorView
View
@@ -16,9 +16,13 @@
#import "TUIImage.h"
#import "TUIButton.h"
+#import "TUICGAdditions.h"
+#import "TUIColor.h"
+#import "TUIControl+Private.h"
+#import "TUIImageView.h"
#import "TUILabel.h"
#import "TUINSView.h"
-#import "TUIControl+Private.h"
+#import "TUITextRenderer.h"
@interface TUIButton ()
View
@@ -29,6 +29,9 @@ typedef NSUInteger TUICGRoundedRectCorner;
#import <Foundation/Foundation.h>
+@class TUIImage;
+@class TUIView;
+
extern CGContextRef TUICreateOpaqueGraphicsContext(CGSize size);
extern CGContextRef TUICreateGraphicsContext(CGSize size);
extern CGContextRef TUICreateGraphicsContextWithOptions(CGSize size, BOOL opaque);
@@ -47,3 +50,25 @@ extern CGRect ABIntegralRectWithSizeCenteredInRect(CGSize s, CGRect r);
extern void CGContextFillRoundRect(CGContextRef context, CGRect rect, CGFloat radius);
extern void CGContextDrawLinearGradientBetweenPoints(CGContextRef context, CGPoint a, CGFloat color_a[4], CGPoint b, CGFloat color_b[4]);
+
+extern CGContextRef TUIGraphicsGetCurrentContext(void);
+extern void TUIGraphicsPushContext(CGContextRef context);
+extern void TUIGraphicsPopContext(void);
+
+extern TUIImage *TUIGraphicsContextGetImage(CGContextRef ctx);
+
+extern void TUIGraphicsBeginImageContext(CGSize size);
+extern void TUIGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale);
+extern TUIImage *TUIGraphicsGetImageFromCurrentImageContext(void);
+extern void TUIGraphicsEndImageContext(void);
+
+extern TUIImage *TUIGraphicsGetImageForView(TUIView *view);
+
+extern TUIImage *TUIGraphicsDrawAsImage(CGSize size, void(^draw)(void));
+
+/**
+ Draw drawing as a PDF
+ @param optionalMediaBox may be NULL
+ @returns NSData encapsulating the PDF drawing, suitable for writing to a file or the pasteboard
+ */
+extern NSData *TUIGraphicsDrawAsPDF(CGRect *optionalMediaBox, void(^draw)(CGContextRef));
View
@@ -15,6 +15,8 @@
*/
#import "TUICGAdditions.h"
+#import "TUIImage.h"
+#import "TUIView.h"
CGContextRef TUICreateOpaqueGraphicsContext(CGSize size)
{
@@ -174,3 +176,89 @@ void CGContextDrawLinearGradientBetweenPoints(CGContextRef context, CGPoint a, C
CGColorSpaceRelease(colorspace);
CGGradientRelease(gradient);
}
+
+CGContextRef TUIGraphicsGetCurrentContext(void)
+{
+ return (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
+}
+
+void TUIGraphicsPushContext(CGContextRef context)
+{
+ NSGraphicsContext *c = [NSGraphicsContext graphicsContextWithGraphicsPort:context flipped:NO];
+ [NSGraphicsContext saveGraphicsState];
+ [NSGraphicsContext setCurrentContext:c];
+}
+
+void TUIGraphicsPopContext(void)
+{
+ [NSGraphicsContext restoreGraphicsState];
+}
+
+TUIImage* TUIGraphicsContextGetImage(CGContextRef ctx)
+{
+ CGImageRef CGImage = TUICreateCGImageFromBitmapContext(ctx);
+ TUIImage *image = [TUIImage imageWithCGImage:CGImage];
+ CGImageRelease(CGImage);
+
+ return image;
+}
+
+void TUIGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale)
+{
+ size.width *= scale;
+ size.height *= scale;
+ if(size.width < 1) size.width = 1;
+ if(size.height < 1) size.height = 1;
+ CGContextRef ctx = TUICreateGraphicsContextWithOptions(size, opaque);
+ TUIGraphicsPushContext(ctx);
+ CGContextRelease(ctx);
+}
+
+void TUIGraphicsBeginImageContext(CGSize size)
+{
+ TUIGraphicsBeginImageContextWithOptions(size, NO, 1.0f);
+}
+
+TUIImage* TUIGraphicsGetImageFromCurrentImageContext(void)
+{
+ return TUIGraphicsContextGetImage(TUIGraphicsGetCurrentContext());
+}
+
+TUIImage* TUIGraphicsGetImageForView(TUIView *view)
+{
+ TUIGraphicsBeginImageContext(view.frame.size);
+ [view.layer renderInContext:TUIGraphicsGetCurrentContext()];
+ TUIImage *image = TUIGraphicsGetImageFromCurrentImageContext();
+ TUIGraphicsEndImageContext();
+ return image;
+}
+
+void TUIGraphicsEndImageContext(void)
+{
+ TUIGraphicsPopContext();
+}
+
+TUIImage *TUIGraphicsDrawAsImage(CGSize size, void(^draw)(void))
+{
+ TUIGraphicsBeginImageContext(size);
+ draw();
+ TUIImage *image = TUIGraphicsGetImageFromCurrentImageContext();
+ TUIGraphicsEndImageContext();
+ return image;
+}
+
+NSData* TUIGraphicsDrawAsPDF(CGRect *optionalMediaBox, void(^draw)(CGContextRef))
+{
+ NSMutableData *data = [NSMutableData data];
+ CGDataConsumerRef dataConsumer = CGDataConsumerCreateWithCFData((__bridge CFMutableDataRef)data);
+ CGContextRef ctx = CGPDFContextCreate(dataConsumer, optionalMediaBox, NULL);
+ CGPDFContextBeginPage(ctx, NULL);
+ TUIGraphicsPushContext(ctx);
+ draw(ctx);
+ TUIGraphicsPopContext();
+ CGPDFContextEndPage(ctx);
+ CGPDFContextClose(ctx);
+ CGContextRelease(ctx);
+ CGDataConsumerRelease(dataConsumer);
+ return data;
+}
View
@@ -15,7 +15,8 @@
*/
#import "TUIColor.h"
-#import "TUIKit.h"
+#import "TUICGAdditions.h"
+#import "TUIImage.h"
@implementation TUIColor
@@ -14,8 +14,9 @@
limitations under the License.
*/
-#import "TUIKit.h"
#import "TUIImage+Drawing.h"
+#import "TUICGAdditions.h"
+#import "TUIColor.h"
@implementation TUIImage (Drawing)
View
@@ -15,7 +15,8 @@
*/
#import "TUIImage.h"
-#import "TUIKit.h"
+#import "TUICGAdditions.h"
+#import "TUIView+Private.h"
static CGImageRef TUICreateImageRefWithData(NSData *data)
{
View
@@ -14,7 +14,6 @@
limitations under the License.
*/
-#import "TUIKit.h"
#import "TUIImageView.h"
#import "TUIImage.h"
View
@@ -36,6 +36,8 @@
#import "TUILabel.h"
#import "TUILayoutConstraint.h"
#import "TUINSView.h"
+#import "TUINSView+Hyperfocus.h"
+#import "TUINSView+NSTextInputClient.h"
#import "TUINSWindow.h"
#import "TUIPopover.h"
#import "TUIProgressBar.h"
@@ -57,26 +59,4 @@
#import "TUIViewController.h"
#import "TUIViewNSViewContainer.h"
-extern CGContextRef TUIGraphicsGetCurrentContext(void);
-extern void TUIGraphicsPushContext(CGContextRef context);
-extern void TUIGraphicsPopContext(void);
-
-extern TUIImage *TUIGraphicsContextGetImage(CGContextRef ctx);
-
-extern void TUIGraphicsBeginImageContext(CGSize size);
-extern void TUIGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale);
-extern TUIImage *TUIGraphicsGetImageFromCurrentImageContext(void);
-extern void TUIGraphicsEndImageContext(void);
-
-extern TUIImage *TUIGraphicsGetImageForView(TUIView *view);
-
-extern TUIImage *TUIGraphicsDrawAsImage(CGSize size, void(^draw)(void));
-
-/**
- Draw drawing as a PDF
- @param optionalMediaBox may be NULL
- @returns NSData encapsulating the PDF drawing, suitable for writing to a file or the pasteboard
- */
-extern NSData *TUIGraphicsDrawAsPDF(CGRect *optionalMediaBox, void(^draw)(CGContextRef));
-
extern BOOL AtLeastLion; // set at launch
View
@@ -14,92 +14,4 @@
limitations under the License.
*/
-#import "TUIKit.h"
-
BOOL AtLeastLion = NO;
-
-CGContextRef TUIGraphicsGetCurrentContext(void)
-{
- return (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
-}
-
-void TUIGraphicsPushContext(CGContextRef context)
-{
- NSGraphicsContext *c = [NSGraphicsContext graphicsContextWithGraphicsPort:context flipped:NO];
- [NSGraphicsContext saveGraphicsState];
- [NSGraphicsContext setCurrentContext:c];
-}
-
-void TUIGraphicsPopContext(void)
-{
- [NSGraphicsContext restoreGraphicsState];
-}
-
-TUIImage* TUIGraphicsContextGetImage(CGContextRef ctx)
-{
- CGImageRef CGImage = TUICreateCGImageFromBitmapContext(ctx);
- TUIImage *image = [TUIImage imageWithCGImage:CGImage];
- CGImageRelease(CGImage);
-
- return image;
-}
-
-void TUIGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale)
-{
- size.width *= scale;
- size.height *= scale;
- if(size.width < 1) size.width = 1;
- if(size.height < 1) size.height = 1;
- CGContextRef ctx = TUICreateGraphicsContextWithOptions(size, opaque);
- TUIGraphicsPushContext(ctx);
- CGContextRelease(ctx);
-}
-
-void TUIGraphicsBeginImageContext(CGSize size)
-{
- TUIGraphicsBeginImageContextWithOptions(size, NO, 1.0f);
-}
-
-TUIImage* TUIGraphicsGetImageFromCurrentImageContext(void)
-{
- return TUIGraphicsContextGetImage(TUIGraphicsGetCurrentContext());
-}
-
-TUIImage* TUIGraphicsGetImageForView(TUIView *view)
-{
- TUIGraphicsBeginImageContext(view.frame.size);
- [view.layer renderInContext:TUIGraphicsGetCurrentContext()];
- TUIImage *image = TUIGraphicsGetImageFromCurrentImageContext();
- TUIGraphicsEndImageContext();
- return image;
-}
-
-void TUIGraphicsEndImageContext(void)
-{
- TUIGraphicsPopContext();
-}
-
-TUIImage *TUIGraphicsDrawAsImage(CGSize size, void(^draw)(void))
-{
- TUIGraphicsBeginImageContext(size);
- draw();
- TUIImage *image = TUIGraphicsGetImageFromCurrentImageContext();
- TUIGraphicsEndImageContext();
- return image;
-}
-
-NSData* TUIGraphicsDrawAsPDF(CGRect *optionalMediaBox, void(^draw)(CGContextRef))
-{
- NSMutableData *data = [NSMutableData data];
- CGDataConsumerRef dataConsumer = CGDataConsumerCreateWithCFData((__bridge CFMutableDataRef)data);
- CGContextRef ctx = CGPDFContextCreate(dataConsumer, optionalMediaBox, NULL);
- CGPDFContextBeginPage(ctx, NULL);
- TUIGraphicsPushContext(ctx);
- draw(ctx);
- TUIGraphicsPopContext();
- CGPDFContextEndPage(ctx);
- CGPDFContextClose(ctx);
- CGContextRelease(ctx);
- CGDataConsumerRelease(dataConsumer);
- return data;
-}
View
@@ -15,7 +15,6 @@
*/
#import "TUIView.h"
-#import "TUIStringDrawing.h"
#import "TUIAttributedString.h"
/*
View
@@ -15,9 +15,11 @@
*/
#import "TUILabel.h"
-#import "TUIFont.h"
#import "TUIColor.h"
+#import "TUIFont.h"
#import "TUINSView.h"
+#import "TUIStringDrawing.h"
+#import "TUITextRenderer.h"
#import "TUIView+Private.h"
@interface TUILabel ()
@@ -1,5 +1,6 @@
#import "TUILayoutConstraint.h"
#import "TUILayoutManager.h"
+#import "TUIView.h"
@interface TUIView (Layout_Private)
@@ -1,6 +1,5 @@
-#import "TUIView.h"
-
@class TUILayoutConstraint;
+@class TUIView;
/*
@@ -1,4 +1,5 @@
#import <objc/runtime.h>
+#import "TUILayoutConstraint.h"
#import "TUILayoutManager.h"
#import "TUIView+Layout.h"
@@ -15,6 +15,7 @@
*/
#import "TUINSView.h"
+#import "TUICGAdditions.h"
#import "TUINSView+Hyperfocus.h"
@implementation TUINSView (Hyperfocus)
Oops, something went wrong.

0 comments on commit 763133b

Please sign in to comment.