changeset 3754:74bed6b35161

export formatter and prefswin APIs
author William Pitcock <nenolod@atheme.org>
date Sun, 14 Oct 2007 19:38:49 -0500
parents 22d71f986b86
children 2ca446f02d97
files src/audacious/plugin.h src/audacious/pluginenum.c
diffstat 2 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/plugin.h	Sun Oct 14 17:47:13 2007 -0500
+++ b/src/audacious/plugin.h	Sun Oct 14 19:38:49 2007 -0500
@@ -98,6 +98,7 @@
 #include "audacious/hook.h"
 #include "audacious/xconvert.h"
 #include "audacious/ui_plugin_menu.h"
+#include "audacious/formatter.h"
 
 #define PLUGIN_COMMON_FIELDS		\
     gpointer handle;			\
@@ -533,6 +534,16 @@
     gint (*drct_pq_get_position)( gint pos );
     gint (*drct_pq_get_queue_position)( gint pos );
 
+    /* Formatter API */
+    Formatter *(*formatter_new)(void);
+    void (*formatter_destroy)(Formatter * formatter);
+    void (*formatter_associate)(Formatter * formatter, guchar id,
+                                gchar * value);
+    void (*formatter_dissociate)(Formatter * formatter, guchar id);
+    gchar *(*formatter_format)(Formatter * formatter, gchar * format);
+
+    gint (*prefswin_page_new)(GtkWidget *container, gchar *name, gchar *imgurl);
+    void (*prefswin_page_destroy)(GtkWidget *container);
 };
 
 /* Convenience macros for accessing the public API. */
@@ -828,6 +839,15 @@
 #define audacious_drct_pq_get_position		_audvt->drct_pq_get_position
 #define audacious_drct_pq_get_queue_position	_audvt->drct_pq_get_queue_position
 
+#define aud_formatter_new			_audvt->formatter_new
+#define aud_formatter_destroy			_audvt->formatter_destroy
+#define aud_formatter_associate			_audvt->formatter_associate
+#define aud_formatter_dissociate		_audvt->formatter_dissociate
+#define aud_formatter_format			_audvt->formatter_format
+
+#define aud_prefswin_page_new			_audvt->prefswin_page_new
+#define aud_prefswin_page_destroy		_audvt->prefswin_page_destroy
+
 #include "audacious/auddrct.h"
 
 /* for multi-file plugins :( */
--- a/src/audacious/pluginenum.c	Sun Oct 14 17:47:13 2007 -0500
+++ b/src/audacious/pluginenum.c	Sun Oct 14 19:38:49 2007 -0500
@@ -55,6 +55,8 @@
 #include "vfs_buffer.h"
 #include "vfs_buffered_file.h"
 
+#include "ui_preferences.h"
+
 const gchar *plugin_dir_list[] = {
     PLUGINSUBS,
     NULL
@@ -337,6 +339,15 @@
     .drct_pq_is_queued = drct_pq_is_queued,
     .drct_pq_get_position = drct_pq_get_position,
     .drct_pq_get_queue_position = drct_pq_get_queue_position,
+
+    .formatter_new = formatter_new,
+    .formatter_destroy = formatter_destroy,
+    .formatter_associate = formatter_associate,
+    .formatter_dissociate = formatter_dissociate,
+    .formatter_format = formatter_format,
+
+    .prefswin_page_new = prefswin_page_new,
+    .prefswin_page_destroy = prefswin_page_destroy,
 };
 
 /*****************************************************************/