Wed, 16 Jan 2008 06:29:52 +0000
Get rid of an unnecessary allocation.
| 11475 | 1 | /** |
| 2 | * @file yahoo_doodle.h The Yahoo! protocol plugin Doodle IMVironment object | |
| 3 | * | |
| 15884 | 4 | * purple |
| 11475 | 5 | * |
| 15884 | 6 | * Purple is the legal property of its developers, whose names are too numerous |
| 11475 | 7 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 8 | * source distribution. | |
| 9 | * | |
| 10 | * This program is free software; you can redistribute it and/or modify | |
| 11 | * it under the terms of the GNU General Public License as published by | |
| 12 | * the Free Software Foundation; either version 2 of the License, or | |
| 13 | * (at your option) any later version. | |
| 14 | * | |
| 15 | * This program is distributed in the hope that it will be useful, | |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 | * GNU General Public License for more details. | |
| 19 | * | |
| 20 | * You should have received a copy of the GNU General Public License | |
| 21 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19064
diff
changeset
|
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 11475 | 23 | */ |
| 24 | ||
| 25 | #ifndef _YAHOO_DOODLE_H_ | |
| 26 | #define _YAHOO_DOODLE_H_ | |
| 27 | ||
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
28 | /****************************************************************************** |
|
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
29 | * Includes |
|
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
30 | *****************************************************************************/ |
| 11475 | 31 | #include "whiteboard.h" |
| 32 | #include "cmds.h" | |
| 33 | ||
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
34 | #define DOODLE_IMV_KEY "doodle;106" |
|
19064
1680699bdbf4
Fix yahoo doodling to work with newer yahoo messenger clients. This breaks doodling with older Pidgin clients (trying to support both looked too painful). Fixes #1445.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
35 | |
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
36 | /****************************************************************************** |
|
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
37 | * Defines |
|
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
38 | *****************************************************************************/ |
|
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
39 | /* Doodle communication commands */ |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
40 | /* TODO: Should be an enum. */ |
|
19064
1680699bdbf4
Fix yahoo doodling to work with newer yahoo messenger clients. This breaks doodling with older Pidgin clients (trying to support both looked too painful). Fixes #1445.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
41 | #define DOODLE_CMD_REQUEST 0 |
|
1680699bdbf4
Fix yahoo doodling to work with newer yahoo messenger clients. This breaks doodling with older Pidgin clients (trying to support both looked too painful). Fixes #1445.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
42 | #define DOODLE_CMD_CLEAR 1 |
|
1680699bdbf4
Fix yahoo doodling to work with newer yahoo messenger clients. This breaks doodling with older Pidgin clients (trying to support both looked too painful). Fixes #1445.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
43 | #define DOODLE_CMD_DRAW 2 |
|
1680699bdbf4
Fix yahoo doodling to work with newer yahoo messenger clients. This breaks doodling with older Pidgin clients (trying to support both looked too painful). Fixes #1445.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
44 | #define DOODLE_CMD_EXTRA 3 |
|
1680699bdbf4
Fix yahoo doodling to work with newer yahoo messenger clients. This breaks doodling with older Pidgin clients (trying to support both looked too painful). Fixes #1445.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
45 | #define DOODLE_CMD_READY 4 |
|
1680699bdbf4
Fix yahoo doodling to work with newer yahoo messenger clients. This breaks doodling with older Pidgin clients (trying to support both looked too painful). Fixes #1445.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
46 | #define DOODLE_CMD_CONFIRM 5 |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
47 | /* Doodle communication command for shutting down (also 0) */ |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
48 | #define DOODLE_CMD_SHUTDOWN 0 |
| 11475 | 49 | |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
50 | #define DOODLE_EXTRA_NONE "\"1\"" |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
51 | #define DOODLE_EXTRA_TICTACTOE "\"3\"" |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
52 | #define DOODLE_EXTRA_DOTS "\"2\"" |
| 11475 | 53 | |
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
54 | /* Doodle session states */ |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
55 | /* TODO: Should be an enum. */ |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
56 | #define DOODLE_STATE_REQUESTING 0 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
57 | #define DOODLE_STATE_REQUESTED 1 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
58 | #define DOODLE_STATE_ESTABLISHED 2 |
|
19064
1680699bdbf4
Fix yahoo doodling to work with newer yahoo messenger clients. This breaks doodling with older Pidgin clients (trying to support both looked too painful). Fixes #1445.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
59 | #define DOODLE_STATE_CANCELED 3 |
| 11475 | 60 | |
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
61 | /* Doodle canvas dimensions */ |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
62 | #define DOODLE_CANVAS_WIDTH 368 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
63 | #define DOODLE_CANVAS_HEIGHT 256 |
| 11475 | 64 | |
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
65 | /* Doodle color codes (most likely RGB) */ |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
66 | /* TODO: Should be an enum and sorted by color name. */ |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
67 | #define DOODLE_COLOR_RED 13369344 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
68 | #define DOODLE_COLOR_ORANGE 16737792 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
69 | #define DOODLE_COLOR_YELLOW 15658496 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
70 | #define DOODLE_COLOR_GREEN 52224 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
71 | #define DOODLE_COLOR_CYAN 52428 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
72 | #define DOODLE_COLOR_BLUE 204 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
73 | #define DOODLE_COLOR_VIOLET 5381277 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
74 | #define DOODLE_COLOR_PURPLE 13369548 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
75 | #define DOODLE_COLOR_TAN 12093547 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
76 | #define DOODLE_COLOR_BROWN 5256485 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
77 | #define DOODLE_COLOR_BLACK 0 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
78 | #define DOODLE_COLOR_GREY 11184810 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
79 | #define DOODLE_COLOR_WHITE 16777215 |
| 11475 | 80 | |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
81 | #define PALETTE_NUM_OF_COLORS 12 |
| 11475 | 82 | |
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
83 | /* Doodle brush sizes (most likely variable) */ |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
84 | #define DOODLE_BRUSH_SMALL 2 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
85 | #define DOODLE_BRUSH_MEDIUM 5 |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
86 | #define DOODLE_BRUSH_LARGE 10 |
| 11475 | 87 | |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
88 | #define DOODLE_MAX_BRUSH_MOTIONS 100 |
| 11475 | 89 | |
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
90 | /****************************************************************************** |
|
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
91 | * Datatypes |
|
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
92 | *****************************************************************************/ |
| 11475 | 93 | typedef struct _doodle_session |
| 94 | { | |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
95 | int brush_size; /* Size of drawing brush */ |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
96 | int brush_color; /* Color of drawing brush */ |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
97 | gchar *imv_key; |
| 11475 | 98 | } doodle_session; |
| 99 | ||
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
100 | /****************************************************************************** |
|
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
101 | * API |
|
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
102 | *****************************************************************************/ |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
103 | |
| 15884 | 104 | PurpleCmdRet yahoo_doodle_purple_cmd_start(PurpleConversation *conv, const char *cmd, char **args, |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11801
diff
changeset
|
105 | char **error, void *data); |
| 11475 | 106 | |
| 15884 | 107 | void yahoo_doodle_process(PurpleConnection *gc, const char *me, const char *from, |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
108 | const char *command, const char *message, const char *imv_key); |
| 15884 | 109 | void yahoo_doodle_initiate(PurpleConnection *gc, const char *to); |
| 11475 | 110 | |
| 15884 | 111 | void yahoo_doodle_command_got_shutdown(PurpleConnection *gc, const char *from); |
| 11475 | 112 | |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
113 | void yahoo_doodle_command_send_request(PurpleConnection *gc, const char *to, const char *imv_key); |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
114 | void yahoo_doodle_command_send_ready(PurpleConnection *gc, const char *to, const char *imv_key); |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
115 | void yahoo_doodle_command_send_draw(PurpleConnection *gc, const char *to, const char *message, const char *imv_key); |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
116 | void yahoo_doodle_command_send_clear(PurpleConnection *gc, const char *to, const char *imv_key); |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
117 | void yahoo_doodle_command_send_extra(PurpleConnection *gc, const char *to, const char *message, const char *imv_key); |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
118 | void yahoo_doodle_command_send_confirm(PurpleConnection *gc, const char *to, const char *imv_key); |
| 15884 | 119 | void yahoo_doodle_command_send_shutdown(PurpleConnection *gc, const char *to); |
| 11475 | 120 | |
| 15884 | 121 | void yahoo_doodle_start(PurpleWhiteboard *wb); |
| 122 | void yahoo_doodle_end(PurpleWhiteboard *wb); | |
| 123 | void yahoo_doodle_get_dimensions(const PurpleWhiteboard *wb, int *width, int *height); | |
| 124 | void yahoo_doodle_send_draw_list(PurpleWhiteboard *wb, GList *draw_list); | |
| 125 | void yahoo_doodle_clear(PurpleWhiteboard *wb); | |
| 11475 | 126 | |
| 15884 | 127 | void yahoo_doodle_draw_stroke(PurpleWhiteboard *wb, GList *draw_list); |
| 128 | void yahoo_doodle_get_brush(const PurpleWhiteboard *wb, int *size, int *color); | |
| 129 | void yahoo_doodle_set_brush(PurpleWhiteboard *wb, int size, int color); | |
| 11475 | 130 | |
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11800
diff
changeset
|
131 | #endif /* _YAHOO_DOODLE_H_ */ |