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

« back to all changes in this revision

Viewing changes to src/cairo-dock-gauge.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_GAUGE2__
22
 
#define  __CAIRO_DOCK_GAUGE2__
23
 
 
24
 
#include "cairo-dock-struct.h"
25
 
#include <cairo-dock-data-renderer.h>
26
 
#include <cairo-dock-themes-manager.h>
27
 
#include <libxml/tree.h>
28
 
#include <libxml/parser.h>
29
 
G_BEGIN_DECLS
30
 
 
31
 
/**
32
 
*@file cairo-dock-gauge.h This class defines the Gauge, which derives from the DataRenderer.
33
 
* All you need to know is the attributes that define a Gauge, the API to use is the common API for DataRenderer, i ncairo-dock-data-renderer.h.
34
 
*/ 
35
 
 
36
 
typedef struct {
37
 
        RsvgHandle *pSvgHandle;
38
 
        cairo_surface_t *pSurface;
39
 
        gint sizeX;
40
 
        gint sizeY;
41
 
        GLuint iTexture;
42
 
} GaugeImage;
43
 
 
44
 
typedef struct {
45
 
        // needle
46
 
        gdouble posX, posY;
47
 
        gdouble posStart, posStop;
48
 
        gdouble direction;
49
 
        gint iNeedleRealWidth, iNeedleRealHeight;
50
 
        gdouble iNeedleOffsetX, iNeedleOffsetY;
51
 
        gdouble fNeedleScale;
52
 
        gint iNeedleWidth, iNeedleHeight;
53
 
        GaugeImage *pImageNeedle;
54
 
        // image list
55
 
        gint iNbImages;
56
 
        gint iNbImageLoaded;
57
 
        GaugeImage *pImageList;
58
 
        // text zone
59
 
        CairoDataRendererTextZone textZone;
60
 
        // logo zone
61
 
        CairoDataRendererEmblem emblem;
62
 
} GaugeIndicator;
63
 
 
64
 
typedef struct {
65
 
        CairoDataRenderer dataRenderer;
66
 
        gchar *cThemeName;
67
 
        GaugeImage *pImageBackground;
68
 
        GaugeImage *pImageForeground;
69
 
        GList *pIndicatorList;
70
 
} Gauge;
71
 
 
72
 
/// Attributes of a Gauge.
73
 
typedef struct _CairoGaugeAttribute CairoGaugeAttribute;
74
 
struct _CairoGaugeAttribute {
75
 
        /// General attributes of any DataRenderer.
76
 
        CairoDataRendererAttribute rendererAttribute;
77
 
        /// path to a gauge theme.
78
 
        gchar *cThemePath;
79
 
};
80
 
 
81
 
 
82
 
Gauge *cairo_dock_new_gauge (void);
83
 
 
84
 
 
85
 
GHashTable *cairo_dock_list_available_gauges (void);
86
 
 
87
 
gchar *cairo_dock_get_gauge_theme_path (const gchar *cThemeName, CairoDockThemeType iType);
88
 
 
89
 
gchar *cairo_dock_get_theme_path_for_gauge (const gchar *cAppletConfFilePath, GKeyFile *pKeyFile, const gchar *cGroupName, const gchar *cKeyName, gboolean *bFlushConfFileNeeded, const gchar *cDefaultThemeName);
90
 
 
91
 
 
92
 
G_END_DECLS
93
 
#endif