plugins/perl/common/PluginPref.xs

Mon, 05 Dec 2005 23:54:34 +0000

author
Will Thompson <resiak@pidgin.im>
date
Mon, 05 Dec 2005 23:54:34 +0000
changeset 12364
42b44fed7423
parent 11290
136722ebf145
child 12807
6d1183fe53b2
permissions
-rw-r--r--

[gaim-migrate @ 14668]
sf patch #1373688, from Will Thompson

"Make the Perl bindings more Perl-ish"

committer: Mark Doliner <markdoliner@pidgin.im>

11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
1 #include "module.h"
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
2
12364
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
3 MODULE = Gaim::PluginPref PACKAGE = Gaim::PluginPref::Frame PREFIX = gaim_plugin_pref_frame_
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
4 PROTOTYPES: ENABLE
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
5
12364
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
6 void
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
7 gaim_plugin_pref_frame_add(frame, pref)
12364
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
8 Gaim::PluginPref::Frame frame
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
9 Gaim::PluginPref pref
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
10
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
11 void
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
12 gaim_plugin_pref_frame_destroy(frame)
12364
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
13 Gaim::PluginPref::Frame frame
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
14
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
15 void
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
16 gaim_plugin_pref_frame_get_prefs(frame)
12364
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
17 Gaim::PluginPref::Frame frame
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
18 PREINIT:
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
19 GList *l;
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
20 PPCODE:
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
21 for (l = gaim_plugin_pref_frame_get_prefs(frame); l != NULL; l = l->next) {
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
22 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::ListItem")));
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
23 }
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
24
12364
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
25 Gaim::PluginPref::Frame
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
26 gaim_plugin_pref_frame_new(class)
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
27 C_ARGS: /* void */
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
28
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
29
12364
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
30 MODULE = Gaim::PluginPref PACKAGE = Gaim::PluginPref PREFIX = gaim_plugin_pref_
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
31 PROTOTYPES: ENABLE
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
32
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
33 void
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
34 gaim_plugin_pref_add_choice(pref, label, choice)
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
35 Gaim::PluginPref pref
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
36 char *label
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
37 gpointer choice
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
38
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
39 void
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
40 gaim_plugin_pref_destroy(pref)
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
41 Gaim::PluginPref pref
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
42
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
43
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
44 void
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
45 gaim_plugin_pref_get_bounds(pref, min, max)
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
46 Gaim::PluginPref pref
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
47 int *min
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
48 int *max
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
49
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
50 void
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
51 gaim_plugin_pref_get_choices(pref)
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
52 Gaim::PluginPref pref
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
53 PREINIT:
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
54 GList *l;
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
55 PPCODE:
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
56 for (l = gaim_plugin_pref_get_choices(pref); l != NULL; l = l->next) {
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
57 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::ListItem")));
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
58 }
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
59
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
60 char *
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
61 gaim_plugin_pref_get_label(pref)
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
62 Gaim::PluginPref pref
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
63
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
64 gboolean
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
65 gaim_plugin_pref_get_masked(pref)
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
66 Gaim::PluginPref pref
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
67
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
68 unsigned int
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
69 gaim_plugin_pref_get_max_length(pref)
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
70 Gaim::PluginPref pref
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
71
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
72 char *
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
73 gaim_plugin_pref_get_name(pref)
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
74 Gaim::PluginPref pref
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
75
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
76 Gaim::PluginPrefType
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
77 gaim_plugin_pref_get_type(pref)
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
78 Gaim::PluginPref pref
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
79
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
80 Gaim::PluginPref
12364
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
81 gaim_plugin_pref_new(class)
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
82 C_ARGS: /* void */
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
83
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
84
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
85 Gaim::PluginPref
12364
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
86 gaim_plugin_pref_new_with_label(class, label)
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
87 char *label
12364
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
88 C_ARGS:
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
89 label
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
90
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
91 Gaim::PluginPref
12364
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
92 gaim_plugin_pref_new_with_name(class, name)
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
93 char *name
12364
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
94 C_ARGS:
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
95 name
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
96
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
97 Gaim::PluginPref
12364
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
98 gaim_plugin_pref_new_with_name_and_label(class, name, label)
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
99 char *name
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
100 char *label
12364
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
101 C_ARGS:
42b44fed7423 [gaim-migrate @ 14668]
Will Thompson <resiak@pidgin.im>
parents: 11290
diff changeset
102 name, label
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
103
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
104 void
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
105 gaim_plugin_pref_set_bounds(pref, min, max)
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
106 Gaim::PluginPref pref
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
107 int min
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
108 int max
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
109
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
110 void
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
111 gaim_plugin_pref_set_label(pref, label)
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
112 Gaim::PluginPref pref
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
113 char *label
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
114
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
115 void
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
116 gaim_plugin_pref_set_masked(pref, mask)
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
117 Gaim::PluginPref pref
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
118 gboolean mask
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
119
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
120 void
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
121 gaim_plugin_pref_set_max_length(pref, max_length)
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
122 Gaim::PluginPref pref
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
123 unsigned int max_length
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
124
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
125 void
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
126 gaim_plugin_pref_set_name(pref, name)
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
127 Gaim::PluginPref pref
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
128 char *name
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
129
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
130 void
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
131 gaim_plugin_pref_set_type(pref, type)
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
132 Gaim::PluginPref pref
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
133 Gaim::PluginPrefType type
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
134 CODE:
11170
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents: 11131
diff changeset
135 GaimPluginPrefType gpp_type = GAIM_PLUGIN_PREF_NONE;
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
136
11170
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents: 11131
diff changeset
137 if (type == 1) {
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents: 11131
diff changeset
138 gpp_type = GAIM_PLUGIN_PREF_CHOICE;
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents: 11131
diff changeset
139 } else if (type == 2) {
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents: 11131
diff changeset
140 gpp_type = GAIM_PLUGIN_PREF_INFO;
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents: 11131
diff changeset
141 }
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents: 11131
diff changeset
142 gaim_plugin_pref_set_type(pref, gpp_type);
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents: 11131
diff changeset
143

mercurial