summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FL/Fl_Paged_Device.H11
-rw-r--r--FL/Fl_Printer.H3
-rw-r--r--src/Fl_GDI_Printer.cxx1
-rw-r--r--src/Fl_Paged_Device.cxx6
-rw-r--r--src/Fl_Printer.cxx7
5 files changed, 16 insertions, 12 deletions
diff --git a/FL/Fl_Paged_Device.H b/FL/Fl_Paged_Device.H
index 99ac9e332..05db7fda5 100644
--- a/FL/Fl_Paged_Device.H
+++ b/FL/Fl_Paged_Device.H
@@ -108,26 +108,23 @@ public:
*/
static const page_format page_formats[NO_PAGE_FORMATS];
-private:
#ifdef __APPLE__
struct chain_elt {
- Fl_Image *image;
const uchar *data;
struct chain_elt *next;
};
- void add_image(Fl_Image *image, const uchar *data); // adds an image to the page image list
#endif
+private:
void traverse(Fl_Widget *widget); // finds subwindows of widget and prints them
protected:
/** \brief horizontal offset to the origin of graphics coordinates */
int x_offset;
/** \brief vertical offset to the origin of graphics coordinates */
int y_offset;
- /** \brief chained list of Fl_Image's used in this page */
- struct chain_elt *image_list_;
#ifdef __APPLE__
- /** \brief deletes the page image list */
- void delete_image_list();
+ struct chain_elt *image_list_; // chained list of images used in this page
+ virtual void add_image(const uchar *data); // adds an image to the page image list
+ void delete_image_list(); // deletes the page image list
#endif
/** \brief The constructor */
Fl_Paged_Device() : Fl_Surface_Device(NULL) {class_name( class_id);};
diff --git a/FL/Fl_Printer.H b/FL/Fl_Printer.H
index 66ae5e677..092bec18f 100644
--- a/FL/Fl_Printer.H
+++ b/FL/Fl_Printer.H
@@ -164,6 +164,9 @@ public:
void untranslate(void);
int end_page (void);
void end_job (void);
+#ifdef __APPLE__
+ void add_image(const uchar *data);
+#endif
/** \brief The destructor */
~Fl_Printer(void);
diff --git a/src/Fl_GDI_Printer.cxx b/src/Fl_GDI_Printer.cxx
index bcd1569ab..9bd64f0c9 100644
--- a/src/Fl_GDI_Printer.cxx
+++ b/src/Fl_GDI_Printer.cxx
@@ -194,7 +194,6 @@ int Fl_System_Printer::start_page (void)
}
printable_rect(&w, &h);
origin(0, 0);
- image_list_ = NULL;
fl_clip_region(0);
gc = (void *)fl_gc;
}
diff --git a/src/Fl_Paged_Device.cxx b/src/Fl_Paged_Device.cxx
index dd3e32dec..ba3014456 100644
--- a/src/Fl_Paged_Device.cxx
+++ b/src/Fl_Paged_Device.cxx
@@ -156,7 +156,7 @@ void Fl_Paged_Device::print_window_part(Fl_Window *win, int x, int y, int w, int
if (offset + width > w) width = w - offset;
fl_draw_image(image_data[i], delta_x + offset, delta_y, width, h, 3);
#ifdef __APPLE__
- add_image(NULL, image_data[i]);
+ add_image(image_data[i]);
#else
delete image_data[i];
#endif
@@ -164,10 +164,9 @@ void Fl_Paged_Device::print_window_part(Fl_Window *win, int x, int y, int w, int
}
#ifdef __APPLE__
-void Fl_Paged_Device::add_image(Fl_Image *image, const uchar *data)
+void Fl_Paged_Device::add_image(const uchar *data)
{
struct chain_elt *elt = (struct chain_elt *)calloc(sizeof(struct chain_elt), 1);
- elt->image = image;
elt->data = data;
if (image_list_) { elt->next = image_list_; }
image_list_ = elt;
@@ -177,7 +176,6 @@ void Fl_Paged_Device::delete_image_list()
{
while(image_list_) {
struct chain_elt *next = image_list_->next;
- if(image_list_->image) delete image_list_->image;
if (image_list_->data) delete (uchar*) image_list_->data; // msvc6 compilation fix
free(image_list_);
image_list_ = next;
diff --git a/src/Fl_Printer.cxx b/src/Fl_Printer.cxx
index b4fb0d99d..40b37ccbe 100644
--- a/src/Fl_Printer.cxx
+++ b/src/Fl_Printer.cxx
@@ -160,6 +160,13 @@ void Fl_Printer::end_job (void)
printer->end_job();
}
+#ifdef __APPLE__
+void Fl_Printer::add_image(const uchar *data)
+{
+ printer->add_image(data);
+}
+#endif
+
Fl_Printer::~Fl_Printer(void)
{
delete printer;