]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/dcpsg.cpp
buttons now become default when they have focus
[wxWidgets.git] / src / generic / dcpsg.cpp
index c6f1a559f43dd234ae63ad91083087ba97368137..880a6a10aa45ece28d4bff0f6aa38b0c4b7c035d 100644 (file)
@@ -25,6 +25,8 @@
     #include "wx/defs.h"
 #endif // WX_PRECOMP
 
+#if wxUSE_PRINTING_ARCHITECTURE
+
 #if wxUSE_POSTSCRIPT
 
 #include "wx/dcmemory.h"
@@ -1332,7 +1334,7 @@ void wxPostScriptDC::EndDoc ()
 
     wxChar *header_file = wxGetTempFileName("ps");
 
-    m_pstream = new ofstream( wxConv_file.cWX2MB(header_file) );
+    m_pstream = new ofstream( wxConvCurrent->cWX2MB(header_file) );
 
     *m_pstream << "%!PS-Adobe-2.0\n";   /* PostScript magic strings */
     *m_pstream << "%%Title: " << m_title.mb_str() << "\n";
@@ -1342,15 +1344,15 @@ void wxPostScriptDC::EndDoc ()
     wxChar userID[256];
     if ( wxGetEmailAddress(userID, sizeof(userID)) )
     {
-        *m_pstream << "%%For: " << MBSTRINGCAST wxConv_libc.cWX2MB(userID);
+        *m_pstream << "%%For: " << MBSTRINGCAST wxConvCurrent->cWX2MB(userID);
         wxChar userName[245];
         if (wxGetUserName(userName, sizeof(userName)))
-            *m_pstream << " (" << MBSTRINGCAST wxConv_libc.cWX2MB(userName) << ")";
+            *m_pstream << " (" << MBSTRINGCAST wxConvCurrent->cWX2MB(userName) << ")";
         *m_pstream << "\n";
     }
     else if ( wxGetUserName(userID, sizeof(userID)) )
     {
-        *m_pstream << "%%For: " << MBSTRINGCAST wxConv_libc.cWX2MB(userID) << "\n";
+        *m_pstream << "%%For: " << MBSTRINGCAST wxConvCurrent->cWX2MB(userID) << "\n";
     }
 
     // THE FOLLOWING HAS BEEN CONTRIBUTED BY Andy Fyfe <andy@hyperparallel.com>
@@ -1685,8 +1687,11 @@ void wxPostScriptDC::GetTextExtent( const wxString& string, long *x, long *y,
         /* get the directory of the AFM files */
         char afmName[256];
         afmName[0] = 0;
-        wxString fmPath(m_printData.GetFontMetricPath());
-        if (fmPath != "") strcpy( afmName, (const char*) fmPath );
+       
+       if (!m_printData.GetFontMetricPath().IsEmpty())
+       {
+           strcpy( afmName, m_printData.GetFontMetricPath().mb_str() )
+       }
 
         /* 2. open and process the file
            /  a short explanation of the AFM format:
@@ -1707,7 +1712,26 @@ void wxPostScriptDC::GetTextExtent( const wxString& string, long *x, long *y,
         strcat(afmName,name);
         strcat(afmName,".afm");
         FILE *afmFile = fopen(afmName,"r");
-        if ( afmFile==NULL )
+       
+#ifdef __UNIX__
+       if (afmFile==NULL)
+       {
+           strcpy( afmName, "/usr/local/share/wx/gs_afm/" );
+            strcat(afmName,name);
+            strcat(afmName,".afm");
+            FILE *afmFile = fopen(afmName,"r");
+       }
+       
+       if (afmFile==NULL)
+       {
+           strcpy( afmName, "/usr/share/wx/gs_afm/" );
+            strcat(afmName,name);
+            strcat(afmName,".afm");
+            FILE *afmFile = fopen(afmName,"r");
+       }
+#endif
+       
+        if (afmFile==NULL)
         {
             wxLogDebug( "GetTextExtent: can't open AFM file '%s'\n", afmName );
             wxLogDebug( "               using approximate values\n");
@@ -2245,3 +2269,6 @@ void wxPostScriptModule::OnExit()
 
 #endif
   // wxUSE_POSTSCRIPT
+
+#endif 
+  // wxUSE_PRINTING_ARCHITECTURE
\ No newline at end of file