From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: Re: xwidget branch Date: Wed, 30 Jun 2010 15:09:35 +0200 Message-ID: References: <4C2B309B.8000402@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1277903442 6907 80.91.229.12 (30 Jun 2010 13:10:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 30 Jun 2010 13:10:42 +0000 (UTC) Cc: Emacs development discussions To: Jan =?iso-8859-1?Q?Dj=E4rv?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 30 15:10:39 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OTx3C-00071m-N4 for ged-emacs-devel@m.gmane.org; Wed, 30 Jun 2010 15:10:35 +0200 Original-Received: from localhost ([127.0.0.1]:37586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTx36-0002LG-PI for ged-emacs-devel@m.gmane.org; Wed, 30 Jun 2010 09:09:56 -0400 Original-Received: from [140.186.70.92] (port=40035 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTx2z-0002L4-Ns for emacs-devel@gnu.org; Wed, 30 Jun 2010 09:09:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OTx2x-0000hh-EV for emacs-devel@gnu.org; Wed, 30 Jun 2010 09:09:48 -0400 Original-Received: from iwfs.imcode.com ([82.115.149.64]:36207 helo=gate.verona.se) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OTx2x-0000fm-5A for emacs-devel@gnu.org; Wed, 30 Jun 2010 09:09:47 -0400 Original-Received: from localhost.localdomain (IDENT:1005@localhost [127.0.0.1]) by gate.verona.se (8.13.4/8.11.4) with ESMTP id o5UD9afj032521; Wed, 30 Jun 2010 15:09:37 +0200 In-Reply-To: <4C2B309B.8000402@swipnet.se> ("Jan =?iso-8859-1?Q?Dj=E4rv=22?= =?iso-8859-1?Q?'s?= message of "Wed, 30 Jun 2010 13:55:07 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:126533 Archived-At: Jan Dj=E4rv writes: > This sounds like fun. How do you handle multiple windows, that is the > same buffer with widgets displayed in different frames/windows? There are some notes in the readme. I paste it below so we can discuss it and improve it. This is as you might imagine the really tricky part. > Does the widgets always flow with the text or can you anchor them at > fixed positions? I was thinking of per window toolbars. They work like images. It ought to be possible to bind them to a margin or something like images, but I havent tested this. Also like images they are not tied to a window but to a buffer. OTOH xwidgets have, unlike images, their own identity, and I have been thinking of letting an xwidget be able to replace an entire window, etc. The readme follows: * Xwidgets This is an experimental branch to enable embedding of GTK widgets inside an Emacs window. The Emacs abstraction is called an Xwidget, for eXternal widget, and also in reference to the Xembed protocoll. There is a demo file called xwidget-test.el which shows some of the possibilities. There are some screnshots at the emacswiki. Currently its possible to insert buttons, sliders, and xembed widgets in the buffer. It works similar to the support for images in Emacs. A difference from images is that xwidgets live their own life. You create them with an api, get a reference, and tie them to a particular buffer with a display spec. Also, xwidgets exists in only one copy, where a plain image can be shown in several windows. The xwidget code tries to handle this by essentialy making a screen capture of the widget and displaying those in the non-active windows, and the real widget in the active window. This doesnt currently work for xembed widgets. The current state is that one window, one frame, showing many xwidgets is a nice demo. TODO - Examine using XComposite rather than GTK off-screen rendering. This would make xembed widgets work much better. - make the keyboard event code propagation code work. - remove the special-case for when the minibuffer is active. Special-casing will never work properly. - disable cursor drawing on top of an active xwidget - figure out what to do with the multiple frames case - improve the xwidgets programming interface so its less of hand-waving affair - more documentation > Jan D. > > > joakim@verona.se skrev 2010-06-23 13.35: >> I created a new "xwidget" branch. It is a very experimental branch that >> allows gtk widgets to be embedded in an emacs buffer, much like images. >> >> It is, for instance, possible to embedd a browser in an Emacs window. >> >> See some screenshots here: >> >> http://www.emacswiki.org/emacs/EmacsXembed> >> Soem screenshots of Daivd Hackneys work to embed the usbl browser: >> >> http://www.haxney.org/2009/08/its-alive.html> >> There is also a README in the root of the branch. >> >> Please note that the code really is experimental and that there are a >> number of hard problems still unsolved. That said, I still find it very >> cool to see gtk buttons moving in an Emacs window, and even Emacs >> embedded in Emacs :) >> --=20 Joakim Verona