23#ifndef Fl_PostScript_H
24#define Fl_PostScript_H
32 typedef int (Fl_PostScript_Close_Command)(FILE *);
63 void transformed_draw_extra(
const char* str,
int n,
double x,
double y,
int w,
bool rtl);
64 void *prepare_rle85();
65 void write_rle85(
uchar b,
void *data);
66 void close_rle85(
void *data);
68 void write85(
void *data,
const uchar *p,
int len);
69 void close85(
void *data);
71 static const char *class_id;
75 enum SHAPE{NONE=0, LINE, LOOP, POLYGON, POINTS};
95 unsigned char cr_,cg_,cb_;
106 Fl_PostScript_Close_Command* close_cmd_;
120 uchar bg_r, bg_g, bg_b;
124 void transformed_draw(
const char* s,
int n,
double x,
double y);
125 void transformed_draw(
const char* s,
double x,
double y);
126 int alpha_mask(
const uchar * data,
int w,
int h,
int D,
int LD=0);
131 void page_policy(
int p);
132 int page_policy(){
return page_policy_;};
133 void close_command(Fl_PostScript_Close_Command* cmd){close_cmd_=cmd;};
134 FILE * file() {
return output;};
138 void interpolate(
int i){interpolate_=i;};
139 int interpolate(){
return interpolate_;}
141 void page(
double pw,
double ph,
int media = 0);
142 void page(
int format);
150 int clip_box(
int x,
int y,
int w,
int h,
int &X,
int &Y,
int &W,
int &H);
157 void rect(
int x,
int y,
int w,
int h);
158 void rectf(
int x,
int y,
int w,
int h);
161 void xyline(
int x,
int y,
int x1,
int y2);
162 void xyline(
int x,
int y,
int x1,
int y2,
int x3);
165 void yxline(
int x,
int y,
int y1,
int x2);
166 void yxline(
int x,
int y,
int y1,
int x2,
int y3);
168 void line(
int x1,
int y1,
int x2,
int y2);
169 void line(
int x1,
int y1,
int x2,
int y2,
int x3,
int y3);
171 void loop(
int x0,
int y0,
int x1,
int y1,
int x2,
int y2);
172 void loop(
int x0,
int y0,
int x1,
int y1,
int x2,
int y2,
int x3,
int y3);
173 void polygon(
int x0,
int y0,
int x1,
int y1,
int x2,
int y2);
174 void polygon(
int x0,
int y0,
int x1,
int y1,
int x2,
int y2,
int x3,
int y3);
182 void curve(
double x,
double y,
double x1,
double y1,
double x2,
double y2,
double x3,
double y3);
183 void circle(
double x,
double y,
double r);
184 void arc(
double x,
double y,
double r,
double start,
double a);
185 void arc(
int x,
int y,
int w,
int h,
double a1,
double a2);
186 void pie(
int x,
int y,
int w,
int h,
double a1,
double a2);
201 void draw(
const char* s,
int nBytes,
int x,
int y) {transformed_draw(s,nBytes,x,y); };
203 void draw(
const char* s,
int nBytes,
float x,
float y) {transformed_draw(s,nBytes,x,y); };
205 void draw(
int angle,
const char *str,
int n,
int x,
int y);
210 void text_extents(
const char *c,
int n,
int &dx,
int &dy,
int &w,
int &h);
214 void draw(
Fl_Bitmap * bitmap,
int XP,
int YP,
int WP,
int HP,
int cx,
int cy);
217 int clocale_printf(
const char *format, ...);
233 static const char *class_id;
237 int start_job(
int pagecount,
int* from,
int* to);
244 void margins(
int *left,
int *top,
int *right,
int *bottom);
247 void scale (
float scale_x,
float scale_y = 0.);
unsigned int Fl_Color
An FLTK color value; see also Colors
Definition: Enumerations.H:932
void(* Fl_Draw_Image_Cb)(void *data, int x, int y, int w, uchar *buf)
signature of image generation callback function.
Definition: Fl_Device.H:49
declaration of class Fl_Paged_Device.
The Fl_Bitmap class supports caching and drawing of mono-color (bitmap) images.
Definition: Fl_Bitmap.H:33
A virtual class subclassed for each graphics driver FLTK uses.
Definition: Fl_Device.H:110
virtual void begin_polygon()
see fl_begin_polygon().
Definition: fl_vertex.cxx:81
virtual void draw(const char *str, int n, int x, int y)
see fl_draw(const char *str, int n, int x, int y).
Definition: Fl_Device.H:251
virtual void end_polygon()
see fl_end_polygon().
Definition: fl_vertex.cxx:163
Base class for image caching and drawing.
Definition: Fl_Image.H:55
Represents page-structured drawing surfaces.
Definition: Fl_Paged_Device.H:38
Page_Layout
Possible page layouts.
Definition: Fl_Paged_Device.H:86
@ PORTRAIT
Portrait orientation.
Definition: Fl_Paged_Device.H:87
Page_Format
Possible page formats.
Definition: Fl_Paged_Device.H:50
@ A4
A4 format.
Definition: Fl_Paged_Device.H:55
The Fl_Pixmap class supports caching and drawing of colormap (pixmap) images, including transparency.
Definition: Fl_Pixmap.H:41
To send graphical output to a PostScript file.
Definition: Fl_PostScript.H:226
void translate(int x, int y)
Translates the current graphics origin accounting for the current rotation.
void untranslate(void)
Undoes the effect of a previous translate() call.
static const char * file_chooser_title
Label of the PostScript file chooser window.
Definition: Fl_PostScript.H:257
int end_page(void)
To be called at the end of each page.
void origin(int x, int y)
Sets the position in page coordinates of the origin of graphics functions.
void rotate(float angle)
Rotates the graphics operations relatively to paper.
void margins(int *left, int *top, int *right, int *bottom)
Computes the dimensions of margins that lie between the printable page area and the full page.
void scale(float scale_x, float scale_y=0.)
Changes the scaling of page coordinates.
void end_job(void)
To be called at the end of a print job.
int start_page(void)
Starts a new printed page.
void origin(int *x, int *y)
Computes the page coordinates of the current origin of graphics functions.
const char * class_name()
Returns the name of the class of this object.
Definition: Fl_PostScript.H:234
int printable_rect(int *w, int *h)
Computes the width and height of the printable area of the page.
PostScript graphical backend.
Definition: Fl_PostScript.H:61
void draw(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy)
Draws an Fl_RGB_Image object to the device.
void draw(Fl_Bitmap *bitmap, int XP, int YP, int WP, int HP, int cx, int cy)
Draws an Fl_Bitmap object to the device.
void begin_polygon()
see fl_begin_polygon().
int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H)
see fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H).
void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3)
see fl_polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3).
void begin_complex_polygon()
see fl_begin_complex_polygon().
Definition: Fl_PostScript.H:191
void rect(int x, int y, int w, int h)
see fl_rect(int x, int y, int w, int h).
void color(uchar r, uchar g, uchar b)
see fl_color(uchar r, uchar g, uchar b).
void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3)
see fl_loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3).
void arc(double x, double y, double r, double start, double a)
see fl_arc(double x, double y, double r, double start, double end).
void line_style(int style, int width=0, char *dashes=0)
see fl_line_style(int style, int width, char* dashes).
void begin_line()
see fl_begin_line().
void pie(int x, int y, int w, int h, double a1, double a2)
see fl_pie(int x, int y, int w, int h, double a1, double a2).
void begin_loop()
see fl_begin_loop().
void xyline(int x, int y, int x1, int y2, int x3)
see fl_xyline(int x, int y, int x1, int y2, int x3).
void pop_clip()
see fl_pop_clip().
void begin_points()
see fl_begin_points().
void gap()
see fl_gap().
Definition: Fl_PostScript.H:192
void end_points()
see fl_end_points().
void draw_image(Fl_Draw_Image_Cb call, void *data, int x, int y, int w, int h, int delta=3)
see fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D).
void rtl_draw(const char *s, int n, int x, int y)
see fl_rtl_draw(const char *str, int n, int x, int y).
void transformed_vertex(double x, double y)
see fl_transformed_vertex(double xf, double yf).
void end_polygon()
see fl_end_polygon().
void xyline(int x, int y, int x1, int y2)
see fl_xyline(int x, int y, int x1, int y2).
void draw_image_mono(const uchar *d, int x, int y, int w, int h, int delta=1, int ld=0)
see fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D, int L).
void xyline(int x, int y, int x1)
see fl_xyline(int x, int y, int x1).
double width(const char *, int)
see fl_width(const char *str, int n).
void polygon(int x0, int y0, int x1, int y1, int x2, int y2)
see fl_polygon(int x0, int y0, int x1, int y1, int x2, int y2).
void color(Fl_Color c)
see fl_color(Fl_Color c).
void loop(int x0, int y0, int x1, int y1, int x2, int y2)
see fl_loop(int x0, int y0, int x1, int y1, int x2, int y2).
void circle(double x, double y, double r)
see fl_circle(double x, double y, double r).
void font(int face, int size)
see fl_font(Fl_Font face, Fl_Fontsize size).
void line(int x1, int y1, int x2, int y2)
see fl_line(int x, int y, int x1, int y1).
void curve(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3)
see fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3,...
const char * class_name()
Returns the name of the class of this object.
Definition: Fl_PostScript.H:72
void rectf(int x, int y, int w, int h)
see fl_rectf(int x, int y, int w, int h).
void end_loop()
see fl_end_loop().
void draw(const char *s, int nBytes, int x, int y)
see fl_draw(const char *str, int n, int x, int y).
Definition: Fl_PostScript.H:201
void push_no_clip()
see fl_push_no_clip().
double width(unsigned int u)
see fl_width(unsigned int n).
void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)
Draws an Fl_Pixmap object to the device.
void end_complex_polygon()
see fl_end_complex_polygon().
Definition: Fl_PostScript.H:193
void yxline(int x, int y, int y1, int x2, int y3)
see fl_yxline(int x, int y, int y1, int x2, int y3).
void arc(int x, int y, int w, int h, double a1, double a2)
see fl_arc(int x, int y, int w, int h, double a1, double a2).
void point(int x, int y)
see fl_point(int x, int y).
void yxline(int x, int y, int y1, int x2)
see fl_yxline(int x, int y, int y1, int x2).
void vertex(double x, double y)
see fl_vertex(double x, double y).
void yxline(int x, int y, int y1)
see fl_yxline(int x, int y, int y1).
void push_clip(int x, int y, int w, int h)
see fl_push_clip(int x, int y, int w, int h).
void line(int x1, int y1, int x2, int y2, int x3, int y3)
see fl_line(int x, int y, int x1, int y1, int x2, int y2).
void draw_image_mono(Fl_Draw_Image_Cb call, void *data, int x, int y, int w, int h, int delta=1)
see fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D).
void text_extents(const char *c, int n, int &dx, int &dy, int &w, int &h)
see fl_text_extents(const char*, int n, int& dx, int& dy, int& w, int& h).
int not_clipped(int x, int y, int w, int h)
see fl_not_clipped(int x, int y, int w, int h).
int height()
see fl_height().
int descent()
see fl_descent().
void draw_image(const uchar *d, int x, int y, int w, int h, int delta=3, int ldelta=0)
see fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L).
int draw_scaled(Fl_Image *img, int XP, int YP, int WP, int HP)
Draws an Fl_Image scaled to width W & height H with top-left corner at X,Y.
void draw(int angle, const char *str, int n, int x, int y)
see fl_draw(int angle, const char *str, int n, int x, int y).
void end_line()
see fl_end_line().
The Fl_RGB_Image class supports caching and drawing of full-color images with 1 to 4 channels of colo...
Definition: Fl_Image.H:202
virtual void set_current(void)
Make this surface the current drawing surface.
Definition: Fl_Device.cxx:44
utility header to pull drawing functions together
unsigned char uchar
unsigned char
Definition: fl_types.h:30