whiteboard.h
Go to the documentation of this file.
1 
5 /* purple
6  *
7  * Purple is the legal property of its developers, whose names are too numerous
8  * to list here. Please refer to the COPYRIGHT file distributed with this
9  * source distribution.
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
24  */
25 
26 #ifndef _PURPLE_WHITEBOARD_H_
27 #define _PURPLE_WHITEBOARD_H_
28 
33 
34 #include "account.h"
35 
39 typedef struct _PurpleWhiteboard
40 {
41  int state;
44  char *who;
46  void *ui_data;
47  void *proto_data;
50  GList *draw_list;
52 
56 typedef struct _PurpleWhiteboardUiOps
57 {
58  void (*create)(PurpleWhiteboard *wb);
59  void (*destroy)(PurpleWhiteboard *wb);
60  void (*set_dimensions)(PurpleWhiteboard *wb, int width, int height);
61  void (*set_brush) (PurpleWhiteboard *wb, int size, int color);
62  void (*draw_point)(PurpleWhiteboard *wb, int x, int y,
63  int color, int size);
64  void (*draw_line)(PurpleWhiteboard *wb, int x1, int y1,
65  int x2, int y2,
66  int color, int size);
67  void (*clear)(PurpleWhiteboard *wb);
69  void (*_purple_reserved1)(void);
70  void (*_purple_reserved2)(void);
71  void (*_purple_reserved3)(void);
72  void (*_purple_reserved4)(void);
74 
79 {
80  void (*start)(PurpleWhiteboard *wb);
81  void (*end)(PurpleWhiteboard *wb);
82  void (*get_dimensions)(const PurpleWhiteboard *wb, int *width, int *height);
83  void (*set_dimensions)(PurpleWhiteboard *wb, int width, int height);
84  void (*get_brush) (const PurpleWhiteboard *wb, int *size, int *color);
85  void (*set_brush) (PurpleWhiteboard *wb, int size, int color);
86  void (*send_draw_list)(PurpleWhiteboard *wb, GList *draw_list);
87  void (*clear)(PurpleWhiteboard *wb);
89  void (*_purple_reserved1)(void);
90  void (*_purple_reserved2)(void);
91  void (*_purple_reserved3)(void);
92  void (*_purple_reserved4)(void);
93 };
94 
95 #ifdef __cplusplus
96 extern "C" {
97 #endif /* __cplusplus */
98 
99 /******************************************************************************/
101 /******************************************************************************/
110 
118 
128 PurpleWhiteboard *purple_whiteboard_create(PurpleAccount *account, const char *who, int state);
129 
136 
143 
152 PurpleWhiteboard *purple_whiteboard_get_session(const PurpleAccount *account, const char *who);
153 
159 void purple_whiteboard_draw_list_destroy(GList *draw_list);
160 
170 gboolean purple_whiteboard_get_dimensions(const PurpleWhiteboard *wb, int *width, int *height);
171 
179 void purple_whiteboard_set_dimensions(PurpleWhiteboard *wb, int width, int height);
180 
190 void purple_whiteboard_draw_point(PurpleWhiteboard *wb, int x, int y, int color, int size);
191 
199 
211 void purple_whiteboard_draw_line(PurpleWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size);
212 
219 
226 
234 void purple_whiteboard_send_brush(PurpleWhiteboard *wb, int size, int color);
235 
245 gboolean purple_whiteboard_get_brush(const PurpleWhiteboard *wb, int *size, int *color);
246 
254 void purple_whiteboard_set_brush(PurpleWhiteboard *wb, int size, int color);
255 
258 #ifdef __cplusplus
259 }
260 #endif /* __cplusplus */
261 
262 #endif /* _PURPLE_WHITEBOARD_H_ */