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/>.
19
#ifndef __CAIRO_DOCK_GAUGE__
20
#define __CAIRO_DOCK_GAUGE__
21
#ifndef __CAIRO_DOCK_GAUGE2__
22
#define __CAIRO_DOCK_GAUGE2__
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>
29
RsvgHandle *svgNeedle;
30
cairo_surface_t *cairoSurface;
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.
36
RsvgHandle *pSvgHandle;
37
cairo_surface_t *pSurface;
37
45
gdouble posX, posY;
38
46
gdouble posStart, posStop;
42
GaugeImage *imageNeedle;
48
gint iNeedleRealWidth, iNeedleRealHeight;
49
gdouble iNeedleOffsetX, iNeedleOffsetY;
51
gint iNeedleWidth, iNeedleHeight;
52
GaugeImage *pImageNeedle;
56
GaugeImage *pImageList;
43
58
gdouble textX, textY;
44
59
gdouble textWidth, textHeight;
45
60
gdouble textColor[3];
53
GaugeImage *imageBackground;
54
GaugeImage *imageForeground;
57
gdouble *pCurrentValues;
64
CairoDataRenderer dataRenderer;
66
GaugeImage *pImageBackground;
67
GaugeImage *pImageForeground;
68
GList *pIndicatorList;
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.
81
Gauge *cairo_dock_new_gauge (void);
62
84
GHashTable *cairo_dock_list_available_gauges (void);
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);
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);
74
void cairo_dock_reload_gauge (cairo_t *pSourceContext, Gauge *pGauge, int iWidth, int iHeight);
76
void cairo_dock_free_gauge(Gauge *pGauge);
86
gchar *cairo_dock_get_gauge_theme_path (const gchar *cThemeName);
78
88
gchar *cairo_dock_get_gauge_key_value (gchar *cAppletConfFilePath, GKeyFile *pKeyFile, gchar *cGroupName, gchar *cKeyName, gboolean *bFlushConfFileNeeded, gchar *cDefaultThemeName);
80
void cairo_dock_add_watermark_on_gauge (cairo_t *pSourceContext, Gauge *pGauge, gchar *cImagePath, double fAlpha);
83
gboolean cairo_dock_gauge_can_draw_text_value (Gauge *pGauge);