Revision: 15290 http://sourceforge.net/p/skim-app/code/15290 Author: hofman Date: 2025-05-25 16:03:44 +0000 (Sun, 25 May 2025) Log Message: ----------- define readonly accessor for interactionMode on document classes
Modified Paths: -------------- trunk/NSDocument_SKExtensions.h trunk/NSDocument_SKExtensions.m trunk/SKMainDocument.m trunk/SKNotesDocument.h trunk/SKNotesDocument.m Modified: trunk/NSDocument_SKExtensions.h =================================================================== --- trunk/NSDocument_SKExtensions.h 2025-05-25 15:49:01 UTC (rev 15289) +++ trunk/NSDocument_SKExtensions.h 2025-05-25 16:03:44 UTC (rev 15290) @@ -60,6 +60,8 @@ @property (nonatomic, nullable, readonly) NSMenu *notesMenu; +@property (nonatomic, readonly) SKInteractionMode interactionMode; + #pragma mark Document Setup - (void)saveRecentDocumentInfo; @@ -123,7 +125,7 @@ @property (nonatomic, nullable, readonly) NSDictionary<NSString *, id> *documentAttributes; @property (nonatomic, readonly, getter=isPDFDocument) BOOL PDFDocument; @property (nonatomic, readonly) NSInteger toolMode; -@property (nonatomic, readonly) NSInteger scriptingInteractionMode; +@property (nonatomic) NSInteger scriptingInteractionMode; @property (nonatomic, nullable, readonly) NSDocument *presentationNotesDocument; @property (nonatomic, readonly) NSInteger presentationNotesOffset; @property (nonatomic, nullable, readonly) id readingBar; Modified: trunk/NSDocument_SKExtensions.m =================================================================== --- trunk/NSDocument_SKExtensions.m 2025-05-25 15:49:01 UTC (rev 15289) +++ trunk/NSDocument_SKExtensions.m 2025-05-25 16:03:44 UTC (rev 15290) @@ -91,6 +91,10 @@ - (NSMenu *)notesMenu { return nil; } +- (SKInteractionMode)interactionMode { + return ([[self mainWindow] styleMask] & NSWindowStyleMaskFullScreen) == 0 ? SKNormalMode : SKFullScreenMode; +} + #pragma mark Document Setup - (void)saveRecentDocumentInfo { @@ -358,8 +362,10 @@ - (NSInteger)toolMode { return 0; } -- (NSInteger)scriptingInteractionMode { return 0; } +- (NSInteger)scriptingInteractionMode { return [self interactionMode]; } +- (void)setScriptingInteractionMode:(NSInteger)mode {} + - (NSDocument *)presentationNotesDocument { return nil; } - (NSInteger)presentationNotesOffset { return 0; } Modified: trunk/SKMainDocument.m =================================================================== --- trunk/SKMainDocument.m 2025-05-25 15:49:01 UTC (rev 15289) +++ trunk/SKMainDocument.m 2025-05-25 16:03:44 UTC (rev 15290) @@ -266,6 +266,10 @@ return option; } +- (SKInteractionMode)interactionMode { + return [[self mainWindowController] interactionMode]; +} + #pragma mark Writing - (NSString *)fileType { @@ -1836,10 +1840,6 @@ [[self pdfView] setToolMode:newToolMode]; } -- (NSInteger)scriptingInteractionMode { - return [[self mainWindowController] interactionMode]; -} - - (void)setScriptingInteractionMode:(NSInteger)mode { if (mode == SKNormalMode) { if ([[self mainWindowController] canExitFullscreen]) Modified: trunk/SKNotesDocument.h =================================================================== --- trunk/SKNotesDocument.h 2025-05-25 15:49:01 UTC (rev 15289) +++ trunk/SKNotesDocument.h 2025-05-25 16:03:44 UTC (rev 15290) @@ -75,7 +75,6 @@ @property (nonatomic, nullable, readonly) PDFDocument *pdfDocument; @property (nonatomic, nullable, readonly) NSWindow *window; @property (nonatomic, nullable, strong) NSURL *sourceFileURL; -@property (nonatomic, readonly) SKInteractionMode interactionMode; - (IBAction)openPDF:(nullable id)sender; - (IBAction)searchNotes:(nullable id)sender; Modified: trunk/SKNotesDocument.m =================================================================== --- trunk/SKNotesDocument.m 2025-05-25 15:49:01 UTC (rev 15289) +++ trunk/SKNotesDocument.m 2025-05-25 16:03:44 UTC (rev 15290) @@ -112,7 +112,7 @@ @implementation SKNotesDocument @synthesize outlineView, statusBar, arrayController, searchField, notes, pdfDocument, sourceFileURL; -@dynamic window, interactionMode; +@dynamic window; - (instancetype)init { self = [super init]; @@ -449,10 +449,6 @@ return [super displayName]; } -- (SKInteractionMode)interactionMode { - return ([[self window] styleMask] & NSWindowStyleMaskFullScreen) == 0 ? SKNormalMode : SKFullScreenMode; -} - - (NSArray *)SkimNoteProperties { NSArray *array = [super SkimNoteProperties]; if ([unsupportedNotes count]) @@ -1018,10 +1014,6 @@ [outlineView selectRowIndexes:rowIndexes byExtendingSelection:NO]; } -- (NSInteger)scriptingInteractionMode { - return [self interactionMode]; -} - - (void)setScriptingInteractionMode:(NSInteger)mode { if (mode != [self interactionMode] && (mode == SKFullScreenMode || mode == SKNormalMode)) [self toggleFullscreen:nil]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit