Revision: 12916
          http://sourceforge.net/p/skim-app/code/12916
Author:   hofman
Date:     2022-05-10 22:30:23 +0000 (Tue, 10 May 2022)
Log Message:
-----------
scripting proprty for current point the pdfview is scrolled to, relative to the 
current page

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     2022-05-10 18:55:17 UTC (rev 12915)
+++ trunk/NSDocument_SKExtensions.h     2022-05-10 22:30:23 UTC (rev 12916)
@@ -112,6 +112,7 @@
 
 - (PDFPage *)currentPage;
 - (void)setCurrentPage:(PDFPage *)page;
+- (NSData *)currentQDPoint;
 - (PDFAnnotation *)activeNote;
 - (NSTextStorage *)richText;
 - (id)selectionSpecifier;

Modified: trunk/NSDocument_SKExtensions.m
===================================================================
--- trunk/NSDocument_SKExtensions.m     2022-05-10 18:55:17 UTC (rev 12915)
+++ trunk/NSDocument_SKExtensions.m     2022-05-10 22:30:23 UTC (rev 12916)
@@ -344,6 +344,8 @@
 
 - (void)setCurrentPage:(PDFPage *)page {}
 
+- (NSData *)currentQDPoint { return nil; }
+
 - (PDFAnnotation *)activeNote { return nil; }
 
 - (NSTextStorage *)richText { return nil; }

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2022-05-10 18:55:17 UTC (rev 12915)
+++ trunk/SKMainDocument.m      2022-05-10 22:30:23 UTC (rev 12916)
@@ -90,6 +90,7 @@
 #import "SKFileShare.h"
 #import "SKAnimatedBorderlessWindow.h"
 #import "PDFOutline_SKExtensions.h"
+#import "PDFView_SKExtensions.h"
 
 #define BUNDLE_DATA_FILENAME @"data"
 #define PRESENTATION_OPTIONS_KEY 
@"net_sourceforge_skim-app_presentation_options"
@@ -1728,6 +1729,13 @@
     return [[self pdfView] goToPage:page];
 }
 
+- (NSData *)currentQDPoint {
+    NSPoint point;
+    [[self pdfView] currentPageIndexAndPoint:&point rotated:NULL];
+    Point qdPoint = SKQDPointFromNSPoint(point);
+    return [NSData dataWithBytes:&qdPoint length:sizeof(Point)];
+}
+
 - (PDFAnnotation *)activeNote {
     return [[self pdfView] activeAnnotation];
 }

Modified: trunk/Skim.sdef
===================================================================
--- trunk/Skim.sdef     2022-05-10 18:55:17 UTC (rev 12915)
+++ trunk/Skim.sdef     2022-05-10 22:30:23 UTC (rev 12916)
@@ -673,6 +673,10 @@
                 description="The current page.">
                 <cocoa key="currentPage"/>
             </property>
+            <property name="current point" code="CPnt" type="point"
+                description="The current point relative to the current page.">
+                <cocoa key="currentQDPoint"/>
+            </property>
             <property name="active note" code="ANot" type="note"
                 description="The currently selected note.">
                 <cocoa key="activeNote"/>

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

Reply via email to