]> git.saurik.com Git - wxWidgets.git/commitdiff
make GetPaperRect() and GetResolution() const functions
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sat, 15 Nov 2008 11:10:34 +0000 (11:10 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sat, 15 Nov 2008 11:10:34 +0000 (11:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56783 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

18 files changed:
include/wx/dc.h
include/wx/dcprint.h
include/wx/generic/dcpsg.h
include/wx/gtk/gnome/gprint.h
include/wx/gtk/print.h
include/wx/motif/dcprint.h
include/wx/msw/dcprint.h
include/wx/os2/dcprint.h
include/wx/osx/carbon/dcprint.h
include/wx/palmos/dcprint.h
src/common/dcbase.cpp
src/generic/dcpsg.cpp
src/gtk/gnome/gprint.cpp
src/gtk/print.cpp
src/msw/dcprint.cpp
src/os2/dcprint.cpp
src/osx/carbon/dcprint.cpp
src/palmos/dcprint.cpp

index ce9356e65393794fce3758a18cd3c3641468f3df..f780315d50b85e69ce7e0f46ab508dfcb2234e1d 100644 (file)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        wx/dc.h
 // Purpose:     wxDC class
-// Author:      Vadim Zeitlin 
+// Author:      Vadim Zeitlin
 // Modified by:
 // Created:     05/25/99
 // RCS-ID:      $Id$
@@ -497,10 +497,10 @@ public:
     // ---------------------------------------------------------
     // wxPrinterDC Impl API
 
-    virtual wxRect GetPaperRect()
+    virtual wxRect GetPaperRect() const
         { int w = 0; int h = 0; DoGetSize( &w, &h ); return wxRect(0,0,w,h); }
 
-    virtual int GetResolution()
+    virtual int GetResolution() const
         { return -1; }
 
 private:
@@ -667,7 +667,7 @@ public:
     wxSize GetPPI() const
         { return m_pimpl->GetPPI(); }
 
-    virtual int GetResolution()
+    virtual int GetResolution() const
         { return m_pimpl->GetResolution(); }
 
     // Right-To-Left (RTL) modes
index 65e725482fc0601478e91102862ebd217fa13ef2..95dbff8f7adc348a29cf7c2f9cabf40fcc1bab2d 100644 (file)
@@ -28,8 +28,8 @@ public:
     wxPrinterDC();
     wxPrinterDC(const wxPrintData& data);
 
-    wxRect GetPaperRect();
-    int GetResolution();
+    wxRect GetPaperRect() const;
+    int GetResolution() const;
 
 protected:
     wxPrinterDC(wxDCImpl *impl) : wxDC(impl) { }
index bb66e50ce15d7e885f8d66d0ee6a716506c581dd..5c0a7ef214c588a5c6a1e79c2f0f9b60b7d93c04 100644 (file)
@@ -91,8 +91,8 @@ public:
 
     // Overrridden for wxPrinterDC Impl
 
-    virtual int GetResolution();
-    virtual wxRect GetPaperRect();
+    virtual int GetResolution() const;
+    virtual wxRect GetPaperRect() const;
 
 protected:
     bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, int style = wxFLOOD_SURFACE);
index a801f01ccd7541f90b4d02881ab087c1dcaab717..0901dae2e7eb22745187eaad7d5528c538bd4ca6 100644 (file)
@@ -265,7 +265,7 @@ protected:
     void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
 #if wxUSE_SPLINES
     void DoDrawSpline(const wxPointList *points);
-#endif 
+#endif
     bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
             wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false,
             wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
@@ -289,8 +289,8 @@ protected:
     wxPrintData& GetPrintData() { return m_printData; }
 
     // overriden for wxPrinterDC Impl
-    virtual wxRect GetPaperRect();
-    virtual int GetResolution();
+    virtual wxRect GetPaperRect() const;
+    virtual int GetResolution() const;
 
 private:
     wxPrintData             m_printData;
@@ -301,7 +301,7 @@ private:
     unsigned char           m_currentRed;
     unsigned char           m_currentGreen;
     unsigned char           m_currentBlue;
-    
+
     double                  m_pageHeight;
 
     GnomePrintContext      *m_gpc;
index 66f34f0702a8d4da53e48f4b23c086e7df3fcda6..62a3514645c6bbf6d0871f033b701b0b392e458a 100644 (file)
@@ -249,10 +249,10 @@ public:
     void SetBackgroundMode(int mode);
     void SetPalette(const wxPalette& WXUNUSED(palette)) { }
     void SetResolution(int ppi);
-    
+
     // overriden for wxPrinterDC Impl
-    virtual int GetResolution();
-    virtual wxRect GetPaperRect();
+    virtual int GetResolution() const;
+    virtual wxRect GetPaperRect() const;
 
 protected:
     bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, int style=wxFLOOD_SURFACE );
index ba338f3dcd34280bf8bfdfa3ea7c41f3c2635402..1292a44ea15678d975e7416342300d2f703142f0 100644 (file)
@@ -24,7 +24,7 @@ public:
                     int orientation = wxPORTRAIT);
     virtual ~wxPrinterDC();
 
-    wxRect GetPaperRect();
+    wxRect GetPaperRect() const;
 
     DECLARE_CLASS(wxPrinterDCImpl)
 };
index 2c7f7d42d56ac49b284cbf0ffc668f420a40eec8..64ed3c7d539e015e5ab3efea90aef9a783fabe25 100644 (file)
@@ -35,7 +35,7 @@ public:
     virtual void StartPage();
     virtual void EndPage();
 
-    virtual wxRect GetPaperRect();
+    virtual wxRect GetPaperRect() const;
 
 protected:
     virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
index 558f6454c9d58dea3603bfa727dc3c5e999aca3b..47689ebc8094e4086891104964e7eff6f2e7dee7 100644 (file)
@@ -33,7 +33,7 @@ class WXDLLIMPEXP_CORE wxPrinterDCImpl: public wxPMDCImpl
     virtual void StartPage(void);
     virtual void EndPage(void);
 
-    virtual wxRect GetPaperRect();
+    virtual wxRect GetPaperRect() const;
 
 protected:
     virtual void DoDrawBitmap( const wxBitmap& rBmp
index 1e64559a2d6a572c3db5978603b90e86f8a71040..4380f4f4f2ef83bb91bd576cd94be8aebacc748a 100644 (file)
@@ -31,17 +31,17 @@ public:
     virtual void StartPage(void) ;
     virtual void EndPage(void) ;
 
-    wxRect GetPaperRect();
+    wxRect GetPaperRect() const;
 
     wxPrintData& GetPrintData() { return m_printData; }
     virtual wxSize GetPPI() const;
-    
+
 protected:
     virtual void DoGetSize( int *width, int *height ) const;
-    
+
     wxPrintData        m_printData ;
     wxNativePrinterDC* m_nativePrinterDC ;
-    
+
 private:
     DECLARE_CLASS(wxPrinterDC)
 #endif // wxUSE_PRINTING_ARCHITECTURE
index 6051b0a23cf49c626f74325e2df02edaaedcf25f..a67bb3123a3fcdd54d60f3174fd73032868c09e1 100644 (file)
@@ -34,7 +34,7 @@ public:
     virtual void StartPage();
     virtual void EndPage();
 
-    wxRect GetPaperRect();
+    wxRect GetPaperRect() const;
 
 protected:
     virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
index 206c1662dd45854e93365d1023774efd783034ec..a60da2e6573e8329c69cb9fb4ded229916af23e1 100644 (file)
@@ -300,12 +300,12 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& data)
 {
 }
 
-wxRect wxPrinterDC::GetPaperRect()
+wxRect wxPrinterDC::GetPaperRect() const
 {
     return GetImpl()->GetPaperRect();
 }
 
-int wxPrinterDC::GetResolution()
+int wxPrinterDC::GetResolution() const
 {
     return GetImpl()->GetResolution();
 }
index e041e64cb6cb49a6debaabc6d8a4f97e2f8f38ed..06880bc1c795a2be3f86b2b71a8eb9622f88bcf2 100644 (file)
@@ -342,7 +342,7 @@ bool wxPostScriptDCImpl::IsOk() const
   return m_ok;
 }
 
-wxRect wxPostScriptDCImpl::GetPaperRect()
+wxRect wxPostScriptDCImpl::GetPaperRect() const
 {
     int w = 0;
     int h = 0;
@@ -350,7 +350,7 @@ wxRect wxPostScriptDCImpl::GetPaperRect()
     return wxRect(0,0,w,h);
 }
 
-int wxPostScriptDCImpl::GetResolution()
+int wxPostScriptDCImpl::GetResolution() const
 {
     return DPI;
 }
index 6c9ef2c793b5643ef3d3485cce15c42eb2f92aec..2e389c56e6cc464cb4a5499c375f06b19460ebeb 100644 (file)
@@ -2015,12 +2015,12 @@ void wxGnomePrinterDCImpl::SetPrintData(const wxPrintData& data)
 
 // overridden for wxPrinterDC Impl
 
-int wxGnomePrinterDCImpl::GetResolution()
+int wxGnomePrinterDCImpl::GetResolution() const
 {
     return DPI;
 }
 
-wxRect wxGnomePrinterDCImpl::GetPaperRect()
+wxRect wxGnomePrinterDCImpl::GetPaperRect() const
 {
     // GNOME print doesn't support printer margins
     int w = 0;
index 8f8a48239bf69d88d95d69174b223b4a2a9300d2..a7c6f95081cb5b444af27b3cd0c5e5332d16c7e5 100644 (file)
@@ -1074,7 +1074,7 @@ wxDC* wxGtkPrinter::PrintDialog( wxWindow *parent )
     }
 
     m_printDialogData = dialog.GetPrintDialogData();
-    
+
     return new wxPrinterDC( m_printDialogData.GetPrintData() );
 }
 
@@ -1132,7 +1132,7 @@ wxGtkPrinterDCImpl::wxGtkPrinterDCImpl(wxPrinterDC *owner, const wxPrintData& da
 #if wxCAIRO_SCALE
     m_PS2DEV = 1.0;
     m_DEV2PS = 1.0;
-    
+
     cairo_scale( m_cairo, 72.0 / (double)m_resolution, 72.0 / (double)m_resolution );
 #else
     m_PS2DEV = (double)m_resolution / 72.0;
@@ -1866,7 +1866,7 @@ void wxGtkPrinterDCImpl::DoDrawRotatedText(const wxString& text, wxCoord x, wxCo
 void wxGtkPrinterDCImpl::Clear()
 {
 // Clear does nothing for printing, but keep the code
-// for later reuse 
+// for later reuse
 /*
     cairo_save(m_cairo);
     cairo_set_operator (m_cairo, CAIRO_OPERATOR_SOURCE);
@@ -1902,7 +1902,7 @@ void wxGtkPrinterDCImpl::SetPen( const wxPen& pen )
     m_pen = pen;
 
     double width;
-    
+
     if (m_pen.GetWidth() <= 0)
         width = 0.1;
     else
@@ -2251,7 +2251,7 @@ void wxGtkPrinterDCImpl::SetPrintData(const wxPrintData& data)
 
 // overriden for wxPrinterDC Impl
 
-wxRect wxGtkPrinterDCImpl::GetPaperRect()
+wxRect wxGtkPrinterDCImpl::GetPaperRect() const
 {
     // Does GtkPrint support printer margins?
     int w = 0;
@@ -2260,7 +2260,7 @@ wxRect wxGtkPrinterDCImpl::GetPaperRect()
     return wxRect( 0,0,w,h );
 }
 
-int wxGtkPrinterDCImpl::GetResolution()
+int wxGtkPrinterDCImpl::GetResolution() const
 {
     return m_resolution;
 }
@@ -2357,7 +2357,7 @@ void wxGtkPrintPreview::DetermineScaling()
         wxSize sizeDevUnits(paper->GetSizeDeviceUnits());
         sizeDevUnits.x = wxRound((double)sizeDevUnits.x * (double)m_resolution / 72.0);
         sizeDevUnits.y = wxRound((double)sizeDevUnits.y * (double)m_resolution / 72.0);
-        
+
         wxSize sizeTenthsMM(paper->GetSize());
         wxSize sizeMM(sizeTenthsMM.x / 10, sizeTenthsMM.y / 10);
 
index 4b5b72c7a1a9c6eea175e48da3a6b82149c45f4b..8a0b13d38fc7438fa5898473bcc19c0ebe07a751 100644 (file)
@@ -228,7 +228,7 @@ void wxPrinterDCImpl::EndPage()
 }
 
 
-wxRect wxPrinterDCImpl::GetPaperRect()
+wxRect wxPrinterDCImpl::GetPaperRect() const
 
 {
     if (!IsOk()) return wxRect(0, 0, 0, 0);
index a861f3363dfb37847f78cd5aa416c22fcdaac81b..9c0f88cc2b888b2438c39016c2dac1a1c71bf031 100644 (file)
@@ -138,7 +138,7 @@ void wxPrinterDCImpl::EndPage()
 //        ::EndPage((HDC) m_hDC);
 } // end of wxPrinterDC::EndPage
 
-wxRect wxPrinterDCImpl::GetPaperRect()
+wxRect wxPrinterDCImpl::GetPaperRect() const
 {
     // Use page rect if we can't get paper rect.
     wxCoord w, h;
index 9da9504af7ec32b12699319becbea98146480420..f9353bc42c58904d98c5385cccf406d249bb7f40 100644 (file)
@@ -85,7 +85,7 @@ wxMacCarbonPrinterDC::wxMacCarbonPrinterDC( wxPrintData* data )
 
     PMResolution res;
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
     if ( PMPrinterGetOutputResolution != NULL )
     {
         PMPrinter printer;
@@ -103,11 +103,11 @@ wxMacCarbonPrinterDC::wxMacCarbonPrinterDC( wxPrintData* data )
     else
 #endif
     {
-#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 
+#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
         m_err = PMGetResolution((PMPageFormat) (native->m_macPageFormat), &res);
 #endif
     }
-    
+
     m_ppi = wxSize(int(res.hRes), int(res.vRes));
 }
 
@@ -135,7 +135,7 @@ bool wxMacCarbonPrinterDC::StartDoc(  wxPrinterDC* dc , const wxString& message
 
     m_err = PMSessionBeginCGDocumentNoDialog(native->m_macPrintSession,
               native->m_macPrintSettings,
-              native->m_macPageFormat);    
+              native->m_macPageFormat);
     if ( m_err != noErr )
         return false;
 
@@ -148,7 +148,7 @@ bool wxMacCarbonPrinterDC::StartDoc(  wxPrinterDC* dc , const wxString& message
     m_maxY = wxCoord(rPage.bottom - rPage.top);
 
     PMResolution res;
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
     if ( PMPrinterGetOutputResolution != NULL )
     {
         PMPrinter printer;
@@ -166,7 +166,7 @@ bool wxMacCarbonPrinterDC::StartDoc(  wxPrinterDC* dc , const wxString& message
     else
 #endif
     {
-#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 
+#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
        m_err = PMGetResolution((PMPageFormat) (native->m_macPageFormat), &res);
 #endif
     }
@@ -256,7 +256,7 @@ void wxMacCarbonPrinterDC::GetSize( int *w , int *h) const
         *h = m_maxY ;
 }
 
-wxSize wxMacCarbonPrinterDC::GetPPI() const 
+wxSize wxMacCarbonPrinterDC::GetPPI() const
 {
      return m_ppi ;
 };
@@ -286,7 +286,7 @@ wxPrinterDCImpl::wxPrinterDCImpl( wxPrinterDC *owner, const wxPrintData& printda
         {
             wxSize sz = GetPPI();
             m_mm_to_pix_x = mm2inches * sz.x;
-            m_mm_to_pix_y = mm2inches * sz.y;        
+            m_mm_to_pix_y = mm2inches * sz.y;
         }
         // we need at least a measuring context because people start measuring before a page
         // gets printed at all
@@ -344,7 +344,7 @@ void wxPrinterDCImpl::EndDoc(void)
     }
 }
 
-wxRect wxPrinterDCImpl::GetPaperRect()
+wxRect wxPrinterDCImpl::GetPaperRect() const
 {
     wxCoord w, h;
     GetOwner()->GetSize(&w, &h);
index dc154f7b2f219f5c30591a58786f42a78746d651..81fabe9cb27973860eb89e767a8367cfc0b4cd7e 100644 (file)
@@ -100,7 +100,7 @@ void wxPrinterDC::EndPage()
 {
 }
 
-wxRect wxPrinterDC::GetPaperRect()
+wxRect wxPrinterDC::GetPaperRect() const
 {
     // Use page rect if we can't get paper rect.
     wxCoord w, h;