After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 606618 - Make public: gtk_printer_get_options and gtk_printer_get_settings_from_options
Make public: gtk_printer_get_options and gtk_printer_get_settings_from_options
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Printing
2.19.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-01-11 11:12 UTC by Rafal Luzynski
Modified: 2018-02-10 04:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
This is the minimum patch which makes the functions public. (7.04 KB, patch)
2010-01-20 23:49 UTC, Rafal Luzynski
none Details | Review
Add documentation to the previous patch (3.85 KB, patch)
2010-01-20 23:54 UTC, Rafal Luzynski
none Details | Review

Description Rafal Luzynski 2010-01-11 11:12:29 UTC
For my project I need these functions to be public:

- gtk_printer_get_options (now known as _gtk_printer_get_options),
- gtk_printer_get_settings_from_options (now known as _gtk_printer_get_settings_from_options).

These functions are required to obtain and then update the printer settings non-interactively (without GtkPrintUnixDialog).

I am already working on the patch which does this so none of you has to bother about this, you can even consider me as assigned if you want. But some hints may be helpful for me:

- If I make the functions public, should I also write a short documentation for them?
- If I make the doc for them, should I also write a doc for GtkPrinterOptionSet which is referenced by _gtk_printer_get_settings_from_options?
- If I make the doc for GtkPrinterOptionSet should I make it public together with all other symbols defined in gtkprinteroptionset.[ch] and consequently also in gtkprinteroption.[ch] ?
Comment 1 Christian Persch 2010-01-11 12:56:14 UTC
Which project is that for? Why do you need access to the printer options (which purely exist to interface the print settings with the gtkprintunixdialog) instead of setting the print settings in a GtkPrintSettings object?
Comment 2 Rafal Luzynski 2010-01-12 12:07:42 UTC
This is a commercial and not yet released project so I am unable to describe all the details. I need these functions to obtain some capabilities of the printer, including:

- list of available paper sources,
- list of the paper types,
- list of supported printer resolutions,
- list of the "Pages per sheet" values.

These data will be processed by the non-GTK applications and for that reason I cannot use the GtkPrintUnixDialog. Also I need to obtain current (default?) setup from the printer. Current GtkPrintSettings API is not sufficient because:

- for each option it contains the user's choice but usually not the list of all available choices,
- it should be created by and obtained from GtkPrintUnixDialog but I don't use it,
- it can be passed to GtkPrintJob which then forwards it to GtkPrinter but there is no way to obtain the settings back from the GtkPrinter unless we use _gtk_printer_get_options and _gtk_printer_get_settings_from_options; the function gtk_print_job_get_settings returns the pointer that has been passed to gtk_print_job_new rather than the actual printer's settings and still requires the job object to be created.

Alternatively, I would require a set of functions like gtk_printer_list_{paper_sources|paper_types|resolutions|n_ups}, probably some of them with the variants: returning the list of IDs and the list of display names. But I would help myself with it if I had just the reliable way to obtain the options and the settings from the printer.
Comment 3 Rafal Luzynski 2010-01-20 23:49:35 UTC
Created attachment 151894 [details] [review]
This is the minimum patch which makes the functions public.
Comment 4 Rafal Luzynski 2010-01-20 23:54:14 UTC
Created attachment 151895 [details] [review]
Add documentation to the previous patch

This patch should be applied after the previous one because it adds the documentation to and improves security of the functions added by the first patch. Please check for correct language of the docs.

I am going to prepare the third patch which makes GtkPrinterOptionSet and GtkPrinterOption public and documented because they are used by the functions in subject.
Comment 5 Rafal Luzynski 2010-01-20 23:57:19 UTC
I am not sure if I understood the intentions of the author(s) of these functions correctly, the docs may be totally incorrect.
Comment 6 Matthias Clasen 2018-02-10 04:36:14 UTC
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and
still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue
for it.