func clipboardFinalizer(c *Clipboard) {
	runtime.SetFinalizer(c, func(c *Clipboard) { gobject.Unref(c) })
}
Clear Clipboard struct when it goes out of reach
package gtk3
import "C"
import "unsafe"
import "runtime"
import "fmt"
import "github.com/norisatir/go-gtk3/gobject"
import g "github.com/norisatir/go-gtk3/gobject"
import "github.com/norisatir/go-gtk3/gdkpixbuf"
import "github.com/norisatir/go-gtk3/gdk3"
import "github.com/norisatir/go-gtk3/glib"
import "github.com/norisatir/go-gtk3/pango"
func Init() {
	C._gtk_init(nil, nil)
}
func Main() {
	C.gtk_main()
}
func MainQuit() {
	C.gtk_main_quit()
}
func GetCurrentEventDevice() *gdk3.Device {
    if d := C.gtk_get_current_event_device(); d != nil {
        if dev, err := gobject.ConvertToGo(unsafe.Pointer(&d)); err == nil {
            return dev.(*gdk3.Device)
        }
    }
    return nil
}
var _closures map[int64]gobject.ClosureFunc
type P map[string]interface{}
type ButID struct {
	Text     string
	Response int
}
type B []ButID
type V map[int]interface{}
type CollAttr struct {
	Attribute string
	Column    int
}
type A []CollAttr
type StockItem struct {
	StockID           string
	Label             string
	Modifier          int
	Keyval            uint
	TranslationDomain string
}
func NewStockItemFromNative(obj unsafe.Pointer) StockItem {
	si := StockItem{}
	csi := (*C.GtkStockItem)(obj)
	si.StockID = C.GoString((*C.char)(csi.stock_id))
	si.Label = C.GoString((*C.char)(csi.label))
	si.Modifier = int(csi.modifier)
	si.Keyval = uint(csi.keyval)
	si.TranslationDomain = C.GoString((*C.char)(csi.translation_domain))
	return si
}
func (self *StockItem) ToNative() unsafe.Pointer {
	var si C.GtkStockItem
	sId := gobject.GString(self.StockID)
	defer sId.Free()
	si.stock_id = C.g_strdup((*C.gchar)(sId.GetPtr()))
	sLabel := gobject.GString(self.Label)
	defer sLabel.Free()
	si.label = C.g_strdup((*C.gchar)(sLabel.GetPtr()))
	si.modifier = C.GdkModifierType(self.Modifier)
	si.keyval = C.guint(self.Keyval)
	sTD := gobject.GString(self.TranslationDomain)
	defer sTD.Free()
	si.translation_domain = C.g_strdup((*C.gchar)(sTD.GetPtr()))
	return unsafe.Pointer(&si)
}
func StockLookup(stockId string) (bool, StockItem) {
	var ci C.GtkStockItem
	s := gobject.GString(stockId)
	defer s.Free()
	b := C.gtk_stock_lookup((*C.gchar)(s.GetPtr()), &ci)
	gb := gobject.GoBool(unsafe.Pointer(&b))
	return gb, NewStockItemFromNative(unsafe.Pointer(&ci))
}
type WidgetLike interface {
	W() *Widget
	gobject.ObjectLike
}
type ContainerLike interface {
	C() *Container
	WidgetLike
}
type BinLike interface {
	CBin() *Bin
}
type WindowLike interface {
	Wnd() *Window
	ContainerLike
}
type BoxLike interface {
	CBox() *Box
}
type ButtonLike interface {
	B() *Button
}
type DialogLike interface {
	D() *Dialog
}
type RangeLike interface {
	R() *Range
}
type TreeModelLike interface {
	ITreeModel() *TreeModel
}
type CellRendererLike interface {
	CRenderer() *CellRenderer
}
type CellAreaLike interface {
	CArea() *CellArea
}
type CellLayoutLike interface {
	ICellLayout() *CellLayout
}
type ComboLike interface {
	Combo() *ComboBox
}
type MenuShellLike interface {
	MShell() *MenuShell
}
type MenuItemLike interface {
	MItem() *MenuItem
}
type OrientableLike interface {
	IOrientable() *Orientable
}
type EntryLike interface {
	E() *Entry
}
type AccelGroup struct {
	object *C.GtkAccelGroup
}
func NewAccelGroup() *AccelGroup {
	ag := &AccelGroup{}
	ag.object = C.gtk_accel_group_new()
	if gobject.IsObjectFloating(ag) {
		gobject.RefSink(ag)
	} else {
		gobject.Ref(ag)
	}
	accelGroupFinalizer(ag)
	return ag
}
func AccelGroupsActivate(obj gobject.ObjectLike, accelKey uint, gdk_modifier int) bool {
	o := C.to_GObject(obj.ToNative())
	b := C.gtk_accel_groups_activate(o, C.guint(accelKey), C.GdkModifierType(gdk_modifier))
	return gobject.GoBool(unsafe.Pointer(&b))
}
func AccelGroupsFromObject(obj gobject.ObjectLike) *glib.GSList {
	o := C.to_GObject(obj.ToNative())
	clist := C.gtk_accel_groups_from_object(o)
	if clist == nil {
		return nil
	}
	goList := glib.NewGSListFromNative(unsafe.Pointer(clist))
	goList.ConversionFunc = newAccelGroupFromNative
	return goList
}
func accelGroupFinalizer(ag *AccelGroup) {
	runtime.SetFinalizer(ag, func(ag *AccelGroup) { gobject.Unref(ag) })
}
func newAccelGroupFromNative(obj unsafe.Pointer) interface{} {
	ag := &AccelGroup{}
	ag.object = C.to_GtkAccelGroup(obj)
	if gobject.IsObjectFloating(ag) {
		gobject.RefSink(ag)
	} else {
		gobject.Ref(ag)
	}
	accelGroupFinalizer(ag)
	return ag
}
func nativeFromAccelGroup(ag interface{}) *gobject.GValue {
	accel, ok := ag.(*AccelGroup)
	if ok {
		gv := gobject.CreateCGValue(GtkType.ACCEL_GROUP, accel.ToNative())
		return gv
	}
	return nil
}
func (self AccelGroup) ToNative() unsafe.Pointer {
	return unsafe.Pointer(self.object)
}
func (self AccelGroup) Connect(name string, f interface{}, data ...interface{}) (*gobject.ClosureElement, *gobject.SignalError) {
	return gobject.Connect(self, name, f, data...)
}
func (self AccelGroup) Set(properties map[string]interface{}) {
	gobject.Set(self, properties)
}
func (self AccelGroup) Get(properties []string) map[string]interface{} {
	return gobject.Get(self, properties)
}
func (self *AccelGroup) ConnectAccel(accelKey uint, gtk_Modifier, gtk_AccelFlags int, f interface{}, data ...interface{}) {
	call, id := gobject.CreateCustomClosure(f, data...)
	_closures[id] = call
	gClosure := C._go_new_closure(C.gint64(id))
	C.gtk_accel_group_connect(self.object, C.guint(accelKey), C.GdkModifierType(gtk_Modifier),
		C.GtkAccelFlags(gtk_AccelFlags), gClosure)
}
func (self *AccelGroup) ConnectByPath(accelPath string, f interface{}, data ...interface{}) {
	call, id := gobject.CreateCustomClosure(f, data...)
	_closures[id] = call
	gClosure := C._go_new_closure(C.gint64(id))
	path := gobject.GString(accelPath)
	defer path.Free()
	C.gtk_accel_group_connect_by_path(self.object, (*C.gchar)(path.GetPtr()), gClosure)
}
func (self *AccelGroup) DisconectKey(accelKey uint, gdk_modifier int) bool {
	b := C.gtk_accel_group_disconnect_key(self.object, C.guint(accelKey), C.GdkModifierType(gdk_modifier))
	return gobject.GoBool(unsafe.Pointer(&b))
}
func (self *AccelGroup) Lock() {
	C.gtk_accel_group_lock(self.object)
}
func (self *AccelGroup) UnLock() {
	C.gtk_accel_group_unlock(self.object)
}
func (self *AccelGroup) GetIsLocked() bool {
	b := C.gtk_accel_group_get_is_locked(self.object)
	return gobject.GoBool(unsafe.Pointer(&b))
}
func (self *AccelGroup) GetModifierMask() int {
	return int(C.gtk_accel_group_get_modifier_mask(self.object))
}
type Clipboard struct {
	object *C.GtkClipboard
}
func ClipboardGet(atom gdk3.Atom) *Clipboard {
	if atom.ToNative() == nil {
		return nil
	}
	c := &Clipboard{}
	c.object = C.gtk_clipboard_get(*((*C.GdkAtom)(atom.ToNative())))
	gobject.Ref(c)
	clipboardFinalizer(c)
	return c
}
func ClipboardGetForDisplay(display *gdk3.Display, atom gdk3.Atom) *Clipboard {
	if display == nil || atom.ToNative() == nil {
		return nil
	}
	c := &Clipboard{}
	c.object = C.gtk_clipboard_get_for_display((*C.GdkDisplay)(display.ToNative()), *((*C.GdkAtom)(atom.ToNative())))
	gobject.Ref(c)
	clipboardFinalizer(c)
	return c
}
func newClipboardFromNative(obj unsafe.Pointer) interface{} {
	c := &Clipboard{}
	c.object = C.to_GtkClipboard(obj)
	gobject.Ref(c)
	clipboardFinalizer(c)
	return c
}