From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ben Simms Newsgroups: gmane.emacs.bugs Subject: bug#73384: [PATCH] Draw coloured stipples on NS Date: Sun, 5 Jan 2025 20:17:42 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000005ee814062afa5e54" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24126"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= , Alan Third , Stefan Kangas , JD Smith , 73384@debbugs.gnu.org To: Arash Esbati Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 06 10:09:21 2025 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 1tUj6u-00068n-TZ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Jan 2025 10:09:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUj6g-0004K8-HB; Mon, 06 Jan 2025 04:09:06 -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 1tUj6f-0004Jf-62 for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 04:09:05 -0500 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 1tUj6e-0004wL-TU for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 04:09:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=jjGySUD3ZwlRsjMkaRQHKUDZNWuCcnacyrgzzznZo1c=; b=UWt4P0dm91YdpEh5M/o0I43NFdYeOlTl6frmv6A8EJVh865Dl5JaeCNTLollUlSfVnnugBKZSVY7VMO8q/qTBzTfJXnpYTb/xTBy8aiEvtX1v15f6aObn6DRezoRLXB8DDBWvKSEer1YV2sqjGsXgPhbdLolWdPx4rysvhxX9cJhQFJyxRsghhEAKNv2ha9jGn8i/qcX4uPf+rreYzY5t7Mh3eB8WMRVbzNkgP4Hw67f5maQTZO/x8fPpvzMLKXeuk6ZQtIcuoT4+jmSmYQvvRY5llKa87qz5VbIvHkPj3MSnSkPn9kPoaclTkSSZTPSYtKpOYwWddLh9cu6rk2SrA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUj6e-0007lj-Ow for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 04:09:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ben Simms Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Jan 2025 09:09:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73384 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73384-submit@debbugs.gnu.org id=B73384.173615451829757 (code B ref 73384); Mon, 06 Jan 2025 09:09:04 +0000 Original-Received: (at 73384) by debbugs.gnu.org; 6 Jan 2025 09:08:38 +0000 Original-Received: from localhost ([127.0.0.1]:36629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUj6D-0007js-7C for submit@debbugs.gnu.org; Mon, 06 Jan 2025 04:08:37 -0500 Original-Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]:45399) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tUW8I-0004Li-IN for 73384@debbugs.gnu.org; Sun, 05 Jan 2025 14:17:55 -0500 Original-Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-7b8618be68bso1062117085a.3 for <73384@debbugs.gnu.org>; Sun, 05 Jan 2025 11:17:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736104674; x=1736709474; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=KJagL39HdtJTTgSHJp/6ky71za9fFhsOKWPOQxDuP0I=; b=dxkcxyoMQWodSkULKgvpBuBC5heKyYm0nnWZ8ikmD+DWIN4KGKbV0cRsB+D6SL2xBd nKs7JfJVCHO2Q7NNzG+dXo7cSNdlc3eh8tpjvgE34cggqEQiIv6GjT68III5FUh7OP34 kFrJD00UR0HfsDPG1XxhVkrYTw/84v4D/5WPLQm5W7ZcRWVXut1Cx80ozLQdpZb9l3Ik JKuAYI7gIp47KiKbfvH66HAruuqbD4Ma2OHTCmQEa+xrm85kz0MCOV0RnQj3aPKYylxK 7r8k9elZWixxWUJ18KEJ95Iy6L6LO9wb8GHhCG88pQHBu9kNvsC96CgIQTgJEk1MIu13 sGDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736104674; x=1736709474; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KJagL39HdtJTTgSHJp/6ky71za9fFhsOKWPOQxDuP0I=; b=OeVp/FnIeqdhh+YGBVKdZotIwuetnOLgzWMK058WsfGo3zeAazx/azv2WtOmqis3EG cCF2zEE3ieX2P0r0zAedpMmP8RMg/nqpw2TRtVIaSxEC1oAL3RfCRzVFytHp4C/Jy/+5 mveG7qxvKON329KPLtV7a91vGy7I73XltfG+Q0NZ2ts3vg2auYds58nOA/ouDBXj4Yao os/wCw04K9+oqsDxUqKhlT8RJqKvMfZFNdvG4PS0iYOX+djyyD9XsAeEyOG/75Ortgco zKUIOx3G9xdHgaiuA7HCZbCH9aX01nLhnmURTqRbvLmtVpcukL8Mp083T0br/Xzm6/0P RmtA== X-Forwarded-Encrypted: i=1; AJvYcCVD/0E+AbBoAa7Z+HKzFMjoiEfg9btZlyerzIcxrEj9x5ePH0kTft0OuEPu8O+vpHF42obbrA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwkjN27EQ+P3/ap93mJtYgT5WEpMLU8MtVYQ78OfY2uGDEgJVWP yxV/YzsRtAdAio374SF809qSnGC1VVcuckdqVO62JGK+hPPgyslJEZtKbrdmveroGwkSjVFijRK 1yQoK+1LR4mMN3BkKv5Oo2OfZseA= X-Gm-Gg: ASbGncsPL9eVWVh0JK+KkSmEX6AQlkiYvWYsNTwsuZbNogUppvG806kfnNubZi0jZli 5mzLotb9TX4keEf5LKm9aatT3VmHzjHLiAKHqWdY4g9gLElZzadDX963muUDMlAD6/F08gg== X-Google-Smtp-Source: AGHT+IEab70nVoau+O2CCiFUoAPHdg8MYV0LOATTE6EOA00krXbrvKbOYOGaAORZrdpknQbnBDJCgYZWqqAsksxjAK0= X-Received: by 2002:a05:620a:6019:b0:7a3:5f3f:c084 with SMTP id af79cd13be357-7b9ba7abf91mr11245625185a.30.1736104673710; Sun, 05 Jan 2025 11:17:53 -0800 (PST) In-Reply-To: X-Mailman-Approved-At: Mon, 06 Jan 2025 04:08:32 -0500 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:298634 Archived-At: --0000000000005ee814062afa5e54 Content-Type: multipart/alternative; boundary="0000000000005ee812062afa5e52" --0000000000005ee812062afa5e52 Content-Type: text/plain; charset="UTF-8" Hi all, I've revised my patch from Alan's feedback. You can find it attached. On Sat, 4 Jan 2025 at 09:49, Arash Esbati wrote: > Many thanks for your comments Alan. Since I'm only the messenger here, > I'm kindly asking Ben if he can incorporate your comments and post a new > patch. > > Reg. your question: > > > I take it this doesn't require the addition of any extra build flags > > to bring in CoreGraphics? > > I don't think so, the patch just worked for me. > > Best, Arash > > Alan Third writes: > > >> +#ifdef NS_IMPL_COCOA > >> +/* Returns a cached CGImageMask of the stipple pattern */ > >> +- (CGImageRef)stippleMask > >> +{ > >> + if (stippleMask == nil) { > >> + CGDataProviderRef provider = CGDataProviderCreateWithData (NULL, > [bmRep bitmapData], > >> + [self > sizeInBytes], NULL); > >> + CGImageRef mask = CGImageMaskCreate( > >> + [self size].width, > >> + [self size].height, > >> + 8, 8, [self size].width, > >> + provider, NULL, 0); > > > > There's some weird formatting in this patch. Some of it looks like > > it's perhaps due to email, but other bits, like the above, just look > > wrong. > > > > Other things I've noticed include C++ comments, //, instead of C > > comments, /* */. Large blocks of code with no whitespace that is a bit > > hard to follow. It would be nicer if it was broken up into logical > > blocks. > > > > > >> + r = NSMakeRect (s->x, s->y + box_line_width, > >> + s->background_width, > >> + s->height - 2 * box_line_width); > > > >> + NSRectFill (r); > >> + s->background_filled_p = 1; > >> + CGImageRef mask = [dpyinfo->bitmaps[face->stipple - 1].img > stippleMask]; > >> + CGRect bounds = CGRectMake (s->x, s->y + box_line_width, > >> + s->background_width, > >> + s->height - 2 * box_line_width); > > > > NSRect and CGRect are the same thing, so here "r" and "bounds" are > > identical. It might be worth just having one variable. > > > >> + else if (s->stippled_p) { > > > > Opening braces go on new lines. > > > > Really that's it, Just some polishing required and a proper commit > > message. Otherwise it looks OK to me. > > > > I take it this doesn't require the addition of any extra build flags > > to bring in CoreGraphics? > --0000000000005ee812062afa5e52 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all, I've revised my patch from Alan's feedback= .
You can find it attached.

On Sat, 4 Jan 20= 25 at 09:49, Arash Esbati <arash@gnu.or= g> wrote:
Many thanks for your comments Alan.=C2=A0 Since I'm only the messenger= here,
I'm kindly asking Ben if he can incorporate your comments and post a ne= w
patch.

Reg. your question:

> I take it this doesn't require the addition of any extra build fla= gs
> to bring in CoreGraphics?

I don't think so, the patch just worked for me.

Best, Arash

Alan Third <alan@id= iocy.org> writes:

>> +#ifdef NS_IMPL_COCOA
>> +/* Returns a cached CGImageMask of the stipple pattern */
>> +- (CGImageRef)stippleMask
>> +{
>> +=C2=A0 if (stippleMask =3D=3D nil) {
>> +=C2=A0 =C2=A0 CGDataProviderRef provider =3D CGDataProviderCreate= WithData (NULL, [bmRep bitmapData],
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0[self sizeInBytes], NULL);
>> +=C2=A0 =C2=A0 CGImageRef mask =3D CGImageMaskCreate(
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 [self size].width,
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 [self size].height,
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 8, 8, [self size].width,
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 provider, NULL, 0);
>
> There's some weird formatting in this patch. Some of it looks like=
> it's perhaps due to email, but other bits, like the above, just lo= ok
> wrong.
>
> Other things I've noticed include C++ comments, //, instead of C > comments, /* */. Large blocks of code with no whitespace that is a bit=
> hard to follow. It would be nicer if it was broken up into logical
> blocks.
>
>
>> +=C2=A0 =C2=A0 r =3D NSMakeRect (s->x, s->y + box_line_width= ,
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 s->background_width,
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 s->height - 2 * box_line_width); > <snip>
>> +=C2=A0 =C2=A0 NSRectFill (r);
>> +=C2=A0 =C2=A0 s->background_filled_p =3D 1;
>> +=C2=A0 =C2=A0 CGImageRef mask =3D [dpyinfo->bitmaps[face->s= tipple - 1].img stippleMask];
>> +=C2=A0 =C2=A0 CGRect bounds =3D CGRectMake (s->x, s->y + bo= x_line_width,
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 s->background_width,
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 s->height - 2 * box_line_width); >
> NSRect and CGRect are the same thing, so here "r" and "= bounds" are
> identical. It might be worth just having one variable.
>
>> +=C2=A0 =C2=A0 =C2=A0 else if (s->stippled_p) {
>
> Opening braces go on new lines.
>
> Really that's it, Just some polishing required and a proper commit=
> message. Otherwise it looks OK to me.
>
> I take it this doesn't require the addition of any extra build fla= gs
> to bring in CoreGraphics?
--0000000000005ee812062afa5e52-- --0000000000005ee814062afa5e54 Content-Type: application/octet-stream; name="0001-Support-coloured-stipples-on-Cocoa-NS.patch" Content-Disposition: attachment; filename="0001-Support-coloured-stipples-on-Cocoa-NS.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_m5jzw0x40 RnJvbSA1MzhiNDQ0NDI3ZDg0N2U4OGI3MTMzNzY2Y2YxZWRlZmMxNTkyMzMxIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBCZW4gU2ltbXMgPGJlbkBiZW5zaW1tcy5tb2U+CkRhdGU6IFN1 biwgNSBKYW4gMjAyNSAyMDowMzo1MyArMDEwMApTdWJqZWN0OiBbUEFUQ0hdIFN1cHBvcnQgY29s b3VyZWQgc3RpcHBsZXMgb24gQ29jb2EgTlMKCk9uIENvY29hIGJ1aWxkcyBvZiBOUyBFbWFjcywg c3RpcHBsZXMgYXJlIHJlbmRlcmVkIHVzaW5nIG1hc2tlZCBDR0ltYWdlcwppbnN0ZWFkIG9mIHBh dHRlcm5lZCBOU0NvbG9ycywgd2hpY2ggaGF2ZSBubyBzdXBwb3J0IGZvciBiZWluZyB1c2VkIGFz IGEKbWFzayBmb3IgdGhlIGZvcmVncm91bmQgY29sb3Vycy4gTlMgRW1hY3MgY2FuIG5vdyByZW5k ZXIgc3RpcHBsZXMgd2l0aApjb2xvdXJzIGEgbGEgb3RoZXIgYnVpbGRzIG9mIGVtYWNzLgotLS0K IHNyYy9uc2ltYWdlLm0gfCAzMSArKysrKysrKysrKysrKysrKysrKysrKwogc3JjL25zdGVybS5o ICB8ICA4ICsrKysrKwogc3JjL25zdGVybS5tICB8IDY4ICsrKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrKysrKysrKysrLQogMyBmaWxl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CisJICAgICAg LyogU3RhbXAgdGhlIGZvcmVncm91bmQgY29sb3VyIHVzaW5nIHRoZSBzdGlwcGxlIG1hc2sgKi8K KwkgICAgICBbW05TQ29sb3IgY29sb3JXaXRoVW5zaWduZWRMb25nOnMtPmZhY2UtPmZvcmVncm91 bmRdIHNldF07CisJICAgICAgQ0dSZWN0IGltYWdlU2l6ZSA9IENHUmVjdE1ha2UgKDAsIDAsIENH SW1hZ2VHZXRXaWR0aCAobWFzayksCisJCQkJCSAgICAgQ0dJbWFnZUdldEhlaWdodCAobWFzaykp OworCSAgICAgIENHQ29udGV4dERyYXdUaWxlZEltYWdlIChjb250ZXh0LCBpbWFnZVNpemUsIG1h c2spOworCSAgICAgIFtbTlNHcmFwaGljc0NvbnRleHQgY3VycmVudENvbnRleHRdIHJlc3RvcmVH cmFwaGljc1N0YXRlXTsKKyNlbHNlCisJICAgICAgW1tkcHlpbmZvLT5iaXRtYXBzW3MtPmZhY2Ut PnN0aXBwbGUgLSAxXS5pbWcgc3RpcHBsZU1hc2tdIHNldF07CisjZW5kaWYgLyogTlNfSU1QTF9D T0NPQSAqLworCSAgICB9CiAJICBlbHNlCiAJICAgIFtbTlNDb2xvciBjb2xvcldpdGhVbnNpZ25l ZExvbmc6IHMtPmZhY2UtPmJhY2tncm91bmRdIHNldF07CiAKLS0gCjIuNDcuMAoK --0000000000005ee814062afa5e54--