FLTK 1.4.0
|
Encapsulated PostScript drawing surface. More...
#include <Fl_PostScript.H>
Public Member Functions | |
int | close () |
Completes all EPS output. | |
FILE * | file () |
Returns the underlying FILE pointer. | |
Fl_EPS_File_Surface (int width, int height, FILE *eps_output, Fl_Color background=FL_WHITE, Fl_PostScript_Close_Command closef=NULL) | |
Constructor. | |
void | origin (int *px, int *py) FL_OVERRIDE |
Computes the coordinates of the current origin of graphics functions. | |
void | origin (int x, int y) FL_OVERRIDE |
Sets the position of the origin of graphics in the drawable part of the drawing surface. | |
int | printable_rect (int *w, int *h) FL_OVERRIDE |
Computes the width and height of the drawable area of the drawing surface. | |
void | translate (int x, int y) FL_OVERRIDE |
Translates the current graphics origin accounting for the current rotation. | |
void | untranslate () FL_OVERRIDE |
Undoes the effect of a previous translate() call. | |
~Fl_EPS_File_Surface () | |
Destructor. | |
Public Member Functions inherited from Fl_Widget_Surface | |
void | draw (Fl_Widget *widget, int delta_x=0, int delta_y=0) |
Draws the widget on the drawing surface. | |
void | draw_decorated_window (Fl_Window *win, int x_offset=0, int y_offset=0) |
Draws a window with its title bar and frame if any. | |
void | print_window_part (Fl_Window *win, int x, int y, int w, int h, int delta_x=0, int delta_y=0) |
Draws a rectangular part of an on-screen window. | |
Public Member Functions inherited from Fl_Surface_Device | |
Fl_Graphics_Driver * | driver () |
Returns the graphics driver of this drawing surface. | |
virtual bool | is_current () |
Is this surface the current drawing surface? | |
virtual void | set_current (void) |
Make this surface the current drawing surface. | |
virtual | ~Fl_Surface_Device () |
The destructor. | |
Protected Member Functions | |
Fl_PostScript_Graphics_Driver * | driver () |
Returns the PostScript driver of this drawing surface. | |
Protected Member Functions inherited from Fl_Widget_Surface | |
Fl_Widget_Surface (Fl_Graphics_Driver *d) | |
The constructor. | |
Protected Member Functions inherited from Fl_Surface_Device | |
void | driver (Fl_Graphics_Driver *graphics_driver) |
Sets the graphics driver of this drawing surface. | |
virtual void | end_current () |
FLTK calls this each time a surface ceases to be the current drawing surface. | |
Fl_Surface_Device (Fl_Graphics_Driver *graphics_driver) | |
Constructor that sets the graphics driver to use for the created surface. | |
Additional Inherited Members | |
Static Public Member Functions inherited from Fl_Surface_Device | |
static Fl_Surface_Device * | pop_current () |
Removes the top element from the current drawing surface stack, and makes the new top element current. | |
static void | push_current (Fl_Surface_Device *new_current) |
Pushes new_current on top of the stack of current drawing surfaces, and makes it current. | |
static Fl_Surface_Device * | surface () |
The current drawing surface. | |
Protected Attributes inherited from Fl_Widget_Surface | |
int | x_offset |
horizontal offset to the origin of graphics coordinates | |
int | y_offset |
vertical offset to the origin of graphics coordinates | |
Encapsulated PostScript drawing surface.
This drawing surface allows to store any FLTK graphics in vectorial form in an "Encapsulated PostScript" file.
Usage example:
Fl_EPS_File_Surface::Fl_EPS_File_Surface | ( | int | width, |
int | height, | ||
FILE * | eps_output, | ||
Fl_Color | background = FL_WHITE , |
||
Fl_PostScript_Close_Command | closef = NULL |
||
) |
Constructor.
width,height | Width and height of the EPS drawing area |
eps_output | A writable FILE pointer where the Encapsulated PostScript data will be sent |
background | Color expected to cover the background of the EPS drawing area. This parameter affects only the drawing of transparent Fl_RGB_Image objects: transparent areas of RGB images are blended with the background color. Under the X11 + pango platform, transparent RGB images are correctly blended to their background, thus this parameter has no effect. |
closef | If not NULL, the destructor or close() will call closef(eps_output) after all EPS data has been sent. If NULL, fclose(eps_output) is called instead. This allows to close the FILE pointer by, e.g., pclose , or, using a function such as "int keep_open(FILE*){return 0;}" , to keep it open after completion of all output to eps_output . Function closef should return non zero to indicate an error. |
Fl_EPS_File_Surface::~Fl_EPS_File_Surface | ( | ) |
Destructor.
By default, the destructor closes with function fclose()
the underlying FILE. See the constructor for how to close it differently or to keep it open. Use close() before object destruction to receive the status code of output operations. If close() is not used and if EPS output results in error, the destructor displays an alert message with fl_alert().
int Fl_EPS_File_Surface::close | ( | ) |
Completes all EPS output.
The only operation possible with the Fl_EPS_File_Surface object after calling close() is its destruction.
|
virtual |
Computes the coordinates of the current origin of graphics functions.
[out] | x,y | If non-null, *x and *y are set to the horizontal and vertical coordinates of the graphics origin. |
Reimplemented from Fl_Widget_Surface.
|
virtual |
Sets the position of the origin of graphics in the drawable part of the drawing surface.
Arguments should be expressed relatively to the result of a previous printable_rect() call. That is, printable_rect(&w, &h); origin(w/2, 0);
sets the graphics origin at the top center of the drawable area. Successive origin() calls don't combine their effects. Origin() calls are not affected by rotate() calls (for classes derived from Fl_Paged_Device).
[in] | x,y | Horizontal and vertical positions in the drawing surface of the desired origin of graphics. |
Reimplemented from Fl_Widget_Surface.
|
virtual |
Computes the width and height of the drawable area of the drawing surface.
Values are in the same unit as that used by FLTK drawing functions and are unchanged by calls to origin(). If the object is derived from class Fl_Paged_Device, values account for the user-selected paper type and print orientation and are changed by scale() calls.
Reimplemented from Fl_Widget_Surface.
|
virtual |
Translates the current graphics origin accounting for the current rotation.
Each translate() call must be matched by an untranslate() call. Successive translate() calls add up their effects.
Reimplemented from Fl_Widget_Surface.
|
virtual |
Undoes the effect of a previous translate() call.
Reimplemented from Fl_Widget_Surface.