changeset 3744:e2f8feddbb19

export hook API
author William Pitcock <nenolod@atheme.org>
date Sun, 14 Oct 2007 03:08:12 -0500
parents 587eec3cee14
children e26ac0692e8f
files src/audacious/plugin.h src/audacious/pluginenum.c
diffstat 2 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/plugin.h	Sun Oct 14 02:47:41 2007 -0500
+++ b/src/audacious/plugin.h	Sun Oct 14 03:08:12 2007 -0500
@@ -93,6 +93,7 @@
 #include "audacious/input.h"
 #include "audacious/mime.h"
 #include "audacious/custom_uri.h"
+#include "audacious/hook.h"
 
 #define PLUGIN_COMMON_FIELDS		\
     gpointer handle;			\
@@ -438,6 +439,12 @@
     /* state vars */
     InputPluginData *ip_state;
     BmpConfig *_cfg;
+
+    /* hook API */
+    void (*hook_register)(const gchar *name);
+    gint (*hook_associate)(const gchar *name, HookFunction func, gpointer user_data);
+    gint (*hook_dissociate)(const gchar *name, HookFunction func);
+    void (*hook_call)(const gchar *name, gpointer hook_data);
 };
 
 /* Convenience macros for accessing the public API. */
@@ -656,6 +663,11 @@
 #define aud_ip_state				_audvt->ip_state
 #define aud_cfg					_audvt->_cfg
 
+#define aud_hook_associate			_audvt->hook_associate
+#define aud_hook_dissociate			_audvt->hook_dissociate
+#define aud_hook_register			_audvt->hook_register
+#define aud_hook_call				_audvt->hook_call
+
 /* for multi-file plugins :( */
 extern struct _AudaciousFuncTableV1 *_audvt;
 
--- a/src/audacious/pluginenum.c	Sun Oct 14 02:47:41 2007 -0500
+++ b/src/audacious/pluginenum.c	Sun Oct 14 03:08:12 2007 -0500
@@ -262,6 +262,11 @@
 
     .ip_state = &ip_data,
     ._cfg = &cfg,
+
+    .hook_associate = hook_associate,
+    .hook_dissociate = hook_dissociate,
+    .hook_register = hook_register,
+    .hook_call = hook_call,
 };
 
 /*****************************************************************/