whiteboard.h

Go to the documentation of this file.
00001 
00005 /* purple
00006  *
00007  * Purple is the legal property of its developers, whose names are too numerous
00008  * to list here.  Please refer to the COPYRIGHT file distributed with this
00009  * source distribution.
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
00024  */
00025 
00026 #ifndef _PURPLE_WHITEBOARD_H_
00027 #define _PURPLE_WHITEBOARD_H_
00028 
00032 typedef struct _PurpleWhiteboardPrplOps PurpleWhiteboardPrplOps;
00033 
00034 #include "account.h"
00035 
00039 typedef struct _PurpleWhiteboard
00040 {
00041     int state;                       
00043     PurpleAccount *account;            
00044     char *who;                       
00046     void *ui_data;                   
00047     void *proto_data;                
00048     PurpleWhiteboardPrplOps *prpl_ops; 
00050     GList *draw_list;                
00051 } PurpleWhiteboard;
00052 
00056 typedef struct _PurpleWhiteboardUiOps
00057 {
00058     void (*create)(PurpleWhiteboard *wb);                                 
00059     void (*destroy)(PurpleWhiteboard *wb);                               
00060     void (*set_dimensions)(PurpleWhiteboard *wb, int width, int height); 
00061     void (*set_brush) (PurpleWhiteboard *wb, int size, int color);      
00062     void (*draw_point)(PurpleWhiteboard *wb, int x, int y,
00063                        int color, int size);                           
00064     void (*draw_line)(PurpleWhiteboard *wb, int x1, int y1,
00065                       int x2, int y2,
00066                       int color, int size);                            
00067     void (*clear)(PurpleWhiteboard *wb);                                 
00069     void (*_purple_reserved1)(void);
00070     void (*_purple_reserved2)(void);
00071     void (*_purple_reserved3)(void);
00072     void (*_purple_reserved4)(void);
00073 } PurpleWhiteboardUiOps;
00074 
00078 struct _PurpleWhiteboardPrplOps
00079 {
00080     void (*start)(PurpleWhiteboard *wb);                                   
00081     void (*end)(PurpleWhiteboard *wb);                                     
00082     void (*get_dimensions)(const PurpleWhiteboard *wb, int *width, int *height); 
00083     void (*set_dimensions)(PurpleWhiteboard *wb, int width, int height);   
00084     void (*get_brush) (const PurpleWhiteboard *wb, int *size, int *color); 
00085     void (*set_brush) (PurpleWhiteboard *wb, int size, int color);         
00086     void (*send_draw_list)(PurpleWhiteboard *wb, GList *draw_list);        
00087     void (*clear)(PurpleWhiteboard *wb);                                   
00089     void (*_purple_reserved1)(void);
00090     void (*_purple_reserved2)(void);
00091     void (*_purple_reserved3)(void);
00092     void (*_purple_reserved4)(void);
00093 };
00094 
00095 #ifdef __cplusplus
00096 extern "C" {
00097 #endif /* __cplusplus */
00098 
00099 /******************************************************************************/
00101 /******************************************************************************/
00109 void purple_whiteboard_set_ui_ops(PurpleWhiteboardUiOps *ops);
00110 
00117 void purple_whiteboard_set_prpl_ops(PurpleWhiteboard *wb, PurpleWhiteboardPrplOps *ops);
00118 
00128 PurpleWhiteboard *purple_whiteboard_create(PurpleAccount *account, const char *who, int state);
00129 
00135 void purple_whiteboard_destroy(PurpleWhiteboard *wb);
00136 
00142 void purple_whiteboard_start(PurpleWhiteboard *wb);
00143 
00152 PurpleWhiteboard *purple_whiteboard_get_session(const PurpleAccount *account, const char *who);
00153 
00159 void purple_whiteboard_draw_list_destroy(GList *draw_list);
00160 
00170 gboolean purple_whiteboard_get_dimensions(const PurpleWhiteboard *wb, int *width, int *height);
00171 
00179 void purple_whiteboard_set_dimensions(PurpleWhiteboard *wb, int width, int height);
00180 
00190 void purple_whiteboard_draw_point(PurpleWhiteboard *wb, int x, int y, int color, int size);
00191 
00198 void purple_whiteboard_send_draw_list(PurpleWhiteboard *wb, GList *list);
00199 
00211 void purple_whiteboard_draw_line(PurpleWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size);
00212 
00218 void purple_whiteboard_clear(PurpleWhiteboard *wb);
00219 
00225 void purple_whiteboard_send_clear(PurpleWhiteboard *wb);
00226 
00234 void purple_whiteboard_send_brush(PurpleWhiteboard *wb, int size, int color);
00235 
00245 gboolean purple_whiteboard_get_brush(const PurpleWhiteboard *wb, int *size, int *color);
00246 
00254 void purple_whiteboard_set_brush(PurpleWhiteboard *wb, int size, int color);
00255 
00258 #ifdef __cplusplus
00259 }
00260 #endif /* __cplusplus */
00261 
00262 #endif /* _PURPLE_WHITEBOARD_H_ */