#include "rrd_tool.h"
#include "rrd_rpncalc.h"
+#ifdef WIN32
+# include <windows.h>
+# define MAXPATH MAX_PATH
+#endif
#define ALTYGRID 0x01 /* use alternative y grid algorithm */
#define ALTAUTOSCALE 0x02 /* use alternative algorithm to find lower and upper bounds */
, VDEF_LSLINT /* least squares line y_intercept */
, VDEF_LSLCORREL /* least squares line correlation coefficient */
};
-enum text_prop_en { TEXT_PROP_DEFAULT = 0, /* default settings */
+enum text_prop_en {
+ TEXT_PROP_DEFAULT = 0, /* default settings */
TEXT_PROP_TITLE, /* properties for the title */
TEXT_PROP_AXIS, /* for the numbers next to the axis */
TEXT_PROP_UNIT, /* for the vertical unit description */
- TEXT_PROP_LEGEND, /* fot the legend below the graph */
+ TEXT_PROP_LEGEND, /* for the legend below the graph */
+ TEXT_PROP_WATERMARK, /* for the little text to the side of the graph */
TEXT_PROP_LAST
};
typedef struct text_prop_t {
double size;
char font[1024];
+ PangoFontDescription *font_desc;
} text_prop_t;
char *imginfo; /* construct an <IMG ... tag and return
as first retval */
enum gfx_if_en imgformat; /* image format */
+ char *daemon_addr; /* rrdcached connection string */
int lazy; /* only update the image if there is
reasonable probablility that the
existing one is out of date */
double force_scale_max; /* Force a scale--max */
/* status information */
-
+ int with_markup;
long xorigin, yorigin; /* where is (0,0) of the graph */
long ximg, yimg; /* total size of the image */
size_t rendered_image_size;
cairo_t *cr; /* drawin context */
cairo_font_options_t *font_options; /* cairo font options */
cairo_antialias_t graph_antialias; /* antialiasing for the graph */
-
- info_t *grinfo; /* root pointer to extra graph info */
- info_t *grinfo_current; /* pointing to current entry */
+ PangoLayout *layout; /* the pango layout we use for writing fonts */
+ rrd_info_t *grinfo; /* root pointer to extra graph info */
+ rrd_info_t *grinfo_current; /* pointing to current entry */
} image_desc_t;
/* Prototypes */
char *const);
void rrd_graph_init(
image_desc_t *);
+
void rrd_graph_options(
int,
char **,
double x,
double y,
gfx_color_t color,
- char *font,
- double size,
+ PangoFontDescription *font_desc,
double tabwidth,
double angle,
enum gfx_h_align_en h_align,
double gfx_get_text_width(
image_desc_t *im,
double start,
- char *font,
- double size,
+ PangoFontDescription *font_desc,
double tabwidth,
char *text);
void grinfo_push(
image_desc_t *im,
char *key,
- enum info_type type,
- infoval value);
+ rrd_info_type_t type, rrd_infoval_t value);