9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] oneko for rio
@ 2001-05-07  8:25 okamoto
  0 siblings, 0 replies; 11+ messages in thread
From: okamoto @ 2001-05-07  8:25 UTC (permalink / raw)
  To: 9fans

>By the way, can somebody provide a set of Glenda bitmap?

Are you going to make jglenda? :-)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] oneko for rio
  2001-04-27 16:32 ` Douglas A. Gwyn
@ 2001-05-07  7:05   ` YAMANASHI Takeshi
  0 siblings, 0 replies; 11+ messages in thread
From: YAMANASHI Takeshi @ 2001-05-07  7:05 UTC (permalink / raw)
  To: 9fans

Hi.

As my first try, I made `jneko', a cat runs in a window (jail)
chasing the mouse cursor.  The cat can't run out of the window,
but at least, you can see whether the bitmaps are clever or not.

% hget http://bata.cc.titech.ac.jp/uncover/liking/plan9/oneko.tgz | gunzip | tar x
% cd oneko; mk jneko.install
% bind -a face /lib/face; jneko


boyd>
> gotta be easier than in X11.

I agree. Writing `jneko' was far easier than X11.
But beyond removing the jail, I might see in time.

By the way, can somebody provide a set of Glenda bitmap?
-- 
YAMANASHI Takeshi


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] oneko for rio
  2001-04-27 13:42 rob pike
@ 2001-04-27 16:32 ` Douglas A. Gwyn
  2001-05-07  7:05   ` YAMANASHI Takeshi
  0 siblings, 1 reply; 11+ messages in thread
From: Douglas A. Gwyn @ 2001-04-27 16:32 UTC (permalink / raw)
  To: 9fans

rob pike wrote:
> The mouse position is always in absolute coordinates unless
> the user program does extra work.

As you can tell I haven't yet tried graphics programming
on Plan 9, apart from the patches to "vt" and "sam" where
somebody else had already done the hard part.

I suppose that window coordinates must also be absolute;
presumably in order to avoid having to intercept data and
add offsets.  This fortunately simplifies the subject task.
The only thing missing seems to be writability of /dev/screen.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] oneko for rio
@ 2001-04-27 13:42 rob pike
  2001-04-27 16:32 ` Douglas A. Gwyn
  0 siblings, 1 reply; 11+ messages in thread
From: rob pike @ 2001-04-27 13:42 UTC (permalink / raw)
  To: 9fans

	Or, anyone want to change line 31 of
	/sys/src/cmd/rio/fsys.c to
		{ "screen",	Qscreen,	0600 ),
	and try the experiment?

It takes more than a chmod of a file to implement a driver.  /dev/screen
is provided by rio; the write interface to the underlying /dev/draw is
provided through an RPC protocol, not direct data writes, which don't
match well to the 2-d quality of the data.  /dev/screen could in principle
be writable but it will take changes to a lot more than line 31.

	The absolute mouse position would be
	determinable by adding the local position to the difference
	in LLCs of /dev/screen and /dev/window;

False.  The mouse position is always in absolute coordinates unless
the user program does extra work.

And as for the return value of main: enough already!  The subject
isn't worth all this clutter in our mailboxes.

-rob



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] oneko for rio
  2001-04-26  9:57 rob pike
  2001-04-26 13:19 ` Boyd Roberts
@ 2001-04-27  9:10 ` Douglas A. Gwyn
  1 sibling, 0 replies; 11+ messages in thread
From: Douglas A. Gwyn @ 2001-04-27  9:10 UTC (permalink / raw)
  To: 9fans

rob pike wrote:
> I agree.  I think I could probably puzzle out a way to implement
> oneko but it will not be easy, to put it mildly.

Similar apps on the DMD/MTG were able to use the full-display
Bitmap data structure (named "display"), also Smouse/RealMouse
for the full-display mouse cursor location.  Since the draw(3)
device interposes a file system between any (sub)window and the
root bitmap (background/desktop), there is no direct path for a
(sub)window process to access its containing window, and
furthermore, rio(1) is not in a position to intervene.

However, it would appear that all that is needed for this kind
of app is for /dev/screen to be writable (it is read-only for
some reason I don't understand).  Perhaps /dev/screen can
support chmod so even if it is provided to the process in a
read-only state that could be changed and then top-level
drawing could be done.  Or, anyone want to change line 31 of
/sys/src/cmd/rio/fsys.c to
	{ "screen",	Qscreen,	0600 ),
and try the experiment?  The absolute mouse position would be
determinable by adding the local position to the difference
in LLCs of /dev/screen and /dev/window; I don't know whether
the mouse position is allowed to be reported as negative, but
it should be.  (Some apps might then have to start checking,
but I suspect most would be okay.)

I have DMD/MTG source for eyes, swarm, and crabs if anyone
wants to try porting them.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] oneko for rio
  2001-04-26 13:19 ` Boyd Roberts
@ 2001-04-27  7:28   ` YAMANASHI Takeshi
  0 siblings, 0 replies; 11+ messages in thread
From: YAMANASHI Takeshi @ 2001-04-27  7:28 UTC (permalink / raw)
  To: 9fans

> i had an idea to get oneko to run rio or namespace
> trikery to get the mouse events and then pass them
> on to rio.

Ok.  I will start with `pipefile' and `tee'-like program
to provide /dev/^(mouse mouse2).  Thank you.
--
YAMANASHI Takeshi


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] oneko for rio
  2001-04-26  9:57 rob pike
@ 2001-04-26 13:19 ` Boyd Roberts
  2001-04-27  7:28   ` YAMANASHI Takeshi
  2001-04-27  9:10 ` Douglas A. Gwyn
  1 sibling, 1 reply; 11+ messages in thread
From: Boyd Roberts @ 2001-04-26 13:19 UTC (permalink / raw)
  To: 9fans

i had an idea to get oneko to run rio or namespace
trikery to get the mouse events and then pass them
on to rio.

gotta be easier than in X11.

IIRC the bitmaps are very clever.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] oneko for rio
@ 2001-04-26 10:02 rog
  0 siblings, 0 replies; 11+ messages in thread
From: rog @ 2001-04-26 10:02 UTC (permalink / raw)
  To: 9fans

> on plan 9 this should be trivial (read 'hello world').

actually, i doubt if it would be so entirely trivial, as it's not that
easy to get the current position of the mouse cursor outside the
current window.  you could get around this by writing a little file
server (easiest using lib9p) that serves not only /dev/mouse, but
/dev/mouse2 as well; it would have to be run before rio (or run rio
inside a rio window)

then oneko would be able to get the current mouse position from
/dev/mouse2, despite the fact that rio had covered up /dev/mouse with
its own version. window position information is trivially found
in /dev/wsys/*/wctl

maybe i'm missing something.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] oneko for rio
@ 2001-04-26  9:57 rob pike
  2001-04-26 13:19 ` Boyd Roberts
  2001-04-27  9:10 ` Douglas A. Gwyn
  0 siblings, 2 replies; 11+ messages in thread
From: rob pike @ 2001-04-26  9:57 UTC (permalink / raw)
  To: 9fans

I agree.  I think I could probably puzzle out a way to implement
oneko but it will not be easy, to put it mildly.

-rob



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] oneko for rio
  2001-04-26  8:30 YAMANASHI Takeshi
@ 2001-04-26  9:28 ` Boyd Roberts
  0 siblings, 0 replies; 11+ messages in thread
From: Boyd Roberts @ 2001-04-26  9:28 UTC (permalink / raw)
  To: 9fans

> I feel like porting a fun X11 application called `oneko'.
> Executing oneko, a kitten appears on the screen and
> chases the mouse cursor running all over windows.

IIRC it's trivial.  the cat ['neko' and the 'o' honorific
has to be a joke:  "it's better than a cat"] is cleverly
constructed out of 8-16? bitmaps.  so all you gotta do is take
the bitmaps and write a bit of code to blit them at the right
time.

on plan 9 this should be trivial (read 'hello world').  on
X11 oneko is a huge chunk of code, just to do a few bit blits.

btw: it's better than a cat = it's better than nothing.

     demo, gaijin da kara, wakaranai




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [9fans] oneko for rio
@ 2001-04-26  8:30 YAMANASHI Takeshi
  2001-04-26  9:28 ` Boyd Roberts
  0 siblings, 1 reply; 11+ messages in thread
From: YAMANASHI Takeshi @ 2001-04-26  8:30 UTC (permalink / raw)
  To: 9fans

Hi.

I feel like porting a fun X11 application called `oneko'.
Executing oneko, a kitten appears on the screen and
chases the mouse cursor running all over windows.

How can I do this for rio?  Any pointer or suggestion
on implementation is great.

Thank you.
--
YAMANASHI Takeshi


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2001-05-07  8:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-07  8:25 [9fans] oneko for rio okamoto
  -- strict thread matches above, loose matches on Subject: below --
2001-04-27 13:42 rob pike
2001-04-27 16:32 ` Douglas A. Gwyn
2001-05-07  7:05   ` YAMANASHI Takeshi
2001-04-26 10:02 rog
2001-04-26  9:57 rob pike
2001-04-26 13:19 ` Boyd Roberts
2001-04-27  7:28   ` YAMANASHI Takeshi
2001-04-27  9:10 ` Douglas A. Gwyn
2001-04-26  8:30 YAMANASHI Takeshi
2001-04-26  9:28 ` Boyd Roberts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).