1 /* $Id: gtkdatabox_grid.h 4 2008-06-22 09:19:11Z 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 /** 21 * SECTION:gtkdatabox_grid 22 * @short_description: A #GtkDataboxGraph used for displaying a grid (like in an oscilloscope). 23 * @include: gtkdatabox_grid.h 24 * @see_also: #GtkDatabox, #GtkDataboxGraph, #GtkDataboxPoints, #GtkDataboxLines, #GtkDataboxBars, #GtkDataboxMarkers 25 * 26 * #GtkDataboxGrid is a #GtkDataboxGraph class for displaying a grid (like in an oscilloscope). You can determine 27 * the number of horizontal and vertical lines. When you zoom in, the grid is also zoomed along with the data. 28 * 29 */ 30 31 #ifndef __GTK_DATABOX_GRID_H__ 32 #define __GTK_DATABOX_GRID_H__ 33 34 #include <gtkdatabox_graph.h> 35 36 G_BEGIN_DECLS 37 #define GTK_DATABOX_TYPE_GRID (gtk_databox_grid_get_type ()) 38 #define GTK_DATABOX_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ 39 GTK_DATABOX_TYPE_GRID, \ 40 GtkDataboxGrid)) 41 #define GTK_DATABOX_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \ 42 GTK_DATABOX_TYPE_GRID, \ 43 GtkDataboxGridClass)) 44 #define GTK_DATABOX_IS_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ 45 GTK_DATABOX_TYPE_GRID)) 46 #define GTK_DATABOX_IS_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ 47 GTK_DATABOX_TYPE_GRID)) 48 #define GTK_DATABOX_GRID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \ 49 GTK_DATABOX_TYPE_GRID, \ 50 GtkDataboxGridClass)) 51 #define GTK_DATABOX_GRID_GET_PRIVATE(obj) \ 52 G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_DATABOX_TYPE_GRID, \ 53 GtkDataboxGridPrivate) 54 55 /** 56 * GtkDataboxGrid 57 * 58 * #GtkDataboxGrid is a #GtkDataboxGraph class for displaying a grid (like in an oscilloscope). You can determine 59 * the number of horizontal and vertical lines. When you zoom in, the grid is also zoomed along with the data. 60 * 61 */ 62 63 typedef struct _GtkDataboxGrid GtkDataboxGrid; 64 65 typedef struct _GtkDataboxGridClass GtkDataboxGridClass; 66 67 typedef enum 68 { 69 GTK_DATABOX_GRID_DASHED_LINES = 0, /* Grid drawn with dashed lines */ 70 GTK_DATABOX_GRID_SOLID_LINES, /* Grid drawn with solid lines */ 71 GTK_DATABOX_GRID_DOTTED_LINES /* Grid drawn with dotted lines */ 72 } 73 GtkDataboxGridLineStyle; 74 75 struct _GtkDataboxGrid 76 { 77 GtkDataboxGraph parent; 78 }; 79 80 struct _GtkDataboxGridClass 81 { 82 GtkDataboxGraphClass parent_class; 83 }; 84 85 GType gtk_databox_grid_get_type (void); 86 87 GtkDataboxGraph *gtk_databox_grid_new (gint hlines, gint vlines, 88 GdkRGBA * color, guint size); 89 GtkDataboxGraph *gtk_databox_grid_array_new (gint hlines, gint vlines, gfloat *hline_vals, gfloat *vline_vals, 90 GdkRGBA * color, guint size); 91 92 void gtk_databox_grid_set_hlines (GtkDataboxGrid * grid, gint hlines); 93 gint gtk_databox_grid_get_hlines (GtkDataboxGrid * grid); 94 95 void gtk_databox_grid_set_vlines (GtkDataboxGrid * grid, gint vlines); 96 gint gtk_databox_grid_get_vlines (GtkDataboxGrid * grid); 97 98 void gtk_databox_grid_set_hline_vals (GtkDataboxGrid * grid, gfloat* hline_vals); 99 gfloat* gtk_databox_grid_get_hline_vals (GtkDataboxGrid * grid); 100 101 void gtk_databox_grid_set_vline_vals (GtkDataboxGrid * grid, gfloat* vline_vals); 102 gfloat* gtk_databox_grid_get_vline_vals (GtkDataboxGrid * grid); 103 104 void gtk_databox_grid_set_line_style (GtkDataboxGrid *grid, gint line_style); 105 gint gtk_databox_grid_get_line_style (GtkDataboxGrid *grid); 106 107 G_END_DECLS 108 #endif /* __GTK_DATABOX_GRID_H__ */ 109