Frameworks/libpurple.framework/Versions/0.6.2/Headers/whiteboard.h
changeset 2592 e8d15275025e
parent 1739 8b0daad9656c
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Frameworks/libpurple.framework/Versions/0.6.2/Headers/whiteboard.h	Fri Aug 21 13:25:11 2009 -0700
     1.3 @@ -0,0 +1,262 @@
     1.4 +/**
     1.5 + * @file whiteboard.h The PurpleWhiteboard core object
     1.6 + */
     1.7 +
     1.8 +/* purple
     1.9 + *
    1.10 + * Purple is the legal property of its developers, whose names are too numerous
    1.11 + * to list here.  Please refer to the COPYRIGHT file distributed with this
    1.12 + * source distribution.
    1.13 + *
    1.14 + * This program is free software; you can redistribute it and/or modify
    1.15 + * it under the terms of the GNU General Public License as published by
    1.16 + * the Free Software Foundation; either version 2 of the License, or
    1.17 + * (at your option) any later version.
    1.18 + *
    1.19 + * This program is distributed in the hope that it will be useful,
    1.20 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.22 + * GNU General Public License for more details.
    1.23 + *
    1.24 + * You should have received a copy of the GNU General Public License
    1.25 + * along with this program; if not, write to the Free Software
    1.26 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
    1.27 + */
    1.28 +
    1.29 +#ifndef _PURPLE_WHITEBOARD_H_
    1.30 +#define _PURPLE_WHITEBOARD_H_
    1.31 +
    1.32 +/**
    1.33 + * Whiteboard PRPL Operations
    1.34 + */
    1.35 +typedef struct _PurpleWhiteboardPrplOps PurpleWhiteboardPrplOps;
    1.36 +
    1.37 +#include "account.h"
    1.38 +
    1.39 +/**
    1.40 + * A PurpleWhiteboard
    1.41 + */
    1.42 +typedef struct _PurpleWhiteboard
    1.43 +{
    1.44 +	int state;                       /**< State of whiteboard session */
    1.45 +
    1.46 +	PurpleAccount *account;            /**< Account associated with this session */
    1.47 +	char *who;                       /**< Name of the remote user */
    1.48 +
    1.49 +	void *ui_data;                   /**< Graphical user-interface data */
    1.50 +	void *proto_data;                /**< Protocol specific data */
    1.51 +	PurpleWhiteboardPrplOps *prpl_ops; /**< Protocol-plugin operations */
    1.52 +
    1.53 +	GList *draw_list;                /**< List of drawing elements/deltas to send */
    1.54 +} PurpleWhiteboard;
    1.55 +
    1.56 +/**
    1.57 + * The PurpleWhiteboard UI Operations
    1.58 + */
    1.59 +typedef struct _PurpleWhiteboardUiOps
    1.60 +{
    1.61 +	void (*create)(PurpleWhiteboard *wb);                                 /**< create function */
    1.62 +	void (*destroy)(PurpleWhiteboard *wb);                               /**< destory function */
    1.63 +	void (*set_dimensions)(PurpleWhiteboard *wb, int width, int height); /**< set_dimensions function */
    1.64 +	void (*set_brush) (PurpleWhiteboard *wb, int size, int color);		/**< set the size and color of the brush */
    1.65 +	void (*draw_point)(PurpleWhiteboard *wb, int x, int y,
    1.66 +					   int color, int size);                           /**< draw_point function */
    1.67 +	void (*draw_line)(PurpleWhiteboard *wb, int x1, int y1,
    1.68 +					  int x2, int y2,
    1.69 +					  int color, int size);                            /**< draw_line function */
    1.70 +	void (*clear)(PurpleWhiteboard *wb);                                 /**< clear function */
    1.71 +
    1.72 +	void (*_purple_reserved1)(void);
    1.73 +	void (*_purple_reserved2)(void);
    1.74 +	void (*_purple_reserved3)(void);
    1.75 +	void (*_purple_reserved4)(void);
    1.76 +} PurpleWhiteboardUiOps;
    1.77 +
    1.78 +/**
    1.79 + * PurpleWhiteboard PRPL Operations
    1.80 + */
    1.81 +struct _PurpleWhiteboardPrplOps
    1.82 +{
    1.83 +	void (*start)(PurpleWhiteboard *wb);                                   /**< start function */
    1.84 +	void (*end)(PurpleWhiteboard *wb);                                     /**< end function */
    1.85 +	void (*get_dimensions)(const PurpleWhiteboard *wb, int *width, int *height); /**< get_dimensions function */
    1.86 +	void (*set_dimensions)(PurpleWhiteboard *wb, int width, int height);   /**< set_dimensions function */
    1.87 +	void (*get_brush) (const PurpleWhiteboard *wb, int *size, int *color); /**< get the brush size and color */
    1.88 +	void (*set_brush) (PurpleWhiteboard *wb, int size, int color);         /**< set the brush size and color */
    1.89 +	void (*send_draw_list)(PurpleWhiteboard *wb, GList *draw_list);        /**< send_draw_list function */
    1.90 +	void (*clear)(PurpleWhiteboard *wb);                                   /**< clear function */
    1.91 +
    1.92 +	void (*_purple_reserved1)(void);
    1.93 +	void (*_purple_reserved2)(void);
    1.94 +	void (*_purple_reserved3)(void);
    1.95 +	void (*_purple_reserved4)(void);
    1.96 +};
    1.97 +
    1.98 +#ifdef __cplusplus
    1.99 +extern "C" {
   1.100 +#endif /* __cplusplus */
   1.101 +
   1.102 +/******************************************************************************/
   1.103 +/** @name PurpleWhiteboard API                                                  */
   1.104 +/******************************************************************************/
   1.105 +/*@{*/
   1.106 +
   1.107 +/**
   1.108 + * Sets the UI operations
   1.109 + *
   1.110 + * @param ops The UI operations to set
   1.111 + */
   1.112 +void purple_whiteboard_set_ui_ops(PurpleWhiteboardUiOps *ops);
   1.113 +
   1.114 +/**
   1.115 + * Sets the prpl operations for a whiteboard
   1.116 + *
   1.117 + * @param wb  The whiteboard for which to set the prpl operations
   1.118 + * @param ops The prpl operations to set
   1.119 + */
   1.120 +void purple_whiteboard_set_prpl_ops(PurpleWhiteboard *wb, PurpleWhiteboardPrplOps *ops);
   1.121 +
   1.122 +/**
   1.123 + * Creates a whiteboard
   1.124 + *
   1.125 + * @param account The account.
   1.126 + * @param who     Who you're drawing with.
   1.127 + * @param state   The state.
   1.128 + *
   1.129 + * @return The new whiteboard
   1.130 + */
   1.131 +PurpleWhiteboard *purple_whiteboard_create(PurpleAccount *account, const char *who, int state);
   1.132 +
   1.133 +/**
   1.134 + * Destroys a whiteboard
   1.135 + *
   1.136 + * @param wb The whiteboard.
   1.137 + */
   1.138 +void purple_whiteboard_destroy(PurpleWhiteboard *wb);
   1.139 +
   1.140 +/**
   1.141 + * Starts a whiteboard
   1.142 + *
   1.143 + * @param wb The whiteboard.
   1.144 + */
   1.145 +void purple_whiteboard_start(PurpleWhiteboard *wb);
   1.146 +
   1.147 +/**
   1.148 + * Finds a whiteboard from an account and user.
   1.149 + *
   1.150 + * @param account The account.
   1.151 + * @param who     The user.
   1.152 + *
   1.153 + * @return The whiteboard if found, otherwise @c NULL.
   1.154 + */
   1.155 +PurpleWhiteboard *purple_whiteboard_get_session(const PurpleAccount *account, const char *who);
   1.156 +
   1.157 +/**
   1.158 + * Destorys a drawing list for a whiteboard
   1.159 + *
   1.160 + * @param draw_list The drawing list.
   1.161 + */
   1.162 +void purple_whiteboard_draw_list_destroy(GList *draw_list);
   1.163 +
   1.164 +/**
   1.165 + * Gets the dimension of a whiteboard.
   1.166 + *
   1.167 + * @param wb		The whiteboard.
   1.168 + * @param width		The width to be set.
   1.169 + * @param height	The height to be set.
   1.170 + *
   1.171 + * @return TRUE if the values of width and height were set.
   1.172 + */
   1.173 +gboolean purple_whiteboard_get_dimensions(const PurpleWhiteboard *wb, int *width, int *height);
   1.174 +
   1.175 +/**
   1.176 + * Sets the dimensions for a whiteboard.
   1.177 + *
   1.178 + * @param wb     The whiteboard.
   1.179 + * @param width  The width.
   1.180 + * @param height The height.
   1.181 + */
   1.182 +void purple_whiteboard_set_dimensions(PurpleWhiteboard *wb, int width, int height);
   1.183 +
   1.184 +/**
   1.185 + * Draws a point on a whiteboard.
   1.186 + *
   1.187 + * @param wb    The whiteboard.
   1.188 + * @param x     The x coordinate.
   1.189 + * @param y     The y coordinate.
   1.190 + * @param color The color to use.
   1.191 + * @param size  The brush size.
   1.192 + */
   1.193 +void purple_whiteboard_draw_point(PurpleWhiteboard *wb, int x, int y, int color, int size);
   1.194 +
   1.195 +/**
   1.196 + * Send a list of points to draw to the buddy.
   1.197 + *
   1.198 + * @param wb	The whiteboard
   1.199 + * @param list	A GList of points
   1.200 + */
   1.201 +void purple_whiteboard_send_draw_list(PurpleWhiteboard *wb, GList *list);
   1.202 +
   1.203 +/**
   1.204 + * Draws a line on a whiteboard
   1.205 + *
   1.206 + * @param wb    The whiteboard.
   1.207 + * @param x1    The top-left x coordinate.
   1.208 + * @param y1    The top-left y coordinate.
   1.209 + * @param x2    The bottom-right x coordinate.
   1.210 + * @param y2    The bottom-right y coordinate.
   1.211 + * @param color The color to use.
   1.212 + * @param size  The brush size.
   1.213 + */
   1.214 +void purple_whiteboard_draw_line(PurpleWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size);
   1.215 +
   1.216 +/**
   1.217 + * Clears a whiteboard
   1.218 + *
   1.219 + * @param wb The whiteboard.
   1.220 + */
   1.221 +void purple_whiteboard_clear(PurpleWhiteboard *wb);
   1.222 +
   1.223 +/**
   1.224 + * Sends a request to the buddy to clear the whiteboard.
   1.225 + *
   1.226 + * @param wb The whiteboard
   1.227 + */
   1.228 +void purple_whiteboard_send_clear(PurpleWhiteboard *wb);
   1.229 +
   1.230 +/**
   1.231 + * Sends a request to change the size and color of the brush.
   1.232 + *
   1.233 + * @param wb	The whiteboard
   1.234 + * @param size	The size of the brush
   1.235 + * @param color	The color of the brush
   1.236 + */
   1.237 +void purple_whiteboard_send_brush(PurpleWhiteboard *wb, int size, int color);
   1.238 +
   1.239 +/**
   1.240 + * Gets the size and color of the brush.
   1.241 + *
   1.242 + * @param wb	The whiteboard
   1.243 + * @param size	The size of the brush
   1.244 + * @param color	The color of the brush
   1.245 + *
   1.246 + * @return	TRUE if the size and color were set.
   1.247 + */
   1.248 +gboolean purple_whiteboard_get_brush(const PurpleWhiteboard *wb, int *size, int *color);
   1.249 +
   1.250 +/**
   1.251 + * Sets the size and color of the brush.
   1.252 + *
   1.253 + * @param wb	The whiteboard
   1.254 + * @param size	The size of the brush
   1.255 + * @param color	The color of the brush
   1.256 + */
   1.257 +void purple_whiteboard_set_brush(PurpleWhiteboard *wb, int size, int color);
   1.258 +
   1.259 +/*@}*/
   1.260 +
   1.261 +#ifdef __cplusplus
   1.262 +}
   1.263 +#endif /* __cplusplus */
   1.264 +
   1.265 +#endif /* _PURPLE_WHITEBOARD_H_ */