[Eric] Is there documentation for how to create a "nonstandard" plugin?

Detlev Offenbach detlev at die-offenbachs.de
Fri Sep 19 17:33:31 BST 2014


Hi,

plug-in documentation is included in the eric distribution archive (as ODF and PDF). This paper 
documents all plug-in specific APIs. Plug-ins can basically use all methods of the eric objects 
once they get access to them. How to detect when an editor is opened is easy and documented 
by using a signal. There are quite a bunch of plug-ins available through the plug-in repository and 
the source code repo, which can be used as examples.

All your points are right and are documented in the a.m. paper. At the moment I don't see 
something obvious that you missed. If unsure, the available plug-ins should clarify it. If not just 
ask again.

Happy coding!

Detlev

On Thursday 18 September 2014, 14:21:40 Mike C. Fletcher wrote:
> Hi all,
> 
> I've been building a little voice-dictation-for-coding service (for
> linux) and I'm getting to the point where I need to actually hook it up
> to an editor. Since Eric (5), from Mercurial is my editor of choice it
> seems I'll need to figure out how to write a plugin that *isn't* one of
> the built-in types (i.e. not a VCS or similar plugin). I want to build a
> plug-in that:
> 
>   * hooks into each opened code-editing window (possibly/likely with a
>     filter on the lexer languages)
>       o captures "focus" events for the window(s) to tell the service
>         when to interpret the dictation in the language-appropriate manner
>       o preferably can provide some context hints to the dictation
>         engine "docstring", "python code", "html code"
>   * generates dictation events to be integrated into the code-editor
>     (over DBUS)
>       o with undo-ability (particularly as there's likely to be lots of
>         "correct-that" operations)
> 
> The rest of this is just me thinking aloud and inviting
> corrections/suggestions/clarifications...
> 
>   * The editor class seems to be in eric5/QScintilla/Editor.py
>       o Undo: QScintilla beginUndoAction/endUndoAction are there, so
>         that looks pretty easy to implement
>       o It looks like command-and-control should be easy to implement
>         when I get that far too
>   * Hooking the creation of an editor
>       o Seems like I should be watching for
>         ViewManager::editorOpenedEd(editor) and then doing all of my
>         hooking in the handler
>       o e5App().getObject('ViewManager').editorOpenedEd.connect(
>         setup_editor_hooks )
>       o The TabNanny plugin seems to do it this way
>       o I'm assuming I can just hook regular Qt focus events too for the
>         "change to this interpretation context" behaviour
>       o It seems I can use the lexer language as a context cue
>         (python/html/javascript/etc)
>   * DBUS
>       o I don't see any other use of DBUS, I'm guessing that PyQt qdbus
>         should be available/workable
>           + Obviously not on Windows/OS-X, but the whole project is
>             linux-only for now
>   * Plugin Structure
>       o Seems to be magic comments in the plugin for metadata?
>       o def activate(self): --> perform the hooking and DBUS setup
>       o def deactivate(self): --> perform the un-hooking and DBUS
>         teardown/deregistration
>       o def __init__( self, ui ): --> internal setup only
>       o Do we need a particular setup/packaging format? I gather each
>         release needs to be hosted on Detlev's server/repository?
> 
> Anyway, if there's something obvious I'm missing, feel free to shout,
> I'm going to do a bit of hacking on the project this afternoon, so it
> may be I'll be back with further notes as I fall flat on my face. Eric
> is a rather huge code-base, so the chance that I've missed something is
> pretty large :D .
> 
> Have fun,
> Mike-- 
*Detlev Offenbach*
detlev at die-offenbachs.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/eric/attachments/20140919/f92dd645/attachment.html>


More information about the Eric mailing list