Mercurial > pidgin
annotate libpurple/plugins/perl/common/Prefs.xs @ 23618:fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
The Prefs Functions Test plugin (plugin_pref.pl) includes an example.
Fixes #6383
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Wed, 30 Jul 2008 03:51:26 +0000 |
parents | f35a57b8f4ce |
children | 6f47135f5378 |
rev | line source |
---|---|
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 #include "module.h" |
23618
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
2 #include "../perl-handlers.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
4 MODULE = Purple::Prefs PACKAGE = Purple::Prefs PREFIX = purple_prefs_ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5 PROTOTYPES: ENABLE |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6 |
16739
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
7 BOOT: |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
8 { |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
9 HV *stash = gv_stashpv("Purple::Pref::Type", 1); |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
10 |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
11 static const constiv *civ, const_iv[] = { |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
12 #define const_iv(name) {#name, (IV)PURPLE_PREF_##name} |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
13 const_iv(NONE), |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
14 const_iv(BOOLEAN), |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
15 const_iv(INT), |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
16 const_iv(STRING), |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
17 const_iv(STRING_LIST), |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
18 const_iv(PATH), |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
19 const_iv(PATH_LIST), |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
20 }; |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
21 |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
22 for (civ = const_iv + sizeof(const_iv) / sizeof(const_iv[0]); civ-- > const_iv; ) |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
23 newCONSTSUB(stash, (char *)civ->name, newSViv(civ->iv)); |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
24 } |
39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
25 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
27 purple_prefs_add_bool(name, value) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 gboolean value |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
32 purple_prefs_add_int(name, value) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 int value |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
37 purple_prefs_add_none(name) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
40 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
41 purple_prefs_add_string(name, value) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 const char *value |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
46 purple_prefs_add_string_list(name, value) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
48 SV *value |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 PREINIT: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
50 GList *t_GL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 int i, t_len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 PPCODE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 t_GL = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
54 t_len = av_len((AV *)SvRV(value)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
56 for (i = 0; i < t_len; i++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 STRLEN t_sl; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(value), i, 0), t_sl)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 } |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
60 purple_prefs_add_string_list(name, t_GL); |
21775
4dc66862203f
This should plug some leaks related to not having freed GList:s and GSList:s
Etan Reisner <pidgin@unreliablesource.net>
parents:
17742
diff
changeset
|
61 g_list_free(t_GL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
62 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
63 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
64 purple_prefs_destroy() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
65 |
23618
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
66 guint |
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
67 purple_prefs_connect_callback(plugin, name, callback, data = 0); |
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
68 Purple::Plugin plugin |
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
69 const char *name |
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
70 SV *callback |
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
71 SV *data |
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
72 CODE: |
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
73 RETVAL = purple_perl_prefs_connect_callback(plugin, name, callback, data); |
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
74 OUTPUT: |
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
75 RETVAL |
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
76 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
77 void |
23618
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
78 purple_prefs_disconnect_by_handle(plugin) |
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
79 Purple::Plugin plugin |
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
80 CODE: |
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
81 purple_perl_pref_cb_clear_for_plugin(plugin); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
82 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
83 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
84 purple_prefs_disconnect_callback(callback_id) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 guint callback_id |
23618
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
86 CODE: |
fb86dbeb2b15
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22692
diff
changeset
|
87 purple_perl_prefs_disconnect_callback(callback_id); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
88 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
89 gboolean |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
90 purple_prefs_exists(name) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
91 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
92 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
93 gboolean |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
94 purple_prefs_get_bool(name) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
95 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
96 |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
97 Purple::Handle |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
98 purple_prefs_get_handle() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
99 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
100 int |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
101 purple_prefs_get_int(name) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
102 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
103 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
104 const char * |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
105 purple_prefs_get_string(name) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
106 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
107 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
108 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
109 purple_prefs_get_string_list(name) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
110 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
111 PREINIT: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 GList *l; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
113 PPCODE: |
17742
ee58212687bb
Plug a few more memory leaks for some perl plugins.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17741
diff
changeset
|
114 for (l = purple_prefs_get_string_list(name); l != NULL; l = g_list_delete_link(l, l)) { |
17741
b61baeefbe38
Fix _prefs_get_string_list for perl.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16739
diff
changeset
|
115 XPUSHs(sv_2mortal(newSVpv(l->data, 0))); |
17742
ee58212687bb
Plug a few more memory leaks for some perl plugins.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17741
diff
changeset
|
116 g_free(l->data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
117 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
118 |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
119 Purple::PrefType |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
120 purple_prefs_get_type(name) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
121 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
122 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
123 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
124 purple_prefs_init() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
125 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
126 gboolean |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
127 purple_prefs_load() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
128 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
129 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
130 purple_prefs_remove(name) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
131 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
132 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
133 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
134 purple_prefs_rename(oldname, newname) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
135 const char *oldname |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
136 const char *newname |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
137 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
138 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
139 purple_prefs_rename_boolean_toggle(oldname, newname) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 const char *oldname |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
141 const char *newname |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
142 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
144 purple_prefs_set_bool(name, value) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
145 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 gboolean value |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
147 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
148 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
149 purple_prefs_set_generic(name, value) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
150 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
151 gpointer value |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
152 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
153 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
154 purple_prefs_set_int(name, value) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
155 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
156 int value |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
157 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
158 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
159 purple_prefs_set_string(name, value) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
161 const char *value |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
162 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
163 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
164 purple_prefs_set_string_list(name, value) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
165 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
166 SV *value |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
167 PREINIT: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
168 GList *t_GL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
169 int i, t_len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
170 PPCODE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
171 t_GL = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
172 t_len = av_len((AV *)SvRV(value)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
173 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
174 for (i = 0; i < t_len; i++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
175 STRLEN t_sl; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
176 t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(value), i, 0), t_sl)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
177 } |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
178 purple_prefs_set_string_list(name, t_GL); |
21775
4dc66862203f
This should plug some leaks related to not having freed GList:s and GSList:s
Etan Reisner <pidgin@unreliablesource.net>
parents:
17742
diff
changeset
|
179 g_list_free(t_GL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
180 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
181 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
182 purple_prefs_trigger_callback(name) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
183 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
184 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
185 void |
22692
f35a57b8f4ce
Expose Purple::Prefs::get_children_names to perl plugins.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21775
diff
changeset
|
186 purple_prefs_get_children_names(name) |
f35a57b8f4ce
Expose Purple::Prefs::get_children_names to perl plugins.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21775
diff
changeset
|
187 const char *name |
f35a57b8f4ce
Expose Purple::Prefs::get_children_names to perl plugins.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21775
diff
changeset
|
188 PREINIT: |
f35a57b8f4ce
Expose Purple::Prefs::get_children_names to perl plugins.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21775
diff
changeset
|
189 GList *l; |
f35a57b8f4ce
Expose Purple::Prefs::get_children_names to perl plugins.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21775
diff
changeset
|
190 PPCODE: |
f35a57b8f4ce
Expose Purple::Prefs::get_children_names to perl plugins.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21775
diff
changeset
|
191 for (l = purple_prefs_get_children_names(name); l != NULL; l = g_list_delete_link(l, l)) { |
f35a57b8f4ce
Expose Purple::Prefs::get_children_names to perl plugins.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21775
diff
changeset
|
192 XPUSHs(sv_2mortal(newSVpv(l->data, 0))); |
f35a57b8f4ce
Expose Purple::Prefs::get_children_names to perl plugins.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21775
diff
changeset
|
193 g_free(l->data); |
f35a57b8f4ce
Expose Purple::Prefs::get_children_names to perl plugins.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21775
diff
changeset
|
194 } |
f35a57b8f4ce
Expose Purple::Prefs::get_children_names to perl plugins.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21775
diff
changeset
|
195 |
f35a57b8f4ce
Expose Purple::Prefs::get_children_names to perl plugins.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21775
diff
changeset
|
196 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
197 purple_prefs_uninit() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
198 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
199 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
200 purple_prefs_update_old() |