// Code generated by girgen. DO NOT EDIT.

package gtklayershell

import (
	"runtime"
	"unsafe"

	coreglib "github.com/diamondburned/gotk4/pkg/core/glib"
	"github.com/diamondburned/gotk4/pkg/gtk/v3"
)

// #include <stdlib.h>
// #include <gtk-layer-shell/gtk-layer-shell.h>
import "C"

// The function takes the following parameters:
//
//   - window: layer surface.
//
// The function returns the following values:
//
//   - keyboardMode: current keyboard interactivity mode for window.
//
func GetKeyboardMode(window *gtk.Window) KeyboardMode {
	var _arg1 *C.GtkWindow                // out
	var _cret C.GtkLayerShellKeyboardMode // in

	_arg1 = (*C.GtkWindow)(unsafe.Pointer(coreglib.InternObject(window).Native()))

	_cret = C.gtk_layer_get_keyboard_mode(_arg1)
	runtime.KeepAlive(window)

	var _keyboardMode KeyboardMode // out

	_keyboardMode = KeyboardMode(_cret)

	return _keyboardMode
}

// GetProtocolVersion: may block for a Wayland roundtrip the first time it's
// called.
//
// The function returns the following values:
//
//   - guint: version of the zwlr_layer_shell_v1 protocol supported by the
//     compositor or 0 if the protocol is not supported.
//
func GetProtocolVersion() uint {
	var _cret C.guint // in

	_cret = C.gtk_layer_get_protocol_version()

	var _guint uint // out

	_guint = uint(_cret)

	return _guint
}

// SetKeyboardMode sets if/when window should receive keyboard events from the
// compositor, see GtkLayerShellKeyboardMode for details.
//
// Default is GTK_LAYER_SHELL_KEYBOARD_MODE_NONE.
//
// The function takes the following parameters:
//
//   - window: layer surface.
//   - mode: type of keyboard interactivity requested.
//
func SetKeyboardMode(window *gtk.Window, mode KeyboardMode) {
	var _arg1 *C.GtkWindow                // out
	var _arg2 C.GtkLayerShellKeyboardMode // out

	_arg1 = (*C.GtkWindow)(unsafe.Pointer(coreglib.InternObject(window).Native()))
	_arg2 = C.GtkLayerShellKeyboardMode(mode)

	C.gtk_layer_set_keyboard_mode(_arg1, _arg2)
	runtime.KeepAlive(window)
	runtime.KeepAlive(mode)
}
