From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Introducing emacs-webkit and more thoughts on Emacs rendering (was Rethinking the design of xwidgets) Date: Tue, 01 Dec 2020 17:58:23 +0200 Message-ID: <83im9likm8.fsf@gnu.org> 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> <86o8jh9cij.fsf@akirakyle.com> <83czzwkmwk.fsf@gnu.org> <86lfeja49y.fsf@akirakyle.com> <87czzu7y5r.fsf@logand.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5830"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Tomas Hlavaty Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 01 16:59:24 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 1kk83n-0001Ma-UO for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Dec 2020 16:59:23 +0100 Original-Received: from localhost ([::1]:51684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk83m-0004R1-Vr for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Dec 2020 10:59:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk82z-0003rB-W3 for emacs-devel@gnu.org; Tue, 01 Dec 2020 10:58:34 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57207) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk82x-0008Da-TR; Tue, 01 Dec 2020 10:58:32 -0500 Original-Received: from [176.228.60.248] (port=2305 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kk82v-0007K3-Az; Tue, 01 Dec 2020 10:58:30 -0500 In-Reply-To: <87czzu7y5r.fsf@logand.com> (message from Tomas Hlavaty on Tue, 01 Dec 2020 09:01:20 +0100) 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:260130 Archived-At: > From: Tomas Hlavaty > Date: Tue, 01 Dec 2020 09:01:20 +0100 > > It would be more convenient, if there was a way to specify elisp > function to draw an image. By default, it could just call the existing > C code but this would also allow me to specify a different elisp > function which would then for example call w3mimgdisplay. You need to be aware of how this works in Emacs. In a nutshell, there's no function "to draw the image": we call system APIs to do that. By the time we need to draw the image, it is already preprocessed into a bitmap/pixmap, so we basically ask the GUI subsystem of the OS to bitblt the image to some coordinates on the screen which we compute. The preprocessing of the images into bitmap/pixmap happens when the display engine sees a 'display' property that specifies an image. At that time we call some image library to convert the image's data into bitmap/pixmap; then we cache the result and produce a handle to the cache that the drawing routines will use. So when you ask for the above, you need to fit into this scheme. > It would be more convenient, if an image was represented as elisp data > instead of C data. create-image already knows how to accept image data. > iirc there is no way to add new image types without touching C. No, because you need to know how to convert that into the internal format used to draw the image, which is platform dependent. Why is it a problem to use one of the known image types? E.g., SVG (via the svg.el library). > Is there a way to turn off cursor for a buffer? There's the cursor-type variable. > Is there a way run a function after emacs changes something on the > screen in a buffer? That depends by what you mean by "after emacs changes something on the screen", since in Emacs redisplay is independent/separate of data changes. Please elaborate.