• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

Fl_Paged_Device.H

Go to the documentation of this file.
00001 //
00002 // "$Id$"
00003 //
00004 // Printing support for the Fast Light Tool Kit (FLTK).
00005 //
00006 // Copyright 2010-2016 by Bill Spitzak and others.
00007 //
00008 // This library is free software. Distribution and use rights are outlined in
00009 // the file "COPYING" which should have been included with this file.  If this
00010 // file is missing or damaged, see the license at:
00011 //
00012 //     http://www.fltk.org/COPYING.php
00013 //
00014 // Please report all bugs and problems on the following page:
00015 //
00016 //     http://www.fltk.org/str.php
00017 //
00018 
00023 #ifndef Fl_Paged_Device_H
00024 #define Fl_Paged_Device_H
00025 
00026 #include <FL/Fl_Device.H>
00027 #include <FL/Fl_Window.H>
00028 
00030 #define NO_PAGE_FORMATS 30 /* MSVC6 compilation fix */
00031 
00038 class FL_EXPORT Fl_Paged_Device : public Fl_Surface_Device {
00039 #ifndef __APPLE__
00040   friend class Fl_Copy_Surface;
00041   friend class Fl_Image_Surface;
00042   void draw_decorated_window(Fl_Window *win, int x_offset, int y_offset, Fl_Surface_Device *toset);
00043 #endif
00044 public:
00050   enum Page_Format {
00051     A0 = 0, 
00052     A1,
00053     A2,
00054     A3,
00055     A4, 
00056     A5,
00057     A6,
00058     A7,
00059     A8,
00060     A9,
00061     B0,
00062     B1,
00063     B2,
00064     B3,
00065     B4,
00066     B5,
00067     B6,
00068     B7,
00069     B8,
00070     B9,
00071     B10,
00072     C5E,
00073     DLE,
00074     EXECUTIVE,
00075     FOLIO,
00076     LEDGER,
00077     LEGAL,
00078     LETTER, 
00079     TABLOID,
00080     ENVELOPE,
00081     MEDIA = 0x1000
00082   };
00086   enum Page_Layout {
00087     PORTRAIT = 0,  
00088     LANDSCAPE = 0x100,   
00089     REVERSED = 0x200,  
00090     ORIENTATION = 0x300 
00091   };
00092 
00095   typedef struct {
00097     int width; 
00099     int height; 
00101     const char *name; 
00102   } page_format;
00105   static const page_format page_formats[NO_PAGE_FORMATS];  
00106 private:
00107   void traverse(Fl_Widget *widget); // finds subwindows of widget and prints them
00108 protected:
00110   int x_offset;
00112   int y_offset;
00114   Fl_Paged_Device() : Fl_Surface_Device(NULL), x_offset(0), y_offset(0) {};
00115 #if FLTK_ABI_VERSION >= 10301
00116 public:
00118   virtual ~Fl_Paged_Device() {};
00119 #else
00120 
00121   virtual ~Fl_Paged_Device() {};
00122 public:
00123 #endif // FLTK_ABI_VERSION
00124   static const char *class_id;
00125   const char *class_name() {return class_id;};
00126   virtual int start_job(int pagecount, int *frompage = NULL, int *topage = NULL);
00127   virtual int start_page(void);
00128   virtual int printable_rect(int *w, int *h);
00129   virtual void margins(int *left, int *top, int *right, int *bottom);
00130   virtual void origin(int x, int y);
00131   virtual void origin(int *x, int *y);
00132   virtual void scale(float scale_x, float scale_y = 0.);
00133   virtual void rotate(float angle);
00134   virtual void translate(int x, int y);
00135   virtual void untranslate(void);
00136   virtual void print_widget(Fl_Widget* widget, int delta_x = 0, int delta_y = 0);
00144   void print_window(Fl_Window *win, int x_offset = 0, int y_offset = 0);
00145   virtual void print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x = 0, int delta_y = 0);
00146   virtual int end_page (void);
00147   virtual void end_job (void);
00148 };
00149 
00150 #endif // Fl_Paged_Device_H
00151 
00152 //
00153 // End of "$Id$"
00154 //
00155 
  • © 1998-2016 by Bill Spitzak and others.     FLTK

  • © 1998-2016 by Bill Spitzak and others.     FLTK

    Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.