File: GtkCurve.xs

package info (click to toggle)
libgtk-perl 0.7009-12
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,956 kB
  • ctags: 2,260
  • sloc: perl: 13,998; xml: 9,919; ansic: 2,894; makefile: 64; cpp: 45
file content (73 lines) | stat: -rw-r--r-- 1,196 bytes parent folder | download | duplicates (3)
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 "GtkDefs.h"

MODULE = Gtk::Curve		PACKAGE = Gtk::Curve	PREFIX = gtk_curve_

#ifdef GTK_CURVE

Gtk::Curve_Sink
new(Class)
	SV *	Class
	CODE:
	RETVAL = (GtkCurve*)(gtk_curve_new());
	OUTPUT:
	RETVAL

void
gtk_curve_reset(curve)
	Gtk::Curve	curve

void
gtk_curve_set_gamma(curve, gamma)
	Gtk::Curve	curve
	double	gamma

void
gtk_curve_set_curve_type(curve, type)
	Gtk::Curve	curve
	Gtk::CurveType	type

void
gtk_curve_set_range(curve, min_x, max_x, min_y, max_y)
	Gtk::Curve	curve
	double	min_x
	double	max_x
	double	min_y
	double	max_y

void
set_vector(curve, value, ...)
	Gtk::Curve	curve
	CODE:
	{
		gfloat * vec = malloc((items-1) * sizeof(gfloat));
		int i;
		for(i=1;i<items;i++)
			vec[i-1] = SvNV(ST(i));
		gtk_curve_set_vector(curve, items-1, vec);
		free(vec);
	}

void
get_vector(curve, points=32)
	Gtk::Curve	curve
	int	points
	PPCODE:
	{
		gfloat * vec;
		int i;
		if (points<=0)
			croak("points must be positive integer");
		vec = malloc(points * sizeof(gfloat));
		gtk_curve_get_vector(curve, points, vec);
		EXTEND(sp, points);
		for(i=0;i<points;i++)
			PUSHs(sv_2mortal(newSVnv(vec[i])));
		free(vec);
	}

#endif