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)
9
10const (
11 // Like [func@get_binary_age], but from the headers used at
12 // application compile time, rather than from the library linked
13 // against at application run time.
14 BINARY_AGE int = 2002
15 // Like [func@get_interface_age], but from the headers used at
16 // application compile time, rather than from the library linked
17 // against at application run time.
18 INTERFACE_AGE int = 2
19 // Like [func@get_major_version], but from the headers used at
20 // application compile time, rather than from the library linked
21 // against at application run time.
22 MAJOR_VERSION int = 4
23 // Like [func@get_micro_version], but from the headers used at
24 // application compile time, rather than from the library linked
25 // against at application run time.
26 MICRO_VERSION int = 2
27 // Like [func@get_minor_version], but from the headers used at
28 // application compile time, rather than from the library linked
29 // against at application run time.
30 MINOR_VERSION int = 20
31)
32
33var xCheckVersion func(uint, uint, uint) string
34
35// Checks that the GTK library in use is compatible with the
36// given version.
37//
38// Generally you would pass in the constants %GTK_MAJOR_VERSION,
39// %GTK_MINOR_VERSION, %GTK_MICRO_VERSION as the three arguments
40// to this function; that produces a check that the library in
41// use is compatible with the version of GTK the application or
42// module was compiled against.
43//
44// Compatibility is defined by two things: first the version
45// of the running library is newer than the version
46// @required_major.required_minor.@required_micro. Second
47// the running library must be binary compatible with the
48// version @required_major.required_minor.@required_micro
49// (same major version.)
50//
51// This function is primarily for GTK modules; the module
52// can call this function to check that it wasn’t loaded
53// into an incompatible version of GTK. However, such a
54// check isn’t completely reliable, since the module may be
55// linked against an old version of GTK and calling the
56// old version of gtk_check_version(), but still get loaded
57// into an application using a newer version of GTK.
58func CheckVersion(RequiredMajorVar uint, RequiredMinorVar uint, RequiredMicroVar uint) string {
59
60 cret := xCheckVersion(RequiredMajorVar, RequiredMinorVar, RequiredMicroVar)
61 return cret
62}
63
64var xGetBinaryAge func() uint
65
66// Returns the binary age as passed to `libtool`.
67//
68// If `libtool` means nothing to you, don't worry about it.
69func GetBinaryAge() uint {
70
71 cret := xGetBinaryAge()
72 return cret
73}
74
75var xGetInterfaceAge func() uint
76
77// Returns the interface age as passed to `libtool`.
78//
79// If `libtool` means nothing to you, don't worry about it.
80func GetInterfaceAge() uint {
81
82 cret := xGetInterfaceAge()
83 return cret
84}
85
86var xGetMajorVersion func() uint
87
88// Returns the major version number of the GTK library.
89//
90// For example, in GTK version 3.1.5 this is 3.
91//
92// This function is in the library, so it represents the GTK library
93// your code is running against. Contrast with the %GTK_MAJOR_VERSION
94// macro, which represents the major version of the GTK headers you
95// have included when compiling your code.
96func GetMajorVersion() uint {
97
98 cret := xGetMajorVersion()
99 return cret
100}
101
102var xGetMicroVersion func() uint
103
104// Returns the micro version number of the GTK library.
105//
106// For example, in GTK version 3.1.5 this is 5.
107//
108// This function is in the library, so it represents the GTK library
109// your code is are running against. Contrast with the
110// %GTK_MICRO_VERSION macro, which represents the micro version of the
111// GTK headers you have included when compiling your code.
112func GetMicroVersion() uint {
113
114 cret := xGetMicroVersion()
115 return cret
116}
117
118var xGetMinorVersion func() uint
119
120// Returns the minor version number of the GTK library.
121//
122// For example, in GTK version 3.1.5 this is 1.
123//
124// This function is in the library, so it represents the GTK library
125// your code is are running against. Contrast with the
126// %GTK_MINOR_VERSION macro, which represents the minor version of the
127// GTK headers you have included when compiling your code.
128func GetMinorVersion() uint {
129
130 cret := xGetMinorVersion()
131 return cret
132}
133
134func init() {
135 core.SetPackageName("GTK", "gtk4")
136 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
137 var libs []uintptr
138 for _, libPath := range core.GetPaths("GTK") {
139 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
140 if err != nil {
141 panic(err)
142 }
143 libs = append(libs, lib)
144 }
145
146 core.PuregoSafeRegister(&xCheckVersion, libs, "gtk_check_version")
147 core.PuregoSafeRegister(&xGetBinaryAge, libs, "gtk_get_binary_age")
148 core.PuregoSafeRegister(&xGetInterfaceAge, libs, "gtk_get_interface_age")
149 core.PuregoSafeRegister(&xGetMajorVersion, libs, "gtk_get_major_version")
150 core.PuregoSafeRegister(&xGetMicroVersion, libs, "gtk_get_micro_version")
151 core.PuregoSafeRegister(&xGetMinorVersion, libs, "gtk_get_minor_version")
152
153}