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 08-25-2011, 03:47 PM   #1
Gogolo
Addict
Gogolo has learned how to buy an e-book online
 
Gogolo's Avatar
 
Posts: 353
Karma: 92
Join Date: Sep 2007
Device: DR1000S, Nook ST (rooted), Kobo Aura one (ksm)
Screen Refresh for DR1000

Hi

Does somebody knows how to code a screen refresh in gtk+ for the DR1000?

Thanks
Gogolo


I may have found the answer:

https://www.mobileread.com/forums/sho...59&postcount=8

Last edited by Gogolo; 08-25-2011 at 04:19 PM.
Gogolo is offline   Reply With Quote
Old 08-28-2011, 03:28 AM   #2
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
Hi Gogolo,

The functions that you mention can indeed be used to force refreshes. An alternative that I used in xournal was to set the text of a GtkLabel, which also triggers a refresh.
Mackx is offline   Reply With Quote
Old 08-29-2011, 02:26 AM   #3
Gogolo
Addict
Gogolo has learned how to buy an e-book online
 
Gogolo's Avatar
 
Posts: 353
Karma: 92
Join Date: Sep 2007
Device: DR1000S, Nook ST (rooted), Kobo Aura one (ksm)
Thank you! If it is not to much work: Could you post the code for that?

Gogolo
Gogolo is offline   Reply With Quote
Old 08-29-2011, 03:39 AM   #4
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 Mackx View Post
Hi Gogolo,

The functions that you mention can indeed be used to force refreshes. An alternative that I used in xournal was to set the text of a GtkLabel, which also triggers a refresh.
A GtkLabel does not own a GdkWindow (i.e. an X window), so I guess this trick performs a full screen refresh. Am I correct?

Iņigo
Iņigo is offline   Reply With Quote
Old 08-30-2011, 01:57 AM   #5
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 Gogolo View Post
Thank you! If it is not to much work: Could you post the code for that?

Gogolo
Hi Gogolo, see the xournal code: https://bitbucket.org/mackx/xournal-...src/scribble.c
Mackx is offline   Reply With Quote
Old 08-30-2011, 02:02 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 Iņigo View Post
A GtkLabel does not own a GdkWindow (i.e. an X window), so I guess this trick performs a full screen refresh. Am I correct?

Iņigo
Yes, a full refresh. Although I am not sure why it works (worked?). Maybe it has to do with the total area that needs an update. If you draw something at the top and then update a GtkLabel at the bottom, it leads to a full-refresh.
(see also sysd/src/display.c)
Mackx is offline   Reply With Quote
Old 08-30-2011, 02:26 AM   #7
Gogolo
Addict
Gogolo has learned how to buy an e-book online
 
Gogolo's Avatar
 
Posts: 353
Karma: 92
Join Date: Sep 2007
Device: DR1000S, Nook ST (rooted), Kobo Aura one (ksm)
Thank you Mackx!!!
Gogolo is offline   Reply With Quote
Old 08-30-2011, 02:49 AM   #8
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 Mackx View Post
Yes, a full refresh. Although I am not sure why it works (worked?). Maybe it has to do with the total area that needs an update. If you draw something at the top and then update a GtkLabel at the bottom, it leads to a full-refresh.
(see also sysd/src/display.c)
From the "Ion Development Environment" doc., pages 23-24:

A simple hook is added to GTK's main loop event handler which triggers a screen update
on certain expose events. We only perform an update if the expose event was emitted by a top level window, and if the expose is not the result of some intermediate process (such is the case with X configure events). This results in the minimum number of display updates, but it ignores updates to GtkEntry fields because they are implemented as GdkWindows (which are ignored, if they're not top-level).


My guess is that as Gtk.Label widgets do not have their own gdk / X window, the parent container with a proper window gets the refresh, thus this the Gtk.Window often.

Iņigo
Iņigo is offline   Reply With Quote
Old 08-30-2011, 03:41 PM   #9
Gogolo
Addict
Gogolo has learned how to buy an e-book online
 
Gogolo's Avatar
 
Posts: 353
Karma: 92
Join Date: Sep 2007
Device: DR1000S, Nook ST (rooted), Kobo Aura one (ksm)
When I add this:

extern GtkWidget *g_label;
gtk_label_set_text( GTK_LABEL(g_label), _(" Layer: ") );

It gives a error when building, g_label is not defined. Sorry I hope Im not annoying to much with these silly questions...
Gogolo is offline   Reply With Quote
Old 08-30-2011, 04:01 PM   #10
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 Gogolo View Post
When I add this:

extern GtkWidget *g_label;
gtk_label_set_text( GTK_LABEL(g_label), _(" Layer: ") );

It gives a error when building, g_label is not defined. Sorry I hope Im not annoying to much with these silly questions...
Try to remove "extern" and recompile if both lines are in the same file.

And no problem with the questions. This is the reason of the forum.
Iņigo is offline   Reply With Quote
Old 08-31-2011, 02:39 AM   #11
Gogolo
Addict
Gogolo has learned how to buy an e-book online
 
Gogolo's Avatar
 
Posts: 353
Karma: 92
Join Date: Sep 2007
Device: DR1000S, Nook ST (rooted), Kobo Aura one (ksm)
Thanks! It compiled good. Now I have to find the right place for it
Gogolo is offline   Reply With Quote
Old 08-31-2011, 03:15 AM   #12
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 Gogolo View Post
Thanks! It compiled good. Now I have to find the right place for it
In the statusbar at the bottom? at the right of message widget.
A simple Gtk.Label with a "." or " " character could be enough. Shift from one to the other anytime there is a move.
Iņigo is offline   Reply With Quote
Old 08-31-2011, 11:38 AM   #13
Gogolo
Addict
Gogolo has learned how to buy an e-book online
 
Gogolo's Avatar
 
Posts: 353
Karma: 92
Join Date: Sep 2007
Device: DR1000S, Nook ST (rooted), Kobo Aura one (ksm)
Thanks for the hint. Will try it tonight.
Gogolo
Gogolo is offline   Reply With Quote
Old 08-31-2011, 06:49 PM   #14
Gogolo
Addict
Gogolo has learned how to buy an e-book online
 
Gogolo's Avatar
 
Posts: 353
Karma: 92
Join Date: Sep 2007
Device: DR1000S, Nook ST (rooted), Kobo Aura one (ksm)
edit: cant get it to update the screen. Im working in vmare and cannot use qemu, so I have to test all the time on DR, which takes a lot of time. Ill stop here. I changed the gui of position editor to fit better for DR. Saving, loading and viewing PGNs runs except of the "only one time" bug. So when somebody is interested I can provide this.

Happy coding!
Gogolo

Last edited by Gogolo; 08-31-2011 at 08:09 PM.
Gogolo 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
Screen refresh on KOBO gandor62 Kobo Reader 13 08-28-2010 08:55 AM
Screen Refresh Question nremondelli Amazon Kindle 3 12-24-2008 09:55 AM
Sound on screen refresh? Savonarola iRex 1 10-18-2008 01:02 AM
How to force a screen refresh? mkaluza Sony Reader Dev Corner 0 08-24-2008 04:54 PM
iLiad Screen refresh tomchek iRex Developer's Corner 7 07-27-2007 05:36 PM


All times are GMT -4. The time now is 03:43 PM.


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