From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from tb-mx0.topicbox.com (localhost.local [127.0.0.1]) by tb-mx0.topicbox.com (Postfix) with ESMTP id 770CD1FF3A6C for <9fans@9fans.net>; Sat, 4 Apr 2020 17:50:38 -0400 (EDT) (envelope-from skip.tavakkolian@gmail.com) Received: from tb-mx0.topicbox.com (localhost [127.0.0.1]) by tb-mx0.topicbox.com (Authentication Milter) with ESMTP id 9660D496FDA; Sat, 4 Apr 2020 17:50:38 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1586037038; b=hk+PIHary9MDdgcwqTG+TSJXzwOvd2EZsCACVDvyWACcpXMEUA HXeL3wWa/dASeUAxOe/VOkN/zxh6uz3VxB5IKxrVdmCD2QAAoHTGRU12nJDYuuDY Y+rUD9v8V0y/IErfB5kgIkuDITXVN+uP2Fg+jIyIWPmvfinqQY5M7gPTrK1/Pfwx dutYb7d2K3Fg/3zDo/shDD7FSkoKNyLEfi9wyGwDD+HEcaCVvQy/pdGfmxfPyNTt BwYWpR9U+lDsEzWv8d/W8XPgU+MIY4P5g/TL5GBhQtWcy5/MpuKPOOa2TPXyRHHF YwrqDjH0UsjfV13GQsMuUWd0AqaPJvscOllA== 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=1586037038; bh=blD+bwLuIMTMi/yIeZE0/390GlJOax78Fo/UF7XnX74=; b=eUPDlFPx6bHd To7nq6hQJM/bBMPz7b8o9TclEOXA/K5W4adBCo8/6hJbu6LmCEw7zHkKWMnGn9jh mPAb197DWCpNi4Ot69TfAaZSrF/Ty1AvoFSX8eMbAmw/m/wsSQFKF/YkHz40sNcf zUpyYBHI3F0KcV0QRmhi8tkj6c6yTgn6m//szoUKr0rIgkQZ7omt7hcSt+SoyUkx vjpXzQmm0r9XOwDZ/CFzO4ZzoF0mO7F68Lfx+6cB0wvl1SjM5vKyu6YrqEBjHZW2 GtYEJxEf1M0gv7Y9dZYgRIO6j3JshH0hB8yDrHj4C1RqvsLrWbKNn6DUwW3854DY x9JHsZUtdA== ARC-Authentication-Results: i=1; tb-mx0.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=I6GUiv+E 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.221.173 (mail-vk1-f173.google.com); spf=pass smtp.mailfrom=skip.tavakkolian@gmail.com smtp.helo=mail-vk1-f173.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=MluSmO1M; x-ptr=pass smtp.helo=mail-vk1-f173.google.com policy.ptr=mail-vk1-f173.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: alt1.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: alt1.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt2.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-mx0.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=I6GUiv+E 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.221.173 (mail-vk1-f173.google.com); spf=pass smtp.mailfrom=skip.tavakkolian@gmail.com smtp.helo=mail-vk1-f173.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=MluSmO1M; x-ptr=pass smtp.helo=mail-vk1-f173.google.com policy.ptr=mail-vk1-f173.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: alt1.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: alt1.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt2.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: gggruggvucftvghtrhhoucdtuddrgeduhedrtdelgddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepgghfjgfhff fkuffvtgesrgdtreertddtjeenucfhrhhomhepufhkihhpucfvrghvrghkkhholhhirghn uceoshhkihhprdhtrghvrghkkhholhhirghnsehgmhgrihhlrdgtohhmqeenucffohhmrg hinhepghhithhhuhgsrdgtohhmpdhgohhlrghnghdrohhrghdptggrthdqvhdrohhrghdp thhophhitggsohigrdgtohhmnecukfhppedvtdelrdekhedrvddvuddrudejfeenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvtdelrdekhedrvddvuddr udejfedphhgvlhhopehmrghilhdqvhhkuddqfhdujeefrdhgohhoghhlvgdrtghomhdpmh grihhlfhhrohhmpeeoshhkihhprdhtrghvrghkkhholhhirghnsehgmhgrihhlrdgtohhm qecuuffkkgfgpeektddtge X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (gmail.com ... _spf.google.com: Sender is authorized to use 'skip.tavakkolian@gmail.com' in 'mfrom' identity (mechanism 'include:_netblocks.google.com' matched)) receiver=tb-mx0.topicbox.com; identity=mailfrom; envelope-from="skip.tavakkolian@gmail.com"; helo=mail-vk1-f173.google.com; client-ip=209.85.221.173 Received: from mail-vk1-f173.google.com (mail-vk1-f173.google.com [209.85.221.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx0.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Sat, 4 Apr 2020 17:50:38 -0400 (EDT) (envelope-from skip.tavakkolian@gmail.com) Received: by mail-vk1-f173.google.com with SMTP id s139so2964842vka.13 for <9fans@9fans.net>; Sat, 04 Apr 2020 14:50:38 -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=blD+bwLuIMTMi/yIeZE0/390GlJOax78Fo/UF7XnX74=; b=I6GUiv+ESGdnOMEkS3HzDSO+kAvOZRypwBXiqImU9tpZXq3W7e2Huy8sZeT4CW8dD3 Pu3OPG7CBG1yUO/dAa5hGo1/eVDOhhlOoFYX2bHVgjp77uolNicnE8MV+1/e4Mxc6UvC CjgcIFFhMPqgzdikUWGRloYAXMq6CAoE/IvkLXvM/Vd7zUXPBGxBF2gp7h3Lnk8gABZf Lx/4arlfKw5ugnjuOcZKZgusSu1dm/n6qo1ra1Wp+NcNst+pFNMNwLc1s+awjUzvs2h6 lZQ688FmNEMeIWL96vTLBihYxZ9Qk0mAvLh8fjI6opr5zKK1n4T1NXPRz7KzhRkvG7tz zuvA== 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=blD+bwLuIMTMi/yIeZE0/390GlJOax78Fo/UF7XnX74=; b=MluSmO1MRXUnj0QBpRt0fULyOeOIHmXqfHdukEUkZNXdegLgwNs9aaDSTLVrutNUgt WJC7ttUZlWqwkTkjA3K6SEK+DYDAKt/99d4q2Cu8dkOC+8cbtleC7luRZ34E5ySIkoD/ sEBR4AC1nMunX+OdROWMR/Y+w8T+RO0WhZxY9Wd5Qn7qVOFeXzT0uT07sL5cCm+upeau R/zYvR0UZHy2lyYzgJNi7EAltGPPlLYQYEixbUjLXwfExu6hrRvh3QNNhoh7pI+ZmTY1 yKqjmisf2/8x+Eg1WD5OkVfudgelDlkg/k9xoWJ818PlTgZ27GnNvLb4gUW+Iq0yrsDG bLxw== X-Gm-Message-State: AGi0PuYP9zSkdEpkfeMXKrdafpwVNpRfFbENC8b8ofxs4JBMB1NeLeBd h/Hoy9+7jVt1Utk0IJsgUpdEovql7xLy/Z/5gpaUqX+3 X-Google-Smtp-Source: APiQypKM493eV0sTXPmqRHusWZtCZuUYx3iLsQl55jIlI7vkmh4mx2Zchp/PWivW03fia6Y84lduZRKncBFeRyKCVHs= X-Received: by 2002:ac5:cd32:: with SMTP id a18mr11040955vkm.90.1586037037363; Sat, 04 Apr 2020 14:50:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Skip Tavakkolian Date: Sat, 4 Apr 2020 14:50:18 -0700 Message-ID: Subject: Re: [9fans] a simple graphical application in Go? To: 9fans <9fans@9fans.net> Content-Type: multipart/alternative; boundary="0000000000003674eb05a27e06b2" Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 54b18cf6-76be-11ea-b437-c8c444dccc1e --0000000000003674eb05a27e06b2 Content-Type: text/plain; charset="UTF-8" I think that's the right place to start. I've not looked closely, but it looks like the only thing that you'd need to do for a client library is to change drawfcall/mux.go:New to use the draw service posted on /srv. On Sat, Apr 4, 2020 at 1:34 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 > --0000000000003674eb05a27e06b2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think that's the right place to start.=C2=A0 I'v= e not looked closely, but it looks like the only thing that you'd need = to do for a client library is to
change drawfcall/mux.go:New to use the= draw service posted on /srv.

On Sat, Apr 4, 2020 at 1:34 PM Jeremy Ja= ckins <jeremyjackins@gmail.co= m> 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 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
--0000000000003674eb05a27e06b2--