From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Stylus drawing input? Date: Tue, 24 Jan 2023 18:50:09 +0800 Message-ID: <87ilgw436m.fsf@yahoo.com> References: <87pmbhpjkc.fsf@web.de> <87cz7eq5uh.fsf@web.de> <0C19A13B-EEFF-486B-BED3-36A4AEF629D8@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9665"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 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 11:51:24 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 1pKGtg-0002NI-9P for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Jan 2023 11:51:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKGt4-0005YF-57; Tue, 24 Jan 2023 05:50:46 -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 1pKGsl-0005Xg-Hf for emacs-devel@gnu.org; Tue, 24 Jan 2023 05:50:28 -0500 Original-Received: from sonic309-20.consmr.mail.ne1.yahoo.com ([66.163.184.146]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pKGsj-0006QR-Lg for emacs-devel@gnu.org; Tue, 24 Jan 2023 05:50:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1674557422; bh=vCZxBTYcOXkoxgFTcv2rjYKkREpTgKxBe5vH1VJ0D7w=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=sDeVA/lVpedoUSEGTMdC/K3cX5mL7PQ2EukaqlFYaD7rOM5bDEnTwkO1eyvHrL4/SY7JlsaOhdGDOJ0xaPfrICbmh8kSObJuqfRJYh4fGdjHHEX1U1zsap7tNTe5wQyizXNuEJDyUPhL/m8HBuDG6qCKrA9Jv0dB0+NyjUeBGsULyhEc9YhYEPNffbwHM2nzjmerynkTrR3B3bEmb43IKiWF3nWJxPaHrEeQwlJ2C4hP+/i01b2fAj6kY6Qn8rDvn1Xh0hFe4Z77tKQwADIzEU7Wy4+Vh45kq0Mql2+hvcw8d+Ee5d6mliNJIibJQpah2v2l/MgnOQFu28Pjj52PSw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1674557422; bh=Fpemgs9CU+jVIegwGnrPRXWfXe0Ie+B0jUhaHjlf/k3=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Umufa8n6YcpUqNOA3RsoWl+2EXx7pSnK560dk+FEGTPy30y16lYq53Tdrh4QuZbmJKfmRaWCxgxPsz8ziihybRknsJpd1vA/SknRk5dQMpL7GEE2gGwGbvh0835nYyrydjrfBoKJ3pJRQM2Iuyf0Fu8SyyraWvwS0Lpe8RDFOrYLF706RFbTGMtfXVZf7gRqu33e1JLvHQCjUNMrPsV607aYV0T0t87O6XYB+iksxPtigHT2StTc2m919QKYOCFOSnpc46swMcjfNmxsp3OnOYibaohIZllHJpqxfVSexlYHYfNP1WidFhABX7xJBmWwojsXzRJWpqMVcBbiiH1mTw== X-YMail-OSG: L.iwCjAVM1mUtsw8RNUGaZllPOdiuAvK5qpl0.37YuyR.Dvxqqo.pNQsnyUPIKQ 2TEqMy7TsCSR2Kg6HIq.TNqGuvk_JaOoAq9o6691Vr5nwVRK_1bUh61QkjPL1rwANcWGla5FGLSS VGslrLVTFcERjwjvIOEW3pk8czrew3JjI1L6.2YrwQUFCZPS3LQMNtgf1Zfo.YCjod0ZQO8AMqNO QBjjF7r5fmRrkw1hitAdHOGy4sdtJ46IEw9OF3ShvvWQlZPpb76zCJWlCsXWcPEJsXHFOm.VE1n4 RqWUuXdzgWiS1jJy2HxuL9ErpG3yGQUCHS0X6uTp9shgNa6GZnx2ikOYbjtDiGYY7xwlch_0JMmO Jw9g2Y1qlShoB1Gm8nPY4Yu3zDSrABVu3tL04sEQynCQ_bEcqMCEHol_f9_k8MuaqaUjMOaFmJAu KLD8_bF3_uHfT3D28B4guXs8wrpLTxQPgUGNVWBIknYuz4cTI7Bo5DOZ7j8LQjGofAZ0tmVXxRoV Y9WC5eQJsUfMHKzCsJmT.XOad84B7iM93ximJpM7O9HubgJGXhLoaKfljeJy87q.G0pb1iJ23RVX Y3MpJRWkIBFt7uTj_GkI0BoBIp4mWnvmorswWm5b2lV4iRjEOzfWoeT0l7_Ebh7AP_jAFrW14xGV skkFEO8KQdSO6w2EJa_BaELHi2RlvtvCeUJAvyYThZN4xu887BliX_uuOu_eG4DrVTToiLi8O0K9 xJjid0QNm.2d5b8EmSGxBQSm2x5Mkjvxdghqns4HrSSm_0XXlqpHmUQuYKbY3NIKE8HBCyBBp31h YbexM5La6TEvCWasvZTE2C4IJaWuECN5aBLUnk7ceF X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Tue, 24 Jan 2023 10:50:22 +0000 Original-Received: by hermes--production-sg3-84766d64d7-422f6 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 19482bca971aeb4bf28a0fb5157a94e5; Tue, 24 Jan 2023 10:50:16 +0000 (UTC) In-Reply-To: (Dov Grobgeld's message of "Tue, 24 Jan 2023 10:03:02 +0200") X-Mailer: WebService/1.1.21096 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.184.146; envelope-from=luangruo@yahoo.com; helo=sonic309-20.consmr.mail.ne1.yahoo.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:302640 Archived-At: Dov Grobgeld writes: > 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? Emacs doesn't have any built in vector graphics capability. But the image route could probably work, yes. > 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. I suggest reading through looking the entirety of (elisp)Input Events. It will explain everything better than I can. > 3. How would I do the same for a stylus while catching additional > pressure data? I will see what interfaces the X Input extension provides to access that information and ack. > 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.) I think you had better head to the nearest library (or perhaps book store) for this one. That is outside of the scope of this list.