Debian Codegraph @

include/gutenprintui2/curve.h

raw symbols SCIP
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 Lesser 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 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
16 */
17
18 /*
19 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
20 * file for a list of people on the GTK+ Team. See the ChangeLog
21 * files for a list of changes. These files are distributed with
22 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23 */
24
25 /*
26 * NOTE this widget is considered too specialized/little-used for
27 * GTK+, and will in the future be moved to some other package. If
28 * your application needs this widget, feel free to use it, as the
29 * widget does work and is useful in some applications; it's just not
30 * of general interest. However, we are not accepting new features for
31 * the widget, and it will eventually move out of the GTK+
32 * distribution.
33 */
34
35 #ifndef GUTENPRINTUI_CURVE_H
36 #define GUTENPRINTUI_CURVE_H
37
38
39 #include <gdk/gdk.h>
40 #include <gtk/gtkdrawingarea.h>
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif /* __cplusplus */
45
46
47 #define STPUI_TYPE_CURVE (stpui_curve_get_type ())
48 #define STPUI_CURVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STPUI_TYPE_CURVE, StpuiCurve))
49 #define STPUI_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STPUI_TYPE_CURVE, StpuiCurveClass))
50 #define STPUI_IS_CURVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STPUI_TYPE_CURVE))
51 #define STPUI_IS_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STPUI_TYPE_CURVE))
52 #define STPUI_CURVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STPUI_TYPE_CURVE, StpuiCurveClass))
53
54
55 /* Curve types */
56 typedef enum
57 {
58 STPUI_CURVE_TYPE_LINEAR, /* linear interpolation */
59 STPUI_CURVE_TYPE_SPLINE, /* spline interpolation */
60 STPUI_CURVE_TYPE_FREE /* free form curve */
61 } StpuiCurveType;
62
63
64 typedef struct _StpuiCurve StpuiCurve;
65 typedef struct _StpuiCurveClass StpuiCurveClass;
66
67
68 struct _StpuiCurve
69 {
70 GtkDrawingArea graph;
71
72 gint cursor_type;
73 gfloat min_x;
74 gfloat max_x;
75 gfloat min_y;
76 gfloat max_y;
77 GdkPixmap *pixmap;
78 StpuiCurveType curve_type;
79 gint height; /* (cached) graph height in pixels */
80 gint grab_point; /* point currently grabbed */
81 gint last;
82
83 /* (cached) curve points: */
84 gint num_points;
85 GdkPoint *point;
86
87 /* control points: */
88 gint num_ctlpoints; /* number of control points */
89 gfloat (*ctlpoint)[2]; /* array of control points */
90 };
91
92 struct _StpuiCurveClass
93 {
94 GtkDrawingAreaClass parent_class;
95
96 void (* curve_type_changed) (StpuiCurve *curve);
97
98 /* Padding for future expansion */
99 void (*_gtk_reserved1) (void);
100 void (*_gtk_reserved2) (void);
101 void (*_gtk_reserved3) (void);
102 void (*_gtk_reserved4) (void);
103 };
104
105
106 GType stpui_curve_get_type (void) G_GNUC_CONST;
107 GtkWidget* stpui_curve_new (void);
108 void stpui_curve_reset (StpuiCurve *curve);
109 void stpui_curve_set_gamma (StpuiCurve *curve, gfloat gamma_);
110 void stpui_curve_set_range (StpuiCurve *curve,
111 gfloat min_x, gfloat max_x,
112 gfloat min_y, gfloat max_y);
113 void stpui_curve_get_vector (StpuiCurve *curve,
114 int veclen, gfloat vector[]);
115 void stpui_curve_set_vector (StpuiCurve *curve,
116 int veclen, const gfloat vector[]);
117 void stpui_curve_set_curve_type (StpuiCurve *curve, StpuiCurveType type);
118
119
120 #ifdef __cplusplus
121 }
122 #endif /* __cplusplus */
123
124
125 #endif /* GUTENPRINTUI_CURVE_H */