| Top |
| CtkPrinter * | ctk_printer_new () |
| CtkPrintBackend * | ctk_printer_get_backend () |
| const gchar * | ctk_printer_get_name () |
| const gchar * | ctk_printer_get_state_message () |
| const gchar * | ctk_printer_get_description () |
| const gchar * | ctk_printer_get_location () |
| const gchar * | ctk_printer_get_icon_name () |
| gint | ctk_printer_get_job_count () |
| gboolean | ctk_printer_is_active () |
| gboolean | ctk_printer_is_paused () |
| gboolean | ctk_printer_is_accepting_jobs () |
| gboolean | ctk_printer_is_virtual () |
| gboolean | ctk_printer_is_default () |
| gboolean | ctk_printer_accepts_ps () |
| gboolean | ctk_printer_accepts_pdf () |
| GList * | ctk_printer_list_papers () |
| gint | ctk_printer_compare () |
| gboolean | ctk_printer_has_details () |
| void | ctk_printer_request_details () |
| CtkPrintCapabilities | ctk_printer_get_capabilities () |
| CtkPageSetup * | ctk_printer_get_default_page_size () |
| gboolean | ctk_printer_get_hard_margins () |
| gboolean | (*CtkPrinterFunc) () |
| void | ctk_enumerate_printers () |
| gboolean | accepting-jobs | Read |
| gboolean | accepts-pdf | Read / Write / Construct Only |
| gboolean | accepts-ps | Read / Write / Construct Only |
| CtkPrintBackend * | backend | Read / Write / Construct Only |
| char * | icon-name | Read |
| gboolean | is-virtual | Read / Write / Construct Only |
| int | job-count | Read |
| char * | location | Read |
| char * | name | Read / Write / Construct Only |
| gboolean | paused | Read |
| char * | state-message | Read |
A CtkPrinter object represents a printer. You only need to deal directly with printers if you use the non-portable CtkPrintUnixDialog API.
A CtkPrinter allows to get status information about the printer, such as its description, its location, the number of queued jobs, etc. Most importantly, a CtkPrinter object can be used to create a CtkPrintJob object, which lets you print to the printer.
Printing support was added in CTK+ 2.10.
CtkPrinter * ctk_printer_new (const gchar *name,CtkPrintBackend *backend,gboolean virtual_);
Creates a new CtkPrinter.
Since: 2.10
CtkPrintBackend *
ctk_printer_get_backend (CtkPrinter *printer);
Returns the backend of the printer.
Since: 2.10
const gchar *
ctk_printer_get_name (CtkPrinter *printer);
Returns the name of the printer.
Since: 2.10
const gchar *
ctk_printer_get_state_message (CtkPrinter *printer);
Returns the state message describing the current state of the printer.
Since: 2.10
const gchar *
ctk_printer_get_description (CtkPrinter *printer);
Gets the description of the printer.
Since: 2.10
const gchar *
ctk_printer_get_location (CtkPrinter *printer);
Returns a description of the location of the printer.
Since: 2.10
const gchar *
ctk_printer_get_icon_name (CtkPrinter *printer);
Gets the name of the icon to use for the printer.
Since: 2.10
gint
ctk_printer_get_job_count (CtkPrinter *printer);
Gets the number of jobs currently queued on the printer.
Since: 2.10
gboolean
ctk_printer_is_active (CtkPrinter *printer);
Returns whether the printer is currently active (i.e. accepts new jobs).
Since: 2.10
gboolean
ctk_printer_is_paused (CtkPrinter *printer);
Returns whether the printer is currently paused. A paused printer still accepts jobs, but it is not printing them.
Since: 2.14
gboolean
ctk_printer_is_accepting_jobs (CtkPrinter *printer);
Returns whether the printer is accepting jobs
Since: 2.14
gboolean
ctk_printer_is_virtual (CtkPrinter *printer);
Returns whether the printer is virtual (i.e. does not represent actual printer hardware, but something like a CUPS class).
Since: 2.10
gboolean
ctk_printer_is_default (CtkPrinter *printer);
Returns whether the printer is the default printer.
Since: 2.10
gboolean
ctk_printer_accepts_ps (CtkPrinter *printer);
Returns whether the printer accepts input in PostScript format.
Since: 2.10
gboolean
ctk_printer_accepts_pdf (CtkPrinter *printer);
Returns whether the printer accepts input in PDF format.
Since: 2.10
GList *
ctk_printer_list_papers (CtkPrinter *printer);
Lists all the paper sizes printer
supports.
This will return and empty list unless the printer’s details are
available, see ctk_printer_has_details() and ctk_printer_request_details().
a newly allocated list of newly allocated CtkPageSetup s.
[element-type CtkPageSetup][transfer full]
Since: 2.12
gint ctk_printer_compare (CtkPrinter *a,CtkPrinter *b);
Compares two printers.
Since: 2.10
gboolean
ctk_printer_has_details (CtkPrinter *printer);
Returns whether the printer details are available.
Since: 2.12
void
ctk_printer_request_details (CtkPrinter *printer);
Requests the printer details. When the details are available,
the “details-acquired” signal will be emitted on printer
.
Since: 2.12
CtkPrintCapabilities
ctk_printer_get_capabilities (CtkPrinter *printer);
Returns the printer’s capabilities.
This is useful when you’re using CtkPrintUnixDialog’s manual-capabilities setting and need to know which settings the printer can handle and which you must handle yourself.
This will return 0 unless the printer’s details are available, see
ctk_printer_has_details() and ctk_printer_request_details().
Since: 2.12
CtkPageSetup *
ctk_printer_get_default_page_size (CtkPrinter *printer);
Returns default page size of printer
.
Since: 2.14
gboolean ctk_printer_get_hard_margins (CtkPrinter *printer,gdouble *top,gdouble *bottom,gdouble *left,gdouble *right);
Retrieve the hard margins of printer
, i.e. the margins that define
the area at the borders of the paper that the printer cannot print to.
Note: This will not succeed unless the printer’s details are available,
see ctk_printer_has_details() and ctk_printer_request_details().
printer |
||
top |
a location to store the top margin in. |
[out] |
bottom |
a location to store the bottom margin in. |
[out] |
left |
a location to store the left margin in. |
[out] |
right |
a location to store the right margin in. |
[out] |
Since: 2.20
gboolean (*CtkPrinterFunc) (CtkPrinter *printer,gpointer data);
The type of function passed to ctk_enumerate_printers().
Note that you need to ref printer
, if you want to keep
a reference to it after the function has returned.
Since: 2.10
void ctk_enumerate_printers (CtkPrinterFunc func,gpointer data,GDestroyNotify destroy,gboolean wait);
Calls a function for all CtkPrinters.
If func
returns TRUE, the enumeration is stopped.
func |
a function to call for each printer |
|
data |
user data to pass to |
|
destroy |
function to call if |
|
wait |
if |
Since: 2.10
“accepting-jobs” property “accepting-jobs” gboolean
This property is TRUE if the printer is accepting jobs.
Owner: CtkPrinter
Flags: Read
Default value: TRUE
Since: 2.14
“accepts-pdf” property “accepts-pdf” gboolean
TRUE if this printer can accept PDF.
Owner: CtkPrinter
Flags: Read / Write / Construct Only
Default value: FALSE
“accepts-ps” property “accepts-ps” gboolean
TRUE if this printer can accept PostScript.
Owner: CtkPrinter
Flags: Read / Write / Construct Only
Default value: TRUE
“backend” property“backend” CtkPrintBackend *
Backend for the printer.
Owner: CtkPrinter
Flags: Read / Write / Construct Only
“icon-name” property “icon-name” char *
The icon name to use for the printer.
Owner: CtkPrinter
Flags: Read
Default value: ""
“is-virtual” property “is-virtual” gboolean
FALSE if this represents a real hardware printer.
Owner: CtkPrinter
Flags: Read / Write / Construct Only
Default value: FALSE
“job-count” property “job-count” int
Number of jobs queued in the printer.
Owner: CtkPrinter
Flags: Read
Allowed values: >= 0
Default value: 0
“location” property “location” char *
The location of the printer.
Owner: CtkPrinter
Flags: Read
Default value: ""
“name” property “name” char *
Name of the printer.
Owner: CtkPrinter
Flags: Read / Write / Construct Only
Default value: ""
“paused” property “paused” gboolean
This property is TRUE if this printer is paused.
A paused printer still accepts jobs, but it does
not print them.
Owner: CtkPrinter
Flags: Read
Default value: FALSE
Since: 2.14
“details-acquired” signalvoid user_function (CtkPrinter *printer, gboolean success, gpointer user_data)
Gets emitted in response to a request for detailed information
about a printer from the print backend. The success
parameter
indicates if the information was actually obtained.
printer |
the CtkPrinter on which the signal is emitted |
|
success |
|
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.10