[webkit-help] What's the WebCore entry point to display a page?

Eagle Offshore eagleoffshore at mac.com
Sat Aug 15 10:30:32 PDT 2009


Thanks, that's a good place to start digging.

I'm trying to do see about doing a port of webkit to Squeak/Pharo.    
So I'm trying to figure out where the lines are between the portable  
and the platform specific code.  Squeak has its own graphics system  
and widget set.  It doesn't use native widgets.  So as I dig into it  
I'm finding that:

1) Fetching data from URLS is platform specific?
2) Layout/Geometry and abstract painting seems to be done in  
WebCore::Renderxxx but this isn't the DOM - correct?
3) The DOM is represented differently on every platform and bound to  
javascript somehow? - so do I need to create a Smalltalk version of  
the DOM based on some IDL?  I see the code generator and two parallel  
hierarchies in WebCore (I happen to be working on a Mac but I want it  
to be as portable as Squeak which means using Squeak graphics and  
either Smalltalk DOM objects, or C++ DOM bridged somehow).

I guess I'm trying to find the portable/platform interfaces and its  
not so obvious which is which.

On Aug 15, 2009, at 4:40 AM, Ryan Leavengood wrote:

> On Sat, Aug 15, 2009 at 6:31 AM, Eagle  
> Offshore<eagleoffshore at mac.com> wrote:
>>
>> Anybody got a snippet of code that shows how to take a URL string  
>> and get it
>> loaded/parsed/and painted?  I'm going round and round trying to  
>> figure out
>> what class is the entry point to kick off the entire load/display  
>> cycle.
>
> Each port does it differently, but it generally will start with some
> sort of binding in the actual "WebKit" part of the code. In fact each
> port has a simple *Launcher application which should have the code you
> are interested in. As an example, here is the main method of
> GtkLauncher (WebKitTools/GtkLauncher/main.c):
>
> int
> main (int argc, char* argv[])
> {
>    gtk_init (&argc, &argv);
>    if (!g_thread_supported ())
>        g_thread_init (NULL);
>
>    GtkWidget* vbox = gtk_vbox_new (FALSE, 0);
>    gtk_box_pack_start (GTK_BOX (vbox), create_toolbar (), FALSE,  
> FALSE, 0);
>    gtk_box_pack_start (GTK_BOX (vbox), create_browser (), TRUE,  
> TRUE, 0);
>    gtk_box_pack_start (GTK_BOX (vbox), create_statusbar (), FALSE,  
> FALSE, 0);
>
>    main_window = create_window ();
>    gtk_container_add (GTK_CONTAINER (main_window), vbox);
>
>    gchar* uri = (gchar*) (argc > 1 ? argv[1] : "http:// 
> www.google.com/");
>    webkit_web_view_load_uri (web_view, uri);
>
>    gtk_widget_grab_focus (GTK_WIDGET (web_view));
>    gtk_widget_show_all (main_window);
>    gtk_main ();
>
>    return 0;
> }
>
> The above makes use of the GTK port WebKit bindings (specifically it
> uses webkit_web_view_load_uri) which are at WebKit/gtk/webkit. Other
> ports are similar.
>
> -- 
> Regards,
> Ryan
> _______________________________________________
> webkit-help mailing list
> webkit-help at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-help



More information about the webkit-help mailing list