FLTK 1.4.0
|
A drawing surface that's susceptible to receive graphical output. More...
#include <Fl_Device.H>
Public Member Functions | |
Fl_Graphics_Driver * | driver () |
Returns the graphics driver of this drawing surface. | |
virtual bool | is_current () |
Is this surface the current drawing surface? More... | |
virtual void | set_current (void) |
Make this surface the current drawing surface. More... | |
virtual | ~Fl_Surface_Device () |
The destructor. | |
Static Public Member Functions | |
static Fl_Surface_Device * | pop_current () |
Removes the top element from the current drawing surface stack, and makes the new top element current. More... | |
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. More... | |
static Fl_Surface_Device * | surface () |
The current drawing surface. More... | |
Protected Member Functions | |
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. More... | |
Fl_Surface_Device (Fl_Graphics_Driver *graphics_driver) | |
Constructor that sets the graphics driver to use for the created surface. | |
A drawing surface that's susceptible to receive graphical output.
Any FLTK application has at any time a current drawing surface to which all drawing requests are directed. The current surface is given by Fl_Surface_Device::surface(). When main() begins running, the current drawing surface has been set to the computer's display, an instance of the Fl_Display_Device class.
A drawing surface other than the computer's display, is typically used as follows:
surface
, an object from an Fl_Surface_Device derived class (e.g., Fl_Image_Surface, Fl_Printer, Fl_Copy_Surface). Fl_Surface_Device::push_current(surface)
; to redirect all graphics requests to surface
which becomes the new current drawing surface (not necessary with classes Fl_Printer / Fl_PostScript_File_Device / Fl_PDF_File_Surface because it is done by Fl_Paged_Device::begin_page()). Fl_Surface_Device::pop_current()
; (not necessary with classes Fl_Printer / Fl_PostScript_File_Device / Fl_PDF_File_Surface). surface
. For back-compatibility, it is also possible to use the Fl_Surface_Device::set_current() member function to change the current drawing surface, once to the new surface, once to the previous one.
|
inlineprotectedvirtual |
FLTK calls this each time a surface ceases to be the current drawing surface.
This member function is mostly of interest to developers of new Fl_Surface_Device derived classes. It allows to perform surface-specific operations necessary when this surface ceases to be current. Each implementation should end with a call to Fl_Surface_Device::end_current().
Reimplemented in Fl_PostScript_File_Device.
|
virtual |
Is this surface the current drawing surface?
Reimplemented in Fl_Copy_Surface, Fl_Image_Surface, Fl_PDF_File_Surface, and Fl_Printer.
|
static |
Removes the top element from the current drawing surface stack, and makes the new top element current.
|
static |
Pushes new_current
on top of the stack of current drawing surfaces, and makes it current.
new_current
will receive all future graphics requests.
Any call to push_current() must be matched by a subsequent call to Fl_Surface_Device::pop_current(). The max height of this stack is 16.
|
virtual |
Make this surface the current drawing surface.
This surface will receive all future graphics requests. Starting
from FLTK 1.4.0, the preferred API to change the current drawing surface is Fl_Surface_Device::push_current( ) / Fl_Surface_Device::pop_current().
Reimplemented in Fl_Copy_Surface, Fl_Image_Surface, Fl_PDF_File_Surface, Fl_PostScript_File_Device, and Fl_Printer.
|
inlinestatic |
The current drawing surface.
In other words, the Fl_Surface_Device object that currently receives all graphics requests.