PaperSize

open class PaperSize : PaperSizeProtocol

GtkPaperSize handles paper sizes. It uses the standard called PWG 5101.1-2002 PWG: Standard for Media Standardized Names to name the paper sizes (and to get the data for the page sizes). In addition to standard paper sizes, GtkPaperSize allows to construct custom paper sizes with arbitrary dimensions.

The GtkPaperSize object stores not only the dimensions (width and height) of a paper size and its name, it also provides default print margins.

Printing support has been added in GTK+ 2.10.

The PaperSize type acts as an owner of an underlying GtkPaperSize instance. It provides the methods that can operate on this data type through PaperSizeProtocol conformance. Use PaperSize as a strong reference or owner of a GtkPaperSize instance.

  • ptr
    Untyped pointer to the underlying `GtkPaperSize` instance.
    

    For type-safe access, use the generated, typed pointer paper_size_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!
  • Designated initialiser from the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the PaperSize instance.

    Declaration

    Swift

    @inlinable
    public init(_ op: UnsafeMutablePointer<GtkPaperSize>)

    Parameters

    op

    pointer to the underlying object

  • Designated initialiser from a constant pointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the PaperSize instance.

    Declaration

    Swift

    @inlinable
    public init(_ op: UnsafePointer<GtkPaperSize>)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from a non-mutating gpointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the PaperSize instance.

    Declaration

    Swift

    @inlinable
    public init!(gpointer op: gpointer?)

    Parameters

    op

    gpointer to the underlying object

  • Optional initialiser from a non-mutating gconstpointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the PaperSize instance.

    Declaration

    Swift

    @inlinable
    public init!(gconstpointer op: gconstpointer?)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from a constant pointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the PaperSize instance.

    Declaration

    Swift

    @inlinable
    public init!(_ op: UnsafePointer<GtkPaperSize>?)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the PaperSize instance.

    Declaration

    Swift

    @inlinable
    public init!(_ op: UnsafeMutablePointer<GtkPaperSize>?)

    Parameters

    op

    pointer to the underlying object

  • Designated initialiser from the underlying C data type. GtkPaperSize does not allow reference counting, so despite the name no actual retaining will occur. i.e., ownership is transferred to the PaperSize instance.

    Declaration

    Swift

    @inlinable
    public init(retaining op: UnsafeMutablePointer<GtkPaperSize>)

    Parameters

    op

    pointer to the underlying object

  • Reference intialiser for a related type that implements PaperSizeProtocol GtkPaperSize does not allow reference counting.

    Declaration

    Swift

    @inlinable
    public init<T>(_ other: T) where T : PaperSizeProtocol

    Parameters

    other

    an instance of a related type that implements PaperSizeProtocol

  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to PaperSizeProtocol.

    Declaration

    Swift

    @inlinable
    public init<T>(cPointer p: UnsafeMutablePointer<T>)

    Parameters

    cPointer

    pointer to the underlying object

  • Unsafe typed, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to PaperSizeProtocol.

    Declaration

    Swift

    @inlinable
    public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>)

    Parameters

    cPointer

    pointer to the underlying object

  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to PaperSizeProtocol.

    Declaration

    Swift

    @inlinable
    public init(raw p: UnsafeRawPointer)

    Parameters

    p

    raw pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to PaperSizeProtocol.

    Declaration

    Swift

    @inlinable
    public init(retainingRaw raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to PaperSizeProtocol.

    Declaration

    Swift

    @inlinable
    public required init(raw p: UnsafeMutableRawPointer)

    Parameters

    p

    mutable raw pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to PaperSizeProtocol.

    Declaration

    Swift

    @inlinable
    public init(retainingRaw raw: UnsafeMutableRawPointer)

    Parameters

    raw

    mutable raw pointer to the underlying object

  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to PaperSizeProtocol.

    Declaration

    Swift

    @inlinable
    public init(opaquePointer p: OpaquePointer)

    Parameters

    p

    opaque pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to PaperSizeProtocol.

    Declaration

    Swift

    @inlinable
    public init(retainingOpaquePointer p: OpaquePointer)

    Parameters

    p

    opaque pointer to the underlying object

  • Creates a new GtkPaperSize object by parsing a PWG 5101.1-2002 paper name.

    If name is nil, the default paper size is returned, see gtk_paper_size_get_default().

    Declaration

    Swift

    @inlinable
    public init(name: UnsafePointer<gchar>? = nil)
  • Creates a new GtkPaperSize object with the given parameters.

    Declaration

    Swift

    @inlinable
    public init(custom name: UnsafePointer<gchar>!, displayName: UnsafePointer<gchar>!, width: Double, height: Double, unit: GtkUnit)
  • Deserialize a paper size from an a{sv} variant in the format produced by gtk_paper_size_to_gvariant().

    Declaration

    Swift

    @inlinable
    public init<VariantT>(gvariant variant: VariantT) where VariantT : VariantProtocol
  • Creates a new GtkPaperSize object by using IPP information.

    If ipp_name is not a recognized paper name, width and height are used to construct a custom GtkPaperSize object.

    Declaration

    Swift

    @inlinable
    public init(ipp ippName: UnsafePointer<gchar>!, width: Double, height: Double)
  • Reads a paper size from the group group_name in the key file key_file.

    Declaration

    Swift

    @inlinable
    public init<KeyFileT>(keyFile: KeyFileT, groupName: UnsafePointer<gchar>? = nil) throws where KeyFileT : KeyFileProtocol
  • Creates a new GtkPaperSize object by using PPD information.

    If ppd_name is not a recognized PPD paper name, ppd_display_name, width and height are used to construct a custom GtkPaperSize object.

    Declaration

    Swift

    @inlinable
    public init(ppd ppdName: UnsafePointer<gchar>!, ppdDisplayName: UnsafePointer<gchar>!, width: Double, height: Double)
  • Creates a new GtkPaperSize object with the given parameters.

    Declaration

    Swift

    @inlinable
    public static func new(custom name: UnsafePointer<gchar>!, displayName: UnsafePointer<gchar>!, width: Double, height: Double, unit: GtkUnit) -> PaperSize!
  • Deserialize a paper size from an a{sv} variant in the format produced by gtk_paper_size_to_gvariant().

    Declaration

    Swift

    @inlinable
    public static func newFromG<VariantT>(gvariant variant: VariantT) -> PaperSize! where VariantT : VariantProtocol
  • Creates a new GtkPaperSize object by using IPP information.

    If ipp_name is not a recognized paper name, width and height are used to construct a custom GtkPaperSize object.

    Declaration

    Swift

    @inlinable
    public static func newFrom(ipp ippName: UnsafePointer<gchar>!, width: Double, height: Double) -> PaperSize!
  • Reads a paper size from the group group_name in the key file key_file.

    Declaration

    Swift

    @inlinable
    public static func newFrom<KeyFileT>(keyFile: KeyFileT, groupName: UnsafePointer<gchar>? = nil) throws -> PaperSize! where KeyFileT : KeyFileProtocol
  • Creates a new GtkPaperSize object by using PPD information.

    If ppd_name is not a recognized PPD paper name, ppd_display_name, width and height are used to construct a custom GtkPaperSize object.

    Declaration

    Swift

    @inlinable
    public static func newFrom(ppd ppdName: UnsafePointer<gchar>!, ppdDisplayName: UnsafePointer<gchar>!, width: Double, height: Double) -> PaperSize!