BathyScapheの中身をぐちゃぐちゃに
Révision | 387da867d557898247a73cb36f27e381dfd5cf04 (tree) |
---|---|
l'heure | 2012-07-02 23:19:56 |
Auteur | masakih <masakih@user...> |
Commiter | masakih |
[Mod] ソースコード整理
@@ -13,7 +13,6 @@ | ||
13 | 13 | |
14 | 14 | #import "CMRThreadView.h" |
15 | 15 | |
16 | -#import <SGAppKit/BSLayoutManager.h> | |
17 | 16 | #import "CMRMainMenuManager.h" |
18 | 17 | #import "AppDefaults.h" |
19 | 18 | #import "CMRMessageAttributesTemplate.h" |
@@ -21,10 +20,7 @@ | ||
21 | 20 | #import "CMRThreadAttributes.h" |
22 | 21 | #import "CMRThreadSignature.h" |
23 | 22 | |
24 | -#import <SGAppKit/BSTitleRulerAppearance.h> | |
25 | -#import <SGAppKit/BSTitleRulerView.h> | |
26 | -#import <SGAppKit/NSTextView-SGExtensions.h> | |
27 | -#import <SGAppKit/NSWorkspace-SGExtensions.h> | |
23 | +#import <SGAppKit/SGAppKit.h> | |
28 | 24 | |
29 | 25 | #import "CMRThreadMessageBufferReader.h" |
30 | 26 | #import "CMRThreadComposingTask.h" |
@@ -43,17 +39,11 @@ NSString *const CMRThreadViewerRunSpamFilterNotification = @"CMRThreadViewerRunS | ||
43 | 39 | NSString *const BSThreadViewerWillStartFindingNotification = @"BSThreadViewerWillStartFindingNotification"; |
44 | 40 | NSString *const BSThreadViewerDidEndFindingNotification = @"BSThreadViewerDidEndFindingNotification"; |
45 | 41 | |
46 | - | |
47 | -#define APP_TVIEW_LOCALIZABLE_FILE @"ThreadViewer" | |
48 | - | |
49 | - | |
50 | - | |
51 | 42 | @interface KMBSLogViewController() |
52 | 43 | @property (assign, readwrite) NSLayoutManager *layoutManager; |
53 | 44 | @property (assign, readwrite) NSTextContainer *textContainer; |
54 | 45 | @property (nonatomic, retain, readwrite) NSCountedSet *countedSet; |
55 | 46 | |
56 | - | |
57 | 47 | @property (readonly) KMReplyMessenger *messenger; |
58 | 48 | @property (nonatomic, retain) NSTextStorage *privateTextStorage; |
59 | 49 | @property (nonatomic, retain) KMHistoryStack *histories; |
@@ -64,7 +54,6 @@ NSString *const BSThreadViewerDidEndFindingNotification = @"BSThreadViewerDidEnd | ||
64 | 54 | @property (readonly) NSWindow *window; |
65 | 55 | |
66 | 56 | - (void)composeDocumentMessage:(id)sender; |
67 | - | |
68 | 57 | @end |
69 | 58 | |
70 | 59 | @interface KMBSLogViewController(BuildViews) |
@@ -128,6 +117,7 @@ static void KMClearRangesFromIndex(KMBSLogViewController *obj, NSUInteger index) | ||
128 | 117 | |
129 | 118 | + (NSString *)localizableStringsTableName |
130 | 119 | { |
120 | +#define APP_TVIEW_LOCALIZABLE_FILE @"ThreadViewer" | |
131 | 121 | return APP_TVIEW_LOCALIZABLE_FILE; |
132 | 122 | } |
133 | 123 |
@@ -381,6 +371,7 @@ static void KMClearRangesFromIndex(KMBSLogViewController *obj, NSUInteger index) | ||
381 | 371 | } |
382 | 372 | |
383 | 373 | finish: |
374 | + // lock in -composeDocumentMessage: method. | |
384 | 375 | [updatingLock unlock]; |
385 | 376 | } |
386 | 377 | - (void)threadComposingDidFinish:(NSMutableAttributedString *)aTextBuffer |
@@ -413,14 +404,10 @@ finish: | ||
413 | 404 | } |
414 | 405 | @end |
415 | 406 | |
416 | - | |
417 | 407 | #import "CMRThreadMessage.h" |
418 | 408 | #import "CMRThreadMessageBuffer.h" |
419 | 409 | #import "CMRAttributedMessageComposer.h" |
420 | - | |
421 | 410 | @implementation KMBSLogViewController(CMRThreadLayout_Dummy) |
422 | -#pragma mark CMRThreadLayout ? | |
423 | - | |
424 | 411 | - (CMRThreadLayout *)threadLayout |
425 | 412 | { |
426 | 413 | return (CMRThreadLayout *)self; |
@@ -1269,9 +1256,6 @@ typedef NSUInteger NSEventSwipeTrackingOptions; | ||
1269 | 1256 | } |
1270 | 1257 | - (void)scrollWheel:(NSEvent *)event |
1271 | 1258 | { |
1272 | - // NSScrollView is instructed to only forward horizontal scroll gesture events (see code above). However, depending | |
1273 | - // on where your controller is in the responder chain, it may receive other scrollWheel events that we don't want | |
1274 | - // to track as a fluid swipe because the event wasn't routed though an NSScrollView first. | |
1275 | 1259 | if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_6) { |
1276 | 1260 | return; |
1277 | 1261 | } |
@@ -1285,19 +1269,12 @@ typedef NSUInteger NSEventSwipeTrackingOptions; | ||
1285 | 1269 | if (fabsf(foo) <= fabsf(bar)) { // Not horizontal |
1286 | 1270 | return; |
1287 | 1271 | } |
1288 | - // If the user has disabled tracking scrolls as fluid swipes in system preferences, we should respect that. | |
1289 | - // NSScrollView will do this check for us, however, depending on where your controller is in the responder chain, | |
1290 | - // it may scrollWheel events that are not filtered by an NSScrollView. | |
1291 | 1272 | if (![NSEvent isSwipeTrackingFromScrollEventsEnabled]) { |
1292 | 1273 | return; |
1293 | 1274 | } |
1294 | 1275 | |
1295 | 1276 | BOOL goForward = (foo < 0); |
1296 | - // Released by the tracking handler once the gesture is complete. | |
1297 | - HistoryOverlayController* historyOverlay = | |
1298 | - [[HistoryOverlayController alloc] | |
1299 | - initForMode:goForward ? kHistoryOverlayModeForward : | |
1300 | - kHistoryOverlayModeBack]; | |
1277 | + HistoryOverlayController* historyOverlay = [[HistoryOverlayController alloc] initForMode:goForward ? kHistoryOverlayModeForward : kHistoryOverlayModeBack]; | |
1301 | 1278 | |
1302 | 1279 | [event trackSwipeEventWithOptions:NSEventSwipeTrackingClampGestureAmount |
1303 | 1280 | dampenAmountThresholdMin:([self.histories canForward] ? -1 : 0) |
@@ -1330,7 +1307,6 @@ typedef NSUInteger NSEventSwipeTrackingOptions; | ||
1330 | 1307 | } |
1331 | 1308 | @end |
1332 | 1309 | |
1333 | - | |
1334 | 1310 | #import "KMThreadDeleteCenter.h" |
1335 | 1311 | @interface KMBSLogViewController(KMThreadDeleteCenterDelegate) <KMThreadDeleteCenterDelegate> |
1336 | 1312 | @end |
@@ -1341,7 +1317,6 @@ typedef NSUInteger NSEventSwipeTrackingOptions; | ||
1341 | 1317 | } |
1342 | 1318 | @end |
1343 | 1319 | |
1344 | - | |
1345 | 1320 | #import "BSLabelMenuItemView.h" |
1346 | 1321 | @interface KMBSLogViewController(BSLabelMenuItemViewValidation) <BSLabelMenuItemViewValidation> |
1347 | 1322 | - (BOOL)validateLabelMenuItem:(BSLabelMenuItemView *)item; |
@@ -1374,10 +1349,8 @@ typedef NSUInteger NSEventSwipeTrackingOptions; | ||
1374 | 1349 | } |
1375 | 1350 | @end |
1376 | 1351 | |
1377 | - | |
1378 | 1352 | @implementation KMBSLogViewController(Actions) |
1379 | 1353 | #import "CMRFavoritesManager+KMAddition.h" |
1380 | -#import <SGAppKit/SGAppKit.h> | |
1381 | 1354 | |
1382 | 1355 | #define kReplyItemKey @"Reply..." |
1383 | 1356 | #define kReplyToItemKey @"Reply 2..." |
@@ -1387,7 +1360,6 @@ typedef NSUInteger NSEventSwipeTrackingOptions; | ||
1387 | 1360 | |
1388 | 1361 | /*** アクション・メニュー ***/ |
1389 | 1362 | #define kActionMenuItemTag (100) /* 「アクション」 */ |
1390 | - | |
1391 | 1363 | #define kActionSpamHeader (111) /* 「迷惑レス」ヘッダ */ |
1392 | 1364 | #define kActionAAHeader (222) /* 「AA」ヘッダ */ |
1393 | 1365 | #define kActionBookmarkHeader (333) /* 「ブックマーク」ヘッダ */ |
@@ -1703,8 +1675,6 @@ static NSInteger messageMaskForTag(NSInteger tag) | ||
1703 | 1675 | |
1704 | 1676 | #import "BSDateFormatter.h" |
1705 | 1677 | #import "BSIndexPanelController.h" |
1706 | - | |
1707 | - | |
1708 | 1678 | @implementation KMBSLogViewController (MoveAction) |
1709 | 1679 | /* 最初/最後のレス */ |
1710 | 1680 | - (IBAction)scrollFirstMessage:(id)sender |
@@ -1834,7 +1804,6 @@ static NSInteger messageMaskForTag(NSInteger tag) | ||
1834 | 1804 | } |
1835 | 1805 | @end |
1836 | 1806 | |
1837 | - | |
1838 | 1807 | @implementation KMBSLogViewController (MoveActionValidation) |
1839 | 1808 | - (BOOL)canScrollToMessage |
1840 | 1809 | { |