Gtk-Perl

 view release on metacpan or  search on metacpan

Gtk/xs/Gtk.xs  view on Meta::CPAN

_bootstrap (func)
	IV	func
	CODE:
	{
		pgtk_boostrapf f = (pgtk_boostrapf)func;
		if (f)
			callXS(f, cv, mark);
	}

void
_boot_all ()
	CODE:
	{
#include "Gtkobjects.xsh"
	}

 #DESC: Perform a garbage collection run.
void
gc(Class)
	SV *	Class
	CODE:
	GCGtkObjects();

SV*
constsubstr (data, offset=0, len=0)
	SV *	data
	unsigned int offset
	unsigned int len
	CODE:
	{
		STRLEN alen;
		char *ptr = SvPV(data, alen);
		if (len == 0)
			len = alen-offset;
		if (offset+len > alen)
			croak("constsubstr out of bounds");
		RETVAL = newSVpv("", 0);
		SvPVX(RETVAL) = ptr+offset;
		SvLEN(RETVAL) = 0;
		SvCUR(RETVAL) = len;
		SvREADONLY_on(RETVAL);
	}
	OUTPUT:
	RETVAL

 #PROTO: init_check
 #DESC:
 # Initialize the Gtk module checking for a connection to the display.
 #RETURNS: a TRUE value on success and undef on failure.
 #SEEALSO: Gtk::init
 #OUTPUT: bool
 #PARAMS: $Class

 # DESC: Initialize the Gtk module.
 # Parses the args out of @ARGV.
void
init(Class)
	SV * Class
	ALIAS:
		Gtk::init_check = 1
	PPCODE:
	{
	int argc;
	char ** argv;
	AV * ARGV;
	SV * ARGV0;
	int i;

	if (pgtk_did_we_init_gtk)
		XSRETURN_UNDEF;
#ifdef PGTK_THREADS
			g_thread_init(NULL); /* should probably check the perl thread implementation... */
#endif
			/* FIXME: Check version */
#if GTK_HVER < 0x010103
			g_set_error_handler((GErrorFunc)g_error_handler);
			g_set_warning_handler((GWarningFunc)g_warning_handler);
#else
			g_log_set_handler	("Gtk", G_LOG_LEVEL_MASK|G_LOG_FLAG_FATAL|G_LOG_FLAG_RECURSION, log_handler, 0);
			g_log_set_handler	("Gdk", G_LOG_LEVEL_MASK, log_handler, 0);
#endif
			
			argv  = 0;
			ARGV = perl_get_av("ARGV", FALSE);
			ARGV0 = perl_get_sv("0", FALSE);
			
			if (pgtk_did_we_init_gdk)
				croak("GTK cannot be initalized after GDK has been initialized");
			
			argc = av_len(ARGV)+2;
			if (argc) {
				argv = malloc(sizeof(char*)*argc);
				argv[0] = SvPV(ARGV0, PL_na);
				for(i=0;i<=av_len(ARGV);i++)
					argv[i+1] = SvPV(*av_fetch(ARGV, i, 0), PL_na);
			}
			
			i = argc;
#if GTK_HVER >= 0x010110
			if ( ix == 1 && !gtk_init_check(&argc, &argv) ) {
				XPUSHs(sv_2mortal(newSVsv(&PL_sv_undef)));
				if (argv)
					free(argv);
				GtkInit_internal();
				XSRETURN_UNDEF;
			} else if ( ix == 0 ) {
				gtk_init(&argc, &argv);
			}
#else
			gtk_init(&argc, &argv);
#endif
			XPUSHs(sv_2mortal(newSViv(1)));

			pgtk_did_we_init_gtk = 1;
			pgtk_did_we_init_gdk = 1;
			
			while(argc<i--)
				av_shift(ARGV);
			
			if (argv)
				free(argv);

Gtk/xs/Gtk.xs  view on Meta::CPAN

gtk_menu_factory_add_entries(factory, entry, ...)
	Gtk::MenuFactory	factory
	SV *	entry
	CODE:
	{
		GtkMenuEntry * entries = malloc(sizeof(GtkMenuEntry)*(items-1));
		int i;
		for(i=1;i<items;i++) {
			SvGtkMenuEntry(ST(i), &entries[i-1]);
		}
		gtk_menu_factory_add_entries(factory, entries, items-1);
		free(entries);
	}

void
gtk_menu_factory_add_subfactory(factory, subfactory, path)
	Gtk::MenuFactory	factory
	Gtk::MenuFactory	subfactory
	char *	path

void
gtk_menu_factory_remove_paths(factory, path, ...)
	Gtk::MenuFactory	factory
	SV *	path
	CODE:
	{
		char ** paths = malloc(sizeof(char*)*(items-1));
		int i;
		for(i=1;i<items;i++)
			paths[i-1] = SvPV(ST(i),PL_na);
		gtk_menu_factory_remove_paths(factory, paths, items-1);
		free(paths);
	}

void
gtk_menu_factory_remove_entries(factory, entry, ...)
	Gtk::MenuFactory	factory
	SV *	entry
	CODE:
	{
		GtkMenuEntry * entries = malloc(sizeof(GtkMenuEntry)*(items-1));
		int i;
		for(i=1;i<items;i++) {
			SvGtkMenuEntry(ST(i), &entries[i-1]);
		}
		gtk_menu_factory_remove_entries(factory, entries, items-1);
		free(entries);
	}

void
gtk_menu_factory_remove_subfactory(factory, subfactory, path)
	Gtk::MenuFactory	factory
	Gtk::MenuFactory	subfactory
	char *	path

 #OUTPUT: string
void
gtk_menu_factory_find(factory, path)
	Gtk::MenuFactory	factory
	char *	path
	PPCODE:
	{
		GtkMenuPath * p = gtk_menu_factory_find(factory, path);
		if (p) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVGtkObjectRef(GTK_OBJECT(p->widget), 0)));
			if (GIMME == G_ARRAY) {
				EXTEND(sp,1);
				PUSHs(sv_2mortal(newSVpv(p->path, 0)));
			}
		}
	}

void
gtk_menu_factory_destroy(factory)
	Gtk::MenuFactory	factory
	CODE:
	gtk_menu_factory_destroy(factory);
	UnregisterMisc((HV*)SvRV(ST(0)), factory);

void
DESTROY(factory)
	Gtk::MenuFactory	factory
	CODE:
	UnregisterMisc((HV*)SvRV(ST(0)), factory);

Gtk::Widget_Up
widget(factory)
	Gtk::MenuFactory	factory
	CODE:
	RETVAL = factory->widget;
	OUTPUT:
	RETVAL


MODULE = Gtk		PACKAGE = Gtk::Rc	PREFIX = gtk_rc_

 #DESC: Parse filename for style and resource information.
void
gtk_rc_parse(Class, filename)
	SV *	Class
	char *	filename
	CODE:
	gtk_rc_parse(filename);

 #DESC: Parse the string data for style and resource information.
void
gtk_rc_parse_string(Class, data)
	SV *	Class
	char *	data
	CODE:
	gtk_rc_parse_string(data);

 #DESC: Get the style of widget.
Gtk::Style
gtk_rc_get_style(Class, widget)
	SV *	Class
	Gtk::Widget	widget
	CODE:
	RETVAL = gtk_rc_get_style(widget);
	OUTPUT:
	RETVAL

#if GTK_HVER < 0x010105

void
gtk_rc_add_widget_name_style(Class, style, pattern)
	SV *	Class
	Gtk::Style	style
	char *	pattern
	CODE:
	gtk_rc_add_widget_name_style(style, pattern);

void
gtk_rc_add_widget_class_style(Class, style, pattern)
	SV *	Class
	Gtk::Style	style
	char *	pattern
	CODE:
	gtk_rc_add_widget_class_style(style, pattern);

#endif

#if GTK_HVER >= 0x010200

 #DESC: Add file as a default resource file to read.
void
gtk_rc_add_default_file (Class, file)
	SV * Class
	char *file
	CODE:
	gtk_rc_add_default_file (file);

 #DESC: Add file and any additional filename as default resource file sto read.
void
gtk_rc_set_default_files(Class, file,...)
	SV * Class
	char *file
	CODE:
	{
		char ** files = malloc(sizeof(char*)*items);
		int i;
		for (i=1; i <items; ++i)
			files[i-1] = SvPV(ST(i), PL_na);
		files[items-1] = NULL;
		gtk_rc_set_default_files(files);
		free(files);
	}

 #DESC: Get a list of the default resource files.
 #OUTPUT: list
 #RETURNS: a list of filenames
void
gtk_rc_get_default_files (Class=0)
	SV * Class
	PPCODE:
	{
		char ** files = gtk_rc_get_default_files();
		int i;
		for (i=0; files && files[i]; ++i) {
			EXTEND(sp, 1);
			XPUSHs(sv_2mortal(newSVpv(files[i], 0)));
		}
	}

 #DESC: Parse again all the resource files loaded by the application and apply
 #the changes, if any. The files are not reloaded if they haven't changed.
 #RETURNS: a TRUE value if any file was actually reloaded.
gboolean
gtk_rc_reparse_all (Class=0)
	SV *	Class
	CODE:
	RETVAL = gtk_rc_reparse_all();
	OUTPUT:
	RETVAL

gstring
gtk_rc_get_module_dir(Class=0)
	SV *	Class
	CODE:
	RETVAL = gtk_rc_get_module_dir();
	OUTPUT:
	RETVAL

gstring
gtk_rc_get_theme_dir(Class=0)
	SV *	Class
	CODE:
	RETVAL = gtk_rc_get_theme_dir();
	OUTPUT:
	RETVAL

#endif

MODULE = Gtk		PACKAGE = Gtk::SelectionData PREFIX = gtk_selection_data_

 #DESC: Get a Gtk::Gdk:Atom describing the selection.
Gtk::Gdk::Atom
selection(selectiondata)
	Gtk::SelectionData	selectiondata
	CODE:
		RETVAL = selectiondata->selection;
	OUTPUT:
	RETVAL

 #DESC: Get a Gtk::Gdk:Atom describing the target type of the data of the selection.
Gtk::Gdk::Atom
target(selectiondata)
	Gtk::SelectionData	selectiondata
	CODE:
		RETVAL = selectiondata->target;
	OUTPUT:
	RETVAL

 #DESC: Get a Gtk::Gdk:Atom describing the type of data of the selection.
Gtk::Gdk::Atom

Gtk/xs/Gtk.xs  view on Meta::CPAN

	int	height

void
gtk_draw_diamond(style, window, state_type, shadow_type, x, y, width, height)
	Gtk::Style	style
	Gtk::Gdk::Window	window
	Gtk::StateType	state_type
	Gtk::ShadowType	shadow_type
	int	x
	int	y
	int	width
	int	height

void
gtk_draw_oval(style, window, state_type, shadow_type, x, y, width, height)
	Gtk::Style	style
	Gtk::Gdk::Window	window
	Gtk::StateType	state_type
	Gtk::ShadowType	shadow_type
	int	x
	int	y
	int	width
	int	height

void
gtk_draw_string(style, window, state_type, x, y, string)
	Gtk::Style	style
	Gtk::Gdk::Window	window
	Gtk::StateType	state_type
	int	x
	int	y
	char *	string


MODULE = Gtk		PACKAGE = Gtk::Type

 #DESC: get a perl reference to an array that corresponds to
 #the given $value for the enum or flag $type. This is an internal function.
SV*
int_to_hash (Class, type, value)
	SV	*Class
	char	*type
	long	value
	CODE:
	{
		GtkType gtype = gtk_type_from_name(type);
		if (GTK_FUNDAMENTAL_TYPE(gtype) == GTK_TYPE_ENUM)
			RETVAL = newSVDefEnumHash(gtype, value);
		else if (GTK_FUNDAMENTAL_TYPE(gtype) == GTK_TYPE_FLAGS)
			RETVAL = newSVDefFlagsHash(gtype, value);
		else
			croak("type '%s' must be an enum or a flag type", type);
	}
	OUTPUT:
	RETVAL

 #DESC: internal: do not use.
void
_PerlTypeFromGtk(gtktype)
	char *	gtktype
	PPCODE:
	{
		char * s;
		if ((s = ptname_for_gtname(gtktype))) {
			XPUSHs (sv_2mortal(newSVpv(s, 0)));
		}
	}

void
_get_packages (Class)
	SV	*Class
	PPCODE:
	{
		GList * p = pgtk_get_packages ();
		GList *tmp = p;

		while (tmp) {
			XPUSHs(sv_2mortal(newSVpv((char*)tmp->data, 0)));
			tmp = tmp->next;
		}
		g_list_free (p);
	}

void
_get_children (Class, basetype)
	SV	*Class
	char	*basetype
	PPCODE:
	{
		GList * p = gtk_type_children_types(gtk_type_from_name(basetype));
		GList * tmp = p;
		while (tmp) {
			XPUSHs(sv_2mortal(newSVpv(gtk_type_name(GPOINTER_TO_UINT(tmp->data)), 0)));
			tmp = tmp->next;
		}
		g_list_free (p);
	}

void
_get_nicknames (Class, type)
	SV	*Class
	char	*type
	PPCODE:
	{
		GtkEnumValue * vals;
		GtkType gtype = gtk_type_from_name(type);

		if (GTK_FUNDAMENTAL_TYPE(gtype) == GTK_TYPE_ENUM)
			vals = gtk_type_enum_get_values(gtype);
		else if (GTK_FUNDAMENTAL_TYPE(gtype) == GTK_TYPE_FLAGS)
			vals = (GtkFlagValue*)gtk_type_flags_get_values(gtype);
		else
			croak("type '%s' must be an enum or a flag type", type);
		while (vals && vals->value_nick) {
			XPUSHs(sv_2mortal(newSVpv(vals->value_nick, 0)));
			XPUSHs(sv_2mortal(newSViv(vals->value)));
			vals++;
		}
	}

MODULE = Gtk		PACKAGE = Gtk::Gdk		PREFIX = gdk_

double
constant(name,arg)
	char *	name
	int	arg

 #PROTO: init_check
 #DESC:
 # Initialize the Gtk::Gdk module checking for a connection to the display.
 #RETURNS: a TRUE value on success and undef on failure.
 #SEEALSO: Gtk::Gdk::init
 #OUTPUT: bool
 #PARAMS: $Class

 # DESC: Initialize the Gtk::Gdk module.
 # Parses the args out of @ARGV.
void
init(Class)
	SV *	Class
	ALIAS:
		Gtk::Gdk::init_check = 1
	PPCODE:
	{
		if (!pgtk_did_we_init_gdk && !pgtk_did_we_init_gtk) {
			int argc;
			char ** argv = 0;
			AV * ARGV = perl_get_av("ARGV", FALSE);
			SV * ARGV0 = perl_get_sv("0", FALSE);
			int i;

			argc = av_len(ARGV)+2;
			if (argc) {
				argv = malloc(sizeof(char*)*argc);
				argv[0] = SvPV(ARGV0, PL_na);
				for(i=0;i<=av_len(ARGV);i++)
					argv[i+1] = SvPV(*av_fetch(ARGV, i, 0), PL_na);
			}
			
			i = argc;
#if GTK_HVER >= 0x010110
			if ( ix == 1 && !gdk_init_check(&argc, &argv) ) {
				XPUSHs(sv_2mortal(newSVsv(&PL_sv_undef)));
				if (argv)
					free(argv);
				XSRETURN_UNDEF;
			} else if (ix == 0) {
				gdk_init(&argc, &argv);
			}
#else
			gdk_init(&argc, &argv);
#endif
			XPUSHs(sv_2mortal(newSViv(1)));

			pgtk_did_we_init_gdk = 1;
			
			while(argc<i--)
				av_shift(ARGV);
			
			if (argv)
				free(argv);
				
			GdkInit_internal();
			
		}
	}

 #DESC: Exit the program with status code.
void
exit(Class, code=0)
	SV *	Class
	int	code
	CODE:
	gdk_exit(code);

#if GTK_HVER >= 0x010110

void
error_trap_push(Class=0)
	SV *	Class
	CODE:
	gdk_error_trap_push();

int
error_trap_pop(Class=0)
	SV *	Class
	CODE:
	RETVAL = gdk_error_trap_pop();
	OUTPUT:
	RETVAL

#endif

 #DESC: Get the number of events in the Gdk queue that need to be serviced.
int
events_pending(Class=0)
	SV *	Class
	CODE:
	RETVAL = gdk_events_pending();
	OUTPUT:
	RETVAL

 #DESC: Create a new event structure.
Gtk::Gdk::Event
event_new (Class=0)
	SV *	Class
	CODE:
	{
		GdkEvent e;
		e.type = GDK_NOTHING;
		RETVAL = gdk_event_copy(&e);
	}
	OUTPUT:
	RETVAL

 #DESC: Get the next event from the event queue (may return undef).
 #OUTPUT: Gtk::Gdk::Event
void
event_get(Class=0)
	SV *	Class
	PPCODE:
	{
		GdkEvent * e;
		HV * hash;
		GV * stash;
		int i, dohandle=0;

		if ((e = gdk_event_get())) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVGdkEvent(e)));
		} 

	}

 #DESC: Put the evnt in the event queue.
void
gdk_event_put(Class, event)
	SV *	Class
	Gtk::Gdk::Event	event
	CODE:
	gdk_event_put(event);

void
gdk_set_show_events(Class, show_events)
	SV *	Class
	bool	show_events
	CODE:
	gdk_set_show_events(show_events);

 #DESC: Enable or disable the use of the X Shred memory extension.
void
gdk_set_use_xshm(Class, use_xshm)
	SV *	Class
	bool	use_xshm
	CODE:
	gdk_set_use_xshm(use_xshm);

#if 0

int
gdk_get_debug_level(Class)
	SV *	Class
	CODE:
	RETVAL = gdk_get_debug_level();
	OUTPUT:
	RETVAL

#endif

int
gdk_get_show_events(Class=0)
	SV *	Class
	CODE:
	RETVAL = gdk_get_show_events();
	OUTPUT:
	RETVAL

 #DESC: Get information about the use of the X Shared memory extension.
int
gdk_get_use_xshm(Class=0)
	SV *	Class

Gtk/xs/Gtk.xs  view on Meta::CPAN


char*
gdk_keyval_name (Class, keyval)
	SV *	Class
	guint	keyval
	CODE:
	RETVAL = gdk_keyval_name(keyval);
	OUTPUT:
	RETVAL

guint
gdk_keyval_from_name (Class, name)
	SV *	Class
	char *	name
	CODE:
	RETVAL = gdk_keyval_from_name(name);
	OUTPUT:
	RETVAL

guint
gdk_keyval_to_upper (Class, keyval)
	SV *	Class
	guint	keyval
	CODE:
	RETVAL = gdk_keyval_to_upper(keyval);
	OUTPUT:
	RETVAL

guint
gdk_keyval_to_lower (Class, keyval)
	SV *	Class
	guint	keyval
	CODE:
	RETVAL = gdk_keyval_to_lower(keyval);
	OUTPUT:
	RETVAL

gboolean
gdk_keyval_is_upper (Class, keyval)
	SV *	Class
	guint	keyval
	CODE:
	RETVAL = gdk_keyval_is_upper(keyval);
	OUTPUT:
	RETVAL

gboolean
gdk_keyval_is_lower (Class, keyval)
	SV *	Class
	guint	keyval
	CODE:
	RETVAL = gdk_keyval_is_lower(keyval);
	OUTPUT:
	RETVAL

 #OUTPUT: Gtk::Gdk::Event
 #DESC: Returns an event from the queue if one is available (may return undef).
void
event_peek(Class=0)
	SV *    Class
	PPCODE:
	{
		GdkEvent * e;
		if ((e = gdk_event_peek())) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVGdkEvent(e)));
		}
	}

guint32
gdk_event_get_time (Class, event)
	SV *	Class
	Gtk::Gdk::Event	event
	CODE:
	RETVAL = gdk_event_get_time(event);
	OUTPUT:
	RETVAL

gboolean
gdk_event_send_client_message (Class, event, xid)
	SV *	Class
	Gtk::Gdk::Event	event
	guint	xid
	CODE:
	RETVAL = gdk_event_send_client_message (event, xid);
	OUTPUT:
	RETVAL

 #DESC: Send to all the clients of the X server the client message event.
void
gdk_event_send_clientmessage_toall (Class, event)
	SV *	Class
	Gtk::Gdk::Event	event
	CODE:
	gdk_event_send_clientmessage_toall (event);

#endif

MODULE = Gtk		PACKAGE = Gtk::Gdk::Rgb				PREFIX = gdk_rgb_

#if GTK_HVER > 0x010100

 #DESC: Initialize the Gtk::Gdk::Rgb subsystem. This is required before calling any of the
 #Gtk::Gdk::Rgb functions.
void
gdk_rgb_init(Class=0)
	CODE:
	gdk_rgb_init();

gulong
gdk_rgb_xpixel_from_rgb(Class, rgb)
	guint	rgb
	CODE:
	RETVAL = gdk_rgb_xpixel_from_rgb(rgb);
	OUTPUT:
	RETVAL

gboolean
gdk_rgb_ditherable(Class=0)
	CODE:
	RETVAL = gdk_rgb_ditherable();

Gtk/xs/Gtk.xs  view on Meta::CPAN


void
gdk_rgb_set_install(Class, install)
	gboolean	install
	CODE:
	gdk_rgb_set_install(install);

void
gdk_rgb_set_min_colors(Class, min_colors)
	gint	min_colors
	CODE:
	gdk_rgb_set_min_colors(min_colors);

Gtk::Gdk::Colormap
gdk_rgb_get_cmap(Class=0)
	CODE:
	RETVAL = gdk_rgb_get_cmap();
	OUTPUT:
	RETVAL

Gtk::Gdk::Visual
gdk_rgb_get_visual(Class=0)
	CODE:
	RETVAL = gdk_rgb_get_visual();
	OUTPUT:
	RETVAL

#endif


MODULE = Gtk		PACKAGE = Gtk::Gdk::ColorContext	PREFIX = gdk_color_context_

Gtk::Gdk::ColorContext
new(Class, visual, colormap)
	SV *	Class
	Gtk::Gdk::Visual	visual
	Gtk::Gdk::Colormap	colormap
	CODE:
	RETVAL = gdk_color_context_new(visual, colormap);
	OUTPUT:
	RETVAL

Gtk::Gdk::ColorContext
new_mono(Class, visual, colormap)
	SV *	Class
	Gtk::Gdk::Visual	visual
	Gtk::Gdk::Colormap	colormap
	CODE:
	RETVAL = gdk_color_context_new_mono(visual, colormap);
	OUTPUT:
	RETVAL

 #OUTPUT: integer
 #DESC: Get the pixel value for the given (red, green, blue) tuple.
void
get_pixel(colorc, red, green, blue)
	Gtk::Gdk::ColorContext	colorc
	int	red
	int	green
	int	blue
	PPCODE:
	{
		int failed = 0;
		unsigned long result = gdk_color_context_get_pixel(colorc, red, green, blue, &failed);
		if (!failed) {
			XPUSHs(sv_2mortal(newSViv(result)));
		}
	}

void
free(colorc)
	Gtk::Gdk::ColorContext	colorc
	CODE:
	gdk_color_context_free(colorc);


MODULE = Gtk		PACKAGE = Gtk::Gdk::Window	PREFIX = gdk_window_

 #CONSTRUCTOR: yes
 #DESC: Create a new Gtk::Gdk::Window using the specified attributes.
Gtk::Gdk::Window
new(Class, attr)
	SV *	Class
	SV *	attr
	CODE:
	{
		GdkWindow * parent = 0;
		GdkWindowAttr a;
		gint mask;
		if (Class && SvOK(Class) && SvRV(Class))
			parent = SvGdkWindow(Class);

		SvGdkWindowAttr(attr, &a, &mask);
		
		RETVAL = gdk_window_new(parent, &a, mask);
		if (!RETVAL)
			croak("gdk_window_new failed");
		sv_2mortal(newSVGdkWindow(RETVAL));
		gdk_pixmap_unref(RETVAL);
	}
	OUTPUT:
	RETVAL

 #DESC: Create a new Gtk::Gd;::Window from the specified window id. This function
 #croaks if the window cannot be created.
Gtk::Gdk::Window
new_foreign(Class, anid)
	SV *	Class
	long	anid
	CODE:
	{
		RETVAL = gdk_window_foreign_new(anid);
		if (!RETVAL)
			croak("gdk_window_foreign_new failed");
		sv_2mortal(newSVGdkWindow(RETVAL));
		gdk_pixmap_unref(RETVAL);
	}
	OUTPUT:
	RETVAL

void

Gtk/xs/Gtk.xs  view on Meta::CPAN

void
gdk_window_copy_area(window, gc, x, y, source_window, source_x, source_y, width, height)
	Gtk::Gdk::Window	window
	Gtk::Gdk::GC  gc
	int	x
	int	y
	Gtk::Gdk::Window    source_window
	int	source_x
	int	source_y
	int	width
	int	height

 #DESC: Set if the window manager should handle this window or not.
void
gdk_window_set_override_redirect(window, override_redirect)
	Gtk::Gdk::Window	window
	bool	override_redirect

void
gdk_window_shape_combine_mask(window, shape_mask, offset_x, offset_y)
	Gtk::Gdk::Window	window
	Gtk::Gdk::Bitmap	shape_mask
	int	offset_x
	int	offset_y

void
gdk_window_set_hints(window, x, y, min_width, min_height, max_width, max_height, flags)
	Gtk::Gdk::Window	window
	int	x
	int	y
	int min_width
	int	min_height
	int	max_width
	int	max_height
	Gtk::Gdk::WindowHints	flags

 #DESC: Set the title of the window.
void
gdk_window_set_title(window, title)
	Gtk::Gdk::Window	window
	char *	title

 #DESC: Set the background color of the window.
void
gdk_window_set_background(window, color)
	Gtk::Gdk::Window	window
	Gtk::Gdk::Color	color

 #DESC: Set the specified pixmap as the background of window.
void
gdk_window_set_back_pixmap(window, pixmap, parent_relative)
	Gtk::Gdk::Window	window
	Gtk::Gdk::Pixmap	pixmap
	int	parent_relative

 #DESC: Get info about the geometry of the window.
 #RETURNS: a list with the (x, y) coordinates, width, height and depth.
void
gdk_window_get_geometry(window)
	Gtk::Gdk::Window	window
	PPCODE:
	{
		int x,y,width,height,depth;
		gdk_window_get_geometry(window,&x,&y,&width,&height,&depth);
		if (GIMME != G_ARRAY)
			croak("must accept array");
		EXTEND(sp,5);
		PUSHs(sv_2mortal(newSViv(x)));
		PUSHs(sv_2mortal(newSViv(y)));
		PUSHs(sv_2mortal(newSViv(width)));
		PUSHs(sv_2mortal(newSViv(height)));
		PUSHs(sv_2mortal(newSViv(depth)));
	}

 #DESC: Get the position of the window. This function croaks if not called in list context.
 #RETURNS: a list with the (x, y) coordinates.
void
gdk_window_get_position(window)
	Gtk::Gdk::Window	window
	PPCODE:
	{
		int x,y;
		gdk_window_get_position(window,&x,&y);
		if (GIMME != G_ARRAY)
			croak("must accept array");
		EXTEND(sp,2);
		PUSHs(sv_2mortal(newSViv(x)));
		PUSHs(sv_2mortal(newSViv(y)));
	}

 #DESC: Get the visual of the window.
Gtk::Gdk::Visual
gdk_window_get_visual(window)
	Gtk::Gdk::Window	window

 #DESC: Get the colormap of the window.
Gtk::Gdk::Colormap
gdk_window_get_colormap(window)
	Gtk::Gdk::Window	window

 #OUTPUT: list
 #RETURNS: the x and y position
void
gdk_window_get_origin(window)
	Gtk::Gdk::Window	window
	PPCODE:
	{
		int x,y;
		gdk_window_get_origin(window,&x,&y);
		if (GIMME != G_ARRAY)
			croak("must accept array");
		EXTEND(sp,2);
		PUSHs(sv_2mortal(newSViv(x)));
		PUSHs(sv_2mortal(newSViv(y)));
	}

 #DESC: Get information about the pointer position in window. This function croaks if not 
 #called in list context.
 #RETURNS: a list with the x and y position of the pointer relative to window, the actual
 #window the pointer is in and the state of the keyboard modifiers.
void
gdk_window_get_pointer(window)
	Gtk::Gdk::Window	window
	PPCODE:
	{
		int x,y;
		GdkModifierType mask;
		GdkWindow * w;
		w = gdk_window_get_pointer(window,&x,&y,&mask);
		if (GIMME != G_ARRAY)
			croak("must accept array");
		EXTEND(sp,4);
		PUSHs(sv_2mortal(newSViv(x)));
		PUSHs(sv_2mortal(newSViv(y)));
		PUSHs(sv_2mortal(newSVGdkWindow(w)));
		PUSHs(sv_2mortal(newSVGdkModifierType(mask)));
	}

 #DESC: Tell the system to use the specified cursor inside window.
 #An undefined value sets the cursor to the default one.
void
gdk_window_set_cursor(window, Cursor)
	Gtk::Gdk::Window	window
	Gtk::Gdk::Cursor_OrNULL	Cursor

 #DESC: Get the parent window.
Gtk::Gdk::Window
gdk_window_get_parent(window)
	Gtk::Gdk::Window	window

 #DESC: Get the toplevel window.
Gtk::Gdk::Window
gdk_window_get_toplevel(window)
	Gtk::Gdk::Window	window

 #DESC: Get the children of window.
 #RETURNS: a list with the windows that are children of window.
void
gdk_window_get_children(window)
	Gtk::Gdk::Window	window
	PPCODE:
	{
		GList * l = gdk_window_get_children(window);
		while(l) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVGdkWindow((GdkWindow*)l->data)));
			l=l->next;
		}
	}

 #DESC: Get the event mask for window.
 #SEEALSO: Gtk::Gdk::Window::set_events
Gtk::Gdk::EventMask
gdk_window_get_events (window)
	Gtk::Gdk::Window    window

 #DESC: Set the event mask for window. Only the events specified by the mask will
 #be handled.
void
gdk_window_set_events (window, event_mask)
	Gtk::Gdk::Window    window
	Gtk::Gdk::EventMask event_mask

void
gdk_window_set_icon (window, icon_window, pixmap, mask)
	Gtk::Gdk::Window    window
	Gtk::Gdk::Window_OrNULL    icon_window
	Gtk::Gdk::Pixmap    pixmap
	Gtk::Gdk::Bitmap    mask

 #DESC: Set the name of the icon for window.
void
gdk_window_set_icon_name (window, name)
	Gtk::Gdk::Window    window
	char*  name

void
gdk_window_set_group (window, leader)
	Gtk::Gdk::Window    window
	Gtk::Gdk::Window    leader

 #DESC: Set the decorations that should appear in the window's frame.
void
gdk_window_set_decorations (window, decorations)
	Gtk::Gdk::Window    window
	Gtk::Gdk::WMDecoration decorations

 #DESC: Set the functions that should appear in the window's title bar.
void
gdk_window_set_functions (window, functions)
	Gtk::Gdk::Window    window
	Gtk::Gdk::WMFunction  functions	

#if GTK_HVER >= 0x010200

 #DESC: Get the window at the current pointer coordinates.
 #OUTPUT: list
 #RETURNS: a list with the window and the (x, y) coordinates of the
 #pointer inside the window.
void
gdk_window_at_pointer (Class=0)
	SV *	Class
	PPCODE:
	{
		gint wx, wy;
		GdkWindow * win = gdk_window_at_pointer(&wx, &wy);
		if (win) {
			XPUSHs(sv_2mortal(newSVGdkWindow(win)));
			XPUSHs(sv_2mortal(newSViv(wx)));
			XPUSHs(sv_2mortal(newSViv(wy)));
		}
	}

 #OUTPUT: list
 #RETURNS: the x and y position.
void
gdk_window_get_deskrelative_origin (window)
	Gtk::Gdk::Window	window
	PPCODE:
	{
		gint wx, wy;
		gboolean res = gdk_window_get_deskrelative_origin(window, &wx, &wy);
		if (res) {
			XPUSHs(sv_2mortal(newSViv(wx)));
			XPUSHs(sv_2mortal(newSViv(wy)));
		}
	}

 #OUTPUT: list
 #RETURNS: the x and y position.
void
gdk_window_get_root_origin (window)
	Gtk::Gdk::Window	window
	PPCODE:
	{
		gint wx, wy;
		gdk_window_get_root_origin(window, &wx, &wy);
		XPUSHs(sv_2mortal(newSViv(wx)));
		XPUSHs(sv_2mortal(newSViv(wy)));
	}

 #DESC: Get info about the window visibility.
gboolean
gdk_window_is_visible (window)
	Gtk::Gdk::Window	window

gboolean
gdk_window_is_viewable (window)
	Gtk::Gdk::Window	window

 #DESC: Set the specified colormap for the window.
void
gdk_window_set_colormap (window, colormap)
	Gtk::Gdk::Window	window
	Gtk::Gdk::Colormap	colormap

gboolean
gdk_window_set_static_gravities (window, use_static)
	Gtk::Gdk::Window	window
	gboolean	use_static

#endif


MODULE = Gtk		PACKAGE = Gtk::Gdk::Window		PREFIX = gdk_

 #OUTPUT: list
 #RETURNS: the data, the type (a Gtk::Gdk::Atom) and the format (integer)
void
gdk_property_get(window, property, type, offset, length, pdelete)
	Gtk::Gdk::Window	window
	Gtk::Gdk::Atom	property
	Gtk::Gdk::Atom	type
	int	offset
	int	length
	int	pdelete
	PPCODE:
	{
		guchar * data;
		GdkAtom actual_type;
		int actual_format, actual_length;
		int result = gdk_property_get(window, property, type, offset, length, pdelete, &actual_type, &actual_format, &actual_length, &data);
		if (result) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVpv(data, actual_length)));
			if (GIMME == G_ARRAY) {
				EXTEND(sp,2);
				PUSHs(sv_2mortal(newSVGdkAtom(actual_type)));
				PUSHs(sv_2mortal(newSViv(actual_format)));
			}
			g_free(data);
		}
	}

 #DESC: Delete the property $property from $window.
void
gdk_property_delete(window, property)
	Gtk::Gdk::Window	window
	Gtk::Gdk::Atom	property
	CODE:
	gdk_property_delete(window, property);

void
gdk_property_change (window, property, type, format, mode, data, nelements)
	Gtk::Gdk::Window	window
	Gtk::Gdk::Atom	property
	Gtk::Gdk::Atom	type
	int	format
	Gtk::Gdk::PropMode	mode
	char *	data
	int	nelements

#if GTK_HVER >= 0x010200

 #DESC: Convert the specified selection to the type identified by target.
void
gdk_selection_convert (window, selection, target, time=GDK_CURRENT_TIME)
	Gtk::Gdk::Window	window
	Gtk::Gdk::Atom	selection
	Gtk::Gdk::Atom	target
	guint32	time

 #DESWC: Set the window as owner of the specified selection.
gint
gdk_selection_owner_set (window, selection, time=GDK_CURRENT_TIME, send_event=1)
	Gtk::Gdk::Window_OrNULL	window
	Gtk::Gdk::Atom	selection
	guint32	time
	gint	send_event

 #DESC: Get the value and type of the selection property.
 #RETURNS: the data (or undef), a Gtk::Gdk::Atom for the type and the format.
void
gdk_selection_property_get (window)
	Gtk::Gdk::Window	window
	PPCODE:
	{
		guchar *data;
		GdkAtom prop_type;
		int prop_format, result;
		result = gdk_selection_property_get(window, &data, &prop_type, &prop_format);
		if (result)
			XPUSHs(sv_2mortal(newSVpv(data, result)));
		else
			XPUSHs(sv_2mortal(newSVsv(&PL_sv_undef)));
		XPUSHs(sv_2mortal(newSVGdkAtom(prop_type)));
		XPUSHs(sv_2mortal(newSViv(prop_format)));
	}

#endif

MODULE = Gtk        PACKAGE = Gtk::Gdk::Pixmap  PREFIX = gdk_window_

 #DESC: Get the low-level id of the drawable.
unsigned long
XWINDOW(window)
	Gtk::Gdk::Window	window
	CODE:
	RETVAL = (unsigned long)GDK_WINDOW_XWINDOW(window);
	OUTPUT:
	RETVAL

unsigned long
XDISPLAY(window)
	Gtk::Gdk::Window	window
	CODE:
	RETVAL = (unsigned long)GDK_WINDOW_XDISPLAY(window);
	OUTPUT:
	RETVAL

	
 #DESC: Get the type of the drawable.
Gtk::Gdk::WindowType
gdk_window_get_type(window)
	Gtk::Gdk::Window	window

 #DESC: Get the size of the drawable. This function croaks if not called in list context.
 #RETURNS: width and height
void
gdk_window_get_size(window)
	Gtk::Gdk::Window	window
	PPCODE:
	{
		int width,height;
		gdk_window_get_size(window,&width,&height);
		if (GIMME != G_ARRAY)
			croak("must accept array");
		EXTEND(sp,2);
		/* FIXME: reverse.... */
		PUSHs(sv_2mortal(newSViv(height)));
		PUSHs(sv_2mortal(newSViv(width)));
	}

Gtk::Gdk::Event_OrNULL
event_get_graphics_expose(window)
	Gtk::Gdk::Window	window
	CODE:
	RETVAL = gdk_event_get_graphics_expose(window);
	OUTPUT:
	RETVAL

MODULE = Gtk		PACKAGE = Gtk::Gdk::Pixmap	PREFIX = gdk_

 #DESC: Draw a point at the ($x, $y) coordinates.
void
gdk_draw_point(pixmap, gc, x, y)
	Gtk::Gdk::Pixmap	pixmap
	Gtk::Gdk::GC	gc
	int	x
	int y

 #DESC: Draw a line from ($x1, $y1) to ($x2, $y2).
void
gdk_draw_line(pixmap, gc, x1, y1, x2, y2)
	Gtk::Gdk::Pixmap	pixmap
	Gtk::Gdk::GC	gc
	int	x1
	int y1
	int	x2
	int	y2

 #DESC: Draw an (optionally filled) rectangle at position ($x, $y)
 # with size ($width, $height).
void
gdk_draw_rectangle(pixmap, gc, filled, x, y, width, height)
	Gtk::Gdk::Pixmap	pixmap
	Gtk::Gdk::GC	gc
	bool	filled
	int	x
	int y
	int	width
	int	height

 #DESC: Draw an (optionally filled) arc. $angle1 and $angle2 are in degrees * 64.
void
gdk_draw_arc(pixmap, gc, filled, x, y, width, height, angle1, angle2)
	Gtk::Gdk::Pixmap	pixmap
	Gtk::Gdk::GC	gc
	bool	filled
	int	x
	int y
	int	width

Gtk/xs/Gtk.xs  view on Meta::CPAN

	OUTPUT:
	RETVAL

unsigned long
XCOLORMAP(cmap)
	Gtk::Gdk::Colormap	cmap
	CODE:
	RETVAL = GDK_COLORMAP_XCOLORMAP(cmap);
	OUTPUT:
	RETVAL

 #DESC: Get the system colormap.
Gtk::Gdk::Colormap
gdk_colormap_get_system(Class=0)
	SV *	Class
	CODE:
	RETVAL = gdk_colormap_get_system();
	OUTPUT:
	RETVAL

 #DESC: Get the size of the system colormap.
int
gdk_colormap_get_system_size(Class=0)
	SV *	Class
	CODE:
	RETVAL = gdk_colormap_get_system_size();
	OUTPUT:
	RETVAL

void
gdk_colormap_change(colormap, ncolors)
	Gtk::Gdk::Colormap	colormap
	int	ncolors

SV *
color(colormap, idx)
	Gtk::Gdk::Colormap	colormap
	int	idx
	CODE:
	RETVAL = newSVGdkColor(&colormap->colors[idx]);
	hv_store((HV*)SvRV(RETVAL), "_parent", 7, ST(0), 0);
	OUTPUT:
	RETVAL

#if GTK_HVER >= 0x010200

Gtk::Gdk::Visual
gdk_colormap_get_visual (colormap)
	Gtk::Gdk::Colormap	colormap

#endif

MODULE = Gtk		PACKAGE = Gtk::Gdk::Colormap	PREFIX = gdk_

 #DESC: Allocate $color in $colormap.
 #RETURNS: a new color if successfull ($color->pixel is valid).
void
gdk_color_alloc(colormap, color)
	Gtk::Gdk::Colormap	colormap
	Gtk::Gdk::Color	color
	PPCODE:
	{
		GdkColor col = *color;
		int result = gdk_color_alloc(colormap, &col);
		if (result)
			XPUSHs(sv_2mortal(newSVGdkColor(&col)));
	}

void
gdk_color_change(colormap, color)
	Gtk::Gdk::Colormap	colormap
	Gtk::Gdk::Color	color

 #DESC: Get the white color from $colormap.
 #RETURNS: the white color if successfull.
void
gdk_color_white(colormap)
	Gtk::Gdk::Colormap	colormap
	PPCODE:
	{
		GdkColor col;
		int result = gdk_color_white(colormap, &col);
		if (result)
			XPUSHs(sv_2mortal(newSVGdkColor(&col)));
	}

 #DESC: Get the black color from $colormap.
 #RETURNS: the black color if successfull.
void
gdk_color_black(colormap)
	Gtk::Gdk::Colormap	colormap
	PPCODE:
	{
		GdkColor col;
		int result = gdk_color_black(colormap, &col);
		if (result)
			XPUSHs(sv_2mortal(newSVGdkColor(&col)));
	}


MODULE = Gtk		PACKAGE = Gtk::Gdk::Color		PREFIX = gdk_color_

 #DESC: Get the red component of $color. Set a new value if given an arg.
int
red(color, new_value=0)
	Gtk::Gdk::Color	color
	int	new_value
	CODE:
	RETVAL=color->red;
	if (items>1)	color->red = new_value;
	OUTPUT:
	color
	RETVAL
		
 #DESC: Get the green component of $color. Set a new value if given an arg.
int
green(color, new_value=0)
	Gtk::Gdk::Color	color
	int	new_value
	CODE:
	RETVAL=color->green;
	if (items>1)	color->green = new_value;
	OUTPUT:
	color
	RETVAL

 #DESC: Get the blue component of $color. Set a new value if given an arg.
int
blue(color, new_value=0)
	Gtk::Gdk::Color	color
	int	new_value
	CODE:
	RETVAL=color->blue;
	if (items>1)	color->blue = new_value;
	OUTPUT:
	color
	RETVAL

 #DESC: Get the pixel valu of $color. Set a new value if given an arg.
int
pixel(color, new_value=0)
	Gtk::Gdk::Color	color
	int	new_value
	CODE:
	RETVAL=color->pixel;
	if (items>1)	color->pixel = new_value;
	OUTPUT:
	color
	RETVAL

 #DESC: Query the red, green and blue components of the named color.
 #OUTPUT: Gtk::Gdk::Color
 #CONSTRUCTOR: yes
void
parse_color(Class, name)
	SV*	Class
	char *	name
	PPCODE:
	{
		GdkColor col;
		int result = gdk_color_parse(name, &col);
		if (result)
			XPUSHs(sv_2mortal(newSVGdkColor(&col)));
	}

 #DESC: Find out if two colors are equal.
int
gdk_color_equal(colora, colorb)
	Gtk::Gdk::Color	colora
	Gtk::Gdk::Color	colorb


MODULE = Gtk		PACKAGE = Gtk::Gdk::Cursor	PREFIX = gdk_cursor_

 #DESC: Create a new cursor.
Gtk::Gdk::Cursor
new(Class, type)
	SV *	Class
	int	type
	CODE:
	RETVAL = gdk_cursor_new(type); /*SvGdkCursorType(type));*/
	OUTPUT:
	RETVAL

 #DESC: Create a new cursor from the specified data. Both $source and
 #$mask must have depth == 1. $x and $y are the coordinates of the hot-spot
 #in the cursor.
Gtk::Gdk::Cursor
gdk_cursor_new_from_pixmap (Class, source, mask, fg, bg, x, y)
	SV *    Class
	Gtk::Gdk::Pixmap  source
	Gtk::Gdk::Pixmap  mask
	Gtk::Gdk::Color   fg
	Gtk::Gdk::Color   bg
	int   x
	int   y
	CODE:
	RETVAL = gdk_cursor_new_from_pixmap(source, mask, fg, bg, x, y);
	OUTPUT:
	RETVAL

void
destroy(cursor)
	Gtk::Gdk::Cursor	cursor
	CODE:
	gdk_cursor_destroy(cursor);

MODULE = Gtk		PACKAGE = Gtk::Gdk::Pixmap	PREFIX = gdk_pixmap_

 #DESC: Create a new pixmap with the specified width and height.
 #If $depth is not given, use the same depth of $window.
Gtk::Gdk::Pixmap
new(Class, window, width, height, depth=-1)
	SV *	Class
	Gtk::Gdk::Window	window
	int	width
	int	height
	int	depth
	CODE:
	RETVAL = gdk_pixmap_new(window, width, height, depth);
	sv_2mortal(newSVGdkWindow(RETVAL));
	gdk_pixmap_unref(RETVAL);
	OUTPUT:
	RETVAL

Gtk::Gdk::Pixmap
create_from_data(Class, window, data, width, height, depth, fg, bg)
	SV *	Class
	Gtk::Gdk::Window	window
	SV *	data
	int	width
	int	height
	int	depth
	Gtk::Gdk::Color	fg
	Gtk::Gdk::Color	bg
	CODE:
	RETVAL = gdk_pixmap_create_from_data(window, SvPV(data,PL_na), width, height, depth, fg, bg);
	sv_2mortal(newSVGdkWindow(RETVAL));
	gdk_pixmap_unref(RETVAL);
	OUTPUT:
	RETVAL

 #DESC: Create a pixmap from $filename.
 #RETURNS: if successfull a list with the pixmap and the mask.
 #OUTPUT: list
void
create_from_xpm(Class, window, transparent_color, filename)
	SV *	Class
	Gtk::Gdk::Window	window
	Gtk::Gdk::Color	transparent_color
	char *	filename
	PPCODE:
	{
		GdkPixmap * result = 0;
		GdkBitmap * mask = 0;
		result = gdk_pixmap_create_from_xpm(window, (GIMME == G_ARRAY) ? &mask : 0,
			transparent_color, filename); 
		if (result) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVGdkPixmap(result)));
		}
		if (mask) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVGdkBitmap(mask)));
		}
	}

 #DESC: Create a pixmap from the XPM formatted data. The data is a list of
 #strings each of which has a line of data.
 #RETURNS: if successfull a list with the pixmap and the mask.
 #OUTPUT: list
void
create_from_xpm_d(Class, window, transparent_color, data, ...)
	SV *	Class
	Gtk::Gdk::Window	window
	Gtk::Gdk::Color_OrNULL	transparent_color
	SV *	data
	PPCODE:
	{
		GdkPixmap * result = 0;
		GdkBitmap * mask = 0;
		char ** lines = (char**)malloc(sizeof(char*)*(items-3));
		int i;
		for(i=3;i<items;i++)
			lines[i-3] = SvPV(ST(i),PL_na);
		result = gdk_pixmap_create_from_xpm_d(window, (GIMME == G_ARRAY) ? &mask : 0,
			transparent_color, lines); 
		free(lines);
		if (result) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVGdkPixmap(result)));
		}
		if (mask) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVGdkBitmap(mask)));
		}
	}

 #DESC: Creates a pixmap from $filename. Either $window or $colormap can be undef,
 #but not both.
 #RETURNS: if successfull a list with the pixmap and the mask.
 #OUTPUT: list
void
gdk_pixmap_colormap_create_from_xpm (Class, window, colormap, transparent_color, filename)
	SV *	Class
	Gtk::Gdk::Window_OrNULL	window
	Gtk::Gdk::Colormap_OrNULL	colormap
	Gtk::Gdk::Color_OrNULL	transparent_color
	char *	filename
	PPCODE:
	{
		GdkPixmap * result = 0;
		GdkBitmap * mask = 0;
		result = gdk_pixmap_colormap_create_from_xpm(window, colormap, (GIMME == G_ARRAY) ? &mask : 0,
			transparent_color, filename); 
		if (result) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVGdkPixmap(result)));
		}
		if (mask) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVGdkBitmap(mask)));
		}
	}

 #DESC: Creates a pixmap from XPM formatted data. Either $window or $colormap can be undef,
 #but not both.
 #RETURNS: if successfull a list with the pixmap and the mask.
 #OUTPUT: list
void
gdk_pixmap_colormap_create_from_xpm_d(Class, window, colormap, transparent_color, data, ...)
	SV *	Class
	Gtk::Gdk::Window_OrNULL	window
	Gtk::Gdk::Colormap_OrNULL	colormap
	Gtk::Gdk::Color_OrNULL	transparent_color
	SV *	data
	PPCODE:
	{
		GdkPixmap * result = 0;
		GdkBitmap * mask = 0;
		char ** lines = (char**)malloc(sizeof(char*)*(items-4));
		int i;
		for(i=4;i<items;i++)
			lines[i-4] = SvPV(ST(i),PL_na);
		result = gdk_pixmap_colormap_create_from_xpm_d(window, colormap, (GIMME == G_ARRAY) ? &mask : 0,
			transparent_color, lines); 
		free(lines);
		if (result) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVGdkPixmap(result)));
		}
		if (mask) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVGdkBitmap(mask)));
		}
	}

#if GTK_HVER >= 0x010200

 #DESC: Creates a pixmap from the specified low-level pixmap id.
Gtk::Gdk::Pixmap
gdk_pixmap_foreign_new (Class, xid)
	SV *	Class
	guint	xid
	CODE:
	RETVAL = gdk_pixmap_foreign_new(xid);
	sv_2mortal(newSVGdkWindow(RETVAL));
	gdk_pixmap_unref(RETVAL);
	OUTPUT:
	RETVAL

#endif


MODULE = Gtk		PACKAGE = Gtk::Gdk::Image	PREFIX = gdk_image_

 #DESC: Create a new image with the specified width, height and visual.
Gtk::Gdk::Image
new(Class, type, visual, width, height)
	SV *	Class
	Gtk::Gdk::ImageType	type
	Gtk::Gdk::Visual	visual
	int	width
	int	height
	CODE:
	RETVAL = gdk_image_new(type, visual, width, height);
	OUTPUT:
	RETVAL

 #DESC: Create a new image with the data from the specified rectangle of $window.
Gtk::Gdk::Image
get(Class, window, x, y, width, height)
	SV *	Class
	Gtk::Gdk::Window	window
	int	x
	int	y
	int	width

Gtk/xs/Gtk.xs  view on Meta::CPAN

	RETVAL = gdk_visual_get_best_depth();
	OUTPUT:
	RETVAL

SV *
best_type(Class=0)
	SV *	Class
	CODE:
	RETVAL = newSVGdkVisualType(gdk_visual_get_best_type());
	OUTPUT:
	RETVAL

unsigned long
XVISUAL(visual)
	Gtk::Gdk::Visual	visual
	CODE:
	RETVAL = (unsigned long)GDK_VISUAL_XVISUAL(visual);
	OUTPUT:
	RETVAL
	

Gtk::Gdk::Visual
best(Class=0, depth=0, type=0)
	SV *	Class
	SV *	depth
	SV *	type
	CODE:
	{
		gint d;
		GdkVisualType t;

		if (depth && SvOK(depth))
			d = SvIV(depth);
		else
			depth = 0;

		if (type && SvOK(type))
			t = SvGdkVisualType(type);
		else
			type = 0;

		if (type) 
			if (depth)
				RETVAL = gdk_visual_get_best_with_both(d, t);
			else
				RETVAL = gdk_visual_get_best_with_type(t);
		else
			if (depth)
				RETVAL = gdk_visual_get_best_with_depth(d);
			else
				RETVAL = gdk_visual_get_best();
	}
	OUTPUT:
	RETVAL

 #OUTPUT: list
 #RETURNS: the list of depths
void
depths(Class=0)
	SV *	Class
	PPCODE:
	{
		gint *depths;
		gint count;
		int i;
		gdk_query_depths(&depths, &count);
		for(i=0;i<count;i++) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSViv(depths[i])));
		}
	}

 #OUTPUT: list
 #RETURNS: the list of visual types (Gtk::Gdk::VisualType)
void
visual_types(Class=0)
	SV *	Class
	PPCODE:
	{
		GdkVisualType *types;
		gint count;
		int i;
		gdk_query_visual_types(&types, &count);
		for(i=0;i<count;i++) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVGdkVisualType(types[i])));
		}
	}

 #OUTPUT: list
 #RETURNS: the list of visuals (Gtk::Gdk::Visual)
void
visuals(Class=0)
	SV *	Class
	PPCODE:
	{
		GList *list, *tmp;
		list = gdk_list_visuals();
		tmp = list;
		while (tmp) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVGdkVisual((GdkVisual*)tmp->data)));
			tmp = tmp->next;
		}
		g_list_free(list);
	}


MODULE = Gtk		PACKAGE = Gtk::Gdk::Font	PREFIX = gdk_font_

 #DESC: Create a new font from $name.
 #CONSTRUCTOR: yes
Gtk::Gdk::Font
load(Class, font_name)
	SV *	Class
	char *	font_name
	CODE:
	RETVAL = gdk_font_load(font_name);
	sv_2mortal(newSVGdkFont(RETVAL));
	gdk_font_unref(RETVAL);
	OUTPUT:
	RETVAL

 #DESC: Create a new fontset from $name.
 #CONSTRUCTOR: yes
Gtk::Gdk::Font
fontset_load(Class, fontset_name)
	SV *	Class
	char *	fontset_name
	CODE:
	RETVAL = gdk_fontset_load(fontset_name);
	sv_2mortal(newSVGdkFont(RETVAL));
	gdk_font_unref(RETVAL);
	OUTPUT:
	RETVAL

int
gdk_font_id(font)
	Gtk::Gdk::Font	font

void
gdk_font_ref(font)
	Gtk::Gdk::Font	font

bool
gdk_font_equal(fonta, fontb)
	Gtk::Gdk::Font	fonta
	Gtk::Gdk::Font	fontb

MODULE = Gtk		PACKAGE = Gtk::Gdk::Atom	PREFIX = gdk_atom_

 #DESC: Get the id bound to $name. Create it if $only_if_exists is false.
Gtk::Gdk::Atom
gdk_atom_intern(Class, atom_name, only_if_exists=0)
	SV *	Class
	char *	atom_name
	int	only_if_exists
	CODE:
	RETVAL = gdk_atom_intern(atom_name, only_if_exists);
	OUTPUT:
	RETVAL

 #DESC: Get the name of $atom.
 #RETURNS: undef if $atom doesn't exist.
SV *
gdk_atom_name(Class, atom)
	SV *            Class
	Gtk::Gdk::Atom	atom
	CODE:
	{
		char *result = gdk_atom_name(atom);
		if (result) {
			RETVAL = newSVpv(result, 0);
			g_free (result);
		} else
			RETVAL = newSVsv(&PL_sv_undef);
	}
	OUTPUT:
	RETVAL

MODULE = Gtk		PACKAGE = Gtk::Gdk::Property	PREFIX = gdk_property_

 #OUTPUT: list
 #RETURNS: the data, the type (a Gtk::Gdk::Atom) and the format (integer)
void
gdk_property_get(Class, window, property, type, offset, length, pdelete)
	SV *	Class
	Gtk::Gdk::Window	window
	Gtk::Gdk::Atom	property
	Gtk::Gdk::Atom	type
	int	offset
	int	length
	int	pdelete
	PPCODE:
	{
		guchar * data;
		GdkAtom actual_type;
		int actual_format, actual_length;
		int result = gdk_property_get(window, property, type, offset, length, pdelete, &actual_type, &actual_format, &actual_length, &data);
		if (result) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVpv(data, actual_length)));
			if (GIMME == G_ARRAY) {
				EXTEND(sp,2);
				PUSHs(sv_2mortal(newSVGdkAtom(actual_type)));
				PUSHs(sv_2mortal(newSViv(actual_format)));
			}
			g_free(data);
		}
	}

 #DESC: Delete the property $property from $window.
void
gdk_property_delete(Class, window, property)
	SV *	Class
	Gtk::Gdk::Window	window
	Gtk::Gdk::Atom	property
	CODE:
	gdk_property_delete(window, property);

void
gdk_property_change (window, property, type, format, mode, data, nelements)
	Gtk::Gdk::Window	window
	Gtk::Gdk::Atom	property
	Gtk::Gdk::Atom	type
	int	format
	Gtk::Gdk::PropMode	mode
	char *	data
	int	nelements

MODULE = Gtk		PACKAGE = Gtk::Gdk::Selection	PREFIX = gdk_selection_

 #DESC: Get the window the owns $selection.
Gtk::Gdk::Window
gdk_selection_owner_get(Class, selection)
	SV *	Class
	Gtk::Gdk::Atom	selection
	CODE:
	RETVAL = gdk_selection_owner_get(selection);
	OUTPUT:
	RETVAL

MODULE = Gtk		PACKAGE = Gtk::Gdk::Rectangle	PREFIX = gdk_rectangle_

 #OUTPUT: Gtk::Gdk::Rectangle
void
gdk_rectangle_intersect(Class, src1, src2)
	SV *	Class
	Gtk::Gdk::Rectangle	src1
	Gtk::Gdk::Rectangle	src2
	PPCODE:
	{
		GdkRectangle dest;
		int result = gdk_rectangle_intersect(src1,src2,&dest);
		if (result) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVGdkRectangle(&dest)));
		}
	}

 #OUTPUT: Gtk::Gdk::Rectangle
void
gdk_rectangle_union(Class, src1, src2)
	SV *    Class
	Gtk::Gdk::Rectangle     src1
	Gtk::Gdk::Rectangle     src2
	PPCODE:
	{
		GdkRectangle dest;
		gdk_rectangle_union(src1,src2,&dest);
		EXTEND(sp,1);
		PUSHs(sv_2mortal(newSVGdkRectangle(&dest)));
	}

MODULE = Gtk		PACKAGE = Gtk::Gdk::Font	PREFIX = gdk_

 #DESC: Get the width of $string.
int
gdk_string_width(font, string)
	Gtk::Gdk::Font	font
	char *	string

 #DESC: Get the width first $text_len chars of $string.
int
gdk_text_width(font, text, text_length)
	Gtk::Gdk::Font	font
	char *	text
	int	text_length

 #DESC: Get the width of $character.
int
gdk_char_width(font, character)
	Gtk::Gdk::Font	font
	int	character

int
gdk_string_measure(font, string)
	Gtk::Gdk::Font	font
	char *	string

int
gdk_text_measure(font, text, text_length)
	Gtk::Gdk::Font	font
	char *	text
	int	text_length

int
gdk_char_measure(font, character)
	Gtk::Gdk::Font	font
	int	character

 #DESC: Get the ascent of $font.
int
ascent(font)
	Gtk::Gdk::Font	font
	CODE:
	RETVAL = font->ascent;
	OUTPUT:
	RETVAL

 #DESC: Get the descent of $font.
int
descent(font)
	Gtk::Gdk::Font	font
	CODE:
	RETVAL = font->descent;
	OUTPUT:
	RETVAL

#if GTK_HVER >= 0x010200

 #DESC: Get infromation about $text's extents.
 #RETURNS: a list with lbearing, rbearing, width, ascent and descent.
void
gdk_string_extents(font, text, len=0)
	Gtk::Gdk::Font	font
	SV *	text
	int	len
	ALIAS:
		Gtk::Gdk::Font::text_extents = 1
	PPCODE:
	{
		gint lbearing, rbearing, width, ascent, descent;
		STRLEN tlen;
		char * t = SvPV(text, tlen);
		gdk_text_extents(font, t, ix==1?len:tlen, &lbearing, &rbearing, &width, &ascent, &descent);
		EXTEND(sp, 5);
		XPUSHs(sv_2mortal(newSViv(lbearing)));
		XPUSHs(sv_2mortal(newSViv(rbearing)));
		XPUSHs(sv_2mortal(newSViv(width)));
		XPUSHs(sv_2mortal(newSViv(ascent)));
		XPUSHs(sv_2mortal(newSViv(descent)));
	}

 #DESC: Get the height of $text.
gint
gdk_string_height(font, text, len=0)
	Gtk::Gdk::Font	font
	SV *	text
	int	len
	ALIAS:
		Gtk::Gdk::Font::text_height = 1
	CODE:
	{
		STRLEN tlen;
		char * t = SvPV(text, tlen);
		RETVAL = gdk_text_height(font, t, ix==1?len:tlen);
	}
	OUTPUT:
	RETVAL

#endif

MODULE = Gtk		PACKAGE = Gtk::Gdk::Region		PREFIX = gdk_region_

Gtk::Gdk::Region
new(Class)
	SV * Class
	CODE:
	RETVAL = gdk_region_new();
	OUTPUT:
	RETVAL

void
gdk_region_destroy (region)
	Gtk::Gdk::Region region

bool
gdk_region_empty (region)
	Gtk::Gdk::Region region

bool
gdk_region_equal (region1, region2)
	Gtk::Gdk::Region region1
	Gtk::Gdk::Region region2

bool
gdk_region_point_in (region, x, y)
	Gtk::Gdk::Region region
	int x
	int y



( run in 1.132 second using v1.01-cache-2.11-cpan-5511b514fd6 )