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

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex

Notices

Reply
 
Thread Tools Search this Thread
Old 04-23-2010, 07:21 PM   #1
GregorRichards
Connoisseur
GregorRichards doesn't litterGregorRichards doesn't litter
 
Posts: 60
Karma: 151
Join Date: Apr 2010
Device: DR800SG
Some DR800 dev questions

I'm building a PDF viewer tailored towards technical documents (good support for rearranging multicolumn docs, etc). It's in poppler + gtk.

I'm having some platformy issues:

1) When I just draw the pages directly, it doesn't trigger the DR800's GTK+ to do a full refresh. So, I added an explicit gdk_display_sync and ioctl to make it to the full refresh ... and now it does it twice! At present I'm stumped as per why.
2) The "please wait" dialog isn't disappearing properly. The first thing I do is pop up a file chooser dialog, but when I do that the "please wait" dialog continues to float on top of it indefinitely ... perhaps this is just a bug in the GTK file chooser dialog (not updating properly) ... is it possible to explicitly hide it?

Thanks for any help!

(PS: Should this go in the iLiad Developer's Corner? Not actually an iLiad ... )
GregorRichards is offline   Reply With Quote
Old 04-24-2010, 06:48 AM   #2
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
Quote:
Originally Posted by GregorRichards View Post
I'm building a PDF viewer tailored towards technical documents (good support for rearranging multicolumn docs, etc). It's in poppler + gtk.

I'm having some platformy issues:

1) When I just draw the pages directly, it doesn't trigger the DR800's GTK+ to do a full refresh. So, I added an explicit gdk_display_sync and ioctl to make it to the full refresh ... and now it does it twice! At present I'm stumped as per why.
2) The "please wait" dialog isn't disappearing properly. The first thing I do is pop up a file chooser dialog, but when I do that the "please wait" dialog continues to float on top of it indefinitely ... perhaps this is just a bug in the GTK file chooser dialog (not updating properly) ... is it possible to explicitly hide it?

Thanks for any help!

(PS: Should this go in the iLiad Developer's Corner? Not actually an iLiad ... )
Can't answer to your first question.
Regarding the second one, I've also observed the same when the application is started using a shell script.
Iņigo is offline   Reply With Quote
Advert
Old 04-24-2010, 07:31 AM   #3
Gertjan
ex-IRX developer
Gertjan doesn't litterGertjan doesn't litterGertjan doesn't litter
 
Gertjan's Avatar
 
Posts: 158
Karma: 224
Join Date: Oct 2008
Device: Irex DR800S, DR1000S, iLiad
Quote:
Originally Posted by GregorRichards View Post
1) When I just draw the pages directly, it doesn't trigger the DR800's GTK+ to do a full refresh. So, I added an explicit gdk_display_sync and ioctl to make it to the full refresh ... and now it does it twice! At present I'm stumped as per why.
The platform has a hybrid display update mechanism. It automatically tries to determine required updates from GTK+ expose events (see display.c of sysd), and it provides a way to control them via an API in liberutils. Working around these will probably result in various side effects.

Quote:
2) The "please wait" dialog isn't disappearing properly. The first thing I do is pop up a file chooser dialog, but when I do that the "please wait" dialog continues to float on top of it indefinitely ... perhaps this is just a bug in the GTK file chooser dialog (not updating properly) ... is it possible to explicitly hide it?
Are you using the original 1.0x or 2.0-beta release?

In the 1.0 release, the dialog is removed as soon as a full screen window is opened, or after 30 seconds. You could try to work around this by opening a window first and show the file chooser dialog on top of it. I don't have the details at hand, but I believe this is reworked in the 2.0 release so that the dialog is removed as soon as the application has started.
Gertjan is offline   Reply With Quote
Old 04-24-2010, 09:54 AM   #4
GregorRichards
Connoisseur
GregorRichards doesn't litterGregorRichards doesn't litter
 
Posts: 60
Karma: 151
Join Date: Apr 2010
Device: DR800SG
Quote:
Originally Posted by Gertjan View Post
The platform has a hybrid display update mechanism. It automatically tries to determine required updates from GTK+ expose events (see display.c of sysd), and it provides a way to control them via an API in liberutils. Working around these will probably result in various side effects.
Aha! Thanks for pointing me at liberutils. Using that to do the explicit requests when I'm doing things GTK+ can't seem to figure out = problem solved

Quote:
Originally Posted by Gertjan View Post
Are you using the original 1.0x or 2.0-beta release?

In the 1.0 release, the dialog is removed as soon as a full screen window is opened, or after 30 seconds. You could try to work around this by opening a window first and show the file chooser dialog on top of it. I don't have the details at hand, but I believe this is reworked in the 2.0 release so that the dialog is removed as soon as the application has started.
I worked around this by running the program in the background from a shell script. Trying to open a full screen window first didn't seem to help, but I'm still poking around ...
GregorRichards is offline   Reply With Quote
Old 04-24-2010, 05:42 PM   #5
GregorRichards
Connoisseur
GregorRichards doesn't litterGregorRichards doesn't litter
 
Posts: 60
Karma: 151
Join Date: Apr 2010
Device: DR800SG
I have both the previous questions answered (enough). I'm trying to properly use the IPC mechanism to handle the menu and page refreshes, but I'm failing miserably ... can somebody tell me what I'm missing? Here's the code:

Code:
gboolean
sys_startup_complete(void *vp)
{
    View *v = (View *) vp;
    const int xid = GDK_WINDOW_XID(v->window->window);
    eripc_sysd_startup_complete( eipccc, getpid(), TRUE, xid);
    return FALSE;
}
...
void menu_handler(eripc_context_t *context,
        const eripc_event_info_t *info,
        void *user_data)
{
    const eripc_arg_t *arg_array = info->args;
    printf("FEH!\n");

    if ((arg_array[0].type == ERIPC_TYPE_STRING) && 
        (arg_array[1].type == ERIPC_TYPE_STRING) && 
        (arg_array[2].type == ERIPC_TYPE_STRING) && 
        (arg_array[3].type == ERIPC_TYPE_STRING))
    {
        const char        *item      = arg_array[0].value.s;
        const char        *group     = arg_array[1].value.s;
        const char        *menu      = arg_array[2].value.s;
        const char        *state     = arg_array[3].value.s;

        printf("%s %s %s %s\n", state, menu, group, item);
    }
}
...
int main() {
...
  eripc_callback_function_t callbacks[] = {
      { menu_handler,           "menuItemActivated",        NULL            },
      { NULL }
  };
...
  /* set up eripc */
  eipccc = eripc_client_context_new(
    "techpdf", "0.1", "org.codu.techpdf", "/org/codu/techpdf", "org.codu.techpdf", callbacks);
  eripc_menu_add_group(eipccc, "GTest", "", "folder");
  eripc_menu_add_item(eipccc, "Test", "GTest", "folder");
  eripc_menu_add_menu(eipccc, "main", "GTest", NULL, NULL, NULL);
  eripc_menu_set_group_label(eipccc, "GTest", "GTest");
  eripc_menu_set_item_label(eipccc, "Test", "GTest", "Test");
  eripc_menu_show_menu(eipccc, "main");
...
}
sys_startup_complete is called as a g_idle_add. The .desktop file calls the binary directly (not via a shell script). The menu displays properly, but doesn't call back properly. I get no callbacks at all

At this point I'm stumped, I'm sure I'm just missing some important call, but I haven't found it ...
GregorRichards is offline   Reply With Quote
Advert
Old 04-25-2010, 05:14 AM   #6
Mackx
Guru
Mackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to behold
 
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
Quote:
Originally Posted by GregorRichards View Post
I have both the previous questions answered (enough). I'm trying to properly use the IPC mechanism to handle the menu and page refreshes, but I'm failing miserably ... can somebody tell me what I'm missing? Here's the code:

sys_startup_complete is called as a g_idle_add. The .desktop file calls the binary directly (not via a shell script). The menu displays properly, but doesn't call back properly. I get no callbacks at all

At this point I'm stumped, I'm sure I'm just missing some important call, but I haven't found it ...
Until now I only used the code I copied from the helloworld example application. I.e. copying the ipc.c file and modifying it.
One of the differences I see is that you use org.codu. and I only use com.irexnet. with only the name of the application changed. Thats the only difference I see.
Mackx is offline   Reply With Quote
Old 04-25-2010, 11:28 AM   #7
GregorRichards
Connoisseur
GregorRichards doesn't litterGregorRichards doesn't litter
 
Posts: 60
Karma: 151
Join Date: Apr 2010
Device: DR800SG
Quote:
Originally Posted by Mackx View Post
Until now I only used the code I copied from the helloworld example application. I.e. copying the ipc.c file and modifying it.
One of the differences I see is that you use org.codu. and I only use com.irexnet. with only the name of the application changed. Thats the only difference I see.
I didn't want to use that code because then I had things coming from two very, very different codebases ... but maybe I can integrate them if I put the appropriate amount of work into it.
GregorRichards is offline   Reply With Quote
Old 04-25-2010, 01:57 PM   #8
Mackx
Guru
Mackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to behold
 
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
Quote:
Originally Posted by GregorRichards View Post
I didn't want to use that code because then I had things coming from two very, very different codebases ... but maybe I can integrate them if I put the appropriate amount of work into it.
Did you try to change your code to use com.irexnet instead of org.codu? I.e.:
Code:
eipccc = eripc_client_context_new(
    "techpdf", "0.1", "com.irexnet.techpdf", "/com/irexnet/techpdf", "com.irexnet.techpdf", callbacks);
Mackx is offline   Reply With Quote
Old 04-25-2010, 03:01 PM   #9
GregorRichards
Connoisseur
GregorRichards doesn't litterGregorRichards doesn't litter
 
Posts: 60
Karma: 151
Join Date: Apr 2010
Device: DR800SG
Yeah, that was ultimately the problem. Weird. (I ended up importing the hello-world IPC code anyway, just to cover all bases.)
GregorRichards 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
DR800 ANN: DR800+. Port of some DR1000 features to the DR800 Iņigo iRex 274 04-05-2013 02:24 PM
Installing dev environment bran iRex Developer's Corner 13 09-28-2010 05:43 PM
iLiad /dev/ttyS1? -Thomas- iRex Developer's Corner 0 05-04-2008 07:16 PM


All times are GMT -4. The time now is 07:30 AM.


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