annotate src/whiteboard.c @ 11902:391acec18e46

[gaim-migrate @ 14193] Grab the gaim.desktop file from oldstatus. Are there any other files we should get? I think the ChangeLogs and NEWS have already been fixed. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 30 Oct 2005 17:23:15 +0000
parents 2e3a6dcebaf3
children 2219f4bf4a57
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * gaim
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 *
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 * Gaim is the legal property of its developers, whose names are too numerous
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * source distribution.
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 *
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * (at your option) any later version.
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 *
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * GNU General Public License for more details.
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 *
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 *
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22 */
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 #include <string.h>
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 #include "whiteboard.h"
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #include "prpl.h"
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
29 /******************************************************************************
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
30 * Globals
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
31 *****************************************************************************/
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 static GaimWhiteboardUiOps *whiteboard_ui_ops = NULL;
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
33 /* static GaimWhiteboardPrplOps *whiteboard_prpl_ops = NULL; */
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 static GList *wbList = NULL;
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
37 /*static gboolean auto_accept = TRUE; */
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
39 /******************************************************************************
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
40 * API
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
41 *****************************************************************************/
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 void gaim_whiteboard_set_ui_ops( GaimWhiteboardUiOps *ops )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 {
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 whiteboard_ui_ops = ops;
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 }
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 void gaim_whiteboard_set_prpl_ops( GaimWhiteboard *wb, GaimWhiteboardPrplOps *ops )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 {
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 wb->prpl_ops = ops;
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 }
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 GaimWhiteboard *gaim_whiteboard_create( GaimAccount *account, char *who, int state )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 {
11506
88d504770c60 [gaim-migrate @ 13751]
Richard Laager <rlaager@wiktel.com>
parents: 11475
diff changeset
54 GaimPluginProtocolInfo *prpl_info;
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 GaimWhiteboard *wb = g_new0( GaimWhiteboard, 1 );
11506
88d504770c60 [gaim-migrate @ 13751]
Richard Laager <rlaager@wiktel.com>
parents: 11475
diff changeset
56
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 wb->account = account;
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 wb->state = state;
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 wb->who = g_strdup( who );
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
60
11506
88d504770c60 [gaim-migrate @ 13751]
Richard Laager <rlaager@wiktel.com>
parents: 11475
diff changeset
61 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO( account->gc->prpl );
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 gaim_whiteboard_set_prpl_ops( wb, prpl_info->whiteboard_prpl_ops );
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
63
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
64 /* Start up protocol specifics */
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 if( wb->prpl_ops && wb->prpl_ops->start )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 wb->prpl_ops->start( wb );
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
67
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 wbList = g_list_append( wbList, ( gpointer )( wb ) );
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
69
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 return( wb );
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 }
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 void gaim_whiteboard_destroy( GaimWhiteboard *wb )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 {
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 if( wb->ui_data )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 {
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
77 /* Destroy frontend */
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 if( whiteboard_ui_ops && whiteboard_ui_ops->destroy )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 whiteboard_ui_ops->destroy( wb );
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 }
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
81
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
82 /* Do protocol specific session ending procedures */
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83 if( wb->prpl_ops && wb->prpl_ops->end )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 wb->prpl_ops->end( wb );
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
85
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 if( wb )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 {
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88 wb->account = NULL;
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 wb->state = 0;
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
90
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 if( wb->who )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 g_free( wb->who );
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
93
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 wbList = g_list_remove( wbList, wb );
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
95
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 g_free( wb );
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 wb = NULL;
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98 }
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99 }
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101 void gaim_whiteboard_start( GaimWhiteboard *wb )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102 {
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
103 /* Create frontend for whiteboard */
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 if( whiteboard_ui_ops && whiteboard_ui_ops->create )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 whiteboard_ui_ops->create( wb );
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106 }
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
108 /* Looks through the list of whiteboard sessions for one that is between
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
109 * usernames 'me' and 'who'. Returns a pointer to a matching whiteboard
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
110 * session; if none match, it returns NULL.
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
111 */
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112 GaimWhiteboard *gaim_whiteboard_get_session( GaimAccount *account, char *who )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
113 {
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114 GaimWhiteboard *wb = NULL;
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
115
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 GList *l = wbList;
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
117
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
118 /* Look for a whiteboard session between the local user and the remote
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
119 * user
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
120 */
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121 while( l )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122 {
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123 wb = l->data;
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
124
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
125 if( !strcmp( gaim_account_get_username( wb->account ),
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
126 gaim_account_get_username( account ) ) &&
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127 !strcmp( wb->who, who ) )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 return( wb );
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
129
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
130 l = l->next;
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
131 }
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
132
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133 return( NULL );
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134 }
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
135
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
136 GList *gaim_whiteboard_draw_list_destroy( GList *draw_list )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
137 {
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
138 if( draw_list == NULL )
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
139 return( NULL );
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
140 else
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
141 {
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
142 /* Destroy the contents of this list */
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
143 int *n = NULL;
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
144 GList *l = draw_list;
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
145 while( l )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
146 {
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
147 n = l->data;
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
148
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
149 if( n )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
150 g_free( n );
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
151
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
152 l = l->next;
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
153 }
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
154
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
155 g_list_free( draw_list );
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
156 draw_list = NULL;
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
157 }
11802
2e3a6dcebaf3 [gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents: 11506
diff changeset
158
11475
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
159 return( draw_list );
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
160 }
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
161
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
162 void gaim_whiteboard_set_dimensions( GaimWhiteboard *wb, int width, int height )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
163 {
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
164 if( whiteboard_ui_ops && whiteboard_ui_ops->set_dimensions )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
165 whiteboard_ui_ops->set_dimensions( wb, width, height );
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
166 }
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
167
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
168 void gaim_whiteboard_draw_point( GaimWhiteboard *wb, int x, int y, int color, int size )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
169 {
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
170 if( whiteboard_ui_ops && whiteboard_ui_ops->draw_point )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
171 whiteboard_ui_ops->draw_point( wb, x, y, color, size );
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
172 }
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
173
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
174 void gaim_whiteboard_draw_line( GaimWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
175 {
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
176 if( whiteboard_ui_ops && whiteboard_ui_ops->draw_line )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
177 whiteboard_ui_ops->draw_line( wb, x1, y1, x2, y2, color, size );
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
178 }
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
179
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
180 void gaim_whiteboard_clear( GaimWhiteboard *wb )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
181 {
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
182 if( whiteboard_ui_ops && whiteboard_ui_ops->clear )
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
183 whiteboard_ui_ops->clear( wb );
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
184 }
7fab28c991f3 [gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
185