--- a/src/gtkwhiteboard.c Thu Jul 28 16:48:14 2005 -0400
+++ b/src/gtkwhiteboard.c Fri Jul 29 23:23:43 2005 -0400
@@ -29,10 +29,14 @@
//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;
+//GdkColor DefaultColor[PALETTE_NUM_OF_COLORS]; +static gboolean LocalShutdownRequest; +static int LastX; // Tracks last position of the mouse when drawing +static int MotionCount; // Tracks how many brush motions made +static int BrushState = BRUSH_STATE_UP; static GaimWhiteboardUiOps ui_ops =
@@ -189,19 +193,25 @@
void gaim_gtk_whiteboard_destroy( GaimWhiteboard *wb )
//g_print( "gaim_gtk_whiteboard_destroy()\n" );
GaimGtkWhiteboard *gtkwb = wb->ui_data;
// TODO Ask if user wants to save picture before the session is closed
// Clear graphical memory
+ //g_print( "---gtkwb->pixmap = %p\n", gtkwb->pixmap ); g_object_unref( gtkwb->pixmap );
- gaim_whiteboard_destroy( gtkwb->wb );
+ //g_print( "---gtkwb->window = %p\n", gtkwb->window ); + gtk_widget_destroy( gtkwb->window ); // ------------------------------------------------------------------------------------------------------
@@ -210,14 +220,40 @@
//g_print( "gaim_gtk_whiteboard_exit()\n" );
- GaimGtkWhiteboard *gtkwb = ( GaimGtkWhiteboard* )( data );
+ GaimGtkWhiteboard *gtkwb = ( GaimGtkWhiteboard* )( data ); + GaimWhiteboard *wb = gtkwb->wb; + if( gtkwb->window && gtkwb->pixmap ) + LocalShutdownRequest = TRUE; + //g_print( "---gtkwb->window = %p\n", gtkwb->window ); + gaim_gtk_whiteboard_destroy( wb ); + LocalShutdownRequest = FALSE; - gaim_gtk_whiteboard_destroy( gtkwb->wb );
+ //g_print( "---gtkwb = %p\n", gtkwb ); + // Destroy whiteboard core, if the local user exited the whiteboard window + if( wb && LocalShutdownRequest ) + //g_print( "---wb = %p\n", wb ); + gaim_whiteboard_destroy( wb ); // ------------------------------------------------------------------------------------------------------
-// Whiteboard start button on conversation window (ooo boy... figure this one out)
+// Whiteboard start button on conversation window (move this code to gtkconv? and use new prpl_info member?) void gaim_gtkwhiteboard_button_start_press( GtkButton *button, gpointer data )
GaimConversation *conv = data;
@@ -226,7 +262,7 @@
char *to = ( char* )( gaim_conversation_get_name( conv ) );
// Only handle this if local client requested Doodle session (else local client would have sent one)
- GaimWhiteboard *wb = gaim_whiteboard_get( account, from );
+ GaimWhiteboard *wb = gaim_whiteboard_get( account, to ); // Write a local message to this conversation showing that
// a request for a Doodle session has been made
@@ -237,7 +273,7 @@
yahoo_doodle_command_send_ready( gc, to );
// Insert this 'session' in the list. At this point, it's only a requested session.
- wb = gaim_whiteboard_create( account, from, DOODLE_STATE_REQUESTING );
+ wb = gaim_whiteboard_create( account, to, DOODLE_STATE_REQUESTING ); // ------------------------------------------------------------------------------------------------------
@@ -654,12 +690,13 @@
GaimGtkWhiteboard *gtkwb = ( GaimGtkWhiteboard* )( data );
- // Proto specific? UI Ops?
- //goodle_send_command_clear( ds->gc, ds->who );
gaim_gtk_whiteboard_clear( gtkwb->wb );
gaim_gtk_whiteboard_set_canvas_as_icon( gtkwb );
+ // Do protocol specific clearing procedures + if( gtkwb->wb->prpl_ops && gtkwb->wb->prpl_ops->clear ) + gtkwb->wb->prpl_ops->clear( gtkwb->wb ); // ------------------------------------------------------------------------------------------------------
--- a/src/protocols/yahoo/yahoo.c Thu Jul 28 16:48:14 2005 -0400
+++ b/src/protocols/yahoo/yahoo.c Fri Jul 29 23:23:43 2005 -0400
@@ -45,8 +45,8 @@
#include "yahoo_filexfer.h"
+#include "yahoo_picture.h" #include "yahoo_doodle.h"
-#include "yahoo_picture.h"
extern char *yahoo_crypt(const char *, const char *);
@@ -3474,8 +3474,20 @@
GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_PRPL_ONLY,
"prpl-yahoo", yahoogaim_cmd_buzz,
_("buzz: Buzz a contact to get their attention"), NULL);
+ gaim_cmd_register("doodle", "", GAIM_CMD_P_PRPL, + GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_PRPL_ONLY, + "prpl-yahoo", yahoo_doodle_gaim_cmd_start, + _("doodle: Request user to start a Doodle session"), NULL); +static GaimWhiteboardPrplOps yahoo_whiteboard_prpl_ops = static GaimPluginProtocolInfo prpl_info =
OPT_PROTO_MAIL_CHECK | OPT_PROTO_CHAT_TOPIC,
@@ -3535,7 +3547,8 @@
yahoo_roomlist_expand_category,
NULL, /* can_receive_file */
+ &yahoo_whiteboard_prpl_ops static GaimPluginInfo info =
--- a/src/protocols/yahoo/yahoo_doodle.c Thu Jul 28 16:48:14 2005 -0400
+++ b/src/protocols/yahoo/yahoo_doodle.c Fri Jul 29 23:23:43 2005 -0400
@@ -53,9 +53,8 @@
#include "yahoo_doodle.h"
// GLOBALS =============================================================================================
-const int DefaultColorRGB24[] =
+const int DefaultColorRGB24[] = @@ -72,166 +71,43 @@
-//GdkColor DefaultColor[PALETTE_NUM_OF_COLORS];
+// FUNCTIONS ============================================================================================ -// FUNCTIONS ============================================================================================
-// This function is called at the start of Gaim (twice?)
-// Anyhow... this is the biggy... I think :P
-void init_plugin( GaimPlugin *plugin )
+GaimCmdRet yahoo_doodle_gaim_cmd_start( GaimConversation *conv, const char *cmd, char **args, char **error, void *data )
- for( i = 0; i < PALETTE_NUM_OF_COLORS; i++ )
- goodle_rgb24_to_rgb48( DefaultColorRGB24[i], &DefaultColor[i] );
-// ------------------------------------------------------------------------------------------------------
+ GaimAccount *account = gaim_conversation_get_account( conv ); + GaimConnection *gc = gaim_account_get_connection( account ); + char *to = ( char* )( gaim_conversation_get_name( conv ) ); -// plugin_load is not required. It is called when the plugin is loaded so that you can
-// initialize any variables and so on. Therefore, called when selected in Preferences->Plugins
-gboolean goodle_load( GaimPlugin *plugin )
- // Set up signal/functions for when connections are made/ended
- void *con_handle = gaim_connections_get_handle();
+ return( GAIM_CMD_RET_FAILED ); - gaim_signal_connect( con_handle, "signed-on", plugin,
- GAIM_CALLBACK( goodle_con_signed_on ), NULL );
+ // NOTE Functionalize this code? + // Only handle this if local client requested Doodle session (else local client would have sent one) + GaimWhiteboard *wb = gaim_whiteboard_get_session( account, to ); - gaim_signal_connect( con_handle, "signed-off", plugin,
- GAIM_CALLBACK( goodle_con_signed_off ), NULL );
- // Set up signal/functions for when the conversation/windows are created
- void *conv_handle = gaim_conversations_get_handle();
+ // Insert this 'session' in the list. At this point, it's only a requested session. + wb = gaim_whiteboard_create( account, to, DOODLE_STATE_REQUESTING ); + // ; // NOTE Perhaps some careful handling of remote assumed established sessions - gaim_signal_connect( conv_handle, "conversation-created", plugin,
- GAIM_CALLBACK( goodle_conv_created ), NULL );
- gaim_signal_connect( conv_handle, "deleting-conversation", plugin,
- GAIM_CALLBACK( goodle_conv_destroyed ), NULL );
+ yahoo_doodle_command_send_request( gc, to ); + yahoo_doodle_command_send_ready( gc, to );
+ // Write a local message to this conversation showing that + // a request for a Doodle session has been made + gaim_conv_im_write( GAIM_CONV_IM( conv ), "", _("Sent Doodle request."), + GAIM_MESSAGE_NICK | GAIM_MESSAGE_RECV, time( NULL ) ); + return( GAIM_CMD_RET_OK ); // ------------------------------------------------------------------------------------------------------
-// plugin_destroy is called when plugin is unloaded (unselected)
-gboolean goodle_unload( GaimPlugin *plugin )
- // Destroy any buttons that haven't been destroyed from closing conversation windows
- g_list_free( buttonList );
- // Clear the list of Doodle sessions (TODO also make sure the pixmaps and perhaps widgets are destroyed too)
- //struct doodle_session *ds;
-// // Check if a Doodle session exists with this user
-// //g_print( "%s\n", ds->who );
-// ------------------------------------------------------------------------------------------------------
-// plugin_destroy is called when plugin is destroyed (fails/crashes)
-void goodle_destroy( GaimPlugin *plugin )
- g_list_free( buttonList );
-// ------------------------------------------------------------------------------------------------------
-void goodle_con_signed_on( GaimConnection *gc, gpointer data )
- g_print( "%s -> SIGNED ON\n", gaim_account_get_username( gc->account ) );
- goodle_set_goodle_functions( TRUE );
-// ------------------------------------------------------------------------------------------------------
-void goodle_con_signed_off( GaimConnection *gc, gpointer data )
- g_print( "%s -> SIGNED OFF\n", gaim_account_get_username( gc->account ) );
-// ------------------------------------------------------------------------------------------------------
-void goodle_conv_created( GaimConversation *conv, gpointer data )
- GaimGtkConversation *gtkconv;
- //GaimConversationType type;
- // Check if this is a valid conversation window in Gaim ?
- if( ( gtkconv = GAIM_GTK_CONVERSATION( conv ) ) == NULL )
- // Create this button (via Gaim API)
- button = gaim_gtkconv_button_new( NULL,
- "Goodle", "Start a Doodle session with this user",
- ( gpointer )( conv ) );
- // Stamp this button with essentially information attributing it to this particular conversation?
- g_object_set_data( G_OBJECT( button ), "conv", conv );
- // Add this particular button to the global list of buttons
- buttonList = g_list_append( buttonList, ( gpointer )( button ) );
- // Place the button at the bottom of the Gaim conversation window
- gtk_box_pack_end( GTK_BOX( gtkconv->bbox ), button, TRUE, TRUE, 0 );
- gtk_size_group_add_widget( gtkconv->sg, button );
- gtk_widget_show( button );
-// ------------------------------------------------------------------------------------------------------
-void goodle_conv_destroyed( GaimConversation *conv, gpointer data )
- GaimConversation *stored_conv;
- // Traverse the list of buttons and destroy the one associated with this conversation window
- for( l = buttonList; l != NULL; l = l_next )
- button = GTK_WIDGET( l->data );
- stored_conv = ( GaimConversation* )g_object_get_data( G_OBJECT( button ), "conv" );
- // Does this button's 'stamp' match that of this conversation?
- if( stored_conv == conv )
- gtk_widget_destroy( button );
- buttonList = g_list_remove( buttonList, l->data );
-// ------------------------------------------------------------------------------------------------------
void yahoo_doodle_process( GaimConnection *gc, char *me, char *from, char *command, char *message )
// g_print( "-----------------------------------------------\n" );
@@ -469,9 +345,7 @@
wb->state = DOODLE_STATE_ESTABLISHED;
- // Check if this session wasn't already started before we start it (again?)
- //if( ds->pixmap == NULL )
- gaim_whiteboard_start( wb );
+ gaim_whiteboard_start( wb ); yahoo_doodle_command_send_confirm( gc, from );
@@ -481,9 +355,7 @@
wb->state = DOODLE_STATE_ESTABLISHED;
- // Check if this session wasn't already started before we start it (again?)
- //if( ds->pixmap == NULL )
- gaim_whiteboard_start( wb );
+ gaim_whiteboard_start( wb ); @@ -505,12 +377,16 @@
gaim_whiteboard_destroy( wb );
+ //yahoo_doodle_command_send_shutdown( gc, from ); // ------------------------------------------------------------------------------------------------------
-int yahoo_doodle_command_send_request( GaimConnection *gc, char *to )
+void yahoo_doodle_command_send_request( GaimConnection *gc, char *to ) g_print( "-----------------------------------------------\n" );
g_print( "Sent REQUEST (%s)\n", to );
@@ -532,13 +408,11 @@
yahoo_packet_hash_str( pkt, 1002, "1" );
yahoo_packet_send_and_free( pkt, yd );
// ------------------------------------------------------------------------------------------------------
-int yahoo_doodle_command_send_ready( GaimConnection *gc, char *to )
+void yahoo_doodle_command_send_ready( GaimConnection *gc, char *to ) g_print( "-----------------------------------------------\n" );
g_print( "Sent READY (%s)\n", to );
@@ -560,8 +434,6 @@
yahoo_packet_hash_str( pkt, 1002, "1" );
yahoo_packet_send_and_free( pkt, yd );
// ------------------------------------------------------------------------------------------------------
@@ -695,126 +567,39 @@
// ------------------------------------------------------------------------------------------------------
-void goodle_doodle_session_start( doodle_session *ds )
- GtkWidget *drawing_area;
- GtkWidget *hbox_palette;
- GtkWidget *vbox_palette_above_canvas_and_controls;
- GtkWidget *hbox_canvas_and_controls;
- GtkWidget *vbox_controls;
- // --------------------------
- // |[][][][palette[][][][][]|
- // |------------------------|
- // --------------------------
- GtkWidget *clear_button;
- GtkWidget *save_button;
- GtkWidget *color_box[PALETTE_NUM_OF_COLORS];
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
- gtk_widget_set_name( window, ds->who );
- gtk_window_set_title( ( GtkWindow* )( window ), ds->who ); // TODO Try and use alias first
- gtk_window_set_resizable( ( GtkWindow* )( window ), FALSE );
- g_signal_connect( G_OBJECT( window ), "destroy",
- G_CALLBACK( goodle_doodle_session_end ), ( gpointer )( ds ) );
- // Create vertical box to place palette above the canvas and controls
- vbox_palette_above_canvas_and_controls = gtk_vbox_new( FALSE, 0 );
- gtk_container_add( GTK_CONTAINER( window ), vbox_palette_above_canvas_and_controls );
- gtk_widget_show( vbox_palette_above_canvas_and_controls );
- // Create horizontal box for the palette and all its entries
- hbox_palette = gtk_hbox_new( FALSE, 0 );
- gtk_container_add( GTK_CONTAINER( vbox_palette_above_canvas_and_controls ), hbox_palette );
- gtk_widget_show( hbox_palette );
- // Create horizontal box to seperate the canvas from the controls
- hbox_canvas_and_controls = gtk_hbox_new( FALSE, 0 );
- gtk_container_add( GTK_CONTAINER( vbox_palette_above_canvas_and_controls ), hbox_canvas_and_controls );
- gtk_widget_show( hbox_canvas_and_controls );
- for( i = 0; i < PALETTE_NUM_OF_COLORS; i++ )
- color_box[i] = gtk_label_new( NULL );
- gtk_widget_set_size_request( color_box[i], DOODLE_CANVAS_WIDTH / PALETTE_NUM_OF_COLORS ,32 );
- gtk_container_add( GTK_CONTAINER( hbox_palette ), color_box[i] );
- gtk_widget_show( color_box[i] );
+void yahoo_doodle_start( GaimWhiteboard *wb ) + doodle_session *ds = g_new0( doodle_session, 1 ); + // Set default brush size and color + ds->brush_size = DOODLE_BRUSH_MEDIUM; + ds->brush_color = 0; // black - // Create the drawing area
- drawing_area = gtk_drawing_area_new();
- ds->drawing_area = drawing_area;
- gtk_widget_set_size_request( GTK_WIDGET( drawing_area ), DOODLE_CANVAS_WIDTH, DOODLE_CANVAS_HEIGHT );
- gtk_box_pack_start( GTK_BOX( hbox_canvas_and_controls ), drawing_area, TRUE, TRUE, 8 );
- gtk_widget_show( drawing_area );
- // Signals used to handle backing pixmap
- g_signal_connect( G_OBJECT( drawing_area ), "expose_event",
- G_CALLBACK( goodle_doodle_session_expose_event ), ( gpointer )( ds ) );
- g_signal_connect( G_OBJECT( drawing_area ), "configure_event",
- G_CALLBACK( goodle_doodle_session_configure_event ), ( gpointer )( ds ) );
- g_signal_connect( G_OBJECT( drawing_area ), "button_press_event",
- G_CALLBACK( goodle_doodle_session_brush_down ), ( gpointer )( ds ) );
- g_signal_connect( G_OBJECT( drawing_area ), "motion_notify_event",
- G_CALLBACK( goodle_doodle_session_brush_motion ), ( gpointer )( ds ) );
- g_signal_connect( G_OBJECT( drawing_area ), "button_release_event",
- G_CALLBACK( goodle_doodle_session_brush_up ), ( gpointer )( ds ) );
+// ------------------------------------------------------------------------------------------------------ - gtk_widget_set_events( drawing_area, GDK_EXPOSURE_MASK |
- GDK_LEAVE_NOTIFY_MASK |
- GDK_BUTTON_PRESS_MASK |
- GDK_POINTER_MOTION_MASK |
- GDK_BUTTON_RELEASE_MASK |
- GDK_POINTER_MOTION_HINT_MASK );
+void yahoo_doodle_end( GaimWhiteboard *wb ) + g_print( "yahoo_doodle_end()\n" ); - // Create vertical box to contain the controls
- vbox_controls = gtk_vbox_new( FALSE, 0 );
- gtk_container_add( GTK_CONTAINER( hbox_canvas_and_controls ), vbox_controls );
- gtk_widget_show( vbox_controls );
- clear_button = gtk_button_new_with_label( "Clear" );
- gtk_widget_set_size_request( clear_button, 96 ,32 );
- gtk_box_pack_start( GTK_BOX( vbox_controls ), clear_button, FALSE, FALSE, 0 );
- gtk_widget_show( clear_button );
+ GaimConnection *gc = gaim_account_get_connection( wb->account ); - g_signal_connect( G_OBJECT( clear_button ), "clicked",
- G_CALLBACK( goodle_doodle_session_button_clear_press ), ( gpointer )( ds ) );
- save_button = gtk_button_new_with_label( "Save" );
- gtk_widget_set_size_request( save_button, 96 ,32 );
- gtk_box_pack_start( GTK_BOX( vbox_controls ), save_button, FALSE, FALSE, 8 );
- gtk_widget_show( save_button );
+ yahoo_doodle_command_send_shutdown( gc, wb->who ); +// ------------------------------------------------------------------------------------------------------ +void yahoo_doodle_clear( GaimWhiteboard *wb ) + GaimConnection *gc = gaim_account_get_connection( wb->account ); - // Make all this (window) visible
- gtk_widget_show( window );
- // Set default brush size and color
- ds->brush_size = DOODLE_BRUSH_MEDIUM;
- ds->brush_color = 0; // black
+ yahoo_doodle_command_send_clear( gc, wb->who );
// ------------------------------------------------------------------------------------------------------
void yahoo_doodle_draw_stroke( GaimWhiteboard *wb, GList *d_list )
@@ -901,16 +686,4 @@
// ------------------------------------------------------------------------------------------------------
-void goodle_doodle_session_button_clear_press( GtkWidget *widget, gpointer data )
- doodle_session *ds = ( doodle_session* )( data );
- yahoo_doodle_command_send_clear( ds->gc, ds->who );
- gaim_whiteboard_clear( wb );
-// ------------------------------------------------------------------------------------------------------
--- a/src/protocols/yahoo/yahoo_doodle.h Thu Jul 28 16:48:14 2005 -0400
+++ b/src/protocols/yahoo/yahoo_doodle.h Fri Jul 29 23:23:43 2005 -0400
@@ -27,6 +27,7 @@
// INCLUDES ============================================================================================
// DEFINES =============================================================================================
@@ -87,40 +88,35 @@
// PROTOTYPES ==========================================================================================
-void init_plugin( GaimPlugin *plugin );
-gboolean goodle_load( GaimPlugin *plugin );
-gboolean goodle_unload( GaimPlugin *plugin );
-void goodle_destroy( GaimPlugin *plugin ); // void or gboolean?
+void dummy_func( void ); +GaimCmdRet yahoo_doodle_gaim_cmd_start( GaimConversation *conv, const char *cmd, char **args, + char **error, void *data ); +void yahoo_doodle_process( GaimConnection *gc, char *me, char *from, char *command, char *message ); -void goodle_con_signed_on( GaimConnection *gc, gpointer data );
-void goodle_con_signed_off( GaimConnection *gc, gpointer data );
-void goodle_conv_created( GaimConversation *conv, gpointer data );
-void goodle_conv_destroyed( GaimConversation *conv, gpointer data );
-void yahoo_doodle_process( GaimConnection *gc, char *me, char *from, char *command, char *message );
+void yahoo_doodle_command_got_request( GaimConnection *gc, char *from ); +void yahoo_doodle_command_got_ready( GaimConnection *gc, char *from ); +void yahoo_doodle_command_got_draw( GaimConnection *gc, char *from, char *message ); +void yahoo_doodle_command_got_clear( GaimConnection *gc, char *from ); +void yahoo_doodle_command_got_extra( GaimConnection *gc, char *from, char *message ); +void yahoo_doodle_command_got_confirm( GaimConnection *gc, char *from ); +void yahoo_doodle_command_got_shutdown( GaimConnection *gc, char *from ); -void yahoo_doodle_command_got_request( GaimConnection *gc, char *from );
-void yahoo_doodle_command_got_ready( GaimConnection *gc, char *from );
-void yahoo_doodle_command_got_draw( GaimConnection *gc, char *from, char *message );
-void yahoo_doodle_command_got_clear( GaimConnection *gc, char *from );
-void yahoo_doodle_command_got_extra( GaimConnection *gc, char *from, char *message );
-void yahoo_doodle_command_got_confirm( GaimConnection *gc, char *from );
-void yahoo_doodle_command_got_shutdown( GaimConnection *gc, char *from );
+void yahoo_doodle_command_send_request( GaimConnection *gc, char *to ); +void yahoo_doodle_command_send_ready( GaimConnection *gc, char *to ); +void yahoo_doodle_command_send_draw( GaimConnection *gc, char *to, char *message ); +void yahoo_doodle_command_send_clear( GaimConnection *gc, char *to ); +void yahoo_doodle_command_send_extra( GaimConnection *gc, char *to, char *message ); +void yahoo_doodle_command_send_confirm( GaimConnection *gc, char *to ); +void yahoo_doodle_command_send_shutdown( GaimConnection *gc, char *to ); -int yahoo_doodle_command_send_request( GaimConnection *gc, char *to );
-int yahoo_doodle_command_send_ready( GaimConnection *gc, char *to );
-void yahoo_doodle_command_send_draw( GaimConnection *gc, char *to, char *message );
-void yahoo_doodle_command_send_clear( GaimConnection *gc, char *to );
-void yahoo_doodle_command_send_extra( GaimConnection *gc, char *to, char *message );
-void yahoo_doodle_command_send_confirm( GaimConnection *gc, char *to );
-void yahoo_doodle_command_send_shutdown( GaimConnection *gc, char *to );
+void yahoo_doodle_start( GaimWhiteboard *wb ); +void yahoo_doodle_end( GaimWhiteboard *wb ); +void yahoo_doodle_clear( GaimWhiteboard *wb ); -//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 yahoo_doodle_draw_stroke( GaimWhiteboard *wb, GList *d_list ); +//char *goodle_doodle_session_build_draw_string( GList *d_list ); #endif // _YAHOO_DOODLE_H_
--- a/src/protocols/yahoo/yahoo_filexfer.c Thu Jul 28 16:48:14 2005 -0400
+++ b/src/protocols/yahoo/yahoo_filexfer.c Fri Jul 29 23:23:43 2005 -0400
@@ -401,7 +401,7 @@
yahoo_doodle_process( gc, me, from, command, message );
// If an IMVIRONMENT packet comes without a specific imviroment name
- if( !strcmp( imv, "" ) )
+ if( !strcmp( imv, ";0" ) ) // It is unfortunately time to close all IMVironments with remote client
yahoo_doodle_command_got_shutdown( gc, from );
--- a/src/whiteboard.c Thu Jul 28 16:48:14 2005 -0400
+++ b/src/whiteboard.c Fri Jul 29 23:23:43 2005 -0400
@@ -24,16 +24,18 @@
// INCLUDES =============================================================================================
// DATATYPES ============================================================================================
// GLOBALS ==============================================================================================
static GaimWhiteboardUiOps *whiteboard_ui_ops = NULL;
+//static GaimWhiteboardPrplOps *whiteboard_prpl_ops = NULL; static GList *wbList = NULL;
-static gboolean auto_accept = TRUE;
+//static gboolean auto_accept = TRUE; // FUNCTIONS ============================================================================================
@@ -44,6 +46,13 @@
// ------------------------------------------------------------------------------------------------------
+void gaim_whiteboard_set_prpl_ops( GaimWhiteboard *wb, GaimWhiteboardPrplOps *ops ) +// ------------------------------------------------------------------------------------------------------ GaimWhiteboard *gaim_whiteboard_create( GaimAccount *account, char *who, int state )
//g_print( "gaim_whiteboard_create()\n" );
@@ -54,6 +63,9 @@
wb->who = g_strdup( who );
+ GaimPluginProtocolInfo *prpl_info = GAIM_PLUGIN_PROTOCOL_INFO( account->gc->prpl ); + gaim_whiteboard_set_prpl_ops( wb, prpl_info->whiteboard_prpl_ops ); wbList = g_list_append( wbList, ( gpointer )( wb ) );
@@ -64,18 +76,34 @@
void gaim_whiteboard_destroy( GaimWhiteboard *wb )
//g_print( "gaim_whiteboard_destroy()\n" );
+ //g_print( "---wb->ui_data = %p\n", wb->ui_data ); + if( whiteboard_ui_ops && whiteboard_ui_ops->destroy ) + whiteboard_ui_ops->destroy( wb );
+ // Do protocol specific session ending procedures + if( wb->prpl_ops && wb->prpl_ops->end ) + wb->prpl_ops->end( wb ); + //g_print( "---wb = %p\n", wb ); wbList = g_list_remove( wbList, wb );
--- a/src/whiteboard.h Thu Jul 28 16:48:14 2005 -0400
+++ b/src/whiteboard.h Fri Jul 29 23:23:43 2005 -0400
@@ -28,6 +28,8 @@
// DEFINES =============================================================================================
+typedef struct _GaimWhiteboardPrplOps GaimWhiteboardPrplOps; // NOTE A nasty compiler fix // INCLUDES ============================================================================================
@@ -35,16 +37,16 @@
// DATATYPES ===========================================================================================
typedef struct _GaimWhiteboard
- int state; // State of whiteboard session
+ int state; // State of whiteboard session - GaimAccount *account; // Account associated with this session
+ GaimAccount *account; // Account associated with this session + char *who; // Name of the remote user - char *who; // Name of the remote user
+ void *ui_data; // Graphical user-interface data + void *proto_data; // Protocol specific data + GaimWhiteboardPrplOps *prpl_ops; // Protocol-plugin operations - void *proto_data; // Protocol specific data
- void *ui_data; // Graphical user-interface data
- GList *draw_list; // List of drawing elements/deltas to send
+ GList *draw_list; // List of drawing elements/deltas to send typedef struct _GaimWhiteboardUiOps
@@ -56,6 +58,13 @@
void ( *clear )( GaimWhiteboard *wb );
+struct _GaimWhiteboardPrplOps + void ( *start )( GaimWhiteboard *wb ); + void ( *end )( GaimWhiteboard *wb ); + void ( *clear )( GaimWhiteboard *wb ); // PROTOTYPES ==========================================================================================
void gaim_whiteboard_set_ui_ops( GaimWhiteboardUiOps *ops );