GtkDatabox A set of GTK+ widgets to display large amounts of numerical data quickly and easily.

- Main Page
- Data Structures
- Files

- File List
- Globals

gtk/gtkdatabox.h
Go to the documentation of this file.

    00001 /* $Id: gtkdatabox.h 3 2008-06-22 08:45:45Z 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
    00020 #ifndef __GTK_DATABOX_H__
    00021 #define __GTK_DATABOX_H__
    00022
    00023 #include <gtkdatabox_typedefs.h>
    00024 #include <gtkdatabox_graph.h>
    00025 #include <gtkdatabox_ruler.h>
    00026 #include <gtk/gtkwidget.h>
    00027 #include <gtk/gtkadjustment.h>
    00028
    00054 G_BEGIN_DECLS
    00055 #define GTK_TYPE_DATABOX                  (gtk_databox_get_type ())
    00056 #define GTK_DATABOX(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
    00057                                            GTK_TYPE_DATABOX, \
    00058                                            GtkDatabox))
    00059 #define GTK_DATABOX_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), \
    00060                                            GTK_TYPE_DATABOX, \
    00061                                            GtkDataboxClass))
    00062 #define GTK_IS_DATABOX(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
    00063                                            GTK_TYPE_DATABOX))
    00064 #define GTK_IS_DATABOX_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), \
    00065                                            GTK_TYPE_DATABOX))
    00066 #define GTK_DATABOX_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), \
    00067                                            GTK_TYPE_DATABOX, \
    00068                                            GtkDataboxClass))
    00069
    00070
    00071 typedef struct _GtkDataboxClass GtkDataboxClass;
    00072
    00080 typedef struct _GtkDataboxPrivate GtkDataboxPrivate;
    00081
    00082 typedef struct
    00083 {
    00084     gfloat x1;
    00085     gfloat x2;
    00086     gfloat y1;
    00087     gfloat y2;
    00088 } GtkDataboxValueRectangle;
    00089
    00098 struct _GtkDatabox
    00099 {
    00100     /*< private >*/
    00101     GtkWidget box;
    00102
    00103     GtkDataboxPrivate *priv;
    00104 };
    00105
    00106 struct _GtkDataboxClass
    00107 {
    00108     GtkWidgetClass parent_class;
    00109
    00110     void (*zoomed) (GtkDatabox * box);
    00111     void (*selection_started) (GtkDatabox * box,
    00112                                GtkDataboxValueRectangle * selectionValues);
    00113     void (*selection_changed) (GtkDatabox * box,
    00114                                GtkDataboxValueRectangle * selectionValues);
    00115     void (*selection_finalized) (GtkDatabox * box,
    00116                                  GtkDataboxValueRectangle *
    00117                                  selectionValues);
    00118     void (*selection_canceled) (GtkDatabox * box);
    00119 };
    00120
    00121 GType gtk_databox_get_type (void);
    00122
    00123 GtkWidget *gtk_databox_new (void);
    00124
    00125 gint gtk_databox_graph_add (GtkDatabox * box, GtkDataboxGraph * graph);
    00126 gint gtk_databox_graph_add_front (GtkDatabox * box, GtkDataboxGraph * graph);
    00127
    00128 gint gtk_databox_graph_remove (GtkDatabox * box, GtkDataboxGraph * graph);
    00129 gint gtk_databox_graph_remove_all (GtkDatabox * box);
    00130
    00131 gint gtk_databox_auto_rescale (GtkDatabox * box, gfloat border);
    00132 gint gtk_databox_calculate_extrema (GtkDatabox * box,
    00133                                     gfloat * min_x, gfloat * max_x,
    00134                                     gfloat * min_y, gfloat * max_y);
    00135
    00136 void gtk_databox_set_total_limits (GtkDatabox * box,
    00137                                    gfloat left, gfloat right,
    00138                                    gfloat top, gfloat bottom);
    00139 void gtk_databox_set_visible_limits (GtkDatabox * box,
    00140                                      gfloat left, gfloat right,
    00141                                      gfloat top, gfloat bottom);
    00142 void gtk_databox_get_total_limits (GtkDatabox * box,
    00143                                    gfloat * left, gfloat * right,
    00144                                    gfloat * top, gfloat * bottom);
    00145 void gtk_databox_get_visible_limits (GtkDatabox * box,
    00146                                      gfloat * left, gfloat * right,
    00147                                      gfloat * top, gfloat * bottom);
    00148
    00149 void gtk_databox_set_adjustment_x (GtkDatabox * box, GtkAdjustment * adj);
    00150 void gtk_databox_set_adjustment_y (GtkDatabox * box, GtkAdjustment * adj);
    00151 GtkAdjustment *gtk_databox_get_adjustment_x (GtkDatabox * box);
    00152 GtkAdjustment *gtk_databox_get_adjustment_y (GtkDatabox * box);
    00153
    00154 void gtk_databox_set_ruler_x (GtkDatabox * box, GtkDataboxRuler * ruler);
    00155 void gtk_databox_set_ruler_y (GtkDatabox * box, GtkDataboxRuler * ruler);
    00156 GtkDataboxRuler *gtk_databox_get_ruler_x (GtkDatabox * box);
    00157 GtkDataboxRuler *gtk_databox_get_ruler_y (GtkDatabox * box);
    00158
    00159 void gtk_databox_set_scale_type_x (GtkDatabox * box,
    00160                                    GtkDataboxScaleType scale_type);
    00161 void gtk_databox_set_scale_type_y (GtkDatabox * box,
    00162                                    GtkDataboxScaleType scale_type);
    00163 GtkDataboxScaleType gtk_databox_get_scale_type_x (GtkDatabox * box);
    00164 GtkDataboxScaleType gtk_databox_get_scale_type_y (GtkDatabox * box);
    00165
    00166 void gtk_databox_set_enable_selection (GtkDatabox * box, gboolean enable);
    00167 void gtk_databox_set_enable_zoom (GtkDatabox * box, gboolean enable);
    00168 void gtk_databox_set_box_shadow(GtkDatabox * box, GtkShadowType which_shadow);
    00169
    00170 gboolean gtk_databox_get_enable_selection (GtkDatabox * box);
    00171 gboolean gtk_databox_get_enable_zoom (GtkDatabox * box);
    00172 GtkShadowType gtk_databox__get_box_shadow(GtkDatabox * box);
    00173
    00174 void gtk_databox_zoom_to_selection (GtkDatabox * box);
    00175 void gtk_databox_zoom_out (GtkDatabox * box);
    00176 void gtk_databox_zoom_home (GtkDatabox * box);
    00177
    00178 gint16 gtk_databox_value_to_pixel_x (GtkDatabox * box, gfloat value);
    00179 gint16 gtk_databox_value_to_pixel_y (GtkDatabox * box, gfloat value);
    00180 gfloat gtk_databox_pixel_to_value_x (GtkDatabox * box, gint16 pixel);
    00181 gfloat gtk_databox_pixel_to_value_y (GtkDatabox * box, gint16 pixel);
    00182 void gtk_databox_values_to_pixels (GtkDatabox * box,
    00183                                    guint len,
    00184                                    const gfloat * values_x,
    00185                                    const gfloat * values_y,
    00186                                    GdkPoint * pixels);
    00187
    00188 void gtk_databox_create_box_with_scrollbars_and_rulers (GtkWidget **
    00189         p_box,
    00190         GtkWidget **
    00191         p_table,
    00192         gboolean scrollbar_x,
    00193         gboolean scrollbar_y,
    00194         gboolean ruler_x,
    00195         gboolean ruler_y);
    00196
    00197 void
    00198 gtk_databox_create_box_with_scrollbars_and_rulers_positioned (GtkWidget ** p_box,
    00199         GtkWidget ** p_table,
    00200         gboolean scrollbar_x,
    00201         gboolean scrollbar_y,
    00202         gboolean ruler_x,
    00203         gboolean ruler_y,
    00204         gboolean ruler_x_top,
    00205         gboolean ruler_y_left);
    00206
    00207 /* Used by graph objects */
    00208 GdkPixmap* gtk_databox_get_backing_pixmap(GtkDatabox * box);
    00209
    00210 G_END_DECLS
    00211 #endif                          /* __GTK_DATABOX_H__ */

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines