]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/dcps.cpp
* First draft on wxStreamBuffer, wxStream* will follow.
[wxWidgets.git] / src / gtk1 / dcps.cpp
index bb7800ea0d356906ba6e850a25066d081939e46d..710668c98a5c989b4ca5d0569e7617c83a0d39b8 100644 (file)
 #pragma interface
 #endif
 
+#include "wx/defs.h"
+
+#if wxUSE_POSTSCRIPT
+
 #include "wx/postscrp.h"
 #include "wx/dcmemory.h"
 #include "wx/utils.h"
 #include "wx/app.h"
 #include "wx/msgdlg.h"
 #include "wx/image.h"
+#include "wx/log.h"
+
+#include "gdk/gdk.h"
+#include "gtk/gtk.h"
 
 //-----------------------------------------------------------------------------
 // start and end of document/page
@@ -1348,11 +1356,16 @@ void wxPostScriptDC::EndPage ()
     *m_pstream << "showpage\n";
 }
 
-bool wxPostScriptDC::Blit (long xdest, long ydest, long fwidth, long fheight,
-      wxDC *source, long xsrc, long ysrc, int WXUNUSED(rop), bool WXUNUSED(useMask))
+bool wxPostScriptDC::Blit( long WXUNUSED(xdest), long WXUNUSED(ydest), 
+                           long WXUNUSED(fwidth), long WXUNUSED(fheight),
+                           wxDC *WXUNUSED(source), 
+                          long WXUNUSED(xsrc), long WXUNUSED(ysrc), 
+                          int WXUNUSED(rop), bool WXUNUSED(useMask) )
 {
     wxCHECK_MSG( m_ok && m_pstream, FALSE, "invalid postscript dc" );
     
+    wxFAIL_MSG( "wxPostScriptDC::Blit no yet implemented." );
+    
     return TRUE;
 }
 
@@ -1499,8 +1512,8 @@ void wxPostScriptDC::GetTextExtent (const wxString& string, long *x, long *y,
     strcat(afmName,".afm");
     FILE *afmFile = fopen(afmName,"r");
     if(afmFile==NULL){
-      wxDebugMsg("GetTextExtent: can't open AFM file '%s'\n",afmName);
-      wxDebugMsg("               using approximate values\n");
+      wxLogDebug("GetTextExtent: can't open AFM file '%s'\n",afmName);
+      wxLogDebug("               using approximate values\n");
       int i;
       for (i=0; i<256; i++) lastWidths[i] = 500; // an approximate value
       lastDescender = -150; // dito.
@@ -1519,7 +1532,7 @@ void wxPostScriptDC::GetTextExtent (const wxString& string, long *x, long *y,
         if(strncmp(line,"Descender",9)==0){
           if((sscanf(line,"%s%d",descString,&lastDescender)!=2)
             || (strcmp(descString,"Descender")!=0)) {
-           wxDebugMsg("AFM-file '%s': line '%s' has error (bad descender)\n",
+           wxLogDebug("AFM-file '%s': line '%s' has error (bad descender)\n",
                       afmName,line);
           }
         }
@@ -1527,7 +1540,7 @@ void wxPostScriptDC::GetTextExtent (const wxString& string, long *x, long *y,
         else if(strncmp(line,"UnderlinePosition",17)==0){
           if((sscanf(line,"%s%lf",upString,&UnderlinePosition)!=2)
             || (strcmp(upString,"UnderlinePosition")!=0)) {
-           wxDebugMsg("AFM-file '%s': line '%s' has error (bad UnderlinePosition)\n",
+           wxLogDebug("AFM-file '%s': line '%s' has error (bad UnderlinePosition)\n",
                       afmName,line);
           }
         }
@@ -1535,7 +1548,7 @@ void wxPostScriptDC::GetTextExtent (const wxString& string, long *x, long *y,
         else if(strncmp(line,"UnderlineThickness",18)==0){
            if((sscanf(line,"%s%lf",utString,&UnderlineThickness)!=2)
             || (strcmp(utString,"UnderlineThickness")!=0)) {
-           wxDebugMsg("AFM-file '%s': line '%s' has error (bad UnderlineThickness)\n",
+           wxLogDebug("AFM-file '%s': line '%s' has error (bad UnderlineThickness)\n",
                       afmName,line);
           }
         }
@@ -1543,12 +1556,12 @@ void wxPostScriptDC::GetTextExtent (const wxString& string, long *x, long *y,
         else if(strncmp(line,"EncodingScheme",14)==0){
           if((sscanf(line,"%s%s",utString,encString)!=2)
             || (strcmp(utString,"EncodingScheme")!=0)) {
-           wxDebugMsg("AFM-file '%s': line '%s' has error (bad EncodingScheme)\n",
+           wxLogDebug("AFM-file '%s': line '%s' has error (bad EncodingScheme)\n",
                       afmName,line);
           }
           else if (strncmp(encString, "AdobeStandardEncoding", 21))
           {
-           wxDebugMsg("AFM-file '%s': line '%s' has error (unsupported EncodingScheme %s)\n",
+           wxLogDebug("AFM-file '%s': line '%s' has error (unsupported EncodingScheme %s)\n",
                       afmName,line, encString);
           }
         }
@@ -1556,18 +1569,18 @@ void wxPostScriptDC::GetTextExtent (const wxString& string, long *x, long *y,
         else if(strncmp(line,"C ",2)==0){
           if(sscanf(line,"%s%d%s%s%d",
               cString,&ascii,semiString,WXString,&cWidth)!=5){
-             wxDebugMsg("AFM-file '%s': line '%s' has an error (bad character width)\n",afmName,line);
+             wxLogDebug("AFM-file '%s': line '%s' has an error (bad character width)\n",afmName,line);
           }
           if(strcmp(cString,"C")!=0 || strcmp(semiString,";")!=0 ||
              strcmp(WXString,"WX")!=0){
-             wxDebugMsg("AFM-file '%s': line '%s' has a format error\n",afmName,line);
+             wxLogDebug("AFM-file '%s': line '%s' has a format error\n",afmName,line);
           }
           //printf("            char '%c'=%d has width '%d'\n",ascii,ascii,cWidth);
           if(ascii>=0 && ascii<256){
             lastWidths[ascii] = cWidth; // store width
           }else{
            /* MATTHEW: this happens a lot; don't print an error */
-            // wxDebugMsg("AFM-file '%s': ASCII value %d out of range\n",afmName,ascii);
+            // wxLogDebug("AFM-file '%s': ASCII value %d out of range\n",afmName,ascii);
           }
         }
         // C.) ignore other entries.
@@ -1600,7 +1613,7 @@ void wxPostScriptDC::GetTextExtent (const wxString& string, long *x, long *y,
   unsigned char *p;
   for(p=(unsigned char *)(const char *)string; *p; p++){
     if(lastWidths[*p]== INT_MIN){
-      wxDebugMsg("GetTextExtent: undefined width for character '%c' (%d)\n",
+      wxLogDebug("GetTextExtent: undefined width for character '%c' (%d)\n",
                  *p,*p);
       widthSum += (long)(lastWidths[' ']/1000.0F * Size); // assume space
     }else{
@@ -1656,3 +1669,5 @@ void wxPostScriptDC::GetSizeMM(long *width, long *height) const
     }
 }
 
+#endif
+  // wxUSE_POSTSCRIPT