gtkdatabox  1.0.0
About: GtkDatabox is a Gtk+-widget for live display of large amounts of fluctuating numerical data.
  Fossies Dox: gtkdatabox-1.0.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

gtkdatabox.h
Go to the documentation of this file.
1 /* $Id: gtkdatabox.h 3 2008-06-22 08:45:45Z rbock $ */
2 /* GtkDatabox - An extension to the gtk+ library
3  * Copyright (C) 1998 - 2008 Dr. Roland Bock
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public License
7  * as published by the Free Software Foundation; either version 2.1
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #ifndef __GTK_DATABOX_H__
21 #define __GTK_DATABOX_H__
22 
23 #include <gtkdatabox_typedefs.h>
24 #include <gtkdatabox_graph.h>
25 #include <gtkdatabox_ruler.h>
26 #include <gtkdatabox_scale.h>
27 #include <gtk/gtk.h>
28 
29 /**
30  * SECTION:gtkdatabox
31  * @short_description: A GTK+ widget to display large amounts of numerical data quickly and easily.
32  * @include: gtkdatabox.h
33  * @see_also: #GtkDataboxGraph, #GtkDataboxPoints, #GtkDataboxLines, #GtkDataboxMarkers, #GtkDataboxGrid
34  *
35  * #GtkDatabox is a widget for the GTK+ library designed to display
36  * large amounts of numerical data quickly and easily. It allows
37  * for one or more data sets of thousands of data points (X and Y coordinates)
38  * to be displayed and updated in split seconds.
39  *
40  * It offers the ability to zoom into and out of the data, and to navigate
41  * through your data by scrolling.
42  *
43  * In addition to rulers and a simple
44  * coordinate cross, it allows you to add one (or even more) configurable grids
45  * like on an oscilloscope.
46  *
47  * Data may be presented as dots, lines connecting the data,
48  * or vertical bars. The widget allows you to easily transform pixel
49  * coordinates into data coordinates, thus allowing you to easily create
50  * powerful applications for data analysis.
51  *
52  **/
53 
54 G_BEGIN_DECLS
55 #define GTK_TYPE_DATABOX (gtk_databox_get_type ())
56 #define GTK_DATABOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
57  GTK_TYPE_DATABOX, \
58  GtkDatabox))
59 #define GTK_DATABOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
60  GTK_TYPE_DATABOX, \
61  GtkDataboxClass))
62 #define GTK_IS_DATABOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
63  GTK_TYPE_DATABOX))
64 #define GTK_IS_DATABOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
65  GTK_TYPE_DATABOX))
66 #define GTK_DATABOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
67  GTK_TYPE_DATABOX, \
68  GtkDataboxClass))
69 
70 typedef struct
71 {
72  gfloat x1;
73  gfloat x2;
74  gfloat y1;
75  gfloat y2;
77 
78 /**
79  * _GtkDatabox
80  * @box: The parent object
81  *
82  * Implementation of #GtkDatabox.
83  *
84  **/
86 {
87  /*< private >*/
88  GtkWidget box;
89 };
90 
91 typedef struct _GtkDataboxClass GtkDataboxClass;
92 
94 {
95  GtkWidgetClass parent_class;
96 
97  void (*zoomed) (GtkDatabox * box);
98  void (*selection_started) (GtkDatabox * box,
99  GtkDataboxValueRectangle * selectionValues);
101  GtkDataboxValueRectangle * selectionValues);
104  selectionValues);
106 };
107 
108 GType gtk_databox_get_type (void);
109 
110 GtkWidget *gtk_databox_new (void);
111 
112 GList * gtk_databox_get_graphs (GtkDatabox *box);
113 
114 gint gtk_databox_graph_add (GtkDatabox * box, GtkDataboxGraph * graph);
116 
119 
120 gint gtk_databox_auto_rescale (GtkDatabox * box, gfloat border);
122  gfloat * min_x, gfloat * max_x,
123  gfloat * min_y, gfloat * max_y);
124 
126  gfloat left, gfloat right,
127  gfloat top, gfloat bottom);
129  gfloat left, gfloat right,
130  gfloat top, gfloat bottom);
132  gfloat * left, gfloat * right,
133  gfloat * top, gfloat * bottom);
135  gfloat * left, gfloat * right,
136  gfloat * top, gfloat * bottom);
137 
138 void gtk_databox_set_adjustment_x (GtkDatabox * box, GtkAdjustment * adj);
139 void gtk_databox_set_adjustment_y (GtkDatabox * box, GtkAdjustment * adj);
140 GtkAdjustment *gtk_databox_get_adjustment_x (GtkDatabox * box);
141 GtkAdjustment *gtk_databox_get_adjustment_y (GtkDatabox * box);
142 
147 
149  GtkDataboxScaleType scale_type);
151  GtkDataboxScaleType scale_type);
154 
155 void gtk_databox_set_enable_selection (GtkDatabox * box, gboolean enable);
156 void gtk_databox_set_enable_zoom (GtkDatabox * box, gboolean enable);
157 void gtk_databox_set_box_shadow(GtkDatabox * box, GtkShadowType which_shadow);
158 void gtk_databox_set_bg_color (GtkDatabox * box, gchar *bg_color);
159 
161 gboolean gtk_databox_get_enable_zoom (GtkDatabox * box);
162 GtkShadowType gtk_databox_get_box_shadow(GtkDatabox * box);
163 
165 void gtk_databox_zoom_out (GtkDatabox * box);
166 void gtk_databox_zoom_home (GtkDatabox * box);
167 
168 gint16 gtk_databox_value_to_pixel_x (GtkDatabox * box, gfloat value);
169 gint16 gtk_databox_value_to_pixel_y (GtkDatabox * box, gfloat value);
170 gfloat gtk_databox_pixel_to_value_x (GtkDatabox * box, gint16 pixel);
171 gfloat gtk_databox_pixel_to_value_y (GtkDatabox * box, gint16 pixel);
172 void gtk_databox_values_to_xpixels (GtkDatabox *box, gint16 *pixels,
173  void *values, GType vtype, guint maxlen, guint start, guint stride, guint len);
174 void gtk_databox_values_to_ypixels (GtkDatabox *box, gint16 *pixels,
175  void *values, GType vtype, guint maxlen, guint start, guint stride, guint len);
176 
178  GtkWidget **p_grid,
179  gboolean scrollbar_x,
180  gboolean scrollbar_y,
181  gboolean ruler_x,
182  gboolean ruler_y);
183 
184 void
186  GtkWidget ** p_grid,
187  gboolean scrollbar_x,
188  gboolean scrollbar_y,
189  gboolean ruler_x,
190  gboolean ruler_y,
191  gboolean ruler_x_top,
192  gboolean ruler_y_left);
193 
194 /* Used by graph objects */
195 cairo_surface_t* gtk_databox_get_backing_surface(GtkDatabox * box);
196 
197 G_END_DECLS
198 #endif /* __GTK_DATABOX_H__ */
gint gtk_databox_graph_add(GtkDatabox *box, GtkDataboxGraph *graph)
Definition: gtkdatabox.c:2091
void gtk_databox_set_ruler_x(GtkDatabox *box, GtkDataboxRuler *ruler)
Definition: gtkdatabox.c:848
gfloat gtk_databox_pixel_to_value_x(GtkDatabox *box, gint16 pixel)
Definition: gtkdatabox.c:2374
void gtk_databox_set_adjustment_x(GtkDatabox *box, GtkAdjustment *adj)
Definition: gtkdatabox.c:742
void gtk_databox_set_enable_selection(GtkDatabox *box, gboolean enable)
Definition: gtkdatabox.c:702
void gtk_databox_set_scale_type_y(GtkDatabox *box, GtkDataboxScaleType scale_type)
Definition: gtkdatabox.c:943
void gtk_databox_get_total_limits(GtkDatabox *box, gfloat *left, gfloat *right, gfloat *top, gfloat *bottom)
Definition: gtkdatabox.c:2033
GtkDataboxRuler * gtk_databox_get_ruler_x(GtkDatabox *box)
Definition: gtkdatabox.c:1050
void gtk_databox_zoom_home(GtkDatabox *box)
Definition: gtkdatabox.c:1613
GType gtk_databox_get_type(void)
GtkDataboxRuler * gtk_databox_get_ruler_y(GtkDatabox *box)
Definition: gtkdatabox.c:1066
void gtk_databox_get_visible_limits(GtkDatabox *box, gfloat *left, gfloat *right, gfloat *top, gfloat *bottom)
Definition: gtkdatabox.c:2062
gfloat gtk_databox_pixel_to_value_y(GtkDatabox *box, gint16 pixel)
Definition: gtkdatabox.c:2403
void gtk_databox_zoom_out(GtkDatabox *box)
Definition: gtkdatabox.c:1575
GtkShadowType gtk_databox_get_box_shadow(GtkDatabox *box)
Definition: gtkdatabox.c:1111
gint16 gtk_databox_value_to_pixel_x(GtkDatabox *box, gfloat value)
Definition: gtkdatabox.c:2179
GtkAdjustment * gtk_databox_get_adjustment_y(GtkDatabox *box)
Definition: gtkdatabox.c:1034
GtkDataboxScaleType gtk_databox_get_scale_type_y(GtkDatabox *box)
Definition: gtkdatabox.c:1097
gint gtk_databox_auto_rescale(GtkDatabox *box, gfloat border)
Definition: gtkdatabox.c:1700
void gtk_databox_values_to_xpixels(GtkDatabox *box, gint16 *pixels, void *values, GType vtype, guint maxlen, guint start, guint stride, guint len)
Definition: gtkdatabox.c:2236
void gtk_databox_set_ruler_y(GtkDatabox *box, GtkDataboxRuler *ruler)
Definition: gtkdatabox.c:885
cairo_surface_t * gtk_databox_get_backing_surface(GtkDatabox *box)
Definition: gtkdatabox.c:1229
void gtk_databox_create_box_with_scrollbars_and_rulers_positioned(GtkWidget **p_box, GtkWidget **p_grid, gboolean scrollbar_x, gboolean scrollbar_y, gboolean ruler_x, gboolean ruler_y, gboolean ruler_x_top, gboolean ruler_y_left)
Definition: gtkdatabox.c:2477
GList * gtk_databox_get_graphs(GtkDatabox *box)
Definition: gtkdatabox.c:474
GtkAdjustment * gtk_databox_get_adjustment_x(GtkDatabox *box)
Definition: gtkdatabox.c:1018
void gtk_databox_set_bg_color(GtkDatabox *box, gchar *bg_color)
Definition: gtkdatabox.c:1127
void gtk_databox_set_total_limits(GtkDatabox *box, gfloat left, gfloat right, gfloat top, gfloat bottom)
Definition: gtkdatabox.c:1876
void gtk_databox_set_scale_type_x(GtkDatabox *box, GtkDataboxScaleType scale_type)
Definition: gtkdatabox.c:923
gint gtk_databox_graph_add_front(GtkDatabox *box, GtkDataboxGraph *graph)
Definition: gtkdatabox.c:2113
void gtk_databox_set_box_shadow(GtkDatabox *box, GtkShadowType which_shadow)
Definition: gtkdatabox.c:962
void gtk_databox_set_adjustment_y(GtkDatabox *box, GtkAdjustment *adj)
Definition: gtkdatabox.c:796
gboolean gtk_databox_get_enable_selection(GtkDatabox *box)
Definition: gtkdatabox.c:986
void gtk_databox_set_enable_zoom(GtkDatabox *box, gboolean enable)
Definition: gtkdatabox.c:723
GtkDataboxScaleType gtk_databox_get_scale_type_x(GtkDatabox *box)
Definition: gtkdatabox.c:1082
gint gtk_databox_graph_remove(GtkDatabox *box, GtkDataboxGraph *graph)
Definition: gtkdatabox.c:2135
gint gtk_databox_calculate_extrema(GtkDatabox *box, gfloat *min_x, gfloat *max_x, gfloat *min_y, gfloat *max_y)
Definition: gtkdatabox.c:1745
GtkWidget * gtk_databox_new(void)
Definition: gtkdatabox.c:461
void gtk_databox_create_box_with_scrollbars_and_rulers(GtkWidget **p_box, GtkWidget **p_grid, gboolean scrollbar_x, gboolean scrollbar_y, gboolean ruler_x, gboolean ruler_y)
Definition: gtkdatabox.c:2443
gint gtk_databox_graph_remove_all(GtkDatabox *box)
Definition: gtkdatabox.c:2158
void gtk_databox_values_to_ypixels(GtkDatabox *box, gint16 *pixels, void *values, GType vtype, guint maxlen, guint start, guint stride, guint len)
Definition: gtkdatabox.c:2308
gint16 gtk_databox_value_to_pixel_y(GtkDatabox *box, gfloat value)
Definition: gtkdatabox.c:2205
gboolean gtk_databox_get_enable_zoom(GtkDatabox *box)
Definition: gtkdatabox.c:1002
void gtk_databox_set_visible_limits(GtkDatabox *box, gfloat left, gfloat right, gfloat top, gfloat bottom)
Definition: gtkdatabox.c:1912
void gtk_databox_zoom_to_selection(GtkDatabox *box)
Definition: gtkdatabox.c:1492
GtkDataboxScaleType
typedefG_BEGIN_DECLS struct _GtkDatabox GtkDatabox
void(* selection_started)(GtkDatabox *box, GtkDataboxValueRectangle *selectionValues)
Definition: gtkdatabox.h:98
void(* selection_canceled)(GtkDatabox *box)
Definition: gtkdatabox.h:105
void(* zoomed)(GtkDatabox *box)
Definition: gtkdatabox.h:97
void(* selection_finalized)(GtkDatabox *box, GtkDataboxValueRectangle *selectionValues)
Definition: gtkdatabox.h:102
GtkWidgetClass parent_class
Definition: gtkdatabox.h:95
void(* selection_changed)(GtkDatabox *box, GtkDataboxValueRectangle *selectionValues)
Definition: gtkdatabox.h:100
GtkWidget box
Definition: gtkdatabox.h:88