// 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/gdk/v3"
	"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:
//
//   - ok: if the surface's exclusive zone is set to change based on the
//     window's size.
//
func AutoExclusiveZoneIsEnabled(window *gtk.Window) bool {
	var _arg1 *C.GtkWindow // out
	var _cret C.gboolean   // in

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

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

	var _ok bool // out

	if _cret != 0 {
		_ok = true
	}

	return _ok
}

// The function takes the following parameters:
//
//   - window: layer surface.
//   - edge
//
// The function returns the following values:
//
//   - ok: if this surface is anchored to the given edge.
//
func GetAnchor(window *gtk.Window, edge Edge) bool {
	var _arg1 *C.GtkWindow        // out
	var _arg2 C.GtkLayerShellEdge // out
	var _cret C.gboolean          // in

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

	_cret = C.gtk_layer_get_anchor(_arg1, _arg2)
	runtime.KeepAlive(window)
	runtime.KeepAlive(edge)

	var _ok bool // out

	if _cret != 0 {
		_ok = true
	}

	return _ok
}

// The function takes the following parameters:
//
//   - window: layer surface.
//
// The function returns the following values:
//
//   - gint window's exclusive zone (which may have been set manually or
//     automatically).
//
func GetExclusiveZone(window *gtk.Window) int {
	var _arg1 *C.GtkWindow // out
	var _cret C.int        // in

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

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

	var _gint int // out

	_gint = int(_cret)

	return _gint
}

// GetKeyboardInteractivity: deprecated: Use gtk_layer_get_keyboard_mode ()
// instead.
//
// The function takes the following parameters:
//
//   - window: layer surface.
//
// The function returns the following values:
//
//   - ok: if keyboard interactivity is enabled.
//
func GetKeyboardInteractivity(window *gtk.Window) bool {
	var _arg1 *C.GtkWindow // out
	var _cret C.gboolean   // in

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

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

	var _ok bool // out

	if _cret != 0 {
		_ok = true
	}

	return _ok
}

// The function takes the following parameters:
//
//   - window: layer surface.
//
// The function returns the following values:
//
//   - layer: current layer.
//
func GetLayer(window *gtk.Window) Layer {
	var _arg1 *C.GtkWindow         // out
	var _cret C.GtkLayerShellLayer // in

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

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

	var _layer Layer // out

	_layer = Layer(_cret)

	return _layer
}

// The function takes the following parameters:
//
//   - window: layer surface.
//   - edge
//
// The function returns the following values:
//
//   - gint: size of the margin for the given edge.
//
func GetMargin(window *gtk.Window, edge Edge) int {
	var _arg1 *C.GtkWindow        // out
	var _arg2 C.GtkLayerShellEdge // out
	var _cret C.int               // in

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

	_cret = C.gtk_layer_get_margin(_arg1, _arg2)
	runtime.KeepAlive(window)
	runtime.KeepAlive(edge)

	var _gint int // out

	_gint = int(_cret)

	return _gint
}

// GetMonitor: NOTE: To get which monitor the surface is actually on, use
// gdk_display_get_monitor_at_window().
//
// The function takes the following parameters:
//
//   - window: layer surface.
//
// The function returns the following values:
//
//   - monitor this surface will/has requested to be on, can be NULL.
//
func GetMonitor(window *gtk.Window) *gdk.Monitor {
	var _arg1 *C.GtkWindow  // out
	var _cret *C.GdkMonitor // in

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

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

	var _monitor *gdk.Monitor // out

	{
		obj := coreglib.Take(unsafe.Pointer(_cret))
		_monitor = &gdk.Monitor{
			Object: obj,
		}
	}

	return _monitor
}

// GetNamespace: NOTE: this function does not return ownership of the string.
// Do not free the returned string. Future calls into the library may invalidate
// the returned string.
//
// The function takes the following parameters:
//
//   - window: layer surface.
//
// The function returns the following values:
//
//   - utf8: reference to the namespace property. If namespace is unset,
//     returns the default namespace ("gtk-layer-shell"). Never returns NULL.
//
func GetNamespace(window *gtk.Window) string {
	var _arg1 *C.GtkWindow // out
	var _cret *C.char      // in

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

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

	var _utf8 string // out

	_utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))

	return _utf8
}

// The function takes the following parameters:
//
//   - window that may or may not have a layer surface.
//
// The function returns the following values:
//
//   - ok: if window has been initialized as a layer surface.
//
func IsLayerWindow(window *gtk.Window) bool {
	var _arg1 *C.GtkWindow // out
	var _cret C.gboolean   // in

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

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

	var _ok bool // out

	if _cret != 0 {
		_ok = true
	}

	return _ok
}

// IsSupported: may block for a Wayland roundtrip the first time it's called.
//
// The function returns the following values:
//
//   - ok: TRUE if the platform is Wayland and Wayland compositor supports the
//     zwlr_layer_shell_v1 protocol.
//
func IsSupported() bool {
	var _cret C.gboolean // in

	_cret = C.gtk_layer_is_supported()

	var _ok bool // out

	if _cret != 0 {
		_ok = true
	}

	return _ok
}
