# HG changeset patch # User andrew.victor@mxit.com # Date 1314737032 0 # Node ID cea77667da7d25b35890d5898db3480f78bdf0c6 # Parent 3899615cef8ac645335f224ae6816a0d6e949f5c Added protocol_data and ui_data accessor functions for Whiteboard. diff -r 3899615cef8a -r cea77667da7d ChangeLog.API --- a/ChangeLog.API Tue Aug 30 20:21:33 2011 +0000 +++ b/ChangeLog.API Tue Aug 30 20:43:52 2011 +0000 @@ -20,6 +20,10 @@ * purple_roomlist_room_set_expanded_once * purple_roomlist_set_proto_data * purple_roomlist_set_ui_data + * purple_whiteboard_get_protocol_data + * purple_whiteboard_set_protocol_data + * purple_whiteboard_get_ui_data + * purple_whiteboard_set_ui_data * purple_xfer_get_protocol_data * purple_xfer_get_ui_data * purple_xfer_set_protocol_data diff -r 3899615cef8a -r cea77667da7d libpurple/ft.h --- a/libpurple/ft.h Tue Aug 30 20:21:33 2011 +0000 +++ b/libpurple/ft.h Tue Aug 30 20:43:52 2011 +0000 @@ -741,7 +741,7 @@ * Sets the protocol data for a file transfer. * * @param xfer The file transfer. - * @param protol_data The protocol data to set for the file transfer. + * @param protocol_data The protocol data to set for the file transfer. * * @since 3.0.0 */ diff -r 3899615cef8a -r cea77667da7d libpurple/whiteboard.c --- a/libpurple/whiteboard.c Tue Aug 30 20:21:33 2011 +0000 +++ b/libpurple/whiteboard.c Tue Aug 30 20:43:52 2011 +0000 @@ -206,3 +206,30 @@ whiteboard_ui_ops->set_brush(wb, size, color); } +void purple_whiteboard_set_protocol_data(PurpleWhiteboard *wb, gpointer proto_data) +{ + g_return_if_fail(wb != NULL); + + wb->proto_data = proto_data; +} + +gpointer purple_whiteboard_get_protocol_data(const PurpleWhiteboard *wb) +{ + g_return_val_if_fail(wb != NULL, NULL); + + return wb->proto_data; +} + +void purple_whiteboard_set_ui_data(PurpleWhiteboard *wb, gpointer ui_data) +{ + g_return_if_fail(wb != NULL); + + wb->ui_data = ui_data; +} + +gpointer purple_whiteboard_get_ui_data(const PurpleWhiteboard *wb) +{ + g_return_val_if_fail(wb != NULL, NULL); + + return wb->ui_data; +} diff -r 3899615cef8a -r cea77667da7d libpurple/whiteboard.h --- a/libpurple/whiteboard.h Tue Aug 30 20:21:33 2011 +0000 +++ b/libpurple/whiteboard.h Tue Aug 30 20:43:52 2011 +0000 @@ -253,6 +253,42 @@ */ void purple_whiteboard_set_brush(PurpleWhiteboard *wb, int size, int color); +/** + * Sets the protocol data for a whiteboard. + * + * @param wb The whiteboard. + * @param protocol_data The protocol data to set for the whiteboard. + */ +void purple_whiteboard_set_protocol_data(PurpleWhiteboard *wb, gpointer proto_data); + +/** + * Gets the protocol data for a whiteboard. + * + * @param wb The whiteboard. + * + * @return The protocol data for the whiteboard. + */ +gpointer purple_whiteboard_get_protocol_data(const PurpleWhiteboard *wb); + +/** + * Set the UI data associated with this whiteboard. + * + * @param wb The whiteboard. + * @param ui_data A pointer to associate with this whiteboard. + */ +void purple_whiteboard_set_ui_data(PurpleWhiteboard *wb, gpointer ui_data); + +/** + * Get the UI data associated with this whiteboard. + * + * @param wb The whiteboard.. + * + * @return 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(const PurpleWhiteboard *wb); + /*@}*/ #ifdef __cplusplus