diff src/whiteboard.c @ 12022:9d562dde0a3a

[gaim-migrate @ 14315] Whiteboard cleanup from sadrul. This also adds the ability to set the brush to the core. I noticed that none of the whiteboard stuff is in Changelog.API yet but I'm about to go to bed and am too lazy to do it right now. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 09 Nov 2005 04:42:42 +0000
parents 2219f4bf4a57
children ad33debf87b4
line wrap: on
line diff
--- a/src/whiteboard.c	Wed Nov 09 03:55:20 2005 +0000
+++ b/src/whiteboard.c	Wed Nov 09 04:42:42 2005 +0000
@@ -127,17 +127,38 @@
 }
 
 void gaim_whiteboard_draw_list_destroy(GList *draw_list)
-		{
+{
 	if (draw_list)
 		g_list_free(draw_list);
 }
 
+gboolean gaim_whiteboard_get_dimensions(GaimWhiteboard *wb, int *width, int *height)
+{
+	GaimWhiteboardPrplOps *prpl_ops = wb->prpl_ops;
+
+	if (prpl_ops && prpl_ops->get_dimensions)
+	{
+		prpl_ops->get_dimensions(wb, width, height);
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
 void gaim_whiteboard_set_dimensions(GaimWhiteboard *wb, int width, int height)
 {
 	if(whiteboard_ui_ops && whiteboard_ui_ops->set_dimensions)
 		whiteboard_ui_ops->set_dimensions(wb, width, height);
 }
 
+void gaim_whiteboard_send_draw_list(GaimWhiteboard *wb, GList *list)
+{
+	GaimWhiteboardPrplOps *prpl_ops = wb->prpl_ops;
+
+	if (prpl_ops && prpl_ops->send_draw_list)
+		prpl_ops->send_draw_list(wb, list);
+}
+
 void gaim_whiteboard_draw_point(GaimWhiteboard *wb, int x, int y, int color, int size)
 {
 	if(whiteboard_ui_ops && whiteboard_ui_ops->draw_point)
@@ -156,3 +177,37 @@
 		whiteboard_ui_ops->clear(wb);
 }
 
+void gaim_whiteboard_send_clear(GaimWhiteboard *wb)
+{
+	GaimWhiteboardPrplOps *prpl_ops = wb->prpl_ops;
+
+	if (prpl_ops && prpl_ops->clear)
+		prpl_ops->clear(wb);
+}
+
+void gaim_whiteboard_send_brush(GaimWhiteboard *wb, int size, int color)
+{
+	GaimWhiteboardPrplOps *prpl_ops = wb->prpl_ops;
+
+	if (prpl_ops && prpl_ops->set_brush)
+		prpl_ops->set_brush(wb, size, color);
+}
+
+gboolean gaim_whiteboard_get_brush(GaimWhiteboard *wb, int *size, int *color)
+{
+	GaimWhiteboardPrplOps *prpl_ops = wb->prpl_ops;
+
+	if (prpl_ops && prpl_ops->get_brush)
+	{
+		prpl_ops->get_brush(wb, size, color);
+		return TRUE;
+	}
+	return FALSE;
+}
+
+void gaim_whiteboard_set_brush(GaimWhiteboard *wb, int size, int color)
+{
+	if (whiteboard_ui_ops && whiteboard_ui_ops->set_brush)
+		whiteboard_ui_ops->set_brush(wb, size, color);
+}
+