From e73f9d466da578f31af7b24d5f016eaa927a5c91 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Thu, 3 Feb 2022 21:56:42 +0100 Subject: Rearrange "Print Button Window" functions - Rename Fl_Screen_Driver::print_or_copy_window() to fl_print_or_copy_window() - Add header file src/print_button.h - Update dependencies --- src/print_button.cxx | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'src/print_button.cxx') diff --git a/src/print_button.cxx b/src/print_button.cxx index 40836adc5..3db942dae 100644 --- a/src/print_button.cxx +++ b/src/print_button.cxx @@ -1,7 +1,7 @@ // // "Print Window" functions for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2021 by Bill Spitzak and others. +// Copyright 1998-2022 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -38,13 +38,12 @@ // Currently the shortcut can't be configured and is always ALT+SHIFT+'s'. // Todo: make the shortcut configurable. -#include -#include "Fl_Screen_Driver.H" +#include "print_button.h" + #include #include #include -//#define USE_PRINT_BUTTON 1 #ifdef USE_PRINT_BUTTON #include @@ -78,7 +77,7 @@ static void output_cb(Fl_Widget * /*unused*/, void *data) { // print window again (which ends the program) if (!win) return; - Fl_Screen_Driver::print_or_copy_window(win, deco_button->value(), fl_int(data)); + fl_print_or_copy_window(win, deco_button->value(), fl_int(data)); print_window->show(); } @@ -143,14 +142,16 @@ int fl_create_print_window() { #endif // USE_PRINT_BUTTON -/** - To print or copy to clipboard a window. - \param win The window to process - \param grab_decoration true means the window titlebar is processed too - \param mode 1 means print, other means copy - */ -int Fl_Screen_Driver::print_or_copy_window(Fl_Window *win, bool grab_decoration, int mode) -{ +/* undocumented function: + + Print a window or copy its contents to the clipboard. + + win The window to process + grab_decoration true means the window titlebar is processed too + mode 1 means print, other means copy +*/ +int fl_print_or_copy_window(Fl_Window *win, bool grab_decoration, int mode) { + if (!win) return 0; int ww = grab_decoration ? win->decorated_w() : win->w(); -- cgit v1.2.3