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/x.H>
00035 #include <FL/Fl_Paged_Device.H>
00036 #include <FL/fl_draw.H>
00037 #include <FL/Fl_Pixmap.H>
00038 #include <FL/Fl_RGB_Image.H>
00039 #include <FL/Fl_Bitmap.H>
00040 #include <stdio.h>
00041 #if !(defined(__APPLE__) || defined(WIN32))
00042 #include <FL/Fl_PostScript.H>
00043 #elif defined(WIN32)
00044 #include <Commdlg.h>
00045 #endif
00046
00047 #if defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN)
00048
00055 class Fl_System_Printer : public Fl_Paged_Device {
00056 private:
00058 void *gc;
00059 void set_current(void);
00060 #ifdef __APPLE__
00061 float scale_x;
00062 float scale_y;
00063 float angle;
00064 Fl_PMPrintSession printSession;
00065 Fl_PMPageFormat pageFormat;
00066 Fl_PMPrintSettings printSettings;
00067 #elif defined(WIN32)
00068 int abortPrint;
00069 PRINTDLG pd;
00070 HDC hPr;
00071 int prerr;
00072 int left_margin;
00073 int top_margin;
00074 void absolute_printable_rect(int *x, int *y, int *w, int *h);
00075 #endif
00076 public:
00077 static const char *device_type;
00081 Fl_System_Printer(void);
00082 int start_job(int pagecount, int *frompage = NULL, int *topage = NULL);
00083 int start_page (void);
00084 int printable_rect(int *w, int *h);
00085 void margins(int *left, int *top, int *right, int *bottom);
00086 void origin(int x, int y);
00087 void scale (float scale_x, float scale_y);
00088 void rotate(float angle);
00089 void translate(int x, int y);
00090 void untranslate(void);
00091 int end_page (void);
00092 void end_job (void);
00093
00097 ~Fl_System_Printer(void);
00098 #ifndef FL_DOXYGEN
00099 public:
00100 static const char *dialog_title;
00101 static const char *dialog_printer;
00102 static const char *dialog_range;
00103 static const char *dialog_copies;
00104 static const char *dialog_all;
00105 static const char *dialog_pages;
00106 static const char *dialog_from;
00107 static const char *dialog_to;
00108 static const char *dialog_properties;
00109 static const char *dialog_copyNo;
00110 static const char *dialog_print_button;
00111 static const char *dialog_cancel_button;
00112 static const char *dialog_print_to_file;
00113 static const char *property_title;
00114 static const char *property_pagesize;
00115 static const char *property_mode;
00116 static const char *property_use;
00117 static const char *property_save;
00118 static const char *property_cancel;
00119 #endif // FL_DOXYGEN
00120 };
00121
00122 typedef Fl_System_Printer Fl_Printer;
00123 #endif
00124
00125 #if !(defined(__APPLE__) || defined(WIN32))
00126
00133 class Fl_PostScript_Printer : public Fl_PostScript_File_Device {
00134 public:
00135 static const char *device_type;
00136 int start_job(int pages, int *firstpage = NULL, int *lastpage = NULL);
00137
00138 #ifndef FL_DOXYGEN
00139 static const char *dialog_title;
00140 static const char *dialog_printer;
00141 static const char *dialog_range;
00142 static const char *dialog_copies;
00143 static const char *dialog_all;
00144 static const char *dialog_pages;
00145 static const char *dialog_from;
00146 static const char *dialog_to;
00147 static const char *dialog_properties;
00148 static const char *dialog_copyNo;
00149 static const char *dialog_print_button;
00150 static const char *dialog_cancel_button;
00151 static const char *dialog_print_to_file;
00152 static const char *property_title;
00153 static const char *property_pagesize;
00154 static const char *property_mode;
00155 static const char *property_use;
00156 static const char *property_save;
00157 static const char *property_cancel;
00158 #endif // FL_DOXYGEN
00159 };
00160
00161 typedef Fl_PostScript_Printer Fl_Printer;
00162 #endif
00163
00198 #ifdef FL_DOXYGEN
00199
00200 class Fl_Printer : public Fl_System_Printer, Fl_PostScript_Printer {
00201 public:
00202 static const char *device_type;
00204 Fl_Printer(void);
00205 int start_job(int pagecount, int *frompage = NULL, int *topage = NULL);
00206 int start_page(void);
00207 int printable_rect(int *w, int *h);
00208 void margins(int *left, int *top, int *right, int *bottom);
00209 void origin(int x, int y);
00210 void scale(float scale_x, float scale_y);
00211 void rotate(float angle);
00212 void translate(int x, int y);
00213 void untranslate(void);
00214 int end_page (void);
00215 void end_job (void);
00217 ~Fl_Printer(void);
00218
00222 static const char *dialog_title;
00223 static const char *dialog_printer;
00224 static const char *dialog_range;
00225 static const char *dialog_copies;
00226 static const char *dialog_all;
00227 static const char *dialog_pages;
00228 static const char *dialog_from;
00229 static const char *dialog_to;
00230 static const char *dialog_properties;
00231 static const char *dialog_copyNo;
00232 static const char *dialog_print_button;
00233 static const char *dialog_cancel_button;
00234 static const char *dialog_print_to_file;
00235 static const char *property_title;
00236 static const char *property_pagesize;
00237 static const char *property_mode;
00238 static const char *property_use;
00239 static const char *property_save;
00240 static const char *property_cancel;
00242 };
00243 #endif
00244
00245 #endif // Fl_Printer_H
00246
00247
00248
00249