Renamed class Fl_Virtual_Printer into Fl_Abstract_Printer

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7301 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2010-03-18 18:02:50 +00:00
parent c72a57a56b
commit cf37057367
8 changed files with 32 additions and 32 deletions

View File

@ -44,7 +44,7 @@ class Fl_RGB_Image;
class Fl_Pixmap; class Fl_Pixmap;
class Fl_Bitmap; class Fl_Bitmap;
class Fl_Display; class Fl_Display;
class Fl_Virtual_Printer; class Fl_Abstract_Printer;
extern Fl_Display *fl_display_device; extern Fl_Display *fl_display_device;
typedef void (*Fl_Draw_Image_Cb)(void* ,int,int,int,uchar*); typedef void (*Fl_Draw_Image_Cb)(void* ,int,int,int,uchar*);
@ -237,7 +237,7 @@ public:
: Fl_Plugin(klass(), name) { } : Fl_Plugin(klass(), name) { }
virtual const char *klass() { return "fltk:device"; } virtual const char *klass() { return "fltk:device"; }
virtual const char *name() = 0; virtual const char *name() = 0;
virtual int print(Fl_Virtual_Printer*, Fl_Widget*, int x, int y) { return 0; } virtual int print(Fl_Abstract_Printer*, Fl_Widget*, int x, int y) { return 0; }
}; };
#endif // Fl_Device_H #endif // Fl_Device_H

View File

@ -51,7 +51,7 @@
*/ */
class class
#ifndef FL_DOXYGEN #ifndef FL_DOXYGEN
Fl_Virtual_Printer Fl_Abstract_Printer
#else #else
Fl_Printer Fl_Printer
#endif #endif
@ -74,7 +74,7 @@ protected:
void *gc; // the printer's graphics context, if there's one, NULL otherwise void *gc; // the printer's graphics context, if there's one, NULL otherwise
void delete_image_list(); // deletes the page image list void delete_image_list(); // deletes the page image list
#ifndef FL_DOXYGEN #ifndef FL_DOXYGEN
Fl_Virtual_Printer(void) { gc = NULL; bg_r_ = bg_g_ = bg_b_ = 0; }; Fl_Abstract_Printer(void) { gc = NULL; bg_r_ = bg_g_ = bg_b_ = 0; };
#endif #endif
public: public:
#ifdef FL_DOXYGEN #ifdef FL_DOXYGEN
@ -234,7 +234,7 @@ public:
}; };
#ifdef __APPLE__ #ifdef __APPLE__
class Fl_Quartz_Printer : public Fl_Virtual_Printer { class Fl_Quartz_Printer : public Fl_Abstract_Printer {
private: private:
float scale_x; float scale_x;
float scale_y; float scale_y;
@ -259,7 +259,7 @@ public:
#endif #endif
#ifdef WIN32 #ifdef WIN32
class Fl_GDI_Printer : public Fl_Virtual_Printer { class Fl_GDI_Printer : public Fl_Abstract_Printer {
private: private:
int abortPrint; int abortPrint;
PRINTDLG pd; PRINTDLG pd;
@ -293,7 +293,7 @@ public:
*/ */
class Fl_PSfile_Device : public class Fl_PSfile_Device : public
#ifndef FL_DOXYGEN #ifndef FL_DOXYGEN
Fl_Virtual_Printer Fl_Abstract_Printer
#else #else
Fl_Device Fl_Device
#endif #endif

View File

@ -266,7 +266,7 @@ Fl_Bitmask fl_create_alphamask(int w, int h, int d, int ld, const uchar *array)
void Fl_Bitmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) { void Fl_Bitmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
if(fl_device->type() == Fl_Device::postscript_device) { if(fl_device->type() == Fl_Device::postscript_device) {
((Fl_Virtual_Printer*)fl_device)->draw(this, XP, YP, WP, HP, cx, cy); ((Fl_Abstract_Printer*)fl_device)->draw(this, XP, YP, WP, HP, cx, cy);
return; return;
} }
if (!array) { if (!array) {

View File

@ -1,7 +1,7 @@
// //
// "$Id$" // "$Id$"
// //
// implementation of Fl_Device and Fl_Virtual_Printer classes for the Fast Light Tool Kit (FLTK). // implementation of Fl_Device and Fl_Abstract_Printer classes for the Fast Light Tool Kit (FLTK).
// //
// Copyright 2010 by Bill Spitzak and others. // Copyright 2010 by Bill Spitzak and others.
// //
@ -48,7 +48,7 @@ void Fl_Device::draw(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, i
// presently, never gets called // presently, never gets called
} }
void Fl_Virtual_Printer::print_widget(Fl_Widget* widget, int delta_x, int delta_y) void Fl_Abstract_Printer::print_widget(Fl_Widget* widget, int delta_x, int delta_y)
{ {
int old_x, old_y, new_x, new_y, is_window; int old_x, old_y, new_x, new_y, is_window;
if ( ! widget->visible() ) return; if ( ! widget->visible() ) return;
@ -87,7 +87,7 @@ void Fl_Virtual_Printer::print_widget(Fl_Widget* widget, int delta_x, int delta_
} }
void Fl_Virtual_Printer::traverse(Fl_Widget *widget) void Fl_Abstract_Printer::traverse(Fl_Widget *widget)
{ {
Fl_Group *g = widget->as_group(); Fl_Group *g = widget->as_group();
if (!g) return; if (!g) return;
@ -102,13 +102,13 @@ void Fl_Virtual_Printer::traverse(Fl_Widget *widget)
} }
} }
void Fl_Virtual_Printer::origin(int *x, int *y) void Fl_Abstract_Printer::origin(int *x, int *y)
{ {
if (x) *x = x_offset; if (x) *x = x_offset;
if (y) *y = y_offset; if (y) *y = y_offset;
} }
void Fl_Virtual_Printer::print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x, int delta_y) void Fl_Abstract_Printer::print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x, int delta_y)
{ {
Fl_Device::display_device()->set_current(); Fl_Device::display_device()->set_current();
Fl_Window *save_front = Fl::first_window(); Fl_Window *save_front = Fl::first_window();
@ -128,7 +128,7 @@ void Fl_Virtual_Printer::print_window_part(Fl_Window *win, int x, int y, int w,
#endif #endif
} }
void Fl_Virtual_Printer::add_image(Fl_Image *image, const uchar *data) void Fl_Abstract_Printer::add_image(Fl_Image *image, const uchar *data)
{ {
struct chain_elt *elt = (struct chain_elt *)calloc(sizeof(struct chain_elt), 1); struct chain_elt *elt = (struct chain_elt *)calloc(sizeof(struct chain_elt), 1);
elt->image = image; elt->image = image;
@ -137,7 +137,7 @@ void Fl_Virtual_Printer::add_image(Fl_Image *image, const uchar *data)
image_list_ = elt; image_list_ = elt;
} }
void Fl_Virtual_Printer::delete_image_list() void Fl_Abstract_Printer::delete_image_list()
{ {
while(image_list_) { while(image_list_) {
struct chain_elt *next = image_list_->next; struct chain_elt *next = image_list_->next;
@ -148,7 +148,7 @@ void Fl_Virtual_Printer::delete_image_list()
} }
} }
Fl_Device *Fl_Virtual_Printer::set_current(void) Fl_Device *Fl_Abstract_Printer::set_current(void)
{ {
#ifdef __APPLE__ #ifdef __APPLE__
fl_gc = (CGContextRef)gc; fl_gc = (CGContextRef)gc;
@ -161,17 +161,17 @@ Fl_Device *Fl_Virtual_Printer::set_current(void)
} }
int Fl_Virtual_Printer::start_job(int pagecount, int *frompage, int *topage) {return 1;} int Fl_Abstract_Printer::start_job(int pagecount, int *frompage, int *topage) {return 1;}
int Fl_Virtual_Printer::start_page (void) {return 1;} int Fl_Abstract_Printer::start_page (void) {return 1;}
int Fl_Virtual_Printer::printable_rect(int *w, int *h) {return 1;} int Fl_Abstract_Printer::printable_rect(int *w, int *h) {return 1;}
void Fl_Virtual_Printer::margins(int *left, int *top, int *right, int *bottom) {} void Fl_Abstract_Printer::margins(int *left, int *top, int *right, int *bottom) {}
void Fl_Virtual_Printer::origin(int x, int y) {} void Fl_Abstract_Printer::origin(int x, int y) {}
void Fl_Virtual_Printer::scale (float scale_x, float scale_y) {} void Fl_Abstract_Printer::scale (float scale_x, float scale_y) {}
void Fl_Virtual_Printer::rotate(float angle) {} void Fl_Abstract_Printer::rotate(float angle) {}
int Fl_Virtual_Printer::end_page (void) {return 1;} int Fl_Abstract_Printer::end_page (void) {return 1;}
void Fl_Virtual_Printer::end_job (void) {} void Fl_Abstract_Printer::end_job (void) {}
void Fl_Virtual_Printer::translate(int x, int y) {} void Fl_Abstract_Printer::translate(int x, int y) {}
void Fl_Virtual_Printer::untranslate(void) {} void Fl_Abstract_Printer::untranslate(void) {}
extern Fl_Device *fl_device; extern Fl_Device *fl_device;

View File

@ -34,7 +34,7 @@
extern HWND fl_window; extern HWND fl_window;
Fl_GDI_Printer::Fl_GDI_Printer(void) : Fl_Virtual_Printer() { Fl_GDI_Printer::Fl_GDI_Printer(void) : Fl_Abstract_Printer() {
hPr = NULL; hPr = NULL;
type_ = gdi_printer; type_ = gdi_printer;
} }

View File

@ -40,7 +40,7 @@ static void imgProviderReleaseData (void *info, const void *data, size_t size)
} }
#endif #endif
static void print_gl_window(Fl_Virtual_Printer *printer, Fl_Gl_Window *glw, int x, int y) static void print_gl_window(Fl_Abstract_Printer *printer, Fl_Gl_Window *glw, int x, int y)
{ {
#ifdef WIN32 #ifdef WIN32
HDC save_gc = fl_gc; HDC save_gc = fl_gc;
@ -129,7 +129,7 @@ class Fl_Gl_Device_Plugin : public Fl_Device_Plugin {
public: public:
Fl_Gl_Device_Plugin() : Fl_Device_Plugin(name()) { } Fl_Gl_Device_Plugin() : Fl_Device_Plugin(name()) { }
virtual const char *name() { return "opengl.device.fltk.org"; } virtual const char *name() { return "opengl.device.fltk.org"; }
virtual int print(Fl_Virtual_Printer *p, Fl_Widget *w, int x, int y) { virtual int print(Fl_Abstract_Printer *p, Fl_Widget *w, int x, int y) {
Fl_Gl_Window *glw = w->as_gl_window(); Fl_Gl_Window *glw = w->as_gl_window();
if (!glw) return 0; if (!glw) return 0;
print_gl_window(p, glw, x, y); print_gl_window(p, glw, x, y);

View File

@ -436,7 +436,7 @@ static void alpha_blend(Fl_RGB_Image *img, int X, int Y, int W, int H, int cx, i
void Fl_RGB_Image::draw(int XP, int YP, int WP, int HP, int cx, int cy) { void Fl_RGB_Image::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
if(fl_device->type() == Fl_Device::postscript_device) { if(fl_device->type() == Fl_Device::postscript_device) {
((Fl_Virtual_Printer*)fl_device)->draw(this, XP, YP, WP, HP, cx, cy); ((Fl_Abstract_Printer*)fl_device)->draw(this, XP, YP, WP, HP, cx, cy);
return; return;
} }
// Don't draw an empty image... // Don't draw an empty image...

View File

@ -76,7 +76,7 @@ void Fl_Pixmap::measure() {
void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) { void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
if(fl_device->type() == Fl_Device::postscript_device) { if(fl_device->type() == Fl_Device::postscript_device) {
((Fl_Virtual_Printer*)fl_device)->draw(this, XP, YP, WP, HP, cx, cy); ((Fl_Abstract_Printer*)fl_device)->draw(this, XP, YP, WP, HP, cx, cy);
return; return;
} }
// ignore empty or bad pixmap data: // ignore empty or bad pixmap data: