"Fossies" - the Fresh Open Source Software Archive

Member "gtkdatabox-1.0.0/gtk/gtkdatabox_graph.h" (31 Mar 2021, 4402 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_graph.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_graph.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_graph
   22  * @short_description: An abstract anchestor for all "real" graphs.
   23  * @include: gtkdatabox_graph.h
   24  * @see_also: #GtkDatabox, #GtkDataboxPoints, #GtkDataboxLines, #GtkDataboxBars, #GtkDataboxGrid, #GtkDataboxCrossSimple
   25  *
   26  * GtkDataboxGraphs can display data or other things in a #GtkDatabox widget.
   27  *
   28  * This class is just the basic interface. Other graph classes are derived from this
   29  * class and implement some real things.
   30  *
   31  */
   32 
   33 
   34 #ifndef __GTK_DATABOX_GRAPH_H__
   35 #define __GTK_DATABOX_GRAPH_H__
   36 
   37 #include <gdk/gdk.h>
   38 #include <pango/pango.h>
   39 #include <gtkdatabox.h>
   40 
   41 G_BEGIN_DECLS
   42 #define GTK_DATABOX_TYPE_GRAPH        (gtk_databox_graph_get_type ())
   43 #define GTK_DATABOX_GRAPH(obj)        (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
   44                                            GTK_DATABOX_TYPE_GRAPH, \
   45                                            GtkDataboxGraph))
   46 #define GTK_DATABOX_GRAPH_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), \
   47                                            GTK_DATABOX_TYPE_GRAPH, \
   48                                            GtkDataboxGraphClass))
   49 #define GTK_DATABOX_IS_GRAPH(obj)     (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
   50                                            GTK_DATABOX_TYPE_GRAPH))
   51 #define GTK_DATABOX_IS_GRAPH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
   52                                            GTK_DATABOX_TYPE_GRAPH))
   53 #define GTK_DATABOX_GRAPH_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), \
   54                                            GTK_DATABOX_TYPE_GRAPH, \
   55                                            GtkDataboxGraphClass))
   56 
   57 /**
   58  * GtkDataboxGraphClass
   59  *
   60  * The object class of #GtkDataboxGraph.
   61  *
   62  **/
   63    typedef struct _GtkDataboxGraphClass GtkDataboxGraphClass;
   64 
   65    struct _GtkDataboxGraphClass
   66    {
   67       GObjectClass parent_class;
   68 
   69       /*
   70        * public virtual drawing function
   71        */
   72       void (*draw) (GtkDataboxGraph * graph, GtkDatabox * box);
   73 
   74       gint (*calculate_extrema) (GtkDataboxGraph * graph,
   75                                  gfloat * min_x, gfloat * max_x,
   76                  gfloat * min_y, gfloat * max_y);
   77       cairo_t* (*create_gc) (GtkDataboxGraph * graph, GtkDatabox * box);
   78    };
   79 
   80    /**
   81     * _GtkDataboxGraph
   82     * @parent: the parent object
   83     *
   84     * Implementation of #GtkDataboxGraph
   85     *
   86     **/
   87    struct _GtkDataboxGraph
   88    {
   89       /*< private >*/
   90       GObject parent;
   91    };
   92 
   93 
   94    GType gtk_databox_graph_get_type (void);
   95 
   96    void gtk_databox_graph_set_hide (GtkDataboxGraph * graph, gboolean hide);
   97    gboolean gtk_databox_graph_get_hide (GtkDataboxGraph * graph);
   98 
   99    void gtk_databox_graph_set_color (GtkDataboxGraph * graph,
  100                      GdkRGBA * color);
  101    GdkRGBA *gtk_databox_graph_get_color (GtkDataboxGraph * graph);
  102 
  103    void gtk_databox_graph_set_rgba (GtkDataboxGraph * graph,
  104                      GdkRGBA * rgba);
  105    GdkRGBA *gtk_databox_graph_get_rgba (GtkDataboxGraph * graph);
  106 
  107    void gtk_databox_graph_set_size (GtkDataboxGraph * graph, gint size);
  108    gint gtk_databox_graph_get_size (GtkDataboxGraph * graph);
  109 
  110    gint gtk_databox_graph_calculate_extrema (GtkDataboxGraph * graph,
  111                          gfloat * min_x, gfloat * max_x,
  112                          gfloat * min_y, gfloat * max_y);
  113    /* This function is called by GtkDatabox */
  114    void gtk_databox_graph_draw (GtkDataboxGraph * graph, GtkDatabox * box);
  115 
  116    /* This function is called by derived graph classes */
  117    cairo_t* gtk_databox_graph_create_gc (GtkDataboxGraph * graph, GtkDatabox * box);
  118 
  119 G_END_DECLS
  120 #endif              /* __GTK_DATABOX_GRAPH_H__ */