From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Cecilio Pardo Newsgroups: gmane.emacs.devel Subject: Re: Drawing UI elements behind text Date: Wed, 27 Nov 2024 00:19:43 +0100 Message-ID: <78d3a7e7-f5a7-476b-8a9d-27beca44a94a@imayhem.com> References: <641230ac-2dbc-42ac-a57e-acda77fe9296@imayhem.com> <8C55E590-E586-440A-89C5-0E5153518790@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5199"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: emacs-devel To: JD Smith Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 27 00:20:45 2024 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 1tG4rN-0001FK-K8 for ged-emacs-devel@m.gmane-mx.org; Wed, 27 Nov 2024 00:20:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tG4qZ-0001df-Kj; Tue, 26 Nov 2024 18:19:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tG4qV-0001dJ-Or for emacs-devel@gnu.org; Tue, 26 Nov 2024 18:19:51 -0500 Original-Received: from mail.imayhem.com ([82.223.54.191] helo=zealous-pike.82-223-54-191.plesk.page) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tG4qT-0006Rb-IO for emacs-devel@gnu.org; Tue, 26 Nov 2024 18:19:51 -0500 Original-Received: from [192.168.68.104] (111.red-88-21-7.staticip.rima-tde.net [88.21.7.111]) by zealous-pike.82-223-54-191.plesk.page (Postfix) with ESMTPSA id 988C080114; Tue, 26 Nov 2024 23:19:44 +0000 (UTC) Authentication-Results: zealous-pike.82-223-54-191.plesk.page; spf=pass (sender IP is 88.21.7.111) smtp.mailfrom=cpardo@imayhem.com smtp.helo=[192.168.68.104] Received-SPF: pass (zealous-pike.82-223-54-191.plesk.page: connection is authenticated) Content-Language: es-ES In-Reply-To: <8C55E590-E586-440A-89C5-0E5153518790@gmail.com> Received-SPF: pass client-ip=82.223.54.191; envelope-from=cpardo@imayhem.com; helo=zealous-pike.82-223-54-191.plesk.page X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325730 Archived-At: On 25/11/2024 0:37, JD Smith wrote: > I support this idea. For indent-bars, I use display :stipple as a "separate band" of graphical information that can lie atop text in a buffer, but remain independent of it. Stipples are flexible and very performant, but have a few issues: > > - There is inconsistent stipple support across emacs versions. > - Stipple patterns begin at the frame origin, so up-to-date window-specific remapping is required to prevent unwanted pattern aliasing. > - Aligning stipples vertically requires fixed space content. Stipples also disable the scrolling of buffer pixels, affecting performance of redisplay. > > More commonly, modes also make use of :box styling, e.g. for producing boxed "labels", as in org-modern. > > An API for drawing simple styled lines, rounded corners, boxes etc. — either in absolute window coordinates, or associated with, but "behind" text in the buffer — would represent a real step forward. I haven't found a way to draw behind the text that is not too complicated or affects redisplay too much. So now the idea is drawing over the text. For the applications I have in mind this works equally well. The starting drawing elements are going to be vertical and horizontal segments, with color (maybe with alpha), width and different patterns. They can be placed on pixel positions or character positions when using fixed size fonts, using floating point numbers so you can put, for example, indent lines in the middle of characters. They are associated with a buffer, and have a 'source' marker so the facility can be shared by several programs. Any ideas for more elements or applications are welcome. -- Cecilio Pardo.