On 7 May 2008, at 9:52 PM, Maxwell, Adam R wrote: > On 05/07/08 10:52, "Christiaan Hofman" <[EMAIL PROTECTED]> wrote: > >> On 7 May 2008, at 6:24 PM, Maxwell, Adam R wrote: > >>> If the basic drawing code could be separated out in a view/framework >>> for >>> view-only clients, then others (BibDesk, DevonThink, Papers, >>> QuickLook...) >>> could just as well use it directly instead of PDFView. I thought it >>> would >>> require too much refactoring to be really feasible? >>> >>> -- >>> adam >> >> >> Which basic drawing code? Drawing is just PDFKit. The only custom >> thing is the EA extensions to get the Skim notes and some code to >> make >> PDFAnnotations from them. I\d think you need to use PDFKit to add the >> annotations anyway. (I don't know how to use the CG versions). > > To be more specific, how difficult would it be to create a > PDFDocument/PDFView subclass pair that reads a .pdf file and > displays Skim > notes? Could SKPDFView be refactored easily so that it inherited > from some > non-editable-view class? > > Basically I wondered if there's a way to break a minimal part of > Skim out > into a framework that Skim would also link against, so future fixes > and > improvements could easily be incorporated elsewhere. The smaller > the API, > the easier it is to change in future, of course...
A PDFView subclass is not needed. It could be done just by categories on PDFDocument, PDFAnnotation<Type>, and NSFileManager. Basically PDFDocument needs an initializer which just calls -initWithURL:, reads the notes from the EAs, creates PDFAnnotations using -[PDFAnnotation initWithProperties:], and adds them to the proper pages. That's all. But this would not be good for Skim, because of additions to editing etc. And we keep track of the notes, so it's not a good idea to let the PDFDocument add the notes. And to make something that could be used would not be worth it I think, as the additional (minimal) code necessary for compatibility with Skim would be much more than the code necessary to do all this. Christiaan ------------------------------------------------------------------------- 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-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/skim-app-users
