Giter Site home page Giter Site logo

michaelweghorn / cpdb-libs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openprinting/cpdb-libs

0.0 0.0 0.0 1.05 MB

Frontend and Backend Libraries for the common printing dialog.

License: MIT License

Shell 0.72% C 94.42% Makefile 1.73% M4 3.13%

cpdb-libs's Introduction

Frontend/Backend Communication Libraries for the Common Print Dialog Backends

This repository hosts the code for frontend and backend libraries for the Common Printing Dialog Backends (CPDB) project. These libraries allow the CPDB frontends (the print dialogs) and backends (the modules communicating with the different printing systems) to communicate with each other via D-Bus.

The frontend library also provides some extra functionality to deal with Printers, Settings, etc. in a high level manner.

Background

The Common Print Dialog Backends (CPDB) project of OpenPrinting is about separating the print dialogs of different GUI toolkits and applications (GTK, Qt, LibreOffice, Firefox, Chromium, ...) from the different print technologies (CUPS/IPP, cloud printing services, ...) so that they can get developed independently and so always from all applications one can print with all print technologies and changes in the print technologies get supported quickly.

If one opens the print dialog, the dialog will not talk directly to CUPS, a cloud printing service, or any other printing system. For this communication there are the backends. The dialog will find all available backends and sends commands to them, for listing all available printers, giving property/option lists for the selected printer, and printing on the selected printer. This communication is done via D-Bus. So the backends are easily exchangeable and for getting support for a new print technology only its backend needs to get added.

Dependencies

  • autoconf
  • autopoint
  • glib 2.0
  • libdbus
  • libtool

On Debian based distros, these can be installed by running:
sudo apt install autoconf autopoint libglib2.0-dev libdbus-1-dev libtool

Build and installation

$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
$ sudo ldconfig

Also install at least one of the backends (cpdb-backend-...).

NOTE: The communication protocol between frontends and backends has changed (Job data streaming via domain socket, printer list filteringvia D-Bus methods). Therefore use backends of at least version 2.0b6.

Testing the library

The project also includes a sample command line frontend (using the cpdb-libs-frontend API) that you can use to test whether the installed libraries and print backends work as expected.

$ cpdb-text-frontend

The list of printers from various print technologies should start appearing automatically. Type help to get the list of available commands. Make sure to stop the frontend using the stop command only.

The library also provides support for serializing a printer. Use the pickle-printer command to serialize it, and run the cpdb-pickle-print executable after that to deserialize and test it.

Using the libraries for developing print backends and dialogs.

To develop a frontend client (eg. a print dialog), use the libcpdb and libcpdb-frontend libraries.

pkg-config support: pkg-config --cflags --libs cpdb and pkg-config --cflags --libs cpdb-frontend. Header file: cpdb/frontend.h

Similarly, to develop a print backend, you need to use the only the libcpdb library. pkg-config support: pkg-config --cflags --libs cpdb. Header file: cpdb/backend.h or simply only cpdb/cpdb.h.

cpdb-libs's People

Contributors

nilanjanalodh avatar tillkamppeter avatar tinytrebuchet avatar metabiswadeep avatar ayush268 avatar yashsriv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.