"Fossies" - the Fresh Open Source Software Archive

Member "gtkdatabox-1.0.0/gtk/gtkdatabox_markers.h" (31 Mar 2021, 6500 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_markers.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_markers.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_markers
   22  * @short_description: A #GtkDataboxGraph used for displaying labeled markers for xy-values.
   23  * @include: gtkdatabox_markers.h
   24  * @see_also: #GtkDatabox, #GtkDataboxGraph, #GtkDataboxPoints, #GtkDataboxLines,  #GtkDataboxBars
   25  *
   26  * #GtkDataboxMarkers is a #GtkDataboxGraph class for displaying labeled markers (circles, triangles, lines) for xy-values.
   27  *
   28  */
   29 
   30 #ifndef __GTK_DATABOX_MARKERS_H__
   31 #define __GTK_DATABOX_MARKERS_H__
   32 
   33 #include <gtkdatabox_xyc_graph.h>
   34 
   35 G_BEGIN_DECLS
   36 #define GTK_DATABOX_TYPE_MARKERS          (gtk_databox_markers_get_type ())
   37 #define GTK_DATABOX_MARKERS(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
   38                                            GTK_DATABOX_TYPE_MARKERS, \
   39                                            GtkDataboxMarkers))
   40 #define GTK_DATABOX_MARKERS_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), \
   41                                            GTK_DATABOX_TYPE_MARKERS, \
   42                                            GtkDataboxMarkersClass))
   43 #define GTK_DATABOX_IS_MARKERS(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
   44                                            GTK_DATABOX_TYPE_MARKERS))
   45 #define GTK_DATABOX_IS_MARKERS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
   46                                            GTK_DATABOX_TYPE_MARKERS))
   47 #define GTK_DATABOX_MARKERS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), \
   48                                            GTK_DATABOX_TYPE_MARKERS, \
   49                                            GtkDataboxMarkersClass))
   50 
   51 /**
   52  * GtkDataboxMarkers
   53  * 
   54  * #GtkDataboxMarkers is a #GtkDataboxGraph class for displaying labeled markers (circles, triangles, lines) for xy-values.
   55  *
   56  * @parent: The parent object 
   57  *
   58  */
   59    typedef struct _GtkDataboxMarkers GtkDataboxMarkers;
   60 
   61    /**
   62     * GtkDataboxMarkersClass
   63     *
   64     * The object class of #GtkDataboxMarkers.
   65     *
   66     **/
   67    typedef struct _GtkDataboxMarkersClass GtkDataboxMarkersClass;
   68 
   69    /**
   70     * GtkDataboxMarkersPosition:
   71     * @GTK_DATABOX_MARKERS_C: centered on data
   72     * @GTK_DATABOX_MARKERS_N: marker is positioned north of data
   73     * @GTK_DATABOX_MARKERS_E: marker is positioned east of data
   74     * @GTK_DATABOX_MARKERS_S: marker is positioned south of data
   75     * @GTK_DATABOX_MARKERS_W: marker is positioned west of data
   76     *
   77     * Position of a marker relative to its respective X/Y value.
   78     */
   79    typedef enum
   80    {
   81       GTK_DATABOX_MARKERS_C = 0,
   82       GTK_DATABOX_MARKERS_N,
   83       GTK_DATABOX_MARKERS_E,
   84       GTK_DATABOX_MARKERS_S,
   85       GTK_DATABOX_MARKERS_W
   86    }
   87    GtkDataboxMarkersPosition;
   88 
   89    /**
   90     * GtkDataboxMarkersTextPosition:
   91     * @GTK_DATABOX_MARKERS_TEXT_CENTER:   text centered   on marker
   92     * @GTK_DATABOX_MARKERS_TEXT_N:    text north      of marker
   93     * @GTK_DATABOX_MARKERS_TEXT_NE:   text north-east of marker
   94     * @GTK_DATABOX_MARKERS_TEXT_E:    text east       of marker
   95     * @GTK_DATABOX_MARKERS_TEXT_SE:   text south-east of marker
   96     * @GTK_DATABOX_MARKERS_TEXT_S:    text south      of marker
   97     * @GTK_DATABOX_MARKERS_TEXT_SW:   text south-west of marker
   98     * @GTK_DATABOX_MARKERS_TEXT_W:    text west       of marker
   99     * @GTK_DATABOX_MARKERS_TEXT_NW:       text north-west of marker
  100     *
  101     * Position of a label relative to its repective marker.
  102     */
  103    typedef enum
  104    {
  105       GTK_DATABOX_MARKERS_TEXT_CENTER = 0,/* text centered   on marker */
  106       GTK_DATABOX_MARKERS_TEXT_N,     /* text north      of marker */
  107       GTK_DATABOX_MARKERS_TEXT_NE,    /* text north-east of marker */
  108       GTK_DATABOX_MARKERS_TEXT_E,     /* text east       of marker */
  109       GTK_DATABOX_MARKERS_TEXT_SE,    /* text south-east of marker */
  110       GTK_DATABOX_MARKERS_TEXT_S,     /* text south      of marker */
  111       GTK_DATABOX_MARKERS_TEXT_SW,    /* text south-west of marker */
  112       GTK_DATABOX_MARKERS_TEXT_W,     /* text west       of marker */
  113       GTK_DATABOX_MARKERS_TEXT_NW     /* text north-west of marker */
  114    }
  115    GtkDataboxMarkersTextPosition;
  116 
  117    /**
  118     * GtkDataboxMarkersType:
  119     * @GTK_DATABOX_MARKERS_NONE:    No Marker (just text)
  120     * @GTK_DATABOX_MARKERS_TRIANGLE:    Marker is a triangle
  121     * @GTK_DATABOX_MARKERS_SOLID_LINE:  Marker is a solid line
  122     * @GTK_DATABOX_MARKERS_DASHED_LINE: Marker is a dashed line
  123     *
  124     * Type of the marker
  125     */
  126    typedef enum
  127    {
  128       GTK_DATABOX_MARKERS_NONE = 0, /* No Marker (just text) */
  129       GTK_DATABOX_MARKERS_TRIANGLE, /* Marker is a triangle */
  130       GTK_DATABOX_MARKERS_SOLID_LINE,   /* Marker is a solid line */
  131       GTK_DATABOX_MARKERS_DASHED_LINE   /* Marker is a dashed line */
  132    }
  133    GtkDataboxMarkersType;
  134 
  135    struct _GtkDataboxMarkers
  136    {
  137       /*< private >*/
  138       GtkDataboxXYCGraph parent;
  139    };
  140 
  141    struct _GtkDataboxMarkersClass
  142    {
  143       GtkDataboxXYCGraphClass parent_class;
  144    };
  145 
  146    GType gtk_databox_markers_get_type (void);
  147 
  148    GtkDataboxGraph *gtk_databox_markers_new (guint len, gfloat * X, gfloat * Y,
  149                         GdkRGBA * color, guint size,
  150                         GtkDataboxMarkersType type);
  151 
  152    void gtk_databox_markers_set_position (GtkDataboxMarkers * markers,
  153                      guint index,
  154                      GtkDataboxMarkersPosition position);
  155 
  156    void gtk_databox_markers_set_label (GtkDataboxMarkers * markers,
  157                       guint index,
  158                       GtkDataboxMarkersTextPosition label_position,
  159                       gchar * text, gboolean boxed);
  160 
  161    GtkDataboxGraph *gtk_databox_markers_new_full (guint maxlen, guint len,
  162             void * X, guint xstart, guint xstride, GType xtype,
  163             void * Y, guint ystart, guint ystride, GType ytype,
  164             GdkRGBA * color, guint size,
  165             GtkDataboxMarkersType type);
  166 
  167 G_END_DECLS
  168 #endif              /* __GTK_DATABOX_MARKERS_H__ */