"Fossies" - the Fresh Open Source Software Archive

Member "gtkdatabox-1.0.0/gtk/gtkdatabox.h" (31 Mar 2021, 8150 Bytes) of package /linux/privat/gtkdatabox-1.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "gtkdatabox.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 0.9.3.1_vs_1.0.0.

    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;
   76 } GtkDataboxValueRectangle;
   77 
   78 /**
   79  * _GtkDatabox
   80  * @box: The parent object
   81  *
   82  * Implementation of #GtkDatabox.
   83  *
   84  **/
   85 struct _GtkDatabox
   86 {
   87     /*< private >*/
   88     GtkWidget box;
   89 };
   90 
   91 typedef struct _GtkDataboxClass GtkDataboxClass;
   92 
   93 struct _GtkDataboxClass
   94 {
   95     GtkWidgetClass parent_class;
   96 
   97     void (*zoomed) (GtkDatabox * box);
   98     void (*selection_started) (GtkDatabox * box,
   99                                GtkDataboxValueRectangle * selectionValues);
  100     void (*selection_changed) (GtkDatabox * box,
  101                                GtkDataboxValueRectangle * selectionValues);
  102     void (*selection_finalized) (GtkDatabox * box,
  103                                  GtkDataboxValueRectangle *
  104                                  selectionValues);
  105     void (*selection_canceled) (GtkDatabox * box);
  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);
  115 gint gtk_databox_graph_add_front (GtkDatabox * box, GtkDataboxGraph * graph);
  116 
  117 gint gtk_databox_graph_remove (GtkDatabox * box, GtkDataboxGraph * graph);
  118 gint gtk_databox_graph_remove_all (GtkDatabox * box);
  119 
  120 gint gtk_databox_auto_rescale (GtkDatabox * box, gfloat border);
  121 gint gtk_databox_calculate_extrema (GtkDatabox * box,
  122                                     gfloat * min_x, gfloat * max_x,
  123                                     gfloat * min_y, gfloat * max_y);
  124 
  125 void gtk_databox_set_total_limits (GtkDatabox * box,
  126                                    gfloat left, gfloat right,
  127                                    gfloat top, gfloat bottom);
  128 void gtk_databox_set_visible_limits (GtkDatabox * box,
  129                                      gfloat left, gfloat right,
  130                                      gfloat top, gfloat bottom);
  131 void gtk_databox_get_total_limits (GtkDatabox * box,
  132                                    gfloat * left, gfloat * right,
  133                                    gfloat * top, gfloat * bottom);
  134 void gtk_databox_get_visible_limits (GtkDatabox * box,
  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 
  143 void gtk_databox_set_ruler_x (GtkDatabox * box, GtkDataboxRuler * ruler);
  144 void gtk_databox_set_ruler_y (GtkDatabox * box, GtkDataboxRuler * ruler);
  145 GtkDataboxRuler *gtk_databox_get_ruler_x (GtkDatabox * box);
  146 GtkDataboxRuler *gtk_databox_get_ruler_y (GtkDatabox * box);
  147 
  148 void gtk_databox_set_scale_type_x (GtkDatabox * box,
  149                                    GtkDataboxScaleType scale_type);
  150 void gtk_databox_set_scale_type_y (GtkDatabox * box,
  151                                    GtkDataboxScaleType scale_type);
  152 GtkDataboxScaleType gtk_databox_get_scale_type_x (GtkDatabox * box);
  153 GtkDataboxScaleType gtk_databox_get_scale_type_y (GtkDatabox * box);
  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 
  160 gboolean gtk_databox_get_enable_selection (GtkDatabox * box);
  161 gboolean gtk_databox_get_enable_zoom (GtkDatabox * box);
  162 GtkShadowType gtk_databox_get_box_shadow(GtkDatabox * box);
  163 
  164 void gtk_databox_zoom_to_selection (GtkDatabox * box);
  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 
  177 void gtk_databox_create_box_with_scrollbars_and_rulers (GtkWidget **p_box,
  178         GtkWidget **p_grid,
  179         gboolean scrollbar_x,
  180         gboolean scrollbar_y,
  181         gboolean ruler_x,
  182         gboolean ruler_y);
  183 
  184 void
  185 gtk_databox_create_box_with_scrollbars_and_rulers_positioned (GtkWidget ** p_box,
  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__ */