--- a/src/gtkwhiteboard.c Tue Jul 19 23:14:35 2005 -0400
+++ b/src/gtkwhiteboard.c Fri Jul 22 17:25:16 2005 -0400
@@ -27,18 +27,34 @@
// GLOBALS =============================================================================================
-//GList *buttonList = NULL;
+//GList *buttonList = NULL; +int LastX; // Tracks last position of the mouse when drawing +int MotionCount; // Tracks how many brush motions made +int BrushState = BRUSH_STATE_UP; -int LastX; // Tracks last position of the mouse when drawing
-int MotionCount; // Tracks how many brush motions made
-int BrushState = BRUSH_STATE_UP;
+static GaimWhiteboardUiOps ui_ops = + gaim_gtk_whiteboard_create, + gaim_gtk_whiteboard_destroy, + gaim_gtk_whiteboard_draw_brush_point, + gaim_gtk_whiteboard_draw_brush_line // FUNCTIONS ============================================================================================
-GaimGtkWhiteboard *gaim_gtkwhiteboard_create( GaimWhiteboard *wb )
+GaimWhiteboardUiOps *gaim_gtk_whiteboard_get_ui_ops( void ) +// ------------------------------------------------------------------------------------------------------ +void gaim_gtk_whiteboard_create( GaimWhiteboard *wb ) + g_print( "gaim_gtk_whiteboard_create()\n" ); @@ -64,6 +80,10 @@
//GtkWidget *color_box[PALETTE_NUM_OF_COLORS];
GaimGtkWhiteboard *gtkwb = g_new0( GaimGtkWhiteboard, 1 );
+ gtkwb->wb = wb; // NOTE Pointer wrong address to link? + g_print( "-->wb=%p\n", wb ); + g_print( "-->ui_data=%p\n", wb->ui_data ); window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
@@ -72,7 +92,7 @@
gtk_window_set_resizable( ( GtkWindow* )( window ), FALSE );
g_signal_connect( G_OBJECT( window ), "destroy",
- G_CALLBACK( gaim_gtkwhiteboard_exit ), ( gpointer )( gtkwb ) );
+ G_CALLBACK( gaim_gtk_whiteboard_exit ), ( gpointer )( gtkwb ) ); // Create vertical box to place palette above the canvas and controls
vbox_palette_above_canvas_and_controls = gtk_vbox_new( FALSE, 0 );
@@ -108,20 +128,20 @@
// Signals used to handle backing pixmap
g_signal_connect( G_OBJECT( drawing_area ), "expose_event",
- G_CALLBACK( gaim_gtkwhiteboard_expose_event ), ( gpointer )( gtkwb ) );
+ G_CALLBACK( gaim_gtk_whiteboard_expose_event ), ( gpointer )( gtkwb ) ); g_signal_connect( G_OBJECT( drawing_area ), "configure_event",
- G_CALLBACK( gaim_gtkwhiteboard_configure_event ), ( gpointer )( gtkwb ) );
+ G_CALLBACK( gaim_gtk_whiteboard_configure_event ), ( gpointer )( gtkwb ) ); g_signal_connect( G_OBJECT( drawing_area ), "button_press_event",
- G_CALLBACK( gaim_gtkwhiteboard_brush_down ), ( gpointer )( gtkwb ) );
+ G_CALLBACK( gaim_gtk_whiteboard_brush_down ), ( gpointer )( gtkwb ) ); g_signal_connect( G_OBJECT( drawing_area ), "motion_notify_event",
- G_CALLBACK( gaim_gtkwhiteboard_brush_motion ), ( gpointer )( gtkwb ) );
+ G_CALLBACK( gaim_gtk_whiteboard_brush_motion ), ( gpointer )( gtkwb ) ); g_signal_connect( G_OBJECT( drawing_area ), "button_release_event",
- G_CALLBACK( gaim_gtkwhiteboard_brush_up ), ( gpointer )( gtkwb ) );
+ G_CALLBACK( gaim_gtk_whiteboard_brush_up ), ( gpointer )( gtkwb ) ); gtk_widget_set_events( drawing_area, GDK_EXPOSURE_MASK |
@@ -142,7 +162,7 @@
gtk_widget_show( clear_button );
g_signal_connect( G_OBJECT( clear_button ), "clicked",
- G_CALLBACK( gaim_gtkwhiteboard_button_clear_press ), ( gpointer )( gtkwb ) );
+ G_CALLBACK( gaim_gtk_whiteboard_button_clear_press ), ( gpointer )( gtkwb ) ); save_button = gtk_button_new_with_label( "Save" );
@@ -153,40 +173,47 @@
// Make all this (window) visible
gtk_widget_show( window );
- gaim_gtkwhiteboard_set_canvas_as_icon( gtkwb );
+ gaim_gtk_whiteboard_set_canvas_as_icon( gtkwb ); // TODO Specific protocol/whiteboard assignment here? Needs a UI Op?
// Set default brush size and color
//ds->brush_size = DOODLE_BRUSH_MEDIUM;
//ds->brush_color = 0; // black
// ------------------------------------------------------------------------------------------------------
-void gaim_gtkwhiteboard_destroy( GaimGtkWhiteboard *gtkwb )
+void gaim_gtk_whiteboard_destroy( GaimWhiteboard *wb ) + g_print( "gaim_gtk_whiteboard_destroy()\n" ); + GaimGtkWhiteboard *gtkwb = wb->ui_data; + g_print( "-->wb =%p\n", wb ); + g_print( "-->ui_data=%p\n", wb->ui_data ); + g_print( "-->gtkwb =%p\n", gtkwb ); // TODO Ask if user wants to save picture before the session is closed
// Clear pixmap memory before we remove this session from the Doodle session list
g_object_unref( gtkwb->pixmap );
// NOTE Correct order below? Will it break anything?
gaim_whiteboard_destroy( gtkwb->wb );
// ------------------------------------------------------------------------------------------------------
-void gaim_gtkwhiteboard_exit( GtkWidget *widget, gpointer data )
+void gaim_gtk_whiteboard_exit( GtkWidget *widget, gpointer data ) + g_print( "gaim_gtk_whiteboard_exit()\n" ); GaimGtkWhiteboard *gtkwb = ( GaimGtkWhiteboard* )( data );
- gaim_gtkwhiteboard_destroy( gtkwb );
+ gaim_gtk_whiteboard_destroy( gtkwb->wb ); // ------------------------------------------------------------------------------------------------------
@@ -216,7 +243,7 @@
// ------------------------------------------------------------------------------------------------------
-gboolean gaim_gtkwhiteboard_configure_event( GtkWidget *widget, GdkEventConfigure *event, gpointer data )
+gboolean gaim_gtk_whiteboard_configure_event( GtkWidget *widget, GdkEventConfigure *event, gpointer data ) GaimGtkWhiteboard *gtkwb = ( GaimGtkWhiteboard* )( data );
@@ -246,7 +273,7 @@
// ------------------------------------------------------------------------------------------------------
-gboolean gaim_gtkwhiteboard_expose_event( GtkWidget *widget, GdkEventExpose *event, gpointer data )
+gboolean gaim_gtk_whiteboard_expose_event( GtkWidget *widget, GdkEventExpose *event, gpointer data ) GaimGtkWhiteboard *gtkwb = ( GaimGtkWhiteboard* )( data );
GdkPixmap *pixmap = gtkwb->pixmap;
@@ -265,18 +292,18 @@
// ------------------------------------------------------------------------------------------------------
-gboolean gaim_gtkwhiteboard_brush_down( GtkWidget *widget, GdkEventButton *event, gpointer data )
+gboolean gaim_gtk_whiteboard_brush_down( GtkWidget *widget, GdkEventButton *event, gpointer data ) GaimGtkWhiteboard *gtkwb = ( GaimGtkWhiteboard* )( data );
GdkPixmap *pixmap = gtkwb->pixmap;
- GList *d_list = gtkwb->wb->draw_list;
+/* GList *d_list = gtkwb->wb->draw_list;
if( BrushState != BRUSH_STATE_UP )
// Potential double-click DOWN to DOWN?
@@ -294,7 +321,7 @@
if( event->button == 1 && pixmap != NULL )
- // Check if draw_list has contents; if so, clear it
+/* // Check if draw_list has contents; if so, clear it gaim_whiteboard_draw_list_destroy( d_list );
@@ -303,24 +330,24 @@
- //*brush_color = gtkwb->brush_color;
- //*brush_size = gtkwb->brush_size;
+ // *brush_color = gtkwb->brush_color; + // *brush_size = gtkwb->brush_size;
// Set tracking variables
+ LastX = event->x;//LastX = *x0; + LastY = event->y;//LastY = *y0;
d_list = g_list_append( d_list, ( gpointer )( brush_color ) );
d_list = g_list_append( d_list, ( gpointer )( brush_size ) );
d_list = g_list_append( d_list, ( gpointer )( x0 ) );
d_list = g_list_append( d_list, ( gpointer )( y0 ) );
- gaim_gtkwhiteboard_draw_brush_point( widget, gtkwb,
- 0,5 );//gtkwb->brush_color, gtkwb->brush_size ); NOTE temp const proto uiop
+ gaim_gtk_whiteboard_draw_brush_point( gtkwb->wb, + 0,5 );//gtkwb->brush_color, gtkwb->brush_size ); NOTE temp const prot uiop @@ -328,19 +355,19 @@
// ------------------------------------------------------------------------------------------------------
-gboolean gaim_gtkwhiteboard_brush_motion( GtkWidget *widget, GdkEventMotion *event, gpointer data )
+gboolean gaim_gtk_whiteboard_brush_motion( GtkWidget *widget, GdkEventMotion *event, gpointer data )
GaimGtkWhiteboard *gtkwb = ( GaimGtkWhiteboard* )( data );
GdkPixmap *pixmap = gtkwb->pixmap;
- GList *d_list = gtkwb->wb->draw_list;
+// GList *d_list = gtkwb->wb->draw_list; //g_print( "BRUSH_MOTION | %s\n", ds->who );
@@ -363,15 +390,15 @@
BrushState = BRUSH_STATE_MOTION;
// NOTE 100 is a temporary constant for how many deltas/motions in a stroke (needs UI Ops?)
@@ -391,8 +418,8 @@
int *x0 = g_new0( int, 1 );
int *y0 = g_new0( int, 1 );
- //*brush_color = gtkwb->brush_color;
- //*brush_size = gtkwb->brush_size;
+ // *brush_color = gtkwb->brush_color; + // *brush_size = gtkwb->brush_size; @@ -415,11 +442,11 @@
d_list = g_list_append( d_list, ( gpointer )( dx ) );
d_list = g_list_append( d_list, ( gpointer )( dy ) );
- gaim_gtkwhiteboard_draw_brush_line( gtkwb->drawing_area, gtkwb,
- 0, 5 );//gtkwb->brush_color, gtkwb->brush_size ); temp const proto ui ops?
+ gaim_gtk_whiteboard_draw_brush_line( gtkwb->wb, + 0, 5 );//gtkwb->brush_color, gtkwb->brush_size ); temp const proto ui ops? // Set tracking variables
@@ -431,12 +458,12 @@
// ------------------------------------------------------------------------------------------------------
-gboolean gaim_gtkwhiteboard_brush_up( GtkWidget *widget, GdkEventButton *event, gpointer data )
+gboolean gaim_gtk_whiteboard_brush_up( GtkWidget *widget, GdkEventButton *event, gpointer data ) GaimGtkWhiteboard *gtkwb = ( GaimGtkWhiteboard* )( data );
GdkPixmap *pixmap = gtkwb->pixmap;
- GList *d_list = gtkwb->wb->draw_list;
+// GList *d_list = gtkwb->wb->draw_list; //g_print( "BRUSH_UP | %s\n", ds->who );
@@ -452,7 +479,7 @@
if( event->button == 1 && pixmap != NULL )
- // If the brush was never moved, express two sets of two deltas
+/* // If the brush was never moved, express two sets of two deltas // That's a 'point,' but not for Yahoo!
//if( ( event->x == LastX ) && ( event->y == LastY ) )
@@ -476,11 +503,11 @@
//char* message = goodle_doodle_session_build_draw_string( drawList );
//yahoo_doodle_command_send_draw( ds->gc, ds->who, message );
- gaim_gtkwhiteboard_set_canvas_as_icon( gtkwb );
+ gaim_gtk_whiteboard_set_canvas_as_icon( gtkwb ); // The brush stroke is finished, clear the list for another one
- gaim_whiteboard_draw_list_destroy( d_list );
+// gaim_whiteboard_draw_list_destroy( d_list ); @@ -488,25 +515,28 @@
// ------------------------------------------------------------------------------------------------------
-void gaim_gtkwhiteboard_draw_brush_point( GtkWidget *widget, GaimGtkWhiteboard *gtkwb,
- int x, int y, int color, int size )
+// void gaim_gtk_whiteboard_draw_brush_point( GtkWidget *widget, GaimGtkWhiteboard *gtkwb, +// int x, int y, int color, int size ) +void gaim_gtk_whiteboard_draw_brush_point( GaimWhiteboard *wb, int x, int y, int color, int size ) - GdkPixmap *pixmap = gtkwb->pixmap;
- //g_print( "goodle_doodle_session_draw_brush | %s\n", ds->who );
+ GaimGtkWhiteboard *gtkwb = wb->ui_data; + GtkWidget *widget = gtkwb->drawing_area; + GdkPixmap *pixmap = gtkwb->pixmap; - GdkRectangle update_rect;
+ GdkRectangle update_rect; update_rect.x = x - size / 2;
update_rect.y = y - size / 2;
update_rect.width = size;
update_rect.height = size;
+ //g_print( "goodle_doodle_session_draw_brush | %s\n", ds->who ); // Interpret and convert color
GdkGC *gfx_con = gdk_gc_new( pixmap );
- gaim_gtkwhiteboard_rgb24_to_rgb48( color, &col );
+ gaim_gtk_whiteboard_rgb24_to_rgb48( color, &col ); gdk_gc_set_rgb_fg_color( gfx_con, &col );
//gdk_gc_set_rgb_bg_color( gfx_con, &col );
@@ -541,9 +571,10 @@
// ------------------------------------------------------------------------------------------------------
// Uses Bresenham's algorithm (as provided by Wikipedia)
-void gaim_gtkwhiteboard_draw_brush_line( GtkWidget *widget, GaimGtkWhiteboard *gtkwb,
- int x0, int y0, int x1, int y1, int color, int size )
+// void gaim_gtk_whiteboard_draw_brush_line( GtkWidget *widget, GaimGtkWhiteboard *gtkwb, +// int x0, int y0, int x1, int y1, int color, int size ) +void gaim_gtk_whiteboard_draw_brush_line( GaimWhiteboard *wb, int x0, int y0, int x1, int y1, int color, int size ) @@ -577,9 +608,9 @@
- gaim_gtkwhiteboard_draw_brush_point( widget, gtkwb, y, x, color, size );
+ gaim_gtk_whiteboard_draw_brush_point( wb, y, x, color, size ); - gaim_gtkwhiteboard_draw_brush_point( widget, gtkwb, x, y, color, size );
+ gaim_gtk_whiteboard_draw_brush_point( wb, x, y, color, size ); @@ -593,15 +624,15 @@
- gaim_gtkwhiteboard_draw_brush_point( widget, gtkwb, y, x, color, size );
+ gaim_gtk_whiteboard_draw_brush_point( wb, y, x, color, size ); - gaim_gtkwhiteboard_draw_brush_point( widget, gtkwb, x, y, color, size );
+ gaim_gtk_whiteboard_draw_brush_point( wb, x, y, color, size ); // ------------------------------------------------------------------------------------------------------
-void gaim_gtkwhiteboard_clear_canvas( GaimGtkWhiteboard *gtkwb )
+void gaim_gtk_whiteboard_clear_canvas( GaimGtkWhiteboard *gtkwb ) GdkPixmap *pixmap = gtkwb->pixmap;
GtkWidget *drawing_area = gtkwb->drawing_area;
@@ -619,21 +650,21 @@
// ------------------------------------------------------------------------------------------------------
-void gaim_gtkwhiteboard_button_clear_press( GtkWidget *widget, gpointer data )
+void gaim_gtk_whiteboard_button_clear_press( GtkWidget *widget, gpointer data ) GaimGtkWhiteboard *gtkwb = ( GaimGtkWhiteboard* )( data );
// Proto specific? UI Ops?
//goodle_send_command_clear( ds->gc, ds->who );
- gaim_gtkwhiteboard_clear_canvas( gtkwb );
+ gaim_gtk_whiteboard_clear_canvas( gtkwb ); - gaim_gtkwhiteboard_set_canvas_as_icon( gtkwb );
+ gaim_gtk_whiteboard_set_canvas_as_icon( gtkwb ); // ------------------------------------------------------------------------------------------------------
-void gaim_gtkwhiteboard_set_canvas_as_icon( GaimGtkWhiteboard *gtkwb )
+void gaim_gtk_whiteboard_set_canvas_as_icon( GaimGtkWhiteboard *gtkwb ) @@ -650,7 +681,7 @@
// ------------------------------------------------------------------------------------------------------
-void gaim_gtkwhiteboard_rgb24_to_rgb48( int color_rgb, GdkColor *color )
+void gaim_gtk_whiteboard_rgb24_to_rgb48( int color_rgb, GdkColor *color ) color->red = ( color_rgb >> 8 ) | 0xFF;
color->green = ( color_rgb & 0xFF00 ) | 0xFF;
--- a/src/protocols/yahoo/yahoo_doodle.c Tue Jul 19 23:14:35 2005 -0400
+++ b/src/protocols/yahoo/yahoo_doodle.c Fri Jul 22 17:25:16 2005 -0400
@@ -113,9 +113,6 @@
gaim_signal_connect( conv_handle, "deleting-conversation", plugin,
GAIM_CALLBACK( goodle_conv_destroyed ), NULL );
- // Make all active Yahoo accounts use the Goodle network packet handler
- goodle_set_goodle_functions( TRUE );
// ------------------------------------------------------------------------------------------------------
@@ -148,9 +145,6 @@
- // Return full packet handling to the original Yahoo plugin
- goodle_set_goodle_functions( FALSE );
// ------------------------------------------------------------------------------------------------------
@@ -284,13 +278,13 @@
void yahoo_doodle_command_got_request( GaimConnection *gc, char *from )
+ g_print( "-----------------------------------------------\n" ); + g_print( "Got REQUEST (%s)\n", from ); GaimAccount *account = gaim_connection_get_account( gc );
// Only handle this if local client requested Doodle session (else local client would have sent one)
- GaimWhiteboard *wb = gaim_whiteboard_get( account, from );
- g_print( "-----------------------------------------------\n" );
- g_print( "Got REQUEST (%s)\n", from );
+ GaimWhiteboard *wb = gaim_whiteboard_get_session( account, from ); // If a session with the remote user doesn't exist
@@ -318,13 +312,13 @@
void yahoo_doodle_command_got_ready( GaimConnection *gc, char *from )
+ g_print( "-----------------------------------------------\n" ); + g_print( "Got READY (%s)\n", from ); GaimAccount *account = gaim_connection_get_account( gc );
// Only handle this if local client requested Doodle session (else local client would have sent one)
- GaimWhiteboard *wb = gaim_whiteboard_get( account, from );
- g_print( "-----------------------------------------------\n" );
- g_print( "Got READY (%s)\n", from );
+ GaimWhiteboard *wb = gaim_whiteboard_get_session( account, from ); @@ -332,7 +326,7 @@
if( wb->state == DOODLE_STATE_REQUESTING )
// TODO Check for active pixmap?
- //goodle_doodle_session_start( ds );
+ gaim_whiteboard_start( wb ); wb->state = DOODLE_STATE_ESTABLISHED;
@@ -345,8 +339,6 @@
// Ask whether to save picture too
//goodle_doodle_session_clear_canvas( ds );
- //goodle_doodle_session_set_canvas_as_icon( ds );
@@ -354,19 +346,19 @@
void yahoo_doodle_command_got_draw( GaimConnection *gc, char *from, char *message )
- GaimAccount *account = gaim_connection_get_account( gc );
- // Only handle this if local client requested Doodle session (else local client would have sent one)
- GaimWhiteboard *wb = gaim_whiteboard_get( account, from );
g_print( "-----------------------------------------------\n" );
g_print( "Got DRAW (%s)\n", from );
g_print( "Draw Message: %s\n", message );
+ GaimAccount *account = gaim_connection_get_account( gc ); + // Only handle this if local client requested Doodle session (else local client would have sent one) + GaimWhiteboard *wb = gaim_whiteboard_get_session( account, from ); // Convert drawing packet message to an integer list
@@ -422,13 +414,13 @@
void yahoo_doodle_command_got_clear( GaimConnection *gc, char *from )
+ g_print( "-----------------------------------------------\n" ); + g_print( "Got CLEAR (%s)\n", from ); GaimAccount *account = gaim_connection_get_account( gc );
// Only handle this if local client requested Doodle session (else local client would have sent one)
- GaimWhiteboard *wb = gaim_whiteboard_get( account, from );
- g_print( "-----------------------------------------------\n" );
- g_print( "Got CLEAR (%s)\n", from );
+ GaimWhiteboard *wb = gaim_whiteboard_get_session( account, from ); @@ -438,8 +430,6 @@
// TODO Ask user whether to save the image before clearing it
//goodle_doodle_session_clear_canvas( ds );
- //goodle_doodle_session_set_canvas_as_icon( ds );
@@ -447,12 +437,12 @@
void yahoo_doodle_command_got_extra( GaimConnection *gc, char *from, char *message )
+ g_print( "-----------------------------------------------\n" ); + g_print( "Got EXTRA (%s)\n", from ); // I do not like these 'extra' features, so I'll only handle them in one way,
// which is returning them with the command/packet to turn them off
- g_print( "-----------------------------------------------\n" );
- g_print( "Got EXTRA (%s)\n", from );
yahoo_doodle_command_send_extra( gc, from, DOODLE_EXTRA_NONE );
@@ -460,14 +450,14 @@
void yahoo_doodle_command_got_confirm( GaimConnection *gc, char *from )
+ g_print( "-----------------------------------------------\n" ); + g_print( "Got CONFIRM (%s)\n", from ); // Get the doodle session
GaimAccount *account = gaim_connection_get_account( gc );
// Only handle this if local client requested Doodle session (else local client would have sent one)
- GaimWhiteboard *wb = gaim_whiteboard_get( account, from );
- g_print( "-----------------------------------------------\n" );
- g_print( "Got CONFIRM (%s)\n", from );
+ GaimWhiteboard *wb = gaim_whiteboard_get_session( account, from ); @@ -481,7 +471,7 @@
// Check if this session wasn't already started before we start it (again?)
//if( ds->pixmap == NULL )
- // goodle_doodle_session_start( ds );
+ gaim_whiteboard_start( wb ); yahoo_doodle_command_send_confirm( gc, from );
@@ -493,7 +483,7 @@
// Check if this session wasn't already started before we start it (again?)
//if( ds->pixmap == NULL )
- // goodle_doodle_session_start( ds );
+ gaim_whiteboard_start( wb ); @@ -501,13 +491,13 @@
void yahoo_doodle_command_got_shutdown( GaimConnection *gc, char *from )
+ g_print( "-----------------------------------------------\n" ); + g_print( "Got SHUTDOWN (%s)\n", from ); GaimAccount *account = gaim_connection_get_account( gc );
// Only handle this if local client requested Doodle session (else local client would have sent one)
- GaimWhiteboard *wb = gaim_whiteboard_get( account, from );
- g_print( "-----------------------------------------------\n" );
- g_print( "Got SHUTDOWN (%s)\n", from );
+ GaimWhiteboard *wb = gaim_whiteboard_get_session( account, from ); // TODO Ask if user wants to save picture before the session is closed
@@ -515,19 +505,19 @@
- ;//gtk_widget_destroy( ds->window );
+ gaim_whiteboard_destroy( wb ); // ------------------------------------------------------------------------------------------------------
int yahoo_doodle_command_send_request( GaimConnection *gc, char *to )
+ g_print( "-----------------------------------------------\n" ); + g_print( "Sent REQUEST (%s)\n", to ); struct yahoo_packet *pkt;
- g_print( "-----------------------------------------------\n" );
- g_print( "Sent REQUEST (%s)\n", to );
// Make and send an acknowledge (ready) Doodle packet
@@ -550,11 +540,11 @@
int yahoo_doodle_command_send_ready( GaimConnection *gc, char *to )
+ g_print( "-----------------------------------------------\n" ); + g_print( "Sent READY (%s)\n", to ); struct yahoo_packet *pkt;
- g_print( "-----------------------------------------------\n" );
- g_print( "Sent READY (%s)\n", to );
@@ -578,11 +568,11 @@
void yahoo_doodle_command_send_draw( GaimConnection *gc, char *to, char *message )
+ g_print( "-----------------------------------------------\n" ); + g_print( "Sent DRAW (%s)\n", to ); struct yahoo_packet *pkt;
- g_print( "-----------------------------------------------\n" );
- g_print( "Sent DRAW (%s)\n", to );
@@ -604,11 +594,11 @@
void yahoo_doodle_command_send_clear( GaimConnection *gc, char *to )
+ g_print( "-----------------------------------------------\n" ); + g_print( "Sent CLEAR (%s)\n", to ); struct yahoo_packet *pkt;
- g_print( "-----------------------------------------------\n" );
- g_print( "Sent CLEAR (%s)\n", to );
@@ -630,11 +620,11 @@
void yahoo_doodle_command_send_extra( GaimConnection *gc, char *to, char *message )
+ g_print( "-----------------------------------------------\n" ); + g_print( "Sent EXTRA (%s)\n", to ); struct yahoo_packet *pkt;
- g_print( "-----------------------------------------------\n" );
- g_print( "Sent EXTRA (%s)\n", to );
@@ -656,11 +646,11 @@
void yahoo_doodle_command_send_confirm( GaimConnection *gc, char *to )
+ g_print( "-----------------------------------------------\n" ); + g_print( "Sent CONFIRM (%s)\n", to ); struct yahoo_packet *pkt;
- g_print( "-----------------------------------------------\n" );
- g_print( "Sent CONFIRM (%s)\n", to );
@@ -682,11 +672,11 @@
void yahoo_doodle_command_send_shutdown( GaimConnection *gc, char *to )
+ g_print( "-----------------------------------------------\n" ); + g_print( "Sent SHUTDOWN (%s)\n", to ); struct yahoo_packet *pkt;
- g_print( "-----------------------------------------------\n" );
- g_print( "Sent SHUTDOWN (%s)\n", to );
@@ -919,8 +909,6 @@
yahoo_doodle_command_send_clear( ds->gc, ds->who );
goodle_doodle_session_clear_canvas( ds );
- goodle_doodle_session_set_canvas_as_icon( ds );
// ------------------------------------------------------------------------------------------------------
--- a/src/whiteboard.c Tue Jul 19 23:14:35 2005 -0400
+++ b/src/whiteboard.c Fri Jul 22 17:25:16 2005 -0400
@@ -27,19 +27,29 @@
// DATATYPES ============================================================================================
-//static GaimWhiteboardOps *ui_ops = NULL;
// GLOBALS ==============================================================================================
-static GList *wbList = NULL;
+static GaimWhiteboardUiOps *whiteboard_ui_ops = NULL; -gboolean auto_accept = TRUE;
+static GList *wbList = NULL; +static gboolean auto_accept = TRUE; // FUNCTIONS ============================================================================================
+void gaim_whiteboard_set_ui_ops( GaimWhiteboardUiOps *ops ) + whiteboard_ui_ops = ops; +// ------------------------------------------------------------------------------------------------------ GaimWhiteboard *gaim_whiteboard_create( GaimAccount *account, char *who, int state )
+ g_print( "gaim_whiteboard_create()\n" ); GaimWhiteboard *wb = g_new0( GaimWhiteboard, 1 );
+ g_print( "-->wb=%p\n", wb ); @@ -57,23 +67,41 @@
void gaim_whiteboard_destroy( GaimWhiteboard *wb )
+ g_print( "gaim_whiteboard_destroy()\n" ); + g_print( "-->wb=%p\n", wb ); wbList = g_list_remove( wbList, wb );
+ g_print( "freed (wb->who)\n" ); + g_print( "freed (wb)\n" ); +// ------------------------------------------------------------------------------------------------------ +void gaim_whiteboard_start( GaimWhiteboard *wb ) + g_print( "gaim_whiteboard_start()\n" ); + // Create frontend for whiteboard + if( whiteboard_ui_ops && whiteboard_ui_ops->create ) + whiteboard_ui_ops->create( wb ); // ------------------------------------------------------------------------------------------------------
// Looks through the list of whiteboard sessions for one that is between usernames 'me' and 'who'
// Returns a pointer to a matching whiteboard session; if none match, it returns NULL
-GaimWhiteboard *gaim_whiteboard_get( GaimAccount *account, char *who )
+GaimWhiteboard *gaim_whiteboard_get_session( GaimAccount *account, char *who ) + g_print( "gaim_whiteboard_get_session()\n" ); GaimWhiteboard *wb = NULL;
@@ -85,7 +113,10 @@
if( !strcmp( gaim_account_get_username( wb->account ), gaim_account_get_username( account ) ) &&
!strcmp( wb->who, who ) )
+ g_print( "@Found whiteboard session\n" ); @@ -115,19 +146,18 @@
// ------------------------------------------------------------------------------------------------------
-void gaim_whiteboard_draw_line( GaimWhiteBoard *board, int x1, int y1, int x2, int y2 )
+void gaim_whiteboard_draw_point( GaimWhiteboard *wb, int x, int y, int color, int size ) - if( ui_ops && ui_ops->draw_line )
- ui_ops->draw_line( board, x1, y1, x2, y2 );
+ if( whiteboard_ui_ops && whiteboard_ui_ops->draw_point ) + whiteboard_ui_ops->draw_point( wb, x, y, color, size ); // ------------------------------------------------------------------------------------------------------
-void gaim_whiteboard_set_ui_ops( GaimWhiteboardOps *ops )
+void gaim_whiteboard_draw_line( GaimWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size )
+ if( whiteboard_ui_ops && whiteboard_ui_ops->draw_line ) + whiteboard_ui_ops->draw_line( wb, x1, y1, x2, y2, color, size ); // ------------------------------------------------------------------------------------------------------