PLplot  5.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
cairo.c File Reference
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <cairo.h>
#include <pango/pangocairo.h>
#include "plDevs.h"
#include "plplotP.h"
#include "drivers.h"

Go to the source code of this file.

Classes

struct  PLCairo

Macros

#define DPI   72
#define PLCAIRO_DEFAULT_X   720
#define PLCAIRO_DEFAULT_Y   540
#define MAX_STRING_LEN   500
#define MAX_MARKUP_LEN   MAX_STRING_LEN * 10
#define NPANGOLOOKUP   5
#define FAMILY_LOOKUP_LEN   1024
#define TAG_LEN   200
#define RISE_FACTOR   0.8

Functions

PLCairostream_and_font_setup (PLStream *, int)
cairo_status_t write_to_stream (void *, unsigned char *, unsigned int)
void set_clip (PLStream *pls)
int cairo_family_check (PLStream *pls)
static void proc_str (PLStream *, EscText *)
static void text_begin_cairo (PLStream *pls, EscText *args)
static void text_char_cairo (PLStream *pls, EscText *args)
static void text_esc_cairo (PLStream *pls, EscText *args)
static void text_end_cairo (PLStream *pls, EscText *args)
static char * ucs4_to_pango_markup_format (PLUNICODE *, int, float)
static void open_span_tag (char *, PLUNICODE, float, int)
static void close_span_tag (char *, int)
static char * rise_span_tag (int, float, float, float)
static void set_current_context (PLStream *)
static void poly_line (PLStream *, short *, short *, PLINT)
static void filled_polygon (PLStream *pls, short *xa, short *ya, PLINT npts)
static void gradient (PLStream *pls, short *xa, short *ya, PLINT npts)
static void arc (PLStream *, arc_struct *)
static void rotate_cairo_surface (PLStream *, float, float, float, float, float, float, PLBOOL)
static void blit_to_x (PLStream *pls, double x, double y, double w, double h)
static void start_raster (PLStream *)
static void end_raster (PLStream *)
static void set_mode (PLStream *, PLINT *)
static void get_mode (PLStream *, PLINT *)
void get_line_properties (PLCairo *aStream, cairo_line_join_t *join, cairo_line_cap_t *cap)
void set_line_properties (PLCairo *aStream, cairo_line_join_t join, cairo_line_cap_t cap)
void plD_bop_cairo (PLStream *)
void plD_eop_cairo (PLStream *)
void plD_state_cairo (PLStream *, PLINT)
void plD_esc_cairo (PLStream *, PLINT, void *)
void plD_tidy_cairo (PLStream *)
void plD_line_cairo (PLStream *, short, short, short, short)
void plD_polyline_cairo (PLStream *, short *, short *, PLINT)
void plD_state_cairo (PLStream *PL_UNUSED(pls), PLINT PL_UNUSED(op))

Variables

static int text_clipping
static int text_anti_aliasing
static int graphics_anti_aliasing
static int external_drawable
static int rasterize_image
static int set_background
static int image_buffering
static int already_warned = 0
static DrvOpt cairo_options []
PLDLLIMPEXP_DRIVER const char * plD_DEVICE_INFO_cairo
const char * defaultFamilyLookup [NPANGOLOOKUP]
const char * envFamilyLookup [NPANGOLOOKUP]
char familyLookup [NPANGOLOOKUP][FAMILY_LOOKUP_LEN]
const char * weightLookup [2]
const char * styleLookup [3]

Macro Definition Documentation

#define DPI   72

Definition at line 70 of file cairo.c.

#define FAMILY_LOOKUP_LEN   1024

Definition at line 213 of file cairo.c.

#define MAX_MARKUP_LEN   MAX_STRING_LEN * 10

Definition at line 75 of file cairo.c.

#define MAX_STRING_LEN   500

Definition at line 74 of file cairo.c.

#define NPANGOLOOKUP   5

Definition at line 195 of file cairo.c.

#define PLCAIRO_DEFAULT_X   720

Definition at line 71 of file cairo.c.

#define PLCAIRO_DEFAULT_Y   540

Definition at line 72 of file cairo.c.

#define RISE_FACTOR   0.8

Definition at line 1214 of file cairo.c.

#define TAG_LEN   200

Definition at line 216 of file cairo.c.

Function Documentation

void arc ( PLStream pls,
arc_struct arc_info 
)
static

Definition at line 1596 of file cairo.c.

static void blit_to_x ( PLStream pls,
double  x,
double  y,
double  w,
double  h 
)
static
int cairo_family_check ( PLStream pls)

Definition at line 1573 of file cairo.c.

void close_span_tag ( char *  pangoMarkupString,
int  upDown 
)
static

Definition at line 1187 of file cairo.c.

void end_raster ( PLStream pls)
static

Definition at line 341 of file cairo.c.

void filled_polygon ( PLStream pls,
short *  xa,
short *  ya,
PLINT  npts 
)
static

Definition at line 1440 of file cairo.c.

void get_line_properties ( PLCairo aStream,
cairo_line_join_t *  join,
cairo_line_cap_t *  cap 
)

Definition at line 421 of file cairo.c.

void get_mode ( PLStream pls,
PLINT mode 
)
static

Definition at line 613 of file cairo.c.

void gradient ( PLStream pls,
short *  xa,
short *  ya,
PLINT  npts 
)
static

Definition at line 1487 of file cairo.c.

void open_span_tag ( char *  pangoMarkupString,
PLUNICODE  fci,
float  fontSize,
int  upDown 
)
static

Definition at line 1137 of file cairo.c.

void plD_bop_cairo ( PLStream pls)

Definition at line 384 of file cairo.c.

void plD_eop_cairo ( PLStream pls)

Definition at line 482 of file cairo.c.

void plD_esc_cairo ( PLStream pls,
PLINT  op,
void ptr 
)

Definition at line 529 of file cairo.c.

void plD_line_cairo ( PLStream pls,
short  x1a,
short  y1a,
short  x2a,
short  y2a 
)

Definition at line 433 of file cairo.c.

void plD_polyline_cairo ( PLStream pls,
short *  xa,
short *  ya,
PLINT  npts 
)

Definition at line 459 of file cairo.c.

void plD_state_cairo ( PLStream ,
PLINT   
)
void plD_state_cairo ( PLStream PL_UNUSEDpls,
PLINT   PL_UNUSEDop 
)

Definition at line 519 of file cairo.c.

void plD_tidy_cairo ( PLStream pls)

Definition at line 497 of file cairo.c.

void poly_line ( PLStream pls,
short *  xa,
short *  ya,
PLINT  npts 
)
static

Definition at line 1418 of file cairo.c.

void proc_str ( PLStream pls,
EscText args 
)
static

Definition at line 873 of file cairo.c.

char * rise_span_tag ( int  ifsuperscript,
float  fontSize,
float  multiplier,
float  rise 
)
static

Definition at line 1227 of file cairo.c.

void rotate_cairo_surface ( PLStream pls,
float  x11,
float  x12,
float  x21,
float  x22,
float  x0,
float  y0,
PLBOOL  is_xcairo 
)
static

Definition at line 1654 of file cairo.c.

void set_clip ( PLStream pls)

Definition at line 1531 of file cairo.c.

void set_current_context ( PLStream pls)
static

Definition at line 1389 of file cairo.c.

void set_line_properties ( PLCairo aStream,
cairo_line_join_t  join,
cairo_line_cap_t  cap 
)

Definition at line 427 of file cairo.c.

void set_mode ( PLStream pls,
PLINT mode 
)
static

Definition at line 585 of file cairo.c.

void start_raster ( PLStream pls)
static

Definition at line 297 of file cairo.c.

PLCairo * stream_and_font_setup ( PLStream pls,
int  interactive 
)

Definition at line 1289 of file cairo.c.

void text_begin_cairo ( PLStream pls,
EscText args 
)
static

Definition at line 645 of file cairo.c.

void text_char_cairo ( PLStream pls,
EscText args 
)
static

Definition at line 670 of file cairo.c.

void text_end_cairo ( PLStream pls,
EscText args 
)
static

Definition at line 773 of file cairo.c.

void text_esc_cairo ( PLStream pls,
EscText args 
)
static

Definition at line 704 of file cairo.c.

char * ucs4_to_pango_markup_format ( PLUNICODE ucs4,
int  ucs4Len,
float  fontSize 
)
static

Definition at line 992 of file cairo.c.

cairo_status_t write_to_stream ( void filePointer,
unsigned char *  data,
unsigned int  length 
)

Definition at line 1265 of file cairo.c.

Variable Documentation

int already_warned = 0
static

Definition at line 84 of file cairo.c.

DrvOpt cairo_options[]
static
Initial value:
{ { "text_clipping", DRV_INT, &text_clipping, "Use text clipping (text_clipping=0|1)" },
{ "text_anti_aliasing", DRV_INT, &text_anti_aliasing, "Set desired text anti-aliasing (text_anti_aliasing=0|1|2|3). The numbers are in the same order as the cairo_antialias_t enumeration documented at http://cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t)" },
{ "graphics_anti_aliasing", DRV_INT, &graphics_anti_aliasing, "Set desired graphics anti-aliasing (graphics_anti_aliasing=0|1|2|3). The numbers are in the same order as the cairo_antialias_t enumeration documented at http://cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t" },
{ "external_drawable", DRV_INT, &external_drawable, "Plot to external X drawable" },
{ "rasterize_image", DRV_INT, &rasterize_image, "Raster or vector image rendering (rasterize_image=0|1)" },
{ "set_background", DRV_INT, &set_background, "Set the background for the extcairo device (set_background=0|1). If 1 then the plot background will set by PLplot" },
{ "image_buffering", DRV_INT, &image_buffering, "Buffered offscreen rendering for the xcairo device (image_buffering=0|1)." },
{ NULL, DRV_INT, NULL, NULL } }

Definition at line 86 of file cairo.c.

const char* defaultFamilyLookup[NPANGOLOOKUP]
Initial value:
{
"sans",
"serif",
"monospace",
"sans,serif",
"sans,serif"
}

Definition at line 197 of file cairo.c.

const char* envFamilyLookup[NPANGOLOOKUP]
Initial value:
{
"PLPLOT_FREETYPE_SANS_FAMILY",
"PLPLOT_FREETYPE_SERIF_FAMILY",
"PLPLOT_FREETYPE_MONO_FAMILY",
"PLPLOT_FREETYPE_SCRIPT_FAMILY",
"PLPLOT_FREETYPE_SYMBOL_FAMILY"
}

Definition at line 205 of file cairo.c.

int external_drawable
static

Definition at line 80 of file cairo.c.

char familyLookup[NPANGOLOOKUP][FAMILY_LOOKUP_LEN]

Definition at line 214 of file cairo.c.

int graphics_anti_aliasing
static

Definition at line 79 of file cairo.c.

int image_buffering
static

Definition at line 83 of file cairo.c.

PLDLLIMPEXP_DRIVER const char* plD_DEVICE_INFO_cairo

Definition at line 148 of file cairo.c.

int rasterize_image
static

Definition at line 81 of file cairo.c.

int set_background
static

Definition at line 82 of file cairo.c.

const char* styleLookup[3]
Initial value:
{
"normal",
"italic",
"oblique"
}

Definition at line 223 of file cairo.c.

int text_anti_aliasing
static

Definition at line 78 of file cairo.c.

int text_clipping
static

Definition at line 77 of file cairo.c.

const char* weightLookup[2]
Initial value:
{
"normal",
"bold"
}

Definition at line 218 of file cairo.c.