Revision: 6462
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6462&view=rev
Author:   hofman
Date:     2010-04-16 17:23:19 +0000 (Fri, 16 Apr 2010)

Log Message:
-----------
macros for delegate implementation/declaration for subclasses

Modified Paths:
--------------
    trunk/SKApplication.h
    trunk/SKApplication.m
    trunk/SKNoteOutlineView.h
    trunk/SKNoteOutlineView.m
    trunk/SKOutlineView.h
    trunk/SKOutlineView.m
    trunk/SKThumbnailTableView.h
    trunk/SKThumbnailTableView.m
    trunk/SKTransitionController.m
    trunk/Skim_Prefix.pch

Modified: trunk/SKApplication.h
===================================================================
--- trunk/SKApplication.h       2010-04-16 09:28:04 UTC (rev 6461)
+++ trunk/SKApplication.h       2010-04-16 17:23:19 UTC (rev 6462)
@@ -48,10 +48,7 @@
 
 @property (nonatomic, getter=isUserAttentionDisabled) BOOL 
userAttentionDisabled;
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
-- (id <SKApplicationDelegate>)delegate;
-- (void)setDelegate:(id <SKApplicationDelegate>)newDelegate;
-#endif
+SUBCLASS_DELEGATE_DEFINITION(SKApplicationDelegate)
 
 @end
 

Modified: trunk/SKApplication.m
===================================================================
--- trunk/SKApplication.m       2010-04-16 09:28:04 UTC (rev 6461)
+++ trunk/SKApplication.m       2010-04-16 17:23:19 UTC (rev 6462)
@@ -196,14 +196,6 @@
     [self reorganizeWindowsItem:aWindow];
 }
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
-- (id <SKApplicationDelegate>)delegate {
-    return (id <SKApplicationDelegate>)[super delegate];
-}
+SUBCLASS_DELEGATE_DECLARATION(SKApplicationDelegate)
 
-- (void)setDelegate:(id <SKApplicationDelegate>)newDelegate {
-    [super setDelegate:newDelegate];
-}
-#endif
-
 @end

Modified: trunk/SKNoteOutlineView.h
===================================================================
--- trunk/SKNoteOutlineView.h   2010-04-16 09:28:04 UTC (rev 6461)
+++ trunk/SKNoteOutlineView.h   2010-04-16 17:23:19 UTC (rev 6462)
@@ -43,10 +43,7 @@
 
 @interface SKNoteOutlineView : SKOutlineView
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
-- (id <SKNoteOutlineViewDelegate>)delegate;
-- (void)setDelegate:(id <SKNoteOutlineViewDelegate>)newDelegate;
-#endif
+SUBCLASS_DELEGATE_DECLARATION(SKNoteOutlineViewDelegate)
 
 @end
 

Modified: trunk/SKNoteOutlineView.m
===================================================================
--- trunk/SKNoteOutlineView.m   2010-04-16 09:28:04 UTC (rev 6461)
+++ trunk/SKNoteOutlineView.m   2010-04-16 17:23:19 UTC (rev 6462)
@@ -194,14 +194,6 @@
 
 #pragma mark Delegate
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
-- (id <SKNoteOutlineViewDelegate>)delegate {
-    return (id <SKNoteOutlineViewDelegate>)[super delegate];
-}
+SUBCLASS_DELEGATE_DEFINITION(SKNoteOutlineViewDelegate)
 
-- (void)setDelegate:(id <SKNoteOutlineViewDelegate>)newDelegate {
-    [super setDelegate:newDelegate];
-}
-#endif
-
 @end

Modified: trunk/SKOutlineView.h
===================================================================
--- trunk/SKOutlineView.h       2010-04-16 09:28:04 UTC (rev 6461)
+++ trunk/SKOutlineView.h       2010-04-16 17:23:19 UTC (rev 6462)
@@ -57,12 +57,8 @@
 - (void)scrollToBeginningOfDocument:(id)sender;
 - (void)scrollToEndOfDocument:(id)sender;
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
-- (id <SKOutlineViewDelegate>)delegate;
-- (void)setDelegate:(id <SKOutlineViewDelegate>)newDelegate;
-- (id <SKOutlineViewDataSource>)dataSource;
-- (void)setDataSource:(id <SKOutlineViewDataSource>)newDataSource;
-#endif
+SUBCLASS_DELEGATE_DECLARATION(SKOutlineViewDelegate)
+SUBCLASS_DATASOURCE_DECLARATION(SKOutlineViewDataSource)
 
 @end
 

Modified: trunk/SKOutlineView.m
===================================================================
--- trunk/SKOutlineView.m       2010-04-16 09:28:04 UTC (rev 6461)
+++ trunk/SKOutlineView.m       2010-04-16 17:23:19 UTC (rev 6462)
@@ -263,22 +263,7 @@
         [[self delegate] outlineView:self typeSelectHelper:aTypeSelectHelper 
updateSearchString:searchString];
 }
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
-- (id <SKOutlineViewDelegate>)delegate {
-    return (id <SKOutlineViewDelegate>)[super delegate];
-}
+SUBCLASS_DELEGATE_DEFINITION(SKOutlineViewDelegate)
+SUBCLASS_DATASOURCE_DEFINITION(SKOutlineViewDataSource)
 
-- (void)setDelegate:(id <SKOutlineViewDelegate>)newDelegate {
-    [super setDelegate:newDelegate];
-}
-
-- (id <SKOutlineViewDataSource>)dataSource {
-    return (id <SKOutlineViewDataSource>)[super dataSource];
-}
-
-- (void)setDataSource:(id <SKOutlineViewDataSource>)newDataSource {
-    [super setDataSource:newDataSource];
-}
-#endif
-
 @end

Modified: trunk/SKThumbnailTableView.h
===================================================================
--- trunk/SKThumbnailTableView.h        2010-04-16 09:28:04 UTC (rev 6461)
+++ trunk/SKThumbnailTableView.h        2010-04-16 17:23:19 UTC (rev 6462)
@@ -48,10 +48,7 @@
 
 @property (nonatomic, readonly) BOOL isScrolling;
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
-- (id <SKThumbnailTableViewDelegate>)delegate;
-- (void)setDelegate:(id <SKThumbnailTableViewDelegate>)newDelegate;
-#endif
+SUBCLASS_DELEGATE_DECLARATION(SKThumbnailTableViewDelegate)
 
 @end
 

Modified: trunk/SKThumbnailTableView.m
===================================================================
--- trunk/SKThumbnailTableView.m        2010-04-16 09:28:04 UTC (rev 6461)
+++ trunk/SKThumbnailTableView.m        2010-04-16 17:23:19 UTC (rev 6462)
@@ -192,14 +192,6 @@
        return [super dragImageForRowsWithIndexes:dragRows tableColumns:[[self 
tableColumns] subarrayWithRange:NSMakeRange(0, 1)] event:dragEvent 
offset:dragImageOffset];
 }
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
-- (id <SKThumbnailTableViewDelegate>)delegate {
-    return (id <SKThumbnailTableViewDelegate>)[super delegate];
-}
+SUBCLASS_DELEGATE_DEFINITION(SKThumbnailTableViewDelegate)
 
-- (void)setDelegate:(id <SKThumbnailTableViewDelegate>)newDelegate {
-    [super setDelegate:newDelegate];
-}
-#endif
-
 @end

Modified: trunk/SKTransitionController.m
===================================================================
--- trunk/SKTransitionController.m      2010-04-16 09:28:04 UTC (rev 6461)
+++ trunk/SKTransitionController.m      2010-04-16 17:23:19 UTC (rev 6462)
@@ -127,10 +127,7 @@
 }
 - (id)initWithFilter:(CIFilter *)aFilter duration:(NSTimeInterval)duration;
 - (CIImage *)currentImage;
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
-- (id <SKTransitionAnimationDelegate>)delegate;
-- (void)setDelegate:(id <SKTransitionAnimationDelegate>)newDelegate;
-#endif
+SUBCLASS_DELEGATE_DECLARATION(SKTransitionAnimationDelegate)
 @end
 
 @protocol SKTransitionAnimationDelegate <NSAnimationDelegate>
@@ -548,16 +545,8 @@
     return [filter valueForKey:kCIOutputImageKey];
 }
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
-- (id <SKTransitionAnimationDelegate>)delegate {
-    return (id <SKTransitionAnimationDelegate>)[super delegate];
-}
+SUBCLASS_DELEGATE_DEFINITION(SKTransitionAnimationDelegate)
 
-- (void)setDelegate:(id <SKTransitionAnimationDelegate>)newDelegate {
-    [super setDelegate:newDelegate];
-}
-#endif
-
 @end
 
 #pragma mark -

Modified: trunk/Skim_Prefix.pch
===================================================================
--- trunk/Skim_Prefix.pch       2010-04-16 09:28:04 UTC (rev 6461)
+++ trunk/Skim_Prefix.pch       2010-04-16 17:23:19 UTC (rev 6462)
@@ -40,6 +40,30 @@
     #define SKDESTROY(variable) do { [variable release]; variable = nil; } 
while (0)
     #define SKCFDESTROY(variable) do { if (variable) CFRelease(variable); 
variable = NULL; } while (0)
     #define SKZONEDESTROY(variable) do { if (variable) 
NSZoneFree(NSZoneFromPointer((void*)variable), (void *)variable); variable = 
NULL; } while (0)
+    
+    #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
+    
+    #define SUBCLASS_DELEGATE_DECLARATION(protocol) \
+    - (id <protocol>)delegate; \
+    - (void)setDelegate:(id <protocol>)newDelegate;
+    #define SUBCLASS_DELEGATE_DEFINITION(protocol) \
+    - (id <protocol>)delegate { return (id <protocol>)[super delegate]; } \
+    - (void)setDelegate:(id <protocol>)newDelegate { [super 
setDelegate:newDelegate]; }
+    #define SUBCLASS_DATASOURCE_DECLARATION(protocol) \
+    - (id <protocol>)dataSource; \
+    - (void)setDataSource:(id <protocol>)newDataSource;
+    #define SUBCLASS_DATASOURCE_DEFINITION(protocol) \
+    - (id <protocol>)dataSource { return (id <protocol>)[super dataSource]; } \
+    - (void)setDataSource:(id <protocol>)newDataSource { [super 
setDataSource:newDataSource]; }
+    
+    #else
+    
+    #define SUBCLASS_DELEGATE_DECLARATION(protocol)
+    #define SUBCLASS_DELEGATE_DEFINITION(protocol)
+    #define SUBCLASS_DATASOURCE_DECLARATION(protocol)
+    #define SUBCLASS_DATASOURCE_DEFINITION(protocol)
+    
+    #endif
 
 #else
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to