gtkorientable.go RawHistoryFolder
1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5 "structs"
6 "unsafe"
7
8 "github.com/ebitengine/purego"
9
10 "github.com/bnema/puregotk/pkg/core"
11 "github.com/bnema/puregotk/v4/gobject/types"
12)
13
14type OrientableIface struct {
15 _ structs.HostLayout
16
17 BaseIface uintptr
18}
19
20func (x *OrientableIface) GoPointer() uintptr {
21 return uintptr(unsafe.Pointer(x))
22}
23
24// An interface for widgets that can be oriented horizontally or vertically.
25//
26// `GtkOrientable` is more flexible in that it allows the orientation to be
27// changed at runtime, allowing the widgets to “flip”.
28//
29// ## CSS nodes
30//
31// `GtkWidget` types implementing the `GtkOrientable` interface will
32// automatically acquire the `horizontal` or `vertical` CSS class depending on
33// the value of the [property@Gtk.Orientable:orientation] property.
34type Orientable interface {
35 GoPointer() uintptr
36 SetGoPointer(uintptr)
37 GetOrientation() Orientation
38 SetOrientation(OrientationVar Orientation)
39}
40
41var xOrientableGLibType func() types.GType
42
43func OrientableGLibType() types.GType {
44 return xOrientableGLibType()
45}
46
47type OrientableBase struct {
48 Ptr uintptr
49}
50
51func (x *OrientableBase) GoPointer() uintptr {
52 if x == nil {
53 return 0
54 }
55 return x.Ptr
56}
57
58func (x *OrientableBase) SetGoPointer(ptr uintptr) {
59 x.Ptr = ptr
60}
61
62// Retrieves the orientation of the @orientable.
63func (x *OrientableBase) GetOrientation() Orientation {
64
65 cret := XGtkOrientableGetOrientation(x.GoPointer())
66 return cret
67}
68
69// Sets the orientation of the @orientable.
70func (x *OrientableBase) SetOrientation(OrientationVar Orientation) {
71
72 XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar)
73
74}
75
76var XGtkOrientableGetOrientation func(uintptr) Orientation
77var XGtkOrientableSetOrientation func(uintptr, Orientation)
78
79func init() {
80 core.SetPackageName("GTK", "gtk4")
81 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
82 var libs []uintptr
83 for _, libPath := range core.GetPaths("GTK") {
84 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
85 if err != nil {
86 panic(err)
87 }
88 libs = append(libs, lib)
89 }
90
91 core.PuregoSafeRegister(&xOrientableGLibType, libs, "gtk_orientable_get_type")
92
93 core.PuregoSafeRegister(&XGtkOrientableGetOrientation, libs, "gtk_orientable_get_orientation")
94 core.PuregoSafeRegister(&XGtkOrientableSetOrientation, libs, "gtk_orientable_set_orientation")
95
96}