gaim/gaim

de189eef5bda
Parents b8da71507169
Children a91f6dfa4164
Drawing and communication works from both ends. Local drawing system still
a little Doodle biased.
--- a/src/gtkwhiteboard.c Fri Jul 29 23:23:43 2005 -0400
+++ b/src/gtkwhiteboard.c Fri Aug 05 20:35:59 2005 -0400
@@ -42,6 +42,7 @@
{
gaim_gtk_whiteboard_create,
gaim_gtk_whiteboard_destroy,
+ gaim_gtk_whiteboard_set_dimensions,
gaim_gtk_whiteboard_draw_brush_point,
gaim_gtk_whiteboard_draw_brush_line,
gaim_gtk_whiteboard_clear
@@ -87,10 +88,10 @@
GaimGtkWhiteboard *gtkwb = g_new0( GaimGtkWhiteboard, 1 );
gtkwb->wb = wb;
wb->ui_data = gtkwb;
-
- // Protocol specific ui_ops?
- gtkwb->width = 368;
- gtkwb->height = 256;
+
+ // Get dimensions (default?) for the whiteboard canvas
+ if( wb->prpl_ops && wb->prpl_ops->get_dimensions )
+ wb->prpl_ops->get_dimensions( wb, &gtkwb->width, &gtkwb->height );
window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtkwb->window = window;
@@ -127,7 +128,6 @@
// Create the drawing area
drawing_area = gtk_drawing_area_new();
gtkwb->drawing_area = drawing_area;
- // NOTE Protocol specific needs UI_OP?
gtk_widget_set_size_request( GTK_WIDGET( drawing_area ), gtkwb->width, gtkwb->height );
gtk_box_pack_start( GTK_BOX( hbox_canvas_and_controls ), drawing_area, TRUE, TRUE, 8 );
@@ -328,19 +328,17 @@
// ------------------------------------------------------------------------------------------------------
gboolean gaim_gtk_whiteboard_brush_down( GtkWidget *widget, GdkEventButton *event, gpointer data )
-{
- //g_print( "BRUSH_DOWN | %s\n", ds->who );
-
- GaimGtkWhiteboard *gtkwb = ( GaimGtkWhiteboard* )( data );
- GdkPixmap *pixmap = gtkwb->pixmap;
+{
+ GaimGtkWhiteboard *gtkwb = ( GaimGtkWhiteboard* )( data );
+ //g_print( "gaim_gtk_whiteboard_brush_down | %s\n", gtkwb->wb->who );
+ GdkPixmap *pixmap = gtkwb->pixmap;
-/* GList *d_list = gtkwb->wb->draw_list;
+ GaimWhiteboard *wb = gtkwb->wb;
+ GList *draw_list = wb->draw_list;
- int *brush_color = NULL;
- int *brush_size = NULL;
- int *x0 = NULL;
- int *y0 = NULL;
-*/
+ int *x0 = NULL;
+ int *y0 = NULL;
+
if( BrushState != BRUSH_STATE_UP )
{
// Potential double-click DOWN to DOWN?
@@ -356,54 +354,52 @@
if( event->button == 1 && pixmap != NULL )
{
-/* // Check if draw_list has contents; if so, clear it
- if( d_list )
- gaim_whiteboard_draw_list_destroy( d_list );
+ // Check if draw_list has contents; if so, clear it
+ if( draw_list )
+ draw_list = gaim_whiteboard_draw_list_destroy( draw_list );
- brush_color = g_new0( int, 1 );
- brush_size = g_new0( int, 1 );
x0 = g_new0( int, 1 );
y0 = g_new0( int, 1 );
- // *brush_color = gtkwb->brush_color;
- // *brush_size = gtkwb->brush_size;
*x0 = event->x;
*y0 = event->y;
-*/
+
// Set tracking variables
- LastX = event->x;//LastX = *x0;
- LastY = event->y;//LastY = *y0;
+ LastX = *x0;
+ LastY = *y0;
+
MotionCount = 0;
-/*
- 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 ) );
-*/
+
+ draw_list = g_list_append( draw_list, ( gpointer )( x0 ) );
+ draw_list = g_list_append( draw_list, ( gpointer )( y0 ) );
+
gaim_gtk_whiteboard_draw_brush_point( gtkwb->wb,
event->x, event->y,
0,5 );//gtkwb->brush_color, gtkwb->brush_size ); NOTE temp const prot uiop
}
+ wb->draw_list = draw_list;
+
return( TRUE );
}
// ------------------------------------------------------------------------------------------------------
gboolean gaim_gtk_whiteboard_brush_motion( GtkWidget *widget, GdkEventMotion *event, gpointer data )
-{
- //g_print( "BRUSH_MOTION | %s\n", ds->who );
+{
+ int x;
+ int y;
+ int *dx;
+ int *dy;
- int x;
- int y;
-// int *dx;
-// int *dy;
- GdkModifierType state;
+ GdkModifierType state;
- GaimGtkWhiteboard *gtkwb = ( GaimGtkWhiteboard* )( data );
- GdkPixmap *pixmap = gtkwb->pixmap;
+ GaimGtkWhiteboard *gtkwb = ( GaimGtkWhiteboard* )( data );
+ //g_print( "gaim_gtk_whiteboard_brush_motion | %s\n", gtkwb->wb->who );
+ GdkPixmap *pixmap = gtkwb->pixmap;
-// GList *d_list = gtkwb->wb->draw_list;
+ GaimWhiteboard *wb = gtkwb->wb;
+ GList *draw_list = wb->draw_list;
if( event->is_hint )
gdk_window_get_pointer( event->window, &x, &y, &state );
@@ -415,7 +411,7 @@
}
if( state & GDK_BUTTON1_MASK && pixmap != NULL )
- {
+ {
if( ( BrushState != BRUSH_STATE_DOWN ) && ( BrushState != BRUSH_STATE_MOTION ) )
{
g_print( "***Bad brush state transition %d to MOTION\n", BrushState );
@@ -425,59 +421,51 @@
return( FALSE );
}
BrushState = BRUSH_STATE_MOTION;
-/*
- dx = g_new0( int, 1 );
- dy = g_new0( int, 1 );
+
+ dx = g_new0( int, 1 );
+ dy = g_new0( int, 1 );
- *dx = x - LastX;
- *dy = y - LastY;
-*/
+ *dx = x - LastX;
+ *dy = y - LastY;
+
MotionCount++;
-/*
+
// NOTE 100 is a temporary constant for how many deltas/motions in a stroke (needs UI Ops?)
if( MotionCount == 100 )
{
- d_list = g_list_append( d_list, ( gpointer )( dx ) );
- d_list = g_list_append( d_list, ( gpointer )( dy ) );
+ draw_list = g_list_append( draw_list, ( gpointer )( dx ) );
+ draw_list = g_list_append( draw_list, ( gpointer )( dy ) );
- //NOTE Protocol specific here too... UI Ops?
-
- //char* message = goodle_doodle_session_build_draw_string( d_list );
- //yahoo_doodle_command_send_draw( ds->gc, ds->who, message );
+ // Send draw list to prpl draw_list handler
+ if( gtkwb->wb->prpl_ops && gtkwb->wb->prpl_ops->send_draw_list )
+ gtkwb->wb->prpl_ops->send_draw_list( gtkwb->wb, draw_list );
// The brush stroke is finished, clear the list for another one
- gaim_whiteboard_draw_list_destroy( d_list );
+ if( draw_list )
+ draw_list = gaim_whiteboard_draw_list_destroy( draw_list );
- int *brush_color = g_new0( int, 1 );
- int *brush_size = g_new0( int, 1 );
int *x0 = g_new0( int, 1 );
int *y0 = g_new0( int, 1 );
-
- // *brush_color = gtkwb->brush_color;
- // *brush_size = gtkwb->brush_size;
+
*x0 = LastX;
*y0 = LastY;
// Reset motion tracking
MotionCount = 0;
-
- 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 ) );
- }
- //else
- {
+
+ draw_list = g_list_append( draw_list, ( gpointer )( x0 ) );
+ draw_list = g_list_append( draw_list, ( gpointer )( y0 ) );
+
dx = g_new0( int, 1 );
dy = g_new0( int, 1 );
-
+
*dx = x - LastX;
*dy = y - LastY;
-
- d_list = g_list_append( d_list, ( gpointer )( dx ) );
- d_list = g_list_append( d_list, ( gpointer )( dy ) );
}
-*/
+
+ draw_list = g_list_append( draw_list, ( gpointer )( dx ) );
+ draw_list = g_list_append( draw_list, ( gpointer )( dy ) );
+
gaim_gtk_whiteboard_draw_brush_line( gtkwb->wb,
LastX, LastY,
x, y,
@@ -487,6 +475,8 @@
LastX = x;
LastY = y;
}
+
+ wb->draw_list = draw_list;
return( TRUE );
}
@@ -495,12 +485,12 @@
gboolean gaim_gtk_whiteboard_brush_up( GtkWidget *widget, GdkEventButton *event, gpointer data )
{
- //g_print( "BRUSH_UP | %s\n", ds->who );
+ GaimGtkWhiteboard *gtkwb = ( GaimGtkWhiteboard* )( data );
+ //g_print( "gaim_gtk_whiteboard_brush_up | %s\n", gtkwb->wb->who );
+ GdkPixmap *pixmap = gtkwb->pixmap;
- GaimGtkWhiteboard *gtkwb = ( GaimGtkWhiteboard* )( data );
- GdkPixmap *pixmap = gtkwb->pixmap;
-
-// GList *d_list = gtkwb->wb->draw_list;
+ GaimWhiteboard *wb = gtkwb->wb;
+ GList *draw_list = wb->draw_list;
if( ( BrushState != BRUSH_STATE_DOWN ) && ( BrushState != BRUSH_STATE_MOTION ) )
{
@@ -514,14 +504,14 @@
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 ) )
if( MotionCount == 0 )
{
int index;
- for( index = 0; index < 2; index++ )
+ for( index = 0; index < 2; index++ ) // NOTE Yahoo Doodle specific!
{
int *x0 = NULL;
int *y0 = NULL;
@@ -529,20 +519,24 @@
x0 = g_new0( int, 1 );
y0 = g_new0( int, 1 );
- d_list = g_list_append( d_list, ( gpointer )( x0 ) );
- d_list = g_list_append( d_list, ( gpointer )( y0 ) );
+ draw_list = g_list_append( draw_list, ( gpointer )( x0 ) );
+ draw_list = g_list_append( draw_list, ( gpointer )( y0 ) );
}
}
//else
// MotionCount = 0;
- //char* message = goodle_doodle_session_build_draw_string( drawList );
- //yahoo_doodle_command_send_draw( ds->gc, ds->who, message );
-*/
+ // Send draw list to prpl draw_list handler
+ if( gtkwb->wb->prpl_ops && gtkwb->wb->prpl_ops->send_draw_list )
+ gtkwb->wb->prpl_ops->send_draw_list( gtkwb->wb, draw_list );
+
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 );
+ if( draw_list )
+ draw_list = gaim_whiteboard_draw_list_destroy( draw_list );
+
+ wb->draw_list = draw_list;
}
return( TRUE );
@@ -667,6 +661,16 @@
// ------------------------------------------------------------------------------------------------------
+void gaim_gtk_whiteboard_set_dimensions( GaimWhiteboard *wb, int width, int height )
+{
+ GaimGtkWhiteboard *gtkwb = wb->ui_data;
+
+ gtkwb->width = width;
+ gtkwb->height = height;
+}
+
+// ------------------------------------------------------------------------------------------------------
+
void gaim_gtk_whiteboard_clear( GaimWhiteboard *wb )
{
GaimGtkWhiteboard *gtkwb = wb->ui_data;
--- a/src/gtkwhiteboard.h Fri Jul 29 23:23:43 2005 -0400
+++ b/src/gtkwhiteboard.h Fri Aug 05 20:35:59 2005 -0400
@@ -74,6 +74,7 @@
void gaim_gtk_whiteboard_draw_brush_line( GaimWhiteboard *wb,
int x0, int y0, int x1, int y1, int color, int size );
+void gaim_gtk_whiteboard_set_dimensions( GaimWhiteboard *wb, int width, int height );
void gaim_gtk_whiteboard_clear( GaimWhiteboard *wb );
void gaim_gtk_whiteboard_button_clear_press( GtkWidget *widget, gpointer data );
--- a/src/protocols/yahoo/yahoo.c Fri Jul 29 23:23:43 2005 -0400
+++ b/src/protocols/yahoo/yahoo.c Fri Aug 05 20:35:59 2005 -0400
@@ -696,6 +696,8 @@
GSList *l = pkt->hash;
GSList *list = NULL;
struct _yahoo_im *im = NULL;
+
+ char imv[16];
if (pkt->status <= 1 || pkt->status == 5) {
while (l) {
@@ -719,12 +721,35 @@
if (im)
im->msg = pair->value;
}
+ // IMV key
+ if (pair->key == 63)
+ {
+ strcpy( imv, pair->value );
+ }
l = l->next;
}
} else if (pkt->status == 2) {
gaim_notify_error(gc, NULL,
_("Your Yahoo! message did not get sent."), NULL);
}
+
+ // Check for the Doodle IMV
+ if( !strcmp( imv, "doodle;11" ) )
+ {
+ g_print( "'doodle;11' found in chat packet\n" );
+
+ GaimWhiteboard *wb = gaim_whiteboard_get_session( gc->account, im->from );
+
+ // If a Doodle session doesn't exist between this user
+ if( wb == NULL )
+ {
+ g_print( "Creating new whiteboard for chat packet request\n" );
+ wb = gaim_whiteboard_create( gc->account, im->from, DOODLE_STATE_REQUESTED );
+
+ yahoo_doodle_command_send_request( gc, im->from );
+ yahoo_doodle_command_send_ready( gc, im->from );
+ }
+ }
for (l = list; l; l = l->next) {
YahooFriend *f;
@@ -2914,20 +2939,14 @@
yahoo_packet_hash_str(pkt, 97, "1");
yahoo_packet_hash_str(pkt, 14, msg2);
- /*
// If this message is to a user who is also Doodling with the local user,
- // format the chat packet with the IMV information (thanks Yahoo!)
- doodle_session *ds = goodle_get_doodle_session( dsList,
- ( char* )( gaim_account_get_username( gc->account ) ),
- ( char* )( who ) );
+ // format the chat packet with the correct IMV information (thanks Yahoo!)
+ GaimWhiteboard *wb = gaim_whiteboard_get_session(gc->account, (char*)who);
+ if (wb)
+ yahoo_packet_hash_str(pkt, 63, "doodle;11");
+ else
+ yahoo_packet_hash_str(pkt, 63, ";0"); // IMvironment
- if( ds )
- yahoo_packet_hash(pkt, 63, "doodle;11");
- else
- yahoo_packet_hash(pkt, 63, ";0"); // IMvironment
- */
-
- yahoo_packet_hash_str(pkt, 63, ";0"); /* IMvironment */
yahoo_packet_hash_str(pkt, 64, "0"); /* no idea */
yahoo_packet_hash_str(pkt, 1002, "1"); /* no idea, Yahoo 6 or later only it seems */
if (!yd->picture_url)
@@ -3485,6 +3504,9 @@
{
yahoo_doodle_start,
yahoo_doodle_end,
+ yahoo_doodle_get_dimensions,
+ NULL,
+ yahoo_doodle_send_draw_list,
yahoo_doodle_clear
};
--- a/src/protocols/yahoo/yahoo_doodle.c Fri Jul 29 23:23:43 2005 -0400
+++ b/src/protocols/yahoo/yahoo_doodle.c Fri Aug 05 20:35:59 2005 -0400
@@ -201,7 +201,6 @@
if( wb->state == DOODLE_STATE_REQUESTING )
{
- // TODO Check for active pixmap?
gaim_whiteboard_start( wb );
wb->state = DOODLE_STATE_ESTABLISHED;
@@ -211,11 +210,20 @@
if( wb->state == DOODLE_STATE_ESTABLISHED )
{
- // TODO Call clear function (requires function to clear canvas (but not send clear command packet)
// Ask whether to save picture too
gaim_whiteboard_clear( wb );
}
+
+ // NOTE Not sure about this... I am trying to handle if the remote user already
+ // thinks we're in a session with them (when their chat message contains the doodle;11 imv key)
+ if( wb->state == DOODLE_STATE_REQUESTED )
+ {
+ g_print( "Hmmmm\n" );
+
+ //gaim_whiteboard_start( wb );
+ yahoo_doodle_command_send_request( gc, from );
+ }
}
// ------------------------------------------------------------------------------------------------------
@@ -569,15 +577,18 @@
// ------------------------------------------------------------------------------------------------------
void yahoo_doodle_start( GaimWhiteboard *wb )
-{/*
+{
+ g_print( "yahoo_doodle_start()\n" );
+
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
- wb->proto_data = ds;*/
- int n = 0;
+ wb->proto_data = ds;
+
+ g_print( "---wb->proto_data:%p\n", wb->proto_data );
}
// ------------------------------------------------------------------------------------------------------
@@ -589,26 +600,56 @@
GaimConnection *gc = gaim_account_get_connection( wb->account );
yahoo_doodle_command_send_shutdown( gc, wb->who );
+
+ doodle_session *ds = wb->proto_data;
+ if( ds )
+ g_free( ds );
+}
+
+// ------------------------------------------------------------------------------------------------------
+
+void yahoo_doodle_get_dimensions( GaimWhiteboard *wb, int *width, int *height )
+{
+ // Standard Doodle canvases are of one size: 368x256
+ *width = DOODLE_CANVAS_WIDTH;
+ *height = DOODLE_CANVAS_HEIGHT;
+}
+
+// ------------------------------------------------------------------------------------------------------
+
+void yahoo_doodle_send_draw_list( GaimWhiteboard *wb, GList *draw_list )
+{
+ g_print( "yahoo_doodle_send_draw_list()\n" );
+
+ doodle_session *ds = wb->proto_data;
+ if( ds == NULL )
+ g_print( "doodle_session not there?\n" );
+ char *message = yahoo_doodle_build_draw_string( ds, draw_list );
+
+ if( message )
+ {
+ yahoo_doodle_command_send_draw( wb->account->gc, wb->who, message );
+ }
+ else
+ g_print( "no message?\n" );
}
// ------------------------------------------------------------------------------------------------------
void yahoo_doodle_clear( GaimWhiteboard *wb )
{
- GaimConnection *gc = gaim_account_get_connection( wb->account );
-
- yahoo_doodle_command_send_clear( gc, wb->who );
+ yahoo_doodle_command_send_clear( wb->account->gc, wb->who );
}
// ------------------------------------------------------------------------------------------------------
-void yahoo_doodle_draw_stroke( GaimWhiteboard *wb, GList *d_list )
+void yahoo_doodle_draw_stroke( GaimWhiteboard *wb, GList *draw_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;
+ GList *l = draw_list;
int *n = NULL;
@@ -647,18 +688,33 @@
}
// ------------------------------------------------------------------------------------------------------
-/*
-char *goodle_doodle_session_build_draw_string( GList *d_list )
+
+char *yahoo_doodle_build_draw_string( doodle_session *ds, GList *draw_list )
{
- GList *l = d_list;
+ g_print( "yahoo_doodle_build_draw_string()\n" );
+
+ if( draw_list == NULL )
+ {
+ g_print( "---Oh, shit! The list is empty!?! %p\n", draw_list );
+ return( NULL );
+ }
+
+ GList *l = draw_list;
int *n = NULL;
- static char message[1024]; // Hope that 500 is enough
+ static char message[1024]; // Hope that 1024 is enough
char token_string[16]; // Token string extracted from draw list
strcpy( message, "\"" );
+ g_print( "---SOOOO far!\n" );
+
+ sprintf( token_string, "%d,%d,", ds->brush_color, ds->brush_size );
+ strcat( message, token_string );
+
+ g_print( "---Started message with: %s\n", token_string );
+
// Pray this works and pray that the list has an even number of elements
while( l )
{
@@ -675,6 +731,8 @@
l = l->next;
}
+ g_print( "---Finished traversing through list\n" );
+
message[strlen( message ) - 1] = '\"';
//message[strlen( message )] = 0;
//message[511] = 0;
@@ -686,4 +744,3 @@
// ------------------------------------------------------------------------------------------------------
-*/
--- a/src/protocols/yahoo/yahoo_doodle.h Fri Jul 29 23:23:43 2005 -0400
+++ b/src/protocols/yahoo/yahoo_doodle.h Fri Aug 05 20:35:59 2005 -0400
@@ -113,10 +113,12 @@
void yahoo_doodle_start( GaimWhiteboard *wb );
void yahoo_doodle_end( GaimWhiteboard *wb );
+void yahoo_doodle_get_dimensions( GaimWhiteboard *wb, int *width, int *height );
+void yahoo_doodle_send_draw_list( GaimWhiteboard *wb, GList *draw_list );
void yahoo_doodle_clear( GaimWhiteboard *wb );
-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 *draw_list );
+char *yahoo_doodle_build_draw_string( doodle_session *ds, GList *draw_list );
#endif // _YAHOO_DOODLE_H_
--- a/src/whiteboard.c Fri Jul 29 23:23:43 2005 -0400
+++ b/src/whiteboard.c Fri Aug 05 20:35:59 2005 -0400
@@ -66,6 +66,10 @@
GaimPluginProtocolInfo *prpl_info = GAIM_PLUGIN_PROTOCOL_INFO( account->gc->prpl );
gaim_whiteboard_set_prpl_ops( wb, prpl_info->whiteboard_prpl_ops );
+ // Start up protocol specifics
+ if( wb->prpl_ops && wb->prpl_ops->start )
+ wb->prpl_ops->start( wb );
+
wbList = g_list_append( wbList, ( gpointer )( wb ) );
return( wb );
@@ -137,10 +141,7 @@
if( !strcmp( gaim_account_get_username( wb->account ), gaim_account_get_username( account ) ) &&
!strcmp( wb->who, who ) )
- {
- //g_print( "@Found whiteboard session\n" );
return( wb );
- }
l = l->next;
}
@@ -150,22 +151,48 @@
// ------------------------------------------------------------------------------------------------------
-void gaim_whiteboard_draw_list_destroy( GList *d_list )
+GList *gaim_whiteboard_draw_list_destroy( GList *draw_list )
{
- // Destroy the contents of this list
- int *n = NULL;
- GList *l = d_list;
- while( l )
+ g_print( "gaim_whiteboard_draw_list_destroy()\n" );
+
+ if( draw_list == NULL )
+ {
+ g_print( "-1-FUCK, the list is empty: %p\n", draw_list );
+ return( NULL );
+ }
+ else
{
- n = l->data;
+ g_print( "-2-d_list:%p\n", draw_list );
+
+ // Destroy the contents of this list
+ int *n = NULL;
+ GList *l = draw_list;
+ while( l )
+ {
+ n = l->data;
+
+ if( n )
+ {
+ g_print( "-3-n=%d\n", *n );
+ g_free( n );
+ }
+
+ l = l->next;
+ }
- g_free( n );
-
- l = l->next;
+ g_list_free( draw_list );
+ draw_list = NULL;
}
- g_list_free( d_list );
- d_list = NULL;
+ return( draw_list );
+}
+
+// ------------------------------------------------------------------------------------------------------
+
+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 );
}
// ------------------------------------------------------------------------------------------------------
--- a/src/whiteboard.h Fri Jul 29 23:23:43 2005 -0400
+++ b/src/whiteboard.h Fri Aug 05 20:35:59 2005 -0400
@@ -28,7 +28,7 @@
// DEFINES =============================================================================================
#include "internal.h"
-typedef struct _GaimWhiteboardPrplOps GaimWhiteboardPrplOps; // NOTE A nasty compiler fix
+typedef struct _GaimWhiteboardPrplOps GaimWhiteboardPrplOps; // NOTE A nasty compiler dependency fix
#include "account.h"
@@ -53,6 +53,7 @@
{
void ( *create )( GaimWhiteboard *wb );
void ( *destroy )( GaimWhiteboard *wb );
+ void ( *set_dimensions)( GaimWhiteboard *wb, int width, int height );
void ( *draw_point )( GaimWhiteboard *wb, int x, int y, int color, int size );
void ( *draw_line )( GaimWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size );
void ( *clear )( GaimWhiteboard *wb );
@@ -62,6 +63,9 @@
{
void ( *start )( GaimWhiteboard *wb );
void ( *end )( GaimWhiteboard *wb );
+ void ( *get_dimensions )( GaimWhiteboard *wb, int *width, int *height );
+ void ( *set_dimensions )( GaimWhiteboard *wb, int width, int height );
+ void ( *send_draw_list )( GaimWhiteboard *wb, GList *draw_list );
void ( *clear )( GaimWhiteboard *wb );
};
@@ -75,8 +79,9 @@
GaimWhiteboard *gaim_whiteboard_get_session( GaimAccount *account, char *who );
-void gaim_whiteboard_draw_list_destroy( GList *d_list );
+GList *gaim_whiteboard_draw_list_destroy( GList *draw_list );
+void gaim_whiteboard_set_dimensions( GaimWhiteboard *wb, int width, int height );
void gaim_whiteboard_draw_point( GaimWhiteboard *wb, int x, int y, int color, int size );
void gaim_whiteboard_draw_line( GaimWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size );
void gaim_whiteboard_clear( GaimWhiteboard *wb );