[Webkit-unassigned] [Bug 14678] [gdk] API Drafting

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 23 10:26:10 PDT 2007


http://bugs.webkit.org/show_bug.cgi?id=14678





------- Comment #16 from xan.lopez at gmail.com  2007-07-23 10:26 PDT -------
Some comments on the implementation:

+    webkit_gtk_frame_signals[CLEARED] = g_signal_new("cleared",
+            G_TYPE_FROM_CLASS(frame_class),
+            (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+            NULL,
+            NULL,
+            NULL,
+            g_cclosure_marshal_VOID__VOID,
+            G_TYPE_NONE, 0);

The WebKitGtkFrame signals have no class method associated, so not even
subclasses will be able to assign one. Is this the desired behavior?

+static void webkit_gtk_page_register_rendering_area_events(GtkWidget* win,
WebKitGtkPage* page)
+{
+    gdk_window_set_events(GTK_IS_LAYOUT(win) ? GTK_LAYOUT(win)->bin_window :
win->window,
+                          (GdkEventMask)(GDK_EXPOSURE_MASK
+                            | GDK_BUTTON_PRESS_MASK
+                            | GDK_BUTTON_RELEASE_MASK
+                            | GDK_POINTER_MOTION_MASK
+                            | GDK_KEY_PRESS_MASK
+                            | GDK_KEY_RELEASE_MASK
+                            | GDK_BUTTON_MOTION_MASK
+                            | GDK_BUTTON1_MOTION_MASK
+                            | GDK_BUTTON2_MOTION_MASK
+                            | GDK_BUTTON3_MOTION_MASK));

Set the realize handler and do this there. 

+
+    g_signal_connect(GTK_OBJECT(win), "expose-event",
G_CALLBACK(webkit_gtk_page_rendering_area_handle_gdk_event), page);
+    g_signal_connect(GTK_OBJECT(win), "key-press-event",
G_CALLBACK(webkit_gtk_page_rendering_area_handle_gdk_event), page);
+    g_signal_connect(GTK_OBJECT(win), "key-release-event",
G_CALLBACK(webkit_gtk_page_rendering_area_handle_gdk_event), page);
+    g_signal_connect(GTK_OBJECT(win), "button-press-event",
G_CALLBACK(webkit_gtk_page_rendering_area_handle_gdk_event), page);
+    g_signal_connect(GTK_OBJECT(win), "button-release-event",
G_CALLBACK(webkit_gtk_page_rendering_area_handle_gdk_event), page);
+    g_signal_connect(GTK_OBJECT(win), "motion-notify-event",
G_CALLBACK(webkit_gtk_page_rendering_area_handle_gdk_event), page);
+    g_signal_connect(GTK_OBJECT(win), "scroll-event",
G_CALLBACK(webkit_gtk_page_rendering_area_handle_gdk_event), page);
+}

Same here. You could set the "event" handler and call the function for all
those events. In general connecting to your own signals makes little sense as
far as I know.

+    webkit_gtk_page_signals[LOAD_PROGRESS_CHANGED] =
g_signal_new("load_progress_changed",
+            G_TYPE_FROM_CLASS(page_class),
+            (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+            NULL,
+            NULL,
+            NULL,
+            g_cclosure_marshal_VOID__INT,
+            G_TYPE_NONE, 1,
+            G_TYPE_INT);

Same than in frame.

+    g_signal_connect_after(G_OBJECT(page), "realize",
G_CALLBACK(webkit_gtk_page_register_rendering_area_events), page);
+    g_signal_connect_after(G_OBJECT(page), "size-allocate",
G_CALLBACK(webkit_gtk_page_rendering_area_resize_callback), page);
+

Set the handlers. You can call your parent's method before doing your thing if
needed.

Index: WebKit/gtk/Api/webkitgtksettings.h
===================================================================
--- WebKit/gtk/Api/webkitgtksettings.h  (revision 0)
+++ WebKit/gtk/Api/webkitgtksettings.h  (revision 0)

(...)

In general settings are implemented as GObject properties, any reason to not do
that here (as properties on other class)?


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list