![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Dec 2008
Device: iLiad
|
Problem Launching ipdf from other app
Hi all,
I'm launching the ipdf through a C application, let's call it "A", to show a .pdf document, but when I try to come back to the application "A" pushing the top left button, the iLiad refreshes the screen and displays the .pdf document again, getting impossible to come back to "A". I paste here the code snippet where I call the ipdf to open a document: int openPdf () { pid_t childpid; /* variable to store the child's pid */ int status; /* parent process: child's exit status */ flush (); /* now create new process */ childpid = fork(); if (childpid >= 0) /* fork succeeded */ { if (childpid == 0) /* fork() returns 0 to the child process */ { printf("CHILD: I am the child process!\n"); printf("CHILD: Here's my PID: %d\n", getpid()); printf("CHILD: My parent's PID is: %d\n", getppid()); printf("CHILD: The value of my copy of childpid is: %d\n", childpid); printf("CHILD: Enter an exit value (0 to 255): "); execlp ("/usr/bin/ipdf", "/usr/bin/ipdf", "/mnt/free/books/test/test.pdf"); flush (); printf("CHILD: Goodbye!\n"); return 0; } else /* fork() returns new pid to the parent process */ { printf("PARENT: I am the parent process!\n"); printf("PARENT: Here's my PID: %d\n", getpid()); printf("PARENT: The value of my copy of childpid is %d\n", childpid); printf("PARENT: I will now wait for my child to exit.\n"); flush (); wait(&status); /*wait for child to exit, and store its status*/ } } else /* fork returns -1 on failure */ { perror("fork"); /* display error message */ return 0; } flush (); } Can anyone help me with this? Is there any other way to call to another application inside the iLiad different to 'fork' or using the manager process of iliad ?? Thanks!! joana. ![]() |
![]() |
![]() |
![]() |
#2 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
|
Do you have special code to process the top left button? I think that the two buttons above flip bar and NEWS, BOOKS, DOCS, NOTES are proprietary to contentlister. I haven't found a way to catch them as GdkEventKey. If I am right, then your app won't respond to those key press unless special connection to contentlister is established.
Added: My above words might not be relevant to your problem. Ideally, when the top-left button is pressed, ipdf should exit. Then, one question: which process will be displayed on screen, your application "A" or contentlister? Last edited by ericshliao; 12-19-2008 at 11:16 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
|
After a second thought, I want to ask you a question:
You said that Quote:
I guesss it should be the later case. Based on my understanding, ipdf started by contentlister will establish a ipc channel to communicate with contentlister, so that contentlister can pass NEWS, BOOKS, DOCS, NOTES and the two buttons above the flip-bar to ipdf. When ipdf is started by your application "A", maybe the IPC channel is not established, and you can't close ipdf by pressing the top-left key. Well, these words are all conjecture. I don't know if they are correct. |
|
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() ![]() ![]() ![]() Posts: 79
Karma: 380
Join Date: Mar 2008
Location: Girona, Spain
Device: iLiad, DR1000s
|
Hi,
It seems that counter list sends the keypressed signals to your program instead to ipdf. About the keypress signals, Counterlist catch that signals and re-send to the open programs. It only re-send the left side buttons signals (pageBar, arrow up, arrow down, dot, exit and previus). If you have added your program in the register.xml, to cath this signals the program should have gtk wmclass and title equal to the value of xResourceName of the register. If you lauch your program form a shell script, you should put "sh" see this thread about buttons pressed: http://forum.irexnet.com/viewtopic.php?t=2366 |
![]() |
![]() |
![]() |
#6 | ||
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Dec 2008
Device: iLiad
|
Thanks for your prompt answer. I´ve been checking your comments, but I still have the same problem.
Quote:
- First, I launch "A" application written in C. - "A" app launchs ipdf - I try to exit ipdf - and if the behavior were ok, I will back to the "A" app I hope this solve your question. Quote:
@Max I´m not sure if the signals are sent to my program instead to ipdf. I have test what you say to launch my app with sh (I tried 'sh -c myapp') but It still doesn´t work. --- In short, I can´t exit or flippage inside the ipdf I have launched. I have realized that I have the same problem if I open a shell (or ssh) and open ipdf by command line. Thanks, joana. |
||
![]() |
![]() |
![]() |
#7 |
Addicted to Porting
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,697
Karma: 7194
Join Date: Oct 2006
Location: Indianapolis, IN
Device: iRex iLiad, Nokia 770, Samsung i760
|
The problem is that the contentlister doesn't know what application to send the keypresses to. It has to do with the IPC channel. You'll likely need to modify the contentlister to get multiple apps to function.
|
![]() |
![]() |
![]() |
#8 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
|
I think Joana probabily tried to make another interface ontop of CL. This thread stroke on a interesting topic and made me curious what does contentlister do when it starts another viewer. I found that, in "viewer.c" on contentlister, there is a fuction "gboolean viewerInit(char *viewer) ", when CL starts another viewer, CL will find the viewer's identity and setup a IPC channel for later communication. So, for viewers not stared by CL, CL won't know how to communicate with them. That's why Joana have the same problem if she open a shell (or ssh) and open ipdf by command line.
Then, a quite challenging question comes out: is it possible to make a middle-ware between CL and viewer, and enable IPC between CL and viewer? I think it's possible, but I don't know how to do it. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pixelar (UK) is launching new ereader | Ea | News | 19 | 11-13-2011 10:29 AM |
iPad Problem with Kindle app | DixieGal | Apple Devices | 5 | 04-18-2010 11:38 AM |
Problem launching Calibre in OS X - depends on which USER | Nigel Brooks | Calibre | 10 | 11-13-2009 02:37 AM |
Beware, problem with Kindle App + your own .mobi/.prc | thianliongpatpoh | Apple Devices | 0 | 08-15-2009 02:46 PM |
ipdf problem - starting up the new versions | ckbrooks | iRex | 5 | 02-18-2009 01:31 PM |