[GTK][WK2] WebKit2 does not build if gtk-unix-printing-3.0 is not available
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Feb 2012 08:38:05 +0000 (08:38 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Feb 2012 08:38:05 +0000 (08:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79011

Fix the build when gtk-unix-printing-3.0 is not present.

* UIProcess/API/gtk/WebKitPrintOperation.cpp:
(webkitPrintOperationRunDialog):
(webkitPrintOperationRunDialogForFrame):
* WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
(WebKit::WebPrintOperationGtk::create):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108216 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp
Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp

index 239116f..815fcea 100644 (file)
@@ -1,3 +1,16 @@
+2012-02-20  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK][WK2] WebKit2 does not build if gtk-unix-printing-3.0 is not available
+        https://bugs.webkit.org/show_bug.cgi?id=79011
+
+        Fix the build when gtk-unix-printing-3.0 is not present.
+
+        * UIProcess/API/gtk/WebKitPrintOperation.cpp:
+        (webkitPrintOperationRunDialog):
+        (webkitPrintOperationRunDialogForFrame):
+        * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
+        (WebKit::WebPrintOperationGtk::create):
+
 2012-02-18  Dan Bernstein  <mitz@apple.com>
 
         <rdar://problem/10891801> BackingStore::scroll() unnecessarily copies pixels around
 2012-02-18  Dan Bernstein  <mitz@apple.com>
 
         <rdar://problem/10891801> BackingStore::scroll() unnecessarily copies pixels around
index d795f70..a20ccb2 100644 (file)
@@ -197,7 +197,7 @@ static void webkit_print_operation_class_init(WebKitPrintOperationClass* printOp
 }
 
 #ifdef HAVE_GTK_UNIX_PRINTING
 }
 
 #ifdef HAVE_GTK_UNIX_PRINTING
-static WebKitPrintOperationResponse webkitPrintOperationRunDialogUnix(WebKitPrintOperation* printOperation, GtkWindow* parent)
+static WebKitPrintOperationResponse webkitPrintOperationRunDialog(WebKitPrintOperation* printOperation, GtkWindow* parent)
 {
     GtkPrintUnixDialog* printDialog = GTK_PRINT_UNIX_DIALOG(gtk_print_unix_dialog_new(0, parent));
     gtk_print_unix_dialog_set_manual_capabilities(printDialog, static_cast<GtkPrintCapabilities>(GTK_PRINT_CAPABILITY_NUMBER_UP
 {
     GtkPrintUnixDialog* printDialog = GTK_PRINT_UNIX_DIALOG(gtk_print_unix_dialog_new(0, parent));
     gtk_print_unix_dialog_set_manual_capabilities(printDialog, static_cast<GtkPrintCapabilities>(GTK_PRINT_CAPABILITY_NUMBER_UP
@@ -228,10 +228,9 @@ static WebKitPrintOperationResponse webkitPrintOperationRunDialogUnix(WebKitPrin
 
     return returnValue;
 }
 
     return returnValue;
 }
-#endif // HAVE_GTK_UNIX_PRINTING
-
-#ifdef G_OS_WIN32
-static WebKitPrintOperationResponse webkitPrintOperationRunDialogWin32(WebKitPrintOperation*, GtkWindow*)
+#else
+// TODO: We need to add an implementation for Windows.
+static WebKitPrintOperationResponse webkitPrintOperationRunDialog(WebKitPrintOperation*, GtkWindow*)
 {
     notImplemented();
     return WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL;
 {
     notImplemented();
     return WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL;
@@ -261,13 +260,8 @@ WebKitPrintOperationResponse webkitPrintOperationRunDialogForFrame(WebKitPrintOp
         if (WebCore::widgetIsOnscreenToplevelWindow(toplevel))
             parent = GTK_WINDOW(toplevel);
     }
         if (WebCore::widgetIsOnscreenToplevelWindow(toplevel))
             parent = GTK_WINDOW(toplevel);
     }
-#ifdef HAVE_GTK_UNIX_PRINTING
-    WebKitPrintOperationResponse response = webkitPrintOperationRunDialogUnix(printOperation, parent);
-#endif
-#ifdef G_OS_WIN32
-    WebKitPrintOperationResponse response = webkitPrintOperationRunDialogWin32(printOperation, parent);
-#endif
 
 
+    WebKitPrintOperationResponse response = webkitPrintOperationRunDialog(printOperation, parent);
     if (response == WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL)
         return response;
 
     if (response == WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL)
         return response;
 
index 0ba9b70..b0440cf 100644 (file)
@@ -367,9 +367,10 @@ PassRefPtr<WebPrintOperationGtk> WebPrintOperationGtk::create(WebPage* page, con
 {
 #ifdef HAVE_GTK_UNIX_PRINTING
     return adoptRef(new WebPrintOperationGtkUnix(page, printInfo));
 {
 #ifdef HAVE_GTK_UNIX_PRINTING
     return adoptRef(new WebPrintOperationGtkUnix(page, printInfo));
-#endif
-#ifdef G_OS_WIN32
+#elif defined(G_OS_WIN32)
     return adoptRef(new WebPrintOperationGtkWin32(page, printInfo));
     return adoptRef(new WebPrintOperationGtkWin32(page, printInfo));
+#else
+    return 0;
 #endif
 }
 
 #endif
 }