src/gtksound.h

Wed, 21 Dec 2005 18:36:19 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Wed, 21 Dec 2005 18:36:19 +0000
changeset 12600
7ecd4441fdc7
parent 12593
11cbffda6b14
permissions
-rw-r--r--

[gaim-migrate @ 14934]
Enable the extra warnings regardless of --enable-debug.

Enable FORTIFY_SOURCE regardless of --enable-debug, adding a --disable-fortify flag to configure.

Enable (well, stop disabling) the missing initializer warnings.
This leads to warnings with: GValue v = {0,}; that must be worked around.
Basically, instead of:
GValue v = {0,};
...
g_value_init(&v, G_TYPE_FOO); /* or other use of the GValue */
We'd need to do:
GValue v;
...
v.g_type = 0;
g_value_init(&v, G_TYPE_FOO); /* or other use of the GValue */

Fix several cases of missing initializers. I don't think any of these are bugs, but having this warning seems like a good idea. It might prevent us from making a mistake in the future.

While I was fixing missing initializers, I optimized substitute_simple_word in plugins/spellchk.c, in the same way as I did substitute_word before. Yes, I'm bad for committing these together.

Added a --enable-fatal-asserts flag to configure. As the name implies, this makes g_return_... guards fatal. This is a useful flag to run on a debug copy of Gaim. It will make it very clear if your changes have triggered one of these guards. It's also useful in detecting g_return_... abuse, which helps prevent crashes if Gaim is compiled with G_DISABLE_ASSERT defined.

5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
1 /**
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
2 * @file gtksound.h GTK+ Sound API
10322
06e23196da4b [gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents: 10320
diff changeset
3 * @ingroup gtkui
5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
4 *
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
5 * gaim
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
6 *
8046
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7035
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7035
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7035
diff changeset
9 * source distribution.
5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
10 *
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
14 * (at your option) any later version.
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
15 *
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
19 * GNU General Public License for more details.
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
20 *
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
24 */
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
25 #ifndef _GAIM_GTKSOUND_H_
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
26 #define _GAIM_GTKSOUND_H_
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
27
12593
11cbffda6b14 [gaim-migrate @ 14923]
Richard Laager <rlaager@pidgin.im>
parents: 12323
diff changeset
28 #include "sound.h"
11cbffda6b14 [gaim-migrate @ 14923]
Richard Laager <rlaager@pidgin.im>
parents: 12323
diff changeset
29
5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
30 /**************************************************************************/
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
31 /** @name GTK+ Sound API */
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
32 /**************************************************************************/
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
33 /*@{*/
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
34
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
35 /**
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
36 * Get the prefs option for an event.
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
37 *
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
38 * @param event The event.
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
39 * @return The option.
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
40 */
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
41 const char *gaim_gtk_sound_get_event_option(GaimSoundEventID event);
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
42
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
43 /**
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
44 * Get the label for an event.
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
45 *
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
46 * @param event The event.
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
47 * @return The label.
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
48 */
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
49 char *gaim_gtk_sound_get_event_label(GaimSoundEventID event);
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
50
10322
06e23196da4b [gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents: 10320
diff changeset
51 /**
06e23196da4b [gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents: 10320
diff changeset
52 * Gets GTK+ sound UI ops.
06e23196da4b [gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents: 10320
diff changeset
53 *
06e23196da4b [gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents: 10320
diff changeset
54 * @return The UI operations structure.
06e23196da4b [gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents: 10320
diff changeset
55 */
06e23196da4b [gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents: 10320
diff changeset
56 GaimSoundUiOps *gaim_gtk_sound_get_ui_ops(void);
06e23196da4b [gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents: 10320
diff changeset
57
06e23196da4b [gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents: 10320
diff changeset
58 /**
06e23196da4b [gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents: 10320
diff changeset
59 * Get the handle for the GTK+ sound system.
06e23196da4b [gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents: 10320
diff changeset
60 *
06e23196da4b [gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents: 10320
diff changeset
61 * @return The handle to the sound system
06e23196da4b [gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents: 10320
diff changeset
62 */
12323
f52908fb23b0 [gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents: 10322
diff changeset
63 void *gaim_gtk_sound_get_handle(void);
10322
06e23196da4b [gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents: 10320
diff changeset
64
5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
65 /*@}*/
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
66
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
67 #endif /* _GAIM_GTKSOUND_H_ */

mercurial