diff options
| author | Manolo Gouy <Manolo> | 2016-01-10 19:08:16 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-01-10 19:08:16 +0000 |
| commit | eeb65bef23b2d269ea38474c04a55ffca5c6e63e (patch) | |
| tree | e00061d0a9dfd7b28e031b1f976ae31c852fac39 /src/Fl_Paged_Device.cxx | |
| parent | acc50806538da470ba18a2f7b76ea65a64cb5f5c (diff) | |
1) Replicate in branch-1.3-porting all recent changes of branch-1.3
2) Advance branch-1.3-porting with new function Fl_X::capture_titlebar_and_borders()
that contains all the platform-specific code of all operations related to drawing
window borders and title bars. What is platform-specific and what is not
is therefore much clearer, to ease porting.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11002 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Paged_Device.cxx')
| -rw-r--r-- | src/Fl_Paged_Device.cxx | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/src/Fl_Paged_Device.cxx b/src/Fl_Paged_Device.cxx index f3b5f21fe..eae08ef62 100644 --- a/src/Fl_Paged_Device.cxx +++ b/src/Fl_Paged_Device.cxx @@ -60,9 +60,7 @@ void Fl_Paged_Device::print_widget(Fl_Widget* widget, int delta_x, int delta_y) fl_push_clip(0, 0, widget->w(), widget->h() ); #ifdef __APPLE__ // for Mac OS X 10.6 and above, make window with rounded bottom corners if ( fl_mac_os_version >= 100600 && driver()->class_name() == Fl_Quartz_Graphics_Driver::class_id ) { - CGContextRestoreGState(fl_gc); Fl_X::clip_to_rounded_corners(fl_gc, widget->w(), widget->h()); - CGContextSaveGState(fl_gc); } #endif } @@ -296,6 +294,45 @@ const Fl_Paged_Device::page_format Fl_Paged_Device::page_formats[NO_PAGE_FORMATS { 297, 684, "Env10"} // envelope }; +void Fl_Paged_Device::draw_decorated_window(Fl_Window *win, int x_offset, int y_offset) +{ + Fl_RGB_Image *top, *left, *bottom, *right; +#if defined(FL_PORTING) +# pragma message "FL_PORTING: implement Fl_X::capture_titlebar_and_borders" +#endif + Fl_X::i(win)->capture_titlebar_and_borders(top, left, bottom, right); + int wsides = left ? left->w() : 0; + int toph = top ? top->h() : 0; + if (top) { +#ifdef __APPLE__ + top->draw(x_offset, y_offset); // draw with transparency +#else + fl_draw_image(top->array, x_offset, y_offset, top->w(), top->h(), top->d()); +#endif // __APPLE__ + delete top; + } + if (left) { + fl_draw_image(left->array, x_offset, y_offset + toph, left->w(), left->h(), left->d()); + delete left; + } + if (right) { + fl_draw_image(right->array, x_offset + win->w() + wsides, y_offset + toph, right->w(), right->h(), right->d()); + delete right; + } + if (bottom) { + fl_draw_image(bottom->array, x_offset, y_offset + toph + win->h(), bottom->w(), bottom->h(), bottom->d()); + delete bottom; + } + this->print_widget(win, x_offset + wsides, y_offset + toph); +} + +#if !defined(__APPLE__) // Mac OS version in Fl_Cocoa.mm +void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset) +{ + draw_decorated_window(win, x_offset, y_offset); +} +#endif + // // End of "$Id$". // |
