X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/184b5d99a5382cd7a19888c85aff11f8a21af2f6..372edb9d375c8de3f5c7a9b110b0968f53a60051:/include/wx/postscrp.h diff --git a/include/wx/postscrp.h b/include/wx/postscrp.h index 1270ff477a..f0c1e5e0dc 100644 --- a/include/wx/postscrp.h +++ b/include/wx/postscrp.h @@ -6,7 +6,7 @@ // Created: 01/02/97 // RCS-ID: $Id$ // Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_POSTSCRPH__ @@ -43,16 +43,24 @@ public: # endif #endif +#ifdef __WXGTK__ + +// wxGTK has its own wxPostscriptDC + +#include "wx/gtk/dcps.h" + +#else + class WXDLLEXPORT wxPostScriptDC: public wxDC { DECLARE_DYNAMIC_CLASS(wxPostScriptDC) public: // Create a printer DC - wxPostScriptDC(void); + wxPostScriptDC(); wxPostScriptDC(const wxString& output, bool interactive = TRUE, wxWindow *parent = (wxWindow *) NULL); - ~wxPostScriptDC(void); + ~wxPostScriptDC(); bool Create(const wxString& output, bool interactive = TRUE, wxWindow *parent = (wxWindow *) NULL); @@ -61,7 +69,7 @@ class WXDLLEXPORT wxPostScriptDC: public wxDC inline virtual void BeginDrawing(void) {} ; inline virtual void EndDrawing(void) {} ; - void FloodFill(long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE) ; + void FloodFill(long x1, long y1, const wxColour &col, int style=wxFLOOD_SURFACE) ; bool GetPixel(long x1, long y1, wxColour *col) const; void DrawLine(long x1, long y1, long x2, long y2); @@ -85,32 +93,31 @@ class WXDLLEXPORT wxPostScriptDC: public wxDC void DrawSpline(wxList *points); - void DrawIcon(const wxIcon& icon, long x, long y); -#ifdef __WXGTK__ - void DrawIcon(const wxIcon& icon, long x, long y, bool WXUNUSED(usemask) ) - { DrawIcon( icon, x, y ); } -#endif + void DrawIcon( const wxIcon& icon, long x, long y ); + void DrawBitmap( const wxBitmap& bitmap, long x, long y, bool useMask=FALSE ); void DrawText(const wxString& text, long x, long y, bool use16 = FALSE); - void Clear(void); + void Clear(); void SetFont(const wxFont& font); void SetPen(const wxPen& pen); void SetBrush(const wxBrush& brush); void SetLogicalFunction(int function); void SetBackground(const wxBrush& brush); + void SetClippingRegion(long x, long y, long width, long height); - void DestroyClippingRegion(void); + void SetClippingRegion( const wxRegion ®ion ); + void DestroyClippingRegion(); bool StartDoc(const wxString& message); - void EndDoc(void); - void StartPage(void); - void EndPage(void); + void EndDoc(); + void StartPage(); + void EndPage(); - long GetCharHeight(void); - long GetCharWidth(void); + long GetCharHeight(); + long GetCharWidth(); void GetTextExtent(const wxString& string, long *x, long *y, - long *descent = (long *) NULL, - long *externalLeading = (long *) NULL, + long *descent = (long *) NULL, + long *externalLeading = (long *) NULL, wxFont *theFont = (wxFont *) NULL, bool use16 = FALSE); virtual void SetLogicalOrigin(long x, long y); virtual void CalcBoundingBox(long x, long y); @@ -151,6 +158,9 @@ protected: double m_scaleFactor; }; +#endif + // __WXGTK__ + #define wxID_PRINTER_COMMAND 1 #define wxID_PRINTER_OPTIONS 2 #define wxID_PRINTER_ORIENTATION 3 @@ -165,8 +175,8 @@ class WXDLLEXPORT wxPostScriptPrintDialog: public wxDialog DECLARE_CLASS(wxPostScriptPrintDialog) public: wxPostScriptPrintDialog (wxWindow *parent, const wxString& title, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE); + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_DIALOG_STYLE); virtual int ShowModal(void) ; }; @@ -197,15 +207,15 @@ WXDLLEXPORT void wxSetPrinterFile(const char *f); WXDLLEXPORT void wxSetAFMPath(const char *f); // Get current values -WXDLLEXPORT char* wxGetPrinterCommand(void); -WXDLLEXPORT char* wxGetPrintPreviewCommand(void); -WXDLLEXPORT char* wxGetPrinterOptions(void); -WXDLLEXPORT int wxGetPrinterOrientation(void); +WXDLLEXPORT char* wxGetPrinterCommand(); +WXDLLEXPORT char* wxGetPrintPreviewCommand(); +WXDLLEXPORT char* wxGetPrinterOptions(); +WXDLLEXPORT int wxGetPrinterOrientation(); WXDLLEXPORT void wxGetPrinterScaling(double* x, double* y); WXDLLEXPORT void wxGetPrinterTranslation(long *x, long *y); -WXDLLEXPORT int wxGetPrinterMode(void); -WXDLLEXPORT char* wxGetPrinterFile(void); -WXDLLEXPORT char* wxGetAFMPath(void); +WXDLLEXPORT int wxGetPrinterMode(); +WXDLLEXPORT char* wxGetPrinterFile(); +WXDLLEXPORT char* wxGetAFMPath(); /* * PostScript print setup information @@ -213,55 +223,57 @@ WXDLLEXPORT char* wxGetAFMPath(void); class WXDLLEXPORT wxPrintSetupData: public wxObject { - DECLARE_DYNAMIC_CLASS(wxPrintSetupData) +public: + char *printerCommand; + char *previewCommand; + char *printerFlags; + char *printerFile; + int printerOrient; + double printerScaleX; + double printerScaleY; + long printerTranslateX; + long printerTranslateY; + // 1 = Preview, 2 = print to file, 3 = send to printer + int printerMode; + char *afmPath; + // A name in the paper database (see wx_print.h: the printing framework) + char *paperName; + bool printColour; - public: - char *printerCommand; - char *previewCommand; - char *printerFlags; - char *printerFile; - int printerOrient; - double printerScaleX; - double printerScaleY; - long printerTranslateX; - long printerTranslateY; - // 1 = Preview, 2 = print to file, 3 = send to printer - int printerMode; - char *afmPath; - // A name in the paper database (see wx_print.h: the printing framework) - char *paperName; - bool printColour; - public: - wxPrintSetupData(void); - ~wxPrintSetupData(void); - - void SetPrinterCommand(const char *cmd); - void SetPaperName(const char *paper); - void SetPrintPreviewCommand(const char *cmd); - void SetPrinterOptions(const char *flags); - void SetPrinterFile(const char *f); - void SetPrinterOrientation(int orient); - void SetPrinterScaling(double x, double y); - void SetPrinterTranslation(long x, long y); - // 1 = Preview, 2 = print to file, 3 = send to printer - void SetPrinterMode(int mode); - void SetAFMPath(const char *f); - void SetColour(bool col); - - // Get current values - char *GetPrinterCommand(void); - char *GetPrintPreviewCommand(void); - char *GetPrinterOptions(void); - char *GetPrinterFile(void); - char *GetPaperName(void); - int GetPrinterOrientation(void); - void GetPrinterScaling(double* x, double* y); - void GetPrinterTranslation(long *x, long *y); - int GetPrinterMode(void); - char *GetAFMPath(void); - bool GetColour(void); - - void operator=(wxPrintSetupData& data); +public: + wxPrintSetupData(); + ~wxPrintSetupData(); + + void SetPrinterCommand(const char *cmd); + void SetPaperName(const char *paper); + void SetPrintPreviewCommand(const char *cmd); + void SetPrinterOptions(const char *flags); + void SetPrinterFile(const char *f); + void SetPrinterOrientation(int orient); + void SetPrinterScaling(double x, double y); + void SetPrinterTranslation(long x, long y); + // 1 = Preview, 2 = print to file, 3 = send to printer + void SetPrinterMode(int mode); + void SetAFMPath(const char *f); + void SetColour(bool col); + + // Get current values + char *GetPrinterCommand(); + char *GetPrintPreviewCommand(); + char *GetPrinterOptions(); + char *GetPrinterFile(); + char *GetPaperName(); + int GetPrinterOrientation(); + void GetPrinterScaling(double* x, double* y); + void GetPrinterTranslation(long *x, long *y); + int GetPrinterMode(); + char *GetAFMPath(); + bool GetColour(); + + void operator=(wxPrintSetupData& data); + +private: + DECLARE_DYNAMIC_CLASS(wxPrintSetupData) }; WXDLLEXPORT_DATA(extern wxPrintSetupData*) wxThePrintSetupData; @@ -274,36 +286,43 @@ WXDLLEXPORT extern void wxInitializePrintSetupData(bool init = TRUE); class WXDLLEXPORT wxPrintPaperType: public wxObject { - DECLARE_DYNAMIC_CLASS(wxPrintPaperType) +public: + wxPrintPaperType(const char *name = (const char *) NULL, int wmm = 0, int hmm = 0, int wp = 0, int hp = 0); + ~wxPrintPaperType(); - public: - int widthMM; - int heightMM; - int widthPixels; - int heightPixels; - char *pageName; - - wxPrintPaperType(const char *name = (const char *) NULL, int wmm = 0, int hmm = 0, int wp = 0, int hp = 0); - ~wxPrintPaperType(void); +public: + int widthMM; + int heightMM; + int widthPixels; + int heightPixels; + char *pageName; + +private: + DECLARE_DYNAMIC_CLASS(wxPrintPaperType) }; class WXDLLEXPORT wxPrintPaperDatabase: public wxList { - DECLARE_DYNAMIC_CLASS(wxPrintPaperDatabase) +public: + wxPrintPaperDatabase(); + ~wxPrintPaperDatabase(); - public: - wxPrintPaperDatabase(void); - ~wxPrintPaperDatabase(void); + void CreateDatabase(); + void ClearDatabase(); - void CreateDatabase(void); - void ClearDatabase(void); + void AddPaperType(const char *name, int wmm, int hmm, int wp, int hp); + wxPrintPaperType *FindPaperType(const char *name); - void AddPaperType(const char *name, int wmm, int hmm, int wp, int hp); - wxPrintPaperType *FindPaperType(const char *name); +private: + DECLARE_DYNAMIC_CLASS(wxPrintPaperDatabase) }; WXDLLEXPORT_DATA(extern wxPrintPaperDatabase*) wxThePrintPaperDatabase; -#endif // wxUSE_POSTSCRIPT +#endif + // wxUSE_POSTSCRIPT + #endif // _WX_POSTSCRPH__ + +