summaryrefslogtreecommitdiff
path: root/FL/x.H
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2010-07-09 17:31:33 +0000
committerManolo Gouy <Manolo>2010-07-09 17:31:33 +0000
commit8306c3d0b31d4e60a9ba9c4d0ca4ed6a32226de1 (patch)
tree03b7946071d9ded7cdc647da9a88b6414b3e9897 /FL/x.H
parent0ac2bc4d40209005b37931bc4541c2af777635fa (diff)
Fixed fl_XXX_offscreen functions when the current output goes to a printer or a PostScript device
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7671 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/x.H')
-rw-r--r--FL/x.H16
1 files changed, 10 insertions, 6 deletions
diff --git a/FL/x.H b/FL/x.H
index 6c2bb07c7..81022cf15 100644
--- a/FL/x.H
+++ b/FL/x.H
@@ -110,16 +110,20 @@ extern FL_EXPORT ulong fl_event_time;
// off-screen pixmaps: create, destroy, draw into, copy to window:
typedef ulong Fl_Offscreen;
-#define fl_create_offscreen(w,h) \
- XCreatePixmap(fl_display, fl_window, w, h, fl_visual->depth)
+# define fl_create_offscreen(w,h) \
+ XCreatePixmap(fl_display, \
+ (fl_surface->type() == Fl_Display_Device::device_type ? \
+ fl_window : fl_xid(Fl::first_window()) ) , \
+ w, h, fl_visual->depth)
// begin/end are macros that save the old state in local variables:
# define fl_begin_offscreen(pixmap) \
- Window _sw=fl_window; fl_window=pixmap; fl_push_no_clip()
+ Window _sw=fl_window; fl_window=pixmap; \
+ Fl_Surface_Device *_ss = fl_surface; fl_display_device->set_current(); \
+ fl_push_no_clip()
# define fl_end_offscreen() \
- fl_pop_clip(); fl_window = _sw
+ fl_pop_clip(); fl_window = _sw; _ss->set_current()
-# define fl_copy_offscreen(x,y,w,h,pixmap,srcx,srcy) \
- XCopyArea(fl_display, pixmap, fl_window, fl_gc, srcx, srcy, w, h, x, y)
+extern void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
# define fl_delete_offscreen(pixmap) XFreePixmap(fl_display, pixmap)
// Bitmap masks