]> git.saurik.com Git - wxWidgets.git/commitdiff
Moved WinPrinter from private.h to printdlg.cpp.
authorJulian Smart <julian@anthemion.co.uk>
Mon, 28 Sep 2009 16:15:34 +0000 (16:15 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 28 Sep 2009 16:15:34 +0000 (16:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/private.h
src/msw/printdlg.cpp

index fa95062dc0dee2e70e764d79966707aa6da9746a..9e40732a3796b0a9559ec572788f4ef3fd530c9d 100644 (file)
@@ -727,52 +727,6 @@ private:
     wxDECLARE_NO_COPY_CLASS(GlobalPtrLock);
 };
 
-// smart pointer like class using OpenPrinter and ClosePrinter
-class WinPrinter
-{
-public:
-    // default ctor
-    WinPrinter()
-    {
-        m_hPrinter = (HANDLE)NULL;
-    }
-
-    WinPrinter( const wxString& printerName )
-    {
-        Open( printerName );
-    }
-
-    ~WinPrinter()
-    {
-        Close();
-    }
-
-    BOOL Open( const wxString& printerName, LPPRINTER_DEFAULTS pDefault=(LPPRINTER_DEFAULTS)NULL )
-    {
-        Close();
-        return OpenPrinter( (LPTSTR)printerName.wx_str(), &m_hPrinter, pDefault );
-    }
-
-    BOOL Close()
-    {
-        BOOL result = TRUE;
-        if( m_hPrinter )
-        {
-            result = ClosePrinter( m_hPrinter );
-            m_hPrinter = (HANDLE)NULL;
-        }
-        return result;
-    }
-
-    operator HANDLE() { return m_hPrinter; }
-    operator bool() { return m_hPrinter != (HANDLE)NULL; }
-
-private:
-    HANDLE m_hPrinter;
-
-    wxDECLARE_NO_COPY_CLASS(WinPrinter);
-};
-
 // register the class when it is first needed and unregister it in dtor
 class ClassRegistrar
 {
index b9b89b6210c8b18e9383f745873c3f1fa9efae54..2d6717597a190ff1dd6430b58ed0e5572f57b4cf 100644 (file)
 
 #include <stdlib.h>
 
+// smart pointer like class using OpenPrinter and ClosePrinter
+class WinPrinter
+{
+public:
+    // default ctor
+    WinPrinter()
+    {
+        m_hPrinter = (HANDLE)NULL;
+    }
+
+    WinPrinter( const wxString& printerName )
+    {
+        Open( printerName );
+    }
+
+    ~WinPrinter()
+    {
+        Close();
+    }
+
+    BOOL Open( const wxString& printerName, LPPRINTER_DEFAULTS pDefault=(LPPRINTER_DEFAULTS)NULL )
+    {
+        Close();
+        return OpenPrinter( (LPTSTR)printerName.wx_str(), &m_hPrinter, pDefault );
+    }
+
+    BOOL Close()
+    {
+        BOOL result = TRUE;
+        if( m_hPrinter )
+        {
+            result = ClosePrinter( m_hPrinter );
+            m_hPrinter = (HANDLE)NULL;
+        }
+        return result;
+    }
+
+    operator HANDLE() { return m_hPrinter; }
+    operator bool() { return m_hPrinter != (HANDLE)NULL; }
+
+private:
+    HANDLE m_hPrinter;
+
+    wxDECLARE_NO_COPY_CLASS(WinPrinter);
+};
+
+
 //----------------------------------------------------------------------------
 // wxWindowsPrintNativeData
 //----------------------------------------------------------------------------