mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
ui/app: (macOS) use CFTypeRef for the view factory
The os and gl packages were separate in the past, which required uintptr for cross-package CFTypeRefs. That's no longer needed. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-2
@@ -25,8 +25,8 @@ type context struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
viewFactory = func() uintptr {
|
viewFactory = func() C.CFTypeRef {
|
||||||
return uintptr(C.gio_createGLView())
|
return C.gio_createGLView()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -43,7 +43,7 @@ var singleWindow struct {
|
|||||||
opts *WindowOptions
|
opts *WindowOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
var viewFactory func() uintptr
|
var viewFactory func() C.CFTypeRef
|
||||||
|
|
||||||
var views = make(map[C.CFTypeRef]*window)
|
var views = make(map[C.CFTypeRef]*window)
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ func createWindow(opts *WindowOptions) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Main() {
|
func Main() {
|
||||||
view := C.CFTypeRef(viewFactory())
|
view := viewFactory()
|
||||||
if view == 0 {
|
if view == 0 {
|
||||||
// TODO: return this error from CreateWindow.
|
// TODO: return this error from CreateWindow.
|
||||||
panic(errors.New("CreateWindow: failed to create view"))
|
panic(errors.New("CreateWindow: failed to create view"))
|
||||||
|
|||||||
Reference in New Issue
Block a user