XMMS2
xmms_plugin.h
Go to the documentation of this file.
1 /* XMMS2 - X Music Multiplexer System
2  * Copyright (C) 2003-2011 XMMS2 Team
3  *
4  * PLUGINS ARE NOT CONSIDERED TO BE DERIVED WORK !!!
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  */
16 
17 
18 
19 
20 #ifndef __XMMS_PLUGIN_INT_H__
21 #define __XMMS_PLUGIN_INT_H__
22 
23 #include "xmms/xmms_object.h"
24 #include "xmms/xmms_plugin.h"
25 #include "xmms/xmms_config.h"
26 
27 #include <gmodule.h>
28 
29 typedef struct xmms_plugin_St {
31  GModule *module;
32 
34  const gchar *name;
35  const gchar *shortname;
36  const gchar *description;
37  const gchar *version;
39 
40 /*
41  * Private functions
42  */
43 
44 gboolean xmms_plugin_init (const gchar *path);
45 void xmms_plugin_shutdown (void);
46 void xmms_plugin_destroy (xmms_plugin_t *plugin);
47 
48 typedef gboolean (*xmms_plugin_foreach_func_t)(xmms_plugin_t *, gpointer);
49 void xmms_plugin_foreach (xmms_plugin_type_t type, xmms_plugin_foreach_func_t func, gpointer user_data);
50 
51 xmms_plugin_t *xmms_plugin_find (xmms_plugin_type_t type, const gchar *name);
52 
54 const char *xmms_plugin_name_get (const xmms_plugin_t *plugin);
55 const gchar *xmms_plugin_shortname_get (const xmms_plugin_t *plugin);
56 const gchar *xmms_plugin_version_get (const xmms_plugin_t *plugin);
57 const char *xmms_plugin_description_get (const xmms_plugin_t *plugin);
58 
60 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);
61 
62 
63 #define XMMS_BUILTIN(type, api_ver, shname, name, ver, desc, setupfunc) \
64  const xmms_plugin_desc_t xmms_builtin_##shname = { \
65  type, \
66  api_ver, \
67  G_STRINGIFY(shname), \
68  name, \
69  ver, \
70  desc, \
71  setupfunc \
72  };
73 
74 #endif
xmms_plugin_type_t xmms_plugin_type_get(const xmms_plugin_t *plugin)
Definition: plugin.c:132
xmms_plugin_type_t
const char * xmms_plugin_description_get(const xmms_plugin_t *plugin)
Definition: plugin.c:184
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)
Definition: plugin.c:104
const char * xmms_plugin_name_get(const xmms_plugin_t *plugin)
Definition: plugin.c:145
const gchar * xmms_plugin_version_get(const xmms_plugin_t *plugin)
Definition: plugin.c:171
xmms_object_t object
Definition: xmms_plugin.h:30
void xmms_plugin_foreach(xmms_plugin_type_t type, xmms_plugin_foreach_func_t func, gpointer user_data)
Definition: plugin.c:406
gboolean xmms_plugin_init(const gchar *path)
Definition: plugin.c:219
const gchar * description
Definition: xmms_plugin.h:36
const gchar * version
Definition: xmms_plugin.h:37
GModule * module
Definition: xmms_plugin.h:31
const gchar * xmms_plugin_shortname_get(const xmms_plugin_t *plugin)
Definition: plugin.c:158
void xmms_plugin_destroy(xmms_plugin_t *plugin)
Definition: plugin.c:466
xmms_plugin_t * xmms_plugin_find(xmms_plugin_type_t type, const gchar *name)
Definition: plugin.c:445
struct xmms_plugin_St xmms_plugin_t
const gchar * shortname
Definition: xmms_plugin.h:35
void xmms_plugin_shutdown(void)
Definition: plugin.c:235
struct xmms_config_property_St xmms_config_property_t
Definition: xmms_config.h:26
const gchar * name
Definition: xmms_plugin.h:34
gboolean(* xmms_plugin_foreach_func_t)(xmms_plugin_t *, gpointer)
Definition: xmms_plugin.h:48
xmms_config_property_t * xmms_plugin_config_lookup(xmms_plugin_t *plugin, const gchar *key)
Definition: plugin.c:76
void(* xmms_object_handler_t)(xmms_object_t *object, xmmsv_t *data, gpointer userdata)
Definition: xmms_object.h:66
xmms_plugin_type_t type
Definition: xmms_plugin.h:33