03-23-2008, 06:12 PM | #1 |
Evangelist
Posts: 423
Karma: 1517132
Join Date: Jun 2006
Location: Madrid, Spain
Device: quaderno, remarkable2, yotaphone2, prs950, iliad, onhandpc, newton
|
xepdmgr - another approach to auto-refresh
NOTE: I'll keep this first post updated with the last version of xepdmgr, as well as some instructions for use. I've not done up to now, and it's getting messy to find the last version in this thread.
xepdmgr is a program that allows developers of the iliad to port programs without being forced to insert "update the screen" commands in the ported programs (and it's very prone to errors in the menus and and dialogs). "Update the screen" commands can be issued with xepdmgr running using the included library (xepdmgrclient.c). xepdmgr works by launching the ported program using xepdmgr as a wrapper, and while the program is launched, xepdmgr will auto-refresh the screen when needed. For example, to launch mycalculator using xepdmgr, you will substitute in your run.sh file the line: Code:
./mycalculator Code:
./xepdmgr :0 ./mycalculator Posts with the different versions uploaded to this thread: #4 9-09-2008 xepdmgr 1.0pre1 with instructions #5 9-20-2008 xepdmgr 1.0, first usable version #8 9-24-2008 xepdmgr 1.1 using iliad's internal libX11.so #13 10-02-2008 xepdmgr 1.2 with busy led off and refresh bugs fixed #35 10-04-2008 xepdmgr 1.3 with multiple tracked areas working (note to self: #37 has Hansel's code for detecting matchbox-keyboard). (note for devels: #47 has sample code for disabling auto-update wile initializing your app) #53 12-08-2008 xepdmgr 1.9, xepdmgr 1.9a, xepdmgr 1.9b Less verbose output #74 12-16-2008 xepdmgr 1.9c. Contains some code to notify contentLister of the updates when running as server #92 03-26-2009 xepdmgr 1.9d. Adds option for operating as wrapper but not launching any programs (using the iliad for displaying exported windows) #94 04-13-2009 xepdmgr 1.9e. Fixed a parameter parsing bug introduced in 1.9d #101 04-25-2009 xepdmgr 1.9f. Adds EpdCancel() to xepdmgrclient, to support updating the screen using fbdev from applications a-la-ipdf. See post #99 for usage and rationale. #127 08-22-2009 xepdmgr 1.9g. Make xepdmgrclient.h usable in C++. #136 09-12-2009 xepdmgr 1.9h. Hopefully fixed a bug that made "autorefresh-disable" non-working. Make xepdmgrclient.c usable in C++. #146 09-18-2009 xepdmgr 1.9i. New dirty area management; it is a lot more consistent in regard to typing/full refreshes than before. Remaining TO-DO for version 2.0: - exclude the matchbox keyboard area when running as a wrapper - make xepdmgr when in wrapper mode to detect that there is another instance running in server mode so that they doesn't clash. ---------------------------------------------- Original message follows: Hi all! I've managed to get time to start coding xepdmgr (another approach to auto-refresh). The proof-of-concept code is attached to the main page of the wiki of the project: https://dev.mobileread.com/trac/xepdmgr/wiki/WikiStart The code itself is attached to the main page of the wiki. It doesn't do much right now (only shows that "dirty" rectangles in stdout). Last edited by Antartica; 01-08-2010 at 08:39 AM. |
03-24-2008, 06:32 AM | #2 |
Addicted to Porting
Posts: 1,697
Karma: 7194
Join Date: Oct 2006
Location: Indianapolis, IN
Device: iRex iLiad, Nokia 770, Samsung i760
|
Great idea! Getting refreshes to work with menus and such has always been the hardest part of porting... I'm very much looking forward to a working version.
Great work Antartica! |
Advert | |
|
03-28-2008, 08:28 AM | #3 |
Pac-Man caught my iLiad.
Posts: 807
Karma: 3595
Join Date: Apr 2006
Location: Germany; next to Baltic Sea
Device: Boox Max Lumi, iRex iLiad (RIP)
|
Interesting. Src was downloaded & now I "compile some extra time" to check it out.
|
09-07-2008, 05:16 PM | #4 |
Evangelist
Posts: 423
Karma: 1517132
Join Date: Jun 2006
Location: Madrid, Spain
Device: quaderno, remarkable2, yotaphone2, prs950, iliad, onhandpc, newton
|
I've finished the first version of xepdmgr, but I've to recompile the X libraries for the iliad as I don't have the needed libXdamage.so.1 and related headers in the scratchbox environment
Anyway, if someone wants to look at how it's at the moment and try it in his desktop (you will have a nice line in stdout when the iliad refresh would be invoked), here it is. To compile, just do "make" in the directory. It has two modes of being used, as an standalone server and as a wrapper for one program only. As a standalone server: 1. In one window launch ./xepdmgr :0 2. In another window exec ./xepdmgrtest 3. To futher tests, exec ./xepdmgrtest --help 4. When you want to stop the server, just hit Ctrl-C in the server window As a wrapper for one program only: 1. Just exec ./xepdmgr :0 ./xepdmgrtest (or ./xepdmgr :0 xterm) 2. When you exit the launched program, xepdmgr also exits I'll document the inner workings and the meaning of the different commands that can be send with xepdmgrtest on another messsage, as today is somewhat late for me :-). OTOH, the xepdmgrclient.h and xepdmgrclient.c are intended to be included in your programs to be able to communicate with the server; see xepdmgrtest.c for an example. Multiple clients are allowed at once, but races can occur in that case (if two programs send a message to the server in the same exact moment, one of the messages will be lost). Something that makes this interesting as an alternative to the hacked libX11 is that [when I manage to compile xepdmgr for the iliad] the problem of having exported windows on the iliad will vanish, as they would auto-refresh correctly ;-). Advantages of this approach: - lets the application force refreshes (or delay them) when needed, unlike the hacked libX11. - Has some heuristics as to when to use the full refresh or the Typing refresh, as it knows how big the portion to refresh is (for small portions it will use the Typing refresh, and for large portions the Full refresh). Enjoy your hacking! |
09-20-2008, 08:37 AM | #5 |
Evangelist
Posts: 423
Karma: 1517132
Join Date: Jun 2006
Location: Madrid, Spain
Device: quaderno, remarkable2, yotaphone2, prs950, iliad, onhandpc, newton
|
First version of xepdmgr for the iliad (untested, but it should work O:-)
Hi all!
Attached is the first version of xepdmgr for the iliad. I've not tested it, but it should work ;-). Happy hacking! |
Advert | |
|
09-20-2008, 10:29 AM | #6 |
JSR FFD2
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
|
Great!
How big is the stripped xepdmgr? Just curious... Why not link the standard Xlibs that are available on every Iliad? The stripped executable would be only 23KB... Last edited by hansel; 09-20-2008 at 10:48 AM. |
09-20-2008, 02:43 PM | #7 | |
Evangelist
Posts: 423
Karma: 1517132
Join Date: Jun 2006
Location: Madrid, Spain
Device: quaderno, remarkable2, yotaphone2, prs950, iliad, onhandpc, newton
|
Quote:
Code:
dario@calcifer:/shared/Devel/iliad/src.xepdmgr/xepdmgr-1.0-iliad$ ls -l xepdmgr -rwxrwxr-x 1 dario dario 224692 2008-09-20 16:01 xepdmgr As you have tested that it works with the included libX11, your approach makes a lot more sense than mine ;-). I'll post here a version that uses the iliad's internal libX11.so library as soon as possible (but that might not be very soon, anyway...). |
|
09-24-2008, 07:55 AM | #8 | |
Evangelist
Posts: 423
Karma: 1517132
Join Date: Jun 2006
Location: Madrid, Spain
Device: quaderno, remarkable2, yotaphone2, prs950, iliad, onhandpc, newton
|
Quote:
It should compile in Adam's VMWare development image. If not, warn me about it ;-). |
|
10-01-2008, 06:13 AM | #9 |
JSR FFD2
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
|
Hi Antartica,
I had some playtime... xepdmgr.c compiles fine, but... has some cut&paste errors causing to much full refreshes... Code:
148,149c148,149 < Epd->ux1=Epd->x1,Epd->uy1=Epd->x1; < Epd->ux2=Epd->x2,Epd->ux2=Epd->x2; > Epd->ux1=Epd->x1,Epd->uy1=Epd->y1; > Epd->ux2=Epd->x2,Epd->uy2=Epd->y2; 358c358 < Epd->ux1,Epd->uy1,Epd->ux2,Epd->ux2); > Epd->ux1,Epd->uy1,Epd->ux2,Epd->uy2); 365c365 < Epd->ux1=Epd->uy1=Epd->ux2=Epd->ux2; > Epd->ux1=Epd->uy1=Epd->ux2=Epd->uy2; |
10-01-2008, 08:07 AM | #10 | |
Evangelist
Posts: 423
Karma: 1517132
Join Date: Jun 2006
Location: Madrid, Spain
Device: quaderno, remarkable2, yotaphone2, prs950, iliad, onhandpc, newton
|
Quote:
OTOH, I've decided how to do the improvement you suggested in the other thread about tracking several areas at once. I'll try to implement that tonight too . |
|
10-01-2008, 10:56 AM | #11 |
JSR FFD2
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
|
Great!
You might as well add code to kill the busy led... This is what I do in xepdmgr.c : Code:
#ifndef DUMMY_BUILD
#include <liberdm/erdm.h>
#include <liberipc/eripcbusyd.h>
#endif
Code:
if(argc>2) {
/* Start child process */
install_signal(SIGCHLD,sigchld);
if((child_pid=fork())==0) {
erClientChannel_t erbusyChannel;
erIpcStartClient(ER_BUSYD_CHANNEL, &erbusyChannel);
busySetBusy(erbusyChannel, ccBusyState_Off);
int fd;
/* Close unneeded fds */
|
10-01-2008, 12:16 PM | #12 |
JSR FFD2
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
|
Even better...
I played some more, and managed to enable the keyboard button on the tool bar. With the following mutation to xepdmgr.c the virtual keystrokes go to my unmodified test app (no specific Iliad stuff in it)
Code:
#ifndef DUMMY_BUILD
#include <liberdm/erdm.h>
#include <liberipc/eripcbusyd.h>
#include <liberipc/eripctoolbar.h>
#endif
Code:
if(argc>2) {
/* Start child process */
install_signal(SIGCHLD,sigchld);
if((child_pid=fork())==0) {
erClientChannel_t erbusyChannel;
erClientChannel_t ertoolbarChannel;
erIpcStartClient(ER_BUSYD_CHANNEL, &erbusyChannel);
busySetBusy(erbusyChannel, ccBusyState_Off);
erIpcStartClient(ER_TOOLBAR_CHANNEL, &ertoolbarChannel);
tbSelectIconSet(ertoolbarChannel, ER_PDF_VIEWER_UA_ID);
tbClearIconSet(ertoolbarChannel, ER_PDF_VIEWER_UA_ID);
int fd;
/* Close unneeded fds */
|
10-01-2008, 07:06 PM | #13 |
Evangelist
Posts: 423
Karma: 1517132
Join Date: Jun 2006
Location: Madrid, Spain
Device: quaderno, remarkable2, yotaphone2, prs950, iliad, onhandpc, newton
|
Version 1.2 of xepdmgr
Hi!
Here it is, attached is v1.2 of xepdmgr. Includes the fixes and changes proposed by Hansel, as well as an implementation of the multiple tracking areas to minimize full refreshes. Thanks a lot, Hansel! BTW, the code you posted for the initial busy led and the keyboard was familiar to me; it's surprinsingly similar to the one in the hacked libX11 (I used those same posts...). P.S.: As always, I've not tested it in the iliad (time is scarce et al.)... Thanks in advance for your testing ;-). |
10-02-2008, 07:16 AM | #14 |
Evangelist
Posts: 423
Karma: 1517132
Join Date: Jun 2006
Location: Madrid, Spain
Device: quaderno, remarkable2, yotaphone2, prs950, iliad, onhandpc, newton
|
This release has at least two bugs related to the multiple tracked areas part:
1. Due to a badly put end condition (tracked_areas_num instead of tracked_areas_num-1) in the code to search for the best candidate merge areas, it will merge always with the first area, as he last one always has merge_with==0, merge_overhead==0. 2.I forgot to consider intersections of the tracked_areas when calculating the final area span. It's simply a matter of putting the code to calculate the intersection of two areas used in the MergeOne function in a separate function and use it when calculating the final area span. I'll do it soon . |
10-02-2008, 11:25 AM | #15 |
Addicted to Porting
Posts: 1,697
Karma: 7194
Join Date: Oct 2006
Location: Indianapolis, IN
Device: iRex iLiad, Nokia 770, Samsung i760
|
I've just tested this program for the first time on a ported app without any internal refreshes. I have to say, Antartica, you're a genius!
It works great, and should make porting *much* easier. Now I have to decide what my first Xepdmgr based release will be. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Psychological Approach | shalini_singh | Lounge | 5 | 09-09-2009 04:33 AM |
New to Sony Reader - Best Approach | kougei | Sony Reader | 11 | 12-23-2008 10:42 PM |
iLiad xepdmgr algorithms dicussion thread | Antartica | iRex Developer's Corner | 14 | 11-17-2008 10:36 AM |
emelFM2 0.41 with xepdmgr | ericshliao | iRex | 0 | 10-06-2008 10:25 AM |
iLiad libX11.so.6, auto refresh | hansel | iRex Developer's Corner | 7 | 09-20-2008 08:40 AM |