GtkDatabox
A set of GTK+ widgets to display large amounts of numerical data quickly and easily.
|
00001 /* $Id: gtkdatabox_graph.h 4 2008-06-22 09:19:11Z rbock $ */ 00002 /* GtkDatabox - An extension to the gtk+ library 00003 * Copyright (C) 1998 - 2008 Dr. Roland Bock 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public License 00007 * as published by the Free Software Foundation; either version 2.1 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 */ 00019 00034 #ifndef __GTK_DATABOX_GRAPH_H__ 00035 #define __GTK_DATABOX_GRAPH_H__ 00036 00037 #include <gtk/gtkstyle.h> 00038 #include <gdk/gdk.h> 00039 #include <pango/pango.h> 00040 #include <gtkdatabox.h> 00041 00042 G_BEGIN_DECLS 00043 #define GTK_DATABOX_TYPE_GRAPH (gtk_databox_graph_get_type ()) 00044 #define GTK_DATABOX_GRAPH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ 00045 GTK_DATABOX_TYPE_GRAPH, \ 00046 GtkDataboxGraph)) 00047 #define GTK_DATABOX_GRAPH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \ 00048 GTK_DATABOX_TYPE_GRAPH, \ 00049 GtkDataboxGraphClass)) 00050 #define GTK_DATABOX_IS_GRAPH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ 00051 GTK_DATABOX_TYPE_GRAPH)) 00052 #define GTK_DATABOX_IS_GRAPH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ 00053 GTK_DATABOX_TYPE_GRAPH)) 00054 #define GTK_DATABOX_GRAPH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \ 00055 GTK_DATABOX_TYPE_GRAPH, \ 00056 GtkDataboxGraphClass)) 00057 00058 typedef struct _GtkDataboxGraphClass GtkDataboxGraphClass; 00059 00067 typedef struct _GtkDataboxGraphPrivate GtkDataboxGraphPrivate; 00068 00077 struct _GtkDataboxGraph 00078 { 00079 /*< private >*/ 00080 GObject parent; 00081 00082 GtkDataboxGraphPrivate *priv; 00083 }; 00084 00085 struct _GtkDataboxGraphClass 00086 { 00087 GObjectClass parent_class; 00088 00089 /* 00090 * public virtual drawing function 00091 */ 00092 void (*draw) (GtkDataboxGraph * graph, GtkDatabox * box); 00093 00094 gint (*calculate_extrema) (GtkDataboxGraph * graph, 00095 gfloat * min_x, gfloat * max_x, 00096 gfloat * min_y, gfloat * max_y); 00097 GdkGC* (*create_gc) (GtkDataboxGraph * graph, GtkDatabox * box); 00098 }; 00099 00100 GType gtk_databox_graph_get_type (void); 00101 00102 GdkGC* gtk_databox_graph_get_gc (GtkDataboxGraph * graph); 00103 void gtk_databox_graph_set_gc (GtkDataboxGraph * graph, GdkGC *gc); 00104 00105 void gtk_databox_graph_set_hide (GtkDataboxGraph * graph, gboolean hide); 00106 gboolean gtk_databox_graph_get_hide (GtkDataboxGraph * graph); 00107 00108 void gtk_databox_graph_set_color (GtkDataboxGraph * graph, 00109 GdkColor * color); 00110 GdkColor *gtk_databox_graph_get_color (GtkDataboxGraph * graph); 00111 00112 void gtk_databox_graph_set_size (GtkDataboxGraph * graph, gint size); 00113 gint gtk_databox_graph_get_size (GtkDataboxGraph * graph); 00114 00115 gint gtk_databox_graph_calculate_extrema (GtkDataboxGraph * graph, 00116 gfloat * min_x, gfloat * max_x, 00117 gfloat * min_y, gfloat * max_y); 00118 /* This function is called by GtkDatabox */ 00119 void gtk_databox_graph_draw (GtkDataboxGraph * graph, GtkDatabox * box); 00120 00121 /* This function is called by derived graph classes */ 00122 GdkGC* gtk_databox_graph_create_gc (GtkDataboxGraph * graph, GtkDatabox * box); 00123 00124 G_END_DECLS 00125 #endif /* __GTK_DATABOX_GRAPH_H__ */