GSoC'17 with the Linux Foundation

My contributions to the Common Printing Dialog project

About the project

The Problem

Printing out of desktop applications is managed by many very different dialogs, mostly depending on which GUI toolkit is used for an application. Some applications like even have their own dialogs, which expose different kind of printing options. This is confuses users a lot, having them to do the printing operation in many different ways. In addition, many dialogs are missing important features.

The Solution

The Common Printing Dialog project aims to solve these problems and provide a uniform printing experience on Linux Desktop Environments. It aims to provide a GUI toolkit independent and modular design so that print dialogs on different desktop environments can offer the same funtionality, as they would all make use of the same print backends. See High level design for details.

High level design

Here’s a bird’s eye view of how the different components of CPD fit together:

Bird's eye view

  • The print dialog gets the relevant info from the print backends. Each respective backend provides its printer list and information to the CPD.
  • The dialog frontend and backend communicate via D-Bus
  • The Frontend and Backend CPD libraries facilitate this communication.
  • The print backends and the CPD libraries are toolkit independent , thus allowing uniform printing experience for the user.

My contributions

I have developed the following components of the common-print-dialog:

CPD Libraries

The CPD Libraries allow the print dialog frontends and backends to communicate via D-Bus. It comprises of :

  • The Frontend library, which the dialog frontends must use.
  • The Backend library, which any print backend should use.

The frontend library provides an implementation and wrapper for the org.openprinting.PrintFrontend interface. It also provides additional functionality so that the dialog GUI can deal with printers, settings , options , jobs, etc. in a high level manner, and also, need not be aware of any D-Bus details.

The backend library provides the dbus interface functions to communicate with the frontend. It is based on the org.openprinting.PrintBackend interface.

Dependencies

  • CUPS : Version >= 2.2
    Install bleeding edge release from here. (Preferable!)
  • GLIB 2.0 : sudo apt install libglib2.0-dev

Installation

  • Get the code :
$ git clone https://github.com/NilanjanaLodh/OpenPrinting_CPD_Libraries
  • Install the libraries
$ ./autogen.sh
$ ./configure 
$ make
$ sudo make install
$ sudo ldconfig

The project also includes a sample command line frontend that you can use to test whether the installed library and print backends work as expected. See here for more details.

Using the frontend and backend libraries

Use the frontend libraries if you are developing a dialog frontend:
It has pkg-config support: pkg-config --cflags --libs CPDFrontend.
Include CPDFrontend.h in your code.

Similarly, to develop a backend you need to use the CPDBackend library. It too has pkg-config support: pkg-config --cflags --libs CPDBackend. Include CPDBackend.h in your code.

CUPS Backend

The CUPS backend is available as an autoactivable dbus service called org.openprinting.Backend.CUPS, which is woken up when any frontend is present and exits immediately when all frontends have exited. Also, as it is developed in accordance with the latest CUPS API(2.2.*) , it also automatically supports ipp printers, eliminating the need for a separate IPP backend.
It uses the CPD Backend Library for dbus communication, thus is an implementation of the org.openprinting.PrintBackend interface.

Dependencies

Installation

  • Get the code :
$ git clone https://github.com/NilanjanaLodh/OpenPrinting_CUPS_Backend
  • Install the backend
$ ./autogen.sh
$ ./configure 
$ make
$ sudo make install

Acknowledgements

Thanks a lot to my mentors Till Kamppeter and Aveek Basu for their invaluable guidance throughout this project!

Mentor details

  • Till Kamppeter : Linux Foundation Org Admin(Canonical)
    • email : till [dot] kamppeter [at] gmail [dot] com
  • Aveek Basu : Linux Foundation Org Admin(Lexmark)
    • email : basu [dot] aveek [at] gmail [dot] com

Contact me