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_ */
PurpleWhiteboardPrplOps * prpl_ops
Protocol-plugin operations.
Definition: whiteboard.h:48
gboolean purple_whiteboard_get_dimensions(const PurpleWhiteboard *wb, int *width, int *height)
Gets the dimension of a whiteboard.
void purple_whiteboard_set_prpl_ops(PurpleWhiteboard *wb, PurpleWhiteboardPrplOps *ops)
Sets the prpl operations for a whiteboard.
void purple_whiteboard_send_clear(PurpleWhiteboard *wb)
Sends a request to the buddy to clear the whiteboard.
void(* end)(PurpleWhiteboard *wb)
end function
Definition: whiteboard.h:81
void(* set_dimensions)(PurpleWhiteboard *wb, int width, int height)
set_dimensions function
Definition: whiteboard.h:83
void purple_whiteboard_set_ui_ops(PurpleWhiteboardUiOps *ops)
Sets the UI operations.
struct _PurpleWhiteboard PurpleWhiteboard
A PurpleWhiteboard.
void purple_whiteboard_send_draw_list(PurpleWhiteboard *wb, GList *list)
Send a list of points to draw to the buddy.
char * who
Name of the remote user.
Definition: whiteboard.h:44
void(* clear)(PurpleWhiteboard *wb)
clear function
Definition: whiteboard.h:87
void(* start)(PurpleWhiteboard *wb)
start function
Definition: whiteboard.h:80
A PurpleWhiteboard.
Definition: whiteboard.h:39
Structure representing an account.
Definition: account.h:126
void purple_whiteboard_draw_list_destroy(GList *draw_list)
Destorys a drawing list for a whiteboard.
int state
State of whiteboard session.
Definition: whiteboard.h:41
GList * draw_list
List of drawing elements/deltas to send.
Definition: whiteboard.h:50
void(* get_brush)(const PurpleWhiteboard *wb, int *size, int *color)
get the brush size and color
Definition: whiteboard.h:84
PurpleWhiteboard * purple_whiteboard_get_session(const PurpleAccount *account, const char *who)
Finds a whiteboard from an account and user.
PurpleAccount * account
Account associated with this session.
Definition: whiteboard.h:43
void(* send_draw_list)(PurpleWhiteboard *wb, GList *draw_list)
send_draw_list function
Definition: whiteboard.h:86
PurpleWhiteboard PRPL Operations.
Definition: whiteboard.h:78
Account API.
void purple_whiteboard_set_brush(PurpleWhiteboard *wb, int size, int color)
Sets the size and color of the brush.
struct _PurpleWhiteboardUiOps PurpleWhiteboardUiOps
The PurpleWhiteboard UI Operations.
void purple_whiteboard_send_brush(PurpleWhiteboard *wb, int size, int color)
Sends a request to change the size and color of the brush.
The PurpleWhiteboard UI Operations.
Definition: whiteboard.h:56
void * ui_data
Graphical user-interface data.
Definition: whiteboard.h:46
void(* destroy)(PurpleWhiteboard *wb)
destory function
Definition: whiteboard.h:59
void(* set_brush)(PurpleWhiteboard *wb, int size, int color)
set the brush size and color
Definition: whiteboard.h:85
void(* create)(PurpleWhiteboard *wb)
create function
Definition: whiteboard.h:58
void purple_whiteboard_destroy(PurpleWhiteboard *wb)
Destroys a whiteboard.
void(* clear)(PurpleWhiteboard *wb)
clear function
Definition: whiteboard.h:67
void * proto_data
Protocol specific data.
Definition: whiteboard.h:47
void purple_whiteboard_clear(PurpleWhiteboard *wb)
Clears a whiteboard.
void purple_whiteboard_draw_point(PurpleWhiteboard *wb, int x, int y, int color, int size)
Draws a point on a whiteboard.
void(* draw_line)(PurpleWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size)
draw_line function
Definition: whiteboard.h:64
void(* draw_point)(PurpleWhiteboard *wb, int x, int y, int color, int size)
draw_point function
Definition: whiteboard.h:62
void purple_whiteboard_set_dimensions(PurpleWhiteboard *wb, int width, int height)
Sets the dimensions for a whiteboard.
void(* get_dimensions)(const PurpleWhiteboard *wb, int *width, int *height)
get_dimensions function
Definition: whiteboard.h:82
void(* set_dimensions)(PurpleWhiteboard *wb, int width, int height)
set_dimensions function
Definition: whiteboard.h:60
void(* set_brush)(PurpleWhiteboard *wb, int size, int color)
set the size and color of the brush
Definition: whiteboard.h:61
gboolean purple_whiteboard_get_brush(const PurpleWhiteboard *wb, int *size, int *color)
Gets the size and color of the brush.
PurpleWhiteboard * purple_whiteboard_create(PurpleAccount *account, const char *who, int state)
Creates a whiteboard.
void purple_whiteboard_draw_line(PurpleWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size)
Draws a line on a whiteboard.
void purple_whiteboard_start(PurpleWhiteboard *wb)
Starts a whiteboard.