1 /** \file
2 * Plugin prototypes.
3 *
4 * This header describes which prototypes plugins should use when
5 * creating their functions. This header is also used by the internal
6 * plugins code to guarantee consistency.
7 *
8 * Author: Ted Gould <ted@gould.cx>
9 * Copyright (c) 2004-2005
10 *
11 * This code is licensed under the GNU GPL. See COPYING for details.
12 */
14 #ifndef __INKSCAPE_EXTENSION_IMPLEMENTATION_PLUGIN_LINK_H__
15 #define __INKSCAPE_EXTENSION_IMPLEMENTATION_PLUGIN_LINK_H__
17 #include <gtk/gtkdialog.h>
18 #include <gtkmm/widget.h>
20 /** \todo This needs to go away eventually. */
21 #include "document.h"
23 /** \brief A simple typedef to make it so that inkscape_extension can
24 be used before I figure out what makes sense here */
25 typedef void inkscape_extension;
26 /** \brief The C prototype of a load function. */
27 typedef int (*inkscape_plugin_load)(inkscape_extension * in_ext);
28 /** \brief The C prototype of an unload function. */
29 typedef void (*inkscape_plugin_unload)(inkscape_extension * in_ext);
30 /** \brief The C prototype of an open function. */
31 typedef SPDocument *(*inkscape_plugin_open)(inkscape_extension * in_ext, const gchar * filename);
32 /** \brief The C prototype of an input prefs function. */
33 typedef Gtk::Widget * (*inkscape_plugin_prefs_input)(inkscape_extension * in_ext, gchar const * filename);
34 /** \brief The C prototype of an effect function. */
35 typedef void (*inkscape_plugin_effect)(inkscape_extension * in_ext, Inkscape::UI::View::View * view);
36 /** \brief The C prototype of an effect prefs function. */
37 typedef Gtk::Widget * (*inkscape_plugin_prefs_effect)(inkscape_extension * in_ext, Inkscape::UI::View::View * view);
39 /** \brief The name of the symbol for the plugin. Should match
40 \c INKSCAPE_PLUGIN_NAME_STR (minus the quotes). */
41 #define INKSCAPE_PLUGIN_NAME inkscape_plugin_table
42 /** \brief The name of the table to define the plugin as a string. This
43 should be the same as \c INKSCAPE_PLUGIN_NAME but with quotes. */
44 #define INKSCAPE_PLUGIN_NAME_STR "inkscape_plugin_table"
45 /** \brief The version of the plugin interface that is being used. This
46 should always be used in the version entry in the \c inkscape_plugin_function_table
47 version entry. This way compiled plugins can be detected. */
48 #define INKSCAPE_PLUGIN_VERSION 0
50 /** \brief A structure containing all the functions that should be called
51 to make the plugin work. */
52 typedef struct {
53 int version; /**< The interface version used. Should
54 always be \c INKSCAPE_PLUGIN_VERSION. */
55 inkscape_plugin_load load; /**< Load function, called on first use */
56 inkscape_plugin_unload unload; /**< Unload function, called when Inkscape is
57 finished with the plugin */
58 inkscape_plugin_open open; /**< Open function, called to open a file
59 for Inkscape */
60 inkscape_plugin_prefs_input prefs_input; /**< Input preferences function, called to get
61 further parameters for an input plugin. */
62 inkscape_plugin_effect effect; /**< Effect function, called to cause an effect
63 on a document. */
64 inkscape_plugin_prefs_effect prefs_effect;/**< Effect preferences, on call could cause settings
65 on a document. */
66 } inkscape_plugin_function_table;
68 #endif /* __INKSCAPE_EXTENSION_IMPLEMENTATION_PLUGIN_LINK_H__ */