Laxkit  0.0.7.1
printdialog.h
1 //
2 //
3 // The Laxkit, a windowing toolkit
4 // Please consult http://laxkit.sourceforge.net about where to send any
5 // correspondence about this software.
6 //
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Library General Public
9 // License as published by the Free Software Foundation; either
10 // version 2 of the License, or (at your option) any later version.
11 //
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Library General Public License for more details.
16 //
17 // You should have received a copy of the GNU Library General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 //
21 // Copyright (C) 2004-2007,2010 by Tom Lechner
22 //
23 #ifndef _LAX_PRINTDIALOG_H
24 #define _LAX_PRINTDIALOG_H
25 
26 #include <lax/rowframe.h>
27 #include <lax/doublebbox.h>
28 
29 #include <cups/cups.h>
30 #include <cups/ppd.h>
31 
32 namespace Laxkit {
33 
34 //--------------------------------- PrintContext ------------------------------
35 class PrintContext : public EventData
36 {
37  public:
38  char *papername;
39  float paperx;
40  float papery;
41  DoubleBBox pageregion;
42  unsigned long flags; //landscape/portrait
43  int copies;
44  int pagestart,pageend; //-1==auto
45  PrintContext();
46  virtual ~PrintContext();
47 };
48 
49 //--------------------------------- PrintDialog ------------------------------
50 #define PRINT_USE_PREVIEW (1<<16)
51 #define PRINT_USE_PS_FILE (1<<17)
52 #define PRINT_USE_EPS_FILE (1<<18)
53 #define PRINT_USE_PDF_FILE (1<<19)
54 #define PRINT_USE_XPRINT (1<<20)
55 #define PRINT_USE_SVG (1<<21)
56 #define PRINT_USE_PNG (1<<22)
57 #define PRINT_USE_JPG (1<<23)
58 #define PRINT_NO_CANCEL_DIALOG (1<<24)
59 
60 
61 class PrintDialog : public RowFrame
62 {
63  protected:
64  cups_dest_t *dests;
65  int numdests,dest;
66  ppd_file_t *ppd;
67  cups_option_t *options;
68  int numoptions;
69  char *filetoprint;
70  PrintContext *printcontext;
71  int optionsstart;
72  virtual void addOptions();
73  public:
74  PrintDialog(anXWindow *parnt,const char *nname,const char *ntitle,unsigned long nstyle,
75  int xx,int yy,int ww,int hh,int brder,
76  anXWindow *prev,unsigned long nowner,const char *nsend,
77  const char *nfiletoprint=NULL, PrintContext *pt=NULL);
78  virtual ~PrintDialog();
79  virtual const char *whattype() { return "PrintDialog"; }
80  virtual int preinit();
81  virtual int init();
82  virtual int send();
83  virtual void setup();
84  virtual int Event(const EventData *e,const char *mes);
85  virtual int CharInput(unsigned int ch,const char *buffer,int len,unsigned int state,const LaxKeyboard *d);
86 };
87 
88 } //namespace Laxkit
89 
90 #endif
91 
92 

Mon Feb 17 2014 11:52:57, Laxkit