# HG changeset patch # User William Pitcock # Date 1191734195 18000 # Node ID ddde4794b4e21f1813574893922bf61112766084 # Parent 0ef1a18a5583549f283ffba99bbf79f8d66d51f4 Export tuple formatter API. diff -r 0ef1a18a5583 -r ddde4794b4e2 src/audacious/plugin.h --- a/src/audacious/plugin.h Sun Oct 07 00:04:09 2007 -0500 +++ b/src/audacious/plugin.h Sun Oct 07 00:16:35 2007 -0500 @@ -257,6 +257,19 @@ const gint nfield, const gchar *field); + /* tuple formatter API */ + gchar *(*tuple_formatter_process_string)(Tuple *tuple, const gchar *string); + gchar *(*tuple_formatter_make_title_string)(Tuple *tuple, const gchar *string); + void (*tuple_formatter_register_expression)(const gchar *keyword, + gboolean (*func)(Tuple *tuple, const gchar *argument)); + void (*tuple_formatter_register_function)(const gchar *keyword, + gchar *(*func)(Tuple *tuple, gchar **argument)); + gchar *(*tuple_formatter_process_expr)(Tuple *tuple, const gchar *expression, + const gchar *argument); + gchar *(*tuple_formatter_process_function)(Tuple *tuple, const gchar *expression, + const gchar *argument); + gchar *(*tuple_formatter_process_construct)(Tuple *tuple, const gchar *string); + }; /* Convenience macros for accessing the public API. */ @@ -330,6 +343,14 @@ #define aud_tuple_get_int _audvt->tuple_get_int #define aud_tuple_free mowgli_object_unref +#define aud_tuple_formatter_process_string _audvt->tuple_formatter_process_string +#define aud_tuple_formatter_make_title_string _audvt->tuple_formatter_make_title_string +#define aud_tuple_formatter_register_expression _audvt->tuple_formatter_register_expression +#define aud_tuple_formatter_register_function _audvt->tuple_formatter_register_function +#define aud_tuple_formatter_process_expr _audvt->tuple_formatter_process_expr +#define aud_tuple_formatter_process_function _audvt->tuple_formatter_process_function +#define aud_tuple_formatter_process_construct _audvt->tuple_formatter_process_construct + /* for multi-file plugins :( */ extern struct _AudaciousFuncTableV1 *_audvt; diff -r 0ef1a18a5583 -r ddde4794b4e2 src/audacious/pluginenum.c --- a/src/audacious/pluginenum.c Sun Oct 07 00:04:09 2007 -0500 +++ b/src/audacious/pluginenum.c Sun Oct 07 00:16:35 2007 -0500 @@ -118,6 +118,14 @@ .tuple_get_value_type = tuple_get_value_type, .tuple_get_string = tuple_get_string, .tuple_get_int = tuple_get_int, + + .tuple_formatter_process_string = tuple_formatter_process_string, + .tuple_formatter_process_function = tuple_formatter_process_function, + .tuple_formatter_process_construct = tuple_formatter_process_construct, + .tuple_formatter_process_expr = tuple_formatter_process_expr, + .tuple_formatter_register_function = tuple_formatter_register_function, + .tuple_formatter_register_expression = tuple_formatter_register_expression, + .tuple_formatter_make_title_string = tuple_formatter_make_title_string, }; /*****************************************************************/