- Revision
- 125890
- Author
- carlo...@webkit.org
- Date
- 2012-08-17 06:11:15 -0700 (Fri, 17 Aug 2012)
Log Message
[GTK] Rename WebKitWebView print-requested signal to print
https://bugs.webkit.org/show_bug.cgi?id=94306
Reviewed by Martin Robinson.
WebKitWebView::print-requested is inconsistent with the rest of
the API. It's a true_handled signal that allows users to implement
their own print dialog, or block printing, or rely on
defaults. The signal should be WebKitWebView::print like other
signals (create, close, decide_policy, etc.)
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_class_init):
(webkitWebViewPrintFrame):
* UIProcess/API/gtk/WebKitWebView.h:
(_WebKitWebViewClass):
* UIProcess/API/gtk/tests/TestPrinting.cpp:
(webViewPrintCallback):
(testWebViewPrint):
(beforeAll):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (125889 => 125890)
--- trunk/Source/WebKit2/ChangeLog 2012-08-17 13:00:01 UTC (rev 125889)
+++ trunk/Source/WebKit2/ChangeLog 2012-08-17 13:11:15 UTC (rev 125890)
@@ -1,3 +1,26 @@
+2012-08-17 Carlos Garcia Campos <cgar...@igalia.com>
+
+ [GTK] Rename WebKitWebView print-requested signal to print
+ https://bugs.webkit.org/show_bug.cgi?id=94306
+
+ Reviewed by Martin Robinson.
+
+ WebKitWebView::print-requested is inconsistent with the rest of
+ the API. It's a true_handled signal that allows users to implement
+ their own print dialog, or block printing, or rely on
+ defaults. The signal should be WebKitWebView::print like other
+ signals (create, close, decide_policy, etc.)
+
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (webkit_web_view_class_init):
+ (webkitWebViewPrintFrame):
+ * UIProcess/API/gtk/WebKitWebView.h:
+ (_WebKitWebViewClass):
+ * UIProcess/API/gtk/tests/TestPrinting.cpp:
+ (webViewPrintCallback):
+ (testWebViewPrint):
+ (beforeAll):
+
2012-08-17 Sudarsana Nagineni <sudarsana.nagin...@linux.intel.com>
[EFL] [WK2] Free Eina Strbuf with eina_strbuf_free() instead of eina_strbuf_string_free()
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp (125889 => 125890)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp 2012-08-17 13:00:01 UTC (rev 125889)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp 2012-08-17 13:11:15 UTC (rev 125890)
@@ -79,7 +79,7 @@
MOUSE_TARGET_CHANGED,
- PRINT_REQUESTED,
+ PRINT,
RESOURCE_LOAD_STARTED,
@@ -882,7 +882,7 @@
WEBKIT_TYPE_HIT_TEST_RESULT,
G_TYPE_UINT);
/**
- * WebKitWebView::print-requested:
+ * WebKitWebView::print:
* @web_view: the #WebKitWebView on which the signal is emitted
* @print_operation: the #WebKitPrintOperation that will handle the print request
*
@@ -899,11 +899,11 @@
* Returns: %TRUE to stop other handlers from being invoked for the event.
* %FALSE to propagate the event further.
*/
- signals[PRINT_REQUESTED] =
- g_signal_new("print-requested",
+ signals[PRINT] =
+ g_signal_new("print",
G_TYPE_FROM_CLASS(webViewClass),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(WebKitWebViewClass, print_requested),
+ G_STRUCT_OFFSET(WebKitWebViewClass, print),
g_signal_accumulator_true_handled, 0,
webkit_marshal_BOOLEAN__OBJECT,
G_TYPE_BOOLEAN, 1,
@@ -1321,7 +1321,7 @@
{
GRefPtr<WebKitPrintOperation> printOperation = adoptGRef(webkit_print_operation_new(webView));
gboolean returnValue;
- g_signal_emit(webView, signals[PRINT_REQUESTED], 0, printOperation.get(), &returnValue);
+ g_signal_emit(webView, signals[PRINT], 0, printOperation.get(), &returnValue);
if (returnValue)
return;
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h (125889 => 125890)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h 2012-08-17 13:00:01 UTC (rev 125889)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h 2012-08-17 13:11:15 UTC (rev 125890)
@@ -162,7 +162,7 @@
void (* mouse_target_changed) (WebKitWebView *web_view,
WebKitHitTestResult *hit_test_result,
guint modifiers);
- gboolean (* print_requested) (WebKitWebView *web_view,
+ gboolean (* print) (WebKitWebView *web_view,
WebKitPrintOperation *print_operation);
void (* resource_load_started) (WebKitWebView *web_view,
WebKitWebResource *resource,
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestPrinting.cpp (125889 => 125890)
--- trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestPrinting.cpp 2012-08-17 13:00:01 UTC (rev 125889)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestPrinting.cpp 2012-08-17 13:11:15 UTC (rev 125890)
@@ -49,7 +49,7 @@
g_assert(webkit_print_operation_get_page_setup(printOperation.get()) == pageSetup.get());
}
-static gboolean webViewPrintRequestedCallback(WebKitWebView* webView, WebKitPrintOperation* printOperation, WebViewTest* test)
+static gboolean webViewPrintCallback(WebKitWebView* webView, WebKitPrintOperation* printOperation, WebViewTest* test)
{
g_assert(webView == test->m_webView);
@@ -64,9 +64,9 @@
return TRUE;
}
-static void testWebViewPrintRequested(WebViewTest* test, gconstpointer)
+static void testWebViewPrint(WebViewTest* test, gconstpointer)
{
- g_signal_connect(test->m_webView, "print-requested", G_CALLBACK(webViewPrintRequestedCallback), test);
+ g_signal_connect(test->m_webView, "print", G_CALLBACK(webViewPrintCallback), test);
test->loadHtml("<html><body _onLoad_=\"print();\">WebKitGTK+ printing test</body></html>", 0);
g_main_loop_run(test->m_mainLoop);
}
@@ -196,7 +196,7 @@
g_assert(kTempDirectory);
WebViewTest::add("WebKitPrintOperation", "printing-settings", testPrintOperationPrintSettings);
- WebViewTest::add("WebKitWebView", "print-requested", testWebViewPrintRequested);
+ WebViewTest::add("WebKitWebView", "print", testWebViewPrint);
#ifdef HAVE_GTK_UNIX_PRINTING
PrintTest::add("WebKitPrintOperation", "print", testPrintOperationPrint);
PrintTest::add("WebKitPrintOperation", "print-errors", testPrintOperationErrors);