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: Stylus drawing input? Date: Tue, 24 Jan 2023 14:27:20 +0200 Message-ID: <83zga8glsn.fsf@gnu.org> References: <87pmbhpjkc.fsf@web.de> <87cz7eq5uh.fsf@web.de> <0C19A13B-EEFF-486B-BED3-36A4AEF629D8@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21321"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Luangruo@yahoo.com, emacs-devel@gnu.org, tomas@tuxteam.de To: Dov Grobgeld Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jan 24 13:27:52 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 1pKIP1-0005Ly-QJ for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Jan 2023 13:27:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKIOO-0003it-AX; Tue, 24 Jan 2023 07:27:12 -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 1pKION-0003hN-4j for emacs-devel@gnu.org; Tue, 24 Jan 2023 07:27:11 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKIOM-0008Fb-AI; Tue, 24 Jan 2023 07:27:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ytp0eHyvZIa46rC3N8K+km0x7O7m5SMMozqLNyQMQko=; b=E+aFTXIuenTT i6hIR7RaKyDW6njQgmPIsyyqwxTMxYvrCtSSQf2YDdCw+TxwjwryQNR2H+FvuID4nL+zQ7sy7LENl LUJvjIv1ZYzEOi9csoscXaruqcBdC3JBvpsw2O4/rDsqp2jGr2j8g6uvD6qVIMC6tCegVYWF+Ug61 ES46s8V6ex/gFlXpqEvIDiP3RUyB9kZWGpyHSdAHpHiyhmXq+5H7hMiiM9MY8vlTc+5+q4VFatLRv aCwdOU+C68oI3WAb/krgVNYpMFaKiIMt8QimZqtmCdzHOVkbdmNMBorqxfgR5wQH0SFddCpTuemGp qqn0w53LxFHz5dmS6WGwBg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKIOL-0001xm-Ii; Tue, 24 Jan 2023 07:27:09 -0500 In-Reply-To: (message from Dov Grobgeld on Tue, 24 Jan 2023 10:03:02 +0200) 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:302641 Archived-At: > 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?