diff options
| author | Manolo Gouy <Manolo> | 2010-04-16 20:19:09 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2010-04-16 20:19:09 +0000 |
| commit | 913530758af63f00676c6746988aef8b35b02531 (patch) | |
| tree | d6b59be15047e3c2742158eb5063aca55ea94eba /src/Fl_Abstract_Printer.cxx | |
| parent | 0f180e130639f1017e7ca6b668357304632c1a62 (diff) | |
Improved the hierarchy of Fl_Device subclasses to allow separation of platform-specific devices.
This introduces multiple inheritance.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7520 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Abstract_Printer.cxx')
| -rw-r--r-- | src/Fl_Abstract_Printer.cxx | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/Fl_Abstract_Printer.cxx b/src/Fl_Abstract_Printer.cxx index 0490dcc68..4560ad7df 100644 --- a/src/Fl_Abstract_Printer.cxx +++ b/src/Fl_Abstract_Printer.cxx @@ -70,7 +70,7 @@ void Fl_Abstract_Printer::print_widget(Fl_Widget* widget, int delta_x, int delta int width, height; this->printable_rect(&width, &height); drawn_by_plugin = pi->print(widget, 0, 0, height); - } + } } if (!drawn_by_plugin) { widget->draw(); @@ -126,7 +126,7 @@ void Fl_Abstract_Printer::origin(int *x, int *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) { int slice, width, offset, count = 0; - Fl_Device::display_device()->set_current(); + Fl_Device *current = Fl_Device::display_device()->set_current(); Fl_Window *save_front = Fl::first_window(); win->show(); fl_gc = NULL; @@ -144,7 +144,7 @@ void Fl_Abstract_Printer::print_window_part(Fl_Window *win, int x, int y, int w, image_data[count++] = fl_read_image(NULL, x + offset, y, width, h); } save_front->show(); - this->set_current(); + current->set_current(); for ( int i = 0, offset = 0; i < count; i++, offset += slice) { width = slice; if (offset + width > w) width = w - offset; @@ -179,18 +179,6 @@ void Fl_Abstract_Printer::delete_image_list() } #endif -Fl_Device *Fl_Abstract_Printer::set_current(void) -{ -#ifdef __APPLE__ - fl_gc = (CGContextRef)gc; -#elif defined(WIN32) - fl_gc = (HDC)gc; -#else - fl_gc = (_XGC*)gc; -#endif - return this->Fl_Device::set_current(); -} - /** @brief Starts a print job. |
