Mercurial > pidgin.yaz
comparison libpurple/whiteboard.h @ 15823:32c366eeeb99
sed -ie 's/gaim/purple/g'
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 19 Mar 2007 07:01:17 +0000 |
parents | c2d75b47198d |
children | 516f14bef90e |
comparison
equal
deleted
inserted
replaced
15822:84b0f9b23ede | 15823:32c366eeeb99 |
---|---|
1 /** | 1 /** |
2 * @file whiteboard.h The GaimWhiteboard core object | 2 * @file whiteboard.h The PurpleWhiteboard core object |
3 * | 3 * |
4 * gaim | 4 * purple |
5 * | 5 * |
6 * Gaim is the legal property of its developers, whose names are too numerous | 6 * Purple is the legal property of its developers, whose names are too numerous |
7 * to list here. Please refer to the COPYRIGHT file distributed with this | 7 * to list here. Please refer to the COPYRIGHT file distributed with this |
8 * source distribution. | 8 * source distribution. |
9 * | 9 * |
10 * This program is free software; you can redistribute it and/or modify | 10 * This program is free software; you can redistribute it and/or modify |
11 * it under the terms of the GNU General Public License as published by | 11 * it under the terms of the GNU General Public License as published by |
20 * You should have received a copy of the GNU General Public License | 20 * You should have received a copy of the GNU General Public License |
21 * along with this program; if not, write to the Free Software | 21 * along with this program; if not, write to the Free Software |
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 */ | 23 */ |
24 | 24 |
25 #ifndef _GAIM_WHITEBOARD_H_ | 25 #ifndef _PURPLE_WHITEBOARD_H_ |
26 #define _GAIM_WHITEBOARD_H_ | 26 #define _PURPLE_WHITEBOARD_H_ |
27 | 27 |
28 /** | 28 /** |
29 * Whiteboard PRPL Operations | 29 * Whiteboard PRPL Operations |
30 */ | 30 */ |
31 typedef struct _GaimWhiteboardPrplOps GaimWhiteboardPrplOps; | 31 typedef struct _PurpleWhiteboardPrplOps PurpleWhiteboardPrplOps; |
32 | 32 |
33 #include "account.h" | 33 #include "account.h" |
34 | 34 |
35 /** | 35 /** |
36 * A GaimWhiteboard | 36 * A PurpleWhiteboard |
37 */ | 37 */ |
38 typedef struct _GaimWhiteboard | 38 typedef struct _PurpleWhiteboard |
39 { | 39 { |
40 int state; /**< State of whiteboard session */ | 40 int state; /**< State of whiteboard session */ |
41 | 41 |
42 GaimAccount *account; /**< Account associated with this session */ | 42 PurpleAccount *account; /**< Account associated with this session */ |
43 char *who; /**< Name of the remote user */ | 43 char *who; /**< Name of the remote user */ |
44 | 44 |
45 void *ui_data; /**< Graphical user-interface data */ | 45 void *ui_data; /**< Graphical user-interface data */ |
46 void *proto_data; /**< Protocol specific data */ | 46 void *proto_data; /**< Protocol specific data */ |
47 GaimWhiteboardPrplOps *prpl_ops; /**< Protocol-plugin operations */ | 47 PurpleWhiteboardPrplOps *prpl_ops; /**< Protocol-plugin operations */ |
48 | 48 |
49 GList *draw_list; /**< List of drawing elements/deltas to send */ | 49 GList *draw_list; /**< List of drawing elements/deltas to send */ |
50 } GaimWhiteboard; | 50 } PurpleWhiteboard; |
51 | 51 |
52 /** | 52 /** |
53 * The GaimWhiteboard UI Operations | 53 * The PurpleWhiteboard UI Operations |
54 */ | 54 */ |
55 typedef struct _GaimWhiteboardUiOps | 55 typedef struct _PurpleWhiteboardUiOps |
56 { | 56 { |
57 void (*create)(GaimWhiteboard *wb); /**< create function */ | 57 void (*create)(PurpleWhiteboard *wb); /**< create function */ |
58 void (*destroy)(GaimWhiteboard *wb); /**< destory function */ | 58 void (*destroy)(PurpleWhiteboard *wb); /**< destory function */ |
59 void (*set_dimensions)(GaimWhiteboard *wb, int width, int height); /**< set_dimensions function */ | 59 void (*set_dimensions)(PurpleWhiteboard *wb, int width, int height); /**< set_dimensions function */ |
60 void (*set_brush) (GaimWhiteboard *wb, int size, int color); /**< set the size and color of the brush */ | 60 void (*set_brush) (PurpleWhiteboard *wb, int size, int color); /**< set the size and color of the brush */ |
61 void (*draw_point)(GaimWhiteboard *wb, int x, int y, | 61 void (*draw_point)(PurpleWhiteboard *wb, int x, int y, |
62 int color, int size); /**< draw_point function */ | 62 int color, int size); /**< draw_point function */ |
63 void (*draw_line)(GaimWhiteboard *wb, int x1, int y1, | 63 void (*draw_line)(PurpleWhiteboard *wb, int x1, int y1, |
64 int x2, int y2, | 64 int x2, int y2, |
65 int color, int size); /**< draw_line function */ | 65 int color, int size); /**< draw_line function */ |
66 void (*clear)(GaimWhiteboard *wb); /**< clear function */ | 66 void (*clear)(PurpleWhiteboard *wb); /**< clear function */ |
67 } GaimWhiteboardUiOps; | 67 } PurpleWhiteboardUiOps; |
68 | 68 |
69 /** | 69 /** |
70 * GaimWhiteboard PRPL Operations | 70 * PurpleWhiteboard PRPL Operations |
71 */ | 71 */ |
72 struct _GaimWhiteboardPrplOps | 72 struct _PurpleWhiteboardPrplOps |
73 { | 73 { |
74 void (*start)(GaimWhiteboard *wb); /**< start function */ | 74 void (*start)(PurpleWhiteboard *wb); /**< start function */ |
75 void (*end)(GaimWhiteboard *wb); /**< end function */ | 75 void (*end)(PurpleWhiteboard *wb); /**< end function */ |
76 void (*get_dimensions)(const GaimWhiteboard *wb, int *width, int *height); /**< get_dimensions function */ | 76 void (*get_dimensions)(const PurpleWhiteboard *wb, int *width, int *height); /**< get_dimensions function */ |
77 void (*set_dimensions)(GaimWhiteboard *wb, int width, int height); /**< set_dimensions function */ | 77 void (*set_dimensions)(PurpleWhiteboard *wb, int width, int height); /**< set_dimensions function */ |
78 void (*get_brush) (const GaimWhiteboard *wb, int *size, int *color); /**< get the brush size and color */ | 78 void (*get_brush) (const PurpleWhiteboard *wb, int *size, int *color); /**< get the brush size and color */ |
79 void (*set_brush) (GaimWhiteboard *wb, int size, int color); /**< set the brush size and color */ | 79 void (*set_brush) (PurpleWhiteboard *wb, int size, int color); /**< set the brush size and color */ |
80 void (*send_draw_list)(GaimWhiteboard *wb, GList *draw_list); /**< send_draw_list function */ | 80 void (*send_draw_list)(PurpleWhiteboard *wb, GList *draw_list); /**< send_draw_list function */ |
81 void (*clear)(GaimWhiteboard *wb); /**< clear function */ | 81 void (*clear)(PurpleWhiteboard *wb); /**< clear function */ |
82 }; | 82 }; |
83 | 83 |
84 #ifdef __cplusplus | 84 #ifdef __cplusplus |
85 extern "C" { | 85 extern "C" { |
86 #endif /* __cplusplus */ | 86 #endif /* __cplusplus */ |
87 | 87 |
88 /******************************************************************************/ | 88 /******************************************************************************/ |
89 /** @name GaimWhiteboard API */ | 89 /** @name PurpleWhiteboard API */ |
90 /******************************************************************************/ | 90 /******************************************************************************/ |
91 /*@{*/ | 91 /*@{*/ |
92 | 92 |
93 /** | 93 /** |
94 * Sets the UI operations | 94 * Sets the UI operations |
95 * | 95 * |
96 * @param ops The UI operations to set | 96 * @param ops The UI operations to set |
97 */ | 97 */ |
98 void gaim_whiteboard_set_ui_ops(GaimWhiteboardUiOps *ops); | 98 void purple_whiteboard_set_ui_ops(PurpleWhiteboardUiOps *ops); |
99 | 99 |
100 /** | 100 /** |
101 * Sets the prpl operations for a whiteboard | 101 * Sets the prpl operations for a whiteboard |
102 * | 102 * |
103 * @param wb The whiteboard for which to set the prpl operations | 103 * @param wb The whiteboard for which to set the prpl operations |
104 * @param ops The prpl operations to set | 104 * @param ops The prpl operations to set |
105 */ | 105 */ |
106 void gaim_whiteboard_set_prpl_ops(GaimWhiteboard *wb, GaimWhiteboardPrplOps *ops); | 106 void purple_whiteboard_set_prpl_ops(PurpleWhiteboard *wb, PurpleWhiteboardPrplOps *ops); |
107 | 107 |
108 /** | 108 /** |
109 * Creates a whiteboard | 109 * Creates a whiteboard |
110 * | 110 * |
111 * @param account The account. | 111 * @param account The account. |
112 * @param who Who you're drawing with. | 112 * @param who Who you're drawing with. |
113 * @param state The state. | 113 * @param state The state. |
114 * | 114 * |
115 * @return The new whiteboard | 115 * @return The new whiteboard |
116 */ | 116 */ |
117 GaimWhiteboard *gaim_whiteboard_create(GaimAccount *account, const char *who, int state); | 117 PurpleWhiteboard *purple_whiteboard_create(PurpleAccount *account, const char *who, int state); |
118 | 118 |
119 /** | 119 /** |
120 * Destroys a whiteboard | 120 * Destroys a whiteboard |
121 * | 121 * |
122 * @param wb The whiteboard. | 122 * @param wb The whiteboard. |
123 */ | 123 */ |
124 void gaim_whiteboard_destroy(GaimWhiteboard *wb); | 124 void purple_whiteboard_destroy(PurpleWhiteboard *wb); |
125 | 125 |
126 /** | 126 /** |
127 * Starts a whiteboard | 127 * Starts a whiteboard |
128 * | 128 * |
129 * @param wb The whiteboard. | 129 * @param wb The whiteboard. |
130 */ | 130 */ |
131 void gaim_whiteboard_start(GaimWhiteboard *wb); | 131 void purple_whiteboard_start(PurpleWhiteboard *wb); |
132 | 132 |
133 /** | 133 /** |
134 * Finds a whiteboard from an account and user. | 134 * Finds a whiteboard from an account and user. |
135 * | 135 * |
136 * @param account The account. | 136 * @param account The account. |
137 * @param who The user. | 137 * @param who The user. |
138 * | 138 * |
139 * @return The whiteboard if found, otherwise @c NULL. | 139 * @return The whiteboard if found, otherwise @c NULL. |
140 */ | 140 */ |
141 GaimWhiteboard *gaim_whiteboard_get_session(const GaimAccount *account, const char *who); | 141 PurpleWhiteboard *purple_whiteboard_get_session(const PurpleAccount *account, const char *who); |
142 | 142 |
143 /** | 143 /** |
144 * Destorys a drawing list for a whiteboard | 144 * Destorys a drawing list for a whiteboard |
145 * | 145 * |
146 * @param draw_list The drawing list. | 146 * @param draw_list The drawing list. |
147 */ | 147 */ |
148 void gaim_whiteboard_draw_list_destroy(GList *draw_list); | 148 void purple_whiteboard_draw_list_destroy(GList *draw_list); |
149 | 149 |
150 /** | 150 /** |
151 * Gets the dimension of a whiteboard. | 151 * Gets the dimension of a whiteboard. |
152 * | 152 * |
153 * @param wb The whiteboard. | 153 * @param wb The whiteboard. |
154 * @param width The width to be set. | 154 * @param width The width to be set. |
155 * @param height The height to be set. | 155 * @param height The height to be set. |
156 * | 156 * |
157 * @return TRUE if the values of width and height were set. | 157 * @return TRUE if the values of width and height were set. |
158 */ | 158 */ |
159 gboolean gaim_whiteboard_get_dimensions(const GaimWhiteboard *wb, int *width, int *height); | 159 gboolean purple_whiteboard_get_dimensions(const PurpleWhiteboard *wb, int *width, int *height); |
160 | 160 |
161 /** | 161 /** |
162 * Sets the dimensions for a whiteboard. | 162 * Sets the dimensions for a whiteboard. |
163 * | 163 * |
164 * @param wb The whiteboard. | 164 * @param wb The whiteboard. |
165 * @param width The width. | 165 * @param width The width. |
166 * @param height The height. | 166 * @param height The height. |
167 */ | 167 */ |
168 void gaim_whiteboard_set_dimensions(GaimWhiteboard *wb, int width, int height); | 168 void purple_whiteboard_set_dimensions(PurpleWhiteboard *wb, int width, int height); |
169 | 169 |
170 /** | 170 /** |
171 * Draws a point on a whiteboard. | 171 * Draws a point on a whiteboard. |
172 * | 172 * |
173 * @param wb The whiteboard. | 173 * @param wb The whiteboard. |
174 * @param x The x coordinate. | 174 * @param x The x coordinate. |
175 * @param y The y coordinate. | 175 * @param y The y coordinate. |
176 * @param color The color to use. | 176 * @param color The color to use. |
177 * @param size The brush size. | 177 * @param size The brush size. |
178 */ | 178 */ |
179 void gaim_whiteboard_draw_point(GaimWhiteboard *wb, int x, int y, int color, int size); | 179 void purple_whiteboard_draw_point(PurpleWhiteboard *wb, int x, int y, int color, int size); |
180 | 180 |
181 /** | 181 /** |
182 * Send a list of points to draw to the buddy. | 182 * Send a list of points to draw to the buddy. |
183 * | 183 * |
184 * @param wb The whiteboard | 184 * @param wb The whiteboard |
185 * @param list A GList of points | 185 * @param list A GList of points |
186 */ | 186 */ |
187 void gaim_whiteboard_send_draw_list(GaimWhiteboard *wb, GList *list); | 187 void purple_whiteboard_send_draw_list(PurpleWhiteboard *wb, GList *list); |
188 | 188 |
189 /** | 189 /** |
190 * Draws a line on a whiteboard | 190 * Draws a line on a whiteboard |
191 * | 191 * |
192 * @param wb The whiteboard. | 192 * @param wb The whiteboard. |
195 * @param x2 The bottom-right x coordinate. | 195 * @param x2 The bottom-right x coordinate. |
196 * @param y2 The bottom-right y coordinate. | 196 * @param y2 The bottom-right y coordinate. |
197 * @param color The color to use. | 197 * @param color The color to use. |
198 * @param size The brush size. | 198 * @param size The brush size. |
199 */ | 199 */ |
200 void gaim_whiteboard_draw_line(GaimWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size); | 200 void purple_whiteboard_draw_line(PurpleWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size); |
201 | 201 |
202 /** | 202 /** |
203 * Clears a whiteboard | 203 * Clears a whiteboard |
204 * | 204 * |
205 * @param wb The whiteboard. | 205 * @param wb The whiteboard. |
206 */ | 206 */ |
207 void gaim_whiteboard_clear(GaimWhiteboard *wb); | 207 void purple_whiteboard_clear(PurpleWhiteboard *wb); |
208 | 208 |
209 /** | 209 /** |
210 * Sends a request to the buddy to clear the whiteboard. | 210 * Sends a request to the buddy to clear the whiteboard. |
211 * | 211 * |
212 * @param wb The whiteboard | 212 * @param wb The whiteboard |
213 */ | 213 */ |
214 void gaim_whiteboard_send_clear(GaimWhiteboard *wb); | 214 void purple_whiteboard_send_clear(PurpleWhiteboard *wb); |
215 | 215 |
216 /** | 216 /** |
217 * Sends a request to change the size and color of the brush. | 217 * Sends a request to change the size and color of the brush. |
218 * | 218 * |
219 * @param wb The whiteboard | 219 * @param wb The whiteboard |
220 * @param size The size of the brush | 220 * @param size The size of the brush |
221 * @param color The color of the brush | 221 * @param color The color of the brush |
222 */ | 222 */ |
223 void gaim_whiteboard_send_brush(GaimWhiteboard *wb, int size, int color); | 223 void purple_whiteboard_send_brush(PurpleWhiteboard *wb, int size, int color); |
224 | 224 |
225 /** | 225 /** |
226 * Gets the size and color of the brush. | 226 * Gets the size and color of the brush. |
227 * | 227 * |
228 * @param wb The whiteboard | 228 * @param wb The whiteboard |
229 * @param size The size of the brush | 229 * @param size The size of the brush |
230 * @param color The color of the brush | 230 * @param color The color of the brush |
231 * | 231 * |
232 * @return TRUE if the size and color were set. | 232 * @return TRUE if the size and color were set. |
233 */ | 233 */ |
234 gboolean gaim_whiteboard_get_brush(const GaimWhiteboard *wb, int *size, int *color); | 234 gboolean purple_whiteboard_get_brush(const PurpleWhiteboard *wb, int *size, int *color); |
235 | 235 |
236 /** | 236 /** |
237 * Sets the size and color of the brush. | 237 * Sets the size and color of the brush. |
238 * | 238 * |
239 * @param wb The whiteboard | 239 * @param wb The whiteboard |
240 * @param size The size of the brush | 240 * @param size The size of the brush |
241 * @param color The color of the brush | 241 * @param color The color of the brush |
242 */ | 242 */ |
243 void gaim_whiteboard_set_brush(GaimWhiteboard *wb, int size, int color); | 243 void purple_whiteboard_set_brush(PurpleWhiteboard *wb, int size, int color); |
244 | 244 |
245 /*@}*/ | 245 /*@}*/ |
246 | 246 |
247 #ifdef __cplusplus | 247 #ifdef __cplusplus |
248 } | 248 } |
249 #endif /* __cplusplus */ | 249 #endif /* __cplusplus */ |
250 | 250 |
251 #endif /* _GAIM_WHITEBOARD_H_ */ | 251 #endif /* _PURPLE_WHITEBOARD_H_ */ |