From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Emacs canvas support Date: Fri, 01 May 2020 16:32:48 +0200 Message-ID: References: <875zdikdge.fsf.ref@yahoo.com> <875zdikdge.fsf@yahoo.com> <834kt21yyo.fsf@gnu.org> <87zhau1uog.fsf@yahoo.com> <83sggmzjp8.fsf@gnu.org> <87mu6u1tii.fsf@yahoo.com> <83o8raziis.fsf@gnu.org> <877dxy1smz.fsf@yahoo.com> <87o8rae0ao.fsf@randomsample> <83lfmexmfp.fsf@gnu.org> <20200429171619.GB20842@tuxteam.de> <83imhixkva.fsf@gnu.org> <83h7x2xke8.fsf@gnu.org> <83v9lhvyy8.fsf@gnu.org> <83sggkx4nc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="75222"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: tomas@tuxteam.de, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 01 16:33:36 2020 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 1jUWjQ-000JSv-HH for ged-emacs-devel@m.gmane-mx.org; Fri, 01 May 2020 16:33:36 +0200 Original-Received: from localhost ([::1]:48630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUWjP-0006c2-Iq for ged-emacs-devel@m.gmane-mx.org; Fri, 01 May 2020 10:33:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46954) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUWik-0006BF-KE for emacs-devel@gnu.org; Fri, 01 May 2020 10:32:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUWij-0003On-0S for emacs-devel@gnu.org; Fri, 01 May 2020 10:32:54 -0400 Original-Received: from mail-oln040092072071.outbound.protection.outlook.com ([40.92.72.71]:1539 helo=EUR03-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUWii-0003Ge-4E; Fri, 01 May 2020 10:32:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dSGAsQ8NU2NbJlzWyEG5AiD8v0KWi3hqmIQakhCTqXloIzEYccqfFT9+hxJ4DGrHAX5B5vGXjc1R1mvXs0F61ajyrpl33/2F+ArQzlLfMka4l6alCquTk+NK5JgsbaOY1//p+nRWoqiA8wivOgrj2BTUqPjSugPh6Zggsv/6oWnGhtGcI13NAQVyfuGAXOJjWNNr9kZ1t8haS45eVfpc7yMLg8azSVRNRWAhA/b7jdU+uJwCpgaSeISapmQTqxGqKiMSLQbdx0syu5hC2PIEmPoBCeaDvzTixmsRSAyLg7Wp4L/pu6JbPS1BKB6afVT2amwMgw3X7/AOvgO7jI2gzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7MRFII67eSDRBaClZydIuQN2U22eUmeqdm5edk9VpGk=; b=Uy7xCk/vcNM/s71NnXIim+cyUyWxywQsfS7o9+BGyvuL6JbB/XVSxQouhLF3Y17SMKm9yQfN/TlJE4u8br7+BN840OEoUVuZWmHpXBrCwE5xEbMgAX6MjE60B5mjVR3nd5Ry16ZU1qmJluiC2xG5EjHwFwzs/6uZtQKpzdPKzaqg17lwStMni/OZYIuqDNoV9/QIKqpZ1Q/y+1msmo+gpnsaUvSLM6xGJxfKDx7kEQ4cJTrtLBHCUID0wMZdVCDhOLJ7lvG9A3JUENs5isVZUZNimWaz8QVurXpYOyBMQ3tK2j6GMuCjRMIy9djbwwhk0B3QhAah5U23gLn0JxCxYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.com; dmarc=pass action=none header.from=live.com; dkim=pass header.d=live.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7MRFII67eSDRBaClZydIuQN2U22eUmeqdm5edk9VpGk=; b=HFaBHjs1KtImEi8UWtpQH/O88bA0a0eUN5ev8zlcjX3kZ/aUsoHiuSNKNx0jt56BdzmK2QqV4Rsurw0bQcM6ydamWD0TOXUJZ+OSL+OzrrIhM2kzL2jObpKkmhfGZQptisNaLxrtz5+sT2aVguJDXZtPEQy10FHQzchzJGQDVHpE8QW+orzL7UbNa8KvGyq3ToK3bbdEF6ns+athjSu2ZuXT8toBrFG6kTtNQGlXwtv2xnd8jGYWYrYT9uNth99nR3F/fLEzgNmuuUO51D770PWLO7sXbFoR/UB7ttMiDv+HMaacKkmfljXfQGuzpe80USMARyGD6gj+89TqpAStDw== Original-Received: from VE1EUR03FT020.eop-EUR03.prod.protection.outlook.com (2a01:111:e400:7e09::45) by VE1EUR03HT063.eop-EUR03.prod.protection.outlook.com (2a01:111:e400:7e09::181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Fri, 1 May 2020 14:32:49 +0000 Original-Received: from AM0PR06MB6420.eurprd06.prod.outlook.com (2a01:111:e400:7e09::49) by VE1EUR03FT020.mail.protection.outlook.com (2a01:111:e400:7e09::242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Fri, 1 May 2020 14:32:49 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:3D855FB31E923875E1F74CC4896DA8A4D3775B8C70F73FDD45498C3A2BE5BC92; UpperCasedChecksum:6BCB9779B064260B8CDEC8380B78067675A1F41D83FB416E67A368E5C76A82C5; SizeAsReceived:8039; Count:48 Original-Received: from AM0PR06MB6420.eurprd06.prod.outlook.com ([fe80::849f:536a:6aab:16]) by AM0PR06MB6420.eurprd06.prod.outlook.com ([fe80::849f:536a:6aab:16%5]) with mapi id 15.20.2937.028; Fri, 1 May 2020 14:32:49 +0000 In-Reply-To: <83sggkx4nc.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 30 Apr 2020 20:30:31 +0300") X-ClientProxiedBy: AM6PR08CA0037.eurprd08.prod.outlook.com (2603:10a6:20b:c0::25) To AM0PR06MB6420.eurprd06.prod.outlook.com (2603:10a6:208:1a2::19) X-Microsoft-Original-Message-ID: <87r1w3d8tr.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM6PR08CA0037.eurprd08.prod.outlook.com (2603:10a6:20b:c0::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Fri, 1 May 2020 14:32:48 +0000 X-Microsoft-Original-Message-ID: <87r1w3d8tr.fsf@live.com> X-TMN: [GnPMQzVXpzfLWTo6OmMXThUiu9cA4KNL] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 97e71471-0e2b-45e1-59eb-08d7eddc85aa X-MS-TrafficTypeDiagnostic: VE1EUR03HT063: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +mJC8cYr9msKfeTKzspNwRi/Ti9K2CYJIwQrmTAL3B7pF+ztH+YRZQUEQYfVP57rF77SqSNJ+gqUUJ1YNgRSL52q2uP00snFeMJtKIskYo+XRd7rJK0rXW2k4vY/BWKwjFw8CnWBkSojTGvVdK4uwr5vSoh3BImdzyTo2M7Y/Iec0mARX5jBLlrfUNTJczcIR+snvkcJ5jIeTKeA2T7Wnw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:0; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR06MB6420.eurprd06.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:; DIR:OUT; SFP:1901; X-MS-Exchange-AntiSpam-MessageData: seSgzy60zd81OGNphOlfAD90datUbcbcgk79IlZX5tXrWRnmfqHAc+Xke415pTjY0V8pKNbTJCpO7t/+zGAkwKLvcAT/p9IKrj8O+YihCOgkh+jHhVhRm1I7omn48Qlbx4fr+adwgbW3kvnvJiyibA== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97e71471-0e2b-45e1-59eb-08d7eddc85aa X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2020 14:32:49.0582 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR03HT063 Received-SPF: pass client-ip=40.92.72.71; envelope-from=arthur.miller@live.com; helo=EUR03-VE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/01 10:32:49 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.92.72.71 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:248303 Archived-At: Eli Zaretskii writes: >> From: Arthur Miller >> Cc: tomas@tuxteam.de, emacs-devel@gnu.org >> Date: Thu, 30 Apr 2020 16:58:10 +0200 >> >> > 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? > > No, of course not. > >> 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. > > I think what you describe doesn't fit with how the redisplay works, > but I'm probably missing something, since Stefan also thinks this > could work. To be honest I am not sure myself if it could or not work, that is why I posed at as a question in my first mail. I am not so familiar with Emacs internal but I do find it intersting to look at C code from time to time :-). My idea is to make it as least intrusive on current pipeline as possible. I see current drawing stuff as it draws to one (implicit) layer: the current window (I mean OS window). The idea is to wrap it in some way (as a callback) and call in it "per layer" each time, where each layer would draw it's own bufer. This way no new objects are needed, no new concepts, just to redraw buffers in same window once per callback. It does not have to be a callback. Instead it could be a list of buffers to draw just in ordinary list; a qeue to draw from first to last. Same code it does now, just re-enter it again per each buffer, and draw them on top of each other. I am not sure where and how to fit it in. What this be per-buffer, or per-window, or even-per frame? I was looking at Window and Buffer structures, but I don't know myself, to be honest. Then if we could get some graphics functions that draw to say XPixmap or Cairo surface (which should be trivial to expose), we could draw graphics to an image, and then display image in one layer and draw text into another layer. It would give a "Canvas" like functionality and layered rendering. How it would be usefull is up to users, but if we look at what people do in Emacs, all this UML with Ditaa, vertical lines with characters etc, obviosly there is some need for graphics in Emacs. I am sure some powerline users would be happy to draw some cool graphics to their modeline. While drawing to image and layering stuff below/above text buffer is not THE most efficient way, it could still be more efficient then drawing to SVG (xml) and rendering svg and display it as image anway or doing canvas with "put pixel" stuff. Also, not a perfect, but as rest of Emacs implementation, probably *good enough* for many uses?