Skip to content
This repository has been archived by the owner on May 2, 2021. It is now read-only.

Commit

Permalink
#10 using TBBean protocol in some beans
Browse files Browse the repository at this point in the history
  • Loading branch information
Tae Won Ha committed Jun 6, 2013
1 parent 5b00356 commit 8e68eb0
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
3 changes: 2 additions & 1 deletion Qmind/QMCellSizeManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
@class QMCell;
@class QMTextLayoutManager;
@class QMAppSettings;
@protocol TBBean;

@interface QMCellSizeManager : NSObject
@interface QMCellSizeManager : NSObject <TBBean>

@property (weak) QMTextLayoutManager *textLayoutManager;
@property (weak) QMAppSettings *settings;
Expand Down
2 changes: 1 addition & 1 deletion Qmind/QMCellSizeManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

#import <Qkit/Qkit.h>
#import <TBCacao/TBCacao.h>
#import "QMCellSizeManager.h"
#import "QMCell.h"
#import "QMTextLayoutManager.h"
Expand All @@ -15,7 +16,6 @@

@implementation QMCellSizeManager

TB_BEAN
TB_AUTOWIRE(textLayoutManager)
TB_AUTOWIRE(settings)

Expand Down
4 changes: 3 additions & 1 deletion Qmind/QMTextDrawer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

#import <Cocoa/Cocoa.h>

@interface QMTextDrawer : NSObject
@protocol TBBean;

@interface QMTextDrawer : NSObject <TBBean>

- (void)drawAttributedString:(NSAttributedString *)attrStr inRect:(NSRect)frame range:(NSRange)range;

Expand Down
3 changes: 0 additions & 3 deletions Qmind/QMTextDrawer.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@

#import <TBCacao/TBCacao.h>
#import "QMTextDrawer.h"
#import "QMAppSettings.h"

@implementation QMTextDrawer {
NSLayoutManager *_layoutManager;
NSTextStorage *_textStorage;
NSTextContainer *_textContainer;
}

TB_BEAN

#pragma mark Public
- (void)drawAttributedString:(NSAttributedString *)attrStr inRect:(NSRect)frame range:(NSRange)range {
@synchronized (_textStorage) {
Expand Down
3 changes: 2 additions & 1 deletion Qmind/QMTextLayoutManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
#import <Cocoa/Cocoa.h>

@class QMAppSettings;
@protocol TBBean;

@interface QMTextLayoutManager : NSObject
@interface QMTextLayoutManager : NSObject <TBBean>

@property (weak) QMAppSettings *settings;

Expand Down
5 changes: 2 additions & 3 deletions Qmind/QMTextLayoutManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@
* See LICENSE
*/

#import "QMTextLayoutManager.h"
#import "QMAppSettings.h"
#import <Qkit/Qkit.h>
#import <TBCacao/TBCacao.h>
#import "QMTextLayoutManager.h"
#import "QMAppSettings.h"

@implementation QMTextLayoutManager {
NSLayoutManager *_layoutManager;
NSTextStorage *_textStorage;
NSTextContainer *_textContainer;
}

TB_BEAN
TB_AUTOWIRE(settings)

#pragma mark Public
Expand Down
4 changes: 3 additions & 1 deletion Qmind/QMUiDrawer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

#import <Cocoa/Cocoa.h>

@interface QMUiDrawer : NSObject
@protocol TBBean;

@interface QMUiDrawer : NSObject <TBBean>

- (void)drawBadgeWithNumber:(NSUInteger)number atPoint:(NSPoint)location;

Expand Down
4 changes: 1 addition & 3 deletions Qmind/QMUiDrawer.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
* See LICENSE
*/

#import "QMUiDrawer.h"
#import <Qkit/Qkit.h>
#import <TBCacao/TBCacao.h>
#import "QMUiDrawer.h"

static const NSSize qSizeOfBadgeCircle = {20., 20.};

@implementation QMUiDrawer

TB_BEAN

- (void)drawBadgeWithNumber:(NSUInteger)number atPoint:(NSPoint)location {
NSColor *red = [NSColor redColor];
NSColor *darkRed = [NSColor colorWithCalibratedRed:0.71 green:0 blue:0.13 alpha:1];
Expand Down

0 comments on commit 8e68eb0

Please sign in to comment.