/* $Id$ */ /* * Cantus Tag Editor * Copyright © 2002-2004 by Samuel Abels * Copyright © 2007 by Tim Huetz * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see **/ #ifdef HAVE_CONFIG_H # include #endif #ifndef HAVE_CANTUSPLUGIN_H #define HAVE_CANTUSPLUGIN_H #ifdef __cplusplus #include #else #include #endif #include // Functions provided by plugins. typedef void *(*AnyFunc) (void); typedef gint (*InitFunc) (CantusHash *specs); typedef gint (*DestroyFunc) (void); typedef gboolean (*HandlesFunc) (const gchar *filename); typedef gint (*ReadFunc) (const gchar *filename, CantusHash *data); typedef gint (*WriteFunc) (const gchar *filename, CantusHash *data); typedef void *(*UIPrefsFunc) (void); typedef void *(*UIWidgetFunc) (gboolean vertical); typedef void *(*UIIconFunc) (void); // EventBus functions, provided by Cantus. typedef void *(*CantusPrefGetFunc) (const gchar *); // FIXME. typedef glong (*CantusAddListenerFunc) (const gchar *, GClosure *); #ifdef __cplusplus typedef glong (*CantusAddListenerSigCFunc)(const gchar *, sigc::slot1); #endif typedef glong (*CantusRemoveListenerFunc) (glong id); typedef glong (*CantusEmitFunc) (const gchar *, const GValue *); // Preferences functions, provided by Cantus. typedef void (*CantusPrefSet_intFunc) (const gchar *key, gint value); typedef gint (*CantusPrefGet_intFunc) (const gchar *key); typedef void (*CantusPrefSet_boolFunc) (const gchar *key, gboolean value); typedef gboolean (*CantusPrefGet_boolFunc) (const gchar *key); typedef void (*CantusPrefSet_charFunc) (const gchar *key, const gchar *value); typedef const gchar* (*CantusPrefGet_charFunc) (const gchar *key); // FileInfoManager functions, provided by Cantus. typedef CantusHash *(*CantusFileInfoGetFunc) (const gchar *filename); typedef void (*CantusFileInfoUnlockFunc)(const gchar *filename); #ifdef __cplusplus extern "C" { #endif /* Purpose: Plugin initializer. */ gint plugin_init(CantusHash *plugindata); /* Purpose: Plugin destructor. */ gint plugin_destroy(void); /* Purpose: Returns TRUE if the plugin is responsible for handling this * filetype, otherwise FALSE. */ gboolean plugin_handles(const gchar *filename); /* Purpose: Will be called to read a file's information into a hash. * Returns an errorcode < 0, or 0. */ gint plugin_read(const gchar *filename, CantusHash *info); /* Purpose: Will be called to write a file's information from a hash to the * filesystem. */ gint plugin_write(const gchar *filename, CantusHash *info); /* Returns the widget tree to show as edit-area. * NULL as a return value is forbidden! * If this function returns NULL, the plugin will be deactivated. */ GtkWidget *plugin_get_uiwidget(gboolean vertical); #ifdef __cplusplus } // extern "C" #endif #endif