// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gtk import ( "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) // Renders numbers as progress bars // // `GtkCellRendererProgress` renders a numeric value as a progress par in a cell. // Additionally, it can display a text on top of the progress bar. type CellRendererProgress struct { CellRenderer } var xCellRendererProgressGLibType func() types.GType func CellRendererProgressGLibType() types.GType { return xCellRendererProgressGLibType() } func CellRendererProgressNewFromInternalPtr(ptr uintptr) *CellRendererProgress { cls := &CellRendererProgress{} cls.Ptr = ptr return cls } var xNewCellRendererProgress func() uintptr // Creates a new `GtkCellRendererProgress`. func NewCellRendererProgress() *CellRendererProgress { var cls *CellRendererProgress cret := xNewCellRendererProgress() if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &CellRendererProgress{} cls.Ptr = cret return cls } func (c *CellRendererProgress) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *CellRendererProgress) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyInverted sets the "inverted" property. // Whether progess is inverted. func (x *CellRendererProgress) SetPropertyInverted(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("inverted", &v) } // GetPropertyInverted gets the "inverted" property. // Whether progess is inverted. func (x *CellRendererProgress) GetPropertyInverted() bool { var v gobject.Value x.GetProperty("inverted", &v) return v.GetBoolean() } // SetPropertyPulse sets the "pulse" property. // Setting this to a non-negative value causes the cell renderer to // enter "activity mode", where a block bounces back and forth to // indicate that some progress is made, without specifying exactly how // much. // // Each increment of the property causes the block to move by a little // bit. // // To indicate that the activity has not started yet, set the property // to zero. To indicate completion, set the property to %G_MAXINT. func (x *CellRendererProgress) SetPropertyPulse(value int) { var v gobject.Value v.Init(gobject.TypeIntVal) v.SetInt(value) x.SetProperty("pulse", &v) } // GetPropertyPulse gets the "pulse" property. // Setting this to a non-negative value causes the cell renderer to // enter "activity mode", where a block bounces back and forth to // indicate that some progress is made, without specifying exactly how // much. // // Each increment of the property causes the block to move by a little // bit. // // To indicate that the activity has not started yet, set the property // to zero. To indicate completion, set the property to %G_MAXINT. func (x *CellRendererProgress) GetPropertyPulse() int { var v gobject.Value x.GetProperty("pulse", &v) return v.GetInt() } // SetPropertyText sets the "text" property. // The "text" property determines the label which will be drawn // over the progress bar. Setting this property to %NULL causes the default // label to be displayed. Setting this property to an empty string causes // no label to be displayed. func (x *CellRendererProgress) SetPropertyText(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("text", &v) } // GetPropertyText gets the "text" property. // The "text" property determines the label which will be drawn // over the progress bar. Setting this property to %NULL causes the default // label to be displayed. Setting this property to an empty string causes // no label to be displayed. func (x *CellRendererProgress) GetPropertyText() string { var v gobject.Value x.GetProperty("text", &v) return v.GetString() } // SetPropertyTextXalign sets the "text-xalign" property. // The "text-xalign" property controls the horizontal alignment of the // text in the progress bar. Valid values range from 0 (left) to 1 // (right). Reserved for RTL layouts. func (x *CellRendererProgress) SetPropertyTextXalign(value float32) { var v gobject.Value v.Init(gobject.TypeFloatVal) v.SetFloat(value) x.SetProperty("text-xalign", &v) } // GetPropertyTextXalign gets the "text-xalign" property. // The "text-xalign" property controls the horizontal alignment of the // text in the progress bar. Valid values range from 0 (left) to 1 // (right). Reserved for RTL layouts. func (x *CellRendererProgress) GetPropertyTextXalign() float32 { var v gobject.Value x.GetProperty("text-xalign", &v) return v.GetFloat() } // SetPropertyTextYalign sets the "text-yalign" property. // The "text-yalign" property controls the vertical alignment of the // text in the progress bar. Valid values range from 0 (top) to 1 // (bottom). func (x *CellRendererProgress) SetPropertyTextYalign(value float32) { var v gobject.Value v.Init(gobject.TypeFloatVal) v.SetFloat(value) x.SetProperty("text-yalign", &v) } // GetPropertyTextYalign gets the "text-yalign" property. // The "text-yalign" property controls the vertical alignment of the // text in the progress bar. Valid values range from 0 (top) to 1 // (bottom). func (x *CellRendererProgress) GetPropertyTextYalign() float32 { var v gobject.Value x.GetProperty("text-yalign", &v) return v.GetFloat() } // SetPropertyValue sets the "value" property. // The "value" property determines the percentage to which the // progress bar will be "filled in". func (x *CellRendererProgress) SetPropertyValue(value int) { var v gobject.Value v.Init(gobject.TypeIntVal) v.SetInt(value) x.SetProperty("value", &v) } // GetPropertyValue gets the "value" property. // The "value" property determines the percentage to which the // progress bar will be "filled in". func (x *CellRendererProgress) GetPropertyValue() int { var v gobject.Value x.GetProperty("value", &v) return v.GetInt() } // Retrieves the orientation of the @orientable. func (x *CellRendererProgress) GetOrientation() Orientation { cret := XGtkOrientableGetOrientation(x.GoPointer()) return cret } // Sets the orientation of the @orientable. func (x *CellRendererProgress) SetOrientation(OrientationVar Orientation) { XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar) } func init() { core.SetPackageName("GTK", "gtk4") core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"}) var libs []uintptr for _, libPath := range core.GetPaths("GTK") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xCellRendererProgressGLibType, libs, "gtk_cell_renderer_progress_get_type") core.PuregoSafeRegister(&xNewCellRendererProgress, libs, "gtk_cell_renderer_progress_new") }