diff options
author | joakim@verona.se <> | 2011-06-28 21:42:45 +0200 |
---|---|---|
committer | joakim@verona.se <> | 2011-06-28 21:42:45 +0200 |
commit | 2322d228fce31d5cab152a9b59dd0331ee4e86e5 (patch) | |
tree | fc929a2075af2d0e490c4238efccfd811ad83fd7 | |
parent | 09a240c3d4172683b4f68eb5de2a2b423befddb2 (diff) | |
download | emacs-2322d228fce31d5cab152a9b59dd0331ee4e86e5.tar.gz |
proof of concept webkit xwidget
-rw-r--r-- | README.xwidget | 42 | ||||
-rw-r--r-- | lisp/xwidget-test.el | 4 | ||||
-rw-r--r-- | src/xwidget.c | 12 |
3 files changed, 52 insertions, 6 deletions
diff --git a/README.xwidget b/README.xwidget index 65e5598f7f2..6a6633b4b20 100644 --- a/README.xwidget +++ b/README.xwidget @@ -237,11 +237,15 @@ Surprisingly, this just worked! I used gtk signals, the implementation for sliders works well! ** TODO canvas support +heresy an interesting comparision of gtk canvases +http://live.gnome.org/ProjectRidley/CanvasOverview *** goocanvas goocanvas is a gtk canvas implemented using cairo. investigate. -http://developer.gnome.org/goocanvas/unstable/goocanvas-model-view-canvas.html -it has a MVC model aproach out of the box which is nice. +pros: +- it has a MVC model aproach out of the box which is nice. + +http://developer.gnome.org/goocanvas/unstable/goocanvas-model-view-canvas.html export CFLAGS="`pkg-config --cflags goocanvas` -DHAVE_GOOCANVAS" export LDFLAGS=`pkg-config --libs goocanvas` @@ -249,9 +253,20 @@ export LDFLAGS=`pkg-config --libs goocanvas` make I made a hello goo world xwidget so seems doable. -I wanted to load a SVG which wasnt straightforward. +I wanted to load a SVG which wasnt immediately straightforward, so I +tried clutter. but it turns out the exact same strategy could be used +with goocanvas. + *** clutter -maybe clutter can be used as a canvas? seems to have a lot of traction atm. +maybe clutter can be used as a canvas? +pros: +- seems to have a lot of traction atm. many examples +- potentialy fast and cool vector graphics +cons: +- no out of the box MVC support, but seems doable. no worse than the + other home brew mvc support I have in xwidgets +(media-explorer in an application that employes the MVC pattern) + http://www.openismus.com/documents/clutter_tutorial/0.9/docs/tutorial/html/sec-stage-widget.html there is also cool stuff like this: @@ -293,3 +308,22 @@ it is an error to reuse xwidgets in several buffers or in the same buffer. how do we catch these errors? +** TODO browser xwidget +although embedding a browser is not my primary concern many are +interested in this. some suitable browser component needs to be found +supporting gtk. + +*** webkit +there is a webkit gtk port. there is no obvious mvc support. +http://live.gnome.org/WebKitGtk +http://webkitgtk.org/ + + +export CFLAGS="`pkg-config --cflags webkit-1.0` -DHAVE_WEBKIT -g" +export LDFLAGS=`pkg-config --libs webkit-1.0` +./configure +make + +*** firefox +http://www-archive.mozilla.org/unix/gtk-embedding.html +seems to be severly bitrotted diff --git a/lisp/xwidget-test.el b/lisp/xwidget-test.el index 2c73f4fd3ce..2e1cb033d8d 100644 --- a/lisp/xwidget-test.el +++ b/lisp/xwidget-test.el @@ -56,6 +56,10 @@ (xwidget-insert (point-min) 'cairo "canvas" 1000 1000 5) (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic)) +(xwidget-demo "a-webkit" + (xwidget-insert (point-min) 'webkit "webkit" 1000 1000 5) + (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic)) + (xwidget-demo "basic" diff --git a/src/xwidget.c b/src/xwidget.c index 870054469c0..14110af7fce 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -105,7 +105,7 @@ Lisp_Object Qxwidget_info; Lisp_Object Qxwidget_resize_internal; Lisp_Object Qxwidget_send_keyboard_event; -Lisp_Object Qbutton, Qtoggle, Qslider, Qsocket, Qcairo, QCplist; +Lisp_Object Qbutton, Qtoggle, Qslider, Qsocket, Qcairo, Qwebkit, QCplist; extern Lisp_Object QCtype; @@ -339,6 +339,13 @@ xwidget_init_view ( clutter_actor_show (stage); #endif + } else if (EQ(xww->type, Qwebkit)) { +#ifdef HAVE_WEBKIT + xv->widget = webkit_web_view_new(); + webkit_web_view_load_uri(xv->widget, "http://www.fsf.org"); +#endif + + } else return NULL; //widget realization @@ -722,7 +729,8 @@ syms_of_xwidget (void) DEFSYM (Qslider, "slider"); DEFSYM (Qsocket, "socket"); DEFSYM (Qcairo, "cairo"); - + DEFSYM (Qwebkit ,"webkit"); + DEFSYM (QCplist, ":plist"); Fprovide (intern ("xwidget-internal"), Qnil); |