annotate src/xs_curve.h @ 358:4f247b19c9ea

Add new files
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 07 Nov 2005 09:49:04 +0000
parents
children df6f12a00305
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
358
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /* GTK - The GIMP Toolkit
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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 * This library is free software; you can redistribute it and/or
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 * modify it under the terms of the GNU Library General Public
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 * License as published by the Free Software Foundation; either
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 * version 2 of the License, or (at your option) any later version.
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 *
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 * This library is distributed in the hope that it will be useful,
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 * Library General Public License for more details.
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 *
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 * You should have received a copy of the GNU Library General Public
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 * License along with this library; if not, write to the
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 * Boston, MA 02111-1307, USA.
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 */
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 /*
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 * file for a list of people on the GTK+ Team. See the ChangeLog
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 * files for a list of changes. These files are distributed with
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 */
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 #ifndef __GTK_CURVE_H__
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 #define __GTK_CURVE_H__
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 #include <gdk/gdk.h>
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 #include <gtk/gtkdrawingarea.h>
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 #ifdef __cplusplus
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 extern "C" {
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 #endif /* __cplusplus */
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 #define GTK_TYPE_CURVE (gtk_curve_get_type ())
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 #define GTK_CURVE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CURVE, GtkCurve))
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 #define GTK_CURVE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CURVE, GtkCurveClass))
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 #define GTK_IS_CURVE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CURVE))
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 #define GTK_IS_CURVE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CURVE))
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 typedef struct _GtkCurve GtkCurve;
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 typedef struct _GtkCurveClass GtkCurveClass;
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
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50 struct _GtkCurve
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51 {
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52 GtkDrawingArea graph;
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 gint cursor_type;
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55 gfloat min_x;
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56 gfloat max_x;
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57 gfloat min_y;
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58 gfloat max_y;
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59 GdkPixmap *pixmap;
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60 GtkCurveType curve_type;
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61 gint height; /* (cached) graph height in pixels */
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
62 gint grab_point; /* point currently grabbed */
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63 gint last;
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65 /* (cached) curve points: */
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66 gint num_points;
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67 GdkPoint *point;
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69 /* control points: */
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70 gint num_ctlpoints; /* number of control points */
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71 gfloat (*ctlpoint)[2]; /* array of control points */
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 };
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 struct _GtkCurveClass
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75 {
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76 GtkDrawingAreaClass parent_class;
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 void (* curve_type_changed) (GtkCurve *curve);
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79 };
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 GtkType gtk_curve_get_type (void);
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83 GtkWidget* gtk_curve_new (void);
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84 void gtk_curve_reset (GtkCurve *curve);
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85 void gtk_curve_set_gamma (GtkCurve *curve, gfloat gamma);
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86 void gtk_curve_set_range (GtkCurve *curve,
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87 gfloat min_x, gfloat max_x,
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88 gfloat min_y, gfloat max_y);
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89 void gtk_curve_get_vector (GtkCurve *curve,
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90 int veclen, gfloat vector[]);
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91 void gtk_curve_set_vector (GtkCurve *curve,
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92 int veclen, gfloat vector[]);
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
93 void gtk_curve_set_curve_type (GtkCurve *curve, GtkCurveType type);
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
95
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96 #ifdef __cplusplus
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97 }
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 #endif /* __cplusplus */
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100
4f247b19c9ea Add new files
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101 #endif /* __GTK_CURVE_H__ */