Mercurial > pidgin
annotate plugins/perl/common/Request.xs @ 12412:a88ca6da0b38
[gaim-migrate @ 14719]
Make some functions static.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Thu, 08 Dec 2005 21:00:39 +0000 |
parents | 30947631262d |
children | 59ce7a35a22b |
rev | line source |
---|---|
11118 | 1 #include "module.h" |
2 | |
11589 | 3 /* This breaks on faceprint's amd64 box |
4 void * | |
5 gaim_request_action_varg(handle, title, primary, secondary, default_action, user_data, action_count, actions) | |
6 void * handle | |
7 const char *title | |
8 const char *primary | |
9 const char *secondary | |
10 unsigned int default_action | |
11 void *user_data | |
12 size_t action_count | |
13 va_list actions | |
14 */ | |
15 | |
16 | |
11170 | 17 typedef struct { |
18 char *cancel_cb; | |
19 char *ok_cb; | |
20 } GaimPerlRequestData; | |
21 | |
22 /********************************************************/ | |
23 /* */ | |
24 /* Callback function that calls a perl subroutine */ | |
25 /* */ | |
26 /* The void * field data is being used as a way to hide */ | |
27 /* the perl sub's name in a GaimPerlRequestData */ | |
28 /* */ | |
29 /********************************************************/ | |
12412
a88ca6da0b38
[gaim-migrate @ 14719]
Richard Laager <rlaager@wiktel.com>
parents:
11589
diff
changeset
|
30 static void gaim_perl_request_ok_cb(void * data, GaimRequestFields *fields) { |
11170 | 31 |
32 GaimPerlRequestData *gpr = (GaimPerlRequestData *)data; | |
33 | |
34 dSP; | |
35 ENTER; | |
36 SAVETMPS; | |
37 PUSHMARK(sp); | |
38 | |
39 XPUSHs(gaim_perl_bless_object(fields, "Gaim::Request::Fields")); | |
40 PUTBACK; | |
41 | |
42 call_pv(gpr->ok_cb, G_EVAL | G_SCALAR); | |
43 SPAGAIN; | |
44 | |
45 PUTBACK; | |
46 FREETMPS; | |
47 LEAVE; | |
48 } | |
49 | |
12412
a88ca6da0b38
[gaim-migrate @ 14719]
Richard Laager <rlaager@wiktel.com>
parents:
11589
diff
changeset
|
50 static void gaim_perl_request_cancel_cb(void * data, GaimRequestFields *fields) { |
11170 | 51 |
52 GaimPerlRequestData *gpr = (GaimPerlRequestData *)data; | |
53 | |
54 dSP; | |
55 ENTER; | |
56 SAVETMPS; | |
57 PUSHMARK(sp); | |
58 | |
59 XPUSHs(gaim_perl_bless_object(fields, "Gaim::Request::Fields")); | |
60 PUTBACK; | |
61 call_pv(gpr->cancel_cb, G_EVAL | G_SCALAR); | |
62 SPAGAIN; | |
63 | |
64 PUTBACK; | |
65 FREETMPS; | |
66 LEAVE; | |
67 } | |
68 | |
11290 | 69 MODULE = Gaim::Request PACKAGE = Gaim::Request PREFIX = gaim_request_ |
70 PROTOTYPES: ENABLE | |
11118 | 71 |
72 void * | |
11290 | 73 gaim_request_input(handle, title, primary, secondary, default_value, multiline, masked, hint, ok_text, ok_cb, cancel_text, cancel_cb) |
74 Gaim::Plugin handle | |
75 const char * title | |
76 const char * primary | |
77 const char * secondary | |
78 const char * default_value | |
79 gboolean multiline | |
80 gboolean masked | |
81 gchar * hint | |
82 const char * ok_text | |
83 SV * ok_cb | |
84 const char * cancel_text | |
85 SV * cancel_cb | |
86 CODE: | |
87 GaimPerlRequestData *gpr; | |
88 STRLEN len; | |
89 char *basename, *package; | |
90 | |
91 basename = g_path_get_basename(handle->path); | |
92 gaim_perl_normalize_script_name(basename); | |
93 package = g_strdup_printf("Gaim::Script::%s", basename); | |
94 gpr = g_new(GaimPerlRequestData, 1); | |
95 gpr->ok_cb = g_strdup_printf("%s::%s", package, SvPV(ok_cb, len)); | |
96 gpr->cancel_cb = g_strdup_printf("%s::%s", package, SvPV(cancel_cb, len)); | |
97 | |
98 RETVAL = gaim_request_input(handle, title, primary, secondary, default_value, multiline, masked, hint, ok_text, G_CALLBACK(gaim_perl_request_ok_cb), cancel_text, G_CALLBACK(gaim_perl_request_cancel_cb), gpr); | |
99 OUTPUT: | |
100 RETVAL | |
101 | |
11118 | 102 void * |
11290 | 103 gaim_request_file(handle, title, filename, savedialog, ok_cb, cancel_cb) |
104 Gaim::Plugin handle | |
105 const char * title | |
106 const char * filename | |
107 gboolean savedialog | |
108 SV * ok_cb | |
109 SV * cancel_cb | |
110 CODE: | |
111 GaimPerlRequestData *gpr; | |
112 STRLEN len; | |
113 char *basename, *package; | |
11118 | 114 |
11290 | 115 basename = g_path_get_basename(handle->path); |
116 gaim_perl_normalize_script_name(basename); | |
117 package = g_strdup_printf("Gaim::Script::%s", basename); | |
118 gpr = g_new(GaimPerlRequestData, 1); | |
119 gpr->ok_cb = g_strdup_printf("%s::%s", package, SvPV(ok_cb, len)); | |
120 gpr->cancel_cb = g_strdup_printf("%s::%s", package, SvPV(cancel_cb, len)); | |
11118 | 121 |
11290 | 122 RETVAL = gaim_request_file(handle, title, filename, savedialog, G_CALLBACK(gaim_perl_request_ok_cb), G_CALLBACK(gaim_perl_request_cancel_cb), gpr); |
123 OUTPUT: | |
124 RETVAL | |
125 | |
11118 | 126 |
11170 | 127 void * |
128 gaim_request_fields(handle, title, primary, secondary, fields, ok_text, ok_cb, cancel_text, cancel_cb) | |
129 Gaim::Plugin handle | |
130 const char * title | |
131 const char * primary | |
132 const char * secondary | |
133 Gaim::Request::Fields fields | |
134 const char * ok_text | |
135 SV * ok_cb | |
136 const char * cancel_text | |
137 SV * cancel_cb | |
138 CODE: | |
139 GaimPerlRequestData *gpr; | |
140 STRLEN len; | |
141 char *basename, *package; | |
142 | |
143 basename = g_path_get_basename(handle->path); | |
144 gaim_perl_normalize_script_name(basename); | |
145 package = g_strdup_printf("Gaim::Script::%s", basename); | |
146 gpr = g_new(GaimPerlRequestData, 1); | |
147 gpr->ok_cb = g_strdup_printf("%s::%s", package, SvPV(ok_cb, len)); | |
148 gpr->cancel_cb = g_strdup_printf("%s::%s", package, SvPV(cancel_cb, len)); | |
11589 | 149 |
11170 | 150 RETVAL = gaim_request_fields(handle, title, primary, secondary, fields, ok_text, G_CALLBACK(gaim_perl_request_ok_cb), cancel_text, G_CALLBACK(gaim_perl_request_cancel_cb), gpr); |
151 OUTPUT: | |
152 RETVAL | |
153 | |
11589 | 154 void |
11118 | 155 gaim_request_close(type, uihandle) |
156 Gaim::RequestType type | |
11589 | 157 void * uihandle |
11118 | 158 |
11589 | 159 void |
11118 | 160 gaim_request_close_with_handle(handle) |
11589 | 161 void * handle |
11118 | 162 |
163 Gaim::Account | |
164 gaim_request_field_account_get_default_value(field) | |
165 Gaim::Request::Field field | |
166 | |
11130 | 167 IV |
11118 | 168 gaim_request_field_account_get_filter(field) |
169 Gaim::Request::Field field | |
11130 | 170 CODE: |
171 RETVAL = PTR2IV(gaim_request_field_account_get_filter(field)); | |
172 OUTPUT: | |
173 RETVAL | |
11118 | 174 |
175 gboolean | |
176 gaim_request_field_account_get_show_all(field) | |
177 Gaim::Request::Field field | |
178 | |
179 Gaim::Account | |
180 gaim_request_field_account_get_value(field) | |
181 Gaim::Request::Field field | |
182 | |
183 Gaim::Request::Field | |
184 gaim_request_field_account_new(id, text, account) | |
185 const char *id | |
186 const char *text | |
187 Gaim::Account account | |
188 | |
189 void | |
190 gaim_request_field_account_set_default_value(field, default_value) | |
191 Gaim::Request::Field field | |
192 Gaim::Account default_value | |
193 | |
194 | |
195 void | |
196 gaim_request_field_account_set_show_all(field, show_all) | |
197 Gaim::Request::Field field | |
198 gboolean show_all | |
199 | |
200 void | |
201 gaim_request_field_account_set_value(field, value) | |
202 Gaim::Request::Field field | |
203 Gaim::Account value | |
204 | |
205 gboolean | |
206 gaim_request_field_bool_get_default_value(field) | |
207 Gaim::Request::Field field | |
208 | |
209 gboolean | |
210 gaim_request_field_bool_get_value(field) | |
211 Gaim::Request::Field field | |
212 | |
213 Gaim::Request::Field | |
214 gaim_request_field_bool_new(id, text, default_value) | |
215 const char *id | |
216 const char *text | |
217 gboolean default_value | |
218 | |
219 void | |
220 gaim_request_field_bool_set_default_value(field, default_value) | |
221 Gaim::Request::Field field | |
222 gboolean default_value | |
223 | |
224 void | |
225 gaim_request_field_bool_set_value(field, value) | |
226 Gaim::Request::Field field | |
227 gboolean value | |
228 | |
229 void | |
230 gaim_request_field_choice_add(field, label) | |
231 Gaim::Request::Field field | |
232 const char *label | |
233 | |
234 int | |
235 gaim_request_field_choice_get_default_value(field) | |
236 Gaim::Request::Field field | |
237 | |
238 void | |
239 gaim_request_field_choice_get_labels(field) | |
240 Gaim::Request::Field field | |
241 PREINIT: | |
242 GList *l; | |
243 PPCODE: | |
244 for (l = gaim_request_field_choice_get_labels(field); l != NULL; l = l->next) { | |
245 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::ListItem"))); | |
246 } | |
247 | |
248 | |
249 | |
250 | |
251 int | |
252 gaim_request_field_choice_get_value(field) | |
253 Gaim::Request::Field field | |
254 | |
255 Gaim::Request::Field | |
256 gaim_request_field_choice_new(id, text, default_value) | |
257 const char *id | |
258 const char *text | |
259 int default_value | |
260 | |
261 void | |
262 gaim_request_field_choice_set_default_value(field, default_value) | |
263 Gaim::Request::Field field | |
264 int default_value | |
265 | |
266 void | |
267 gaim_request_field_choice_set_value(field, value) | |
268 Gaim::Request::Field field | |
269 int value | |
270 | |
271 void | |
272 gaim_request_field_destroy(field) | |
273 Gaim::Request::Field field | |
274 | |
275 const char * | |
276 gaim_request_field_get_id(field) | |
277 Gaim::Request::Field field | |
278 | |
279 const char * | |
280 gaim_request_field_get_label(field) | |
281 Gaim::Request::Field field | |
282 | |
283 Gaim::RequestFieldType | |
284 gaim_request_field_get_type(field) | |
285 Gaim::Request::Field field | |
286 | |
287 const char * | |
288 gaim_request_field_get_type_hint(field) | |
289 Gaim::Request::Field field | |
290 | |
291 void | |
292 gaim_request_field_group_add_field(group, field) | |
293 Gaim::Request::Field::Group group | |
294 Gaim::Request::Field field | |
295 | |
296 void | |
297 gaim_request_field_group_destroy(group) | |
298 Gaim::Request::Field::Group group | |
299 | |
300 void | |
301 gaim_request_field_group_get_fields(group) | |
302 Gaim::Request::Field::Group group | |
303 PREINIT: | |
304 GList *l; | |
305 PPCODE: | |
306 for (l = gaim_request_field_group_get_fields(group); l != NULL; l = l->next) { | |
307 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::ListItem"))); | |
308 } | |
309 | |
310 | |
311 | |
312 const char * | |
313 gaim_request_field_group_get_title(group) | |
314 Gaim::Request::Field::Group group | |
315 | |
316 Gaim::Request::Field::Group | |
317 gaim_request_field_group_new(title) | |
318 const char *title | |
319 | |
320 int | |
321 gaim_request_field_int_get_default_value(field) | |
322 Gaim::Request::Field field | |
323 | |
324 int | |
325 gaim_request_field_int_get_value(field) | |
326 Gaim::Request::Field field | |
327 | |
328 Gaim::Request::Field | |
329 gaim_request_field_int_new(id, text, default_value) | |
330 const char *id | |
331 const char *text | |
332 int default_value | |
333 | |
334 void | |
335 gaim_request_field_int_set_default_value(field, default_value) | |
336 Gaim::Request::Field field | |
337 int default_value | |
338 | |
339 void | |
340 gaim_request_field_int_set_value(field, value) | |
341 Gaim::Request::Field field | |
342 int value | |
343 | |
344 gboolean | |
345 gaim_request_field_is_required(field) | |
346 Gaim::Request::Field field | |
347 | |
348 gboolean | |
349 gaim_request_field_is_visible(field) | |
350 Gaim::Request::Field field | |
351 | |
352 Gaim::Request::Field | |
353 gaim_request_field_label_new(id, text) | |
354 const char *id | |
355 const char *text | |
356 | |
357 void | |
358 gaim_request_field_list_add(field, item, data) | |
359 Gaim::Request::Field field | |
360 const char *item | |
361 void * data | |
362 | |
363 void | |
364 gaim_request_field_list_add_selected(field, item) | |
365 Gaim::Request::Field field | |
366 const char *item | |
367 | |
368 void | |
369 gaim_request_field_list_clear_selected(field) | |
370 Gaim::Request::Field field | |
371 | |
372 void * | |
373 gaim_request_field_list_get_data(field, text) | |
374 Gaim::Request::Field field | |
375 const char *text | |
376 | |
377 void | |
378 gaim_request_field_list_get_items(field) | |
379 Gaim::Request::Field field | |
380 PREINIT: | |
11130 | 381 const GList *l; |
11118 | 382 PPCODE: |
383 for (l = gaim_request_field_list_get_items(field); l != NULL; l = l->next) { | |
384 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::ListItem"))); | |
385 } | |
386 | |
387 gboolean | |
388 gaim_request_field_list_get_multi_select(field) | |
389 Gaim::Request::Field field | |
390 | |
391 void | |
392 gaim_request_field_list_get_selected(field) | |
393 Gaim::Request::Field field | |
394 PREINIT: | |
11130 | 395 const GList *l; |
11118 | 396 PPCODE: |
397 for (l = gaim_request_field_list_get_selected(field); l != NULL; l = l->next) { | |
398 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::ListItem"))); | |
399 } | |
400 | |
401 | |
402 gboolean | |
403 gaim_request_field_list_is_selected(field, item) | |
404 Gaim::Request::Field field | |
405 const char *item | |
406 | |
407 Gaim::Request::Field | |
408 gaim_request_field_list_new(id, text) | |
409 const char *id | |
410 const char *text | |
411 | |
412 void | |
413 gaim_request_field_list_set_multi_select(field, multi_select) | |
414 Gaim::Request::Field field | |
415 gboolean multi_select | |
416 | |
417 Gaim::Request::Field | |
418 gaim_request_field_new(id, text, type) | |
419 const char *id | |
420 const char *text | |
421 Gaim::RequestFieldType type | |
422 | |
423 void | |
424 gaim_request_field_set_label(field, label) | |
425 Gaim::Request::Field field | |
426 const char *label | |
427 | |
428 void | |
429 gaim_request_field_set_required(field, required) | |
430 Gaim::Request::Field field | |
431 gboolean required | |
432 | |
433 void | |
434 gaim_request_field_set_type_hint(field, type_hint) | |
435 Gaim::Request::Field field | |
436 const char *type_hint | |
437 | |
438 void | |
439 gaim_request_field_set_visible(field, visible) | |
440 Gaim::Request::Field field | |
441 gboolean visible | |
442 | |
443 const char * | |
444 gaim_request_field_string_get_default_value(field) | |
445 Gaim::Request::Field field | |
446 | |
447 const char * | |
448 gaim_request_field_string_get_value(field) | |
449 Gaim::Request::Field field | |
450 | |
451 gboolean | |
452 gaim_request_field_string_is_editable(field) | |
453 Gaim::Request::Field field | |
454 | |
455 gboolean | |
456 gaim_request_field_string_is_masked(field) | |
457 Gaim::Request::Field field | |
458 | |
459 gboolean | |
460 gaim_request_field_string_is_multiline(field) | |
461 Gaim::Request::Field field | |
462 | |
463 Gaim::Request::Field | |
464 gaim_request_field_string_new(id, text, default_value, multiline) | |
465 const char *id | |
466 const char *text | |
467 const char *default_value | |
468 gboolean multiline | |
469 | |
470 void | |
471 gaim_request_field_string_set_default_value(field, default_value) | |
472 Gaim::Request::Field field | |
473 const char *default_value | |
474 | |
475 void | |
476 gaim_request_field_string_set_editable(field, editable) | |
477 Gaim::Request::Field field | |
478 gboolean editable | |
479 | |
480 void | |
481 gaim_request_field_string_set_masked(field, masked) | |
482 Gaim::Request::Field field | |
483 gboolean masked | |
484 | |
485 void | |
486 gaim_request_field_string_set_value(field, value) | |
487 Gaim::Request::Field field | |
488 const char *value | |
489 | |
490 void | |
491 gaim_request_fields_add_group(fields, group) | |
492 Gaim::Request::Fields fields | |
493 Gaim::Request::Field::Group group | |
494 | |
495 gboolean | |
496 gaim_request_fields_all_required_filled(fields) | |
497 Gaim::Request::Fields fields | |
498 | |
499 void | |
500 gaim_request_fields_destroy(fields) | |
501 Gaim::Request::Fields fields | |
502 | |
503 gboolean | |
504 gaim_request_fields_exists(fields, id) | |
505 Gaim::Request::Fields fields | |
506 const char *id | |
507 | |
508 Gaim::Account | |
509 gaim_request_fields_get_account(fields, id) | |
510 Gaim::Request::Fields fields | |
511 const char *id | |
512 | |
513 gboolean | |
514 gaim_request_fields_get_bool(fields, id) | |
515 Gaim::Request::Fields fields | |
516 const char *id | |
517 | |
518 int | |
519 gaim_request_fields_get_choice(fields, id) | |
520 Gaim::Request::Fields fields | |
521 const char *id | |
522 | |
523 Gaim::Request::Field | |
524 gaim_request_fields_get_field(fields, id) | |
525 Gaim::Request::Fields fields | |
526 const char *id | |
527 | |
528 void | |
529 gaim_request_fields_get_groups(fields) | |
530 Gaim::Request::Fields fields | |
531 PREINIT: | |
532 GList *l; | |
533 PPCODE: | |
534 for (l = gaim_request_fields_get_groups(fields); l != NULL; l = l->next) { | |
535 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::ListItem"))); | |
536 } | |
537 | |
538 | |
539 | |
540 int | |
541 gaim_request_fields_get_integer(fields, id) | |
542 Gaim::Request::Fields fields | |
543 const char *id | |
544 | |
545 void | |
546 gaim_request_fields_get_required(fields) | |
547 Gaim::Request::Fields fields | |
548 PREINIT: | |
11130 | 549 const GList *l; |
11118 | 550 PPCODE: |
551 for (l = gaim_request_fields_get_required(fields); l != NULL; l = l->next) { | |
552 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::ListItem"))); | |
553 } | |
554 | |
555 | |
556 | |
557 const char * | |
558 gaim_request_fields_get_string(fields, id) | |
559 Gaim::Request::Fields fields | |
560 const char *id | |
561 | |
562 gboolean | |
563 gaim_request_fields_is_field_required(fields, id) | |
564 Gaim::Request::Fields fields | |
565 const char *id | |
566 | |
567 Gaim::Request::Fields | |
568 gaim_request_fields_new() | |
569 | |
570 | |
571 Gaim::Request::UiOps | |
572 gaim_request_get_ui_ops() | |
573 | |
574 | |
575 void | |
576 gaim_request_set_ui_ops(ops) | |
577 Gaim::Request::UiOps ops | |
578 |