From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dov Grobgeld Newsgroups: gmane.emacs.devel Subject: Re: Stylus drawing input? Date: Tue, 24 Jan 2023 17:55:15 +0200 Message-ID: References: <87pmbhpjkc.fsf@web.de> <87cz7eq5uh.fsf@web.de> <0C19A13B-EEFF-486B-BED3-36A4AEF629D8@yahoo.com> <83zga8glsn.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39586"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Luangruo@yahoo.com, emacs-devel@gnu.org, tomas@tuxteam.de To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jan 24 16:56:29 2023 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 1pKLeu-000A5e-KK for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Jan 2023 16:56:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKLe6-00051S-PZ; Tue, 24 Jan 2023 10:55:39 -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 1pKLe3-00051G-DM for emacs-devel@gnu.org; Tue, 24 Jan 2023 10:55:35 -0500 Original-Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pKLe0-0001BM-Kc; Tue, 24 Jan 2023 10:55:34 -0500 Original-Received: by mail-lf1-x12a.google.com with SMTP id br9so24120653lfb.4; Tue, 24 Jan 2023 07:55:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=l3czLj6EGBHqQUVIojmcbDAkPBcVFoK4lDxD4+scepg=; b=O6v4jf+kAo87c9hbW/4QCW/3NLmCQzAURRLwj4Lg+waKsts4l3b0jptTb52mLuRMmP /ZO7n8fDIksGjVB41tG7GApfkCzbjNXItr+fE4GbBibs2Xy0GVMQVi99JfKW4AqCEHLS SjcK3+fF2kOCH05WQsKIehBlBSrsXJvSXdGTpwMwb3+8PqZtW/Ija7gEJssw/RINC1NK LQ83dycMYcdxMyIRfQ3Segf6zmHWSMlBmk9OKaPtnKDE1k/hlM88ADedNtVC0hFS6yHs C8I7U9x6nMOxQc/BPTuoLTpQu4TYxRjBH3yqXfsT6EbzaOr7qt+y4xzWcxLeoNujZ6Bz CRhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=l3czLj6EGBHqQUVIojmcbDAkPBcVFoK4lDxD4+scepg=; b=t2IRP+lCIURQT58nZx4MvUDs/CAwxDSpXzW7MbwRMIrAYyJ/0W00EHlA/1UAhZbOMX oVFfVjrKTPEZv5oinjwR1kiu58hYD/iU224K16W4AYdDfhVjh/JLdBzqNokeNCVsWIs9 JrKPUngWzG12V5tTPDa1e8W0lHLDbEU0dvPkk/yg2G2BPbNROZA8nxNDR5pwuTeMiKxl gg2+dMwHk1Q/fOOzFW0QhXKeBKogB/mxyaJovl3u0S8ilad1zxUkbrqdgeQ7mFrQwLOX bIrInnL15H7D8YNnT72lqDjaonkqRu1BeiqyzQCIUTkI/8xuBCtFlSfjq8gBh3WZIRYZ lUGQ== X-Gm-Message-State: AFqh2kpnNXs8iAFLoRjhTibt5FA0vP4Ew58bcAoZhD1SVwIV277ctqch uLM5e9PrJ0nhoxcICHWJrohaBFU18JWiv50cbxh4SgIg X-Google-Smtp-Source: AMrXdXvJqpOQES/gsD8LyWmTNDXLGyQJS8UyoCRI5KD5vWsohilVZel9u0vNcfAlZm2GE5EqFjxkXmFb5iZtwYH3uNY= X-Received: by 2002:a19:5502:0:b0:4a2:4b01:8466 with SMTP id n2-20020a195502000000b004a24b018466mr2092888lfe.34.1674575728270; Tue, 24 Jan 2023 07:55:28 -0800 (PST) In-Reply-To: <83zga8glsn.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=dov.grobgeld@gmail.com; helo=mail-lf1-x12a.google.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, RCVD_IN_DNSWL_NONE=-0.0001, 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:302642 Archived-At: Thanks! I had a look at it and it seems that it shows the rendering part of issue number 1. I.e. by expressing the vector graphics as svg we can generate an image and insert it into the buffer. It might also solve number 4, if I can figure out how to make it draw antialiased in a single color. But I still don't understand how emacs can display such an image as an "overlay" on top of other buffer contents. E.g. if I have an RGBA image (or svg object) containing the stroke of the stylus. How can I display that "above" the pdf display window? Does emacs support the notion of layers? (Having the notion of layers would also be nice for doing presentations in emacs, as you can then have some static graphics as a background image.) Regards, Dov On Tue, Jan 24, 2023 at 2:27 PM Eli Zaretskii wrote: > > > From: Dov Grobgeld > > Date: Tue, 24 Jan 2023 10:03:02 +0200 > > Cc: emacs-devel@gnu.org, tomas@tuxteam.de > > > > Thanks. I need some guidance on how feasible the following is and how > > I would go about doing it. > > > > 1. How do I draw vector graphics object in an emacs buffer. I.e. > > line-to, move-to, close-path, fill etc. Do I need to generate the > > pixels on my own (can be done e.g. with the agg library or with > > libcairo) and then place the image as on overlay (how?), or is there > > higher lever interface? Is it accessible from elisp or from C? > > 2. How can I trace the x,y input coordinates of mouse movement. E.g. > > I'd like to run a command to enter capture mode, and then catch > > subsequent motion events of the mouse, until the mouse button is > > raised. The resulting object should be a list of motion coordinates. > > 3. How would I do the same for a stylus while catching additional pressure data? > > 4. Given some vector graphics objects drawn on the screen, how would I > > do mouse hit detection, so that doing a mouse click on the object, > > returns the object id? (This I can do "offline" though, by drawing a > > "label image" of the buffer contents on mouse press end then finding > > the label of the object under the mouse.) > > Does the svg.el library help with some of the above?