libpurple/sound-theme.h

Mon, 16 Sep 2013 22:53:40 +0530

author
Ankit Vani <a@nevitus.org>
date
Mon, 16 Sep 2013 22:53:40 +0530
branch
soc.2013.gobjectification.plugins
changeset 36752
c726e758c59b
parent 34691
3acdd397a9c1
child 34994
dfcc9f64f58c
permissions
-rw-r--r--

Refactored finch grouping plugin to use the new plugin API

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 {
34691
3acdd397a9c1 Removed reserved fields from instance structs.
Ankit Vani <a@nevitus.org>
parents: 34530
diff changeset
53 /*< private >*/
23646
ec4f4e6508b1 fixed some gobject stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23642
diff changeset
54 PurpleTheme parent;
23639
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 {
34691
3acdd397a9c1 Removed reserved fields from instance structs.
Ankit Vani <a@nevitus.org>
parents: 34530
diff changeset
59 /*< private >*/
23639
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
60 PurpleThemeClass parent_class;
34530
a2471041078b Added missing padding members to theme components
Ankit Vani <a@nevitus.org>
parents: 32438
diff changeset
61
a2471041078b Added missing padding members to theme components
Ankit Vani <a@nevitus.org>
parents: 32438
diff changeset
62 void (*purple_reserved1)(void);
a2471041078b Added missing padding members to theme components
Ankit Vani <a@nevitus.org>
parents: 32438
diff changeset
63 void (*purple_reserved2)(void);
a2471041078b Added missing padding members to theme components
Ankit Vani <a@nevitus.org>
parents: 32438
diff changeset
64 void (*purple_reserved3)(void);
a2471041078b Added missing padding members to theme components
Ankit Vani <a@nevitus.org>
parents: 32438
diff changeset
65 void (*purple_reserved4)(void);
23639
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 /**************************************************************************/
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
69 /** @name Purple Sound Theme API */
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 G_BEGIN_DECLS
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 /**
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
74 * GObject foo.
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
75 * @internal.
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
76 */
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
77 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
78
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
79 /**
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
80 * 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
81 *
26385
91c16c785e03 Fix more `make docs` warnings
Paul Aurich <darkrain42@pidgin.im>
parents: 25875
diff changeset
82 * @param theme The theme.
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
83 * @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
84 *
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
85 * @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
86 */
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
87 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
88 const gchar *event);
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
89
23639
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
90 /**
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
91 * 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
92 *
26385
91c16c785e03 Fix more `make docs` warnings
Paul Aurich <darkrain42@pidgin.im>
parents: 25875
diff changeset
93 * @param theme The theme.
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
94 * @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
95 *
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
96 * @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
97 * 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
98 */
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
99 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
100 const gchar *event);
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
101
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 * 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
104 *
26385
91c16c785e03 Fix more `make docs` warnings
Paul Aurich <darkrain42@pidgin.im>
parents: 25875
diff changeset
105 * @param theme The theme.
91c16c785e03 Fix more `make docs` warnings
Paul Aurich <darkrain42@pidgin.im>
parents: 25875
diff changeset
106 * @param event the purple sound event to look up
91c16c785e03 Fix more `make docs` warnings
Paul Aurich <darkrain42@pidgin.im>
parents: 25875
diff changeset
107 * @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
108 */
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
109 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
110 const gchar *event,
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
111 const gchar *filename);
23639
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
112
c59dd2e328c3 Added minimal sound theme class (only get/set api)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
113 G_END_DECLS
25875
a98b16817658 Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents: 23653
diff changeset
114 #endif /* PURPLE_SOUND_THEME_H */

mercurial