// Code generated by girgen. DO NOT EDIT.

package adw

import (
	"fmt"
	"unsafe"

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

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

// GType values.
var (
	GTypeFoldThresholdPolicy = coreglib.Type(C.adw_fold_threshold_policy_get_type())
)

func init() {
	coreglib.RegisterGValueMarshalers([]coreglib.TypeMarshaler{
		coreglib.TypeMarshaler{T: GTypeFoldThresholdPolicy, F: marshalFoldThresholdPolicy},
	})
}

// FoldThresholdPolicy determines when flap and leaflet will fold.
//
// Deprecated: Stop using AdwLeaflet and AdwFlap.
type FoldThresholdPolicy C.gint

const (
	// FoldThresholdPolicyMinimum: folding is based on the minimum size.
	FoldThresholdPolicyMinimum FoldThresholdPolicy = iota
	// FoldThresholdPolicyNatural: folding is based on the natural size.
	FoldThresholdPolicyNatural
)

func marshalFoldThresholdPolicy(p uintptr) (interface{}, error) {
	return FoldThresholdPolicy(coreglib.ValueFromNative(unsafe.Pointer(p)).Enum()), nil
}

// String returns the name in string for FoldThresholdPolicy.
func (f FoldThresholdPolicy) String() string {
	switch f {
	case FoldThresholdPolicyMinimum:
		return "Minimum"
	case FoldThresholdPolicyNatural:
		return "Natural"
	default:
		return fmt.Sprintf("FoldThresholdPolicy(%d)", f)
	}
}
