// Code generated by girgen. DO NOT EDIT.

package adw

import (
	"unsafe"

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

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

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

		f = closure.Func.(func() (tabPage *TabPage))
	}

	tabPage := f()

	var _ *TabPage

	cret = (*C.AdwTabPage)(unsafe.Pointer(coreglib.InternObject(tabPage).Native()))

	return cret
}

//export _gotk4_adw1_TabOverview_ConnectExtraDragDrop
func _gotk4_adw1_TabOverview_ConnectExtraDragDrop(arg0 C.gpointer, arg1 *C.AdwTabPage, arg2 *C.GValue, arg3 C.guintptr) (cret C.gboolean) {
	var f func(page *TabPage, value *coreglib.Value) (ok bool)
	{
		closure := coreglib.ConnectedGeneratedClosure(uintptr(arg3))
		if closure == nil {
			panic("given unknown closure user_data")
		}
		defer closure.TryRepanic()

		f = closure.Func.(func(page *TabPage, value *coreglib.Value) (ok bool))
	}

	var _page *TabPage         // out
	var _value *coreglib.Value // out

	_page = wrapTabPage(coreglib.Take(unsafe.Pointer(arg1)))
	_value = coreglib.ValueFromNative(unsafe.Pointer(arg2))

	ok := f(_page, _value)

	var _ bool

	if ok {
		cret = C.TRUE
	}

	return cret
}

//export _gotk4_adw1_TabOverview_ConnectExtraDragValue
func _gotk4_adw1_TabOverview_ConnectExtraDragValue(arg0 C.gpointer, arg1 *C.AdwTabPage, arg2 *C.GValue, arg3 C.guintptr) (cret C.GdkDragAction) {
	var f func(page *TabPage, value *coreglib.Value) (dragAction gdk.DragAction)
	{
		closure := coreglib.ConnectedGeneratedClosure(uintptr(arg3))
		if closure == nil {
			panic("given unknown closure user_data")
		}
		defer closure.TryRepanic()

		f = closure.Func.(func(page *TabPage, value *coreglib.Value) (dragAction gdk.DragAction))
	}

	var _page *TabPage         // out
	var _value *coreglib.Value // out

	_page = wrapTabPage(coreglib.Take(unsafe.Pointer(arg1)))
	_value = coreglib.ValueFromNative(unsafe.Pointer(arg2))

	dragAction := f(_page, _value)

	var _ gdk.DragAction

	cret = C.GdkDragAction(dragAction)

	return cret
}
