gtkdatabox  1.0.0
About: GtkDatabox is a Gtk+-widget for live display of large amounts of fluctuating numerical data.
  Fossies Dox: gtkdatabox-1.0.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

gtkdatabox_cross_simple.c
Go to the documentation of this file.
1 /* $Id: gtkdatabox_cross_simple.c 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 
21 
22 G_DEFINE_TYPE(GtkDataboxCrossSimple, gtk_databox_cross_simple,
24 
25 static void
26 cross_simple_finalize (GObject * object)
27 {
28  gpointer pointer;
29 
31  if (pointer)
32  g_free (pointer);
33 
35  if (pointer)
36  g_free (pointer);
37 
38  /* Chain up to the parent class */
39  G_OBJECT_CLASS (gtk_databox_cross_simple_parent_class)->finalize (object);
40 }
41 
42 static void
44 {
45  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
46 
47  gobject_class->finalize = cross_simple_finalize;
48 }
49 
51 {
52  if (cross == NULL) g_warning ("cross_simple_init with NULL");
53 }
54 
55 /**
56  * gtk_databox_cross_simple_new:
57  * @color: color of the markers
58  * @size: marker size or line width (depending on the @type)
59  *
60  * Creates a new #GtkDataboxCrossSimple object which can be added to a #GtkDatabox widget as nice decoration for other graphs.
61  *
62  * Return value: A new #GtkDataboxCrossSimple object
63  **/
65 gtk_databox_cross_simple_new (GdkRGBA * color, guint size)
66 {
67  GtkDataboxCrossSimple *cross_simple;
68  gfloat *X = g_new0 (gfloat, 2);
69  gfloat *Y = g_new0 (gfloat, 2);
70  gint len = 2;
71 
72  cross_simple = g_object_new (GTK_DATABOX_TYPE_CROSS_SIMPLE,
73  "markers-type", GTK_DATABOX_MARKERS_SOLID_LINE,
74  "X-Values", X,
75  "Y-Values", Y,
76  "xstart", 0,
77  "ystart", 0,
78  "xstride", 1,
79  "ystride", 1,
80  "xtype", G_TYPE_FLOAT,
81  "ytype", G_TYPE_FLOAT,
82  "length", len,
83  "maxlen", len,
84  "color", color, "size", size, NULL);
85 
89  GTK_DATABOX_MARKERS_TEXT_SW, "0", FALSE);
92 
93  return GTK_DATABOX_GRAPH (cross_simple);
94 }
GtkDataboxGraph * gtk_databox_cross_simple_new(GdkRGBA *color, guint size)
static void gtk_databox_cross_simple_class_init(GtkDataboxCrossSimpleClass *klass)
static void gtk_databox_cross_simple_init(GtkDataboxCrossSimple *cross)
G_DEFINE_TYPE(GtkDataboxCrossSimple, gtk_databox_cross_simple, GTK_DATABOX_TYPE_MARKERS)
#define GTK_DATABOX_TYPE_CROSS_SIMPLE
#define GTK_DATABOX_GRAPH(obj)
void gtk_databox_markers_set_position(GtkDataboxMarkers *markers, guint index, GtkDataboxMarkersPosition position)
void gtk_databox_markers_set_label(GtkDataboxMarkers *markers, guint index, GtkDataboxMarkersTextPosition label_position, gchar *text, gboolean boxed)
@ GTK_DATABOX_MARKERS_C
@ GTK_DATABOX_MARKERS_W
#define GTK_DATABOX_MARKERS(obj)
@ GTK_DATABOX_MARKERS_TEXT_SW
@ GTK_DATABOX_MARKERS_SOLID_LINE
#define GTK_DATABOX_TYPE_MARKERS
gfloat * gtk_databox_xyc_graph_get_Y(GtkDataboxXYCGraph *xyc_graph)
gfloat * gtk_databox_xyc_graph_get_X(GtkDataboxXYCGraph *xyc_graph)
#define GTK_DATABOX_XYC_GRAPH(obj)