Compare commits

...

28 Commits

Author SHA1 Message Date
Rene Hexel 3f4bfe8364 Regen for 3.24.29 2021-05-09 12:16:10 +10:00
Rene Hexel 3bbcf75b33 Merge branch 'main' into generated 2021-05-09 12:07:48 +10:00
Rene Hexel d003d8f6e0 s/development/main/ 2021-05-09 12:06:05 +10:00
Rene Hexel d6e4daf0df Merge branch 'development' 2021-05-09 12:05:36 +10:00
Rene Hexel 5ed52785ff Add /opt/homebrew to GIR search path prefix 2021-01-28 06:25:11 +10:00
Rene Hexel d15f05947f regen 2021-01-19 09:14:44 +10:00
Rene Hexel e3fbb3b353 regen with gir2swift 12.1 2021-01-17 10:59:09 +10:00
Rene Hexel dd1b581db2 Merge branch 'main' into generated 2021-01-17 10:41:41 +10:00
Rene Hexel b707ba62b3 Add gir2swift to example Package.swift 2021-01-17 10:36:36 +10:00
Rene Hexel 46989903a9 Remove docs 2021-01-16 10:20:28 +10:00
Rene Hexel fad20d99ef Merge branch 'main' into generated 2021-01-16 10:11:20 +10:00
Rene Hexel 8442e68bee regen with gir2swift 12 2021-01-16 10:10:09 +10:00
Rene Hexel ed3cac3c47 Merge branch 'main' into generated 2021-01-16 09:54:28 +10:00
Rene Hexel 03b7b6cde7 regen 2021-01-06 11:57:01 +10:00
Rene Hexel 82a71a9950 Merge branch 'main' into generated 2021-01-06 10:58:29 +10:00
Rene Hexel d6a753ddc7 Merge master 2020-09-13 14:30:13 +10:00
Rene Hexel 3d4bf4a240 regen 2020-09-13 14:30:07 +10:00
Rene Hexel 9d46e49127 Merge master 2020-09-06 09:27:22 +10:00
Rene Hexel 026f24847d regen 2020-09-06 09:27:17 +10:00
Rene Hexel 779e2a6720 regen for gir2swift 10 2020-06-21 06:30:30 +10:00
Rene Hexel 48aaf68fc4 Merge branch 'master' into generated 2020-06-21 06:21:09 +10:00
Rene Hexel 4c6406202a regen for gir2swift 8.0.0 and Swift 5.2 2020-03-29 14:45:55 +10:00
Rene Hexel 7ec6c312e5 Merge branch 'master' into generated 2020-03-29 14:45:32 +10:00
Rene Hexel 6fb4b72fa6 update for gtk-3.24.12 2019-10-10 06:03:56 +10:00
Rene Hexel f324c7f899 Merge branch 'master' into generated 2019-10-10 06:03:09 +10:00
Rene Hexel 0d290b6d94 Regen with gir2swift-6.1.8 to support anchors and hrefs 2019-10-06 12:48:23 +10:00
Rene Hexel 580910dd2f Merge branch 'master' into generated 2019-10-06 12:48:05 +10:00
Rene Hexel 185763d42c Add generated sources 2019-10-01 11:02:19 +10:00
25 changed files with 42044 additions and 4 deletions

1
.gitignore vendored
View File

@ -9,4 +9,3 @@
undocumented.json
Package.resolved
Package.pins
*-*.swift

View File

@ -6,9 +6,9 @@ let package = Package(
name: "Gdk",
products: [ .library(name: "Gdk", targets: ["Gdk"]) ],
dependencies: [
.package(name: "gir2swift", url: "https://github.com/rhx/gir2swift.git", .branch("development")),
.package(name: "GdkPixbuf", url: "https://github.com/rhx/SwiftGdkPixbuf.git", .branch("development")),
.package(name: "PangoCairo", url: "https://github.com/rhx/SwiftPangoCairo.git", .branch("development")),
.package(name: "gir2swift", url: "https://github.com/rhx/gir2swift.git", .branch("main")),
.package(name: "GdkPixbuf", url: "https://github.com/rhx/SwiftGdkPixbuf.git", .branch("main")),
.package(name: "PangoCairo", url: "https://github.com/rhx/SwiftPangoCairo.git", .branch("main")),
],
targets: [
.systemLibrary(name: "CGdk", pkgConfig: "gdk-3.0",

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,727 @@
import CGLib
import CCairo
import CPango
import CGdkPixbuf
import CGdk
import GLib
import GLibObject
import GIO
import Pango
import Cairo
import PangoCairo
import GdkPixbuf
// MARK: - Atom Record
/// The `AtomProtocol` protocol exposes the methods and properties of an underlying `GdkAtom` instance.
/// The default implementation of these can be found in the protocol extension below.
/// For a concrete class that implements these methods and properties, see `Atom`.
/// Alternatively, use `AtomRef` as a lighweight, `unowned` reference if you already have an instance you just want to use.
///
/// An opaque type representing a string as an index into a table
/// of strings on the X server.
public protocol AtomProtocol {
/// Untyped pointer to the underlying `GdkAtom` instance.
var ptr: UnsafeMutableRawPointer! { get }
/// Typed pointer to the underlying `GdkAtom` instance.
var _ptr: GdkAtom! { get }
/// Required Initialiser for types conforming to `AtomProtocol`
init(raw: UnsafeMutableRawPointer)
}
/// The `AtomRef` type acts as a lightweight Swift reference to an underlying `GdkAtom` instance.
/// It exposes methods that can operate on this data type through `AtomProtocol` conformance.
/// Use `AtomRef` only as an `unowned` reference to an existing `GdkAtom` instance.
///
/// An opaque type representing a string as an index into a table
/// of strings on the X server.
public struct AtomRef: AtomProtocol {
/// Untyped pointer to the underlying `GdkAtom` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
public let ptr: UnsafeMutableRawPointer!
}
public extension AtomRef {
/// Designated initialiser from the underlying `C` data type
@inlinable init(_ p: GdkAtom) {
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from a constant pointer to the underlying `C` data type
@inlinable init(_ p: UnsafePointer<GdkAtom>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: p))
}
/// Conditional initialiser from an optional pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: GdkAtom?) {
guard let p = maybePointer else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafePointer<GdkAtom>?) {
guard let p = UnsafeMutablePointer(mutating: maybePointer) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional `gpointer`
@inlinable init!(gpointer g: gpointer?) {
guard let p = g else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable `gconstpointer`
@inlinable init!(gconstpointer g: gconstpointer?) {
guard let p = UnsafeMutableRawPointer(mutating: g) else { return nil }
ptr = p
}
/// Reference intialiser for a related type that implements `AtomProtocol`
@inlinable init<T: AtomProtocol>(_ other: T) {
ptr = other.ptr
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `AtomProtocol`.**
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `AtomProtocol`.**
@inlinable init<T>(constPointer: UnsafePointer<T>) {
ptr = UnsafeMutableRawPointer(mutating: UnsafeRawPointer(constPointer))
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `AtomProtocol`.**
@inlinable init(mutating raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `AtomProtocol`.**
@inlinable init(raw: UnsafeMutableRawPointer) {
ptr = raw
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `AtomProtocol`.**
@inlinable init(opaquePointer: OpaquePointer) {
ptr = UnsafeMutableRawPointer(opaquePointer)
}
}
/// The `Atom` type acts as an owner of an underlying `GdkAtom` instance.
/// It provides the methods that can operate on this data type through `AtomProtocol` conformance.
/// Use `Atom` as a strong reference or owner of a `GdkAtom` instance.
///
/// An opaque type representing a string as an index into a table
/// of strings on the X server.
open class Atom: AtomProtocol {
/// Untyped pointer to the underlying `GdkAtom` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
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 `Atom` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: GdkAtom) {
ptr = UnsafeMutableRawPointer(op)
}
/// 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 `Atom` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafePointer<GdkAtom>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: op))
}
/// 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 `Atom` instance.
/// - Parameter op: gpointer to the underlying object
@inlinable public init!(gpointer op: gpointer?) {
guard let p = UnsafeMutableRawPointer(op) else { return nil }
ptr = p
}
/// 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 `Atom` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(gconstpointer op: gconstpointer?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// 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 `Atom` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafePointer<GdkAtom>?) {
guard let p = UnsafeMutablePointer(mutating: op) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Optional initialiser from the underlying `C` data type.
/// This creates an instance without performing an unbalanced retain
/// i.e., ownership is transferred to the `Atom` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: GdkAtom?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from the underlying `C` data type.
/// `GdkAtom` does not allow reference counting, so despite the name no actual retaining will occur.
/// i.e., ownership is transferred to the `Atom` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(retaining op: GdkAtom) {
ptr = UnsafeMutableRawPointer(op)
// no reference counting for GdkAtom, cannot ref(_ptr)
}
/// Reference intialiser for a related type that implements `AtomProtocol`
/// `GdkAtom` does not allow reference counting.
/// - Parameter other: an instance of a related type that implements `AtomProtocol`
@inlinable public init<T: AtomProtocol>(_ other: T) {
ptr = other.ptr
// no reference counting for GdkAtom, cannot ref(_ptr)
}
/// Do-nothing destructor for `GdkAtom`.
deinit {
// no reference counting for GdkAtom, cannot unref(_ptr)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `AtomProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(cPointer p: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe typed, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `AtomProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
// no reference counting for GdkAtom, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `AtomProtocol`.**
/// - Parameter p: raw pointer to the underlying object
@inlinable public init(raw p: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `AtomProtocol`.**
@inlinable public init(retainingRaw raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
// no reference counting for GdkAtom, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `AtomProtocol`.**
/// - Parameter p: mutable raw pointer to the underlying object
@inlinable public required init(raw p: UnsafeMutableRawPointer) {
ptr = p
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `AtomProtocol`.**
/// - Parameter raw: mutable raw pointer to the underlying object
@inlinable public init(retainingRaw raw: UnsafeMutableRawPointer) {
ptr = raw
// no reference counting for GdkAtom, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `AtomProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(opaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `AtomProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(retainingOpaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
// no reference counting for GdkAtom, cannot ref(_ptr)
}
}
// MARK: no Atom properties
// MARK: no Atom signals
// MARK: Atom has no signals
// MARK: Atom Record: AtomProtocol extension (methods and fields)
public extension AtomProtocol {
/// Return the stored, untyped pointer as a typed pointer to the `GdkAtom` instance.
@inlinable var _ptr: GdkAtom! { return ptr?.assumingMemoryBound(to: _GdkAtom.self) }
/// Determines the string corresponding to an atom.
@inlinable func name() -> String! {
let rv = gdk_atom_name(_ptr).map({ String(cString: $0) })
return rv
}
// *** propertyGet() causes a syntax error and is therefore not available!
/// Retrieves selection data that was stored by the selection
/// data in response to a call to `gdk_selection_convert()`. This function
/// will not be used by applications, who should use the `GtkClipboard`
/// API instead.
@inlinable func selectionPropertyGet<WindowT: WindowProtocol>(requestor: WindowT, data: UnsafeMutablePointer<UnsafeMutablePointer<guchar>?>!, property _ptr: UnsafeMutablePointer<GdkAtom?>, propertyFormat: UnsafeMutablePointer<gint>!) -> Int {
let rv = Int(gdk_selection_property_get(requestor.window_ptr, data, _ptr, propertyFormat))
return rv
}
}
// MARK: - Color Record
/// The `ColorProtocol` protocol exposes the methods and properties of an underlying `GdkColor` instance.
/// The default implementation of these can be found in the protocol extension below.
/// For a concrete class that implements these methods and properties, see `Color`.
/// Alternatively, use `ColorRef` as a lighweight, `unowned` reference if you already have an instance you just want to use.
///
/// A `GdkColor` is used to describe a color,
/// similar to the XColor struct used in the X11 drawing API.
public protocol ColorProtocol {
/// Untyped pointer to the underlying `GdkColor` instance.
var ptr: UnsafeMutableRawPointer! { get }
/// Typed pointer to the underlying `GdkColor` instance.
var color_ptr: UnsafeMutablePointer<GdkColor>! { get }
/// Required Initialiser for types conforming to `ColorProtocol`
init(raw: UnsafeMutableRawPointer)
}
/// The `ColorRef` type acts as a lightweight Swift reference to an underlying `GdkColor` instance.
/// It exposes methods that can operate on this data type through `ColorProtocol` conformance.
/// Use `ColorRef` only as an `unowned` reference to an existing `GdkColor` instance.
///
/// A `GdkColor` is used to describe a color,
/// similar to the XColor struct used in the X11 drawing API.
public struct ColorRef: ColorProtocol {
/// Untyped pointer to the underlying `GdkColor` instance.
/// For type-safe access, use the generated, typed pointer `color_ptr` property instead.
public let ptr: UnsafeMutableRawPointer!
}
public extension ColorRef {
/// Designated initialiser from the underlying `C` data type
@inlinable init(_ p: UnsafeMutablePointer<GdkColor>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from a constant pointer to the underlying `C` data type
@inlinable init(_ p: UnsafePointer<GdkColor>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: p))
}
/// Conditional initialiser from an optional pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GdkColor>?) {
guard let p = maybePointer else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafePointer<GdkColor>?) {
guard let p = UnsafeMutablePointer(mutating: maybePointer) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional `gpointer`
@inlinable init!(gpointer g: gpointer?) {
guard let p = g else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable `gconstpointer`
@inlinable init!(gconstpointer g: gconstpointer?) {
guard let p = UnsafeMutableRawPointer(mutating: g) else { return nil }
ptr = p
}
/// Reference intialiser for a related type that implements `ColorProtocol`
@inlinable init<T: ColorProtocol>(_ other: T) {
ptr = other.ptr
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `ColorProtocol`.**
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `ColorProtocol`.**
@inlinable init<T>(constPointer: UnsafePointer<T>) {
ptr = UnsafeMutableRawPointer(mutating: UnsafeRawPointer(constPointer))
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `ColorProtocol`.**
@inlinable init(mutating raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `ColorProtocol`.**
@inlinable init(raw: UnsafeMutableRawPointer) {
ptr = raw
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `ColorProtocol`.**
@inlinable init(opaquePointer: OpaquePointer) {
ptr = UnsafeMutableRawPointer(opaquePointer)
}
}
/// The `Color` type acts as an owner of an underlying `GdkColor` instance.
/// It provides the methods that can operate on this data type through `ColorProtocol` conformance.
/// Use `Color` as a strong reference or owner of a `GdkColor` instance.
///
/// A `GdkColor` is used to describe a color,
/// similar to the XColor struct used in the X11 drawing API.
open class Color: ColorProtocol {
/// Untyped pointer to the underlying `GdkColor` instance.
/// For type-safe access, use the generated, typed pointer `color_ptr` property instead.
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 `Color` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafeMutablePointer<GdkColor>) {
ptr = UnsafeMutableRawPointer(op)
}
/// 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 `Color` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafePointer<GdkColor>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: op))
}
/// 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 `Color` instance.
/// - Parameter op: gpointer to the underlying object
@inlinable public init!(gpointer op: gpointer?) {
guard let p = UnsafeMutableRawPointer(op) else { return nil }
ptr = p
}
/// 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 `Color` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(gconstpointer op: gconstpointer?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// 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 `Color` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafePointer<GdkColor>?) {
guard let p = UnsafeMutablePointer(mutating: op) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Optional initialiser from the underlying `C` data type.
/// This creates an instance without performing an unbalanced retain
/// i.e., ownership is transferred to the `Color` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafeMutablePointer<GdkColor>?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from the underlying `C` data type.
/// `GdkColor` does not allow reference counting, so despite the name no actual retaining will occur.
/// i.e., ownership is transferred to the `Color` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(retaining op: UnsafeMutablePointer<GdkColor>) {
ptr = UnsafeMutableRawPointer(op)
// no reference counting for GdkColor, cannot ref(color_ptr)
}
/// Reference intialiser for a related type that implements `ColorProtocol`
/// `GdkColor` does not allow reference counting.
/// - Parameter other: an instance of a related type that implements `ColorProtocol`
@inlinable public init<T: ColorProtocol>(_ other: T) {
ptr = other.ptr
// no reference counting for GdkColor, cannot ref(color_ptr)
}
/// Do-nothing destructor for `GdkColor`.
deinit {
// no reference counting for GdkColor, cannot unref(color_ptr)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `ColorProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(cPointer p: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe typed, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `ColorProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
// no reference counting for GdkColor, cannot ref(color_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `ColorProtocol`.**
/// - Parameter p: raw pointer to the underlying object
@inlinable public init(raw p: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `ColorProtocol`.**
@inlinable public init(retainingRaw raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
// no reference counting for GdkColor, cannot ref(color_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `ColorProtocol`.**
/// - Parameter p: mutable raw pointer to the underlying object
@inlinable public required init(raw p: UnsafeMutableRawPointer) {
ptr = p
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `ColorProtocol`.**
/// - Parameter raw: mutable raw pointer to the underlying object
@inlinable public init(retainingRaw raw: UnsafeMutableRawPointer) {
ptr = raw
// no reference counting for GdkColor, cannot ref(color_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `ColorProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(opaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `ColorProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(retainingOpaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
// no reference counting for GdkColor, cannot ref(color_ptr)
}
}
// MARK: no Color properties
// MARK: no Color signals
// MARK: Color has no signals
// MARK: Color Record: ColorProtocol extension (methods and fields)
public extension ColorProtocol {
/// Return the stored, untyped pointer as a typed pointer to the `GdkColor` instance.
@inlinable var color_ptr: UnsafeMutablePointer<GdkColor>! { return ptr?.assumingMemoryBound(to: GdkColor.self) }
/// Makes a copy of a `GdkColor`.
///
/// The result must be freed using `gdk_color_free()`.
///
/// **copy is deprecated:**
/// Use #GdkRGBA
@available(*, deprecated) @inlinable func copy() -> ColorRef! {
guard let rv = ColorRef(gconstpointer: gconstpointer(gdk_color_copy(color_ptr))) else { return nil }
return rv
}
/// Compares two colors.
///
/// **equal is deprecated:**
/// Use #GdkRGBA
@available(*, deprecated) @inlinable func equal<ColorT: ColorProtocol>(colorb: ColorT) -> Bool {
let rv = ((gdk_color_equal(color_ptr, colorb.color_ptr)) != 0)
return rv
}
/// Frees a `GdkColor` created with `gdk_color_copy()`.
///
/// **free is deprecated:**
/// Use #GdkRGBA
@available(*, deprecated) @inlinable func free() {
gdk_color_free(color_ptr)
}
/// A hash function suitable for using for a hash
/// table that stores `GdkColors`.
///
/// **hash is deprecated:**
/// Use #GdkRGBA
@available(*, deprecated) @inlinable func hash() -> Int {
let rv = Int(gdk_color_hash(color_ptr))
return rv
}
/// Returns a textual specification of `color` in the hexadecimal
/// form \`rrrrggggbbbb` where r, g and b are hex digits
/// representing the red, green and blue components respectively.
///
/// The returned string can be parsed by `gdk_color_parse()`.
///
/// **to_string is deprecated:**
/// Use #GdkRGBA
@available(*, deprecated) @inlinable func toString() -> String! {
let rv = gdk_color_to_string(color_ptr).map({ String(cString: $0) })
return rv
}
/// Parses a textual specification of a color and fill in the
/// `red`, `green`, and `blue` fields of a `GdkColor`.
///
/// The string can either one of a large set of standard names
/// (taken from the X11 `rgb.txt` file), or it can be a hexadecimal
/// value in the form \`rgb` \`rrggbb`, \`rrrgggbbb` or
/// \`rrrrggggbbbb` where r, g and b are hex digits of
/// the red, green, and blue components of the color, respectively.
/// (White in the four forms is \`fff`, \`ffffff`, \`fffffffff`
/// and \`ffffffffffff`).
///
/// **parse is deprecated:**
/// Use #GdkRGBA
@available(*, deprecated) @inlinable func parse(spec: UnsafePointer<gchar>!) -> Bool {
let rv = ((gdk_color_parse(spec, color_ptr)) != 0)
return rv
}
/// Sets the specified `GdkColor` as the source color of `cr`.
///
/// **cairo_set_source_color is deprecated:**
/// Use gdk_cairo_set_source_rgba() instead
@available(*, deprecated) @inlinable func cairoSetSourceColor<ContextT: Cairo.ContextProtocol>(cr: ContextT) {
gdk_cairo_set_source_color(cr._ptr, color_ptr)
}
/// Parses a textual specification of a color and fill in the
/// `red`, `green`, and `blue` fields of a `GdkColor`.
///
/// The string can either one of a large set of standard names
/// (taken from the X11 `rgb.txt` file), or it can be a hexadecimal
/// value in the form \`rgb` \`rrggbb`, \`rrrgggbbb` or
/// \`rrrrggggbbbb` where r, g and b are hex digits of
/// the red, green, and blue components of the color, respectively.
/// (White in the four forms is \`fff`, \`ffffff`, \`fffffffff`
/// and \`ffffffffffff`).
///
/// **color_parse is deprecated:**
/// Use #GdkRGBA
@available(*, deprecated) @inlinable func colorParse(spec: UnsafePointer<gchar>!) -> Bool {
let rv = ((gdk_color_parse(spec, color_ptr)) != 0)
return rv
}
/// For allocated colors, the pixel value used to
/// draw this color on the screen. Not used anymore.
@inlinable var pixel: guint32 {
/// For allocated colors, the pixel value used to
/// draw this color on the screen. Not used anymore.
get {
let rv = color_ptr.pointee.pixel
return rv
}
/// For allocated colors, the pixel value used to
/// draw this color on the screen. Not used anymore.
set {
color_ptr.pointee.pixel = newValue
}
}
/// The red component of the color. This is
/// a value between 0 and 65535, with 65535 indicating
/// full intensity
@inlinable var red: guint16 {
/// The red component of the color. This is
/// a value between 0 and 65535, with 65535 indicating
/// full intensity
get {
let rv = color_ptr.pointee.red
return rv
}
/// The red component of the color. This is
/// a value between 0 and 65535, with 65535 indicating
/// full intensity
set {
color_ptr.pointee.red = newValue
}
}
/// The green component of the color
@inlinable var green: guint16 {
/// The green component of the color
get {
let rv = color_ptr.pointee.green
return rv
}
/// The green component of the color
set {
color_ptr.pointee.green = newValue
}
}
/// The blue component of the color
@inlinable var blue: guint16 {
/// The blue component of the color
get {
let rv = color_ptr.pointee.blue
return rv
}
/// The blue component of the color
set {
color_ptr.pointee.blue = newValue
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,512 @@
import CGLib
import CCairo
import CPango
import CGdkPixbuf
import CGdk
import GLib
import GLibObject
import GIO
import Pango
import Cairo
import PangoCairo
import GdkPixbuf
// MARK: - DevicePad Interface
/// The `DevicePadProtocol` protocol exposes the methods and properties of an underlying `GdkDevicePad` instance.
/// The default implementation of these can be found in the protocol extension below.
/// For a concrete class that implements these methods and properties, see `DevicePad`.
/// Alternatively, use `DevicePadRef` as a lighweight, `unowned` reference if you already have an instance you just want to use.
///
/// `GdkDevicePad` is an interface implemented by devices of type
/// `GDK_SOURCE_TABLET_PAD`, it allows querying the features provided
/// by the pad device.
///
/// Tablet pads may contain one or more groups, each containing a subset
/// of the buttons/rings/strips available. `gdk_device_pad_get_n_groups()`
/// can be used to obtain the number of groups, `gdk_device_pad_get_n_features()`
/// and `gdk_device_pad_get_feature_group()` can be combined to find out the
/// number of buttons/rings/strips the device has, and how are they grouped.
///
/// Each of those groups have different modes, which may be used to map
/// each individual pad feature to multiple actions. Only one mode is
/// effective (current) for each given group, different groups may have
/// different current modes. The number of available modes in a group can
/// be found out through `gdk_device_pad_get_group_n_modes()`, and the current
/// mode for a given group will be notified through the `GdkEventPadGroupMode`
/// event.
public protocol DevicePadProtocol: DeviceProtocol {
/// Untyped pointer to the underlying `GdkDevicePad` instance.
var ptr: UnsafeMutableRawPointer! { get }
/// Typed pointer to the underlying `GdkDevicePad` instance.
var device_pad_ptr: UnsafeMutablePointer<GdkDevicePad>! { get }
/// Required Initialiser for types conforming to `DevicePadProtocol`
init(raw: UnsafeMutableRawPointer)
}
/// The `DevicePadRef` type acts as a lightweight Swift reference to an underlying `GdkDevicePad` instance.
/// It exposes methods that can operate on this data type through `DevicePadProtocol` conformance.
/// Use `DevicePadRef` only as an `unowned` reference to an existing `GdkDevicePad` instance.
///
/// `GdkDevicePad` is an interface implemented by devices of type
/// `GDK_SOURCE_TABLET_PAD`, it allows querying the features provided
/// by the pad device.
///
/// Tablet pads may contain one or more groups, each containing a subset
/// of the buttons/rings/strips available. `gdk_device_pad_get_n_groups()`
/// can be used to obtain the number of groups, `gdk_device_pad_get_n_features()`
/// and `gdk_device_pad_get_feature_group()` can be combined to find out the
/// number of buttons/rings/strips the device has, and how are they grouped.
///
/// Each of those groups have different modes, which may be used to map
/// each individual pad feature to multiple actions. Only one mode is
/// effective (current) for each given group, different groups may have
/// different current modes. The number of available modes in a group can
/// be found out through `gdk_device_pad_get_group_n_modes()`, and the current
/// mode for a given group will be notified through the `GdkEventPadGroupMode`
/// event.
public struct DevicePadRef: DevicePadProtocol, GWeakCapturing {
/// Untyped pointer to the underlying `GdkDevicePad` instance.
/// For type-safe access, use the generated, typed pointer `device_pad_ptr` property instead.
public let ptr: UnsafeMutableRawPointer!
}
public extension DevicePadRef {
/// Designated initialiser from the underlying `C` data type
@inlinable init(_ p: UnsafeMutablePointer<GdkDevicePad>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from a constant pointer to the underlying `C` data type
@inlinable init(_ p: UnsafePointer<GdkDevicePad>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: p))
}
/// Conditional initialiser from an optional pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GdkDevicePad>?) {
guard let p = maybePointer else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafePointer<GdkDevicePad>?) {
guard let p = UnsafeMutablePointer(mutating: maybePointer) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional `gpointer`
@inlinable init!(gpointer g: gpointer?) {
guard let p = g else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable `gconstpointer`
@inlinable init!(gconstpointer g: gconstpointer?) {
guard let p = UnsafeMutableRawPointer(mutating: g) else { return nil }
ptr = p
}
/// Reference intialiser for a related type that implements `DevicePadProtocol`
@inlinable init<T: DevicePadProtocol>(_ other: T) {
ptr = other.ptr
}
/// This factory is syntactic sugar for setting weak pointers wrapped in `GWeak<T>`
@inlinable static func unowned<T: DevicePadProtocol>(_ other: T) -> DevicePadRef { DevicePadRef(other) }
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadProtocol`.**
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadProtocol`.**
@inlinable init<T>(constPointer: UnsafePointer<T>) {
ptr = UnsafeMutableRawPointer(mutating: UnsafeRawPointer(constPointer))
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadProtocol`.**
@inlinable init(mutating raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadProtocol`.**
@inlinable init(raw: UnsafeMutableRawPointer) {
ptr = raw
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadProtocol`.**
@inlinable init(opaquePointer: OpaquePointer) {
ptr = UnsafeMutableRawPointer(opaquePointer)
}
}
/// The `DevicePad` type acts as a reference-counted owner of an underlying `GdkDevicePad` instance.
/// It provides the methods that can operate on this data type through `DevicePadProtocol` conformance.
/// Use `DevicePad` as a strong reference or owner of a `GdkDevicePad` instance.
///
/// `GdkDevicePad` is an interface implemented by devices of type
/// `GDK_SOURCE_TABLET_PAD`, it allows querying the features provided
/// by the pad device.
///
/// Tablet pads may contain one or more groups, each containing a subset
/// of the buttons/rings/strips available. `gdk_device_pad_get_n_groups()`
/// can be used to obtain the number of groups, `gdk_device_pad_get_n_features()`
/// and `gdk_device_pad_get_feature_group()` can be combined to find out the
/// number of buttons/rings/strips the device has, and how are they grouped.
///
/// Each of those groups have different modes, which may be used to map
/// each individual pad feature to multiple actions. Only one mode is
/// effective (current) for each given group, different groups may have
/// different current modes. The number of available modes in a group can
/// be found out through `gdk_device_pad_get_group_n_modes()`, and the current
/// mode for a given group will be notified through the `GdkEventPadGroupMode`
/// event.
open class DevicePad: Device, DevicePadProtocol {
/// Designated initialiser from the underlying `C` data type.
/// This creates an instance without performing an unbalanced retain
/// i.e., ownership is transferred to the `DevicePad` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafeMutablePointer<GdkDevicePad>) {
super.init(cPointer: op)
}
/// 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 `DevicePad` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafePointer<GdkDevicePad>) {
super.init(raw: UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: op)))
}
/// 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 `DevicePad` instance.
/// - Parameter op: gpointer to the underlying object
@inlinable override public init!(gpointer op: gpointer?) {
guard let p = UnsafeMutableRawPointer(op) else { return nil }
super.init(raw: p)
}
/// 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 `DevicePad` instance.
/// - Parameter op: pointer to the underlying object
@inlinable override public init!(gconstpointer op: gconstpointer?) {
guard let p = op else { return nil }
super.init(raw: p)
}
/// 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 `DevicePad` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafePointer<GdkDevicePad>?) {
guard let p = UnsafeMutablePointer(mutating: op) else { return nil }
super.init(cPointer: p)
}
/// Optional initialiser from the underlying `C` data type.
/// This creates an instance without performing an unbalanced retain
/// i.e., ownership is transferred to the `DevicePad` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafeMutablePointer<GdkDevicePad>?) {
guard let p = op else { return nil }
super.init(cPointer: p)
}
/// Designated initialiser from the underlying `C` data type.
/// Will retain `GdkDevicePad`.
/// i.e., ownership is transferred to the `DevicePad` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(retaining op: UnsafeMutablePointer<GdkDevicePad>) {
super.init(retainingCPointer: op)
}
/// Reference intialiser for a related type that implements `DevicePadProtocol`
/// Will retain `GdkDevicePad`.
/// - Parameter other: an instance of a related type that implements `DevicePadProtocol`
@inlinable public init<T: DevicePadProtocol>(devicePad other: T) {
super.init(retainingRaw: other.ptr)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable override public init<T>(cPointer p: UnsafeMutablePointer<T>) {
super.init(cPointer: p)
}
/// Unsafe typed, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable override public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>) {
super.init(retainingCPointer: cPointer)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadProtocol`.**
/// - Parameter p: raw pointer to the underlying object
@inlinable override public init(raw p: UnsafeRawPointer) {
super.init(raw: p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadProtocol`.**
@inlinable override public init(retainingRaw raw: UnsafeRawPointer) {
super.init(retainingRaw: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadProtocol`.**
/// - Parameter p: mutable raw pointer to the underlying object
@inlinable public required init(raw p: UnsafeMutableRawPointer) {
super.init(raw: p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadProtocol`.**
/// - Parameter raw: mutable raw pointer to the underlying object
@inlinable required public init(retainingRaw raw: UnsafeMutableRawPointer) {
super.init(retainingRaw: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable override public init(opaquePointer p: OpaquePointer) {
super.init(opaquePointer: p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable override public init(retainingOpaquePointer p: OpaquePointer) {
super.init(retainingOpaquePointer: p)
}
}
public enum DevicePadPropertyName: String, PropertyNameProtocol {
/// Associated pointer or keyboard with this device, if any. Devices of type `GDK_DEVICE_TYPE_MASTER`
/// always come in keyboard/pointer pairs. Other device types will have a `nil` associated device.
case associatedDevice = "associated-device"
/// The axes currently available for this device.
case axes = "axes"
/// The `GdkDeviceManager` the `GdkDevice` pertains to.
case deviceManager = "device-manager"
/// The `GdkDisplay` the `GdkDevice` pertains to.
case display = "display"
/// Whether the device is represented by a cursor on the screen. Devices of type
/// `GDK_DEVICE_TYPE_MASTER` will have `true` here.
case hasCursor = "has-cursor"
case inputMode = "input-mode"
/// Source type for the device.
case inputSource = "input-source"
/// Number of axes in the device.
case nAxes = "n-axes"
/// The device name.
case name = "name"
/// The maximal number of concurrent touches on a touch device.
/// Will be 0 if the device is not a touch device or if the number
/// of touches is unknown.
case numTouches = "num-touches"
/// Product ID of this device, see `gdk_device_get_product_id()`.
case productId = "product-id"
/// `GdkSeat` of this device.
case seat = "seat"
case tool = "tool"
/// Device role in the device manager.
case type = "type"
/// Vendor ID of this device, see `gdk_device_get_vendor_id()`.
case vendorId = "vendor-id"
}
public extension DevicePadProtocol {
/// Bind a `DevicePadPropertyName` source property to a given target object.
/// - Parameter source_property: the source property to bind
/// - Parameter target: the target object to bind to
/// - Parameter target_property: the target property to bind to
/// - Parameter flags: the flags to pass to the `Binding`
/// - Parameter transform_from: `ValueTransformer` to use for forward transformation
/// - Parameter transform_to: `ValueTransformer` to use for backwards transformation
/// - Returns: binding reference or `nil` in case of an error
@discardableResult @inlinable func bind<Q: PropertyNameProtocol, T: GLibObject.ObjectProtocol>(property source_property: DevicePadPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! {
func _bind(_ source: UnsafePointer<gchar>, to t: T, _ target_property: UnsafePointer<gchar>, flags f: BindingFlags = .default, holder: BindingClosureHolder, transformFrom transform_from: @convention(c) @escaping (gpointer, gpointer, gpointer, gpointer) -> gboolean, transformTo transform_to: @convention(c) @escaping (gpointer, gpointer, gpointer, gpointer) -> gboolean) -> BindingRef! {
let holder = UnsafeMutableRawPointer(Unmanaged.passRetained(holder).toOpaque())
let from = unsafeBitCast(transform_from, to: BindingTransformFunc.self)
let to = unsafeBitCast(transform_to, to: BindingTransformFunc.self)
let rv = GLibObject.ObjectRef(raw: ptr).bindPropertyFull(sourceProperty: source, target: t, targetProperty: target_property, flags: f, transformTo: to, transformFrom: from, userData: holder) {
if let swift = UnsafeRawPointer($0) {
let holder = Unmanaged<GLibObject.SignalHandlerClosureHolder>.fromOpaque(swift)
holder.release()
}
}
return rv.map { BindingRef($0) }
}
let rv = _bind(source_property.name, to: target, target_property.name, flags: f, holder: BindingClosureHolder(transform_from, transform_to), transformFrom: {
let ptr = UnsafeRawPointer($3)
let holder = Unmanaged<BindingClosureHolder>.fromOpaque(ptr).takeUnretainedValue()
return holder.transform_from(GLibObject.ValueRef(raw: $1), GLibObject.ValueRef(raw: $2)) ? 1 : 0
}) {
let ptr = UnsafeRawPointer($3)
let holder = Unmanaged<BindingClosureHolder>.fromOpaque(ptr).takeUnretainedValue()
return holder.transform_to(GLibObject.ValueRef(raw: $1), GLibObject.ValueRef(raw: $2)) ? 1 : 0
}
return rv
}
/// Get the value of a DevicePad property
/// - Parameter property: the property to get the value for
/// - Returns: the value of the named property
@inlinable func get(property: DevicePadPropertyName) -> GLibObject.Value {
let v = GLibObject.Value()
g_object_get_property(ptr.assumingMemoryBound(to: GObject.self), property.rawValue, v.value_ptr)
return v
}
/// Set the value of a DevicePad property.
/// *Note* that this will only have an effect on properties that are writable and not construct-only!
/// - Parameter property: the property to get the value for
/// - Returns: the value of the named property
@inlinable func set(property: DevicePadPropertyName, value v: GLibObject.Value) {
g_object_set_property(ptr.assumingMemoryBound(to: GObject.self), property.rawValue, v.value_ptr)
}
}
public enum DevicePadSignalName: String, SignalNameProtocol {
/// The `changed` signal is emitted either when the `GdkDevice`
/// has changed the number of either axes or keys. For example
/// In X this will normally happen when the slave device routing
/// events through the master device changes (for example, user
/// switches from the USB mouse to a tablet), in that case the
/// master device will change to reflect the new slave device
/// axes and keys.
case changed = "changed"
/// The notify signal is emitted on an object when one of its properties has
/// its value set through `g_object_set_property()`, `g_object_set()`, et al.
///
/// Note that getting this signal doesnt itself guarantee that the value of
/// the property has actually changed. When it is emitted is determined by the
/// derived GObject class. If the implementor did not create the property with
/// `G_PARAM_EXPLICIT_NOTIFY`, then any call to `g_object_set_property()` results
/// in `notify` being emitted, even if the new value is the same as the old.
/// If they did pass `G_PARAM_EXPLICIT_NOTIFY`, then this signal is emitted only
/// when they explicitly call `g_object_notify()` or `g_object_notify_by_pspec()`,
/// and common practice is to do that only when the value has actually changed.
///
/// This signal is typically used to obtain change notification for a
/// single property, by specifying the property name as a detail in the
/// `g_signal_connect()` call, like this:
/// (C Language Example):
/// ```C
/// g_signal_connect (text_view->buffer, "notify::paste-target-list",
/// G_CALLBACK (gtk_text_view_target_list_notify),
/// text_view)
/// ```
/// It is important to note that you must use
/// [canonical parameter names](#canonical-parameter-names) as
/// detail strings for the notify signal.
case notify = "notify"
/// The `tool-changed` signal is emitted on pen/eraser
/// `GdkDevices` whenever tools enter or leave proximity.
case toolChanged = "tool-changed"
/// Associated pointer or keyboard with this device, if any. Devices of type `GDK_DEVICE_TYPE_MASTER`
/// always come in keyboard/pointer pairs. Other device types will have a `nil` associated device.
case notifyAssociatedDevice = "notify::associated-device"
/// The axes currently available for this device.
case notifyAxes = "notify::axes"
/// The `GdkDeviceManager` the `GdkDevice` pertains to.
case notifyDeviceManager = "notify::device-manager"
/// The `GdkDisplay` the `GdkDevice` pertains to.
case notifyDisplay = "notify::display"
/// Whether the device is represented by a cursor on the screen. Devices of type
/// `GDK_DEVICE_TYPE_MASTER` will have `true` here.
case notifyHasCursor = "notify::has-cursor"
case notifyInputMode = "notify::input-mode"
/// Source type for the device.
case notifyInputSource = "notify::input-source"
/// Number of axes in the device.
case notifyNAxes = "notify::n-axes"
/// The device name.
case notifyName = "notify::name"
/// The maximal number of concurrent touches on a touch device.
/// Will be 0 if the device is not a touch device or if the number
/// of touches is unknown.
case notifyNumTouches = "notify::num-touches"
/// Product ID of this device, see `gdk_device_get_product_id()`.
case notifyProductId = "notify::product-id"
/// `GdkSeat` of this device.
case notifySeat = "notify::seat"
case notifyTool = "notify::tool"
/// Device role in the device manager.
case notifyType = "notify::type"
/// Vendor ID of this device, see `gdk_device_get_vendor_id()`.
case notifyVendorId = "notify::vendor-id"
}
// MARK: DevicePad has no signals
// MARK: DevicePad Interface: DevicePadProtocol extension (methods and fields)
public extension DevicePadProtocol {
/// Return the stored, untyped pointer as a typed pointer to the `GdkDevicePad` instance.
@inlinable var device_pad_ptr: UnsafeMutablePointer<GdkDevicePad>! { return ptr?.assumingMemoryBound(to: GdkDevicePad.self) }
/// Returns the group the given `feature` and `idx` belong to,
/// or -1 if feature/index do not exist in `pad`.
@inlinable func getFeatureGroup(feature: GdkDevicePadFeature, featureIdx: Int) -> Int {
let rv = Int(gdk_device_pad_get_feature_group(device_pad_ptr, feature, gint(featureIdx)))
return rv
}
/// Returns the number of modes that `group` may have.
@inlinable func getGroupNModes(groupIdx: Int) -> Int {
let rv = Int(gdk_device_pad_get_group_n_modes(device_pad_ptr, gint(groupIdx)))
return rv
}
/// Returns the number of features a tablet pad has.
@inlinable func getNFeatures(feature: GdkDevicePadFeature) -> Int {
let rv = Int(gdk_device_pad_get_n_features(device_pad_ptr, feature))
return rv
}
/// Returns the number of groups this pad device has. Pads have
/// at least one group. A pad group is a subcollection of
/// buttons/strip/rings that is affected collectively by a same
/// current mode.
@inlinable func getNGroups() -> Int {
let rv = Int(gdk_device_pad_get_n_groups(device_pad_ptr))
return rv
}
/// Returns the number of groups this pad device has. Pads have
/// at least one group. A pad group is a subcollection of
/// buttons/strip/rings that is affected collectively by a same
/// current mode.
@inlinable var nGroups: Int {
/// Returns the number of groups this pad device has. Pads have
/// at least one group. A pad group is a subcollection of
/// buttons/strip/rings that is affected collectively by a same
/// current mode.
get {
let rv = Int(gdk_device_pad_get_n_groups(device_pad_ptr))
return rv
}
}
}

View File

@ -0,0 +1,580 @@
import CGLib
import CCairo
import CPango
import CGdkPixbuf
import CGdk
import GLib
import GLibObject
import GIO
import Pango
import Cairo
import PangoCairo
import GdkPixbuf
/// Metatype/GType declaration for DevicePad
public extension DevicePadInterfaceRef {
/// This getter returns the GLib type identifier registered for `DevicePad`
static var metatypeReference: GType { gdk_device_pad_get_type() }
private static var metatypePointer: UnsafeMutablePointer<GdkDevicePadInterface>? { g_type_class_peek_static(metatypeReference)?.assumingMemoryBound(to: GdkDevicePadInterface.self) }
static var metatype: GdkDevicePadInterface? { metatypePointer?.pointee }
static var wrapper: DevicePadInterfaceRef? { DevicePadInterfaceRef(metatypePointer) }
}
// MARK: - DevicePadInterface Record
/// The `DevicePadInterfaceProtocol` protocol exposes the methods and properties of an underlying `GdkDevicePadInterface` instance.
/// The default implementation of these can be found in the protocol extension below.
/// For a concrete class that implements these methods and properties, see `DevicePadInterface`.
/// Alternatively, use `DevicePadInterfaceRef` as a lighweight, `unowned` reference if you already have an instance you just want to use.
///
public protocol DevicePadInterfaceProtocol {
/// Untyped pointer to the underlying `GdkDevicePadInterface` instance.
var ptr: UnsafeMutableRawPointer! { get }
/// Typed pointer to the underlying `GdkDevicePadInterface` instance.
var _ptr: UnsafeMutablePointer<GdkDevicePadInterface>! { get }
/// Required Initialiser for types conforming to `DevicePadInterfaceProtocol`
init(raw: UnsafeMutableRawPointer)
}
/// The `DevicePadInterfaceRef` type acts as a lightweight Swift reference to an underlying `GdkDevicePadInterface` instance.
/// It exposes methods that can operate on this data type through `DevicePadInterfaceProtocol` conformance.
/// Use `DevicePadInterfaceRef` only as an `unowned` reference to an existing `GdkDevicePadInterface` instance.
///
public struct DevicePadInterfaceRef: DevicePadInterfaceProtocol {
/// Untyped pointer to the underlying `GdkDevicePadInterface` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
public let ptr: UnsafeMutableRawPointer!
}
public extension DevicePadInterfaceRef {
/// Designated initialiser from the underlying `C` data type
@inlinable init(_ p: UnsafeMutablePointer<GdkDevicePadInterface>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from a constant pointer to the underlying `C` data type
@inlinable init(_ p: UnsafePointer<GdkDevicePadInterface>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: p))
}
/// Conditional initialiser from an optional pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GdkDevicePadInterface>?) {
guard let p = maybePointer else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafePointer<GdkDevicePadInterface>?) {
guard let p = UnsafeMutablePointer(mutating: maybePointer) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional `gpointer`
@inlinable init!(gpointer g: gpointer?) {
guard let p = g else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable `gconstpointer`
@inlinable init!(gconstpointer g: gconstpointer?) {
guard let p = UnsafeMutableRawPointer(mutating: g) else { return nil }
ptr = p
}
/// Reference intialiser for a related type that implements `DevicePadInterfaceProtocol`
@inlinable init<T: DevicePadInterfaceProtocol>(_ other: T) {
ptr = other.ptr
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadInterfaceProtocol`.**
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadInterfaceProtocol`.**
@inlinable init<T>(constPointer: UnsafePointer<T>) {
ptr = UnsafeMutableRawPointer(mutating: UnsafeRawPointer(constPointer))
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadInterfaceProtocol`.**
@inlinable init(mutating raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadInterfaceProtocol`.**
@inlinable init(raw: UnsafeMutableRawPointer) {
ptr = raw
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DevicePadInterfaceProtocol`.**
@inlinable init(opaquePointer: OpaquePointer) {
ptr = UnsafeMutableRawPointer(opaquePointer)
}
}
// MARK: DevicePadInterface Record: DevicePadInterfaceProtocol extension (methods and fields)
public extension DevicePadInterfaceProtocol {
/// Return the stored, untyped pointer as a typed pointer to the `GdkDevicePadInterface` instance.
@inlinable var _ptr: UnsafeMutablePointer<GdkDevicePadInterface>! { return ptr?.assumingMemoryBound(to: GdkDevicePadInterface.self) }
}
/// Metatype/GType declaration for DrawingContext
public extension DrawingContextClassRef {
/// This getter returns the GLib type identifier registered for `DrawingContext`
static var metatypeReference: GType { gdk_drawing_context_get_type() }
private static var metatypePointer: UnsafeMutablePointer<GdkDrawingContextClass>? { g_type_class_peek_static(metatypeReference)?.assumingMemoryBound(to: GdkDrawingContextClass.self) }
static var metatype: GdkDrawingContextClass? { metatypePointer?.pointee }
static var wrapper: DrawingContextClassRef? { DrawingContextClassRef(metatypePointer) }
}
// MARK: - DrawingContextClass Record
/// The `DrawingContextClassProtocol` protocol exposes the methods and properties of an underlying `GdkDrawingContextClass` instance.
/// The default implementation of these can be found in the protocol extension below.
/// For a concrete class that implements these methods and properties, see `DrawingContextClass`.
/// Alternatively, use `DrawingContextClassRef` as a lighweight, `unowned` reference if you already have an instance you just want to use.
///
public protocol DrawingContextClassProtocol {
/// Untyped pointer to the underlying `GdkDrawingContextClass` instance.
var ptr: UnsafeMutableRawPointer! { get }
/// Typed pointer to the underlying `GdkDrawingContextClass` instance.
var _ptr: UnsafeMutablePointer<GdkDrawingContextClass>! { get }
/// Required Initialiser for types conforming to `DrawingContextClassProtocol`
init(raw: UnsafeMutableRawPointer)
}
/// The `DrawingContextClassRef` type acts as a lightweight Swift reference to an underlying `GdkDrawingContextClass` instance.
/// It exposes methods that can operate on this data type through `DrawingContextClassProtocol` conformance.
/// Use `DrawingContextClassRef` only as an `unowned` reference to an existing `GdkDrawingContextClass` instance.
///
public struct DrawingContextClassRef: DrawingContextClassProtocol {
/// Untyped pointer to the underlying `GdkDrawingContextClass` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
public let ptr: UnsafeMutableRawPointer!
}
public extension DrawingContextClassRef {
/// Designated initialiser from the underlying `C` data type
@inlinable init(_ p: UnsafeMutablePointer<GdkDrawingContextClass>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from a constant pointer to the underlying `C` data type
@inlinable init(_ p: UnsafePointer<GdkDrawingContextClass>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: p))
}
/// Conditional initialiser from an optional pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GdkDrawingContextClass>?) {
guard let p = maybePointer else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafePointer<GdkDrawingContextClass>?) {
guard let p = UnsafeMutablePointer(mutating: maybePointer) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional `gpointer`
@inlinable init!(gpointer g: gpointer?) {
guard let p = g else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable `gconstpointer`
@inlinable init!(gconstpointer g: gconstpointer?) {
guard let p = UnsafeMutableRawPointer(mutating: g) else { return nil }
ptr = p
}
/// Reference intialiser for a related type that implements `DrawingContextClassProtocol`
@inlinable init<T: DrawingContextClassProtocol>(_ other: T) {
ptr = other.ptr
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DrawingContextClassProtocol`.**
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DrawingContextClassProtocol`.**
@inlinable init<T>(constPointer: UnsafePointer<T>) {
ptr = UnsafeMutableRawPointer(mutating: UnsafeRawPointer(constPointer))
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DrawingContextClassProtocol`.**
@inlinable init(mutating raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DrawingContextClassProtocol`.**
@inlinable init(raw: UnsafeMutableRawPointer) {
ptr = raw
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `DrawingContextClassProtocol`.**
@inlinable init(opaquePointer: OpaquePointer) {
ptr = UnsafeMutableRawPointer(opaquePointer)
}
}
// MARK: DrawingContextClass Record: DrawingContextClassProtocol extension (methods and fields)
public extension DrawingContextClassProtocol {
/// Return the stored, untyped pointer as a typed pointer to the `GdkDrawingContextClass` instance.
@inlinable var _ptr: UnsafeMutablePointer<GdkDrawingContextClass>! { return ptr?.assumingMemoryBound(to: GdkDrawingContextClass.self) }
}
// MARK: - EventAny Record
/// The `EventAnyProtocol` protocol exposes the methods and properties of an underlying `GdkEventAny` instance.
/// The default implementation of these can be found in the protocol extension below.
/// For a concrete class that implements these methods and properties, see `EventAny`.
/// Alternatively, use `EventAnyRef` as a lighweight, `unowned` reference if you already have an instance you just want to use.
///
/// Contains the fields which are common to all event structs.
/// Any event pointer can safely be cast to a pointer to a `GdkEventAny` to
/// access these fields.
public protocol EventAnyProtocol {
/// Untyped pointer to the underlying `GdkEventAny` instance.
var ptr: UnsafeMutableRawPointer! { get }
/// Typed pointer to the underlying `GdkEventAny` instance.
var _ptr: UnsafeMutablePointer<GdkEventAny>! { get }
/// Required Initialiser for types conforming to `EventAnyProtocol`
init(raw: UnsafeMutableRawPointer)
}
/// The `EventAnyRef` type acts as a lightweight Swift reference to an underlying `GdkEventAny` instance.
/// It exposes methods that can operate on this data type through `EventAnyProtocol` conformance.
/// Use `EventAnyRef` only as an `unowned` reference to an existing `GdkEventAny` instance.
///
/// Contains the fields which are common to all event structs.
/// Any event pointer can safely be cast to a pointer to a `GdkEventAny` to
/// access these fields.
public struct EventAnyRef: EventAnyProtocol {
/// Untyped pointer to the underlying `GdkEventAny` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
public let ptr: UnsafeMutableRawPointer!
}
public extension EventAnyRef {
/// Designated initialiser from the underlying `C` data type
@inlinable init(_ p: UnsafeMutablePointer<GdkEventAny>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from a constant pointer to the underlying `C` data type
@inlinable init(_ p: UnsafePointer<GdkEventAny>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: p))
}
/// Conditional initialiser from an optional pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GdkEventAny>?) {
guard let p = maybePointer else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafePointer<GdkEventAny>?) {
guard let p = UnsafeMutablePointer(mutating: maybePointer) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional `gpointer`
@inlinable init!(gpointer g: gpointer?) {
guard let p = g else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable `gconstpointer`
@inlinable init!(gconstpointer g: gconstpointer?) {
guard let p = UnsafeMutableRawPointer(mutating: g) else { return nil }
ptr = p
}
/// Reference intialiser for a related type that implements `EventAnyProtocol`
@inlinable init<T: EventAnyProtocol>(_ other: T) {
ptr = other.ptr
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `EventAnyProtocol`.**
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `EventAnyProtocol`.**
@inlinable init<T>(constPointer: UnsafePointer<T>) {
ptr = UnsafeMutableRawPointer(mutating: UnsafeRawPointer(constPointer))
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `EventAnyProtocol`.**
@inlinable init(mutating raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `EventAnyProtocol`.**
@inlinable init(raw: UnsafeMutableRawPointer) {
ptr = raw
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `EventAnyProtocol`.**
@inlinable init(opaquePointer: OpaquePointer) {
ptr = UnsafeMutableRawPointer(opaquePointer)
}
}
/// The `EventAny` type acts as an owner of an underlying `GdkEventAny` instance.
/// It provides the methods that can operate on this data type through `EventAnyProtocol` conformance.
/// Use `EventAny` as a strong reference or owner of a `GdkEventAny` instance.
///
/// Contains the fields which are common to all event structs.
/// Any event pointer can safely be cast to a pointer to a `GdkEventAny` to
/// access these fields.
open class EventAny: EventAnyProtocol {
/// Untyped pointer to the underlying `GdkEventAny` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
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 `EventAny` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafeMutablePointer<GdkEventAny>) {
ptr = UnsafeMutableRawPointer(op)
}
/// 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 `EventAny` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafePointer<GdkEventAny>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: op))
}
/// 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 `EventAny` instance.
/// - Parameter op: gpointer to the underlying object
@inlinable public init!(gpointer op: gpointer?) {
guard let p = UnsafeMutableRawPointer(op) else { return nil }
ptr = p
}
/// 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 `EventAny` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(gconstpointer op: gconstpointer?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// 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 `EventAny` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafePointer<GdkEventAny>?) {
guard let p = UnsafeMutablePointer(mutating: op) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Optional initialiser from the underlying `C` data type.
/// This creates an instance without performing an unbalanced retain
/// i.e., ownership is transferred to the `EventAny` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafeMutablePointer<GdkEventAny>?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from the underlying `C` data type.
/// `GdkEventAny` does not allow reference counting, so despite the name no actual retaining will occur.
/// i.e., ownership is transferred to the `EventAny` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(retaining op: UnsafeMutablePointer<GdkEventAny>) {
ptr = UnsafeMutableRawPointer(op)
// no reference counting for GdkEventAny, cannot ref(_ptr)
}
/// Reference intialiser for a related type that implements `EventAnyProtocol`
/// `GdkEventAny` does not allow reference counting.
/// - Parameter other: an instance of a related type that implements `EventAnyProtocol`
@inlinable public init<T: EventAnyProtocol>(_ other: T) {
ptr = other.ptr
// no reference counting for GdkEventAny, cannot ref(_ptr)
}
/// Do-nothing destructor for `GdkEventAny`.
deinit {
// no reference counting for GdkEventAny, cannot unref(_ptr)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `EventAnyProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(cPointer p: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe typed, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `EventAnyProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
// no reference counting for GdkEventAny, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `EventAnyProtocol`.**
/// - Parameter p: raw pointer to the underlying object
@inlinable public init(raw p: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `EventAnyProtocol`.**
@inlinable public init(retainingRaw raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
// no reference counting for GdkEventAny, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `EventAnyProtocol`.**
/// - Parameter p: mutable raw pointer to the underlying object
@inlinable public required init(raw p: UnsafeMutableRawPointer) {
ptr = p
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `EventAnyProtocol`.**
/// - Parameter raw: mutable raw pointer to the underlying object
@inlinable public init(retainingRaw raw: UnsafeMutableRawPointer) {
ptr = raw
// no reference counting for GdkEventAny, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `EventAnyProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(opaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `EventAnyProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(retainingOpaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
// no reference counting for GdkEventAny, cannot ref(_ptr)
}
}
// MARK: no EventAny properties
// MARK: no EventAny signals
// MARK: EventAny has no signals
// MARK: EventAny Record: EventAnyProtocol extension (methods and fields)
public extension EventAnyProtocol {
/// Return the stored, untyped pointer as a typed pointer to the `GdkEventAny` instance.
@inlinable var _ptr: UnsafeMutablePointer<GdkEventAny>! { return ptr?.assumingMemoryBound(to: GdkEventAny.self) }
/// the type of the event.
@inlinable var type: GdkEventType {
/// the type of the event.
get {
let rv = _ptr.pointee.type
return rv
}
/// the type of the event.
set {
_ptr.pointee.type = newValue
}
}
/// the window which received the event.
@inlinable var window: WindowRef! {
/// the window which received the event.
get {
let rv = WindowRef(gconstpointer: gconstpointer(_ptr.pointee.window))
return rv
}
/// the window which received the event.
set {
_ptr.pointee.window = UnsafeMutablePointer<GdkWindow>(newValue.window_ptr)
}
}
/// `true` if the event was sent explicitly.
@inlinable var sendEvent: gint8 {
/// `true` if the event was sent explicitly.
get {
let rv = _ptr.pointee.send_event
return rv
}
/// `true` if the event was sent explicitly.
set {
_ptr.pointee.send_event = newValue
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,473 @@
import CGLib
import CCairo
import CPango
import CGdkPixbuf
import CGdk
import GLib
import GLibObject
import GIO
import Pango
import Cairo
import PangoCairo
import GdkPixbuf
// MARK: - KeymapKey Record
/// The `KeymapKeyProtocol` protocol exposes the methods and properties of an underlying `GdkKeymapKey` instance.
/// The default implementation of these can be found in the protocol extension below.
/// For a concrete class that implements these methods and properties, see `KeymapKey`.
/// Alternatively, use `KeymapKeyRef` as a lighweight, `unowned` reference if you already have an instance you just want to use.
///
/// A `GdkKeymapKey` is a hardware key that can be mapped to a keyval.
public protocol KeymapKeyProtocol {
/// Untyped pointer to the underlying `GdkKeymapKey` instance.
var ptr: UnsafeMutableRawPointer! { get }
/// Typed pointer to the underlying `GdkKeymapKey` instance.
var _ptr: UnsafeMutablePointer<GdkKeymapKey>! { get }
/// Required Initialiser for types conforming to `KeymapKeyProtocol`
init(raw: UnsafeMutableRawPointer)
}
/// The `KeymapKeyRef` type acts as a lightweight Swift reference to an underlying `GdkKeymapKey` instance.
/// It exposes methods that can operate on this data type through `KeymapKeyProtocol` conformance.
/// Use `KeymapKeyRef` only as an `unowned` reference to an existing `GdkKeymapKey` instance.
///
/// A `GdkKeymapKey` is a hardware key that can be mapped to a keyval.
public struct KeymapKeyRef: KeymapKeyProtocol {
/// Untyped pointer to the underlying `GdkKeymapKey` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
public let ptr: UnsafeMutableRawPointer!
}
public extension KeymapKeyRef {
/// Designated initialiser from the underlying `C` data type
@inlinable init(_ p: UnsafeMutablePointer<GdkKeymapKey>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from a constant pointer to the underlying `C` data type
@inlinable init(_ p: UnsafePointer<GdkKeymapKey>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: p))
}
/// Conditional initialiser from an optional pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GdkKeymapKey>?) {
guard let p = maybePointer else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafePointer<GdkKeymapKey>?) {
guard let p = UnsafeMutablePointer(mutating: maybePointer) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional `gpointer`
@inlinable init!(gpointer g: gpointer?) {
guard let p = g else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable `gconstpointer`
@inlinable init!(gconstpointer g: gconstpointer?) {
guard let p = UnsafeMutableRawPointer(mutating: g) else { return nil }
ptr = p
}
/// Reference intialiser for a related type that implements `KeymapKeyProtocol`
@inlinable init<T: KeymapKeyProtocol>(_ other: T) {
ptr = other.ptr
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `KeymapKeyProtocol`.**
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `KeymapKeyProtocol`.**
@inlinable init<T>(constPointer: UnsafePointer<T>) {
ptr = UnsafeMutableRawPointer(mutating: UnsafeRawPointer(constPointer))
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `KeymapKeyProtocol`.**
@inlinable init(mutating raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `KeymapKeyProtocol`.**
@inlinable init(raw: UnsafeMutableRawPointer) {
ptr = raw
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `KeymapKeyProtocol`.**
@inlinable init(opaquePointer: OpaquePointer) {
ptr = UnsafeMutableRawPointer(opaquePointer)
}
}
/// The `KeymapKey` type acts as an owner of an underlying `GdkKeymapKey` instance.
/// It provides the methods that can operate on this data type through `KeymapKeyProtocol` conformance.
/// Use `KeymapKey` as a strong reference or owner of a `GdkKeymapKey` instance.
///
/// A `GdkKeymapKey` is a hardware key that can be mapped to a keyval.
open class KeymapKey: KeymapKeyProtocol {
/// Untyped pointer to the underlying `GdkKeymapKey` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
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 `KeymapKey` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafeMutablePointer<GdkKeymapKey>) {
ptr = UnsafeMutableRawPointer(op)
}
/// 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 `KeymapKey` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafePointer<GdkKeymapKey>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: op))
}
/// 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 `KeymapKey` instance.
/// - Parameter op: gpointer to the underlying object
@inlinable public init!(gpointer op: gpointer?) {
guard let p = UnsafeMutableRawPointer(op) else { return nil }
ptr = p
}
/// 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 `KeymapKey` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(gconstpointer op: gconstpointer?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// 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 `KeymapKey` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafePointer<GdkKeymapKey>?) {
guard let p = UnsafeMutablePointer(mutating: op) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Optional initialiser from the underlying `C` data type.
/// This creates an instance without performing an unbalanced retain
/// i.e., ownership is transferred to the `KeymapKey` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafeMutablePointer<GdkKeymapKey>?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from the underlying `C` data type.
/// `GdkKeymapKey` does not allow reference counting, so despite the name no actual retaining will occur.
/// i.e., ownership is transferred to the `KeymapKey` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(retaining op: UnsafeMutablePointer<GdkKeymapKey>) {
ptr = UnsafeMutableRawPointer(op)
// no reference counting for GdkKeymapKey, cannot ref(_ptr)
}
/// Reference intialiser for a related type that implements `KeymapKeyProtocol`
/// `GdkKeymapKey` does not allow reference counting.
/// - Parameter other: an instance of a related type that implements `KeymapKeyProtocol`
@inlinable public init<T: KeymapKeyProtocol>(_ other: T) {
ptr = other.ptr
// no reference counting for GdkKeymapKey, cannot ref(_ptr)
}
/// Do-nothing destructor for `GdkKeymapKey`.
deinit {
// no reference counting for GdkKeymapKey, cannot unref(_ptr)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `KeymapKeyProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(cPointer p: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe typed, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `KeymapKeyProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
// no reference counting for GdkKeymapKey, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `KeymapKeyProtocol`.**
/// - Parameter p: raw pointer to the underlying object
@inlinable public init(raw p: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `KeymapKeyProtocol`.**
@inlinable public init(retainingRaw raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
// no reference counting for GdkKeymapKey, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `KeymapKeyProtocol`.**
/// - Parameter p: mutable raw pointer to the underlying object
@inlinable public required init(raw p: UnsafeMutableRawPointer) {
ptr = p
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `KeymapKeyProtocol`.**
/// - Parameter raw: mutable raw pointer to the underlying object
@inlinable public init(retainingRaw raw: UnsafeMutableRawPointer) {
ptr = raw
// no reference counting for GdkKeymapKey, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `KeymapKeyProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(opaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `KeymapKeyProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(retainingOpaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
// no reference counting for GdkKeymapKey, cannot ref(_ptr)
}
}
// MARK: no KeymapKey properties
// MARK: no KeymapKey signals
// MARK: KeymapKey has no signals
// MARK: KeymapKey Record: KeymapKeyProtocol extension (methods and fields)
public extension KeymapKeyProtocol {
/// Return the stored, untyped pointer as a typed pointer to the `GdkKeymapKey` instance.
@inlinable var _ptr: UnsafeMutablePointer<GdkKeymapKey>! { return ptr?.assumingMemoryBound(to: GdkKeymapKey.self) }
/// the hardware keycode. This is an identifying number for a
/// physical key.
@inlinable var keycode: guint {
/// the hardware keycode. This is an identifying number for a
/// physical key.
get {
let rv = _ptr.pointee.keycode
return rv
}
/// the hardware keycode. This is an identifying number for a
/// physical key.
set {
_ptr.pointee.keycode = newValue
}
}
/// indicates movement in a horizontal direction. Usually groups are used
/// for two different languages. In group 0, a key might have two English
/// characters, and in group 1 it might have two Hebrew characters. The Hebrew
/// characters will be printed on the key next to the English characters.
@inlinable var group: gint {
/// indicates movement in a horizontal direction. Usually groups are used
/// for two different languages. In group 0, a key might have two English
/// characters, and in group 1 it might have two Hebrew characters. The Hebrew
/// characters will be printed on the key next to the English characters.
get {
let rv = _ptr.pointee.group
return rv
}
/// indicates movement in a horizontal direction. Usually groups are used
/// for two different languages. In group 0, a key might have two English
/// characters, and in group 1 it might have two Hebrew characters. The Hebrew
/// characters will be printed on the key next to the English characters.
set {
_ptr.pointee.group = newValue
}
}
/// indicates which symbol on the key will be used, in a vertical direction.
/// So on a standard US keyboard, the key with the number 1 on it also has the
/// exclamation point ("!") character on it. The level indicates whether to use
/// the 1 or the ! symbol. The letter keys are considered to have a lowercase
/// letter at level 0, and an uppercase letter at level 1, though only the
/// uppercase letter is printed.
@inlinable var level: gint {
/// indicates which symbol on the key will be used, in a vertical direction.
/// So on a standard US keyboard, the key with the number 1 on it also has the
/// exclamation point ("!") character on it. The level indicates whether to use
/// the 1 or the ! symbol. The letter keys are considered to have a lowercase
/// letter at level 0, and an uppercase letter at level 1, though only the
/// uppercase letter is printed.
get {
let rv = _ptr.pointee.level
return rv
}
/// indicates which symbol on the key will be used, in a vertical direction.
/// So on a standard US keyboard, the key with the number 1 on it also has the
/// exclamation point ("!") character on it. The level indicates whether to use
/// the 1 or the ! symbol. The letter keys are considered to have a lowercase
/// letter at level 0, and an uppercase letter at level 1, though only the
/// uppercase letter is printed.
set {
_ptr.pointee.level = newValue
}
}
}
/// Metatype/GType declaration for Monitor
public extension MonitorClassRef {
/// This getter returns the GLib type identifier registered for `Monitor`
static var metatypeReference: GType { gdk_monitor_get_type() }
private static var metatypePointer: UnsafeMutablePointer<GdkMonitorClass>? { g_type_class_peek_static(metatypeReference)?.assumingMemoryBound(to: GdkMonitorClass.self) }
static var metatype: GdkMonitorClass? { metatypePointer?.pointee }
static var wrapper: MonitorClassRef? { MonitorClassRef(metatypePointer) }
}
// MARK: - MonitorClass Record
/// The `MonitorClassProtocol` protocol exposes the methods and properties of an underlying `GdkMonitorClass` instance.
/// The default implementation of these can be found in the protocol extension below.
/// For a concrete class that implements these methods and properties, see `MonitorClass`.
/// Alternatively, use `MonitorClassRef` as a lighweight, `unowned` reference if you already have an instance you just want to use.
///
public protocol MonitorClassProtocol {
/// Untyped pointer to the underlying `GdkMonitorClass` instance.
var ptr: UnsafeMutableRawPointer! { get }
/// Typed pointer to the underlying `GdkMonitorClass` instance.
var _ptr: UnsafeMutablePointer<GdkMonitorClass>! { get }
/// Required Initialiser for types conforming to `MonitorClassProtocol`
init(raw: UnsafeMutableRawPointer)
}
/// The `MonitorClassRef` type acts as a lightweight Swift reference to an underlying `GdkMonitorClass` instance.
/// It exposes methods that can operate on this data type through `MonitorClassProtocol` conformance.
/// Use `MonitorClassRef` only as an `unowned` reference to an existing `GdkMonitorClass` instance.
///
public struct MonitorClassRef: MonitorClassProtocol {
/// Untyped pointer to the underlying `GdkMonitorClass` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
public let ptr: UnsafeMutableRawPointer!
}
public extension MonitorClassRef {
/// Designated initialiser from the underlying `C` data type
@inlinable init(_ p: UnsafeMutablePointer<GdkMonitorClass>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from a constant pointer to the underlying `C` data type
@inlinable init(_ p: UnsafePointer<GdkMonitorClass>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: p))
}
/// Conditional initialiser from an optional pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GdkMonitorClass>?) {
guard let p = maybePointer else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafePointer<GdkMonitorClass>?) {
guard let p = UnsafeMutablePointer(mutating: maybePointer) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional `gpointer`
@inlinable init!(gpointer g: gpointer?) {
guard let p = g else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable `gconstpointer`
@inlinable init!(gconstpointer g: gconstpointer?) {
guard let p = UnsafeMutableRawPointer(mutating: g) else { return nil }
ptr = p
}
/// Reference intialiser for a related type that implements `MonitorClassProtocol`
@inlinable init<T: MonitorClassProtocol>(_ other: T) {
ptr = other.ptr
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `MonitorClassProtocol`.**
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `MonitorClassProtocol`.**
@inlinable init<T>(constPointer: UnsafePointer<T>) {
ptr = UnsafeMutableRawPointer(mutating: UnsafeRawPointer(constPointer))
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `MonitorClassProtocol`.**
@inlinable init(mutating raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `MonitorClassProtocol`.**
@inlinable init(raw: UnsafeMutableRawPointer) {
ptr = raw
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `MonitorClassProtocol`.**
@inlinable init(opaquePointer: OpaquePointer) {
ptr = UnsafeMutableRawPointer(opaquePointer)
}
}
// MARK: MonitorClass Record: MonitorClassProtocol extension (methods and fields)
public extension MonitorClassProtocol {
/// Return the stored, untyped pointer as a typed pointer to the `GdkMonitorClass` instance.
@inlinable var _ptr: UnsafeMutablePointer<GdkMonitorClass>! { return ptr?.assumingMemoryBound(to: GdkMonitorClass.self) }
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,701 @@
import CGLib
import CCairo
import CPango
import CGdkPixbuf
import CGdk
import GLib
import GLibObject
import GIO
import Pango
import Cairo
import PangoCairo
import GdkPixbuf
// MARK: - Point Record
/// The `PointProtocol` protocol exposes the methods and properties of an underlying `GdkPoint` instance.
/// The default implementation of these can be found in the protocol extension below.
/// For a concrete class that implements these methods and properties, see `Point`.
/// Alternatively, use `PointRef` as a lighweight, `unowned` reference if you already have an instance you just want to use.
///
/// Defines the x and y coordinates of a point.
public protocol PointProtocol {
/// Untyped pointer to the underlying `GdkPoint` instance.
var ptr: UnsafeMutableRawPointer! { get }
/// Typed pointer to the underlying `GdkPoint` instance.
var _ptr: UnsafeMutablePointer<GdkPoint>! { get }
/// Required Initialiser for types conforming to `PointProtocol`
init(raw: UnsafeMutableRawPointer)
}
/// The `PointRef` type acts as a lightweight Swift reference to an underlying `GdkPoint` instance.
/// It exposes methods that can operate on this data type through `PointProtocol` conformance.
/// Use `PointRef` only as an `unowned` reference to an existing `GdkPoint` instance.
///
/// Defines the x and y coordinates of a point.
public struct PointRef: PointProtocol {
/// Untyped pointer to the underlying `GdkPoint` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
public let ptr: UnsafeMutableRawPointer!
}
public extension PointRef {
/// Designated initialiser from the underlying `C` data type
@inlinable init(_ p: UnsafeMutablePointer<GdkPoint>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from a constant pointer to the underlying `C` data type
@inlinable init(_ p: UnsafePointer<GdkPoint>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: p))
}
/// Conditional initialiser from an optional pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GdkPoint>?) {
guard let p = maybePointer else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafePointer<GdkPoint>?) {
guard let p = UnsafeMutablePointer(mutating: maybePointer) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional `gpointer`
@inlinable init!(gpointer g: gpointer?) {
guard let p = g else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable `gconstpointer`
@inlinable init!(gconstpointer g: gconstpointer?) {
guard let p = UnsafeMutableRawPointer(mutating: g) else { return nil }
ptr = p
}
/// Reference intialiser for a related type that implements `PointProtocol`
@inlinable init<T: PointProtocol>(_ other: T) {
ptr = other.ptr
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `PointProtocol`.**
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `PointProtocol`.**
@inlinable init<T>(constPointer: UnsafePointer<T>) {
ptr = UnsafeMutableRawPointer(mutating: UnsafeRawPointer(constPointer))
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `PointProtocol`.**
@inlinable init(mutating raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `PointProtocol`.**
@inlinable init(raw: UnsafeMutableRawPointer) {
ptr = raw
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `PointProtocol`.**
@inlinable init(opaquePointer: OpaquePointer) {
ptr = UnsafeMutableRawPointer(opaquePointer)
}
}
/// The `Point` type acts as an owner of an underlying `GdkPoint` instance.
/// It provides the methods that can operate on this data type through `PointProtocol` conformance.
/// Use `Point` as a strong reference or owner of a `GdkPoint` instance.
///
/// Defines the x and y coordinates of a point.
open class Point: PointProtocol {
/// Untyped pointer to the underlying `GdkPoint` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
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 `Point` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafeMutablePointer<GdkPoint>) {
ptr = UnsafeMutableRawPointer(op)
}
/// 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 `Point` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafePointer<GdkPoint>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: op))
}
/// 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 `Point` instance.
/// - Parameter op: gpointer to the underlying object
@inlinable public init!(gpointer op: gpointer?) {
guard let p = UnsafeMutableRawPointer(op) else { return nil }
ptr = p
}
/// 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 `Point` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(gconstpointer op: gconstpointer?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// 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 `Point` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafePointer<GdkPoint>?) {
guard let p = UnsafeMutablePointer(mutating: op) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Optional initialiser from the underlying `C` data type.
/// This creates an instance without performing an unbalanced retain
/// i.e., ownership is transferred to the `Point` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafeMutablePointer<GdkPoint>?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from the underlying `C` data type.
/// `GdkPoint` does not allow reference counting, so despite the name no actual retaining will occur.
/// i.e., ownership is transferred to the `Point` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(retaining op: UnsafeMutablePointer<GdkPoint>) {
ptr = UnsafeMutableRawPointer(op)
// no reference counting for GdkPoint, cannot ref(_ptr)
}
/// Reference intialiser for a related type that implements `PointProtocol`
/// `GdkPoint` does not allow reference counting.
/// - Parameter other: an instance of a related type that implements `PointProtocol`
@inlinable public init<T: PointProtocol>(_ other: T) {
ptr = other.ptr
// no reference counting for GdkPoint, cannot ref(_ptr)
}
/// Do-nothing destructor for `GdkPoint`.
deinit {
// no reference counting for GdkPoint, cannot unref(_ptr)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `PointProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(cPointer p: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe typed, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `PointProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
// no reference counting for GdkPoint, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `PointProtocol`.**
/// - Parameter p: raw pointer to the underlying object
@inlinable public init(raw p: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `PointProtocol`.**
@inlinable public init(retainingRaw raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
// no reference counting for GdkPoint, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `PointProtocol`.**
/// - Parameter p: mutable raw pointer to the underlying object
@inlinable public required init(raw p: UnsafeMutableRawPointer) {
ptr = p
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `PointProtocol`.**
/// - Parameter raw: mutable raw pointer to the underlying object
@inlinable public init(retainingRaw raw: UnsafeMutableRawPointer) {
ptr = raw
// no reference counting for GdkPoint, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `PointProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(opaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `PointProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(retainingOpaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
// no reference counting for GdkPoint, cannot ref(_ptr)
}
}
// MARK: no Point properties
// MARK: no Point signals
// MARK: Point has no signals
// MARK: Point Record: PointProtocol extension (methods and fields)
public extension PointProtocol {
/// Return the stored, untyped pointer as a typed pointer to the `GdkPoint` instance.
@inlinable var _ptr: UnsafeMutablePointer<GdkPoint>! { return ptr?.assumingMemoryBound(to: GdkPoint.self) }
/// the x coordinate of the point.
@inlinable var x: gint {
/// the x coordinate of the point.
get {
let rv = _ptr.pointee.x
return rv
}
/// the x coordinate of the point.
set {
_ptr.pointee.x = newValue
}
}
/// the y coordinate of the point.
@inlinable var y: gint {
/// the y coordinate of the point.
get {
let rv = _ptr.pointee.y
return rv
}
/// the y coordinate of the point.
set {
_ptr.pointee.y = newValue
}
}
}
// MARK: - RGBA Record
/// The `RGBAProtocol` protocol exposes the methods and properties of an underlying `GdkRGBA` instance.
/// The default implementation of these can be found in the protocol extension below.
/// For a concrete class that implements these methods and properties, see `RGBA`.
/// Alternatively, use `RGBARef` as a lighweight, `unowned` reference if you already have an instance you just want to use.
///
/// A `GdkRGBA` is used to represent a (possibly translucent)
/// color, in a way that is compatible with cairos notion of color.
public protocol RGBAProtocol {
/// Untyped pointer to the underlying `GdkRGBA` instance.
var ptr: UnsafeMutableRawPointer! { get }
/// Typed pointer to the underlying `GdkRGBA` instance.
var rgba_ptr: UnsafeMutablePointer<GdkRGBA>! { get }
/// Required Initialiser for types conforming to `RGBAProtocol`
init(raw: UnsafeMutableRawPointer)
}
/// The `RGBARef` type acts as a lightweight Swift reference to an underlying `GdkRGBA` instance.
/// It exposes methods that can operate on this data type through `RGBAProtocol` conformance.
/// Use `RGBARef` only as an `unowned` reference to an existing `GdkRGBA` instance.
///
/// A `GdkRGBA` is used to represent a (possibly translucent)
/// color, in a way that is compatible with cairos notion of color.
public struct RGBARef: RGBAProtocol {
/// Untyped pointer to the underlying `GdkRGBA` instance.
/// For type-safe access, use the generated, typed pointer `rgba_ptr` property instead.
public let ptr: UnsafeMutableRawPointer!
}
public extension RGBARef {
/// Designated initialiser from the underlying `C` data type
@inlinable init(_ p: UnsafeMutablePointer<GdkRGBA>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from a constant pointer to the underlying `C` data type
@inlinable init(_ p: UnsafePointer<GdkRGBA>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: p))
}
/// Conditional initialiser from an optional pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GdkRGBA>?) {
guard let p = maybePointer else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafePointer<GdkRGBA>?) {
guard let p = UnsafeMutablePointer(mutating: maybePointer) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional `gpointer`
@inlinable init!(gpointer g: gpointer?) {
guard let p = g else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable `gconstpointer`
@inlinable init!(gconstpointer g: gconstpointer?) {
guard let p = UnsafeMutableRawPointer(mutating: g) else { return nil }
ptr = p
}
/// Reference intialiser for a related type that implements `RGBAProtocol`
@inlinable init<T: RGBAProtocol>(_ other: T) {
ptr = other.ptr
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RGBAProtocol`.**
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RGBAProtocol`.**
@inlinable init<T>(constPointer: UnsafePointer<T>) {
ptr = UnsafeMutableRawPointer(mutating: UnsafeRawPointer(constPointer))
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RGBAProtocol`.**
@inlinable init(mutating raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RGBAProtocol`.**
@inlinable init(raw: UnsafeMutableRawPointer) {
ptr = raw
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RGBAProtocol`.**
@inlinable init(opaquePointer: OpaquePointer) {
ptr = UnsafeMutableRawPointer(opaquePointer)
}
}
/// The `RGBA` type acts as an owner of an underlying `GdkRGBA` instance.
/// It provides the methods that can operate on this data type through `RGBAProtocol` conformance.
/// Use `RGBA` as a strong reference or owner of a `GdkRGBA` instance.
///
/// A `GdkRGBA` is used to represent a (possibly translucent)
/// color, in a way that is compatible with cairos notion of color.
open class RGBA: RGBAProtocol {
/// Untyped pointer to the underlying `GdkRGBA` instance.
/// For type-safe access, use the generated, typed pointer `rgba_ptr` property instead.
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 `RGBA` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafeMutablePointer<GdkRGBA>) {
ptr = UnsafeMutableRawPointer(op)
}
/// 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 `RGBA` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafePointer<GdkRGBA>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: op))
}
/// 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 `RGBA` instance.
/// - Parameter op: gpointer to the underlying object
@inlinable public init!(gpointer op: gpointer?) {
guard let p = UnsafeMutableRawPointer(op) else { return nil }
ptr = p
}
/// 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 `RGBA` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(gconstpointer op: gconstpointer?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// 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 `RGBA` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafePointer<GdkRGBA>?) {
guard let p = UnsafeMutablePointer(mutating: op) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Optional initialiser from the underlying `C` data type.
/// This creates an instance without performing an unbalanced retain
/// i.e., ownership is transferred to the `RGBA` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafeMutablePointer<GdkRGBA>?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from the underlying `C` data type.
/// `GdkRGBA` does not allow reference counting, so despite the name no actual retaining will occur.
/// i.e., ownership is transferred to the `RGBA` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(retaining op: UnsafeMutablePointer<GdkRGBA>) {
ptr = UnsafeMutableRawPointer(op)
// no reference counting for GdkRGBA, cannot ref(rgba_ptr)
}
/// Reference intialiser for a related type that implements `RGBAProtocol`
/// `GdkRGBA` does not allow reference counting.
/// - Parameter other: an instance of a related type that implements `RGBAProtocol`
@inlinable public init<T: RGBAProtocol>(_ other: T) {
ptr = other.ptr
// no reference counting for GdkRGBA, cannot ref(rgba_ptr)
}
/// Do-nothing destructor for `GdkRGBA`.
deinit {
// no reference counting for GdkRGBA, cannot unref(rgba_ptr)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RGBAProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(cPointer p: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe typed, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RGBAProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
// no reference counting for GdkRGBA, cannot ref(rgba_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RGBAProtocol`.**
/// - Parameter p: raw pointer to the underlying object
@inlinable public init(raw p: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RGBAProtocol`.**
@inlinable public init(retainingRaw raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
// no reference counting for GdkRGBA, cannot ref(rgba_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RGBAProtocol`.**
/// - Parameter p: mutable raw pointer to the underlying object
@inlinable public required init(raw p: UnsafeMutableRawPointer) {
ptr = p
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RGBAProtocol`.**
/// - Parameter raw: mutable raw pointer to the underlying object
@inlinable public init(retainingRaw raw: UnsafeMutableRawPointer) {
ptr = raw
// no reference counting for GdkRGBA, cannot ref(rgba_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RGBAProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(opaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RGBAProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(retainingOpaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
// no reference counting for GdkRGBA, cannot ref(rgba_ptr)
}
}
// MARK: no RGBA properties
// MARK: no RGBA signals
// MARK: RGBA has no signals
// MARK: RGBA Record: RGBAProtocol extension (methods and fields)
public extension RGBAProtocol {
/// Return the stored, untyped pointer as a typed pointer to the `GdkRGBA` instance.
@inlinable var rgba_ptr: UnsafeMutablePointer<GdkRGBA>! { return ptr?.assumingMemoryBound(to: GdkRGBA.self) }
/// Makes a copy of a `GdkRGBA`.
///
/// The result must be freed through `gdk_rgba_free()`.
@inlinable func copy() -> RGBARef! {
guard let rv = RGBARef(gconstpointer: gconstpointer(gdk_rgba_copy(rgba_ptr))) else { return nil }
return rv
}
/// Compares two RGBA colors.
@inlinable func equal<RGBAT: RGBAProtocol>(p2: RGBAT) -> Bool {
let rv = ((gdk_rgba_equal(rgba_ptr, p2.rgba_ptr)) != 0)
return rv
}
/// Frees a `GdkRGBA` created with `gdk_rgba_copy()`
@inlinable func free() {
gdk_rgba_free(rgba_ptr)
}
/// A hash function suitable for using for a hash
/// table that stores `GdkRGBAs`.
@inlinable func hash() -> Int {
let rv = Int(gdk_rgba_hash(rgba_ptr))
return rv
}
/// Parses a textual representation of a color, filling in
/// the `red`, `green`, `blue` and `alpha` fields of the `rgba` `GdkRGBA`.
///
/// The string can be either one of:
/// - A standard name (Taken from the X11 rgb.txt file).
/// - A hexadecimal value in the form \`rgb`, \`rrggbb`,
/// \`rrrgggbbb` or \`rrrrggggbbbb`
/// - A RGB color in the form `rgb(r,g,b)` (In this case the color will
/// have full opacity)
/// - A RGBA color in the form `rgba(r,g,b,a)`
///
/// Where r, g, b and a are respectively the red, green, blue and
/// alpha color values. In the last two cases, r, g, and b are either integers
/// in the range 0 to 255 or percentage values in the range 0% to 100``, and
/// a is a floating point value in the range 0 to 1.
@inlinable func parse(spec: UnsafePointer<gchar>!) -> Bool {
let rv = ((gdk_rgba_parse(rgba_ptr, spec)) != 0)
return rv
}
/// Returns a textual specification of `rgba` in the form
/// ``rgb(r,g,b)`` or
/// ``rgba(r g,b,a)``,
/// where r, g, b and a represent the red, green,
/// blue and alpha values respectively. r, g, and b are
/// represented as integers in the range 0 to 255, and a
/// is represented as a floating point value in the range 0 to 1.
///
/// These string forms are string forms that are supported by
/// the CSS3 colors module, and can be parsed by `gdk_rgba_parse()`.
///
/// Note that this string representation may lose some
/// precision, since r, g and b are represented as 8-bit
/// integers. If this is a concern, you should use a
/// different representation.
@inlinable func toString() -> String! {
let rv = gdk_rgba_to_string(rgba_ptr).map({ String(cString: $0) })
return rv
}
/// Sets the specified `GdkRGBA` as the source color of `cr`.
@inlinable func cairoSetSourceRgba<ContextT: Cairo.ContextProtocol>(cr: ContextT) {
gdk_cairo_set_source_rgba(cr._ptr, rgba_ptr)
}
/// The intensity of the red channel from 0.0 to 1.0 inclusive
@inlinable var red: gdouble {
/// The intensity of the red channel from 0.0 to 1.0 inclusive
get {
let rv = rgba_ptr.pointee.red
return rv
}
/// The intensity of the red channel from 0.0 to 1.0 inclusive
set {
rgba_ptr.pointee.red = newValue
}
}
/// The intensity of the green channel from 0.0 to 1.0 inclusive
@inlinable var green: gdouble {
/// The intensity of the green channel from 0.0 to 1.0 inclusive
get {
let rv = rgba_ptr.pointee.green
return rv
}
/// The intensity of the green channel from 0.0 to 1.0 inclusive
set {
rgba_ptr.pointee.green = newValue
}
}
/// The intensity of the blue channel from 0.0 to 1.0 inclusive
@inlinable var blue: gdouble {
/// The intensity of the blue channel from 0.0 to 1.0 inclusive
get {
let rv = rgba_ptr.pointee.blue
return rv
}
/// The intensity of the blue channel from 0.0 to 1.0 inclusive
set {
rgba_ptr.pointee.blue = newValue
}
}
/// The opacity of the color from 0.0 for completely translucent to
/// 1.0 for opaque
@inlinable var alpha: gdouble {
/// The opacity of the color from 0.0 for completely translucent to
/// 1.0 for opaque
get {
let rv = rgba_ptr.pointee.alpha
return rv
}
/// The opacity of the color from 0.0 for completely translucent to
/// 1.0 for opaque
set {
rgba_ptr.pointee.alpha = newValue
}
}
}

View File

@ -0,0 +1,656 @@
import CGLib
import CCairo
import CPango
import CGdkPixbuf
import CGdk
import GLib
import GLibObject
import GIO
import Pango
import Cairo
import PangoCairo
import GdkPixbuf
// MARK: - Rectangle Record
/// The `RectangleProtocol` protocol exposes the methods and properties of an underlying `GdkRectangle` instance.
/// The default implementation of these can be found in the protocol extension below.
/// For a concrete class that implements these methods and properties, see `Rectangle`.
/// Alternatively, use `RectangleRef` as a lighweight, `unowned` reference if you already have an instance you just want to use.
///
/// Defines the position and size of a rectangle. It is identical to
/// `cairo_rectangle_int_t`.
public protocol RectangleProtocol {
/// Untyped pointer to the underlying `GdkRectangle` instance.
var ptr: UnsafeMutableRawPointer! { get }
/// Typed pointer to the underlying `GdkRectangle` instance.
var rectangle_ptr: UnsafeMutablePointer<GdkRectangle>! { get }
/// Required Initialiser for types conforming to `RectangleProtocol`
init(raw: UnsafeMutableRawPointer)
}
/// The `RectangleRef` type acts as a lightweight Swift reference to an underlying `GdkRectangle` instance.
/// It exposes methods that can operate on this data type through `RectangleProtocol` conformance.
/// Use `RectangleRef` only as an `unowned` reference to an existing `GdkRectangle` instance.
///
/// Defines the position and size of a rectangle. It is identical to
/// `cairo_rectangle_int_t`.
public struct RectangleRef: RectangleProtocol {
/// Untyped pointer to the underlying `GdkRectangle` instance.
/// For type-safe access, use the generated, typed pointer `rectangle_ptr` property instead.
public let ptr: UnsafeMutableRawPointer!
}
public extension RectangleRef {
/// Designated initialiser from the underlying `C` data type
@inlinable init(_ p: UnsafeMutablePointer<GdkRectangle>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from a constant pointer to the underlying `C` data type
@inlinable init(_ p: UnsafePointer<GdkRectangle>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: p))
}
/// Conditional initialiser from an optional pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GdkRectangle>?) {
guard let p = maybePointer else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafePointer<GdkRectangle>?) {
guard let p = UnsafeMutablePointer(mutating: maybePointer) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional `gpointer`
@inlinable init!(gpointer g: gpointer?) {
guard let p = g else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable `gconstpointer`
@inlinable init!(gconstpointer g: gconstpointer?) {
guard let p = UnsafeMutableRawPointer(mutating: g) else { return nil }
ptr = p
}
/// Reference intialiser for a related type that implements `RectangleProtocol`
@inlinable init<T: RectangleProtocol>(_ other: T) {
ptr = other.ptr
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RectangleProtocol`.**
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RectangleProtocol`.**
@inlinable init<T>(constPointer: UnsafePointer<T>) {
ptr = UnsafeMutableRawPointer(mutating: UnsafeRawPointer(constPointer))
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RectangleProtocol`.**
@inlinable init(mutating raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RectangleProtocol`.**
@inlinable init(raw: UnsafeMutableRawPointer) {
ptr = raw
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RectangleProtocol`.**
@inlinable init(opaquePointer: OpaquePointer) {
ptr = UnsafeMutableRawPointer(opaquePointer)
}
}
/// The `Rectangle` type acts as an owner of an underlying `GdkRectangle` instance.
/// It provides the methods that can operate on this data type through `RectangleProtocol` conformance.
/// Use `Rectangle` as a strong reference or owner of a `GdkRectangle` instance.
///
/// Defines the position and size of a rectangle. It is identical to
/// `cairo_rectangle_int_t`.
open class Rectangle: RectangleProtocol {
/// Untyped pointer to the underlying `GdkRectangle` instance.
/// For type-safe access, use the generated, typed pointer `rectangle_ptr` property instead.
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 `Rectangle` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafeMutablePointer<GdkRectangle>) {
ptr = UnsafeMutableRawPointer(op)
}
/// 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 `Rectangle` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafePointer<GdkRectangle>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: op))
}
/// 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 `Rectangle` instance.
/// - Parameter op: gpointer to the underlying object
@inlinable public init!(gpointer op: gpointer?) {
guard let p = UnsafeMutableRawPointer(op) else { return nil }
ptr = p
}
/// 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 `Rectangle` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(gconstpointer op: gconstpointer?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// 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 `Rectangle` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafePointer<GdkRectangle>?) {
guard let p = UnsafeMutablePointer(mutating: op) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Optional initialiser from the underlying `C` data type.
/// This creates an instance without performing an unbalanced retain
/// i.e., ownership is transferred to the `Rectangle` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafeMutablePointer<GdkRectangle>?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from the underlying `C` data type.
/// `GdkRectangle` does not allow reference counting, so despite the name no actual retaining will occur.
/// i.e., ownership is transferred to the `Rectangle` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(retaining op: UnsafeMutablePointer<GdkRectangle>) {
ptr = UnsafeMutableRawPointer(op)
// no reference counting for GdkRectangle, cannot ref(rectangle_ptr)
}
/// Reference intialiser for a related type that implements `RectangleProtocol`
/// `GdkRectangle` does not allow reference counting.
/// - Parameter other: an instance of a related type that implements `RectangleProtocol`
@inlinable public init<T: RectangleProtocol>(_ other: T) {
ptr = other.ptr
// no reference counting for GdkRectangle, cannot ref(rectangle_ptr)
}
/// Do-nothing destructor for `GdkRectangle`.
deinit {
// no reference counting for GdkRectangle, cannot unref(rectangle_ptr)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RectangleProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(cPointer p: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe typed, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RectangleProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
// no reference counting for GdkRectangle, cannot ref(rectangle_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RectangleProtocol`.**
/// - Parameter p: raw pointer to the underlying object
@inlinable public init(raw p: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RectangleProtocol`.**
@inlinable public init(retainingRaw raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
// no reference counting for GdkRectangle, cannot ref(rectangle_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RectangleProtocol`.**
/// - Parameter p: mutable raw pointer to the underlying object
@inlinable public required init(raw p: UnsafeMutableRawPointer) {
ptr = p
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RectangleProtocol`.**
/// - Parameter raw: mutable raw pointer to the underlying object
@inlinable public init(retainingRaw raw: UnsafeMutableRawPointer) {
ptr = raw
// no reference counting for GdkRectangle, cannot ref(rectangle_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RectangleProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(opaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `RectangleProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(retainingOpaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
// no reference counting for GdkRectangle, cannot ref(rectangle_ptr)
}
}
// MARK: no Rectangle properties
// MARK: no Rectangle signals
// MARK: Rectangle has no signals
// MARK: Rectangle Record: RectangleProtocol extension (methods and fields)
public extension RectangleProtocol {
/// Return the stored, untyped pointer as a typed pointer to the `GdkRectangle` instance.
@inlinable var rectangle_ptr: UnsafeMutablePointer<GdkRectangle>! { return ptr?.assumingMemoryBound(to: GdkRectangle.self) }
/// Checks if the two given rectangles are equal.
@inlinable func equal<RectangleT: RectangleProtocol>(rect2: RectangleT) -> Bool {
let rv = ((gdk_rectangle_equal(rectangle_ptr, rect2.rectangle_ptr)) != 0)
return rv
}
/// Calculates the intersection of two rectangles. It is allowed for
/// `dest` to be the same as either `src1` or `src2`. If the rectangles
/// do not intersect, `dest`s width and height is set to 0 and its x
/// and y values are undefined. If you are only interested in whether
/// the rectangles intersect, but not in the intersecting area itself,
/// pass `nil` for `dest`.
@inlinable func intersect<RectangleT: RectangleProtocol>(src2: RectangleT, dest: RectangleT?) -> Bool {
let rv = ((gdk_rectangle_intersect(rectangle_ptr, src2.rectangle_ptr, dest?.rectangle_ptr)) != 0)
return rv
}
/// Calculates the union of two rectangles.
/// The union of rectangles `src1` and `src2` is the smallest rectangle which
/// includes both `src1` and `src2` within it.
/// It is allowed for `dest` to be the same as either `src1` or `src2`.
///
/// Note that this function does not ignore 'empty' rectangles (ie. with
/// zero width or height).
@inlinable func union<RectangleT: RectangleProtocol>(src2: RectangleT, dest: RectangleT) {
gdk_rectangle_union(rectangle_ptr, src2.rectangle_ptr, dest.rectangle_ptr)
}
/// This is a convenience function around `cairo_clip_extents()`.
/// It rounds the clip extents to integer coordinates and returns
/// a boolean indicating if a clip area exists.
@inlinable func cairoGetClipRectangle<ContextT: Cairo.ContextProtocol>(cr: ContextT) -> Bool {
let rv = ((gdk_cairo_get_clip_rectangle(cr._ptr, rectangle_ptr)) != 0)
return rv
}
/// Adds the given rectangle to the current path of `cr`.
@inlinable func cairoRectangle<ContextT: Cairo.ContextProtocol>(cr: ContextT) {
gdk_cairo_rectangle(cr._ptr, rectangle_ptr)
}
@inlinable var x: gint {
get {
let rv = rectangle_ptr.pointee.x
return rv
}
set {
rectangle_ptr.pointee.x = newValue
}
}
@inlinable var y: gint {
get {
let rv = rectangle_ptr.pointee.y
return rv
}
set {
rectangle_ptr.pointee.y = newValue
}
}
@inlinable var width: gint {
get {
let rv = rectangle_ptr.pointee.width
return rv
}
set {
rectangle_ptr.pointee.width = newValue
}
}
@inlinable var height: gint {
get {
let rv = rectangle_ptr.pointee.height
return rv
}
set {
rectangle_ptr.pointee.height = newValue
}
}
}
// MARK: - TimeCoord Record
/// The `TimeCoordProtocol` protocol exposes the methods and properties of an underlying `GdkTimeCoord` instance.
/// The default implementation of these can be found in the protocol extension below.
/// For a concrete class that implements these methods and properties, see `TimeCoord`.
/// Alternatively, use `TimeCoordRef` as a lighweight, `unowned` reference if you already have an instance you just want to use.
///
/// A `GdkTimeCoord` stores a single event in a motion history.
public protocol TimeCoordProtocol {
/// Untyped pointer to the underlying `GdkTimeCoord` instance.
var ptr: UnsafeMutableRawPointer! { get }
/// Typed pointer to the underlying `GdkTimeCoord` instance.
var _ptr: UnsafeMutablePointer<GdkTimeCoord>! { get }
/// Required Initialiser for types conforming to `TimeCoordProtocol`
init(raw: UnsafeMutableRawPointer)
}
/// The `TimeCoordRef` type acts as a lightweight Swift reference to an underlying `GdkTimeCoord` instance.
/// It exposes methods that can operate on this data type through `TimeCoordProtocol` conformance.
/// Use `TimeCoordRef` only as an `unowned` reference to an existing `GdkTimeCoord` instance.
///
/// A `GdkTimeCoord` stores a single event in a motion history.
public struct TimeCoordRef: TimeCoordProtocol {
/// Untyped pointer to the underlying `GdkTimeCoord` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
public let ptr: UnsafeMutableRawPointer!
}
public extension TimeCoordRef {
/// Designated initialiser from the underlying `C` data type
@inlinable init(_ p: UnsafeMutablePointer<GdkTimeCoord>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from a constant pointer to the underlying `C` data type
@inlinable init(_ p: UnsafePointer<GdkTimeCoord>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: p))
}
/// Conditional initialiser from an optional pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GdkTimeCoord>?) {
guard let p = maybePointer else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafePointer<GdkTimeCoord>?) {
guard let p = UnsafeMutablePointer(mutating: maybePointer) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional `gpointer`
@inlinable init!(gpointer g: gpointer?) {
guard let p = g else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable `gconstpointer`
@inlinable init!(gconstpointer g: gconstpointer?) {
guard let p = UnsafeMutableRawPointer(mutating: g) else { return nil }
ptr = p
}
/// Reference intialiser for a related type that implements `TimeCoordProtocol`
@inlinable init<T: TimeCoordProtocol>(_ other: T) {
ptr = other.ptr
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `TimeCoordProtocol`.**
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `TimeCoordProtocol`.**
@inlinable init<T>(constPointer: UnsafePointer<T>) {
ptr = UnsafeMutableRawPointer(mutating: UnsafeRawPointer(constPointer))
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `TimeCoordProtocol`.**
@inlinable init(mutating raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `TimeCoordProtocol`.**
@inlinable init(raw: UnsafeMutableRawPointer) {
ptr = raw
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `TimeCoordProtocol`.**
@inlinable init(opaquePointer: OpaquePointer) {
ptr = UnsafeMutableRawPointer(opaquePointer)
}
}
/// The `TimeCoord` type acts as an owner of an underlying `GdkTimeCoord` instance.
/// It provides the methods that can operate on this data type through `TimeCoordProtocol` conformance.
/// Use `TimeCoord` as a strong reference or owner of a `GdkTimeCoord` instance.
///
/// A `GdkTimeCoord` stores a single event in a motion history.
open class TimeCoord: TimeCoordProtocol {
/// Untyped pointer to the underlying `GdkTimeCoord` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
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 `TimeCoord` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafeMutablePointer<GdkTimeCoord>) {
ptr = UnsafeMutableRawPointer(op)
}
/// 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 `TimeCoord` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafePointer<GdkTimeCoord>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: op))
}
/// 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 `TimeCoord` instance.
/// - Parameter op: gpointer to the underlying object
@inlinable public init!(gpointer op: gpointer?) {
guard let p = UnsafeMutableRawPointer(op) else { return nil }
ptr = p
}
/// 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 `TimeCoord` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(gconstpointer op: gconstpointer?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// 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 `TimeCoord` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafePointer<GdkTimeCoord>?) {
guard let p = UnsafeMutablePointer(mutating: op) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Optional initialiser from the underlying `C` data type.
/// This creates an instance without performing an unbalanced retain
/// i.e., ownership is transferred to the `TimeCoord` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafeMutablePointer<GdkTimeCoord>?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from the underlying `C` data type.
/// `GdkTimeCoord` does not allow reference counting, so despite the name no actual retaining will occur.
/// i.e., ownership is transferred to the `TimeCoord` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(retaining op: UnsafeMutablePointer<GdkTimeCoord>) {
ptr = UnsafeMutableRawPointer(op)
// no reference counting for GdkTimeCoord, cannot ref(_ptr)
}
/// Reference intialiser for a related type that implements `TimeCoordProtocol`
/// `GdkTimeCoord` does not allow reference counting.
/// - Parameter other: an instance of a related type that implements `TimeCoordProtocol`
@inlinable public init<T: TimeCoordProtocol>(_ other: T) {
ptr = other.ptr
// no reference counting for GdkTimeCoord, cannot ref(_ptr)
}
/// Do-nothing destructor for `GdkTimeCoord`.
deinit {
// no reference counting for GdkTimeCoord, cannot unref(_ptr)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `TimeCoordProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(cPointer p: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe typed, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `TimeCoordProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
// no reference counting for GdkTimeCoord, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `TimeCoordProtocol`.**
/// - Parameter p: raw pointer to the underlying object
@inlinable public init(raw p: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `TimeCoordProtocol`.**
@inlinable public init(retainingRaw raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
// no reference counting for GdkTimeCoord, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `TimeCoordProtocol`.**
/// - Parameter p: mutable raw pointer to the underlying object
@inlinable public required init(raw p: UnsafeMutableRawPointer) {
ptr = p
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `TimeCoordProtocol`.**
/// - Parameter raw: mutable raw pointer to the underlying object
@inlinable public init(retainingRaw raw: UnsafeMutableRawPointer) {
ptr = raw
// no reference counting for GdkTimeCoord, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `TimeCoordProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(opaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `TimeCoordProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(retainingOpaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
// no reference counting for GdkTimeCoord, cannot ref(_ptr)
}
}
// MARK: no TimeCoord properties
// MARK: no TimeCoord signals
// MARK: TimeCoord has no signals
// MARK: TimeCoord Record: TimeCoordProtocol extension (methods and fields)
public extension TimeCoordProtocol {
/// Return the stored, untyped pointer as a typed pointer to the `GdkTimeCoord` instance.
@inlinable var _ptr: UnsafeMutablePointer<GdkTimeCoord>! { return ptr?.assumingMemoryBound(to: GdkTimeCoord.self) }
/// The timestamp for this event.
@inlinable var time: guint32 {
/// The timestamp for this event.
get {
let rv = _ptr.pointee.time
return rv
}
/// The timestamp for this event.
set {
_ptr.pointee.time = newValue
}
}
/// the values of the devices axes.
@inlinable var axes: (gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble) {
/// the values of the devices axes.
get {
let rv = _ptr.pointee.axes
return rv
}
/// the values of the devices axes.
set {
_ptr.pointee.axes = newValue
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,889 @@
import CGLib
import CCairo
import CPango
import CGdkPixbuf
import CGdk
import GLib
import GLibObject
import GIO
import Pango
import Cairo
import PangoCairo
import GdkPixbuf
// MARK: - WindowAttr Record
/// The `WindowAttrProtocol` protocol exposes the methods and properties of an underlying `GdkWindowAttr` instance.
/// The default implementation of these can be found in the protocol extension below.
/// For a concrete class that implements these methods and properties, see `WindowAttr`.
/// Alternatively, use `WindowAttrRef` as a lighweight, `unowned` reference if you already have an instance you just want to use.
///
/// Attributes to use for a newly-created window.
public protocol WindowAttrProtocol {
/// Untyped pointer to the underlying `GdkWindowAttr` instance.
var ptr: UnsafeMutableRawPointer! { get }
/// Typed pointer to the underlying `GdkWindowAttr` instance.
var _ptr: UnsafeMutablePointer<GdkWindowAttr>! { get }
/// Required Initialiser for types conforming to `WindowAttrProtocol`
init(raw: UnsafeMutableRawPointer)
}
/// The `WindowAttrRef` type acts as a lightweight Swift reference to an underlying `GdkWindowAttr` instance.
/// It exposes methods that can operate on this data type through `WindowAttrProtocol` conformance.
/// Use `WindowAttrRef` only as an `unowned` reference to an existing `GdkWindowAttr` instance.
///
/// Attributes to use for a newly-created window.
public struct WindowAttrRef: WindowAttrProtocol {
/// Untyped pointer to the underlying `GdkWindowAttr` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
public let ptr: UnsafeMutableRawPointer!
}
public extension WindowAttrRef {
/// Designated initialiser from the underlying `C` data type
@inlinable init(_ p: UnsafeMutablePointer<GdkWindowAttr>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from a constant pointer to the underlying `C` data type
@inlinable init(_ p: UnsafePointer<GdkWindowAttr>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: p))
}
/// Conditional initialiser from an optional pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GdkWindowAttr>?) {
guard let p = maybePointer else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafePointer<GdkWindowAttr>?) {
guard let p = UnsafeMutablePointer(mutating: maybePointer) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional `gpointer`
@inlinable init!(gpointer g: gpointer?) {
guard let p = g else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable `gconstpointer`
@inlinable init!(gconstpointer g: gconstpointer?) {
guard let p = UnsafeMutableRawPointer(mutating: g) else { return nil }
ptr = p
}
/// Reference intialiser for a related type that implements `WindowAttrProtocol`
@inlinable init<T: WindowAttrProtocol>(_ other: T) {
ptr = other.ptr
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowAttrProtocol`.**
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowAttrProtocol`.**
@inlinable init<T>(constPointer: UnsafePointer<T>) {
ptr = UnsafeMutableRawPointer(mutating: UnsafeRawPointer(constPointer))
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowAttrProtocol`.**
@inlinable init(mutating raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowAttrProtocol`.**
@inlinable init(raw: UnsafeMutableRawPointer) {
ptr = raw
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowAttrProtocol`.**
@inlinable init(opaquePointer: OpaquePointer) {
ptr = UnsafeMutableRawPointer(opaquePointer)
}
}
/// The `WindowAttr` type acts as an owner of an underlying `GdkWindowAttr` instance.
/// It provides the methods that can operate on this data type through `WindowAttrProtocol` conformance.
/// Use `WindowAttr` as a strong reference or owner of a `GdkWindowAttr` instance.
///
/// Attributes to use for a newly-created window.
open class WindowAttr: WindowAttrProtocol {
/// Untyped pointer to the underlying `GdkWindowAttr` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
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 `WindowAttr` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafeMutablePointer<GdkWindowAttr>) {
ptr = UnsafeMutableRawPointer(op)
}
/// 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 `WindowAttr` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafePointer<GdkWindowAttr>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: op))
}
/// 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 `WindowAttr` instance.
/// - Parameter op: gpointer to the underlying object
@inlinable public init!(gpointer op: gpointer?) {
guard let p = UnsafeMutableRawPointer(op) else { return nil }
ptr = p
}
/// 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 `WindowAttr` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(gconstpointer op: gconstpointer?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// 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 `WindowAttr` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafePointer<GdkWindowAttr>?) {
guard let p = UnsafeMutablePointer(mutating: op) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Optional initialiser from the underlying `C` data type.
/// This creates an instance without performing an unbalanced retain
/// i.e., ownership is transferred to the `WindowAttr` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafeMutablePointer<GdkWindowAttr>?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from the underlying `C` data type.
/// `GdkWindowAttr` does not allow reference counting, so despite the name no actual retaining will occur.
/// i.e., ownership is transferred to the `WindowAttr` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(retaining op: UnsafeMutablePointer<GdkWindowAttr>) {
ptr = UnsafeMutableRawPointer(op)
// no reference counting for GdkWindowAttr, cannot ref(_ptr)
}
/// Reference intialiser for a related type that implements `WindowAttrProtocol`
/// `GdkWindowAttr` does not allow reference counting.
/// - Parameter other: an instance of a related type that implements `WindowAttrProtocol`
@inlinable public init<T: WindowAttrProtocol>(_ other: T) {
ptr = other.ptr
// no reference counting for GdkWindowAttr, cannot ref(_ptr)
}
/// Do-nothing destructor for `GdkWindowAttr`.
deinit {
// no reference counting for GdkWindowAttr, cannot unref(_ptr)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowAttrProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(cPointer p: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe typed, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowAttrProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
// no reference counting for GdkWindowAttr, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowAttrProtocol`.**
/// - Parameter p: raw pointer to the underlying object
@inlinable public init(raw p: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowAttrProtocol`.**
@inlinable public init(retainingRaw raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
// no reference counting for GdkWindowAttr, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowAttrProtocol`.**
/// - Parameter p: mutable raw pointer to the underlying object
@inlinable public required init(raw p: UnsafeMutableRawPointer) {
ptr = p
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowAttrProtocol`.**
/// - Parameter raw: mutable raw pointer to the underlying object
@inlinable public init(retainingRaw raw: UnsafeMutableRawPointer) {
ptr = raw
// no reference counting for GdkWindowAttr, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowAttrProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(opaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowAttrProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(retainingOpaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
// no reference counting for GdkWindowAttr, cannot ref(_ptr)
}
}
// MARK: no WindowAttr properties
// MARK: no WindowAttr signals
// MARK: WindowAttr has no signals
// MARK: WindowAttr Record: WindowAttrProtocol extension (methods and fields)
public extension WindowAttrProtocol {
/// Return the stored, untyped pointer as a typed pointer to the `GdkWindowAttr` instance.
@inlinable var _ptr: UnsafeMutablePointer<GdkWindowAttr>! { return ptr?.assumingMemoryBound(to: GdkWindowAttr.self) }
/// title of the window (for toplevel windows)
@inlinable var title: UnsafeMutablePointer<gchar>! {
/// title of the window (for toplevel windows)
get {
let rv = _ptr.pointee.title
return rv
}
/// title of the window (for toplevel windows)
set {
_ptr.pointee.title = newValue
}
}
/// event mask (see `gdk_window_set_events()`)
@inlinable var eventMask: gint {
/// event mask (see `gdk_window_set_events()`)
get {
let rv = _ptr.pointee.event_mask
return rv
}
/// event mask (see `gdk_window_set_events()`)
set {
_ptr.pointee.event_mask = newValue
}
}
/// X coordinate relative to parent window (see `gdk_window_move()`)
@inlinable var x: gint {
/// X coordinate relative to parent window (see `gdk_window_move()`)
get {
let rv = _ptr.pointee.x
return rv
}
/// X coordinate relative to parent window (see `gdk_window_move()`)
set {
_ptr.pointee.x = newValue
}
}
/// Y coordinate relative to parent window (see `gdk_window_move()`)
@inlinable var y: gint {
/// Y coordinate relative to parent window (see `gdk_window_move()`)
get {
let rv = _ptr.pointee.y
return rv
}
/// Y coordinate relative to parent window (see `gdk_window_move()`)
set {
_ptr.pointee.y = newValue
}
}
/// width of window
@inlinable var width: gint {
/// width of window
get {
let rv = _ptr.pointee.width
return rv
}
/// width of window
set {
_ptr.pointee.width = newValue
}
}
/// height of window
@inlinable var height: gint {
/// height of window
get {
let rv = _ptr.pointee.height
return rv
}
/// height of window
set {
_ptr.pointee.height = newValue
}
}
/// `GDK_INPUT_OUTPUT` (normal window) or `GDK_INPUT_ONLY` (invisible
/// window that receives events)
@inlinable var wclass: GdkWindowWindowClass {
/// `GDK_INPUT_OUTPUT` (normal window) or `GDK_INPUT_ONLY` (invisible
/// window that receives events)
get {
let rv = _ptr.pointee.wclass
return rv
}
/// `GDK_INPUT_OUTPUT` (normal window) or `GDK_INPUT_ONLY` (invisible
/// window that receives events)
set {
_ptr.pointee.wclass = newValue
}
}
/// `GdkVisual` for window
@inlinable var visual: VisualRef! {
/// `GdkVisual` for window
get {
let rv = VisualRef(gconstpointer: gconstpointer(_ptr.pointee.visual))
return rv
}
/// `GdkVisual` for window
set {
_ptr.pointee.visual = UnsafeMutablePointer<GdkVisual>(newValue.visual_ptr)
}
}
/// type of window
@inlinable var windowType: GdkWindowType {
/// type of window
get {
let rv = _ptr.pointee.window_type
return rv
}
/// type of window
set {
_ptr.pointee.window_type = newValue
}
}
/// cursor for the window (see `gdk_window_set_cursor()`)
@inlinable var cursor: CursorRef! {
/// cursor for the window (see `gdk_window_set_cursor()`)
get {
let rv = CursorRef(gconstpointer: gconstpointer(_ptr.pointee.cursor))
return rv
}
/// cursor for the window (see `gdk_window_set_cursor()`)
set {
_ptr.pointee.cursor = UnsafeMutablePointer<GdkCursor>(newValue.cursor_ptr)
}
}
/// dont use (see `gtk_window_set_wmclass()`)
@inlinable var wmclassName: UnsafeMutablePointer<gchar>! {
/// dont use (see `gtk_window_set_wmclass()`)
get {
let rv = _ptr.pointee.wmclass_name
return rv
}
/// dont use (see `gtk_window_set_wmclass()`)
set {
_ptr.pointee.wmclass_name = newValue
}
}
/// dont use (see `gtk_window_set_wmclass()`)
@inlinable var wmclassClass: UnsafeMutablePointer<gchar>! {
/// dont use (see `gtk_window_set_wmclass()`)
get {
let rv = _ptr.pointee.wmclass_class
return rv
}
/// dont use (see `gtk_window_set_wmclass()`)
set {
_ptr.pointee.wmclass_class = newValue
}
}
/// `true` to bypass the window manager
@inlinable var overrideRedirect: gboolean {
/// `true` to bypass the window manager
get {
let rv = _ptr.pointee.override_redirect
return rv
}
/// `true` to bypass the window manager
set {
_ptr.pointee.override_redirect = newValue
}
}
/// a hint of the function of the window
@inlinable var typeHint: GdkWindowTypeHint {
/// a hint of the function of the window
get {
let rv = _ptr.pointee.type_hint
return rv
}
/// a hint of the function of the window
set {
_ptr.pointee.type_hint = newValue
}
}
}
/// Metatype/GType declaration for Window
public extension WindowClassRef {
/// This getter returns the GLib type identifier registered for `Window`
static var metatypeReference: GType { gdk_window_get_type() }
private static var metatypePointer: UnsafeMutablePointer<GdkWindowClass>? { g_type_class_peek_static(metatypeReference)?.assumingMemoryBound(to: GdkWindowClass.self) }
static var metatype: GdkWindowClass? { metatypePointer?.pointee }
static var wrapper: WindowClassRef? { WindowClassRef(metatypePointer) }
}
// MARK: - WindowClass Record
/// The `WindowClassProtocol` protocol exposes the methods and properties of an underlying `GdkWindowClass` instance.
/// The default implementation of these can be found in the protocol extension below.
/// For a concrete class that implements these methods and properties, see `WindowClass`.
/// Alternatively, use `WindowClassRef` as a lighweight, `unowned` reference if you already have an instance you just want to use.
///
public protocol WindowClassProtocol {
/// Untyped pointer to the underlying `GdkWindowClass` instance.
var ptr: UnsafeMutableRawPointer! { get }
/// Typed pointer to the underlying `GdkWindowClass` instance.
var _ptr: UnsafeMutablePointer<GdkWindowClass>! { get }
/// Required Initialiser for types conforming to `WindowClassProtocol`
init(raw: UnsafeMutableRawPointer)
}
/// The `WindowClassRef` type acts as a lightweight Swift reference to an underlying `GdkWindowClass` instance.
/// It exposes methods that can operate on this data type through `WindowClassProtocol` conformance.
/// Use `WindowClassRef` only as an `unowned` reference to an existing `GdkWindowClass` instance.
///
public struct WindowClassRef: WindowClassProtocol {
/// Untyped pointer to the underlying `GdkWindowClass` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
public let ptr: UnsafeMutableRawPointer!
}
public extension WindowClassRef {
/// Designated initialiser from the underlying `C` data type
@inlinable init(_ p: UnsafeMutablePointer<GdkWindowClass>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from a constant pointer to the underlying `C` data type
@inlinable init(_ p: UnsafePointer<GdkWindowClass>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: p))
}
/// Conditional initialiser from an optional pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GdkWindowClass>?) {
guard let p = maybePointer else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafePointer<GdkWindowClass>?) {
guard let p = UnsafeMutablePointer(mutating: maybePointer) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional `gpointer`
@inlinable init!(gpointer g: gpointer?) {
guard let p = g else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable `gconstpointer`
@inlinable init!(gconstpointer g: gconstpointer?) {
guard let p = UnsafeMutableRawPointer(mutating: g) else { return nil }
ptr = p
}
/// Reference intialiser for a related type that implements `WindowClassProtocol`
@inlinable init<T: WindowClassProtocol>(_ other: T) {
ptr = other.ptr
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowClassProtocol`.**
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowClassProtocol`.**
@inlinable init<T>(constPointer: UnsafePointer<T>) {
ptr = UnsafeMutableRawPointer(mutating: UnsafeRawPointer(constPointer))
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowClassProtocol`.**
@inlinable init(mutating raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowClassProtocol`.**
@inlinable init(raw: UnsafeMutableRawPointer) {
ptr = raw
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowClassProtocol`.**
@inlinable init(opaquePointer: OpaquePointer) {
ptr = UnsafeMutableRawPointer(opaquePointer)
}
}
// MARK: WindowClass Record: WindowClassProtocol extension (methods and fields)
public extension WindowClassProtocol {
/// Return the stored, untyped pointer as a typed pointer to the `GdkWindowClass` instance.
@inlinable var _ptr: UnsafeMutablePointer<GdkWindowClass>! { return ptr?.assumingMemoryBound(to: GdkWindowClass.self) }
@inlinable var parentClass: GObjectClass {
get {
let rv = _ptr.pointee.parent_class
return rv
}
}
// var pickEmbeddedChild is unavailable because pick_embedded_child is void
// var toEmbedder is unavailable because to_embedder is void
// var fromEmbedder is unavailable because from_embedder is void
// var createSurface is unavailable because create_surface is void
// var GdkReserved1 is unavailable because _gdk_reserved1 is void
// var GdkReserved2 is unavailable because _gdk_reserved2 is void
// var GdkReserved3 is unavailable because _gdk_reserved3 is void
// var GdkReserved4 is unavailable because _gdk_reserved4 is void
// var GdkReserved5 is unavailable because _gdk_reserved5 is void
// var GdkReserved6 is unavailable because _gdk_reserved6 is void
// var GdkReserved7 is unavailable because _gdk_reserved7 is void
// var GdkReserved8 is unavailable because _gdk_reserved8 is void
}
// MARK: - WindowRedirect Record
/// The `WindowRedirectProtocol` protocol exposes the methods and properties of an underlying `GdkWindowRedirect` instance.
/// The default implementation of these can be found in the protocol extension below.
/// For a concrete class that implements these methods and properties, see `WindowRedirect`.
/// Alternatively, use `WindowRedirectRef` as a lighweight, `unowned` reference if you already have an instance you just want to use.
///
public protocol WindowRedirectProtocol {
/// Untyped pointer to the underlying `GdkWindowRedirect` instance.
var ptr: UnsafeMutableRawPointer! { get }
/// Typed pointer to the underlying `GdkWindowRedirect` instance.
var _ptr: UnsafeMutablePointer<GdkWindowRedirect>! { get }
/// Required Initialiser for types conforming to `WindowRedirectProtocol`
init(raw: UnsafeMutableRawPointer)
}
/// The `WindowRedirectRef` type acts as a lightweight Swift reference to an underlying `GdkWindowRedirect` instance.
/// It exposes methods that can operate on this data type through `WindowRedirectProtocol` conformance.
/// Use `WindowRedirectRef` only as an `unowned` reference to an existing `GdkWindowRedirect` instance.
///
public struct WindowRedirectRef: WindowRedirectProtocol {
/// Untyped pointer to the underlying `GdkWindowRedirect` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
public let ptr: UnsafeMutableRawPointer!
}
public extension WindowRedirectRef {
/// Designated initialiser from the underlying `C` data type
@inlinable init(_ p: UnsafeMutablePointer<GdkWindowRedirect>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from a constant pointer to the underlying `C` data type
@inlinable init(_ p: UnsafePointer<GdkWindowRedirect>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: p))
}
/// Conditional initialiser from an optional pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GdkWindowRedirect>?) {
guard let p = maybePointer else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable pointer to the underlying `C` data type
@inlinable init!(_ maybePointer: UnsafePointer<GdkWindowRedirect>?) {
guard let p = UnsafeMutablePointer(mutating: maybePointer) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional `gpointer`
@inlinable init!(gpointer g: gpointer?) {
guard let p = g else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Conditional initialiser from an optional, non-mutable `gconstpointer`
@inlinable init!(gconstpointer g: gconstpointer?) {
guard let p = UnsafeMutableRawPointer(mutating: g) else { return nil }
ptr = p
}
/// Reference intialiser for a related type that implements `WindowRedirectProtocol`
@inlinable init<T: WindowRedirectProtocol>(_ other: T) {
ptr = other.ptr
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowRedirectProtocol`.**
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowRedirectProtocol`.**
@inlinable init<T>(constPointer: UnsafePointer<T>) {
ptr = UnsafeMutableRawPointer(mutating: UnsafeRawPointer(constPointer))
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowRedirectProtocol`.**
@inlinable init(mutating raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowRedirectProtocol`.**
@inlinable init(raw: UnsafeMutableRawPointer) {
ptr = raw
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowRedirectProtocol`.**
@inlinable init(opaquePointer: OpaquePointer) {
ptr = UnsafeMutableRawPointer(opaquePointer)
}
}
/// The `WindowRedirect` type acts as an owner of an underlying `GdkWindowRedirect` instance.
/// It provides the methods that can operate on this data type through `WindowRedirectProtocol` conformance.
/// Use `WindowRedirect` as a strong reference or owner of a `GdkWindowRedirect` instance.
///
open class WindowRedirect: WindowRedirectProtocol {
/// Untyped pointer to the underlying `GdkWindowRedirect` instance.
/// For type-safe access, use the generated, typed pointer `_ptr` property instead.
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 `WindowRedirect` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafeMutablePointer<GdkWindowRedirect>) {
ptr = UnsafeMutableRawPointer(op)
}
/// 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 `WindowRedirect` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(_ op: UnsafePointer<GdkWindowRedirect>) {
ptr = UnsafeMutableRawPointer(UnsafeMutablePointer(mutating: op))
}
/// 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 `WindowRedirect` instance.
/// - Parameter op: gpointer to the underlying object
@inlinable public init!(gpointer op: gpointer?) {
guard let p = UnsafeMutableRawPointer(op) else { return nil }
ptr = p
}
/// 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 `WindowRedirect` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(gconstpointer op: gconstpointer?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// 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 `WindowRedirect` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafePointer<GdkWindowRedirect>?) {
guard let p = UnsafeMutablePointer(mutating: op) else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Optional initialiser from the underlying `C` data type.
/// This creates an instance without performing an unbalanced retain
/// i.e., ownership is transferred to the `WindowRedirect` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init!(_ op: UnsafeMutablePointer<GdkWindowRedirect>?) {
guard let p = op else { return nil }
ptr = UnsafeMutableRawPointer(p)
}
/// Designated initialiser from the underlying `C` data type.
/// `GdkWindowRedirect` does not allow reference counting, so despite the name no actual retaining will occur.
/// i.e., ownership is transferred to the `WindowRedirect` instance.
/// - Parameter op: pointer to the underlying object
@inlinable public init(retaining op: UnsafeMutablePointer<GdkWindowRedirect>) {
ptr = UnsafeMutableRawPointer(op)
// no reference counting for GdkWindowRedirect, cannot ref(_ptr)
}
/// Reference intialiser for a related type that implements `WindowRedirectProtocol`
/// `GdkWindowRedirect` does not allow reference counting.
/// - Parameter other: an instance of a related type that implements `WindowRedirectProtocol`
@inlinable public init<T: WindowRedirectProtocol>(_ other: T) {
ptr = other.ptr
// no reference counting for GdkWindowRedirect, cannot ref(_ptr)
}
/// Do-nothing destructor for `GdkWindowRedirect`.
deinit {
// no reference counting for GdkWindowRedirect, cannot unref(_ptr)
}
/// Unsafe typed initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowRedirectProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(cPointer p: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe typed, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowRedirectProtocol`.**
/// - Parameter cPointer: pointer to the underlying object
@inlinable public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>) {
ptr = UnsafeMutableRawPointer(cPointer)
// no reference counting for GdkWindowRedirect, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowRedirectProtocol`.**
/// - Parameter p: raw pointer to the underlying object
@inlinable public init(raw p: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowRedirectProtocol`.**
@inlinable public init(retainingRaw raw: UnsafeRawPointer) {
ptr = UnsafeMutableRawPointer(mutating: raw)
// no reference counting for GdkWindowRedirect, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowRedirectProtocol`.**
/// - Parameter p: mutable raw pointer to the underlying object
@inlinable public required init(raw p: UnsafeMutableRawPointer) {
ptr = p
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowRedirectProtocol`.**
/// - Parameter raw: mutable raw pointer to the underlying object
@inlinable public init(retainingRaw raw: UnsafeMutableRawPointer) {
ptr = raw
// no reference counting for GdkWindowRedirect, cannot ref(_ptr)
}
/// Unsafe untyped initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowRedirectProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(opaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
}
/// Unsafe untyped, retaining initialiser.
/// **Do not use unless you know the underlying data type the pointer points to conforms to `WindowRedirectProtocol`.**
/// - Parameter p: opaque pointer to the underlying object
@inlinable public init(retainingOpaquePointer p: OpaquePointer) {
ptr = UnsafeMutableRawPointer(p)
// no reference counting for GdkWindowRedirect, cannot ref(_ptr)
}
}
// MARK: no WindowRedirect properties
// MARK: no WindowRedirect signals
// MARK: WindowRedirect has no signals
// MARK: WindowRedirect Record: WindowRedirectProtocol extension (methods and fields)
public extension WindowRedirectProtocol {
/// Return the stored, untyped pointer as a typed pointer to the `GdkWindowRedirect` instance.
@inlinable var _ptr: UnsafeMutablePointer<GdkWindowRedirect>! { return ptr?.assumingMemoryBound(to: GdkWindowRedirect.self) }
}

View File

@ -0,0 +1,16 @@
import CGLib
import CCairo
import CPango
import CGdkPixbuf
import CGdk
import GLib
import GLibObject
import GIO
import Pango
import Cairo
import PangoCairo
import GdkPixbuf
/// Used to represent native events (XEvents for the X11
/// backend, MSGs for Win32).
public typealias XEvent = GdkXEvent

View File

@ -0,0 +1,726 @@
import CGLib
import CCairo
import CPango
import CGdkPixbuf
import CGdk
import GLib
import GLibObject
import GIO
import Pango
import Cairo
import PangoCairo
import GdkPixbuf
/// Positioning hints for aligning a window relative to a rectangle.
///
/// These hints determine how the window should be positioned in the case that
/// the window would fall off-screen if placed in its ideal position.
///
/// For example, `GDK_ANCHOR_FLIP_X` will replace `GDK_GRAVITY_NORTH_WEST` with
/// `GDK_GRAVITY_NORTH_EAST` and vice versa if the window extends beyond the left
/// or right edges of the monitor.
///
/// If `GDK_ANCHOR_SLIDE_X` is set, the window can be shifted horizontally to fit
/// on-screen. If `GDK_ANCHOR_RESIZE_X` is set, the window can be shrunken
/// horizontally to fit.
///
/// In general, when multiple flags are set, flipping should take precedence over
/// sliding, which should take precedence over resizing.
public struct AnchorHints: OptionSet {
/// The corresponding value of the raw type
public var rawValue: UInt32 = 0
/// The equivalent raw Int value
@inlinable public var intValue: Int { get { Int(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent raw `gint` value
@inlinable public var int: gint { get { gint(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent underlying `GdkAnchorHints` enum value
@inlinable public var value: GdkAnchorHints {
get {
func castToGdkAnchorHintsInt<I: BinaryInteger, J: BinaryInteger>(_ param: I) -> J { J(param) }
return GdkAnchorHints(rawValue: castToGdkAnchorHintsInt(rawValue))
}
set { rawValue = UInt32(newValue.rawValue) }
}
/// Creates a new instance with the specified raw value
@inlinable public init(rawValue: UInt32) { self.rawValue = rawValue }
/// Creates a new instance with the specified `GdkAnchorHints` enum value
@inlinable public init(_ enumValue: GdkAnchorHints) { self.rawValue = UInt32(enumValue.rawValue) }
/// Creates a new instance with the specified Int value
@inlinable public init<I: BinaryInteger>(_ intValue: I) { self.rawValue = UInt32(intValue) }
/// allow flipping anchors horizontally
public static let flipX = AnchorHints(1) // GDK_ANCHOR_FLIP_X
/// allow flipping anchors vertically
public static let flipY = AnchorHints(2) // GDK_ANCHOR_FLIP_Y
/// allow sliding window horizontally
public static let slideX = AnchorHints(4) // GDK_ANCHOR_SLIDE_X
/// allow sliding window vertically
public static let slideY = AnchorHints(8) // GDK_ANCHOR_SLIDE_Y
/// allow resizing window horizontally
public static let resizeX = AnchorHints(16) // GDK_ANCHOR_RESIZE_X
/// allow resizing window vertically
public static let resizeY = AnchorHints(32) // GDK_ANCHOR_RESIZE_Y
/// allow flipping anchors on both axes
public static let flip = AnchorHints(3) // GDK_ANCHOR_FLIP
/// allow sliding window on both axes
public static let slide = AnchorHints(12) // GDK_ANCHOR_SLIDE
/// allow resizing window on both axes
public static let resize = AnchorHints(48) // GDK_ANCHOR_RESIZE
}
/// Flags describing the current capabilities of a device/tool.
public struct AxisFlags: OptionSet {
/// The corresponding value of the raw type
public var rawValue: UInt32 = 0
/// The equivalent raw Int value
@inlinable public var intValue: Int { get { Int(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent raw `gint` value
@inlinable public var int: gint { get { gint(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent underlying `GdkAxisFlags` enum value
@inlinable public var value: GdkAxisFlags {
get {
func castToGdkAxisFlagsInt<I: BinaryInteger, J: BinaryInteger>(_ param: I) -> J { J(param) }
return GdkAxisFlags(rawValue: castToGdkAxisFlagsInt(rawValue))
}
set { rawValue = UInt32(newValue.rawValue) }
}
/// Creates a new instance with the specified raw value
@inlinable public init(rawValue: UInt32) { self.rawValue = rawValue }
/// Creates a new instance with the specified `GdkAxisFlags` enum value
@inlinable public init(_ enumValue: GdkAxisFlags) { self.rawValue = UInt32(enumValue.rawValue) }
/// Creates a new instance with the specified Int value
@inlinable public init<I: BinaryInteger>(_ intValue: I) { self.rawValue = UInt32(intValue) }
/// X axis is present
public static let x = AxisFlags(2) // GDK_AXIS_FLAG_X
/// Y axis is present
public static let y = AxisFlags(4) // GDK_AXIS_FLAG_Y
/// Pressure axis is present
public static let pressure = AxisFlags(8) // GDK_AXIS_FLAG_PRESSURE
/// X tilt axis is present
public static let xtilt = AxisFlags(16) // GDK_AXIS_FLAG_XTILT
/// Y tilt axis is present
public static let ytilt = AxisFlags(32) // GDK_AXIS_FLAG_YTILT
/// Wheel axis is present
public static let wheel = AxisFlags(64) // GDK_AXIS_FLAG_WHEEL
/// Distance axis is present
public static let distance = AxisFlags(128) // GDK_AXIS_FLAG_DISTANCE
/// Z-axis rotation is present
public static let rotation = AxisFlags(256) // GDK_AXIS_FLAG_ROTATION
/// Slider axis is present
public static let slider = AxisFlags(512) // GDK_AXIS_FLAG_SLIDER
}
/// Used in `GdkDragContext` to indicate what the destination
/// should do with the dropped data.
public struct DragAction: OptionSet {
/// The corresponding value of the raw type
public var rawValue: UInt32 = 0
/// The equivalent raw Int value
@inlinable public var intValue: Int { get { Int(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent raw `gint` value
@inlinable public var int: gint { get { gint(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent underlying `GdkDragAction` enum value
@inlinable public var value: GdkDragAction {
get {
func castToGdkDragActionInt<I: BinaryInteger, J: BinaryInteger>(_ param: I) -> J { J(param) }
return GdkDragAction(rawValue: castToGdkDragActionInt(rawValue))
}
set { rawValue = UInt32(newValue.rawValue) }
}
/// Creates a new instance with the specified raw value
@inlinable public init(rawValue: UInt32) { self.rawValue = rawValue }
/// Creates a new instance with the specified `GdkDragAction` enum value
@inlinable public init(_ enumValue: GdkDragAction) { self.rawValue = UInt32(enumValue.rawValue) }
/// Creates a new instance with the specified Int value
@inlinable public init<I: BinaryInteger>(_ intValue: I) { self.rawValue = UInt32(intValue) }
/// Means nothing, and should not be used.
public static let `default` = DragAction(1) // GDK_ACTION_DEFAULT
/// Copy the data.
public static let copy = DragAction(2) // GDK_ACTION_COPY
/// Move the data, i.e. first copy it, then delete
/// it from the source using the DELETE target of the X selection protocol.
public static let move = DragAction(4) // GDK_ACTION_MOVE
/// Add a link to the data. Note that this is only
/// useful if source and destination agree on what it means.
public static let link = DragAction(8) // GDK_ACTION_LINK
/// Special action which tells the source that the
/// destination will do something that the source doesnt understand.
public static let `private` = DragAction(16) // GDK_ACTION_PRIVATE
/// Ask the user what to do with the data.
public static let ask = DragAction(32) // GDK_ACTION_ASK
}
/// A set of bit-flags to indicate which events a window is to receive.
/// Most of these masks map onto one or more of the `GdkEventType` event types
/// above.
///
/// See the [input handling overview](#chap-input-handling) for details of
/// [event masks](#event-masks) and [event propagation](#event-propagation).
///
/// `GDK_POINTER_MOTION_HINT_MASK` is deprecated. It is a special mask
/// to reduce the number of `GDK_MOTION_NOTIFY` events received. When using
/// `GDK_POINTER_MOTION_HINT_MASK`, fewer `GDK_MOTION_NOTIFY` events will
/// be sent, some of which are marked as a hint (the is_hint member is
/// `true`). To receive more motion events after a motion hint event,
/// the application needs to asks for more, by calling
/// `gdk_event_request_motions()`.
///
/// Since GTK 3.8, motion events are already compressed by default, independent
/// of this mechanism. This compression can be disabled with
/// `gdk_window_set_event_compression()`. See the documentation of that function
/// for details.
///
/// If `GDK_TOUCH_MASK` is enabled, the window will receive touch events
/// from touch-enabled devices. Those will come as sequences of `GdkEventTouch`
/// with type `GDK_TOUCH_UPDATE`, enclosed by two events with
/// type `GDK_TOUCH_BEGIN` and `GDK_TOUCH_END` (or `GDK_TOUCH_CANCEL`).
/// `gdk_event_get_event_sequence()` returns the event sequence for these
/// events, so different sequences may be distinguished.
public struct EventMask: OptionSet {
/// The corresponding value of the raw type
public var rawValue: UInt32 = 0
/// The equivalent raw Int value
@inlinable public var intValue: Int { get { Int(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent raw `gint` value
@inlinable public var int: gint { get { gint(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent underlying `GdkEventMask` enum value
@inlinable public var value: GdkEventMask {
get {
func castToGdkEventMaskInt<I: BinaryInteger, J: BinaryInteger>(_ param: I) -> J { J(param) }
return GdkEventMask(rawValue: castToGdkEventMaskInt(rawValue))
}
set { rawValue = UInt32(newValue.rawValue) }
}
/// Creates a new instance with the specified raw value
@inlinable public init(rawValue: UInt32) { self.rawValue = rawValue }
/// Creates a new instance with the specified `GdkEventMask` enum value
@inlinable public init(_ enumValue: GdkEventMask) { self.rawValue = UInt32(enumValue.rawValue) }
/// Creates a new instance with the specified Int value
@inlinable public init<I: BinaryInteger>(_ intValue: I) { self.rawValue = UInt32(intValue) }
/// receive expose events
public static let exposureMask = EventMask(2) // GDK_EXPOSURE_MASK
/// receive all pointer motion events
public static let pointerMotionMask = EventMask(4) // GDK_POINTER_MOTION_MASK
/// deprecated. see the explanation above
public static let pointerMotionHintMask = EventMask(8) // GDK_POINTER_MOTION_HINT_MASK
/// receive pointer motion events while any button is pressed
public static let buttonMotionMask = EventMask(16) // GDK_BUTTON_MOTION_MASK
/// receive pointer motion events while 1 button is pressed
public static let button1MotionMask = EventMask(32) // GDK_BUTTON1_MOTION_MASK
/// receive pointer motion events while 2 button is pressed
public static let button2MotionMask = EventMask(64) // GDK_BUTTON2_MOTION_MASK
/// receive pointer motion events while 3 button is pressed
public static let button3MotionMask = EventMask(128) // GDK_BUTTON3_MOTION_MASK
/// receive button press events
public static let buttonPressMask = EventMask(256) // GDK_BUTTON_PRESS_MASK
/// receive button release events
public static let buttonReleaseMask = EventMask(512) // GDK_BUTTON_RELEASE_MASK
/// receive key press events
public static let keyPressMask = EventMask(1024) // GDK_KEY_PRESS_MASK
/// receive key release events
public static let keyReleaseMask = EventMask(2048) // GDK_KEY_RELEASE_MASK
/// receive window enter events
public static let enterNotifyMask = EventMask(4096) // GDK_ENTER_NOTIFY_MASK
/// receive window leave events
public static let leaveNotifyMask = EventMask(8192) // GDK_LEAVE_NOTIFY_MASK
/// receive focus change events
public static let focusChangeMask = EventMask(16384) // GDK_FOCUS_CHANGE_MASK
/// receive events about window configuration change
public static let structureMask = EventMask(32768) // GDK_STRUCTURE_MASK
/// receive property change events
public static let propertyChangeMask = EventMask(65536) // GDK_PROPERTY_CHANGE_MASK
/// receive visibility change events
public static let visibilityNotifyMask = EventMask(131072) // GDK_VISIBILITY_NOTIFY_MASK
/// receive proximity in events
public static let proximityInMask = EventMask(262144) // GDK_PROXIMITY_IN_MASK
/// receive proximity out events
public static let proximityOutMask = EventMask(524288) // GDK_PROXIMITY_OUT_MASK
/// receive events about window configuration changes of
/// child windows
public static let substructureMask = EventMask(1048576) // GDK_SUBSTRUCTURE_MASK
/// receive scroll events
public static let scrollMask = EventMask(2097152) // GDK_SCROLL_MASK
/// receive touch events. Since 3.4
public static let touchMask = EventMask(4194304) // GDK_TOUCH_MASK
/// receive smooth scrolling events. Since 3.4
public static let smoothScrollMask = EventMask(8388608) // GDK_SMOOTH_SCROLL_MASK
/// receive touchpad gesture events. Since 3.18
public static let touchpadGestureMask = EventMask(16777216) // GDK_TOUCHPAD_GESTURE_MASK
/// receive tablet pad events. Since 3.22
public static let tabletPadMask = EventMask(33554432) // GDK_TABLET_PAD_MASK
/// the combination of all the above event masks.
public static let allEventsMask = EventMask(67108862) // GDK_ALL_EVENTS_MASK
}
/// `GdkFrameClockPhase` is used to represent the different paint clock
/// phases that can be requested. The elements of the enumeration
/// correspond to the signals of `GdkFrameClock`.
public struct FrameClockPhase: OptionSet {
/// The corresponding value of the raw type
public var rawValue: UInt32 = 0
/// The equivalent raw Int value
@inlinable public var intValue: Int { get { Int(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent raw `gint` value
@inlinable public var int: gint { get { gint(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent underlying `GdkFrameClockPhase` enum value
@inlinable public var value: GdkFrameClockPhase {
get {
func castToGdkFrameClockPhaseInt<I: BinaryInteger, J: BinaryInteger>(_ param: I) -> J { J(param) }
return GdkFrameClockPhase(rawValue: castToGdkFrameClockPhaseInt(rawValue))
}
set { rawValue = UInt32(newValue.rawValue) }
}
/// Creates a new instance with the specified raw value
@inlinable public init(rawValue: UInt32) { self.rawValue = rawValue }
/// Creates a new instance with the specified `GdkFrameClockPhase` enum value
@inlinable public init(_ enumValue: GdkFrameClockPhase) { self.rawValue = UInt32(enumValue.rawValue) }
/// Creates a new instance with the specified Int value
@inlinable public init<I: BinaryInteger>(_ intValue: I) { self.rawValue = UInt32(intValue) }
/// no phase
public static let `none` = FrameClockPhase(0) // GDK_FRAME_CLOCK_PHASE_NONE
/// corresponds to GdkFrameClock`flush-events`. Should not be handled by applications.
public static let flushEvents = FrameClockPhase(1) // GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS
/// corresponds to GdkFrameClock`before-paint`. Should not be handled by applications.
public static let beforePaint = FrameClockPhase(2) // GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT
/// corresponds to GdkFrameClock`update`.
public static let update = FrameClockPhase(4) // GDK_FRAME_CLOCK_PHASE_UPDATE
/// corresponds to GdkFrameClock`layout`.
public static let layout = FrameClockPhase(8) // GDK_FRAME_CLOCK_PHASE_LAYOUT
/// corresponds to GdkFrameClock`paint`.
public static let paint = FrameClockPhase(16) // GDK_FRAME_CLOCK_PHASE_PAINT
/// corresponds to GdkFrameClock`resume-events`. Should not be handled by applications.
public static let resumeEvents = FrameClockPhase(32) // GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS
/// corresponds to GdkFrameClock`after-paint`. Should not be handled by applications.
public static let afterPaint = FrameClockPhase(64) // GDK_FRAME_CLOCK_PHASE_AFTER_PAINT
}
/// A set of bit-flags to indicate the state of modifier keys and mouse buttons
/// in various event types. Typical modifier keys are Shift, Control, Meta,
/// Super, Hyper, Alt, Compose, Apple, CapsLock or ShiftLock.
///
/// Like the X Window System, GDK supports 8 modifier keys and 5 mouse buttons.
///
/// Since 2.10, GDK recognizes which of the Meta, Super or Hyper keys are mapped
/// to Mod2 - Mod5, and indicates this by setting `GDK_SUPER_MASK`,
/// `GDK_HYPER_MASK` or `GDK_META_MASK` in the state field of key events.
///
/// Note that GDK may add internal values to events which include
/// reserved values such as `GDK_MODIFIER_RESERVED_13_MASK`. Your code
/// should preserve and ignore them. You can use `GDK_MODIFIER_MASK` to
/// remove all reserved values.
///
/// Also note that the GDK X backend interprets button press events for button
/// 4-7 as scroll events, so `GDK_BUTTON4_MASK` and `GDK_BUTTON5_MASK` will never
/// be set.
public struct ModifierType: OptionSet {
/// The corresponding value of the raw type
public var rawValue: UInt32 = 0
/// The equivalent raw Int value
@inlinable public var intValue: Int { get { Int(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent raw `gint` value
@inlinable public var int: gint { get { gint(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent underlying `GdkModifierType` enum value
@inlinable public var value: GdkModifierType {
get {
func castToGdkModifierTypeInt<I: BinaryInteger, J: BinaryInteger>(_ param: I) -> J { J(param) }
return GdkModifierType(rawValue: castToGdkModifierTypeInt(rawValue))
}
set { rawValue = UInt32(newValue.rawValue) }
}
/// Creates a new instance with the specified raw value
@inlinable public init(rawValue: UInt32) { self.rawValue = rawValue }
/// Creates a new instance with the specified `GdkModifierType` enum value
@inlinable public init(_ enumValue: GdkModifierType) { self.rawValue = UInt32(enumValue.rawValue) }
/// Creates a new instance with the specified Int value
@inlinable public init<I: BinaryInteger>(_ intValue: I) { self.rawValue = UInt32(intValue) }
/// the Shift key.
public static let shiftMask = ModifierType(1) // GDK_SHIFT_MASK
/// a Lock key (depending on the modifier mapping of the
/// X server this may either be CapsLock or ShiftLock).
public static let lockMask = ModifierType(2) // GDK_LOCK_MASK
/// the Control key.
public static let controlMask = ModifierType(4) // GDK_CONTROL_MASK
/// the fourth modifier key (it depends on the modifier
/// mapping of the X server which key is interpreted as this modifier, but
/// normally it is the Alt key).
public static let mod1Mask = ModifierType(8) // GDK_MOD1_MASK
/// the fifth modifier key (it depends on the modifier
/// mapping of the X server which key is interpreted as this modifier).
public static let mod2Mask = ModifierType(16) // GDK_MOD2_MASK
/// the sixth modifier key (it depends on the modifier
/// mapping of the X server which key is interpreted as this modifier).
public static let mod3Mask = ModifierType(32) // GDK_MOD3_MASK
/// the seventh modifier key (it depends on the modifier
/// mapping of the X server which key is interpreted as this modifier).
public static let mod4Mask = ModifierType(64) // GDK_MOD4_MASK
/// the eighth modifier key (it depends on the modifier
/// mapping of the X server which key is interpreted as this modifier).
public static let mod5Mask = ModifierType(128) // GDK_MOD5_MASK
/// the first mouse button.
public static let button1Mask = ModifierType(256) // GDK_BUTTON1_MASK
/// the second mouse button.
public static let button2Mask = ModifierType(512) // GDK_BUTTON2_MASK
/// the third mouse button.
public static let button3Mask = ModifierType(1024) // GDK_BUTTON3_MASK
/// the fourth mouse button.
public static let button4Mask = ModifierType(2048) // GDK_BUTTON4_MASK
/// the fifth mouse button.
public static let button5Mask = ModifierType(4096) // GDK_BUTTON5_MASK
/// A reserved bit flag; do not use in your own code
public static let modifierReserved13Mask = ModifierType(8192) // GDK_MODIFIER_RESERVED_13_MASK
/// A reserved bit flag; do not use in your own code
public static let modifierReserved14Mask = ModifierType(16384) // GDK_MODIFIER_RESERVED_14_MASK
/// A reserved bit flag; do not use in your own code
public static let modifierReserved15Mask = ModifierType(32768) // GDK_MODIFIER_RESERVED_15_MASK
/// A reserved bit flag; do not use in your own code
public static let modifierReserved16Mask = ModifierType(65536) // GDK_MODIFIER_RESERVED_16_MASK
/// A reserved bit flag; do not use in your own code
public static let modifierReserved17Mask = ModifierType(131072) // GDK_MODIFIER_RESERVED_17_MASK
/// A reserved bit flag; do not use in your own code
public static let modifierReserved18Mask = ModifierType(262144) // GDK_MODIFIER_RESERVED_18_MASK
/// A reserved bit flag; do not use in your own code
public static let modifierReserved19Mask = ModifierType(524288) // GDK_MODIFIER_RESERVED_19_MASK
/// A reserved bit flag; do not use in your own code
public static let modifierReserved20Mask = ModifierType(1048576) // GDK_MODIFIER_RESERVED_20_MASK
/// A reserved bit flag; do not use in your own code
public static let modifierReserved21Mask = ModifierType(2097152) // GDK_MODIFIER_RESERVED_21_MASK
/// A reserved bit flag; do not use in your own code
public static let modifierReserved22Mask = ModifierType(4194304) // GDK_MODIFIER_RESERVED_22_MASK
/// A reserved bit flag; do not use in your own code
public static let modifierReserved23Mask = ModifierType(8388608) // GDK_MODIFIER_RESERVED_23_MASK
/// A reserved bit flag; do not use in your own code
public static let modifierReserved24Mask = ModifierType(16777216) // GDK_MODIFIER_RESERVED_24_MASK
/// A reserved bit flag; do not use in your own code
public static let modifierReserved25Mask = ModifierType(33554432) // GDK_MODIFIER_RESERVED_25_MASK
/// the Super modifier. Since 2.10
public static let superMask = ModifierType(67108864) // GDK_SUPER_MASK
/// the Hyper modifier. Since 2.10
public static let hyperMask = ModifierType(134217728) // GDK_HYPER_MASK
/// the Meta modifier. Since 2.10
public static let metaMask = ModifierType(268435456) // GDK_META_MASK
/// A reserved bit flag; do not use in your own code
public static let modifierReserved29Mask = ModifierType(536870912) // GDK_MODIFIER_RESERVED_29_MASK
/// not used in GDK itself. GTK+ uses it to differentiate
/// between (keyval, modifiers) pairs from key press and release events.
public static let releaseMask = ModifierType(1073741824) // GDK_RELEASE_MASK
/// a mask covering all modifier types.
public static let modifierMask = ModifierType(1543512063) // GDK_MODIFIER_MASK
}
/// Flags describing the seat capabilities.
public struct SeatCapabilities: OptionSet {
/// The corresponding value of the raw type
public var rawValue: UInt32 = 0
/// The equivalent raw Int value
@inlinable public var intValue: Int { get { Int(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent raw `gint` value
@inlinable public var int: gint { get { gint(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent underlying `GdkSeatCapabilities` enum value
@inlinable public var value: GdkSeatCapabilities {
get {
func castToGdkSeatCapabilitiesInt<I: BinaryInteger, J: BinaryInteger>(_ param: I) -> J { J(param) }
return GdkSeatCapabilities(rawValue: castToGdkSeatCapabilitiesInt(rawValue))
}
set { rawValue = UInt32(newValue.rawValue) }
}
/// Creates a new instance with the specified raw value
@inlinable public init(rawValue: UInt32) { self.rawValue = rawValue }
/// Creates a new instance with the specified `GdkSeatCapabilities` enum value
@inlinable public init(_ enumValue: GdkSeatCapabilities) { self.rawValue = UInt32(enumValue.rawValue) }
/// Creates a new instance with the specified Int value
@inlinable public init<I: BinaryInteger>(_ intValue: I) { self.rawValue = UInt32(intValue) }
/// No input capabilities
public static let `none` = SeatCapabilities(0) // GDK_SEAT_CAPABILITY_NONE
/// The seat has a pointer (e.g. mouse)
public static let pointer = SeatCapabilities(1) // GDK_SEAT_CAPABILITY_POINTER
/// The seat has `touchscreen(s)` attached
public static let touch = SeatCapabilities(2) // GDK_SEAT_CAPABILITY_TOUCH
/// The seat has drawing `tablet(s)` attached
public static let tabletStylus = SeatCapabilities(4) // GDK_SEAT_CAPABILITY_TABLET_STYLUS
/// The seat has `keyboard(s)` attached
public static let keyboard = SeatCapabilities(8) // GDK_SEAT_CAPABILITY_KEYBOARD
/// The union of all pointing capabilities
public static let allPointing = SeatCapabilities(7) // GDK_SEAT_CAPABILITY_ALL_POINTING
/// The union of all capabilities
public static let all = SeatCapabilities(15) // GDK_SEAT_CAPABILITY_ALL
}
/// These are hints originally defined by the Motif toolkit.
/// The window manager can use them when determining how to decorate
/// the window. The hint must be set before mapping the window.
public struct WMDecoration: OptionSet {
/// The corresponding value of the raw type
public var rawValue: UInt32 = 0
/// The equivalent raw Int value
@inlinable public var intValue: Int { get { Int(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent raw `gint` value
@inlinable public var int: gint { get { gint(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent underlying `GdkWMDecoration` enum value
@inlinable public var value: GdkWMDecoration {
get {
func castToGdkWMDecorationInt<I: BinaryInteger, J: BinaryInteger>(_ param: I) -> J { J(param) }
return GdkWMDecoration(rawValue: castToGdkWMDecorationInt(rawValue))
}
set { rawValue = UInt32(newValue.rawValue) }
}
/// Creates a new instance with the specified raw value
@inlinable public init(rawValue: UInt32) { self.rawValue = rawValue }
/// Creates a new instance with the specified `GdkWMDecoration` enum value
@inlinable public init(_ enumValue: GdkWMDecoration) { self.rawValue = UInt32(enumValue.rawValue) }
/// Creates a new instance with the specified Int value
@inlinable public init<I: BinaryInteger>(_ intValue: I) { self.rawValue = UInt32(intValue) }
/// all decorations should be applied.
public static let all = WMDecoration(1) // GDK_DECOR_ALL
/// a frame should be drawn around the window.
public static let border = WMDecoration(2) // GDK_DECOR_BORDER
/// the frame should have resize handles.
public static let resizeh = WMDecoration(4) // GDK_DECOR_RESIZEH
/// a titlebar should be placed above the window.
public static let title = WMDecoration(8) // GDK_DECOR_TITLE
/// a button for opening a menu should be included.
public static let menu = WMDecoration(16) // GDK_DECOR_MENU
/// a minimize button should be included.
public static let minimize = WMDecoration(32) // GDK_DECOR_MINIMIZE
/// a maximize button should be included.
public static let maximize = WMDecoration(64) // GDK_DECOR_MAXIMIZE
}
/// These are hints originally defined by the Motif toolkit. The window manager
/// can use them when determining the functions to offer for the window. The
/// hint must be set before mapping the window.
public struct WMFunction: OptionSet {
/// The corresponding value of the raw type
public var rawValue: UInt32 = 0
/// The equivalent raw Int value
@inlinable public var intValue: Int { get { Int(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent raw `gint` value
@inlinable public var int: gint { get { gint(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent underlying `GdkWMFunction` enum value
@inlinable public var value: GdkWMFunction {
get {
func castToGdkWMFunctionInt<I: BinaryInteger, J: BinaryInteger>(_ param: I) -> J { J(param) }
return GdkWMFunction(rawValue: castToGdkWMFunctionInt(rawValue))
}
set { rawValue = UInt32(newValue.rawValue) }
}
/// Creates a new instance with the specified raw value
@inlinable public init(rawValue: UInt32) { self.rawValue = rawValue }
/// Creates a new instance with the specified `GdkWMFunction` enum value
@inlinable public init(_ enumValue: GdkWMFunction) { self.rawValue = UInt32(enumValue.rawValue) }
/// Creates a new instance with the specified Int value
@inlinable public init<I: BinaryInteger>(_ intValue: I) { self.rawValue = UInt32(intValue) }
/// all functions should be offered.
public static let all = WMFunction(1) // GDK_FUNC_ALL
/// the window should be resizable.
public static let resize = WMFunction(2) // GDK_FUNC_RESIZE
/// the window should be movable.
public static let move = WMFunction(4) // GDK_FUNC_MOVE
/// the window should be minimizable.
public static let minimize = WMFunction(8) // GDK_FUNC_MINIMIZE
/// the window should be maximizable.
public static let maximize = WMFunction(16) // GDK_FUNC_MAXIMIZE
/// the window should be closable.
public static let close = WMFunction(32) // GDK_FUNC_CLOSE
}
/// Used to indicate which fields in the `GdkWindowAttr` struct should be honored.
/// For example, if you filled in the cursor and x fields of `GdkWindowAttr`,
/// pass `GDK_WA_X` | `GDK_WA_CURSOR` to `gdk_window_new()`. Fields in
/// `GdkWindowAttr` not covered by a bit in this enum are required; for example,
/// the `width`/`height`, `wclass`, and `window_type` fields are required, they have
/// no corresponding flag in `GdkWindowAttributesType`.
public struct WindowAttributesType: OptionSet {
/// The corresponding value of the raw type
public var rawValue: UInt32 = 0
/// The equivalent raw Int value
@inlinable public var intValue: Int { get { Int(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent raw `gint` value
@inlinable public var int: gint { get { gint(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent underlying `GdkWindowAttributesType` enum value
@inlinable public var value: GdkWindowAttributesType {
get {
func castToGdkWindowAttributesTypeInt<I: BinaryInteger, J: BinaryInteger>(_ param: I) -> J { J(param) }
return GdkWindowAttributesType(rawValue: castToGdkWindowAttributesTypeInt(rawValue))
}
set { rawValue = UInt32(newValue.rawValue) }
}
/// Creates a new instance with the specified raw value
@inlinable public init(rawValue: UInt32) { self.rawValue = rawValue }
/// Creates a new instance with the specified `GdkWindowAttributesType` enum value
@inlinable public init(_ enumValue: GdkWindowAttributesType) { self.rawValue = UInt32(enumValue.rawValue) }
/// Creates a new instance with the specified Int value
@inlinable public init<I: BinaryInteger>(_ intValue: I) { self.rawValue = UInt32(intValue) }
/// Honor the title field
public static let title = WindowAttributesType(2) // GDK_WA_TITLE
/// Honor the X coordinate field
public static let x = WindowAttributesType(4) // GDK_WA_X
/// Honor the Y coordinate field
public static let y = WindowAttributesType(8) // GDK_WA_Y
/// Honor the cursor field
public static let cursor = WindowAttributesType(16) // GDK_WA_CURSOR
/// Honor the visual field
public static let visual = WindowAttributesType(32) // GDK_WA_VISUAL
/// Honor the wmclass_class and wmclass_name fields
public static let wmclass = WindowAttributesType(64) // GDK_WA_WMCLASS
/// Honor the override_redirect field
public static let noredir = WindowAttributesType(128) // GDK_WA_NOREDIR
/// Honor the type_hint field
public static let typeHint = WindowAttributesType(256) // GDK_WA_TYPE_HINT
}
/// Used to indicate which fields of a `GdkGeometry` struct should be paid
/// attention to. Also, the presence/absence of `GDK_HINT_POS`,
/// `GDK_HINT_USER_POS`, and `GDK_HINT_USER_SIZE` is significant, though they don't
/// directly refer to `GdkGeometry` fields. `GDK_HINT_USER_POS` will be set
/// automatically by `GtkWindow` if you call `gtk_window_move()`.
/// `GDK_HINT_USER_POS` and `GDK_HINT_USER_SIZE` should be set if the user
/// specified a size/position using a --geometry command-line argument;
/// `gtk_window_parse_geometry()` automatically sets these flags.
public struct WindowHints: OptionSet {
/// The corresponding value of the raw type
public var rawValue: UInt32 = 0
/// The equivalent raw Int value
@inlinable public var intValue: Int { get { Int(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent raw `gint` value
@inlinable public var int: gint { get { gint(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent underlying `GdkWindowHints` enum value
@inlinable public var value: GdkWindowHints {
get {
func castToGdkWindowHintsInt<I: BinaryInteger, J: BinaryInteger>(_ param: I) -> J { J(param) }
return GdkWindowHints(rawValue: castToGdkWindowHintsInt(rawValue))
}
set { rawValue = UInt32(newValue.rawValue) }
}
/// Creates a new instance with the specified raw value
@inlinable public init(rawValue: UInt32) { self.rawValue = rawValue }
/// Creates a new instance with the specified `GdkWindowHints` enum value
@inlinable public init(_ enumValue: GdkWindowHints) { self.rawValue = UInt32(enumValue.rawValue) }
/// Creates a new instance with the specified Int value
@inlinable public init<I: BinaryInteger>(_ intValue: I) { self.rawValue = UInt32(intValue) }
/// indicates that the program has positioned the window
public static let pos = WindowHints(1) // GDK_HINT_POS
/// min size fields are set
public static let minSize = WindowHints(2) // GDK_HINT_MIN_SIZE
/// max size fields are set
public static let maxSize = WindowHints(4) // GDK_HINT_MAX_SIZE
/// base size fields are set
public static let baseSize = WindowHints(8) // GDK_HINT_BASE_SIZE
/// aspect ratio fields are set
public static let aspect = WindowHints(16) // GDK_HINT_ASPECT
/// resize increment fields are set
public static let resizeInc = WindowHints(32) // GDK_HINT_RESIZE_INC
/// window gravity field is set
public static let winGravity = WindowHints(64) // GDK_HINT_WIN_GRAVITY
/// indicates that the windows position was explicitly set
/// by the user
public static let userPos = WindowHints(128) // GDK_HINT_USER_POS
/// indicates that the windows size was explicitly set by
/// the user
public static let userSize = WindowHints(256) // GDK_HINT_USER_SIZE
}
/// Specifies the state of a toplevel window.
public struct WindowState: OptionSet {
/// The corresponding value of the raw type
public var rawValue: UInt32 = 0
/// The equivalent raw Int value
@inlinable public var intValue: Int { get { Int(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent raw `gint` value
@inlinable public var int: gint { get { gint(rawValue) } set { rawValue = UInt32(newValue) } }
/// The equivalent underlying `GdkWindowState` enum value
@inlinable public var value: GdkWindowState {
get {
func castToGdkWindowStateInt<I: BinaryInteger, J: BinaryInteger>(_ param: I) -> J { J(param) }
return GdkWindowState(rawValue: castToGdkWindowStateInt(rawValue))
}
set { rawValue = UInt32(newValue.rawValue) }
}
/// Creates a new instance with the specified raw value
@inlinable public init(rawValue: UInt32) { self.rawValue = rawValue }
/// Creates a new instance with the specified `GdkWindowState` enum value
@inlinable public init(_ enumValue: GdkWindowState) { self.rawValue = UInt32(enumValue.rawValue) }
/// Creates a new instance with the specified Int value
@inlinable public init<I: BinaryInteger>(_ intValue: I) { self.rawValue = UInt32(intValue) }
/// the window is not shown.
public static let withdrawn = WindowState(1) // GDK_WINDOW_STATE_WITHDRAWN
/// the window is minimized.
public static let iconified = WindowState(2) // GDK_WINDOW_STATE_ICONIFIED
/// the window is maximized.
public static let maximized = WindowState(4) // GDK_WINDOW_STATE_MAXIMIZED
/// the window is sticky.
public static let sticky = WindowState(8) // GDK_WINDOW_STATE_STICKY
/// the window is maximized without
/// decorations.
public static let fullscreen = WindowState(16) // GDK_WINDOW_STATE_FULLSCREEN
/// the window is kept above other windows.
public static let above = WindowState(32) // GDK_WINDOW_STATE_ABOVE
/// the window is kept below other windows.
public static let below = WindowState(64) // GDK_WINDOW_STATE_BELOW
/// the window is presented as focused (with active decorations).
public static let focused = WindowState(128) // GDK_WINDOW_STATE_FOCUSED
/// the window is in a tiled state, Since 3.10. Since 3.22.23, this
/// is deprecated in favor of per-edge information.
public static let tiled = WindowState(256) // GDK_WINDOW_STATE_TILED
/// whether the top edge is tiled, Since 3.22.23
public static let topTiled = WindowState(512) // GDK_WINDOW_STATE_TOP_TILED
/// whether the top edge is resizable, Since 3.22.23
public static let topResizable = WindowState(1024) // GDK_WINDOW_STATE_TOP_RESIZABLE
/// whether the right edge is tiled, Since 3.22.23
public static let rightTiled = WindowState(2048) // GDK_WINDOW_STATE_RIGHT_TILED
/// whether the right edge is resizable, Since 3.22.23
public static let rightResizable = WindowState(4096) // GDK_WINDOW_STATE_RIGHT_RESIZABLE
/// whether the bottom edge is tiled, Since 3.22.23
public static let bottomTiled = WindowState(8192) // GDK_WINDOW_STATE_BOTTOM_TILED
/// whether the bottom edge is resizable, Since 3.22.23
public static let bottomResizable = WindowState(16384) // GDK_WINDOW_STATE_BOTTOM_RESIZABLE
/// whether the left edge is tiled, Since 3.22.23
public static let leftTiled = WindowState(32768) // GDK_WINDOW_STATE_LEFT_TILED
/// whether the left edge is resizable, Since 3.22.23
public static let leftResizable = WindowState(65536) // GDK_WINDOW_STATE_LEFT_RESIZABLE
}

View File

@ -0,0 +1,45 @@
import CGLib
import CCairo
import CPango
import CGdkPixbuf
import CGdk
import GLib
import GLibObject
import GIO
import Pango
import Cairo
import PangoCairo
import GdkPixbuf
/// Specifies the type of function passed to `gdk_event_handler_set()` to
/// handle all GDK events.
public typealias EventFunc = GdkEventFunc
/// Specifies the type of function used to filter native events before they are
/// converted to GDK events.
///
/// When a filter is called, `event` is unpopulated, except for
/// `event-&gt;window`. The filter may translate the native
/// event to a GDK event and store the result in `event`, or handle it without
/// translation. If the filter translates the event and processing should
/// continue, it should return `GDK_FILTER_TRANSLATE`.
public typealias FilterFunc = GdkFilterFunc
/// Type of the callback used to set up `window` so it can be
/// grabbed. A typical action would be ensuring the window is
/// visible, although there's room for other initialization
/// actions.
public typealias SeatGrabPrepareFunc = GdkSeatGrabPrepareFunc
/// A function of this type is passed to `gdk_window_invalidate_maybe_recurse()`.
/// It gets called for each child of the window to determine whether to
/// recursively invalidate it or now.
public typealias WindowChildFunc = GdkWindowChildFunc
/// Whenever some area of the window is invalidated (directly in the
/// window or in a child window) this gets called with `region` in
/// the coordinate space of `window`. You can use `region` to just
/// keep track of the dirty region, or you can actually change
/// `region` in case you are doing display tricks like showing
/// a child in multiple places.
public typealias WindowInvalidateHandlerFunc = GdkWindowInvalidateHandlerFunc

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

35
Sources/Gdk/Gdk-3.0.swift Normal file
View File

@ -0,0 +1,35 @@
import CGLib
import CCairo
import CPango
import CGdkPixbuf
import CGdk
import GLib
import GLibObject
import GIO
import Pango
import Cairo
import PangoCairo
import GdkPixbuf
// missing header file type aliases
public typealias GdkXEvent = _GdkXEvent
extension gboolean {
private init(_ b: Bool) { self = b ? gboolean(1) : gboolean(0) }
}
func asStringArray(_ param: UnsafePointer<UnsafePointer<CChar>?>) -> [String] {
var ptr = param
var rv = [String]()
while ptr.pointee != nil {
rv.append(String(cString: ptr.pointee!))
ptr = ptr.successor()
}
return rv
}
func asStringArray<T>(_ param: UnsafePointer<UnsafePointer<CChar>?>, release: ((UnsafePointer<T>?) -> Void)) -> [String] {
let rv = asStringArray(param)
param.withMemoryRebound(to: T.self, capacity: rv.count) { release(UnsafePointer<T>($0)) }
return rv
}