[Kde-print-devel] KDE Printer Manager

Cristian Tibirna tibirna at kde.org
Sat Feb 24 06:06:28 CET 2007


On 23 February 2007 18:34, Till Kamppeter wrote:
> Cristian, can you help here?

Yes. Thanks for forwarding, Till.

> dwelch91 wrote:
> > Till-
> >
> > I noticed that in the KDE Print Manager, there is a link to "EPSON
> > inkjet" when you click Printer | Printer Tools... (see attached
> > screenshot). I am wondering if you knew how that link was placed in
> > there and how we would be able to get HP Device Manager linked there?

I will try to cover two senses of the "... how that link was placed in 
there..." although I didn't write the associated code at the time so part of 
this information will be guessing from my side.

Sense 1: history

The escputil support was introduced on 2001-12-24 (yes, Christmas Eve...) by 
Michael Goffioul, the brilliant mastermind/creator of the excellent KDE 
printing system, _as an example_ of use for the new generic mechanism of 
support for external printer tools.

As it often happens, no printer manufacturer picked this up (at least not 
openly/visibly) up to now (we are glad to see this changing), so the escputil 
example remained the only one available.


Sense 2: technicalities

In order to add support for an external printer tool in KDE's printer 
manager's source code, it is enough to follow the "escputil example" (I'd 
call it a live tutorial).

One has to create a new directory in the kdeprint source structure, under
kdeprint/tools [1]. In this directory, three things have to be added:

- a .desktop file that, upon installation in a properly configured KDE, will 
display a menu item in Printer|Printer Tools

- a wrapper class (.h and .cc files pair) has to be added, containing code 
similar to the one exemplified in [2] and [3]. This wrapper class will be 
used by the kdeprint mechanisms in order to display a dialog to the user, 
when the user will click on the menu item added by the previously 
mentioned .desktop file.

- the necessary building infrastructure (makefiles), different between KDE3 
and KDE4 at this point.
 
All this wrapping requires an independent (meaning not provided by KDE) 
executable or library (in the epson example it is the command-line tool known 
as escputil [4]), which has to be installed in the system and detected by the 
wrapper before use.

If the tool is installed and the wrapping explained above isadded to KDE's 
source, upon new compilation of the sources, the tool will automatically 
become available to KDEPrint users through the Printer|PrinterTools menu.

I hope this helps.

Thanks for your interest in KDE.

[1] http://websvn.kde.org/trunk/KDE/kdelibs/kdeprint/tools/
[2] 
http://websvn.kde.org/trunk/KDE/kdelibs/kdeprint/tools/escputil/escpwidget.cpp?revision=636243&view=markup
[3] 
http://websvn.kde.org/trunk/KDE/kdelibs/kdeprint/tools/escputil/escpwidget.h?revision=636243&view=markup
[4]escputil is a _GPL_ tool written by Robert Krawitz for the GIMP project and 
probably not affiliated with Epson: 
http://www.google.com/search?hl=en&c2coff=1&q=escputil.&btnG=Search

-- 
Cristian Tibirna
KDE developer .. tibirna at kde.org .. http://www.kde.org


More information about the Kde-print-devel mailing list