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