emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SVG hack for display engine


From: Eli Zaretskii
Subject: Re: SVG hack for display engine
Date: Thu, 18 Nov 2021 16:52:55 +0200

> From: Anand Tamariya <atamariya@gmail.com>
> Date: Thu, 18 Nov 2021 18:59:10 +0530
> Cc: Alexander Adolf <alexander.adolf@condition-alpha.com>, Emacs Devel 
> <emacs-devel@gnu.org>
> 
>  But that's not generally true.  Redisplay has its own criteria to
>  decide which parts need to be redrawn, and those criteria are not
>  necessarily trivial to guess from buffer contents alone, because
>  redisplay has access to all kinds of information recorded specifically
>  for that purpose, and not exposed to Lisp.
> 
> Display engine must continue to do what it does presently to not break any 
> functionality in the terminal and
> elsewhere.  I'm only asking to extend the functionality to allow a developer 
> more freedom to play with SVG
> should he desire.

OK, but I still don't understand what you need from the display engine
for that purpose.

>  >   . what is the "required information" to be passed to
>  >     display-svg-hook, and how will it be generated from the information
>  >     that exists in the display engine?
>  > 
>  >  "required information" in my sentence above refers to the parameters of 
> (svg-render) API viz. svg x y
>  width
>  > height. display-svg-hook can be a no-arg function.
> 
>  What are X, Y, WIDTH and HEIGHT here?
> 
> - 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 .

I know that dom-node is defined in dom.el.  What I don't understand is
which code will generate a DOM, and based on what information.

>  And how will those hooks or svg-render know what to display an where
>  on the screen?
> 
> Take some simple cases like a tooltip or an auto-completion popup.  They 
> usually display near the point with
> some offset. (posn-at-point) provides that information. For complete window 
> display control like my formula
> editor, they can specify to display at (0,0) an image of size 
> (window-pixel-wdth) x (window-pixel-height).

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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]