Construct the LPR printer with explicit is-virtual, accepts-pdf and
accepts-ps properties so the backend advertises the formats it can
handle.
This follows the GTK2 LPR backend fix referenced by OpenBSD ports and
GNOME, using GTK2's GtkPrinter:is-virtual property name and keeping the
printer non-virtual as in the referenced patch.
Make sure to enable the LPR print backend when using this feature, for
example by setting gtk-print-backends in the user's GTK2 rc file:
gtk-print-backends = "file,cups,lpr"
For normal application startup, put this setting in ~/.gtkrc-2.0 so GTK2
applications pick it up automatically.
Ported-from: OpenBSD ports x11/gtk+2 patch-modules_printbackends_lpr_gtkprintbackendlpr_c
Resolve multiple compiler errors and warnings found on current toolchains.
Changes include:
- explicit type casts for subtype/base assignments
- legacy prototype cleanup
- test source fixes
- gail and CUPS backend build fixes
Restores successful compilation on current Linux systems.
Add parameter for specification of port to gtk_cups_connection_cups_new().
Use default port returned by ippPort() if the given port is lower than 0.
https://bugzilla.gnome.org/show_bug.cgi?id=693738
Show printers advertised by avahi on local network. CUPS
backend now looks for _ipps._tcp and _ipp._tcp services
offered by avahi. If it finds such a service (printer)
it requests its attributes through IPP_GET_PRINTER_ATTRIBUTES
ipp request and adds it to the list of printers. Such printer
behaves like a remote printer then.
If an avahi printer is a default printer then it is considered
default by the backend only if there is no local or remote
default printer.
This functionality is enabled when building Gtk+ with CUPS 1.6
or later because it replaces browsing protocol removed in CUPS 1.6.
https://bugzilla.gnome.org/show_bug.cgi?id=702455
gtk+ was trying to display already freed strings, leaking memory,
...I noticed this because I was getting weird blinking characters
as the status of my cups printers, and valgrind confirmed something
was wrong.
https://bugzilla.gnome.org/show_bug.cgi?id=683072
Reset state of CUPS requests correctly during authentization and
check CUPS requests for errors.
Don't initialize variables holding password and username with empty
string (#664640).
Check whether "Custom." prefix is already present in the name
of selected paper size. (#679883)
(cherry picked from commit be7752183eb07274b67036362f895b31aa28eb25)
Having refactored cups_request_printer_list_cb so that the cups
version-dependent block size is small enough to be handled in a single
ifdef, make the ifdef HAVE_CUPS_API_1_6 block
So that it can be passed as a single parameter to functions as we
extract-function to make cups_request_printer_list_cb more manageable.
Note that not all of the affected variables are changed in this
changeset. Those are in extracted functions and will be addressed in the
next two changes.
This commit fixes crash which occurs in Firefox, Thunderbird and Inkscape
during printing. This crash was caused because of wrong handling of Custom
CUPS options. (#543520)
gcc warns if you switch on values that are not part of the enum you're
switching on. So handle those cases in the default handler by using if
statments.
PS: Someone file a bug against cups about this?
Parse options job-sheets, job-hold-until and sides correctly.
Add get_lpoption_name() for translation of lpoption names to
gtk option names. Usable for options which values don't need
conversion (e.g. number-up, number-up-layout, job-billing
and job-priority).
Rename array option_names to ppd_option_names to reflect its
purpose better. Rename get_option_name() to get_ppd_option_name()
because of the same reason.
(cherry picked from commit 95e69afea83e6a43163a3c2b0d2928c9e646b77b)
CUPS backend shouldn't handle "connecting-to-device" state reason.
It shows "Printer '%s' may not be connected" for this state,
which is not true in almost all cases. Better is to use
"printer-state-message" which contains correct message (#622011).
(cherry picked from commit 998459afb7ae8be77c138a879d82765785f3f54e)
Go to the next address given by CUPS if we fail to connect to
previous address (#603637).
(cherry picked from commit f8ac1231923fe77eb243fe2333e83b03c29c8868)
Reading of PPD files collides with getting list of printers.
It helps to give higher priority to getting of PPDs than to
getting list of printers (#614581).
Either g_type_register_static_simple (used by G_DEFINE_TYPE_EXTENDED)
and G_IMPLEMENT_INTERFACE use automatic variables for GTypeInfo and
GInterfaceInfo structs, while tutorials and source code often use
static variables. This commit consistently adopts the former method.
https://bugzilla.gnome.org/show_bug.cgi?id=600158