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.
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.
-
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 thePaperSize
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 thePaperSize
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 underlyingC
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to thePaperSize
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 underlyingC
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to thePaperSize
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 thePaperSize
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 thePaperSize
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 thePaperSize
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
isnil
, the default paper size is returned, see [funcGtk.PaperSize.get_default
].Declaration
Swift
@inlinable public init(name: UnsafePointer<CChar>? = nil)
-
Creates a new
GtkPaperSize
object with the given parameters.Declaration
Swift
@inlinable public init(custom name: UnsafePointer<CChar>!, displayName: UnsafePointer<CChar>!, width: CDouble, height: CDouble, unit: GtkUnit)
-
Deserialize a paper size from a
GVariant
.The
GVariant must be in the format produced by [method
Gtk.PaperSize.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
andheight
are used to construct a customGtkPaperSize
object.Declaration
Swift
@inlinable public init(ipp ippName: UnsafePointer<CChar>!, width: CDouble, height: CDouble)
-
Reads a paper size from the group
group_name
in the key filekey_file
.Declaration
Swift
@inlinable public init<KeyFileT>(keyFile: KeyFileT, groupName: UnsafePointer<CChar>? = 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
andheight
are used to construct a customGtkPaperSize
object.Declaration
Swift
@inlinable public init(ppd ppdName: UnsafePointer<CChar>!, ppdDisplayName: UnsafePointer<CChar>!, width: CDouble, height: CDouble)
-
Creates a new
GtkPaperSize
object with the given parameters.Declaration
Swift
@inlinable public static func new(custom name: UnsafePointer<CChar>!, displayName: UnsafePointer<CChar>!, width: CDouble, height: CDouble, unit: GtkUnit) -> PaperSize!
-
Deserialize a paper size from a
GVariant
.The
GVariant must be in the format produced by [method
Gtk.PaperSize.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
andheight
are used to construct a customGtkPaperSize
object.Declaration
Swift
@inlinable public static func newFrom(ipp ippName: UnsafePointer<CChar>!, width: CDouble, height: CDouble) -> PaperSize!
-
Reads a paper size from the group
group_name
in the key filekey_file
.Declaration
Swift
@inlinable public static func newFrom<KeyFileT>(keyFile: KeyFileT, groupName: UnsafePointer<CChar>? = 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
andheight
are used to construct a customGtkPaperSize
object.Declaration
Swift
@inlinable public static func newFrom(ppd ppdName: UnsafePointer<CChar>!, ppdDisplayName: UnsafePointer<CChar>!, width: CDouble, height: CDouble) -> PaperSize!