annotate src/xs_curve.h @ 502:54d86ee98b98

Alpha/preliminary curve widget code merged.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 27 Jan 2007 02:52:02 +0000
parents 7e35b6059d79
children fa95d942f226
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
370
df6f12a00305 Work on filter curve widget begins, based on GtkCurve widget from Gtk+ 1.2.10.
Matti Hamalainen <ccr@tnsp.org>
parents: 358
diff changeset
1 #ifndef _XS_CURVE_H
df6f12a00305 Work on filter curve widget begins, based on GtkCurve widget from Gtk+ 1.2.10.
Matti Hamalainen <ccr@tnsp.org>
parents: 358
diff changeset
2 #define _XS_CURVE_H
358
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 #include <gdk/gdk.h>
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 #include <gtk/gtkdrawingarea.h>
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 #ifdef __cplusplus
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 extern "C" {
370
df6f12a00305 Work on filter curve widget begins, based on GtkCurve widget from Gtk+ 1.2.10.
Matti Hamalainen <ccr@tnsp.org>
parents: 358
diff changeset
9 #endif
358
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11
374
58079c6180a0 More removal of original curve code.
Matti Hamalainen <ccr@tnsp.org>
parents: 370
diff changeset
12 #define XS_TYPE_CURVE (xs_curve_get_type())
58079c6180a0 More removal of original curve code.
Matti Hamalainen <ccr@tnsp.org>
parents: 370
diff changeset
13 #define XS_CURVE(obj) (GTK_CHECK_CAST ((obj), XS_TYPE_CURVE, XSCurve))
58079c6180a0 More removal of original curve code.
Matti Hamalainen <ccr@tnsp.org>
parents: 370
diff changeset
14 #define XS_CURVE_CLASS(luokka) (GTK_CHECK_CLASS_CAST ((luokka), XS_TYPE_CURVE, XSCurveClass))
58079c6180a0 More removal of original curve code.
Matti Hamalainen <ccr@tnsp.org>
parents: 370
diff changeset
15 #define XS_IS_CURVE(obj) (GTK_CHECK_TYPE ((obj), XS_TYPE_CURVE))
58079c6180a0 More removal of original curve code.
Matti Hamalainen <ccr@tnsp.org>
parents: 370
diff changeset
16 #define XS_IS_CURVE_CLASS(luokka) (GTK_CHECK_CLASS_TYPE ((luokka), XS_TYPE_CURVE))
358
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18
370
df6f12a00305 Work on filter curve widget begins, based on GtkCurve widget from Gtk+ 1.2.10.
Matti Hamalainen <ccr@tnsp.org>
parents: 358
diff changeset
19 typedef struct _XSCurve XSCurve;
df6f12a00305 Work on filter curve widget begins, based on GtkCurve widget from Gtk+ 1.2.10.
Matti Hamalainen <ccr@tnsp.org>
parents: 358
diff changeset
20 typedef struct _XSCurveClass XSCurveClass;
358
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21
502
54d86ee98b98 Alpha/preliminary curve widget code merged.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
22 typedef struct {
54d86ee98b98 Alpha/preliminary curve widget code merged.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
23 gfloat x,y;
54d86ee98b98 Alpha/preliminary curve widget code merged.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
24 } t_xs_point;
358
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25
502
54d86ee98b98 Alpha/preliminary curve widget code merged.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
26
54d86ee98b98 Alpha/preliminary curve widget code merged.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
27 struct _XSCurve {
384
Matti Hamalainen <ccr@tnsp.org>
parents: 374
diff changeset
28 GtkDrawingArea graph;
358
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29
502
54d86ee98b98 Alpha/preliminary curve widget code merged.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
30 gint cursor_type;
384
Matti Hamalainen <ccr@tnsp.org>
parents: 374
diff changeset
31 gfloat min_x;
Matti Hamalainen <ccr@tnsp.org>
parents: 374
diff changeset
32 gfloat max_x;
Matti Hamalainen <ccr@tnsp.org>
parents: 374
diff changeset
33 gfloat min_y;
Matti Hamalainen <ccr@tnsp.org>
parents: 374
diff changeset
34 gfloat max_y;
Matti Hamalainen <ccr@tnsp.org>
parents: 374
diff changeset
35 GdkPixmap *pixmap;
502
54d86ee98b98 Alpha/preliminary curve widget code merged.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
36 gint height; /* (cached) graph height in pixels */
54d86ee98b98 Alpha/preliminary curve widget code merged.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
37 gint grab_point; /* point currently grabbed */
384
Matti Hamalainen <ccr@tnsp.org>
parents: 374
diff changeset
38 gint last;
358
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39
502
54d86ee98b98 Alpha/preliminary curve widget code merged.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
40 /* control points */
54d86ee98b98 Alpha/preliminary curve widget code merged.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
41 gint num_ctlpoints; /* number of control points */
54d86ee98b98 Alpha/preliminary curve widget code merged.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
42 t_xs_point *ctlpoints; /* array of control points */
358
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 };
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44
502
54d86ee98b98 Alpha/preliminary curve widget code merged.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
45 struct _XSCurveClass {
384
Matti Hamalainen <ccr@tnsp.org>
parents: 374
diff changeset
46 GtkDrawingAreaClass parent_class;
358
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 };
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49
370
df6f12a00305 Work on filter curve widget begins, based on GtkCurve widget from Gtk+ 1.2.10.
Matti Hamalainen <ccr@tnsp.org>
parents: 358
diff changeset
50 GtkType xs_curve_get_type (void);
df6f12a00305 Work on filter curve widget begins, based on GtkCurve widget from Gtk+ 1.2.10.
Matti Hamalainen <ccr@tnsp.org>
parents: 358
diff changeset
51 GtkWidget* xs_curve_new (void);
df6f12a00305 Work on filter curve widget begins, based on GtkCurve widget from Gtk+ 1.2.10.
Matti Hamalainen <ccr@tnsp.org>
parents: 358
diff changeset
52 void xs_curve_reset (XSCurve *curve);
df6f12a00305 Work on filter curve widget begins, based on GtkCurve widget from Gtk+ 1.2.10.
Matti Hamalainen <ccr@tnsp.org>
parents: 358
diff changeset
53 void xs_curve_set_range (XSCurve *curve,
358
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 gfloat min_x, gfloat max_x,
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55 gfloat min_y, gfloat max_y);
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57 #ifdef __cplusplus
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58 }
370
df6f12a00305 Work on filter curve widget begins, based on GtkCurve widget from Gtk+ 1.2.10.
Matti Hamalainen <ccr@tnsp.org>
parents: 358
diff changeset
59 #endif
358
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60
370
df6f12a00305 Work on filter curve widget begins, based on GtkCurve widget from Gtk+ 1.2.10.
Matti Hamalainen <ccr@tnsp.org>
parents: 358
diff changeset
61 #endif /* _XS_CURVE_H */