Mercurial > pidgin.yaz
diff src/whiteboard.h @ 11914:2219f4bf4a57
[gaim-migrate @ 14205]
SF Patch #1342017 from sadrul
"This patch allows a user to change brush color during
the doodle-session.
This patch is mostly a rough one to get an idea whether
the approach is correct. To make things simple, I have
kept brush_size and brush_color in GaimGtkWhiteboard,
although it's there in doodle_session. It could be in
either place, although I would think it's best to be in
GaimGtkWhiteboard because any/most implementations of
doodle-ing would have these attributes. So keeping them
within the prpl may not be the best option?
Anyway, considering the brush-size and color stay at
the prpl for now, I have introduced two functions in
GaimWhiteboardPrplOps to get/set the size and color of
the brush from the prpl.
rekkanoryo (using Y! 7) and I (using gaim) have tested
this, and it seemed to work OK."
Plus, I cleaned up a whole bunch of code.
My apologies for this all being committed together, but it was a case of "Oh, this will be quick." that lead into hours of making intertwined changes.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Mon, 31 Oct 2005 02:19:51 +0000 |
parents | 2e3a6dcebaf3 |
children | 9d562dde0a3a |
line wrap: on
line diff
--- a/src/whiteboard.h Mon Oct 31 01:58:26 2005 +0000 +++ b/src/whiteboard.h Mon Oct 31 02:19:51 2005 +0000 @@ -37,16 +37,16 @@ */ typedef struct _GaimWhiteboard { - int state; /**< State of whiteboard session */ + int state; /**< State of whiteboard session */ - GaimAccount *account; /**< Account associated with this session */ - char *who; /**< Name of the remote user */ + GaimAccount *account; /**< Account associated with this session */ + 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 *ui_data; /**< Graphical user-interface data */ + void *proto_data; /**< Protocol specific data */ + GaimWhiteboardPrplOps *prpl_ops; /**< Protocol-plugin operations */ - GList *draw_list; /**< List of drawing elements/deltas to send */ + GList *draw_list; /**< List of drawing elements/deltas to send */ } GaimWhiteboard; /** @@ -54,12 +54,15 @@ */ typedef struct _GaimWhiteboardUiOps { - void ( *create )( GaimWhiteboard *wb ); /**< create function */ - void ( *destroy )( GaimWhiteboard *wb ); /**< destory function */ - void ( *set_dimensions)( GaimWhiteboard *wb, int width, int height ); /**< set_dimensions function */ - void ( *draw_point )( GaimWhiteboard *wb, int x, int y, int color, int size ); /**< draw_point function */ - void ( *draw_line )( GaimWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size ); /**< draw_line function */ - void ( *clear )( GaimWhiteboard *wb ); /**< clear function */ + void (*create)(GaimWhiteboard *wb); /**< create function */ + void (*destroy)(GaimWhiteboard *wb); /**< destory function */ + void (*set_dimensions)(GaimWhiteboard *wb, int width, int height); /**< set_dimensions function */ + void (*draw_point)(GaimWhiteboard *wb, int x, int y, + int color, int size); /**< draw_point function */ + void (*draw_line)(GaimWhiteboard *wb, int x1, int y1, + int x2, int y2, + int color, int size); /**< draw_line function */ + void (*clear)(GaimWhiteboard *wb); /**< clear function */ } GaimWhiteboardUiOps; /** @@ -67,12 +70,14 @@ */ struct _GaimWhiteboardPrplOps { - void ( *start )( GaimWhiteboard *wb ); /**< start function */ - void ( *end )( GaimWhiteboard *wb ); /**< end function */ - void ( *get_dimensions )( GaimWhiteboard *wb, int *width, int *height ); /**< get_dimensions function */ - void ( *set_dimensions )( GaimWhiteboard *wb, int width, int height ); /**< set_dimensions function */ - void ( *send_draw_list )( GaimWhiteboard *wb, GList *draw_list ); /**< send_draw_list function */ - void ( *clear )( GaimWhiteboard *wb ); /**< clear function */ + void (*start)(GaimWhiteboard *wb); /**< start function */ + void (*end)(GaimWhiteboard *wb); /**< end function */ + void (*get_dimensions)(GaimWhiteboard *wb, int *width, int *height); /**< get_dimensions function */ + void (*set_dimensions)(GaimWhiteboard *wb, int width, int height); /**< set_dimensions function */ + void (*get_brush) (GaimWhiteboard *wb, int *size, int *color); /**< get the brush size and color */ + void (*set_brush) (GaimWhiteboard *wb, int size, int color); /**< set the brush size and color */ + void (*send_draw_list)(GaimWhiteboard *wb, GList *draw_list); /**< send_draw_list function */ + void (*clear)(GaimWhiteboard *wb); /**< clear function */ }; #ifdef __cplusplus @@ -89,7 +94,7 @@ * * @param ops The UI Operations to set */ -void gaim_whiteboard_set_ui_ops( GaimWhiteboardUiOps *ops ); +void gaim_whiteboard_set_ui_ops(GaimWhiteboardUiOps *ops); /** * Creates a whiteboard @@ -100,21 +105,21 @@ * * @return The new whiteboard */ -GaimWhiteboard *gaim_whiteboard_create( GaimAccount *account, char *who, int state ); +GaimWhiteboard *gaim_whiteboard_create(GaimAccount *account, const char *who, int state); /** * Destroys a whiteboard * * @param wb The whiteboard. */ -void gaim_whiteboard_destroy( GaimWhiteboard *wb ); +void gaim_whiteboard_destroy(GaimWhiteboard *wb); /** * Starts a whiteboard * * @param wb The whiteboard. */ -void gaim_whiteboard_start( GaimWhiteboard *wb ); +void gaim_whiteboard_start(GaimWhiteboard *wb); /** * Finds a whiteboard from an account and user. @@ -124,16 +129,14 @@ * * @return The whiteboard if found, otherwise @c NULL. */ -GaimWhiteboard *gaim_whiteboard_get_session( GaimAccount *account, char *who ); +GaimWhiteboard *gaim_whiteboard_get_session(GaimAccount *account, const char *who); /** * Destorys a drawing list for a whiteboard * * @param draw_list The drawing list. - * - * @return The start of the new drawing list (?) */ -GList *gaim_whiteboard_draw_list_destroy( GList *draw_list ); +void gaim_whiteboard_draw_list_destroy(GList *draw_list); /** * Sets the dimensions for a whiteboard. @@ -142,7 +145,7 @@ * @param width The width. * @param height The height. */ -void gaim_whiteboard_set_dimensions( GaimWhiteboard *wb, int width, int height ); +void gaim_whiteboard_set_dimensions(GaimWhiteboard *wb, int width, int height); /** * Draws a point on a whiteboard. @@ -153,7 +156,7 @@ * @param color The color to use. * @param size The brush size. */ -void gaim_whiteboard_draw_point( GaimWhiteboard *wb, int x, int y, int color, int size ); +void gaim_whiteboard_draw_point(GaimWhiteboard *wb, int x, int y, int color, int size); /** * Draws a line on a whiteboard @@ -166,14 +169,14 @@ * @param color The color to use. * @param size The brush size. */ -void gaim_whiteboard_draw_line( GaimWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size ); +void gaim_whiteboard_draw_line(GaimWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size); /** * Clears a whiteboard * * @param wb The whiteboard. */ -void gaim_whiteboard_clear( GaimWhiteboard *wb ); +void gaim_whiteboard_clear(GaimWhiteboard *wb); /*@}*/