|
fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) ![]() |
00001 // 00002 // "$Id: Fl_Printer.cxx 8197 2011-01-06 08:46:54Z manolo $" 00003 // 00004 // Encompasses platform-specific printing-support code and 00005 // PostScript output code for the Fast Light Tool Kit (FLTK). 00006 // 00007 // Copyright 2010 by Bill Spitzak and others. 00008 // 00009 // This library is free software; you can redistribute it and/or 00010 // modify it under the terms of the GNU Library General Public 00011 // License as published by the Free Software Foundation; either 00012 // version 2 of the License, or (at your option) any later version. 00013 // 00014 // This library is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 // Library General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU Library General Public 00020 // License along with this library; if not, write to the Free Software 00021 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00022 // USA. 00023 // 00024 // Please report all bugs and problems to: 00025 // 00026 // http://www.fltk.org/str.php 00027 // 00028 00029 #include <FL/Fl_Printer.H> 00030 00031 #ifdef __APPLE__ 00032 //#include "Fl_Quartz_Printer.mm" 00033 #elif defined(WIN32) 00034 #include "Fl_GDI_Printer.cxx" 00035 #endif 00036 00037 #include "Fl_PostScript.cxx" 00038 00039 // print dialog customization strings 00041 const char *Fl_Printer::dialog_title = "Print"; 00043 const char *Fl_Printer::dialog_printer = "Printer:"; 00045 const char *Fl_Printer::dialog_range = "Print Range"; 00047 const char *Fl_Printer::dialog_copies = "Copies"; 00049 const char *Fl_Printer::dialog_all = "All"; 00051 const char *Fl_Printer::dialog_pages = "Pages"; 00053 const char *Fl_Printer::dialog_from = "From:"; 00055 const char *Fl_Printer::dialog_to = "To:"; 00057 const char *Fl_Printer::dialog_properties = "Properties..."; 00059 const char *Fl_Printer::dialog_copyNo = "# Copies:"; 00061 const char *Fl_Printer::dialog_print_button = "Print"; 00063 const char *Fl_Printer::dialog_cancel_button = "Cancel"; 00065 const char *Fl_Printer::dialog_print_to_file = "Print To File"; 00067 const char *Fl_Printer::property_title = "Printer Properties"; 00069 const char *Fl_Printer::property_pagesize = "Page Size:"; 00071 const char *Fl_Printer::property_mode = "Output Mode:"; 00073 const char *Fl_Printer::property_use = "Use"; 00075 const char *Fl_Printer::property_save = "Save"; 00077 const char *Fl_Printer::property_cancel = "Cancel"; 00078 00079 const char *Fl_Printer::class_id = "Fl_Printer"; 00080 #if defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN) 00081 const char *Fl_System_Printer::class_id = Fl_Printer::class_id; 00082 #endif 00083 #if !( defined(__APPLE__) || defined(WIN32) ) 00084 const char *Fl_PostScript_Printer::class_id = Fl_Printer::class_id; 00085 #endif 00086 00087 #if defined(__APPLE__) || defined(WIN32) 00088 void Fl_System_Printer::set_current(void) 00089 { 00090 #ifdef __APPLE__ 00091 fl_gc = (CGContextRef)gc; 00092 #elif defined(WIN32) 00093 fl_gc = (HDC)gc; 00094 #endif 00095 this->Fl_Surface_Device::set_current(); 00096 } 00097 #endif 00098 00099 Fl_Printer::Fl_Printer(void) { 00100 #if defined(WIN32) || defined(__APPLE__) 00101 printer = new Fl_System_Printer(); 00102 #else 00103 printer = new Fl_PostScript_Printer(); 00104 #endif 00105 class_name(class_id); 00106 } 00107 00108 int Fl_Printer::start_job(int pagecount, int *frompage, int *topage) 00109 { 00110 return printer->start_job(pagecount, frompage, topage); 00111 } 00112 00113 int Fl_Printer::start_page(void) 00114 { 00115 return printer->start_page(); 00116 } 00117 00118 int Fl_Printer::printable_rect(int *w, int *h) 00119 { 00120 return printer->printable_rect(w, h); 00121 } 00122 00123 void Fl_Printer::margins(int *left, int *top, int *right, int *bottom) 00124 { 00125 printer->margins(left, top, right, bottom); 00126 } 00127 00128 void Fl_Printer::origin(int x, int y) 00129 { 00130 printer->origin(x, y); 00131 } 00132 00133 void Fl_Printer::scale(float scale_x, float scale_y) 00134 { 00135 printer->scale(scale_x, scale_y); 00136 } 00137 00138 void Fl_Printer::rotate(float angle) 00139 { 00140 printer->rotate(angle); 00141 } 00142 00143 void Fl_Printer::translate(int x, int y) 00144 { 00145 printer->translate(x, y); 00146 } 00147 00148 void Fl_Printer::untranslate(void) 00149 { 00150 printer->untranslate(); 00151 } 00152 00153 int Fl_Printer::end_page (void) 00154 { 00155 return printer->end_page(); 00156 } 00157 00158 void Fl_Printer::end_job (void) 00159 { 00160 printer->end_job(); 00161 } 00162 00163 Fl_Printer::~Fl_Printer(void) 00164 { 00165 delete printer; 00166 } 00167 00168 00169 // 00170 // End of "$Id: Fl_Printer.cxx 8197 2011-01-06 08:46:54Z manolo $". 00171 //