How to write a plugin for Evolution using Mono ?


1) Get Evolution Sources
2) Create a new directory for your plugin, say "translate"
3) Create your plugin.cs file. Generate a plugin-name.dll file by using gmcs. You can use Camel.cs and Evolution.cs for generating a .dll for your class. For example, for the plugin tarball given in the bottom of this page, the command to compile will be:

 gmcs -t:library hello.cs Camel.cs Evolution.cs -pkg:gtk-sharp-2.0 -pkg:gtkhtml-sharp-2.0

4) Now create a file: org-gnome-<plugin-name>.eplug.xml

 <?xml version="1.0">
 <e-plugin-list>
  <e-plugin id="org.gnome.evolution.hello" type="mono" _name="Hello Mono" location="@PLUGINDIR@/hello.dll" handler="translate">
    <author name="<Your name goes here> Sankar P" email="psankar@ximian.com"/>
    <_description>
    A translate Plugin in Evo-mono. This will translate a mail in English to Spanish and will display using GtkHTML# 
    </_description>
    <hook class="org.gnome.evolution.mail.bonobomenu:1.0">
      <menu id="org.gnome.evolution.mail.browser" target="select">
        <!-- the path to the bonobo menu description. Any UI item should come here. -->
        <ui file="@PLUGINDIR@/org-gnome-translate-ui.xml"/>
        <item type="item" verb="Convert" path="/commands/Convert" enable="one" activate="translate_handle"/>
      </menu>
    </hook>
  </e-plugin>
 </e-plugin-list>

5) Prepare your Makefile.am

6) Edit configure.in file in evolution source directory and add your plugin name to the list of:

 standard_plugins

You can search for the above string in the configure.in file.

7) Run configure from evolution source directory to generate Makefile in your plugin directory.

8) Run "make install" from your plugin directory

9) Launch Evolution. Make sure your plugin comes in the Edit->Plugins list


A sample plugin can be obtained as a '''patch file''' or '''tarball'''. Use them as a reference.

Apps/Evolution/MonoEPlugin (last edited 2013-08-08 22:50:05 by WilliamJonMcCann)