aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-web-view.c
diff options
context:
space:
mode:
authorGustavo Noronha Silva <gns@gnome.org>2009-08-28 04:02:45 +0800
committerGustavo Noronha Silva <gns@gnome.org>2009-08-28 21:11:27 +0800
commit7eafc70b2158944f8d783a8e283547153979f015 (patch)
tree34cc51eecad37a734735cbb80908d61e61052248 /embed/ephy-web-view.c
parent4b06e10f0870528a180f614375e4de158ddb8751 (diff)
downloadgsoc2013-epiphany-7eafc70b2158944f8d783a8e283547153979f015.tar.gz
gsoc2013-epiphany-7eafc70b2158944f8d783a8e283547153979f015.tar.zst
gsoc2013-epiphany-7eafc70b2158944f8d783a8e283547153979f015.zip
Reimplement "search keys" structure for the WebKit backend
This allows Epiphany itself, and extensions to treat keys that are not handled by the WebView for in-page search purposes.
Diffstat (limited to 'embed/ephy-web-view.c')
-rw-r--r--embed/ephy-web-view.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 1e1ce1864..a1228904a 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -486,6 +486,22 @@ ephy_web_view_file_monitor_cancel (EphyWebView *view)
priv->reload_delay_ticks = 0;
}
+static gboolean
+ephy_web_view_key_press_event (GtkWidget *widget, GdkEventKey *event)
+{
+ EphyWebView *web_view = EPHY_WEB_VIEW (widget);
+ gboolean key_handled = FALSE;
+
+ key_handled = GTK_WIDGET_CLASS (ephy_web_view_parent_class)->key_press_event (widget, event);
+
+ if (key_handled)
+ return TRUE;
+
+ g_signal_emit_by_name (web_view, "search-key-press", event, &key_handled);
+
+ return key_handled;
+}
+
static void
ephy_web_view_dispose (GObject *object)
{
@@ -526,12 +542,15 @@ static void
ephy_web_view_class_init (EphyWebViewClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gobject_class->dispose = ephy_web_view_dispose;
gobject_class->finalize = ephy_web_view_finalize;
gobject_class->get_property = ephy_web_view_get_property;
gobject_class->set_property = ephy_web_view_set_property;
+ widget_class->key_press_event = ephy_web_view_key_press_event;
+
g_object_class_install_property (gobject_class,
PROP_ADDRESS,
g_param_spec_string ("address",
@@ -851,14 +870,14 @@ ephy_web_view_class_init (EphyWebViewClass *klass)
G_TYPE_POINTER);
/**
- * EphyWebView::ge-search-key-press:
+ * EphyWebView::search-key-press:
* @embed:
* @event: the #GdkEventKey which triggered this signal
*
- * The ::ge-search-key-press signal is emitted for keypresses which
+ * The ::search-key-press signal is emitted for keypresses which
* should be used for find implementations.
**/
- g_signal_new ("ge-search-key-press",
+ g_signal_new ("search-key-press",
EPHY_TYPE_WEB_VIEW,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EphyWebViewClass, search_key_press),