21 #ifndef Fl_PostScript_H 22 #define Fl_PostScript_H 30 typedef int (Fl_PostScript_Close_Command)(FILE *);
42 class FL_EXPORT Fl_PostScript_Graphics_Driver :
public Fl_Graphics_Driver {
44 void transformed_draw_extra(
const char* str,
int n,
double x,
double y,
int w,
bool rtl);
45 void *prepare_rle85();
46 void write_rle85(
uchar b,
void *data);
47 void close_rle85(
void *data);
49 void write85(
void *data,
const uchar *p,
int len);
50 void close85(
void *data);
51 int scale_for_image_(
Fl_Image *img,
int XP,
int YP,
int WP,
int HP,
int cx,
int cy);
53 uchar **mask_bitmap() {
return &mask;}
55 Fl_PostScript_Graphics_Driver();
57 enum SHAPE{NONE=0, LINE, LOOP, POLYGON, POINTS};
77 unsigned char cr_,cg_,cb_;
88 Fl_PostScript_Close_Command* close_cmd_;
102 uchar bg_r, bg_g, bg_b;
106 void transformed_draw(
const char* s,
int n,
double x,
double y);
107 void transformed_draw(
const char* s,
double x,
double y);
108 int alpha_mask(
const uchar * data,
int w,
int h,
int D,
int LD=0);
113 void page_policy(
int p);
114 int page_policy(){
return page_policy_;};
115 void close_command(Fl_PostScript_Close_Command* cmd){close_cmd_=cmd;};
116 FILE * file() {
return output;};
120 void interpolate(
int i){interpolate_=i;};
121 int interpolate(){
return interpolate_;}
123 void page(
double pw,
double ph,
int media = 0);
124 void page(
int format);
131 void push_clip(
int x,
int y,
int w,
int h);
132 int clip_box(
int x,
int y,
int w,
int h,
int &X,
int &Y,
int &W,
int &H);
133 int not_clipped(
int x,
int y,
int w,
int h);
137 void line_style(
int style,
int width=0,
char* dashes=0);
139 void rect(
int x,
int y,
int w,
int h);
140 void rectf(
int x,
int y,
int w,
int h);
142 void xyline(
int x,
int y,
int x1);
143 void xyline(
int x,
int y,
int x1,
int y2);
144 void xyline(
int x,
int y,
int x1,
int y2,
int x3);
146 void yxline(
int x,
int y,
int y1);
147 void yxline(
int x,
int y,
int y1,
int x2);
148 void yxline(
int x,
int y,
int y1,
int x2,
int y3);
150 void line(
int x1,
int y1,
int x2,
int y2);
151 void line(
int x1,
int y1,
int x2,
int y2,
int x3,
int y3);
153 void loop(
int x0,
int y0,
int x1,
int y1,
int x2,
int y2);
154 void loop(
int x0,
int y0,
int x1,
int y1,
int x2,
int y2,
int x3,
int y3);
155 void polygon(
int x0,
int y0,
int x1,
int y1,
int x2,
int y2);
156 void polygon(
int x0,
int y0,
int x1,
int y1,
int x2,
int y2,
int x3,
int y3);
157 void point(
int x,
int y);
162 void begin_polygon();
163 void vertex(
double x,
double y);
164 void curve(
double x,
double y,
double x1,
double y1,
double x2,
double y2,
double x3,
double y3);
165 void circle(
double x,
double y,
double r);
166 void arc(
double x,
double y,
double r,
double start,
double a);
167 void arc(
int x,
int y,
int w,
int h,
double a1,
double a2);
168 void pie(
int x,
int y,
int w,
int h,
double a1,
double a2);
173 void begin_complex_polygon(){begin_polygon();};
175 void end_complex_polygon(){end_polygon();};
176 void transformed_vertex(
double x,
double y);
178 void draw_image(
const uchar* d,
int x,
int y,
int w,
int h,
int delta=3,
int ldelta=0);
179 void draw_image_mono(
const uchar* d,
int x,
int y,
int w,
int h,
int delta=1,
int ld=0);
180 void draw_image(Fl_Draw_Image_Cb call,
void* data,
int x,
int y,
int w,
int h,
int delta=3);
181 void draw_image_mono(Fl_Draw_Image_Cb call,
void* data,
int x,
int y,
int w,
int h,
int delta=1);
183 void draw(
const char* s,
int nBytes,
int x,
int y) {transformed_draw(s,nBytes,x,y); };
184 void draw(
const char* s,
int nBytes,
float x,
float y) {transformed_draw(s,nBytes,x,y); };
185 void draw(
int angle,
const char *str,
int n,
int x,
int y);
186 void rtl_draw(
const char* s,
int n,
int x,
int y);
187 void font(
int face,
int size);
188 double width(
const char *,
int);
189 double width(
unsigned int u);
190 void text_extents(
const char *c,
int n,
int &dx,
int &dy,
int &w,
int &h);
193 void draw_pixmap(
Fl_Pixmap * pxm,
int XP,
int YP,
int WP,
int HP,
int cx,
int cy);
194 void draw_bitmap(
Fl_Bitmap * bitmap,
int XP,
int YP,
int WP,
int HP,
int cx,
int cy);
195 void draw_rgb(
Fl_RGB_Image * rgb,
int XP,
int YP,
int WP,
int HP,
int cx,
int cy);
202 int clocale_printf(
const char *format, ...);
203 ~Fl_PostScript_Graphics_Driver();
205 Fl_Bitmask create_bitmask(
int w,
int h,
const uchar *array) {
return 0L; }
206 virtual int has_feature(driver_feature feature_mask) {
return feature_mask & PRINTER; }
208 int start_eps(
int width,
int height);
209 void ps_origin(
int x,
int y);
210 void ps_translate(
int,
int);
211 void ps_untranslate();
253 Fl_PostScript_Graphics_Driver *driver();
264 int begin_job(
int pagecount,
int* from,
int* to,
char **perr_message);
280 return begin_job(pagecount, format, layout);
298 return begin_job(ps_output, pagecount, format, layout);
301 int begin_page (
void);
302 int printable_rect(
int *w,
int *h);
303 void margins(
int *left,
int *top,
int *right,
int *bottom);
304 void origin(
int *x,
int *y);
305 void origin(
int x,
int y);
306 void scale (
float scale_x,
float scale_y = 0.);
307 void rotate(
float angle);
308 void translate(
int x,
int y);
309 void untranslate(
void);
315 FILE *
file() {
return driver()->file(); }
358 virtual int printable_rect(
int *w,
int *h);
360 FILE *
file() {
return driver() ? driver()->output : NULL; }
361 virtual void origin(
int x,
int y);
362 virtual void origin(
int *px,
int *py);
363 virtual void translate(
int x,
int y);
364 virtual void untranslate();
370 #endif // Fl_PostScript_H Represents page-structured drawing surfaces.
Definition: Fl_Paged_Device.H:36
Encapsulated PostScript drawing surface.
Definition: Fl_PostScript.H:336
The Fl_Pixmap class supports caching and drawing of colormap (pixmap) images, including transparency...
Definition: Fl_Pixmap.H:36
Page_Layout
Possible page layouts.
Definition: Fl_Paged_Device.H:82
Base class for image caching, scaling and drawing.
Definition: Fl_Image.H:62
The Fl_RGB_Image class supports caching and drawing of full-color images with 1 to 4 channels of colo...
Definition: Fl_Image.H:287
int start_job(FILE *ps_output, int pagecount=0, enum Fl_Paged_Device::Page_Format format=Fl_Paged_Device::A4, enum Fl_Paged_Device::Page_Layout layout=Fl_Paged_Device::PORTRAIT)
Synonym of begin_job().
Definition: Fl_PostScript.H:296
FILE * file()
Returns the underlying FILE pointer.
Definition: Fl_PostScript.H:360
FILE * file()
Returns the underlying FILE* receiving all PostScript data.
Definition: Fl_PostScript.H:315
Fl_PostScript_Graphics_Driver * driver()
Returns the PostScript driver of this drawing surface.
Definition: Fl_PostScript.H:341
static const char * file_chooser_title
Label of the PostScript file chooser window.
Definition: Fl_PostScript.H:313
declaration of class Fl_Paged_Device.
Page_Format
Possible page formats.
Definition: Fl_Paged_Device.H:46
utility header to pull drawing functions together
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition: Enumerations.H:1042
The Fl_Bitmap class supports caching and drawing of mono-color (bitmap) images.
Definition: Fl_Bitmap.H:32
A4 format.
Definition: Fl_Paged_Device.H:51
To send graphical output to a PostScript file.
Definition: Fl_PostScript.H:248
Portrait orientation.
Definition: Fl_Paged_Device.H:83
int start_job(int pagecount=0, enum Fl_Paged_Device::Page_Format format=Fl_Paged_Device::A4, enum Fl_Paged_Device::Page_Layout layout=Fl_Paged_Device::PORTRAIT)
Synonym of begin_job().
Definition: Fl_PostScript.H:278
unsigned char uchar
unsigned char
Definition: fl_types.h:28
Fl_Graphics_Driver * driver()
Returns the graphics driver of this drawing surface.
Definition: Fl_Device.H:82