// Code generated by girgen. DO NOT EDIT.

package adw

import (
	"unsafe"

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

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

// GType values.
var (
	GTypePasswordEntryRow = coreglib.Type(C.adw_password_entry_row_get_type())
)

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

// PasswordEntryRowOverrides contains methods that are overridable.
type PasswordEntryRowOverrides struct {
}

func defaultPasswordEntryRowOverrides(v *PasswordEntryRow) PasswordEntryRowOverrides {
	return PasswordEntryRowOverrides{}
}

// PasswordEntryRow: entryrow tailored for entering secrets.
//
// <picture> <source srcset="password-entry-row-dark.png"
// media="(prefers-color-scheme: dark)"> <img src="password-entry-row.png"
// alt="password-entry-row"> </picture>
//
// It does not show its contents in clear text, does not allow to copy it
// to the clipboard, and shows a warning when Caps Lock is engaged. If the
// underlying platform allows it, AdwPasswordEntryRow will also place the text
// in a non-pageable memory area, to avoid it being written out to disk by the
// operating system.
//
// It offer a way to reveal the contents in clear text.
//
// # CSS Nodes
//
// AdwPasswordEntryRow has a single CSS node with name row that carries .entry
// and .password style classes.
type PasswordEntryRow struct {
	_ [0]func() // equal guard
	EntryRow
}

var (
	_ coreglib.Objector = (*PasswordEntryRow)(nil)
	_ gtk.Widgetter     = (*PasswordEntryRow)(nil)
)

func init() {
	coreglib.RegisterClassInfo[*PasswordEntryRow, *PasswordEntryRowClass, PasswordEntryRowOverrides](
		GTypePasswordEntryRow,
		initPasswordEntryRowClass,
		wrapPasswordEntryRow,
		defaultPasswordEntryRowOverrides,
	)
}

func initPasswordEntryRowClass(gclass unsafe.Pointer, overrides PasswordEntryRowOverrides, classInitFunc func(*PasswordEntryRowClass)) {
	if classInitFunc != nil {
		class := (*PasswordEntryRowClass)(gextras.NewStructNative(gclass))
		classInitFunc(class)
	}
}

func wrapPasswordEntryRow(obj *coreglib.Object) *PasswordEntryRow {
	return &PasswordEntryRow{
		EntryRow: EntryRow{
			PreferencesRow: PreferencesRow{
				ListBoxRow: gtk.ListBoxRow{
					Widget: gtk.Widget{
						InitiallyUnowned: coreglib.InitiallyUnowned{
							Object: obj,
						},
						Object: obj,
						Accessible: gtk.Accessible{
							Object: obj,
						},
						Buildable: gtk.Buildable{
							Object: obj,
						},
						ConstraintTarget: gtk.ConstraintTarget{
							Object: obj,
						},
					},
					Object: obj,
					Actionable: gtk.Actionable{
						Widget: gtk.Widget{
							InitiallyUnowned: coreglib.InitiallyUnowned{
								Object: obj,
							},
							Object: obj,
							Accessible: gtk.Accessible{
								Object: obj,
							},
							Buildable: gtk.Buildable{
								Object: obj,
							},
							ConstraintTarget: gtk.ConstraintTarget{
								Object: obj,
							},
						},
					},
				},
			},
			Object: obj,
			EditableTextWidget: gtk.EditableTextWidget{
				Widget: gtk.Widget{
					InitiallyUnowned: coreglib.InitiallyUnowned{
						Object: obj,
					},
					Object: obj,
					Accessible: gtk.Accessible{
						Object: obj,
					},
					Buildable: gtk.Buildable{
						Object: obj,
					},
					ConstraintTarget: gtk.ConstraintTarget{
						Object: obj,
					},
				},
			},
		},
	}
}

func marshalPasswordEntryRow(p uintptr) (interface{}, error) {
	return wrapPasswordEntryRow(coreglib.ValueFromNative(unsafe.Pointer(p)).Object()), nil
}

// NewPasswordEntryRow creates a new AdwPasswordEntryRow.
//
// The function returns the following values:
//
//   - passwordEntryRow: newly created AdwPasswordEntryRow.
func NewPasswordEntryRow() *PasswordEntryRow {
	var _cret *C.GtkWidget // in

	_cret = C.adw_password_entry_row_new()

	var _passwordEntryRow *PasswordEntryRow // out

	_passwordEntryRow = wrapPasswordEntryRow(coreglib.Take(unsafe.Pointer(_cret)))

	return _passwordEntryRow
}
