14192
+ ��膩��� 1 /**
+ ��膩��� 2 * @file whiteboard.h The GaimWhiteboard core object
+ ��膩��� 3 *
+ ��膩��� 4 * gaim
+ ��膩��� 5 *
+ ��膩��� 6 * Gaim 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
+ ��膩��� 8 * source distribution.
+ ��膩��� 9 *
+ ��膩��� 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
+ ��膩��� 12 * the Free Software Foundation; either version 2 of the License, or
+ ��膩��� 13 * (at your option) any later version.
+ ��膩��� 14 *
+ ��膩��� 15 * This program is distributed in the hope that it will be useful,
+ ��膩��� 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ��膩��� 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ��膩��� 18 * GNU General Public License for more details.
+ ��膩��� 19 *
+ ��膩��� 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
+ ��膩��� 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ ��膩��� 23 */
+ ��膩��� 24
+ ��膩��� 25 #ifndef _GAIM_WHITEBOARD_H_
+ ��膩��� 26 #define _GAIM_WHITEBOARD_H_
+ ��膩��� 27
+ ��膩��� 28 /**
+ ��膩��� 29 * Whiteboard PRPL Operations
+ ��膩��� 30 */
+ ��膩��� 31 typedef struct _GaimWhiteboardPrplOps GaimWhiteboardPrplOps;
+ ��膩��� 32
+ ��膩��� 33 #include "account.h"
+ ��膩��� 34
+ ��膩��� 35 /**
+ ��膩��� 36 * A GaimWhiteboard
+ ��膩��� 37 */
+ ��膩��� 38 typedef struct _GaimWhiteboard
+ ��膩��� 39 {
+ ��膩��� 40 int state; /**< State of whiteboard session */
+ ��膩��� 41
+ ��膩��� 42 GaimAccount *account; /**< Account associated with this session */
+ ��膩��� 43 char *who; /**< Name of the remote user */
+ ��膩��� 44
+ ��膩��� 45 void *ui_data; /**< Graphical user-interface data */
+ ��膩��� 46 void *proto_data; /**< Protocol specific data */
+ ��膩��� 47 GaimWhiteboardPrplOps *prpl_ops; /**< Protocol-plugin operations */
+ ��膩��� 48
+ ��膩��� 49 GList *draw_list; /**< List of drawing elements/deltas to send */
+ ��膩��� 50 } GaimWhiteboard;
+ ��膩��� 51
+ ��膩��� 52 /**
+ ��膩��� 53 * The GaimWhiteboard UI Operations
+ ��膩��� 54 */
+ ��膩��� 55 typedef struct _GaimWhiteboardUiOps
+ ��膩��� 56 {
+ ��膩��� 57 void (*create)(GaimWhiteboard *wb); /**< create function */
+ ��膩��� 58 void (*destroy)(GaimWhiteboard *wb); /**< destory function */
+ ��膩��� 59 void (*set_dimensions)(GaimWhiteboard *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 */
+ ��膩��� 61 void (*draw_point)(GaimWhiteboard *wb, int x, int y,
+ ��膩��� 62 int color, int size); /**< draw_point function */
+ ��膩��� 63 void (*draw_line)(GaimWhiteboard *wb, int x1, int y1,
+ ��膩��� 64 int x2, int y2,
+ ��膩��� 65 int color, int size); /**< draw_line function */
+ ��膩��� 66 void (*clear)(GaimWhiteboard *wb); /**< clear function */
+ ��膩��� 67 } GaimWhiteboardUiOps;
+ ��膩��� 68
+ ��膩��� 69 /**
+ ��膩��� 70 * GaimWhiteboard PRPL Operations
+ ��膩��� 71 */
+ ��膩��� 72 struct _GaimWhiteboardPrplOps
+ ��膩��� 73 {
+ ��膩��� 74 void (*start)(GaimWhiteboard *wb); /**< start function */
+ ��膩��� 75 void (*end)(GaimWhiteboard *wb); /**< end function */
+ ��膩��� 76 void (*get_dimensions)(GaimWhiteboard *wb, int *width, int *height); /**< get_dimensions function */
+ ��膩��� 77 void (*set_dimensions)(GaimWhiteboard *wb, int width, int height); /**< set_dimensions function */
+ ��膩��� 78 void (*get_brush) (GaimWhiteboard *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 */
+ ��膩��� 80 void (*send_draw_list)(GaimWhiteboard *wb, GList *draw_list); /**< send_draw_list function */
+ ��膩��� 81 void (*clear)(GaimWhiteboard *wb); /**< clear function */
+ ��膩��� 82 };
+ ��膩��� 83
+ ��膩��� 84 #ifdef __cplusplus
+ ��膩��� 85 extern "C" {
+ ��膩��� 86 #endif /* __cplusplus */
+ ��膩��� 87
+ ��膩��� 88 /******************************************************************************/
+ ��膩��� 89 /** @name GaimWhiteboard API */
+ ��膩��� 90 /******************************************************************************/
+ ��膩��� 91 /*@{*/
+ ��膩��� 92
+ ��膩��� 93 /**
+ ��膩��� 94 * Sets the UI operations
+ ��膩��� 95 *
+ ��膩��� 96 * @param ops The UI operations to set
+ ��膩��� 97 */
+ ��膩��� 98 void gaim_whiteboard_set_ui_ops(GaimWhiteboardUiOps *ops);
+ ��膩��� 99
+ ��膩��� 100 /**
+ ��膩��� 101 * Sets the prpl operations for a whiteboard
+ ��膩��� 102 *
+ ��膩��� 103 * @param wb The whiteboard for which to set the prpl operations
+ ��膩��� 104 * @param ops The prpl operations to set
+ ��膩��� 105 */
+ ��膩��� 106 void gaim_whiteboard_set_prpl_ops(GaimWhiteboard *wb, GaimWhiteboardPrplOps *ops);
+ ��膩��� 107
+ ��膩��� 108 /**
+ ��膩��� 109 * Creates a whiteboard
+ ��膩��� 110 *
+ ��膩��� 111 * @param account The account.
+ ��膩��� 112 * @param who Who you're drawing with.
+ ��膩��� 113 * @param state The state.
+ ��膩��� 114 *
+ ��膩��� 115 * @return The new whiteboard
+ ��膩��� 116 */
+ ��膩��� 117 GaimWhiteboard *gaim_whiteboard_create(GaimAccount *account, const char *who, int state);
+ ��膩��� 118
+ ��膩��� 119 /**
+ ��膩��� 120 * Destroys a whiteboard
+ ��膩��� 121 *
+ ��膩��� 122 * @param wb The whiteboard.
+ ��膩��� 123 */
+ ��膩��� 124 void gaim_whiteboard_destroy(GaimWhiteboard *wb);
+ ��膩��� 125
+ ��膩��� 126 /**
+ ��膩��� 127 * Starts a whiteboard
+ ��膩��� 128 *
+ ��膩��� 129 * @param wb The whiteboard.
+ ��膩��� 130 */
+ ��膩��� 131 void gaim_whiteboard_start(GaimWhiteboard *wb);
+ ��膩��� 132
+ ��膩��� 133 /**
+ ��膩��� 134 * Finds a whiteboard from an account and user.
+ ��膩��� 135 *
+ ��膩��� 136 * @param account The account.
+ ��膩��� 137 * @param who The user.
+ ��膩��� 138 *
+ ��膩��� 139 * @return The whiteboard if found, otherwise @c NULL.
+ ��膩��� 140 */
+ ��膩��� 141 GaimWhiteboard *gaim_whiteboard_get_session(GaimAccount *account, const char *who);
+ ��膩��� 142
+ ��膩��� 143 /**
+ ��膩��� 144 * Destorys a drawing list for a whiteboard
+ ��膩��� 145 *
+ ��膩��� 146 * @param draw_list The drawing list.
+ ��膩��� 147 */
+ ��膩��� 148 void gaim_whiteboard_draw_list_destroy(GList *draw_list);
+ ��膩��� 149
+ ��膩��� 150 /**
+ ��膩��� 151 * Gets the dimension of a whiteboard.
+ ��膩��� 152 *
+ ��膩��� 153 * @param wb The whiteboard.
+ ��膩��� 154 * @param width The width to be set.
+ ��膩��� 155 * @param height The height to be set.
+ ��膩��� 156 *
+ ��膩��� 157 * @return TRUE if the values of width and height were set.
+ ��膩��� 158 */
+ ��膩��� 159 gboolean gaim_whiteboard_get_dimensions(GaimWhiteboard *wb, int *width, int *height);
+ ��膩��� 160
+ ��膩��� 161 /**
+ ��膩��� 162 * Sets the dimensions for a whiteboard.
+ ��膩��� 163 *
+ ��膩��� 164 * @param wb The whiteboard.
+ ��膩��� 165 * @param width The width.
+ ��膩��� 166 * @param height The height.
+ ��膩��� 167 */
+ ��膩��� 168 void gaim_whiteboard_set_dimensions(GaimWhiteboard *wb, int width, int height);
+ ��膩��� 169
+ ��膩��� 170 /**
+ ��膩��� 171 * Draws a point on a whiteboard.
+ ��膩��� 172 *
+ ��膩��� 173 * @param wb The whiteboard.
+ ��膩��� 174 * @param x The x coordinate.
+ ��膩��� 175 * @param y The y coordinate.
+ ��膩��� 176 * @param color The color to use.
+ ��膩��� 177 * @param size The brush size.
+ ��膩��� 178 */
+ ��膩��� 179 void gaim_whiteboard_draw_point(GaimWhiteboard *wb, int x, int y, int color, int size);
+ ��膩��� 180
+ ��膩��� 181 /**
+ ��膩��� 182 * Send a list of points to draw to the buddy.
+ ��膩��� 183 *
+ ��膩��� 184 * @param wb The whiteboard
+ ��膩��� 185 * @param list A GList of points
+ ��膩��� 186 */
+ ��膩��� 187 void gaim_whiteboard_send_draw_list(GaimWhiteboard *wb, GList *list);
+ ��膩��� 188
+ ��膩��� 189 /**
+ ��膩��� 190 * Draws a line on a whiteboard
+ ��膩��� 191 *
+ ��膩��� 192 * @param wb The whiteboard.
+ ��膩��� 193 * @param x1 The top-left x coordinate.
+ ��膩��� 194 * @param y1 The top-left y coordinate.
+ ��膩��� 195 * @param x2 The bottom-right x coordinate.
+ ��膩��� 196 * @param y2 The bottom-right y coordinate.
+ ��膩��� 197 * @param color The color to use.
+ ��膩��� 198 * @param size The brush size.
+ ��膩��� 199 */
+ ��膩��� 200 void gaim_whiteboard_draw_line(GaimWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size);
+ ��膩��� 201
+ ��膩��� 202 /**
+ ��膩��� 203 * Clears a whiteboard
+ ��膩��� 204 *
+ ��膩��� 205 * @param wb The whiteboard.
+ ��膩��� 206 */
+ ��膩��� 207 void gaim_whiteboard_clear(GaimWhiteboard *wb);
+ ��膩��� 208
+ ��膩��� 209 /**
+ ��膩��� 210 * Sends a request to the buddy to clear the whiteboard.
+ ��膩��� 211 *
+ ��膩��� 212 * @param wb The whiteboard
+ ��膩��� 213 */
+ ��膩��� 214 void gaim_whiteboard_send_clear(GaimWhiteboard *wb);
+ ��膩��� 215
+ ��膩��� 216 /**
+ ��膩��� 217 * Sends a request to change the size and color of the brush.
+ ��膩��� 218 *
+ ��膩��� 219 * @param wb The whiteboard
+ ��膩��� 220 * @param size The size of the brush
+ ��膩��� 221 * @param color The color of the brush
+ ��膩��� 222 */
+ ��膩��� 223 void gaim_whiteboard_send_brush(GaimWhiteboard *wb, int size, int color);
+ ��膩��� 224
+ ��膩��� 225 /**
+ ��膩��� 226 * Gets the size and color of the brush.
+ ��膩��� 227 *
+ ��膩��� 228 * @param wb The whiteboard
+ ��膩��� 229 * @param size The size of the brush
+ ��膩��� 230 * @param color The color of the brush
+ ��膩��� 231 *
+ ��膩��� 232 * @return TRUE if the size and color were set.
+ ��膩��� 233 */
+ ��膩��� 234 gboolean gaim_whiteboard_get_brush(GaimWhiteboard *wb, int *size, int *color);
+ ��膩��� 235
+ ��膩��� 236 /**
+ ��膩��� 237 * Sets the size and color of the brush.
+ ��膩��� 238 *
+ ��膩��� 239 * @param wb The whiteboard
+ ��膩��� 240 * @param size The size of the brush
+ ��膩��� 241 * @param color The color of the brush
+ ��膩��� 242 */
+ ��膩��� 243 void gaim_whiteboard_set_brush(GaimWhiteboard *wb, int size, int color);
+ ��膩��� 244
+ ��膩��� 245 /*@}*/
+ ��膩��� 246
+ ��膩��� 247 #ifdef __cplusplus
+ ��膩��� 248 }
+ ��膩��� 249 #endif /* __cplusplus */
+ ��膩��� 250
+ ��膩��� 251 #endif /* _GAIM_WHITEBOARD_H_ */