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: Wed, 17 Nov 2021 15:47:41 +0200 Message-ID: <83mtm2zyf6.fsf@gnu.org> References: <83zgq41cra.fsf@gnu.org> <83k0h818zw.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34123"; 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 Wed Nov 17 14:49:08 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 1mnLJD-0008eZ-NK for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Nov 2021 14:49:07 +0100 Original-Received: from localhost ([::1]:38698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnLJC-0000Vk-CK for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Nov 2021 08:49:06 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnLHw-0006we-L8 for emacs-devel@gnu.org; Wed, 17 Nov 2021 08:47:48 -0500 Original-Received: from [2001:470:142:3::e] (port=59942 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 1mnLHw-0007Vy-2z; Wed, 17 Nov 2021 08:47:48 -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=YVvHoGujnrpXkQJOh8FGfLXtIssGIwJcCGKl2+d2L2A=; b=sBBhCD6TaQYw axTZeKSD+wiI0m27sAc4liZjv7d/ROO+Fq6gE7WpiaXyzoIiCnIgUNAebFyh1MP+VR6uMP/ovDI7f izcvbsbbiue66BoxlGYV02F+LhNP0IIOJcHrWOP6AGb5TsyzXtHay3WJCx2Xde+eL+CkInXVynVRP 0f10GQDwefP1Zt11zbmnfumtNi8NMPS7F2qByeil6cDxrJ9H7r5EcAjaLJkWvVWbwKkkU5PjlMJum pSUqWZ5uyX+u/gGbmu4Umt6M9eZvxXh0/lZi58iHcMkAnEY7k7NXhBxE7gcvuMc5xm3FmQCXG5hlt nZUQU0rTTIKp3DH/h9kqUg==; Original-Received: from [87.69.77.57] (port=3175 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 1mnLHv-0006aD-NQ; Wed, 17 Nov 2021 08:47:48 -0500 In-Reply-To: (message from Anand Tamariya on Wed, 17 Nov 2021 10:03:25 +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:279632 Archived-At: > From: Anand Tamariya > Date: Wed, 17 Nov 2021 10:03:25 +0530 > Cc: Alexander Adolf , Emacs Devel > > Here's some details on how I think it might work. Emacs exposes two Lisp APIs: > - svg-render (svg x y width height) > svg is a Lisp DOM object as returned by (dom-node). What code will produce that DOM object, and how will it be produced? > 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. > > - svg-bbox (node) > This returns the bounding box of the DOM node. This is basically a wrapper around librsvg API. > > Emacs also adds a hook, say, display-svg-hook which runs only on a graphical display. Any mode can use > this hook to display the SVG content using the above API. Please describe the intended use of these APIs and the hook to provide the display feature(s) you have in mind, and how will that work in concert with the display engine. I don't think I have a clear picture of that yet. Also, please describe what happens with use of these APIs when just a small part of the Emacs display needs to be redrawn. Thanks.