From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: Re: C equivalent for: (face-attribute 'region :background (selected-frame) 'default) Date: Thu, 05 Oct 2017 20:53:53 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1507262095 6060 195.159.176.226 (6 Oct 2017 03:54:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 6 Oct 2017 03:54:55 +0000 (UTC) Cc: emacs-devel@gnu.org To: YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 06 05:54:47 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0Jio-0000S7-Gw for ged-emacs-devel@m.gmane.org; Fri, 06 Oct 2017 05:54:47 +0200 Original-Received: from localhost ([::1]:42871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Jiv-0005uA-VW for ged-emacs-devel@m.gmane.org; Thu, 05 Oct 2017 23:54:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0JiJ-0005u4-Vt for emacs-devel@gnu.org; Thu, 05 Oct 2017 23:54:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0JiG-0003Om-UL for emacs-devel@gnu.org; Thu, 05 Oct 2017 23:54:16 -0400 Original-Received: from gateway23.websitewelcome.com ([192.185.50.250]:49546) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e0JiG-0003Ex-MS for emacs-devel@gnu.org; Thu, 05 Oct 2017 23:54:12 -0400 Original-Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway23.websitewelcome.com (Postfix) with ESMTP id E653F7A71 for ; Thu, 5 Oct 2017 22:53:55 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id 0JhzeYS2ttuxm0Jhze16XZ; Thu, 05 Oct 2017 22:53:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=F1J3v1bj7lMlCoG6F8DB+YYdE9rBjPWCSR00lbsYLLc=; b=RYZ3H4ePDipzuZ7P/XXjt557Hc mTxZlspw4kbJFV4MjErWtLHyjF+avEfXjl28fx3jBJjDTSkQjYqQ8yGAusuYW99rA9I9pPpoVDZJb hZI+szz87ZNJQ3/NROFntYV4nXyrIyZo30vLnEAQ91eKtqdonA+uvmbXTJnkhkrhPctJPobvIvVLa B3d49RlZwekT36GgIMkzcXJUkYZDPO3AJn1QGqXK8gVsiZaF+ebaKnnBOnK/7iAcQkcuvpTjOfJ6N 5wSt5ec9CDa4t+EPfXSyGyseBDH6FMYDcpPsuymNCqz7+Dkuz0ZaLHRhkIeS9P8Ws8tHcFtF/6n8X bC1BZgRQ==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:55199 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1e0Jhy-003MMz-Na; Thu, 05 Oct 2017 22:53:54 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Exim-ID: 1e0Jhy-003MMz-Na X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private) [45.48.239.195]:55199 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 192.185.50.250 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219161 Archived-At: Thank you, YAMAMOTO Mitsuharu, for following this thread. Emacs for all three platforms already uses (to some extent) LSL color vectors. nsterm.m does not need to convert the LSL values and it uses them liberally. xterm.c multiplies or divides them by 65535 depending upon which direction the conversion is needed. w32term.c multiplies them by 255. My current design erases fake cursors in the reverse method in which they were drawn. A fake cursor with a glyph (e.g., text underneath) needs no special treatment -- i.e., erase_phys_cursor takes care of everything (given the proper configuration). A floating glyphless cursor (with no text) can be used to create a floating horizontal or vertical line anywhere within the window-body-height/width -- it is erased by drawing it again with the background color. Inasmuch as we can convert to/from any color format we desire, what happens internally is just a matter of personal preference. The draft API for fake cursors already supports three formats: "red", [1.0 0.0 0.0], and "#FF0000". The API can easily be extended to support a face, which only the background color would be relevant. The user does not need to care about the fact that Emacs is converting from: red-face => red => [1 0 0] => xterm.c/nsterm.m/w32term.c compatible implementations. I successfully implemented a working draft of crosshairs in xterm.c today, and am now moving on to w32 in the coming days. Extracting the coordinates for fake cursors when dealing with overlays and text properties will be last on my list of things to do, since that is the most intimidating. Implementing functionality similar to Magnars multiple cursors library will be left to someone more advanced than myself. For the past several months, I have been using built-in multiple fake cursors in conjunction with Magnars' library -- i.e., instead of a box overlay, I'm using a vertical bar fake cursor for each fake cursor. Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATE: [10-05-2017 00:11:44] <05 Oct 2017 16:11:44 +0900> FROM: YAMAMOTO Mitsuharu > > * * * > > And as I already commented, creating LSL vector or something from a > face in a platform-independent code is not a good design in the sense > that it is inconsistent with the current code. Each drawing backend > can get color information (as GC, in all the platforms other than NS) > from a given face as I showed in the code `mac_gc_for_face_id'. > > Also, erasing crosshairs or cursors could be done by imitating the > code in `expose_area'. I think you don't need to know which face is > used in the erased area. > > YAMAMOTO Mitsuharu > mituharu@math.s.chiba-u.ac.jp