From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from tb-mx1.topicbox.com (localhost.local [127.0.0.1]) by tb-mx1.topicbox.com (Postfix) with ESMTP id 47E021E05C5D for <9fans@9fans.net>; Sun, 5 Apr 2020 00:15:46 -0400 (EDT) (envelope-from fshahriar@gmail.com) Received: from tb-mx1.topicbox.com (localhost [127.0.0.1]) by tb-mx1.topicbox.com (Authentication Milter) with ESMTP id 461A638C5B9; Sun, 5 Apr 2020 00:15:46 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1586060146; b=uu75Ufp5gCv1yUlM1RsNzOVgNIerGhFLdw6e+2+EZ5b3uBZjLL 1DMxp4WNOHmzyJcdji4MSa+KsCgxf6I5yhfkJc7YHZw0n2/iwS50FbvA2noLtcxB i2qbXsCXXKI5UinSvwj42nmcX3e2PA0STS+0z8sUurPkf8kbQwInV2ZXn9QnDOl4 /gpFqwCSmwRurHQD8VdWkPJQlWC7oFWR5mLWfrlUDD6VeZm8EhYibe+ghFLOaIPm 0Cf4UNYtim84YCq43WA1d2zfx4NMMDB5MV/liibJmCeK21SB0nvocs4OrDPIBZXw ILplJCJRKgGz55UUpQEJdXtwPNgvpsbBIotw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type; s=arcseal; t=1586060146; bh=jvvFcV3yu9+lVG11DpGAfn9GOFaqoJwAUSxVkM/xmMc=; b=opYgQMC8gbru vUJKwXhUXhjw0ZSCtAgeAhRA3F6fLj9g3afcLU47VEUE01uMH6cnQP4WCVFZzSlp 4Nx5919dBqwjsYmvLa/HJcMM+QnnWDHOYOJtjAa8p6b5DziYvB5kzgCIb8pdWwUq VDXLBv4C9AVk59rlCxY7PGdEFT3rMFrrikkjL0ldjRQE17seJApNS9dRP3i+IPuA thtq9dSJhpCuDjMVNtdKLso0cQG6xZeX1wyH/Y6xu67bu8d68UlxbUQA1jRAq6KY yACu5XfP75ioOLkM6fbIfTs2clQZ2YkzKo8iXAEHewQIy4aWCbnbE+1RwjEpKhh+ h847NkPiHQ== ARC-Authentication-Results: i=1; tb-mx1.topicbox.com; arc=none (no signatures found); bimi=none (Domain is not BIMI enabled); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=sMtBmEx9 header.a=rsa-sha256 header.s=20161025 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.210.49 (mail-ot1-f49.google.com); spf=pass smtp.mailfrom=fshahriar@gmail.com smtp.helo=mail-ot1-f49.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=aunZmrzt; x-ptr=pass smtp.helo=mail-ot1-f49.google.com policy.ptr=mail-ot1-f49.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: alt2.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: alt2.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 Authentication-Results: tb-mx1.topicbox.com; arc=none (no signatures found); bimi=none (Domain is not BIMI enabled); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=sMtBmEx9 header.a=rsa-sha256 header.s=20161025 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.210.49 (mail-ot1-f49.google.com); spf=pass smtp.mailfrom=fshahriar@gmail.com smtp.helo=mail-ot1-f49.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=aunZmrzt; x-ptr=pass smtp.helo=mail-ot1-f49.google.com policy.ptr=mail-ot1-f49.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: alt2.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: alt2.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgeduhedrtdelgdekudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepgghfjgfhff fkuffvtgesrgdtreertddtjeenucfhrhhomhephfgriihluhhlucfuhhgrhhhrihgrrhcu oehfshhhrghhrhhirghrsehgmhgrihhlrdgtohhmqeenucffohhmrghinheplehfrghnsh drnhgvthdpghhithhhuhgsrdgtohhmpdhgohhlrghnghdrohhrghdptggrthdqvhdrohhr ghdpthhophhitggsohigrdgtohhmnecukfhppedvtdelrdekhedrvddutddrgeelnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddtledrkeehrddvuddt rdegledphhgvlhhopehmrghilhdqohhtuddqfhegledrghhoohhglhgvrdgtohhmpdhmrg hilhhfrhhomhepoehfshhhrghhrhhirghrsehgmhgrihhlrdgtohhmqecuuffkkgfgpeej leekje X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (gmail.com ... _spf.google.com: Sender is authorized to use 'fshahriar@gmail.com' in 'mfrom' identity (mechanism 'include:_netblocks.google.com' matched)) receiver=tb-mx1.topicbox.com; identity=mailfrom; envelope-from="fshahriar@gmail.com"; helo=mail-ot1-f49.google.com; client-ip=209.85.210.49 Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx1.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Sun, 5 Apr 2020 00:15:45 -0400 (EDT) (envelope-from fshahriar@gmail.com) Received: by mail-ot1-f49.google.com with SMTP id t28so11806262ott.5 for <9fans@9fans.net>; Sat, 04 Apr 2020 21:15:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=jvvFcV3yu9+lVG11DpGAfn9GOFaqoJwAUSxVkM/xmMc=; b=sMtBmEx91Mnutq8hMkC6/ObZBHLoYBdpnUgBnu9bq/lk+cDCu0g7ljRDpKDzAPjrhy 8HQdNpL+QxeUdKtDi7oXW6GWAwtQ+IRZfR4ke75PSLuu1PJK6He43B2dcQrKDNeII0fr AC3sdJrqdwA/Fmz6beH+6Ee4Gsp9RrNOZVAlrOHqfYNN2b7Z0uWUM5bsaaEvsGGMGXU7 2MMb/sOONInRMZu3djGfEswEzi24sRfyfkrgZrhXSryBJh62mxHBiHAiE6GzYCrZRbGp NImtDR0b8R7Nbgf7whIftq4TY8alvTTrVl3F6ezTAUHpozaox+Du92cbaFRsXMV9A6S3 e6Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=jvvFcV3yu9+lVG11DpGAfn9GOFaqoJwAUSxVkM/xmMc=; b=aunZmrztjuR/7xWA7fCXpbEXu+AvbCknT9FzNJYWEZYrwEAjyYiYX84HMCfW//Iewn 1P62qGAtNdk8PElM9GS5QxKuJQBxi0C31kwJMdZzGaYPXd0xTNGF+yh9xQN5yYfmhgLa cBj7pNParp0QLv6Biq1S0nhQdqLZeKareDtukzx7H9xqaB93GvSX+u8P31V0T8YzrkCE s4ooUNFnVsNztzOgkw3N8rhQSw0UG8Jcs+K6hja/fXcMeBMEJ3PAra8pgfivW4GKo16W s3goivSv5w++gKT+AFjnLLLruYUlQBpW+1NTdHwvFqg/0IuIVTK4gPHPxkJkB07FRjxM DSkw== X-Gm-Message-State: AGi0PuZoIPz27i0ibhjqcfMG6+SqnQA96kWEBgESycte+MWV5spuGd92 8xben2vQ0DSf4Zz3LKbr+ikZFIVgcPAXYvNvk3sOh2TnLqk= X-Google-Smtp-Source: APiQypLGf2dE7D5l2CRa1hs8mykD3xdThV6RcAZjJPVA2DXHUf1uyaX31nhnr6S/FII+eNMufLtMEmIInqc4jAQLMto= X-Received: by 2002:a9d:7f05:: with SMTP id j5mr12909100otq.312.1586060144867; Sat, 04 Apr 2020 21:15:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Fazlul Shahriar Date: Sun, 5 Apr 2020 00:15:34 -0400 Message-ID: Subject: Re: [9fans] a simple graphical application in Go? To: 9fans <9fans@9fans.net> Content-Type: multipart/alternative; boundary="00000000000086fd7805a2836780" Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 2293b3b2-76f4-11ea-ba3f-8bcd2c3817b8 --00000000000086fd7805a2836780 Content-Type: text/plain; charset="UTF-8" There is a PR open with Plan 9 devdraw support to 9fans.net/go/draw: https://github.com/9fans/go/pull/28 It at least works with the Go acme port Edwood last I tested. On Sat, Apr 4, 2020 at 4:33 PM Jeremy Jackins wrote: > Well, you need a Go draw package in place of the C library. There is a > draw package in github.com/9fans/go/ but unfortunately I think it only > supports plan9port devdraw, rather than the native Plan 9 draw device. > So there is some library work to be done first. Since the Go standard > library also contains the most important drawing primitives > implemented by the Plan 9 draw device (with the exception of font > rendering, but there is golang.org/x/image/font), you may be able to > ignore a lot of functionality provided by the Plan 9 draw library and > focus on a few things like loading pixel data directly to the draw > device. > > See: http://man.cat-v.org/plan_9/3/draw > > Jeremy > > On Sat, 4 Apr 2020 at 06:55, Kim Lassila wrote: > > > > Has anyone written a graphical application in Go on Plan 9? How would > the Go equivalent of black.c (thank you fgb) look like? > > > > - - - clip - - - > > > > #include > > #include > > #include > > > > void > > main(int, char *argv[]) > > { > > Rectangle rect; > > Image *black; > > > > fmtinstall('R', Rfmt); > > if(initdraw(nil, nil, argv[0]) < 0) > > sysfatal("initdraw: %r"); > > rect = screen->r; > > black = display->black; > > draw(screen, rect, black, nil, ZP); > > flushimage(display, 1); > > sleep(5 * 1000); > > closedisplay(display); > > print("rectangle was %R\n", rect); > > exits(nil); > > } > > > > 9fans / 9fans / see discussions + participants + delivery options > Permalink > > ------------------------------------------ > 9fans: 9fans > Permalink: > https://9fans.topicbox.com/groups/9fans/T0d490c91935dc74b-M08178595d1453fd46812690c > Delivery options: https://9fans.topicbox.com/groups/9fans/subscription > --00000000000086fd7805a2836780 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
There is a PR open with Plan 9 devdraw support to 9fans.net/go/draw:=C2=A0https://github.com/9fans/go/pull/28
= It at least works with the Go acme port Edwood=C2=A0last I tested.

On = Sat, Apr 4, 2020 at 4:33 PM Jeremy Jackins <jeremyjackins@gmail.com> wrote:
Well, you need a Go draw package in p= lace of the C library. There is a
draw package in github.com/9fans/go/ but unfortunately I think it onl= y
supports plan9port devdraw, rather than the native Plan 9 draw device.
So there is some library work to be done first. Since the Go standard
library also contains the most important drawing primitives
implemented by the Plan 9 draw device (with the exception of font
rendering, but there is golang.org/x/image/font), you may be able = to
ignore a lot of functionality provided by the Plan 9 draw library and
focus on a few things like loading pixel data directly to the draw
device.

See: http://man.cat-v.org/plan_9/3/draw

Jeremy

On Sat, 4 Apr 2020 at 06:55, Kim Lassila <kim.lassila@gmail.com> wrote:
>
> Has anyone written a graphical application in Go on Plan 9? How would = the Go equivalent of black.c (thank you fgb) look like?
>
> - - - clip - - -
>
> #include <u.h>
> #include <libc.h>
> #include <draw.h>
>
> void
> main(int, char *argv[])
> {
> Rectangle rect;
> Image *black;
>
> fmtinstall('R', Rfmt);
> if(initdraw(nil, nil, argv[0]) < 0)
> sysfatal("initdraw: %r");
> rect =3D screen->r;
> black =3D display->black;
> draw(screen, rect, black, nil, ZP);
> flushimage(display, 1);
> sleep(5 * 1000);
> closedisplay(display);
> print("rectangle was %R\n", rect);
> exits(nil);
> }
>
> 9fans / 9fans / see discussions + participants + delivery options Perm= alink

------------------------------------------
9fans: 9fans
Permalink: https:= //9fans.topicbox.com/groups/9fans/T0d490c91935dc74b-M08178595d1453fd4681269= 0c
Delivery options: https://9fans.topicbox.com/gro= ups/9fans/subscription
--00000000000086fd7805a2836780--