pidgin/gtkwhiteboard.h

Tue, 07 Jul 2009 17:44:13 +0000

author
Paul Aurich <darkrain42@pidgin.im>
date
Tue, 07 Jul 2009 17:44:13 +0000
changeset 27660
f9d3ec6e177e
parent 20147
66f05a854eee
child 32394
f883709bdba4
child 32790
b95c7c504118
child 38089
da90fe7312d3
permissions
-rw-r--r--

Plug a leak of an account dropdown selection dialog or two.

The optmenu was being assigned to the wrong field, meaning it would be
created twice (the latter when pidgin_request_fields hits that field). On
top of that, the dropdown was being created even when the field isn't
visible (which, in the case of one active account and the New IM dialog,
it isn't).

Fixes a bunch of failed assertions in the debug log like:
g_log: purple_request_field_account_set_value: assertion `field->type == PURPLE_REQUEST_FIELD_ACCOUNT' failed

11475
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /**
15577
b8129373f65e More pidgin changes
Sean Egan <seanegan@pidgin.im>
parents: 15572
diff changeset
2 * @file gtkwhiteboard.h The PidginWhiteboard frontend object
20147
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
3 */
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
4
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
5 /* pidgin
11475
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 *
15572
e069b22c1fc4 headers to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
7 * Pidgin is the legal property of its developers, whose names are too numerous
11475
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * source distribution.
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 *
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * (at your option) any later version.
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 *
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * GNU General Public License for more details.
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 *
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 15931
diff changeset
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
11475
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 */
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
26 #ifndef _PIDGINWHITEBOARD_H_
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
27 #define _PIDGINWHITEBOARD_H_
11475
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28
15577
b8129373f65e More pidgin changes
Sean Egan <seanegan@pidgin.im>
parents: 15572
diff changeset
29 #include "pidgin.h"
11475
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 #include "whiteboard.h"
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32
11914
81ac838f3824 [gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11802
diff changeset
33 #define FULL_CIRCLE_DEGREES 23040
11475
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34
11914
81ac838f3824 [gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11802
diff changeset
35 /* TODO: Make into an enum. */
81ac838f3824 [gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11802
diff changeset
36 #define BRUSH_STATE_UP 0
81ac838f3824 [gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11802
diff changeset
37 #define BRUSH_STATE_DOWN 1
81ac838f3824 [gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11802
diff changeset
38 #define BRUSH_STATE_MOTION 2
11475
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39
11914
81ac838f3824 [gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11802
diff changeset
40 /* XXX: This seems duplicated with the Yahoo! Doodle prpl code.
81ac838f3824 [gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11802
diff changeset
41 * XXX: How should they work together? */
81ac838f3824 [gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11802
diff changeset
42 #define PALETTE_NUM_COLORS 7
11475
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43
11802
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
44 /**
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
45 * A PidginWhiteboard
11802
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
46 */
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
47 typedef struct _PidginWhiteboard
11475
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
49 PurpleWhiteboard *wb; /**< backend data for this whiteboard */
11802
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
50
11914
81ac838f3824 [gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11802
diff changeset
51 GtkWidget *window; /**< Window for the Doodle session */
81ac838f3824 [gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11802
diff changeset
52 GtkWidget *drawing_area; /**< Drawing area */
11802
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
53
11914
81ac838f3824 [gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11802
diff changeset
54 GdkPixmap *pixmap; /**< Memory for drawing area */
11802
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
55
11914
81ac838f3824 [gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11802
diff changeset
56 int width; /**< Canvas width */
81ac838f3824 [gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11802
diff changeset
57 int height; /**< Canvas height */
81ac838f3824 [gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11802
diff changeset
58 int brush_color; /**< Foreground color */
81ac838f3824 [gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11802
diff changeset
59 int brush_size; /**< Brush size */
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
60 } PidginWhiteboard;
11475
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61
11802
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
62 #ifdef __cplusplus
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
63 extern "C" {
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
64 #endif /* __cplusplus */
11475
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65
11802
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
66 /*****************************************************************************/
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
67 /** @name PidginWhiteboard API */
11802
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
68 /*****************************************************************************/
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
69 /*@{*/
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
70
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
71 /**
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
72 * Gets the GtkWhiteboard UI Operations.
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
73 *
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
74 * @return The GtkWhiteboard UI Operations.
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
75 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
76 PurpleWhiteboardUiOps *pidgin_whiteboard_get_ui_ops( void );
11475
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77
11802
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
78 /*@}*/
11475
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79
11802
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
80 #ifdef __cplusplus
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
81 }
b97b3fea95ce [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11475
diff changeset
82 #endif /* __cplusplus */
11475
1e222e6e52a0 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
84 #endif /* _PIDGINWHITEBOARD_H_ */

mercurial