diff options
| -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! | |||
| 237 | I used gtk signals, the implementation for sliders works well! | 237 | I used gtk signals, the implementation for sliders works well! |
| 238 | 238 | ||
| 239 | ** TODO canvas support | 239 | ** TODO canvas support |
| 240 | heresy an interesting comparision of gtk canvases | ||
| 241 | http://live.gnome.org/ProjectRidley/CanvasOverview | ||
| 240 | *** goocanvas | 242 | *** goocanvas |
| 241 | goocanvas is a gtk canvas implemented using cairo. investigate. | 243 | goocanvas is a gtk canvas implemented using cairo. investigate. |
| 242 | http://developer.gnome.org/goocanvas/unstable/goocanvas-model-view-canvas.html | ||
| 243 | it has a MVC model aproach out of the box which is nice. | ||
| 244 | 244 | ||
| 245 | pros: | ||
| 246 | - it has a MVC model aproach out of the box which is nice. | ||
| 247 | |||
| 248 | http://developer.gnome.org/goocanvas/unstable/goocanvas-model-view-canvas.html | ||
| 245 | 249 | ||
| 246 | export CFLAGS="`pkg-config --cflags goocanvas` -DHAVE_GOOCANVAS" | 250 | export CFLAGS="`pkg-config --cflags goocanvas` -DHAVE_GOOCANVAS" |
| 247 | export LDFLAGS=`pkg-config --libs goocanvas` | 251 | export LDFLAGS=`pkg-config --libs goocanvas` |
| @@ -249,9 +253,20 @@ export LDFLAGS=`pkg-config --libs goocanvas` | |||
| 249 | make | 253 | make |
| 250 | 254 | ||
| 251 | I made a hello goo world xwidget so seems doable. | 255 | I made a hello goo world xwidget so seems doable. |
| 252 | I wanted to load a SVG which wasnt straightforward. | 256 | I wanted to load a SVG which wasnt immediately straightforward, so I |
| 257 | tried clutter. but it turns out the exact same strategy could be used | ||
| 258 | with goocanvas. | ||
| 259 | |||
| 253 | *** clutter | 260 | *** clutter |
| 254 | maybe clutter can be used as a canvas? seems to have a lot of traction atm. | 261 | maybe clutter can be used as a canvas? |
| 262 | pros: | ||
| 263 | - seems to have a lot of traction atm. many examples | ||
| 264 | - potentialy fast and cool vector graphics | ||
| 265 | cons: | ||
| 266 | - no out of the box MVC support, but seems doable. no worse than the | ||
| 267 | other home brew mvc support I have in xwidgets | ||
| 268 | (media-explorer in an application that employes the MVC pattern) | ||
| 269 | |||
| 255 | http://www.openismus.com/documents/clutter_tutorial/0.9/docs/tutorial/html/sec-stage-widget.html | 270 | http://www.openismus.com/documents/clutter_tutorial/0.9/docs/tutorial/html/sec-stage-widget.html |
| 256 | 271 | ||
| 257 | there is also cool stuff like this: | 272 | 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 | |||
| 293 | buffer. how do we catch these errors? | 308 | buffer. how do we catch these errors? |
| 294 | 309 | ||
| 295 | 310 | ||
| 311 | ** TODO browser xwidget | ||
| 312 | although embedding a browser is not my primary concern many are | ||
| 313 | interested in this. some suitable browser component needs to be found | ||
| 314 | supporting gtk. | ||
| 315 | |||
| 316 | *** webkit | ||
| 317 | there is a webkit gtk port. there is no obvious mvc support. | ||
| 318 | http://live.gnome.org/WebKitGtk | ||
| 319 | http://webkitgtk.org/ | ||
| 320 | |||
| 321 | |||
| 322 | export CFLAGS="`pkg-config --cflags webkit-1.0` -DHAVE_WEBKIT -g" | ||
| 323 | export LDFLAGS=`pkg-config --libs webkit-1.0` | ||
| 324 | ./configure | ||
| 325 | make | ||
| 326 | |||
| 327 | *** firefox | ||
| 328 | http://www-archive.mozilla.org/unix/gtk-embedding.html | ||
| 329 | 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 @@ | |||
| 56 | (xwidget-insert (point-min) 'cairo "canvas" 1000 1000 5) | 56 | (xwidget-insert (point-min) 'cairo "canvas" 1000 1000 5) |
| 57 | (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic)) | 57 | (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic)) |
| 58 | 58 | ||
| 59 | (xwidget-demo "a-webkit" | ||
| 60 | (xwidget-insert (point-min) 'webkit "webkit" 1000 1000 5) | ||
| 61 | (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic)) | ||
| 62 | |||
| 59 | 63 | ||
| 60 | 64 | ||
| 61 | (xwidget-demo "basic" | 65 | (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; | |||
| 105 | Lisp_Object Qxwidget_resize_internal; | 105 | Lisp_Object Qxwidget_resize_internal; |
| 106 | Lisp_Object Qxwidget_send_keyboard_event; | 106 | Lisp_Object Qxwidget_send_keyboard_event; |
| 107 | 107 | ||
| 108 | Lisp_Object Qbutton, Qtoggle, Qslider, Qsocket, Qcairo, QCplist; | 108 | Lisp_Object Qbutton, Qtoggle, Qslider, Qsocket, Qcairo, Qwebkit, QCplist; |
| 109 | 109 | ||
| 110 | 110 | ||
| 111 | extern Lisp_Object QCtype; | 111 | extern Lisp_Object QCtype; |
| @@ -339,6 +339,13 @@ xwidget_init_view ( | |||
| 339 | clutter_actor_show (stage); | 339 | clutter_actor_show (stage); |
| 340 | #endif | 340 | #endif |
| 341 | 341 | ||
| 342 | } else if (EQ(xww->type, Qwebkit)) { | ||
| 343 | #ifdef HAVE_WEBKIT | ||
| 344 | xv->widget = webkit_web_view_new(); | ||
| 345 | webkit_web_view_load_uri(xv->widget, "http://www.fsf.org"); | ||
| 346 | #endif | ||
| 347 | |||
| 348 | |||
| 342 | } else return NULL; | 349 | } else return NULL; |
| 343 | 350 | ||
| 344 | //widget realization | 351 | //widget realization |
| @@ -722,7 +729,8 @@ syms_of_xwidget (void) | |||
| 722 | DEFSYM (Qslider, "slider"); | 729 | DEFSYM (Qslider, "slider"); |
| 723 | DEFSYM (Qsocket, "socket"); | 730 | DEFSYM (Qsocket, "socket"); |
| 724 | DEFSYM (Qcairo, "cairo"); | 731 | DEFSYM (Qcairo, "cairo"); |
| 725 | 732 | DEFSYM (Qwebkit ,"webkit"); | |
| 733 | |||
| 726 | DEFSYM (QCplist, ":plist"); | 734 | DEFSYM (QCplist, ":plist"); |
| 727 | 735 | ||
| 728 | Fprovide (intern ("xwidget-internal"), Qnil); | 736 | Fprovide (intern ("xwidget-internal"), Qnil); |