]> Dogcows Code - chaz/homebank/blob - src/gtk-chart-colors.h
Merge branch 'upstream'
[chaz/homebank] / src / gtk-chart-colors.h
1 /* HomeBank -- Free, easy, personal accounting for everyone.
2 * Copyright (C) 1995-2016 Maxime DOYEN
3 *
4 * This file is part of HomeBank.
5 *
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.
10 *
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.
15 *
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/>.
18 */
19
20 #ifndef __GTK_COLORS_H__
21 #define __GTK_COLORS_H__
22
23 #include <cairo.h>
24
25 #define MASKCOL 255
26 #define COLTO16(col8) ( (col8 | col8<<8 ) )
27 #define COLTOOVER(col8) ( (col8 + MASKCOL) / 2 )
28
29 #define AREA_ALPHA .33
30 #define OVER_ALPHA .15
31 #define OVER_COLOR (MASKCOL * OVER_ALPHA)
32 #define COLTOCAIRO(col8) ( (col8 / 255.0) )
33 #define COLTOCAIROOVER(col8) ( ((col8 * (1 - OVER_ALPHA)) + OVER_COLOR ) / 255.0 )
34
35 //typedef struct _rgbcol RgbCol;
36 typedef struct _ColorScheme GtkColorScheme;
37
38 struct rgbcol
39 {
40 guint8 r, g, b;
41 };
42
43
44 struct _ColorScheme
45 {
46 struct rgbcol *colors;
47 gint nb_cols;
48 gint cs_red;
49 gint cs_green;
50 gint cs_blue;
51 gint cs_yellow;
52 gint cs_orange;
53 };
54
55
56 enum {
57 BLACK,
58 WHITE,
59 GREY1,
60 TEXT,
61 XYLINES,
62 THBASE,
63 THTEXT
64 };
65
66 enum colmap
67 {
68 CHART_COLMAP_HOMEBANK,
69 CHART_COLMAP_MSMONEY,
70 CHART_COLMAP_SAP,
71 CHART_COLMAP_QUICKEN,
72 CHART_COLMAP_OFFICE2010,
73 CHART_COLMAP_OFFICE2013,
74 CHART_COLMAP_ANALYTICS,
75 };
76
77 enum {
78 CHART_FONT_SIZE_TITLE,
79 CHART_FONT_SIZE_SUBTITLE,
80 CHART_FONT_SIZE_NORMAL
81 };
82
83
84 extern char *chart_colors[];
85
86 extern struct rgbcol global_colors[];
87 extern struct rgbcol money_colors[];
88 extern struct rgbcol quicken_colors[];
89 extern struct rgbcol analytics_colors[];
90 extern struct rgbcol office2010_colors[];
91 extern struct rgbcol office2013_colors[];
92 extern struct rgbcol sap_colors[];
93 extern struct rgbcol homebank_colors[];
94
95 extern int money_nbcolors;
96 extern int quicken_nbcolors;
97 extern int analytics_nbcolors;
98 extern int office2010_nbcolors;
99 extern int office2013_nbcolors;
100 extern int sap_nbcolors;
101 extern int homebank_nbcolors;
102
103 void chart_color_global_default(void);
104
105 void cairo_user_set_rgbcol(cairo_t *cr, struct rgbcol *col);
106 void cairo_user_set_rgbacol(cairo_t *cr, struct rgbcol *col, double alpha);
107 void cairo_user_set_rgbcol_over(cairo_t *cr, struct rgbcol *col, gboolean over);
108
109 void colorscheme_init(GtkColorScheme *scheme, gint index);
110
111 #endif /* __GTK_COLORS_H__ */
This page took 0.03895 seconds and 4 git commands to generate.