Revision: 3854
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3854&view=rev
Author:   hofman
Date:     2008-05-06 05:43:51 -0700 (Tue, 06 May 2008)

Log Message:
-----------
Rename files.

Modified Paths:
--------------
    trunk/CIImage_BDSKExtensions.m
    trunk/NSCell_SKExtensions.m
    trunk/NSScrollView_SKExtensions.m
    trunk/NSURL_SKExtensions.m
    trunk/PDFAnnotation_SKExtensions.m
    trunk/PDFDisplayView_SKExtensions.m
    trunk/PDFDocument_SKExtensions.m
    trunk/PDFPage_SKExtensions.m
    trunk/SKApplicationController.m
    trunk/SKBookmark.m
    trunk/SKBookmarkController.m
    trunk/SKColorSwatch.m
    trunk/SKDocumentController.m
    trunk/SKFindTableView.m
    trunk/SKFontWell.m
    trunk/SKInfoWindowController.m
    trunk/SKLineWell.m
    trunk/SKMainWindowController.m
    trunk/SKPDFView.m
    trunk/SKSnapshotPageCell.m
    trunk/SKTemplateParser.m
    trunk/SKThumbnailTableView.m
    trunk/SKTypeSelectHelper.m
    trunk/Skim.xcodeproj/project.pbxproj

Added Paths:
-----------
    trunk/SKUtilities.h
    trunk/SKUtilities.m

Removed Paths:
-------------
    trunk/OBUtilities.h
    trunk/OBUtilities.m

Modified: trunk/CIImage_BDSKExtensions.m
===================================================================
--- trunk/CIImage_BDSKExtensions.m      2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/CIImage_BDSKExtensions.m      2008-05-06 12:43:51 UTC (rev 3854)
@@ -37,7 +37,7 @@
  */
 
 #import "CIImage_BDSKExtensions.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 
 
 @implementation CIImage (BDSKExtensions)

Modified: trunk/NSCell_SKExtensions.m
===================================================================
--- trunk/NSCell_SKExtensions.m 2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/NSCell_SKExtensions.m 2008-05-06 12:43:51 UTC (rev 3854)
@@ -39,7 +39,7 @@
  */
 
 #import "NSCell_SKExtensions.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 #import "SKPDFView.h"
 
 

Modified: trunk/NSScrollView_SKExtensions.m
===================================================================
--- trunk/NSScrollView_SKExtensions.m   2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/NSScrollView_SKExtensions.m   2008-05-06 12:43:51 UTC (rev 3854)
@@ -37,7 +37,7 @@
  */
 
 #import "NSScrollView_SKExtensions.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 #import "BDSKEdgeView.h"
 
 

Modified: trunk/NSURL_SKExtensions.m
===================================================================
--- trunk/NSURL_SKExtensions.m  2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/NSURL_SKExtensions.m  2008-05-06 12:43:51 UTC (rev 3854)
@@ -37,7 +37,7 @@
  */
 
 #import "NSURL_SKExtensions.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 
 NSString *SKWeblocFilePboardType = @"CorePasteboardFlavorType 0x75726C20";
 

Deleted: trunk/OBUtilities.h
===================================================================
--- trunk/OBUtilities.h 2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/OBUtilities.h 2008-05-06 12:43:51 UTC (rev 3854)
@@ -1,31 +0,0 @@
-//
-//  OBUtilities.h
-//  Skim
-//
-//  Created by Christiaan Hofman on 2/15/07.
-
-/* Some of the following functions are inspired by OmniBase/OBUtilities.h and 
subject to the following copyright */
-
-// Copyright 1997-2008 Omni Development, Inc.  All rights reserved.
-//
-// This software may only be used and reproduced according to the
-// terms in the file OmniSourceLicense.html, which should be
-// distributed with this project and can also be found at
-// <http://www.omnigroup.com/developer/sourcecode/sourcelicense/>.
-
-#import <objc/objc.h>
-#import <objc/objc-class.h>
-#import <objc/objc-runtime.h>
-
-IMP SKReplaceMethodImplementation(Class aClass, SEL aSelector, IMP anImp);
-IMP SKReplaceMethodImplementationWithSelector(Class aClass, SEL aSelector, SEL 
impSelector);
-void SKAddMethodImplementationWithSelector(Class aClass, SEL aSelector, SEL 
impSelector);
-
-#define OBINITIALIZE \
-    do { \
-        static BOOL hasBeenInitialized = NO; \
-        [super initialize]; \
-        if (hasBeenInitialized) \
-            return; \
-        hasBeenInitialized = YES;\
-    } while (0);

Deleted: trunk/OBUtilities.m
===================================================================
--- trunk/OBUtilities.m 2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/OBUtilities.m 2008-05-06 12:43:51 UTC (rev 3854)
@@ -1,103 +0,0 @@
-//
-//  OBUtilities.m
-//  Skim
-//
-//  Created by Christiaan Hofman on 2/15/07.
-
-/* Some of the following functions are inspired by OmniBase/OBUtilities.h and 
subject to the following copyright */
-
-// Copyright 1997-2008 Omni Development, Inc.  All rights reserved.
-//
-// This software may only be used and reproduced according to the
-// terms in the file OmniSourceLicense.html, which should be
-// distributed with this project and can also be found at
-// <http://www.omnigroup.com/developer/sourcecode/sourcelicense/>.
-
-#import "OBUtilities.h"
-#import <Foundation/Foundation.h>
-
-
-// wrappers around 10.5 only functions, use 10.4 API when the function is not 
defined
-
-static IMP SK_method_getImplementation(Method aMethod)
-{
-    return method_getImplementation != NULL ? 
method_getImplementation(aMethod) : aMethod->method_imp;
-} 
-
-static IMP SK_method_setImplementation(Method aMethod, IMP anImp)
-{
-    if (method_setImplementation != NULL) {
-        return method_setImplementation(aMethod, anImp);
-    } else {
-        IMP oldImp = aMethod->method_imp;
-        aMethod->method_imp = anImp;
-        return oldImp;
-    }
-} 
-
-static const char *SK_method_getTypeEncoding(Method aMethod)
-{
-    return method_getTypeEncoding != NULL ? method_getTypeEncoding(aMethod) : 
aMethod->method_types;
-}
-
-static Class SK_class_getSuperclass(Class aClass)
-{
-    return class_getSuperclass != NULL ? class_getSuperclass(aClass) : 
aClass->super_class;
-}
-
-static void SK_class_addMethod(Class aClass, SEL selector, IMP methodImp, 
const char *methodTypes)
-{
-    if (class_addMethod != NULL) {
-        class_addMethod(aClass, selector, methodImp, methodTypes);
-    } else {
-        struct objc_method_list *newMethodList;
-        
-        newMethodList = (struct objc_method_list *) 
NSZoneMalloc(NSDefaultMallocZone(), sizeof(struct objc_method_list));
-        
-        newMethodList->method_count = 1;
-        newMethodList->method_list[0].method_name = selector;
-        newMethodList->method_list[0].method_imp = methodImp;
-        newMethodList->method_list[0].method_types = (char *)methodTypes;
-        
-        class_addMethods(aClass, newMethodList);
-    }
-}
-
-IMP SKReplaceMethodImplementation(Class aClass, SEL aSelector, IMP anImp)
-{
-    Method localMethod, superMethod = NULL;
-    IMP oldImp = NULL;
-    Class superCls = Nil;
-    extern void _objc_flush_caches(Class);
-    
-    if ((localMethod = class_getInstanceMethod(aClass, aSelector))) {
-        if (superCls = SK_class_getSuperclass(aClass))
-            superMethod = class_getInstanceMethod(superCls, aSelector);
-        
-        if (superMethod == localMethod) {
-            // We are inheriting this method from the superclass.  We do *not* 
want to clobber the superclass's Method structure as that would replace the 
implementation on a greater scope than the caller wanted.  In this case, 
install a new method at this class and return the superclass's implementation 
as the old implementation (which it is).
-            oldImp = SK_method_getImplementation(localMethod);
-            SK_class_addMethod(aClass, aSelector, anImp, 
SK_method_getTypeEncoding(localMethod));
-        } else {
-            // Replace the method in place
-            oldImp = SK_method_setImplementation(localMethod, anImp);
-        }
-        
-        // Flush the method cache, deprecated on 10.5
-        if (_objc_flush_caches != NULL)
-            _objc_flush_caches(aClass);
-    }
-    
-    return oldImp;
-}
-
-IMP SKReplaceMethodImplementationWithSelector(Class aClass, SEL aSelector, SEL 
impSelector)
-{
-    return SKReplaceMethodImplementation(aClass, aSelector, 
SK_method_getImplementation(class_getInstanceMethod(aClass, impSelector)));
-}
-
-void SKAddMethodImplementationWithSelector(Class aClass, SEL aSelector, SEL 
impSelector)
-{
-    Method method = class_getInstanceMethod(aClass, impSelector);
-    SK_class_addMethod(aClass, aSelector, SK_method_getImplementation(method), 
SK_method_getTypeEncoding(method));
-}

Modified: trunk/PDFAnnotation_SKExtensions.m
===================================================================
--- trunk/PDFAnnotation_SKExtensions.m  2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/PDFAnnotation_SKExtensions.m  2008-05-06 12:43:51 UTC (rev 3854)
@@ -51,7 +51,7 @@
 #import "SKPDFView.h"
 #import "NSGeometry_SKExtensions.h"
 #import "NSString_SKExtensions.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 
 
 unsigned long SKScriptingBorderStyleFromBorderStyle(int borderStyle) {

Modified: trunk/PDFDisplayView_SKExtensions.m
===================================================================
--- trunk/PDFDisplayView_SKExtensions.m 2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/PDFDisplayView_SKExtensions.m 2008-05-06 12:43:51 UTC (rev 3854)
@@ -41,7 +41,7 @@
 #import "PDFAnnotation_SKExtensions.h"
 #import "SKPDFDocument.h"
 #import "SKStringConstants.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 
 @interface PDFDisplayView : NSView
 - (void)passwordEntered:(id)sender;

Modified: trunk/PDFDocument_SKExtensions.m
===================================================================
--- trunk/PDFDocument_SKExtensions.m    2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/PDFDocument_SKExtensions.m    2008-05-06 12:43:51 UTC (rev 3854)
@@ -38,7 +38,7 @@
 
 #import "PDFDocument_SKExtensions.h"
 #import "PDFSelection_SKExtensions.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 
 
 @interface PDFDocument (SKPrivateDeclarations)

Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m        2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/PDFPage_SKExtensions.m        2008-05-06 12:43:51 UTC (rev 3854)
@@ -41,7 +41,7 @@
 #import "SKPDFDocument.h"
 #import "SKPDFView.h"
 #import "PDFSelection_SKExtensions.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 #import "NSBitmapImageRep_SKExtensions.h"
 #import "SKStringConstants.h"
 #import "NSCharacterSet_SKExtensions.h"

Modified: trunk/SKApplicationController.m
===================================================================
--- trunk/SKApplicationController.m     2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/SKApplicationController.m     2008-05-06 12:43:51 UTC (rev 3854)
@@ -64,7 +64,7 @@
 #import "Files_SKExtensions.h"
 #import "NSTask_SKExtensions.h"
 #import "NSView_SKExtensions.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 #import "PDFAnnotation_SKExtensions.h"
 #import "SKPDFAnnotationLine.h"
 #import "SKPDFAnnotationNote.h"

Modified: trunk/SKBookmark.m
===================================================================
--- trunk/SKBookmark.m  2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/SKBookmark.m  2008-05-06 12:43:51 UTC (rev 3854)
@@ -40,7 +40,7 @@
 #import "SKBookmarkController.h"
 #import "BDAlias.h"
 #import "NSImage_SKExtensions.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 
 NSString *SKBookmarkChangedNotification = @"SKBookmarkChangedNotification";
 NSString *SKBookmarkWillBeRemovedNotification = 
@"SKBookmarkWillBeRemovedNotification";

Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m        2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/SKBookmarkController.m        2008-05-06 12:43:51 UTC (rev 3854)
@@ -49,7 +49,7 @@
 #import "SKToolbarItem.h"
 #import "NSImage_SKExtensions.h"
 #import "SKStringConstants.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 #import "NSUserDefaultsController_SKExtensions.h"
 
 static NSString *SKBookmarkRowsPboardType = @"SKBookmarkRowsPboardType";

Modified: trunk/SKColorSwatch.m
===================================================================
--- trunk/SKColorSwatch.m       2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/SKColorSwatch.m       2008-05-06 12:43:51 UTC (rev 3854)
@@ -37,7 +37,7 @@
  */
 
 #import "SKColorSwatch.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 #import <Carbon/Carbon.h>
 
 NSString *SKColorSwatchColorsChangedNotification = 
@"SKColorSwatchColorsChangedNotification";

Modified: trunk/SKDocumentController.m
===================================================================
--- trunk/SKDocumentController.m        2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/SKDocumentController.m        2008-05-06 12:43:51 UTC (rev 3854)
@@ -42,7 +42,7 @@
 #import "NSString_SKExtensions.h"
 #import "NSURL_SKExtensions.h"
 #import "SKStringConstants.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 
 // See CFBundleTypeName in Info.plist
 static NSString *SKPDFDocumentTypeName = nil; /* set to NSPDFPboardType, not 
@"NSPDFPboardType" */

Modified: trunk/SKFindTableView.m
===================================================================
--- trunk/SKFindTableView.m     2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/SKFindTableView.m     2008-05-06 12:43:51 UTC (rev 3854)
@@ -38,7 +38,7 @@
 
 #import "SKFindTableView.h"
 #import "SKStringConstants.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 
 
 @implementation SKFindTableView

Modified: trunk/SKFontWell.m
===================================================================
--- trunk/SKFontWell.m  2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/SKFontWell.m  2008-05-06 12:43:51 UTC (rev 3854)
@@ -37,7 +37,7 @@
  */
 
 #import "SKFontWell.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 
 static NSString *SKNSFontPanelDescriptorsPboardType = 
@"NSFontPanelDescriptorsPboardType";
 static NSString *SKNSFontPanelFamiliesPboardType = 
@"NSFontPanelFamiliesPboardType";

Modified: trunk/SKInfoWindowController.m
===================================================================
--- trunk/SKInfoWindowController.m      2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/SKInfoWindowController.m      2008-05-06 12:43:51 UTC (rev 3854)
@@ -39,7 +39,7 @@
 #import "SKInfoWindowController.h"
 #import "SKPDFDocument.h"
 #import <Quartz/Quartz.h>
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 
 static NSString *SKInfoWindowFrameAutosaveName = @"SKInfoWindow";
 

Modified: trunk/SKLineWell.m
===================================================================
--- trunk/SKLineWell.m  2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/SKLineWell.m  2008-05-06 12:43:51 UTC (rev 3854)
@@ -38,7 +38,7 @@
 
 #import "SKLineWell.h"
 #import "SKLineInspector.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 
 NSString *SKLineStylePboardType = @"SKLineStylePboardType";
 

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/SKMainWindowController.m      2008-05-06 12:43:51 UTC (rev 3854)
@@ -88,7 +88,7 @@
 #import "SKSecondaryPDFView.h"
 #import "SKSheetController.h"
 #import "SKColorSwatch.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 #import "SKApplicationController.h"
 #import "SKCFCallbacks.h"
 #import "NSSegmentedControl_SKExtensions.h"

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/SKPDFView.m   2008-05-06 12:43:51 UTC (rev 3854)
@@ -63,7 +63,7 @@
 #import <Carbon/Carbon.h>
 #import "NSGeometry_SKExtensions.h"
 #import "SKTypeSelectHelper.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 #import "NSAffineTransform_SKExtensions.h"
 #import "BDSKEdgeView.h"
 #import "PDFDocument_SKExtensions.h"

Modified: trunk/SKSnapshotPageCell.m
===================================================================
--- trunk/SKSnapshotPageCell.m  2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/SKSnapshotPageCell.m  2008-05-06 12:43:51 UTC (rev 3854)
@@ -37,7 +37,7 @@
  */
 
 #import "SKSnapshotPageCell.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 
 NSString *SKSnapshotPageCellLabelKey = @"label";
 NSString *SKSnapshotPageCellHasWindowKey = @"hasWindow";

Modified: trunk/SKTemplateParser.m
===================================================================
--- trunk/SKTemplateParser.m    2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/SKTemplateParser.m    2008-05-06 12:43:51 UTC (rev 3854)
@@ -40,7 +40,7 @@
 #import "NSCharacterSet_SKExtensions.h"
 #import "NSString_SKExtensions.h"
 #import "SKTag.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 
 #define START_TAG_OPEN_DELIM            @"<$"
 #define END_TAG_OPEN_DELIM              @"</$"

Modified: trunk/SKThumbnailTableView.m
===================================================================
--- trunk/SKThumbnailTableView.m        2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/SKThumbnailTableView.m        2008-05-06 12:43:51 UTC (rev 3854)
@@ -37,7 +37,7 @@
  */
 
 #import "SKThumbnailTableView.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 #import "SKTypeSelectHelper.h"
 #import "NSColor_SKExtensions.h"
 

Modified: trunk/SKTypeSelectHelper.m
===================================================================
--- trunk/SKTypeSelectHelper.m  2008-05-06 12:39:53 UTC (rev 3853)
+++ trunk/SKTypeSelectHelper.m  2008-05-06 12:43:51 UTC (rev 3854)
@@ -37,7 +37,7 @@
  */
 
 #import "SKTypeSelectHelper.h"
-#import "OBUtilities.h"
+#import "SKUtilities.h"
 
 static NSString *SKWindowDidChangeFirstResponderNotification = 
@"SKWindowDidChangeFirstResponderNotification";
 

Copied: trunk/SKUtilities.h (from rev 3853, trunk/OBUtilities.h)
===================================================================
--- trunk/SKUtilities.h                         (rev 0)
+++ trunk/SKUtilities.h 2008-05-06 12:43:51 UTC (rev 3854)
@@ -0,0 +1,31 @@
+//
+//  SKUtilities.h
+//  Skim
+//
+//  Created by Christiaan Hofman on 2/15/07.
+
+/* Some of the following functions are inspired by OmniBase/SKUtilities.h and 
subject to the following copyright */
+
+// Copyright 1997-2008 Omni Development, Inc.  All rights reserved.
+//
+// This software may only be used and reproduced according to the
+// terms in the file OmniSourceLicense.html, which should be
+// distributed with this project and can also be found at
+// <http://www.omnigroup.com/developer/sourcecode/sourcelicense/>.
+
+#import <objc/objc.h>
+#import <objc/objc-class.h>
+#import <objc/objc-runtime.h>
+
+IMP SKReplaceMethodImplementation(Class aClass, SEL aSelector, IMP anImp);
+IMP SKReplaceMethodImplementationWithSelector(Class aClass, SEL aSelector, SEL 
impSelector);
+void SKAddMethodImplementationWithSelector(Class aClass, SEL aSelector, SEL 
impSelector);
+
+#define OBINITIALIZE \
+    do { \
+        static BOOL hasBeenInitialized = NO; \
+        [super initialize]; \
+        if (hasBeenInitialized) \
+            return; \
+        hasBeenInitialized = YES;\
+    } while (0);

Copied: trunk/SKUtilities.m (from rev 3853, trunk/OBUtilities.m)
===================================================================
--- trunk/SKUtilities.m                         (rev 0)
+++ trunk/SKUtilities.m 2008-05-06 12:43:51 UTC (rev 3854)
@@ -0,0 +1,103 @@
+//
+//  SKUtilities.m
+//  Skim
+//
+//  Created by Christiaan Hofman on 2/15/07.
+
+/* Some of the following functions are inspired by OmniBase/SKUtilities.h and 
subject to the following copyright */
+
+// Copyright 1997-2008 Omni Development, Inc.  All rights reserved.
+//
+// This software may only be used and reproduced according to the
+// terms in the file OmniSourceLicense.html, which should be
+// distributed with this project and can also be found at
+// <http://www.omnigroup.com/developer/sourcecode/sourcelicense/>.
+
+#import "SKUtilities.h"
+#import <Foundation/Foundation.h>
+
+
+// wrappers around 10.5 only functions, use 10.4 API when the function is not 
defined
+
+static IMP SK_method_getImplementation(Method aMethod)
+{
+    return method_getImplementation != NULL ? 
method_getImplementation(aMethod) : aMethod->method_imp;
+} 
+
+static IMP SK_method_setImplementation(Method aMethod, IMP anImp)
+{
+    if (method_setImplementation != NULL) {
+        return method_setImplementation(aMethod, anImp);
+    } else {
+        IMP oldImp = aMethod->method_imp;
+        aMethod->method_imp = anImp;
+        return oldImp;
+    }
+} 
+
+static const char *SK_method_getTypeEncoding(Method aMethod)
+{
+    return method_getTypeEncoding != NULL ? method_getTypeEncoding(aMethod) : 
aMethod->method_types;
+}
+
+static Class SK_class_getSuperclass(Class aClass)
+{
+    return class_getSuperclass != NULL ? class_getSuperclass(aClass) : 
aClass->super_class;
+}
+
+static void SK_class_addMethod(Class aClass, SEL selector, IMP methodImp, 
const char *methodTypes)
+{
+    if (class_addMethod != NULL) {
+        class_addMethod(aClass, selector, methodImp, methodTypes);
+    } else {
+        struct objc_method_list *newMethodList;
+        
+        newMethodList = (struct objc_method_list *) 
NSZoneMalloc(NSDefaultMallocZone(), sizeof(struct objc_method_list));
+        
+        newMethodList->method_count = 1;
+        newMethodList->method_list[0].method_name = selector;
+        newMethodList->method_list[0].method_imp = methodImp;
+        newMethodList->method_list[0].method_types = (char *)methodTypes;
+        
+        class_addMethods(aClass, newMethodList);
+    }
+}
+
+IMP SKReplaceMethodImplementation(Class aClass, SEL aSelector, IMP anImp)
+{
+    Method localMethod, superMethod = NULL;
+    IMP oldImp = NULL;
+    Class superCls = Nil;
+    extern void _objc_flush_caches(Class);
+    
+    if ((localMethod = class_getInstanceMethod(aClass, aSelector))) {
+        if (superCls = SK_class_getSuperclass(aClass))
+            superMethod = class_getInstanceMethod(superCls, aSelector);
+        
+        if (superMethod == localMethod) {
+            // We are inheriting this method from the superclass.  We do *not* 
want to clobber the superclass's Method structure as that would replace the 
implementation on a greater scope than the caller wanted.  In this case, 
install a new method at this class and return the superclass's implementation 
as the old implementation (which it is).
+            oldImp = SK_method_getImplementation(localMethod);
+            SK_class_addMethod(aClass, aSelector, anImp, 
SK_method_getTypeEncoding(localMethod));
+        } else {
+            // Replace the method in place
+            oldImp = SK_method_setImplementation(localMethod, anImp);
+        }
+        
+        // Flush the method cache, deprecated on 10.5
+        if (_objc_flush_caches != NULL)
+            _objc_flush_caches(aClass);
+    }
+    
+    return oldImp;
+}
+
+IMP SKReplaceMethodImplementationWithSelector(Class aClass, SEL aSelector, SEL 
impSelector)
+{
+    return SKReplaceMethodImplementation(aClass, aSelector, 
SK_method_getImplementation(class_getInstanceMethod(aClass, impSelector)));
+}
+
+void SKAddMethodImplementationWithSelector(Class aClass, SEL aSelector, SEL 
impSelector)
+{
+    Method method = class_getInstanceMethod(aClass, impSelector);
+    SK_class_addMethod(aClass, aSelector, SK_method_getImplementation(method), 
SK_method_getTypeEncoding(method));
+}

Modified: trunk/Skim.xcodeproj/project.pbxproj
===================================================================
--- trunk/Skim.xcodeproj/project.pbxproj        2008-05-06 12:39:53 UTC (rev 
3853)
+++ trunk/Skim.xcodeproj/project.pbxproj        2008-05-06 12:43:51 UTC (rev 
3854)
@@ -39,7 +39,7 @@
                8D15AC320486D014006FF6A4 /* main.m in Sources */ = {isa = 
PBXBuildFile; fileRef = 2A37F4B0FDCFA73011CA2CEA /* main.m */; settings = 
{ATTRIBUTES = (); }; };
                8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */ = 
{isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; 
};
                CE0463CB0B84D24300C11E4A /* SKApplication.m in Sources */ = 
{isa = PBXBuildFile; fileRef = CE0463CA0B84D24300C11E4A /* SKApplication.m */; 
};
-               CE0464A20B84E3E400C11E4A /* OBUtilities.m in Sources */ = {isa 
= PBXBuildFile; fileRef = CE0464A10B84E3E400C11E4A /* OBUtilities.m */; };
+               CE0464A20B84E3E400C11E4A /* SKUtilities.m in Sources */ = {isa 
= PBXBuildFile; fileRef = CE0464A10B84E3E400C11E4A /* SKUtilities.m */; };
                CE070EA20B89039700733CC8 /* NSScrollView_SKExtensions.m in 
Sources */ = {isa = PBXBuildFile; fileRef = CE070EA10B89039700733CC8 /* 
NSScrollView_SKExtensions.m */; };
                CE0710170B89BDD600733CC8 /* BDSKCollapsibleView.m in Sources */ 
= {isa = PBXBuildFile; fileRef = CE0710120B89BDD600733CC8 /* 
BDSKCollapsibleView.m */; };
                CE0710180B89BDD600733CC8 /* BDSKContainerView.m in Sources */ = 
{isa = PBXBuildFile; fileRef = CE0710140B89BDD600733CC8 /* BDSKContainerView.m 
*/; };
@@ -408,8 +408,8 @@
                A489FE240BC8E97800BA14DD /* Italian */ = {isa = 
PBXFileReference; lastKnownFileType = folder; name = Italian; path = 
"Italian.lproj/Skim Help"; sourceTree = "<group>"; };
                CE0463C90B84D24300C11E4A /* SKApplication.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SKApplication.h; sourceTree = "<group>"; };
                CE0463CA0B84D24300C11E4A /* SKApplication.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= SKApplication.m; sourceTree = "<group>"; };
-               CE0464A00B84E3E400C11E4A /* OBUtilities.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
OBUtilities.h; sourceTree = "<group>"; };
-               CE0464A10B84E3E400C11E4A /* OBUtilities.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= OBUtilities.m; sourceTree = "<group>"; };
+               CE0464A00B84E3E400C11E4A /* SKUtilities.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SKUtilities.h; sourceTree = "<group>"; };
+               CE0464A10B84E3E400C11E4A /* SKUtilities.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= SKUtilities.m; sourceTree = "<group>"; };
                CE070EA00B89039700733CC8 /* NSScrollView_SKExtensions.h */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
path = NSScrollView_SKExtensions.h; sourceTree = "<group>"; };
                CE070EA10B89039700733CC8 /* NSScrollView_SKExtensions.m */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.objc; path = NSScrollView_SKExtensions.m; sourceTree = "<group>"; 
};
                CE0710110B89BDD600733CC8 /* BDSKCollapsibleView.h */ = {isa = 
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = 
BDSKCollapsibleView.h; sourceTree = "<group>"; };
@@ -1324,8 +1324,8 @@
                                CE64E8A20D92E670000AD050 /* SKCFCallBacks.m */,
                                45A3BD060B4F0770002B297F /* SKStringConstants.h 
*/,
                                45A3BD070B4F0770002B297F /* SKStringConstants.m 
*/,
-                               CE0464A00B84E3E400C11E4A /* OBUtilities.h */,
-                               CE0464A10B84E3E400C11E4A /* OBUtilities.m */,
+                               CE0464A00B84E3E400C11E4A /* SKUtilities.h */,
+                               CE0464A10B84E3E400C11E4A /* SKUtilities.m */,
                                CE5BD6710C7ADF1500EBDCF7 /* 
SKTypeSelectHelper.h */,
                                CE5BD6720C7ADF1500EBDCF7 /* 
SKTypeSelectHelper.m */,
                                CEE54F8E0DA3FE9A0037169F /* 
SKUnarchiveFromDataArrayTransformer.h */,
@@ -1953,7 +1953,7 @@
                                CE38ECD30B8093B200A1B779 /* 
NSString_SKExtensions.m in Sources */,
                                F9CDD67B0B837A7F006363C3 /* 
SKPreferenceController.m in Sources */,
                                CE0463CB0B84D24300C11E4A /* SKApplication.m in 
Sources */,
-                               CE0464A20B84E3E400C11E4A /* OBUtilities.m in 
Sources */,
+                               CE0464A20B84E3E400C11E4A /* SKUtilities.m in 
Sources */,
                                CE2DE4920B85D48F00D0DA12 /* SKThumbnail.m in 
Sources */,
                                CE2DE49D0B85D4F400D0DA12 /* 
SKFullScreenWindow.m in Sources */,
                                CE2DE4C60B85D78200D0DA12 /* 
SKMiniaturizeWindow.m in Sources */,


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

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to