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