From: Andrew D. <pu...@us...> - 2005-07-23 07:37:57
|
Update of /cvsroot/gaim/gaim/src/protocols/yahoo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv432/src/protocols/yahoo Modified Files: Tag: gaim-doodle yahoo_doodle.c yahoo_doodle.h Log Message: Local client now uses recieved drawing data to draw to whiteboard canvas. Fixed a foolish bug (when freeing GaimGtkWhiteboard memory). Index: yahoo_doodle.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/yahoo/Attic/yahoo_doodle.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -d -p -r1.1.2.3 -r1.1.2.4 --- yahoo_doodle.c 22 Jul 2005 21:25:16 -0000 1.1.2.3 +++ yahoo_doodle.c 23 Jul 2005 07:37:49 -0000 1.1.2.4 @@ -75,7 +75,6 @@ const int DefaultColorRGB24[] = //GdkColor DefaultColor[PALETTE_NUM_OF_COLORS]; // FUNCTIONS ============================================================================================ - /* // This function is called at the start of Gaim (twice?) // Anyhow... this is the biggy... I think :P @@ -115,9 +114,10 @@ gboolean goodle_load( GaimPlugin *plugin return( TRUE ); } + // ------------------------------------------------------------------------------------------------------ -*/ -/* + + // plugin_destroy is called when plugin is unloaded (unselected) gboolean goodle_unload( GaimPlugin *plugin ) { @@ -338,7 +338,7 @@ void yahoo_doodle_command_got_ready( Gai // TODO Call clear function (requires function to clear canvas (but not send clear command packet) // Ask whether to save picture too - //goodle_doodle_session_clear_canvas( ds ); + gaim_whiteboard_clear( wb ); } } @@ -390,10 +390,10 @@ void yahoo_doodle_command_got_draw( Gaim message = token_end + 1; } - //goodle_doodle_draw_stroke( ds, d_list ); + yahoo_doodle_draw_stroke( wb, d_list ); //goodle_doodle_session_set_canvas_as_icon( ds ); - + // Remove that shit int *n = NULL; GList *l = d_list; @@ -429,7 +429,7 @@ void yahoo_doodle_command_got_clear( Gai { // TODO Ask user whether to save the image before clearing it - //goodle_doodle_session_clear_canvas( ds ); + gaim_whiteboard_clear( wb ); } } @@ -810,18 +810,19 @@ void goodle_doodle_session_start( doodle // Make all this (window) visible gtk_widget_show( window ); - goodle_doodle_session_set_canvas_as_icon( ds ); - // Set default brush size and color ds->brush_size = DOODLE_BRUSH_MEDIUM; ds->brush_color = 0; // black } - +*/ // ------------------------------------------------------------------------------------------------------ -void goodle_doodle_draw_stroke( doodle_session *ds, GList *d_list ) +void yahoo_doodle_draw_stroke( GaimWhiteboard *wb, GList *d_list ) { // Traverse through the list and draw the points and lines + + //g_print( "Drawing: color=%d, size=%d, (%d,%d)\n", brush_color, brush_size, x, y ); + GList *l = d_list; int *n = NULL; @@ -840,8 +841,6 @@ void goodle_doodle_draw_stroke( doodle_s int count = 0; - //g_print( "Drawing: color=%d, size=%d, (%d,%d)\n", brush_color, brush_size, x, y ); - // Pray this works and pray that the list has an even number of elements while( l ) { @@ -850,20 +849,20 @@ void goodle_doodle_draw_stroke( doodle_s n = l->data; dx = *n; l = l->next; n = l->data; dy = *n; l = l->next; - goodle_doodle_session_draw_brush_line( ds->drawing_area, ds, - x, y, - x + dx, y + dy, - brush_color, brush_size ); + gaim_whiteboard_draw_line( wb, + x, y, + x + dx, y + dy, + brush_color, brush_size ); x = x + dx; y = y + dy; } - g_print( "Counted %d deltas\n", count ); + //g_print( "Counted %d deltas\n", count ); } // ------------------------------------------------------------------------------------------------------ - +/* char *goodle_doodle_session_build_draw_string( GList *d_list ) { GList *l = d_list; @@ -908,7 +907,7 @@ void goodle_doodle_session_button_clear_ yahoo_doodle_command_send_clear( ds->gc, ds->who ); - goodle_doodle_session_clear_canvas( ds ); + gaim_whiteboard_clear( wb ); } // ------------------------------------------------------------------------------------------------------ Index: yahoo_doodle.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/yahoo/Attic/yahoo_doodle.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -d -p -r1.1.2.2 -r1.1.2.3 --- yahoo_doodle.h 20 Jul 2005 03:14:35 -0000 1.1.2.2 +++ yahoo_doodle.h 23 Jul 2005 07:37:49 -0000 1.1.2.3 @@ -25,6 +25,9 @@ #ifndef _YAHOO_DOODLE_H_ #define _YAHOO_DOODLE_H_ +// INCLUDES ============================================================================================ +#include "whiteboard.h" + // DEFINES ============================================================================================= // Doodle communication commands @@ -114,11 +117,10 @@ void yahoo_doodle_command_send_extra( G void yahoo_doodle_command_send_confirm( GaimConnection *gc, char *to ); void yahoo_doodle_command_send_shutdown( GaimConnection *gc, char *to ); -/* -void goodle_doodle_session_start( doodle_session *ds ); +//void goodle_doodle_session_start( doodle_session *ds ); + +void yahoo_doodle_draw_stroke( GaimWhiteboard *wb, GList *d_list ); +//char *goodle_doodle_session_build_draw_string( GList *d_list ); -void goodle_doodle_draw_stroke( doodle_session *ds, GList *d_list ); -char *goodle_doodle_session_build_draw_string( GList *d_list ); -*/ #endif // _YAHOO_DOODLE_H_ |