GtkPrinter

GtkPrinter — Represents a printer

Synopsis


#include <gtk/gtk.h>


            GtkPrinter;
            GtkPrintBackend;
GtkPrinter* gtk_printer_new                 (const gchar *name,
                                             GtkPrintBackend *backend,
                                             gboolean virtual_);
GtkPrintBackend* gtk_printer_get_backend    (GtkPrinter *printer);
const gchar* gtk_printer_get_name           (GtkPrinter *printer);
const gchar* gtk_printer_get_state_message  (GtkPrinter *printer);
const gchar* gtk_printer_get_description    (GtkPrinter *printer);
const gchar* gtk_printer_get_location       (GtkPrinter *printer);
const gchar* gtk_printer_get_icon_name      (GtkPrinter *printer);
gint        gtk_printer_get_job_count       (GtkPrinter *printer);
gboolean    gtk_printer_is_active           (GtkPrinter *printer);
gboolean    gtk_printer_is_virtual          (GtkPrinter *printer);
gboolean    gtk_printer_is_default          (GtkPrinter *printer);
gint        gtk_printer_compare             (GtkPrinter *a,
                                             GtkPrinter *b);


Object Hierarchy


  GObject
   +----GtkPrinter

  GObject
   +----GtkPrintBackend

Properties


  "accepts-pdf"          gboolean              : Read / Write / Construct Only
  "accepts-ps"           gboolean              : Read / Write / Construct Only
  "backend"              GtkPrintBackend       : Read / Write / Construct Only
  "icon-name"            gchararray            : Read
  "is-virtual"           gboolean              : Read / Write / Construct Only
  "job-count"            gint                  : Read
  "location"             gchararray            : Read
  "name"                 gchararray            : Read / Write / Construct Only
  "state-message"        gchararray            : Read

Signals


"details-acquired"
            void        user_function      (GtkPrinter *printer,
                                            gboolean    success,
                                            gpointer    user_data)      : Run last

Description

A GtkPrinter object represents a printer. You only need to deal directly with printers if you use the non-portable GtkPrintUnixDialog API.

A GtkPrinter allows to get status information about the printer, such as its description, its location, the number of queued jobs, etc. Most importantly, a GtkPrinter object can be used to create a GtkPrintJob object, which lets you print to the printer.

Printing support was added in GTK+ 2.10.

Details

GtkPrinter

typedef struct _GtkPrinter GtkPrinter;


GtkPrintBackend

typedef struct _GtkPrintBackend GtkPrintBackend;


gtk_printer_new ()

GtkPrinter* gtk_printer_new                 (const gchar *name,
                                             GtkPrintBackend *backend,
                                             gboolean virtual_);

Creates a new GtkPrinter.

name : the name of the printer
backend : a GtkPrintBackend
virtual_ : whether the printer is virtual
Returns : a new GtkPrinter

Since 2.10


gtk_printer_get_backend ()

GtkPrintBackend* gtk_printer_get_backend    (GtkPrinter *printer);

Returns the backend of the printer.

printer : a GtkPrinter
Returns : the backend of printer

Since 2.10


gtk_printer_get_name ()

const gchar* gtk_printer_get_name           (GtkPrinter *printer);

Returns the name of the printer.

printer : a GtkPrinter
Returns : the name of printer

Since 2.10


gtk_printer_get_state_message ()

const gchar* gtk_printer_get_state_message  (GtkPrinter *printer);

Returns the state message describing the current state of the printer.

printer : a GtkPrinter
Returns : the state message of printer

Since 2.10


gtk_printer_get_description ()

const gchar* gtk_printer_get_description    (GtkPrinter *printer);

Gets the description of the printer.

printer : a GtkPrinter
Returns : the description of printer

Since 2.10


gtk_printer_get_location ()

const gchar* gtk_printer_get_location       (GtkPrinter *printer);

Returns a description of the location of the printer.

printer : a GtkPrinter
Returns : the location of printer

Since 2.10


gtk_printer_get_icon_name ()

const gchar* gtk_printer_get_icon_name      (GtkPrinter *printer);

Gets the name of the icon to use for the printer.

printer : a GtkPrinter
Returns : the icon name for printer

Since 2.10


gtk_printer_get_job_count ()

gint        gtk_printer_get_job_count       (GtkPrinter *printer);

Gets the number of jobs currently queued on the printer.

printer : a GtkPrinter
Returns : the number of jobs on printer

Since 2.10


gtk_printer_is_active ()

gboolean    gtk_printer_is_active           (GtkPrinter *printer);

Returns whether the printer is currently active (i.e. accepts new jobs).

printer : a GtkPrinter
Returns : TRUE if printer is active

Since 2.10


gtk_printer_is_virtual ()

gboolean    gtk_printer_is_virtual          (GtkPrinter *printer);

Returns whether the printer is virtual (i.e. does not represent actual printer hardware, but something like a CUPS class).

printer : a GtkPrinter
Returns : TRUE if printer is virtual

Since 2.10


gtk_printer_is_default ()

gboolean    gtk_printer_is_default          (GtkPrinter *printer);

Returns whether the printer is the default printer.

printer : a GtkPrinter
Returns : TRUE if printer is the default

Since 2.10


gtk_printer_compare ()

gint        gtk_printer_compare             (GtkPrinter *a,
                                             GtkPrinter *b);

a :
b :
Returns :

Property Details

The "accepts-pdf" property

  "accepts-pdf"          gboolean              : Read / Write / Construct Only

TRUE if this printer can accept PDF.

Default value: TRUE


The "accepts-ps" property

  "accepts-ps"           gboolean              : Read / Write / Construct Only

TRUE if this printer can accept PostScript.

Default value: TRUE


The "backend" property

  "backend"              GtkPrintBackend       : Read / Write / Construct Only

Backend for the printer.


The "icon-name" property

  "icon-name"            gchararray            : Read

The icon name to use for the printer.

Default value: NULL


The "is-virtual" property

  "is-virtual"           gboolean              : Read / Write / Construct Only

FALSE if this represents a real hardware printer.

Default value: FALSE


The "job-count" property

  "job-count"            gint                  : Read

Number of jobs queued in the printer.

Allowed values: >= 0

Default value: 0


The "location" property

  "location"             gchararray            : Read

The location of the printer.

Default value: NULL


The "name" property

  "name"                 gchararray            : Read / Write / Construct Only

Name of the printer.

Default value: NULL


The "state-message" property

  "state-message"        gchararray            : Read

String giving the current state of the printer.

Default value: NULL

Signal Details

The "details-acquired" signal

void        user_function                  (GtkPrinter *printer,
                                            gboolean    success,
                                            gpointer    user_data)      : Run last

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 GtkPrinter on which the signal is emitted
success : TRUE if the details were successfully acquired
user_data : user data set when the signal handler was connected.

Since 2.10