XMMS2
|
00001 /* XMMS2 - X Music Multiplexer System 00002 * Copyright (C) 2003-2009 XMMS2 Team 00003 * 00004 * PLUGINS ARE NOT CONSIDERED TO BE DERIVED WORK !!! 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 */ 00016 00017 00018 00019 00020 #ifndef __XMMS_PLUGIN_INT_H__ 00021 #define __XMMS_PLUGIN_INT_H__ 00022 00023 #include "xmms/xmms_object.h" 00024 #include "xmms/xmms_plugin.h" 00025 #include "xmms/xmms_config.h" 00026 00027 #include <gmodule.h> 00028 00029 typedef struct xmms_plugin_St { 00030 xmms_object_t object; 00031 GModule *module; 00032 00033 xmms_plugin_type_t type; 00034 const gchar *name; 00035 const gchar *shortname; 00036 const gchar *description; 00037 const gchar *version; 00038 } xmms_plugin_t; 00039 00040 /* 00041 * Private functions 00042 */ 00043 00044 gboolean xmms_plugin_init (const gchar *path); 00045 void xmms_plugin_shutdown (void); 00046 void xmms_plugin_destroy (xmms_plugin_t *plugin); 00047 00048 typedef gboolean (*xmms_plugin_foreach_func_t)(xmms_plugin_t *, gpointer); 00049 void xmms_plugin_foreach (xmms_plugin_type_t type, xmms_plugin_foreach_func_t func, gpointer user_data); 00050 00051 xmms_plugin_t *xmms_plugin_find (xmms_plugin_type_t type, const gchar *name); 00052 00053 xmms_plugin_type_t xmms_plugin_type_get (const xmms_plugin_t *plugin); 00054 const char *xmms_plugin_name_get (const xmms_plugin_t *plugin); 00055 const gchar *xmms_plugin_shortname_get (const xmms_plugin_t *plugin); 00056 const gchar *xmms_plugin_version_get (const xmms_plugin_t *plugin); 00057 const char *xmms_plugin_description_get (const xmms_plugin_t *plugin); 00058 00059 xmms_config_property_t *xmms_plugin_config_lookup (xmms_plugin_t *plugin, const gchar *key); 00060 xmms_config_property_t *xmms_plugin_config_property_register (xmms_plugin_t *plugin, const gchar *name, const gchar *default_value, xmms_object_handler_t cb, gpointer userdata); 00061 00062 00063 #define XMMS_BUILTIN(type, api_ver, shname, name, ver, desc, setupfunc) \ 00064 const xmms_plugin_desc_t xmms_builtin_##shname = { \ 00065 type, \ 00066 api_ver, \ 00067 G_STRINGIFY(shname), \ 00068 name, \ 00069 ver, \ 00070 desc, \ 00071 setupfunc \ 00072 }; 00073 00074 #endif