changeset 14438:01915dd6ff85

[gaim-migrate @ 17152] I'm not sure how I put these in the wrong place to being with, but this is where they belong. committer: Tailor Script <tailor@pidgin.im>
author Etan Reisner <pidgin@unreliablesource.net>
date Mon, 04 Sep 2006 04:08:07 +0000
parents 13422c8f74a2
children 300946b0f4a2
files gtk/plugins/perl/common/GtkPluginPref.xs gtk/plugins/perl/common/GtkPrefs.xs
diffstat 2 files changed, 67 insertions(+), 58 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/plugins/perl/common/GtkPluginPref.xs	Mon Sep 04 03:58:23 2006 +0000
+++ b/gtk/plugins/perl/common/GtkPluginPref.xs	Mon Sep 04 04:08:07 2006 +0000
@@ -6,63 +6,6 @@
 Gtk::Widget
 gaim_gtk_plugin_pref_create_frame(frame)
 	Gaim::PluginPref::Frame frame
-
-Gtk::Widget
-gaim_gtk_prefs_checkbox(title, key, page)
-	const char * title
-	const char * key
-	Gtk::Widget page
-
-Gtk::Widget
-gaim_gtk_prefs_labeled_spin_button(page, title, key, min, max, sg)
-	Gtk::Widget page
-	const gchar * title
-	const char * key
-	int min
-	int max
-	Gtk::Size::Group sg
-
-Gtk::Widget
-gaim_gtk_prefs_labeled_entry(page, title, key, sg)
-	Gtk::Widget page
-	const gchar * title
-	const char * key
-	Gtk::Size::Group sg
-*/
-
-/* TODO I don't know how to handle this in XS
-Gtk::Widget
-gaim_gtk_prefs_dropdown(page, title, type, key, ...)
-	Gtk::Widget page
-	const gchar * title
-	Gaim::Pref::Type type
-	const char * key
-
-*/
-
-/* This can't work at the moment since I don't have a typemap for Gtk::Widget.
- * I thought about using the one from libgtk2-perl but wasn't sure how to go
- * about doing that.
-Gtk::Widget
-gaim_gtk_prefs_dropdown_from_list(page, title, type, key, menuitems)
-	Gtk::Widget page
-	const gchar * title
-	Gaim::Pref::Type type
-	const char * key
-	SV *menuitems
-PREINIT:
-	GList *t_GL;
-	int i, t_len;
-CODE:
-	t_GL = NULL;
-	t_len = av_len((AV *)SvRV(menuitems));
-
-	for ( i = 0; i < t_len; i++) {
-		STRLEN t_sl;
-		t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(menuitems), i, 0), t_sl));
-	RETVAL = gaim_gtk_prefs_dropdown_from_list(page, title, type, key, t_GL);
-OUTPUT:
-	RETVAL
 */
 
 MODULE = Gaim::Gtk::PluginPref  PACKAGE = Gaim::Gtk::PluginPref  PREFIX = gaim_gtk_plugin_pref_
--- a/gtk/plugins/perl/common/GtkPrefs.xs	Mon Sep 04 03:58:23 2006 +0000
+++ b/gtk/plugins/perl/common/GtkPrefs.xs	Mon Sep 04 04:08:07 2006 +0000
@@ -1,8 +1,74 @@
 #include "gtkmodule.h"
 
+/* This can't work at the moment since I don't have a typemap for Gtk::Widget.
+ * I thought about using the one from libgtk2-perl but wasn't sure how to go
+ * about doing that.
+Gtk::Widget
+gaim_gtk_prefs_checkbox(title, key, page)
+	const char * title
+	const char * key
+	Gtk::Widget page
+
+Gtk::Widget
+gaim_gtk_prefs_labeled_spin_button(page, title, key, min, max, sg)
+	Gtk::Widget page
+	const gchar * title
+	const char * key
+	int min
+	int max
+	Gtk::Size::Group sg
+
+Gtk::Widget
+gaim_gtk_prefs_labeled_entry(page, title, key, sg)
+	Gtk::Widget page
+	const gchar * title
+	const char * key
+	Gtk::Size::Group sg
+
+TODO Test this carefully, I'm not at all confident in the loop.
+Gtk::Widget
+gaim_gtk_prefs_dropdown(page, title, type, key, ...)
+	Gtk::Widget page
+	const gchar * title
+	Gaim::Pref::Type type
+	const char * key
+PREINIT:
+	GList *t_GL;
+	int i;
+CODE:
+	t_GL = NULL;
+	for (i = 0; i < items; i++) {
+		if (type == GAIM_PREF_INT || type == GAIM_PREF_BOOLEAN) {
+			t_GL = g_list_append(t_GL, SvIV(ST(i+1)));
+		else {
+			t_GL = g_list_append(t_GL, SvPV(ST(i+1)));
+		}
+	}
+
+Gtk::Widget
+gaim_gtk_prefs_dropdown_from_list(page, title, type, key, menuitems)
+	Gtk::Widget page
+	const gchar * title
+	Gaim::Pref::Type type
+	const char * key
+	SV *menuitems
+PREINIT:
+	GList *t_GL;
+	int i, t_len;
+CODE:
+	t_GL = NULL;
+	t_len = av_len((AV *)SvRV(menuitems));
+
+	for ( i = 0; i < t_len; i++) {
+		STRLEN t_sl;
+		t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(menuitems), i, 0), t_sl));
+	RETVAL = gaim_gtk_prefs_dropdown_from_list(page, title, type, key, t_GL);
+OUTPUT:
+	RETVAL
+*/
+
 MODULE = Gaim::Gtk::Prefs  PACKAGE = Gaim::Gtk::Prefs  PREFIX = gaim_gtk_prefs_
 PROTOTYPES: ENABLE
 
 void
 gaim_gtk_prefs_show()
-