Mercurial > pidgin
annotate plugins/perl/common/Conversation.xs @ 12869:45c7f6510baa
[gaim-migrate @ 15221]
ranma42 got me his name.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sat, 14 Jan 2006 00:32:31 +0000 |
parents | 622110272ed9 |
children | 2422097a7a5e |
rev | line source |
---|---|
6591 | 1 #include "module.h" |
2 | |
12819
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
3 MODULE = Gaim::Conversation PACKAGE = Gaim PREFIX = gaim_ |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
4 PROTOTYPES: ENABLE |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
5 |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
6 void |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
7 gaim_get_ims() |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
8 PREINIT: |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
9 GList *l; |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
10 PPCODE: |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
11 for (l = gaim_get_ims(); l != NULL; l = l->next) { |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
12 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::Conversation"))); |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
13 } |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
14 |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
15 void |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
16 gaim_get_conversations() |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
17 PREINIT: |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
18 GList *l; |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
19 PPCODE: |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
20 for (l = gaim_get_conversations(); l != NULL; l = l->next) { |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
21 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::Conversation"))); |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
22 } |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
23 |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
24 void |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
25 gaim_get_chats() |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
26 PREINIT: |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
27 GList *l; |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
28 PPCODE: |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
29 for (l = gaim_get_chats(); l != NULL; l = l->next) { |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
30 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::Conversation"))); |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
31 } |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
32 |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
33 MODULE = Gaim::Conversation PACKAGE = Gaim::Conversations PREFIX = gaim_conversations_ |
11123 | 34 PROTOTYPES: ENABLE |
35 | |
36 void * | |
37 gaim_conversations_get_handle() | |
38 | |
11581 | 39 void |
11123 | 40 gaim_conversations_init() |
41 | |
42 void | |
11581 | 43 gaim_conversations_uninit() |
11123 | 44 |
12819
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
45 MODULE = Gaim::Conversation PACKAGE = Gaim::Conversation PREFIX = gaim_conversation_ |
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
46 PROTOTYPES: ENABLE |
11123 | 47 |
48 void | |
49 gaim_conversation_get_send_history(conv) | |
6591 | 50 Gaim::Conversation conv |
11123 | 51 PREINIT: |
52 GList *l; | |
53 PPCODE: | |
54 for (l = gaim_conversation_get_send_history(conv); l != NULL; l = l->next) { | |
55 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::ListEntry"))); | |
56 } | |
57 | |
11581 | 58 void |
11123 | 59 gaim_conversation_destroy(conv) |
60 Gaim::Conversation conv | |
61 | |
11581 | 62 Gaim::ConversationType |
11123 | 63 gaim_conversation_get_type(conv) |
64 Gaim::Conversation conv | |
6591 | 65 |
66 Gaim::Account | |
67 gaim_conversation_get_account(conv) | |
68 Gaim::Conversation conv | |
69 | |
70 Gaim::Connection | |
71 gaim_conversation_get_gc(conv) | |
72 Gaim::Conversation conv | |
73 | |
11581 | 74 void |
11123 | 75 gaim_conversation_set_title(conv, title); |
6591 | 76 Gaim::Conversation conv |
11123 | 77 const char * title |
6591 | 78 |
11123 | 79 const char * |
80 gaim_conversation_get_title(conv) | |
81 Gaim::Conversation conv | |
82 | |
11581 | 83 void |
6591 | 84 gaim_conversation_autoset_title(conv) |
85 Gaim::Conversation conv | |
86 | |
11581 | 87 void |
11123 | 88 gaim_conversation_set_name(conv, name) |
89 Gaim::Conversation conv | |
90 const char *name | |
91 | |
6591 | 92 const char * |
93 gaim_conversation_get_name(conv) | |
94 Gaim::Conversation conv | |
11581 | 95 |
96 void | |
6591 | 97 gaim_conversation_set_logging(conv, log) |
98 Gaim::Conversation conv | |
99 gboolean log | |
100 | |
11581 | 101 gboolean |
6591 | 102 gaim_conversation_is_logging(conv) |
103 Gaim::Conversation conv | |
104 | |
11123 | 105 |
6591 | 106 Gaim::Conversation::IM |
107 gaim_conversation_get_im_data(conv) | |
108 Gaim::Conversation conv | |
109 | |
110 Gaim::Conversation::Chat | |
111 gaim_conversation_get_chat_data(conv) | |
112 Gaim::Conversation conv | |
113 | |
11581 | 114 gpointer |
11123 | 115 gaim_conversation_get_data(conv, key) |
116 Gaim::Conversation conv | |
117 const char * key | |
6591 | 118 |
11581 | 119 Gaim::ConnectionFlags |
11123 | 120 gaim_conversation_get_features(conv) |
121 Gaim::Conversation conv | |
122 | |
11581 | 123 gboolean |
11123 | 124 gaim_conversation_has_focus(conv) |
125 Gaim::Conversation conv | |
126 | |
11581 | 127 void |
11123 | 128 gaim_conversation_update(conv, type) |
129 Gaim::Conversation conv | |
130 Gaim::ConvUpdateType type | |
11581 | 131 |
132 Gaim::Conversation | |
12364 | 133 gaim_conversation_new(class, type, account, name) |
11581 | 134 Gaim::ConversationType type |
11170 | 135 Gaim::Account account |
136 const char *name | |
12364 | 137 C_ARGS: |
138 type, account, name | |
11123 | 139 |
11581 | 140 void |
11170 | 141 gaim_conversation_set_account(conv, account); |
142 Gaim::Conversation conv | |
143 Gaim::Account account | |
11581 | 144 |
12340 | 145 MODULE = Gaim::Conversation PACKAGE = Gaim::Conversation::IM PREFIX = gaim_conv_im_ |
11123 | 146 PROTOTYPES: ENABLE |
147 | |
148 Gaim::Conversation | |
149 gaim_conv_im_get_conversation(im) | |
150 Gaim::Conversation::IM im | |
151 | |
11581 | 152 void |
11123 | 153 gaim_conv_im_set_icon(im, icon) |
154 Gaim::Conversation::IM im | |
155 Gaim::Buddy::Icon icon | |
156 | |
157 Gaim::Buddy::Icon | |
158 gaim_conv_im_get_icon(im) | |
159 Gaim::Conversation::IM im | |
160 | |
11581 | 161 void |
11123 | 162 gaim_conv_im_set_typing_state(im, state) |
163 Gaim::Conversation::IM im | |
164 Gaim::TypingState state | |
165 | |
11581 | 166 Gaim::TypingState |
11123 | 167 gaim_conv_im_get_typing_state(im) |
168 Gaim::Conversation::IM im | |
169 | |
11581 | 170 void |
11123 | 171 gaim_conv_im_start_typing_timeout(im, timeout) |
172 Gaim::Conversation::IM im | |
173 int timeout | |
174 | |
11581 | 175 void |
11123 | 176 gaim_conv_im_stop_typing_timeout(im) |
177 Gaim::Conversation::IM im | |
178 | |
11581 | 179 guint |
11123 | 180 gaim_conv_im_get_typing_timeout(im) |
181 Gaim::Conversation::IM im | |
182 | |
11581 | 183 void |
11123 | 184 gaim_conv_im_set_type_again(im, val) |
185 Gaim::Conversation::IM im | |
186 time_t val | |
187 | |
188 time_t | |
189 gaim_conv_im_get_type_again(im) | |
190 Gaim::Conversation::IM im | |
191 | |
11581 | 192 void |
11123 | 193 gaim_conv_im_start_type_again_timeout(im) |
194 Gaim::Conversation::IM im | |
195 | |
11581 | 196 void |
11123 | 197 gaim_conv_im_stop_type_again_timeout(im) |
198 Gaim::Conversation::IM im | |
199 | |
11581 | 200 guint |
11123 | 201 gaim_conv_im_get_type_again_timeout(im) |
202 Gaim::Conversation::IM im | |
203 | |
204 | |
11581 | 205 void |
11123 | 206 gaim_conv_im_update_typing(im) |
207 Gaim::Conversation::IM im | |
208 | |
209 | |
11581 | 210 void |
11123 | 211 gaim_conv_im_send(im, message) |
212 Gaim::Conversation::IM im | |
213 const char *message | |
214 | |
11581 | 215 void |
11170 | 216 gaim_conv_im_write(im, who, message, flags, mtime) |
217 Gaim::Conversation::IM im | |
218 const char *who | |
219 const char *message | |
220 Gaim::MessageFlags flags | |
221 time_t mtime | |
11123 | 222 |
223 | |
12340 | 224 MODULE = Gaim::Conversation PACKAGE = Gaim::Conversation PREFIX = gaim_conv_ |
11123 | 225 PROTOTYPES: ENABLE |
226 | |
11581 | 227 gboolean |
11123 | 228 gaim_conv_present_error(who, account, what) |
229 const char *who | |
230 Gaim::Account account | |
12819
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12364
diff
changeset
|
231 const char *what |
11123 | 232 |
11581 | 233 void |
11123 | 234 gaim_conv_custom_smiley_close(conv, smile) |
235 Gaim::Conversation conv | |
236 const char *smile | |
237 | |
12340 | 238 MODULE = Gaim::Conversation PACKAGE = Gaim::Conversation::Chat PREFIX = gaim_conv_chat_ |
6591 | 239 PROTOTYPES: ENABLE |
240 | |
241 Gaim::Conversation | |
11123 | 242 gaim_conv_chat_get_conversation(chat) |
243 Gaim::Conversation::Chat chat | |
6591 | 244 |
11123 | 245 void |
246 gaim_conv_chat_set_users(chat, users) | |
247 Gaim::Conversation::Chat chat | |
248 SV * users | |
249 PREINIT: | |
250 GList *l, *t_GL; | |
251 int i, t_len; | |
252 PPCODE: | |
253 t_GL = NULL; | |
254 t_len = av_len((AV *)SvRV(users)); | |
6591 | 255 |
11123 | 256 for (i = 0; i < t_len; i++) { |
257 STRLEN t_sl; | |
258 t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(users), i, 0), t_sl)); | |
259 } | |
6591 | 260 |
11123 | 261 for (l = gaim_conv_chat_set_users(chat, t_GL); l != NULL; l = l->next) { |
262 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::ListEntry"))); | |
263 } | |
6591 | 264 |
265 void | |
11123 | 266 gaim_conv_chat_get_users(chat) |
267 Gaim::Conversation::Chat chat | |
268 PREINIT: | |
269 GList *l; | |
270 PPCODE: | |
271 for (l = gaim_conv_chat_get_users(chat); l != NULL; l = l->next) { | |
272 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::ListEntry"))); | |
273 } | |
274 | |
11581 | 275 void |
11123 | 276 gaim_conv_chat_ignore(chat, name) |
277 Gaim::Conversation::Chat chat | |
278 const char *name | |
279 | |
11581 | 280 void |
11123 | 281 gaim_conv_chat_unignore(chat, name) |
282 Gaim::Conversation::Chat chat | |
283 const char *name | |
284 | |
11581 | 285 void |
11123 | 286 gaim_conv_chat_set_ignored(chat, ignored) |
287 Gaim::Conversation::Chat chat | |
288 SV * ignored | |
289 PREINIT: | |
290 GList *l, *t_GL; | |
291 int i, t_len; | |
292 PPCODE: | |
293 t_GL = NULL; | |
294 t_len = av_len((AV *)SvRV(ignored)); | |
295 | |
296 for (i = 0; i < t_len; i++) { | |
297 STRLEN t_sl; | |
298 t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(ignored), i, 0), t_sl)); | |
299 } | |
300 | |
301 for (l = gaim_conv_chat_set_ignored(chat, t_GL); l != NULL; l = l->next) { | |
302 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::ListEntry"))); | |
303 } | |
304 | |
305 void | |
306 gaim_conv_chat_get_ignored(chat) | |
307 Gaim::Conversation::Chat chat | |
6591 | 308 PREINIT: |
309 GList *l; | |
310 PPCODE: | |
11123 | 311 for (l = gaim_conv_chat_get_ignored(chat); l != NULL; l = l->next) { |
312 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::ListEntry"))); | |
313 } | |
314 | |
315 const char * | |
316 gaim_conv_chat_get_topic(chat) | |
317 Gaim::Conversation::Chat chat | |
318 | |
11581 | 319 void |
11123 | 320 gaim_conv_chat_set_id(chat, id) |
321 Gaim::Conversation::Chat chat | |
322 int id | |
323 | |
11581 | 324 int |
11123 | 325 gaim_conv_chat_get_id(chat) |
326 Gaim::Conversation::Chat chat | |
327 | |
11581 | 328 void |
11123 | 329 gaim_conv_chat_send(chat, message) |
330 Gaim::Conversation::Chat chat | |
331 const char * message | |
332 | |
11581 | 333 void |
11456
8dc405fa5856
[gaim-migrate @ 13695]
Richard Laager <rlaager@wiktel.com>
parents:
11290
diff
changeset
|
334 gaim_conv_chat_add_users(chat, users, extra_msgs, flags, new_arrivals) |
11123 | 335 Gaim::Conversation::Chat chat |
336 SV * users | |
11456
8dc405fa5856
[gaim-migrate @ 13695]
Richard Laager <rlaager@wiktel.com>
parents:
11290
diff
changeset
|
337 SV * extra_msgs |
11123 | 338 SV * flags |
11456
8dc405fa5856
[gaim-migrate @ 13695]
Richard Laager <rlaager@wiktel.com>
parents:
11290
diff
changeset
|
339 gboolean new_arrivals |
11123 | 340 PREINIT: |
11456
8dc405fa5856
[gaim-migrate @ 13695]
Richard Laager <rlaager@wiktel.com>
parents:
11290
diff
changeset
|
341 GList *t_GL_users, *t_GL_extra_msgs, *t_GL_flags; |
11123 | 342 int i, t_len; |
343 PPCODE: | |
344 t_GL_users = NULL; | |
345 t_len = av_len((AV *)SvRV(users)); | |
346 | |
347 for (i = 0; i < t_len; i++) { | |
348 STRLEN t_sl; | |
349 t_GL_users = g_list_append(t_GL_users, SvPV(*av_fetch((AV *)SvRV(users), i, 0), t_sl)); | |
6591 | 350 } |
11123 | 351 |
352 t_GL_flags = NULL; | |
353 t_len = av_len((AV *)SvRV(flags)); | |
354 | |
355 for (i = 0; i < t_len; i++) { | |
356 STRLEN t_sl; | |
357 t_GL_flags = g_list_append(t_GL_flags, SvPV(*av_fetch((AV *)SvRV(flags), i, 0), t_sl)); | |
358 } | |
359 | |
11456
8dc405fa5856
[gaim-migrate @ 13695]
Richard Laager <rlaager@wiktel.com>
parents:
11290
diff
changeset
|
360 t_GL_extra_msgs = NULL; |
8dc405fa5856
[gaim-migrate @ 13695]
Richard Laager <rlaager@wiktel.com>
parents:
11290
diff
changeset
|
361 t_len = av_len((AV *)SvRV(extra_msgs)); |
8dc405fa5856
[gaim-migrate @ 13695]
Richard Laager <rlaager@wiktel.com>
parents:
11290
diff
changeset
|
362 |
8dc405fa5856
[gaim-migrate @ 13695]
Richard Laager <rlaager@wiktel.com>
parents:
11290
diff
changeset
|
363 for (i = 0; i < t_len; i++) { |
8dc405fa5856
[gaim-migrate @ 13695]
Richard Laager <rlaager@wiktel.com>
parents:
11290
diff
changeset
|
364 STRLEN t_sl; |
8dc405fa5856
[gaim-migrate @ 13695]
Richard Laager <rlaager@wiktel.com>
parents:
11290
diff
changeset
|
365 t_GL_extra_msgs = g_list_append(t_GL_extra_msgs, SvPV(*av_fetch((AV *)SvRV(extra_msgs), i, 0), t_sl)); |
8dc405fa5856
[gaim-migrate @ 13695]
Richard Laager <rlaager@wiktel.com>
parents:
11290
diff
changeset
|
366 } |
8dc405fa5856
[gaim-migrate @ 13695]
Richard Laager <rlaager@wiktel.com>
parents:
11290
diff
changeset
|
367 |
8dc405fa5856
[gaim-migrate @ 13695]
Richard Laager <rlaager@wiktel.com>
parents:
11290
diff
changeset
|
368 gaim_conv_chat_add_users(chat, t_GL_users, t_GL_extra_msgs, t_GL_flags, new_arrivals); |
11581 | 369 |
11123 | 370 |
11581 | 371 gboolean |
11123 | 372 gaim_conv_chat_find_user(chat, user) |
373 Gaim::Conversation::Chat chat | |
374 const char * user | |
375 | |
376 void gaim_conv_chat_clear_users(chat) | |
377 Gaim::Conversation::Chat chat | |
378 | |
379 void gaim_conv_chat_set_nick(chat, nick) | |
380 Gaim::Conversation::Chat chat | |
381 const char * nick | |
382 | |
383 const char * | |
384 gaim_conv_chat_get_nick(chat) | |
385 Gaim::Conversation::Chat chat | |
386 | |
387 Gaim::Conversation | |
388 gaim_find_chat(gc, id) | |
389 Gaim::Connection gc | |
390 int id | |
391 | |
392 void gaim_conv_chat_left(chat) | |
393 Gaim::Conversation::Chat chat | |
394 | |
395 gboolean gaim_conv_chat_has_left(chat) | |
396 Gaim::Conversation::Chat chat | |
397 | |
398 Gaim::Conversation::ChatBuddy | |
399 gaim_conv_chat_cb_find(chat, name) | |
400 Gaim::Conversation::Chat chat | |
401 const char *name | |
402 | |
403 const char * | |
404 gaim_conv_chat_cb_get_name(cb) | |
405 Gaim::Conversation::ChatBuddy cb | |
406 | |
11581 | 407 void |
11123 | 408 gaim_conv_chat_cb_destroy(cb); |
409 Gaim::Conversation::ChatBuddy cb |