comparison src/sid/xs_curve.h @ 735:6c3c7b841382 trunk

[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
author nenolod
date Tue, 27 Feb 2007 01:40:23 -0800
parents
children 64ded0b8f80e
comparison
equal deleted inserted replaced
734:ff62f5530a36 735:6c3c7b841382
1 #ifndef XS_CURVE_H
2 #define XS_CURVE_H
3
4 #include <gdk/gdk.h>
5 #include <gtk/gtkdrawingarea.h>
6
7 G_BEGIN_DECLS
8
9 /* Macros for type-classing this GtkWidget/object
10 */
11 #define XS_TYPE_CURVE (xs_curve_get_type())
12 #define XS_CURVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XS_TYPE_CURVE, XSCurve))
13 #define XS_CURVE_CLASS(luokka) (G_TYPE_CHECK_CLASS_CAST ((luokka), XS_TYPE_CURVE, XSCurveClass))
14 #define XS_IS_CURVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XS_TYPE_CURVE))
15 #define XS_IS_CURVE_CLASS(luokka) (G_TYPE_CHECK_CLASS_TYPE ((luokka), XS_TYPE_CURVE))
16 #define XS_CURVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XS_TYPE_CURVE, XSCurveClass))
17
18
19 /* Structures
20 */
21 typedef struct _XSCurve XSCurve;
22 typedef struct _XSCurveClass XSCurveClass;
23
24 typedef struct {
25 gfloat x,y;
26 } t_xs_point;
27
28 typedef struct {
29 gint x, y;
30 } t_xs_int_point;
31
32 struct _XSCurve {
33 GtkDrawingArea graph;
34
35 gint cursor_type;
36 gfloat min_x;
37 gfloat max_x;
38 gfloat min_y;
39 gfloat max_y;
40 GdkPixmap *pixmap;
41 gint height; /* (cached) graph height in pixels */
42 gint grab_point; /* point currently grabbed */
43 gint last;
44
45 /* control points */
46 gint nctlpoints; /* number of control points */
47 t_xs_point *ctlpoints; /* array of control points */
48 };
49
50 struct _XSCurveClass {
51 GtkDrawingAreaClass parent_class;
52 };
53
54
55 GType xs_curve_get_type (void);
56 GtkWidget* xs_curve_new (void);
57 void xs_curve_reset (XSCurve *curve);
58 void xs_curve_set_range (XSCurve *curve,
59 gfloat min_x, gfloat min_y,
60 gfloat max_x, gfloat max_y);
61 gboolean xs_curve_realloc_data (XSCurve *curve, gint npoints);
62 void xs_curve_get_data (XSCurve *curve, t_xs_point ***points, gint **npoints);
63 gboolean xs_curve_set_points (XSCurve *curve, t_xs_int_point *points, gint npoints);
64 gboolean xs_curve_get_points (XSCurve *curve, t_xs_int_point **points, gint *npoints);
65
66 G_END_DECLS
67
68 #endif /* XS_CURVE_H */