From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: SVG hack for display engine Date: Fri, 19 Nov 2021 09:07:05 +0200 Message-ID: <83mtm0wrmu.fsf@gnu.org> References: <83zgq41cra.fsf@gnu.org> <83k0h818zw.fsf@gnu.org> <83mtm2zyf6.fsf@gnu.org> <83pmqxyj3j.fsf@gnu.org> <83czmxyaio.fsf@gnu.org> <837dd5y0qg.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30530"; mail-complaints-to="usenet@ciao.gmane.io" Cc: alexander.adolf@condition-alpha.com, emacs-devel@gnu.org To: Anand Tamariya Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 19 08:37:30 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mnySf-0007j5-QK for ged-emacs-devel@m.gmane-mx.org; Fri, 19 Nov 2021 08:37:29 +0100 Original-Received: from localhost ([::1]:53754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnySe-0004oh-KS for ged-emacs-devel@m.gmane-mx.org; Fri, 19 Nov 2021 02:37:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnxzI-0004PX-Q9 for emacs-devel@gnu.org; Fri, 19 Nov 2021 02:07:08 -0500 Original-Received: from [2001:470:142:3::e] (port=52296 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnxzG-0002b2-Ug; Fri, 19 Nov 2021 02:07:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Nr7oBoQmGukQE8Zhd/fPMTtKz58Vwlr9HEwLko9QjRc=; b=LTNH4XwLcQzB cEhFrRQUtwLQ5VwRI6uHset+dJhxsdyAHuSGmVGdhHZzyLSfWCuYB5LvYclXUjVlRC7WNxX6I52rH NO86lUllB+lacEbTqqXLt/G4mZPBHqqWxYxUibQU+kREqhVJCaaCsF1zPTWD3L6Irf/kL+VQ4vNRg nyqQZok/xTT8GcXeSd1rpYWnAu7cxKy0r7d8kVS8ktMoQHkp2dUSNP9UXMbFEDK3lF/61Ubpkb9+t DFF4H/MN/eCMXcY/9VC0AZgLheiKp4CKJILuwvJ6KzC+NRh5TOKdfiFgBEdcV9Qkz5pEPsTs8zpTv L0MyZktunjcA2USKmOA85A==; Original-Received: from [87.69.77.57] (port=4870 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnxzG-0004K6-HI; Fri, 19 Nov 2021 02:07:06 -0500 In-Reply-To: (message from Anand Tamariya on Fri, 19 Nov 2021 07:02:20 +0530) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:279723 Archived-At: > From: Anand Tamariya > Date: Fri, 19 Nov 2021 07:02:20 +0530 > Cc: Alexander Adolf , Emacs Devel > > So this is only for popping up some additional image on top of the > "normal" Emacs display? Or is the intent to replace some parts of the > "normal" Emacs display, i.e. what we show in the windows of the > regular frames? > > And if this is just for popups, isn't there already some hook ypou > could use for that purpose? If not, what is missing in the existing > hooks? > > Two problems in current approach: > > I've used (read-event) and (lookup-key) to allow for key translations for navigation commands. > Hopefully with a tighter integration, all of this will not be required. > > - Do you remember I said I am running my own event loop? This means I'm missing out on the key > translations that Emacs would normally handle for me. So anything the developer hasn't coded for will > remain inaccessible while the mode is in effect. Sorry, I don't follow: what do these issues have to do with what we are discussing, and in general to the display engine? What am I missing? > > - svg-render (svg x y width height) > > svg is a Lisp DOM object as returned by (dom-node). This should use librsvg to generate a bitmap > image of > > svg of size (width x height) and superimpose it at position (x, y) on the current bitmap being displayed > by > > Emacs. The current image API takes either a filename or XML string for SVG. This can be > avoided if svg is a > > Lisp DOM. Edit: (dom-node) is defined in dom.el . > > Can you visualize the amount of string serialization, deserialization and SVG parsing happening in a draw or > move operation with live feedback? Do you see it performing well for even a moderately sized SVG? > > Without direct SVG support in the display engine ie. a way for a developer to tell the display engine to use a > particular SVG in a DOM form during it's normal display cycle, any such implementation will remain a hack - > it works but it could be much better. I understand that you want Emacs to be able to support display of an SVG specified via a DOM. What I'm trying to understand, and so far failing, is where would that DOM come from, assuming the SVG will display text of some buffer or string. Can you explain the connection between the text to be displayed and the DOM?