Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 78 lines (75 sloc) 3.404 kB
02179b5 @pchilds source unbundled
authored
1 /***************************************************************************
75e3268 @pchilds transferred to gtk_ based API and polar bug fixes
authored
2 * gtkplotlinear.h
02179b5 @pchilds source unbundled
authored
3 *
4 * A GTK+ widget that plots data
5 *
6 * Sat Dec 4 17:18:14 2010
7 * Copyright 2011 Paul Childs
8 * <pchilds@physics.org>
9 ****************************************************************************/
10
11 /*
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Library General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
25 */
26
75e3268 @pchilds transferred to gtk_ based API and polar bug fixes
authored
27 #ifndef __GTK_PLOT_LINEAR_H__
28 # define __GTK_PLOT_LINEAR_H__
80c6a47 @pchilds update
authored
29 # include <gtk/gtk.h>
30 G_BEGIN_DECLS
75e3268 @pchilds transferred to gtk_ based API and polar bug fixes
authored
31 # define GTK_PLOT_TYPE_LINEAR (gtk_plot_linear_get_type())
32 # define GTK_PLOT_LINEAR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_PLOT_TYPE_LINEAR, GtkPlotLinear))
33 # define GTK_PLOT_IS_LINEAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_PLOT_TYPE_LINEAR))
34 # define GTK_PLOT_LINEAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_PLOT_LINEAR, GtkPlotLinearClass))
35 # define GTK_PLOT_IS_LINEAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_PLOT_TYPE_LINEAR))
36 # define GTK_PLOT_LINEAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_PLOT_TYPE_LINEAR, GtkPlotLinearClass))
37 typedef struct _GtkPlotLinear GtkPlotLinear;
38 typedef struct _GtkPlotLinearClass GtkPlotLinearClass;
80c6a47 @pchilds update
authored
39 typedef enum
40 {
75e3268 @pchilds transferred to gtk_ based API and polar bug fixes
authored
41 GTK_PLOT_LINEAR_ZOOM_OUT = 1 << 0,
42 GTK_PLOT_LINEAR_ZOOM_HZT = 1 << 1,
43 GTK_PLOT_LINEAR_ZOOM_VRT = 1 << 2,
44 GTK_PLOT_LINEAR_ZOOM_SGL = 1 << 3
45 } GtkPlotLinearZoom;
80c6a47 @pchilds update
authored
46 typedef enum
47 {
75e3268 @pchilds transferred to gtk_ based API and polar bug fixes
authored
48 GTK_PLOT_LINEAR_DISP_LIN = 1 << 0,
49 GTK_PLOT_LINEAR_DISP_PTS = 1 << 1
50 } GtkPlotLinearDisp;
51 struct _GtkPlotLinear
80c6a47 @pchilds update
authored
52 {
53 GtkDrawingArea parent;
54 GArray *xdata, *ydata; /* x and y data sets */
55 GArray *ind, *sizes; /* indices of first element and number of elements for each trace */
56 GArray *rd, *gr, *bl, *al; /* colour and alpha of the plots */
57 gchar *xlab, *ylab; /* labels for the x and y axes */
58 PangoFontDescription *afont, *lfont; /* font descriptions for the tick mark and axis labels */
59 guint ptsize, linew; /* radii of the points and line width of the plot line */
dff3b34 @pchilds rounding errors fixed
authored
60 guint xdp, ydp; /* number of decimal points for axes */
80c6a47 @pchilds update
authored
61 gint zmode; /* zoom mode flags */
62 gdouble xps, yps; /* x and y position of mouse */
63 guint flagd; /* data display flags */
64 };
75e3268 @pchilds transferred to gtk_ based API and polar bug fixes
authored
65 struct _GtkPlotLinearClass
80c6a47 @pchilds update
authored
66 {
67 GtkDrawingAreaClass parent_class;
75e3268 @pchilds transferred to gtk_ based API and polar bug fixes
authored
68 void (*moved) (GtkPlotLinear *plot);
80c6a47 @pchilds update
authored
69 };
75e3268 @pchilds transferred to gtk_ based API and polar bug fixes
authored
70 gboolean gtk_plot_linear_update_scale(GtkWidget *widget, gdouble xn, gdouble xx, gdouble yn, gdouble yx);
71 gboolean gtk_plot_linear_update_scale_pretty(GtkWidget *widget, gdouble xl, gdouble xu, gdouble yl, gdouble yu);
72 gboolean gtk_plot_linear_print_eps(GtkWidget *widget, gchar *fout);
73 gboolean gtk_plot_linear_print_png(GtkWidget *widget, gchar *fout);
74 gboolean gtk_plot_linear_print_svg(GtkWidget *widget, gchar *fout);
75 GtkWidget *gtk_plot_linear_new(void);
80c6a47 @pchilds update
authored
76 G_END_DECLS
02179b5 @pchilds source unbundled
authored
77 #endif
Something went wrong with that request. Please try again.