From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Introducing emacs-webkit and more thoughts on Emacs rendering (was Rethinking the design of xwidgets) Date: Sun, 29 Nov 2020 01:22:18 +0100 Message-ID: References: <864kmzupp0.fsf@akirakyle.com> <86pn46awrr.fsf@akirakyle.com> <87y2ise7j5.fsf@gnus.org> <86tutfwhr6.fsf@akirakyle.com> <87h7pfb76z.fsf@gnus.org> <86h7peqkt5.fsf@akirakyle.com> <83tutdsc8i.fsf@gnu.org> <86eeker01y.fsf@akirakyle.com> <83wny5naf5.fsf@gnu.org> <83tut9n8hv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38544"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: larsi@gnus.org, akira@akirakyle.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 29 01:23:08 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 1kjAUe-0009vH-Gw for ged-emacs-devel@m.gmane-mx.org; Sun, 29 Nov 2020 01:23:08 +0100 Original-Received: from localhost ([::1]:48934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjAUd-0001o9-DL for ged-emacs-devel@m.gmane-mx.org; Sat, 28 Nov 2020 19:23:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjATy-0001J5-Kf for emacs-devel@gnu.org; Sat, 28 Nov 2020 19:22:26 -0500 Original-Received: from mail-am7eur06olkn2089.outbound.protection.outlook.com ([40.92.16.89]:13185 helo=EUR06-AM7-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 1kjATv-0007ra-7O; Sat, 28 Nov 2020 19:22:26 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JKlQv+ZfQVI4tlJXYIVYEBGwNEwknl8eutJk+ChoF7rWDIGIuKiVJ6lF060qnGPM5Iy+iztSgq6lNzkDM3R3nEcrh8KCz73y2XFC2YzIwRnVO4D7rJJeH/wefj/18QGLfVcSsTClr6Nmjqnr8YlQi/3yFP189UdnDRW5WOVmtUEv2pLDIPA2HNst9gFiZGj/eCgpYMEmhFd8Z3u0bgrdzTbHaN9UJNjXl1GvOlY/qdxXPKOW8Rxg5kaQdlypDyiqC9+3hYekn+c3WsnVZwiZ8lXDOUe7KiMOITOGsXZKlKeiAsvwiisn8D4X4Tos8gt29byS9BvVK1mG8V5VkkI0tg== 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=tb0qovy/yOQMRf0vtRk3EqyK+uzBy154HNxc8UGFFsM=; b=nQiRn3G0BBtY4Xa+TYj/NMG1n8hpio/zpeBYEU2BpBWBnP2i3CBVTXvRc6F1+97gTkxxrJ27Ow57xfMqw41ewmQc9C5E+aiPmwYyc4+AplXdGINdeam8Id9YpEIjSJMB/TYk8Fayn2Y5nyZI0dwDH3w2ZEc72vEADo8T9eN7mkxVXQoTcrIpD+ROId62N81v3NYkjAAPiKiufWZcK0n/CM3UHUiLJEYJZGjRD8Xor77AwUIUPylLlZ66JYA1tsY9IKDGYFo1TWY+tO+67F60cilwOOo78y7OBAmRbpNboBbvkPRKPD1b9iyXDUOYBBOaTf2xilnYWSrwrrjvJ+/BMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=tb0qovy/yOQMRf0vtRk3EqyK+uzBy154HNxc8UGFFsM=; b=pGDeYjd3fYy+1VV6Ii2d/uuhgNYOGz/oZTgkFNWGC90OjKmWyUmIGRpYNN8GdKtmmWYWPBJwyIIXdkYg0aTOHK8vnZ9gUbyj8SLcHWBqp+Tu3g3jTBmJdWUmzqhTLlFHsC7CcdsnvShiyV7n90eXmF/MezCERNAixASmKVaaK19DFUSwEPnxlzatIw53fpFK3sSQ8PeC9HA/oQRHIe7EN340QR3VK3uSBExW3bXmnrs672/jvdtf67iCwqgzC393EU2T1Ecw6g2h+7oeWFVujMo8BdTGz2bnZZn9u3ct7QJts5GXMp8ufHVFjZ5+MS59ZqHdIXq2FkBv9GHHDFhy0w== Original-Received: from VI1EUR06FT028.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc37::40) by VI1EUR06HT128.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc37::234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.23; Sun, 29 Nov 2020 00:22:19 +0000 Original-Received: from AM0PR06MB6577.eurprd06.prod.outlook.com (2a01:111:e400:fc37::40) by VI1EUR06FT028.mail.protection.outlook.com (2a01:111:e400:fc37::444) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.23 via Frontend Transport; Sun, 29 Nov 2020 00:22:19 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:A337DE0C22FA73DF01B5EE731468FB2CAF5FF4A9C9103193BAE28C6408CF7355; UpperCasedChecksum:7A33BE1B177A7B5B92CAF9C60B7922824C041D54F1C810EBDDE11145CF3A8589; SizeAsReceived:7811; Count:46 Original-Received: from AM0PR06MB6577.eurprd06.prod.outlook.com ([fe80::9487:8c7d:da00:4993]) by AM0PR06MB6577.eurprd06.prod.outlook.com ([fe80::9487:8c7d:da00:4993%7]) with mapi id 15.20.3611.025; Sun, 29 Nov 2020 00:22:19 +0000 In-Reply-To: <83tut9n8hv.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 28 Nov 2020 11:19:56 +0200") X-TMN: [3LX8x9R2uUB7XHsPL4nwCetkLkfs7WTR] X-ClientProxiedBy: AM6PR08CA0011.eurprd08.prod.outlook.com (2603:10a6:20b:b2::23) To AM0PR06MB6577.eurprd06.prod.outlook.com (2603:10a6:208:19a::23) X-Microsoft-Original-Message-ID: <871rgdt3k5.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM6PR08CA0011.eurprd08.prod.outlook.com (2603:10a6:20b:b2::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20 via Frontend Transport; Sun, 29 Nov 2020 00:22:18 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: eebc11a7-df92-45b6-0304-08d893fcd520 X-MS-TrafficTypeDiagnostic: VI1EUR06HT128: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +dzyMTvRlbX0rLovbInWsj9WiD1Gdn+HK+gdtQUdQVyoR9lxEJfSU15shIJq768b6le/4fK2vSUvWBaihTSvytIy4ZudrqsPNVVTR3Rq38XVIhs8K23yLb3TDpiXwChGmeHxQp4PSo3viAB6/P+bOpKnZgkv7TNCfF0VVvH8b9V/0U8FklrOhEhIpEub2Efr5sHTDtgpaqV/D3Z8YEUTXA== X-MS-Exchange-AntiSpam-MessageData: E7fXPxvgohRIMdc8ZLy3OucqeFozxRg+sS3u4Zhon1KFDtUM36zvfy+Rc9UmXH9d8Wj4eZDWkUfzbtYfujeritiQ0Gk9uEW8SpFJEOKT/F+YwNJVkDmIpx0aVcuRKitpUF4N2bdUoCn1nQTJHI1MvA== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: eebc11a7-df92-45b6-0304-08d893fcd520 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2020 00:22:19.5187 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VI1EUR06FT028.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1EUR06HT128 Received-SPF: pass client-ip=40.92.16.89; envelope-from=arthur.miller@live.com; helo=EUR06-AM7-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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.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:259982 Archived-At: Eli Zaretskii writes: >> From: Arthur Miller >> Cc: Akira Kyle , larsi@gnus.org, emacs-devel@gnu.org >> Date: Sat, 28 Nov 2020 09:57:39 +0100 >> >> Eli Zaretskii writes: >> >> > As long as the widget can be told to use a given rectangular portion >> > of the screen, we should be fine: the current Emacs display engine is >> > perfectly capable of handling display elements that occupy an area of >> > certain dimensions. >> >> How can I tell any drawing routines to use certain rectangular area on >> display so it is in harmony with Emacs display engine? > > On the display engine level, you need to define a new kind of "display > element" (see 'enum glyph_type' in dispextern.h) and new kind of > method for producing such a display element (see 'enum it_method' in > dispextern.h). You will also need to write a BUILD__GLYPH_STRING > macro that produces a "glyph string" from one or more display elements > of this new type; see BUILD_XWIDGET_GLYPH_STRING in xdisp.c as an > example. Glyph strings are the interface between xdisp.c, which > parses buffers and strings for display and performs display layout, > and xterm.c (see below) which actually draws the resulting display > elements. > > On the Lisp level, you will probably use a special 'display' property > whose value specifies the widget with the necessary parameters, like > we do with images. > >> Are there callbacks I can connect too if I would like to update opengl >> viewport that I can hook easily into? Where do I look? I am not sure I >> understand it from image.c; it was there I was looking. I never looked >> into xwidgets though. Can be just me; but if you can point me to right >> place to look at I am thankful. > > The actual drawing is in xterm.c (for X; it's w32term.c for > MS-Windows, nsterm.m for NS, and term.c for TTY frames). Each type of > display element has a function there, which is called to draw the > display element. For example, x_draw_image_glyph_string for drawing > images. You will need to write a new function for this new display > element, whose parameters are passed from the new it_method method > above. Not sure if this is what you meant by "callback to connect to > in order to update opengl viewport". > > (image.c just prepares the data required for drawing an image; its > functions are not called when drawing the image, we just use the > pixmap produced by image.c and various other parameters, like image > dimensions etc.) Thank you for the kind tour! This was much more then I was hoping for :-).