(This page is still under development. The information may not be accurate)
Writing a simple EPlugin
Learn a concept by reading through the code. This what my mentor says and i prefer this type of learning. This is a quick method to learn the basics of a concept. So here we’ll learn about EPlugins by writing a simple plugin. Lets write a plugin that will print the XXXXXXXXXXXXXX of the attachments of a mail.
More concepts will be disscused in the EPlugin manual. But here we will look in to the basic stuff alone.
> Identify Hook point
> Write EPLUG
> Write a Makefile.am
> Add plugin in configure.in
> Write a factory function
> Implement Logic
Identify Hook Point.
First step is to identify the proper HOOK point. This depends on the type of plugin you want to write.
With Eplugins you can create context sensitive menu items to toolbar buttons and main menu items. To have a list of available hook point you can refer the manual. Or to get a fresh list of hookpoints you can find out by
grep -inr “@hook” *
at the top directory of evolution source
So since we want a hook point for mail attachments, the following hookpoints will do the job
For more hook points and their possible use refer evolution manual.
Writing a EPLUG
The manual has good documentation on the hook points.
Imports ICS attachments to calendar.
Let me explain the tags and properties
[ The following section is directly taken from eplugin-manual ]
Id : A unique string identifying this plugin. By convention this will follow the java-like
class namespace system. e.g. com.ximian.evolution.test-plugin
Type : The type name of the plugin loader. Currently shlib and mono are the only supported
values. If no known handler is registered for this type, the plugin definition is silently
Domain : The translation domain for this plugin, as passed to the dcgettext call of the gettext
package. If not supplied then the default application domain is used (i.e. “evolution”).
This is used to translate translatable strings for display.
Name : A short name for the plugin. “Bob’s Wonder Extender” might be suitable. This value
will be translated.
Description : A longer description of the plugin’s purpose. This value will be translated.
Hook : This is a list of all of the hooks that this plugin wishes to hook into. See the Plugin
Hooks section for the details of the basic hook types defined.
The hook class is resolved using the registered hook types, and if none can be
found, or a version mismatch occurs, then the hook is silently ignored.
Awaiting Content ( 🙂 you can contribute to this … )
Write a factory function.
This is the callback function that is invoked when the menu is created.
void * function(ep, data);
EPlugin * ep;
void * data;
> function : The callback function.
> ep : The container EPlugin representing this plugin.
> data : Hook context data. It is part of the hook’s api to specify the type of this pointer.
> return : value Return data. It is part of the hook’s api to specify the type of this pointer.
Add plugin to configure.in
Time to add this plugin to configure.in to gernerate the make file.
Well this is the place you need to add the code..