annotate src/sound.h @ 12288:3897229ccb33

[gaim-migrate @ 14592] " This patch fixes two serious bugs in the hidden conversation/queuing code. First, it removes the need to explicitly present conversations created under queuing conditions. Instead, when an incoming message is received and a conversation does not exist, a hidden conversation is created in a received-im-msg signal handler by swapping out the create_conversation function in the gtkconv ui_ops. This fixes a bug which could allow conversations to be created in a hidden state when they should be visible (i.e. buddy pounce open an im window action). This required a second search for a conversation in server.c after the signal is emitted. Second, it fixes a bug which would cause gaim to crash when quitting with a queued message. Fixing this simplified the code a bit by removing the private_remove_gtkconv function and instead adding a check in gaim_gtk_conv_window_remove_gtkconv to prevent the hidden_convwin from being destroyed when the last conversation is removed." --charkins committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Fri, 02 Dec 2005 00:40:32 +0000
parents 58bc500cf226
children 5bc3d67ceb24
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
1 /**
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
2 * @file sound.h Sound API
9938
524a7f8efba3 [gaim-migrate @ 10830]
Ethan Blanton <elb@pidgin.im>
parents: 9713
diff changeset
3 * @ingroup core
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
4 *
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
5 * gaim
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
6 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7035
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7035
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7035
diff changeset
9 * source distribution.
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
10 *
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
14 * (at your option) any later version.
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
15 *
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
19 * GNU General Public License for more details.
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
20 *
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
24 */
4581
4b1e24835bbf [gaim-migrate @ 4864]
Nathan Walp <nwalp@pidgin.im>
parents: 4562
diff changeset
25 #ifndef _GAIM_SOUND_H_
4b1e24835bbf [gaim-migrate @ 4864]
Nathan Walp <nwalp@pidgin.im>
parents: 4562
diff changeset
26 #define _GAIM_SOUND_H_
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
27
11642
58bc500cf226 [gaim-migrate @ 13919]
Mark Doliner <mark@kingant.net>
parents: 10322
diff changeset
28 #include "account.h"
58bc500cf226 [gaim-migrate @ 13919]
Mark Doliner <mark@kingant.net>
parents: 10322
diff changeset
29
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
30 /**************************************************************************/
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
31 /** Data Structures */
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
32 /**************************************************************************/
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
33
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
34
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
35 /**
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
36 * A type of sound.
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
37 */
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
38
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
39 typedef enum _GaimSoundEventID
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
40 {
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
41 GAIM_SOUND_BUDDY_ARRIVE = 0, /**< Buddy signs on. */
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
42 GAIM_SOUND_BUDDY_LEAVE, /**< Buddy signs off. */
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
43 GAIM_SOUND_RECEIVE, /**< Receive an IM. */
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
44 GAIM_SOUND_FIRST_RECEIVE, /**< Receive an IM that starts a conv. */
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
45 GAIM_SOUND_SEND, /**< Send an IM. */
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
46 GAIM_SOUND_CHAT_JOIN, /**< Someone joins a chat. */
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
47 GAIM_SOUND_CHAT_LEAVE, /**< Someone leaves a chat. */
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
48 GAIM_SOUND_CHAT_YOU_SAY, /**< You say something in a chat. */
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
49 GAIM_SOUND_CHAT_SAY, /**< Someone else says somthing in a chat. */
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
50 GAIM_SOUND_POUNCE_DEFAULT, /**< Default sound for a buddy pounce. */
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
51 GAIM_SOUND_CHAT_NICK, /**< Someone says your name in a chat. */
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
52 GAIM_NUM_SOUNDS /**< Total number of sounds. */
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
53
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
54 } GaimSoundEventID;
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
55
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
56 typedef struct _GaimSoundUiOps
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
57 {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
58 void (*init)(void);
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 9938
diff changeset
59 void (*uninit)(void);
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
60 void (*play_file)(const char *filename);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
61 void (*play_event)(GaimSoundEventID event);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
62
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
63 } GaimSoundUiOps;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
64
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
65 #ifdef __cplusplus
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
66 extern "C" {
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
67 #endif
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
68
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
69 /**************************************************************************/
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
70 /** @name Sound API */
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
71 /**************************************************************************/
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
72 /*@{*/
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
73
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
74 /**
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 9938
diff changeset
75 * Plays the specified sound file.
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 9938
diff changeset
76 *
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 9938
diff changeset
77 * @param filename The file to play.
11642
58bc500cf226 [gaim-migrate @ 13919]
Mark Doliner <mark@kingant.net>
parents: 10322
diff changeset
78 * @param account The account that this sound is associated with, or
58bc500cf226 [gaim-migrate @ 13919]
Mark Doliner <mark@kingant.net>
parents: 10322
diff changeset
79 * NULL if the sound is not associated with any specific
58bc500cf226 [gaim-migrate @ 13919]
Mark Doliner <mark@kingant.net>
parents: 10322
diff changeset
80 * account. This is needed for the "sounds while away?"
58bc500cf226 [gaim-migrate @ 13919]
Mark Doliner <mark@kingant.net>
parents: 10322
diff changeset
81 * preference to work correctly.
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 9938
diff changeset
82 */
11642
58bc500cf226 [gaim-migrate @ 13919]
Mark Doliner <mark@kingant.net>
parents: 10322
diff changeset
83 void gaim_sound_play_file(const char *filename, const GaimAccount *account);
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 9938
diff changeset
84
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 9938
diff changeset
85 /**
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 9938
diff changeset
86 * Plays the sound associated with the specified event.
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 9938
diff changeset
87 *
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 9938
diff changeset
88 * @param event The event.
11642
58bc500cf226 [gaim-migrate @ 13919]
Mark Doliner <mark@kingant.net>
parents: 10322
diff changeset
89 * @param account The account that this sound is associated with, or
58bc500cf226 [gaim-migrate @ 13919]
Mark Doliner <mark@kingant.net>
parents: 10322
diff changeset
90 * NULL if the sound is not associated with any specific
58bc500cf226 [gaim-migrate @ 13919]
Mark Doliner <mark@kingant.net>
parents: 10322
diff changeset
91 * account. This is needed for the "sounds while away?"
58bc500cf226 [gaim-migrate @ 13919]
Mark Doliner <mark@kingant.net>
parents: 10322
diff changeset
92 * preference to work correctly.
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 9938
diff changeset
93 */
11642
58bc500cf226 [gaim-migrate @ 13919]
Mark Doliner <mark@kingant.net>
parents: 10322
diff changeset
94 void gaim_sound_play_event(GaimSoundEventID event, const GaimAccount *account);
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 9938
diff changeset
95
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 9938
diff changeset
96 /**
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
97 * Sets the UI sound operations
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
98 *
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
99 * @param ops The UI sound operations structure.
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
100 */
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
101 void gaim_sound_set_ui_ops(GaimSoundUiOps *ops);
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
102
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
103 /**
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
104 * Gets the UI sound operations
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
105 *
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
106 * @return The UI sound operations structure.
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
107 */
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
108 GaimSoundUiOps *gaim_sound_get_ui_ops(void);
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
109
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
110 /**
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
111 * Initializes the sound subsystem
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
112 */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
113 void gaim_sound_init(void);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
114
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
115 /**
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
116 * Shuts down the sound subsystem
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
117 */
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 9938
diff changeset
118 void gaim_sound_uninit(void);
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
119
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
120 /*@}*/
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
121
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
122 #ifdef __cplusplus
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
123 }
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
124 #endif
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
125
4581
4b1e24835bbf [gaim-migrate @ 4864]
Nathan Walp <nwalp@pidgin.im>
parents: 4562
diff changeset
126 #endif /* _GAIM_SOUND_H_ */