#include <inttypes.h>
#include <X11/Xlib.h>
+
+#include <cairo-svg.h>
#include <cairo-xlib.h>
#include "acre.h"
cairo_surface_destroy (surface);
}
+static void
+draw_svg (acre_t *acre, int width, int height, double x_min, double x_max)
+{
+ cairo_t *cr;
+ cairo_surface_t *surface;
+
+ surface = cairo_svg_surface_create ("acre-fips.svg", width, height);
+
+ cr = cairo_create (surface);
+
+ acre_set_x_axis_range (acre, x_min, x_max);
+ acre_draw (acre, cr, width, height);
+
+ cairo_destroy (cr);
+
+ cairo_surface_destroy (surface);
+}
+
static void
handle_events(Display *dpy, Window window, Visual *visual,
KeyCode equal_code = XKeysymToKeycode (dpy, XStringToKeysym("equal"));
KeyCode minus_code = XKeysymToKeycode (dpy, XStringToKeysym("minus"));
KeyCode home_code = XKeysymToKeycode (dpy, XStringToKeysym("Home"));
+ KeyCode svg_code = XKeysymToKeycode (dpy, XStringToKeysym("S"));
KeyCode keycode;
bool need_redraw = false;
double x_min, x_max, shift;
{
acre_get_x_axis_data_range (acre, &x_min, &x_max);
}
+ else if (keycode == svg_code)
+ {
+ need_redraw = false;
+ draw_svg (acre, width, height, x_min, x_max);
+ }
else
{
need_redraw = false;