Revision: 14747
          http://sourceforge.net/p/skim-app/code/14747
Author:   hofman
Date:     2024-11-26 16:46:00 +0000 (Tue, 26 Nov 2024)
Log Message:
-----------
rename global variables for document types

Modified Paths:
--------------
    trunk/Base.lproj/PrintAccessoryView.xib
    trunk/NSDocument_SKExtensions.m
    trunk/SKBookmark.m
    trunk/SKBookmarkController.m
    trunk/SKConversionProgressController.m
    trunk/SKDocumentController.h
    trunk/SKDocumentController.m
    trunk/SKMainDocument.m
    trunk/SKMainWindowController.m
    trunk/SKMainWindowController_UI.m
    trunk/SKNotesDocument.m
    trunk/SKPrintAccessoryController.m
    trunk/SKTemplateManager.m

Modified: trunk/Base.lproj/PrintAccessoryView.xib
===================================================================
--- trunk/Base.lproj/PrintAccessoryView.xib     2024-11-26 09:55:52 UTC (rev 
14746)
+++ trunk/Base.lproj/PrintAccessoryView.xib     2024-11-26 16:46:00 UTC (rev 
14747)
@@ -1,9 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="16097.3" targetRuntime="MacOSX.Cocoa" 
propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
     <dependencies>
         <deployment identifier="macosx"/>
-        <development version="8000" identifier="xcode"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="16097.3"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="19529"/>
         <capability name="documents saved in the Xcode 8 format" 
minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -15,10 +14,10 @@
         <customObject id="-1" userLabel="First Responder" 
customClass="FirstResponder"/>
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <customView translatesAutoresizingMaskIntoConstraints="NO" id="23" 
userLabel="View">
-            <rect key="frame" x="0.0" y="0.0" width="254" height="122"/>
+            <rect key="frame" x="0.0" y="0.0" width="254" height="124"/>
             <subviews>
                 <button autoresizesSubviews="NO" verticalHuggingPriority="750" 
imageHugsTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="24">
-                    <rect key="frame" x="18" y="86" width="210" height="18"/>
+                    <rect key="frame" x="18" y="87" width="214" height="18"/>
                     <buttonCell key="cell" type="check" title="Automatically 
rotate each page" bezelStyle="regularSquare" imagePosition="left" 
alignment="left" inset="2" id="35">
                         <behavior key="behavior" changeContents="YES" 
doesNotDimImage="YES" lightByContents="YES"/>
                         <font key="font" metaFont="system"/>
@@ -28,7 +27,7 @@
                     </connections>
                 </button>
                 <button verticalHuggingPriority="750" 
translatesAutoresizingMaskIntoConstraints="NO" id="x7f-3x-hY9">
-                    <rect key="frame" x="19" y="63" width="183" height="18"/>
+                    <rect key="frame" x="18" y="63" width="187" height="18"/>
                     <buttonCell key="cell" type="radio" title="No automatic 
page scaling" bezelStyle="regularSquare" imagePosition="left" alignment="left" 
inset="2" id="i4V-l6-yNe">
                         <behavior key="behavior" changeContents="YES" 
doesNotDimImage="YES" lightByContents="YES"/>
                         <font key="font" metaFont="system"/>
@@ -42,7 +41,7 @@
                     </connections>
                 </button>
                 <button verticalHuggingPriority="750" 
translatesAutoresizingMaskIntoConstraints="NO" id="sQ3-58-dVf">
-                    <rect key="frame" x="19" y="41" width="193" height="18"/>
+                    <rect key="frame" x="18" y="41" width="196" height="18"/>
                     <buttonCell key="cell" type="radio" title="Scale each page 
to fit paper" bezelStyle="regularSquare" imagePosition="left" alignment="left" 
inset="2" id="ENf-WO-mFk">
                         <behavior key="behavior" changeContents="YES" 
doesNotDimImage="YES" lightByContents="YES"/>
                         <font key="font" metaFont="system"/>
@@ -56,7 +55,7 @@
                     </connections>
                 </button>
                 <button verticalHuggingPriority="750" 
translatesAutoresizingMaskIntoConstraints="NO" id="cVD-ka-kpE">
-                    <rect key="frame" x="19" y="19" width="196" height="18"/>
+                    <rect key="frame" x="18" y="19" width="200" height="18"/>
                     <buttonCell key="cell" type="radio" title="Only scale down 
large pages" bezelStyle="regularSquare" imagePosition="left" alignment="left" 
inset="2" id="jf0-KC-VTv">
                         <behavior key="behavior" changeContents="YES" 
doesNotDimImage="YES" lightByContents="YES"/>
                         <font key="font" metaFont="system"/>

Modified: trunk/NSDocument_SKExtensions.m
===================================================================
--- trunk/NSDocument_SKExtensions.m     2024-11-26 09:55:52 UTC (rev 14746)
+++ trunk/NSDocument_SKExtensions.m     2024-11-26 16:46:00 UTC (rev 14747)
@@ -278,11 +278,11 @@
 }
 
 - (NSString *)notesString {
-    return [self notesStringForTemplateType:SKNotesTextDocumentType];
+    return [self notesStringForTemplateType:SKDocumentTypeNotesText];
 }
 
 - (NSData *)notesRTFData {
-    return [self notesDataForTemplateType:SKNotesRTFDocumentType];
+    return [self notesDataForTemplateType:SKDocumentTypeNotesRTF];
 }
 
 - (NSData *)notesFDFDataForFile:(NSString *)filename fileIDStrings:(NSArray 
*)fileIDStrings {

Modified: trunk/SKBookmark.m
===================================================================
--- trunk/SKBookmark.m  2024-11-26 09:55:52 UTC (rev 14746)
+++ trunk/SKBookmark.m  2024-11-26 16:46:00 UTC (rev 14747)
@@ -126,7 +126,7 @@
         SKBookmark *bookmark;
         NSString *label = nil;
         [url getResourceValue:&label forKey:NSURLLocalizedNameKey error:NULL];
-        if ([[NSWorkspace sharedWorkspace] type:fileType 
conformsToType:SKFolderDocumentType]) {
+        if ([[NSWorkspace sharedWorkspace] type:fileType 
conformsToType:SKDocumentTypeFolder]) {
             NSArray *children = [self bookmarksForURLs:[fm 
contentsOfDirectoryAtURL:url includingPropertiesForKeys:@[] 
options:NSDirectoryEnumerationSkipsHiddenFiles error:NULL]];
             if ([children count] && (bookmark = [[self alloc] 
initFolderWithChildren:children label:label])) {
                 [array addObject:bookmark];

Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m        2024-11-26 09:55:52 UTC (rev 14746)
+++ trunk/SKBookmarkController.m        2024-11-26 16:46:00 UTC (rev 14747)
@@ -560,7 +560,7 @@
     SKBookmark *bm = [[self clickedBookmarks] firstObject];
     NSURL *oldURL = [bm fileURL];
     NSOpenPanel *oPanel = [NSOpenPanel openPanel];
-    [oPanel setAllowedFileTypes:@[SKPDFDocumentType, SKPDFBundleDocumentType, 
SKPostScriptDocumentType, SKEncapsulatedPostScriptDocumentType, 
SKDVIDocumentType, SKXDVDocumentType, SKNotesDocumentType]];
+    [oPanel setAllowedFileTypes:@[SKDocumentTypePDF, SKDocumentTypePDFBundle, 
SKDocumentTypePostScript, SKDocumentTypeEncapsulatedPostScript, 
SKDocumentTypeDVI, SKDocumentTypeXDV, SKDocumentTypeNotes]];
     if (oldURL)
         [oPanel setDirectoryURL:[oldURL URLByDeletingLastPathComponent]];
     [oPanel beginSheetModalForWindow:[self window] 
completionHandler:^(NSModalResponse result){

Modified: trunk/SKConversionProgressController.m
===================================================================
--- trunk/SKConversionProgressController.m      2024-11-26 09:55:52 UTC (rev 
14746)
+++ trunk/SKConversionProgressController.m      2024-11-26 16:46:00 UTC (rev 
14747)
@@ -113,7 +113,7 @@
 }
 
 + (NSData *)newPDFDataWithPostScriptData:(NSData *)psData error:(NSError 
**)outError {
-    return [[[self alloc] init] newPDFDataFromURL:nil orData:psData 
ofType:SKPostScriptDocumentType error:outError];
+    return [[[self alloc] init] newPDFDataFromURL:nil orData:psData 
ofType:SKDocumentTypePostScript error:outError];
 }
 
 - (void)dealloc {
@@ -225,14 +225,14 @@
     NSString *toolPath = [toolPaths objectForKey:fileType];
     if (toolPath == nil) {
         NSWorkspace *ws = [NSWorkspace sharedWorkspace];
-        if ([ws type:fileType conformsToType:SKDVIDocumentType]) {
+        if ([ws type:fileType conformsToType:SKDocumentTypeDVI]) {
             if (@available(macOS 14.0, *))
                 toolPath = toolPathForCommand(SKDviConversionCommandKey, 
@[@"dvipdfmx", @"dvipdfm", @"dvipdf"]);
             else
                 toolPath = toolPathForCommand(SKDviConversionCommandKey, 
@[@"dvipdfmx", @"dvipdfm", @"dvipdf", @"dvips"]);
-        } else if ([ws type:fileType conformsToType:SKXDVDocumentType]) {
+        } else if ([ws type:fileType conformsToType:SKDocumentTypeXDV]) {
             toolPath = toolPathForCommand(SKXdvConversionCommandKey, 
@[@"xdvipdfmx", @"dvipdfmx", @"xdv2pdf"]);
-        } else if ([ws type:fileType conformsToType:SKPostScriptDocumentType]) 
{
+        } else if ([ws type:fileType conformsToType:SKDocumentTypePostScript]) 
{
             toolPath = toolPathForCommand(SKPSConversionCommandKey, 
@[@"ps2pdf", @"ps2pdf12", @"ps2pdf13", @"ps2pdf14", @"pstopdf"]);
         }
         if (toolPath) {
@@ -271,7 +271,7 @@
     
     CGDataProviderRef provider = NULL;
     BOOL useTask = YES;
-    if (@available(macOS 14.0, *)) {} else if ([[NSWorkspace sharedWorkspace] 
type:fileType conformsToType:SKPostScriptDocumentType] && [[NSUserDefaults 
standardUserDefaults] objectForKey:SKPSConversionCommandKey] == nil)
+    if (@available(macOS 14.0, *)) {} else if ([[NSWorkspace sharedWorkspace] 
type:fileType conformsToType:SKDocumentTypePostScript] && [[NSUserDefaults 
standardUserDefaults] objectForKey:SKPSConversionCommandKey] == nil)
         useTask = NO;
     
     if (useTask) {
@@ -284,7 +284,7 @@
             NSURL *outFileURL = [tmpDirURL URLByAppendingPathComponent:[aURL 
lastPathComponentReplacingPathExtension:outputPS ? @"ps" : @"pdf"] 
isDirectory:NO];
             NSArray *arguments = nil;
             if ([commandName hasPrefix:@"ps2pdf"] && [PS_SEARCH_PATHS 
containsObject:[toolPath stringByDeletingLastPathComponent]]) {
-                if ([[NSWorkspace sharedWorkspace] type:fileType 
conformsToType:SKEncapsulatedPostScriptDocumentType])
+                if ([[NSWorkspace sharedWorkspace] type:fileType 
conformsToType:SKDocumentTypeEncapsulatedPostScript])
                     arguments = @[@"-dALLOWPSTRANSPARENCY", @"-dEPSCrop", 
[aURL path], [outFileURL path]];
                 else
                     arguments = @[@"-dALLOWPSTRANSPARENCY", [aURL path], 
[outFileURL path]];

Modified: trunk/SKDocumentController.h
===================================================================
--- trunk/SKDocumentController.h        2024-11-26 09:55:52 UTC (rev 14746)
+++ trunk/SKDocumentController.h        2024-11-26 16:46:00 UTC (rev 14747)
@@ -40,19 +40,19 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-extern NSString *SKPDFDocumentType;
-extern NSString *SKPDFBundleDocumentType;
-extern NSString *SKNotesDocumentType;
-extern NSString *SKNotesTextDocumentType;
-extern NSString *SKNotesRTFDocumentType;
-extern NSString *SKNotesRTFDDocumentType;
-extern NSString *SKNotesFDFDocumentType;
-extern NSString *SKPostScriptDocumentType;
-extern NSString *SKEncapsulatedPostScriptDocumentType;
-extern NSString *SKDVIDocumentType;
-extern NSString *SKXDVDocumentType;
-extern NSString *SKArchiveDocumentType;
-extern NSString *SKFolderDocumentType;
+extern NSString *SKDocumentTypePDF;
+extern NSString *SKDocumentTypePDFBundle;
+extern NSString *SKDocumentTypeNotes;
+extern NSString *SKDocumentTypeNotesText;
+extern NSString *SKDocumentTypeNotesRTF;
+extern NSString *SKDocumentTypeNotesRTFD;
+extern NSString *SKDocumentTypeNotesFDF;
+extern NSString *SKDocumentTypePostScript;
+extern NSString *SKDocumentTypeEncapsulatedPostScript;
+extern NSString *SKDocumentTypeDVI;
+extern NSString *SKDocumentTypeXDV;
+extern NSString *SKDocumentTypeArchive;
+extern NSString *SKDocumentTypeFolder;
 
 extern NSString *SKDocumentSetupAliasKey;
 extern NSString *SKDocumentSetupBookmarkKey;

Modified: trunk/SKDocumentController.m
===================================================================
--- trunk/SKDocumentController.m        2024-11-26 09:55:52 UTC (rev 14746)
+++ trunk/SKDocumentController.m        2024-11-26 16:46:00 UTC (rev 14747)
@@ -53,19 +53,19 @@
 
 #define SKIM_NOTES_KEY @"net_sourceforge_skim-app_notes"
 
-NSString *SKPDFDocumentType = @"com.adobe.pdf";
-NSString *SKPDFBundleDocumentType = @"net.sourceforge.skim-app.pdfd";
-NSString *SKNotesDocumentType = @"net.sourceforge.skim-app.skimnotes";
-NSString *SKNotesTextDocumentType = @"public.plain-text";
-NSString *SKNotesRTFDocumentType = @"public.rtf";
-NSString *SKNotesRTFDDocumentType = @"com.apple.rtfd";
-NSString *SKNotesFDFDocumentType = @"com.adobe.fdf";
-NSString *SKPostScriptDocumentType = @"com.adobe.postscript";
-NSString *SKEncapsulatedPostScriptDocumentType = 
@"com.adobe.encapsulated-postscript";
-NSString *SKDVIDocumentType = @"org.tug.tex.dvi";
-NSString *SKXDVDocumentType = @"org.tug.tex.xdv";
-NSString *SKArchiveDocumentType = @"org.gnu.gnu-zip-tar-archive";
-NSString *SKFolderDocumentType = @"public.folder";
+NSString *SKDocumentTypePDF = @"com.adobe.pdf";
+NSString *SKDocumentTypePDFBundle = @"net.sourceforge.skim-app.pdfd";
+NSString *SKDocumentTypeNotes = @"net.sourceforge.skim-app.skimnotes";
+NSString *SKDocumentTypeNotesText = @"public.plain-text";
+NSString *SKDocumentTypeNotesRTF = @"public.rtf";
+NSString *SKDocumentTypeNotesRTFD = @"com.apple.rtfd";
+NSString *SKDocumentTypeNotesFDF = @"com.adobe.fdf";
+NSString *SKDocumentTypePostScript = @"com.adobe.postscript";
+NSString *SKDocumentTypeEncapsulatedPostScript = 
@"com.adobe.encapsulated-postscript";
+NSString *SKDocumentTypeDVI = @"org.tug.tex.dvi";
+NSString *SKDocumentTypeXDV = @"org.tug.tex.xdv";
+NSString *SKDocumentTypeArchive = @"org.gnu.gnu-zip-tar-archive";
+NSString *SKDocumentTypeFolder = @"public.folder";
 
 NSString *SKDocumentSetupAliasKey = @"_BDAlias";
 NSString *SKDocumentSetupBookmarkKey = @"bookmark";
@@ -165,23 +165,23 @@
     NSString *type = [super typeForContentsOfURL:inAbsoluteURL error:&error];
     NSWorkspace *ws = [NSWorkspace sharedWorkspace];
     
-    if ([ws type:type conformsToType:SKFolderDocumentType] == NO && [self 
documentClassForType:type] == NULL) {
+    if ([ws type:type conformsToType:SKDocumentTypeFolder] == NO && [self 
documentClassForType:type] == NULL) {
         // "open -f" creates a temporary file with a .txt extension, we want 
to be able to open these file as it can be very handy to e.g. display man pages 
and pretty printed text file from the command line
         if ([inAbsoluteURL isFileURL]) {
             NSData *leadingData = [[NSFileHandle 
fileHandleForReadingFromURL:inAbsoluteURL error:NULL] readDataOfLength:20];
             if (isPDFData(leadingData))
-                type = SKPDFDocumentType;
+                type = SKDocumentTypePDF;
             else if (isPostScriptData(leadingData))
-                type = isEncapsulatedPostScriptData(leadingData) ? 
SKEncapsulatedPostScriptDocumentType : SKPostScriptDocumentType;
+                type = isEncapsulatedPostScriptData(leadingData) ? 
SKDocumentTypeEncapsulatedPostScript : SKDocumentTypePostScript;
         }
         if (type == nil && outError)
             *outError = error;
-    } else if ([ws type:type conformsToType:SKNotesFDFDocumentType]) {
+    } else if ([ws type:type conformsToType:SKDocumentTypeNotesFDF]) {
         // Springer sometimes sends PDF files with an .fdf extension for 
review, huh?
         NSFileHandle *fh = [NSFileHandle 
fileHandleForReadingFromURL:inAbsoluteURL error:NULL];
         NSData *leadingData = [fh readDataOfLength:5];
         if (isPDFData(leadingData))
-            type = SKPDFDocumentType;
+            type = SKDocumentTypePDF;
     }
     
     return type;
@@ -251,20 +251,20 @@
     if ([pboard canReadItemWithDataConformingToTypes:@[NSPasteboardTypePDF]]) {
         [pboard types];
         data = [pboard dataForType:NSPasteboardTypePDF];
-        type = SKPDFDocumentType;
+        type = SKDocumentTypePDF;
     } else if ([pboard 
canReadItemWithDataConformingToTypes:@[SKPasteboardTypePostScript]]) {
         [pboard types];
         data = [pboard dataForType:SKPasteboardTypePostScript];
-        type = isEncapsulatedPostScriptData(data) ? 
SKEncapsulatedPostScriptDocumentType : SKPostScriptDocumentType;
+        type = isEncapsulatedPostScriptData(data) ? 
SKDocumentTypeEncapsulatedPostScript : SKDocumentTypePostScript;
     } else if ([pboard 
canReadItemWithDataConformingToTypes:@[NSPasteboardTypeTIFF]]) {
         [pboard types];
         data = convertTIFFDataToPDF([pboard dataForType:NSPasteboardTypeTIFF]);
-        type = SKPDFDocumentType;
+        type = SKDocumentTypePDF;
     } else {
         NSArray *images = [pboard readObjectsForClasses:@[[NSImage class]] 
options:@{}];
         if ([images count] > 0) {
             data = convertTIFFDataToPDF([[images objectAtIndex:0] 
TIFFRepresentation]);
-            type = SKPDFDocumentType;
+            type = SKDocumentTypePDF;
         }
     }
     
@@ -323,7 +323,7 @@
             } else {
                 NSData *data = nil;
                 
-                if ([[NSWorkspace sharedWorkspace] type:type 
conformsToType:SKPDFBundleDocumentType]) {
+                if ([[NSWorkspace sharedWorkspace] type:type 
conformsToType:SKDocumentTypePDFBundle]) {
                     NSURL *skimFileURL = [[NSFileManager defaultManager] 
bundledFileURLWithExtension:@"skim" inPDFBundleAtURL:theURL error:&error];
                     data = skimFileURL ? [NSData 
dataWithContentsOfURL:skimFileURL options:0 error:&error] : nil;
                 } else {
@@ -330,10 +330,10 @@
                     data = [[SKNExtendedAttributeManager sharedManager] 
extendedAttributeNamed:SKIM_NOTES_KEY atPath:[theURL path] traverseLink:YES 
error:&error];
                 }
                 
-                document = [self 
makeUntitledDocumentOfType:SKNotesDocumentType error:&error];
+                document = [self 
makeUntitledDocumentOfType:SKDocumentTypeNotes error:&error];
                 [document setSourceFileURL:theURL];
                 
-                if (data == nil || [document readFromData:data 
ofType:SKNotesDocumentType error:&error]) {
+                if (data == nil || [document readFromData:data 
ofType:SKDocumentTypeNotes error:&error]) {
                     [self addDocument:document];
                     [document makeWindowControllers];
                     [document showWindows];
@@ -594,7 +594,7 @@
     if ([fragment length] > 0)
         absoluteURL = [NSURL fileURLWithPath:[absoluteURL path]];
     
-    if ([ws type:type conformsToType:SKFolderDocumentType]) {
+    if ([ws type:type conformsToType:SKDocumentTypeFolder]) {
         
         NSError *err = nil;
         NSArray *urls = [self fileURLsInFolderAtURL:absoluteURL error:&err];
@@ -629,7 +629,7 @@
         
     } else {
         
-        if ([ws type:type conformsToType:SKNotesDocumentType]) {
+        if ([ws type:type conformsToType:SKDocumentTypeNotes]) {
             NSAppleEventDescriptor *event = [[NSAppleEventManager 
sharedAppleEventManager] currentAppleEvent];
             if ([event eventID] == kAEOpenDocuments && [[[event 
descriptorForKeyword:keyAESearchText] stringValue] length]) {
                 NSURL *pdfURL = [absoluteURL URLReplacingPathExtension:@"pdf"];

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2024-11-26 09:55:52 UTC (rev 14746)
+++ trunk/SKMainDocument.m      2024-11-26 16:46:00 UTC (rev 14747)
@@ -270,16 +270,16 @@
     NSMutableArray *writableTypes = [[super 
writableTypesForSaveOperation:saveOperation] mutableCopy];
     NSString *type = [self fileType];
     NSWorkspace *ws = [NSWorkspace sharedWorkspace];
-    if ([ws type:type conformsToType:SKEncapsulatedPostScriptDocumentType] == 
NO)
-        [writableTypes removeObject:SKEncapsulatedPostScriptDocumentType];
+    if ([ws type:type conformsToType:SKDocumentTypeEncapsulatedPostScript] == 
NO)
+        [writableTypes removeObject:SKDocumentTypeEncapsulatedPostScript];
     else
-        [writableTypes removeObject:SKPostScriptDocumentType];
-    if ([ws type:type conformsToType:SKPostScriptDocumentType] == NO)
-        [writableTypes removeObject:SKPostScriptDocumentType];
-    if ([ws type:type conformsToType:SKDVIDocumentType] == NO)
-        [writableTypes removeObject:SKDVIDocumentType];
-    if ([ws type:type conformsToType:SKXDVDocumentType] == NO)
-        [writableTypes removeObject:SKXDVDocumentType];
+        [writableTypes removeObject:SKDocumentTypePostScript];
+    if ([ws type:type conformsToType:SKDocumentTypePostScript] == NO)
+        [writableTypes removeObject:SKDocumentTypePostScript];
+    if ([ws type:type conformsToType:SKDocumentTypeDVI] == NO)
+        [writableTypes removeObject:SKDocumentTypeDVI];
+    if ([ws type:type conformsToType:SKDocumentTypeXDV] == NO)
+        [writableTypes removeObject:SKDocumentTypeXDV];
     if (saveOperation == NSSaveToOperation) {
         [writableTypes addObjectsFromArray:[[SKTemplateManager sharedManager] 
customTemplateTypes]];
     }
@@ -292,10 +292,10 @@
 
 - (BOOL)canAttachNotesForType:(NSString *)typeName {
     NSWorkspace *ws = [NSWorkspace sharedWorkspace];
-    return ([ws type:typeName conformsToType:SKPDFDocumentType] || 
-            [ws type:typeName conformsToType:SKPostScriptDocumentType] || 
-            [ws type:typeName conformsToType:SKDVIDocumentType] || 
-            [ws type:typeName conformsToType:SKXDVDocumentType]);
+    return ([ws type:typeName conformsToType:SKDocumentTypePDF] || 
+            [ws type:typeName conformsToType:SKDocumentTypePostScript] || 
+            [ws type:typeName conformsToType:SKDocumentTypeDVI] || 
+            [ws type:typeName conformsToType:SKDocumentTypeXDV]);
 }
 
 - (NSInteger)exportOption {
@@ -320,7 +320,7 @@
         [exportAccessoryController setHasExportOptions:NO];
     } else {
         [exportAccessoryController setHasExportOptions:YES];
-        if ([[NSWorkspace sharedWorkspace] type:type 
conformsToType:SKPDFDocumentType] && ([[self pdfDocument] isLocked] == NO && 
[[self pdfDocument] allowsPrinting])) {
+        if ([[NSWorkspace sharedWorkspace] type:type 
conformsToType:SKDocumentTypePDF] && ([[self pdfDocument] isLocked] == NO && 
[[self pdfDocument] allowsPrinting])) {
             [exportAccessoryController setAllowsEmbeddedOption:YES];
         } else {
             [exportAccessoryController setAllowsEmbeddedOption:NO];
@@ -484,7 +484,7 @@
     
     if (writeNotesOK) {
         if ([self hasNotes])
-            writeNotesOK = [super writeSafelyToURL:absoluteURL 
ofType:SKNotesDocumentType forSaveOperation:NSSaveToOperation error:NULL];
+            writeNotesOK = [super writeSafelyToURL:absoluteURL 
ofType:SKDocumentTypeNotes forSaveOperation:NSSaveToOperation error:NULL];
         else if (fileExists)
             writeNotesOK = [[NSFileManager defaultManager] 
removeItemAtURL:absoluteURL error:NULL];
     }
@@ -542,8 +542,8 @@
     NSString *path = nil;
     BOOL attachNotes = [self canAttachNotesForType:typeName] && 
mdFlags.exportOption == SKExportOptionDefault;
     
-    if ([ws type:typeName conformsToType:SKPDFBundleDocumentType] &&
-        [ws type:[self fileType] conformsToType:SKPDFBundleDocumentType] &&
+    if ([ws type:typeName conformsToType:SKDocumentTypePDFBundle] &&
+        [ws type:[self fileType] conformsToType:SKDocumentTypePDFBundle] &&
         [self fileURL] &&
         (saveOperation == NSSaveOperation || saveOperation == 
NSSaveAsOperation || saveOperation == NSAutosaveInPlaceOperation)) {
         NSFileManager *fm = [NSFileManager defaultManager];
@@ -673,48 +673,48 @@
     BOOL didWrite = NO;
     NSError *error = nil;
     NSWorkspace *ws = [NSWorkspace sharedWorkspace];
-    if ([ws type:SKNotesTextDocumentType conformsToType:typeName]) {
+    if ([ws type:SKDocumentTypeNotesText conformsToType:typeName]) {
         NSString *string = [self notesString];
         if (string)
             didWrite = [string writeToURL:absoluteURL atomically:NO 
encoding:NSUTF8StringEncoding error:&error];
         else
             error = [NSError 
writeFileErrorWithLocalizedDescription:NSLocalizedString(@"Unable to write 
notes as text", @"Error description")];
-    } else if ([ws type:SKPDFDocumentType conformsToType:typeName]) {
+    } else if ([ws type:SKDocumentTypePDF conformsToType:typeName]) {
         if (mdFlags.exportOption == SKExportOptionWithEmbeddedNotes)
             didWrite = [[self pdfDocument] writeToURL:absoluteURL];
         else
             didWrite = [pdfData writeToURL:absoluteURL options:0 error:&error];
-    } else if ([ws type:SKEncapsulatedPostScriptDocumentType 
conformsToType:typeName] || 
-               [ws type:SKDVIDocumentType conformsToType:typeName] || 
-               [ws type:SKXDVDocumentType conformsToType:typeName]) {
+    } else if ([ws type:SKDocumentTypeEncapsulatedPostScript 
conformsToType:typeName] || 
+               [ws type:SKDocumentTypeDVI conformsToType:typeName] || 
+               [ws type:SKDocumentTypeXDV conformsToType:typeName]) {
         if ([ws type:[self fileType] conformsToType:typeName])
             didWrite = [originalData writeToURL:absoluteURL options:0 
error:&error];
-    } else if ([ws type:SKPDFBundleDocumentType conformsToType:typeName]) {
+    } else if ([ws type:SKDocumentTypePDFBundle conformsToType:typeName]) {
         NSFileWrapper *fileWrapper = [self 
PDFBundleFileWrapperForName:[[absoluteURL lastPathComponent] 
stringByDeletingPathExtension]];
         if (fileWrapper)
             didWrite = [fileWrapper writeToURL:absoluteURL options:0 
originalContentsURL:nil error:&error];
         else
             error = [NSError 
writeFileErrorWithLocalizedDescription:NSLocalizedString(@"Unable to write 
file", @"Error description")];
-    } else if ([ws type:SKArchiveDocumentType conformsToType:typeName]) {
+    } else if ([ws type:SKDocumentTypeArchive conformsToType:typeName]) {
         didWrite = [self writeArchiveToURL:absoluteURL error:&error];
-    } else if ([ws type:SKNotesDocumentType conformsToType:typeName]) {
+    } else if ([ws type:SKDocumentTypeNotes conformsToType:typeName]) {
         SKNSkimNotesWritingOptions options = [[NSUserDefaults 
standardUserDefaults] boolForKey:SKWriteLegacySkimNotesKey] || [[NSUserDefaults 
standardUserDefaults] boolForKey:SKWriteSkimNotesAsArchiveKey] ? 0 : 
SKNSkimNotesWritingPlist;
         didWrite = [[NSFileManager defaultManager] writeSkimNotes:[self 
SkimNoteProperties] toSkimFileAtURL:absoluteURL options:options error:&error];
-    } else if ([ws type:SKNotesRTFDocumentType conformsToType:typeName]) {
+    } else if ([ws type:SKDocumentTypeNotesRTF conformsToType:typeName]) {
         NSData *data = [self notesRTFData];
         if (data)
             didWrite = [data writeToURL:absoluteURL options:0 error:&error];
         else
             error = [NSError 
writeFileErrorWithLocalizedDescription:NSLocalizedString(@"Unable to write 
notes as RTF", @"Error description")];
-    } else if ([ws type:SKNotesRTFDDocumentType conformsToType:typeName]) {
+    } else if ([ws type:SKDocumentTypeNotesRTFD conformsToType:typeName]) {
         NSFileWrapper *fileWrapper = [self 
notesFileWrapperForTemplateType:typeName];
         if (fileWrapper)
             didWrite = [fileWrapper writeToURL:absoluteURL options:0 
originalContentsURL:nil error:&error];
         else
             error = [NSError 
writeFileErrorWithLocalizedDescription:NSLocalizedString(@"Unable to write 
notes as RTFD", @"Error description")];
-    } else if ([ws type:SKNotesFDFDocumentType conformsToType:typeName]) {
+    } else if ([ws type:SKDocumentTypeNotesFDF conformsToType:typeName]) {
         NSURL *fileURL = [self fileURL];
-        if (fileURL && [ws type:[self fileType] 
conformsToType:SKPDFBundleDocumentType])
+        if (fileURL && [ws type:[self fileType] 
conformsToType:SKDocumentTypePDFBundle])
             fileURL = [[NSFileManager defaultManager] 
bundledFileURLWithExtension:@"pdf" inPDFBundleAtURL:fileURL error:NULL];
         NSData *data = [self notesFDFDataForFile:[fileURL lastPathComponent] 
fileIDStrings:[[self pdfDocument] fileIDStrings]];
         if (data)
@@ -747,20 +747,20 @@
     
     // only set the creator code for our native types
     if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKShouldSetCreatorCodeKey] && 
-        ([[self class] isNativeType:typeName] || [typeName 
isEqualToString:SKNotesDocumentType]))
+        ([[self class] isNativeType:typeName] || [typeName 
isEqualToString:SKDocumentTypeNotes]))
         [dict setObject:[NSNumber numberWithUnsignedInt:'SKim'] 
forKey:NSFileHFSCreatorCode];
     
-    if ([ws type:typeName conformsToType:SKPDFDocumentType])
+    if ([ws type:typeName conformsToType:SKDocumentTypePDF])
         [dict setObject:[NSNumber numberWithUnsignedInt:'PDF '] 
forKey:NSFileHFSTypeCode];
-    else if ([ws type:typeName conformsToType:SKPDFBundleDocumentType])
+    else if ([ws type:typeName conformsToType:SKDocumentTypePDFBundle])
         [dict setObject:[NSNumber numberWithUnsignedInt:'PDFD'] 
forKey:NSFileHFSTypeCode];
-    else if ([ws type:typeName conformsToType:SKNotesDocumentType])
+    else if ([ws type:typeName conformsToType:SKDocumentTypeNotes])
         [dict setObject:[NSNumber numberWithUnsignedInt:'SKNT'] 
forKey:NSFileHFSTypeCode];
-    else if ([ws type:typeName conformsToType:SKNotesFDFDocumentType])
+    else if ([ws type:typeName conformsToType:SKDocumentTypeNotesFDF])
         [dict setObject:[NSNumber numberWithUnsignedInt:'FDF '] 
forKey:NSFileHFSTypeCode];
-    else if ([[absoluteURL pathExtension] isEqualToString:@"rtf"] || [ws 
type:typeName conformsToType:SKNotesRTFDocumentType])
+    else if ([[absoluteURL pathExtension] isEqualToString:@"rtf"] || [ws 
type:typeName conformsToType:SKDocumentTypeNotesRTF])
         [dict setObject:[NSNumber numberWithUnsignedInt:'RTF '] 
forKey:NSFileHFSTypeCode];
-    else if ([[absoluteURL pathExtension] isEqualToString:@"txt"] || [ws 
type:typeName conformsToType:SKNotesTextDocumentType])
+    else if ([[absoluteURL pathExtension] isEqualToString:@"txt"] || [ws 
type:typeName conformsToType:SKDocumentTypeNotesText])
         [dict setObject:[NSNumber numberWithUnsignedInt:'TEXT'] 
forKey:NSFileHFSTypeCode];
     
     return dict;
@@ -772,14 +772,14 @@
     static NSArray *readableTypes = nil;
     if (readableTypes == nil) {
         NSMutableArray *tmpTypes = [[super readableTypes] mutableCopy];
-        if ([SKConversionProgressController toolPathForType:SKDVIDocumentType] 
== nil)
-            [tmpTypes removeObject:SKDVIDocumentType];
-        if ([SKConversionProgressController toolPathForType:SKXDVDocumentType] 
== nil)
-            [tmpTypes removeObject:SKXDVDocumentType];
+        if ([SKConversionProgressController toolPathForType:SKDocumentTypeDVI] 
== nil)
+            [tmpTypes removeObject:SKDocumentTypeDVI];
+        if ([SKConversionProgressController toolPathForType:SKDocumentTypeXDV] 
== nil)
+            [tmpTypes removeObject:SKDocumentTypeXDV];
         if (@available(macOS 14.0, *)) {
-            if ([SKConversionProgressController 
toolPathForType:SKPostScriptDocumentType] == nil) {
-                [tmpTypes removeObject:SKPostScriptDocumentType];
-                [tmpTypes removeObject:SKEncapsulatedPostScriptDocumentType];
+            if ([SKConversionProgressController 
toolPathForType:SKDocumentTypePostScript] == nil) {
+                [tmpTypes removeObject:SKDocumentTypePostScript];
+                [tmpTypes removeObject:SKDocumentTypeEncapsulatedPostScript];
             }
         }
         readableTypes = tmpTypes;
@@ -807,7 +807,7 @@
     
     tmpData = [[SKTemporaryData alloc] init];
     
-    if ([[NSWorkspace sharedWorkspace] type:docType 
conformsToType:SKPostScriptDocumentType]) {
+    if ([[NSWorkspace sharedWorkspace] type:docType 
conformsToType:SKDocumentTypePostScript]) {
         inData = data;
         data = [SKConversionProgressController 
newPDFDataWithPostScriptData:data error:&error];
     }
@@ -845,7 +845,7 @@
     
     tmpData = [[SKTemporaryData alloc] init];
     
-    if ([ws type:docType conformsToType:SKPDFBundleDocumentType]) {
+    if ([ws type:docType conformsToType:SKDocumentTypePDFBundle]) {
         NSURL *pdfURL = [[NSFileManager defaultManager] 
bundledFileURLWithExtension:@"pdf" inPDFBundleAtURL:absoluteURL error:&error];
         if (pdfURL) {
             if ((data = [[NSData alloc] initWithContentsOfURL:pdfURL 
options:NSDataReadingUncached error:&error]) &&
@@ -868,7 +868,7 @@
             }
         }
     } else if ((data = [[NSData alloc] initWithContentsOfURL:absoluteURL 
options:NSDataReadingUncached error:&error])) {
-        if ([ws type:docType conformsToType:SKPDFDocumentType]) {
+        if ([ws type:docType conformsToType:SKDocumentTypePDF]) {
             pdfDoc = [[SKPDFDocument alloc] initWithURL:absoluteURL];
         } else {
             fileData = data;
@@ -933,7 +933,7 @@
             NSDictionary *dictionary = nil;
             NSArray *array = nil;
             NSNumber *number = nil;
-            if ([docType isEqualToString:SKPDFBundleDocumentType]) {
+            if ([docType isEqualToString:SKDocumentTypePDFBundle]) {
                 NSDictionary *info = [NSDictionary 
dictionaryWithContentsOfURL:[[absoluteURL 
URLByAppendingPathComponent:BUNDLE_DATA_FILENAME isDirectory:NO] 
URLByAppendingPathExtension:@"plist"]];
                 if ([info isKindOfClass:[NSDictionary class]]) {
                     dictionary = [info objectForKey:SKPresentationOptionsKey];
@@ -1057,9 +1057,9 @@
     NSString *type = [ws typeOfFile:[notesURL path] error:NULL];
     NSArray *array = nil;
     
-    if ([ws type:type conformsToType:SKNotesDocumentType]) {
+    if ([ws type:type conformsToType:SKDocumentTypeNotes]) {
         array = [[NSFileManager defaultManager] 
readSkimNotesFromSkimFileAtURL:notesURL error:NULL];
-    } else if ([ws type:type conformsToType:SKNotesFDFDocumentType]) {
+    } else if ([ws type:type conformsToType:SKDocumentTypeNotesFDF]) {
         NSData *fdfData = [NSData dataWithContentsOfURL:notesURL];
         if (fdfData)
             array = [SKFDFParser noteDictionariesFromFDFData:fdfData];
@@ -1095,7 +1095,7 @@
     }
     
     [oPanel setDirectoryURL:[fileURL URLByDeletingLastPathComponent]];
-    [oPanel setAllowedFileTypes:@[SKNotesDocumentType]];
+    [oPanel setAllowedFileTypes:@[SKDocumentTypeNotes]];
     [oPanel beginSheetModalForWindow:[self windowForSheet] 
completionHandler:^(NSModalResponse result){
             if (result == NSModalResponseOK) {
                 NSURL *notesURL = [[oPanel URLs] objectAtIndex:0];
@@ -1231,7 +1231,7 @@
 
 - (IBAction)convertNotes:(id)sender {
     NSWorkspace *ws = [NSWorkspace sharedWorkspace];
-    if (([ws type:[self fileType] conformsToType:SKPDFDocumentType] == NO && 
[ws type:[self fileType] conformsToType:SKPDFBundleDocumentType] == NO) ||
+    if (([ws type:[self fileType] conformsToType:SKDocumentTypePDF] == NO && 
[ws type:[self fileType] conformsToType:SKDocumentTypePDFBundle] == NO) ||
         [self hasConvertibleAnnotations] == NO) {
         NSBeep();
         return;
@@ -1254,8 +1254,8 @@
     BOOL shouldArchive = ([self hasNotes] || [[self presentationOptions] 
count] > 0 || [[[self mainWindowController] widgetProperties] count] > 0);
     
     NSString *typeName = [self fileType];
-    if (shouldArchive == NO && [typeName 
isEqualToString:SKPDFBundleDocumentType])
-        typeName = SKPDFDocumentType;
+    if (shouldArchive == NO && [typeName 
isEqualToString:SKDocumentTypePDFBundle])
+        typeName = SKDocumentTypePDF;
     
     NSString *typeExt = [self fileNameExtensionForType:typeName 
saveOperation:NSAutosaveElsewhereOperation];
     NSString *targetExt = shouldArchive ? @"tgz" : typeExt;
@@ -1353,7 +1353,7 @@
     } else if ([anItem action] == @selector(printDocument:)) {
         return [[self pdfDocument] allowsPrinting];
     } else if ([anItem action] == @selector(convertNotes:)) {
-        return [[NSWorkspace sharedWorkspace] type:[self fileType] 
conformsToType:SKPDFDocumentType] && [[self pdfDocument] allowsNotes];
+        return [[NSWorkspace sharedWorkspace] type:[self fileType] 
conformsToType:SKDocumentTypePDF] && [[self pdfDocument] allowsNotes];
     } else if ([anItem action] == @selector(readNotes:)) {
         return [[self pdfDocument] allowsNotes];
     } else if ([anItem action] == @selector(performFindPanelAction:)) {
@@ -1924,45 +1924,45 @@
         NSArray *writableTypes = [self 
writableTypesForSaveOperation:NSSaveToOperation];
         SKTemplateManager *tm = [SKTemplateManager sharedManager];
         if ([fileType isEqualToString:@"PDF"]) {
-            normalizedType = SKPDFDocumentType;
+            normalizedType = SKDocumentTypePDF;
         } else if ([fileType isEqualToString:@"PDF With Embedded Notes"]) {
-            normalizedType = SKPDFDocumentType;
+            normalizedType = SKDocumentTypePDF;
             option = SKExportOptionWithEmbeddedNotes;
         } else if ([fileType isEqualToString:@"PDF Without Notes"]) {
-            normalizedType = SKPDFDocumentType;
+            normalizedType = SKDocumentTypePDF;
             option = SKExportOptionWithoutNotes;
         } else if ([fileType isEqualToString:@"PostScript"]) {
-            normalizedType = [[NSWorkspace sharedWorkspace] type:[self 
fileType] conformsToType:SKEncapsulatedPostScriptDocumentType] ? 
SKEncapsulatedPostScriptDocumentType : SKPostScriptDocumentType;
+            normalizedType = [[NSWorkspace sharedWorkspace] type:[self 
fileType] conformsToType:SKDocumentTypeEncapsulatedPostScript] ? 
SKDocumentTypeEncapsulatedPostScript : SKDocumentTypePostScript;
         } else if ([fileType isEqualToString:@"PostScript Without Notes"]) {
-            normalizedType = [[NSWorkspace sharedWorkspace] type:[self 
fileType] conformsToType:SKEncapsulatedPostScriptDocumentType] ? 
SKEncapsulatedPostScriptDocumentType : SKPostScriptDocumentType;
+            normalizedType = [[NSWorkspace sharedWorkspace] type:[self 
fileType] conformsToType:SKDocumentTypeEncapsulatedPostScript] ? 
SKDocumentTypeEncapsulatedPostScript : SKDocumentTypePostScript;
             option = SKExportOptionWithoutNotes;
         } else if ([fileType isEqualToString:@"Encapsulated PostScript"]) {
-            normalizedType = SKEncapsulatedPostScriptDocumentType;
+            normalizedType = SKDocumentTypeEncapsulatedPostScript;
         } else if ([fileType isEqualToString:@"Encapsulated PostScript Without 
Notes"]) {
-            normalizedType = SKEncapsulatedPostScriptDocumentType;
+            normalizedType = SKDocumentTypeEncapsulatedPostScript;
             option = SKExportOptionWithoutNotes;
         } else if ([fileType isEqualToString:@"DVI"]) {
-            normalizedType = SKDVIDocumentType;
+            normalizedType = SKDocumentTypeDVI;
         } else if ([fileType isEqualToString:@"DVI Without Notes"]) {
-            normalizedType = SKDVIDocumentType;
+            normalizedType = SKDocumentTypeDVI;
             option = SKExportOptionWithoutNotes;
         } else if ([fileType isEqualToString:@"XDV"]) {
-            normalizedType = SKXDVDocumentType;
+            normalizedType = SKDocumentTypeXDV;
         } else if ([fileType isEqualToString:@"XDV Without Notes"]) {
-            normalizedType = SKXDVDocumentType;
+            normalizedType = SKDocumentTypeXDV;
             option = SKExportOptionWithoutNotes;
         } else if ([fileType isEqualToString:@"PDF Bundle"]) {
-            normalizedType = SKPDFBundleDocumentType;
+            normalizedType = SKDocumentTypePDFBundle;
         } else if ([fileType isEqualToString:@"Skim Notes"]) {
-            normalizedType = SKNotesDocumentType;
+            normalizedType = SKDocumentTypeNotes;
         } else if ([fileType isEqualToString:@"Notes as Text"]) {
-            normalizedType = SKNotesTextDocumentType;
+            normalizedType = SKDocumentTypeNotesText;
         } else if ([fileType isEqualToString:@"Notes as RTF"]) {
-            normalizedType = SKNotesRTFDocumentType;
+            normalizedType = SKDocumentTypeNotesRTF;
         } else if ([fileType isEqualToString:@"Notes as RTFD"]) {
-            normalizedType = SKNotesRTFDDocumentType;
+            normalizedType = SKDocumentTypeNotesRTFD;
         } else if ([fileType isEqualToString:@"Notes as FDF"]) {
-            normalizedType = SKNotesFDFDocumentType;
+            normalizedType = SKDocumentTypeNotesFDF;
         } else if ([writableTypes containsObject:fileType] == NO) {
             normalizedType = [tm templateTypeForDisplayName:fileType];
         }
@@ -2102,7 +2102,7 @@
 }
 
 - (void)handleConvertNotesScriptCommand:(NSScriptCommand *)command {
-    if ([[NSWorkspace sharedWorkspace] type:[self fileType] 
conformsToType:SKPDFDocumentType] == NO && [[NSWorkspace sharedWorkspace] 
type:[self fileType] conformsToType:SKPDFBundleDocumentType] == NO) {
+    if ([[NSWorkspace sharedWorkspace] type:[self fileType] 
conformsToType:SKDocumentTypePDF] == NO && [[NSWorkspace sharedWorkspace] 
type:[self fileType] conformsToType:SKDocumentTypePDFBundle] == NO) {
         [command setScriptErrorNumber:NSArgumentsWrongScriptError];
     } else if (mdFlags.convertingNotes || [[self pdfDocument] isLocked]) {
         [command setScriptErrorNumber:NSInternalScriptError];
@@ -2125,7 +2125,7 @@
     } else {
         NSNumber *replaceNumber = [args objectForKey:@"Replace"];
         NSString *fileType = [[NSDocumentController sharedDocumentController] 
typeForContentsOfURL:notesURL error:NULL];
-        if ([[NSWorkspace sharedWorkspace] type:fileType 
conformsToType:SKNotesDocumentType])
+        if ([[NSWorkspace sharedWorkspace] type:fileType 
conformsToType:SKDocumentTypeNotes])
             [self readNotesFromURL:notesURL replace:(replaceNumber ? 
[replaceNumber boolValue] : YES)];
         else
             [command setScriptErrorNumber:NSArgumentsWrongScriptError];

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2024-11-26 09:55:52 UTC (rev 14746)
+++ trunk/SKMainWindowController.m      2024-11-26 16:46:00 UTC (rev 14747)
@@ -2941,13 +2941,13 @@
         CGFloat width = ceil(0.8 * fmin(size.width, size.height));
         NSRect rect = NSMakeRect(0.5 * (size.width - width), 0.5 * 
(size.height - width), width, width);
         NSString *type = [[self document] fileType];
-        if ([type isEqualToString:SKPostScriptDocumentType])
+        if ([type isEqualToString:SKDocumentTypePostScript])
             type = @"PS";
-        else if ([type isEqualToString:SKEncapsulatedPostScriptDocumentType])
+        else if ([type isEqualToString:SKDocumentTypeEncapsulatedPostScript])
             type = @"EPS";
-        else if ([type isEqualToString:SKDVIDocumentType])
+        else if ([type isEqualToString:SKDocumentTypeDVI])
             type = @"DVI";
-        else if ([type isEqualToString:SKXDVDocumentType])
+        else if ([type isEqualToString:SKDocumentTypeXDV])
             type = @"XDV";
         else
             type = @"PDF";

Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m   2024-11-26 09:55:52 UTC (rev 14746)
+++ trunk/SKMainWindowController_UI.m   2024-11-26 16:46:00 UTC (rev 14747)
@@ -1455,7 +1455,7 @@
 - (NSURL *)redirectRelativeLinkURL:(NSURL *)url {
     if ([url scheme] == nil && [[self document] fileURL])
         url = [[NSURL URLWithString:[url absoluteString] relativeToURL:[[self 
document] fileURL]] absoluteURL] ?: url;
-    if ([url isFileURL] && [[[self document] fileType] 
isEqualToString:SKPDFBundleDocumentType] && [url 
checkResourceIsReachableAndReturnError:NULL] == NO) {
+    if ([url isFileURL] && [[[self document] fileType] 
isEqualToString:SKDocumentTypePDFBundle] && [url 
checkResourceIsReachableAndReturnError:NULL] == NO) {
         NSString *path = [url path];
         NSURL *docURL = [[self document] fileURL];
         NSString *docPath = [docURL path];

Modified: trunk/SKNotesDocument.m
===================================================================
--- trunk/SKNotesDocument.m     2024-11-26 09:55:52 UTC (rev 14746)
+++ trunk/SKNotesDocument.m     2024-11-26 16:46:00 UTC (rev 14747)
@@ -274,10 +274,10 @@
     NSFileWrapper *fileWrapper = nil;
     NSWorkspace *ws = [NSWorkspace sharedWorkspace];
     
-    if ([ws type:SKNotesDocumentType conformsToType:typeName] ||
-        [ws type:SKNotesTextDocumentType conformsToType:typeName] ||
-        [ws type:SKNotesRTFDocumentType conformsToType:typeName] ||
-        [ws type:SKNotesFDFDocumentType conformsToType:typeName] ||
+    if ([ws type:SKDocumentTypeNotes conformsToType:typeName] ||
+        [ws type:SKDocumentTypeNotesText conformsToType:typeName] ||
+        [ws type:SKDocumentTypeNotesRTF conformsToType:typeName] ||
+        [ws type:SKDocumentTypeNotesFDF conformsToType:typeName] ||
         [[SKTemplateManager sharedManager] 
isRichTextBundleTemplateType:typeName] == NO)
         fileWrapper = [super fileWrapperOfType:typeName error:outError];
     else
@@ -293,13 +293,13 @@
     NSData *data = nil;
     NSWorkspace *ws = [NSWorkspace sharedWorkspace];
     
-    if ([ws type:SKNotesDocumentType conformsToType:typeName]) {
+    if ([ws type:SKDocumentTypeNotes conformsToType:typeName]) {
         data = [self notesData];
-    } else if ([ws type:SKNotesTextDocumentType conformsToType:typeName]) {
+    } else if ([ws type:SKDocumentTypeNotesText conformsToType:typeName]) {
         data = [[self notesString] dataUsingEncoding:NSUTF8StringEncoding];
-    } else if ([ws type:SKNotesRTFDocumentType conformsToType:typeName]) {
+    } else if ([ws type:SKDocumentTypeNotesRTF conformsToType:typeName]) {
         data = [self notesRTFData];
-    } else if ([ws type:SKNotesFDFDocumentType conformsToType:typeName]) {
+    } else if ([ws type:SKDocumentTypeNotesFDF conformsToType:typeName]) {
         NSString *filename = nil;
         NSURL *pdfURL = [[self fileURL] URLReplacingPathExtension:@"pdf"];
         if ([pdfURL checkResourceIsReachableAndReturnError:NULL])
@@ -320,9 +320,9 @@
     NSArray *array = nil;
     NSWorkspace *ws = [NSWorkspace sharedWorkspace];
     
-    if ([ws type:typeName conformsToType:SKNotesDocumentType]) {
+    if ([ws type:typeName conformsToType:SKDocumentTypeNotes]) {
         array = SKNSkimNotesFromData(data);
-    } else if ([ws type:typeName conformsToType:SKNotesFDFDocumentType]) {
+    } else if ([ws type:typeName conformsToType:SKDocumentTypeNotesFDF]) {
         array = [SKFDFParser noteDictionariesFromFDFData:data];
     }
     
@@ -389,14 +389,14 @@
     NSWorkspace *ws = [NSWorkspace sharedWorkspace];
     
     // only set the creator code for our native types
-    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKShouldSetCreatorCodeKey] && [ws type:typeName 
conformsToType:SKNotesDocumentType])
+    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKShouldSetCreatorCodeKey] && [ws type:typeName 
conformsToType:SKDocumentTypeNotes])
         [dict setObject:[NSNumber numberWithUnsignedInt:'SKim'] 
forKey:NSFileHFSCreatorCode];
     
-    if ([ws type:typeName conformsToType:SKNotesDocumentType])
+    if ([ws type:typeName conformsToType:SKDocumentTypeNotes])
         [dict setObject:[NSNumber numberWithUnsignedInt:'SKNT'] 
forKey:NSFileHFSTypeCode];
-    else if ([[absoluteURL pathExtension] isEqualToString:@"rtf"] || [ws 
type:typeName conformsToType:SKNotesRTFDocumentType])
+    else if ([[absoluteURL pathExtension] isEqualToString:@"rtf"] || [ws 
type:typeName conformsToType:SKDocumentTypeNotesRTF])
         [dict setObject:[NSNumber numberWithUnsignedInt:'RTF '] 
forKey:NSFileHFSTypeCode];
-    else if ([[absoluteURL pathExtension] isEqualToString:@"txt"] || [ws 
type:typeName conformsToType:SKNotesTextDocumentType])
+    else if ([[absoluteURL pathExtension] isEqualToString:@"txt"] || [ws 
type:typeName conformsToType:SKDocumentTypeNotesText])
         [dict setObject:[NSNumber numberWithUnsignedInt:'TEXT'] 
forKey:NSFileHFSTypeCode];
     
     return dict;
@@ -925,7 +925,7 @@
     item = [[SKToolbarItem alloc] 
initWithItemIdentifier:SKNotesDocumentOpenPDFToolbarItemIdentifier];
     [item setLabels:NSLocalizedString(@"Open PDF", @"Toolbar item label")];
     [item setToolTip:NSLocalizedString(@"Open Associated PDF File", @"Tool tip 
message")];
-    [item setImage:[[NSWorkspace sharedWorkspace] 
iconForFileType:SKPDFDocumentType]];
+    [item setImage:[[NSWorkspace sharedWorkspace] 
iconForFileType:SKDocumentTypePDF]];
     [item setTarget:self];
     [item setAction:@selector(openPDF:)];
     [dict setObject:item forKey:SKNotesDocumentOpenPDFToolbarItemIdentifier];
@@ -977,15 +977,15 @@
         NSArray *writableTypes = [self 
writableTypesForSaveOperation:NSSaveToOperation];
         SKTemplateManager *tm = [SKTemplateManager sharedManager];
         if ([fileType isEqualToString:@"Skim Notes"])
-            normalizedType = SKNotesDocumentType;
+            normalizedType = SKDocumentTypeNotes;
         else if ([fileType isEqualToString:@"Notes as Text"])
-            normalizedType = SKNotesTextDocumentType;
+            normalizedType = SKDocumentTypeNotesText;
         else if ([fileType isEqualToString:@"Notes as RTF"])
-            normalizedType = SKNotesRTFDocumentType;
+            normalizedType = SKDocumentTypeNotesRTF;
         else if ([fileType isEqualToString:@"Notes as RTFD"])
-            normalizedType = SKNotesRTFDDocumentType;
+            normalizedType = SKDocumentTypeNotesRTFD;
         else if ([fileType isEqualToString:@"Notes as FDF"])
-            normalizedType = SKNotesFDFDocumentType;
+            normalizedType = SKDocumentTypeNotesFDF;
         else if ([writableTypes containsObject:fileType] == NO)
             normalizedType = [tm templateTypeForDisplayName:fileType];
         if ((normalizedType && [writableTypes containsObject:normalizedType]) 
|| [tm fileNameExtensionForTemplateType:fileType]) {

Modified: trunk/SKPrintAccessoryController.m
===================================================================
--- trunk/SKPrintAccessoryController.m  2024-11-26 09:55:52 UTC (rev 14746)
+++ trunk/SKPrintAccessoryController.m  2024-11-26 16:46:00 UTC (rev 14747)
@@ -73,7 +73,7 @@
 }
 
 - (NSString *)title {
-    return [[NSDocumentController sharedDocumentController] 
displayNameForType:SKPDFDocumentType];
+    return [[NSDocumentController sharedDocumentController] 
displayNameForType:SKDocumentTypePDF];
 }
 
 - (BOOL)autoRotate {

Modified: trunk/SKTemplateManager.m
===================================================================
--- trunk/SKTemplateManager.m   2024-11-26 09:55:52 UTC (rev 14746)
+++ trunk/SKTemplateManager.m   2024-11-26 16:46:00 UTC (rev 14747)
@@ -58,7 +58,7 @@
 - (instancetype)init {
     self = [super init];
     if (self) {
-        templateFileNames = [[NSMutableDictionary alloc] 
initWithObjectsAndKeys:@"notesTemplate.txt", SKNotesTextDocumentType, 
@"notesTemplate.rtf", SKNotesRTFDocumentType, @"notesTemplate.rtfd", 
SKNotesRTFDDocumentType, nil];
+        templateFileNames = [[NSMutableDictionary alloc] 
initWithObjectsAndKeys:@"notesTemplate.txt", SKDocumentTypeNotesText, 
@"notesTemplate.rtf", SKDocumentTypeNotesRTF, @"notesTemplate.rtfd", 
SKDocumentTypeNotesRTFD, nil];
     }
     return self;
 }

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



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to