changeset 32000:cea77667da7d

Added protocol_data and ui_data accessor functions for Whiteboard.
author andrew.victor@mxit.com
date Tue, 30 Aug 2011 20:43:52 +0000
parents 3899615cef8a
children 9f869eb728ff
files ChangeLog.API libpurple/ft.h libpurple/whiteboard.c libpurple/whiteboard.h
diffstat 4 files changed, 68 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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
  */
--- 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;
+}
--- 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