From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Emacs canvas support Date: Thu, 30 Apr 2020 23:20:18 +0300 Organization: LINKOV.NET Message-ID: <87r1w4sp31.fsf@mail.linkov.net> References: <875zdikdge.fsf.ref@yahoo.com> <875zdikdge.fsf@yahoo.com> <875zdi8988.fsf@mail.linkov.net> <837dxxya1b.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="89809"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: luangruo@yahoo.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 30 22:27:18 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 1jUFmA-000NHC-MX for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Apr 2020 22:27:18 +0200 Original-Received: from localhost ([::1]:45940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUFm9-0004bP-P7 for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Apr 2020 16:27:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34930) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUFkZ-0003NN-Fb for emacs-devel@gnu.org; Thu, 30 Apr 2020 16:25:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUFkU-0001C8-W6 for emacs-devel@gnu.org; Thu, 30 Apr 2020 16:25:39 -0400 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:60487) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUFjj-0007Mi-US; Thu, 30 Apr 2020 16:24:48 -0400 X-Originating-IP: 91.129.106.11 Original-Received: from mail.gandi.net (m91-129-106-11.cust.tele2.ee [91.129.106.11]) (Authenticated sender: juri@linkov.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 331E4C0004; Thu, 30 Apr 2020 20:24:43 +0000 (UTC) In-Reply-To: <837dxxya1b.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 30 Apr 2020 05:36:32 +0300") Received-SPF: pass client-ip=217.70.183.198; envelope-from=juri@linkov.net; helo=relay6-d.mail.gandi.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/30 16:24:45 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Received-From: 217.70.183.198 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:248274 Archived-At: --=-=-= Content-Type: text/plain >> > I'd appreciate some feedback on something I came up with during my spare >> > time: Emacs canvas support. >> >> Great, thanks! I'm going to try to use canvas-rounded-rectangle >> for rounded corners of tabs. Sometime ago I tried to draw them >> with Cairo, but the implementation was too ah-hoc. Whereas your >> solution is more generally usable. > > Did you try using svg.el? I tried, but svg is not great, it has many unfixed problems with scaling and backgrounds. OTOH, I hope with canvas it would be easy to draw such shapes around the tab name like in web browsers shown below, and also to implement overlapping tabs. At least canvas in web browsers allow doing such custom drawings. As for the implementation, there is already Cairo code used to draw 3D box shapes around strings with box faces in xterm.c. Canvas could be implemented to generalize these hard-coded shapes and expose their definitions to Lisp as configurable options. --=-=-= Content-Type: image/png Content-Disposition: inline; filename=browser_tab.png Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAIwAAAAsCAYAAAC33FDQAAAABmJLR0QA/wD/AP+gvaeTAAAHNUlE QVR42u2cbUiT3R/HP5tzs7JtubWMhLpTg+kmUhYYzBLM0jfSg5UiCr5SsBVEBVFE9SIqNGgDpSAS LX1jMCrs4d0g7UUWJFqETyAk2YNzS2nz2na/+P/bv91qas37n3o+b7adnYfr/M73Oud3zrnOJaut rQ0iEMwSuTCBQAhGIAQjEIIRCMEIFjuKuSbQ6/X89ddfqNVqNBoNKpVKWPEPx+v1Mjo6itvtpr+/ n0+fPv07gklPT8doNIoWWGCoVCoMBgMGg4GkpCS6urp4/fr1/A5Jubm5QiyLhNTUVHJzc+dPMGaz GZ1OJyy9iNDpdJhMpsgLJi4u7pcyFvz5mM1mVq1aFVnBJCcnC8suYpKSkiIrGLVaLay6iFm5cmVk BaPRaIRVFzGxsbGRFUx0dLSw6iJmxYoV8zOtFgjgF1Z654rL5cJut9Pb24vP5wNAqVSSmJhIVVUV Wq1WtMICYl57mNbWVqxWK93d3UxMTKDRaNDpdPh8Prq7u7FarbS2tka0zJKSEjwej2jZhdbDtLa2 0tjYiEwmo7CwkIKCAuRyOW/evOHixYsASJJEY2MjAHl5ebPK9+jRo3z8+HFSeH5+PiUlJRG7/rdv 3+JwOOjp6UGSJAwGA/n5+ezYsQOA48ePEx8fz4kTJ0Jpvn37xrlz57h8+TIAdrud4uJi4uLiQnEG BwdxuVyYzeYpyw0EAsjl8qUlGJfLxd27d5HJZFy9epW1a9cCcOfOHdra2sLiBoNBmpqayMzMnNXw dO3aNYLBIP39/dhsNmpqagCQyWQRu/5Xr15ht9vZv38/5eXlLFu2jMHBQZYvXx4Wr6enhxcvXpCR kRGRcn0+HzKZbEbBWK1WUlJSqKioCAuvq6uju7ub69evLyzB2O12/H4/hYWFIbH09f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