ContextRef
public struct ContextRef : ContextProtocol, GWeakCapturing
A PangoContext
stores global information used to control the
itemization process.
The information stored by PangoContext
includes the fontmap used
to look up fonts, and default values such as the default language,
default gravity, or default font.
To obtain a PangoContext
, use [methodPango.FontMap.create_context
].
The ContextRef
type acts as a lightweight Swift reference to an underlying PangoContext
instance.
It exposes methods that can operate on this data type through ContextProtocol
conformance.
Use ContextRef
only as an unowned
reference to an existing PangoContext
instance.
-
Untyped pointer to the underlying `PangoContext` instance.
For type-safe access, use the generated, typed pointer
context_ptr
property instead.Declaration
Swift
public let ptr: UnsafeMutableRawPointer!
-
Designated initialiser from the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafeMutablePointer<PangoContext>)
-
Designated initialiser from a constant pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafePointer<PangoContext>)
-
Conditional initialiser from an optional pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafeMutablePointer<PangoContext>?)
-
Conditional initialiser from an optional, non-mutable pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafePointer<PangoContext>?)
-
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
ContextProtocol
Declaration
Swift
@inlinable init<T>(_ other: T) where T : ContextProtocol
-
This factory is syntactic sugar for setting weak pointers wrapped in
GWeak<T>
Declaration
Swift
@inlinable static func unowned<T>(_ other: T) -> ContextRef where T : ContextProtocol
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ContextProtocol
.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
ContextProtocol
.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
ContextProtocol
.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
ContextProtocol
.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
ContextProtocol
.Declaration
Swift
@inlinable init(opaquePointer: OpaquePointer)
-
Creates a new `PangoContext` initialized to default values.
This function is not particularly useful as it should always be followed by a [method
Pango.Context.set_font_map
] call, and the function [methodPango.FontMap.create_context
] does these two steps together and hence users are recommended to use that.If you are using Pango as part of a higher-level system, that system may have it’s own way of create a
PangoContext
. For instance, the GTK toolkit has, among others,gtk_widget_get_pango_context()
. Use those instead.Declaration
Swift
@inlinable init()