Revision: 7683
http://skim-app.svn.sourceforge.net/skim-app/?rev=7683&view=rev
Author: hofman
Date: 2012-03-12 13:01:27 +0000 (Mon, 12 Mar 2012)
Log Message:
-----------
Scripting support for interaction mode and presentation notes document
Modified Paths:
--------------
trunk/NSDocument_SKExtensions.h
trunk/NSDocument_SKExtensions.m
trunk/SKMainDocument.m
trunk/Skim.sdef
Modified: trunk/NSDocument_SKExtensions.h
===================================================================
--- trunk/NSDocument_SKExtensions.h 2012-03-12 12:11:22 UTC (rev 7682)
+++ trunk/NSDocument_SKExtensions.h 2012-03-12 13:01:27 UTC (rev 7683)
@@ -101,6 +101,8 @@
- (NSDictionary *)documentAttributes;
- (BOOL)isPDFDocument;
- (NSInteger)toolMode;
+- (NSInteger)interactionMode;
+- (NSDocument *)presentationNotesDocument;
- (void)handleRevertScriptCommand:(NSScriptCommand *)command;
- (void)handleGoToScriptCommand:(NSScriptCommand *)command;
Modified: trunk/NSDocument_SKExtensions.m
===================================================================
--- trunk/NSDocument_SKExtensions.m 2012-03-12 12:11:22 UTC (rev 7682)
+++ trunk/NSDocument_SKExtensions.m 2012-03-12 13:01:27 UTC (rev 7683)
@@ -276,6 +276,10 @@
- (NSInteger)toolMode { return 0; }
+- (NSInteger)interactionMode { return 0; }
+
+- (NSDocument *)presentationNotesDocument { return nil; }
+
- (NSDictionary *)documentAttributes {
return [[SKInfoWindowController sharedInstance] infoForDocument:self];
}
Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m 2012-03-12 12:11:22 UTC (rev 7682)
+++ trunk/SKMainDocument.m 2012-03-12 13:01:27 UTC (rev 7683)
@@ -1782,6 +1782,29 @@
[[self pdfView] setToolMode:newToolMode];
}
+- (NSInteger)interactionMode {
+ return [[self mainWindowController] interactionMode];
+}
+
+- (void)setInteractionMode:(NSInteger)interactionMode {
+ if ([[self pdfDocument] isLocked] == NO && interactionMode != [[self
mainWindowController] interactionMode]) {
+ switch (interactionMode) {
+ case SKNormalMode: [[self mainWindowController]
exitFullscreen:nil]; break;
+ case SKFullScreenMode: [[self mainWindowController]
enterFullscreen:nil]; break;
+ case SKPresentationMode: [[self mainWindowController]
enterPresentation:nil]; break;
+ }
+ }
+}
+
+- (NSDocument *)presentationNotesDocument {
+ return [[self mainWindowController] presentationNotesDocument];
+}
+
+- (void)setPresentationNotesDocument:(NSDocument *)document {
+ if ([document isPDFDocument] && [document countOfPages] == [self
countOfPages] && document != self)
+ [[self mainWindowController] setPresentationNotesDocument:document];
+}
+
- (BOOL)isPDFDocument {
return YES;
}
Modified: trunk/Skim.sdef
===================================================================
--- trunk/Skim.sdef 2012-03-12 12:11:22 UTC (rev 7682)
+++ trunk/Skim.sdef 2012-03-12 13:01:27 UTC (rev 7683)
@@ -939,10 +939,18 @@
description="The tool mode for the document.">
<cocoa key="toolMode"/>
</property>
+ <property name="interaction mode" type="interaction mode type"
code="IMod"
+ description="The interaction mode for the document.">
+ <cocoa key="interactionMode"/>
+ </property>
<property name="containing PDF" type="boolean" code="iPDF"
access="r"
description="Is this a PDF document?">
<cocoa key="isPDFDocument"/>
</property>
+ <property name="presentation notes document" type="document"
code="NotD"
+ description="A document containing notes for a presentation
that is synchronized.">
+ <cocoa key="presentationNotesDocument"/>
+ </property>
<responds-to name="revert">
<cocoa method="handleRevertScriptCommand:"/>
</responds-to>
@@ -1793,6 +1801,21 @@
</enumerator>
</enumeration>
+ <enumeration name="interaction mode type" code="ModT">
+ <enumerator name="normal mode" code="ModN"
+ description="Normal mode.">
+ <cocoa integer-value="0"/>
+ </enumerator>
+ <enumerator name="full screen mode" code="ModF"
+ description="Full screen mode.">
+ <cocoa integer-value="1"/>
+ </enumerator>
+ <enumerator name="presentation mode" code="ModP"
+ description="Presentation mode.">
+ <cocoa integer-value="2"/>
+ </enumerator>
+ </enumeration>
+
<enumeration name="bookmark type" code="BmkE">
<enumerator name="file bookmark" code="BmFl"
description="File bookmark.">
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit