On 03.03.2010 at 18:22, Michael Sweet wrote:

>>> Yup, and CUPS is available on just about every OS and Linux distribution 
>>> around...
>>
>> Thanks. Is there a short recipe how to do that, or where to look for it?
>
>
> Sure, here you go:
>
>      http://www.cups.org/documentation.php/api-cups.html

Thanks.

> You'll use the cupsGetDests function to get the list of printers, 
> cupsFreeDests to free that list, and cupsPrintFile to print something

Okay, that was the easy part :-) .  Tested and works, I get the printers
(destinations), and I can use cupsPrintFile to print a single *file*.

But, what is an "instance"? I couldn't find an explanation in the
programming docs, but maybe it is elsewhere...

> (or cupsCreateJob, cupsStartDocument, cupsWriteRequestData, and 
> cupsFinishDocument if you want to stream - that's available in CUPS 1.4 and 
> later...)

That would be the problematic part, I guess.  My not so old Ubuntu 9.04
has CUPS 1.3.9, thus I can't test it right now.  But that also means
that we can't assume that 1.4 is already widely used, so that we
can't rely on these functions.

Anyway, dynamically loading the necessary functions from libcups seems
appropriate, so that we don't get a dependency on libcups.

If we can't find libcups or any of the functions, we can fall back
to lpstat/lp (if we don't use lp for actual printing anyway).

> My printing sample code uses the CUPS API as well:
>
>      http://www.easysw.com/~mike/uiexperiments.html

Can we use the code for FLTK, and if yes, what copyright (yours or
the standard FLTK copyright)?

I take it that SpinBox == Fl_Spinner and can be replaced (didn't try
it though), but CollapsibleWindow would probably be a nice extension
for FLTK.

Having this, we could use your UI ideas to create Fl_Printer_Chooser
or something ... if others agree that this is feasible.  Opinions?

But, having said that, this will be a later step anyway, because I
will go on and make the current (fluid) version ready as my first
step.

-----
BTW.: pddemo-2005-12-16.tar.gz is incomplete.  Loading the .fl file
in fluid gives me:

pddemo.fl:69: icons/portrait.xbm : No such file or directory
pddemo.fl:73: icons/landscape.xbm : No such file or directory
pddemo.fl:77: icons/revportrait.xbm : No such file or directory
pddemo.fl:81: icons/seascape.xbm : No such file or directory

and shows a checker board background that is probably not
indended.

Albrecht
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to