summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2013-10-23 14:39:14 +0000
committerManolo Gouy <Manolo>2013-10-23 14:39:14 +0000
commit4827a696df04d50f2af5bbff2c1a1bd976b887a7 (patch)
tree11ab6037cd6812401b32784565843800e7df13dd /src
parent49e2f6e9db366b6a880679d649a3ebb7b6c9dc53 (diff)
Modified Fl_Paged_Device::print_window() so it works with any kind of Fl_Paged_Device instance.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10007 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 1a03bc135..c39b264b9 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -3435,22 +3435,21 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
this->print_widget(win, x_offset, y_offset);
return;
}
- int bx, by, bt;
+ int bx, by, bt, bpp;
get_window_frame_sizes(bx, by, bt);
Fl_Display_Device::display_device()->set_current(); // send win to front and make it current
win->show();
fl_gc = NULL;
Fl::check();
win->make_current();
- this->set_current(); // back to the Fl_Paged_Device
// capture the window title bar
- CGImageRef img = Fl_X::CGImage_from_window_rect(win, 0, -bt, win->w(), bt);
+ unsigned char *bitmap = Fl_X::bitmap_from_window_rect(win, 0, -bt, win->w(), bt, &bpp);
// and print it
- CGRect rect = { { x_offset, y_offset }, { win->w(), bt } };
- Fl_X::q_begin_image(rect, 0, 0, win->w(), bt);
- CGContextDrawImage(fl_gc, rect, img);
- Fl_X::q_end_image();
- CFRelease(img);
+ this->set_current(); // back to the Fl_Paged_Device
+ Fl_RGB_Image *rgb = new Fl_RGB_Image(bitmap, win->w(), bt, bpp);
+ rgb->draw(x_offset, y_offset);
+ delete rgb;
+ delete[] bitmap;
this->print_widget(win, x_offset, y_offset + bt); // print the window inner part
}