comparison src/gtkwhiteboard.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
comparison
equal deleted inserted replaced
11913:b3105d119a17 11914:2219f4bf4a57
27 27
28 #include "gtkgaim.h" 28 #include "gtkgaim.h"
29 29
30 #include "whiteboard.h" 30 #include "whiteboard.h"
31 31
32 #define FULL_CIRCLE_DEGREES 23040 32 #define FULL_CIRCLE_DEGREES 23040
33 33
34 #define BRUSH_STATE_UP 0 34 /* TODO: Make into an enum. */
35 #define BRUSH_STATE_DOWN 1 35 #define BRUSH_STATE_UP 0
36 #define BRUSH_STATE_MOTION 2 36 #define BRUSH_STATE_DOWN 1
37 #define BRUSH_STATE_MOTION 2
37 38
38 #define PALETTE_NUM_COLORS 7 39 /* XXX: This seems duplicated with the Yahoo! Doodle prpl code.
40 * XXX: How should they work together? */
41 #define PALETTE_NUM_COLORS 7
39 42
40 /** 43 /**
41 * A GaimGtkWhiteboard 44 * A GaimGtkWhiteboard
42 */ 45 */
43 typedef struct _GaimGtkWhiteboard 46 typedef struct _GaimGtkWhiteboard
44 { 47 {
45 GaimWhiteboard *wb; /**< backend data for this whiteboard */ 48 GaimWhiteboard *wb; /**< backend data for this whiteboard */
46 49
47 GtkWidget *window; /**< Window for the Doodle session */ 50 GtkWidget *window; /**< Window for the Doodle session */
48 GtkWidget *drawing_area; /**< Drawing area */ 51 GtkWidget *drawing_area; /**< Drawing area */
49 52
50 GdkPixmap *pixmap; /**< Memory for drawing area */ 53 GdkPixmap *pixmap; /**< Memory for drawing area */
51 54
52 int width; /**< Canvas width */ 55 int width; /**< Canvas width */
53 int height; /**< Canvas height */ 56 int height; /**< Canvas height */
57 int brush_color; /**< Foreground color */
58 int brush_size; /**< Brush size */
54 } GaimGtkWhiteboard; 59 } GaimGtkWhiteboard;
55 60
56 #ifdef __cplusplus 61 #ifdef __cplusplus
57 extern "C" { 62 extern "C" {
58 #endif /* __cplusplus */ 63 #endif /* __cplusplus */
65 /** 70 /**
66 * Gets the GtkWhiteboard UI Operations. 71 * Gets the GtkWhiteboard UI Operations.
67 * 72 *
68 * @return The GtkWhiteboard UI Operations. 73 * @return The GtkWhiteboard UI Operations.
69 */ 74 */
70 GaimWhiteboardUiOps *gaim_gtk_whiteboard_get_ui_ops( void ); 75 GaimWhiteboardUiOps *gaim_gtk_whiteboard_get_ui_ops( void );
71 76
72 /*@}*/ 77 /*@}*/
73 78
74 #ifdef __cplusplus 79 #ifdef __cplusplus
75 } 80 }