|  09-27-2008, 05:03 AM | #1 | 
| Guru       Posts: 976 Karma: 687 Join Date: Nov 2007 Device: Dell X51v; iLiad v2 | 
				
				A homebrew txt viewer and asking for help
			 
			
			This is a small GTK proram running on iLiad. Unpack it to anywhere and execute from contentlister.Because I haven't figured out the refresh mechanism, please wait for 5 secs after executing, then touch the "page 1" label (on the middle of bottom). Attention: After each action, touch the page label on mid-bottom to refresh screen manually. Users can select a text file to display on screen by touching "Folder" button. Touching "Cancel" button will close the program. With proper font file installed, this app can display national text in UTF-8 encoding. Souce code is included. Compile command: Code: gcc -o gtktextview gtktextview.c -I`pkg-config --cflags --libs gtk+-2.0` Any help is welcome. Last edited by ericshliao; 09-27-2008 at 07:56 AM. | 
|   |   | 
|  09-27-2008, 08:20 AM | #2 | |
| Evangelist            Posts: 423 Karma: 1517132 Join Date: Jun 2006 Location: Madrid, Spain Device: quaderno, remarkable2, yotaphone2, prs950, iliad, onhandpc, newton | Quote: 
  . | |
|   |   | 
|  09-27-2008, 04:53 PM | #3 | |
| Evangelist            Posts: 423 Karma: 1517132 Join Date: Jun 2006 Location: Madrid, Spain Device: quaderno, remarkable2, yotaphone2, prs950, iliad, onhandpc, newton | Quote: 
 I mean, the executable has calls to liberipc that are missing in the code. If it was intentional, I can try to add the needed calls. If it was unintentional, I prefer to modify the code you intend to use and not the vanilla version :-). Anyway, a couple of things about porting apps to the iliad: 1. You have to set the window class to "sh" or your application will not receive kepresses (as they're are routed to the window class of the same name as the app registered in iRex's contentlister, and all apps launched from .sh files are "sh"). Look at one of the Gtk+2 apps ported by Adam as to how to do it. 2. To supress the blinking led after program launch you have to do a call to erbusy using liberipc, you have a example in the patch to libX11 http://projects.mobileread.com/iliad...0061203-2.diff 3. To stop the blinking led after any hardware button press, I don't know the correct way, but Adam has managed to do it right, so ask him  4. To handle the refreshes you have three ways at the moment: 4a. Explicit calls to liberdm (again, look at libX11 patch above as to how to do them) 4b. Using the patched libX11 (download the latest dillo from http://projects.mobileread.com/iliad..._iliad-0.7.zip and look at the launcher shell script and the files in the lib/ directory). 4c. Using xepdmgr and, if needed for your program, use calls to xepdmgrclient.[ch] to fine tune it's behaviour. It's as simple as launching your program using xepdmgr as a wrapper: ./xepdmgr ./gtktextview (see https://dev.mobileread.com/trac/xepdmgr/wiki and https://www.mobileread.com/forums/showthread.php?t=22215 for more information). Hope that helps  . Last edited by Antartica; 09-27-2008 at 04:58 PM. Reason: sp | |
|   |   | 
|  09-27-2008, 06:58 PM | #4 | 
| Guru       Posts: 976 Karma: 687 Join Date: Nov 2007 Device: Dell X51v; iLiad v2 | 
			
			As to the mismatched sourrce code, it may be that  I made modifications after making a working binary package, then I found I should include source code in the package. Sorry for the inconvenience. Anyway , the source code is still in primitive stage. I don't retain a source code match to the uploaded binary. Feel free to do anything you want. I am trying to do something more in the source code, and I will try your suggestions later when I finish it. Last edited by ericshliao; 09-27-2008 at 07:10 PM. | 
|   |   | 
|  09-27-2008, 07:26 PM | #5 | 
| Guru       Posts: 976 Karma: 687 Join Date: Nov 2007 Device: Dell X51v; iLiad v2 | 
			
			The attachment in this post contains matching source code and binary.
		 | 
|   |   | 
|  09-27-2008, 09:41 PM | #6 | 
| Addicted to Porting            Posts: 1,697 Karma: 7194 Join Date: Oct 2006 Location: Indianapolis, IN Device: iRex iLiad, Nokia 770, Samsung i760 | 
			
			I may be able to look at the code Monday and see if I can fix it for refreshes and the busy light.  It might be a good time to work with Antartica's xepdmgr.
		 | 
|   |   | 
|  09-28-2008, 04:01 PM | #7 | |
| JSR FFD2         Posts: 305 Karma: 1045 Join Date: Aug 2008 Location: Rotterdam, Netherlands, Europe, Sol 3 Device: iliad | Quote: 
 Code: 'xepdmgr -busy_off :0.0 myprog' Last edited by hansel; 09-28-2008 at 04:04 PM. | |
|   |   | 
|  09-28-2008, 04:04 PM | #8 | 
| fruminous edugeek            Posts: 6,745 Karma: 551260 Join Date: Oct 2006 Location: Northeast US Device: iPad, eBw 1150 | 
			
			I'm curious-- why are you porting a text viewer? Just as practice porting to the iLiad? Granted the text viewer the iLiad ships with isn't very good, but FBreader handles text files quite well.    | 
|   |   | 
|  09-28-2008, 04:25 PM | #9 | |
| Evangelist            Posts: 423 Karma: 1517132 Join Date: Jun 2006 Location: Madrid, Spain Device: quaderno, remarkable2, yotaphone2, prs950, iliad, onhandpc, newton | Quote: 
 About the window class stuff: that would mean that xepdmgr opens a window with the "sh" class name, and then it would have to redirect the keystrokes it receives to the window of the application...and it doesn't know the window to redirect it :-/. Perhaps if there is a way to query the z-order of the windows and use the window with highest z-order (ignoring the ones of the panel, the pagebar and the soft-keyboard, of course)... For now I think that setting the correct class in the app is a reasonable compromise, but for the future sure it's worthwhile goal :-). | |
|   |   | 
|  | 
| Thread Tools | Search this Thread | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| [old-topic]ebook-viewer: Open source, crossplatform viewer for EPUB, LIT, MOBI, etc | kovidgoyal | Calibre | 68 | 05-30-2011 08:46 PM | 
| PSP + homebrew as a mobile reader? | albireo | Alternative Devices | 8 | 03-29-2011 07:40 PM | 
| My homebrew imanga (image, cbz, cbr viewer)! | ericshliao | iRex | 14 | 08-18-2009 11:50 PM | 
| A homebrew proposal | DasFool | Sony Reader Dev Corner | 4 | 07-30-2008 05:45 AM | 
| PRS-500 Homebrew Wish List | Aerlock | Sony Reader Dev Corner | 31 | 09-11-2007 08:27 PM |