~ubuntu-branches/ubuntu/oneiric/cairo-dock/oneiric

« back to all changes in this revision

Viewing changes to src/cairo-dock-graph.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe)
  • Date: 2010-08-09 23:26:12 UTC
  • mto: (18.1.1 cairo-dock) (19.1.1 cairo-dock)
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: james.westby@ubuntu.com-20100809232612-pocdxliaxjdetm37
Tags: upstream-2.2.0~0beta4
ImportĀ upstreamĀ versionĀ 2.2.0~0beta4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
* This file is a part of the Cairo-Dock project
3
 
*
4
 
* Copyright : (C) see the 'copyright' file.
5
 
* E-mail    : see the 'copyright' file.
6
 
*
7
 
* This program is free software; you can redistribute it and/or
8
 
* modify it under the terms of the GNU General Public License
9
 
* as published by the Free Software Foundation; either version 3
10
 
* of the License, or (at your option) any later version.
11
 
*
12
 
* This program is distributed in the hope that it will be useful,
13
 
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
* 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/>.
18
 
*/
19
 
 
20
 
 
21
 
#ifndef __CAIRO_DOCK_GRAPH2__
22
 
#define  __CAIRO_DOCK_GRAPH2__
23
 
 
24
 
#include <gtk/gtk.h>
25
 
G_BEGIN_DECLS
26
 
 
27
 
#include <cairo-dock-struct.h>
28
 
#include <cairo-dock-data-renderer.h>
29
 
 
30
 
/**
31
 
*@file cairo-dock-graph.h This class defines the Graph, which derives from the DataRenderer.
32
 
* All you need to know is the attributes that define a Graph, the API to use is the common API for DataRenderer, i ncairo-dock-data-renderer.h.
33
 
*/ 
34
 
 
35
 
/// Types of graph.
36
 
typedef enum {
37
 
        /// a continuous line.
38
 
        CAIRO_DOCK_GRAPH2_LINE=0,
39
 
        /// a continuous plain graph.
40
 
        CAIRO_DOCK_GRAPH2_PLAIN,
41
 
        /// a histogram.
42
 
        CAIRO_DOCK_GRAPH2_BAR,
43
 
        /// a circle.
44
 
        CAIRO_DOCK_GRAPH2_CIRCLE,
45
 
        /// a plain circle.
46
 
        CAIRO_DOCK_GRAPH2_CIRCLE_PLAIN
47
 
        } CairoDockTypeGraph;
48
 
 
49
 
typedef struct _CairoGraphAttribute CairoGraphAttribute;
50
 
/// Attributes of a Graph.
51
 
struct _CairoGraphAttribute {
52
 
        /// General attributes of any DataRenderer.
53
 
        CairoDataRendererAttribute rendererAttribute;
54
 
        /// type of graph
55
 
        CairoDockTypeGraph iType;
56
 
        /// color of the high values. it's a table of nb_values triplets, each of them representing an rgb color.
57
 
        gdouble *fHighColor;
58
 
        /// color of the low values. same as fHighColor.
59
 
        gdouble *fLowColor;
60
 
        /// color of the background.
61
 
        gdouble fBackGroundColor[4];
62
 
        /// radius of the corners of the background.
63
 
        gint iRadius;
64
 
        /// TRUE to draw all the values on the same graph.
65
 
        gboolean bMixGraphs;
66
 
};
67
 
 
68
 
typedef struct _CairoDockGraph {
69
 
        CairoDataRenderer dataRenderer;
70
 
        CairoDockTypeGraph iType;
71
 
        gdouble *fHighColor;  // iNbValues triplets (r,v,b).
72
 
        gdouble *fLowColor;  // idem.
73
 
        cairo_pattern_t **pGradationPatterns;  // iNbValues patterns.
74
 
        gdouble fBackGroundColor[4];
75
 
        cairo_surface_t *pBackgroundSurface;
76
 
        GLuint iBackgroundTexture;
77
 
        gint iRadius;
78
 
        gdouble fMargin;
79
 
        gboolean bMixGraphs;
80
 
        } CairoDockGraph;
81
 
 
82
 
 
83
 
CairoDockGraph *cairo_dock_new_graph (void);
84
 
 
85
 
 
86
 
G_END_DECLS
87
 
#endif