view gtk/plugins/perl/common/GtkPluginPref.xs @ 14416:eeca8be382a5

[gaim-migrate @ 17124] This is a Gaim::Gtk perl module for use by gaim plugins to get access to the gtkgaim interface functions. It isn't complete because anything dealing with Gtk widgets themselves doesn't work yet (I need to figure out the best way to do that). To use this a perl plugin just needs to include 'use Gaim::Gtk;' either on top of 'use Gaim;' or instead of it. I'm not done with this yet. At the moment you have to 'use Gaim;' or 'use Gaim::Gtk;' which loads all the parts, I'm planning to let you actually say 'use Gaim::Gtk::Debug;' to just get the gtkdebug.h functions. Though 'use Gaim' would work the same way as always. committer: Tailor Script <tailor@pidgin.im>
author Etan Reisner <pidgin@unreliablesource.net>
date Sat, 02 Sep 2006 05:31:10 +0000
parents
children 01915dd6ff85
line wrap: on
line source

#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_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_
PROTOTYPES: ENABLE