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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne, Matthieu Baerts (matttbe), Julien Lavergne
  • Date: 2009-10-04 16:33:52 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20091004163352-ttbbjfmpb8uzl8j4
Tags: 2.0.9-0ubuntu1
[ Matthieu Baerts (matttbe) ]
* New Upstream Version. (LP: #435587)
* Added apport hook in debian/apport
 - Add debian/apport
 - debian/cairo-dock-core.install: Added debian/apport/cairo-dock.py
* Use .desktop provided by upstream
 - Removed debian/*.desktop
 - debian/cairo-dock-core.install: install upstream desktop files. 

[ Julien Lavergne ]
* Adjust debian/changelog with Daniel Holbach suggestions.
* debian/patches/01_rename_cairo-dock-package-theme.patch: drop, 
  merged upstream.
* debian/patches/01-desktop-file-category.patch:
 - Remove Encoding field and set category to Utility.
* debian/patches/02-merge-changelog.patch:
 - Merge ChangeLog and ChangeLog-2.0.9.
* debian/apport: Remove commands with grep, python doesn't like it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
* Gauge headers for Cairo-Dock
 
2
* This file is a part of the Cairo-Dock project
3
3
*
4
 
* Copyright : (C) 2009 by Fabrice Rey
5
 
* E-mail    : fabounet@users.berlios.de
 
4
* Copyright : (C) see the 'copyright' file.
 
5
* E-mail    : see the 'copyright' file.
6
6
*
7
7
* This program is free software; you can redistribute it and/or
8
8
* modify it under the terms of the GNU General Public License
13
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
15
* GNU General Public License for more details.
16
 
*   http://www.gnu.org/licenses/licenses.html#GPL
 
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/>.
17
18
*/
18
19
 
19
 
#ifndef __CAIRO_DOCK_GAUGE__
20
 
#define  __CAIRO_DOCK_GAUGE__
 
20
 
 
21
#ifndef __CAIRO_DOCK_GAUGE2__
 
22
#define  __CAIRO_DOCK_GAUGE2__
21
23
 
22
24
#include "cairo-dock-struct.h"
 
25
#include <cairo-dock-data-renderer.h>
23
26
#include <libxml/tree.h>
24
27
#include <libxml/parser.h>
25
28
G_BEGIN_DECLS
26
29
 
27
 
typedef struct
28
 
{
29
 
        RsvgHandle *svgNeedle;
30
 
        cairo_surface_t *cairoSurface;
 
30
/**
 
31
*@file cairo-dock-gauge.h This class defines the Gauge, which derives from the DataRenderer.
 
32
* 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.
 
33
*/ 
 
34
 
 
35
typedef struct {
 
36
        RsvgHandle *pSvgHandle;
 
37
        cairo_surface_t *pSurface;
31
38
        gint sizeX;
32
39
        gint sizeY;
 
40
        GLuint iTexture;
33
41
} GaugeImage;
34
42
 
35
 
typedef struct
36
 
{
 
43
typedef struct {
 
44
        // needle
37
45
        gdouble posX, posY;
38
46
        gdouble posStart, posStop;
39
47
        gdouble direction;
40
 
        gint nbImage;
41
 
        GList *imageList;
42
 
        GaugeImage *imageNeedle;
 
48
        gint iNeedleRealWidth, iNeedleRealHeight;
 
49
        gdouble iNeedleOffsetX, iNeedleOffsetY;
 
50
        gdouble fNeedleScale;
 
51
        gint iNeedleWidth, iNeedleHeight;
 
52
        GaugeImage *pImageNeedle;
 
53
        // image list
 
54
        gint iNbImages;
 
55
        gint iNbImageLoaded;
 
56
        GaugeImage *pImageList;
 
57
        // text zone
43
58
        gdouble textX, textY;
44
59
        gdouble textWidth, textHeight;
45
60
        gdouble textColor[3];
46
61
} GaugeIndicator;
47
62
 
48
 
typedef struct
49
 
{
50
 
        gchar *themeName;
51
 
        gint sizeX;
52
 
        gint sizeY;
53
 
        GaugeImage *imageBackground;
54
 
        GaugeImage *imageForeground;
55
 
        GList *indicatorList;
56
 
        gint iRank;
57
 
        gdouble *pCurrentValues;
58
 
        gdouble *pOldValues;
 
63
typedef struct {
 
64
        CairoDataRenderer dataRenderer;
 
65
        gchar *cThemeName;
 
66
        GaugeImage *pImageBackground;
 
67
        GaugeImage *pImageForeground;
 
68
        GList *pIndicatorList;
59
69
} Gauge;
60
70
 
 
71
/// Attributes of a Gauge.
 
72
typedef struct _CairoGaugeAttribute CairoGaugeAttribute;
 
73
struct _CairoGaugeAttribute {
 
74
        /// General attributes of any DataRenderer.
 
75
        CairoDataRendererAttribute rendererAttribute;
 
76
        /// path to a gauge theme.
 
77
        gchar *cThemePath;
 
78
};
 
79
 
 
80
 
 
81
Gauge *cairo_dock_new_gauge (void);
 
82
 
61
83
 
62
84
GHashTable *cairo_dock_list_available_gauges (void);
63
85
 
64
 
void cairo_dock_xml_open_file (gchar *filePath, const gchar *mainNodeName,xmlDocPtr *xmlDoc,xmlNodePtr *node);
65
 
Gauge *cairo_dock_load_gauge(cairo_t *pSourceContext, const gchar *cThemePath, int iWidth, int iHeight);
66
 
GaugeImage *cairo_dock_init_gauge_image (gchar *cImagePath);
67
 
void cairo_dock_load_gauge_image (cairo_t *pSourceContext, GaugeImage *pGaugeImage, int iWidth, int iHeight);
68
 
 
69
 
void cairo_dock_render_gauge(cairo_t *pSourceContext, CairoContainer *pContainer, Icon *pIcon, Gauge *pGauge, double fValue);
70
 
void cairo_dock_render_gauge_multi_value(cairo_t *pSourceContext, CairoContainer *pContainer, Icon *pIcon, Gauge *pGauge, GList *valueList);
71
 
void draw_cd_Gauge_needle(cairo_t *pSourceContext, Gauge *pGauge, GaugeIndicator *pGaugeIndicator, double fValue);
72
 
void draw_cd_Gauge_image(cairo_t *pSourceContext, GaugeIndicator *pGaugeIndicator, double fValue);
73
 
 
74
 
void cairo_dock_reload_gauge (cairo_t *pSourceContext, Gauge *pGauge, int iWidth, int iHeight);
75
 
 
76
 
void cairo_dock_free_gauge(Gauge *pGauge);
 
86
gchar *cairo_dock_get_gauge_theme_path (const gchar *cThemeName);
77
87
 
78
88
gchar *cairo_dock_get_gauge_key_value (gchar *cAppletConfFilePath, GKeyFile *pKeyFile, gchar *cGroupName, gchar *cKeyName, gboolean *bFlushConfFileNeeded, gchar *cDefaultThemeName);
79
89
 
80
 
void cairo_dock_add_watermark_on_gauge (cairo_t *pSourceContext, Gauge *pGauge, gchar *cImagePath, double fAlpha);
81
 
 
82
 
 
83
 
gboolean cairo_dock_gauge_can_draw_text_value (Gauge *pGauge);
84
90
 
85
91
G_END_DECLS
86
92
#endif