-
Notifications
You must be signed in to change notification settings - Fork 182
/
native_linbsd_x11.go
67 lines (57 loc) · 1.63 KB
/
native_linbsd_x11.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//go:build (linux && !wayland) || (freebsd && !wayland) || (netbsd && !wayland) || (openbsd && !wayland)
// +build linux,!wayland freebsd,!wayland netbsd,!wayland openbsd,!wayland
package glfw
//#include <stdlib.h>
//#define GLFW_EXPOSE_NATIVE_X11
//#define GLFW_EXPOSE_NATIVE_GLX
//#define GLFW_INCLUDE_NONE
//#include "glfw/include/GLFW/glfw3.h"
//#include "glfw/include/GLFW/glfw3native.h"
import "C"
import "unsafe"
func GetX11Display() *C.Display {
ret := C.glfwGetX11Display()
panicError()
return ret
}
// GetX11Adapter returns the RRCrtc of the monitor.
func (m *Monitor) GetX11Adapter() C.RRCrtc {
ret := C.glfwGetX11Adapter(m.data)
panicError()
return ret
}
// GetX11Monitor returns the RROutput of the monitor.
func (m *Monitor) GetX11Monitor() C.RROutput {
ret := C.glfwGetX11Monitor(m.data)
panicError()
return ret
}
// GetX11Window returns the Window of the window.
func (w *Window) GetX11Window() C.Window {
ret := C.glfwGetX11Window(w.data)
panicError()
return ret
}
// GetGLXContext returns the GLXContext of the window.
func (w *Window) GetGLXContext() C.GLXContext {
ret := C.glfwGetGLXContext(w.data)
panicError()
return ret
}
// GetGLXWindow returns the GLXWindow of the window.
func (w *Window) GetGLXWindow() C.GLXWindow {
ret := C.glfwGetGLXWindow(w.data)
panicError()
return ret
}
// SetX11SelectionString sets the X11 selection string.
func SetX11SelectionString(str string) {
s := C.CString(str)
defer C.free(unsafe.Pointer(s))
C.glfwSetX11SelectionString(s)
}
// GetX11SelectionString gets the X11 selection string.
func GetX11SelectionString() string {
s := C.glfwGetX11SelectionString()
return C.GoString(s)
}