1 /* HomeBank -- Free, easy, personal accounting for everyone.
2 * Copyright (C) 1995-2012 Maxime DOYEN
4 * This file is part of HomeBank.
6 * HomeBank is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * HomeBank is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __CHARTSTACK_H__
21 #define __CHARTSTACK_H__
23 #include "gtk-chart-colors.h"
27 #endif /* __cplusplus */
30 /* Macro for casting a pointer to a GtkWidget or GtkWidgetClass pointer.
31 * Macros for testing whether `widget' or `klass' are of type GTK_TYPE_WIDGET.
33 #define GTK_TYPE_CHARTSTACK (ui_chart_stack_get_type ())
34 #define GTK_CHARTSTACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CHARTSTACK, ChartStack))
35 #define GTK_CHARTSTACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CHARTSTACK, ChartStackClass)
36 #define GTK_IS_CHARTSTACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CHARTSTACK))
37 #define GTK_IS_CHARTSTACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CHARTSTACK))
38 #define GTK_CHARTSTACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CHARTSTACK, ChartStackClass))
40 typedef struct _ChartStack ChartStack
;
41 typedef struct _ChartStackClass ChartStackClass
;
43 typedef struct _StackItem StackItem
;
45 typedef gchar (* ChartStackPrintIntFunc
) (gint value
, gboolean minor
);
46 typedef gchar (* ChartStackPrintDoubleFunc
) (gdouble value
, gboolean minor
);
48 /* = = = = = = = = = = */
49 /* = = = = = = = = = = = = = = = = = = = = */
50 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
51 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
53 #define GTK_CHARTSTACK_BARW 32
54 #define CHART_BUFFER_LENGTH 128
57 #define DEFAULT_DELAY 500 /* Default delay in ms */
60 #define CHART_MARGIN 18 //standard a4 margin
61 #define CHART_SPACING 6
85 /* you should access only the entry and list fields directly */
92 GtkAdjustment
*adjustment
;
117 GtkColorScheme color_scheme
;
119 /* cairo default value */
120 PangoFontDescription
*pfd
;
124 cairo_surface_t
*surface
;
129 /* draw area coordinates */
130 double l
, t
, b
, r
, w
, h
;
134 double subtitle_zh
, subtitle_y
;
135 double header_zh
, header_y
;
145 double graph_width
, graph_height
; //graph dimension
148 gint active
, lastactive
;
150 gchar buffer
[CHART_BUFFER_LENGTH
];
155 struct _ChartStackClass
{
156 GtkBoxClass parent_class
;
158 /* Padding for future expansion */
159 void (*_gtk_reserved1
) (void);
160 void (*_gtk_reserved2
) (void);
161 void (*_gtk_reserved3
) (void);
162 void (*_gtk_reserved4
) (void);
166 GType
ui_chart_stack_get_type (void);
169 /* public function */
170 GtkWidget
*ui_chart_stack_new(void);
172 void ui_chart_stack_set_color_scheme(ChartStack
* chart
, gint colorscheme
);
173 void ui_chart_stack_set_dualdatas(ChartStack
*chart
, GtkTreeModel
*model
, gchar
*coltitle1
, gchar
*coltitle2
, gchar
*title
, gchar
*subtitle
);
174 void ui_chart_stack_set_title(ChartStack
* chart
, gchar
*title
);
175 void ui_chart_stack_set_subtitle(ChartStack
* chart
, gchar
*subtitle
);
176 void ui_chart_stack_set_barw(ChartStack
* chart
, gdouble barw
);
177 void ui_chart_stack_show_minor(ChartStack
* chart
, gboolean minor
);
179 void ui_chart_stack_set_minor_prefs(ChartStack
* chart
, gdouble rate
, gchar
*symbol
);
180 void ui_chart_stack_set_currency(ChartStack
* chart
, guint32 kcur
);
184 #endif /* __cplusplus */
186 #endif /* __CHARTSTACK_H__ */