PaperSizeRef
public struct PaperSizeRef : 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 PaperSizeRef
type acts as a lightweight Swift reference to an underlying GtkPaperSize
instance.
It exposes methods that can operate on this data type through PaperSizeProtocol
conformance.
Use PaperSizeRef
only as an unowned
reference to an existing 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 typeDeclaration
Swift
@inlinable init(_ p: UnsafeMutablePointer<GtkPaperSize>)
-
Designated initialiser from a constant pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafePointer<GtkPaperSize>)
-
Conditional initialiser from an optional pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GtkPaperSize>?)
-
Conditional initialiser from an optional, non-mutable pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafePointer<GtkPaperSize>?)
-
Conditional initialiser from an optional
gpointer
Declaration
Swift
@inlinable init!(gpointer g: gpointer?)
-
Conditional initialiser from an optional, non-mutable
gconstpointer
Declaration
Swift
@inlinable init!(gconstpointer g: gconstpointer?)
-
Reference intialiser for a related type that implements
PaperSizeProtocol
Declaration
Swift
@inlinable init<T>(_ other: T) where T : PaperSizeProtocol
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
PaperSizeProtocol
.Declaration
Swift
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>)
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
PaperSizeProtocol
.Declaration
Swift
@inlinable init<T>(constPointer: UnsafePointer<T>)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
PaperSizeProtocol
.Declaration
Swift
@inlinable init(mutating 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 init(raw: UnsafeMutableRawPointer)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
PaperSizeProtocol
.Declaration
Swift
@inlinable init(opaquePointer: OpaquePointer)
-
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 init(name: UnsafePointer<CChar>? = nil)
-
Creates a new
GtkPaperSize
object with the given parameters.Declaration
Swift
@inlinable 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 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 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 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 init(ppd ppdName: UnsafePointer<CChar>!, ppdDisplayName: UnsafePointer<CChar>!, width: CDouble, height: CDouble)
-
Creates a new
GtkPaperSize
object with the given parameters.Declaration
Swift
@inlinable static func new(custom name: UnsafePointer<CChar>!, displayName: UnsafePointer<CChar>!, width: CDouble, height: CDouble, unit: GtkUnit) -> PaperSizeRef!
-
Deserialize a paper size from a
GVariant
.The
GVariant must be in the format produced by [method
Gtk.PaperSize.to_gvariant`].Declaration
Swift
@inlinable static func newFromG<VariantT>(gvariant variant: VariantT) -> PaperSizeRef! 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 static func newFrom(ipp ippName: UnsafePointer<CChar>!, width: CDouble, height: CDouble) -> PaperSizeRef!
-
Reads a paper size from the group
group_name
in the key filekey_file
.Declaration
Swift
@inlinable static func newFrom<KeyFileT>(keyFile: KeyFileT, groupName: UnsafePointer<CChar>? = nil) throws -> PaperSizeRef! 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 static func newFrom(ppd ppdName: UnsafePointer<CChar>!, ppdDisplayName: UnsafePointer<CChar>!, width: CDouble, height: CDouble) -> PaperSizeRef!