annotate libpurple/sound-theme.h @ 25442:13574de83636

propagate from branch 'im.pidgin.cpw.malu.xmpp.attention' (head cbf0c3bd9fb3c235c896517b27d6ea14b2993e19) to branch 'im.pidgin.pidgin' (head 6531cebc9caa9fdf99847473e9f133ec4bfaf8db)
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 02 Mar 2009 06:26:15 +0000
parents 0c7b74fc558e
children b1c8ffbd48f9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23458
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
1 /**
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
2 * @file sound-theme.h Purple Sound Theme Abstact Class API
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
3 */
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
4
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
5 /* purple
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
6 *
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
7 * Purple is the legal property of its developers, whose names are too numerous
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
9 * source distribution.
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
10 *
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
14 * (at your option) any later version.
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
15 *
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
19 * GNU General Public License for more details.
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
20 *
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
24 */
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
25
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
26 #ifndef PURPLE_SOUND_THEME_H
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
27 #define PURPLE_SOUND_THEME_H
23458
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
28
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
29 #include <glib.h>
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
30 #include <glib-object.h>
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
31 #include "theme.h"
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
32 #include "sound.h"
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
33
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
34 /**
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
35 * extends PurpleTheme (theme.h)
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
36 * A purple sound theme.
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
37 * This is an object for Purple to represent a sound theme.
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
38 *
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
39 * PurpleSoundTheme is a PurpleTheme Object.
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
40 */
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
41 typedef struct _PurpleSoundTheme PurpleSoundTheme;
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
42 typedef struct _PurpleSoundThemeClass PurpleSoundThemeClass;
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
43
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
44 #define PURPLE_TYPE_SOUND_THEME (purple_sound_theme_get_type())
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
45 #define PURPLE_SOUND_THEME(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_SOUND_THEME, PurpleSoundTheme))
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
46 #define PURPLE_SOUND_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_SOUND_THEME, PurpleSoundThemeClass))
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
47 #define PURPLE_IS_SOUND_THEME(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_SOUND_THEME))
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
48 #define PURPLE_IS_SOUND_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_SOUND_THEME))
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
49 #define PURPLE_SOUND_THEME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_SOUND_THEME, PurpleSoundThemeClass))
23458
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
50
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
51 struct _PurpleSoundTheme
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
52 {
23465
d60c3d1c6966 fixed some gobject stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23461
diff changeset
53 PurpleTheme parent;
23458
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
54 gpointer priv;
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
55 };
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
56
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
57 struct _PurpleSoundThemeClass
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
58 {
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
59 PurpleThemeClass parent_class;
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
60 };
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
61
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
62 /**************************************************************************/
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
63 /** @name Purple Sound Theme API */
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
64 /**************************************************************************/
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
65 G_BEGIN_DECLS
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
66
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
67 /**
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
68 * GObject foo.
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
69 * @internal.
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
70 */
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
71 GType purple_sound_theme_get_type(void);
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
72
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
73 /**
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
74 * Returns a copy of the filename for the sound event.
23458
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
75 *
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
76 * @param event The purple sound event to look up.
23458
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
77 *
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
78 * @returns The filename of the sound event.
23458
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
79 */
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23468
diff changeset
80 const gchar *purple_sound_theme_get_file(PurpleSoundTheme *theme,
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
81 const gchar *event);
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
82
23458
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
83 /**
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
84 * Returns a copy of the directory and filename for the sound event
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
85 *
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
86 * @param event The purple sound event to look up
23458
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
87 *
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
88 * @returns The directory + '/' + filename of the sound event. This is
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
89 * a newly allocated string that should be freed with g_free.
23458
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
90 */
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
91 gchar *purple_sound_theme_get_file_full(PurpleSoundTheme *theme,
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
92 const gchar *event);
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
93
23458
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
94 /**
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
95 * Sets the filename for a given sound event
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
96 *
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
97 * @param event the purple sound event to look up
23468
cf7625d4d7e0 Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23465
diff changeset
98 * @param filename the name of the file to be used for the event
23458
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
99 */
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
100 void purple_sound_theme_set_file(PurpleSoundTheme *theme,
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
101 const gchar *event,
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
102 const gchar *filename);
23458
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
103
1cf10adc9b32 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
104 G_END_DECLS
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23472
diff changeset
105 #endif /* PURPLE_SOUND_THEME_H */