From 9472ff546cc0b4150d4dec89b48b3e4814b421f6 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sun, 31 Mar 2024 16:55:49 +0200 Subject: Implement and document new class Fl_PDF_File_Surface --- src/Fl_Device.cxx | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'src/Fl_Device.cxx') diff --git a/src/Fl_Device.cxx b/src/Fl_Device.cxx index b6c3f4da0..16a9045bd 100644 --- a/src/Fl_Device.cxx +++ b/src/Fl_Device.cxx @@ -1,7 +1,7 @@ // // implementation of classes Fl_Surface_Device and Fl_Display_Device for the Fast Light Tool Kit (FLTK). // -// Copyright 2010-2023 by Bill Spitzak and others. +// Copyright 2010-2024 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 @@ -46,6 +46,11 @@ | +- Fl_Posix_Printer_Driver: Fl_Printer uses that under Posix platforms +- Fl_GTK_Printer_Driver: Fl_Printer uses that under Posix+GTK platforms + +- Fl_PDF_File_Surface: draw into a PDF file + +- Fl_PDF_GDI_File_Surface: Windows-specific helper class interfacing FLTK with PDF operations + +- Fl_PDF_Pango_File_Surface: Linux/Unix-specific helper class interfacing FLTK with PDF operations + +- Fl_PDF_Cocoa_File_Surface: macOS-specific helper class interfacing FLTK with PDF operations + +- Fl_Graphics_Driver -> directed to an Fl_Surface_Device object | @@ -154,3 +159,28 @@ Fl_Device_Plugin *Fl_Device_Plugin::opengl_plugin() { } return pi; } + +#if !defined(FL_NO_PRINT_SUPPORT) + +#include + +Fl_PDF_File_Surface::Fl_PDF_File_Surface() { + platform_surface_ = new_platform_pdf_surface_(&out_filename_); + driver(platform_surface_->driver()); +} + + +Fl_PDF_File_Surface::~Fl_PDF_File_Surface() { + delete platform_surface_; +} + +#endif // !defined(FL_NO_PRINT_SUPPORT) + +/** Localizable text of the "PDF document settings" dialog */ +const char * Fl_PDF_File_Surface::format_dialog_title = "PDF document settings"; +/** Localizable text of the "PDF document settings" dialog */ +const char * Fl_PDF_File_Surface::format_dialog_page_size = "Page Size:"; +/** Localizable text of the "PDF document settings" dialog */ +const char * Fl_PDF_File_Surface::format_dialog_default = "Set as default"; +/** Localizable text of the "PDF document settings" dialog */ +const char * Fl_PDF_File_Surface::format_dialog_orientation = "Orientation:"; -- cgit v1.2.3