[sugar] eBook ideas

Don Hopkins dhopkins
Sat Mar 31 00:25:31 EDT 2007


Marco Pesenti Gritti wrote:
> Hello,
>
> what is the internet archive?
>
>   
The Internet Archive (http://www.archive.org) is scanning many books and 
putting them online as PDF files. They also archive other things like 
web pages and music and software, but this project is to make a good 
eBook reader for the scanned books. They are available in several 
formats including PDF and DJVW. We considered using DJVW (which evince 
supports), but decided to focus on PDF, because it is more widely used 
and supported.
> This is not quite correct. The xbook activity binds the evince view API,
> it's not a separate process.
>   
I didn't realize evince was usable as a library integrated with Python 
-- that's great!
I wasn't able to find the evince module in the sugar source tree, but 
I'm not completely up to date.
Has it been checked in recently, or can I download it from somewhere?
> I think binding poppler is probably the right thing to do now, given the
> Ebook requirements and how the sugar graphics API is shaping up.
>
>   
Yes, let's give Cairo lots of exercise, and make it better, smaller and 
faster!
Poppler calls Cairo directly to do the rendering, without using any 
intermediate bitmaps.
> I'm not that happy about SWIG, since poppler has a glib API and most of
> sugar API is gobject based. Though using poppler directly might give us
> more flexibility. In the end I don't think it's a big issue, so I'm fine
> with whatever it's easier for you.
>
>   
I'm using SWIG because I'm familiar with it, but I haven't figured out 
the glib python wrapping stuff yet.
If glib wrappers would "just work" without much more work, then it 
sounds like that would be worth doing.
Is there a simple project that uses glib python bindings, that I can use 
as an example?
Where's can I find some more documentation about glib python wrappers?

> Awesome! Do you have a public repository for this work? As soon as it
> doesn't regress xbook functionalities I'd like to get it into the
> builds.
>
> Marco
>
>   
I haven't packaged it up and put it into a repository yet, but that's 
high on my todo list.
I have my own svn server that I can publish the code on, but I'd be glad 
to check them into the official repository, once they projects configure 
nicely and don't break anything.

It's factored into two projects: the python poppler module and the sugar 
ebook activity.
The poppler module shouldn't effect xbook, but we should figure out 
whether it's best for me to integrate the work I'm doing for the 
Internet Archive with the existing xbook activity, or make a separate 
activity for now (based on xbook), and merge them later (or not).

I'm going to be adding some Internet Archive library browsing, searching 
and ebook downloading functionality, using RSS feeds.
Since search results are returned as RSS: Do you think I should I try to 
use penguintv to browse RSS feeds of book search results? Run it as a 
separate activity that switches back to the ebook reader when you click 
on a link to a pdf file? Or would it be easier (and better integrated) 
to embed the rss reader in the ebook interface? Is there a way to 
register the ebook reader activity as the handler of the pdf content 
type, so both the web browser and rss reader will switch to it to read 
PDF files?

Now that we can read SVG as well as PDF (and PNG of course) and render 
it with Cairo, it would be nice to have a generic high-level 
media-type-independent interface, like a resource manager, that knows 
how to load, measure and render icons (or pages), and deal with caching.

I ran across something like that, IconCache in sugar.graphics.canvasicon 
module, but currently it only knows about svg files.

IconCache could be refactored and extended into a resource manager that 
supports any kind of image, and optionally support caching scaled 
bitmaps as well as direct Cairo rendering. It could support icons with 
multiple frames (for pdf document pages, animated gif frames, etc), and 
application could tell it how aggressively to cache bitmaps and data 
structures in memory (or turn off caching so it always reads the file 
from disk). The operating system should notify applications when memory 
or disk space is low, and the resource manager can flush its caches as 
appropriate.

    -Don



More information about the Sugar-devel mailing list