Mercurial > pidgin
annotate src/whiteboard.c @ 12798:09d4ea834370
[gaim-migrate @ 15145]
SF Patch #1389870 from Bleeter, building on work in SF Patch #1114194 from Alex Badea
"Following on from #1114194, where I thought that
sending audibles is a little twitty because we can't
see what's going on, I also noted that it would be nice
if we could display the URL wheree the audible swf file
lived. The example URL provided only supported US
locales, which also needed addressing.
I've tested this patch with the Taiwain audible, named
within the patch, by confirming that the URL pattern
match actually works. Whether it actually works when
sent from a Taiwanese YIM native client, I have no
idea. It looks like it should.
Just to re-iterate: This patch displays the the
received audible's URL and text only, not the audible
swf file itself, nor does it send anything."
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Mon, 09 Jan 2006 22:28:17 +0000 |
parents | 9d562dde0a3a |
children | ad33debf87b4 |
rev | line source |
---|---|
11475 | 1 /* |
2 * gaim | |
3 * | |
4 * Gaim is the legal property of its developers, whose names are too numerous | |
5 * to list here. Please refer to the COPYRIGHT file distributed with this | |
6 * source distribution. | |
7 * | |
8 * This program is free software; you can redistribute it and/or modify | |
9 * it under the terms of the GNU General Public License as published by | |
10 * the Free Software Foundation; either version 2 of the License, or | |
11 * (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 * GNU General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program; if not, write to the Free Software | |
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 * | |
22 */ | |
23 | |
24 #include <string.h> | |
25 | |
26 #include "whiteboard.h" | |
27 #include "prpl.h" | |
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 *****************************************************************************/ |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
32 static GaimWhiteboardUiOps *whiteboard_ui_ops = NULL; |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
33 /* static GaimWhiteboardPrplOps *whiteboard_prpl_ops = NULL; */ |
11475 | 34 |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
35 static GList *wbList = NULL; |
11475 | 36 |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
37 /*static gboolean auto_accept = TRUE; */ |
11475 | 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 *****************************************************************************/ |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
42 void gaim_whiteboard_set_ui_ops(GaimWhiteboardUiOps *ops) |
11475 | 43 { |
44 whiteboard_ui_ops = ops; | |
45 } | |
46 | |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
47 void gaim_whiteboard_set_prpl_ops(GaimWhiteboard *wb, GaimWhiteboardPrplOps *ops) |
11475 | 48 { |
49 wb->prpl_ops = ops; | |
50 } | |
51 | |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
52 GaimWhiteboard *gaim_whiteboard_create(GaimAccount *account, const char *who, int state) |
11475 | 53 { |
11506
88d504770c60
[gaim-migrate @ 13751]
Richard Laager <rlaager@wiktel.com>
parents:
11475
diff
changeset
|
54 GaimPluginProtocolInfo *prpl_info; |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
55 GaimWhiteboard *wb = g_new0(GaimWhiteboard, 1); |
11506
88d504770c60
[gaim-migrate @ 13751]
Richard Laager <rlaager@wiktel.com>
parents:
11475
diff
changeset
|
56 |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
57 wb->account = account; |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
58 wb->state = state; |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
59 wb->who = g_strdup(who); |
11802
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
60 |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
61 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(account->gc->prpl); |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
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 */ |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
65 if(wb->prpl_ops && wb->prpl_ops->start) |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
66 wb->prpl_ops->start(wb); |
11802
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
67 |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
68 wbList = g_list_append(wbList, wb); |
11802
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
69 |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
70 return wb; |
11475 | 71 } |
72 | |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
73 void gaim_whiteboard_destroy(GaimWhiteboard *wb) |
11475 | 74 { |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
75 if(wb->ui_data) |
11475 | 76 { |
11802
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
77 /* Destroy frontend */ |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
78 if(whiteboard_ui_ops && whiteboard_ui_ops->destroy) |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
79 whiteboard_ui_ops->destroy(wb); |
11475 | 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 */ |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
83 if(wb->prpl_ops && wb->prpl_ops->end) |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
84 wb->prpl_ops->end(wb); |
11802
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
85 |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
86 if(wb) |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
87 { |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
88 if(wb->who) |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
89 g_free(wb->who); |
11802
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
90 |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
91 wbList = g_list_remove(wbList, wb); |
11802
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
92 |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
93 g_free(wb); |
11475 | 94 } |
95 } | |
96 | |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
97 void gaim_whiteboard_start(GaimWhiteboard *wb) |
11475 | 98 { |
11802
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
99 /* Create frontend for whiteboard */ |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
100 if(whiteboard_ui_ops && whiteboard_ui_ops->create) |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
101 whiteboard_ui_ops->create(wb); |
11475 | 102 } |
103 | |
11802
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
104 /* 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
|
105 * usernames 'me' and 'who'. Returns a pointer to a matching whiteboard |
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
106 * session; if none match, it returns NULL. |
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
107 */ |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
108 GaimWhiteboard *gaim_whiteboard_get_session(GaimAccount *account, const char *who) |
11475 | 109 { |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
110 GaimWhiteboard *wb = NULL; |
11802
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
111 |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
112 GList *l = wbList; |
11802
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
113 |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
114 /* Look for a whiteboard session between the local user and the remote user |
11802
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
115 */ |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
116 while(l != NULL) |
11475 | 117 { |
118 wb = l->data; | |
11802
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
119 |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
120 if(wb->account == account && !strcmp(wb->who, who)) |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
121 return wb; |
11802
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
122 |
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
123 l = l->next; |
11475 | 124 } |
11802
2e3a6dcebaf3
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
125 |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
126 return NULL; |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
127 } |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
128 |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
129 void gaim_whiteboard_draw_list_destroy(GList *draw_list) |
12022
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
130 { |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
131 if (draw_list) |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
132 g_list_free(draw_list); |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
133 } |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
134 |
12022
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
135 gboolean gaim_whiteboard_get_dimensions(GaimWhiteboard *wb, int *width, int *height) |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
136 { |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
137 GaimWhiteboardPrplOps *prpl_ops = wb->prpl_ops; |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
138 |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
139 if (prpl_ops && prpl_ops->get_dimensions) |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
140 { |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
141 prpl_ops->get_dimensions(wb, width, height); |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
142 return TRUE; |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
143 } |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
144 |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
145 return FALSE; |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
146 } |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
147 |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
148 void gaim_whiteboard_set_dimensions(GaimWhiteboard *wb, int width, int height) |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
149 { |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
150 if(whiteboard_ui_ops && whiteboard_ui_ops->set_dimensions) |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
151 whiteboard_ui_ops->set_dimensions(wb, width, height); |
11475 | 152 } |
153 | |
12022
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
154 void gaim_whiteboard_send_draw_list(GaimWhiteboard *wb, GList *list) |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
155 { |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
156 GaimWhiteboardPrplOps *prpl_ops = wb->prpl_ops; |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
157 |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
158 if (prpl_ops && prpl_ops->send_draw_list) |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
159 prpl_ops->send_draw_list(wb, list); |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
160 } |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
161 |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
162 void gaim_whiteboard_draw_point(GaimWhiteboard *wb, int x, int y, int color, int size) |
11475 | 163 { |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
164 if(whiteboard_ui_ops && whiteboard_ui_ops->draw_point) |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
165 whiteboard_ui_ops->draw_point(wb, x, y, color, size); |
11475 | 166 } |
167 | |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
168 void gaim_whiteboard_draw_line(GaimWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size) |
11475 | 169 { |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
170 if(whiteboard_ui_ops && whiteboard_ui_ops->draw_line) |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
171 whiteboard_ui_ops->draw_line(wb, x1, y1, x2, y2, color, size); |
11475 | 172 } |
173 | |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
174 void gaim_whiteboard_clear(GaimWhiteboard *wb) |
11475 | 175 { |
11914
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
176 if(whiteboard_ui_ops && whiteboard_ui_ops->clear) |
2219f4bf4a57
[gaim-migrate @ 14205]
Richard Laager <rlaager@wiktel.com>
parents:
11802
diff
changeset
|
177 whiteboard_ui_ops->clear(wb); |
11475 | 178 } |
179 | |
12022
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
180 void gaim_whiteboard_send_clear(GaimWhiteboard *wb) |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
181 { |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
182 GaimWhiteboardPrplOps *prpl_ops = wb->prpl_ops; |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
183 |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
184 if (prpl_ops && prpl_ops->clear) |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
185 prpl_ops->clear(wb); |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
186 } |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
187 |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
188 void gaim_whiteboard_send_brush(GaimWhiteboard *wb, int size, int color) |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
189 { |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
190 GaimWhiteboardPrplOps *prpl_ops = wb->prpl_ops; |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
191 |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
192 if (prpl_ops && prpl_ops->set_brush) |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
193 prpl_ops->set_brush(wb, size, color); |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
194 } |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
195 |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
196 gboolean gaim_whiteboard_get_brush(GaimWhiteboard *wb, int *size, int *color) |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
197 { |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
198 GaimWhiteboardPrplOps *prpl_ops = wb->prpl_ops; |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
199 |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
200 if (prpl_ops && prpl_ops->get_brush) |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
201 { |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
202 prpl_ops->get_brush(wb, size, color); |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
203 return TRUE; |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
204 } |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
205 return FALSE; |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
206 } |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
207 |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
208 void gaim_whiteboard_set_brush(GaimWhiteboard *wb, int size, int color) |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
209 { |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
210 if (whiteboard_ui_ops && whiteboard_ui_ops->set_brush) |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
211 whiteboard_ui_ops->set_brush(wb, size, color); |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
212 } |
9d562dde0a3a
[gaim-migrate @ 14315]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11914
diff
changeset
|
213 |