aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2011-07-22 08:14:13 +0200
committerJoakim Verona2011-07-22 08:14:13 +0200
commitde37acc4249c95bd02295f7c3a8c080297335a1d (patch)
tree3f7760807b3521f20fe8692f44822f172175dc53
parentc196618976ca42baca2e2de2167a8c5b9c28d75f (diff)
downloademacs-de37acc4249c95bd02295f7c3a8c080297335a1d.tar.gz
emacs-de37acc4249c95bd02295f7c3a8c080297335a1d.zip
notes
-rw-r--r--README.xwidget134
1 files changed, 98 insertions, 36 deletions
diff --git a/README.xwidget b/README.xwidget
index 4cb0f704195..296be30bb6d 100644
--- a/README.xwidget
+++ b/README.xwidget
@@ -7,10 +7,10 @@ for eXternal widget, and also in reference to the Xembed protocoll.
7There is a demo file called xwidget-test.el which shows some of the 7There is a demo file called xwidget-test.el which shows some of the
8possibilities. There are some screnshots at the emacswiki. 8possibilities. There are some screnshots at the emacswiki.
9 9
10Currently its possible to insert buttons, sliders, and xembed widgets 10Currently its possible to insert buttons, sliders, xembed widgets, and
11in the buffer. It works similar to the support for images in Emacs. 11webkit in the buffer. It works similar to the support for images in
12Adding more types of widgets should be fairly straightforward, but 12Emacs. Adding more types of widgets should be fairly straightforward,
13will require adapter code for each type. 13but will require adapter code for each type.
14 14
15A difference from images is that xwidgets live their own life. You 15A difference from images is that xwidgets live their own life. You
16create them with an api, get a reference, and tie them to a particular 16create them with an api, get a reference, and tie them to a particular
@@ -21,42 +21,48 @@ model, and an xwidget-view is a view of the xwidget in a particular
21Emacs window. 21Emacs window.
22 22
23The xwidget code attempts to keep the visual appearance of the views 23The xwidget code attempts to keep the visual appearance of the views
24in sync with through an Observer pattern implementation. 24in sync with through an Observer pattern implementation. This is
25necessary to support the Emacs window paradigm.
25 26
26** building 27** building
27bzr co bzr+ssh://bzr.savannah.gnu.org/emacs/xwidget/ 28bzr co bzr+ssh://bzr.savannah.gnu.org/emacs/xwidget/
28export CFLAGS=" -g -DGLYPH_DEBUG=1" 29export CFLAGS=" -g -DGLYPH_DEBUG=1"
29#export CFLAGS="-g"
30./configure --with-x-toolkit=gtk3 --with-xwidgets 30./configure --with-x-toolkit=gtk3 --with-xwidgets
31make -j4 31make -j4
32 32
33** MVC and Xembedd 33** try it out
34The MVC approach appears to be at least in principle robust for plain gtk 34If you have GTK3 and gtk-webkit installed, you should be able to
35widgets. For the interesting case of gtk sockets which implements an 35started the embedded webkit browser now:
36xembed host widget that allows for embedding other applications inside
37an Emacs window, the story gets more complex.
38 36
39The problem is that xembed is designed to plug an application window 37M-X xwidget-webkit-browse-url
40inside a a secket and thats it. You can't move a plug between
41sockets. I tried numerous hacks to get around this but there is
42nothing that works realy well.
43 38
44Therefore the Emacs part of the code will only expose well-defined 39If that didnt work out try the minimal demonstration instead:
45interfaces. cooperating applications will be able to use the interface
46in a well defined manner. The problem is that there is no known xembeddable
47application that implement the needed type of functionality, which is
48allowing for creating new windows on the fly that plug into new
49sockets.
50 40
51Therefore I will attempt to provide an external application that wraps 41(load-library "xwidget-test")
52another application and through hacks attempts to provide the needed 42(xwidget-demo-a-button)
53multi view xembed function. That way Emacs is sane and the insanity
54contained.
55 43
56This app will work by providing a socket that an app plugs into. The 44It looks unimpressive, but it's a gtk button inside an Emars buffer!
57socket window is copied efficientlp by means of composition to a 45
58number of other windows, that then are plugged into the different 46** Stability
59Emacs sockets. 47Beginning with Summer 2011 I am now able to use Xwidget Emacs as my
48primary Emacs. That is good for the project and the stability of the
49code.
50
51At the time of writing I have 24 hour Emacs uptime with several
52embedded webkit browsers, Gnus, org-mode, tramp, etc. etc.
53
54That said, there are still many improvements that needs to be done,
55particularily in memory management. Expect xwidget emacs to leak
56heavily for now.
57
58** timeline for inclusion in trunk
59The Emacs 24 feature freeze is passed, so xwidgets won't probably be merged
60until Emacs 25. OTOH since I now use xwidget emacs as my primary
61emacs, I will merge from trunk much more often than in the past.
62
63** Thanks
64emacs-devel@gnu.org. There are very helpful people there. When I
65started the xwidget project I had no clue about the Emacs internals.
60 66
61* Brief overview of how xwidgets work 67* Brief overview of how xwidgets work
62Xwidgets work in one way like images in Emacs. You bind a display spec very 68Xwidgets work in one way like images in Emacs. You bind a display spec very
@@ -139,6 +145,33 @@ this is aproach worked so-so.
139;; cd /path/to/xwidgets-emacs-dir 145;; cd /path/to/xwidgets-emacs-dir
140;; make all&& src/emacs -q --eval "(progn (load \"`pwd`/lisp/xwidget-test.el\") (xwidget-demo-basic))" 146;; make all&& src/emacs -q --eval "(progn (load \"`pwd`/lisp/xwidget-test.el\") (xwidget-demo-basic))"
141 147
148** MVC and Xembedd
149The MVC approach appears to be at least in principle robust for plain gtk
150widgets. For the interesting case of gtk sockets which implements an
151xembed host widget that allows for embedding other applications inside
152an Emacs window, the story gets more complex.
153
154The problem is that xembed is designed to plug an application window
155inside a a secket and thats it. You can't move a plug between
156sockets. I tried numerous hacks to get around this but there is
157nothing that works realy well.
158
159Therefore the Emacs part of the code will only expose well-defined
160interfaces. cooperating applications will be able to use the interface
161in a well defined manner. The problem is that there is no known xembeddable
162application that implement the needed type of functionality, which is
163allowing for creating new windows on the fly that plug into new
164sockets.
165
166Therefore I will attempt to provide an external application that wraps
167another application and through hacks attempts to provide the needed
168multi view xembed function. That way Emacs is sane and the insanity
169contained.
170
171This app will work by providing a socket that an app plugs into. The
172socket window is copied efficientlp by means of composition to a
173number of other windows, that then are plugged into the different
174Emacs sockets.
142* ToDo:s 175* ToDo:s
143** DONE webkit flashkiller by default 176** DONE webkit flashkiller by default
144 CLOSED: [2011-07-19 Tue 14:27] 177 CLOSED: [2011-07-19 Tue 14:27]
@@ -407,7 +440,7 @@ Surprisingly, this just worked!
407I used gtk signals, the implementation for sliders works well! 440I used gtk signals, the implementation for sliders works well!
408 441
409** TODO canvas support 442** TODO canvas support
410heresy an interesting comparision of gtk canvases 443heres an interesting comparision of gtk canvases
411http://live.gnome.org/ProjectRidley/CanvasOverview 444http://live.gnome.org/ProjectRidley/CanvasOverview
412*** goocanvas 445*** goocanvas
413goocanvas is a gtk canvas implemented using cairo. investigate. 446goocanvas is a gtk canvas implemented using cairo. investigate.
@@ -490,7 +523,8 @@ so turned out this got solved by using proper lisp objects for
490xwidgets. yay! 523xwidgets. yay!
491 524
492 525
493** TODO browser xwidget 526** DONE browser xwidget
527 CLOSED: [2011-07-20 Wed 20:05]
494although embedding a browser is not my primary concern many are 528although embedding a browser is not my primary concern many are
495interested in this. some suitable browser component needs to be found 529interested in this. some suitable browser component needs to be found
496supporting gtk. 530supporting gtk.
@@ -586,7 +620,8 @@ offscreen rendering issues makes it interesting to see what ff brings
586to the table. turns out webkit has as good offscreen support as anyone. 620to the table. turns out webkit has as good offscreen support as anyone.
587 621
588 622
589*** TODO text field support 623*** DONE text field support
624 CLOSED: [2011-07-20 Wed 20:05]
590Emacs captures all keyboard events so text field support isn't super 625Emacs captures all keyboard events so text field support isn't super
591straightforward. 626straightforward.
592 627
@@ -777,11 +812,13 @@ allocation hack and set_has_window it works. Idea prefer not to have
777the allocatien hack and it wasnt needed it gtk3 only gtk2. needs 812the allocatien hack and it wasnt needed it gtk3 only gtk2. needs
778furthi investigation, 813furthi investigation,
779 814
780** TODO various code cleanups 815** DONE various code cleanups
816 CLOSED: [2011-07-20 Wed 20:05]
781There are many cleanups necessary before any hope of inclusion in 817There are many cleanups necessary before any hope of inclusion in
782Emacs trunk. To begin with, the part of the patch that touches other 818Emacs trunk. To begin with, the part of the patch that touches other
783parts of emacs must be very clean. 819parts of emacs must be very clean.
784*** TODO use FRAME_GTK_WIDGET (f) 820*** DONE use FRAME_GTK_WIDGET (f)
821 CLOSED: [2011-07-20 Wed 20:02]
785rather than gwfixed. 822rather than gwfixed.
786 823
787*** DONE support configure 824*** DONE support configure
@@ -816,9 +853,34 @@ this seems to work
816 853
817 854
818** TODO support webkit signals 855** TODO support webkit signals
819particularily document-load-finished 856*** TODO particularily document-load-finished
820http://webkitgtk.org/reference/webkitgtk-webkitwebview.html#WebKitWebView-document-load-finished 857http://webkitgtk.org/reference/webkitgtk-webkitwebview.html#WebKitWebView-document-load-finished
821** notes from x_draw_xwidget_glyph_string 858*** TODO console messages
859http://webkitgtk.org/reference/webkitgtk-webkitwebview.html#WebKitWebView-console-message
860http://getfirebug.com/wiki/index.php/Console_API#console.count.28.5Btitle.5D.29
861because maybe we can make a simple JS REPL that way.
862 (xwidget-webkit-execute-script ( xwidget-webkit-last-session)
863 "console.log('hello')")
864prints hello to stdout but theres no way to catch stdout from webkit I
865think other than receiving the signal.
866
867
868
869** TODO webkit downloads
870when clicking a download link in Webkit Emacs should take over and handle it
871from there. Probably need signals.
872
873** TODO webkit alt-text not handled
874XKCD use image-title to display a cartoon comment. These mysteriously
875don't work ATM. Other mouseovers work though. Maybe webkit tries to
876open a new window or something, which wont work.
877
878** TODO isearch in webkit buffers
879have a look at how docview solves it
880webkit_web_view_search_text ()
881** TODO webkit relative references doesn't work
882probably because we handle scrolling in a non-standard way
883* old notes from x_draw_xwidget_glyph_string
822 884
823 BUG it seems this method for some reason is called with bad s->x and s->y sometimes. 885 BUG it seems this method for some reason is called with bad s->x and s->y sometimes.
824 When this happens the xwidget doesnt move on screen as it should. 886 When this happens the xwidget doesnt move on screen as it should.