Mercurial > pidgin
annotate gtk/plugins/perl/common/GtkPrefs.xs @ 14495:c804f41d61ae
[gaim-migrate @ 17214]
I'm pretty sure this is what was supposed to go here. KingAnt did you retype
all of this stuff by hand?
committer: Tailor Script <tailor@pidgin.im>
author | Etan Reisner <pidgin@unreliablesource.net> |
---|---|
date | Sun, 10 Sep 2006 05:33:52 +0000 |
parents | 01915dd6ff85 |
children | d6eae5115b31 |
rev | line source |
---|---|
14416
eeca8be382a5
[gaim-migrate @ 17124]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
1 #include "gtkmodule.h" |
eeca8be382a5
[gaim-migrate @ 17124]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
2 |
14438
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
3 /* This can't work at the moment since I don't have a typemap for Gtk::Widget. |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
4 * I thought about using the one from libgtk2-perl but wasn't sure how to go |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
5 * about doing that. |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
6 Gtk::Widget |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
7 gaim_gtk_prefs_checkbox(title, key, page) |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
8 const char * title |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
9 const char * key |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
10 Gtk::Widget page |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
11 |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
12 Gtk::Widget |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
13 gaim_gtk_prefs_labeled_spin_button(page, title, key, min, max, sg) |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
14 Gtk::Widget page |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
15 const gchar * title |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
16 const char * key |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
17 int min |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
18 int max |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
19 Gtk::Size::Group sg |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
20 |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
21 Gtk::Widget |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
22 gaim_gtk_prefs_labeled_entry(page, title, key, sg) |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
23 Gtk::Widget page |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
24 const gchar * title |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
25 const char * key |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
26 Gtk::Size::Group sg |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
27 |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
28 TODO Test this carefully, I'm not at all confident in the loop. |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
29 Gtk::Widget |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
30 gaim_gtk_prefs_dropdown(page, title, type, key, ...) |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
31 Gtk::Widget page |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
32 const gchar * title |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
33 Gaim::Pref::Type type |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
34 const char * key |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
35 PREINIT: |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
36 GList *t_GL; |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
37 int i; |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
38 CODE: |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
39 t_GL = NULL; |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
40 for (i = 0; i < items; i++) { |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
41 if (type == GAIM_PREF_INT || type == GAIM_PREF_BOOLEAN) { |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
42 t_GL = g_list_append(t_GL, SvIV(ST(i+1))); |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
43 else { |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
44 t_GL = g_list_append(t_GL, SvPV(ST(i+1))); |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
45 } |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
46 } |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
47 |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
48 Gtk::Widget |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
49 gaim_gtk_prefs_dropdown_from_list(page, title, type, key, menuitems) |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
50 Gtk::Widget page |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
51 const gchar * title |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
52 Gaim::Pref::Type type |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
53 const char * key |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
54 SV *menuitems |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
55 PREINIT: |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
56 GList *t_GL; |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
57 int i, t_len; |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
58 CODE: |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
59 t_GL = NULL; |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
60 t_len = av_len((AV *)SvRV(menuitems)); |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
61 |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
62 for ( i = 0; i < t_len; i++) { |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
63 STRLEN t_sl; |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
64 t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(menuitems), i, 0), t_sl)); |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
65 RETVAL = gaim_gtk_prefs_dropdown_from_list(page, title, type, key, t_GL); |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
66 OUTPUT: |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
67 RETVAL |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
68 */ |
01915dd6ff85
[gaim-migrate @ 17152]
Etan Reisner <pidgin@unreliablesource.net>
parents:
14416
diff
changeset
|
69 |
14416
eeca8be382a5
[gaim-migrate @ 17124]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
70 MODULE = Gaim::Gtk::Prefs PACKAGE = Gaim::Gtk::Prefs PREFIX = gaim_gtk_prefs_ |
eeca8be382a5
[gaim-migrate @ 17124]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
71 PROTOTYPES: ENABLE |
eeca8be382a5
[gaim-migrate @ 17124]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
72 |
eeca8be382a5
[gaim-migrate @ 17124]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
73 void |
eeca8be382a5
[gaim-migrate @ 17124]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
74 gaim_gtk_prefs_show() |