class
Gtk::Printer
- Gtk::Printer
- GObject::Object
- Reference
- Object
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.crConstructors
-
.new(name : String, backend : Gtk::PrintBackend, virtual_ : Bool) : self
Creates a new
Gtk::Printer. -
.new
Initialize a new
Printer. - .new(*, accepting_jobs : Bool | Nil = nil, accepts_pdf : Bool | Nil = nil, accepts_ps : Bool | Nil = nil, icon_name : String | Nil = nil, is_virtual : Bool | Nil = nil, job_count : Int32 | Nil = nil, location : String | Nil = nil, name : String | Nil = nil, paused : Bool | Nil = nil, state_message : String | Nil = nil)
Class Method Summary
-
.g_type : UInt64
Returns the type id (GType) registered in GLib type system.
Instance Method Summary
-
#==(other : self)
Returns
trueif this reference is the same as other. - #accepting_jobs? : Bool
-
#accepts_pdf : Bool
Returns whether the printer accepts input in PDF format.
- #accepts_pdf=(value : Bool) : Bool
- #accepts_pdf? : Bool
-
#accepts_ps : Bool
Returns whether the printer accepts input in PostScript format.
- #accepts_ps=(value : Bool) : Bool
- #accepts_ps? : Bool
-
#backend : Gtk::PrintBackend
Returns the backend of the printer.
-
#capabilities : Gtk::PrintCapabilities
Returns the printer’s capabilities.
-
#compare(b : Gtk::Printer) : Int32
Compares two printers.
-
#default_page_size : Gtk::PageSetup
Returns default page size of printer.
-
#description : String
Gets the description of the printer.
- #details_acquired_signal
-
#hard_margins(top : Float64, bottom : Float64, left : Float64, right : Float64) : Bool
Retrieve the hard margins of printer.
-
#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.
-
#has_details : Bool
Returns whether the printer details are available.
-
#hash(hasher)
See
Object#hash(hasher) -
#icon_name : String
Gets the name of the icon to use for the printer.
-
#icon_name? : String | Nil
Same as
#icon_name, but can return nil. -
#is_accepting_jobs : Bool
Returns whether the printer is accepting jobs
-
#is_active : Bool
Returns whether the printer is currently active (i.e.
-
#is_default : Bool
Returns whether the printer is the default printer.
-
#is_paused : Bool
Returns whether the printer is currently paused.
-
#is_virtual : Bool
Returns whether the printer is virtual (i.e.
- #is_virtual=(value : Bool) : Bool
- #is_virtual? : Bool
-
#job_count : Int32
Gets the number of jobs currently queued on the printer.
-
#list_papers : GLib::List
Lists all the paper sizes printer supports.
-
#location : String
Returns a description of the location of the printer.
-
#location? : String | Nil
Same as
#location, but can return nil. -
#name : String
Returns the name of the printer.
- #name=(value : String) : String
-
#name=(value : Nil) : Nil
Set
#nameproperty to nil. -
#name? : String | Nil
Same as
#name, but can return nil. - #paused? : Bool
-
#request_details : Nil
Requests the printer details.
-
#state_message : String
Returns the state message describing the current state of the printer.
-
#state_message? : String | Nil
Same as
#state_message, but can return nil.
Instance methods inherited from class GObject::Object
==(other : self)
==,
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) | Nil
data,
finalize
finalize,
freeze_notify : Nil
freeze_notify,
getv(names : Enumerable(String), values : Enumerable(_)) : Nil
getv,
hash(hasher)
hash,
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) | Nil
qdata,
ref_count : UInt32
ref_count,
run_dispose : Nil
run_dispose,
set_data(key : String, data : Pointer(Void) | Nil) : Nil
set_data,
set_property(property_name : String, value : _) : Nil
set_property,
steal_data(key : String) : Pointer(Void) | Nil
steal_data,
steal_qdata(quark : UInt32) : Pointer(Void) | Nil
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,
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
cast?(obj : GObject::Object) : self | Nil
cast?,
compat_control(what : UInt64, data : Pointer(Void) | Nil) : 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
Macros inherited from class GObject::Object
previous_vfunc(*args)
previous_vfunc,
previous_vfunc!(*args)
previous_vfunc!,
signal(signature)
signal
Constructor Detail
Creates a new Gtk::Printer.
Class Method Detail
Returns the type id (GType) registered in GLib type system.
Instance Method Detail
Returns true if this reference is the same as other. Invokes same?.
Returns whether the printer accepts input in PostScript format.
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.
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.
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.
Returns whether the printer is currently active (i.e. accepts new jobs).
Returns whether the printer is currently paused.
A paused printer still accepts jobs, but it is not printing them.
Returns whether the printer is virtual (i.e. does not represent actual printer hardware, but something like a CUPS class).
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.
Requests the printer details.
When the details are available, the [signal@Gtk.Printer::details-acquired] signal will be emitted on printer.
Returns the state message describing the current state of the printer.