From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#35468: [PATCH] Refactor draw_glyph_string on X and w32 Date: Tue, 30 Apr 2019 07:59:37 +0300 Message-ID: <83sgu0rsue.fsf@gnu.org> References: <877ebeor2d.fsf@gmail.com> <83tveit5ph.fsf@gnu.org> <87pnp5oqu1.fsf@gmail.com> <877ebcogg4.fsf@gmail.com> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="172695"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 35468@debbugs.gnu.org To: Alex Gramiak Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 30 07:00:15 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLKsJ-000ioX-3K for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Apr 2019 07:00:15 +0200 Original-Received: from localhost ([127.0.0.1]:39154 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLKsI-0002Ip-2E for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Apr 2019 01:00:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLKsC-0002IG-4t for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2019 01:00:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLKs9-0005Ed-Re for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2019 01:00:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55141) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hLKs6-0005Dk-Ql for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2019 01:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hLKs6-0007PR-JG for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2019 01:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Apr 2019 05:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35468 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35468-submit@debbugs.gnu.org id=B35468.155660039928447 (code B ref 35468); Tue, 30 Apr 2019 05:00:02 +0000 Original-Received: (at 35468) by debbugs.gnu.org; 30 Apr 2019 04:59:59 +0000 Original-Received: from localhost ([127.0.0.1]:40452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLKs3-0007Ol-CR for submit@debbugs.gnu.org; Tue, 30 Apr 2019 00:59:59 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48451) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLKs1-0007OW-KJ for 35468@debbugs.gnu.org; Tue, 30 Apr 2019 00:59:57 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLKrs-00057x-1v; Tue, 30 Apr 2019 00:59:51 -0400 Original-Received: from [176.228.60.248] (port=1303 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hLKrq-0003AP-Aa; Tue, 30 Apr 2019 00:59:47 -0400 In-reply-to: <877ebcogg4.fsf@gmail.com> (message from Alex Gramiak on Mon, 29 Apr 2019 11:43:23 -0600) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158477 Archived-At: > From: Alex Gramiak > Cc: 35468@debbugs.gnu.org > Date: Mon, 29 Apr 2019 11:43:23 -0600 > > I'm in {x,w32}_draw_box_rect right now, trying to generalize both > versions. The issue is that the fill command in each accepts different > arguments; specifically the w32 version takes in the color explicitly > and uses s->hdc instead of s->gc. So I think there will have to be 2 > different fill_rectangle interface procedures: one for glyph strings (so > that the w32 version can access s->hdc), and another for other > procedures like *_draw_bar_cursor. Would it be possible to generalize this into a single interface? The GC vs HDC part can be generalized by passing both (HDC will be NULL in the X and NS cases), and the color will be passed as in the w32 version, with the X version doing its thing with GCForeground internally. Alternatively, we could have a set_foreground interface that will do nothing for w32 and for X call XGetGCValues and XSetForeground, to set up s->gc. The second alternative will probably be more efficient. If this doesn't work, can you tell why? > It doesn't work for NS partially because of the following section only > present in the NS equivalent of gui_draw_glyph_string_box. Would you be > okay with putting this in the generic version inside a FRAME_NS_P (s->f) > check? I don't know why only NS has this, though... > > if (s->hl == DRAW_MOUSE_FACE) > { > face = FACE_FROM_ID_OR_NULL (s->f, > MOUSE_HL_INFO (s->f)->mouse_face_face_id); > if (!face) > face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); > } > else > face = s->face; I don't know why this is TRT, either. We could ask Alan to look into this, or we could simply remove that, as other terminals don't use box_line_width from the mouse face, they use s->face instead. Thanks.