annotate src/audacious/hook.h @ 2504:fcf730269639 trunk

[svn] - convert filename string to utf8 for playlist->title (closes bug #789)
author giacomo
date Mon, 12 Feb 2007 04:34:56 -0800
parents b7f77224ea03
children d226b83fa329
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2404
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
1 /* Audacious
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
2 * Copyright (c) 2006-2007 William Pitcock
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
3 *
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
4 * This program is free software; you can redistribute it and/or modify
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
6 * the Free Software Foundation; under version 2 of the License.
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
7 *
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
8 * This program is distributed in the hope that it will be useful,
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
11 * GNU General Public License for more details.
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
12 *
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
13 * You should have received a copy of the GNU General Public License
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
14 * along with this program; if not, write to the Free Software
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
16 */
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
17
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
18 #ifndef __AUDACIOUS_HOOK_H__
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
19 #define __AUDACIOUS_HOOK_H__
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
20
2457
b7f77224ea03 [svn] - now it's possible to pass user_data along with the hook function in hook_associate
giacomo
parents: 2404
diff changeset
21 #include <glib.h>
b7f77224ea03 [svn] - now it's possible to pass user_data along with the hook function in hook_associate
giacomo
parents: 2404
diff changeset
22
b7f77224ea03 [svn] - now it's possible to pass user_data along with the hook function in hook_associate
giacomo
parents: 2404
diff changeset
23 typedef void (*HookFunction)(gpointer hook_data, gpointer user_data);
b7f77224ea03 [svn] - now it's possible to pass user_data along with the hook function in hook_associate
giacomo
parents: 2404
diff changeset
24
b7f77224ea03 [svn] - now it's possible to pass user_data along with the hook function in hook_associate
giacomo
parents: 2404
diff changeset
25 typedef struct {
b7f77224ea03 [svn] - now it's possible to pass user_data along with the hook function in hook_associate
giacomo
parents: 2404
diff changeset
26 HookFunction func;
b7f77224ea03 [svn] - now it's possible to pass user_data along with the hook function in hook_associate
giacomo
parents: 2404
diff changeset
27 gpointer user_data;
b7f77224ea03 [svn] - now it's possible to pass user_data along with the hook function in hook_associate
giacomo
parents: 2404
diff changeset
28 } HookItem;
2404
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
29
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
30 typedef struct {
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
31 const gchar *name;
2457
b7f77224ea03 [svn] - now it's possible to pass user_data along with the hook function in hook_associate
giacomo
parents: 2404
diff changeset
32 GSList *items;
2404
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
33 } Hook;
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
34
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
35 void hook_register(const gchar *name);
2457
b7f77224ea03 [svn] - now it's possible to pass user_data along with the hook function in hook_associate
giacomo
parents: 2404
diff changeset
36 gint hook_associate(const gchar *name, HookFunction func, gpointer user_data);
b7f77224ea03 [svn] - now it's possible to pass user_data along with the hook function in hook_associate
giacomo
parents: 2404
diff changeset
37 gint hook_dissociate(const gchar *name, HookFunction func);
b7f77224ea03 [svn] - now it's possible to pass user_data along with the hook function in hook_associate
giacomo
parents: 2404
diff changeset
38 void hook_call(const gchar *name, gpointer hook_data);
2404
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
39
60f1bc20c19c [svn] - hooking implementation.
nenolod
parents:
diff changeset
40 #endif