wl.go RawHistoryFolder
1// Package wl is the stable alias surface over package wlturbo. It is imported
2// by the bindings generated in github.com/bnema/go-wayland-bindings, so its
3// names are part of that contract. It also keeps source compatibility with
4// neurlang/wayland, so code written against that package can migrate by
5// changing its import path.
6package wl
7
8import (
9 "github.com/bnema/wlturbo"
10)
11
12// Type aliases for compatibility
13type (
14 Display = wlturbo.Display
15 Registry = wlturbo.Registry
16 Context = wlturbo.Context
17 Fixed = wlturbo.Fixed
18 Object = wlturbo.Object
19 Proxy = wlturbo.Proxy
20 BaseProxy = wlturbo.BaseProxy
21 Event = wlturbo.Event
22 Global = wlturbo.Global
23 GlobalHandler = wlturbo.GlobalHandler
24 RegistryGlobalHandler = wlturbo.RegistryGlobalHandler
25 RegistryGlobalRemoveHandler = wlturbo.RegistryGlobalRemoveHandler
26 RegistryGlobalEvent = wlturbo.RegistryGlobalEvent
27 RegistryGlobalRemoveEvent = wlturbo.RegistryGlobalRemoveEvent
28 OwnedFD = wlturbo.OwnedFD
29 Request = wlturbo.Request
30 Arg = wlturbo.Arg
31
32 // Transport failures. Without these, a caller that imports this shim has to
33 // import the root package as well just to classify an error.
34 DisplayError = wlturbo.DisplayError
35 ProtocolError = wlturbo.ProtocolError
36)
37
38// Function aliases
39var (
40 Connect = wlturbo.Connect
41 NewFixed = wlturbo.NewFixed
42 NewContext = wlturbo.NewContext
43 CloseSentFD = wlturbo.CloseSentFD
44 CheckVersion = wlturbo.CheckVersion
45 CreateAnonymousFile = wlturbo.CreateAnonymousFile
46 MapMemory = wlturbo.MapMemory
47 UnmapMemory = wlturbo.UnmapMemory
48)
49
50// ArgUint constructs a uint argument.
51func ArgUint(v uint32) Arg { return wlturbo.ArgUint(v) }
52
53// ArgInt constructs an int argument.
54func ArgInt(v int32) Arg { return wlturbo.ArgInt(v) }
55
56// ArgFixed constructs a fixed-point argument.
57func ArgFixed(v Fixed) Arg { return wlturbo.ArgFixed(v) }
58
59// ArgString constructs a string argument borrowed until the request returns.
60func ArgString(v string) Arg { return wlturbo.ArgString(v) }
61
62// ArgArray constructs an array argument borrowed until the request returns.
63func ArgArray(v []byte) Arg { return wlturbo.ArgArray(v) }
64
65// ArgObject constructs an object or new_id argument; nil is sent as 0.
66func ArgObject(v Object) Arg { return wlturbo.ArgObject(v) }
67
68// ArgFD marks a descriptor position; the descriptor travels in Request.FDs.
69func ArgFD() Arg { return wlturbo.ArgFD() }
70
71// Sentinels for the transport's error classes, so errors.Is works through the
72// shim as it does through the root package.
73var (
74 ErrMalformedFrame = wlturbo.ErrMalformedFrame
75 ErrUnknownObject = wlturbo.ErrUnknownObject
76 ErrUnknownOpcode = wlturbo.ErrUnknownOpcode
77 ErrDisplayError = wlturbo.ErrDisplayError
78 ErrVersionTooLow = wlturbo.ErrVersionTooLow
79)