summaryrefslogtreecommitdiffstats
path: root/WebKit/gtk/webkit/webkitwebframe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/gtk/webkit/webkitwebframe.cpp')
-rw-r--r--WebKit/gtk/webkit/webkitwebframe.cpp63
1 files changed, 61 insertions, 2 deletions
diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp
index 64fdc40..fbd246d 100644
--- a/WebKit/gtk/webkit/webkitwebframe.cpp
+++ b/WebKit/gtk/webkit/webkitwebframe.cpp
@@ -54,7 +54,9 @@
#include "JSDOMBinding.h"
#include "ScriptController.h"
#include "SubstituteData.h"
+#if ENABLE(SVG)
#include "SVGSMILElement.h"
+#endif
#include <atk/atk.h>
#include <JavaScriptCore/APICast.h>
@@ -182,6 +184,14 @@ static void webkit_web_frame_class_init(WebKitWebFrameClass* frameClass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
+ /**
+ * WebKitWebFrame::load-done
+ * @web_frame: the object on which the signal is emitted
+ *
+ * Emitted when frame loading is done.
+ *
+ * Deprecated: Use the "load-status" property instead.
+ */
webkit_web_frame_signals[LOAD_COMMITTED] = g_signal_new("load-committed",
G_TYPE_FROM_CLASS(frameClass),
(GSignalFlags)G_SIGNAL_RUN_LAST,
@@ -197,7 +207,7 @@ static void webkit_web_frame_class_init(WebKitWebFrameClass* frameClass)
*
* Emitted when frame loading is done.
*
- * Deprecated: Use WebKitWebView::load-finished instead, and/or
+ * Deprecated: Use the "load-status" property instead, and/or
* WebKitWebView::load-error to be notified of load errors
*/
webkit_web_frame_signals[LOAD_DONE] = g_signal_new("load-done",
@@ -210,6 +220,15 @@ static void webkit_web_frame_class_init(WebKitWebFrameClass* frameClass)
G_TYPE_NONE, 1,
G_TYPE_BOOLEAN);
+ /**
+ * WebKitWebFrame::title-changed:
+ * @frame: the object on which the signal is emitted
+ * @title: the new title
+ *
+ * When a #WebKitWebFrame changes the document title this signal is emitted.
+ *
+ * Deprecated: 1.1.18: Use "notify::title" instead.
+ */
webkit_web_frame_signals[TITLE_CHANGED] = g_signal_new("title-changed",
G_TYPE_FROM_CLASS(frameClass),
(GSignalFlags)G_SIGNAL_RUN_LAST,
@@ -250,6 +269,9 @@ static void webkit_web_frame_class_init(WebKitWebFrameClass* frameClass)
* WebKitWebFrame:horizontal-scrollbar-policy and
* WebKitWebFrame:vertical-scrollbar-policy properties.
*
+ * Return value: %TRUE to stop other handlers from being invoked for the
+ * event. %FALSE to propagate the event further.
+ *
* Since: 1.1.14
*/
webkit_web_frame_signals[SCROLLBARS_POLICY_CHANGED] = g_signal_new("scrollbars-policy-changed",
@@ -822,6 +844,29 @@ gchar* webkit_web_frame_counter_value_for_element_by_id(WebKitWebFrame* frame, c
}
/**
+ * webkit_web_frame_page_number_for_element_by_id
+ * @frame: a #WebKitWebFrame
+ * @id: an element ID string
+ * @pageWidth: width of a page
+ * @pageHeight: height of a page
+ *
+ * Return value: The number of page where the specified element will be put
+ */
+int webkit_web_frame_page_number_for_element_by_id(WebKitWebFrame* frame, const gchar* id, float pageWidth, float pageHeight)
+{
+ g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL);
+
+ Frame* coreFrame = core(frame);
+ if (!coreFrame)
+ return -1;
+
+ Element* coreElement = coreFrame->document()->getElementById(AtomicString(id));
+ if (!coreElement)
+ return -1;
+ return PrintContext::pageNumberForElement(coreElement, FloatSize(pageWidth, pageHeight));
+}
+
+/**
* webkit_web_frame_get_pending_unload_event_count:
* @frame: a #WebKitWebFrame
*
@@ -891,7 +936,12 @@ GtkPrintOperationResult webkit_web_frame_print_full(WebKitWebFrame* frame, GtkPr
g_return_val_if_fail(GTK_IS_PRINT_OPERATION(operation), GTK_PRINT_OPERATION_RESULT_ERROR);
GtkWidget* topLevel = gtk_widget_get_toplevel(GTK_WIDGET(webkit_web_frame_get_web_view(frame)));
+
+#if GTK_CHECK_VERSION(2, 18, 0)
+ if (!gtk_widget_is_toplevel(topLevel))
+#else
if (!GTK_WIDGET_TOPLEVEL(topLevel))
+#endif
topLevel = NULL;
Frame* coreFrame = core(frame);
@@ -930,11 +980,20 @@ void webkit_web_frame_print(WebKitWebFrame* frame)
if (error) {
GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(priv->webView));
+#if GTK_CHECK_VERSION(2, 18, 0)
+ GtkWidget* dialog = gtk_message_dialog_new(gtk_widget_is_toplevel(window) ? GTK_WINDOW(window) : 0,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ "%s", error->message);
+#else
GtkWidget* dialog = gtk_message_dialog_new(GTK_WIDGET_TOPLEVEL(window) ? GTK_WINDOW(window) : 0,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"%s", error->message);
+#endif
+
g_error_free(error);
g_signal_connect(dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
@@ -963,13 +1022,13 @@ bool webkit_web_frame_pause_transition(WebKitWebFrame* frame, const gchar* name,
bool webkit_web_frame_pause_svg_animation(WebKitWebFrame* frame, const gchar* animationId, double time, const gchar* elementId)
{
ASSERT(core(frame));
+#if ENABLE(SVG)
Document* document = core(frame)->document();
if (!document || !document->svgExtensions())
return false;
Element* coreElement = document->getElementById(AtomicString(animationId));
if (!coreElement || !SVGSMILElement::isSMILElement(coreElement))
return false;
-#if ENABLE(SVG)
return document->accessSVGExtensions()->sampleAnimationAtTime(elementId, static_cast<SVGSMILElement*>(coreElement), time);
#else
return false;