WebKit integration anyway


#1

Hi Julian.

Do you plan to make an underlying layer in JUCE to support the WebKit integration? I’m asking that since I’ve seen an easy and seamless integration into the Gtk library, the Qt framework and many more. Trolltech will officially integrate it into the Qt framework since the 4.4 version or so. Google selected WebKit as their web rendering engine for their Android. Aren’t that not enough arguments to support WebKit like you do that to QuickTime and OpenGL in JUCE?


#2

I need to embed a browser for another project I’m working on, so I’ll be looking into this kind of thing soon! (And of course if Qt does it, I need to keep up with them…)


#3

Thank you, Julian. :smiley:


#4

+1


#5

I’ve just been trying this, and when I finally built WebKit, the lib file it produced is almost 1GB in size - and my poor PC hasn’t got enough memory to link to it! Has anyone actually managed to build anything with WebKit?..


#6

You should check against last qt 4.4 snapshot:
http://trolltech.com/developer/downloads/qt/snapshots
For spying how they managed to integrate webkit into their library:
http://doc.trolltech.com/main-snapshot/qtwebkit.html

Looking at webkit svn there seems to be a GraphicsContext class (among others) per platform implementation:
Qt:
http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
CoreGraphics:
http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Cairo:
http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
Win32:
http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/platform/graphics/win/GraphicsContextWin.cpp
Wx:
http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/platform/graphics/wx/GraphicsContextWx.cpp

Maybe a good start will be to hack platform/graphics/juce/GraphicsContextJuce.cpp in there.


#7

I’ve given up on webkit - it’s just too much of a mess to work out how to even build the damn thing, let alone integrate it. Am looking at gecko at the moment, which seems a bit more usable, as the XUL SDK allows embedding.


#8

Strange, without looking deeply into it I thought that webkit was lighter and more “embeddable” that gecko.
Anyway you can take a look at:
http://www.ubrowser.com/
For example of gecko embedding.


#9

getting WebKit to build on OS X is really easy. I’m assuming the problem must be building on windows?

I’m sad now. I work with a team on a product that builds a xulrunner application, and it is quite a beast to work with. I was hoping JUCE + WebKit would be a viable alternative. I’ll have more time to investigate in a couple of weeks.


#10

I’m just having some hassle with xulrunner now… Why are all these things such a bloody nightmare to build? Hasn’t anyone written a browser that’s just a straightforward set of c++ classes that you can build without needing millions of bizarre scripts that never work properly??.. :evil:


#11

UZI?

It’s still missing the basic CSS parsing, but it can fetch and display any URL almost correctly…

BTW, I would welcome anyone helping me to improve it.

Edit: Realized I haven’t updated the repository recently, so there is still old code in their. The new version is much more compliant when it deals with table rendering. Let me know if you need it.


#12

You’ve compiled it in release mode ?

i’ve done it properly as a shared library under linux, and the libQtWebKit.so.4.3.2 occupies only 12mb in size. No problem linking as i don’t link it statically, and it is working very nicely with the qt and gtk binding.

the way to go is to write the backend for juce before trying to embed it. if i will find some time i’ll give it a go.

edit - the steps to compile it properly in linux from svn as it is not stated on the site:

# Be careful you already have dependancies like:
#    gperf libiconv qt4 icu xslt curl3 sqlite3 libjpeg62 libpng12 bison flex

svn co http://svn.webkit.org/repository/webkit/trunk WebKit

cd WebKit/WebKitTools/Scripts/
QTDIR=/usr/share/qt4 ./build-webkit --qmakearg=WEBKIT_INC_DIR=$PREFIX/include/WebKit --qmakearg=WEBKIT_LIB_DIR=$PREFIX/lib --gdk
sudo make install

./run-launcher

after doing make install you can easily #include <webkit.h> on your applications and link the shared library


#13

[quote=“X-Ryl669”]UZI?

It’s still missing the basic CSS parsing, but it can fetch and display any URL almost correctly…

BTW, I would welcome anyone helping me to improve it.

Edit: Realized I haven’t updated the repository recently, so there is still old code in their. The new version is much more compliant when it deals with table rendering. Let me know if you need it.[/quote]

Yeah, I need a full-featured browser that can do fancy stuff like javascript…

[quote]
i’ve done it properly as a shared library under linux, and the libQtWebKit.so.4.3.2 occupies only 12mb in size. No problem linking as i don’t link it statically, and it is working very nicely with the qt and gtk binding. [/quote]

I don’t need a windows version, it’s just windows that I had a nasty time with. I got around the problem with the huge library, but there were millions of other stupid build failures and I just got sick of it and gave up…


#14

Maybe there is another way to use compiled WebKit shared library like you do that to QuickTime and OpenGL. Maybe that’s the way… Am I missing something?


#15

If there is, I’d love to know about it!


#16

i wanted to ask, which one is “1GB” lib, is it QtWebKit?
and how to build the lib anyway? ( if it’s not QtWebkit )
i’ve build QtWebKit dll, it only takes about 6-7 MB ( 2008.05.05 )


#17

No, I wasn’t using the Qt version. Can’t actually remember now, I gave up on webkit pretty quickly and turned to mozilla instead.


#18