Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex > iRex Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 11-12-2006, 02:08 PM   #1
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
Cool mrxvt ported to iLiad

I've ported mrxvt to the iLiad and I will be using it as a training tool to help other developers learn what it takes to port X11 applications to run on the iLiad.

First off, mrxvt is a tabbed version of rxvt. And rxvt is a small terminal program that doesn't try to do too much so it stays small in size. A terminal program allows you to execute commands under Linix on the iLiad. You can use it to examine the contents of memory cards, move files to and from memory cards. Set the time zone, set the time... In general it is your swiss army knife of tools that iRex has so far failed to provide.

I'll be using mrxvt to document some of the more useful features such as setting the timezone so your notes have the correct date and time on them (unless of course you already live and work in UTC).

I've bundled this tool up in a manner similar to that I developed for gnuchess. It is a zip file that you need to extract onto a MMC/CF card or onto the iLiad's own internal memory drive.

You will then need to have the [SHELL] hack installed. Navigate to where you extracted the zip and click into the "mrxvt" directory created, then click on the "run.sh" file.

You should see a window pop up like that shown in the picture below.

If you are not an experienced Linux command shell user (and if you don't know what that means: you aren't ) then do try not to brick your iLiad by typing in random things you find to try via Google. I'll be posting articles, please be patient.

The features of this program that I will be sharing via postings shortly are:

1. It knows how to label itself so Matchbox Window Manager lets it decide its window size.
2. It knows how to coax the keyboard into automatically popping up: the right way.
3. It knows how to put away the keyboard on exit.
4. It knows how to invoke a light weight screen refresh so it won't risk triggering epileptic seizures amongst the users.
5. It knows how to turn off the busy LED.
6. It defaults to using one of the few X11 fonts provided "out of the box".
7. It uses nothing but "out of the box" shared libraries, so it is a very tiny program.

For the advanced I'll share how to make an on screen button for it using Matchbox so you can pop it up and then put it away whilst in the middle of other things.
Attached Thumbnails
Click image for larger version

Name:	mrxvt.png
Views:	2545
Size:	79.8 KB
ID:	2173  
Attached Files
File Type: zip mrxvt_iliad_0.1.zip (83.6 KB, 3050 views)
scotty1024 is offline   Reply With Quote
Old 11-12-2006, 02:23 PM   #2
b_k
Übernerd
b_k is on a distinguished road
 
Posts: 238
Karma: 74
Join Date: Jun 2006
Location: Germany
Device: iRex iLiad
still busy scotty?
Anyway, looks promising. Now i should finally install the [SHELL] patch.
b_k is offline   Reply With Quote
 
Enthusiast
Old 11-12-2006, 03:00 PM   #3
jęd
Evangelist
jęd has a complete set of Star Wars action figures.jęd has a complete set of Star Wars action figures.jęd has a complete set of Star Wars action figures.
 
Posts: 458
Karma: 293
Join Date: May 2006
Quote:
Originally Posted by scotty1024
I've ported mrxvt to the iLiad and I will be using it as a training tool to help other developers learn what it takes to port X11 applications to run on the iLiad.
Are you going to be posting source code to this (potentially) useful tool...?
jęd is offline   Reply With Quote
Old 11-12-2006, 04:31 PM   #4
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
The bits and pieces

You need the following includes:

Code:
#include <liberdm/erdm.h>
#include <liberipc/eripcviewer.h>
#include <liberipc/eripctoolbar.h>
#include <liberipc/eripcbusyd.h>
The following globals

Code:
erClientChannel_t erbusyChannel;
erClientChannel_t ertoolbarChannel;
This bit of code turns off the LED.

Code:
    // Turn off busy LED if we were invoked via [SHELL]
    erIpcStartClient(ER_BUSYD_CHANNEL, &erbusyChannel);
    busySetBusy(erbusyChannel, ccBusyState_Off);
This bit of code enables and then pops up the keyboard.

Code:
    erIpcStartClient(ER_TOOLBAR_CHANNEL, &ertoolbarChannel);
    tbSelectIconSet(ertoolbarChannel, ER_PDF_VIEWER_UA_ID);
    tbClearIconSet(ertoolbarChannel, ER_PDF_VIEWER_UA_ID);

    // Turn off trashcan
    tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_trashcan, -1);
    tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_trashcan, iconState_grey );

    // Enable then pop up keyboard
    tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_keyboard, -1);
    tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_keyboard, iconState_selected);
This bit of code labels the main window so Matchbox treats it as a Dialog and lets it set its own size (and brings it to front).

Code:
Atom window_type = XInternAtom(r->Xdisplay,
                               "_NET_WM_WINDOW_TYPE_DIALOG",
                               False);
XChangeProperty(r->Xdisplay,
                r->TermWin.parent,
                XInternAtom(r->Xdisplay, "_NET_WM_WINDOW_TYPE", False),
                XA_ATOM,
                32,
                PropModeReplace,
                (unsigned char*)&window_type, 1);
This bit of code flashes the screen black to do as ghost-less a refresh as possible

Code:
    // Full Refresh, chase off all the ghosts
    dmDisplay(dmCmdPriorUrgent, dmQFull);
This bit of code refreshes the screen without the black flash. It works much better for UI work such as that in mrxvt.

Code:
        dmDisplay(dmCmdPriorUrgent, dmQTyping);
To make the keyboard go away when you are done with it (or exiting mrxvt).

Code:
    extern erClientChannel_t ertoolbarChannel;

    // close keyboard
    tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_keyboard, iconState_normal);
And to link you need the following libraries.

Code:
-lerdm -leripc

Last edited by scotty1024; 11-12-2006 at 07:56 PM. Reason: Added library linkages and Matchbox WM code
scotty1024 is offline   Reply With Quote
Old 11-13-2006, 07:11 AM   #5
arivero
Guru
arivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it is
 
arivero's Avatar
 
Posts: 607
Karma: 2157
Join Date: Oct 2005
Device: NCR3125, Nokia 770,...
I remember time ago I had some trouble about the appropiate font to use for xrvt.

Scotty, the centered Dialog idea is BRILLIANT. And I regret do not have greater/bigger uppercasses. Er, wait a moment, I have...
BRILLIANT.

It is real hack, to have remembered that dialog windows indeed appear and of course to know that they can be asked to show.
arivero is offline   Reply With Quote
Old 11-13-2006, 07:32 AM   #6
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
Quote:
Originally Posted by arivero
It is real hack, to have remembered that dialog windows indeed appear and of course to know that they can be asked to show.
Thanks!

I think the next item out of my porting pipeline will really put the heat to iRex from the 2.7.1 user community.
scotty1024 is offline   Reply With Quote
Old 11-13-2006, 07:54 AM   #7
CommanderROR
eink fanatic
CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.
 
CommanderROR's Avatar
 
Posts: 2,022
Karma: 4924
Join Date: Mar 2006
Location: Germany
Device: STAReBOOK, iRex Iliad, Sony 505, Kindle 2
well, i'm certainly looking forward to that then...:-)
CommanderROR is offline   Reply With Quote
Old 11-13-2006, 07:58 AM   #8
arivero
Guru
arivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it is
 
arivero's Avatar
 
Posts: 607
Karma: 2157
Join Date: Oct 2005
Device: NCR3125, Nokia 770,...
Quote:
Originally Posted by scotty1024
I think the next item out of my porting pipeline will really put the heat to iRex from the 2.7.1 user community.
So you are porting Basilisk ?

EDITED: well, or any vmac fork
arivero is offline   Reply With Quote
Old 11-13-2006, 11:23 AM   #9
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
I said heat, not something to make iRex laugh their asses off.
scotty1024 is offline   Reply With Quote
Old 11-13-2006, 11:27 AM   #10
NatCh
Gizmologist
NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.
 
NatCh's Avatar
 
Posts: 11,605
Karma: 926222
Join Date: Jan 2006
Location: Republic of Texas Embassy at Jackson, TN
Device: Nook STGR
Hmm, might do them some good to laugh a bit.
NatCh is offline   Reply With Quote
Old 11-14-2006, 09:22 AM   #11
yokos
Pac-Man catched my iLiad.
yokos plays well with othersyokos plays well with othersyokos plays well with othersyokos plays well with othersyokos plays well with othersyokos plays well with othersyokos plays well with othersyokos plays well with othersyokos plays well with othersyokos plays well with othersyokos plays well with others
 
yokos's Avatar
 
Posts: 720
Karma: 2571
Join Date: Apr 2006
Location: Germany; next to Baltic Sea
Device: 1st gen iRex iLiad with 2nd ed. battery/case
Thanks, scotty, brilliant as usual.
No we have a real shell terminal.
I copied some files from CF to /mnt/free wo help of a PC. uhh! nice!
yokos is offline   Reply With Quote
Old 11-14-2006, 09:23 AM   #12
arivero
Guru
arivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it isarivero knows what time it is
 
arivero's Avatar
 
Posts: 607
Karma: 2157
Join Date: Oct 2005
Device: NCR3125, Nokia 770,...
Quote:
Originally Posted by yokos
Thanks, scotty, brilliant as usual.
No we have a real shell terminal.
I copied some files from CF to /mnt/free wo help of a PC. uhh! nice!
yeah, that is really useful: to be able to move files and folders between devices!

Plus, wget.
arivero is offline   Reply With Quote
Old 11-15-2006, 05:38 AM   #13
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
Quote:
Originally Posted by yokos
Thanks, scotty, brilliant as usual.
No we have a real shell terminal.
I copied some files from CF to /mnt/free wo help of a PC. uhh! nice!
After your excellent piece of work on the [SHELL] hack I was wondering if you were thinking about doing a similar posting documenting how to move files around?

I think there has been a bit of pent up demand for this simple capability.
scotty1024 is offline   Reply With Quote
Old 11-15-2006, 07:12 AM   #14
yokos
Pac-Man catched my iLiad.
yokos plays well with othersyokos plays well with othersyokos plays well with othersyokos plays well with othersyokos plays well with othersyokos plays well with othersyokos plays well with othersyokos plays well with othersyokos plays well with othersyokos plays well with othersyokos plays well with others
 
yokos's Avatar
 
Posts: 720
Karma: 2571
Join Date: Apr 2006
Location: Germany; next to Baltic Sea
Device: 1st gen iRex iLiad with 2nd ed. battery/case
STICKY [This is a first draft, this message says to you: post isn't finished right now]

step-to-step-guide How to copy directories from CF/MMC to iLiad's USB drive without a PC
What you need to know
How you can start mrxvt

What you want
copy a directory from media card to iLiad. Wouldn't it be nice to do this without a PC? at the beach, in subway, you understand?

Steps
# run mrxvt via run.sh
# what you get is a terminal window, where you can run shell comands
# my terminal says /mnt/free/newpapers/Apps/mrxvt/ #
What does this mean? It shows you in which directory your mrxvt application lies. So this depends, where you copied the binary file [application] mrxvt.
# using mrxvt works this way:
1- you enter a command,
2- then you press enter,
3- mrxvt executes your command & creates a new line,
4- where can enter the next command.
# This will we do. Ok, first we need to change the directory first
type cd /mnt/cf [if you use a CF card] or cd /mnt/mmc [if you use a MMC card], then press "enter" button on keyboard.
terminal gets a new line, which lists the address you typed in. You are now at the lowest dir level [root] of you memory card.
cd stands for change directory, /mnt/cf is the address of root directory of CF card
# you can type ls -l if you want, a contents list of your memory card is shown, this may helps to choose the directory you want to copy.
sample output:
Code:
dr-xr-xr-x    3 root     root         4096 Nov  3 11:45 Kryptologie
drwxr-xr-x    4 root     root         4096 Nov 11 17:18 LaTex
drwxr-xr-x    4 root     root         4096 Nov  6 13:28 Linux
drwxr-xr-x    6 root     root         4096 Sep  2 17:43 My Notes
-rwxr-xr-x    1 root     root        23558 Mar 19  2004 pdf.ico
Reading the sample output above, We get following information:
sample root directory of memory card has got 4 dirs [Do you see the d in front of line? It's says, it's a dir]
What the hack is the rwx stuff?
r=read right, w=write right,x=execute right. In sample you have as user/root all rights.
# You can switch with cd command between levels of directories.
like
Code:
cd Linux
,
Code:
cd directoryname
with this command you change the current working directory to subdictionary directoryname.
with
Code:
cd ..
you can jump from your current directory a level up again.
# I decide to copy the directory "Kryptologie" with all subdirectories to the iLiad's Books USB drive.
How to do this. We can you use the copy command.
We type cp -r Kryptologie /mnt/free/books/Kryptologie
This copies the directory Kryptologie to the iLiad's book directory. It takes a while to copy, depending how large your files are, when the copy process is done, mrxvt creates a new line & is waiting for a new command.
general command is
Code:
cp -r /directory/to/copy/from /directory/to/copy/to
How can I exit mrxvt?
# press cross [top right of window] or
# type the command exit

a one-step-copy-process [if you know what you want to copy] in mrxvt could be:
Code:
cp -r /mnt/cf/directory/subdirectory /mnt/free/books/subdirectory
This copies the directory "subdirectory" with all it's subsubdirectories from CF to iLiad's book directory. This is quite handy. This command uses the absolute path address.

note to myself: I need to install fbshot. Some screenshots would be nice.

Q: Can you follow the instructions? Or did you found any mistakes?

a tip: with the up-arrow key on keyboard you can switch between commands you already used.

more information about shell commands:
# Linux man pages online
# linuxmanpages.com
# cp @wikipedia.

Last edited by yokos; 11-16-2006 at 06:40 AM.
yokos is offline   Reply With Quote
Old 11-15-2006, 01:19 PM   #15
vranghel
Addict
vranghel began at the beginning.
 
vranghel's Avatar
 
Posts: 285
Karma: 10
Join Date: Apr 2006
Location: Vancouver, Canada
Device: Proud Iliad owner
Quote:
Originally Posted by scotty1024
Thanks!

I think the next item out of my porting pipeline will really put the heat to iRex from the 2.7.1 user community.

So i'm assuming that your next(current) project is so awesome that the 2.7.1 ppl will be so jelaous that they will 'scream' at iRex to push their releases faster.

Can't wait!
vranghel is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Qt ported to PRS-505 bero Sony Reader Dev Corner 5 06-18-2010 03:05 AM
GNUShogi ported to iLiad? zatrigkiwtes iRex 5 05-25-2009 11:53 PM
iLiad Has anyone ported ltrace to the iLiad? LazyScot iRex Developer's Corner 3 07-18-2008 04:02 PM
iLiad Bigger Font for mrxvt? grayfox iRex Developer's Corner 6 10-20-2007 06:00 PM
iLiad FBReader is being ported for the Iliad! CommanderROR iRex Developer's Corner 0 03-15-2007 05:36 PM


All times are GMT -4. The time now is 05:06 AM.


MobileRead.com is a privately owned, operated and funded community.