// Code generated by girgen. DO NOT EDIT.

package adw

import (
	"unsafe"

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

// #include <stdlib.h>
// #include <adwaita.h>
import "C"

//export _gotk4_adw1_NavigationPage_ConnectHidden
func _gotk4_adw1_NavigationPage_ConnectHidden(arg0 C.gpointer, arg1 C.guintptr) {
	var f func()
	{
		closure := coreglib.ConnectedGeneratedClosure(uintptr(arg1))
		if closure == nil {
			panic("given unknown closure user_data")
		}
		defer closure.TryRepanic()

		f = closure.Func.(func())
	}

	f()
}

//export _gotk4_adw1_NavigationPage_ConnectHiding
func _gotk4_adw1_NavigationPage_ConnectHiding(arg0 C.gpointer, arg1 C.guintptr) {
	var f func()
	{
		closure := coreglib.ConnectedGeneratedClosure(uintptr(arg1))
		if closure == nil {
			panic("given unknown closure user_data")
		}
		defer closure.TryRepanic()

		f = closure.Func.(func())
	}

	f()
}

//export _gotk4_adw1_NavigationPage_ConnectShowing
func _gotk4_adw1_NavigationPage_ConnectShowing(arg0 C.gpointer, arg1 C.guintptr) {
	var f func()
	{
		closure := coreglib.ConnectedGeneratedClosure(uintptr(arg1))
		if closure == nil {
			panic("given unknown closure user_data")
		}
		defer closure.TryRepanic()

		f = closure.Func.(func())
	}

	f()
}

//export _gotk4_adw1_NavigationPage_ConnectShown
func _gotk4_adw1_NavigationPage_ConnectShown(arg0 C.gpointer, arg1 C.guintptr) {
	var f func()
	{
		closure := coreglib.ConnectedGeneratedClosure(uintptr(arg1))
		if closure == nil {
			panic("given unknown closure user_data")
		}
		defer closure.TryRepanic()

		f = closure.Func.(func())
	}

	f()
}

//export _gotk4_adw1_NavigationView_ConnectGetNextPage
func _gotk4_adw1_NavigationView_ConnectGetNextPage(arg0 C.gpointer, arg1 C.guintptr) (cret *C.AdwNavigationPage) {
	var f func() (navigationPage *NavigationPage)
	{
		closure := coreglib.ConnectedGeneratedClosure(uintptr(arg1))
		if closure == nil {
			panic("given unknown closure user_data")
		}
		defer closure.TryRepanic()

		f = closure.Func.(func() (navigationPage *NavigationPage))
	}

	navigationPage := f()

	var _ *NavigationPage

	if navigationPage != nil {
		cret = (*C.AdwNavigationPage)(unsafe.Pointer(coreglib.InternObject(navigationPage).Native()))
		C.g_object_ref(C.gpointer(coreglib.InternObject(navigationPage).Native()))
	}

	return cret
}

//export _gotk4_adw1_NavigationView_ConnectPopped
func _gotk4_adw1_NavigationView_ConnectPopped(arg0 C.gpointer, arg1 *C.AdwNavigationPage, arg2 C.guintptr) {
	var f func(page *NavigationPage)
	{
		closure := coreglib.ConnectedGeneratedClosure(uintptr(arg2))
		if closure == nil {
			panic("given unknown closure user_data")
		}
		defer closure.TryRepanic()

		f = closure.Func.(func(page *NavigationPage))
	}

	var _page *NavigationPage // out

	_page = wrapNavigationPage(coreglib.Take(unsafe.Pointer(arg1)))

	f(_page)
}

//export _gotk4_adw1_NavigationView_ConnectPushed
func _gotk4_adw1_NavigationView_ConnectPushed(arg0 C.gpointer, arg1 C.guintptr) {
	var f func()
	{
		closure := coreglib.ConnectedGeneratedClosure(uintptr(arg1))
		if closure == nil {
			panic("given unknown closure user_data")
		}
		defer closure.TryRepanic()

		f = closure.Func.(func())
	}

	f()
}

//export _gotk4_adw1_NavigationView_ConnectReplaced
func _gotk4_adw1_NavigationView_ConnectReplaced(arg0 C.gpointer, arg1 C.guintptr) {
	var f func()
	{
		closure := coreglib.ConnectedGeneratedClosure(uintptr(arg1))
		if closure == nil {
			panic("given unknown closure user_data")
		}
		defer closure.TryRepanic()

		f = closure.Func.(func())
	}

	f()
}
