File: GtkColorSelection.xs

package info (click to toggle)
libgtk-perl 0.1.17-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,352 kB
  • ctags: 1,100
  • sloc: ansic: 4,393; perl: 3,463; makefile: 36
file content (73 lines) | stat: -rw-r--r-- 1,296 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

#include <gtk/gtk.h>

#include "GtkTypes.h"
#include "GdkTypes.h"
#include "MiscTypes.h"

#include "GtkDefs.h"

#ifndef boolSV
# define boolSV(b) ((b) ? &sv_yes : &sv_no)
#endif

MODULE = Gtk::ColorSelection		PACKAGE = Gtk::ColorSelection	PREFIX = gtk_color_selection_

#ifdef GTK_COLOR_SELECTION

Gtk::ColorSelection_Sink
new(Class)
	SV *	Class
	CODE:
	RETVAL = GTK_COLOR_SELECTION(gtk_color_selection_new());
	OUTPUT:
	RETVAL

void
gtk_color_selection_set_opacity(self, use_opacity)
	Gtk::ColorSelection	self
	bool	use_opacity

void
gtk_color_selection_set_update_policy(self, policy)
	Gtk::ColorSelection	self
	Gtk::UpdateType	policy

void
set_color(self, red, green, blue, opacity=0)
	Gtk::ColorSelection	self
	double	red
	double	green
	double	blue
	double	opacity
	CODE:
	{
		double c[4];
		c[0] = red;
		c[1] = green;
		c[2] = blue;
		c[3] = opacity;
		gtk_color_selection_set_color(self, c);
	}

void
get_color(self)
	Gtk::ColorSelection	self
	PPCODE:
	{
		double c[4];
		gtk_color_selection_get_color(self, c);
		EXTEND(sp,3);
		PUSHs(sv_2mortal(newSVnv(c[0])));
		PUSHs(sv_2mortal(newSVnv(c[1])));
		PUSHs(sv_2mortal(newSVnv(c[2])));
		if (self->use_opacity) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVnv(c[3])));
		}
	}

#endif