comparison src/whiteboard.h @ 11802:2e3a6dcebaf3

[gaim-migrate @ 14093] This should be it for the // -> /* */ for the doodle/whiteboard stuff. This could use a bit of cleaning yet.... committer: Tailor Script <tailor@pidgin.im>
author Gary Kramlich <grim@reaperworld.com>
date Mon, 24 Oct 2005 22:45:24 +0000
parents 7fab28c991f3
children 2219f4bf4a57
comparison
equal deleted inserted replaced
11801:81806e9241be 11802:2e3a6dcebaf3
23 */ 23 */
24 24
25 #ifndef _GAIM_WHITEBOARD_H_ 25 #ifndef _GAIM_WHITEBOARD_H_
26 #define _GAIM_WHITEBOARD_H_ 26 #define _GAIM_WHITEBOARD_H_
27 27
28 // DEFINES ============================================================================================= 28 /**
29 29 * Whiteboard PRPL Operations
30 typedef struct _GaimWhiteboardPrplOps GaimWhiteboardPrplOps; // NOTE A nasty compiler dependency fix 30 */
31 typedef struct _GaimWhiteboardPrplOps GaimWhiteboardPrplOps;
31 32
32 #include "account.h" 33 #include "account.h"
33 34
34 // INCLUDES ============================================================================================ 35 /**
35 36 * A GaimWhiteboard
36 // DATATYPES =========================================================================================== 37 */
37 typedef struct _GaimWhiteboard 38 typedef struct _GaimWhiteboard
38 { 39 {
39 int state; // State of whiteboard session 40 int state; /**< State of whiteboard session */
40 41
41 GaimAccount *account; // Account associated with this session 42 GaimAccount *account; /**< Account associated with this session */
42 char *who; // Name of the remote user 43 char *who; /**< Name of the remote user */
43 44
44 void *ui_data; // Graphical user-interface data 45 void *ui_data; /**< Graphical user-interface data */
45 void *proto_data; // Protocol specific data 46 void *proto_data; /**< Protocol specific data */
46 GaimWhiteboardPrplOps *prpl_ops; // Protocol-plugin operations 47 GaimWhiteboardPrplOps *prpl_ops; /**< Protocol-plugin operations */
47 48
48 GList *draw_list; // List of drawing elements/deltas to send 49 GList *draw_list; /**< List of drawing elements/deltas to send */
49 } GaimWhiteboard; 50 } GaimWhiteboard;
50 51
52 /**
53 * The GaimWhiteboard UI Operations
54 */
51 typedef struct _GaimWhiteboardUiOps 55 typedef struct _GaimWhiteboardUiOps
52 { 56 {
53 void ( *create )( GaimWhiteboard *wb ); 57 void ( *create )( GaimWhiteboard *wb ); /**< create function */
54 void ( *destroy )( GaimWhiteboard *wb ); 58 void ( *destroy )( GaimWhiteboard *wb ); /**< destory function */
55 void ( *set_dimensions)( GaimWhiteboard *wb, int width, int height ); 59 void ( *set_dimensions)( GaimWhiteboard *wb, int width, int height ); /**< set_dimensions function */
56 void ( *draw_point )( GaimWhiteboard *wb, int x, int y, int color, int size ); 60 void ( *draw_point )( GaimWhiteboard *wb, int x, int y, int color, int size ); /**< draw_point function */
57 void ( *draw_line )( GaimWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size ); 61 void ( *draw_line )( GaimWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size ); /**< draw_line function */
58 void ( *clear )( GaimWhiteboard *wb ); 62 void ( *clear )( GaimWhiteboard *wb ); /**< clear function */
59 } GaimWhiteboardUiOps; 63 } GaimWhiteboardUiOps;
60 64
65 /**
66 * GaimWhiteboard PRPL Operations
67 */
61 struct _GaimWhiteboardPrplOps 68 struct _GaimWhiteboardPrplOps
62 { 69 {
63 void ( *start )( GaimWhiteboard *wb ); 70 void ( *start )( GaimWhiteboard *wb ); /**< start function */
64 void ( *end )( GaimWhiteboard *wb ); 71 void ( *end )( GaimWhiteboard *wb ); /**< end function */
65 void ( *get_dimensions )( GaimWhiteboard *wb, int *width, int *height ); 72 void ( *get_dimensions )( GaimWhiteboard *wb, int *width, int *height ); /**< get_dimensions function */
66 void ( *set_dimensions )( GaimWhiteboard *wb, int width, int height ); 73 void ( *set_dimensions )( GaimWhiteboard *wb, int width, int height ); /**< set_dimensions function */
67 void ( *send_draw_list )( GaimWhiteboard *wb, GList *draw_list ); 74 void ( *send_draw_list )( GaimWhiteboard *wb, GList *draw_list ); /**< send_draw_list function */
68 void ( *clear )( GaimWhiteboard *wb ); 75 void ( *clear )( GaimWhiteboard *wb ); /**< clear function */
69 }; 76 };
70 77
71 // PROTOTYPES ========================================================================================== 78 #ifdef __cplusplus
79 extern "C" {
80 #endif /* __cplusplus */
72 81
82 /******************************************************************************/
83 /** @name GaimWhiteboard API */
84 /******************************************************************************/
85 /*@{*/
86
87 /**
88 * Sets the UI Operations
89 *
90 * @param ops The UI Operations to set
91 */
73 void gaim_whiteboard_set_ui_ops( GaimWhiteboardUiOps *ops ); 92 void gaim_whiteboard_set_ui_ops( GaimWhiteboardUiOps *ops );
74 93
94 /**
95 * Creates a whiteboard
96 *
97 * @param account The account.
98 * @param who Who you're drawing with.
99 * @param state The state.
100 *
101 * @return The new whiteboard
102 */
75 GaimWhiteboard *gaim_whiteboard_create( GaimAccount *account, char *who, int state ); 103 GaimWhiteboard *gaim_whiteboard_create( GaimAccount *account, char *who, int state );
104
105 /**
106 * Destroys a whiteboard
107 *
108 * @param wb The whiteboard.
109 */
76 void gaim_whiteboard_destroy( GaimWhiteboard *wb ); 110 void gaim_whiteboard_destroy( GaimWhiteboard *wb );
111
112 /**
113 * Starts a whiteboard
114 *
115 * @param wb The whiteboard.
116 */
77 void gaim_whiteboard_start( GaimWhiteboard *wb ); 117 void gaim_whiteboard_start( GaimWhiteboard *wb );
78 118
119 /**
120 * Finds a whiteboard from an account and user.
121 *
122 * @param account The account.
123 * @param who The user.
124 *
125 * @return The whiteboard if found, otherwise @c NULL.
126 */
79 GaimWhiteboard *gaim_whiteboard_get_session( GaimAccount *account, char *who ); 127 GaimWhiteboard *gaim_whiteboard_get_session( GaimAccount *account, char *who );
80 128
129 /**
130 * Destorys a drawing list for a whiteboard
131 *
132 * @param draw_list The drawing list.
133 *
134 * @return The start of the new drawing list (?)
135 */
81 GList *gaim_whiteboard_draw_list_destroy( GList *draw_list ); 136 GList *gaim_whiteboard_draw_list_destroy( GList *draw_list );
82 137
138 /**
139 * Sets the dimensions for a whiteboard.
140 *
141 * @param wb The whiteboard.
142 * @param width The width.
143 * @param height The height.
144 */
83 void gaim_whiteboard_set_dimensions( GaimWhiteboard *wb, int width, int height ); 145 void gaim_whiteboard_set_dimensions( GaimWhiteboard *wb, int width, int height );
146
147 /**
148 * Draws a point on a whiteboard.
149 *
150 * @param wb The whiteboard.
151 * @param x The x coordinate.
152 * @param y The y coordinate.
153 * @param color The color to use.
154 * @param size The brush size.
155 */
84 void gaim_whiteboard_draw_point( GaimWhiteboard *wb, int x, int y, int color, int size ); 156 void gaim_whiteboard_draw_point( GaimWhiteboard *wb, int x, int y, int color, int size );
157
158 /**
159 * Draws a line on a whiteboard
160 *
161 * @param wb The whiteboard.
162 * @param x1 The top-left x coordinate.
163 * @param y1 The top-left y coordinate.
164 * @param x2 The bottom-right x coordinate.
165 * @param y2 The bottom-right y coordinate.
166 * @param color The color to use.
167 * @param size The brush size.
168 */
85 void gaim_whiteboard_draw_line( GaimWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size ); 169 void gaim_whiteboard_draw_line( GaimWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size );
170
171 /**
172 * Clears a whiteboard
173 *
174 * @param wb The whiteboard.
175 */
86 void gaim_whiteboard_clear( GaimWhiteboard *wb ); 176 void gaim_whiteboard_clear( GaimWhiteboard *wb );
87 177
88 #endif // _GAIM_WHITEBOARD_H_ 178 /*@}*/
179
180 #ifdef __cplusplus
181 }
182 #endif /* __cplusplus */
183
184 #endif /* _GAIM_WHITEBOARD_H_ */