BrowserWindow.bjs
[app.webkitpdf] / BrowserWindow.vala
index f5ec48c..b1dc3b9 100644 (file)
@@ -48,6 +48,7 @@ public class BrowserWindow : Object
                // if we have not finished in 25 seconds
                // call printit...
                  GLib.Timeout.add_seconds(25, () => { 
+                       print("Calling printit - timeout 25 seconds");
                                _this.view.printit();
                                return true;
                });
@@ -122,26 +123,18 @@ public class BrowserWindow : Object
             
             #else
              //listeners
-                        this.el.resource_request_starting.connect( (p0, webres, netreq ) => {
-                          print("resource req. started %s\n", netreq.uri);
+                      //  this.el.resource_request_starting.connect( (p0, webres, netreq ) => {
+                        //  print("resource req. started %s\n", netreq.uri);
                              
-                        });
+                      //  });
                         
                         this.el.load_finished.connect( ( ) => {
                                         
                                this.printit(); 
                          
                         });
-                        
             #endif
             }
-
-            //listeners
-            this.el.load_finished.connect( ( ) => {
-                        
-                   this.printit(); 
-             
-            });
         }
 
         // user defined functions
@@ -194,6 +187,11 @@ public class BrowserWindow : Object
                        return;
                }
                        
+        
+        #if GTK3
+               print("PNG not supported in webkit2\n");
+               return;
+        #else
                        
             GLib.Timeout.add_seconds(webkitpdf.opt_delay, () => { 
            
@@ -220,7 +218,7 @@ public class BrowserWindow : Object
                  }, GLib.Priority.DEFAULT);
         
         
-            
+        #endif    
             
         }
         public bool printpdf () {
@@ -288,7 +286,7 @@ public class BrowserWindow : Object
                    
                    
         
-                       this.el.print(pe);
+                       this.el.get_main_frame().print(pe);
         
         
                    try {
@@ -312,7 +310,9 @@ public class BrowserWindow : Object
         // what size is the documet.
         
              print("making screenshot\n");
-             
+        #if GTK3
+        
+        #else     
             // fix vapi - get_snapshot add '?' to all null.
             var pixmap = _this.view.el.get_snapshot( null );
         
@@ -336,7 +336,7 @@ public class BrowserWindow : Object
             //});
             Gtk.main_quit();
              
-           
+        #endif