libpurple/sound-theme.h

Wed, 13 May 2009 20:29:03 +0000

author
Marcus Lundblad <malu@pidgin.im>
date
Wed, 13 May 2009 20:29:03 +0000
changeset 27110
05ca719b901b
parent 26385
91c16c785e03
child 32438
dc8991868906
permissions
-rw-r--r--

Support custom smileys in MUCs (when all participants support BoB and a maximum
of 10 participants are in the chat).
Always announce support for BoB, since disable custom smileys will still turn
off fetching them, and BoB can be used for other purposes further on.

23639
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
1 /**
c59dd2e328c3 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
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
3 */
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
4
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
5 /* purple
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
6 *
c59dd2e328c3 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
c59dd2e328c3 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
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
9 * source distribution.
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
10 *
c59dd2e328c3 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
c59dd2e328c3 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
c59dd2e328c3 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
c59dd2e328c3 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.
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
15 *
c59dd2e328c3 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,
c59dd2e328c3 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
c59dd2e328c3 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
c59dd2e328c3 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.
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
20 *
c59dd2e328c3 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
c59dd2e328c3 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
c59dd2e328c3 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
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
24 */
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
25
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
26 #ifndef PURPLE_SOUND_THEME_H
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
27 #define PURPLE_SOUND_THEME_H
23639
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
28
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
29 #include <glib.h>
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
30 #include <glib-object.h>
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
31 #include "theme.h"
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
32 #include "sound.h"
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
33
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
34 /**
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
35 * extends PurpleTheme (theme.h)
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
36 * A purple sound theme.
c59dd2e328c3 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.
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
38 *
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
39 * PurpleSoundTheme is a PurpleTheme Object.
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
40 */
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
41 typedef struct _PurpleSoundTheme PurpleSoundTheme;
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
42 typedef struct _PurpleSoundThemeClass PurpleSoundThemeClass;
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
43
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
44 #define PURPLE_TYPE_SOUND_THEME (purple_sound_theme_get_type())
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
45 #define PURPLE_SOUND_THEME(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_SOUND_THEME, PurpleSoundTheme))
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
46 #define PURPLE_SOUND_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_SOUND_THEME, PurpleSoundThemeClass))
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
47 #define PURPLE_IS_SOUND_THEME(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_SOUND_THEME))
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
48 #define PURPLE_IS_SOUND_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_SOUND_THEME))
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
49 #define PURPLE_SOUND_THEME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_SOUND_THEME, PurpleSoundThemeClass))
23639
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
50
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
51 struct _PurpleSoundTheme
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
52 {
23646
ec4f4e6508b1 fixed some gobject stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23642
diff changeset
53 PurpleTheme parent;
23639
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
54 gpointer priv;
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
55 };
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
56
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
57 struct _PurpleSoundThemeClass
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
58 {
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
59 PurpleThemeClass parent_class;
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
60 };
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
61
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
62 /**************************************************************************/
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
63 /** @name Purple Sound Theme API */
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
64 /**************************************************************************/
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
65 G_BEGIN_DECLS
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
66
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
67 /**
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
68 * GObject foo.
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
69 * @internal.
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
70 */
c59dd2e328c3 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);
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
72
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
73 /**
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
74 * Returns a copy of the filename for the sound event.
23639
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
75 *
26385
91c16c785e03 Fix more `make docs` warnings
Paul Aurich <darkrain42@pidgin.im>
parents: 25875
diff changeset
76 * @param theme The theme.
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
77 * @param event The purple sound event to look up.
23639
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
78 *
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
79 * @returns The filename of the sound event.
23639
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
80 */
23653
79934bf9a349 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: 23649
diff changeset
81 const gchar *purple_sound_theme_get_file(PurpleSoundTheme *theme,
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
82 const gchar *event);
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
83
23639
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
84 /**
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
85 * Returns a copy of the directory and filename for the sound event
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
86 *
26385
91c16c785e03 Fix more `make docs` warnings
Paul Aurich <darkrain42@pidgin.im>
parents: 25875
diff changeset
87 * @param theme The theme.
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
88 * @param event The purple sound event to look up
23639
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
89 *
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
90 * @returns The directory + '/' + filename of the sound event. This is
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
91 * a newly allocated string that should be freed with g_free.
23639
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
92 */
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
93 gchar *purple_sound_theme_get_file_full(PurpleSoundTheme *theme,
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
94 const gchar *event);
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
95
23639
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
96 /**
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
97 * Sets the filename for a given sound event
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
98 *
26385
91c16c785e03 Fix more `make docs` warnings
Paul Aurich <darkrain42@pidgin.im>
parents: 25875
diff changeset
99 * @param theme The theme.
91c16c785e03 Fix more `make docs` warnings
Paul Aurich <darkrain42@pidgin.im>
parents: 25875
diff changeset
100 * @param event the purple sound event to look up
91c16c785e03 Fix more `make docs` warnings
Paul Aurich <darkrain42@pidgin.im>
parents: 25875
diff changeset
101 * @param filename the name of the file to be used for the event
23639
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
102 */
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
103 void purple_sound_theme_set_file(PurpleSoundTheme *theme,
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
104 const gchar *event,
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
105 const gchar *filename);
23639
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
106
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
107 G_END_DECLS
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
108 #endif /* PURPLE_SOUND_THEME_H */

mercurial