# HG changeset patch # User andrew.victor@mxit.com # Date 1314741749 0 # Node ID 2bf260b860866c082e2aa81faba73455c489b955 # Parent d5ddf2d1ee04878e87b5e165ba2cfd476e3be3b8 Add additional accessor functions for Whiteboard. diff -r d5ddf2d1ee04 -r 2bf260b86086 libpurple/whiteboard.c --- a/libpurple/whiteboard.c Tue Aug 30 21:00:29 2011 +0000 +++ b/libpurple/whiteboard.c Tue Aug 30 22:02:29 2011 +0000 @@ -90,6 +90,34 @@ g_free(wb); } +PurpleAccount *purple_whiteboard_get_account(const PurpleWhiteboard *wb) +{ + g_return_val_if_fail(wb != NULL, NULL); + + return wb->account; +} + +const char *purple_whiteboard_get_who(const PurpleWhiteboard *wb) +{ + g_return_val_if_fail(wb != NULL, NULL); + + return wb->who; +} + +void purple_whiteboard_set_state(PurpleWhiteboard *wb, int state) +{ + g_return_if_fail(wb != NULL); + + wb->state = state; +} + +int purple_whiteboard_get_state(const PurpleWhiteboard *wb) +{ + g_return_val_if_fail(wb != NULL, -1); + + return wb->state; +} + void purple_whiteboard_start(PurpleWhiteboard *wb) { /* Create frontend for whiteboard */ @@ -206,6 +234,20 @@ whiteboard_ui_ops->set_brush(wb, size, color); } +GList *purple_whiteboard_get_draw_list(const PurpleWhiteboard *wb) +{ + g_return_val_if_fail(wb != NULL, NULL); + + return wb->draw_list; +} + +void purple_whiteboard_set_draw_list(PurpleWhiteboard *wb, GList* draw_list) +{ + g_return_if_fail(wb != NULL); + + wb->draw_list = draw_list; +} + void purple_whiteboard_set_protocol_data(PurpleWhiteboard *wb, gpointer proto_data) { g_return_if_fail(wb != NULL); diff -r d5ddf2d1ee04 -r 2bf260b86086 libpurple/whiteboard.h --- a/libpurple/whiteboard.h Tue Aug 30 21:00:29 2011 +0000 +++ b/libpurple/whiteboard.h Tue Aug 30 22:02:29 2011 +0000 @@ -135,6 +135,41 @@ void purple_whiteboard_destroy(PurpleWhiteboard *wb); /** + * Returns the whiteboard's account. + * + * @param wb The whiteboard. + * + * @return The whiteboard's account. + */ +PurpleAccount *purple_whiteboard_get_account(const PurpleWhiteboard *wb); + +/** + * Return who you're drawing with. + * + * @param wb The whiteboard + * + * @return Who you're drawing with. + */ +const char *purple_whiteboard_get_who(const PurpleWhiteboard *wb); + +/** + * Set the state of the whiteboard. + * + * @param wb The whiteboard. + * @param state The state + */ +void purple_whiteboard_set_state(PurpleWhiteboard *wb, int state); + +/** + * Return the state of the whiteboard. + * + * @param wb The whiteboard. + * + * @return The state of the whiteboard. + */ +int purple_whiteboard_get_state(const PurpleWhiteboard *wb); + +/** * Starts a whiteboard * * @param wb The whiteboard. @@ -254,6 +289,23 @@ void purple_whiteboard_set_brush(PurpleWhiteboard *wb, int size, int color); /** + * Return the drawing list. + * + * @param wb The whiteboard. + * + * @return The drawing list + */ +GList *purple_whiteboard_get_draw_list(const PurpleWhiteboard *wb); + +/** + * Set the drawing list. + * + * @param wb The whiteboard + * @param draw_list The drawing list. + */ +void purple_whiteboard_set_draw_list(PurpleWhiteboard *wb, GList* draw_list); + +/** * Sets the protocol data for a whiteboard. * * @param wb The whiteboard.