unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Akib Azmain Turja <akib@disroot.org>
To: emacs-devel@gnu.org
Subject: Questions on glyph matrices used for rendering frame in terminal
Date: Mon, 04 Jul 2022 23:26:18 +0600	[thread overview]
Message-ID: <874jzwn611.fsf@disroot.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 2270 bytes --]


Hello hackers,

I'm currently trying to understand how Emacs builds the desired matrix
of a frame from the desired matrices of the windows in it.  But I can
barely understand anything.  I would be grateful if someone familiar
enough with it takes time to answer my following questions.


1. What's the purpose of the following in
build_frame_matrix_from_leaf_window?  "frame_row->used[TEXT_AREA]" will
always end up being equal to "window_matrix->matrix_w" after processing
the right-most window of the row.

--8<---------------cut here---------------start------------->8---
      /* Set number of used glyphs in the frame matrix.  Since we fill
         up with spaces, and visit leaf windows from left to right it
         can be done simply.  */
      frame_row->used[TEXT_AREA]
	= window_matrix->matrix_x + window_matrix->matrix_w;
--8<---------------cut here---------------end--------------->8---


2. From the documentation of make-terminal-frame:

> Note that changing the size of one terminal frame automatically
> affects all frames on the same terminal device.

But why?  Do they share glyph matrices, since only one of them is
visible at a single time?


3. Why clear the desired matrix in build_frame_matrix?  As I understand,
that would clear the glyph matrices of windows the frame, because window
desired matrix shares memory with frame desired matrix, and its seems
like build_frame_matrix is called after window desired matrices are
built.

--8<---------------cut here---------------start------------->8---
  /* Clear all rows in the frame matrix covered by window matrices.
     Menu bar lines are not covered by windows.  */
  for (i = FRAME_TOP_MARGIN (f); i < f->desired_matrix->nrows; ++i)
    clear_glyph_row (MATRIX_ROW (f->desired_matrix, i));
--8<---------------cut here---------------end--------------->8---


4. And one more question: why don't Emacs is use the window feature of
ncurses despite depending on it?  Is it inefficient or lack of any
feature?


Thanks in advance, and apologies if this is not the right place to ask.


-- 
Akib Azmain Turja

This message is signed by me with my GnuPG key.  It's fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

             reply	other threads:[~2022-07-04 17:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04 17:26 Akib Azmain Turja [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-07-04 19:37 Questions on glyph matrices used for rendering frame in terminal Gerd Möllmann
2022-07-05  2:49 ` Po Lu
2022-07-05  4:26 ` Akib Azmain Turja
2022-07-05  6:24   ` Gerd Möllmann
2022-07-05  9:03     ` Akib Azmain Turja

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=874jzwn611.fsf@disroot.org \
    --to=akib@disroot.org \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).