New userland app: Viewer

Posted by: jheathco

New userland app: Viewer - 07/03/2002 00:19

Alright, this is the only time I'm gonna release this personally, but feel free to make any changes to the source that I'm posting as well.. I just don't have any time to do any more work on it... anyways...

Viewer - this userland app allows you to display the contents of files in a specific directory. I made this for things like directions, etc. If you get directions from mapquest, you can save them to a file, upload it via ftp (with hijack), and then view them while your driving. Scrolling is done with the volume buttons on the remote or with the rotary knob.

Anyways, more info and directions for installation are at the top of the sourcefile at http://www.heathcosoft.com/empeg/viewer.c. The binary is at http://www.heathcosoft.com/empeg/viewer.

I'm using Bitt Faulk's preinit.d binary to start it up, and my init script that you can use to start up the viewer at boot is at http://www.heathcosoft.com/empeg/viewerinit.

Posted by: justinlarsen

Re: New userland app: Viewer - 07/03/2002 03:14

can i bind it to the hijack menu?
Posted by: mtempsch

Re: New userland app: Viewer - 07/03/2002 04:32

According to the top of the .c file it already binds to Hijack menus as "Viewer"
(haven't had time to play with it yet)

/Michael
Posted by: mlord

Re: New userland app: Viewer - 07/03/2002 07:39

This looks cool. Does it work on the /proc files? Tried it?

Cheers
Posted by: genixia

Re: New userland app: Viewer - 07/03/2002 07:54

This looks really cool. And it's a great example of how to use the Hijack ioctls in userapps, which for us newbie C hackers is going to be very useful.

I'm going to have to install this one
Posted by: peterk

Re: New userland app: Viewer - 07/03/2002 10:38

Nice app John.
I'm going to have fun with this one

PeterK
Posted by: jheathco

Re: New userland app: Viewer - 07/03/2002 12:08

Right now it doesn't read from the /proc files but that seems like it could be relatively easy to do. I would have to modify a bit though. Right now, it reads up to 10k from a maximum of 10 files in /empeg/bin/viewer/data, so if you had 10 big files, it would eat 100k of memory (I don't think that's a lot, or are we really that hogged)?

Also, before I had it so when you scroll, it goes to the next visible line, but I was having a bit of trouble with that as I had to calculate the width of the following characters to see how many can fit on a line since kfont in hijack is variable width. It ended up being 1 or 2 characters off, so I just have it go to the next newline character, which seemed better afterwards anyway.
Posted by: jheathco

Re: New userland app: Viewer - 07/03/2002 12:27

What I think would be really neat would be to make a directory browser, in which you can use the buttons to go into directories and out of directories, and choosing a file will display that file.