Sunday, August 28, 2011

Padre integration

Well, Padre is really incredibly extensible - except for one thing (I'm going to have to patch my current copy); you can't add a MIME type/file extension mapping from a plugin, which is very disappointing. So here's basically what I'm doing:
  • Add .dpl => application/x-decl to EXT_MIME in Padre::MimeTypes.pm (patch)
  • Create a Padre::Plugin::Decl.pm
  • There, registered_documents can assign x-decl to Padre::Document::Decl.pm
  • Create Padre::Document::Decl.pm
The Plugin module handles general UI stuff (menus, About, special tools, etc.) while the Document module customizes the editor's behavior to suit you. I'm particularly interested in folding - but so far the documentation is really chaotic.

I've got about ten windows open on this task:
Also, I had some initial success with creating a new document class and doing some rudimentary folding in it - it was harder than hell to find documentation, though. It's scattered all around the Web. Here's some links that came in handy when dealing with folding in Scintilla/wxStyledTextControl:
  • Somewhat random access, but here is some POD for the wxScintilla control.
  • Here's some guy doing folding against Scintilla in a language I haven't even identified.
  • Otherwise, there's loads of stuff written for/about wxPython that works pretty well.

No comments:

Post a Comment