From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Help writing a patch to allow transparent backgrounds? Date: Sat, 13 Feb 2016 15:51:46 +0200 Message-ID: <83oabk67m5.fsf@gnu.org> References: <56BA043E.1050305@gmail.com> <83lh6s9zx9.fsf@gnu.org> <56BB8570.6040607@gmail.com> <83fux09xpj.fsf@gnu.org> <56BB913C.4050305@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1455371520 22326 80.91.229.3 (13 Feb 2016 13:52:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Feb 2016 13:52:00 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?utf-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 13 14:51:55 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aUac6-0003Fs-L4 for ged-emacs-devel@m.gmane.org; Sat, 13 Feb 2016 14:51:54 +0100 Original-Received: from localhost ([::1]:42244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUac5-0002oo-HK for ged-emacs-devel@m.gmane.org; Sat, 13 Feb 2016 08:51:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUac1-0002oj-T9 for emacs-devel@gnu.org; Sat, 13 Feb 2016 08:51:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aUaby-00087T-MX for emacs-devel@gnu.org; Sat, 13 Feb 2016 08:51:49 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUaby-00087G-Ib; Sat, 13 Feb 2016 08:51:46 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4764 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aUabx-0001O9-Pk; Sat, 13 Feb 2016 08:51:46 -0500 In-reply-to: <56BB913C.4050305@gmail.com> (message from =?utf-8?Q?Cl=C3=A9?= =?utf-8?Q?ment?= Pit--Claudel on Wed, 10 Feb 2016 14:36:28 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:199872 Archived-At: > Cc: emacs-devel@gnu.org > From: Clément Pit--Claudel > Date: Wed, 10 Feb 2016 14:36:28 -0500 > > Thanks! I'll be happy to try to implement this feature, with some help to navigate my way around the C source. Look at xterm.c:x_draw_glyph_string_background. This is the function that draws the background of text before that text is drawn in the foreground color. The other function to look at is x_draw_glyph_string_bg_rect in the same file -- this one is used to draw the background of display elements that are not text: images and stretches of white space. A word about "glyph strings": these are structures built by the Emacs display engine in preparation for actually redrawing portions of the display which need that. Each glyph string is the longest possible collection of glyphs that are to be drawn in the same face, so the terminal-specific back-end (such as xterm.c) could set up the necessary settings once, and then draw all of the glyphs of the glyph string in one go. For displaying text, the glyph string includes a run of characters in the same face (font, colors, etc.) specified by their glyph indices in the font. HTH