Work on GNOME Books has continued, and actually a great update is behind the door. Let’s get in…
When most of the functionality in the Read Mode was implemented it was time to start working on the Overview Mode. I am very excited to write about this update. The app is getting real good, and it is starting to fulfill some basic requirements making the user experience better.
Overview Mode lists all the eBooks in the epub format that are part of your Books folder in your $HOME directory. Overview Mode is showing the cover of the eBook. Books can be listed in two modes, as a list and as a grid of icons.
Later on, some more information is going to be shown in the list mode. An interesting feature would also be to add a book details dialog, which will show all the information about the book.
By clicking one of the books a Read Mode opens, with the contents of the chosen book.
Read Mode was also changed with some design improvements. Title bar is updating with the book title. Icons for loading table of contents and page numbers (which are hopefully going to be discard in the future) are part of the title bar.
Hope you enjoyed this short post. The next step would be to create a roadmap towards the goal, so expect my update soon.
Google Summer of Code was an incredible experience, and I would like to give special thanks to Google for the sponsorship. This was a great opportunity to finally get involved in the FOSS world, and to start contributing to GNOME. My mentor, Cosimo Cecchi was a great support, helper, and teacher, so thank you Cosimo for your time, patience and knowledge transfer.
As a reminder, my project for GNOME is to develop an application for reading eBooks, titled ‘GNOME Books’. The main focus during this phase of Books development was to get the most of the functionality in the Read Mode. The first format which was chosen to support was EPUB, as it is a very popular standard among eBooks. The core application code itself is designed to have a formal separation of backend and frontend logic. The backend, so called GNOME Books Library is focused on providing the core object model & operation, and the interaction with the external libraries like epub.js. The frontend, or GJS Books Application builds on this backend, to produce a GTK based user interface.
For the easier understanding of the following text the image below is showing the main components of the GNOME Books Application with the libraries.
GNOME BOOKS LIBRARY
GJS BOOKS APPLICATION
GJS Books application is based on GtkApplication class which handles aspects of GTK+ application. It exports actions and menus, and manages a list of toplevel windows whose life-cycle is automatically tied to the life-cycle of the application.
By using introspected library application can load and render the eBook and present it in the window, with the WebKit WebView. Some extra functionality which is implemented is controlling the Read Mode.
It was difficult to build the application ‘manually’ as it’s complexity reached a certain size. At that point I started learning about an awesome build system, autotools aka the GNU build system. After producing autotools and getting the project build it was much easier to continue the development.
You can get the code from the git repository . Open the README file and follow the instructions.
There is an example eBook which is going to be loaded by clicking Load Book button. When the mouse is moved navigation controls will show up, and allow you to change the pages. You can also jump to other chapters by clicking Contents button in the navigation bar. This is the temporary look of the application. Later on, the buttons in the top panel are going to be removed, and displaced.
The development is still in the progress, so there is many new features coming up soon.
End of the Google Summer of Code does not mean the end of the project. There is many more ideas left to realize. Below is the list of the next steps:
Solution to the asynchronous bug for the interaction between the WebKit JS and the Promise RSVP library used by ePub.js
Overview mode and integration with GNOME Documents
GNOME Books integration with an existing store
GNOME Books design
Very interesting parts of the GNOME Books development are in front of us. I will continue updating You about new features and hopefully, very soon, we are going to have a new application in GNOME.
“Grain by grain – a loaf; stone by stone – a palace.” – George Bernard Shaw
Here is a short status of the work done from the previous report. So let’s not waste too many word…
As mentioned in the previous report GNOME Books Library exposes WebKit WebView and the functionality needed for the interaction with epub.js. There are some new features. The library implements navigation bar and page controlling (total number of pages, status of the current page) as well as table of contents (links to the book chapters).
While working on the interaction between WebKit and epub.js certain issues are present. Epub.js uses RSVP.js, tools for organizing asynchronous code, by using Promises. There is no such functionality in WebKit, which causes a bad interaction between the WebKit JS execution and the epub.js. Because of that some extra steps in the user interaction were added, such as buttons to Load Table of Contents and Load Page Number. This should be further discussed and improved, so the user can achieve it’s task in the least number of steps.
Google Summer of Code is close to it’s end. An overview post with the pictures of the work done during GSoC is on it’s way… stay tuned ;).
… is a short description of my first GUADEC. GNOME Foundation sponsored me to attend GUADEC, the main conference for GNOME enthusiasts. I’m really happy that I was part of this event and that I had a chance to meet and to talk with the great minds.
GUADEC was for me:
Arrived on the second day and sliding through the beautiful streets of Strasbourg
Interns’ Lightning Talks, presenting my work for GNOME
Great talks by Debarshi Ray, Benjamin Otte, Jasper St. Pierre, Allan Day, Sriram Ramkrishna, etc.
Looking behind my back, a very interesting part is done. Let me tell you what I did during this period and what is coming.
A library for handling interaction with the WebKit WebView, which could be called GNOME Books Library,
GNOME JS application.
GNOME BOOKS LIBRARY
The C library is exposing “controller” object with the methods which are calling into the WebKit WebView. WebKit View is then calling JS functions to execute the method.
The most challenging aspect was building the whole thing. The best supported build system is the autotools aka the GNU build system, with autoconf, automake and libtool.
The structure of the project at this point can be seen below.
GJS Books application is based on GtkApplication class which handles aspects of GTK+ application. It exports actions and menus and manages a list of toplevel windows whose life-cycle is automatically tied to the life-cycle of the application.
By using introspected library application can load and render the book and present it in the window, with the WebKit WebView. Some extra functionality which is implemented is controlling the reading more.
The repository of the GNOME Books application can be found on github .
I am very glad to say that I’ll attend this years edition of GUADEC in Strasbourg, France. As a participant of Google Summer of Code I will give a short introduction of my application during the interns’ lightning talks session.
Add more functionality in the library to navigate the book
Integrate Books application with the document discovery part that Documents partly does
 github repository of the GNOME Books application: https://github.com/martamilakovic/gnome-books/tree/master
This report is important because basis are now lined up and the process of building the application can start.
“LAST” TOUCH TO THE URI SCHEME
As the previous report said URI schemes are promising, now I can confirm that statement. The whole idea about URI schemes is pretty simple. By registering one I’m able to load epub.js library which renders the content of the .ePub eBook by loading local files such as html, css, images, etc. Using URI scheme I have successfully overcome the cross origin issue. A small problem which was described in the previous post was actually solved by defining the correct path of the eBook. A relative path to the unpacked eBook is given to epub.js, which builds the absolute path. It does that simply by getting current location of the document. Having this information all the relative links within the book are detected and replaced with the absolute path. This way the requests are made with the registered URI scheme. This should also be used for loading .epub file, as epub.js supports unpacking.
The overall look over the application structure will be explain, but further improvements and details will be given later on as this is still in the working state.
Application GNOME Books is going to have a WebKit view, subclass that loads epub.js. This class needs to expose “controller” object with the methods to control the interaction. The methods are used for loading an eBook file, controlling the reading mode (next page, previous page, pagination, etc). The WebKit view would then call JS functions to execute methods.
INTERACTION EPUB.JS <-> WEBKIT
I’m going to tell you briefly about the work and other stuff that happened from the previous report. Lets see…
As a conclusion I can say that this method is promising, and at this point I’m able to read an eBook in the .epub format without running the server, but some more improvements have to be done in order to show pictures and to apply the styles from the style-sheets.
The repository of the test application can be found on github .
Finish the URI scheme
Manage the interaction between library and WebKit
Croatian Linux Users’ Convention
Last week I received an email from Marina Zhurakhinskaya. She invited me to join Croatia’s biggest and oldest FLOSS conference DORS/CLUC as a speaker in the round table panel on topic “Women in FLOSS technology world” together with Jasna Benčić, Elizabeth Krumbach Joseph, Ana Mandić, and Lucija Pilić. I was very excited about this opportunity and I gladly accepted the call. Today was the first day of the conference, and our round table took place too. We talked about different experiences of the girls in the FLOSS world and in IT in general, we also discussed how to encourage women to involve more in this exciting world, and we promoted different opportunities that are out there.
 github repository of the test application: https://github.com/martamilakovic/gnome-books