23 #ifndef _LAX_DISPLAYER_CAIRO_H
24 #define _LAX_DISPLAYER_CAIRO_H
26 #include <cairo/cairo-xlib.h>
27 #include <cairo/cairo-ft.h>
29 #include <lax/displayer.h>
48 cairo_surface_t *target;
54 double ctm[6],ictm[6];
57 double fgRed, fgGreen, fgBlue, fgAlpha;
58 double bgRed, bgGreen, bgBlue, bgAlpha;
60 cairo_font_face_t *curfont;
61 cairo_scaled_font_t *curscaledfont;
72 virtual Display *GetDpy();
75 virtual cairo_t *GetCairo();
79 virtual void SwapBuffers();
80 virtual void BackBuffer(
int on);
94 virtual unsigned long NewFG(
double r,
double g,
double b,
double a=1.0);
95 virtual unsigned long NewFG(
unsigned long ncol);
97 virtual unsigned long NewFG(
int r,
int g,
int b,
int a=255);
98 virtual unsigned long NewBG(
double r,
double g,
double b);
99 virtual unsigned long NewBG(
int r,
int g,
int b);
100 virtual unsigned long NewBG(
unsigned long nc);
101 virtual unsigned long FG();
102 virtual unsigned long BG();
103 virtual void LineAttributes(
double width,
int dash,
int cap,
int join);
104 virtual void FillAttributes(
int fillstyle,
int fillrule);
119 virtual void PushClip(
int startfresh);
129 virtual void fill(
int preserve);
130 virtual void stroke(
int preserve);
138 virtual void drawpoint(
double x,
double y,
double radius,
int tofill);
141 virtual void drawline(
double ax,
double ay,
double bx,
double by);
144 virtual void initFont();
145 virtual int textheight();
146 virtual int font(
LaxFont *nfont,
double size=-1);
147 virtual int font(
const char *fontconfigpattern);
148 virtual int font(
const char *family,
const char *style,
double pixelsize);
149 virtual int fontsize(
double size);
150 virtual double textextent(
LaxFont *thisfont,
const char *str,
int len,
double *width,
double *height,
double *ascent,
double *descent,
char real);
151 virtual double textout(
double x,
double y,
const char *str,
int len=0,
unsigned long align=LAX_CENTER);
152 virtual double textout(
double *matrix,
double x,
double y,
const char *str,
int len=0,
unsigned long align=LAX_CENTER);
153 virtual double textout(
double angle,
double x,
double y,
const char *str,
int len=0,
unsigned long align=LAX_CENTER);
156 virtual void imageout(
LaxImage *img,
double x,
double y);
157 virtual int imageout(
LaxImage *img,
double x,
double y,
double w,
double h);
158 virtual void imageout(
LaxImage *img,
double *matrix);
159 virtual void imageout(
LaxImage *img,
double angle,
double x,
double y);
160 virtual void imageout_rotated(
LaxImage *img,
double x,
double y,
double ulx,
double uly);
161 virtual void imageout_skewed(
LaxImage *img,
double x,
double y,
double ulx,
double uly,
double urx,
double ury);
166 virtual const double *
Getctm();
167 virtual const double *
Getictm();
171 virtual void NewTransform(
double a,
double b,
double c,
double d,
double x0,
double y0);
174 virtual int DrawReal();
175 virtual int DrawScreen();