all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: tomas@tuxteam.de, emacs-devel@gnu.org
Subject: Re: Emacs canvas support
Date: Thu, 30 Apr 2020 16:58:10 +0200	[thread overview]
Message-ID: <AM0PR06MB6420436EE2A1C203B457926496AA0@AM0PR06MB6420.eurprd06.prod.outlook.com> (raw)
In-Reply-To: <83v9lhvyy8.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 30 Apr 2020 17:18:55 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Arthur Miller <arthur.miller@live.com>
>> Date: Thu, 30 Apr 2020 15:11:10 +0200
>> Cc: tomas@tuxteam.de, emacs-devel@gnu.org
>> 
>> I have a question here about display: when lisp engine decides to draw
>> the display, how difficult would it be to add a callback for pre- and
>> post render?
>
> I don't think I understand the question.  It is trivial to add a call

I am probably not so clear in my writing, but what I mean is, can it be
impelemnted as a hook/callback, to enter same redisplay machinery
several times. As you described in other mails how redisplay is
figuring out what draw, everything has to come from buffers that are
essentially glyph matrices etc. Whatever entry in that machinery is now,
can't we just have a list of hooks that each call into that machinery?
Normally there would be just one such so Emacs work as it is now, but
user could add one before or after, or several do do some extra drawing.

> to a Lisp function anywhere in Emacs, the question is what thats
> function will be able to do to be useful.
Essentially it would be like layered rendering. Imagine Gimp layers.
Since each hook is drawing it's own stuff it would be like a layer.

For example, if Emacs exposed some graphics stuff like say: draw-this,
fill-that, and if drawing layered, like in post-render, that wouldn't
collide with overlays and other stuff, one could draw over images etc.
Similarly a pre-render could put some graphics and images that appear as
a background below normal buffer text.

> If the called Lisp can do
> anything it wants, then how can it be useful without knowing a whole
> lot about the window layout, and what was just now, or will be in a
> moment, drawn on it, and in which parts?
Each hook woul have it's own associated buffer, which could be same as
current buffer or different one (say an temporary with an image in it).
Redisplay engine can then just do whatever it does now to figure out
that buffer so no changes to redisplay engine. Yes, it would draw in
same pixel coordinates of the window it is drawing on. The only hard
part would be to figure out how to trigger redisplay engine when some of
buffers with associated hooks changes (I think, but I am not
knowledgable enough about implementation details here).

>> Prerender callback could be any user lisp function called
>> that do anything it wants, say draw something on the screen as it owned
>> window itself. Than render engine would it's ordinary rendering drawing
>> just as it does now, pretending that there was nothing already drawn, so
>> it would mean no change at all to current c code for rendering.
>
> So how do we prevent the display engine from blissfully drawing over
> what the pre-render draws?

You don't! It is exactly my point to redraw over stuff. Render should
re-draw over what pre-render has drawn etc.

That way, if a pre-render hook, draws say a buffer with an image in it,
then ordinary buffer can draw it's text over it and image would appear
as a background in final view. 

>> Similarly one call a post-render callback and draw over the already
>> rendered text so user could draw whatever on top of already draw
>> onverlas and what not.
>
> How will the post-render know where it can and where it cannot draw?
> Or even where to draw, for that matter (assuming you want to do
> something more useful than just put the same pixels in the same pixel
> coordinates)?
Actually sometimes, you do want to just put pixels in same pixel
coordinates :-). But anyway, one could draw some lines below/above text
in buffers, rectangles, and so on. Info about where and what
to draw comes well from user code. User's elisp can figure out where and
what to draw by examining the buffer and window with usual elisp we have
now?

> For example, if the window scrolls, wouldn't you want
> the graphics drawn by these pre/post-renderers to move on display as
> well, at least sometimes?  If you do, how can you do that without
> knowing some details about the scroll?
Of course. Wouldn't came out automatically, by redisplay engine as it
already is?

>> It is just how z-buffer works and it would mean z order from pre-render,
>> normal render (as it is now) and post render as implicit z-depths.
>
> AFIU, z-buffer doesn't care to obscure what's displayed below.  is
> this what you have in mind: obscuring the "normal" display with some
> graphics?

No I didn't, I had in mind to redraw stuff, so user can draw below or
above whatever Emacs normally draws.

Yeah sure if user chooses to draw two different text buffers on top of
each other it would be a mess, but I don't think that is an issue
because, normally, probably nobody want's to draw to text files on top
of each other.



  reply	other threads:[~2020-04-30 14:58 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <875zdikdge.fsf.ref@yahoo.com>
2020-04-29  6:34 ` Emacs canvas support Po Lu via Emacs development discussions.
2020-04-29  8:24   ` Eli Zaretskii
2020-04-29  9:57     ` Po Lu
2020-04-29 10:10       ` Eli Zaretskii
2020-04-29 10:22         ` Po Lu
2020-04-29 10:27           ` Po Lu via Emacs development discussions.
2020-04-29 11:47             ` Eli Zaretskii
2020-04-29 10:35           ` Eli Zaretskii
2020-04-29 10:41             ` Po Lu
2020-04-29 11:51               ` Eli Zaretskii
2020-04-29 12:12                 ` Po Lu
2020-04-29 16:14               ` David Engster
2020-04-29 16:54                 ` Eli Zaretskii
2020-04-29 17:16                   ` tomas
2020-04-29 17:27                     ` Eli Zaretskii
2020-04-29 17:38                       ` Eli Zaretskii
2020-04-30 13:11                         ` Arthur Miller
2020-04-30 14:18                           ` Eli Zaretskii
2020-04-30 14:58                             ` Arthur Miller [this message]
2020-04-30 17:30                               ` Eli Zaretskii
2020-05-01 14:32                                 ` Arthur Miller
2020-04-29 18:51                       ` tomas
2020-04-29 19:03                         ` Eli Zaretskii
2020-04-29 19:08                           ` tomas
2020-04-29 19:25                             ` Eli Zaretskii
2020-04-29 19:59                               ` tomas
2020-04-30  1:19                                 ` Stefan Monnier
2020-04-30  6:55                                   ` tomas
2020-04-30 12:03                                     ` Stefan Monnier
2020-04-30 12:50                                       ` tomas
2020-04-30  8:04                                   ` Po Lu
2020-04-30 12:08                                     ` Stefan Monnier
2020-04-30 13:55                                     ` Eli Zaretskii
2020-05-01 23:27                                       ` Po Lu
2020-05-02  6:51                                         ` Eli Zaretskii
2020-04-30 13:46                                   ` Eli Zaretskii
2020-04-30 14:37                                     ` Stefan Monnier
2020-04-30 17:27                                       ` Eli Zaretskii
2020-04-30 18:22                                         ` Stefan Monnier
2020-04-30 18:42                                           ` Eli Zaretskii
2020-04-30 14:27                                   ` Drew Adams
2020-04-30 13:33                                 ` Eli Zaretskii
2020-04-30 13:52                                   ` Arthur Miller
2020-04-29 19:23                   ` David Engster
2020-04-30 13:29                     ` Eli Zaretskii
2020-04-30  6:52                   ` Corwin Brust
2020-04-29 17:08                 ` Eli Zaretskii
2020-04-29 20:14                   ` David Engster
2020-04-30 13:35                     ` Eli Zaretskii
2020-04-29 20:48   ` Juri Linkov
2020-04-30  2:36     ` Eli Zaretskii
2020-04-30 20:20       ` Juri Linkov
2020-05-01  6:01         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM0PR06MB6420436EE2A1C203B457926496AA0@AM0PR06MB6420.eurprd06.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=tomas@tuxteam.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.