gtkcellrendererpixbuf.go RawHistoryFolder
1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5 "github.com/ebitengine/purego"
6
7 "github.com/bnema/puregotk/pkg/core"
8 "github.com/bnema/puregotk/v4/gobject"
9 "github.com/bnema/puregotk/v4/gobject/types"
10)
11
12// Renders a pixbuf in a cell
13//
14// A `GtkCellRendererPixbuf` can be used to render an image in a cell. It allows
15// to render either a given `GdkPixbuf` (set via the
16// `GtkCellRendererPixbuf:pixbuf` property) or a named icon (set via the
17// `GtkCellRendererPixbuf:icon-name` property).
18//
19// To support the tree view, `GtkCellRendererPixbuf` also supports rendering two
20// alternative pixbufs, when the `GtkCellRenderer:is-expander` property is %TRUE.
21// If the `GtkCellRenderer:is-expanded property` is %TRUE and the
22// `GtkCellRendererPixbuf:pixbuf-expander-open` property is set to a pixbuf, it
23// renders that pixbuf, if the `GtkCellRenderer:is-expanded` property is %FALSE
24// and the `GtkCellRendererPixbuf:pixbuf-expander-closed` property is set to a
25// pixbuf, it renders that one.
26type CellRendererPixbuf struct {
27 CellRenderer
28}
29
30var xCellRendererPixbufGLibType func() types.GType
31
32func CellRendererPixbufGLibType() types.GType {
33 return xCellRendererPixbufGLibType()
34}
35
36func CellRendererPixbufNewFromInternalPtr(ptr uintptr) *CellRendererPixbuf {
37 cls := &CellRendererPixbuf{}
38 cls.Ptr = ptr
39 return cls
40}
41
42var xNewCellRendererPixbuf func() uintptr
43
44// Creates a new `GtkCellRendererPixbuf`. Adjust rendering
45// parameters using object properties. Object properties can be set
46// globally (with g_object_set()). Also, with `GtkTreeViewColumn`, you
47// can bind a property to a value in a `GtkTreeModel`. For example, you
48// can bind the “pixbuf” property on the cell renderer to a pixbuf value
49// in the model, thus rendering a different image in each row of the
50// `GtkTreeView`.
51func NewCellRendererPixbuf() *CellRendererPixbuf {
52 var cls *CellRendererPixbuf
53
54 cret := xNewCellRendererPixbuf()
55
56 if cret == 0 {
57 return nil
58 }
59 gobject.IncreaseRef(cret)
60 cls = &CellRendererPixbuf{}
61 cls.Ptr = cret
62 return cls
63}
64
65func (c *CellRendererPixbuf) GoPointer() uintptr {
66 if c == nil {
67 return 0
68 }
69 return c.Ptr
70}
71
72func (c *CellRendererPixbuf) SetGoPointer(ptr uintptr) {
73 c.Ptr = ptr
74}
75
76// SetPropertyIconName sets the "icon-name" property.
77// The name of the themed icon to display.
78// This property only has an effect if not overridden by the "pixbuf" property.
79func (x *CellRendererPixbuf) SetPropertyIconName(value string) {
80 var v gobject.Value
81 v.Init(gobject.TypeStringVal)
82 v.SetString(&value)
83 x.SetProperty("icon-name", &v)
84}
85
86// GetPropertyIconName gets the "icon-name" property.
87// The name of the themed icon to display.
88// This property only has an effect if not overridden by the "pixbuf" property.
89func (x *CellRendererPixbuf) GetPropertyIconName() string {
90 var v gobject.Value
91 x.GetProperty("icon-name", &v)
92 return v.GetString()
93}
94
95func init() {
96 core.SetPackageName("GTK", "gtk4")
97 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
98 var libs []uintptr
99 for _, libPath := range core.GetPaths("GTK") {
100 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
101 if err != nil {
102 panic(err)
103 }
104 libs = append(libs, lib)
105 }
106
107 core.PuregoSafeRegister(&xCellRendererPixbufGLibType, libs, "gtk_cell_renderer_pixbuf_get_type")
108
109 core.PuregoSafeRegister(&xNewCellRendererPixbuf, libs, "gtk_cell_renderer_pixbuf_new")
110
111}