class Gtk::Printer

Overview

A Gtk::Printer object represents a printer.

You only need to deal directly with printers if you use the non-portable Gtk::PrintUnixDialog API.

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

Defined in:

lib/gi-crystal/src/auto/gtk-4.0/printer.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class GObject::Object

bind_property(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags) : GObject::Binding bind_property, bind_property_full(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags, transform_to : GObject::Closure, transform_from : GObject::Closure) : GObject::Binding bind_property_full, data(key : String) : Pointer(Void)? data, finalize finalize, freeze_notify : Nil freeze_notify, getv(names : Enumerable(String), values : Enumerable(_)) : Nil getv, notify(property_name : String) : Nil notify, notify_by_pspec(pspec : GObject::ParamSpec) : Nil notify_by_pspec, notify_signal notify_signal, property(property_name : String, value : _) : Nil property, qdata(quark : UInt32) : Pointer(Void)? qdata, ref_count : UInt32 ref_count, run_dispose : Nil run_dispose, set_data(key : String, data : Pointer(Void)?) : Nil set_data, set_property(property_name : String, value : _) : Nil set_property, steal_data(key : String) : Pointer(Void)? steal_data, steal_qdata(quark : UInt32) : Pointer(Void)? steal_qdata, thaw_notify : Nil thaw_notify, to_unsafe : Pointer(Void) to_unsafe, watch_closure(closure : GObject::Closure) : Nil watch_closure

Constructor methods inherited from class GObject::Object

cast(obj : GObject::Object) : self cast, cast?(obj : GObject::Object) : self? cast?, new(pointer : Pointer(Void), transfer : GICrystal::Transfer)
new
new
, newv(object_type : UInt64, parameters : Enumerable(GObject::Parameter)) : self newv

Class methods inherited from class GObject::Object

compat_control(what : UInt64, data : Pointer(Void)?) : UInt64 compat_control, g_type : UInt64 g_type, interface_find_property(g_iface : GObject::TypeInterface, property_name : String) : GObject::ParamSpec interface_find_property, interface_list_properties(g_iface : GObject::TypeInterface) : Enumerable(GObject::ParamSpec) interface_list_properties

Constructor Detail

def self.new(name : String, backend : Gtk::PrintBackend, virtual_ : Bool) : self #

Creates a new Gtk::Printer.


def self.new #

Initialize a new Printer.


def self.new(*, accepting_jobs : Bool? = nil, accepts_pdf : Bool? = nil, accepts_ps : Bool? = nil, icon_name : String? = nil, is_virtual : Bool? = nil, job_count : Int32? = nil, location : String? = nil, name : String? = nil, paused : Bool? = nil, state_message : String? = nil) #

Class Method Detail

def self.g_type : UInt64 #

Returns the type id (GType) registered in GLib type system.


Instance Method Detail

def accepting_jobs? : Bool #

def accepts_pdf : Bool #

Returns whether the printer accepts input in PDF format.


def accepts_pdf=(value : Bool) : Bool #

def accepts_pdf? : Bool #

def accepts_ps : Bool #

Returns whether the printer accepts input in PostScript format.


def accepts_ps=(value : Bool) : Bool #

def accepts_ps? : Bool #

def backend : Gtk::PrintBackend #

Returns the backend of the printer.


def capabilities : Gtk::PrintCapabilities #

Returns the printer’s capabilities.

This is useful when you’re using Gtk::PrintUnixDialog’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 Gtk::Printer#has_details and Gtk::Printer#request_details.


def compare(b : Gtk::Printer) : Int32 #

Compares two printers.


def default_page_size : Gtk::PageSetup #

Returns default page size of @printer.


def description : String #

Gets the description of the printer.


def details_acquired_signal #

def hard_margins(top : Float64, bottom : Float64, left : Float64, right : Float64) : Bool #

Retrieve the hard margins of @printer.

These are 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 Gtk::Printer#has_details and Gtk::Printer#request_details.


def hard_margins_for_paper_size(paper_size : Gtk::PaperSize, top : Float64, bottom : Float64, left : Float64, right : Float64) : Bool #

Retrieve the hard margins of @printer for @paper_size.

These are 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 Gtk::Printer#has_details and Gtk::Printer#request_details.


def has_details : Bool #

Returns whether the printer details are available.


def icon_name : String #

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


def is_accepting_jobs : Bool #

Returns whether the printer is accepting jobs


def is_active : Bool #

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


def is_default : Bool #

Returns whether the printer is the default printer.


def is_paused : Bool #

Returns whether the printer is currently paused.

A paused printer still accepts jobs, but it is not printing them.


def is_virtual : Bool #

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


def is_virtual=(value : Bool) : Bool #

def is_virtual? : Bool #

def job_count : Int32 #

Gets the number of jobs currently queued on the printer.


def list_papers : GLib::List #

Lists all the paper sizes @printer supports.

This will return and empty list unless the printer’s details are available, see Gtk::Printer#has_details and Gtk::Printer#request_details.


def location : String #

Returns a description of the location of the printer.


def name : String #

Returns the name of the printer.


def name=(value : String) : String #

def paused? : Bool #

def request_details : Nil #

Requests the printer details.

When the details are available, the [signal@Gtk.Printer::details-acquired] signal will be emitted on @printer.


def state_message : String #

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