00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00031 #ifndef Fl_Printer_H
00032 #define Fl_Printer_H
00033
00034 #include <FL/Fl_Paged_Device.H>
00035 #include <FL/fl_draw.H>
00036 #include <FL/Fl_Pixmap.H>
00037 #include <FL/Fl_RGB_Image.H>
00038 #include <FL/Fl_Bitmap.H>
00039 #include <stdio.h>
00040 #if !(defined(__APPLE__) || defined(WIN32))
00041 #include <FL/Fl_PostScript.H>
00042 #endif
00043
00044 #if defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN)
00045
00052 class Fl_System_Printer : public Fl_Paged_Device {
00053 private:
00055 void *gc;
00056 void set_current(void);
00057 #ifdef __APPLE__
00058 float scale_x;
00059 float scale_y;
00060 float angle;
00061 Fl_PMPrintSession printSession;
00062 Fl_PMPageFormat pageFormat;
00063 Fl_PMPrintSettings printSettings;
00064 #elif defined(WIN32)
00065 int abortPrint;
00066 PRINTDLG pd;
00067 HDC hPr;
00068 int prerr;
00069 int left_margin;
00070 int top_margin;
00071 void absolute_printable_rect(int *x, int *y, int *w, int *h);
00072 #endif
00073 public:
00074 static const char *device_type;
00078 Fl_System_Printer(void);
00079 int start_job(int pagecount, int *frompage = NULL, int *topage = NULL);
00080 int start_page (void);
00081 int printable_rect(int *w, int *h);
00082 void margins(int *left, int *top, int *right, int *bottom);
00083 void origin(int x, int y);
00084 void scale (float scale_x, float scale_y);
00085 void rotate(float angle);
00086 void translate(int x, int y);
00087 void untranslate(void);
00088 int end_page (void);
00089 void end_job (void);
00090
00094 ~Fl_System_Printer(void);
00095 #ifndef FL_DOXYGEN
00096 public:
00097 static const char *dialog_title;
00098 static const char *dialog_printer;
00099 static const char *dialog_range;
00100 static const char *dialog_copies;
00101 static const char *dialog_all;
00102 static const char *dialog_pages;
00103 static const char *dialog_from;
00104 static const char *dialog_to;
00105 static const char *dialog_properties;
00106 static const char *dialog_copyNo;
00107 static const char *dialog_print_button;
00108 static const char *dialog_cancel_button;
00109 static const char *dialog_print_to_file;
00110 static const char *property_title;
00111 static const char *property_pagesize;
00112 static const char *property_mode;
00113 static const char *property_use;
00114 static const char *property_save;
00115 static const char *property_cancel;
00116 #endif // FL_DOXYGEN
00117 };
00118
00119 typedef Fl_System_Printer Fl_Printer;
00120 #endif
00121
00122 #if !(defined(__APPLE__) || defined(WIN32))
00123
00130 class Fl_PostScript_Printer : public Fl_PostScript_File_Device {
00131 public:
00132 static const char *device_type;
00133 int start_job(int pages, int *firstpage = NULL, int *lastpage = NULL);
00134
00135 #ifndef FL_DOXYGEN
00136 static const char *dialog_title;
00137 static const char *dialog_printer;
00138 static const char *dialog_range;
00139 static const char *dialog_copies;
00140 static const char *dialog_all;
00141 static const char *dialog_pages;
00142 static const char *dialog_from;
00143 static const char *dialog_to;
00144 static const char *dialog_properties;
00145 static const char *dialog_copyNo;
00146 static const char *dialog_print_button;
00147 static const char *dialog_cancel_button;
00148 static const char *dialog_print_to_file;
00149 static const char *property_title;
00150 static const char *property_pagesize;
00151 static const char *property_mode;
00152 static const char *property_use;
00153 static const char *property_save;
00154 static const char *property_cancel;
00155 #endif // FL_DOXYGEN
00156 };
00157
00158 typedef Fl_PostScript_Printer Fl_Printer;
00159 #endif
00160
00195 #ifdef FL_DOXYGEN
00196
00197 class Fl_Printer : public Fl_System_Printer, Fl_PostScript_Printer {
00198 public:
00199 static const char *device_type;
00201 Fl_Printer(void);
00202 int start_job(int pagecount, int *frompage = NULL, int *topage = NULL);
00203 int start_page(void);
00204 int printable_rect(int *w, int *h);
00205 void margins(int *left, int *top, int *right, int *bottom);
00206 void origin(int x, int y);
00207 void scale(float scale_x, float scale_y);
00208 void rotate(float angle);
00209 void translate(int x, int y);
00210 void untranslate(void);
00211 int end_page (void);
00212 void end_job (void);
00214 ~Fl_Printer(void);
00215
00219 static const char *dialog_title;
00220 static const char *dialog_printer;
00221 static const char *dialog_range;
00222 static const char *dialog_copies;
00223 static const char *dialog_all;
00224 static const char *dialog_pages;
00225 static const char *dialog_from;
00226 static const char *dialog_to;
00227 static const char *dialog_properties;
00228 static const char *dialog_copyNo;
00229 static const char *dialog_print_button;
00230 static const char *dialog_cancel_button;
00231 static const char *dialog_print_to_file;
00232 static const char *property_title;
00233 static const char *property_pagesize;
00234 static const char *property_mode;
00235 static const char *property_use;
00236 static const char *property_save;
00237 static const char *property_cancel;
00239 };
00240 #endif
00241
00242 #endif // Fl_Printer_H
00243
00244
00245
00246