aboutsummaryrefslogtreecommitdiffstats
path: root/README.xwidget
diff options
context:
space:
mode:
authorJoakim Verona2011-07-10 23:47:48 +0200
committerJoakim Verona2011-07-10 23:47:48 +0200
commite098c552ccd4be2c05898bb69df97ce35efa90b7 (patch)
tree11758196be04a6ec414100fd73419ffb582bde60 /README.xwidget
parentd812bba65d7f22a624c8cc19e9ec21ffe3720228 (diff)
downloademacs-e098c552ccd4be2c05898bb69df97ce35efa90b7.tar.gz
emacs-e098c552ccd4be2c05898bb69df97ce35efa90b7.zip
minor cleanups and doc
Diffstat (limited to 'README.xwidget')
-rw-r--r--README.xwidget115
1 files changed, 102 insertions, 13 deletions
diff --git a/README.xwidget b/README.xwidget
index 8c4998cc960..068ffa01bed 100644
--- a/README.xwidget
+++ b/README.xwidget
@@ -198,13 +198,62 @@ stuff that needs to work:
198- lookup xw-view for xwidget in emacs window(during redisplay) 198- lookup xw-view for xwidget in emacs window(during redisplay)
199(- do something for all siblings of a xw-view. not atm) 199(- do something for all siblings of a xw-view. not atm)
200 200
201*** TODO xwidget creation interface
202xwidgets are a little bit like emacs processes but also a little bit
203like emacs images. Therefore its not perfectly obvious how to handle
204creation. Currently I just use hardcoded identifiers. the real scheme
205needs to be something else.
206
207Heres a tentative approach:
208- xwidget-create returns a xwidget object, like process creation
209 functions. the xwidget will be largely uninitialized until
210 discovered by redisplay. an xw belongs to a buffer
211- xwidget-insert inserts the xwidget in a buffer. when discovered by
212 redisplay it will be initialized and a xwidget-view allocated
213- an event will be emitted when initialization is finished when
214 relevant like for sockets
215
216the problem with this aproach is that its not really legal to reuse
217xwidget objects by writing several display specs who reference the
218same xwidget. It could presumably be done but it would just become
219weird for no real benefit. the big preblem is that the display spec
220decides the on-screen size, and its not sane to have xwidget views
221with different sizes. therefore such display specs would need to be
222catched and dissallowed. Except it is hard because AFAIK the specs
223don't have an identity as such. A flag in the structure could be set
224by lookup so the first display attempt would win. but then you can't
225rewrite the spec to change the size. hmmm. A third approach would be
226to just allow the 1st spec refering an xw during a redisplay to take
227effect, the rest are signaled as errors. this wouldnt be too bad.
228
229the other aproach would be to work more like images:
230
231- write the display spec with all information needed to create the
232 xwidget.
233- retrieve the xwidget objet from the spec with an xwidget-at-point function. It
234 can be uninitalized which client code must handle. Unlike
235 assynchronous process creation we dont get back a handle, because
236 there is none yet.
237- emitted event on initialization, when needed. Many widgets don't
238 need this. for instance, a button sends an event when pressed. but
239 you can't press it unless its on screen, and then its initialized
240 properly.
241
242This approach seemed good, but how do I know which instance
243generates an event if I cant set the id beforehand?
244
245so, therefore, the first two aproach is used.
246
247
248
201** TODO more documentation 249** TODO more documentation
202There should be user docs, and xwidget contributor docs. The current README 250There should be user docs, and xwidget contributor docs. The current README
203is all contributor docs there is now, apart from the code. 251is all contributor docs there is now, apart from the code.
204 252
205 253
206 254
207** TODO look into more ways of displaying xwidgets, like binding them to a 255** CANCELLED look into more ways of displaying xwidgets, like binding them to a
256 CLOSED: [2011-07-05 Tue 11:34]
208window rather than a point in a buffer. This was suggested by Chidong. 257window rather than a point in a buffer. This was suggested by Chidong.
209This would be a useful addition to Emacs in itself, and would avoid nearly all 258This would be a useful addition to Emacs in itself, and would avoid nearly all
210display issues. I still think the general case is more interesting, but this 259display issues. I still think the general case is more interesting, but this
@@ -212,6 +261,9 @@ special case should also be added. The xwidget would then be bound to
212replace the view of a particular window, and it would only show in 261replace the view of a particular window, and it would only show in
213that window. 262that window.
214 263
264I got the webkit xwidget to work well enough so I dont see the need
265for this now, except for sockets and I think it can better be dealt
266with at the lisp level.
215 267
216** DONE MVC mode for xwidgets 268** DONE MVC mode for xwidgets
217 CLOSED: [2011-06-27 Mon 12:53] 269 CLOSED: [2011-06-27 Mon 12:53]
@@ -298,10 +350,9 @@ make
298 350
299 351
300** TODO mvc code crashes after a while 352** TODO mvc code crashes after a while
301seemingly only when compiling with optimizations 353seemingly only when compiling with optimizations.
354I have no idea why.
302 355
303** TODO delete xwidgets belonging to an emacs window
304when it closes
305** TODO xwidget-resize-at 356** TODO xwidget-resize-at
306currently it rewrites the display spec. then it resizes the xwidget 357currently it rewrites the display spec. then it resizes the xwidget
307views. maybe rewriting the spec should be sufficient, and changes to 358views. maybe rewriting the spec should be sufficient, and changes to
@@ -349,7 +400,7 @@ webkitViewportAttributesRecompute is the offender.
349 400
350maybe try gtk3 variants? 401maybe try gtk3 variants?
351 402
352export CFLAGS="`pkg-config --cflags webkitgtk-3.0 ` -DHAVE_WEBKIT_OSR -g" 403export CFLAGS="`pkg-config --cflags webkitgtk-3.0 ` -DHAVE_WEBKIT_OSR "
353export LDFLAGS=`pkg-config --libs webkitgtk-3.0 ` 404export LDFLAGS=`pkg-config --libs webkitgtk-3.0 `
354./configure --with-x-toolkit=gtk3 405./configure --with-x-toolkit=gtk3
355make 406make
@@ -420,6 +471,8 @@ interesting than just forwarding keyboard events.
420 471
421webkit_web_view_get_dom_document () 472webkit_web_view_get_dom_document ()
422 473
474this is hard it seems. an idea might be to hack elisp support for swig
475to machine generate the bindings.
423**** DONE inject javascript 476**** DONE inject javascript
424 CLOSED: [2011-07-03 Sun 22:50] 477 CLOSED: [2011-07-03 Sun 22:50]
425webkit_web_view_execute_script () 478webkit_web_view_execute_script ()
@@ -448,12 +501,32 @@ or this funny hack:
448<jave> lucian: that was a pretty cool idea! 501<jave> lucian: that was a pretty cool idea!
449 502
450 503
451**** webkit_web_view_load_string () 504*** webkit_web_view_load_string ()
452I would like preview of html in a buffer rather than from uri. 505I would like preview of html in a buffer rather than from uri.
453 506
454 507
455 508
456** TODO clipping of controllers 509*** TODO simple xwidget-webkit wrapper
510so that it could be used for actual browsing :)
511I dont want to reinvent too many wheels so i'd like to use existing
512emacs facilities here possible. use bindings similar to w3m(or info)
513
514- m-x xwidget-webkit starts a session
515- 'g' goes to a url
516- use bookmark-jump i suppose. I mostly use org for bookmarks myself
517- browse-url support so webkit can be the default browser
518- some way of getting around the quirky keyboard interaction since
519 xwidgets dont receive keyboard events because I hawe no idea how to
520 do that in a sane way
521
522... and one can of course go on bikeshedding forever. lets keep it
523simple and extensible, and compatible with other Emacs packages.
524
525the really cool ideas would need Emacs DOM integration, which is not
526easy.
527
528** DONE clipping of controllers
529 CLOSED: [2011-07-05 Tue 11:33]
457 530
458Emacs uses a big GTK window and does its own clipping against Emacs 531Emacs uses a big GTK window and does its own clipping against Emacs
459windows inside this area. So, in order to layout gtk widgets in emacs 532windows inside this area. So, in order to layout gtk widgets in emacs
@@ -478,6 +551,7 @@ either.
478 551
479http://www.lanedo.com/~carlos/gtk3-doc/chap-drawing-model.html 552http://www.lanedo.com/~carlos/gtk3-doc/chap-drawing-model.html
480 553
554anyway clipping is rather complicated but seems to finally work okay.
481 555
482*** DONE subclass my own clipping widget 556*** DONE subclass my own clipping widget
483 CLOSED: [2011-07-04 Mon 16:55] 557 CLOSED: [2011-07-04 Mon 16:55]
@@ -555,7 +629,8 @@ the needed data is private to the base class. to overcome this:
555JanD pointed out the GTK3 port already has its own subclass, so I 629JanD pointed out the GTK3 port already has its own subclass, so I
556modified that one. 630modified that one.
557 631
558*** TODO clip top 632*** DONE clip top
633 CLOSED: [2011-07-05 Tue 11:30]
559there are four controller edges that potentialy need clipping. I begun 634there are four controller edges that potentialy need clipping. I begun
560with right and bottom edges. clipping them is just a matter of setting 635with right and bottom edges. clipping them is just a matter of setting
561the right size of the widgetwindow and also ensure it gets the right 636the right size of the widgetwindow and also ensure it gets the right
@@ -569,9 +644,20 @@ makes it harder to use the allocation workarounds.
569see: 644see:
570- gtk_widget_set_size_request 645- gtk_widget_set_size_request
571- gtkscrolledwindow 646- gtkscrolledwindow
572** TODO use FRAME_GTK_WIDGET (f)
573rather than gwfixed
574 647
648I returned to using a simple gtkfixed for the widgetwindow. with
649allocation hack and set_has_window it works. Idea prefer not to have
650the allocatien hack and it wasnt needed it gtk3 only gtk2. needs
651furthi investigation,
652
653** TODO various code cleanups
654There are many cleanups necessary before any hope of inclusion in
655Emacs trunk. To begin with, the part of the patch that touches other
656parts of emacs must be very clean.
657*** TODO use FRAME_GTK_WIDGET (f)
658rather than gwfixed.
659
660*** TODO support configure
575** DONE translate clicks 661** DONE translate clicks
576 CLOSED: [2011-07-03 Sun 22:12] 662 CLOSED: [2011-07-03 Sun 22:12]
577on onscreen webkit peer to offscreen 663on onscreen webkit peer to offscreen
@@ -584,18 +670,21 @@ forwarded them offscreen!
584 670
585** TODO investigate gdk_window_redirect_to_drawable 671** TODO investigate gdk_window_redirect_to_drawable
586http://developer.gnome.org/gdk/stable/gdk-Windows.html#gdk-offscreen-window-set-embedder 672http://developer.gnome.org/gdk/stable/gdk-Windows.html#gdk-offscreen-window-set-embedder
587maybe control be used in place of my own copy hacks? 673maybe control be used in place of my own copy hacks? to work it must
674support a chain of redirects, which seems unlikely. the benefit would
675be that I dont have to spend time optimizing redrawing.
588 676
589 677
590 678
591** TODO remove xwidget_views when emacs window is deleted 679** DONE remove xwidget_views when emacs window is deleted
680 CLOSED: [2011-07-05 Tue 11:29]
592removing xwidget views when an Emacs window closes is not reliable. 681removing xwidget views when an Emacs window closes is not reliable.
593 682
594- switching buffers in a window seems to hide the corresponding 683- switching buffers in a window seems to hide the corresponding
595 xwidget-views properly, but they might as well be deleted. 684 xwidget-views properly, but they might as well be deleted.
596 685
597- patching delete-window-internal could be used to delete the xwidget-views 686- patching delete-window-internal could be used to delete the xwidget-views
598 687this seems to work
599 688
600 689
601** notes from x_draw_xwidget_glyph_string 690** notes from x_draw_xwidget_glyph_string