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.bugs Subject: bug#71159: [PATCH] Stipple support for MS Windows Date: Sun, 02 Jun 2024 07:54:34 +0300 Message-ID: <867cf8ndv9.fsf@gnu.org> References: <86cypcuhhk.fsf@gmail.com> <86jzjcgq00.fsf@gmail.com> <86sexydekl.fsf@gmail.com> <87ed9gkber.fsf@yahoo.com> <86r0dg4hpd.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13137"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, 71159@debbugs.gnu.org To: "Elijah G." Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 02 06:55:15 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1sDdFT-0003D2-LF for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Jun 2024 06:55:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sDdF8-00050n-BC; Sun, 02 Jun 2024 00:54:54 -0400 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 1sDdF5-000500-3L for bug-gnu-emacs@gnu.org; Sun, 02 Jun 2024 00:54:52 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sDdF4-00042e-Aw for bug-gnu-emacs@gnu.org; Sun, 02 Jun 2024 00:54:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sDdFG-0003Cf-Av for bug-gnu-emacs@gnu.org; Sun, 02 Jun 2024 00:55: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: Sun, 02 Jun 2024 04:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71159 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 71159-submit@debbugs.gnu.org id=B71159.171730409612298 (code B ref 71159); Sun, 02 Jun 2024 04:55:02 +0000 Original-Received: (at 71159) by debbugs.gnu.org; 2 Jun 2024 04:54:56 +0000 Original-Received: from localhost ([127.0.0.1]:57655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDdF9-0003CI-Kd for submit@debbugs.gnu.org; Sun, 02 Jun 2024 00:54:55 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDdF7-0003C5-Rc for 71159@debbugs.gnu.org; Sun, 02 Jun 2024 00:54:54 -0400 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 1sDdEq-00041v-8u; Sun, 02 Jun 2024 00:54:36 -0400 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=p0oxj57TiFC4ENTD1pqXa8YbQ5mOjaXCJPg88npMWIc=; b=hEoi7DOz8v1F WRBtZmL2l5zNdY5ZNGo2poTRywAEOuwME51i2rxXpVNaKD2Dxl07ONPuRqc1GWEvygsyxT2YADZyx qpxLkao5+6giACkvzFGpW5JaR0KB0DIGO2MO9PckzHeIVFfZgcAlsZ0MewoeNPwWQ9Mgi+TPVHVSY XL8eaNFAPi4tfZjjozhpcX6Lq8TFRNAPjb76eLI3OHvQEPHNIHCsCaj35G3WjUyl/U+ZG9wEUrGhA yoSTeGDwKV1BWmrB7jBaCTSJSRy5qeaCDygN5hgYKty39izRp3Gr/GcFKD7TcORKcQGOx6DmaM4mR ebM53t8Dp4v7tphjb8OApg==; In-Reply-To: <86r0dg4hpd.fsf@gmail.com> (eg642616@gmail.com) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286357 Archived-At: > From: "Elijah G." > Cc: Po Lu , 71159@debbugs.gnu.org, Eli Zaretskii > > Date: Sat, 01 Jun 2024 12:54:22 -0600 > > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -2827,6 +2827,9 @@ thumbnail images and show them in the thumbnail buffer. Unlike with > using 'convert', this fallback method is synchronous, so Emacs will wait > until all the thumbnails are created and displayed, before showing them. > > +--- > +*** Emacs on MS-Windows now supports the :stipple face attribute This should end with a period, and :stipple should be quoted as ':stipple'. > + Emacs_Pixmap stipple, bitmap; > bitmap = CreateBitmap (width, height, > - FRAME_DISPLAY_INFO (XFRAME (frame))->n_planes, > - FRAME_DISPLAY_INFO (XFRAME (frame))->n_cbits, > + dpyinfo->n_planes, > + dpyinfo->n_cbits, > bits); Please rewrite this as follows: Emacs_Pixmap stipple; Emacs_Pixmap bitmap = CreateBitmap (width, height, dpyinfo->n_planes, dpyinfo->n_cbits, bits); > + { > + char *invertedBits; > + int nbytes, i; > + > + invertedBits = bits; > + nbytes = (width + CHAR_BIT - 1) / CHAR_BIT * height; Also here, please initialize the local variables where appropriate: { char invertedBits = bits; int nbytes = (width + CHAR_BIT - 1) / CHAR_BIT * height, i; Thanks.