* Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
#ifndef PURPLE_WHITEBOARD_H
#define PURPLE_WHITEBOARD_H
* @section_id: libpurple-whiteboard
* @short_description: <filename>whiteboard.h</filename>
* @title: Whiteboard Object
#define PURPLE_TYPE_WHITEBOARD (purple_whiteboard_get_type())
typedef struct _PurpleWhiteboard PurpleWhiteboard;
#define PURPLE_TYPE_WHITEBOARD_UI_OPS (purple_whiteboard_ui_ops_get_type())
typedef struct _PurpleWhiteboardUiOps PurpleWhiteboardUiOps;
typedef struct _PurpleWhiteboardOps PurpleWhiteboardOps;
* @create: create whiteboard
* @destroy: destory whiteboard
* @set_dimensions: set whiteboard dimensions
* @set_brush: set the size and color of the brush
* @draw_point: draw a point
* @draw_line: draw a line
* @clear: clear whiteboard
* The PurpleWhiteboard UI Operations
struct _PurpleWhiteboardUiOps
void (*create)(PurpleWhiteboard *wb);
void (*destroy)(PurpleWhiteboard *wb);
void (*set_dimensions)(PurpleWhiteboard *wb, int width, int height);
void (*set_brush) (PurpleWhiteboard *wb, int size, int color);
void (*draw_point)(PurpleWhiteboard *wb, int x, int y,
void (*draw_line)(PurpleWhiteboard *wb, int x1, int y1,
void (*clear)(PurpleWhiteboard *wb);
void (*_purple_reserved1)(void);
void (*_purple_reserved2)(void);
void (*_purple_reserved3)(void);
void (*_purple_reserved4)(void);
* @get_dimensions: get whiteboard dimensions
* @set_dimensions: set whiteboard dimensions
* @get_brush: get the brush size and color
* @set_brush: set the brush size and color
* @send_draw_list: send_draw_list function
* @clear: clear whiteboard
* Whiteboard protocol operations
struct _PurpleWhiteboardOps
void (*start)(PurpleWhiteboard *wb);
void (*end)(PurpleWhiteboard *wb);
void (*get_dimensions)(const PurpleWhiteboard *wb, int *width, int *height);
void (*set_dimensions)(PurpleWhiteboard *wb, int width, int height);
void (*get_brush) (const PurpleWhiteboard *wb, int *size, int *color);
void (*set_brush) (PurpleWhiteboard *wb, int size, int color);
void (*send_draw_list)(PurpleWhiteboard *wb, GList *draw_list);
void (*clear)(PurpleWhiteboard *wb);
void (*_purple_reserved1)(void);
void (*_purple_reserved2)(void);
void (*_purple_reserved3)(void);
void (*_purple_reserved4)(void);
* @ui_data: The UI data associated with this whiteboard. This is a convenience
* field provided to the UIs -- it is not used by the libpurple core.
/******************************************************************************/
/* PurpleWhiteboard API */
/******************************************************************************/
* purple_whiteboard_get_type:
* Returns: The #GType for the #PurpleWhiteboard object.
G_DECLARE_FINAL_TYPE(PurpleWhiteboard, purple_whiteboard, PURPLE, WHITEBOARD,
* purple_whiteboard_ui_ops_get_type:
* Returns: The #GType for the #PurpleWhiteboardUiOps boxed structure.
GType purple_whiteboard_ui_ops_get_type(void);
* purple_whiteboard_set_ui_ops:
* @ops: The UI operations to set
void purple_whiteboard_set_ui_ops(PurpleWhiteboardUiOps *ops);
* purple_whiteboard_set_protocol_ops:
* @wb: The whiteboard for which to set the protocol operations
* @ops: The protocol operations to set
* Sets the protocol operations for a whiteboard
void purple_whiteboard_set_protocol_ops(PurpleWhiteboard *wb, PurpleWhiteboardOps *ops);
* @who: Who you're drawing with.
* Creates a new whiteboard
* Returns: The new whiteboard
PurpleWhiteboard *purple_whiteboard_new(PurpleAccount *account, const char *who, int state);
* purple_whiteboard_get_account:
* Returns the whiteboard's account.
* Returns: (transfer none): The whiteboard's account.
PurpleAccount *purple_whiteboard_get_account(PurpleWhiteboard *wb);
* purple_whiteboard_get_who:
* Return who you're drawing with.
* Returns: Who you're drawing with.
const char *purple_whiteboard_get_who(PurpleWhiteboard *wb);
* purple_whiteboard_set_state:
* Set the state of the whiteboard.
void purple_whiteboard_set_state(PurpleWhiteboard *wb, int state);
* purple_whiteboard_get_state:
* Return the state of the whiteboard.
* Returns: The state of the whiteboard.
int purple_whiteboard_get_state(PurpleWhiteboard *wb);
* purple_whiteboard_start:
void purple_whiteboard_start(PurpleWhiteboard *wb);
* purple_whiteboard_get_session:
* Finds a whiteboard from an account and user.
* Returns: (transfer none): The whiteboard if found, otherwise %NULL.
PurpleWhiteboard *purple_whiteboard_get_session(const PurpleAccount *account, const char *who);
* purple_whiteboard_draw_list_destroy:
* @draw_list: (element-type gint): The drawing list.
* Destorys a drawing list for a whiteboard
void purple_whiteboard_draw_list_destroy(GList *draw_list);
* purple_whiteboard_get_dimensions:
* @width: The width to be set.
* @height: The height to be set.
* Gets the dimension of a whiteboard.
* Returns: TRUE if the values of width and height were set.
gboolean purple_whiteboard_get_dimensions(PurpleWhiteboard *wb, int *width, int *height);
* purple_whiteboard_set_dimensions:
* Sets the dimensions for a whiteboard.
void purple_whiteboard_set_dimensions(PurpleWhiteboard *wb, int width, int height);
* purple_whiteboard_draw_point:
* @color: The color to use.
* Draws a point on a whiteboard.
void purple_whiteboard_draw_point(PurpleWhiteboard *wb, int x, int y, int color, int size);
* purple_whiteboard_send_draw_list:
* @list: (element-type gint): A GList of points
* Send a list of points to draw to the buddy.
void purple_whiteboard_send_draw_list(PurpleWhiteboard *wb, GList *list);
* purple_whiteboard_draw_line:
* @x1: The top-left x coordinate.
* @y1: The top-left y coordinate.
* @x2: The bottom-right x coordinate.
* @y2: The bottom-right y coordinate.
* @color: The color to use.
* Draws a line on a whiteboard
void purple_whiteboard_draw_line(PurpleWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size);
* purple_whiteboard_clear:
void purple_whiteboard_clear(PurpleWhiteboard *wb);
* purple_whiteboard_send_clear:
* Sends a request to the buddy to clear the whiteboard.
void purple_whiteboard_send_clear(PurpleWhiteboard *wb);
* purple_whiteboard_send_brush:
* @size: The size of the brush
* @color: The color of the brush
* Sends a request to change the size and color of the brush.
void purple_whiteboard_send_brush(PurpleWhiteboard *wb, int size, int color);
* purple_whiteboard_get_brush:
* @size: The size of the brush
* @color: The color of the brush
* Gets the size and color of the brush.
* Returns: TRUE if the size and color were set.
gboolean purple_whiteboard_get_brush(PurpleWhiteboard *wb, int *size, int *color);
* purple_whiteboard_set_brush:
* @size: The size of the brush
* @color: The color of the brush
* Sets the size and color of the brush.
void purple_whiteboard_set_brush(PurpleWhiteboard *wb, int size, int color);
* purple_whiteboard_get_draw_list:
* Return the drawing list.
* Returns: (transfer none) (element-type gint): The drawing list
GList *purple_whiteboard_get_draw_list(PurpleWhiteboard *wb);
* purple_whiteboard_set_draw_list:
* @draw_list: (element-type gint): The drawing list.
void purple_whiteboard_set_draw_list(PurpleWhiteboard *wb, GList* draw_list);
* purple_whiteboard_set_protocol_data:
* @proto_data: The protocol data to set for the whiteboard.
* Sets the protocol data for a whiteboard.
void purple_whiteboard_set_protocol_data(PurpleWhiteboard *wb, gpointer proto_data);
* purple_whiteboard_get_protocol_data:
* Gets the protocol data for a whiteboard.
* Returns: The protocol data for the whiteboard.
gpointer purple_whiteboard_get_protocol_data(PurpleWhiteboard *wb);
* purple_whiteboard_set_ui_data:
* @ui_data: A pointer to associate with this whiteboard.
* Set the UI data associated with this whiteboard.
void purple_whiteboard_set_ui_data(PurpleWhiteboard *wb, gpointer ui_data);
* purple_whiteboard_get_ui_data:
* Get the UI data associated with this whiteboard.
* Returns: The UI data associated with this whiteboard. This is a
* convenience field provided to the UIs--it is not
* used by the libpurple core.
gpointer purple_whiteboard_get_ui_data(PurpleWhiteboard *wb);
#endif /* PURPLE_WHITEBOARD_H */