Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: PrinterMeta

[450:14] static extends: object

Generated metadata helpers for Printer class surfaces.

Methods

  • properties ()

    Returns property metadata for Printer.

    • @r A list.
  • signals ()

    Returns signal metadata for Printer.

    • @r A list.

class: Printer

[18:7] extends: object

Represents a printer. You only need to deal directly with printers if you use the non-portable [class@Gtk.PrintUnixDialog] 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 [class@Gtk.PrintJob] object, which lets you print to the printer.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Printer (name = null, backend = null, virtual_ = null)

    Creates a new GtkPrinter.

    • @p name is the name of the printer.
    • @p backend is a GtkPrintBackend.
    • @p virtual_ is whether the printer is virtual.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asObject ()

    Wraps this handle as Object.

    • @r A Object object.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnDetailsacquired (callback Fn, UserData = null)

    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.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (Printer Self, bool Success).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • accepts_pdf ()

    Returns whether the printer accepts input in PDF format.

  • accepts_ps ()

    Returns whether the printer accepts input in PostScript format.

  • compare (object b)

    Compares two printers.

    • @p b is another GtkPrinter.
  • get_backend ()

    Returns the backend of the printer.

  • get_capabilities ()

    Returns the printer’s capabilities. This is useful when you’re using GtkPrintUnixDialog’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 [method@Gtk.Printer.has_details] and [method@Gtk.Printer.request_details].

  • get_default_page_size ()

    Returns default page size of @printer.

  • get_description ()

    Gets the description of the printer.

  • get_icon_name ()

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

  • get_job_count ()

    Gets the number of jobs currently queued on the printer.

  • get_location ()

    Returns a description of the location of the printer.

  • get_name ()

    Returns the name of the printer.

  • get_state_message ()

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

  • has_details ()

    Returns whether the printer details are available.

  • is_accepting_jobs ()

    Returns whether the printer is accepting jobs

  • is_active ()

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

  • is_default ()

    Returns whether the printer is the default printer.

  • is_paused ()

    Returns whether the printer is currently paused. A paused printer still accepts jobs, but it is not printing them.

  • is_virtual ()

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

  • list_papers ()

    Lists all the paper sizes @printer supports. This will return and empty list unless the printer’s details are available, see [method@Gtk.Printer.has_details] and [method@Gtk.Printer.request_details].

  • request_details ()

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

    • @printer. ``
    • @r None.
  • papers ()

    Returns list_papers as an Aussom list of wrapper objects. This companion method materializes the full collection up front; use list_papers() when lazy or change-notify access is required.

    • @r An Aussom list of elements.

class: PrinterDetailsacquiredCallback

[379:7] extends: object

Generated low-level callback wrapper for GIR callback details-acquired.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • PrinterDetailsacquiredCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, success, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.