devhelp r1170 - in trunk: . src



Author: herzi
Date: Thu Oct  9 17:42:54 2008
New Revision: 1170
URL: http://svn.gnome.org/viewvc/devhelp?rev=1170&view=rev

Log:
2008-10-07  Sven Herzberg  <sven imendio com>

	Moved assistant_button_press_event_cb into DhAssistantView

	* src/dh-assistant-view.c: added assistant_button_press_event_cb
	* src/dh-assistant.c: dropped assistant_button_press_event_cb


Modified:
   trunk/ChangeLog
   trunk/src/dh-assistant-view.c
   trunk/src/dh-assistant.c

Modified: trunk/src/dh-assistant-view.c
==============================================================================
--- trunk/src/dh-assistant-view.c	(original)
+++ trunk/src/dh-assistant-view.c	Thu Oct  9 17:42:54 2008
@@ -82,14 +82,29 @@
         return WEBKIT_NAVIGATION_RESPONSE_IGNORE;
 }
 
+static gboolean
+assistant_button_press_event_cb (GtkWidget      *widget,
+                                 GdkEventButton *event)
+{
+        /* Block webkit's builtin context menu. */
+        if (event->button != 1) {
+                return TRUE;
+        }
+
+        return FALSE;
+}
+
 static void
 dh_assistant_view_class_init (DhAssistantViewClass* self_class)
 {
         GObjectClass       *object_class = G_OBJECT_CLASS (self_class);
+        GtkWidgetClass     *widget_class = GTK_WIDGET_CLASS (self_class);
         WebKitWebViewClass *web_view_class = WEBKIT_WEB_VIEW_CLASS (self_class);
 
         object_class->finalize = view_finalize;
 
+        widget_class->button_press_event = assistant_button_press_event_cb;
+
         web_view_class->navigation_requested = assistant_navigation_requested_cb;
 }
 

Modified: trunk/src/dh-assistant.c
==============================================================================
--- trunk/src/dh-assistant.c	(original)
+++ trunk/src/dh-assistant.c	Thu Oct  9 17:42:54 2008
@@ -59,19 +59,6 @@
         return FALSE;
 }
 
-static gboolean
-assistant_button_press_event_cb (GtkWidget      *widget,
-                                 GdkEventButton *event,
-                                 gpointer        user_data)
-{
-        /* Block webkit's builtin context menu. */
-        if (event->button != 1) {
-                return TRUE;
-        }
-
-        return FALSE;
-}
-
 static void
 assistant_finalize (GObject *object)
 {
@@ -111,10 +98,6 @@
 
         priv->web_view = dh_assistant_view_new ();
 
-        g_signal_connect (priv->web_view, "button-press-event",
-                          G_CALLBACK (assistant_button_press_event_cb),
-                          assistant);
-
         g_signal_connect (priv->web_view, "key-press-event",
                           G_CALLBACK (assistant_key_press_event_cb),
                           assistant);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]