initial commit
- commit
- 7d292f29a68fd087b8058504ca73618ab33315eb
- author
- jwijenbergh · · 2023-06-17 08:52 UTC
- committer
- jwijenbergh · · 2023-08-15 10:50 UTC
- parent
- none (root commit)
- signature
- GPG Unverified
1A2298F6C34F96E5The key is unknown
696 files · +745353 -0
A LICENSE +21 -0
| @@ -0,0 +1,21 @@ | |||
| 1 | + | MIT License | |
| 2 | + | ||
| 3 | + | Copyright (c) 2023 Jeroen Wijenbergh | |
| 4 | + | ||
| 5 | + | Permission is hereby granted, free of charge, to any person obtaining a copy | |
| 6 | + | of this software and associated documentation files (the "Software"), to deal | |
| 7 | + | in the Software without restriction, including without limitation the rights | |
| 8 | + | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| 9 | + | copies of the Software, and to permit persons to whom the Software is | |
| 10 | + | furnished to do so, subject to the following conditions: | |
| 11 | + | ||
| 12 | + | The above copyright notice and this permission notice shall be included in all | |
| 13 | + | copies or substantial portions of the Software. | |
| 14 | + | ||
| 15 | + | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 16 | + | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 17 | + | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
| 18 | + | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 19 | + | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
| 20 | + | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
| 21 | + | SOFTWARE. | |
A README.md +95 -0
| @@ -0,0 +1,95 @@ | |||
| 1 | + | # Puregotk | |
| 2 | + | ||
| 3 | + | > **_NOTE:_** This library is currently expiremental and needs thorough testing. Some APIs might be incorrectly exposed | |
| 4 | + | ||
| 5 | + | Autogenerated GTK4+Adwaita bindings for Go leveraging [purego](https://github.com/ebitengine/purego) | |
| 6 | + | ||
| 7 | + | # Motivation | |
| 8 | + | I created this library because I found that alternative libraries using Cgo had much too slow compilation speed. For my laptop around 15 minutes to build a simple example for [gotk3](https://github.com/gotk3/gotk3) and also [gotk4](https://github.com/diamondburned/gotk4). | |
| 9 | + | This is not a fault for these libraries as CGo compilation is just inherently slow in Go. In this project I want to test a new approach by levering purego which allows you to load libraries using dlopen without needing cgo. | |
| 10 | + | ||
| 11 | + | Compilation speed currently is around 40 seconds for me on basic examples. | |
| 12 | + | ||
| 13 | + | ## Advantages | |
| 14 | + | ||
| 15 | + | No Cgo needed, thus: | |
| 16 | + | * Easy cross compilation | |
| 17 | + | * No C toolchain needed | |
| 18 | + | * Much faster compile times than alternatives like [gotk3](https://github.com/gotk3/gotk3) & [gotk4](https://github.com/diamondburned/gotk4) | |
| 19 | + | ||
| 20 | + | ## Disadvantages | |
| 21 | + | ||
| 22 | + | Limitations of this library as compared to the alternatives using cgo: | |
| 23 | + | * Some APIs are not possible due to purego not currently supporting struct arguments (that are not pointers) | |
| 24 | + | * Currently only support for x86, for ARM I need to figure out how to get callbacks working in purego and contribute to purego | |
| 25 | + | ||
| 26 | + | # Planned features | |
| 27 | + | In order of priority: | |
| 28 | + | * General code cleanup | |
| 29 | + | * ARM support | |
| 30 | + | * Support for OS other than Linux (I only test on Linux currently) | |
| 31 | + | * GTK 3 support | |
| 32 | + | ||
| 33 | + | # Basic example | |
| 34 | + | ||
| 35 | + | ```go | |
| 36 | + | package main | |
| 37 | + | ||
| 38 | + | import ( | |
| 39 | + | "os" | |
| 40 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 41 | + | "github.com/jwijenbergh/puregotk/v4/gio" | |
| 42 | + | ) | |
| 43 | + | ||
| 44 | + | func main() { | |
| 45 | + | app := gtk.NewApplication("com.github.jwijenbergh.puregotk.gtk4.hello", gio.GApplicationFlagsNoneValue) | |
| 46 | + | defer app.Unref() | |
| 47 | + | app.ConnectActivate(func (_ gio.Application) { | |
| 48 | + | activate(app) | |
| 49 | + | }) | |
| 50 | + | ||
| 51 | + | if code := app.Run(len(os.Args), os.Args); code > 0 { | |
| 52 | + | os.Exit(code) | |
| 53 | + | } | |
| 54 | + | } | |
| 55 | + | ||
| 56 | + | func activate(app gtk.Application) { | |
| 57 | + | var window gtk.ApplicationWindow | |
| 58 | + | gtk.NewApplicationWindow(app).Cast(&window) | |
| 59 | + | window.SetTitle("purego") | |
| 60 | + | window.SetChild(gtk.NewLabel("Hello, World!")) | |
| 61 | + | window.SetDefaultSize(500, 500) | |
| 62 | + | window.Show() | |
| 63 | + | } | |
| 64 | + | ``` | |
| 65 | + | ||
| 66 | + | Save this to a main.go and then build & run with | |
| 67 | + | ||
| 68 | + | ```bash | |
| 69 | + | CGO_ENABLED=0 go run main.go | |
| 70 | + | ``` | |
| 71 | + | ||
| 72 | + | > **_NOTE:_** Passing CGO_ENABLED=0 is currently required | |
| 73 | + | ||
| 74 | + | # Generating the library | |
| 75 | + | This library is automatically generated by reading GIR files. | |
| 76 | + | ||
| 77 | + | To generate the library, run: | |
| 78 | + | ||
| 79 | + | ```bash | |
| 80 | + | ./gen.sh | |
| 81 | + | ``` | |
| 82 | + | ||
| 83 | + | In the root of the project. This needs: | |
| 84 | + | ||
| 85 | + | - Go >= 1.20 | |
| 86 | + | - [goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports) | |
| 87 | + | ||
| 88 | + | # License | |
| 89 | + | ||
| 90 | + | [MIT](./LICENSE) | |
| 91 | + | ||
| 92 | + | # Acknowledgements | |
| 93 | + | * [Purego](https://github.com/ebitengine/purego) and the ebitengine team for their great work | |
| 94 | + | * [gotk4](https://github.com/diamondburned/gotk4) for some GIR type definitions | |
| 95 | + | * [gtk](https://gitlab.com/gnome/gtk) of course | |
A gen.go +47 -0
| @@ -0,0 +1,47 @@ | |||
| 1 | + | package main | |
| 2 | + | ||
| 3 | + | import ( | |
| 4 | + | "os" | |
| 5 | + | "path/filepath" | |
| 6 | + | "strings" | |
| 7 | + | "text/template" | |
| 8 | + | ||
| 9 | + | "github.com/jwijenbergh/puregotk/internal/gir/pass" | |
| 10 | + | "github.com/jwijenbergh/puregotk/internal/gir/util" | |
| 11 | + | ) | |
| 12 | + | ||
| 13 | + | //go:generate go run gen.go | |
| 14 | + | ||
| 15 | + | func main() { | |
| 16 | + | dir := "v4" | |
| 17 | + | os.RemoveAll(dir) | |
| 18 | + | var girs []string | |
| 19 | + | filepath.Walk("internal/gir/spec", func(path string, f os.FileInfo, err error) error { | |
| 20 | + | if !strings.HasSuffix(path, ".gir") { | |
| 21 | + | return nil | |
| 22 | + | } | |
| 23 | + | girs = append(girs, path) | |
| 24 | + | return nil | |
| 25 | + | }) | |
| 26 | + | p, err := pass.New(girs) | |
| 27 | + | if err != nil { | |
| 28 | + | panic(err) | |
| 29 | + | } | |
| 30 | + | // collect basic type info | |
| 31 | + | p.First() | |
| 32 | + | ||
| 33 | + | // Create the template | |
| 34 | + | gotemp, err := template.New("go").Funcs(template.FuncMap{"conv": util.ConvertArgs, "convc": util.ConvertArgsComma}).ParseFiles("templates/go") | |
| 35 | + | if err != nil { | |
| 36 | + | panic(err) | |
| 37 | + | } | |
| 38 | + | ||
| 39 | + | // Write go files by making the second pass | |
| 40 | + | p.Second(dir, gotemp) | |
| 41 | + | ||
| 42 | + | // Finally copy some extra code that we want in the API | |
| 43 | + | data, err := os.ReadFile("templates/gobject") | |
| 44 | + | if err == nil { | |
| 45 | + | os.WriteFile("v4/gobject/more.go", data, 0o644) | |
| 46 | + | } | |
| 47 | + | } | |
A gen.sh +18 -0
| @@ -0,0 +1,18 @@ | |||
| 1 | + | #!/usr/bin/env bash | |
| 2 | + | ||
| 3 | + | set -e | |
| 4 | + | ||
| 5 | + | echo "generating go files..." | |
| 6 | + | go generate | |
| 7 | + | ||
| 8 | + | tmp=$(mktemp -d) | |
| 9 | + | ||
| 10 | + | echo "making sure imports are correct..." | |
| 11 | + | GOPATH="$tmp" goimports --srcdir . -w v4 || { rm -r "$tmp"; exit 1; } | |
| 12 | + | rm -r "$tmp" | |
| 13 | + | ||
| 14 | + | echo "formatting files..." | |
| 15 | + | go fmt "github.com/jwijenbergh/puregotk/v4/..." | |
| 16 | + | ||
| 17 | + | echo "running go vet..." | |
| 18 | + | go vet ./v4/... | |
A go.mod +7 -0
| @@ -0,0 +1,7 @@ | |||
| 1 | + | module github.com/jwijenbergh/puregotk | |
| 2 | + | ||
| 3 | + | go 1.20 | |
| 4 | + | ||
| 5 | + | require github.com/jwijenbergh/purego v0.0.0-20230815104821-b26146068cfb | |
| 6 | + | ||
| 7 | + | require golang.org/x/sys v0.11.0 // indirect | |
A go.sum +4 -0 generated file: collapsed
A internal/core/core.go +138 -0
| @@ -0,0 +1,138 @@ | |||
| 1 | + | // package core implements core functionality for the generated files | |
| 2 | + | // this core lib is imported by the generated code | |
| 3 | + | package core | |
| 4 | + | ||
| 5 | + | import ( | |
| 6 | + | "bytes" | |
| 7 | + | "fmt" | |
| 8 | + | "os" | |
| 9 | + | "os/exec" | |
| 10 | + | "path/filepath" | |
| 11 | + | "strings" | |
| 12 | + | ||
| 13 | + | "github.com/jwijenbergh/purego" | |
| 14 | + | ) | |
| 15 | + | ||
| 16 | + | func PuregoSafeRegister(fptr interface{}, handle uintptr, name string) error { | |
| 17 | + | sym, err := purego.Dlsym(handle, name) | |
| 18 | + | if err != nil { | |
| 19 | + | return err | |
| 20 | + | } | |
| 21 | + | purego.RegisterFunc(fptr, sym) | |
| 22 | + | return nil | |
| 23 | + | } | |
| 24 | + | ||
| 25 | + | // paths to where the shared object files should be located | |
| 26 | + | // TODO: This needs to be split in architecture and more paths should be added | |
| 27 | + | var paths = []string{ | |
| 28 | + | "/usr/lib/x86_64-linux-gnu/", | |
| 29 | + | } | |
| 30 | + | ||
| 31 | + | // names is a lookup from library names to shared object filenames | |
| 32 | + | var names = map[string][]string{ | |
| 33 | + | "ADW": {"libadwaita-1.so"}, | |
| 34 | + | "CAIRO": {"libcairo.so"}, | |
| 35 | + | "GDK": {"libgtk-4.so"}, | |
| 36 | + | "GDKPIXBUF": {"libgdk_pixbuf-2.0.so"}, | |
| 37 | + | "GIO": {"libgio-2.0.so"}, | |
| 38 | + | "GLIB": {"libglib-2.0.so"}, | |
| 39 | + | "GMODULE": {"libgmodule-2.0.so"}, | |
| 40 | + | "GOBJECT": {"libgobject-2.0.so"}, | |
| 41 | + | "GRAPHENE": {"libgraphene-1.0.so"}, | |
| 42 | + | "GSK": {"libgtk-4.so"}, | |
| 43 | + | "GTK": {"libgtk-4.so"}, | |
| 44 | + | "PANGO": {"libpango-1.0.so"}, | |
| 45 | + | "PANGOCAIRO": {"libpangocairo-1.0.so"}, | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | // pkgConfNames is a lookup from library names to pkg-config library names | |
| 49 | + | // TODO: Get this from the package name in the gir files with a fallback to gtk's package name | |
| 50 | + | var pkgConfNames = map[string]string{ | |
| 51 | + | "ADW": "libadwaita-1", | |
| 52 | + | "CAIRO": "cairo", | |
| 53 | + | "GDK": "gtk4", | |
| 54 | + | "GDKPIXBUF": "gdk-pixbuf-2.0", | |
| 55 | + | "GIO": "gio-2.0", | |
| 56 | + | "GLIB": "glib-2.0", | |
| 57 | + | "GMODULE": "gmodule-2.0", | |
| 58 | + | "GOBJECT": "gobject-2.0", | |
| 59 | + | "GRAPHENE": "graphene-gobject-1.0", | |
| 60 | + | "GSK": "gtk4", | |
| 61 | + | "GTK": "gtk4", | |
| 62 | + | "PANGO": "pango", | |
| 63 | + | "PANGOCAIRO": "pangocairo", | |
| 64 | + | } | |
| 65 | + | ||
| 66 | + | // findSo tries to find a shared object from a path and a library name | |
| 67 | + | // It does this by mapping the library name to a suitable shared object filename and then trying some suffixes | |
| 68 | + | func findSo(path string, name string) string { | |
| 69 | + | for _, n := range names[name] { | |
| 70 | + | suffixes := []string{"", ".0", ".1", ".2"} | |
| 71 | + | fn := filepath.Join(path, n) | |
| 72 | + | for _, s := range suffixes { | |
| 73 | + | if _, err := os.Stat(fn + s); err == nil { | |
| 74 | + | return fn | |
| 75 | + | } | |
| 76 | + | } | |
| 77 | + | } | |
| 78 | + | return "" | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | // findPkgConf finds a shared object file with pkg-config | |
| 82 | + | // it does this by running pkg-config --libs-only-L libname | |
| 83 | + | // and then it loops over the directories returned and finds a suitable one | |
| 84 | + | func findPkgConf(name string) string { | |
| 85 | + | // try to get with pkg-config | |
| 86 | + | cmd := exec.Command("pkg-config", "--libs-only-L", pkgConfNames[name]) | |
| 87 | + | var out, outerr bytes.Buffer | |
| 88 | + | cmd.Stdout = &out | |
| 89 | + | cmd.Stderr = &outerr | |
| 90 | + | err := cmd.Run() | |
| 91 | + | if err != nil { | |
| 92 | + | fmt.Fprintf(os.Stderr, "pkg-config, failed with: %v and stderr: %s\n", err, outerr.String()) | |
| 93 | + | return "" | |
| 94 | + | } | |
| 95 | + | outs := strings.Split(out.String(), "-L") | |
| 96 | + | for _, v := range outs { | |
| 97 | + | c := strings.TrimSpace(v) | |
| 98 | + | if c == "" { | |
| 99 | + | continue | |
| 100 | + | } | |
| 101 | + | g := findSo(c, name) | |
| 102 | + | if g != "" { | |
| 103 | + | return g | |
| 104 | + | } | |
| 105 | + | } | |
| 106 | + | return "" | |
| 107 | + | } | |
| 108 | + | ||
| 109 | + | // GetPath gets a shared object file from a library name | |
| 110 | + | // it does it in the following order | |
| 111 | + | // see if PUREGOTK_LIBNAME_PATH is set | |
| 112 | + | // go over the hardcoded paths | |
| 113 | + | // find a library name with pkg-config | |
| 114 | + | // panic if failed | |
| 115 | + | // TODO: Hardcore a library shared object with linker -X flag | |
| 116 | + | // This is useful for packaging | |
| 117 | + | func GetPath(name string) string { | |
| 118 | + | // try to get from env var | |
| 119 | + | ev := fmt.Sprintf("PUREGOTK_%s_PATH", name) | |
| 120 | + | if v := os.Getenv(ev); v != "" { | |
| 121 | + | return v | |
| 122 | + | } | |
| 123 | + | ||
| 124 | + | // try to loop over paths | |
| 125 | + | for _, p := range paths { | |
| 126 | + | g := findSo(p, name) | |
| 127 | + | if g != "" { | |
| 128 | + | return g | |
| 129 | + | } | |
| 130 | + | ||
| 131 | + | } | |
| 132 | + | g := findPkgConf(name) | |
| 133 | + | if g != "" { | |
| 134 | + | return g | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | panic(fmt.Sprintf("Path for library: %s not found. Please set the path to this library shared object file manually with env variable: %s. Or make sure pkg-config is setup correctly", strings.ToLower(name), ev)) | |
| 138 | + | } | |
A internal/gir/pass/pass.go +303 -0
| @@ -0,0 +1,303 @@ | |||
| 1 | + | // package pass implements the first and second pass to go from gir files to go files | |
| 2 | + | // the first pass collects basic type information | |
| 3 | + | // the second pass uses the basic type information to go over the gir files again and convert it to go files | |
| 4 | + | package pass | |
| 5 | + | ||
| 6 | + | import ( | |
| 7 | + | "encoding/xml" | |
| 8 | + | "fmt" | |
| 9 | + | "os" | |
| 10 | + | "strings" | |
| 11 | + | "text/template" | |
| 12 | + | ||
| 13 | + | "github.com/jwijenbergh/puregotk/internal/gir/types" | |
| 14 | + | "github.com/jwijenbergh/puregotk/internal/gir/util" | |
| 15 | + | ) | |
| 16 | + | ||
| 17 | + | type Pass struct { | |
| 18 | + | Parsed []types.Repository | |
| 19 | + | Types types.KindMap | |
| 20 | + | } | |
| 21 | + | ||
| 22 | + | // New creates a new pass struct by parsing gir files in the string slice | |
| 23 | + | // This pass object will then be used to go over these files multiple times up until we have the full info to convert it to go files | |
| 24 | + | func New(files []string) (*Pass, error) { | |
| 25 | + | p := Pass{ | |
| 26 | + | Parsed: make([]types.Repository, len(files)), | |
| 27 | + | Types: make(types.KindMap), | |
| 28 | + | } | |
| 29 | + | for i, f := range files { | |
| 30 | + | b, err := os.ReadFile(f) | |
| 31 | + | if err != nil { | |
| 32 | + | return nil, err | |
| 33 | + | } | |
| 34 | + | var r types.Repository | |
| 35 | + | err = xml.Unmarshal(b, &r) | |
| 36 | + | if err != nil { | |
| 37 | + | return nil, err | |
| 38 | + | } | |
| 39 | + | p.Parsed[i] = r | |
| 40 | + | } | |
| 41 | + | return &p, nil | |
| 42 | + | } | |
| 43 | + | ||
| 44 | + | func (p *Pass) collectTypes(r types.Repository) { | |
| 45 | + | ns := r.Namespaces[0] | |
| 46 | + | for _, cls := range ns.Classes { | |
| 47 | + | p.Types.Add(ns.Name, cls.Name, types.ClassesType, cls) | |
| 48 | + | } | |
| 49 | + | for _, rec := range ns.Records { | |
| 50 | + | p.Types.Add(ns.Name, rec.Name, types.RecordsType, rec) | |
| 51 | + | } | |
| 52 | + | for _, en := range ns.Enums { | |
| 53 | + | // TODO: This probably shouldn't be aliastype, but we should make dedicated types | |
| 54 | + | p.Types.Add(ns.Name, en.Name, types.AliasType, en) | |
| 55 | + | } | |
| 56 | + | for _, cb := range ns.Callbacks { | |
| 57 | + | p.Types.Add(ns.Name, cb.Name, types.CallbackType, cb) | |
| 58 | + | } | |
| 59 | + | for _, b := range ns.Bitfields { | |
| 60 | + | // TODO: This probably shouldn't be aliastype, but we should make dedicated types | |
| 61 | + | p.Types.Add(ns.Name, b.Name, types.AliasType, b) | |
| 62 | + | } | |
| 63 | + | for _, inter := range ns.Interfaces { | |
| 64 | + | p.Types.Add(ns.Name, inter.Name, types.InterfacesType, inter) | |
| 65 | + | } | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | // First does a "first pass" meaning it collects basic type information for all the repositories | |
| 69 | + | func (p *Pass) First() { | |
| 70 | + | for _, r := range p.Parsed { | |
| 71 | + | p.collectTypes(r) | |
| 72 | + | } | |
| 73 | + | } | |
| 74 | + | ||
| 75 | + | func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string) { | |
| 76 | + | ns := r.Namespaces[0] | |
| 77 | + | ||
| 78 | + | aliases := make(map[string][]types.AliasTemplate) | |
| 79 | + | enums := make(map[string][]types.EnumTemplate) | |
| 80 | + | var files []string | |
| 81 | + | for _, el := range ns.Bitfields { | |
| 82 | + | temp := el.Template(ns.Name) | |
| 83 | + | fn := el.FilenameSafe() | |
| 84 | + | files = append(files, fn) | |
| 85 | + | enums[fn] = append(enums[fn], temp) | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | for _, el := range ns.Enums { | |
| 89 | + | temp := el.Template(ns.Name) | |
| 90 | + | fn := el.FilenameSafe() | |
| 91 | + | files = append(files, fn) | |
| 92 | + | enums[fn] = append(enums[fn], temp) | |
| 93 | + | } | |
| 94 | + | ||
| 95 | + | records := make(map[string][]types.RecordTemplate) | |
| 96 | + | recordLookup := make(map[string]bool) | |
| 97 | + | for _, rec := range ns.Records { | |
| 98 | + | name := util.SnakeToCamel(rec.Name) | |
| 99 | + | fields := make([]types.RecordField, len(rec.Fields)) | |
| 100 | + | fn := rec.FilenameSafe() | |
| 101 | + | files = append(files, fn) | |
| 102 | + | for _, f := range rec.Fields { | |
| 103 | + | _type := f.Translate(ns.Name, p.Types) | |
| 104 | + | if _type == "" { | |
| 105 | + | continue | |
| 106 | + | } | |
| 107 | + | fields = append(fields, types.RecordField{ | |
| 108 | + | Name: util.SnakeToCamel(f.Name), | |
| 109 | + | Type: _type, | |
| 110 | + | }) | |
| 111 | + | } | |
| 112 | + | records[fn] = append(records[fn], types.RecordTemplate{ | |
| 113 | + | Name: name, | |
| 114 | + | Doc: rec.Doc.StringSafe(), | |
| 115 | + | Fields: fields, | |
| 116 | + | }) | |
| 117 | + | recordLookup[name] = true | |
| 118 | + | } | |
| 119 | + | ||
| 120 | + | callbacks := make(map[string][]types.CallbackTemplate) | |
| 121 | + | // set every callback equal to uintptr as well | |
| 122 | + | for _, cb := range ns.Callbacks { | |
| 123 | + | fn := cb.FilenameSafe() | |
| 124 | + | files = append(files, fn) | |
| 125 | + | cbT := types.CallbackTemplate{ | |
| 126 | + | Doc: cb.Doc.StringSafe(), | |
| 127 | + | Name: cb.Name, | |
| 128 | + | Args: cb.Parameters.Template(ns.Name, "", p.Types), | |
| 129 | + | Ret: cb.ReturnValue.Template(ns.Name, "", p.Types), | |
| 130 | + | } | |
| 131 | + | callbacks[fn] = append(callbacks[fn], cbT) | |
| 132 | + | } | |
| 133 | + | ||
| 134 | + | interfaces := make(map[string][]types.InterfaceTemplate) | |
| 135 | + | for _, inter := range ns.Interfaces { | |
| 136 | + | fn := inter.FilenameSafe() | |
| 137 | + | files = append(files, fn) | |
| 138 | + | interfaces[fn] = append(interfaces[fn], types.ConvertInterface(ns.Name, "", inter, nil, p.Types)) | |
| 139 | + | } | |
| 140 | + | ||
| 141 | + | for _, union := range ns.Unions { | |
| 142 | + | fn := union.FilenameSafe() | |
| 143 | + | files = append(files, fn) | |
| 144 | + | name := util.SnakeToCamel(union.Name) | |
| 145 | + | interT := types.AliasTemplate{ | |
| 146 | + | Doc: union.Doc.StringSafe(), | |
| 147 | + | Name: name, | |
| 148 | + | // structs are not yet supported in CGO | |
| 149 | + | Value: "uintptr", | |
| 150 | + | } | |
| 151 | + | aliases[fn] = append(aliases[fn], interT) | |
| 152 | + | } | |
| 153 | + | ||
| 154 | + | for _, alias := range ns.Aliases { | |
| 155 | + | fn := alias.FilenameSafe() | |
| 156 | + | files = append(files, fn) | |
| 157 | + | typeName := alias.Type.Template(ns.Name, p.Types) | |
| 158 | + | if typeName == "" { | |
| 159 | + | typeName = "uintptr" | |
| 160 | + | } | |
| 161 | + | name := util.SnakeToCamel(alias.Name) | |
| 162 | + | aliasT := types.AliasTemplate{ | |
| 163 | + | Doc: alias.Doc.StringSafe(), | |
| 164 | + | Name: name, | |
| 165 | + | // structs are not yet supported in CGO | |
| 166 | + | Value: typeName, | |
| 167 | + | } | |
| 168 | + | aliases[fn] = append(aliases[fn], aliasT) | |
| 169 | + | } | |
| 170 | + | ||
| 171 | + | functions := make(map[string][]types.FuncTemplate) | |
| 172 | + | for _, f := range ns.Functions { | |
| 173 | + | name := util.SnakeToCamel(f.Name) | |
| 174 | + | if p.Types.Kind(ns.Name, name) != types.UnknownType { | |
| 175 | + | name = "New" + name | |
| 176 | + | } | |
| 177 | + | fn := f.FilenameSafe() | |
| 178 | + | files = append(files, fn) | |
| 179 | + | functions[fn] = append(functions[fn], types.FuncTemplate{ | |
| 180 | + | Name: name, | |
| 181 | + | CName: f.CIdentifier, | |
| 182 | + | Doc: f.Doc.StringSafe(), | |
| 183 | + | Args: f.Parameters.Template(ns.Name, "", p.Types), | |
| 184 | + | Ret: f.ReturnValue.Template(ns.Name, "", p.Types), | |
| 185 | + | }) | |
| 186 | + | } | |
| 187 | + | ||
| 188 | + | classes := make(map[string][]types.ClassTemplate) | |
| 189 | + | for _, cls := range ns.Classes { | |
| 190 | + | implemented := make(map[string]bool) | |
| 191 | + | constructors := make([]types.FuncTemplate, len(cls.Constructors)) | |
| 192 | + | fn := cls.FilenameSafe() | |
| 193 | + | files = append(files, fn) | |
| 194 | + | ||
| 195 | + | for i, c := range cls.Constructors { | |
| 196 | + | name := util.SnakeToCamel(c.Name) | |
| 197 | + | constructors[i] = types.FuncTemplate{ | |
| 198 | + | Name: name, | |
| 199 | + | CName: c.CIdentifier, | |
| 200 | + | Doc: c.Doc.StringSafe(), | |
| 201 | + | Args: c.Parameters.Template(ns.Name, "", p.Types), | |
| 202 | + | Ret: c.ReturnValue.Template(ns.Name, "", p.Types), | |
| 203 | + | } | |
| 204 | + | } | |
| 205 | + | signals := make([]types.SignalsTemplate, len(cls.Signals)) | |
| 206 | + | for i, s := range cls.Signals { | |
| 207 | + | signals[i] = types.SignalsTemplate{ | |
| 208 | + | Doc: s.Doc.StringSafe(), | |
| 209 | + | Name: util.DashToCamel(s.Name), | |
| 210 | + | CName: s.Name, | |
| 211 | + | Args: s.Parameters.Template(ns.Name, "", p.Types), | |
| 212 | + | Ret: s.ReturnValue.Template(ns.Name, "", p.Types), | |
| 213 | + | } | |
| 214 | + | } | |
| 215 | + | receivers := make([]types.FuncTemplate, len(cls.Methods)) | |
| 216 | + | for i, f := range cls.Methods { | |
| 217 | + | name := util.SnakeToCamel(f.Name) | |
| 218 | + | implemented[name] = true | |
| 219 | + | receivers[i] = types.FuncTemplate{ | |
| 220 | + | Doc: f.Doc.StringSafe(), | |
| 221 | + | Name: name, | |
| 222 | + | CName: f.CIdentifier, | |
| 223 | + | Args: f.Parameters.Template(ns.Name, "", p.Types), | |
| 224 | + | Ret: f.ReturnValue.Template(ns.Name, "", p.Types), | |
| 225 | + | } | |
| 226 | + | } | |
| 227 | + | var interfaces []types.InterfaceTemplate | |
| 228 | + | for _, impl := range cls.Implements { | |
| 229 | + | interfaces = append(interfaces, types.GetInterfaceFuncs(ns.Name, impl.Name, implemented, p.Types)) | |
| 230 | + | } | |
| 231 | + | classes[fn] = append(classes[fn], types.ClassTemplate{ | |
| 232 | + | Doc: cls.Doc.StringSafe(), | |
| 233 | + | Name: cls.Name, | |
| 234 | + | Parent: util.NormalizeNamespace(ns.Name, cls.Parent, true), | |
| 235 | + | Constructors: constructors, | |
| 236 | + | Receivers: receivers, | |
| 237 | + | Interfaces: interfaces, | |
| 238 | + | Signals: signals, | |
| 239 | + | }) | |
| 240 | + | } | |
| 241 | + | ||
| 242 | + | pkgName := strings.ToLower(ns.Name) | |
| 243 | + | for _, fn := range files { | |
| 244 | + | var includesSlice []string | |
| 245 | + | //includesSlice := make([]string, len(includes[fn])) | |
| 246 | + | //i := 0 | |
| 247 | + | //for k, v := range includes[fn] { | |
| 248 | + | // if v { | |
| 249 | + | // includesSlice[i] = k | |
| 250 | + | // } | |
| 251 | + | // i++ | |
| 252 | + | //} | |
| 253 | + | methods := 0 | |
| 254 | + | for _, i := range interfaces[fn] { | |
| 255 | + | for range i.Methods { | |
| 256 | + | methods += 1 | |
| 257 | + | } | |
| 258 | + | } | |
| 259 | + | for _, i := range classes[fn] { | |
| 260 | + | for range i.Constructors { | |
| 261 | + | methods += 1 | |
| 262 | + | } | |
| 263 | + | for range i.Receivers { | |
| 264 | + | methods += 1 | |
| 265 | + | } | |
| 266 | + | } | |
| 267 | + | // we do not need to add the length of interfaces in here | |
| 268 | + | // as they should only be loaded when there are classes | |
| 269 | + | needsInit := (len(functions[fn]) + methods) > 0 | |
| 270 | + | ||
| 271 | + | args := types.TemplateArg{ | |
| 272 | + | PkgName: pkgName, | |
| 273 | + | PkgEnv: strings.ToUpper(pkgName), | |
| 274 | + | NeedsInit: needsInit, | |
| 275 | + | Imports: includesSlice, | |
| 276 | + | Aliases: aliases[fn], | |
| 277 | + | Callbacks: callbacks[fn], | |
| 278 | + | Records: records[fn], | |
| 279 | + | Enums: enums[fn], | |
| 280 | + | Functions: functions[fn], | |
| 281 | + | Interfaces: interfaces[fn], | |
| 282 | + | Classes: classes[fn], | |
| 283 | + | } | |
| 284 | + | ||
| 285 | + | os.MkdirAll(fmt.Sprintf(dir+"/%s", pkgName), 0o755) | |
| 286 | + | ||
| 287 | + | f, err := os.Create(fmt.Sprintf(dir+"/%s/%s", pkgName, fn)) | |
| 288 | + | if err != nil { | |
| 289 | + | panic(err) | |
| 290 | + | } | |
| 291 | + | err = gotemp.Execute(f, args) | |
| 292 | + | if err != nil { | |
| 293 | + | panic(err) | |
| 294 | + | } | |
| 295 | + | ||
| 296 | + | } | |
| 297 | + | } | |
| 298 | + | ||
| 299 | + | func (p *Pass) Second(dir string, gotemp *template.Template) { | |
| 300 | + | for _, r := range p.Parsed { | |
| 301 | + | p.writeGo(r, gotemp, dir) | |
| 302 | + | } | |
| 303 | + | } | |
A internal/gir/spec/Adw-1.gir +29130 -0 large diff (29130 lines changed): collapsed
A internal/gir/spec/GLib-2.0.gir +83214 -0 large diff (83214 lines changed): collapsed
A internal/gir/spec/GModule-2.0.gir +522 -0
| @@ -0,0 +1,522 @@ | |||
| 1 | + | <?xml version="1.0"?> | |
| 2 | + | <!-- This file was automatically generated from C sources - DO NOT EDIT! | |
| 3 | + | To affect the contents of this file, edit the original C definitions, | |
| 4 | + | and/or use gtk-doc annotations. --> | |
| 5 | + | <repository version="1.2" | |
| 6 | + | xmlns="http://www.gtk.org/introspection/core/1.0" | |
| 7 | + | xmlns:c="http://www.gtk.org/introspection/c/1.0" | |
| 8 | + | xmlns:glib="http://www.gtk.org/introspection/glib/1.0"> | |
| 9 | + | <include name="GLib" version="2.0"/> | |
| 10 | + | <package name="gmodule-2.0"/> | |
| 11 | + | <c:include name="gmodule.h"/> | |
| 12 | + | <namespace name="GModule" | |
| 13 | + | version="2.0" | |
| 14 | + | shared-library="libgmodule-2.0.so.0" | |
| 15 | + | c:identifier-prefixes="G" | |
| 16 | + | c:symbol-prefixes="g"> | |
| 17 | + | <record name="Module" c:type="GModule" disguised="1"> | |
| 18 | + | <doc xml:space="preserve" | |
| 19 | + | filename="gmodule-2.0.c" | |
| 20 | + | line="5">The #GModule struct is an opaque data structure to represent a | |
| 21 | + | [dynamically-loaded module][glib-Dynamic-Loading-of-Modules]. | |
| 22 | + | It should only be accessed via the following functions.</doc> | |
| 23 | + | <source-position filename="gmodule.h" line="65"/> | |
| 24 | + | <method name="close" c:identifier="g_module_close"> | |
| 25 | + | <doc xml:space="preserve" | |
| 26 | + | filename="gmodule-2.0.c" | |
| 27 | + | line="185">Closes a module.</doc> | |
| 28 | + | <source-position filename="gmodule.h" line="105"/> | |
| 29 | + | <return-value transfer-ownership="none"> | |
| 30 | + | <doc xml:space="preserve" | |
| 31 | + | filename="gmodule-2.0.c" | |
| 32 | + | line="191">%TRUE on success</doc> | |
| 33 | + | <type name="gboolean" c:type="gboolean"/> | |
| 34 | + | </return-value> | |
| 35 | + | <parameters> | |
| 36 | + | <instance-parameter name="module" transfer-ownership="none"> | |
| 37 | + | <doc xml:space="preserve" | |
| 38 | + | filename="gmodule-2.0.c" | |
| 39 | + | line="187">a #GModule to close</doc> | |
| 40 | + | <type name="Module" c:type="GModule*"/> | |
| 41 | + | </instance-parameter> | |
| 42 | + | </parameters> | |
| 43 | + | </method> | |
| 44 | + | <method name="make_resident" c:identifier="g_module_make_resident"> | |
| 45 | + | <doc xml:space="preserve" | |
| 46 | + | filename="gmodule-2.0.c" | |
| 47 | + | line="204">Ensures that a module will never be unloaded. | |
| 48 | + | Any future g_module_close() calls on the module will be ignored.</doc> | |
| 49 | + | <source-position filename="gmodule.h" line="109"/> | |
| 50 | + | <return-value transfer-ownership="none"> | |
| 51 | + | <type name="none" c:type="void"/> | |
| 52 | + | </return-value> | |
| 53 | + | <parameters> | |
| 54 | + | <instance-parameter name="module" transfer-ownership="none"> | |
| 55 | + | <doc xml:space="preserve" | |
| 56 | + | filename="gmodule-2.0.c" | |
| 57 | + | line="206">a #GModule to make permanently resident</doc> | |
| 58 | + | <type name="Module" c:type="GModule*"/> | |
| 59 | + | </instance-parameter> | |
| 60 | + | </parameters> | |
| 61 | + | </method> | |
| 62 | + | <method name="name" c:identifier="g_module_name"> | |
| 63 | + | <doc xml:space="preserve" | |
| 64 | + | filename="gmodule-2.0.c" | |
| 65 | + | line="213">Returns the filename that the module was opened with. | |
| 66 | + | ||
| 67 | + | If @module refers to the application itself, "main" is returned.</doc> | |
| 68 | + | <source-position filename="gmodule.h" line="123"/> | |
| 69 | + | <return-value transfer-ownership="none"> | |
| 70 | + | <doc xml:space="preserve" | |
| 71 | + | filename="gmodule-2.0.c" | |
| 72 | + | line="221">the filename of the module</doc> | |
| 73 | + | <type name="utf8" c:type="const gchar*"/> | |
| 74 | + | </return-value> | |
| 75 | + | <parameters> | |
| 76 | + | <instance-parameter name="module" transfer-ownership="none"> | |
| 77 | + | <doc xml:space="preserve" | |
| 78 | + | filename="gmodule-2.0.c" | |
| 79 | + | line="215">a #GModule</doc> | |
| 80 | + | <type name="Module" c:type="GModule*"/> | |
| 81 | + | </instance-parameter> | |
| 82 | + | </parameters> | |
| 83 | + | </method> | |
| 84 | + | <method name="symbol" c:identifier="g_module_symbol"> | |
| 85 | + | <doc xml:space="preserve" | |
| 86 | + | filename="gmodule-2.0.c" | |
| 87 | + | line="273">Gets a symbol pointer from a module, such as one exported | |
| 88 | + | by %G_MODULE_EXPORT. Note that a valid symbol can be %NULL.</doc> | |
| 89 | + | <source-position filename="gmodule.h" line="117"/> | |
| 90 | + | <return-value transfer-ownership="none"> | |
| 91 | + | <doc xml:space="preserve" | |
| 92 | + | filename="gmodule-2.0.c" | |
| 93 | + | line="282">%TRUE on success</doc> | |
| 94 | + | <type name="gboolean" c:type="gboolean"/> | |
| 95 | + | </return-value> | |
| 96 | + | <parameters> | |
| 97 | + | <instance-parameter name="module" transfer-ownership="none"> | |
| 98 | + | <doc xml:space="preserve" | |
| 99 | + | filename="gmodule-2.0.c" | |
| 100 | + | line="275">a #GModule</doc> | |
| 101 | + | <type name="Module" c:type="GModule*"/> | |
| 102 | + | </instance-parameter> | |
| 103 | + | <parameter name="symbol_name" transfer-ownership="none"> | |
| 104 | + | <doc xml:space="preserve" | |
| 105 | + | filename="gmodule-2.0.c" | |
| 106 | + | line="276">the name of the symbol to find</doc> | |
| 107 | + | <type name="utf8" c:type="const gchar*"/> | |
| 108 | + | </parameter> | |
| 109 | + | <parameter name="symbol" | |
| 110 | + | direction="out" | |
| 111 | + | caller-allocates="0" | |
| 112 | + | transfer-ownership="full" | |
| 113 | + | nullable="1"> | |
| 114 | + | <doc xml:space="preserve" | |
| 115 | + | filename="gmodule-2.0.c" | |
| 116 | + | line="277">returns the pointer to the symbol value</doc> | |
| 117 | + | <type name="gpointer" c:type="gpointer*"/> | |
| 118 | + | </parameter> | |
| 119 | + | </parameters> | |
| 120 | + | </method> | |
| 121 | + | <function name="build_path" c:identifier="g_module_build_path"> | |
| 122 | + | <doc xml:space="preserve" | |
| 123 | + | filename="gmodule-2.0.c" | |
| 124 | + | line="159">A portable way to build the filename of a module. The platform-specific | |
| 125 | + | prefix and suffix are added to the filename, if needed, and the result | |
| 126 | + | is added to the directory, using the correct separator character. | |
| 127 | + | ||
| 128 | + | The directory should specify the directory where the module can be found. | |
| 129 | + | It can be %NULL or an empty string to indicate that the module is in a | |
| 130 | + | standard platform-specific directory, though this is not recommended | |
| 131 | + | since the wrong module may be found. | |
| 132 | + | ||
| 133 | + | For example, calling g_module_build_path() on a Linux system with a | |
| 134 | + | @directory of `/lib` and a @module_name of "mylibrary" will return | |
| 135 | + | `/lib/libmylibrary.so`. On a Windows system, using `\Windows` as the | |
| 136 | + | directory it will return `\Windows\mylibrary.dll`.</doc> | |
| 137 | + | <source-position filename="gmodule.h" line="137"/> | |
| 138 | + | <return-value transfer-ownership="full"> | |
| 139 | + | <doc xml:space="preserve" | |
| 140 | + | filename="gmodule-2.0.c" | |
| 141 | + | line="180">the complete path of the module, including the standard library | |
| 142 | + | prefix and suffix. This should be freed when no longer needed</doc> | |
| 143 | + | <type name="utf8" c:type="gchar*"/> | |
| 144 | + | </return-value> | |
| 145 | + | <parameters> | |
| 146 | + | <parameter name="directory" | |
| 147 | + | transfer-ownership="none" | |
| 148 | + | nullable="1" | |
| 149 | + | allow-none="1"> | |
| 150 | + | <doc xml:space="preserve" | |
| 151 | + | filename="gmodule-2.0.c" | |
| 152 | + | line="161">the directory where the module is. This can be | |
| 153 | + | %NULL or the empty string to indicate that the standard platform-specific | |
| 154 | + | directories will be used, though that is not recommended</doc> | |
| 155 | + | <type name="utf8" c:type="const gchar*"/> | |
| 156 | + | </parameter> | |
| 157 | + | <parameter name="module_name" transfer-ownership="none"> | |
| 158 | + | <doc xml:space="preserve" | |
| 159 | + | filename="gmodule-2.0.c" | |
| 160 | + | line="164">the name of the module</doc> | |
| 161 | + | <type name="utf8" c:type="const gchar*"/> | |
| 162 | + | </parameter> | |
| 163 | + | </parameters> | |
| 164 | + | </function> | |
| 165 | + | <function name="error" c:identifier="g_module_error"> | |
| 166 | + | <doc xml:space="preserve" | |
| 167 | + | filename="gmodule-2.0.c" | |
| 168 | + | line="195">Gets a string describing the last module error.</doc> | |
| 169 | + | <source-position filename="gmodule.h" line="113"/> | |
| 170 | + | <return-value transfer-ownership="none"> | |
| 171 | + | <doc xml:space="preserve" | |
| 172 | + | filename="gmodule-2.0.c" | |
| 173 | + | line="200">a string describing the last module error</doc> | |
| 174 | + | <type name="utf8" c:type="const gchar*"/> | |
| 175 | + | </return-value> | |
| 176 | + | </function> | |
| 177 | + | <function name="error_quark" c:identifier="g_module_error_quark"> | |
| 178 | + | <return-value transfer-ownership="none"> | |
| 179 | + | <type name="GLib.Quark" c:type="GQuark"/> | |
| 180 | + | </return-value> | |
| 181 | + | </function> | |
| 182 | + | <function name="open" c:identifier="g_module_open" introspectable="0"> | |
| 183 | + | <doc xml:space="preserve" | |
| 184 | + | filename="gmodule-2.0.c" | |
| 185 | + | line="225">A thin wrapper function around g_module_open_full()</doc> | |
| 186 | + | <source-position filename="gmodule.h" line="95"/> | |
| 187 | + | <return-value> | |
| 188 | + | <doc xml:space="preserve" | |
| 189 | + | filename="gmodule-2.0.c" | |
| 190 | + | line="234">a #GModule on success, or %NULL on failure</doc> | |
| 191 | + | <type name="Module" c:type="GModule*"/> | |
| 192 | + | </return-value> | |
| 193 | + | <parameters> | |
| 194 | + | <parameter name="file_name" | |
| 195 | + | transfer-ownership="none" | |
| 196 | + | nullable="1" | |
| 197 | + | allow-none="1"> | |
| 198 | + | <doc xml:space="preserve" | |
| 199 | + | filename="gmodule-2.0.c" | |
| 200 | + | line="227">the name of the file containing the module, or %NULL | |
| 201 | + | to obtain a #GModule representing the main program itself</doc> | |
| 202 | + | <type name="utf8" c:type="const gchar*"/> | |
| 203 | + | </parameter> | |
| 204 | + | <parameter name="flags" transfer-ownership="none"> | |
| 205 | + | <doc xml:space="preserve" | |
| 206 | + | filename="gmodule-2.0.c" | |
| 207 | + | line="229">the flags used for opening the module. This can be the | |
| 208 | + | logical OR of any of the #GModuleFlags.</doc> | |
| 209 | + | <type name="ModuleFlags" c:type="GModuleFlags"/> | |
| 210 | + | </parameter> | |
| 211 | + | </parameters> | |
| 212 | + | </function> | |
| 213 | + | <function name="open_full" | |
| 214 | + | c:identifier="g_module_open_full" | |
| 215 | + | version="2.70" | |
| 216 | + | introspectable="0" | |
| 217 | + | throws="1"> | |
| 218 | + | <doc xml:space="preserve" | |
| 219 | + | filename="gmodule-2.0.c" | |
| 220 | + | line="238">Opens a module. If the module has already been opened, | |
| 221 | + | its reference count is incremented. | |
| 222 | + | ||
| 223 | + | First of all g_module_open_full() tries to open @file_name as a module. | |
| 224 | + | If that fails and @file_name has the ".la"-suffix (and is a libtool | |
| 225 | + | archive) it tries to open the corresponding module. If that fails | |
| 226 | + | and it doesn't have the proper module suffix for the platform | |
| 227 | + | (%G_MODULE_SUFFIX), this suffix will be appended and the corresponding | |
| 228 | + | module will be opened. If that fails and @file_name doesn't have the | |
| 229 | + | ".la"-suffix, this suffix is appended and g_module_open_full() tries to open | |
| 230 | + | the corresponding module. If eventually that fails as well, %NULL is | |
| 231 | + | returned.</doc> | |
| 232 | + | <source-position filename="gmodule.h" line="99"/> | |
| 233 | + | <return-value> | |
| 234 | + | <doc xml:space="preserve" | |
| 235 | + | filename="gmodule-2.0.c" | |
| 236 | + | line="259">a #GModule on success, or %NULL on failure</doc> | |
| 237 | + | <type name="Module" c:type="GModule*"/> | |
| 238 | + | </return-value> | |
| 239 | + | <parameters> | |
| 240 | + | <parameter name="file_name" | |
| 241 | + | transfer-ownership="none" | |
| 242 | + | nullable="1" | |
| 243 | + | allow-none="1"> | |
| 244 | + | <doc xml:space="preserve" | |
| 245 | + | filename="gmodule-2.0.c" | |
| 246 | + | line="240">the name of the file containing the module, or %NULL | |
| 247 | + | to obtain a #GModule representing the main program itself</doc> | |
| 248 | + | <type name="utf8" c:type="const gchar*"/> | |
| 249 | + | </parameter> | |
| 250 | + | <parameter name="flags" transfer-ownership="none"> | |
| 251 | + | <doc xml:space="preserve" | |
| 252 | + | filename="gmodule-2.0.c" | |
| 253 | + | line="242">the flags used for opening the module. This can be the | |
| 254 | + | logical OR of any of the #GModuleFlags</doc> | |
| 255 | + | <type name="ModuleFlags" c:type="GModuleFlags"/> | |
| 256 | + | </parameter> | |
| 257 | + | </parameters> | |
| 258 | + | </function> | |
| 259 | + | <function name="supported" c:identifier="g_module_supported"> | |
| 260 | + | <doc xml:space="preserve" | |
| 261 | + | filename="gmodule-2.0.c" | |
| 262 | + | line="264">Checks if modules are supported on the current platform.</doc> | |
| 263 | + | <source-position filename="gmodule.h" line="91"/> | |
| 264 | + | <return-value transfer-ownership="none"> | |
| 265 | + | <doc xml:space="preserve" | |
| 266 | + | filename="gmodule-2.0.c" | |
| 267 | + | line="269">%TRUE if modules are supported</doc> | |
| 268 | + | <type name="gboolean" c:type="gboolean"/> | |
| 269 | + | </return-value> | |
| 270 | + | </function> | |
| 271 | + | </record> | |
| 272 | + | <callback name="ModuleCheckInit" c:type="GModuleCheckInit"> | |
| 273 | + | <doc xml:space="preserve" | |
| 274 | + | filename="gmodule-2.0.c" | |
| 275 | + | line="14">Specifies the type of the module initialization function. | |
| 276 | + | If a module contains a function named g_module_check_init() it is called | |
| 277 | + | automatically when the module is loaded. It is passed the #GModule structure | |
| 278 | + | and should return %NULL on success or a string describing the initialization | |
| 279 | + | error.</doc> | |
| 280 | + | <source-position filename="gmodule.h" line="66"/> | |
| 281 | + | <return-value transfer-ownership="none"> | |
| 282 | + | <doc xml:space="preserve" | |
| 283 | + | filename="gmodule-2.0.c" | |
| 284 | + | line="24">%NULL on success, or a string describing the initialization error</doc> | |
| 285 | + | <type name="utf8" c:type="const gchar*"/> | |
| 286 | + | </return-value> | |
| 287 | + | <parameters> | |
| 288 | + | <parameter name="module" transfer-ownership="none"> | |
| 289 | + | <doc xml:space="preserve" | |
| 290 | + | filename="gmodule-2.0.c" | |
| 291 | + | line="16">the #GModule corresponding to the module which has just been loaded</doc> | |
| 292 | + | <type name="Module" c:type="GModule*"/> | |
| 293 | + | </parameter> | |
| 294 | + | </parameters> | |
| 295 | + | </callback> | |
| 296 | + | <enumeration name="ModuleError" | |
| 297 | + | version="2.70" | |
| 298 | + | c:type="GModuleError" | |
| 299 | + | glib:error-domain="g-module-error-quark"> | |
| 300 | + | <doc xml:space="preserve" | |
| 301 | + | filename="gmodule.h" | |
| 302 | + | line="73">Errors returned by g_module_open_full().</doc> | |
| 303 | + | <source-position filename="gmodule.h" line="86"/> | |
| 304 | + | <member name="failed" value="0" c:identifier="G_MODULE_ERROR_FAILED"> | |
| 305 | + | <doc xml:space="preserve" | |
| 306 | + | filename="gmodule.h" | |
| 307 | + | line="75">there was an error loading or opening a module file</doc> | |
| 308 | + | </member> | |
| 309 | + | <member name="check_failed" | |
| 310 | + | value="1" | |
| 311 | + | c:identifier="G_MODULE_ERROR_CHECK_FAILED"> | |
| 312 | + | <doc xml:space="preserve" | |
| 313 | + | filename="gmodule.h" | |
| 314 | + | line="76">a module returned an error from its `g_module_check_init()` function</doc> | |
| 315 | + | </member> | |
| 316 | + | </enumeration> | |
| 317 | + | <bitfield name="ModuleFlags" c:type="GModuleFlags"> | |
| 318 | + | <doc xml:space="preserve" | |
| 319 | + | filename="gmodule.h" | |
| 320 | + | line="44">Flags passed to g_module_open(). | |
| 321 | + | Note that these flags are not supported on all platforms.</doc> | |
| 322 | + | <source-position filename="gmodule.h" line="63"/> | |
| 323 | + | <member name="lazy" value="1" c:identifier="G_MODULE_BIND_LAZY"> | |
| 324 | + | <doc xml:space="preserve" | |
| 325 | + | filename="gmodule.h" | |
| 326 | + | line="46">specifies that symbols are only resolved when | |
| 327 | + | needed. The default action is to bind all symbols when the module | |
| 328 | + | is loaded.</doc> | |
| 329 | + | </member> | |
| 330 | + | <member name="local" value="2" c:identifier="G_MODULE_BIND_LOCAL"> | |
| 331 | + | <doc xml:space="preserve" | |
| 332 | + | filename="gmodule.h" | |
| 333 | + | line="49">specifies that symbols in the module should | |
| 334 | + | not be added to the global name space. The default action on most | |
| 335 | + | platforms is to place symbols in the module in the global name space, | |
| 336 | + | which may cause conflicts with existing symbols.</doc> | |
| 337 | + | </member> | |
| 338 | + | <member name="mask" value="3" c:identifier="G_MODULE_BIND_MASK"> | |
| 339 | + | <doc xml:space="preserve" | |
| 340 | + | filename="gmodule.h" | |
| 341 | + | line="53">mask for all flags.</doc> | |
| 342 | + | </member> | |
| 343 | + | </bitfield> | |
| 344 | + | <callback name="ModuleUnload" c:type="GModuleUnload"> | |
| 345 | + | <doc xml:space="preserve" | |
| 346 | + | filename="gmodule-2.0.c" | |
| 347 | + | line="28">Specifies the type of the module function called when it is unloaded. | |
| 348 | + | If a module contains a function named g_module_unload() it is called | |
| 349 | + | automatically when the module is unloaded. | |
| 350 | + | It is passed the #GModule structure.</doc> | |
| 351 | + | <source-position filename="gmodule.h" line="67"/> | |
| 352 | + | <return-value transfer-ownership="none"> | |
| 353 | + | <type name="none" c:type="void"/> | |
| 354 | + | </return-value> | |
| 355 | + | <parameters> | |
| 356 | + | <parameter name="module" transfer-ownership="none"> | |
| 357 | + | <doc xml:space="preserve" | |
| 358 | + | filename="gmodule-2.0.c" | |
| 359 | + | line="30">the #GModule about to be unloaded</doc> | |
| 360 | + | <type name="Module" c:type="GModule*"/> | |
| 361 | + | </parameter> | |
| 362 | + | </parameters> | |
| 363 | + | </callback> | |
| 364 | + | <function name="module_build_path" | |
| 365 | + | c:identifier="g_module_build_path" | |
| 366 | + | moved-to="Module.build_path"> | |
| 367 | + | <doc xml:space="preserve" | |
| 368 | + | filename="gmodule-2.0.c" | |
| 369 | + | line="159">A portable way to build the filename of a module. The platform-specific | |
| 370 | + | prefix and suffix are added to the filename, if needed, and the result | |
| 371 | + | is added to the directory, using the correct separator character. | |
| 372 | + | ||
| 373 | + | The directory should specify the directory where the module can be found. | |
| 374 | + | It can be %NULL or an empty string to indicate that the module is in a | |
| 375 | + | standard platform-specific directory, though this is not recommended | |
| 376 | + | since the wrong module may be found. | |
| 377 | + | ||
| 378 | + | For example, calling g_module_build_path() on a Linux system with a | |
| 379 | + | @directory of `/lib` and a @module_name of "mylibrary" will return | |
| 380 | + | `/lib/libmylibrary.so`. On a Windows system, using `\Windows` as the | |
| 381 | + | directory it will return `\Windows\mylibrary.dll`.</doc> | |
| 382 | + | <source-position filename="gmodule.h" line="137"/> | |
| 383 | + | <return-value transfer-ownership="full"> | |
| 384 | + | <doc xml:space="preserve" | |
| 385 | + | filename="gmodule-2.0.c" | |
| 386 | + | line="180">the complete path of the module, including the standard library | |
| 387 | + | prefix and suffix. This should be freed when no longer needed</doc> | |
| 388 | + | <type name="utf8" c:type="gchar*"/> | |
| 389 | + | </return-value> | |
| 390 | + | <parameters> | |
| 391 | + | <parameter name="directory" | |
| 392 | + | transfer-ownership="none" | |
| 393 | + | nullable="1" | |
| 394 | + | allow-none="1"> | |
| 395 | + | <doc xml:space="preserve" | |
| 396 | + | filename="gmodule-2.0.c" | |
| 397 | + | line="161">the directory where the module is. This can be | |
| 398 | + | %NULL or the empty string to indicate that the standard platform-specific | |
| 399 | + | directories will be used, though that is not recommended</doc> | |
| 400 | + | <type name="utf8" c:type="const gchar*"/> | |
| 401 | + | </parameter> | |
| 402 | + | <parameter name="module_name" transfer-ownership="none"> | |
| 403 | + | <doc xml:space="preserve" | |
| 404 | + | filename="gmodule-2.0.c" | |
| 405 | + | line="164">the name of the module</doc> | |
| 406 | + | <type name="utf8" c:type="const gchar*"/> | |
| 407 | + | </parameter> | |
| 408 | + | </parameters> | |
| 409 | + | </function> | |
| 410 | + | <function name="module_error" | |
| 411 | + | c:identifier="g_module_error" | |
| 412 | + | moved-to="Module.error"> | |
| 413 | + | <doc xml:space="preserve" | |
| 414 | + | filename="gmodule-2.0.c" | |
| 415 | + | line="195">Gets a string describing the last module error.</doc> | |
| 416 | + | <source-position filename="gmodule.h" line="113"/> | |
| 417 | + | <return-value transfer-ownership="none"> | |
| 418 | + | <doc xml:space="preserve" | |
| 419 | + | filename="gmodule-2.0.c" | |
| 420 | + | line="200">a string describing the last module error</doc> | |
| 421 | + | <type name="utf8" c:type="const gchar*"/> | |
| 422 | + | </return-value> | |
| 423 | + | </function> | |
| 424 | + | <function name="module_error_quark" | |
| 425 | + | c:identifier="g_module_error_quark" | |
| 426 | + | moved-to="Module.error_quark"> | |
| 427 | + | <return-value transfer-ownership="none"> | |
| 428 | + | <type name="GLib.Quark" c:type="GQuark"/> | |
| 429 | + | </return-value> | |
| 430 | + | </function> | |
| 431 | + | <function name="module_supported" | |
| 432 | + | c:identifier="g_module_supported" | |
| 433 | + | moved-to="Module.supported"> | |
| 434 | + | <doc xml:space="preserve" | |
| 435 | + | filename="gmodule-2.0.c" | |
| 436 | + | line="264">Checks if modules are supported on the current platform.</doc> | |
| 437 | + | <source-position filename="gmodule.h" line="91"/> | |
| 438 | + | <return-value transfer-ownership="none"> | |
| 439 | + | <doc xml:space="preserve" | |
| 440 | + | filename="gmodule-2.0.c" | |
| 441 | + | line="269">%TRUE if modules are supported</doc> | |
| 442 | + | <type name="gboolean" c:type="gboolean"/> | |
| 443 | + | </return-value> | |
| 444 | + | </function> | |
| 445 | + | <docsection name="modules"> | |
| 446 | + | <doc xml:space="preserve" | |
| 447 | + | filename="gmodule-2.0.c" | |
| 448 | + | line="79">These functions provide a portable way to dynamically load object files | |
| 449 | + | (commonly known as 'plug-ins'). The current implementation supports all | |
| 450 | + | systems that provide an implementation of dlopen() (e.g. Linux/Sun), as | |
| 451 | + | well as Windows platforms via DLLs. | |
| 452 | + | ||
| 453 | + | A program which wants to use these functions must be linked to the | |
| 454 | + | libraries output by the command `pkg-config --libs gmodule-2.0`. | |
| 455 | + | ||
| 456 | + | To use them you must first determine whether dynamic loading | |
| 457 | + | is supported on the platform by calling g_module_supported(). | |
| 458 | + | If it is, you can open a module with g_module_open(), | |
| 459 | + | find the module's symbols (e.g. function names) with g_module_symbol(), | |
| 460 | + | and later close the module with g_module_close(). | |
| 461 | + | g_module_name() will return the file name of a currently opened module. | |
| 462 | + | ||
| 463 | + | If any of the above functions fail, the error status can be found with | |
| 464 | + | g_module_error(). | |
| 465 | + | ||
| 466 | + | The #GModule implementation features reference counting for opened modules, | |
| 467 | + | and supports hook functions within a module which are called when the | |
| 468 | + | module is loaded and unloaded (see #GModuleCheckInit and #GModuleUnload). | |
| 469 | + | ||
| 470 | + | If your module introduces static data to common subsystems in the running | |
| 471 | + | program, e.g. through calling | |
| 472 | + | `g_quark_from_static_string ("my-module-stuff")`, | |
| 473 | + | it must ensure that it is never unloaded, by calling g_module_make_resident(). | |
| 474 | + | ||
| 475 | + | Example: Calling a function defined in a GModule | |
| 476 | + | |[<!-- language="C" --> | |
| 477 | + | // the function signature for 'say_hello' | |
| 478 | + | typedef void (* SayHelloFunc) (const char *message); | |
| 479 | + | ||
| 480 | + | gboolean | |
| 481 | + | just_say_hello (const char *filename, GError **error) | |
| 482 | + | { | |
| 483 | + | SayHelloFunc say_hello; | |
| 484 | + | GModule *module; | |
| 485 | + | ||
| 486 | + | module = g_module_open (filename, G_MODULE_BIND_LAZY); | |
| 487 | + | if (!module) | |
| 488 | + | { | |
| 489 | + | g_set_error (error, FOO_ERROR, FOO_ERROR_BLAH, | |
| 490 | + | "%s", g_module_error ()); | |
| 491 | + | return FALSE; | |
| 492 | + | } | |
| 493 | + | ||
| 494 | + | if (!g_module_symbol (module, "say_hello", (gpointer *)&say_hello)) | |
| 495 | + | { | |
| 496 | + | g_set_error (error, SAY_ERROR, SAY_ERROR_OPEN, | |
| 497 | + | "%s: %s", filename, g_module_error ()); | |
| 498 | + | if (!g_module_close (module)) | |
| 499 | + | g_warning ("%s: %s", filename, g_module_error ()); | |
| 500 | + | return FALSE; | |
| 501 | + | } | |
| 502 | + | ||
| 503 | + | if (say_hello == NULL) | |
| 504 | + | { | |
| 505 | + | g_set_error (error, SAY_ERROR, SAY_ERROR_OPEN, | |
| 506 | + | "symbol say_hello is NULL"); | |
| 507 | + | if (!g_module_close (module)) | |
| 508 | + | g_warning ("%s: %s", filename, g_module_error ()); | |
| 509 | + | return FALSE; | |
| 510 | + | } | |
| 511 | + | ||
| 512 | + | // call our function in the module | |
| 513 | + | say_hello ("Hello world!"); | |
| 514 | + | ||
| 515 | + | if (!g_module_close (module)) | |
| 516 | + | g_warning ("%s: %s", filename, g_module_error ()); | |
| 517 | + | return TRUE; | |
| 518 | + | } | |
| 519 | + | ]|</doc> | |
| 520 | + | </docsection> | |
| 521 | + | </namespace> | |
| 522 | + | </repository> | |
A internal/gir/spec/GObject-2.0.gir +27133 -0 large diff (27133 lines changed): collapsed
A internal/gir/spec/Gdk-4.0.gir +31079 -0 large diff (31079 lines changed): collapsed
A internal/gir/spec/GdkPixbuf-2.0.gir +7353 -0
| @@ -0,0 +1,7353 @@ | |||
| 1 | + | <?xml version="1.0"?> | |
| 2 | + | <!-- This file was automatically generated from C sources - DO NOT EDIT! | |
| 3 | + | To affect the contents of this file, edit the original C definitions, | |
| 4 | + | and/or use gtk-doc annotations. --> | |
| 5 | + | <repository version="1.2" | |
| 6 | + | xmlns="http://www.gtk.org/introspection/core/1.0" | |
| 7 | + | xmlns:c="http://www.gtk.org/introspection/c/1.0" | |
| 8 | + | xmlns:glib="http://www.gtk.org/introspection/glib/1.0"> | |
| 9 | + | <include name="GModule" version="2.0"/> | |
| 10 | + | <include name="Gio" version="2.0"/> | |
| 11 | + | <package name="gdk-pixbuf-2.0"/> | |
| 12 | + | <c:include name="gdk-pixbuf/gdk-pixbuf.h"/> | |
| 13 | + | <namespace name="GdkPixbuf" | |
| 14 | + | version="2.0" | |
| 15 | + | shared-library="libgdk_pixbuf-2.0.so.0" | |
| 16 | + | c:identifier-prefixes="Gdk" | |
| 17 | + | c:symbol-prefixes="gdk"> | |
| 18 | + | <enumeration name="Colorspace" | |
| 19 | + | glib:type-name="GdkColorspace" | |
| 20 | + | glib:get-type="gdk_colorspace_get_type" | |
| 21 | + | c:type="GdkColorspace"> | |
| 22 | + | <doc xml:space="preserve" | |
| 23 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 24 | + | line="71">This enumeration defines the color spaces that are supported by | |
| 25 | + | the gdk-pixbuf library. | |
| 26 | + | ||
| 27 | + | Currently only RGB is supported.</doc> | |
| 28 | + | <member name="rgb" | |
| 29 | + | value="0" | |
| 30 | + | c:identifier="GDK_COLORSPACE_RGB" | |
| 31 | + | glib:nick="rgb" | |
| 32 | + | glib:name="GDK_COLORSPACE_RGB"> | |
| 33 | + | <doc xml:space="preserve" | |
| 34 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 35 | + | line="73">Indicates a red/green/blue additive color space.</doc> | |
| 36 | + | </member> | |
| 37 | + | </enumeration> | |
| 38 | + | <function-macro name="IS_PIXBUF" | |
| 39 | + | c:identifier="GDK_IS_PIXBUF" | |
| 40 | + | introspectable="0"> | |
| 41 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" line="93"/> | |
| 42 | + | <parameters> | |
| 43 | + | <parameter name="object"> | |
| 44 | + | </parameter> | |
| 45 | + | </parameters> | |
| 46 | + | </function-macro> | |
| 47 | + | <function-macro name="IS_PIXBUF_ANIMATION" | |
| 48 | + | c:identifier="GDK_IS_PIXBUF_ANIMATION" | |
| 49 | + | introspectable="0"> | |
| 50 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 51 | + | line="46"/> | |
| 52 | + | <parameters> | |
| 53 | + | <parameter name="object"> | |
| 54 | + | </parameter> | |
| 55 | + | </parameters> | |
| 56 | + | </function-macro> | |
| 57 | + | <function-macro name="IS_PIXBUF_ANIMATION_CLASS" | |
| 58 | + | c:identifier="GDK_IS_PIXBUF_ANIMATION_CLASS" | |
| 59 | + | introspectable="0"> | |
| 60 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 61 | + | line="138"/> | |
| 62 | + | <parameters> | |
| 63 | + | <parameter name="klass"> | |
| 64 | + | </parameter> | |
| 65 | + | </parameters> | |
| 66 | + | </function-macro> | |
| 67 | + | <function-macro name="IS_PIXBUF_ANIMATION_ITER" | |
| 68 | + | c:identifier="GDK_IS_PIXBUF_ANIMATION_ITER" | |
| 69 | + | introspectable="0"> | |
| 70 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 71 | + | line="50"/> | |
| 72 | + | <parameters> | |
| 73 | + | <parameter name="object"> | |
| 74 | + | </parameter> | |
| 75 | + | </parameters> | |
| 76 | + | </function-macro> | |
| 77 | + | <function-macro name="IS_PIXBUF_ANIMATION_ITER_CLASS" | |
| 78 | + | c:identifier="GDK_IS_PIXBUF_ANIMATION_ITER_CLASS" | |
| 79 | + | introspectable="0"> | |
| 80 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 81 | + | line="186"/> | |
| 82 | + | <parameters> | |
| 83 | + | <parameter name="klass"> | |
| 84 | + | </parameter> | |
| 85 | + | </parameters> | |
| 86 | + | </function-macro> | |
| 87 | + | <function-macro name="IS_PIXBUF_LOADER" | |
| 88 | + | c:identifier="GDK_IS_PIXBUF_LOADER" | |
| 89 | + | introspectable="0"> | |
| 90 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" line="42"/> | |
| 91 | + | <parameters> | |
| 92 | + | <parameter name="obj"> | |
| 93 | + | </parameter> | |
| 94 | + | </parameters> | |
| 95 | + | </function-macro> | |
| 96 | + | <function-macro name="IS_PIXBUF_LOADER_CLASS" | |
| 97 | + | c:identifier="GDK_IS_PIXBUF_LOADER_CLASS" | |
| 98 | + | introspectable="0"> | |
| 99 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" line="43"/> | |
| 100 | + | <parameters> | |
| 101 | + | <parameter name="klass"> | |
| 102 | + | </parameter> | |
| 103 | + | </parameters> | |
| 104 | + | </function-macro> | |
| 105 | + | <function-macro name="IS_PIXBUF_SIMPLE_ANIM" | |
| 106 | + | c:identifier="GDK_IS_PIXBUF_SIMPLE_ANIM" | |
| 107 | + | introspectable="0"> | |
| 108 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.h" | |
| 109 | + | line="43"/> | |
| 110 | + | <parameters> | |
| 111 | + | <parameter name="object"> | |
| 112 | + | </parameter> | |
| 113 | + | </parameters> | |
| 114 | + | </function-macro> | |
| 115 | + | <function-macro name="IS_PIXBUF_SIMPLE_ANIM_CLASS" | |
| 116 | + | c:identifier="GDK_IS_PIXBUF_SIMPLE_ANIM_CLASS" | |
| 117 | + | introspectable="0"> | |
| 118 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.h" | |
| 119 | + | line="46"/> | |
| 120 | + | <parameters> | |
| 121 | + | <parameter name="klass"> | |
| 122 | + | </parameter> | |
| 123 | + | </parameters> | |
| 124 | + | </function-macro> | |
| 125 | + | <enumeration name="InterpType" | |
| 126 | + | glib:type-name="GdkInterpType" | |
| 127 | + | glib:get-type="gdk_interp_type_get_type" | |
| 128 | + | c:type="GdkInterpType"> | |
| 129 | + | <doc xml:space="preserve" | |
| 130 | + | filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 131 | + | line="39">Interpolation modes for scaling functions. | |
| 132 | + | ||
| 133 | + | The `GDK_INTERP_NEAREST` mode is the fastest scaling method, but has | |
| 134 | + | horrible quality when scaling down; `GDK_INTERP_BILINEAR` is the best | |
| 135 | + | choice if you aren't sure what to choose, it has a good speed/quality | |
| 136 | + | balance. | |
| 137 | + | ||
| 138 | + | **Note**: Cubic filtering is missing from the list; hyperbolic | |
| 139 | + | interpolation is just as fast and results in higher quality.</doc> | |
| 140 | + | <member name="nearest" | |
| 141 | + | value="0" | |
| 142 | + | c:identifier="GDK_INTERP_NEAREST" | |
| 143 | + | glib:nick="nearest" | |
| 144 | + | glib:name="GDK_INTERP_NEAREST"> | |
| 145 | + | <doc xml:space="preserve" | |
| 146 | + | filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 147 | + | line="41">Nearest neighbor sampling; this is the fastest | |
| 148 | + | and lowest quality mode. Quality is normally unacceptable when scaling | |
| 149 | + | down, but may be OK when scaling up.</doc> | |
| 150 | + | </member> | |
| 151 | + | <member name="tiles" | |
| 152 | + | value="1" | |
| 153 | + | c:identifier="GDK_INTERP_TILES" | |
| 154 | + | glib:nick="tiles" | |
| 155 | + | glib:name="GDK_INTERP_TILES"> | |
| 156 | + | <doc xml:space="preserve" | |
| 157 | + | filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 158 | + | line="44">This is an accurate simulation of the PostScript | |
| 159 | + | image operator without any interpolation enabled. Each pixel is | |
| 160 | + | rendered as a tiny parallelogram of solid color, the edges of which | |
| 161 | + | are implemented with antialiasing. It resembles nearest neighbor for | |
| 162 | + | enlargement, and bilinear for reduction.</doc> | |
| 163 | + | </member> | |
| 164 | + | <member name="bilinear" | |
| 165 | + | value="2" | |
| 166 | + | c:identifier="GDK_INTERP_BILINEAR" | |
| 167 | + | glib:nick="bilinear" | |
| 168 | + | glib:name="GDK_INTERP_BILINEAR"> | |
| 169 | + | <doc xml:space="preserve" | |
| 170 | + | filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 171 | + | line="49">Best quality/speed balance; use this mode by | |
| 172 | + | default. Bilinear interpolation. For enlargement, it is | |
| 173 | + | equivalent to point-sampling the ideal bilinear-interpolated image. | |
| 174 | + | For reduction, it is equivalent to laying down small tiles and | |
| 175 | + | integrating over the coverage area.</doc> | |
| 176 | + | </member> | |
| 177 | + | <member name="hyper" | |
| 178 | + | value="3" | |
| 179 | + | c:identifier="GDK_INTERP_HYPER" | |
| 180 | + | glib:nick="hyper" | |
| 181 | + | glib:name="GDK_INTERP_HYPER"> | |
| 182 | + | <doc xml:space="preserve" | |
| 183 | + | filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 184 | + | line="54">This is the slowest and highest quality | |
| 185 | + | reconstruction function. It is derived from the hyperbolic filters in | |
| 186 | + | Wolberg's "Digital Image Warping", and is formally defined as the | |
| 187 | + | hyperbolic-filter sampling the ideal hyperbolic-filter interpolated | |
| 188 | + | image (the filter is designed to be idempotent for 1:1 pixel mapping). | |
| 189 | + | **Deprecated**: this interpolation filter is deprecated, as in reality | |
| 190 | + | it has a lower quality than the @GDK_INTERP_BILINEAR filter | |
| 191 | + | (Since: 2.38)</doc> | |
| 192 | + | </member> | |
| 193 | + | </enumeration> | |
| 194 | + | <function-macro name="PIXBUF" c:identifier="GDK_PIXBUF" introspectable="0"> | |
| 195 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" line="92"/> | |
| 196 | + | <parameters> | |
| 197 | + | <parameter name="object"> | |
| 198 | + | </parameter> | |
| 199 | + | </parameters> | |
| 200 | + | </function-macro> | |
| 201 | + | <function-macro name="PIXBUF_ANIMATION" | |
| 202 | + | c:identifier="GDK_PIXBUF_ANIMATION" | |
| 203 | + | introspectable="0"> | |
| 204 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 205 | + | line="45"/> | |
| 206 | + | <parameters> | |
| 207 | + | <parameter name="object"> | |
| 208 | + | </parameter> | |
| 209 | + | </parameters> | |
| 210 | + | </function-macro> | |
| 211 | + | <function-macro name="PIXBUF_ANIMATION_CLASS" | |
| 212 | + | c:identifier="GDK_PIXBUF_ANIMATION_CLASS" | |
| 213 | + | introspectable="0"> | |
| 214 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 215 | + | line="137"/> | |
| 216 | + | <parameters> | |
| 217 | + | <parameter name="klass"> | |
| 218 | + | </parameter> | |
| 219 | + | </parameters> | |
| 220 | + | </function-macro> | |
| 221 | + | <function-macro name="PIXBUF_ANIMATION_GET_CLASS" | |
| 222 | + | c:identifier="GDK_PIXBUF_ANIMATION_GET_CLASS" | |
| 223 | + | introspectable="0"> | |
| 224 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 225 | + | line="139"/> | |
| 226 | + | <parameters> | |
| 227 | + | <parameter name="obj"> | |
| 228 | + | </parameter> | |
| 229 | + | </parameters> | |
| 230 | + | </function-macro> | |
| 231 | + | <function-macro name="PIXBUF_ANIMATION_ITER" | |
| 232 | + | c:identifier="GDK_PIXBUF_ANIMATION_ITER" | |
| 233 | + | introspectable="0"> | |
| 234 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 235 | + | line="49"/> | |
| 236 | + | <parameters> | |
| 237 | + | <parameter name="object"> | |
| 238 | + | </parameter> | |
| 239 | + | </parameters> | |
| 240 | + | </function-macro> | |
| 241 | + | <function-macro name="PIXBUF_ANIMATION_ITER_CLASS" | |
| 242 | + | c:identifier="GDK_PIXBUF_ANIMATION_ITER_CLASS" | |
| 243 | + | introspectable="0"> | |
| 244 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 245 | + | line="185"/> | |
| 246 | + | <parameters> | |
| 247 | + | <parameter name="klass"> | |
| 248 | + | </parameter> | |
| 249 | + | </parameters> | |
| 250 | + | </function-macro> | |
| 251 | + | <function-macro name="PIXBUF_ANIMATION_ITER_GET_CLASS" | |
| 252 | + | c:identifier="GDK_PIXBUF_ANIMATION_ITER_GET_CLASS" | |
| 253 | + | introspectable="0"> | |
| 254 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 255 | + | line="187"/> | |
| 256 | + | <parameters> | |
| 257 | + | <parameter name="obj"> | |
| 258 | + | </parameter> | |
| 259 | + | </parameters> | |
| 260 | + | </function-macro> | |
| 261 | + | <function-macro name="PIXBUF_CHECK_VERSION" | |
| 262 | + | c:identifier="GDK_PIXBUF_CHECK_VERSION" | |
| 263 | + | version="2.36" | |
| 264 | + | introspectable="0"> | |
| 265 | + | <doc xml:space="preserve" | |
| 266 | + | filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 267 | + | line="32">Macro to test the version of GdkPixbuf being compiled against.</doc> | |
| 268 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" line="45"/> | |
| 269 | + | <parameters> | |
| 270 | + | <parameter name="major"> | |
| 271 | + | <doc xml:space="preserve" | |
| 272 | + | filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 273 | + | line="34">major version (e.g. 2 for version 2.34.0)</doc> | |
| 274 | + | </parameter> | |
| 275 | + | <parameter name="minor"> | |
| 276 | + | <doc xml:space="preserve" | |
| 277 | + | filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 278 | + | line="35">minor version (e.g. 34 for version 2.34.0)</doc> | |
| 279 | + | </parameter> | |
| 280 | + | <parameter name="micro"> | |
| 281 | + | <doc xml:space="preserve" | |
| 282 | + | filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 283 | + | line="36">micro version (e.g. 0 for version 2.34.0)</doc> | |
| 284 | + | </parameter> | |
| 285 | + | </parameters> | |
| 286 | + | </function-macro> | |
| 287 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_0_FOR" | |
| 288 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_0_FOR" | |
| 289 | + | introspectable="0"> | |
| 290 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 291 | + | line="343"/> | |
| 292 | + | <parameters> | |
| 293 | + | <parameter name="f"> | |
| 294 | + | </parameter> | |
| 295 | + | </parameters> | |
| 296 | + | </function-macro> | |
| 297 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_10_FOR" | |
| 298 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_10_FOR" | |
| 299 | + | introspectable="0"> | |
| 300 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 301 | + | line="433"/> | |
| 302 | + | <parameters> | |
| 303 | + | <parameter name="f"> | |
| 304 | + | </parameter> | |
| 305 | + | </parameters> | |
| 306 | + | </function-macro> | |
| 307 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_12_FOR" | |
| 308 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_12_FOR" | |
| 309 | + | introspectable="0"> | |
| 310 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 311 | + | line="451"/> | |
| 312 | + | <parameters> | |
| 313 | + | <parameter name="f"> | |
| 314 | + | </parameter> | |
| 315 | + | </parameters> | |
| 316 | + | </function-macro> | |
| 317 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_14_FOR" | |
| 318 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_14_FOR" | |
| 319 | + | introspectable="0"> | |
| 320 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 321 | + | line="469"/> | |
| 322 | + | <parameters> | |
| 323 | + | <parameter name="f"> | |
| 324 | + | </parameter> | |
| 325 | + | </parameters> | |
| 326 | + | </function-macro> | |
| 327 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_16_FOR" | |
| 328 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_16_FOR" | |
| 329 | + | introspectable="0"> | |
| 330 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 331 | + | line="487"/> | |
| 332 | + | <parameters> | |
| 333 | + | <parameter name="f"> | |
| 334 | + | </parameter> | |
| 335 | + | </parameters> | |
| 336 | + | </function-macro> | |
| 337 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_18_FOR" | |
| 338 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_18_FOR" | |
| 339 | + | introspectable="0"> | |
| 340 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 341 | + | line="505"/> | |
| 342 | + | <parameters> | |
| 343 | + | <parameter name="f"> | |
| 344 | + | </parameter> | |
| 345 | + | </parameters> | |
| 346 | + | </function-macro> | |
| 347 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_20_FOR" | |
| 348 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_20_FOR" | |
| 349 | + | introspectable="0"> | |
| 350 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 351 | + | line="523"/> | |
| 352 | + | <parameters> | |
| 353 | + | <parameter name="f"> | |
| 354 | + | </parameter> | |
| 355 | + | </parameters> | |
| 356 | + | </function-macro> | |
| 357 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_22_FOR" | |
| 358 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_22_FOR" | |
| 359 | + | introspectable="0"> | |
| 360 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 361 | + | line="541"/> | |
| 362 | + | <parameters> | |
| 363 | + | <parameter name="f"> | |
| 364 | + | </parameter> | |
| 365 | + | </parameters> | |
| 366 | + | </function-macro> | |
| 367 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_24_FOR" | |
| 368 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_24_FOR" | |
| 369 | + | introspectable="0"> | |
| 370 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 371 | + | line="559"/> | |
| 372 | + | <parameters> | |
| 373 | + | <parameter name="f"> | |
| 374 | + | </parameter> | |
| 375 | + | </parameters> | |
| 376 | + | </function-macro> | |
| 377 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_26_FOR" | |
| 378 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_26_FOR" | |
| 379 | + | introspectable="0"> | |
| 380 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 381 | + | line="577"/> | |
| 382 | + | <parameters> | |
| 383 | + | <parameter name="f"> | |
| 384 | + | </parameter> | |
| 385 | + | </parameters> | |
| 386 | + | </function-macro> | |
| 387 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_28_FOR" | |
| 388 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_28_FOR" | |
| 389 | + | introspectable="0"> | |
| 390 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 391 | + | line="595"/> | |
| 392 | + | <parameters> | |
| 393 | + | <parameter name="f"> | |
| 394 | + | </parameter> | |
| 395 | + | </parameters> | |
| 396 | + | </function-macro> | |
| 397 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_2_FOR" | |
| 398 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_2_FOR" | |
| 399 | + | introspectable="0"> | |
| 400 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 401 | + | line="361"/> | |
| 402 | + | <parameters> | |
| 403 | + | <parameter name="f"> | |
| 404 | + | </parameter> | |
| 405 | + | </parameters> | |
| 406 | + | </function-macro> | |
| 407 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_30_FOR" | |
| 408 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_30_FOR" | |
| 409 | + | introspectable="0"> | |
| 410 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 411 | + | line="613"/> | |
| 412 | + | <parameters> | |
| 413 | + | <parameter name="f"> | |
| 414 | + | </parameter> | |
| 415 | + | </parameters> | |
| 416 | + | </function-macro> | |
| 417 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_32_FOR" | |
| 418 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_32_FOR" | |
| 419 | + | introspectable="0"> | |
| 420 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 421 | + | line="631"/> | |
| 422 | + | <parameters> | |
| 423 | + | <parameter name="f"> | |
| 424 | + | </parameter> | |
| 425 | + | </parameters> | |
| 426 | + | </function-macro> | |
| 427 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_34_FOR" | |
| 428 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_34_FOR" | |
| 429 | + | introspectable="0"> | |
| 430 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 431 | + | line="649"/> | |
| 432 | + | <parameters> | |
| 433 | + | <parameter name="f"> | |
| 434 | + | </parameter> | |
| 435 | + | </parameters> | |
| 436 | + | </function-macro> | |
| 437 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_36_FOR" | |
| 438 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_36_FOR" | |
| 439 | + | introspectable="0"> | |
| 440 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 441 | + | line="667"/> | |
| 442 | + | <parameters> | |
| 443 | + | <parameter name="f"> | |
| 444 | + | </parameter> | |
| 445 | + | </parameters> | |
| 446 | + | </function-macro> | |
| 447 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_38_FOR" | |
| 448 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_38_FOR" | |
| 449 | + | introspectable="0"> | |
| 450 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 451 | + | line="685"/> | |
| 452 | + | <parameters> | |
| 453 | + | <parameter name="f"> | |
| 454 | + | </parameter> | |
| 455 | + | </parameters> | |
| 456 | + | </function-macro> | |
| 457 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_40_FOR" | |
| 458 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_40_FOR" | |
| 459 | + | introspectable="0"> | |
| 460 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 461 | + | line="703"/> | |
| 462 | + | <parameters> | |
| 463 | + | <parameter name="f"> | |
| 464 | + | </parameter> | |
| 465 | + | </parameters> | |
| 466 | + | </function-macro> | |
| 467 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_4_FOR" | |
| 468 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_4_FOR" | |
| 469 | + | introspectable="0"> | |
| 470 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 471 | + | line="379"/> | |
| 472 | + | <parameters> | |
| 473 | + | <parameter name="f"> | |
| 474 | + | </parameter> | |
| 475 | + | </parameters> | |
| 476 | + | </function-macro> | |
| 477 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_6_FOR" | |
| 478 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_6_FOR" | |
| 479 | + | introspectable="0"> | |
| 480 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 481 | + | line="397"/> | |
| 482 | + | <parameters> | |
| 483 | + | <parameter name="f"> | |
| 484 | + | </parameter> | |
| 485 | + | </parameters> | |
| 486 | + | </function-macro> | |
| 487 | + | <function-macro name="PIXBUF_DEPRECATED_IN_2_8_FOR" | |
| 488 | + | c:identifier="GDK_PIXBUF_DEPRECATED_IN_2_8_FOR" | |
| 489 | + | introspectable="0"> | |
| 490 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-macros.h" | |
| 491 | + | line="415"/> | |
| 492 | + | <parameters> | |
| 493 | + | <parameter name="f"> | |
| 494 | + | </parameter> | |
| 495 | + | </parameters> | |
| 496 | + | </function-macro> | |
| 497 | + | <function-macro name="PIXBUF_LOADER" | |
| 498 | + | c:identifier="GDK_PIXBUF_LOADER" | |
| 499 | + | introspectable="0"> | |
| 500 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" line="40"/> | |
| 501 | + | <parameters> | |
| 502 | + | <parameter name="obj"> | |
| 503 | + | </parameter> | |
| 504 | + | </parameters> | |
| 505 | + | </function-macro> | |
| 506 | + | <function-macro name="PIXBUF_LOADER_CLASS" | |
| 507 | + | c:identifier="GDK_PIXBUF_LOADER_CLASS" | |
| 508 | + | introspectable="0"> | |
| 509 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" line="41"/> | |
| 510 | + | <parameters> | |
| 511 | + | <parameter name="klass"> | |
| 512 | + | </parameter> | |
| 513 | + | </parameters> | |
| 514 | + | </function-macro> | |
| 515 | + | <function-macro name="PIXBUF_LOADER_GET_CLASS" | |
| 516 | + | c:identifier="GDK_PIXBUF_LOADER_GET_CLASS" | |
| 517 | + | introspectable="0"> | |
| 518 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" line="44"/> | |
| 519 | + | <parameters> | |
| 520 | + | <parameter name="obj"> | |
| 521 | + | </parameter> | |
| 522 | + | </parameters> | |
| 523 | + | </function-macro> | |
| 524 | + | <constant name="PIXBUF_MAJOR" value="2" c:type="GDK_PIXBUF_MAJOR"> | |
| 525 | + | <doc xml:space="preserve" | |
| 526 | + | filename="../gdk-pixbuf/gdk-pixbuf-features.h" | |
| 527 | + | line="10">Major version of gdk-pixbuf library, that is the "0" in | |
| 528 | + | "0.8.2" for example.</doc> | |
| 529 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-features.h" | |
| 530 | + | line="37"/> | |
| 531 | + | <type name="gint" c:type="gint"/> | |
| 532 | + | </constant> | |
| 533 | + | <constant name="PIXBUF_MICRO" value="10" c:type="GDK_PIXBUF_MICRO"> | |
| 534 | + | <doc xml:space="preserve" | |
| 535 | + | filename="../gdk-pixbuf/gdk-pixbuf-features.h" | |
| 536 | + | line="22">Micro version of gdk-pixbuf library, that is the "2" in | |
| 537 | + | "0.8.2" for example.</doc> | |
| 538 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-features.h" | |
| 539 | + | line="39"/> | |
| 540 | + | <type name="gint" c:type="gint"/> | |
| 541 | + | </constant> | |
| 542 | + | <constant name="PIXBUF_MINOR" value="42" c:type="GDK_PIXBUF_MINOR"> | |
| 543 | + | <doc xml:space="preserve" | |
| 544 | + | filename="../gdk-pixbuf/gdk-pixbuf-features.h" | |
| 545 | + | line="16">Minor version of gdk-pixbuf library, that is the "8" in | |
| 546 | + | "0.8.2" for example.</doc> | |
| 547 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-features.h" | |
| 548 | + | line="38"/> | |
| 549 | + | <type name="gint" c:type="gint"/> | |
| 550 | + | </constant> | |
| 551 | + | <function-macro name="PIXBUF_SIMPLE_ANIM" | |
| 552 | + | c:identifier="GDK_PIXBUF_SIMPLE_ANIM" | |
| 553 | + | introspectable="0"> | |
| 554 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.h" | |
| 555 | + | line="42"/> | |
| 556 | + | <parameters> | |
| 557 | + | <parameter name="object"> | |
| 558 | + | </parameter> | |
| 559 | + | </parameters> | |
| 560 | + | </function-macro> | |
| 561 | + | <function-macro name="PIXBUF_SIMPLE_ANIM_CLASS" | |
| 562 | + | c:identifier="GDK_PIXBUF_SIMPLE_ANIM_CLASS" | |
| 563 | + | introspectable="0"> | |
| 564 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.h" | |
| 565 | + | line="45"/> | |
| 566 | + | <parameters> | |
| 567 | + | <parameter name="klass"> | |
| 568 | + | </parameter> | |
| 569 | + | </parameters> | |
| 570 | + | </function-macro> | |
| 571 | + | <function-macro name="PIXBUF_SIMPLE_ANIM_GET_CLASS" | |
| 572 | + | c:identifier="GDK_PIXBUF_SIMPLE_ANIM_GET_CLASS" | |
| 573 | + | introspectable="0"> | |
| 574 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.h" | |
| 575 | + | line="47"/> | |
| 576 | + | <parameters> | |
| 577 | + | <parameter name="obj"> | |
| 578 | + | </parameter> | |
| 579 | + | </parameters> | |
| 580 | + | </function-macro> | |
| 581 | + | <constant name="PIXBUF_VERSION" | |
| 582 | + | value="2.42.10" | |
| 583 | + | c:type="GDK_PIXBUF_VERSION"> | |
| 584 | + | <doc xml:space="preserve" | |
| 585 | + | filename="../gdk-pixbuf/gdk-pixbuf-features.h" | |
| 586 | + | line="28">Contains the full version of GdkPixbuf as a string. | |
| 587 | + | ||
| 588 | + | This is the version being compiled against; contrast with | |
| 589 | + | `gdk_pixbuf_version`.</doc> | |
| 590 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-features.h" | |
| 591 | + | line="40"/> | |
| 592 | + | <type name="utf8" c:type="gchar*"/> | |
| 593 | + | </constant> | |
| 594 | + | <class name="Pixbuf" | |
| 595 | + | c:symbol-prefix="pixbuf" | |
| 596 | + | c:type="GdkPixbuf" | |
| 597 | + | parent="GObject.Object" | |
| 598 | + | glib:type-name="GdkPixbuf" | |
| 599 | + | glib:get-type="gdk_pixbuf_get_type"> | |
| 600 | + | <doc xml:space="preserve" | |
| 601 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 602 | + | line="24">A pixel buffer. | |
| 603 | + | ||
| 604 | + | `GdkPixbuf` contains information about an image's pixel data, | |
| 605 | + | its color space, bits per sample, width and height, and the | |
| 606 | + | rowstride (the number of bytes between the start of one row | |
| 607 | + | and the start of the next). | |
| 608 | + | ||
| 609 | + | ## Creating new `GdkPixbuf` | |
| 610 | + | ||
| 611 | + | The most basic way to create a pixbuf is to wrap an existing pixel | |
| 612 | + | buffer with a [class@GdkPixbuf.Pixbuf] instance. You can use the | |
| 613 | + | [`ctor@GdkPixbuf.Pixbuf.new_from_data`] function to do this. | |
| 614 | + | ||
| 615 | + | Every time you create a new `GdkPixbuf` instance for some data, you | |
| 616 | + | will need to specify the destroy notification function that will be | |
| 617 | + | called when the data buffer needs to be freed; this will happen when | |
| 618 | + | a `GdkPixbuf` is finalized by the reference counting functions. If | |
| 619 | + | you have a chunk of static data compiled into your application, you | |
| 620 | + | can pass in `NULL` as the destroy notification function so that the | |
| 621 | + | data will not be freed. | |
| 622 | + | ||
| 623 | + | The [`ctor@GdkPixbuf.Pixbuf.new`] constructor function can be used | |
| 624 | + | as a convenience to create a pixbuf with an empty buffer; this is | |
| 625 | + | equivalent to allocating a data buffer using `malloc()` and then | |
| 626 | + | wrapping it with `gdk_pixbuf_new_from_data()`. The `gdk_pixbuf_new()` | |
| 627 | + | function will compute an optimal rowstride so that rendering can be | |
| 628 | + | performed with an efficient algorithm. | |
| 629 | + | ||
| 630 | + | As a special case, you can use the [`ctor@GdkPixbuf.Pixbuf.new_from_xpm_data`] | |
| 631 | + | function to create a pixbuf from inline XPM image data. | |
| 632 | + | ||
| 633 | + | You can also copy an existing pixbuf with the [method@Pixbuf.copy] | |
| 634 | + | function. This is not the same as just acquiring a reference to | |
| 635 | + | the old pixbuf instance: the copy function will actually duplicate | |
| 636 | + | the pixel data in memory and create a new [class@Pixbuf] instance | |
| 637 | + | for it. | |
| 638 | + | ||
| 639 | + | ## Reference counting | |
| 640 | + | ||
| 641 | + | `GdkPixbuf` structures are reference counted. This means that an | |
| 642 | + | application can share a single pixbuf among many parts of the | |
| 643 | + | code. When a piece of the program needs to use a pixbuf, it should | |
| 644 | + | acquire a reference to it by calling `g_object_ref()`; when it no | |
| 645 | + | longer needs the pixbuf, it should release the reference it acquired | |
| 646 | + | by calling `g_object_unref()`. The resources associated with a | |
| 647 | + | `GdkPixbuf` will be freed when its reference count drops to zero. | |
| 648 | + | Newly-created `GdkPixbuf` instances start with a reference count | |
| 649 | + | of one. | |
| 650 | + | ||
| 651 | + | ## Image Data | |
| 652 | + | ||
| 653 | + | Image data in a pixbuf is stored in memory in an uncompressed, | |
| 654 | + | packed format. Rows in the image are stored top to bottom, and | |
| 655 | + | in each row pixels are stored from left to right. | |
| 656 | + | ||
| 657 | + | There may be padding at the end of a row. | |
| 658 | + | ||
| 659 | + | The "rowstride" value of a pixbuf, as returned by [`method@GdkPixbuf.Pixbuf.get_rowstride`], | |
| 660 | + | indicates the number of bytes between rows. | |
| 661 | + | ||
| 662 | + | **NOTE**: If you are copying raw pixbuf data with `memcpy()` note that the | |
| 663 | + | last row in the pixbuf may not be as wide as the full rowstride, but rather | |
| 664 | + | just as wide as the pixel data needs to be; that is: it is unsafe to do | |
| 665 | + | `memcpy (dest, pixels, rowstride * height)` to copy a whole pixbuf. Use | |
| 666 | + | [method@GdkPixbuf.Pixbuf.copy] instead, or compute the width in bytes of the | |
| 667 | + | last row as: | |
| 668 | + | ||
| 669 | + | ```c | |
| 670 | + | last_row = width * ((n_channels * bits_per_sample + 7) / 8); | |
| 671 | + | ``` | |
| 672 | + | ||
| 673 | + | The same rule applies when iterating over each row of a `GdkPixbuf` pixels | |
| 674 | + | array. | |
| 675 | + | ||
| 676 | + | The following code illustrates a simple `put_pixel()` | |
| 677 | + | function for RGB pixbufs with 8 bits per channel with an alpha | |
| 678 | + | channel. | |
| 679 | + | ||
| 680 | + | ```c | |
| 681 | + | static void | |
| 682 | + | put_pixel (GdkPixbuf *pixbuf, | |
| 683 | + | int x, | |
| 684 | + | int y, | |
| 685 | + | guchar red, | |
| 686 | + | guchar green, | |
| 687 | + | guchar blue, | |
| 688 | + | guchar alpha) | |
| 689 | + | { | |
| 690 | + | int n_channels = gdk_pixbuf_get_n_channels (pixbuf); | |
| 691 | + | ||
| 692 | + | // Ensure that the pixbuf is valid | |
| 693 | + | g_assert (gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB); | |
| 694 | + | g_assert (gdk_pixbuf_get_bits_per_sample (pixbuf) == 8); | |
| 695 | + | g_assert (gdk_pixbuf_get_has_alpha (pixbuf)); | |
| 696 | + | g_assert (n_channels == 4); | |
| 697 | + | ||
| 698 | + | int width = gdk_pixbuf_get_width (pixbuf); | |
| 699 | + | int height = gdk_pixbuf_get_height (pixbuf); | |
| 700 | + | ||
| 701 | + | // Ensure that the coordinates are in a valid range | |
| 702 | + | g_assert (x >= 0 && x < width); | |
| 703 | + | g_assert (y >= 0 && y < height); | |
| 704 | + | ||
| 705 | + | int rowstride = gdk_pixbuf_get_rowstride (pixbuf); | |
| 706 | + | ||
| 707 | + | // The pixel buffer in the GdkPixbuf instance | |
| 708 | + | guchar *pixels = gdk_pixbuf_get_pixels (pixbuf); | |
| 709 | + | ||
| 710 | + | // The pixel we wish to modify | |
| 711 | + | guchar *p = pixels + y * rowstride + x * n_channels; | |
| 712 | + | p[0] = red; | |
| 713 | + | p[1] = green; | |
| 714 | + | p[2] = blue; | |
| 715 | + | p[3] = alpha; | |
| 716 | + | } | |
| 717 | + | ``` | |
| 718 | + | ||
| 719 | + | ## Loading images | |
| 720 | + | ||
| 721 | + | The `GdkPixBuf` class provides a simple mechanism for loading | |
| 722 | + | an image from a file in synchronous and asynchronous fashion. | |
| 723 | + | ||
| 724 | + | For GUI applications, it is recommended to use the asynchronous | |
| 725 | + | stream API to avoid blocking the control flow of the application. | |
| 726 | + | ||
| 727 | + | Additionally, `GdkPixbuf` provides the [class@GdkPixbuf.PixbufLoader`] | |
| 728 | + | API for progressive image loading. | |
| 729 | + | ||
| 730 | + | ## Saving images | |
| 731 | + | ||
| 732 | + | The `GdkPixbuf` class provides methods for saving image data in | |
| 733 | + | a number of file formats. The formatted data can be written to a | |
| 734 | + | file or to a memory buffer. `GdkPixbuf` can also call a user-defined | |
| 735 | + | callback on the data, which allows to e.g. write the image | |
| 736 | + | to a socket or store it in a database.</doc> | |
| 737 | + | <implements name="Gio.Icon"/> | |
| 738 | + | <implements name="Gio.LoadableIcon"/> | |
| 739 | + | <constructor name="new" c:identifier="gdk_pixbuf_new"> | |
| 740 | + | <doc xml:space="preserve" | |
| 741 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 742 | + | line="599">Creates a new `GdkPixbuf` structure and allocates a buffer for it. | |
| 743 | + | ||
| 744 | + | If the allocation of the buffer failed, this function will return `NULL`. | |
| 745 | + | ||
| 746 | + | The buffer has an optimal rowstride. Note that the buffer is not cleared; | |
| 747 | + | you will have to fill it completely yourself.</doc> | |
| 748 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 749 | + | line="206"/> | |
| 750 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 751 | + | <doc xml:space="preserve" | |
| 752 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 753 | + | line="614">A newly-created pixel buffer</doc> | |
| 754 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 755 | + | </return-value> | |
| 756 | + | <parameters> | |
| 757 | + | <parameter name="colorspace" transfer-ownership="none"> | |
| 758 | + | <doc xml:space="preserve" | |
| 759 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 760 | + | line="601">Color space for image</doc> | |
| 761 | + | <type name="Colorspace" c:type="GdkColorspace"/> | |
| 762 | + | </parameter> | |
| 763 | + | <parameter name="has_alpha" transfer-ownership="none"> | |
| 764 | + | <doc xml:space="preserve" | |
| 765 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 766 | + | line="602">Whether the image should have transparency information</doc> | |
| 767 | + | <type name="gboolean" c:type="gboolean"/> | |
| 768 | + | </parameter> | |
| 769 | + | <parameter name="bits_per_sample" transfer-ownership="none"> | |
| 770 | + | <doc xml:space="preserve" | |
| 771 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 772 | + | line="603">Number of bits per color sample</doc> | |
| 773 | + | <type name="gint" c:type="int"/> | |
| 774 | + | </parameter> | |
| 775 | + | <parameter name="width" transfer-ownership="none"> | |
| 776 | + | <doc xml:space="preserve" | |
| 777 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 778 | + | line="604">Width of image in pixels, must be > 0</doc> | |
| 779 | + | <type name="gint" c:type="int"/> | |
| 780 | + | </parameter> | |
| 781 | + | <parameter name="height" transfer-ownership="none"> | |
| 782 | + | <doc xml:space="preserve" | |
| 783 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 784 | + | line="605">Height of image in pixels, must be > 0</doc> | |
| 785 | + | <type name="gint" c:type="int"/> | |
| 786 | + | </parameter> | |
| 787 | + | </parameters> | |
| 788 | + | </constructor> | |
| 789 | + | <constructor name="new_from_bytes" | |
| 790 | + | c:identifier="gdk_pixbuf_new_from_bytes" | |
| 791 | + | version="2.32"> | |
| 792 | + | <doc xml:space="preserve" | |
| 793 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 794 | + | line="94">Creates a new #GdkPixbuf out of in-memory readonly image data. | |
| 795 | + | ||
| 796 | + | Currently only RGB images with 8 bits per sample are supported. | |
| 797 | + | ||
| 798 | + | This is the `GBytes` variant of gdk_pixbuf_new_from_data(), useful | |
| 799 | + | for language bindings.</doc> | |
| 800 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 801 | + | line="286"/> | |
| 802 | + | <return-value transfer-ownership="full"> | |
| 803 | + | <doc xml:space="preserve" | |
| 804 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 805 | + | line="111">A newly-created pixbuf</doc> | |
| 806 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 807 | + | </return-value> | |
| 808 | + | <parameters> | |
| 809 | + | <parameter name="data" transfer-ownership="none"> | |
| 810 | + | <doc xml:space="preserve" | |
| 811 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 812 | + | line="96">Image data in 8-bit/sample packed format inside a #GBytes</doc> | |
| 813 | + | <type name="GLib.Bytes" c:type="GBytes*"/> | |
| 814 | + | </parameter> | |
| 815 | + | <parameter name="colorspace" transfer-ownership="none"> | |
| 816 | + | <doc xml:space="preserve" | |
| 817 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 818 | + | line="97">Colorspace for the image data</doc> | |
| 819 | + | <type name="Colorspace" c:type="GdkColorspace"/> | |
| 820 | + | </parameter> | |
| 821 | + | <parameter name="has_alpha" transfer-ownership="none"> | |
| 822 | + | <doc xml:space="preserve" | |
| 823 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 824 | + | line="98">Whether the data has an opacity channel</doc> | |
| 825 | + | <type name="gboolean" c:type="gboolean"/> | |
| 826 | + | </parameter> | |
| 827 | + | <parameter name="bits_per_sample" transfer-ownership="none"> | |
| 828 | + | <doc xml:space="preserve" | |
| 829 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 830 | + | line="99">Number of bits per sample</doc> | |
| 831 | + | <type name="gint" c:type="int"/> | |
| 832 | + | </parameter> | |
| 833 | + | <parameter name="width" transfer-ownership="none"> | |
| 834 | + | <doc xml:space="preserve" | |
| 835 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 836 | + | line="100">Width of the image in pixels, must be > 0</doc> | |
| 837 | + | <type name="gint" c:type="int"/> | |
| 838 | + | </parameter> | |
| 839 | + | <parameter name="height" transfer-ownership="none"> | |
| 840 | + | <doc xml:space="preserve" | |
| 841 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 842 | + | line="101">Height of the image in pixels, must be > 0</doc> | |
| 843 | + | <type name="gint" c:type="int"/> | |
| 844 | + | </parameter> | |
| 845 | + | <parameter name="rowstride" transfer-ownership="none"> | |
| 846 | + | <doc xml:space="preserve" | |
| 847 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 848 | + | line="102">Distance in bytes between row starts</doc> | |
| 849 | + | <type name="gint" c:type="int"/> | |
| 850 | + | </parameter> | |
| 851 | + | </parameters> | |
| 852 | + | </constructor> | |
| 853 | + | <constructor name="new_from_data" | |
| 854 | + | c:identifier="gdk_pixbuf_new_from_data"> | |
| 855 | + | <doc xml:space="preserve" | |
| 856 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 857 | + | line="29">Creates a new #GdkPixbuf out of in-memory image data. | |
| 858 | + | ||
| 859 | + | Currently only RGB images with 8 bits per sample are supported. | |
| 860 | + | ||
| 861 | + | Since you are providing a pre-allocated pixel buffer, you must also | |
| 862 | + | specify a way to free that data. This is done with a function of | |
| 863 | + | type `GdkPixbufDestroyNotify`. When a pixbuf created with is | |
| 864 | + | finalized, your destroy notification function will be called, and | |
| 865 | + | it is its responsibility to free the pixel array. | |
| 866 | + | ||
| 867 | + | See also: [ctor@GdkPixbuf.Pixbuf.new_from_bytes]</doc> | |
| 868 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 869 | + | line="276"/> | |
| 870 | + | <return-value transfer-ownership="full"> | |
| 871 | + | <doc xml:space="preserve" | |
| 872 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 873 | + | line="54">A newly-created pixbuf</doc> | |
| 874 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 875 | + | </return-value> | |
| 876 | + | <parameters> | |
| 877 | + | <parameter name="data" transfer-ownership="none"> | |
| 878 | + | <doc xml:space="preserve" | |
| 879 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 880 | + | line="31">Image data in 8-bit/sample packed format</doc> | |
| 881 | + | <array zero-terminated="0" c:type="const guchar*"> | |
| 882 | + | <type name="guint8" c:type="guchar"/> | |
| 883 | + | </array> | |
| 884 | + | </parameter> | |
| 885 | + | <parameter name="colorspace" transfer-ownership="none"> | |
| 886 | + | <doc xml:space="preserve" | |
| 887 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 888 | + | line="32">Colorspace for the image data</doc> | |
| 889 | + | <type name="Colorspace" c:type="GdkColorspace"/> | |
| 890 | + | </parameter> | |
| 891 | + | <parameter name="has_alpha" transfer-ownership="none"> | |
| 892 | + | <doc xml:space="preserve" | |
| 893 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 894 | + | line="33">Whether the data has an opacity channel</doc> | |
| 895 | + | <type name="gboolean" c:type="gboolean"/> | |
| 896 | + | </parameter> | |
| 897 | + | <parameter name="bits_per_sample" transfer-ownership="none"> | |
| 898 | + | <doc xml:space="preserve" | |
| 899 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 900 | + | line="34">Number of bits per sample</doc> | |
| 901 | + | <type name="gint" c:type="int"/> | |
| 902 | + | </parameter> | |
| 903 | + | <parameter name="width" transfer-ownership="none"> | |
| 904 | + | <doc xml:space="preserve" | |
| 905 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 906 | + | line="35">Width of the image in pixels, must be > 0</doc> | |
| 907 | + | <type name="gint" c:type="int"/> | |
| 908 | + | </parameter> | |
| 909 | + | <parameter name="height" transfer-ownership="none"> | |
| 910 | + | <doc xml:space="preserve" | |
| 911 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 912 | + | line="36">Height of the image in pixels, must be > 0</doc> | |
| 913 | + | <type name="gint" c:type="int"/> | |
| 914 | + | </parameter> | |
| 915 | + | <parameter name="rowstride" transfer-ownership="none"> | |
| 916 | + | <doc xml:space="preserve" | |
| 917 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 918 | + | line="37">Distance in bytes between row starts</doc> | |
| 919 | + | <type name="gint" c:type="int"/> | |
| 920 | + | </parameter> | |
| 921 | + | <parameter name="destroy_fn" | |
| 922 | + | transfer-ownership="none" | |
| 923 | + | nullable="1" | |
| 924 | + | allow-none="1" | |
| 925 | + | scope="async" | |
| 926 | + | closure="8"> | |
| 927 | + | <doc xml:space="preserve" | |
| 928 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 929 | + | line="38">Function used to free the data when the pixbuf's reference count | |
| 930 | + | drops to zero, or %NULL if the data should not be freed</doc> | |
| 931 | + | <type name="PixbufDestroyNotify" c:type="GdkPixbufDestroyNotify"/> | |
| 932 | + | </parameter> | |
| 933 | + | <parameter name="destroy_fn_data" | |
| 934 | + | transfer-ownership="none" | |
| 935 | + | nullable="1" | |
| 936 | + | allow-none="1"> | |
| 937 | + | <doc xml:space="preserve" | |
| 938 | + | filename="../gdk-pixbuf/gdk-pixbuf-data.c" | |
| 939 | + | line="40">Closure data to pass to the destroy notification function</doc> | |
| 940 | + | <type name="gpointer" c:type="gpointer"/> | |
| 941 | + | </parameter> | |
| 942 | + | </parameters> | |
| 943 | + | </constructor> | |
| 944 | + | <constructor name="new_from_file" | |
| 945 | + | c:identifier="gdk_pixbuf_new_from_file" | |
| 946 | + | throws="1"> | |
| 947 | + | <doc xml:space="preserve" | |
| 948 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 949 | + | line="1089">Creates a new pixbuf by loading an image from a file. | |
| 950 | + | ||
| 951 | + | The file format is detected automatically. | |
| 952 | + | ||
| 953 | + | If `NULL` is returned, then @error will be set. Possible errors are: | |
| 954 | + | ||
| 955 | + | - the file could not be opened | |
| 956 | + | - there is no loader for the file's format | |
| 957 | + | - there is not enough memory to allocate the image buffer | |
| 958 | + | - the image buffer contains invalid data | |
| 959 | + | ||
| 960 | + | The error domains are `GDK_PIXBUF_ERROR` and `G_FILE_ERROR`.</doc> | |
| 961 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 962 | + | line="252"/> | |
| 963 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 964 | + | <doc xml:space="preserve" | |
| 965 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 966 | + | line="1108">A newly-created pixbuf</doc> | |
| 967 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 968 | + | </return-value> | |
| 969 | + | <parameters> | |
| 970 | + | <parameter name="filename" transfer-ownership="none"> | |
| 971 | + | <doc xml:space="preserve" | |
| 972 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 973 | + | line="1091">Name of file to load, in the GLib file | |
| 974 | + | name encoding</doc> | |
| 975 | + | <type name="filename" c:type="const char*"/> | |
| 976 | + | </parameter> | |
| 977 | + | </parameters> | |
| 978 | + | </constructor> | |
| 979 | + | <constructor name="new_from_file_at_scale" | |
| 980 | + | c:identifier="gdk_pixbuf_new_from_file_at_scale" | |
| 981 | + | version="2.6" | |
| 982 | + | throws="1"> | |
| 983 | + | <doc xml:space="preserve" | |
| 984 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 985 | + | line="1337">Creates a new pixbuf by loading an image from a file. | |
| 986 | + | ||
| 987 | + | The file format is detected automatically. | |
| 988 | + | ||
| 989 | + | If `NULL` is returned, then @error will be set. Possible errors are: | |
| 990 | + | ||
| 991 | + | - the file could not be opened | |
| 992 | + | - there is no loader for the file's format | |
| 993 | + | - there is not enough memory to allocate the image buffer | |
| 994 | + | - the image buffer contains invalid data | |
| 995 | + | ||
| 996 | + | The error domains are `GDK_PIXBUF_ERROR` and `G_FILE_ERROR`. | |
| 997 | + | ||
| 998 | + | The image will be scaled to fit in the requested size, optionally preserving | |
| 999 | + | the image's aspect ratio. | |
| 1000 | + | ||
| 1001 | + | When preserving the aspect ratio, a `width` of -1 will cause the image | |
| 1002 | + | to be scaled to the exact given height, and a `height` of -1 will cause | |
| 1003 | + | the image to be scaled to the exact given width. When not preserving | |
| 1004 | + | aspect ratio, a `width` or `height` of -1 means to not scale the image | |
| 1005 | + | at all in that dimension. Negative values for `width` and `height` are | |
| 1006 | + | allowed since 2.8.</doc> | |
| 1007 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 1008 | + | line="260"/> | |
| 1009 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 1010 | + | <doc xml:space="preserve" | |
| 1011 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1012 | + | line="1369">A newly-created pixbuf</doc> | |
| 1013 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 1014 | + | </return-value> | |
| 1015 | + | <parameters> | |
| 1016 | + | <parameter name="filename" transfer-ownership="none"> | |
| 1017 | + | <doc xml:space="preserve" | |
| 1018 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1019 | + | line="1339">Name of file to load, in the GLib file | |
| 1020 | + | name encoding</doc> | |
| 1021 | + | <type name="filename" c:type="const char*"/> | |
| 1022 | + | </parameter> | |
| 1023 | + | <parameter name="width" transfer-ownership="none"> | |
| 1024 | + | <doc xml:space="preserve" | |
| 1025 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1026 | + | line="1341">The width the image should have or -1 to not constrain the width</doc> | |
| 1027 | + | <type name="gint" c:type="int"/> | |
| 1028 | + | </parameter> | |
| 1029 | + | <parameter name="height" transfer-ownership="none"> | |
| 1030 | + | <doc xml:space="preserve" | |
| 1031 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1032 | + | line="1342">The height the image should have or -1 to not constrain the height</doc> | |
| 1033 | + | <type name="gint" c:type="int"/> | |
| 1034 | + | </parameter> | |
| 1035 | + | <parameter name="preserve_aspect_ratio" transfer-ownership="none"> | |
| 1036 | + | <doc xml:space="preserve" | |
| 1037 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1038 | + | line="1343">`TRUE` to preserve the image's aspect ratio</doc> | |
| 1039 | + | <type name="gboolean" c:type="gboolean"/> | |
| 1040 | + | </parameter> | |
| 1041 | + | </parameters> | |
| 1042 | + | </constructor> | |
| 1043 | + | <constructor name="new_from_file_at_size" | |
| 1044 | + | c:identifier="gdk_pixbuf_new_from_file_at_size" | |
| 1045 | + | version="2.4" | |
| 1046 | + | throws="1"> | |
| 1047 | + | <doc xml:space="preserve" | |
| 1048 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1049 | + | line="1210">Creates a new pixbuf by loading an image from a file. | |
| 1050 | + | ||
| 1051 | + | The file format is detected automatically. | |
| 1052 | + | ||
| 1053 | + | If `NULL` is returned, then @error will be set. Possible errors are: | |
| 1054 | + | ||
| 1055 | + | - the file could not be opened | |
| 1056 | + | - there is no loader for the file's format | |
| 1057 | + | - there is not enough memory to allocate the image buffer | |
| 1058 | + | - the image buffer contains invalid data | |
| 1059 | + | ||
| 1060 | + | The error domains are `GDK_PIXBUF_ERROR` and `G_FILE_ERROR`. | |
| 1061 | + | ||
| 1062 | + | The image will be scaled to fit in the requested size, preserving | |
| 1063 | + | the image's aspect ratio. Note that the returned pixbuf may be smaller | |
| 1064 | + | than `width` x `height`, if the aspect ratio requires it. To load | |
| 1065 | + | and image at the requested size, regardless of aspect ratio, use | |
| 1066 | + | [ctor@GdkPixbuf.Pixbuf.new_from_file_at_scale].</doc> | |
| 1067 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 1068 | + | line="255"/> | |
| 1069 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 1070 | + | <doc xml:space="preserve" | |
| 1071 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1072 | + | line="1237">A newly-created pixbuf</doc> | |
| 1073 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 1074 | + | </return-value> | |
| 1075 | + | <parameters> | |
| 1076 | + | <parameter name="filename" transfer-ownership="none"> | |
| 1077 | + | <doc xml:space="preserve" | |
| 1078 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1079 | + | line="1212">Name of file to load, in the GLib file | |
| 1080 | + | name encoding</doc> | |
| 1081 | + | <type name="filename" c:type="const char*"/> | |
| 1082 | + | </parameter> | |
| 1083 | + | <parameter name="width" transfer-ownership="none"> | |
| 1084 | + | <doc xml:space="preserve" | |
| 1085 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1086 | + | line="1214">The width the image should have or -1 to not constrain the width</doc> | |
| 1087 | + | <type name="gint" c:type="int"/> | |
| 1088 | + | </parameter> | |
| 1089 | + | <parameter name="height" transfer-ownership="none"> | |
| 1090 | + | <doc xml:space="preserve" | |
| 1091 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1092 | + | line="1215">The height the image should have or -1 to not constrain the height</doc> | |
| 1093 | + | <type name="gint" c:type="int"/> | |
| 1094 | + | </parameter> | |
| 1095 | + | </parameters> | |
| 1096 | + | </constructor> | |
| 1097 | + | <constructor name="new_from_inline" | |
| 1098 | + | c:identifier="gdk_pixbuf_new_from_inline" | |
| 1099 | + | deprecated="1" | |
| 1100 | + | deprecated-version="2.32" | |
| 1101 | + | throws="1"> | |
| 1102 | + | <doc xml:space="preserve" | |
| 1103 | + | filename="../gdk-pixbuf/gdk-pixdata.c" | |
| 1104 | + | line="951">Creates a `GdkPixbuf` from a flat representation that is suitable for | |
| 1105 | + | storing as inline data in a program. | |
| 1106 | + | ||
| 1107 | + | This is useful if you want to ship a program with images, but don't want | |
| 1108 | + | to depend on any external files. | |
| 1109 | + | ||
| 1110 | + | GdkPixbuf ships with a program called `gdk-pixbuf-csource`, which allows | |
| 1111 | + | for conversion of `GdkPixbuf`s into such a inline representation. | |
| 1112 | + | ||
| 1113 | + | In almost all cases, you should pass the `--raw` option to | |
| 1114 | + | `gdk-pixbuf-csource`. A sample invocation would be: | |
| 1115 | + | ||
| 1116 | + | ``` | |
| 1117 | + | gdk-pixbuf-csource --raw --name=myimage_inline myimage.png | |
| 1118 | + | ``` | |
| 1119 | + | ||
| 1120 | + | For the typical case where the inline pixbuf is read-only static data, | |
| 1121 | + | you don't need to copy the pixel data unless you intend to write to | |
| 1122 | + | it, so you can pass `FALSE` for `copy_pixels`. If you pass `--rle` to | |
| 1123 | + | `gdk-pixbuf-csource`, a copy will be made even if `copy_pixels` is `FALSE`, | |
| 1124 | + | so using this option is generally a bad idea. | |
| 1125 | + | ||
| 1126 | + | If you create a pixbuf from const inline data compiled into your | |
| 1127 | + | program, it's probably safe to ignore errors and disable length checks, | |
| 1128 | + | since things will always succeed: | |
| 1129 | + | ||
| 1130 | + | ```c | |
| 1131 | + | pixbuf = gdk_pixbuf_new_from_inline (-1, myimage_inline, FALSE, NULL); | |
| 1132 | + | ``` | |
| 1133 | + | ||
| 1134 | + | For non-const inline data, you could get out of memory. For untrusted | |
| 1135 | + | inline data located at runtime, you could have corrupt inline data in | |
| 1136 | + | addition.</doc> | |
| 1137 | + | <doc-deprecated xml:space="preserve">Use `GResource` instead.</doc-deprecated> | |
| 1138 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 1139 | + | line="298"/> | |
| 1140 | + | <return-value transfer-ownership="full"> | |
| 1141 | + | <doc xml:space="preserve" | |
| 1142 | + | filename="../gdk-pixbuf/gdk-pixdata.c" | |
| 1143 | + | line="995">A newly-created pixbuf</doc> | |
| 1144 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 1145 | + | </return-value> | |
| 1146 | + | <parameters> | |
| 1147 | + | <parameter name="data_length" transfer-ownership="none"> | |
| 1148 | + | <doc xml:space="preserve" | |
| 1149 | + | filename="../gdk-pixbuf/gdk-pixdata.c" | |
| 1150 | + | line="953">Length in bytes of the `data` argument or -1 to | |
| 1151 | + | disable length checks</doc> | |
| 1152 | + | <type name="gint" c:type="gint"/> | |
| 1153 | + | </parameter> | |
| 1154 | + | <parameter name="data" transfer-ownership="none"> | |
| 1155 | + | <doc xml:space="preserve" | |
| 1156 | + | filename="../gdk-pixbuf/gdk-pixdata.c" | |
| 1157 | + | line="955">Byte data containing a | |
| 1158 | + | serialized `GdkPixdata` structure</doc> | |
| 1159 | + | <array length="0" zero-terminated="0" c:type="const guint8*"> | |
| 1160 | + | <type name="guint8" c:type="guint8"/> | |
| 1161 | + | </array> | |
| 1162 | + | </parameter> | |
| 1163 | + | <parameter name="copy_pixels" transfer-ownership="none"> | |
| 1164 | + | <doc xml:space="preserve" | |
| 1165 | + | filename="../gdk-pixbuf/gdk-pixdata.c" | |
| 1166 | + | line="957">Whether to copy the pixel data, or use direct pointers | |
| 1167 | + | `data` for the resulting pixbuf</doc> | |
| 1168 | + | <type name="gboolean" c:type="gboolean"/> | |
| 1169 | + | </parameter> | |
| 1170 | + | </parameters> | |
| 1171 | + | </constructor> | |
| 1172 | + | <constructor name="new_from_resource" | |
| 1173 | + | c:identifier="gdk_pixbuf_new_from_resource" | |
| 1174 | + | version="2.26" | |
| 1175 | + | throws="1"> | |
| 1176 | + | <doc xml:space="preserve" | |
| 1177 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1178 | + | line="1793">Creates a new pixbuf by loading an image from an resource. | |
| 1179 | + | ||
| 1180 | + | The file format is detected automatically. If `NULL` is returned, then | |
| 1181 | + | @error will be set.</doc> | |
| 1182 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 1183 | + | line="266"/> | |
| 1184 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 1185 | + | <doc xml:space="preserve" | |
| 1186 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1187 | + | line="1803">A newly-created pixbuf</doc> | |
| 1188 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 1189 | + | </return-value> | |
| 1190 | + | <parameters> | |
| 1191 | + | <parameter name="resource_path" transfer-ownership="none"> | |
| 1192 | + | <doc xml:space="preserve" | |
| 1193 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1194 | + | line="1795">the path of the resource file</doc> | |
| 1195 | + | <type name="utf8" c:type="const char*"/> | |
| 1196 | + | </parameter> | |
| 1197 | + | </parameters> | |
| 1198 | + | </constructor> | |
| 1199 | + | <constructor name="new_from_resource_at_scale" | |
| 1200 | + | c:identifier="gdk_pixbuf_new_from_resource_at_scale" | |
| 1201 | + | version="2.26" | |
| 1202 | + | throws="1"> | |
| 1203 | + | <doc xml:space="preserve" | |
| 1204 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1205 | + | line="1827">Creates a new pixbuf by loading an image from an resource. | |
| 1206 | + | ||
| 1207 | + | The file format is detected automatically. If `NULL` is returned, then | |
| 1208 | + | @error will be set. | |
| 1209 | + | ||
| 1210 | + | The image will be scaled to fit in the requested size, optionally | |
| 1211 | + | preserving the image's aspect ratio. When preserving the aspect ratio, | |
| 1212 | + | a @width of -1 will cause the image to be scaled to the exact given | |
| 1213 | + | height, and a @height of -1 will cause the image to be scaled to the | |
| 1214 | + | exact given width. When not preserving aspect ratio, a @width or | |
| 1215 | + | @height of -1 means to not scale the image at all in that dimension. | |
| 1216 | + | ||
| 1217 | + | The stream is not closed.</doc> | |
| 1218 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 1219 | + | line="269"/> | |
| 1220 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 1221 | + | <doc xml:space="preserve" | |
| 1222 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1223 | + | line="1849">A newly-created pixbuf</doc> | |
| 1224 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 1225 | + | </return-value> | |
| 1226 | + | <parameters> | |
| 1227 | + | <parameter name="resource_path" transfer-ownership="none"> | |
| 1228 | + | <doc xml:space="preserve" | |
| 1229 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1230 | + | line="1829">the path of the resource file</doc> | |
| 1231 | + | <type name="utf8" c:type="const char*"/> | |
| 1232 | + | </parameter> | |
| 1233 | + | <parameter name="width" transfer-ownership="none"> | |
| 1234 | + | <doc xml:space="preserve" | |
| 1235 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1236 | + | line="1830">The width the image should have or -1 to not constrain the width</doc> | |
| 1237 | + | <type name="gint" c:type="int"/> | |
| 1238 | + | </parameter> | |
| 1239 | + | <parameter name="height" transfer-ownership="none"> | |
| 1240 | + | <doc xml:space="preserve" | |
| 1241 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1242 | + | line="1831">The height the image should have or -1 to not constrain the height</doc> | |
| 1243 | + | <type name="gint" c:type="int"/> | |
| 1244 | + | </parameter> | |
| 1245 | + | <parameter name="preserve_aspect_ratio" transfer-ownership="none"> | |
| 1246 | + | <doc xml:space="preserve" | |
| 1247 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1248 | + | line="1832">`TRUE` to preserve the image's aspect ratio</doc> | |
| 1249 | + | <type name="gboolean" c:type="gboolean"/> | |
| 1250 | + | </parameter> | |
| 1251 | + | </parameters> | |
| 1252 | + | </constructor> | |
| 1253 | + | <constructor name="new_from_stream" | |
| 1254 | + | c:identifier="gdk_pixbuf_new_from_stream" | |
| 1255 | + | version="2.14" | |
| 1256 | + | throws="1"> | |
| 1257 | + | <doc xml:space="preserve" | |
| 1258 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1259 | + | line="1717">Creates a new pixbuf by loading an image from an input stream. | |
| 1260 | + | ||
| 1261 | + | The file format is detected automatically. | |
| 1262 | + | ||
| 1263 | + | If `NULL` is returned, then `error` will be set. | |
| 1264 | + | ||
| 1265 | + | The `cancellable` can be used to abort the operation from another thread. | |
| 1266 | + | If the operation was cancelled, the error `G_IO_ERROR_CANCELLED` will be | |
| 1267 | + | returned. Other possible errors are in the `GDK_PIXBUF_ERROR` and | |
| 1268 | + | `G_IO_ERROR` domains. | |
| 1269 | + | ||
| 1270 | + | The stream is not closed.</doc> | |
| 1271 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 1272 | + | line="409"/> | |
| 1273 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 1274 | + | <doc xml:space="preserve" | |
| 1275 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1276 | + | line="1736">A newly-created pixbuf</doc> | |
| 1277 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 1278 | + | </return-value> | |
| 1279 | + | <parameters> | |
| 1280 | + | <parameter name="stream" transfer-ownership="none"> | |
| 1281 | + | <doc xml:space="preserve" | |
| 1282 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1283 | + | line="1719">a `GInputStream` to load the pixbuf from</doc> | |
| 1284 | + | <type name="Gio.InputStream" c:type="GInputStream*"/> | |
| 1285 | + | </parameter> | |
| 1286 | + | <parameter name="cancellable" | |
| 1287 | + | transfer-ownership="none" | |
| 1288 | + | nullable="1" | |
| 1289 | + | allow-none="1"> | |
| 1290 | + | <doc xml:space="preserve" | |
| 1291 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1292 | + | line="1720">optional `GCancellable` object, `NULL` to ignore</doc> | |
| 1293 | + | <type name="Gio.Cancellable" c:type="GCancellable*"/> | |
| 1294 | + | </parameter> | |
| 1295 | + | </parameters> | |
| 1296 | + | </constructor> | |
| 1297 | + | <constructor name="new_from_stream_at_scale" | |
| 1298 | + | c:identifier="gdk_pixbuf_new_from_stream_at_scale" | |
| 1299 | + | version="2.14" | |
| 1300 | + | throws="1"> | |
| 1301 | + | <doc xml:space="preserve" | |
| 1302 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1303 | + | line="1543">Creates a new pixbuf by loading an image from an input stream. | |
| 1304 | + | ||
| 1305 | + | The file format is detected automatically. If `NULL` is returned, then | |
| 1306 | + | @error will be set. The @cancellable can be used to abort the operation | |
| 1307 | + | from another thread. If the operation was cancelled, the error | |
| 1308 | + | `G_IO_ERROR_CANCELLED` will be returned. Other possible errors are in | |
| 1309 | + | the `GDK_PIXBUF_ERROR` and `G_IO_ERROR` domains. | |
| 1310 | + | ||
| 1311 | + | The image will be scaled to fit in the requested size, optionally | |
| 1312 | + | preserving the image's aspect ratio. | |
| 1313 | + | ||
| 1314 | + | When preserving the aspect ratio, a `width` of -1 will cause the image to be | |
| 1315 | + | scaled to the exact given height, and a `height` of -1 will cause the image | |
| 1316 | + | to be scaled to the exact given width. If both `width` and `height` are | |
| 1317 | + | given, this function will behave as if the smaller of the two values | |
| 1318 | + | is passed as -1. | |
| 1319 | + | ||
| 1320 | + | When not preserving aspect ratio, a `width` or `height` of -1 means to not | |
| 1321 | + | scale the image at all in that dimension. | |
| 1322 | + | ||
| 1323 | + | The stream is not closed.</doc> | |
| 1324 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 1325 | + | line="424"/> | |
| 1326 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 1327 | + | <doc xml:space="preserve" | |
| 1328 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1329 | + | line="1574">A newly-created pixbuf</doc> | |
| 1330 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 1331 | + | </return-value> | |
| 1332 | + | <parameters> | |
| 1333 | + | <parameter name="stream" transfer-ownership="none"> | |
| 1334 | + | <doc xml:space="preserve" | |
| 1335 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1336 | + | line="1545">a `GInputStream` to load the pixbuf from</doc> | |
| 1337 | + | <type name="Gio.InputStream" c:type="GInputStream*"/> | |
| 1338 | + | </parameter> | |
| 1339 | + | <parameter name="width" transfer-ownership="none"> | |
| 1340 | + | <doc xml:space="preserve" | |
| 1341 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1342 | + | line="1546">The width the image should have or -1 to not constrain the width</doc> | |
| 1343 | + | <type name="gint" c:type="gint"/> | |
| 1344 | + | </parameter> | |
| 1345 | + | <parameter name="height" transfer-ownership="none"> | |
| 1346 | + | <doc xml:space="preserve" | |
| 1347 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1348 | + | line="1547">The height the image should have or -1 to not constrain the height</doc> | |
| 1349 | + | <type name="gint" c:type="gint"/> | |
| 1350 | + | </parameter> | |
| 1351 | + | <parameter name="preserve_aspect_ratio" transfer-ownership="none"> | |
| 1352 | + | <doc xml:space="preserve" | |
| 1353 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1354 | + | line="1548">`TRUE` to preserve the image's aspect ratio</doc> | |
| 1355 | + | <type name="gboolean" c:type="gboolean"/> | |
| 1356 | + | </parameter> | |
| 1357 | + | <parameter name="cancellable" | |
| 1358 | + | transfer-ownership="none" | |
| 1359 | + | nullable="1" | |
| 1360 | + | allow-none="1"> | |
| 1361 | + | <doc xml:space="preserve" | |
| 1362 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1363 | + | line="1549">optional `GCancellable` object, `NULL` to ignore</doc> | |
| 1364 | + | <type name="Gio.Cancellable" c:type="GCancellable*"/> | |
| 1365 | + | </parameter> | |
| 1366 | + | </parameters> | |
| 1367 | + | </constructor> | |
| 1368 | + | <constructor name="new_from_stream_finish" | |
| 1369 | + | c:identifier="gdk_pixbuf_new_from_stream_finish" | |
| 1370 | + | version="2.24" | |
| 1371 | + | throws="1"> | |
| 1372 | + | <doc xml:space="preserve" | |
| 1373 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1374 | + | line="1914">Finishes an asynchronous pixbuf creation operation started with | |
| 1375 | + | gdk_pixbuf_new_from_stream_async().</doc> | |
| 1376 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 1377 | + | line="420"/> | |
| 1378 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 1379 | + | <doc xml:space="preserve" | |
| 1380 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1381 | + | line="1922">the newly created pixbuf</doc> | |
| 1382 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 1383 | + | </return-value> | |
| 1384 | + | <parameters> | |
| 1385 | + | <parameter name="async_result" transfer-ownership="none"> | |
| 1386 | + | <doc xml:space="preserve" | |
| 1387 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1388 | + | line="1916">a `GAsyncResult`</doc> | |
| 1389 | + | <type name="Gio.AsyncResult" c:type="GAsyncResult*"/> | |
| 1390 | + | </parameter> | |
| 1391 | + | </parameters> | |
| 1392 | + | </constructor> | |
| 1393 | + | <constructor name="new_from_xpm_data" | |
| 1394 | + | c:identifier="gdk_pixbuf_new_from_xpm_data"> | |
| 1395 | + | <doc xml:space="preserve" | |
| 1396 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1397 | + | line="2148">Creates a new pixbuf by parsing XPM data in memory. | |
| 1398 | + | ||
| 1399 | + | This data is commonly the result of including an XPM file into a | |
| 1400 | + | program's C source.</doc> | |
| 1401 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 1402 | + | line="294"/> | |
| 1403 | + | <return-value transfer-ownership="full"> | |
| 1404 | + | <doc xml:space="preserve" | |
| 1405 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1406 | + | line="2157">A newly-created pixbuf</doc> | |
| 1407 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 1408 | + | </return-value> | |
| 1409 | + | <parameters> | |
| 1410 | + | <parameter name="data" transfer-ownership="none"> | |
| 1411 | + | <doc xml:space="preserve" | |
| 1412 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1413 | + | line="2150">Pointer to inline XPM data.</doc> | |
| 1414 | + | <array c:type="const char**"> | |
| 1415 | + | <type name="utf8" c:type="char*"/> | |
| 1416 | + | </array> | |
| 1417 | + | </parameter> | |
| 1418 | + | </parameters> | |
| 1419 | + | </constructor> | |
| 1420 | + | <function name="calculate_rowstride" | |
| 1421 | + | c:identifier="gdk_pixbuf_calculate_rowstride" | |
| 1422 | + | version="2.36.8"> | |
| 1423 | + | <doc xml:space="preserve" | |
| 1424 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 1425 | + | line="557">Calculates the rowstride that an image created with those values would | |
| 1426 | + | have. | |
| 1427 | + | ||
| 1428 | + | This function is useful for front-ends and backends that want to check | |
| 1429 | + | image values without needing to create a `GdkPixbuf`.</doc> | |
| 1430 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 1431 | + | line="210"/> | |
| 1432 | + | <return-value transfer-ownership="none"> | |
| 1433 | + | <doc xml:space="preserve" | |
| 1434 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 1435 | + | line="571">the rowstride for the given values, or -1 in case of error.</doc> | |
| 1436 | + | <type name="gint" c:type="gint"/> | |
| 1437 | + | </return-value> | |
| 1438 | + | <parameters> | |
| 1439 | + | <parameter name="colorspace" transfer-ownership="none"> | |
| 1440 | + | <doc xml:space="preserve" | |
| 1441 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 1442 | + | line="559">Color space for image</doc> | |
| 1443 | + | <type name="Colorspace" c:type="GdkColorspace"/> | |
| 1444 | + | </parameter> | |
| 1445 | + | <parameter name="has_alpha" transfer-ownership="none"> | |
| 1446 | + | <doc xml:space="preserve" | |
| 1447 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 1448 | + | line="560">Whether the image should have transparency information</doc> | |
| 1449 | + | <type name="gboolean" c:type="gboolean"/> | |
| 1450 | + | </parameter> | |
| 1451 | + | <parameter name="bits_per_sample" transfer-ownership="none"> | |
| 1452 | + | <doc xml:space="preserve" | |
| 1453 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 1454 | + | line="561">Number of bits per color sample</doc> | |
| 1455 | + | <type name="gint" c:type="int"/> | |
| 1456 | + | </parameter> | |
| 1457 | + | <parameter name="width" transfer-ownership="none"> | |
| 1458 | + | <doc xml:space="preserve" | |
| 1459 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 1460 | + | line="562">Width of image in pixels, must be > 0</doc> | |
| 1461 | + | <type name="gint" c:type="int"/> | |
| 1462 | + | </parameter> | |
| 1463 | + | <parameter name="height" transfer-ownership="none"> | |
| 1464 | + | <doc xml:space="preserve" | |
| 1465 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 1466 | + | line="563">Height of image in pixels, must be > 0</doc> | |
| 1467 | + | <type name="gint" c:type="int"/> | |
| 1468 | + | </parameter> | |
| 1469 | + | </parameters> | |
| 1470 | + | </function> | |
| 1471 | + | <function name="get_file_info" | |
| 1472 | + | c:identifier="gdk_pixbuf_get_file_info" | |
| 1473 | + | version="2.4"> | |
| 1474 | + | <doc xml:space="preserve" | |
| 1475 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1476 | + | line="1964">Parses an image file far enough to determine its format and size.</doc> | |
| 1477 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="77"/> | |
| 1478 | + | <return-value transfer-ownership="none" nullable="1"> | |
| 1479 | + | <doc xml:space="preserve" | |
| 1480 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1481 | + | line="1972">A `GdkPixbufFormat` describing | |
| 1482 | + | the image format of the file</doc> | |
| 1483 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 1484 | + | </return-value> | |
| 1485 | + | <parameters> | |
| 1486 | + | <parameter name="filename" transfer-ownership="none"> | |
| 1487 | + | <doc xml:space="preserve" | |
| 1488 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1489 | + | line="1966">The name of the file to identify.</doc> | |
| 1490 | + | <type name="filename" c:type="const gchar*"/> | |
| 1491 | + | </parameter> | |
| 1492 | + | <parameter name="width" | |
| 1493 | + | direction="out" | |
| 1494 | + | caller-allocates="0" | |
| 1495 | + | transfer-ownership="full" | |
| 1496 | + | optional="1" | |
| 1497 | + | allow-none="1"> | |
| 1498 | + | <doc xml:space="preserve" | |
| 1499 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1500 | + | line="1967">Return location for the width of the image</doc> | |
| 1501 | + | <type name="gint" c:type="gint*"/> | |
| 1502 | + | </parameter> | |
| 1503 | + | <parameter name="height" | |
| 1504 | + | direction="out" | |
| 1505 | + | caller-allocates="0" | |
| 1506 | + | transfer-ownership="full" | |
| 1507 | + | optional="1" | |
| 1508 | + | allow-none="1"> | |
| 1509 | + | <doc xml:space="preserve" | |
| 1510 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1511 | + | line="1968">Return location for the height of the image</doc> | |
| 1512 | + | <type name="gint" c:type="gint*"/> | |
| 1513 | + | </parameter> | |
| 1514 | + | </parameters> | |
| 1515 | + | </function> | |
| 1516 | + | <function name="get_file_info_async" | |
| 1517 | + | c:identifier="gdk_pixbuf_get_file_info_async" | |
| 1518 | + | version="2.32"> | |
| 1519 | + | <doc xml:space="preserve" | |
| 1520 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1521 | + | line="2062">Asynchronously parses an image file far enough to determine its | |
| 1522 | + | format and size. | |
| 1523 | + | ||
| 1524 | + | For more details see gdk_pixbuf_get_file_info(), which is the synchronous | |
| 1525 | + | version of this function. | |
| 1526 | + | ||
| 1527 | + | When the operation is finished, @callback will be called in the | |
| 1528 | + | main thread. You can then call gdk_pixbuf_get_file_info_finish() to | |
| 1529 | + | get the result of the operation.</doc> | |
| 1530 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="81"/> | |
| 1531 | + | <return-value transfer-ownership="none"> | |
| 1532 | + | <type name="none" c:type="void"/> | |
| 1533 | + | </return-value> | |
| 1534 | + | <parameters> | |
| 1535 | + | <parameter name="filename" transfer-ownership="none"> | |
| 1536 | + | <doc xml:space="preserve" | |
| 1537 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1538 | + | line="2064">The name of the file to identify</doc> | |
| 1539 | + | <type name="filename" c:type="const gchar*"/> | |
| 1540 | + | </parameter> | |
| 1541 | + | <parameter name="cancellable" | |
| 1542 | + | transfer-ownership="none" | |
| 1543 | + | nullable="1" | |
| 1544 | + | allow-none="1"> | |
| 1545 | + | <doc xml:space="preserve" | |
| 1546 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1547 | + | line="2065">optional `GCancellable` object, `NULL` to ignore</doc> | |
| 1548 | + | <type name="Gio.Cancellable" c:type="GCancellable*"/> | |
| 1549 | + | </parameter> | |
| 1550 | + | <parameter name="callback" | |
| 1551 | + | transfer-ownership="none" | |
| 1552 | + | nullable="1" | |
| 1553 | + | allow-none="1" | |
| 1554 | + | scope="async" | |
| 1555 | + | closure="3"> | |
| 1556 | + | <doc xml:space="preserve" | |
| 1557 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1558 | + | line="2066">a `GAsyncReadyCallback` to call when the file info is available</doc> | |
| 1559 | + | <type name="Gio.AsyncReadyCallback" c:type="GAsyncReadyCallback"/> | |
| 1560 | + | </parameter> | |
| 1561 | + | <parameter name="user_data" | |
| 1562 | + | transfer-ownership="none" | |
| 1563 | + | nullable="1" | |
| 1564 | + | allow-none="1"> | |
| 1565 | + | <doc xml:space="preserve" | |
| 1566 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1567 | + | line="2067">the data to pass to the callback function</doc> | |
| 1568 | + | <type name="gpointer" c:type="gpointer"/> | |
| 1569 | + | </parameter> | |
| 1570 | + | </parameters> | |
| 1571 | + | </function> | |
| 1572 | + | <function name="get_file_info_finish" | |
| 1573 | + | c:identifier="gdk_pixbuf_get_file_info_finish" | |
| 1574 | + | version="2.32" | |
| 1575 | + | throws="1"> | |
| 1576 | + | <doc xml:space="preserve" | |
| 1577 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1578 | + | line="2105">Finishes an asynchronous pixbuf parsing operation started with | |
| 1579 | + | gdk_pixbuf_get_file_info_async().</doc> | |
| 1580 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="86"/> | |
| 1581 | + | <return-value transfer-ownership="none" nullable="1"> | |
| 1582 | + | <doc xml:space="preserve" | |
| 1583 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1584 | + | line="2115">A `GdkPixbufFormat` describing the | |
| 1585 | + | image format of the file</doc> | |
| 1586 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 1587 | + | </return-value> | |
| 1588 | + | <parameters> | |
| 1589 | + | <parameter name="async_result" transfer-ownership="none"> | |
| 1590 | + | <doc xml:space="preserve" | |
| 1591 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1592 | + | line="2107">a `GAsyncResult`</doc> | |
| 1593 | + | <type name="Gio.AsyncResult" c:type="GAsyncResult*"/> | |
| 1594 | + | </parameter> | |
| 1595 | + | <parameter name="width" | |
| 1596 | + | direction="out" | |
| 1597 | + | caller-allocates="0" | |
| 1598 | + | transfer-ownership="full"> | |
| 1599 | + | <doc xml:space="preserve" | |
| 1600 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1601 | + | line="2108">Return location for the width of the image, or `NULL`</doc> | |
| 1602 | + | <type name="gint" c:type="gint*"/> | |
| 1603 | + | </parameter> | |
| 1604 | + | <parameter name="height" | |
| 1605 | + | direction="out" | |
| 1606 | + | caller-allocates="0" | |
| 1607 | + | transfer-ownership="full"> | |
| 1608 | + | <doc xml:space="preserve" | |
| 1609 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1610 | + | line="2109">Return location for the height of the image, or `NULL`</doc> | |
| 1611 | + | <type name="gint" c:type="gint*"/> | |
| 1612 | + | </parameter> | |
| 1613 | + | </parameters> | |
| 1614 | + | </function> | |
| 1615 | + | <function name="get_formats" | |
| 1616 | + | c:identifier="gdk_pixbuf_get_formats" | |
| 1617 | + | version="2.2"> | |
| 1618 | + | <doc xml:space="preserve" | |
| 1619 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1620 | + | line="3426">Obtains the available information about the image formats supported | |
| 1621 | + | by GdkPixbuf.</doc> | |
| 1622 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="52"/> | |
| 1623 | + | <return-value transfer-ownership="container"> | |
| 1624 | + | <doc xml:space="preserve" | |
| 1625 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1626 | + | line="3432">A list of | |
| 1627 | + | support image formats.</doc> | |
| 1628 | + | <type name="GLib.SList" c:type="GSList*"> | |
| 1629 | + | <type name="PixbufFormat"/> | |
| 1630 | + | </type> | |
| 1631 | + | </return-value> | |
| 1632 | + | </function> | |
| 1633 | + | <function name="init_modules" | |
| 1634 | + | c:identifier="gdk_pixbuf_init_modules" | |
| 1635 | + | version="2.40" | |
| 1636 | + | throws="1"> | |
| 1637 | + | <doc xml:space="preserve" | |
| 1638 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1639 | + | line="561">Initalizes the gdk-pixbuf loader modules referenced by the `loaders.cache` | |
| 1640 | + | file present inside that directory. | |
| 1641 | + | ||
| 1642 | + | This is to be used by applications that want to ship certain loaders | |
| 1643 | + | in a different location from the system ones. | |
| 1644 | + | ||
| 1645 | + | This is needed when the OS or runtime ships a minimal number of loaders | |
| 1646 | + | so as to reduce the potential attack surface of carefully crafted image | |
| 1647 | + | files, especially for uncommon file types. Applications that require | |
| 1648 | + | broader image file types coverage, such as image viewers, would be | |
| 1649 | + | expected to ship the gdk-pixbuf modules in a separate location, bundled | |
| 1650 | + | with the application in a separate directory from the OS or runtime- | |
| 1651 | + | provided modules.</doc> | |
| 1652 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="45"/> | |
| 1653 | + | <return-value transfer-ownership="none"> | |
| 1654 | + | <type name="gboolean" c:type="gboolean"/> | |
| 1655 | + | </return-value> | |
| 1656 | + | <parameters> | |
| 1657 | + | <parameter name="path" transfer-ownership="none"> | |
| 1658 | + | <doc xml:space="preserve" | |
| 1659 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1660 | + | line="563">Path to directory where the `loaders.cache` is installed</doc> | |
| 1661 | + | <type name="utf8" c:type="const char*"/> | |
| 1662 | + | </parameter> | |
| 1663 | + | </parameters> | |
| 1664 | + | </function> | |
| 1665 | + | <function name="new_from_stream_async" | |
| 1666 | + | c:identifier="gdk_pixbuf_new_from_stream_async" | |
| 1667 | + | version="2.24"> | |
| 1668 | + | <doc xml:space="preserve" | |
| 1669 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1670 | + | line="1872">Creates a new pixbuf by asynchronously loading an image from an input stream. | |
| 1671 | + | ||
| 1672 | + | For more details see gdk_pixbuf_new_from_stream(), which is the synchronous | |
| 1673 | + | version of this function. | |
| 1674 | + | ||
| 1675 | + | When the operation is finished, @callback will be called in the main thread. | |
| 1676 | + | You can then call gdk_pixbuf_new_from_stream_finish() to get the result of | |
| 1677 | + | the operation.</doc> | |
| 1678 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 1679 | + | line="414"/> | |
| 1680 | + | <return-value transfer-ownership="none"> | |
| 1681 | + | <type name="none" c:type="void"/> | |
| 1682 | + | </return-value> | |
| 1683 | + | <parameters> | |
| 1684 | + | <parameter name="stream" transfer-ownership="none"> | |
| 1685 | + | <doc xml:space="preserve" | |
| 1686 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1687 | + | line="1874">a `GInputStream` from which to load the pixbuf</doc> | |
| 1688 | + | <type name="Gio.InputStream" c:type="GInputStream*"/> | |
| 1689 | + | </parameter> | |
| 1690 | + | <parameter name="cancellable" | |
| 1691 | + | transfer-ownership="none" | |
| 1692 | + | nullable="1" | |
| 1693 | + | allow-none="1"> | |
| 1694 | + | <doc xml:space="preserve" | |
| 1695 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1696 | + | line="1875">optional `GCancellable` object, `NULL` to ignore</doc> | |
| 1697 | + | <type name="Gio.Cancellable" c:type="GCancellable*"/> | |
| 1698 | + | </parameter> | |
| 1699 | + | <parameter name="callback" | |
| 1700 | + | transfer-ownership="none" | |
| 1701 | + | nullable="1" | |
| 1702 | + | allow-none="1" | |
| 1703 | + | scope="async" | |
| 1704 | + | closure="3"> | |
| 1705 | + | <doc xml:space="preserve" | |
| 1706 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1707 | + | line="1876">a `GAsyncReadyCallback` to call when the pixbuf is loaded</doc> | |
| 1708 | + | <type name="Gio.AsyncReadyCallback" c:type="GAsyncReadyCallback"/> | |
| 1709 | + | </parameter> | |
| 1710 | + | <parameter name="user_data" | |
| 1711 | + | transfer-ownership="none" | |
| 1712 | + | nullable="1" | |
| 1713 | + | allow-none="1"> | |
| 1714 | + | <doc xml:space="preserve" | |
| 1715 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1716 | + | line="1877">the data to pass to the callback function</doc> | |
| 1717 | + | <type name="gpointer" c:type="gpointer"/> | |
| 1718 | + | </parameter> | |
| 1719 | + | </parameters> | |
| 1720 | + | </function> | |
| 1721 | + | <function name="new_from_stream_at_scale_async" | |
| 1722 | + | c:identifier="gdk_pixbuf_new_from_stream_at_scale_async" | |
| 1723 | + | version="2.24"> | |
| 1724 | + | <doc xml:space="preserve" | |
| 1725 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1726 | + | line="1655">Creates a new pixbuf by asynchronously loading an image from an input stream. | |
| 1727 | + | ||
| 1728 | + | For more details see gdk_pixbuf_new_from_stream_at_scale(), which is the synchronous | |
| 1729 | + | version of this function. | |
| 1730 | + | ||
| 1731 | + | When the operation is finished, @callback will be called in the main thread. | |
| 1732 | + | You can then call gdk_pixbuf_new_from_stream_finish() to get the result of the operation.</doc> | |
| 1733 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 1734 | + | line="432"/> | |
| 1735 | + | <return-value transfer-ownership="none"> | |
| 1736 | + | <type name="none" c:type="void"/> | |
| 1737 | + | </return-value> | |
| 1738 | + | <parameters> | |
| 1739 | + | <parameter name="stream" transfer-ownership="none"> | |
| 1740 | + | <doc xml:space="preserve" | |
| 1741 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1742 | + | line="1657">a `GInputStream` from which to load the pixbuf</doc> | |
| 1743 | + | <type name="Gio.InputStream" c:type="GInputStream*"/> | |
| 1744 | + | </parameter> | |
| 1745 | + | <parameter name="width" transfer-ownership="none"> | |
| 1746 | + | <doc xml:space="preserve" | |
| 1747 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1748 | + | line="1658">the width the image should have or -1 to not constrain the width</doc> | |
| 1749 | + | <type name="gint" c:type="gint"/> | |
| 1750 | + | </parameter> | |
| 1751 | + | <parameter name="height" transfer-ownership="none"> | |
| 1752 | + | <doc xml:space="preserve" | |
| 1753 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1754 | + | line="1659">the height the image should have or -1 to not constrain the height</doc> | |
| 1755 | + | <type name="gint" c:type="gint"/> | |
| 1756 | + | </parameter> | |
| 1757 | + | <parameter name="preserve_aspect_ratio" transfer-ownership="none"> | |
| 1758 | + | <doc xml:space="preserve" | |
| 1759 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1760 | + | line="1660">`TRUE` to preserve the image's aspect ratio</doc> | |
| 1761 | + | <type name="gboolean" c:type="gboolean"/> | |
| 1762 | + | </parameter> | |
| 1763 | + | <parameter name="cancellable" | |
| 1764 | + | transfer-ownership="none" | |
| 1765 | + | nullable="1" | |
| 1766 | + | allow-none="1"> | |
| 1767 | + | <doc xml:space="preserve" | |
| 1768 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1769 | + | line="1661">optional `GCancellable` object, `NULL` to ignore</doc> | |
| 1770 | + | <type name="Gio.Cancellable" c:type="GCancellable*"/> | |
| 1771 | + | </parameter> | |
| 1772 | + | <parameter name="callback" | |
| 1773 | + | transfer-ownership="none" | |
| 1774 | + | nullable="1" | |
| 1775 | + | allow-none="1" | |
| 1776 | + | scope="async" | |
| 1777 | + | closure="6"> | |
| 1778 | + | <doc xml:space="preserve" | |
| 1779 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1780 | + | line="1662">a `GAsyncReadyCallback` to call when the pixbuf is loaded</doc> | |
| 1781 | + | <type name="Gio.AsyncReadyCallback" c:type="GAsyncReadyCallback"/> | |
| 1782 | + | </parameter> | |
| 1783 | + | <parameter name="user_data" | |
| 1784 | + | transfer-ownership="none" | |
| 1785 | + | nullable="1" | |
| 1786 | + | allow-none="1"> | |
| 1787 | + | <doc xml:space="preserve" | |
| 1788 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1789 | + | line="1663">the data to pass to the callback function</doc> | |
| 1790 | + | <type name="gpointer" c:type="gpointer"/> | |
| 1791 | + | </parameter> | |
| 1792 | + | </parameters> | |
| 1793 | + | </function> | |
| 1794 | + | <function name="save_to_stream_finish" | |
| 1795 | + | c:identifier="gdk_pixbuf_save_to_stream_finish" | |
| 1796 | + | version="2.24" | |
| 1797 | + | throws="1"> | |
| 1798 | + | <doc xml:space="preserve" | |
| 1799 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1800 | + | line="3199">Finishes an asynchronous pixbuf save operation started with | |
| 1801 | + | gdk_pixbuf_save_to_stream_async().</doc> | |
| 1802 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 1803 | + | line="458"/> | |
| 1804 | + | <return-value transfer-ownership="none"> | |
| 1805 | + | <doc xml:space="preserve" | |
| 1806 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1807 | + | line="3207">`TRUE` if the pixbuf was saved successfully, `FALSE` if an error was set.</doc> | |
| 1808 | + | <type name="gboolean" c:type="gboolean"/> | |
| 1809 | + | </return-value> | |
| 1810 | + | <parameters> | |
| 1811 | + | <parameter name="async_result" transfer-ownership="none"> | |
| 1812 | + | <doc xml:space="preserve" | |
| 1813 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 1814 | + | line="3201">a `GAsyncResult`</doc> | |
| 1815 | + | <type name="Gio.AsyncResult" c:type="GAsyncResult*"/> | |
| 1816 | + | </parameter> | |
| 1817 | + | </parameters> | |
| 1818 | + | </function> | |
| 1819 | + | <method name="add_alpha" c:identifier="gdk_pixbuf_add_alpha"> | |
| 1820 | + | <doc xml:space="preserve" | |
| 1821 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 1822 | + | line="29">Takes an existing pixbuf and adds an alpha channel to it. | |
| 1823 | + | ||
| 1824 | + | If the existing pixbuf already had an alpha channel, the channel | |
| 1825 | + | values are copied from the original; otherwise, the alpha channel | |
| 1826 | + | is initialized to 255 (full opacity). | |
| 1827 | + | ||
| 1828 | + | If `substitute_color` is `TRUE`, then the color specified by the | |
| 1829 | + | (`r`, `g`, `b`) arguments will be assigned zero opacity. That is, | |
| 1830 | + | if you pass `(255, 255, 255)` for the substitute color, all white | |
| 1831 | + | pixels will become fully transparent. | |
| 1832 | + | ||
| 1833 | + | If `substitute_color` is `FALSE`, then the (`r`, `g`, `b`) arguments | |
| 1834 | + | will be ignored.</doc> | |
| 1835 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 1836 | + | line="482"/> | |
| 1837 | + | <return-value transfer-ownership="full"> | |
| 1838 | + | <doc xml:space="preserve" | |
| 1839 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 1840 | + | line="51">A newly-created pixbuf</doc> | |
| 1841 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 1842 | + | </return-value> | |
| 1843 | + | <parameters> | |
| 1844 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 1845 | + | <doc xml:space="preserve" | |
| 1846 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 1847 | + | line="31">A #GdkPixbuf.</doc> | |
| 1848 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 1849 | + | </instance-parameter> | |
| 1850 | + | <parameter name="substitute_color" transfer-ownership="none"> | |
| 1851 | + | <doc xml:space="preserve" | |
| 1852 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 1853 | + | line="32">Whether to set a color to zero opacity.</doc> | |
| 1854 | + | <type name="gboolean" c:type="gboolean"/> | |
| 1855 | + | </parameter> | |
| 1856 | + | <parameter name="r" transfer-ownership="none"> | |
| 1857 | + | <doc xml:space="preserve" | |
| 1858 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 1859 | + | line="33">Red value to substitute.</doc> | |
| 1860 | + | <type name="guint8" c:type="guchar"/> | |
| 1861 | + | </parameter> | |
| 1862 | + | <parameter name="g" transfer-ownership="none"> | |
| 1863 | + | <doc xml:space="preserve" | |
| 1864 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 1865 | + | line="34">Green value to substitute.</doc> | |
| 1866 | + | <type name="guint8" c:type="guchar"/> | |
| 1867 | + | </parameter> | |
| 1868 | + | <parameter name="b" transfer-ownership="none"> | |
| 1869 | + | <doc xml:space="preserve" | |
| 1870 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 1871 | + | line="35">Blue value to substitute.</doc> | |
| 1872 | + | <type name="guint8" c:type="guchar"/> | |
| 1873 | + | </parameter> | |
| 1874 | + | </parameters> | |
| 1875 | + | </method> | |
| 1876 | + | <method name="apply_embedded_orientation" | |
| 1877 | + | c:identifier="gdk_pixbuf_apply_embedded_orientation" | |
| 1878 | + | version="2.12"> | |
| 1879 | + | <doc xml:space="preserve" | |
| 1880 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 1881 | + | line="273">Takes an existing pixbuf and checks for the presence of an | |
| 1882 | + | associated "orientation" option. | |
| 1883 | + | ||
| 1884 | + | The orientation option may be provided by the JPEG loader (which | |
| 1885 | + | reads the exif orientation tag) or the TIFF loader (which reads | |
| 1886 | + | the TIFF orientation tag, and compensates it for the partial | |
| 1887 | + | transforms performed by libtiff). | |
| 1888 | + | ||
| 1889 | + | If an orientation option/tag is present, the appropriate transform | |
| 1890 | + | will be performed so that the pixbuf is oriented correctly.</doc> | |
| 1891 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 1892 | + | line="502"/> | |
| 1893 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 1894 | + | <doc xml:space="preserve" | |
| 1895 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 1896 | + | line="288">A newly-created pixbuf</doc> | |
| 1897 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 1898 | + | </return-value> | |
| 1899 | + | <parameters> | |
| 1900 | + | <instance-parameter name="src" transfer-ownership="none"> | |
| 1901 | + | <doc xml:space="preserve" | |
| 1902 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 1903 | + | line="275">a pixbuf with an orientation option</doc> | |
| 1904 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 1905 | + | </instance-parameter> | |
| 1906 | + | </parameters> | |
| 1907 | + | </method> | |
| 1908 | + | <method name="composite" c:identifier="gdk_pixbuf_composite"> | |
| 1909 | + | <doc xml:space="preserve" | |
| 1910 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 1911 | + | line="91">Creates a transformation of the source image @src by scaling by | |
| 1912 | + | @scale_x and @scale_y then translating by @offset_x and @offset_y. | |
| 1913 | + | ||
| 1914 | + | This gives an image in the coordinates of the destination pixbuf. | |
| 1915 | + | The rectangle (@dest_x, @dest_y, @dest_width, @dest_height) | |
| 1916 | + | is then alpha blended onto the corresponding rectangle of the | |
| 1917 | + | original destination image. | |
| 1918 | + | ||
| 1919 | + | When the destination rectangle contains parts not in the source | |
| 1920 | + | image, the data at the edges of the source image is replicated | |
| 1921 | + | to infinity. | |
| 1922 | + | ||
| 1923 | + | </doc> | |
| 1924 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 1925 | + | line="111"/> | |
| 1926 | + | <return-value transfer-ownership="none"> | |
| 1927 | + | <type name="none" c:type="void"/> | |
| 1928 | + | </return-value> | |
| 1929 | + | <parameters> | |
| 1930 | + | <instance-parameter name="src" transfer-ownership="none"> | |
| 1931 | + | <doc xml:space="preserve" | |
| 1932 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 1933 | + | line="93">a #GdkPixbuf</doc> | |
| 1934 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 1935 | + | </instance-parameter> | |
| 1936 | + | <parameter name="dest" transfer-ownership="none"> | |
| 1937 | + | <doc xml:space="preserve" | |
| 1938 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 1939 | + | line="94">the #GdkPixbuf into which to render the results</doc> | |
| 1940 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 1941 | + | </parameter> | |
| 1942 | + | <parameter name="dest_x" transfer-ownership="none"> | |
| 1943 | + | <doc xml:space="preserve" | |
| 1944 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 1945 | + | line="95">the left coordinate for region to render</doc> | |
| 1946 | + | <type name="gint" c:type="int"/> | |
| 1947 | + | </parameter> | |
| 1948 | + | <parameter name="dest_y" transfer-ownership="none"> | |
| 1949 | + | <doc xml:space="preserve" | |
| 1950 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 1951 | + | line="96">the top coordinate for region to render</doc> | |
| 1952 | + | <type name="gint" c:type="int"/> | |
| 1953 | + | </parameter> | |
| 1954 | + | <parameter name="dest_width" transfer-ownership="none"> | |
| 1955 | + | <doc xml:space="preserve" | |
| 1956 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 1957 | + | line="97">the width of the region to render</doc> | |
| 1958 | + | <type name="gint" c:type="int"/> | |
| 1959 | + | </parameter> | |
| 1960 | + | <parameter name="dest_height" transfer-ownership="none"> | |
| 1961 | + | <doc xml:space="preserve" | |
| 1962 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 1963 | + | line="98">the height of the region to render</doc> | |
| 1964 | + | <type name="gint" c:type="int"/> | |
| 1965 | + | </parameter> | |
| 1966 | + | <parameter name="offset_x" transfer-ownership="none"> | |
| 1967 | + | <doc xml:space="preserve" | |
| 1968 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 1969 | + | line="99">the offset in the X direction (currently rounded to an integer)</doc> | |
| 1970 | + | <type name="gdouble" c:type="double"/> | |
| 1971 | + | </parameter> | |
| 1972 | + | <parameter name="offset_y" transfer-ownership="none"> | |
| 1973 | + | <doc xml:space="preserve" | |
| 1974 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 1975 | + | line="100">the offset in the Y direction (currently rounded to an integer)</doc> | |
| 1976 | + | <type name="gdouble" c:type="double"/> | |
| 1977 | + | </parameter> | |
| 1978 | + | <parameter name="scale_x" transfer-ownership="none"> | |
| 1979 | + | <doc xml:space="preserve" | |
| 1980 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 1981 | + | line="101">the scale factor in the X direction</doc> | |
| 1982 | + | <type name="gdouble" c:type="double"/> | |
| 1983 | + | </parameter> | |
| 1984 | + | <parameter name="scale_y" transfer-ownership="none"> | |
| 1985 | + | <doc xml:space="preserve" | |
| 1986 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 1987 | + | line="102">the scale factor in the Y direction</doc> | |
| 1988 | + | <type name="gdouble" c:type="double"/> | |
| 1989 | + | </parameter> | |
| 1990 | + | <parameter name="interp_type" transfer-ownership="none"> | |
| 1991 | + | <doc xml:space="preserve" | |
| 1992 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 1993 | + | line="103">the interpolation type for the transformation.</doc> | |
| 1994 | + | <type name="InterpType" c:type="GdkInterpType"/> | |
| 1995 | + | </parameter> | |
| 1996 | + | <parameter name="overall_alpha" transfer-ownership="none"> | |
| 1997 | + | <doc xml:space="preserve" | |
| 1998 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 1999 | + | line="104">overall alpha for source image (0..255)</doc> | |
| 2000 | + | <type name="gint" c:type="int"/> | |
| 2001 | + | </parameter> | |
| 2002 | + | </parameters> | |
| 2003 | + | </method> | |
| 2004 | + | <method name="composite_color" c:identifier="gdk_pixbuf_composite_color"> | |
| 2005 | + | <doc xml:space="preserve" | |
| 2006 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2007 | + | line="158">Creates a transformation of the source image @src by scaling by | |
| 2008 | + | @scale_x and @scale_y then translating by @offset_x and @offset_y, | |
| 2009 | + | then alpha blends the rectangle (@dest_x ,@dest_y, @dest_width, | |
| 2010 | + | @dest_height) of the resulting image with a checkboard of the | |
| 2011 | + | colors @color1 and @color2 and renders it onto the destination | |
| 2012 | + | image. | |
| 2013 | + | ||
| 2014 | + | If the source image has no alpha channel, and @overall_alpha is 255, a fast | |
| 2015 | + | path is used which omits the alpha blending and just performs the scaling. | |
| 2016 | + | ||
| 2017 | + | See gdk_pixbuf_composite_color_simple() for a simpler variant of this | |
| 2018 | + | function suitable for many tasks.</doc> | |
| 2019 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 2020 | + | line="124"/> | |
| 2021 | + | <return-value transfer-ownership="none"> | |
| 2022 | + | <type name="none" c:type="void"/> | |
| 2023 | + | </return-value> | |
| 2024 | + | <parameters> | |
| 2025 | + | <instance-parameter name="src" transfer-ownership="none"> | |
| 2026 | + | <doc xml:space="preserve" | |
| 2027 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2028 | + | line="160">a #GdkPixbuf</doc> | |
| 2029 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2030 | + | </instance-parameter> | |
| 2031 | + | <parameter name="dest" transfer-ownership="none"> | |
| 2032 | + | <doc xml:space="preserve" | |
| 2033 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2034 | + | line="161">the #GdkPixbuf into which to render the results</doc> | |
| 2035 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2036 | + | </parameter> | |
| 2037 | + | <parameter name="dest_x" transfer-ownership="none"> | |
| 2038 | + | <doc xml:space="preserve" | |
| 2039 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2040 | + | line="162">the left coordinate for region to render</doc> | |
| 2041 | + | <type name="gint" c:type="int"/> | |
| 2042 | + | </parameter> | |
| 2043 | + | <parameter name="dest_y" transfer-ownership="none"> | |
| 2044 | + | <doc xml:space="preserve" | |
| 2045 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2046 | + | line="163">the top coordinate for region to render</doc> | |
| 2047 | + | <type name="gint" c:type="int"/> | |
| 2048 | + | </parameter> | |
| 2049 | + | <parameter name="dest_width" transfer-ownership="none"> | |
| 2050 | + | <doc xml:space="preserve" | |
| 2051 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2052 | + | line="164">the width of the region to render</doc> | |
| 2053 | + | <type name="gint" c:type="int"/> | |
| 2054 | + | </parameter> | |
| 2055 | + | <parameter name="dest_height" transfer-ownership="none"> | |
| 2056 | + | <doc xml:space="preserve" | |
| 2057 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2058 | + | line="165">the height of the region to render</doc> | |
| 2059 | + | <type name="gint" c:type="int"/> | |
| 2060 | + | </parameter> | |
| 2061 | + | <parameter name="offset_x" transfer-ownership="none"> | |
| 2062 | + | <doc xml:space="preserve" | |
| 2063 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2064 | + | line="166">the offset in the X direction (currently rounded to an integer)</doc> | |
| 2065 | + | <type name="gdouble" c:type="double"/> | |
| 2066 | + | </parameter> | |
| 2067 | + | <parameter name="offset_y" transfer-ownership="none"> | |
| 2068 | + | <doc xml:space="preserve" | |
| 2069 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2070 | + | line="167">the offset in the Y direction (currently rounded to an integer)</doc> | |
| 2071 | + | <type name="gdouble" c:type="double"/> | |
| 2072 | + | </parameter> | |
| 2073 | + | <parameter name="scale_x" transfer-ownership="none"> | |
| 2074 | + | <doc xml:space="preserve" | |
| 2075 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2076 | + | line="168">the scale factor in the X direction</doc> | |
| 2077 | + | <type name="gdouble" c:type="double"/> | |
| 2078 | + | </parameter> | |
| 2079 | + | <parameter name="scale_y" transfer-ownership="none"> | |
| 2080 | + | <doc xml:space="preserve" | |
| 2081 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2082 | + | line="169">the scale factor in the Y direction</doc> | |
| 2083 | + | <type name="gdouble" c:type="double"/> | |
| 2084 | + | </parameter> | |
| 2085 | + | <parameter name="interp_type" transfer-ownership="none"> | |
| 2086 | + | <doc xml:space="preserve" | |
| 2087 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2088 | + | line="170">the interpolation type for the transformation.</doc> | |
| 2089 | + | <type name="InterpType" c:type="GdkInterpType"/> | |
| 2090 | + | </parameter> | |
| 2091 | + | <parameter name="overall_alpha" transfer-ownership="none"> | |
| 2092 | + | <doc xml:space="preserve" | |
| 2093 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2094 | + | line="171">overall alpha for source image (0..255)</doc> | |
| 2095 | + | <type name="gint" c:type="int"/> | |
| 2096 | + | </parameter> | |
| 2097 | + | <parameter name="check_x" transfer-ownership="none"> | |
| 2098 | + | <doc xml:space="preserve" | |
| 2099 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2100 | + | line="172">the X offset for the checkboard (origin of checkboard is at -@check_x, -@check_y)</doc> | |
| 2101 | + | <type name="gint" c:type="int"/> | |
| 2102 | + | </parameter> | |
| 2103 | + | <parameter name="check_y" transfer-ownership="none"> | |
| 2104 | + | <doc xml:space="preserve" | |
| 2105 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2106 | + | line="173">the Y offset for the checkboard</doc> | |
| 2107 | + | <type name="gint" c:type="int"/> | |
| 2108 | + | </parameter> | |
| 2109 | + | <parameter name="check_size" transfer-ownership="none"> | |
| 2110 | + | <doc xml:space="preserve" | |
| 2111 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2112 | + | line="174">the size of checks in the checkboard (must be a power of two)</doc> | |
| 2113 | + | <type name="gint" c:type="int"/> | |
| 2114 | + | </parameter> | |
| 2115 | + | <parameter name="color1" transfer-ownership="none"> | |
| 2116 | + | <doc xml:space="preserve" | |
| 2117 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2118 | + | line="175">the color of check at upper left</doc> | |
| 2119 | + | <type name="guint32" c:type="guint32"/> | |
| 2120 | + | </parameter> | |
| 2121 | + | <parameter name="color2" transfer-ownership="none"> | |
| 2122 | + | <doc xml:space="preserve" | |
| 2123 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2124 | + | line="176">the color of the other check</doc> | |
| 2125 | + | <type name="guint32" c:type="guint32"/> | |
| 2126 | + | </parameter> | |
| 2127 | + | </parameters> | |
| 2128 | + | </method> | |
| 2129 | + | <method name="composite_color_simple" | |
| 2130 | + | c:identifier="gdk_pixbuf_composite_color_simple"> | |
| 2131 | + | <doc xml:space="preserve" | |
| 2132 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2133 | + | line="292">Creates a new pixbuf by scaling `src` to `dest_width` x `dest_height` | |
| 2134 | + | and alpha blending the result with a checkboard of colors `color1` | |
| 2135 | + | and `color2`.</doc> | |
| 2136 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 2137 | + | line="149"/> | |
| 2138 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 2139 | + | <doc xml:space="preserve" | |
| 2140 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2141 | + | line="307">the new pixbuf</doc> | |
| 2142 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2143 | + | </return-value> | |
| 2144 | + | <parameters> | |
| 2145 | + | <instance-parameter name="src" transfer-ownership="none"> | |
| 2146 | + | <doc xml:space="preserve" | |
| 2147 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2148 | + | line="294">a #GdkPixbuf</doc> | |
| 2149 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2150 | + | </instance-parameter> | |
| 2151 | + | <parameter name="dest_width" transfer-ownership="none"> | |
| 2152 | + | <doc xml:space="preserve" | |
| 2153 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2154 | + | line="295">the width of destination image</doc> | |
| 2155 | + | <type name="gint" c:type="int"/> | |
| 2156 | + | </parameter> | |
| 2157 | + | <parameter name="dest_height" transfer-ownership="none"> | |
| 2158 | + | <doc xml:space="preserve" | |
| 2159 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2160 | + | line="296">the height of destination image</doc> | |
| 2161 | + | <type name="gint" c:type="int"/> | |
| 2162 | + | </parameter> | |
| 2163 | + | <parameter name="interp_type" transfer-ownership="none"> | |
| 2164 | + | <doc xml:space="preserve" | |
| 2165 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2166 | + | line="297">the interpolation type for the transformation.</doc> | |
| 2167 | + | <type name="InterpType" c:type="GdkInterpType"/> | |
| 2168 | + | </parameter> | |
| 2169 | + | <parameter name="overall_alpha" transfer-ownership="none"> | |
| 2170 | + | <doc xml:space="preserve" | |
| 2171 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2172 | + | line="298">overall alpha for source image (0..255)</doc> | |
| 2173 | + | <type name="gint" c:type="int"/> | |
| 2174 | + | </parameter> | |
| 2175 | + | <parameter name="check_size" transfer-ownership="none"> | |
| 2176 | + | <doc xml:space="preserve" | |
| 2177 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2178 | + | line="299">the size of checks in the checkboard (must be a power of two)</doc> | |
| 2179 | + | <type name="gint" c:type="int"/> | |
| 2180 | + | </parameter> | |
| 2181 | + | <parameter name="color1" transfer-ownership="none"> | |
| 2182 | + | <doc xml:space="preserve" | |
| 2183 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2184 | + | line="300">the color of check at upper left</doc> | |
| 2185 | + | <type name="guint32" c:type="guint32"/> | |
| 2186 | + | </parameter> | |
| 2187 | + | <parameter name="color2" transfer-ownership="none"> | |
| 2188 | + | <doc xml:space="preserve" | |
| 2189 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2190 | + | line="301">the color of the other check</doc> | |
| 2191 | + | <type name="guint32" c:type="guint32"/> | |
| 2192 | + | </parameter> | |
| 2193 | + | </parameters> | |
| 2194 | + | </method> | |
| 2195 | + | <method name="copy" c:identifier="gdk_pixbuf_copy"> | |
| 2196 | + | <doc xml:space="preserve" | |
| 2197 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2198 | + | line="643">Creates a new `GdkPixbuf` with a copy of the information in the specified | |
| 2199 | + | `pixbuf`. | |
| 2200 | + | ||
| 2201 | + | Note that this does not copy the options set on the original `GdkPixbuf`, | |
| 2202 | + | use gdk_pixbuf_copy_options() for this.</doc> | |
| 2203 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2204 | + | line="218"/> | |
| 2205 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 2206 | + | <doc xml:space="preserve" | |
| 2207 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2208 | + | line="653">A newly-created pixbuf</doc> | |
| 2209 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2210 | + | </return-value> | |
| 2211 | + | <parameters> | |
| 2212 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2213 | + | <doc xml:space="preserve" | |
| 2214 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2215 | + | line="645">A pixbuf.</doc> | |
| 2216 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2217 | + | </instance-parameter> | |
| 2218 | + | </parameters> | |
| 2219 | + | </method> | |
| 2220 | + | <method name="copy_area" c:identifier="gdk_pixbuf_copy_area"> | |
| 2221 | + | <doc xml:space="preserve" | |
| 2222 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 2223 | + | line="121">Copies a rectangular area from `src_pixbuf` to `dest_pixbuf`. | |
| 2224 | + | ||
| 2225 | + | Conversion of pixbuf formats is done automatically. | |
| 2226 | + | ||
| 2227 | + | If the source rectangle overlaps the destination rectangle on the | |
| 2228 | + | same pixbuf, it will be overwritten during the copy operation. | |
| 2229 | + | Therefore, you can not use this function to scroll a pixbuf.</doc> | |
| 2230 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2231 | + | line="487"/> | |
| 2232 | + | <return-value transfer-ownership="none"> | |
| 2233 | + | <type name="none" c:type="void"/> | |
| 2234 | + | </return-value> | |
| 2235 | + | <parameters> | |
| 2236 | + | <instance-parameter name="src_pixbuf" transfer-ownership="none"> | |
| 2237 | + | <doc xml:space="preserve" | |
| 2238 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 2239 | + | line="123">Source pixbuf.</doc> | |
| 2240 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2241 | + | </instance-parameter> | |
| 2242 | + | <parameter name="src_x" transfer-ownership="none"> | |
| 2243 | + | <doc xml:space="preserve" | |
| 2244 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 2245 | + | line="124">Source X coordinate within @src_pixbuf.</doc> | |
| 2246 | + | <type name="gint" c:type="int"/> | |
| 2247 | + | </parameter> | |
| 2248 | + | <parameter name="src_y" transfer-ownership="none"> | |
| 2249 | + | <doc xml:space="preserve" | |
| 2250 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 2251 | + | line="125">Source Y coordinate within @src_pixbuf.</doc> | |
| 2252 | + | <type name="gint" c:type="int"/> | |
| 2253 | + | </parameter> | |
| 2254 | + | <parameter name="width" transfer-ownership="none"> | |
| 2255 | + | <doc xml:space="preserve" | |
| 2256 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 2257 | + | line="126">Width of the area to copy.</doc> | |
| 2258 | + | <type name="gint" c:type="int"/> | |
| 2259 | + | </parameter> | |
| 2260 | + | <parameter name="height" transfer-ownership="none"> | |
| 2261 | + | <doc xml:space="preserve" | |
| 2262 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 2263 | + | line="127">Height of the area to copy.</doc> | |
| 2264 | + | <type name="gint" c:type="int"/> | |
| 2265 | + | </parameter> | |
| 2266 | + | <parameter name="dest_pixbuf" transfer-ownership="none"> | |
| 2267 | + | <doc xml:space="preserve" | |
| 2268 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 2269 | + | line="128">Destination pixbuf.</doc> | |
| 2270 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2271 | + | </parameter> | |
| 2272 | + | <parameter name="dest_x" transfer-ownership="none"> | |
| 2273 | + | <doc xml:space="preserve" | |
| 2274 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 2275 | + | line="129">X coordinate within @dest_pixbuf.</doc> | |
| 2276 | + | <type name="gint" c:type="int"/> | |
| 2277 | + | </parameter> | |
| 2278 | + | <parameter name="dest_y" transfer-ownership="none"> | |
| 2279 | + | <doc xml:space="preserve" | |
| 2280 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 2281 | + | line="130">Y coordinate within @dest_pixbuf.</doc> | |
| 2282 | + | <type name="gint" c:type="int"/> | |
| 2283 | + | </parameter> | |
| 2284 | + | </parameters> | |
| 2285 | + | </method> | |
| 2286 | + | <method name="copy_options" | |
| 2287 | + | c:identifier="gdk_pixbuf_copy_options" | |
| 2288 | + | version="2.36"> | |
| 2289 | + | <doc xml:space="preserve" | |
| 2290 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2291 | + | line="1311">Copies the key/value pair options attached to a `GdkPixbuf` to another | |
| 2292 | + | `GdkPixbuf`. | |
| 2293 | + | ||
| 2294 | + | This is useful to keep original metadata after having manipulated | |
| 2295 | + | a file. However be careful to remove metadata which you've already | |
| 2296 | + | applied, such as the "orientation" option after rotating the image.</doc> | |
| 2297 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2298 | + | line="518"/> | |
| 2299 | + | <return-value transfer-ownership="none"> | |
| 2300 | + | <doc xml:space="preserve" | |
| 2301 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2302 | + | line="1323">`TRUE` on success.</doc> | |
| 2303 | + | <type name="gboolean" c:type="gboolean"/> | |
| 2304 | + | </return-value> | |
| 2305 | + | <parameters> | |
| 2306 | + | <instance-parameter name="src_pixbuf" transfer-ownership="none"> | |
| 2307 | + | <doc xml:space="preserve" | |
| 2308 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2309 | + | line="1313">the source pixbuf</doc> | |
| 2310 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2311 | + | </instance-parameter> | |
| 2312 | + | <parameter name="dest_pixbuf" transfer-ownership="none"> | |
| 2313 | + | <doc xml:space="preserve" | |
| 2314 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2315 | + | line="1314">the destination pixbuf</doc> | |
| 2316 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2317 | + | </parameter> | |
| 2318 | + | </parameters> | |
| 2319 | + | </method> | |
| 2320 | + | <method name="fill" c:identifier="gdk_pixbuf_fill"> | |
| 2321 | + | <doc xml:space="preserve" | |
| 2322 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2323 | + | line="1043">Clears a pixbuf to the given RGBA value, converting the RGBA value into | |
| 2324 | + | the pixbuf's pixel format. | |
| 2325 | + | ||
| 2326 | + | The alpha component will be ignored if the pixbuf doesn't have an alpha | |
| 2327 | + | channel.</doc> | |
| 2328 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2329 | + | line="306"/> | |
| 2330 | + | <return-value transfer-ownership="none"> | |
| 2331 | + | <type name="none" c:type="void"/> | |
| 2332 | + | </return-value> | |
| 2333 | + | <parameters> | |
| 2334 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2335 | + | <doc xml:space="preserve" | |
| 2336 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2337 | + | line="1045">a `GdkPixbuf`</doc> | |
| 2338 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2339 | + | </instance-parameter> | |
| 2340 | + | <parameter name="pixel" transfer-ownership="none"> | |
| 2341 | + | <doc xml:space="preserve" | |
| 2342 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2343 | + | line="1046">RGBA pixel to used to clear (`0xffffffff` is opaque white, | |
| 2344 | + | `0x00000000` transparent black)</doc> | |
| 2345 | + | <type name="guint32" c:type="guint32"/> | |
| 2346 | + | </parameter> | |
| 2347 | + | </parameters> | |
| 2348 | + | </method> | |
| 2349 | + | <method name="flip" c:identifier="gdk_pixbuf_flip" version="2.6"> | |
| 2350 | + | <doc xml:space="preserve" | |
| 2351 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2352 | + | line="446">Flips a pixbuf horizontally or vertically and returns the | |
| 2353 | + | result in a new pixbuf.</doc> | |
| 2354 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 2355 | + | line="162"/> | |
| 2356 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 2357 | + | <doc xml:space="preserve" | |
| 2358 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2359 | + | line="454">the new pixbuf</doc> | |
| 2360 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2361 | + | </return-value> | |
| 2362 | + | <parameters> | |
| 2363 | + | <instance-parameter name="src" transfer-ownership="none"> | |
| 2364 | + | <doc xml:space="preserve" | |
| 2365 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2366 | + | line="448">a #GdkPixbuf</doc> | |
| 2367 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2368 | + | </instance-parameter> | |
| 2369 | + | <parameter name="horizontal" transfer-ownership="none"> | |
| 2370 | + | <doc xml:space="preserve" | |
| 2371 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2372 | + | line="449">`TRUE` to flip horizontally, `FALSE` to flip vertically</doc> | |
| 2373 | + | <type name="gboolean" c:type="gboolean"/> | |
| 2374 | + | </parameter> | |
| 2375 | + | </parameters> | |
| 2376 | + | </method> | |
| 2377 | + | <method name="get_bits_per_sample" | |
| 2378 | + | c:identifier="gdk_pixbuf_get_bits_per_sample" | |
| 2379 | + | glib:get-property="bits-per-sample"> | |
| 2380 | + | <doc xml:space="preserve" | |
| 2381 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2382 | + | line="795">Queries the number of bits per color sample in a pixbuf.</doc> | |
| 2383 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2384 | + | line="180"/> | |
| 2385 | + | <return-value transfer-ownership="none"> | |
| 2386 | + | <doc xml:space="preserve" | |
| 2387 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2388 | + | line="801">Number of bits per color sample.</doc> | |
| 2389 | + | <type name="gint" c:type="int"/> | |
| 2390 | + | </return-value> | |
| 2391 | + | <parameters> | |
| 2392 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2393 | + | <doc xml:space="preserve" | |
| 2394 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2395 | + | line="797">A pixbuf.</doc> | |
| 2396 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2397 | + | </instance-parameter> | |
| 2398 | + | </parameters> | |
| 2399 | + | </method> | |
| 2400 | + | <method name="get_byte_length" | |
| 2401 | + | c:identifier="gdk_pixbuf_get_byte_length" | |
| 2402 | + | version="2.26"> | |
| 2403 | + | <doc xml:space="preserve" | |
| 2404 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2405 | + | line="1008">Returns the length of the pixel data, in bytes.</doc> | |
| 2406 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2407 | + | line="190"/> | |
| 2408 | + | <return-value transfer-ownership="none"> | |
| 2409 | + | <doc xml:space="preserve" | |
| 2410 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2411 | + | line="1014">The length of the pixel data.</doc> | |
| 2412 | + | <type name="gsize" c:type="gsize"/> | |
| 2413 | + | </return-value> | |
| 2414 | + | <parameters> | |
| 2415 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2416 | + | <doc xml:space="preserve" | |
| 2417 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2418 | + | line="1010">A pixbuf</doc> | |
| 2419 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2420 | + | </instance-parameter> | |
| 2421 | + | </parameters> | |
| 2422 | + | </method> | |
| 2423 | + | <method name="get_colorspace" | |
| 2424 | + | c:identifier="gdk_pixbuf_get_colorspace" | |
| 2425 | + | glib:get-property="colorspace"> | |
| 2426 | + | <doc xml:space="preserve" | |
| 2427 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2428 | + | line="747">Queries the color space of a pixbuf.</doc> | |
| 2429 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2430 | + | line="174"/> | |
| 2431 | + | <return-value transfer-ownership="none"> | |
| 2432 | + | <doc xml:space="preserve" | |
| 2433 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2434 | + | line="753">Color space.</doc> | |
| 2435 | + | <type name="Colorspace" c:type="GdkColorspace"/> | |
| 2436 | + | </return-value> | |
| 2437 | + | <parameters> | |
| 2438 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2439 | + | <doc xml:space="preserve" | |
| 2440 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2441 | + | line="749">A pixbuf.</doc> | |
| 2442 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2443 | + | </instance-parameter> | |
| 2444 | + | </parameters> | |
| 2445 | + | </method> | |
| 2446 | + | <method name="get_has_alpha" | |
| 2447 | + | c:identifier="gdk_pixbuf_get_has_alpha" | |
| 2448 | + | glib:get-property="has-alpha"> | |
| 2449 | + | <doc xml:space="preserve" | |
| 2450 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2451 | + | line="779">Queries whether a pixbuf has an alpha channel (opacity information).</doc> | |
| 2452 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2453 | + | line="178"/> | |
| 2454 | + | <return-value transfer-ownership="none"> | |
| 2455 | + | <doc xml:space="preserve" | |
| 2456 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2457 | + | line="785">`TRUE` if it has an alpha channel, `FALSE` otherwise.</doc> | |
| 2458 | + | <type name="gboolean" c:type="gboolean"/> | |
| 2459 | + | </return-value> | |
| 2460 | + | <parameters> | |
| 2461 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2462 | + | <doc xml:space="preserve" | |
| 2463 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2464 | + | line="781">A pixbuf.</doc> | |
| 2465 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2466 | + | </instance-parameter> | |
| 2467 | + | </parameters> | |
| 2468 | + | </method> | |
| 2469 | + | <method name="get_height" | |
| 2470 | + | c:identifier="gdk_pixbuf_get_height" | |
| 2471 | + | glib:get-property="height"> | |
| 2472 | + | <doc xml:space="preserve" | |
| 2473 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2474 | + | line="975">Queries the height of a pixbuf.</doc> | |
| 2475 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2476 | + | line="186"/> | |
| 2477 | + | <return-value transfer-ownership="none"> | |
| 2478 | + | <doc xml:space="preserve" | |
| 2479 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2480 | + | line="981">Height in pixels.</doc> | |
| 2481 | + | <type name="gint" c:type="int"/> | |
| 2482 | + | </return-value> | |
| 2483 | + | <parameters> | |
| 2484 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2485 | + | <doc xml:space="preserve" | |
| 2486 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2487 | + | line="977">A pixbuf.</doc> | |
| 2488 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2489 | + | </instance-parameter> | |
| 2490 | + | </parameters> | |
| 2491 | + | </method> | |
| 2492 | + | <method name="get_n_channels" | |
| 2493 | + | c:identifier="gdk_pixbuf_get_n_channels" | |
| 2494 | + | glib:get-property="n-channels"> | |
| 2495 | + | <doc xml:space="preserve" | |
| 2496 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2497 | + | line="763">Queries the number of channels of a pixbuf.</doc> | |
| 2498 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2499 | + | line="176"/> | |
| 2500 | + | <return-value transfer-ownership="none"> | |
| 2501 | + | <doc xml:space="preserve" | |
| 2502 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2503 | + | line="769">Number of channels.</doc> | |
| 2504 | + | <type name="gint" c:type="int"/> | |
| 2505 | + | </return-value> | |
| 2506 | + | <parameters> | |
| 2507 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2508 | + | <doc xml:space="preserve" | |
| 2509 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2510 | + | line="765">A pixbuf.</doc> | |
| 2511 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2512 | + | </instance-parameter> | |
| 2513 | + | </parameters> | |
| 2514 | + | </method> | |
| 2515 | + | <method name="get_option" c:identifier="gdk_pixbuf_get_option"> | |
| 2516 | + | <doc xml:space="preserve" | |
| 2517 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2518 | + | line="1111">Looks up @key in the list of options that may have been attached to the | |
| 2519 | + | @pixbuf when it was loaded, or that may have been attached by another | |
| 2520 | + | function using gdk_pixbuf_set_option(). | |
| 2521 | + | ||
| 2522 | + | For instance, the ANI loader provides "Title" and "Artist" options. | |
| 2523 | + | The ICO, XBM, and XPM loaders provide "x_hot" and "y_hot" hot-spot | |
| 2524 | + | options for cursor definitions. The PNG loader provides the tEXt ancillary | |
| 2525 | + | chunk key/value pairs as options. Since 2.12, the TIFF and JPEG loaders | |
| 2526 | + | return an "orientation" option string that corresponds to the embedded | |
| 2527 | + | TIFF/Exif orientation tag (if present). Since 2.32, the TIFF loader sets | |
| 2528 | + | the "multipage" option string to "yes" when a multi-page TIFF is loaded. | |
| 2529 | + | Since 2.32 the JPEG and PNG loaders set "x-dpi" and "y-dpi" if the file | |
| 2530 | + | contains image density information in dots per inch. | |
| 2531 | + | Since 2.36.6, the JPEG loader sets the "comment" option with the comment | |
| 2532 | + | EXIF tag.</doc> | |
| 2533 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2534 | + | line="510"/> | |
| 2535 | + | <return-value transfer-ownership="none" nullable="1"> | |
| 2536 | + | <doc xml:space="preserve" | |
| 2537 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2538 | + | line="1132">the value associated with `key`</doc> | |
| 2539 | + | <type name="utf8" c:type="const gchar*"/> | |
| 2540 | + | </return-value> | |
| 2541 | + | <parameters> | |
| 2542 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2543 | + | <doc xml:space="preserve" | |
| 2544 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2545 | + | line="1113">a `GdkPixbuf`</doc> | |
| 2546 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2547 | + | </instance-parameter> | |
| 2548 | + | <parameter name="key" transfer-ownership="none"> | |
| 2549 | + | <doc xml:space="preserve" | |
| 2550 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2551 | + | line="1114">a nul-terminated string.</doc> | |
| 2552 | + | <type name="utf8" c:type="const gchar*"/> | |
| 2553 | + | </parameter> | |
| 2554 | + | </parameters> | |
| 2555 | + | </method> | |
| 2556 | + | <method name="get_options" | |
| 2557 | + | c:identifier="gdk_pixbuf_get_options" | |
| 2558 | + | version="2.32"> | |
| 2559 | + | <doc xml:space="preserve" | |
| 2560 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2561 | + | line="1156">Returns a `GHashTable` with a list of all the options that may have been | |
| 2562 | + | attached to the `pixbuf` when it was loaded, or that may have been | |
| 2563 | + | attached by another function using [method@GdkPixbuf.Pixbuf.set_option].</doc> | |
| 2564 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2565 | + | line="516"/> | |
| 2566 | + | <return-value transfer-ownership="container"> | |
| 2567 | + | <doc xml:space="preserve" | |
| 2568 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2569 | + | line="1164">a #GHashTable | |
| 2570 | + | of key/values pairs</doc> | |
| 2571 | + | <type name="GLib.HashTable" c:type="GHashTable*"> | |
| 2572 | + | <type name="utf8"/> | |
| 2573 | + | <type name="utf8"/> | |
| 2574 | + | </type> | |
| 2575 | + | </return-value> | |
| 2576 | + | <parameters> | |
| 2577 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2578 | + | <doc xml:space="preserve" | |
| 2579 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2580 | + | line="1158">a `GdkPixbuf`</doc> | |
| 2581 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2582 | + | </instance-parameter> | |
| 2583 | + | </parameters> | |
| 2584 | + | </method> | |
| 2585 | + | <method name="get_pixels" | |
| 2586 | + | c:identifier="gdk_pixbuf_get_pixels" | |
| 2587 | + | shadowed-by="get_pixels_with_length" | |
| 2588 | + | glib:get-property="pixels"> | |
| 2589 | + | <doc xml:space="preserve" | |
| 2590 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2591 | + | line="811">Queries a pointer to the pixel data of a pixbuf. | |
| 2592 | + | ||
| 2593 | + | This function will cause an implicit copy of the pixbuf data if the | |
| 2594 | + | pixbuf was created from read-only data. | |
| 2595 | + | ||
| 2596 | + | Please see the section on [image data](class.Pixbuf.html#image-data) for information | |
| 2597 | + | about how the pixel data is stored in memory.</doc> | |
| 2598 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2599 | + | line="182"/> | |
| 2600 | + | <return-value transfer-ownership="none"> | |
| 2601 | + | <doc xml:space="preserve" | |
| 2602 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2603 | + | line="823">A pointer to the pixbuf's pixel data.</doc> | |
| 2604 | + | <array zero-terminated="0" c:type="guchar*"> | |
| 2605 | + | <type name="guint8" c:type="guchar"/> | |
| 2606 | + | </array> | |
| 2607 | + | </return-value> | |
| 2608 | + | <parameters> | |
| 2609 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2610 | + | <doc xml:space="preserve" | |
| 2611 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2612 | + | line="813">A pixbuf.</doc> | |
| 2613 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2614 | + | </instance-parameter> | |
| 2615 | + | </parameters> | |
| 2616 | + | </method> | |
| 2617 | + | <method name="get_pixels_with_length" | |
| 2618 | + | c:identifier="gdk_pixbuf_get_pixels_with_length" | |
| 2619 | + | shadows="get_pixels" | |
| 2620 | + | version="2.26"> | |
| 2621 | + | <doc xml:space="preserve" | |
| 2622 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2623 | + | line="857">Queries a pointer to the pixel data of a pixbuf. | |
| 2624 | + | ||
| 2625 | + | This function will cause an implicit copy of the pixbuf data if the | |
| 2626 | + | pixbuf was created from read-only data. | |
| 2627 | + | ||
| 2628 | + | Please see the section on [image data](class.Pixbuf.html#image-data) for information | |
| 2629 | + | about how the pixel data is stored in memory.</doc> | |
| 2630 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2631 | + | line="193"/> | |
| 2632 | + | <return-value transfer-ownership="none"> | |
| 2633 | + | <doc xml:space="preserve" | |
| 2634 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2635 | + | line="870">A pointer to the pixbuf's | |
| 2636 | + | pixel data.</doc> | |
| 2637 | + | <array length="0" zero-terminated="0" c:type="guchar*"> | |
| 2638 | + | <type name="guint8" c:type="guchar"/> | |
| 2639 | + | </array> | |
| 2640 | + | </return-value> | |
| 2641 | + | <parameters> | |
| 2642 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2643 | + | <doc xml:space="preserve" | |
| 2644 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2645 | + | line="859">A pixbuf.</doc> | |
| 2646 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2647 | + | </instance-parameter> | |
| 2648 | + | <parameter name="length" | |
| 2649 | + | direction="out" | |
| 2650 | + | caller-allocates="0" | |
| 2651 | + | transfer-ownership="full"> | |
| 2652 | + | <doc xml:space="preserve" | |
| 2653 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2654 | + | line="860">The length of the binary data.</doc> | |
| 2655 | + | <type name="guint" c:type="guint*"/> | |
| 2656 | + | </parameter> | |
| 2657 | + | </parameters> | |
| 2658 | + | </method> | |
| 2659 | + | <method name="get_rowstride" | |
| 2660 | + | c:identifier="gdk_pixbuf_get_rowstride" | |
| 2661 | + | glib:get-property="rowstride"> | |
| 2662 | + | <doc xml:space="preserve" | |
| 2663 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2664 | + | line="991">Queries the rowstride of a pixbuf, which is the number of bytes between | |
| 2665 | + | the start of a row and the start of the next row.</doc> | |
| 2666 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2667 | + | line="188"/> | |
| 2668 | + | <return-value transfer-ownership="none"> | |
| 2669 | + | <doc xml:space="preserve" | |
| 2670 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2671 | + | line="998">Distance between row starts.</doc> | |
| 2672 | + | <type name="gint" c:type="int"/> | |
| 2673 | + | </return-value> | |
| 2674 | + | <parameters> | |
| 2675 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2676 | + | <doc xml:space="preserve" | |
| 2677 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2678 | + | line="993">A pixbuf.</doc> | |
| 2679 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2680 | + | </instance-parameter> | |
| 2681 | + | </parameters> | |
| 2682 | + | </method> | |
| 2683 | + | <method name="get_width" | |
| 2684 | + | c:identifier="gdk_pixbuf_get_width" | |
| 2685 | + | glib:get-property="width"> | |
| 2686 | + | <doc xml:space="preserve" | |
| 2687 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2688 | + | line="959">Queries the width of a pixbuf.</doc> | |
| 2689 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2690 | + | line="184"/> | |
| 2691 | + | <return-value transfer-ownership="none"> | |
| 2692 | + | <doc xml:space="preserve" | |
| 2693 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2694 | + | line="965">Width in pixels.</doc> | |
| 2695 | + | <type name="gint" c:type="int"/> | |
| 2696 | + | </return-value> | |
| 2697 | + | <parameters> | |
| 2698 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2699 | + | <doc xml:space="preserve" | |
| 2700 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2701 | + | line="961">A pixbuf.</doc> | |
| 2702 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2703 | + | </instance-parameter> | |
| 2704 | + | </parameters> | |
| 2705 | + | </method> | |
| 2706 | + | <method name="new_subpixbuf" c:identifier="gdk_pixbuf_new_subpixbuf"> | |
| 2707 | + | <doc xml:space="preserve" | |
| 2708 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2709 | + | line="685">Creates a new pixbuf which represents a sub-region of `src_pixbuf`. | |
| 2710 | + | ||
| 2711 | + | The new pixbuf shares its pixels with the original pixbuf, so | |
| 2712 | + | writing to one affects both. The new pixbuf holds a reference to | |
| 2713 | + | `src_pixbuf`, so `src_pixbuf` will not be finalized until the new | |
| 2714 | + | pixbuf is finalized. | |
| 2715 | + | ||
| 2716 | + | Note that if `src_pixbuf` is read-only, this function will force it | |
| 2717 | + | to be mutable.</doc> | |
| 2718 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2719 | + | line="222"/> | |
| 2720 | + | <return-value transfer-ownership="full"> | |
| 2721 | + | <doc xml:space="preserve" | |
| 2722 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2723 | + | line="703">a new pixbuf</doc> | |
| 2724 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2725 | + | </return-value> | |
| 2726 | + | <parameters> | |
| 2727 | + | <instance-parameter name="src_pixbuf" transfer-ownership="none"> | |
| 2728 | + | <doc xml:space="preserve" | |
| 2729 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2730 | + | line="687">a `GdkPixbuf`</doc> | |
| 2731 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2732 | + | </instance-parameter> | |
| 2733 | + | <parameter name="src_x" transfer-ownership="none"> | |
| 2734 | + | <doc xml:space="preserve" | |
| 2735 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2736 | + | line="688">X coord in @src_pixbuf</doc> | |
| 2737 | + | <type name="gint" c:type="int"/> | |
| 2738 | + | </parameter> | |
| 2739 | + | <parameter name="src_y" transfer-ownership="none"> | |
| 2740 | + | <doc xml:space="preserve" | |
| 2741 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2742 | + | line="689">Y coord in @src_pixbuf</doc> | |
| 2743 | + | <type name="gint" c:type="int"/> | |
| 2744 | + | </parameter> | |
| 2745 | + | <parameter name="width" transfer-ownership="none"> | |
| 2746 | + | <doc xml:space="preserve" | |
| 2747 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2748 | + | line="690">width of region in @src_pixbuf</doc> | |
| 2749 | + | <type name="gint" c:type="int"/> | |
| 2750 | + | </parameter> | |
| 2751 | + | <parameter name="height" transfer-ownership="none"> | |
| 2752 | + | <doc xml:space="preserve" | |
| 2753 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2754 | + | line="691">height of region in @src_pixbuf</doc> | |
| 2755 | + | <type name="gint" c:type="int"/> | |
| 2756 | + | </parameter> | |
| 2757 | + | </parameters> | |
| 2758 | + | </method> | |
| 2759 | + | <method name="read_pixel_bytes" | |
| 2760 | + | c:identifier="gdk_pixbuf_read_pixel_bytes" | |
| 2761 | + | version="2.32"> | |
| 2762 | + | <doc xml:space="preserve" | |
| 2763 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2764 | + | line="924">Provides a #GBytes buffer containing the raw pixel data; the data | |
| 2765 | + | must not be modified. | |
| 2766 | + | ||
| 2767 | + | This function allows skipping the implicit copy that must be made | |
| 2768 | + | if gdk_pixbuf_get_pixels() is called on a read-only pixbuf.</doc> | |
| 2769 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2770 | + | line="199"/> | |
| 2771 | + | <return-value transfer-ownership="full"> | |
| 2772 | + | <doc xml:space="preserve" | |
| 2773 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2774 | + | line="934">A new reference to a read-only copy of | |
| 2775 | + | the pixel data. Note that for mutable pixbufs, this function will | |
| 2776 | + | incur a one-time copy of the pixel data for conversion into the | |
| 2777 | + | returned #GBytes.</doc> | |
| 2778 | + | <type name="GLib.Bytes" c:type="GBytes*"/> | |
| 2779 | + | </return-value> | |
| 2780 | + | <parameters> | |
| 2781 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2782 | + | <doc xml:space="preserve" | |
| 2783 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2784 | + | line="926">A pixbuf</doc> | |
| 2785 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2786 | + | </instance-parameter> | |
| 2787 | + | </parameters> | |
| 2788 | + | </method> | |
| 2789 | + | <method name="read_pixels" | |
| 2790 | + | c:identifier="gdk_pixbuf_read_pixels" | |
| 2791 | + | version="2.32"> | |
| 2792 | + | <doc xml:space="preserve" | |
| 2793 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2794 | + | line="890">Provides a read-only pointer to the raw pixel data. | |
| 2795 | + | ||
| 2796 | + | This function allows skipping the implicit copy that must be made | |
| 2797 | + | if gdk_pixbuf_get_pixels() is called on a read-only pixbuf.</doc> | |
| 2798 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2799 | + | line="197"/> | |
| 2800 | + | <return-value transfer-ownership="none"> | |
| 2801 | + | <doc xml:space="preserve" | |
| 2802 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2803 | + | line="899">a read-only pointer to the raw pixel data</doc> | |
| 2804 | + | <type name="guint8" c:type="const guint8*"/> | |
| 2805 | + | </return-value> | |
| 2806 | + | <parameters> | |
| 2807 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2808 | + | <doc xml:space="preserve" | |
| 2809 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2810 | + | line="892">A pixbuf</doc> | |
| 2811 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2812 | + | </instance-parameter> | |
| 2813 | + | </parameters> | |
| 2814 | + | </method> | |
| 2815 | + | <method name="ref" | |
| 2816 | + | c:identifier="gdk_pixbuf_ref" | |
| 2817 | + | introspectable="0" | |
| 2818 | + | deprecated="1" | |
| 2819 | + | deprecated-version="2.0"> | |
| 2820 | + | <doc xml:space="preserve" | |
| 2821 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2822 | + | line="414">Adds a reference to a pixbuf.</doc> | |
| 2823 | + | <doc-deprecated xml:space="preserve">Use g_object_ref().</doc-deprecated> | |
| 2824 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2825 | + | line="166"/> | |
| 2826 | + | <return-value> | |
| 2827 | + | <doc xml:space="preserve" | |
| 2828 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2829 | + | line="420">The same as the @pixbuf argument.</doc> | |
| 2830 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2831 | + | </return-value> | |
| 2832 | + | <parameters> | |
| 2833 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2834 | + | <doc xml:space="preserve" | |
| 2835 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2836 | + | line="416">A pixbuf.</doc> | |
| 2837 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2838 | + | </instance-parameter> | |
| 2839 | + | </parameters> | |
| 2840 | + | </method> | |
| 2841 | + | <method name="remove_option" | |
| 2842 | + | c:identifier="gdk_pixbuf_remove_option" | |
| 2843 | + | version="2.36"> | |
| 2844 | + | <doc xml:space="preserve" | |
| 2845 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2846 | + | line="1191">Removes the key/value pair option attached to a `GdkPixbuf`.</doc> | |
| 2847 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2848 | + | line="513"/> | |
| 2849 | + | <return-value transfer-ownership="none"> | |
| 2850 | + | <doc xml:space="preserve" | |
| 2851 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2852 | + | line="1198">`TRUE` if an option was removed, `FALSE` if not.</doc> | |
| 2853 | + | <type name="gboolean" c:type="gboolean"/> | |
| 2854 | + | </return-value> | |
| 2855 | + | <parameters> | |
| 2856 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 2857 | + | <doc xml:space="preserve" | |
| 2858 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2859 | + | line="1193">a `GdkPixbuf`</doc> | |
| 2860 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2861 | + | </instance-parameter> | |
| 2862 | + | <parameter name="key" transfer-ownership="none"> | |
| 2863 | + | <doc xml:space="preserve" | |
| 2864 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 2865 | + | line="1194">a nul-terminated string representing the key to remove.</doc> | |
| 2866 | + | <type name="utf8" c:type="const gchar*"/> | |
| 2867 | + | </parameter> | |
| 2868 | + | </parameters> | |
| 2869 | + | </method> | |
| 2870 | + | <method name="rotate_simple" | |
| 2871 | + | c:identifier="gdk_pixbuf_rotate_simple" | |
| 2872 | + | version="2.6"> | |
| 2873 | + | <doc xml:space="preserve" | |
| 2874 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2875 | + | line="340">Rotates a pixbuf by a multiple of 90 degrees, and returns the | |
| 2876 | + | result in a new pixbuf. | |
| 2877 | + | ||
| 2878 | + | If `angle` is 0, this function will return a copy of `src`.</doc> | |
| 2879 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 2880 | + | line="159"/> | |
| 2881 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 2882 | + | <doc xml:space="preserve" | |
| 2883 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2884 | + | line="350">the new pixbuf</doc> | |
| 2885 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2886 | + | </return-value> | |
| 2887 | + | <parameters> | |
| 2888 | + | <instance-parameter name="src" transfer-ownership="none"> | |
| 2889 | + | <doc xml:space="preserve" | |
| 2890 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2891 | + | line="342">a #GdkPixbuf</doc> | |
| 2892 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2893 | + | </instance-parameter> | |
| 2894 | + | <parameter name="angle" transfer-ownership="none"> | |
| 2895 | + | <doc xml:space="preserve" | |
| 2896 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 2897 | + | line="343">the angle to rotate by</doc> | |
| 2898 | + | <type name="PixbufRotation" c:type="GdkPixbufRotation"/> | |
| 2899 | + | </parameter> | |
| 2900 | + | </parameters> | |
| 2901 | + | </method> | |
| 2902 | + | <method name="saturate_and_pixelate" | |
| 2903 | + | c:identifier="gdk_pixbuf_saturate_and_pixelate"> | |
| 2904 | + | <doc xml:space="preserve" | |
| 2905 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 2906 | + | line="172">Modifies saturation and optionally pixelates `src`, placing the result in | |
| 2907 | + | `dest`. | |
| 2908 | + | ||
| 2909 | + | The `src` and `dest` pixbufs must have the same image format, size, and | |
| 2910 | + | rowstride. | |
| 2911 | + | ||
| 2912 | + | The `src` and `dest` arguments may be the same pixbuf with no ill effects. | |
| 2913 | + | ||
| 2914 | + | If `saturation` is 1.0 then saturation is not changed. If it's less than 1.0, | |
| 2915 | + | saturation is reduced (the image turns toward grayscale); if greater than | |
| 2916 | + | 1.0, saturation is increased (the image gets more vivid colors). | |
| 2917 | + | ||
| 2918 | + | If `pixelate` is `TRUE`, then pixels are faded in a checkerboard pattern to | |
| 2919 | + | create a pixelated image.</doc> | |
| 2920 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 2921 | + | line="495"/> | |
| 2922 | + | <return-value transfer-ownership="none"> | |
| 2923 | + | <type name="none" c:type="void"/> | |
| 2924 | + | </return-value> | |
| 2925 | + | <parameters> | |
| 2926 | + | <instance-parameter name="src" transfer-ownership="none"> | |
| 2927 | + | <doc xml:space="preserve" | |
| 2928 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 2929 | + | line="174">source image</doc> | |
| 2930 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 2931 | + | </instance-parameter> | |
| 2932 | + | <parameter name="dest" transfer-ownership="none"> | |
| 2933 | + | <doc xml:space="preserve" | |
| 2934 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 2935 | + | line="175">place to write modified version of @src</doc> | |
| 2936 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 2937 | + | </parameter> | |
| 2938 | + | <parameter name="saturation" transfer-ownership="none"> | |
| 2939 | + | <doc xml:space="preserve" | |
| 2940 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 2941 | + | line="176">saturation factor</doc> | |
| 2942 | + | <type name="gfloat" c:type="gfloat"/> | |
| 2943 | + | </parameter> | |
| 2944 | + | <parameter name="pixelate" transfer-ownership="none"> | |
| 2945 | + | <doc xml:space="preserve" | |
| 2946 | + | filename="../gdk-pixbuf/gdk-pixbuf-util.c" | |
| 2947 | + | line="177">whether to pixelate</doc> | |
| 2948 | + | <type name="gboolean" c:type="gboolean"/> | |
| 2949 | + | </parameter> | |
| 2950 | + | </parameters> | |
| 2951 | + | </method> | |
| 2952 | + | <method name="save" c:identifier="gdk_pixbuf_save" introspectable="0"> | |
| 2953 | + | <doc xml:space="preserve" | |
| 2954 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 2955 | + | line="2416">Saves pixbuf to a file in format @type. By default, "jpeg", "png", "ico" | |
| 2956 | + | and "bmp" are possible file formats to save in, but more formats may be | |
| 2957 | + | installed. The list of all writable formats can be determined in the | |
| 2958 | + | following way: | |
| 2959 | + | ||
| 2960 | + | ```c | |
| 2961 | + | void add_if_writable (GdkPixbufFormat *data, GSList **list) | |
| 2962 | + | { | |
| 2963 | + | if (gdk_pixbuf_format_is_writable (data)) | |
| 2964 | + | *list = g_slist_prepend (*list, data); | |
| 2965 | + | } | |
| 2966 | + | ||
| 2967 | + | GSList *formats = gdk_pixbuf_get_formats (); | |
| 2968 | + | GSList *writable_formats = NULL; | |
| 2969 | + | g_slist_foreach (formats, add_if_writable, &writable_formats); | |
| 2970 | + | g_slist_free (formats); | |
| 2971 | + | ``` | |
| 2972 | + | ||
| 2973 | + | If `error` is set, `FALSE` will be returned. Possible errors include | |
| 2974 | + | those in the `GDK_PIXBUF_ERROR` domain and those in the `G_FILE_ERROR` | |
| 2975 | + | domain. | |
| 2976 | + | ||
| 2977 | + | The variable argument list should be `NULL`-terminated; if not empty, | |
| 2978 | + | it should contain pairs of strings that modify the save | |
| 2979 | + | parameters. For example: | |
| 2980 | + | ||
| 2981 | + | ```c | |
| 2982 | + | gdk_pixbuf_save (pixbuf, handle, "jpeg", &error, "quality", "100", NULL); | |
| 2983 | + | ``` | |
| 2984 | + | ||
| 2985 | + | Currently only few parameters exist. | |
| 2986 | + | ||
| 2987 | + | JPEG images can be saved with a "quality" parameter; its value should be | |
| 2988 | + | in the range `[0, 100]`. JPEG and PNG density can be set by setting the | |
| 2989 | + | "x-dpi" and "y-dpi" parameters to the appropriate values in dots per inch. | |
| 2990 | + | ||
| 2991 | + | Text chunks can be attached to PNG images by specifying parameters of | |
| 2992 | + | the form "tEXt::key", where key is an ASCII string of length 1-79. | |
| 2993 | + | The values are UTF-8 encoded strings. The PNG compression level can | |
| 2994 | + | be specified using the "compression" parameter; it's value is in an | |
| 2995 | + | integer in the range of `[0, 9]`. | |
| 2996 | + | ||
| 2997 | + | ICC color profiles can also be embedded into PNG, JPEG and TIFF images. | |
| 2998 | + | The "icc-profile" value should be the complete ICC profile encoded | |
| 2999 | + | into base64. | |
| 3000 | + | ||
| 3001 | + | ```c | |
| 3002 | + | char *contents; | |
| 3003 | + | gsize length; | |
| 3004 | + | ||
| 3005 | + | // icm_path is set elsewhere | |
| 3006 | + | g_file_get_contents (icm_path, &contents, &length, NULL); | |
| 3007 | + | ||
| 3008 | + | char *contents_encode = g_base64_encode ((const guchar *) contents, length); | |
| 3009 | + | ||
| 3010 | + | gdk_pixbuf_save (pixbuf, handle, "png", &error, "icc-profile", contents_encode, NULL); | |
| 3011 | + | ``` | |
| 3012 | + | ||
| 3013 | + | TIFF images recognize: | |
| 3014 | + | ||
| 3015 | + | 1. a "bits-per-sample" option (integer) which can be either 1 for saving | |
| 3016 | + | bi-level CCITTFAX4 images, or 8 for saving 8-bits per sample | |
| 3017 | + | 2. a "compression" option (integer) which can be 1 for no compression, | |
| 3018 | + | 2 for Huffman, 5 for LZW, 7 for JPEG and 8 for DEFLATE (see the libtiff | |
| 3019 | + | documentation and tiff.h for all supported codec values) | |
| 3020 | + | 3. an "icc-profile" option (zero-terminated string) containing a base64 | |
| 3021 | + | encoded ICC color profile. | |
| 3022 | + | ||
| 3023 | + | ICO images can be saved in depth 16, 24, or 32, by using the "depth" | |
| 3024 | + | parameter. When the ICO saver is given "x_hot" and "y_hot" parameters, | |
| 3025 | + | it produces a CUR instead of an ICO.</doc> | |
| 3026 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 3027 | + | line="319"/> | |
| 3028 | + | <return-value transfer-ownership="none"> | |
| 3029 | + | <doc xml:space="preserve" | |
| 3030 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3031 | + | line="2496">`TRUE` on success, and `FALSE` otherwise</doc> | |
| 3032 | + | <type name="gboolean" c:type="gboolean"/> | |
| 3033 | + | </return-value> | |
| 3034 | + | <parameters> | |
| 3035 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 3036 | + | <doc xml:space="preserve" | |
| 3037 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3038 | + | line="2418">a `GdkPixbuf`.</doc> | |
| 3039 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 3040 | + | </instance-parameter> | |
| 3041 | + | <parameter name="filename" transfer-ownership="none"> | |
| 3042 | + | <doc xml:space="preserve" | |
| 3043 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3044 | + | line="2419">name of file to save.</doc> | |
| 3045 | + | <type name="filename" c:type="const char*"/> | |
| 3046 | + | </parameter> | |
| 3047 | + | <parameter name="type" transfer-ownership="none"> | |
| 3048 | + | <doc xml:space="preserve" | |
| 3049 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3050 | + | line="2420">name of file format.</doc> | |
| 3051 | + | <type name="utf8" c:type="const char*"/> | |
| 3052 | + | </parameter> | |
| 3053 | + | <parameter name="error" | |
| 3054 | + | transfer-ownership="none" | |
| 3055 | + | nullable="1" | |
| 3056 | + | allow-none="1"> | |
| 3057 | + | <doc xml:space="preserve" | |
| 3058 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3059 | + | line="2421">return location for error</doc> | |
| 3060 | + | <type name="GLib.Error" c:type="GError**"/> | |
| 3061 | + | </parameter> | |
| 3062 | + | <parameter name="..." transfer-ownership="none"> | |
| 3063 | + | <doc xml:space="preserve" | |
| 3064 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3065 | + | line="2422">list of key-value save options, followed by `NULL`</doc> | |
| 3066 | + | <varargs/> | |
| 3067 | + | </parameter> | |
| 3068 | + | </parameters> | |
| 3069 | + | </method> | |
| 3070 | + | <method name="save_to_buffer" | |
| 3071 | + | c:identifier="gdk_pixbuf_save_to_buffer" | |
| 3072 | + | version="2.4" | |
| 3073 | + | introspectable="0"> | |
| 3074 | + | <doc xml:space="preserve" | |
| 3075 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3076 | + | line="2753">Saves pixbuf to a new buffer in format `type`, which is currently "jpeg", | |
| 3077 | + | "png", "tiff", "ico" or "bmp". | |
| 3078 | + | ||
| 3079 | + | This is a convenience function that uses `gdk_pixbuf_save_to_callback()` | |
| 3080 | + | to do the real work. | |
| 3081 | + | ||
| 3082 | + | Note that the buffer is not `NUL`-terminated and may contain embedded `NUL` | |
| 3083 | + | characters. | |
| 3084 | + | ||
| 3085 | + | If @error is set, `FALSE` will be returned and @buffer will be set to | |
| 3086 | + | `NULL`. Possible errors include those in the `GDK_PIXBUF_ERROR` | |
| 3087 | + | domain. | |
| 3088 | + | ||
| 3089 | + | See `gdk_pixbuf_save()` for more details.</doc> | |
| 3090 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 3091 | + | line="392"/> | |
| 3092 | + | <return-value transfer-ownership="none"> | |
| 3093 | + | <doc xml:space="preserve" | |
| 3094 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3095 | + | line="2778">whether an error was set</doc> | |
| 3096 | + | <type name="gboolean" c:type="gboolean"/> | |
| 3097 | + | </return-value> | |
| 3098 | + | <parameters> | |
| 3099 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 3100 | + | <doc xml:space="preserve" | |
| 3101 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3102 | + | line="2755">a `GdkPixbuf`.</doc> | |
| 3103 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 3104 | + | </instance-parameter> | |
| 3105 | + | <parameter name="buffer" | |
| 3106 | + | direction="out" | |
| 3107 | + | caller-allocates="0" | |
| 3108 | + | transfer-ownership="full"> | |
| 3109 | + | <doc xml:space="preserve" | |
| 3110 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3111 | + | line="2756">location to receive a pointer | |
| 3112 | + | to the new buffer.</doc> | |
| 3113 | + | <array length="1" zero-terminated="0" c:type="gchar**"> | |
| 3114 | + | <type name="guint8"/> | |
| 3115 | + | </array> | |
| 3116 | + | </parameter> | |
| 3117 | + | <parameter name="buffer_size" | |
| 3118 | + | direction="out" | |
| 3119 | + | caller-allocates="0" | |
| 3120 | + | transfer-ownership="full"> | |
| 3121 | + | <doc xml:space="preserve" | |
| 3122 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3123 | + | line="2758">location to receive the size of the new buffer.</doc> | |
| 3124 | + | <type name="gsize" c:type="gsize*"/> | |
| 3125 | + | </parameter> | |
| 3126 | + | <parameter name="type" transfer-ownership="none"> | |
| 3127 | + | <doc xml:space="preserve" | |
| 3128 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3129 | + | line="2759">name of file format.</doc> | |
| 3130 | + | <type name="utf8" c:type="const char*"/> | |
| 3131 | + | </parameter> | |
| 3132 | + | <parameter name="error" | |
| 3133 | + | transfer-ownership="none" | |
| 3134 | + | nullable="1" | |
| 3135 | + | allow-none="1"> | |
| 3136 | + | <doc xml:space="preserve" | |
| 3137 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3138 | + | line="2760">return location for error, or `NULL`</doc> | |
| 3139 | + | <type name="GLib.Error" c:type="GError**"/> | |
| 3140 | + | </parameter> | |
| 3141 | + | <parameter name="..." transfer-ownership="none"> | |
| 3142 | + | <doc xml:space="preserve" | |
| 3143 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3144 | + | line="2761">list of key-value save options</doc> | |
| 3145 | + | <varargs/> | |
| 3146 | + | </parameter> | |
| 3147 | + | </parameters> | |
| 3148 | + | </method> | |
| 3149 | + | <method name="save_to_bufferv" | |
| 3150 | + | c:identifier="gdk_pixbuf_save_to_bufferv" | |
| 3151 | + | version="2.4" | |
| 3152 | + | throws="1"> | |
| 3153 | + | <doc xml:space="preserve" | |
| 3154 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3155 | + | line="2846">Vector version of `gdk_pixbuf_save_to_buffer()`. | |
| 3156 | + | ||
| 3157 | + | Saves pixbuf to a new buffer in format @type, which is currently "jpeg", | |
| 3158 | + | "tiff", "png", "ico" or "bmp". | |
| 3159 | + | ||
| 3160 | + | See [method@GdkPixbuf.Pixbuf.save_to_buffer] for more details.</doc> | |
| 3161 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 3162 | + | line="400"/> | |
| 3163 | + | <return-value transfer-ownership="none"> | |
| 3164 | + | <doc xml:space="preserve" | |
| 3165 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3166 | + | line="2864">whether an error was set</doc> | |
| 3167 | + | <type name="gboolean" c:type="gboolean"/> | |
| 3168 | + | </return-value> | |
| 3169 | + | <parameters> | |
| 3170 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 3171 | + | <doc xml:space="preserve" | |
| 3172 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3173 | + | line="2848">a `GdkPixbuf`.</doc> | |
| 3174 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 3175 | + | </instance-parameter> | |
| 3176 | + | <parameter name="buffer" | |
| 3177 | + | direction="out" | |
| 3178 | + | caller-allocates="0" | |
| 3179 | + | transfer-ownership="full"> | |
| 3180 | + | <doc xml:space="preserve" | |
| 3181 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3182 | + | line="2849"> | |
| 3183 | + | location to receive a pointer to the new buffer.</doc> | |
| 3184 | + | <array length="1" zero-terminated="0" c:type="gchar**"> | |
| 3185 | + | <type name="guint8"/> | |
| 3186 | + | </array> | |
| 3187 | + | </parameter> | |
| 3188 | + | <parameter name="buffer_size" | |
| 3189 | + | direction="out" | |
| 3190 | + | caller-allocates="0" | |
| 3191 | + | transfer-ownership="full"> | |
| 3192 | + | <doc xml:space="preserve" | |
| 3193 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3194 | + | line="2851">location to receive the size of the new buffer.</doc> | |
| 3195 | + | <type name="gsize" c:type="gsize*"/> | |
| 3196 | + | </parameter> | |
| 3197 | + | <parameter name="type" transfer-ownership="none"> | |
| 3198 | + | <doc xml:space="preserve" | |
| 3199 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3200 | + | line="2852">name of file format.</doc> | |
| 3201 | + | <type name="utf8" c:type="const char*"/> | |
| 3202 | + | </parameter> | |
| 3203 | + | <parameter name="option_keys" | |
| 3204 | + | transfer-ownership="none" | |
| 3205 | + | nullable="1" | |
| 3206 | + | allow-none="1"> | |
| 3207 | + | <doc xml:space="preserve" | |
| 3208 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3209 | + | line="2853">name of options to set</doc> | |
| 3210 | + | <array c:type="char**"> | |
| 3211 | + | <type name="utf8"/> | |
| 3212 | + | </array> | |
| 3213 | + | </parameter> | |
| 3214 | + | <parameter name="option_values" | |
| 3215 | + | transfer-ownership="none" | |
| 3216 | + | nullable="1" | |
| 3217 | + | allow-none="1"> | |
| 3218 | + | <doc xml:space="preserve" | |
| 3219 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3220 | + | line="2854">values for named options</doc> | |
| 3221 | + | <array c:type="char**"> | |
| 3222 | + | <type name="utf8"/> | |
| 3223 | + | </array> | |
| 3224 | + | </parameter> | |
| 3225 | + | </parameters> | |
| 3226 | + | </method> | |
| 3227 | + | <method name="save_to_callback" | |
| 3228 | + | c:identifier="gdk_pixbuf_save_to_callback" | |
| 3229 | + | version="2.4" | |
| 3230 | + | introspectable="0"> | |
| 3231 | + | <doc xml:space="preserve" | |
| 3232 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3233 | + | line="2640">Saves pixbuf in format `type` by feeding the produced data to a | |
| 3234 | + | callback. | |
| 3235 | + | ||
| 3236 | + | This function can be used when you want to store the image to something | |
| 3237 | + | other than a file, such as an in-memory buffer or a socket. | |
| 3238 | + | ||
| 3239 | + | If @error is set, `FALSE` will be returned. Possible errors | |
| 3240 | + | include those in the `GDK_PIXBUF_ERROR` domain and whatever the save | |
| 3241 | + | function generates. | |
| 3242 | + | ||
| 3243 | + | See [method@GdkPixbuf.Pixbuf.save] for more details.</doc> | |
| 3244 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 3245 | + | line="373"/> | |
| 3246 | + | <return-value transfer-ownership="none"> | |
| 3247 | + | <doc xml:space="preserve" | |
| 3248 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3249 | + | line="2662">whether an error was set</doc> | |
| 3250 | + | <type name="gboolean" c:type="gboolean"/> | |
| 3251 | + | </return-value> | |
| 3252 | + | <parameters> | |
| 3253 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 3254 | + | <doc xml:space="preserve" | |
| 3255 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3256 | + | line="2642">a `GdkPixbuf`.</doc> | |
| 3257 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 3258 | + | </instance-parameter> | |
| 3259 | + | <parameter name="save_func" | |
| 3260 | + | transfer-ownership="none" | |
| 3261 | + | scope="call" | |
| 3262 | + | closure="1"> | |
| 3263 | + | <doc xml:space="preserve" | |
| 3264 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3265 | + | line="2643">a function that is called to save each block of data that | |
| 3266 | + | the save routine generates.</doc> | |
| 3267 | + | <type name="PixbufSaveFunc" c:type="GdkPixbufSaveFunc"/> | |
| 3268 | + | </parameter> | |
| 3269 | + | <parameter name="user_data" | |
| 3270 | + | transfer-ownership="none" | |
| 3271 | + | nullable="1" | |
| 3272 | + | allow-none="1"> | |
| 3273 | + | <doc xml:space="preserve" | |
| 3274 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3275 | + | line="2645">user data to pass to the save function.</doc> | |
| 3276 | + | <type name="gpointer" c:type="gpointer"/> | |
| 3277 | + | </parameter> | |
| 3278 | + | <parameter name="type" transfer-ownership="none"> | |
| 3279 | + | <doc xml:space="preserve" | |
| 3280 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3281 | + | line="2646">name of file format.</doc> | |
| 3282 | + | <type name="utf8" c:type="const char*"/> | |
| 3283 | + | </parameter> | |
| 3284 | + | <parameter name="error" | |
| 3285 | + | transfer-ownership="none" | |
| 3286 | + | nullable="1" | |
| 3287 | + | allow-none="1"> | |
| 3288 | + | <doc xml:space="preserve" | |
| 3289 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3290 | + | line="2647">return location for error, or `NULL`</doc> | |
| 3291 | + | <type name="GLib.Error" c:type="GError**"/> | |
| 3292 | + | </parameter> | |
| 3293 | + | <parameter name="..." transfer-ownership="none"> | |
| 3294 | + | <doc xml:space="preserve" | |
| 3295 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3296 | + | line="2648">list of key-value save options</doc> | |
| 3297 | + | <varargs/> | |
| 3298 | + | </parameter> | |
| 3299 | + | </parameters> | |
| 3300 | + | </method> | |
| 3301 | + | <method name="save_to_callbackv" | |
| 3302 | + | c:identifier="gdk_pixbuf_save_to_callbackv" | |
| 3303 | + | version="2.4" | |
| 3304 | + | throws="1"> | |
| 3305 | + | <doc xml:space="preserve" | |
| 3306 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3307 | + | line="2697">Vector version of `gdk_pixbuf_save_to_callback()`. | |
| 3308 | + | ||
| 3309 | + | Saves pixbuf to a callback in format @type, which is currently "jpeg", | |
| 3310 | + | "png", "tiff", "ico" or "bmp". | |
| 3311 | + | ||
| 3312 | + | If @error is set, `FALSE` will be returned. | |
| 3313 | + | ||
| 3314 | + | See [method@GdkPixbuf.Pixbuf.save_to_callback] for more details.</doc> | |
| 3315 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 3316 | + | line="381"/> | |
| 3317 | + | <return-value transfer-ownership="none"> | |
| 3318 | + | <doc xml:space="preserve" | |
| 3319 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3320 | + | line="2717">whether an error was set</doc> | |
| 3321 | + | <type name="gboolean" c:type="gboolean"/> | |
| 3322 | + | </return-value> | |
| 3323 | + | <parameters> | |
| 3324 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 3325 | + | <doc xml:space="preserve" | |
| 3326 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3327 | + | line="2699">a `GdkPixbuf`.</doc> | |
| 3328 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 3329 | + | </instance-parameter> | |
| 3330 | + | <parameter name="save_func" | |
| 3331 | + | transfer-ownership="none" | |
| 3332 | + | scope="call" | |
| 3333 | + | closure="1"> | |
| 3334 | + | <doc xml:space="preserve" | |
| 3335 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3336 | + | line="2700">a function that is called to save each block of data that | |
| 3337 | + | the save routine generates.</doc> | |
| 3338 | + | <type name="PixbufSaveFunc" c:type="GdkPixbufSaveFunc"/> | |
| 3339 | + | </parameter> | |
| 3340 | + | <parameter name="user_data" | |
| 3341 | + | transfer-ownership="none" | |
| 3342 | + | nullable="1" | |
| 3343 | + | allow-none="1"> | |
| 3344 | + | <doc xml:space="preserve" | |
| 3345 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3346 | + | line="2702">user data to pass to the save function.</doc> | |
| 3347 | + | <type name="gpointer" c:type="gpointer"/> | |
| 3348 | + | </parameter> | |
| 3349 | + | <parameter name="type" transfer-ownership="none"> | |
| 3350 | + | <doc xml:space="preserve" | |
| 3351 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3352 | + | line="2703">name of file format.</doc> | |
| 3353 | + | <type name="utf8" c:type="const char*"/> | |
| 3354 | + | </parameter> | |
| 3355 | + | <parameter name="option_keys" | |
| 3356 | + | transfer-ownership="none" | |
| 3357 | + | nullable="1" | |
| 3358 | + | allow-none="1"> | |
| 3359 | + | <doc xml:space="preserve" | |
| 3360 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3361 | + | line="2704">name of options to set</doc> | |
| 3362 | + | <array c:type="char**"> | |
| 3363 | + | <type name="utf8"/> | |
| 3364 | + | </array> | |
| 3365 | + | </parameter> | |
| 3366 | + | <parameter name="option_values" | |
| 3367 | + | transfer-ownership="none" | |
| 3368 | + | nullable="1" | |
| 3369 | + | allow-none="1"> | |
| 3370 | + | <doc xml:space="preserve" | |
| 3371 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3372 | + | line="2705">values for named options</doc> | |
| 3373 | + | <array c:type="char**"> | |
| 3374 | + | <type name="utf8"/> | |
| 3375 | + | </array> | |
| 3376 | + | </parameter> | |
| 3377 | + | </parameters> | |
| 3378 | + | </method> | |
| 3379 | + | <method name="save_to_stream" | |
| 3380 | + | c:identifier="gdk_pixbuf_save_to_stream" | |
| 3381 | + | version="2.14" | |
| 3382 | + | introspectable="0"> | |
| 3383 | + | <doc xml:space="preserve" | |
| 3384 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3385 | + | line="2990">Saves `pixbuf` to an output stream. | |
| 3386 | + | ||
| 3387 | + | Supported file formats are currently "jpeg", "tiff", "png", "ico" or | |
| 3388 | + | "bmp". See `gdk_pixbuf_save_to_buffer()` for more details. | |
| 3389 | + | ||
| 3390 | + | The `cancellable` can be used to abort the operation from another | |
| 3391 | + | thread. If the operation was cancelled, the error `G_IO_ERROR_CANCELLED` | |
| 3392 | + | will be returned. Other possible errors are in the `GDK_PIXBUF_ERROR` | |
| 3393 | + | and `G_IO_ERROR` domains. | |
| 3394 | + | ||
| 3395 | + | The stream is not closed at the end of this call.</doc> | |
| 3396 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 3397 | + | line="441"/> | |
| 3398 | + | <return-value transfer-ownership="none"> | |
| 3399 | + | <doc xml:space="preserve" | |
| 3400 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3401 | + | line="3011">`TRUE` if the pixbuf was saved successfully, `FALSE` if an | |
| 3402 | + | error was set.</doc> | |
| 3403 | + | <type name="gboolean" c:type="gboolean"/> | |
| 3404 | + | </return-value> | |
| 3405 | + | <parameters> | |
| 3406 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 3407 | + | <doc xml:space="preserve" | |
| 3408 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3409 | + | line="2992">a `GdkPixbuf`</doc> | |
| 3410 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 3411 | + | </instance-parameter> | |
| 3412 | + | <parameter name="stream" transfer-ownership="none"> | |
| 3413 | + | <doc xml:space="preserve" | |
| 3414 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3415 | + | line="2993">a `GOutputStream` to save the pixbuf to</doc> | |
| 3416 | + | <type name="Gio.OutputStream" c:type="GOutputStream*"/> | |
| 3417 | + | </parameter> | |
| 3418 | + | <parameter name="type" transfer-ownership="none"> | |
| 3419 | + | <doc xml:space="preserve" | |
| 3420 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3421 | + | line="2994">name of file format</doc> | |
| 3422 | + | <type name="utf8" c:type="const char*"/> | |
| 3423 | + | </parameter> | |
| 3424 | + | <parameter name="cancellable" | |
| 3425 | + | transfer-ownership="none" | |
| 3426 | + | nullable="1" | |
| 3427 | + | allow-none="1"> | |
| 3428 | + | <doc xml:space="preserve" | |
| 3429 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3430 | + | line="2995">optional `GCancellable` object, `NULL` to ignore</doc> | |
| 3431 | + | <type name="Gio.Cancellable" c:type="GCancellable*"/> | |
| 3432 | + | </parameter> | |
| 3433 | + | <parameter name="error" | |
| 3434 | + | transfer-ownership="none" | |
| 3435 | + | nullable="1" | |
| 3436 | + | allow-none="1"> | |
| 3437 | + | <doc xml:space="preserve" | |
| 3438 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3439 | + | line="2996">return location for error, or `NULL`</doc> | |
| 3440 | + | <type name="GLib.Error" c:type="GError**"/> | |
| 3441 | + | </parameter> | |
| 3442 | + | <parameter name="..." transfer-ownership="none"> | |
| 3443 | + | <doc xml:space="preserve" | |
| 3444 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3445 | + | line="2997">list of key-value save options</doc> | |
| 3446 | + | <varargs/> | |
| 3447 | + | </parameter> | |
| 3448 | + | </parameters> | |
| 3449 | + | </method> | |
| 3450 | + | <method name="save_to_stream_async" | |
| 3451 | + | c:identifier="gdk_pixbuf_save_to_stream_async" | |
| 3452 | + | version="2.24" | |
| 3453 | + | introspectable="0"> | |
| 3454 | + | <doc xml:space="preserve" | |
| 3455 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3456 | + | line="3144">Saves `pixbuf` to an output stream asynchronously. | |
| 3457 | + | ||
| 3458 | + | For more details see gdk_pixbuf_save_to_stream(), which is the synchronous | |
| 3459 | + | version of this function. | |
| 3460 | + | ||
| 3461 | + | When the operation is finished, `callback` will be called in the main thread. | |
| 3462 | + | ||
| 3463 | + | You can then call gdk_pixbuf_save_to_stream_finish() to get the result of | |
| 3464 | + | the operation.</doc> | |
| 3465 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 3466 | + | line="449"/> | |
| 3467 | + | <return-value transfer-ownership="none"> | |
| 3468 | + | <type name="none" c:type="void"/> | |
| 3469 | + | </return-value> | |
| 3470 | + | <parameters> | |
| 3471 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 3472 | + | <doc xml:space="preserve" | |
| 3473 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3474 | + | line="3146">a `GdkPixbuf`</doc> | |
| 3475 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 3476 | + | </instance-parameter> | |
| 3477 | + | <parameter name="stream" transfer-ownership="none"> | |
| 3478 | + | <doc xml:space="preserve" | |
| 3479 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3480 | + | line="3147">a `GOutputStream` to which to save the pixbuf</doc> | |
| 3481 | + | <type name="Gio.OutputStream" c:type="GOutputStream*"/> | |
| 3482 | + | </parameter> | |
| 3483 | + | <parameter name="type" transfer-ownership="none"> | |
| 3484 | + | <doc xml:space="preserve" | |
| 3485 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3486 | + | line="3148">name of file format</doc> | |
| 3487 | + | <type name="utf8" c:type="const gchar*"/> | |
| 3488 | + | </parameter> | |
| 3489 | + | <parameter name="cancellable" | |
| 3490 | + | transfer-ownership="none" | |
| 3491 | + | nullable="1" | |
| 3492 | + | allow-none="1"> | |
| 3493 | + | <doc xml:space="preserve" | |
| 3494 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3495 | + | line="3149">optional `GCancellable` object, `NULL` to ignore</doc> | |
| 3496 | + | <type name="Gio.Cancellable" c:type="GCancellable*"/> | |
| 3497 | + | </parameter> | |
| 3498 | + | <parameter name="callback" | |
| 3499 | + | transfer-ownership="none" | |
| 3500 | + | nullable="1" | |
| 3501 | + | allow-none="1" | |
| 3502 | + | scope="async" | |
| 3503 | + | closure="4"> | |
| 3504 | + | <doc xml:space="preserve" | |
| 3505 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3506 | + | line="3150">a `GAsyncReadyCallback` to call when the pixbuf is saved</doc> | |
| 3507 | + | <type name="Gio.AsyncReadyCallback" c:type="GAsyncReadyCallback"/> | |
| 3508 | + | </parameter> | |
| 3509 | + | <parameter name="user_data" | |
| 3510 | + | transfer-ownership="none" | |
| 3511 | + | nullable="1" | |
| 3512 | + | allow-none="1"> | |
| 3513 | + | <doc xml:space="preserve" | |
| 3514 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3515 | + | line="3151">the data to pass to the callback function</doc> | |
| 3516 | + | <type name="gpointer" c:type="gpointer"/> | |
| 3517 | + | </parameter> | |
| 3518 | + | <parameter name="..." transfer-ownership="none"> | |
| 3519 | + | <doc xml:space="preserve" | |
| 3520 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3521 | + | line="3152">list of key-value save options</doc> | |
| 3522 | + | <varargs/> | |
| 3523 | + | </parameter> | |
| 3524 | + | </parameters> | |
| 3525 | + | </method> | |
| 3526 | + | <method name="save_to_streamv" | |
| 3527 | + | c:identifier="gdk_pixbuf_save_to_streamv" | |
| 3528 | + | version="2.36" | |
| 3529 | + | throws="1"> | |
| 3530 | + | <doc xml:space="preserve" | |
| 3531 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3532 | + | line="2948">Saves `pixbuf` to an output stream. | |
| 3533 | + | ||
| 3534 | + | Supported file formats are currently "jpeg", "tiff", "png", "ico" or | |
| 3535 | + | "bmp". | |
| 3536 | + | ||
| 3537 | + | See [method@GdkPixbuf.Pixbuf.save_to_stream] for more details.</doc> | |
| 3538 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 3539 | + | line="472"/> | |
| 3540 | + | <return-value transfer-ownership="none"> | |
| 3541 | + | <doc xml:space="preserve" | |
| 3542 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3543 | + | line="2965">`TRUE` if the pixbuf was saved successfully, `FALSE` if an | |
| 3544 | + | error was set.</doc> | |
| 3545 | + | <type name="gboolean" c:type="gboolean"/> | |
| 3546 | + | </return-value> | |
| 3547 | + | <parameters> | |
| 3548 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 3549 | + | <doc xml:space="preserve" | |
| 3550 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3551 | + | line="2950">a `GdkPixbuf`</doc> | |
| 3552 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 3553 | + | </instance-parameter> | |
| 3554 | + | <parameter name="stream" transfer-ownership="none"> | |
| 3555 | + | <doc xml:space="preserve" | |
| 3556 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3557 | + | line="2951">a `GOutputStream` to save the pixbuf to</doc> | |
| 3558 | + | <type name="Gio.OutputStream" c:type="GOutputStream*"/> | |
| 3559 | + | </parameter> | |
| 3560 | + | <parameter name="type" transfer-ownership="none"> | |
| 3561 | + | <doc xml:space="preserve" | |
| 3562 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3563 | + | line="2952">name of file format</doc> | |
| 3564 | + | <type name="utf8" c:type="const char*"/> | |
| 3565 | + | </parameter> | |
| 3566 | + | <parameter name="option_keys" | |
| 3567 | + | transfer-ownership="none" | |
| 3568 | + | nullable="1" | |
| 3569 | + | allow-none="1"> | |
| 3570 | + | <doc xml:space="preserve" | |
| 3571 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3572 | + | line="2953">name of options to set</doc> | |
| 3573 | + | <array c:type="char**"> | |
| 3574 | + | <type name="utf8"/> | |
| 3575 | + | </array> | |
| 3576 | + | </parameter> | |
| 3577 | + | <parameter name="option_values" | |
| 3578 | + | transfer-ownership="none" | |
| 3579 | + | nullable="1" | |
| 3580 | + | allow-none="1"> | |
| 3581 | + | <doc xml:space="preserve" | |
| 3582 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3583 | + | line="2954">values for named options</doc> | |
| 3584 | + | <array c:type="char**"> | |
| 3585 | + | <type name="utf8"/> | |
| 3586 | + | </array> | |
| 3587 | + | </parameter> | |
| 3588 | + | <parameter name="cancellable" | |
| 3589 | + | transfer-ownership="none" | |
| 3590 | + | nullable="1" | |
| 3591 | + | allow-none="1"> | |
| 3592 | + | <doc xml:space="preserve" | |
| 3593 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3594 | + | line="2955">optional `GCancellable` object, `NULL` to ignore</doc> | |
| 3595 | + | <type name="Gio.Cancellable" c:type="GCancellable*"/> | |
| 3596 | + | </parameter> | |
| 3597 | + | </parameters> | |
| 3598 | + | </method> | |
| 3599 | + | <method name="save_to_streamv_async" | |
| 3600 | + | c:identifier="gdk_pixbuf_save_to_streamv_async" | |
| 3601 | + | version="2.36"> | |
| 3602 | + | <doc xml:space="preserve" | |
| 3603 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3604 | + | line="3086">Saves `pixbuf` to an output stream asynchronously. | |
| 3605 | + | ||
| 3606 | + | For more details see gdk_pixbuf_save_to_streamv(), which is the synchronous | |
| 3607 | + | version of this function. | |
| 3608 | + | ||
| 3609 | + | When the operation is finished, `callback` will be called in the main thread. | |
| 3610 | + | ||
| 3611 | + | You can then call gdk_pixbuf_save_to_stream_finish() to get the result of | |
| 3612 | + | the operation.</doc> | |
| 3613 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 3614 | + | line="462"/> | |
| 3615 | + | <return-value transfer-ownership="none"> | |
| 3616 | + | <type name="none" c:type="void"/> | |
| 3617 | + | </return-value> | |
| 3618 | + | <parameters> | |
| 3619 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 3620 | + | <doc xml:space="preserve" | |
| 3621 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3622 | + | line="3088">a `GdkPixbuf`</doc> | |
| 3623 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 3624 | + | </instance-parameter> | |
| 3625 | + | <parameter name="stream" transfer-ownership="none"> | |
| 3626 | + | <doc xml:space="preserve" | |
| 3627 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3628 | + | line="3089">a `GOutputStream` to which to save the pixbuf</doc> | |
| 3629 | + | <type name="Gio.OutputStream" c:type="GOutputStream*"/> | |
| 3630 | + | </parameter> | |
| 3631 | + | <parameter name="type" transfer-ownership="none"> | |
| 3632 | + | <doc xml:space="preserve" | |
| 3633 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3634 | + | line="3090">name of file format</doc> | |
| 3635 | + | <type name="utf8" c:type="const gchar*"/> | |
| 3636 | + | </parameter> | |
| 3637 | + | <parameter name="option_keys" | |
| 3638 | + | transfer-ownership="none" | |
| 3639 | + | nullable="1" | |
| 3640 | + | allow-none="1"> | |
| 3641 | + | <doc xml:space="preserve" | |
| 3642 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3643 | + | line="3091">name of options to set</doc> | |
| 3644 | + | <array c:type="gchar**"> | |
| 3645 | + | <type name="utf8"/> | |
| 3646 | + | </array> | |
| 3647 | + | </parameter> | |
| 3648 | + | <parameter name="option_values" | |
| 3649 | + | transfer-ownership="none" | |
| 3650 | + | nullable="1" | |
| 3651 | + | allow-none="1"> | |
| 3652 | + | <doc xml:space="preserve" | |
| 3653 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3654 | + | line="3092">values for named options</doc> | |
| 3655 | + | <array c:type="gchar**"> | |
| 3656 | + | <type name="utf8"/> | |
| 3657 | + | </array> | |
| 3658 | + | </parameter> | |
| 3659 | + | <parameter name="cancellable" | |
| 3660 | + | transfer-ownership="none" | |
| 3661 | + | nullable="1" | |
| 3662 | + | allow-none="1"> | |
| 3663 | + | <doc xml:space="preserve" | |
| 3664 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3665 | + | line="3093">optional `GCancellable` object, `NULL` to ignore</doc> | |
| 3666 | + | <type name="Gio.Cancellable" c:type="GCancellable*"/> | |
| 3667 | + | </parameter> | |
| 3668 | + | <parameter name="callback" | |
| 3669 | + | transfer-ownership="none" | |
| 3670 | + | nullable="1" | |
| 3671 | + | allow-none="1" | |
| 3672 | + | scope="async" | |
| 3673 | + | closure="6"> | |
| 3674 | + | <doc xml:space="preserve" | |
| 3675 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3676 | + | line="3094">a `GAsyncReadyCallback` to call when the pixbuf is saved</doc> | |
| 3677 | + | <type name="Gio.AsyncReadyCallback" c:type="GAsyncReadyCallback"/> | |
| 3678 | + | </parameter> | |
| 3679 | + | <parameter name="user_data" | |
| 3680 | + | transfer-ownership="none" | |
| 3681 | + | nullable="1" | |
| 3682 | + | allow-none="1"> | |
| 3683 | + | <doc xml:space="preserve" | |
| 3684 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3685 | + | line="3095">the data to pass to the callback function</doc> | |
| 3686 | + | <type name="gpointer" c:type="gpointer"/> | |
| 3687 | + | </parameter> | |
| 3688 | + | </parameters> | |
| 3689 | + | </method> | |
| 3690 | + | <method name="savev" c:identifier="gdk_pixbuf_savev" throws="1"> | |
| 3691 | + | <doc xml:space="preserve" | |
| 3692 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3693 | + | line="2528">Vector version of `gdk_pixbuf_save()`. | |
| 3694 | + | ||
| 3695 | + | Saves pixbuf to a file in `type`, which is currently "jpeg", "png", "tiff", "ico" or "bmp". | |
| 3696 | + | ||
| 3697 | + | If @error is set, `FALSE` will be returned. | |
| 3698 | + | ||
| 3699 | + | See [method@GdkPixbuf.Pixbuf.save] for more details.</doc> | |
| 3700 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 3701 | + | line="326"/> | |
| 3702 | + | <return-value transfer-ownership="none"> | |
| 3703 | + | <doc xml:space="preserve" | |
| 3704 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3705 | + | line="2545">whether an error was set</doc> | |
| 3706 | + | <type name="gboolean" c:type="gboolean"/> | |
| 3707 | + | </return-value> | |
| 3708 | + | <parameters> | |
| 3709 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 3710 | + | <doc xml:space="preserve" | |
| 3711 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3712 | + | line="2530">a `GdkPixbuf`.</doc> | |
| 3713 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 3714 | + | </instance-parameter> | |
| 3715 | + | <parameter name="filename" transfer-ownership="none"> | |
| 3716 | + | <doc xml:space="preserve" | |
| 3717 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3718 | + | line="2531">name of file to save.</doc> | |
| 3719 | + | <type name="filename" c:type="const char*"/> | |
| 3720 | + | </parameter> | |
| 3721 | + | <parameter name="type" transfer-ownership="none"> | |
| 3722 | + | <doc xml:space="preserve" | |
| 3723 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3724 | + | line="2532">name of file format.</doc> | |
| 3725 | + | <type name="utf8" c:type="const char*"/> | |
| 3726 | + | </parameter> | |
| 3727 | + | <parameter name="option_keys" | |
| 3728 | + | transfer-ownership="none" | |
| 3729 | + | nullable="1" | |
| 3730 | + | allow-none="1"> | |
| 3731 | + | <doc xml:space="preserve" | |
| 3732 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3733 | + | line="2533">name of options to set</doc> | |
| 3734 | + | <array c:type="char**"> | |
| 3735 | + | <type name="utf8"/> | |
| 3736 | + | </array> | |
| 3737 | + | </parameter> | |
| 3738 | + | <parameter name="option_values" | |
| 3739 | + | transfer-ownership="none" | |
| 3740 | + | nullable="1" | |
| 3741 | + | allow-none="1"> | |
| 3742 | + | <doc xml:space="preserve" | |
| 3743 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 3744 | + | line="2534">values for named options</doc> | |
| 3745 | + | <array c:type="char**"> | |
| 3746 | + | <type name="utf8"/> | |
| 3747 | + | </array> | |
| 3748 | + | </parameter> | |
| 3749 | + | </parameters> | |
| 3750 | + | </method> | |
| 3751 | + | <method name="scale" c:identifier="gdk_pixbuf_scale"> | |
| 3752 | + | <doc xml:space="preserve" | |
| 3753 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3754 | + | line="28">Creates a transformation of the source image @src by scaling by | |
| 3755 | + | @scale_x and @scale_y then translating by @offset_x and @offset_y, | |
| 3756 | + | then renders the rectangle (@dest_x, @dest_y, @dest_width, | |
| 3757 | + | @dest_height) of the resulting image onto the destination image | |
| 3758 | + | replacing the previous contents. | |
| 3759 | + | ||
| 3760 | + | Try to use gdk_pixbuf_scale_simple() first; this function is | |
| 3761 | + | the industrial-strength power tool you can fall back to, if | |
| 3762 | + | gdk_pixbuf_scale_simple() isn't powerful enough. | |
| 3763 | + | ||
| 3764 | + | If the source rectangle overlaps the destination rectangle on the | |
| 3765 | + | same pixbuf, it will be overwritten during the scaling which | |
| 3766 | + | results in rendering artifacts.</doc> | |
| 3767 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 3768 | + | line="99"/> | |
| 3769 | + | <return-value transfer-ownership="none"> | |
| 3770 | + | <type name="none" c:type="void"/> | |
| 3771 | + | </return-value> | |
| 3772 | + | <parameters> | |
| 3773 | + | <instance-parameter name="src" transfer-ownership="none"> | |
| 3774 | + | <doc xml:space="preserve" | |
| 3775 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3776 | + | line="30">a #GdkPixbuf</doc> | |
| 3777 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 3778 | + | </instance-parameter> | |
| 3779 | + | <parameter name="dest" transfer-ownership="none"> | |
| 3780 | + | <doc xml:space="preserve" | |
| 3781 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3782 | + | line="31">the #GdkPixbuf into which to render the results</doc> | |
| 3783 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 3784 | + | </parameter> | |
| 3785 | + | <parameter name="dest_x" transfer-ownership="none"> | |
| 3786 | + | <doc xml:space="preserve" | |
| 3787 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3788 | + | line="32">the left coordinate for region to render</doc> | |
| 3789 | + | <type name="gint" c:type="int"/> | |
| 3790 | + | </parameter> | |
| 3791 | + | <parameter name="dest_y" transfer-ownership="none"> | |
| 3792 | + | <doc xml:space="preserve" | |
| 3793 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3794 | + | line="33">the top coordinate for region to render</doc> | |
| 3795 | + | <type name="gint" c:type="int"/> | |
| 3796 | + | </parameter> | |
| 3797 | + | <parameter name="dest_width" transfer-ownership="none"> | |
| 3798 | + | <doc xml:space="preserve" | |
| 3799 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3800 | + | line="34">the width of the region to render</doc> | |
| 3801 | + | <type name="gint" c:type="int"/> | |
| 3802 | + | </parameter> | |
| 3803 | + | <parameter name="dest_height" transfer-ownership="none"> | |
| 3804 | + | <doc xml:space="preserve" | |
| 3805 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3806 | + | line="35">the height of the region to render</doc> | |
| 3807 | + | <type name="gint" c:type="int"/> | |
| 3808 | + | </parameter> | |
| 3809 | + | <parameter name="offset_x" transfer-ownership="none"> | |
| 3810 | + | <doc xml:space="preserve" | |
| 3811 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3812 | + | line="36">the offset in the X direction (currently rounded to an integer)</doc> | |
| 3813 | + | <type name="gdouble" c:type="double"/> | |
| 3814 | + | </parameter> | |
| 3815 | + | <parameter name="offset_y" transfer-ownership="none"> | |
| 3816 | + | <doc xml:space="preserve" | |
| 3817 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3818 | + | line="37">the offset in the Y direction (currently rounded to an integer)</doc> | |
| 3819 | + | <type name="gdouble" c:type="double"/> | |
| 3820 | + | </parameter> | |
| 3821 | + | <parameter name="scale_x" transfer-ownership="none"> | |
| 3822 | + | <doc xml:space="preserve" | |
| 3823 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3824 | + | line="38">the scale factor in the X direction</doc> | |
| 3825 | + | <type name="gdouble" c:type="double"/> | |
| 3826 | + | </parameter> | |
| 3827 | + | <parameter name="scale_y" transfer-ownership="none"> | |
| 3828 | + | <doc xml:space="preserve" | |
| 3829 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3830 | + | line="39">the scale factor in the Y direction</doc> | |
| 3831 | + | <type name="gdouble" c:type="double"/> | |
| 3832 | + | </parameter> | |
| 3833 | + | <parameter name="interp_type" transfer-ownership="none"> | |
| 3834 | + | <doc xml:space="preserve" | |
| 3835 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3836 | + | line="40">the interpolation type for the transformation.</doc> | |
| 3837 | + | <type name="InterpType" c:type="GdkInterpType"/> | |
| 3838 | + | </parameter> | |
| 3839 | + | </parameters> | |
| 3840 | + | </method> | |
| 3841 | + | <method name="scale_simple" c:identifier="gdk_pixbuf_scale_simple"> | |
| 3842 | + | <doc xml:space="preserve" | |
| 3843 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3844 | + | line="236">Create a new pixbuf containing a copy of `src` scaled to | |
| 3845 | + | `dest_width` x `dest_height`. | |
| 3846 | + | ||
| 3847 | + | This function leaves `src` unaffected. | |
| 3848 | + | ||
| 3849 | + | The `interp_type` should be `GDK_INTERP_NEAREST` if you want maximum | |
| 3850 | + | speed (but when scaling down `GDK_INTERP_NEAREST` is usually unusably | |
| 3851 | + | ugly). The default `interp_type` should be `GDK_INTERP_BILINEAR` which | |
| 3852 | + | offers reasonable quality and speed. | |
| 3853 | + | ||
| 3854 | + | You can scale a sub-portion of `src` by creating a sub-pixbuf | |
| 3855 | + | pointing into `src`; see [method@GdkPixbuf.Pixbuf.new_subpixbuf]. | |
| 3856 | + | ||
| 3857 | + | If `dest_width` and `dest_height` are equal to the width and height of | |
| 3858 | + | `src`, this function will return an unscaled copy of `src`. | |
| 3859 | + | ||
| 3860 | + | For more complicated scaling/alpha blending see [method@GdkPixbuf.Pixbuf.scale] | |
| 3861 | + | and [method@GdkPixbuf.Pixbuf.composite].</doc> | |
| 3862 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 3863 | + | line="143"/> | |
| 3864 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 3865 | + | <doc xml:space="preserve" | |
| 3866 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3867 | + | line="262">the new pixbuf</doc> | |
| 3868 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 3869 | + | </return-value> | |
| 3870 | + | <parameters> | |
| 3871 | + | <instance-parameter name="src" transfer-ownership="none"> | |
| 3872 | + | <doc xml:space="preserve" | |
| 3873 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3874 | + | line="238">a #GdkPixbuf</doc> | |
| 3875 | + | <type name="Pixbuf" c:type="const GdkPixbuf*"/> | |
| 3876 | + | </instance-parameter> | |
| 3877 | + | <parameter name="dest_width" transfer-ownership="none"> | |
| 3878 | + | <doc xml:space="preserve" | |
| 3879 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3880 | + | line="239">the width of destination image</doc> | |
| 3881 | + | <type name="gint" c:type="int"/> | |
| 3882 | + | </parameter> | |
| 3883 | + | <parameter name="dest_height" transfer-ownership="none"> | |
| 3884 | + | <doc xml:space="preserve" | |
| 3885 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3886 | + | line="240">the height of destination image</doc> | |
| 3887 | + | <type name="gint" c:type="int"/> | |
| 3888 | + | </parameter> | |
| 3889 | + | <parameter name="interp_type" transfer-ownership="none"> | |
| 3890 | + | <doc xml:space="preserve" | |
| 3891 | + | filename="../gdk-pixbuf/gdk-pixbuf-scale.c" | |
| 3892 | + | line="241">the interpolation type for the transformation.</doc> | |
| 3893 | + | <type name="InterpType" c:type="GdkInterpType"/> | |
| 3894 | + | </parameter> | |
| 3895 | + | </parameters> | |
| 3896 | + | </method> | |
| 3897 | + | <method name="set_option" | |
| 3898 | + | c:identifier="gdk_pixbuf_set_option" | |
| 3899 | + | version="2.2"> | |
| 3900 | + | <doc xml:space="preserve" | |
| 3901 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 3902 | + | line="1257">Attaches a key/value pair as an option to a `GdkPixbuf`. | |
| 3903 | + | ||
| 3904 | + | If `key` already exists in the list of options attached to the `pixbuf`, | |
| 3905 | + | the new value is ignored and `FALSE` is returned.</doc> | |
| 3906 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 3907 | + | line="506"/> | |
| 3908 | + | <return-value transfer-ownership="none"> | |
| 3909 | + | <doc xml:space="preserve" | |
| 3910 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 3911 | + | line="1268">`TRUE` on success</doc> | |
| 3912 | + | <type name="gboolean" c:type="gboolean"/> | |
| 3913 | + | </return-value> | |
| 3914 | + | <parameters> | |
| 3915 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 3916 | + | <doc xml:space="preserve" | |
| 3917 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 3918 | + | line="1259">a `GdkPixbuf`</doc> | |
| 3919 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 3920 | + | </instance-parameter> | |
| 3921 | + | <parameter name="key" transfer-ownership="none"> | |
| 3922 | + | <doc xml:space="preserve" | |
| 3923 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 3924 | + | line="1260">a nul-terminated string.</doc> | |
| 3925 | + | <type name="utf8" c:type="const gchar*"/> | |
| 3926 | + | </parameter> | |
| 3927 | + | <parameter name="value" transfer-ownership="none"> | |
| 3928 | + | <doc xml:space="preserve" | |
| 3929 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 3930 | + | line="1261">a nul-terminated string.</doc> | |
| 3931 | + | <type name="utf8" c:type="const gchar*"/> | |
| 3932 | + | </parameter> | |
| 3933 | + | </parameters> | |
| 3934 | + | </method> | |
| 3935 | + | <method name="unref" | |
| 3936 | + | c:identifier="gdk_pixbuf_unref" | |
| 3937 | + | introspectable="0" | |
| 3938 | + | deprecated="1" | |
| 3939 | + | deprecated-version="2.0"> | |
| 3940 | + | <doc xml:space="preserve" | |
| 3941 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 3942 | + | line="430">Removes a reference from a pixbuf.</doc> | |
| 3943 | + | <doc-deprecated xml:space="preserve">Use g_object_unref().</doc-deprecated> | |
| 3944 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 3945 | + | line="168"/> | |
| 3946 | + | <return-value transfer-ownership="none"> | |
| 3947 | + | <type name="none" c:type="void"/> | |
| 3948 | + | </return-value> | |
| 3949 | + | <parameters> | |
| 3950 | + | <instance-parameter name="pixbuf" transfer-ownership="none"> | |
| 3951 | + | <doc xml:space="preserve" | |
| 3952 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 3953 | + | line="432">A pixbuf.</doc> | |
| 3954 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 3955 | + | </instance-parameter> | |
| 3956 | + | </parameters> | |
| 3957 | + | </method> | |
| 3958 | + | <property name="bits-per-sample" | |
| 3959 | + | writable="1" | |
| 3960 | + | construct-only="1" | |
| 3961 | + | transfer-ownership="none" | |
| 3962 | + | getter="get_bits_per_sample"> | |
| 3963 | + | <doc xml:space="preserve" | |
| 3964 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 3965 | + | line="281">The number of bits per sample. | |
| 3966 | + | ||
| 3967 | + | Currently only 8 bit per sample are supported.</doc> | |
| 3968 | + | <type name="gint" c:type="gint"/> | |
| 3969 | + | </property> | |
| 3970 | + | <property name="colorspace" | |
| 3971 | + | writable="1" | |
| 3972 | + | construct-only="1" | |
| 3973 | + | transfer-ownership="none" | |
| 3974 | + | getter="get_colorspace"> | |
| 3975 | + | <doc xml:space="preserve" | |
| 3976 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 3977 | + | line="254">The color space of the pixbuf. | |
| 3978 | + | ||
| 3979 | + | Currently, only `GDK_COLORSPACE_RGB` is supported.</doc> | |
| 3980 | + | <type name="Colorspace"/> | |
| 3981 | + | </property> | |
| 3982 | + | <property name="has-alpha" | |
| 3983 | + | writable="1" | |
| 3984 | + | construct-only="1" | |
| 3985 | + | transfer-ownership="none" | |
| 3986 | + | getter="get_has_alpha"> | |
| 3987 | + | <doc xml:space="preserve" | |
| 3988 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 3989 | + | line="269">Whether the pixbuf has an alpha channel.</doc> | |
| 3990 | + | <type name="gboolean" c:type="gboolean"/> | |
| 3991 | + | </property> | |
| 3992 | + | <property name="height" | |
| 3993 | + | writable="1" | |
| 3994 | + | construct-only="1" | |
| 3995 | + | transfer-ownership="none" | |
| 3996 | + | getter="get_height"> | |
| 3997 | + | <doc xml:space="preserve" | |
| 3998 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 3999 | + | line="311">The number of rows of the pixbuf.</doc> | |
| 4000 | + | <type name="gint" c:type="gint"/> | |
| 4001 | + | </property> | |
| 4002 | + | <property name="n-channels" | |
| 4003 | + | writable="1" | |
| 4004 | + | construct-only="1" | |
| 4005 | + | transfer-ownership="none" | |
| 4006 | + | getter="get_n_channels"> | |
| 4007 | + | <doc xml:space="preserve" | |
| 4008 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 4009 | + | line="238">The number of samples per pixel. | |
| 4010 | + | ||
| 4011 | + | Currently, only 3 or 4 samples per pixel are supported.</doc> | |
| 4012 | + | <type name="gint" c:type="gint"/> | |
| 4013 | + | </property> | |
| 4014 | + | <property name="pixel-bytes" | |
| 4015 | + | writable="1" | |
| 4016 | + | construct-only="1" | |
| 4017 | + | transfer-ownership="none"> | |
| 4018 | + | <type name="GLib.Bytes"/> | |
| 4019 | + | </property> | |
| 4020 | + | <property name="pixels" | |
| 4021 | + | writable="1" | |
| 4022 | + | construct-only="1" | |
| 4023 | + | transfer-ownership="none" | |
| 4024 | + | getter="get_pixels"> | |
| 4025 | + | <doc xml:space="preserve" | |
| 4026 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 4027 | + | line="343">A pointer to the pixel data of the pixbuf.</doc> | |
| 4028 | + | <type name="gpointer" c:type="gpointer"/> | |
| 4029 | + | </property> | |
| 4030 | + | <property name="rowstride" | |
| 4031 | + | writable="1" | |
| 4032 | + | construct-only="1" | |
| 4033 | + | transfer-ownership="none" | |
| 4034 | + | getter="get_rowstride"> | |
| 4035 | + | <doc xml:space="preserve" | |
| 4036 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 4037 | + | line="325">The number of bytes between the start of a row and | |
| 4038 | + | the start of the next row. | |
| 4039 | + | ||
| 4040 | + | This number must (obviously) be at least as large as the | |
| 4041 | + | width of the pixbuf.</doc> | |
| 4042 | + | <type name="gint" c:type="gint"/> | |
| 4043 | + | </property> | |
| 4044 | + | <property name="width" | |
| 4045 | + | writable="1" | |
| 4046 | + | construct-only="1" | |
| 4047 | + | transfer-ownership="none" | |
| 4048 | + | getter="get_width"> | |
| 4049 | + | <doc xml:space="preserve" | |
| 4050 | + | filename="../gdk-pixbuf/gdk-pixbuf.c" | |
| 4051 | + | line="297">The number of columns of the pixbuf.</doc> | |
| 4052 | + | <type name="gint" c:type="gint"/> | |
| 4053 | + | </property> | |
| 4054 | + | </class> | |
| 4055 | + | <enumeration name="PixbufAlphaMode" | |
| 4056 | + | deprecated="1" | |
| 4057 | + | deprecated-version="2.42" | |
| 4058 | + | glib:type-name="GdkPixbufAlphaMode" | |
| 4059 | + | glib:get-type="gdk_pixbuf_alpha_mode_get_type" | |
| 4060 | + | c:type="GdkPixbufAlphaMode"> | |
| 4061 | + | <doc xml:space="preserve" | |
| 4062 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 4063 | + | line="39">Control the alpha channel for drawables. | |
| 4064 | + | ||
| 4065 | + | These values can be passed to gdk_pixbuf_xlib_render_to_drawable_alpha() | |
| 4066 | + | in gdk-pixbuf-xlib to control how the alpha channel of an image should | |
| 4067 | + | be handled. | |
| 4068 | + | ||
| 4069 | + | This function can create a bilevel clipping mask (black and white) and use | |
| 4070 | + | it while painting the image. | |
| 4071 | + | ||
| 4072 | + | In the future, when the X Window System gets an alpha channel extension, | |
| 4073 | + | it will be possible to do full alpha compositing onto arbitrary drawables. | |
| 4074 | + | For now both cases fall back to a bilevel clipping mask.</doc> | |
| 4075 | + | <doc-deprecated xml:space="preserve">There is no user of GdkPixbufAlphaMode in GdkPixbuf, | |
| 4076 | + | and the Xlib utility functions have been split out to their own | |
| 4077 | + | library, gdk-pixbuf-xlib</doc-deprecated> | |
| 4078 | + | <member name="bilevel" | |
| 4079 | + | value="0" | |
| 4080 | + | c:identifier="GDK_PIXBUF_ALPHA_BILEVEL" | |
| 4081 | + | glib:nick="bilevel" | |
| 4082 | + | glib:name="GDK_PIXBUF_ALPHA_BILEVEL"> | |
| 4083 | + | <doc xml:space="preserve" | |
| 4084 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 4085 | + | line="41">A bilevel clipping mask (black and white) | |
| 4086 | + | will be created and used to draw the image. Pixels below 0.5 opacity | |
| 4087 | + | will be considered fully transparent, and all others will be | |
| 4088 | + | considered fully opaque.</doc> | |
| 4089 | + | </member> | |
| 4090 | + | <member name="full" | |
| 4091 | + | value="1" | |
| 4092 | + | c:identifier="GDK_PIXBUF_ALPHA_FULL" | |
| 4093 | + | glib:nick="full" | |
| 4094 | + | glib:name="GDK_PIXBUF_ALPHA_FULL"> | |
| 4095 | + | <doc xml:space="preserve" | |
| 4096 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 4097 | + | line="45">For now falls back to #GDK_PIXBUF_ALPHA_BILEVEL. | |
| 4098 | + | In the future it will do full alpha compositing.</doc> | |
| 4099 | + | </member> | |
| 4100 | + | </enumeration> | |
| 4101 | + | <class name="PixbufAnimation" | |
| 4102 | + | c:symbol-prefix="pixbuf_animation" | |
| 4103 | + | c:type="GdkPixbufAnimation" | |
| 4104 | + | parent="GObject.Object" | |
| 4105 | + | glib:type-name="GdkPixbufAnimation" | |
| 4106 | + | glib:get-type="gdk_pixbuf_animation_get_type" | |
| 4107 | + | glib:type-struct="PixbufAnimationClass"> | |
| 4108 | + | <doc xml:space="preserve" | |
| 4109 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4110 | + | line="32">An opaque object representing an animation. | |
| 4111 | + | ||
| 4112 | + | The GdkPixBuf library provides a simple mechanism to load and | |
| 4113 | + | represent animations. An animation is conceptually a series of | |
| 4114 | + | frames to be displayed over time. | |
| 4115 | + | ||
| 4116 | + | The animation may not be represented as a series of frames | |
| 4117 | + | internally; for example, it may be stored as a sprite and | |
| 4118 | + | instructions for moving the sprite around a background. | |
| 4119 | + | ||
| 4120 | + | To display an animation you don't need to understand its | |
| 4121 | + | representation, however; you just ask `GdkPixbuf` what should | |
| 4122 | + | be displayed at a given point in time.</doc> | |
| 4123 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4124 | + | line="163"/> | |
| 4125 | + | <constructor name="new_from_file" | |
| 4126 | + | c:identifier="gdk_pixbuf_animation_new_from_file" | |
| 4127 | + | throws="1"> | |
| 4128 | + | <doc xml:space="preserve" | |
| 4129 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4130 | + | line="147">Creates a new animation by loading it from a file. | |
| 4131 | + | ||
| 4132 | + | The file format is detected automatically. | |
| 4133 | + | ||
| 4134 | + | If the file's format does not support multi-frame images, then an animation | |
| 4135 | + | with a single frame will be created. | |
| 4136 | + | ||
| 4137 | + | Possible errors are in the `GDK_PIXBUF_ERROR` and `G_FILE_ERROR` domains.</doc> | |
| 4138 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4139 | + | line="63"/> | |
| 4140 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 4141 | + | <doc xml:space="preserve" | |
| 4142 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4143 | + | line="162">A newly-created animation</doc> | |
| 4144 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4145 | + | </return-value> | |
| 4146 | + | <parameters> | |
| 4147 | + | <parameter name="filename" transfer-ownership="none"> | |
| 4148 | + | <doc xml:space="preserve" | |
| 4149 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4150 | + | line="149">Name of file to load, in the GLib file | |
| 4151 | + | name encoding</doc> | |
| 4152 | + | <type name="filename" c:type="const char*"/> | |
| 4153 | + | </parameter> | |
| 4154 | + | </parameters> | |
| 4155 | + | </constructor> | |
| 4156 | + | <constructor name="new_from_resource" | |
| 4157 | + | c:identifier="gdk_pixbuf_animation_new_from_resource" | |
| 4158 | + | version="2.28" | |
| 4159 | + | throws="1"> | |
| 4160 | + | <doc xml:space="preserve" | |
| 4161 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4162 | + | line="504">Creates a new pixbuf animation by loading an image from an resource. | |
| 4163 | + | ||
| 4164 | + | The file format is detected automatically. If `NULL` is returned, then | |
| 4165 | + | @error will be set.</doc> | |
| 4166 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4167 | + | line="78"/> | |
| 4168 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 4169 | + | <doc xml:space="preserve" | |
| 4170 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4171 | + | line="514">A newly-created animation</doc> | |
| 4172 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4173 | + | </return-value> | |
| 4174 | + | <parameters> | |
| 4175 | + | <parameter name="resource_path" transfer-ownership="none"> | |
| 4176 | + | <doc xml:space="preserve" | |
| 4177 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4178 | + | line="506">the path of the resource file</doc> | |
| 4179 | + | <type name="utf8" c:type="const char*"/> | |
| 4180 | + | </parameter> | |
| 4181 | + | </parameters> | |
| 4182 | + | </constructor> | |
| 4183 | + | <constructor name="new_from_stream" | |
| 4184 | + | c:identifier="gdk_pixbuf_animation_new_from_stream" | |
| 4185 | + | version="2.28" | |
| 4186 | + | throws="1"> | |
| 4187 | + | <doc xml:space="preserve" | |
| 4188 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4189 | + | line="346">Creates a new animation by loading it from an input stream. | |
| 4190 | + | ||
| 4191 | + | The file format is detected automatically. | |
| 4192 | + | ||
| 4193 | + | If `NULL` is returned, then @error will be set. | |
| 4194 | + | ||
| 4195 | + | The @cancellable can be used to abort the operation from another thread. | |
| 4196 | + | If the operation was cancelled, the error `G_IO_ERROR_CANCELLED` will be | |
| 4197 | + | returned. Other possible errors are in the `GDK_PIXBUF_ERROR` and | |
| 4198 | + | `G_IO_ERROR` domains. | |
| 4199 | + | ||
| 4200 | + | The stream is not closed.</doc> | |
| 4201 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4202 | + | line="66"/> | |
| 4203 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 4204 | + | <doc xml:space="preserve" | |
| 4205 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4206 | + | line="365">A newly-created animation</doc> | |
| 4207 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4208 | + | </return-value> | |
| 4209 | + | <parameters> | |
| 4210 | + | <parameter name="stream" transfer-ownership="none"> | |
| 4211 | + | <doc xml:space="preserve" | |
| 4212 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4213 | + | line="348">a `GInputStream` to load the pixbuf from</doc> | |
| 4214 | + | <type name="Gio.InputStream" c:type="GInputStream*"/> | |
| 4215 | + | </parameter> | |
| 4216 | + | <parameter name="cancellable" | |
| 4217 | + | transfer-ownership="none" | |
| 4218 | + | nullable="1" | |
| 4219 | + | allow-none="1"> | |
| 4220 | + | <doc xml:space="preserve" | |
| 4221 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4222 | + | line="349">optional `GCancellable` object</doc> | |
| 4223 | + | <type name="Gio.Cancellable" c:type="GCancellable*"/> | |
| 4224 | + | </parameter> | |
| 4225 | + | </parameters> | |
| 4226 | + | </constructor> | |
| 4227 | + | <constructor name="new_from_stream_finish" | |
| 4228 | + | c:identifier="gdk_pixbuf_animation_new_from_stream_finish" | |
| 4229 | + | version="2.28" | |
| 4230 | + | throws="1"> | |
| 4231 | + | <doc xml:space="preserve" | |
| 4232 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4233 | + | line="479">Finishes an asynchronous pixbuf animation creation operation started with | |
| 4234 | + | [func@GdkPixbuf.PixbufAnimation.new_from_stream_async].</doc> | |
| 4235 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4236 | + | line="75"/> | |
| 4237 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 4238 | + | <doc xml:space="preserve" | |
| 4239 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4240 | + | line="487">the newly created animation</doc> | |
| 4241 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4242 | + | </return-value> | |
| 4243 | + | <parameters> | |
| 4244 | + | <parameter name="async_result" transfer-ownership="none"> | |
| 4245 | + | <doc xml:space="preserve" | |
| 4246 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4247 | + | line="481">a #GAsyncResult</doc> | |
| 4248 | + | <type name="Gio.AsyncResult" c:type="GAsyncResult*"/> | |
| 4249 | + | </parameter> | |
| 4250 | + | </parameters> | |
| 4251 | + | </constructor> | |
| 4252 | + | <function name="new_from_stream_async" | |
| 4253 | + | c:identifier="gdk_pixbuf_animation_new_from_stream_async" | |
| 4254 | + | version="2.28"> | |
| 4255 | + | <doc xml:space="preserve" | |
| 4256 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4257 | + | line="443">Creates a new animation by asynchronously loading an image from an input stream. | |
| 4258 | + | ||
| 4259 | + | For more details see gdk_pixbuf_new_from_stream(), which is the synchronous | |
| 4260 | + | version of this function. | |
| 4261 | + | ||
| 4262 | + | When the operation is finished, `callback` will be called in the main thread. | |
| 4263 | + | You can then call gdk_pixbuf_animation_new_from_stream_finish() to get the | |
| 4264 | + | result of the operation.</doc> | |
| 4265 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4266 | + | line="70"/> | |
| 4267 | + | <return-value transfer-ownership="none"> | |
| 4268 | + | <type name="none" c:type="void"/> | |
| 4269 | + | </return-value> | |
| 4270 | + | <parameters> | |
| 4271 | + | <parameter name="stream" transfer-ownership="none"> | |
| 4272 | + | <doc xml:space="preserve" | |
| 4273 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4274 | + | line="445">a #GInputStream from which to load the animation</doc> | |
| 4275 | + | <type name="Gio.InputStream" c:type="GInputStream*"/> | |
| 4276 | + | </parameter> | |
| 4277 | + | <parameter name="cancellable" | |
| 4278 | + | transfer-ownership="none" | |
| 4279 | + | nullable="1" | |
| 4280 | + | allow-none="1"> | |
| 4281 | + | <doc xml:space="preserve" | |
| 4282 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4283 | + | line="446">optional #GCancellable object</doc> | |
| 4284 | + | <type name="Gio.Cancellable" c:type="GCancellable*"/> | |
| 4285 | + | </parameter> | |
| 4286 | + | <parameter name="callback" | |
| 4287 | + | transfer-ownership="none" | |
| 4288 | + | nullable="1" | |
| 4289 | + | allow-none="1" | |
| 4290 | + | scope="async" | |
| 4291 | + | closure="3"> | |
| 4292 | + | <doc xml:space="preserve" | |
| 4293 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4294 | + | line="447">a `GAsyncReadyCallback` to call when the pixbuf is loaded</doc> | |
| 4295 | + | <type name="Gio.AsyncReadyCallback" c:type="GAsyncReadyCallback"/> | |
| 4296 | + | </parameter> | |
| 4297 | + | <parameter name="user_data" | |
| 4298 | + | transfer-ownership="none" | |
| 4299 | + | nullable="1" | |
| 4300 | + | allow-none="1"> | |
| 4301 | + | <doc xml:space="preserve" | |
| 4302 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4303 | + | line="448">the data to pass to the callback function</doc> | |
| 4304 | + | <type name="gpointer" c:type="gpointer"/> | |
| 4305 | + | </parameter> | |
| 4306 | + | </parameters> | |
| 4307 | + | </function> | |
| 4308 | + | <virtual-method name="get_iter" invoker="get_iter"> | |
| 4309 | + | <doc xml:space="preserve" | |
| 4310 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4311 | + | line="664">Get an iterator for displaying an animation. | |
| 4312 | + | ||
| 4313 | + | The iterator provides the frames that should be displayed at a | |
| 4314 | + | given time. | |
| 4315 | + | ||
| 4316 | + | @start_time would normally come from g_get_current_time(), and marks | |
| 4317 | + | the beginning of animation playback. After creating an iterator, you | |
| 4318 | + | should immediately display the pixbuf returned by | |
| 4319 | + | gdk_pixbuf_animation_iter_get_pixbuf(). Then, you should install | |
| 4320 | + | a timeout (with g_timeout_add()) or by some other mechanism ensure | |
| 4321 | + | that you'll update the image after | |
| 4322 | + | gdk_pixbuf_animation_iter_get_delay_time() milliseconds. Each time | |
| 4323 | + | the image is updated, you should reinstall the timeout with the new, | |
| 4324 | + | possibly-changed delay time. | |
| 4325 | + | ||
| 4326 | + | As a shortcut, if @start_time is `NULL`, the result of | |
| 4327 | + | g_get_current_time() will be used automatically. | |
| 4328 | + | ||
| 4329 | + | To update the image (i.e. possibly change the result of | |
| 4330 | + | gdk_pixbuf_animation_iter_get_pixbuf() to a new frame of the animation), | |
| 4331 | + | call gdk_pixbuf_animation_iter_advance(). | |
| 4332 | + | ||
| 4333 | + | If you're using #GdkPixbufLoader, in addition to updating the image | |
| 4334 | + | after the delay time, you should also update it whenever you | |
| 4335 | + | receive the area_updated signal and | |
| 4336 | + | gdk_pixbuf_animation_iter_on_currently_loading_frame() returns | |
| 4337 | + | `TRUE`. In this case, the frame currently being fed into the loader | |
| 4338 | + | has received new data, so needs to be refreshed. The delay time for | |
| 4339 | + | a frame may also be modified after an area_updated signal, for | |
| 4340 | + | example if the delay time for a frame is encoded in the data after | |
| 4341 | + | the frame itself. So your timeout should be reinstalled after any | |
| 4342 | + | area_updated signal. | |
| 4343 | + | ||
| 4344 | + | A delay time of -1 is possible, indicating "infinite".</doc> | |
| 4345 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4346 | + | line="161"/> | |
| 4347 | + | <return-value transfer-ownership="full"> | |
| 4348 | + | <doc xml:space="preserve" | |
| 4349 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4350 | + | line="704">an iterator to move over the animation</doc> | |
| 4351 | + | <type name="PixbufAnimationIter" c:type="GdkPixbufAnimationIter*"/> | |
| 4352 | + | </return-value> | |
| 4353 | + | <parameters> | |
| 4354 | + | <instance-parameter name="animation" transfer-ownership="none"> | |
| 4355 | + | <doc xml:space="preserve" | |
| 4356 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4357 | + | line="666">a #GdkPixbufAnimation</doc> | |
| 4358 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4359 | + | </instance-parameter> | |
| 4360 | + | <parameter name="start_time" | |
| 4361 | + | transfer-ownership="none" | |
| 4362 | + | nullable="1" | |
| 4363 | + | allow-none="1"> | |
| 4364 | + | <doc xml:space="preserve" | |
| 4365 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4366 | + | line="667">time when the animation starts playing</doc> | |
| 4367 | + | <type name="GLib.TimeVal" c:type="const GTimeVal*"/> | |
| 4368 | + | </parameter> | |
| 4369 | + | </parameters> | |
| 4370 | + | </virtual-method> | |
| 4371 | + | <virtual-method name="get_size"> | |
| 4372 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4373 | + | line="157"/> | |
| 4374 | + | <return-value transfer-ownership="none"> | |
| 4375 | + | <type name="none" c:type="void"/> | |
| 4376 | + | </return-value> | |
| 4377 | + | <parameters> | |
| 4378 | + | <instance-parameter name="animation" transfer-ownership="none"> | |
| 4379 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4380 | + | </instance-parameter> | |
| 4381 | + | <parameter name="width" transfer-ownership="none"> | |
| 4382 | + | <type name="gint" c:type="int*"/> | |
| 4383 | + | </parameter> | |
| 4384 | + | <parameter name="height" transfer-ownership="none"> | |
| 4385 | + | <type name="gint" c:type="int*"/> | |
| 4386 | + | </parameter> | |
| 4387 | + | </parameters> | |
| 4388 | + | </virtual-method> | |
| 4389 | + | <virtual-method name="get_static_image" invoker="get_static_image"> | |
| 4390 | + | <doc xml:space="preserve" | |
| 4391 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4392 | + | line="593">Retrieves a static image for the animation. | |
| 4393 | + | ||
| 4394 | + | If an animation is really just a plain image (has only one frame), | |
| 4395 | + | this function returns that image. | |
| 4396 | + | ||
| 4397 | + | If the animation is an animation, this function returns a reasonable | |
| 4398 | + | image to use as a static unanimated image, which might be the first | |
| 4399 | + | frame, or something more sophisticated depending on the file format. | |
| 4400 | + | ||
| 4401 | + | If an animation hasn't loaded any frames yet, this function will | |
| 4402 | + | return `NULL`.</doc> | |
| 4403 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4404 | + | line="155"/> | |
| 4405 | + | <return-value transfer-ownership="none"> | |
| 4406 | + | <doc xml:space="preserve" | |
| 4407 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4408 | + | line="609">unanimated image representing the animation</doc> | |
| 4409 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 4410 | + | </return-value> | |
| 4411 | + | <parameters> | |
| 4412 | + | <instance-parameter name="animation" transfer-ownership="none"> | |
| 4413 | + | <doc xml:space="preserve" | |
| 4414 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4415 | + | line="595">a #GdkPixbufAnimation</doc> | |
| 4416 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4417 | + | </instance-parameter> | |
| 4418 | + | </parameters> | |
| 4419 | + | </virtual-method> | |
| 4420 | + | <virtual-method name="is_static_image" invoker="is_static_image"> | |
| 4421 | + | <doc xml:space="preserve" | |
| 4422 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4423 | + | line="572">Checks whether the animation is a static image. | |
| 4424 | + | ||
| 4425 | + | If you load a file with gdk_pixbuf_animation_new_from_file() and it | |
| 4426 | + | turns out to be a plain, unanimated image, then this function will | |
| 4427 | + | return `TRUE`. Use gdk_pixbuf_animation_get_static_image() to retrieve | |
| 4428 | + | the image.</doc> | |
| 4429 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4430 | + | line="153"/> | |
| 4431 | + | <return-value transfer-ownership="none"> | |
| 4432 | + | <doc xml:space="preserve" | |
| 4433 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4434 | + | line="583">`TRUE` if the "animation" was really just an image</doc> | |
| 4435 | + | <type name="gboolean" c:type="gboolean"/> | |
| 4436 | + | </return-value> | |
| 4437 | + | <parameters> | |
| 4438 | + | <instance-parameter name="animation" transfer-ownership="none"> | |
| 4439 | + | <doc xml:space="preserve" | |
| 4440 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4441 | + | line="574">a #GdkPixbufAnimation</doc> | |
| 4442 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4443 | + | </instance-parameter> | |
| 4444 | + | </parameters> | |
| 4445 | + | </virtual-method> | |
| 4446 | + | <method name="get_height" c:identifier="gdk_pixbuf_animation_get_height"> | |
| 4447 | + | <doc xml:space="preserve" | |
| 4448 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4449 | + | line="641">Queries the height of the bounding box of a pixbuf animation.</doc> | |
| 4450 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4451 | + | line="92"/> | |
| 4452 | + | <return-value transfer-ownership="none"> | |
| 4453 | + | <doc xml:space="preserve" | |
| 4454 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4455 | + | line="647">Height of the bounding box of the animation.</doc> | |
| 4456 | + | <type name="gint" c:type="int"/> | |
| 4457 | + | </return-value> | |
| 4458 | + | <parameters> | |
| 4459 | + | <instance-parameter name="animation" transfer-ownership="none"> | |
| 4460 | + | <doc xml:space="preserve" | |
| 4461 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4462 | + | line="643">An animation.</doc> | |
| 4463 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4464 | + | </instance-parameter> | |
| 4465 | + | </parameters> | |
| 4466 | + | </method> | |
| 4467 | + | <method name="get_iter" c:identifier="gdk_pixbuf_animation_get_iter"> | |
| 4468 | + | <doc xml:space="preserve" | |
| 4469 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4470 | + | line="664">Get an iterator for displaying an animation. | |
| 4471 | + | ||
| 4472 | + | The iterator provides the frames that should be displayed at a | |
| 4473 | + | given time. | |
| 4474 | + | ||
| 4475 | + | @start_time would normally come from g_get_current_time(), and marks | |
| 4476 | + | the beginning of animation playback. After creating an iterator, you | |
| 4477 | + | should immediately display the pixbuf returned by | |
| 4478 | + | gdk_pixbuf_animation_iter_get_pixbuf(). Then, you should install | |
| 4479 | + | a timeout (with g_timeout_add()) or by some other mechanism ensure | |
| 4480 | + | that you'll update the image after | |
| 4481 | + | gdk_pixbuf_animation_iter_get_delay_time() milliseconds. Each time | |
| 4482 | + | the image is updated, you should reinstall the timeout with the new, | |
| 4483 | + | possibly-changed delay time. | |
| 4484 | + | ||
| 4485 | + | As a shortcut, if @start_time is `NULL`, the result of | |
| 4486 | + | g_get_current_time() will be used automatically. | |
| 4487 | + | ||
| 4488 | + | To update the image (i.e. possibly change the result of | |
| 4489 | + | gdk_pixbuf_animation_iter_get_pixbuf() to a new frame of the animation), | |
| 4490 | + | call gdk_pixbuf_animation_iter_advance(). | |
| 4491 | + | ||
| 4492 | + | If you're using #GdkPixbufLoader, in addition to updating the image | |
| 4493 | + | after the delay time, you should also update it whenever you | |
| 4494 | + | receive the area_updated signal and | |
| 4495 | + | gdk_pixbuf_animation_iter_on_currently_loading_frame() returns | |
| 4496 | + | `TRUE`. In this case, the frame currently being fed into the loader | |
| 4497 | + | has received new data, so needs to be refreshed. The delay time for | |
| 4498 | + | a frame may also be modified after an area_updated signal, for | |
| 4499 | + | example if the delay time for a frame is encoded in the data after | |
| 4500 | + | the frame itself. So your timeout should be reinstalled after any | |
| 4501 | + | area_updated signal. | |
| 4502 | + | ||
| 4503 | + | A delay time of -1 is possible, indicating "infinite".</doc> | |
| 4504 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4505 | + | line="100"/> | |
| 4506 | + | <return-value transfer-ownership="full"> | |
| 4507 | + | <doc xml:space="preserve" | |
| 4508 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4509 | + | line="704">an iterator to move over the animation</doc> | |
| 4510 | + | <type name="PixbufAnimationIter" c:type="GdkPixbufAnimationIter*"/> | |
| 4511 | + | </return-value> | |
| 4512 | + | <parameters> | |
| 4513 | + | <instance-parameter name="animation" transfer-ownership="none"> | |
| 4514 | + | <doc xml:space="preserve" | |
| 4515 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4516 | + | line="666">a #GdkPixbufAnimation</doc> | |
| 4517 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4518 | + | </instance-parameter> | |
| 4519 | + | <parameter name="start_time" | |
| 4520 | + | transfer-ownership="none" | |
| 4521 | + | nullable="1" | |
| 4522 | + | allow-none="1"> | |
| 4523 | + | <doc xml:space="preserve" | |
| 4524 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4525 | + | line="667">time when the animation starts playing</doc> | |
| 4526 | + | <type name="GLib.TimeVal" c:type="const GTimeVal*"/> | |
| 4527 | + | </parameter> | |
| 4528 | + | </parameters> | |
| 4529 | + | </method> | |
| 4530 | + | <method name="get_static_image" | |
| 4531 | + | c:identifier="gdk_pixbuf_animation_get_static_image"> | |
| 4532 | + | <doc xml:space="preserve" | |
| 4533 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4534 | + | line="593">Retrieves a static image for the animation. | |
| 4535 | + | ||
| 4536 | + | If an animation is really just a plain image (has only one frame), | |
| 4537 | + | this function returns that image. | |
| 4538 | + | ||
| 4539 | + | If the animation is an animation, this function returns a reasonable | |
| 4540 | + | image to use as a static unanimated image, which might be the first | |
| 4541 | + | frame, or something more sophisticated depending on the file format. | |
| 4542 | + | ||
| 4543 | + | If an animation hasn't loaded any frames yet, this function will | |
| 4544 | + | return `NULL`.</doc> | |
| 4545 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4546 | + | line="96"/> | |
| 4547 | + | <return-value transfer-ownership="none"> | |
| 4548 | + | <doc xml:space="preserve" | |
| 4549 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4550 | + | line="609">unanimated image representing the animation</doc> | |
| 4551 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 4552 | + | </return-value> | |
| 4553 | + | <parameters> | |
| 4554 | + | <instance-parameter name="animation" transfer-ownership="none"> | |
| 4555 | + | <doc xml:space="preserve" | |
| 4556 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4557 | + | line="595">a #GdkPixbufAnimation</doc> | |
| 4558 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4559 | + | </instance-parameter> | |
| 4560 | + | </parameters> | |
| 4561 | + | </method> | |
| 4562 | + | <method name="get_width" c:identifier="gdk_pixbuf_animation_get_width"> | |
| 4563 | + | <doc xml:space="preserve" | |
| 4564 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4565 | + | line="619">Queries the width of the bounding box of a pixbuf animation.</doc> | |
| 4566 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4567 | + | line="90"/> | |
| 4568 | + | <return-value transfer-ownership="none"> | |
| 4569 | + | <doc xml:space="preserve" | |
| 4570 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4571 | + | line="625">Width of the bounding box of the animation.</doc> | |
| 4572 | + | <type name="gint" c:type="int"/> | |
| 4573 | + | </return-value> | |
| 4574 | + | <parameters> | |
| 4575 | + | <instance-parameter name="animation" transfer-ownership="none"> | |
| 4576 | + | <doc xml:space="preserve" | |
| 4577 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4578 | + | line="621">An animation.</doc> | |
| 4579 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4580 | + | </instance-parameter> | |
| 4581 | + | </parameters> | |
| 4582 | + | </method> | |
| 4583 | + | <method name="is_static_image" | |
| 4584 | + | c:identifier="gdk_pixbuf_animation_is_static_image"> | |
| 4585 | + | <doc xml:space="preserve" | |
| 4586 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4587 | + | line="572">Checks whether the animation is a static image. | |
| 4588 | + | ||
| 4589 | + | If you load a file with gdk_pixbuf_animation_new_from_file() and it | |
| 4590 | + | turns out to be a plain, unanimated image, then this function will | |
| 4591 | + | return `TRUE`. Use gdk_pixbuf_animation_get_static_image() to retrieve | |
| 4592 | + | the image.</doc> | |
| 4593 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4594 | + | line="94"/> | |
| 4595 | + | <return-value transfer-ownership="none"> | |
| 4596 | + | <doc xml:space="preserve" | |
| 4597 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4598 | + | line="583">`TRUE` if the "animation" was really just an image</doc> | |
| 4599 | + | <type name="gboolean" c:type="gboolean"/> | |
| 4600 | + | </return-value> | |
| 4601 | + | <parameters> | |
| 4602 | + | <instance-parameter name="animation" transfer-ownership="none"> | |
| 4603 | + | <doc xml:space="preserve" | |
| 4604 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4605 | + | line="574">a #GdkPixbufAnimation</doc> | |
| 4606 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4607 | + | </instance-parameter> | |
| 4608 | + | </parameters> | |
| 4609 | + | </method> | |
| 4610 | + | <method name="ref" | |
| 4611 | + | c:identifier="gdk_pixbuf_animation_ref" | |
| 4612 | + | introspectable="0" | |
| 4613 | + | deprecated="1" | |
| 4614 | + | deprecated-version="2.0"> | |
| 4615 | + | <doc xml:space="preserve" | |
| 4616 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4617 | + | line="542">Adds a reference to an animation.</doc> | |
| 4618 | + | <doc-deprecated xml:space="preserve">Use g_object_ref().</doc-deprecated> | |
| 4619 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4620 | + | line="84"/> | |
| 4621 | + | <return-value> | |
| 4622 | + | <doc xml:space="preserve" | |
| 4623 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4624 | + | line="548">The same as the @animation argument.</doc> | |
| 4625 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4626 | + | </return-value> | |
| 4627 | + | <parameters> | |
| 4628 | + | <instance-parameter name="animation" transfer-ownership="none"> | |
| 4629 | + | <doc xml:space="preserve" | |
| 4630 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4631 | + | line="544">An animation.</doc> | |
| 4632 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4633 | + | </instance-parameter> | |
| 4634 | + | </parameters> | |
| 4635 | + | </method> | |
| 4636 | + | <method name="unref" | |
| 4637 | + | c:identifier="gdk_pixbuf_animation_unref" | |
| 4638 | + | introspectable="0" | |
| 4639 | + | deprecated="1" | |
| 4640 | + | deprecated-version="2.0"> | |
| 4641 | + | <doc xml:space="preserve" | |
| 4642 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4643 | + | line="558">Removes a reference from an animation.</doc> | |
| 4644 | + | <doc-deprecated xml:space="preserve">Use g_object_unref().</doc-deprecated> | |
| 4645 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4646 | + | line="86"/> | |
| 4647 | + | <return-value transfer-ownership="none"> | |
| 4648 | + | <type name="none" c:type="void"/> | |
| 4649 | + | </return-value> | |
| 4650 | + | <parameters> | |
| 4651 | + | <instance-parameter name="animation" transfer-ownership="none"> | |
| 4652 | + | <doc xml:space="preserve" | |
| 4653 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4654 | + | line="560">An animation.</doc> | |
| 4655 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4656 | + | </instance-parameter> | |
| 4657 | + | </parameters> | |
| 4658 | + | </method> | |
| 4659 | + | <field name="parent_instance"> | |
| 4660 | + | <type name="GObject.Object" c:type="GObject"/> | |
| 4661 | + | </field> | |
| 4662 | + | </class> | |
| 4663 | + | <record name="PixbufAnimationClass" | |
| 4664 | + | c:type="GdkPixbufAnimationClass" | |
| 4665 | + | glib:is-gtype-struct-for="PixbufAnimation"> | |
| 4666 | + | <doc xml:space="preserve" | |
| 4667 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4668 | + | line="123">Modules supporting animations must derive a type from | |
| 4669 | + | #GdkPixbufAnimation, providing suitable implementations of the | |
| 4670 | + | virtual functions.</doc> | |
| 4671 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4672 | + | line="163"/> | |
| 4673 | + | <field name="parent_class"> | |
| 4674 | + | <doc xml:space="preserve" | |
| 4675 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4676 | + | line="125">the parent class</doc> | |
| 4677 | + | <type name="GObject.ObjectClass" c:type="GObjectClass"/> | |
| 4678 | + | </field> | |
| 4679 | + | <field name="is_static_image"> | |
| 4680 | + | <callback name="is_static_image"> | |
| 4681 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4682 | + | line="153"/> | |
| 4683 | + | <return-value transfer-ownership="none"> | |
| 4684 | + | <doc xml:space="preserve" | |
| 4685 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4686 | + | line="583">`TRUE` if the "animation" was really just an image</doc> | |
| 4687 | + | <type name="gboolean" c:type="gboolean"/> | |
| 4688 | + | </return-value> | |
| 4689 | + | <parameters> | |
| 4690 | + | <parameter name="animation" transfer-ownership="none"> | |
| 4691 | + | <doc xml:space="preserve" | |
| 4692 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4693 | + | line="574">a #GdkPixbufAnimation</doc> | |
| 4694 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4695 | + | </parameter> | |
| 4696 | + | </parameters> | |
| 4697 | + | </callback> | |
| 4698 | + | </field> | |
| 4699 | + | <field name="get_static_image"> | |
| 4700 | + | <callback name="get_static_image"> | |
| 4701 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4702 | + | line="155"/> | |
| 4703 | + | <return-value transfer-ownership="none"> | |
| 4704 | + | <doc xml:space="preserve" | |
| 4705 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4706 | + | line="609">unanimated image representing the animation</doc> | |
| 4707 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 4708 | + | </return-value> | |
| 4709 | + | <parameters> | |
| 4710 | + | <parameter name="animation" transfer-ownership="none"> | |
| 4711 | + | <doc xml:space="preserve" | |
| 4712 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4713 | + | line="595">a #GdkPixbufAnimation</doc> | |
| 4714 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4715 | + | </parameter> | |
| 4716 | + | </parameters> | |
| 4717 | + | </callback> | |
| 4718 | + | </field> | |
| 4719 | + | <field name="get_size"> | |
| 4720 | + | <callback name="get_size"> | |
| 4721 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4722 | + | line="157"/> | |
| 4723 | + | <return-value transfer-ownership="none"> | |
| 4724 | + | <type name="none" c:type="void"/> | |
| 4725 | + | </return-value> | |
| 4726 | + | <parameters> | |
| 4727 | + | <parameter name="animation" transfer-ownership="none"> | |
| 4728 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4729 | + | </parameter> | |
| 4730 | + | <parameter name="width" transfer-ownership="none"> | |
| 4731 | + | <type name="gint" c:type="int*"/> | |
| 4732 | + | </parameter> | |
| 4733 | + | <parameter name="height" transfer-ownership="none"> | |
| 4734 | + | <type name="gint" c:type="int*"/> | |
| 4735 | + | </parameter> | |
| 4736 | + | </parameters> | |
| 4737 | + | </callback> | |
| 4738 | + | </field> | |
| 4739 | + | <field name="get_iter"> | |
| 4740 | + | <callback name="get_iter"> | |
| 4741 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4742 | + | line="161"/> | |
| 4743 | + | <return-value transfer-ownership="full"> | |
| 4744 | + | <doc xml:space="preserve" | |
| 4745 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4746 | + | line="704">an iterator to move over the animation</doc> | |
| 4747 | + | <type name="PixbufAnimationIter" c:type="GdkPixbufAnimationIter*"/> | |
| 4748 | + | </return-value> | |
| 4749 | + | <parameters> | |
| 4750 | + | <parameter name="animation" transfer-ownership="none"> | |
| 4751 | + | <doc xml:space="preserve" | |
| 4752 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4753 | + | line="666">a #GdkPixbufAnimation</doc> | |
| 4754 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 4755 | + | </parameter> | |
| 4756 | + | <parameter name="start_time" | |
| 4757 | + | transfer-ownership="none" | |
| 4758 | + | nullable="1" | |
| 4759 | + | allow-none="1"> | |
| 4760 | + | <doc xml:space="preserve" | |
| 4761 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4762 | + | line="667">time when the animation starts playing</doc> | |
| 4763 | + | <type name="GLib.TimeVal" c:type="const GTimeVal*"/> | |
| 4764 | + | </parameter> | |
| 4765 | + | </parameters> | |
| 4766 | + | </callback> | |
| 4767 | + | </field> | |
| 4768 | + | </record> | |
| 4769 | + | <class name="PixbufAnimationIter" | |
| 4770 | + | c:symbol-prefix="pixbuf_animation_iter" | |
| 4771 | + | c:type="GdkPixbufAnimationIter" | |
| 4772 | + | parent="GObject.Object" | |
| 4773 | + | glib:type-name="GdkPixbufAnimationIter" | |
| 4774 | + | glib:get-type="gdk_pixbuf_animation_iter_get_type" | |
| 4775 | + | glib:type-struct="PixbufAnimationIterClass"> | |
| 4776 | + | <doc xml:space="preserve" | |
| 4777 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4778 | + | line="50">An opaque object representing an iterator which points to a | |
| 4779 | + | certain position in an animation.</doc> | |
| 4780 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4781 | + | line="208"/> | |
| 4782 | + | <virtual-method name="advance" invoker="advance"> | |
| 4783 | + | <doc xml:space="preserve" | |
| 4784 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4785 | + | line="813">Possibly advances an animation to a new frame. | |
| 4786 | + | ||
| 4787 | + | Chooses the frame based on the start time passed to | |
| 4788 | + | gdk_pixbuf_animation_get_iter(). | |
| 4789 | + | ||
| 4790 | + | @current_time would normally come from g_get_current_time(), and | |
| 4791 | + | must be greater than or equal to the time passed to | |
| 4792 | + | gdk_pixbuf_animation_get_iter(), and must increase or remain | |
| 4793 | + | unchanged each time gdk_pixbuf_animation_iter_get_pixbuf() is | |
| 4794 | + | called. That is, you can't go backward in time; animations only | |
| 4795 | + | play forward. | |
| 4796 | + | ||
| 4797 | + | As a shortcut, pass `NULL` for the current time and g_get_current_time() | |
| 4798 | + | will be invoked on your behalf. So you only need to explicitly pass | |
| 4799 | + | @current_time if you're doing something odd like playing the animation | |
| 4800 | + | at double speed. | |
| 4801 | + | ||
| 4802 | + | If this function returns `FALSE`, there's no need to update the animation | |
| 4803 | + | display, assuming the display had been rendered prior to advancing; | |
| 4804 | + | if `TRUE`, you need to call gdk_pixbuf_animation_iter_get_pixbuf() | |
| 4805 | + | and update the display with the new pixbuf.</doc> | |
| 4806 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4807 | + | line="206"/> | |
| 4808 | + | <return-value transfer-ownership="none"> | |
| 4809 | + | <doc xml:space="preserve" | |
| 4810 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4811 | + | line="840">`TRUE` if the image may need updating</doc> | |
| 4812 | + | <type name="gboolean" c:type="gboolean"/> | |
| 4813 | + | </return-value> | |
| 4814 | + | <parameters> | |
| 4815 | + | <instance-parameter name="iter" transfer-ownership="none"> | |
| 4816 | + | <doc xml:space="preserve" | |
| 4817 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4818 | + | line="815">a #GdkPixbufAnimationIter</doc> | |
| 4819 | + | <type name="PixbufAnimationIter" c:type="GdkPixbufAnimationIter*"/> | |
| 4820 | + | </instance-parameter> | |
| 4821 | + | <parameter name="current_time" | |
| 4822 | + | transfer-ownership="none" | |
| 4823 | + | nullable="1" | |
| 4824 | + | allow-none="1"> | |
| 4825 | + | <doc xml:space="preserve" | |
| 4826 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4827 | + | line="816">current time</doc> | |
| 4828 | + | <type name="GLib.TimeVal" c:type="const GTimeVal*"/> | |
| 4829 | + | </parameter> | |
| 4830 | + | </parameters> | |
| 4831 | + | </virtual-method> | |
| 4832 | + | <virtual-method name="get_delay_time" invoker="get_delay_time"> | |
| 4833 | + | <doc xml:space="preserve" | |
| 4834 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4835 | + | line="735">Gets the number of milliseconds the current pixbuf should be displayed, | |
| 4836 | + | or -1 if the current pixbuf should be displayed forever. | |
| 4837 | + | ||
| 4838 | + | The `g_timeout_add()` function conveniently takes a timeout in milliseconds, | |
| 4839 | + | so you can use a timeout to schedule the next update. | |
| 4840 | + | ||
| 4841 | + | Note that some formats, like GIF, might clamp the timeout values in the | |
| 4842 | + | image file to avoid updates that are just too quick. The minimum timeout | |
| 4843 | + | for GIF images is currently 20 milliseconds.</doc> | |
| 4844 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4845 | + | line="200"/> | |
| 4846 | + | <return-value transfer-ownership="none"> | |
| 4847 | + | <doc xml:space="preserve" | |
| 4848 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4849 | + | line="749">delay time in milliseconds (thousandths of a second)</doc> | |
| 4850 | + | <type name="gint" c:type="int"/> | |
| 4851 | + | </return-value> | |
| 4852 | + | <parameters> | |
| 4853 | + | <instance-parameter name="iter" transfer-ownership="none"> | |
| 4854 | + | <doc xml:space="preserve" | |
| 4855 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4856 | + | line="737">an animation iterator</doc> | |
| 4857 | + | <type name="PixbufAnimationIter" c:type="GdkPixbufAnimationIter*"/> | |
| 4858 | + | </instance-parameter> | |
| 4859 | + | </parameters> | |
| 4860 | + | </virtual-method> | |
| 4861 | + | <virtual-method name="get_pixbuf" invoker="get_pixbuf"> | |
| 4862 | + | <doc xml:space="preserve" | |
| 4863 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4864 | + | line="760">Gets the current pixbuf which should be displayed. | |
| 4865 | + | ||
| 4866 | + | The pixbuf might not be the same size as the animation itself | |
| 4867 | + | (gdk_pixbuf_animation_get_width(), gdk_pixbuf_animation_get_height()). | |
| 4868 | + | ||
| 4869 | + | This pixbuf should be displayed for gdk_pixbuf_animation_iter_get_delay_time() | |
| 4870 | + | milliseconds. | |
| 4871 | + | ||
| 4872 | + | The caller of this function does not own a reference to the returned | |
| 4873 | + | pixbuf; the returned pixbuf will become invalid when the iterator | |
| 4874 | + | advances to the next frame, which may happen anytime you call | |
| 4875 | + | gdk_pixbuf_animation_iter_advance(). | |
| 4876 | + | ||
| 4877 | + | Copy the pixbuf to keep it (don't just add a reference), as it may get | |
| 4878 | + | recycled as you advance the iterator.</doc> | |
| 4879 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4880 | + | line="202"/> | |
| 4881 | + | <return-value transfer-ownership="none"> | |
| 4882 | + | <doc xml:space="preserve" | |
| 4883 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4884 | + | line="780">the pixbuf to be displayed</doc> | |
| 4885 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 4886 | + | </return-value> | |
| 4887 | + | <parameters> | |
| 4888 | + | <instance-parameter name="iter" transfer-ownership="none"> | |
| 4889 | + | <doc xml:space="preserve" | |
| 4890 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4891 | + | line="762">an animation iterator</doc> | |
| 4892 | + | <type name="PixbufAnimationIter" c:type="GdkPixbufAnimationIter*"/> | |
| 4893 | + | </instance-parameter> | |
| 4894 | + | </parameters> | |
| 4895 | + | </virtual-method> | |
| 4896 | + | <virtual-method name="on_currently_loading_frame" | |
| 4897 | + | invoker="on_currently_loading_frame"> | |
| 4898 | + | <doc xml:space="preserve" | |
| 4899 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4900 | + | line="791">Used to determine how to respond to the area_updated signal on | |
| 4901 | + | #GdkPixbufLoader when loading an animation. | |
| 4902 | + | ||
| 4903 | + | The `::area_updated` signal is emitted for an area of the frame currently | |
| 4904 | + | streaming in to the loader. So if you're on the currently loading frame, | |
| 4905 | + | you will need to redraw the screen for the updated area.</doc> | |
| 4906 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4907 | + | line="204"/> | |
| 4908 | + | <return-value transfer-ownership="none"> | |
| 4909 | + | <doc xml:space="preserve" | |
| 4910 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4911 | + | line="802">`TRUE` if the frame we're on is partially loaded, or the last frame</doc> | |
| 4912 | + | <type name="gboolean" c:type="gboolean"/> | |
| 4913 | + | </return-value> | |
| 4914 | + | <parameters> | |
| 4915 | + | <instance-parameter name="iter" transfer-ownership="none"> | |
| 4916 | + | <doc xml:space="preserve" | |
| 4917 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4918 | + | line="793">a #GdkPixbufAnimationIter</doc> | |
| 4919 | + | <type name="PixbufAnimationIter" c:type="GdkPixbufAnimationIter*"/> | |
| 4920 | + | </instance-parameter> | |
| 4921 | + | </parameters> | |
| 4922 | + | </virtual-method> | |
| 4923 | + | <method name="advance" c:identifier="gdk_pixbuf_animation_iter_advance"> | |
| 4924 | + | <doc xml:space="preserve" | |
| 4925 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4926 | + | line="813">Possibly advances an animation to a new frame. | |
| 4927 | + | ||
| 4928 | + | Chooses the frame based on the start time passed to | |
| 4929 | + | gdk_pixbuf_animation_get_iter(). | |
| 4930 | + | ||
| 4931 | + | @current_time would normally come from g_get_current_time(), and | |
| 4932 | + | must be greater than or equal to the time passed to | |
| 4933 | + | gdk_pixbuf_animation_get_iter(), and must increase or remain | |
| 4934 | + | unchanged each time gdk_pixbuf_animation_iter_get_pixbuf() is | |
| 4935 | + | called. That is, you can't go backward in time; animations only | |
| 4936 | + | play forward. | |
| 4937 | + | ||
| 4938 | + | As a shortcut, pass `NULL` for the current time and g_get_current_time() | |
| 4939 | + | will be invoked on your behalf. So you only need to explicitly pass | |
| 4940 | + | @current_time if you're doing something odd like playing the animation | |
| 4941 | + | at double speed. | |
| 4942 | + | ||
| 4943 | + | If this function returns `FALSE`, there's no need to update the animation | |
| 4944 | + | display, assuming the display had been rendered prior to advancing; | |
| 4945 | + | if `TRUE`, you need to call gdk_pixbuf_animation_iter_get_pixbuf() | |
| 4946 | + | and update the display with the new pixbuf.</doc> | |
| 4947 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4948 | + | line="114"/> | |
| 4949 | + | <return-value transfer-ownership="none"> | |
| 4950 | + | <doc xml:space="preserve" | |
| 4951 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4952 | + | line="840">`TRUE` if the image may need updating</doc> | |
| 4953 | + | <type name="gboolean" c:type="gboolean"/> | |
| 4954 | + | </return-value> | |
| 4955 | + | <parameters> | |
| 4956 | + | <instance-parameter name="iter" transfer-ownership="none"> | |
| 4957 | + | <doc xml:space="preserve" | |
| 4958 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4959 | + | line="815">a #GdkPixbufAnimationIter</doc> | |
| 4960 | + | <type name="PixbufAnimationIter" c:type="GdkPixbufAnimationIter*"/> | |
| 4961 | + | </instance-parameter> | |
| 4962 | + | <parameter name="current_time" | |
| 4963 | + | transfer-ownership="none" | |
| 4964 | + | nullable="1" | |
| 4965 | + | allow-none="1"> | |
| 4966 | + | <doc xml:space="preserve" | |
| 4967 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4968 | + | line="816">current time</doc> | |
| 4969 | + | <type name="GLib.TimeVal" c:type="const GTimeVal*"/> | |
| 4970 | + | </parameter> | |
| 4971 | + | </parameters> | |
| 4972 | + | </method> | |
| 4973 | + | <method name="get_delay_time" | |
| 4974 | + | c:identifier="gdk_pixbuf_animation_iter_get_delay_time"> | |
| 4975 | + | <doc xml:space="preserve" | |
| 4976 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4977 | + | line="735">Gets the number of milliseconds the current pixbuf should be displayed, | |
| 4978 | + | or -1 if the current pixbuf should be displayed forever. | |
| 4979 | + | ||
| 4980 | + | The `g_timeout_add()` function conveniently takes a timeout in milliseconds, | |
| 4981 | + | so you can use a timeout to schedule the next update. | |
| 4982 | + | ||
| 4983 | + | Note that some formats, like GIF, might clamp the timeout values in the | |
| 4984 | + | image file to avoid updates that are just too quick. The minimum timeout | |
| 4985 | + | for GIF images is currently 20 milliseconds.</doc> | |
| 4986 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 4987 | + | line="107"/> | |
| 4988 | + | <return-value transfer-ownership="none"> | |
| 4989 | + | <doc xml:space="preserve" | |
| 4990 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4991 | + | line="749">delay time in milliseconds (thousandths of a second)</doc> | |
| 4992 | + | <type name="gint" c:type="int"/> | |
| 4993 | + | </return-value> | |
| 4994 | + | <parameters> | |
| 4995 | + | <instance-parameter name="iter" transfer-ownership="none"> | |
| 4996 | + | <doc xml:space="preserve" | |
| 4997 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 4998 | + | line="737">an animation iterator</doc> | |
| 4999 | + | <type name="PixbufAnimationIter" c:type="GdkPixbufAnimationIter*"/> | |
| 5000 | + | </instance-parameter> | |
| 5001 | + | </parameters> | |
| 5002 | + | </method> | |
| 5003 | + | <method name="get_pixbuf" | |
| 5004 | + | c:identifier="gdk_pixbuf_animation_iter_get_pixbuf"> | |
| 5005 | + | <doc xml:space="preserve" | |
| 5006 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 5007 | + | line="760">Gets the current pixbuf which should be displayed. | |
| 5008 | + | ||
| 5009 | + | The pixbuf might not be the same size as the animation itself | |
| 5010 | + | (gdk_pixbuf_animation_get_width(), gdk_pixbuf_animation_get_height()). | |
| 5011 | + | ||
| 5012 | + | This pixbuf should be displayed for gdk_pixbuf_animation_iter_get_delay_time() | |
| 5013 | + | milliseconds. | |
| 5014 | + | ||
| 5015 | + | The caller of this function does not own a reference to the returned | |
| 5016 | + | pixbuf; the returned pixbuf will become invalid when the iterator | |
| 5017 | + | advances to the next frame, which may happen anytime you call | |
| 5018 | + | gdk_pixbuf_animation_iter_advance(). | |
| 5019 | + | ||
| 5020 | + | Copy the pixbuf to keep it (don't just add a reference), as it may get | |
| 5021 | + | recycled as you advance the iterator.</doc> | |
| 5022 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 5023 | + | line="109"/> | |
| 5024 | + | <return-value transfer-ownership="none"> | |
| 5025 | + | <doc xml:space="preserve" | |
| 5026 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 5027 | + | line="780">the pixbuf to be displayed</doc> | |
| 5028 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 5029 | + | </return-value> | |
| 5030 | + | <parameters> | |
| 5031 | + | <instance-parameter name="iter" transfer-ownership="none"> | |
| 5032 | + | <doc xml:space="preserve" | |
| 5033 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 5034 | + | line="762">an animation iterator</doc> | |
| 5035 | + | <type name="PixbufAnimationIter" c:type="GdkPixbufAnimationIter*"/> | |
| 5036 | + | </instance-parameter> | |
| 5037 | + | </parameters> | |
| 5038 | + | </method> | |
| 5039 | + | <method name="on_currently_loading_frame" | |
| 5040 | + | c:identifier="gdk_pixbuf_animation_iter_on_currently_loading_frame"> | |
| 5041 | + | <doc xml:space="preserve" | |
| 5042 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 5043 | + | line="791">Used to determine how to respond to the area_updated signal on | |
| 5044 | + | #GdkPixbufLoader when loading an animation. | |
| 5045 | + | ||
| 5046 | + | The `::area_updated` signal is emitted for an area of the frame currently | |
| 5047 | + | streaming in to the loader. So if you're on the currently loading frame, | |
| 5048 | + | you will need to redraw the screen for the updated area.</doc> | |
| 5049 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 5050 | + | line="111"/> | |
| 5051 | + | <return-value transfer-ownership="none"> | |
| 5052 | + | <doc xml:space="preserve" | |
| 5053 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 5054 | + | line="802">`TRUE` if the frame we're on is partially loaded, or the last frame</doc> | |
| 5055 | + | <type name="gboolean" c:type="gboolean"/> | |
| 5056 | + | </return-value> | |
| 5057 | + | <parameters> | |
| 5058 | + | <instance-parameter name="iter" transfer-ownership="none"> | |
| 5059 | + | <doc xml:space="preserve" | |
| 5060 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 5061 | + | line="793">a #GdkPixbufAnimationIter</doc> | |
| 5062 | + | <type name="PixbufAnimationIter" c:type="GdkPixbufAnimationIter*"/> | |
| 5063 | + | </instance-parameter> | |
| 5064 | + | </parameters> | |
| 5065 | + | </method> | |
| 5066 | + | <field name="parent_instance"> | |
| 5067 | + | <type name="GObject.Object" c:type="GObject"/> | |
| 5068 | + | </field> | |
| 5069 | + | </class> | |
| 5070 | + | <record name="PixbufAnimationIterClass" | |
| 5071 | + | c:type="GdkPixbufAnimationIterClass" | |
| 5072 | + | glib:is-gtype-struct-for="PixbufAnimationIter"> | |
| 5073 | + | <doc xml:space="preserve" | |
| 5074 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 5075 | + | line="168">Modules supporting animations must derive a type from | |
| 5076 | + | #GdkPixbufAnimationIter, providing suitable implementations of the | |
| 5077 | + | virtual functions.</doc> | |
| 5078 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 5079 | + | line="208"/> | |
| 5080 | + | <field name="parent_class"> | |
| 5081 | + | <doc xml:space="preserve" | |
| 5082 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 5083 | + | line="170">the parent class</doc> | |
| 5084 | + | <type name="GObject.ObjectClass" c:type="GObjectClass"/> | |
| 5085 | + | </field> | |
| 5086 | + | <field name="get_delay_time"> | |
| 5087 | + | <callback name="get_delay_time"> | |
| 5088 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 5089 | + | line="200"/> | |
| 5090 | + | <return-value transfer-ownership="none"> | |
| 5091 | + | <doc xml:space="preserve" | |
| 5092 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 5093 | + | line="749">delay time in milliseconds (thousandths of a second)</doc> | |
| 5094 | + | <type name="gint" c:type="int"/> | |
| 5095 | + | </return-value> | |
| 5096 | + | <parameters> | |
| 5097 | + | <parameter name="iter" transfer-ownership="none"> | |
| 5098 | + | <doc xml:space="preserve" | |
| 5099 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 5100 | + | line="737">an animation iterator</doc> | |
| 5101 | + | <type name="PixbufAnimationIter" | |
| 5102 | + | c:type="GdkPixbufAnimationIter*"/> | |
| 5103 | + | </parameter> | |
| 5104 | + | </parameters> | |
| 5105 | + | </callback> | |
| 5106 | + | </field> | |
| 5107 | + | <field name="get_pixbuf"> | |
| 5108 | + | <callback name="get_pixbuf"> | |
| 5109 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 5110 | + | line="202"/> | |
| 5111 | + | <return-value transfer-ownership="none"> | |
| 5112 | + | <doc xml:space="preserve" | |
| 5113 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 5114 | + | line="780">the pixbuf to be displayed</doc> | |
| 5115 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 5116 | + | </return-value> | |
| 5117 | + | <parameters> | |
| 5118 | + | <parameter name="iter" transfer-ownership="none"> | |
| 5119 | + | <doc xml:space="preserve" | |
| 5120 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 5121 | + | line="762">an animation iterator</doc> | |
| 5122 | + | <type name="PixbufAnimationIter" | |
| 5123 | + | c:type="GdkPixbufAnimationIter*"/> | |
| 5124 | + | </parameter> | |
| 5125 | + | </parameters> | |
| 5126 | + | </callback> | |
| 5127 | + | </field> | |
| 5128 | + | <field name="on_currently_loading_frame"> | |
| 5129 | + | <callback name="on_currently_loading_frame"> | |
| 5130 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 5131 | + | line="204"/> | |
| 5132 | + | <return-value transfer-ownership="none"> | |
| 5133 | + | <doc xml:space="preserve" | |
| 5134 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 5135 | + | line="802">`TRUE` if the frame we're on is partially loaded, or the last frame</doc> | |
| 5136 | + | <type name="gboolean" c:type="gboolean"/> | |
| 5137 | + | </return-value> | |
| 5138 | + | <parameters> | |
| 5139 | + | <parameter name="iter" transfer-ownership="none"> | |
| 5140 | + | <doc xml:space="preserve" | |
| 5141 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 5142 | + | line="793">a #GdkPixbufAnimationIter</doc> | |
| 5143 | + | <type name="PixbufAnimationIter" | |
| 5144 | + | c:type="GdkPixbufAnimationIter*"/> | |
| 5145 | + | </parameter> | |
| 5146 | + | </parameters> | |
| 5147 | + | </callback> | |
| 5148 | + | </field> | |
| 5149 | + | <field name="advance"> | |
| 5150 | + | <callback name="advance"> | |
| 5151 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 5152 | + | line="206"/> | |
| 5153 | + | <return-value transfer-ownership="none"> | |
| 5154 | + | <doc xml:space="preserve" | |
| 5155 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 5156 | + | line="840">`TRUE` if the image may need updating</doc> | |
| 5157 | + | <type name="gboolean" c:type="gboolean"/> | |
| 5158 | + | </return-value> | |
| 5159 | + | <parameters> | |
| 5160 | + | <parameter name="iter" transfer-ownership="none"> | |
| 5161 | + | <doc xml:space="preserve" | |
| 5162 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 5163 | + | line="815">a #GdkPixbufAnimationIter</doc> | |
| 5164 | + | <type name="PixbufAnimationIter" | |
| 5165 | + | c:type="GdkPixbufAnimationIter*"/> | |
| 5166 | + | </parameter> | |
| 5167 | + | <parameter name="current_time" | |
| 5168 | + | transfer-ownership="none" | |
| 5169 | + | nullable="1" | |
| 5170 | + | allow-none="1"> | |
| 5171 | + | <doc xml:space="preserve" | |
| 5172 | + | filename="../gdk-pixbuf/gdk-pixbuf-animation.c" | |
| 5173 | + | line="816">current time</doc> | |
| 5174 | + | <type name="GLib.TimeVal" c:type="const GTimeVal*"/> | |
| 5175 | + | </parameter> | |
| 5176 | + | </parameters> | |
| 5177 | + | </callback> | |
| 5178 | + | </field> | |
| 5179 | + | </record> | |
| 5180 | + | <callback name="PixbufDestroyNotify" c:type="GdkPixbufDestroyNotify"> | |
| 5181 | + | <doc xml:space="preserve" | |
| 5182 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 5183 | + | line="96">A function of this type is responsible for freeing the pixel array | |
| 5184 | + | of a pixbuf. | |
| 5185 | + | ||
| 5186 | + | The gdk_pixbuf_new_from_data() function lets you pass in a pre-allocated | |
| 5187 | + | pixel array so that a pixbuf can be created from it; in this case you | |
| 5188 | + | will need to pass in a function of type `GdkPixbufDestroyNotify` so that | |
| 5189 | + | the pixel data can be freed when the pixbuf is finalized.</doc> | |
| 5190 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" line="110"/> | |
| 5191 | + | <return-value transfer-ownership="none"> | |
| 5192 | + | <type name="none" c:type="void"/> | |
| 5193 | + | </return-value> | |
| 5194 | + | <parameters> | |
| 5195 | + | <parameter name="pixels" transfer-ownership="none"> | |
| 5196 | + | <doc xml:space="preserve" | |
| 5197 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 5198 | + | line="98">The pixel array of the pixbuf | |
| 5199 | + | that is being finalized.</doc> | |
| 5200 | + | <array zero-terminated="0" c:type="guchar*"> | |
| 5201 | + | <type name="guint8"/> | |
| 5202 | + | </array> | |
| 5203 | + | </parameter> | |
| 5204 | + | <parameter name="data" | |
| 5205 | + | transfer-ownership="none" | |
| 5206 | + | nullable="1" | |
| 5207 | + | allow-none="1" | |
| 5208 | + | closure="1"> | |
| 5209 | + | <doc xml:space="preserve" | |
| 5210 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 5211 | + | line="100">User closure data.</doc> | |
| 5212 | + | <type name="gpointer" c:type="gpointer"/> | |
| 5213 | + | </parameter> | |
| 5214 | + | </parameters> | |
| 5215 | + | </callback> | |
| 5216 | + | <enumeration name="PixbufError" | |
| 5217 | + | glib:type-name="GdkPixbufError" | |
| 5218 | + | glib:get-type="gdk_pixbuf_error_get_type" | |
| 5219 | + | c:type="GdkPixbufError" | |
| 5220 | + | glib:error-domain="gdk-pixbuf-error-quark"> | |
| 5221 | + | <doc xml:space="preserve" | |
| 5222 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 5223 | + | line="123">An error code in the `GDK_PIXBUF_ERROR` domain. | |
| 5224 | + | ||
| 5225 | + | Many gdk-pixbuf operations can cause errors in this domain, or in | |
| 5226 | + | the `G_FILE_ERROR` domain.</doc> | |
| 5227 | + | <member name="corrupt_image" | |
| 5228 | + | value="0" | |
| 5229 | + | c:identifier="GDK_PIXBUF_ERROR_CORRUPT_IMAGE" | |
| 5230 | + | glib:nick="corrupt-image" | |
| 5231 | + | glib:name="GDK_PIXBUF_ERROR_CORRUPT_IMAGE"> | |
| 5232 | + | <doc xml:space="preserve" | |
| 5233 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 5234 | + | line="125">An image file was broken somehow.</doc> | |
| 5235 | + | </member> | |
| 5236 | + | <member name="insufficient_memory" | |
| 5237 | + | value="1" | |
| 5238 | + | c:identifier="GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY" | |
| 5239 | + | glib:nick="insufficient-memory" | |
| 5240 | + | glib:name="GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY"> | |
| 5241 | + | <doc xml:space="preserve" | |
| 5242 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 5243 | + | line="126">Not enough memory.</doc> | |
| 5244 | + | </member> | |
| 5245 | + | <member name="bad_option" | |
| 5246 | + | value="2" | |
| 5247 | + | c:identifier="GDK_PIXBUF_ERROR_BAD_OPTION" | |
| 5248 | + | glib:nick="bad-option" | |
| 5249 | + | glib:name="GDK_PIXBUF_ERROR_BAD_OPTION"> | |
| 5250 | + | <doc xml:space="preserve" | |
| 5251 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 5252 | + | line="127">A bad option was passed to a pixbuf save module.</doc> | |
| 5253 | + | </member> | |
| 5254 | + | <member name="unknown_type" | |
| 5255 | + | value="3" | |
| 5256 | + | c:identifier="GDK_PIXBUF_ERROR_UNKNOWN_TYPE" | |
| 5257 | + | glib:nick="unknown-type" | |
| 5258 | + | glib:name="GDK_PIXBUF_ERROR_UNKNOWN_TYPE"> | |
| 5259 | + | <doc xml:space="preserve" | |
| 5260 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 5261 | + | line="128">Unknown image type.</doc> | |
| 5262 | + | </member> | |
| 5263 | + | <member name="unsupported_operation" | |
| 5264 | + | value="4" | |
| 5265 | + | c:identifier="GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION" | |
| 5266 | + | glib:nick="unsupported-operation" | |
| 5267 | + | glib:name="GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION"> | |
| 5268 | + | <doc xml:space="preserve" | |
| 5269 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 5270 | + | line="129">Don't know how to perform the | |
| 5271 | + | given operation on the type of image at hand.</doc> | |
| 5272 | + | </member> | |
| 5273 | + | <member name="failed" | |
| 5274 | + | value="5" | |
| 5275 | + | c:identifier="GDK_PIXBUF_ERROR_FAILED" | |
| 5276 | + | glib:nick="failed" | |
| 5277 | + | glib:name="GDK_PIXBUF_ERROR_FAILED"> | |
| 5278 | + | <doc xml:space="preserve" | |
| 5279 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 5280 | + | line="131">Generic failure code, something went wrong.</doc> | |
| 5281 | + | </member> | |
| 5282 | + | <member name="incomplete_animation" | |
| 5283 | + | value="6" | |
| 5284 | + | c:identifier="GDK_PIXBUF_ERROR_INCOMPLETE_ANIMATION" | |
| 5285 | + | glib:nick="incomplete-animation" | |
| 5286 | + | glib:name="GDK_PIXBUF_ERROR_INCOMPLETE_ANIMATION"> | |
| 5287 | + | <doc xml:space="preserve" | |
| 5288 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 5289 | + | line="132">Only part of the animation was loaded.</doc> | |
| 5290 | + | </member> | |
| 5291 | + | <function name="quark" c:identifier="gdk_pixbuf_error_quark"> | |
| 5292 | + | <return-value transfer-ownership="none"> | |
| 5293 | + | <type name="GLib.Quark" c:type="GQuark"/> | |
| 5294 | + | </return-value> | |
| 5295 | + | </function> | |
| 5296 | + | </enumeration> | |
| 5297 | + | <record name="PixbufFormat" | |
| 5298 | + | c:type="GdkPixbufFormat" | |
| 5299 | + | version="2.2" | |
| 5300 | + | glib:type-name="GdkPixbufFormat" | |
| 5301 | + | glib:get-type="gdk_pixbuf_format_get_type" | |
| 5302 | + | c:symbol-prefix="pixbuf_format"> | |
| 5303 | + | <doc xml:space="preserve" | |
| 5304 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 5305 | + | line="443">A `GdkPixbufFormat` contains information about the image format accepted | |
| 5306 | + | by a module. | |
| 5307 | + | ||
| 5308 | + | Only modules should access the fields directly, applications should | |
| 5309 | + | use the `gdk_pixbuf_format_*` family of functions.</doc> | |
| 5310 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="475"/> | |
| 5311 | + | <field name="name" writable="1"> | |
| 5312 | + | <doc xml:space="preserve" | |
| 5313 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 5314 | + | line="445">the name of the image format</doc> | |
| 5315 | + | <type name="utf8" c:type="gchar*"/> | |
| 5316 | + | </field> | |
| 5317 | + | <field name="signature" writable="1"> | |
| 5318 | + | <doc xml:space="preserve" | |
| 5319 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 5320 | + | line="446">the signature of the module</doc> | |
| 5321 | + | <type name="PixbufModulePattern" c:type="GdkPixbufModulePattern*"/> | |
| 5322 | + | </field> | |
| 5323 | + | <field name="domain" writable="1"> | |
| 5324 | + | <doc xml:space="preserve" | |
| 5325 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 5326 | + | line="447">the message domain for the `description`</doc> | |
| 5327 | + | <type name="utf8" c:type="gchar*"/> | |
| 5328 | + | </field> | |
| 5329 | + | <field name="description" writable="1"> | |
| 5330 | + | <doc xml:space="preserve" | |
| 5331 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 5332 | + | line="448">a description of the image format</doc> | |
| 5333 | + | <type name="utf8" c:type="gchar*"/> | |
| 5334 | + | </field> | |
| 5335 | + | <field name="mime_types" writable="1"> | |
| 5336 | + | <doc xml:space="preserve" | |
| 5337 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 5338 | + | line="449">the MIME types for the image format</doc> | |
| 5339 | + | <array c:type="gchar**"> | |
| 5340 | + | <type name="utf8" c:type="gchar*"/> | |
| 5341 | + | </array> | |
| 5342 | + | </field> | |
| 5343 | + | <field name="extensions" writable="1"> | |
| 5344 | + | <doc xml:space="preserve" | |
| 5345 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 5346 | + | line="450">typical filename extensions for the | |
| 5347 | + | image format</doc> | |
| 5348 | + | <array c:type="gchar**"> | |
| 5349 | + | <type name="utf8" c:type="gchar*"/> | |
| 5350 | + | </array> | |
| 5351 | + | </field> | |
| 5352 | + | <field name="flags" writable="1"> | |
| 5353 | + | <doc xml:space="preserve" | |
| 5354 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 5355 | + | line="452">a combination of `GdkPixbufFormatFlags`</doc> | |
| 5356 | + | <type name="guint32" c:type="guint32"/> | |
| 5357 | + | </field> | |
| 5358 | + | <field name="disabled" writable="1"> | |
| 5359 | + | <doc xml:space="preserve" | |
| 5360 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 5361 | + | line="453">a boolean determining whether the loader is disabled`</doc> | |
| 5362 | + | <type name="gboolean" c:type="gboolean"/> | |
| 5363 | + | </field> | |
| 5364 | + | <field name="license" writable="1"> | |
| 5365 | + | <doc xml:space="preserve" | |
| 5366 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 5367 | + | line="454">a string containing license information, typically set to | |
| 5368 | + | shorthands like "GPL", "LGPL", etc.</doc> | |
| 5369 | + | <type name="utf8" c:type="gchar*"/> | |
| 5370 | + | </field> | |
| 5371 | + | <method name="copy" c:identifier="gdk_pixbuf_format_copy" version="2.22"> | |
| 5372 | + | <doc xml:space="preserve" | |
| 5373 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5374 | + | line="3452">Creates a copy of `format`.</doc> | |
| 5375 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="92"/> | |
| 5376 | + | <return-value transfer-ownership="full"> | |
| 5377 | + | <doc xml:space="preserve" | |
| 5378 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5379 | + | line="3458">the newly allocated copy of a `GdkPixbufFormat`. Use | |
| 5380 | + | gdk_pixbuf_format_free() to free the resources when done</doc> | |
| 5381 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 5382 | + | </return-value> | |
| 5383 | + | <parameters> | |
| 5384 | + | <instance-parameter name="format" transfer-ownership="none"> | |
| 5385 | + | <doc xml:space="preserve" | |
| 5386 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5387 | + | line="3454">a pixbuf format</doc> | |
| 5388 | + | <type name="PixbufFormat" c:type="const GdkPixbufFormat*"/> | |
| 5389 | + | </instance-parameter> | |
| 5390 | + | </parameters> | |
| 5391 | + | </method> | |
| 5392 | + | <method name="free" c:identifier="gdk_pixbuf_format_free" version="2.22"> | |
| 5393 | + | <doc xml:space="preserve" | |
| 5394 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5395 | + | line="3472">Frees the resources allocated when copying a `GdkPixbufFormat` | |
| 5396 | + | using gdk_pixbuf_format_copy()</doc> | |
| 5397 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="94"/> | |
| 5398 | + | <return-value transfer-ownership="none"> | |
| 5399 | + | <type name="none" c:type="void"/> | |
| 5400 | + | </return-value> | |
| 5401 | + | <parameters> | |
| 5402 | + | <instance-parameter name="format" transfer-ownership="none"> | |
| 5403 | + | <doc xml:space="preserve" | |
| 5404 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5405 | + | line="3474">a pixbuf format</doc> | |
| 5406 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 5407 | + | </instance-parameter> | |
| 5408 | + | </parameters> | |
| 5409 | + | </method> | |
| 5410 | + | <method name="get_description" | |
| 5411 | + | c:identifier="gdk_pixbuf_format_get_description" | |
| 5412 | + | version="2.2"> | |
| 5413 | + | <doc xml:space="preserve" | |
| 5414 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5415 | + | line="3249">Returns a description of the format.</doc> | |
| 5416 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="56"/> | |
| 5417 | + | <return-value transfer-ownership="full"> | |
| 5418 | + | <doc xml:space="preserve" | |
| 5419 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5420 | + | line="3255">a description of the format.</doc> | |
| 5421 | + | <type name="utf8" c:type="gchar*"/> | |
| 5422 | + | </return-value> | |
| 5423 | + | <parameters> | |
| 5424 | + | <instance-parameter name="format" transfer-ownership="none"> | |
| 5425 | + | <doc xml:space="preserve" | |
| 5426 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5427 | + | line="3251">a `GdkPixbufFormat`</doc> | |
| 5428 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 5429 | + | </instance-parameter> | |
| 5430 | + | </parameters> | |
| 5431 | + | </method> | |
| 5432 | + | <method name="get_extensions" | |
| 5433 | + | c:identifier="gdk_pixbuf_format_get_extensions" | |
| 5434 | + | version="2.2"> | |
| 5435 | + | <doc xml:space="preserve" | |
| 5436 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5437 | + | line="3293">Returns the filename extensions typically used for files in the | |
| 5438 | + | given format.</doc> | |
| 5439 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="60"/> | |
| 5440 | + | <return-value transfer-ownership="full"> | |
| 5441 | + | <doc xml:space="preserve" | |
| 5442 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5443 | + | line="3300">an array of | |
| 5444 | + | filename extensions</doc> | |
| 5445 | + | <array c:type="gchar**"> | |
| 5446 | + | <type name="utf8"/> | |
| 5447 | + | </array> | |
| 5448 | + | </return-value> | |
| 5449 | + | <parameters> | |
| 5450 | + | <instance-parameter name="format" transfer-ownership="none"> | |
| 5451 | + | <doc xml:space="preserve" | |
| 5452 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5453 | + | line="3295">a `GdkPixbufFormat`</doc> | |
| 5454 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 5455 | + | </instance-parameter> | |
| 5456 | + | </parameters> | |
| 5457 | + | </method> | |
| 5458 | + | <method name="get_license" | |
| 5459 | + | c:identifier="gdk_pixbuf_format_get_license" | |
| 5460 | + | version="2.6"> | |
| 5461 | + | <doc xml:space="preserve" | |
| 5462 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5463 | + | line="3397">Returns information about the license of the image loader for the format. | |
| 5464 | + | ||
| 5465 | + | The returned string should be a shorthand for a well known license, e.g. | |
| 5466 | + | "LGPL", "GPL", "QPL", "GPL/QPL", or "other" to indicate some other license.</doc> | |
| 5467 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="74"/> | |
| 5468 | + | <return-value transfer-ownership="full"> | |
| 5469 | + | <doc xml:space="preserve" | |
| 5470 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5471 | + | line="3406">a string describing the license of the pixbuf format</doc> | |
| 5472 | + | <type name="utf8" c:type="gchar*"/> | |
| 5473 | + | </return-value> | |
| 5474 | + | <parameters> | |
| 5475 | + | <instance-parameter name="format" transfer-ownership="none"> | |
| 5476 | + | <doc xml:space="preserve" | |
| 5477 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5478 | + | line="3399">a pixbuf format</doc> | |
| 5479 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 5480 | + | </instance-parameter> | |
| 5481 | + | </parameters> | |
| 5482 | + | </method> | |
| 5483 | + | <method name="get_mime_types" | |
| 5484 | + | c:identifier="gdk_pixbuf_format_get_mime_types" | |
| 5485 | + | version="2.2"> | |
| 5486 | + | <doc xml:space="preserve" | |
| 5487 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5488 | + | line="3275">Returns the mime types supported by the format.</doc> | |
| 5489 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="58"/> | |
| 5490 | + | <return-value transfer-ownership="full"> | |
| 5491 | + | <doc xml:space="preserve" | |
| 5492 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5493 | + | line="3281">an array of mime types</doc> | |
| 5494 | + | <array c:type="gchar**"> | |
| 5495 | + | <type name="utf8"/> | |
| 5496 | + | </array> | |
| 5497 | + | </return-value> | |
| 5498 | + | <parameters> | |
| 5499 | + | <instance-parameter name="format" transfer-ownership="none"> | |
| 5500 | + | <doc xml:space="preserve" | |
| 5501 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5502 | + | line="3277">a `GdkPixbufFormat`</doc> | |
| 5503 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 5504 | + | </instance-parameter> | |
| 5505 | + | </parameters> | |
| 5506 | + | </method> | |
| 5507 | + | <method name="get_name" | |
| 5508 | + | c:identifier="gdk_pixbuf_format_get_name" | |
| 5509 | + | version="2.2"> | |
| 5510 | + | <doc xml:space="preserve" | |
| 5511 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5512 | + | line="3231">Returns the name of the format.</doc> | |
| 5513 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="54"/> | |
| 5514 | + | <return-value transfer-ownership="full"> | |
| 5515 | + | <doc xml:space="preserve" | |
| 5516 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5517 | + | line="3237">the name of the format.</doc> | |
| 5518 | + | <type name="utf8" c:type="gchar*"/> | |
| 5519 | + | </return-value> | |
| 5520 | + | <parameters> | |
| 5521 | + | <instance-parameter name="format" transfer-ownership="none"> | |
| 5522 | + | <doc xml:space="preserve" | |
| 5523 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5524 | + | line="3233">a `GdkPixbufFormat`</doc> | |
| 5525 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 5526 | + | </instance-parameter> | |
| 5527 | + | </parameters> | |
| 5528 | + | </method> | |
| 5529 | + | <method name="is_disabled" | |
| 5530 | + | c:identifier="gdk_pixbuf_format_is_disabled" | |
| 5531 | + | version="2.6"> | |
| 5532 | + | <doc xml:space="preserve" | |
| 5533 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5534 | + | line="3353">Returns whether this image format is disabled. | |
| 5535 | + | ||
| 5536 | + | See gdk_pixbuf_format_set_disabled().</doc> | |
| 5537 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="69"/> | |
| 5538 | + | <return-value transfer-ownership="none"> | |
| 5539 | + | <doc xml:space="preserve" | |
| 5540 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5541 | + | line="3361">whether this image format is disabled.</doc> | |
| 5542 | + | <type name="gboolean" c:type="gboolean"/> | |
| 5543 | + | </return-value> | |
| 5544 | + | <parameters> | |
| 5545 | + | <instance-parameter name="format" transfer-ownership="none"> | |
| 5546 | + | <doc xml:space="preserve" | |
| 5547 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5548 | + | line="3355">a `GdkPixbufFormat`</doc> | |
| 5549 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 5550 | + | </instance-parameter> | |
| 5551 | + | </parameters> | |
| 5552 | + | </method> | |
| 5553 | + | <method name="is_save_option_supported" | |
| 5554 | + | c:identifier="gdk_pixbuf_format_is_save_option_supported" | |
| 5555 | + | version="2.36"> | |
| 5556 | + | <doc xml:space="preserve" | |
| 5557 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5558 | + | line="3488">Returns `TRUE` if the save option specified by @option_key is supported when | |
| 5559 | + | saving a pixbuf using the module implementing @format. | |
| 5560 | + | ||
| 5561 | + | See gdk_pixbuf_save() for more information about option keys.</doc> | |
| 5562 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="62"/> | |
| 5563 | + | <return-value transfer-ownership="none"> | |
| 5564 | + | <doc xml:space="preserve" | |
| 5565 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5566 | + | line="3498">`TRUE` if the specified option is supported</doc> | |
| 5567 | + | <type name="gboolean" c:type="gboolean"/> | |
| 5568 | + | </return-value> | |
| 5569 | + | <parameters> | |
| 5570 | + | <instance-parameter name="format" transfer-ownership="none"> | |
| 5571 | + | <doc xml:space="preserve" | |
| 5572 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5573 | + | line="3490">a pixbuf format</doc> | |
| 5574 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 5575 | + | </instance-parameter> | |
| 5576 | + | <parameter name="option_key" transfer-ownership="none"> | |
| 5577 | + | <doc xml:space="preserve" | |
| 5578 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5579 | + | line="3491">the name of an option</doc> | |
| 5580 | + | <type name="utf8" c:type="const gchar*"/> | |
| 5581 | + | </parameter> | |
| 5582 | + | </parameters> | |
| 5583 | + | </method> | |
| 5584 | + | <method name="is_scalable" | |
| 5585 | + | c:identifier="gdk_pixbuf_format_is_scalable" | |
| 5586 | + | version="2.6"> | |
| 5587 | + | <doc xml:space="preserve" | |
| 5588 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5589 | + | line="3331">Returns whether this image format is scalable. | |
| 5590 | + | ||
| 5591 | + | If a file is in a scalable format, it is preferable to load it at | |
| 5592 | + | the desired size, rather than loading it at the default size and | |
| 5593 | + | scaling the resulting pixbuf to the desired size.</doc> | |
| 5594 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="67"/> | |
| 5595 | + | <return-value transfer-ownership="none"> | |
| 5596 | + | <doc xml:space="preserve" | |
| 5597 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5598 | + | line="3341">whether this image format is scalable.</doc> | |
| 5599 | + | <type name="gboolean" c:type="gboolean"/> | |
| 5600 | + | </return-value> | |
| 5601 | + | <parameters> | |
| 5602 | + | <instance-parameter name="format" transfer-ownership="none"> | |
| 5603 | + | <doc xml:space="preserve" | |
| 5604 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5605 | + | line="3333">a `GdkPixbufFormat`</doc> | |
| 5606 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 5607 | + | </instance-parameter> | |
| 5608 | + | </parameters> | |
| 5609 | + | </method> | |
| 5610 | + | <method name="is_writable" | |
| 5611 | + | c:identifier="gdk_pixbuf_format_is_writable" | |
| 5612 | + | version="2.2"> | |
| 5613 | + | <doc xml:space="preserve" | |
| 5614 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5615 | + | line="3313">Returns whether pixbufs can be saved in the given format.</doc> | |
| 5616 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="65"/> | |
| 5617 | + | <return-value transfer-ownership="none"> | |
| 5618 | + | <doc xml:space="preserve" | |
| 5619 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5620 | + | line="3319">whether pixbufs can be saved in the given format.</doc> | |
| 5621 | + | <type name="gboolean" c:type="gboolean"/> | |
| 5622 | + | </return-value> | |
| 5623 | + | <parameters> | |
| 5624 | + | <instance-parameter name="format" transfer-ownership="none"> | |
| 5625 | + | <doc xml:space="preserve" | |
| 5626 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5627 | + | line="3315">a `GdkPixbufFormat`</doc> | |
| 5628 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 5629 | + | </instance-parameter> | |
| 5630 | + | </parameters> | |
| 5631 | + | </method> | |
| 5632 | + | <method name="set_disabled" | |
| 5633 | + | c:identifier="gdk_pixbuf_format_set_disabled" | |
| 5634 | + | version="2.6"> | |
| 5635 | + | <doc xml:space="preserve" | |
| 5636 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5637 | + | line="3373">Disables or enables an image format. | |
| 5638 | + | ||
| 5639 | + | If a format is disabled, GdkPixbuf won't use the image loader for | |
| 5640 | + | this format to load images. | |
| 5641 | + | ||
| 5642 | + | Applications can use this to avoid using image loaders with an | |
| 5643 | + | inappropriate license, see gdk_pixbuf_format_get_license().</doc> | |
| 5644 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="71"/> | |
| 5645 | + | <return-value transfer-ownership="none"> | |
| 5646 | + | <type name="none" c:type="void"/> | |
| 5647 | + | </return-value> | |
| 5648 | + | <parameters> | |
| 5649 | + | <instance-parameter name="format" transfer-ownership="none"> | |
| 5650 | + | <doc xml:space="preserve" | |
| 5651 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5652 | + | line="3375">a `GdkPixbufFormat`</doc> | |
| 5653 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 5654 | + | </instance-parameter> | |
| 5655 | + | <parameter name="disabled" transfer-ownership="none"> | |
| 5656 | + | <doc xml:space="preserve" | |
| 5657 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 5658 | + | line="3376">`TRUE` to disable the format @format</doc> | |
| 5659 | + | <type name="gboolean" c:type="gboolean"/> | |
| 5660 | + | </parameter> | |
| 5661 | + | </parameters> | |
| 5662 | + | </method> | |
| 5663 | + | </record> | |
| 5664 | + | <bitfield name="PixbufFormatFlags" | |
| 5665 | + | version="2.2" | |
| 5666 | + | c:type="GdkPixbufFormatFlags"> | |
| 5667 | + | <doc xml:space="preserve" | |
| 5668 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 5669 | + | line="424">Flags which allow a module to specify further details about the supported | |
| 5670 | + | operations.</doc> | |
| 5671 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="441"/> | |
| 5672 | + | <member name="writable" | |
| 5673 | + | value="1" | |
| 5674 | + | c:identifier="GDK_PIXBUF_FORMAT_WRITABLE"> | |
| 5675 | + | <doc xml:space="preserve" | |
| 5676 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 5677 | + | line="426">the module can write out images in the format.</doc> | |
| 5678 | + | </member> | |
| 5679 | + | <member name="scalable" | |
| 5680 | + | value="2" | |
| 5681 | + | c:identifier="GDK_PIXBUF_FORMAT_SCALABLE"> | |
| 5682 | + | <doc xml:space="preserve" | |
| 5683 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 5684 | + | line="427">the image format is scalable</doc> | |
| 5685 | + | </member> | |
| 5686 | + | <member name="threadsafe" | |
| 5687 | + | value="4" | |
| 5688 | + | c:identifier="GDK_PIXBUF_FORMAT_THREADSAFE"> | |
| 5689 | + | <doc xml:space="preserve" | |
| 5690 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 5691 | + | line="428">the module is threadsafe. gdk-pixbuf | |
| 5692 | + | ignores modules that are not marked as threadsafe. (Since 2.28).</doc> | |
| 5693 | + | </member> | |
| 5694 | + | </bitfield> | |
| 5695 | + | <class name="PixbufLoader" | |
| 5696 | + | c:symbol-prefix="pixbuf_loader" | |
| 5697 | + | c:type="GdkPixbufLoader" | |
| 5698 | + | parent="GObject.Object" | |
| 5699 | + | glib:type-name="GdkPixbufLoader" | |
| 5700 | + | glib:get-type="gdk_pixbuf_loader_get_type" | |
| 5701 | + | glib:type-struct="PixbufLoaderClass"> | |
| 5702 | + | <doc xml:space="preserve" | |
| 5703 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5704 | + | line="34">Incremental image loader. | |
| 5705 | + | ||
| 5706 | + | `GdkPixbufLoader` provides a way for applications to drive the | |
| 5707 | + | process of loading an image, by letting them send the image data | |
| 5708 | + | directly to the loader instead of having the loader read the data | |
| 5709 | + | from a file. Applications can use this functionality instead of | |
| 5710 | + | `gdk_pixbuf_new_from_file()` or `gdk_pixbuf_animation_new_from_file()` | |
| 5711 | + | when they need to parse image data in small chunks. For example, | |
| 5712 | + | it should be used when reading an image from a (potentially) slow | |
| 5713 | + | network connection, or when loading an extremely large file. | |
| 5714 | + | ||
| 5715 | + | To use `GdkPixbufLoader` to load an image, create a new instance, | |
| 5716 | + | and call [method@GdkPixbuf.PixbufLoader.write] to send the data | |
| 5717 | + | to it. When done, [method@GdkPixbuf.PixbufLoader.close] should be | |
| 5718 | + | called to end the stream and finalize everything. | |
| 5719 | + | ||
| 5720 | + | The loader will emit three important signals throughout the process: | |
| 5721 | + | ||
| 5722 | + | - [signal@GdkPixbuf.PixbufLoader::size-prepared] will be emitted as | |
| 5723 | + | soon as the image has enough information to determine the size of | |
| 5724 | + | the image to be used. If you want to scale the image while loading | |
| 5725 | + | it, you can call [method@GdkPixbuf.PixbufLoader.set_size] in | |
| 5726 | + | response to this signal. | |
| 5727 | + | - [signal@GdkPixbuf.PixbufLoader::area-prepared] will be emitted as | |
| 5728 | + | soon as the pixbuf of the desired has been allocated. You can obtain | |
| 5729 | + | the `GdkPixbuf` instance by calling [method@GdkPixbuf.PixbufLoader.get_pixbuf]. | |
| 5730 | + | If you want to use it, simply acquire a reference to it. You can | |
| 5731 | + | also call `gdk_pixbuf_loader_get_pixbuf()` later to get the same | |
| 5732 | + | pixbuf. | |
| 5733 | + | - [signal@GdkPixbuf.PixbufLoader::area-updated] will be emitted every | |
| 5734 | + | time a region is updated. This way you can update a partially | |
| 5735 | + | completed image. Note that you do not know anything about the | |
| 5736 | + | completeness of an image from the updated area. For example, in an | |
| 5737 | + | interlaced image you will need to make several passes before the | |
| 5738 | + | image is done loading. | |
| 5739 | + | ||
| 5740 | + | ## Loading an animation | |
| 5741 | + | ||
| 5742 | + | Loading an animation is almost as easy as loading an image. Once the | |
| 5743 | + | first [signal@GdkPixbuf.PixbufLoader::area-prepared] signal has been | |
| 5744 | + | emitted, you can call [method@GdkPixbuf.PixbufLoader.get_animation] to | |
| 5745 | + | get the [class@GdkPixbuf.PixbufAnimation] instance, and then call | |
| 5746 | + | and [method@GdkPixbuf.PixbufAnimation.get_iter] to get a | |
| 5747 | + | [class@GdkPixbuf.PixbufAnimationIter] to retrieve the pixbuf for the | |
| 5748 | + | desired time stamp.</doc> | |
| 5749 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" line="74"/> | |
| 5750 | + | <constructor name="new" c:identifier="gdk_pixbuf_loader_new"> | |
| 5751 | + | <doc xml:space="preserve" | |
| 5752 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5753 | + | line="596">Creates a new pixbuf loader object.</doc> | |
| 5754 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 5755 | + | line="79"/> | |
| 5756 | + | <return-value transfer-ownership="full"> | |
| 5757 | + | <doc xml:space="preserve" | |
| 5758 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5759 | + | line="601">A newly-created pixbuf loader.</doc> | |
| 5760 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 5761 | + | </return-value> | |
| 5762 | + | </constructor> | |
| 5763 | + | <constructor name="new_with_mime_type" | |
| 5764 | + | c:identifier="gdk_pixbuf_loader_new_with_mime_type" | |
| 5765 | + | version="2.4" | |
| 5766 | + | throws="1"> | |
| 5767 | + | <doc xml:space="preserve" | |
| 5768 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5769 | + | line="654">Creates a new pixbuf loader object that always attempts to parse | |
| 5770 | + | image data as if it were an image of MIME type @mime_type, instead of | |
| 5771 | + | identifying the type automatically. | |
| 5772 | + | ||
| 5773 | + | This function is useful if you want an error if the image isn't the | |
| 5774 | + | expected MIME type; for loading image formats that can't be reliably | |
| 5775 | + | identified by looking at the data; or if the user manually forces a | |
| 5776 | + | specific MIME type. | |
| 5777 | + | ||
| 5778 | + | The list of supported mime types depends on what image loaders | |
| 5779 | + | are installed, but typically "image/png", "image/jpeg", "image/gif", | |
| 5780 | + | "image/tiff" and "image/x-xpixmap" are among the supported mime types. | |
| 5781 | + | To obtain the full list of supported mime types, call | |
| 5782 | + | gdk_pixbuf_format_get_mime_types() on each of the #GdkPixbufFormat | |
| 5783 | + | structs returned by gdk_pixbuf_get_formats().</doc> | |
| 5784 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 5785 | + | line="84"/> | |
| 5786 | + | <return-value transfer-ownership="full"> | |
| 5787 | + | <doc xml:space="preserve" | |
| 5788 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5789 | + | line="675">A newly-created pixbuf loader.</doc> | |
| 5790 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 5791 | + | </return-value> | |
| 5792 | + | <parameters> | |
| 5793 | + | <parameter name="mime_type" transfer-ownership="none"> | |
| 5794 | + | <doc xml:space="preserve" | |
| 5795 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5796 | + | line="656">the mime type to be loaded</doc> | |
| 5797 | + | <type name="utf8" c:type="const char*"/> | |
| 5798 | + | </parameter> | |
| 5799 | + | </parameters> | |
| 5800 | + | </constructor> | |
| 5801 | + | <constructor name="new_with_type" | |
| 5802 | + | c:identifier="gdk_pixbuf_loader_new_with_type" | |
| 5803 | + | throws="1"> | |
| 5804 | + | <doc xml:space="preserve" | |
| 5805 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5806 | + | line="609">Creates a new pixbuf loader object that always attempts to parse | |
| 5807 | + | image data as if it were an image of type @image_type, instead of | |
| 5808 | + | identifying the type automatically. | |
| 5809 | + | ||
| 5810 | + | This function is useful if you want an error if the image isn't the | |
| 5811 | + | expected type; for loading image formats that can't be reliably | |
| 5812 | + | identified by looking at the data; or if the user manually forces | |
| 5813 | + | a specific type. | |
| 5814 | + | ||
| 5815 | + | The list of supported image formats depends on what image loaders | |
| 5816 | + | are installed, but typically "png", "jpeg", "gif", "tiff" and | |
| 5817 | + | "xpm" are among the supported formats. To obtain the full list of | |
| 5818 | + | supported image formats, call gdk_pixbuf_format_get_name() on each | |
| 5819 | + | of the #GdkPixbufFormat structs returned by gdk_pixbuf_get_formats().</doc> | |
| 5820 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 5821 | + | line="81"/> | |
| 5822 | + | <return-value transfer-ownership="full"> | |
| 5823 | + | <doc xml:space="preserve" | |
| 5824 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5825 | + | line="629">A newly-created pixbuf loader.</doc> | |
| 5826 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 5827 | + | </return-value> | |
| 5828 | + | <parameters> | |
| 5829 | + | <parameter name="image_type" transfer-ownership="none"> | |
| 5830 | + | <doc xml:space="preserve" | |
| 5831 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5832 | + | line="611">name of the image format to be loaded with the image</doc> | |
| 5833 | + | <type name="utf8" c:type="const char*"/> | |
| 5834 | + | </parameter> | |
| 5835 | + | </parameters> | |
| 5836 | + | </constructor> | |
| 5837 | + | <virtual-method name="area_prepared"> | |
| 5838 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 5839 | + | line="64"/> | |
| 5840 | + | <return-value transfer-ownership="none"> | |
| 5841 | + | <type name="none" c:type="void"/> | |
| 5842 | + | </return-value> | |
| 5843 | + | <parameters> | |
| 5844 | + | <instance-parameter name="loader" transfer-ownership="none"> | |
| 5845 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 5846 | + | </instance-parameter> | |
| 5847 | + | </parameters> | |
| 5848 | + | </virtual-method> | |
| 5849 | + | <virtual-method name="area_updated"> | |
| 5850 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 5851 | + | line="67"/> | |
| 5852 | + | <return-value transfer-ownership="none"> | |
| 5853 | + | <type name="none" c:type="void"/> | |
| 5854 | + | </return-value> | |
| 5855 | + | <parameters> | |
| 5856 | + | <instance-parameter name="loader" transfer-ownership="none"> | |
| 5857 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 5858 | + | </instance-parameter> | |
| 5859 | + | <parameter name="x" transfer-ownership="none"> | |
| 5860 | + | <type name="gint" c:type="int"/> | |
| 5861 | + | </parameter> | |
| 5862 | + | <parameter name="y" transfer-ownership="none"> | |
| 5863 | + | <type name="gint" c:type="int"/> | |
| 5864 | + | </parameter> | |
| 5865 | + | <parameter name="width" transfer-ownership="none"> | |
| 5866 | + | <type name="gint" c:type="int"/> | |
| 5867 | + | </parameter> | |
| 5868 | + | <parameter name="height" transfer-ownership="none"> | |
| 5869 | + | <type name="gint" c:type="int"/> | |
| 5870 | + | </parameter> | |
| 5871 | + | </parameters> | |
| 5872 | + | </virtual-method> | |
| 5873 | + | <virtual-method name="closed"> | |
| 5874 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 5875 | + | line="73"/> | |
| 5876 | + | <return-value transfer-ownership="none"> | |
| 5877 | + | <type name="none" c:type="void"/> | |
| 5878 | + | </return-value> | |
| 5879 | + | <parameters> | |
| 5880 | + | <instance-parameter name="loader" transfer-ownership="none"> | |
| 5881 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 5882 | + | </instance-parameter> | |
| 5883 | + | </parameters> | |
| 5884 | + | </virtual-method> | |
| 5885 | + | <virtual-method name="size_prepared"> | |
| 5886 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 5887 | + | line="60"/> | |
| 5888 | + | <return-value transfer-ownership="none"> | |
| 5889 | + | <type name="none" c:type="void"/> | |
| 5890 | + | </return-value> | |
| 5891 | + | <parameters> | |
| 5892 | + | <instance-parameter name="loader" transfer-ownership="none"> | |
| 5893 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 5894 | + | </instance-parameter> | |
| 5895 | + | <parameter name="width" transfer-ownership="none"> | |
| 5896 | + | <type name="gint" c:type="int"/> | |
| 5897 | + | </parameter> | |
| 5898 | + | <parameter name="height" transfer-ownership="none"> | |
| 5899 | + | <type name="gint" c:type="int"/> | |
| 5900 | + | </parameter> | |
| 5901 | + | </parameters> | |
| 5902 | + | </virtual-method> | |
| 5903 | + | <method name="close" c:identifier="gdk_pixbuf_loader_close" throws="1"> | |
| 5904 | + | <doc xml:space="preserve" | |
| 5905 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5906 | + | line="803">Informs a pixbuf loader that no further writes with | |
| 5907 | + | gdk_pixbuf_loader_write() will occur, so that it can free its | |
| 5908 | + | internal loading structures. | |
| 5909 | + | ||
| 5910 | + | This function also tries to parse any data that hasn't yet been parsed; | |
| 5911 | + | if the remaining data is partial or corrupt, an error will be returned. | |
| 5912 | + | ||
| 5913 | + | If `FALSE` is returned, `error` will be set to an error from the | |
| 5914 | + | `GDK_PIXBUF_ERROR` or `G_FILE_ERROR` domains. | |
| 5915 | + | ||
| 5916 | + | If you're just cancelling a load rather than expecting it to be finished, | |
| 5917 | + | passing `NULL` for `error` to ignore it is reasonable. | |
| 5918 | + | ||
| 5919 | + | Remember that this function does not release a reference on the loader, so | |
| 5920 | + | you will need to explicitly release any reference you hold.</doc> | |
| 5921 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 5922 | + | line="104"/> | |
| 5923 | + | <return-value transfer-ownership="none"> | |
| 5924 | + | <doc xml:space="preserve" | |
| 5925 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5926 | + | line="824">`TRUE` if all image data written so far was successfully | |
| 5927 | + | passed out via the update_area signal</doc> | |
| 5928 | + | <type name="gboolean" c:type="gboolean"/> | |
| 5929 | + | </return-value> | |
| 5930 | + | <parameters> | |
| 5931 | + | <instance-parameter name="loader" transfer-ownership="none"> | |
| 5932 | + | <doc xml:space="preserve" | |
| 5933 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5934 | + | line="805">A pixbuf loader.</doc> | |
| 5935 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 5936 | + | </instance-parameter> | |
| 5937 | + | </parameters> | |
| 5938 | + | </method> | |
| 5939 | + | <method name="get_animation" | |
| 5940 | + | c:identifier="gdk_pixbuf_loader_get_animation"> | |
| 5941 | + | <doc xml:space="preserve" | |
| 5942 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5943 | + | line="775">Queries the #GdkPixbufAnimation that a pixbuf loader is currently creating. | |
| 5944 | + | ||
| 5945 | + | In general it only makes sense to call this function after the | |
| 5946 | + | [signal@GdkPixbuf.PixbufLoader::area-prepared] signal has been emitted by | |
| 5947 | + | the loader. | |
| 5948 | + | ||
| 5949 | + | If the loader doesn't have enough bytes yet, and hasn't emitted the `area-prepared` | |
| 5950 | + | signal, this function will return `NULL`.</doc> | |
| 5951 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 5952 | + | line="102"/> | |
| 5953 | + | <return-value transfer-ownership="none" nullable="1"> | |
| 5954 | + | <doc xml:space="preserve" | |
| 5955 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5956 | + | line="788">The animation that the loader is | |
| 5957 | + | currently loading</doc> | |
| 5958 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 5959 | + | </return-value> | |
| 5960 | + | <parameters> | |
| 5961 | + | <instance-parameter name="loader" transfer-ownership="none"> | |
| 5962 | + | <doc xml:space="preserve" | |
| 5963 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5964 | + | line="777">A pixbuf loader</doc> | |
| 5965 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 5966 | + | </instance-parameter> | |
| 5967 | + | </parameters> | |
| 5968 | + | </method> | |
| 5969 | + | <method name="get_format" | |
| 5970 | + | c:identifier="gdk_pixbuf_loader_get_format" | |
| 5971 | + | version="2.2"> | |
| 5972 | + | <doc xml:space="preserve" | |
| 5973 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5974 | + | line="891">Obtains the available information about the format of the | |
| 5975 | + | currently loading image file.</doc> | |
| 5976 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 5977 | + | line="107"/> | |
| 5978 | + | <return-value transfer-ownership="none" nullable="1"> | |
| 5979 | + | <doc xml:space="preserve" | |
| 5980 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5981 | + | line="898">A #GdkPixbufFormat</doc> | |
| 5982 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 5983 | + | </return-value> | |
| 5984 | + | <parameters> | |
| 5985 | + | <instance-parameter name="loader" transfer-ownership="none"> | |
| 5986 | + | <doc xml:space="preserve" | |
| 5987 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5988 | + | line="893">A pixbuf loader.</doc> | |
| 5989 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 5990 | + | </instance-parameter> | |
| 5991 | + | </parameters> | |
| 5992 | + | </method> | |
| 5993 | + | <method name="get_pixbuf" c:identifier="gdk_pixbuf_loader_get_pixbuf"> | |
| 5994 | + | <doc xml:space="preserve" | |
| 5995 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 5996 | + | line="737">Queries the #GdkPixbuf that a pixbuf loader is currently creating. | |
| 5997 | + | ||
| 5998 | + | In general it only makes sense to call this function after the | |
| 5999 | + | [signal@GdkPixbuf.PixbufLoader::area-prepared] signal has been | |
| 6000 | + | emitted by the loader; this means that enough data has been read | |
| 6001 | + | to know the size of the image that will be allocated. | |
| 6002 | + | ||
| 6003 | + | If the loader has not received enough data via gdk_pixbuf_loader_write(), | |
| 6004 | + | then this function returns `NULL`. | |
| 6005 | + | ||
| 6006 | + | The returned pixbuf will be the same in all future calls to the loader, | |
| 6007 | + | so if you want to keep using it, you should acquire a reference to it. | |
| 6008 | + | ||
| 6009 | + | Additionally, if the loader is an animation, it will return the "static | |
| 6010 | + | image" of the animation (see gdk_pixbuf_animation_get_static_image()).</doc> | |
| 6011 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 6012 | + | line="100"/> | |
| 6013 | + | <return-value transfer-ownership="none" nullable="1"> | |
| 6014 | + | <doc xml:space="preserve" | |
| 6015 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6016 | + | line="757">The pixbuf that the loader is | |
| 6017 | + | creating</doc> | |
| 6018 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 6019 | + | </return-value> | |
| 6020 | + | <parameters> | |
| 6021 | + | <instance-parameter name="loader" transfer-ownership="none"> | |
| 6022 | + | <doc xml:space="preserve" | |
| 6023 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6024 | + | line="739">A pixbuf loader.</doc> | |
| 6025 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 6026 | + | </instance-parameter> | |
| 6027 | + | </parameters> | |
| 6028 | + | </method> | |
| 6029 | + | <method name="set_size" | |
| 6030 | + | c:identifier="gdk_pixbuf_loader_set_size" | |
| 6031 | + | version="2.2"> | |
| 6032 | + | <doc xml:space="preserve" | |
| 6033 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6034 | + | line="260">Causes the image to be scaled while it is loaded. | |
| 6035 | + | ||
| 6036 | + | The desired image size can be determined relative to the original | |
| 6037 | + | size of the image by calling gdk_pixbuf_loader_set_size() from a | |
| 6038 | + | signal handler for the ::size-prepared signal. | |
| 6039 | + | ||
| 6040 | + | Attempts to set the desired image size are ignored after the | |
| 6041 | + | emission of the ::size-prepared signal.</doc> | |
| 6042 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 6043 | + | line="87"/> | |
| 6044 | + | <return-value transfer-ownership="none"> | |
| 6045 | + | <type name="none" c:type="void"/> | |
| 6046 | + | </return-value> | |
| 6047 | + | <parameters> | |
| 6048 | + | <instance-parameter name="loader" transfer-ownership="none"> | |
| 6049 | + | <doc xml:space="preserve" | |
| 6050 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6051 | + | line="262">A pixbuf loader.</doc> | |
| 6052 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 6053 | + | </instance-parameter> | |
| 6054 | + | <parameter name="width" transfer-ownership="none"> | |
| 6055 | + | <doc xml:space="preserve" | |
| 6056 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6057 | + | line="263">The desired width of the image being loaded.</doc> | |
| 6058 | + | <type name="gint" c:type="int"/> | |
| 6059 | + | </parameter> | |
| 6060 | + | <parameter name="height" transfer-ownership="none"> | |
| 6061 | + | <doc xml:space="preserve" | |
| 6062 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6063 | + | line="264">The desired height of the image being loaded.</doc> | |
| 6064 | + | <type name="gint" c:type="int"/> | |
| 6065 | + | </parameter> | |
| 6066 | + | </parameters> | |
| 6067 | + | </method> | |
| 6068 | + | <method name="write" c:identifier="gdk_pixbuf_loader_write" throws="1"> | |
| 6069 | + | <doc xml:space="preserve" | |
| 6070 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6071 | + | line="506">Parses the next `count` bytes in the given image buffer.</doc> | |
| 6072 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 6073 | + | line="91"/> | |
| 6074 | + | <return-value transfer-ownership="none"> | |
| 6075 | + | <doc xml:space="preserve" | |
| 6076 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6077 | + | line="515">`TRUE` if the write was successful, or | |
| 6078 | + | `FALSE` if the loader cannot parse the buffer</doc> | |
| 6079 | + | <type name="gboolean" c:type="gboolean"/> | |
| 6080 | + | </return-value> | |
| 6081 | + | <parameters> | |
| 6082 | + | <instance-parameter name="loader" transfer-ownership="none"> | |
| 6083 | + | <doc xml:space="preserve" | |
| 6084 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6085 | + | line="508">A pixbuf loader.</doc> | |
| 6086 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 6087 | + | </instance-parameter> | |
| 6088 | + | <parameter name="buf" transfer-ownership="none"> | |
| 6089 | + | <doc xml:space="preserve" | |
| 6090 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6091 | + | line="509">Pointer to image data.</doc> | |
| 6092 | + | <array length="1" zero-terminated="0" c:type="const guchar*"> | |
| 6093 | + | <type name="guint8" c:type="guchar"/> | |
| 6094 | + | </array> | |
| 6095 | + | </parameter> | |
| 6096 | + | <parameter name="count" transfer-ownership="none"> | |
| 6097 | + | <doc xml:space="preserve" | |
| 6098 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6099 | + | line="510">Length of the @buf buffer in bytes.</doc> | |
| 6100 | + | <type name="gsize" c:type="gsize"/> | |
| 6101 | + | </parameter> | |
| 6102 | + | </parameters> | |
| 6103 | + | </method> | |
| 6104 | + | <method name="write_bytes" | |
| 6105 | + | c:identifier="gdk_pixbuf_loader_write_bytes" | |
| 6106 | + | version="2.30" | |
| 6107 | + | throws="1"> | |
| 6108 | + | <doc xml:space="preserve" | |
| 6109 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6110 | + | line="567">Parses the next contents of the given image buffer.</doc> | |
| 6111 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 6112 | + | line="96"/> | |
| 6113 | + | <return-value transfer-ownership="none"> | |
| 6114 | + | <doc xml:space="preserve" | |
| 6115 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6116 | + | line="575">`TRUE` if the write was successful, or `FALSE` if | |
| 6117 | + | the loader cannot parse the buffer</doc> | |
| 6118 | + | <type name="gboolean" c:type="gboolean"/> | |
| 6119 | + | </return-value> | |
| 6120 | + | <parameters> | |
| 6121 | + | <instance-parameter name="loader" transfer-ownership="none"> | |
| 6122 | + | <doc xml:space="preserve" | |
| 6123 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6124 | + | line="569">A pixbuf loader.</doc> | |
| 6125 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 6126 | + | </instance-parameter> | |
| 6127 | + | <parameter name="buffer" transfer-ownership="none"> | |
| 6128 | + | <doc xml:space="preserve" | |
| 6129 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6130 | + | line="570">The image data as a `GBytes` buffer.</doc> | |
| 6131 | + | <type name="GLib.Bytes" c:type="GBytes*"/> | |
| 6132 | + | </parameter> | |
| 6133 | + | </parameters> | |
| 6134 | + | </method> | |
| 6135 | + | <field name="parent_instance" readable="0" private="1"> | |
| 6136 | + | <type name="GObject.Object" c:type="GObject"/> | |
| 6137 | + | </field> | |
| 6138 | + | <field name="priv" readable="0" private="1"> | |
| 6139 | + | <type name="gpointer" c:type="gpointer"/> | |
| 6140 | + | </field> | |
| 6141 | + | <glib:signal name="area-prepared" when="last"> | |
| 6142 | + | <doc xml:space="preserve" | |
| 6143 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6144 | + | line="154">This signal is emitted when the pixbuf loader has allocated the | |
| 6145 | + | pixbuf in the desired size. | |
| 6146 | + | ||
| 6147 | + | After this signal is emitted, applications can call | |
| 6148 | + | gdk_pixbuf_loader_get_pixbuf() to fetch the partially-loaded | |
| 6149 | + | pixbuf.</doc> | |
| 6150 | + | <return-value transfer-ownership="none"> | |
| 6151 | + | <type name="none" c:type="void"/> | |
| 6152 | + | </return-value> | |
| 6153 | + | </glib:signal> | |
| 6154 | + | <glib:signal name="area-updated" when="last"> | |
| 6155 | + | <doc xml:space="preserve" | |
| 6156 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6157 | + | line="174">This signal is emitted when a significant area of the image being | |
| 6158 | + | loaded has been updated. | |
| 6159 | + | ||
| 6160 | + | Normally it means that a complete scanline has been read in, but | |
| 6161 | + | it could be a different area as well. | |
| 6162 | + | ||
| 6163 | + | Applications can use this signal to know when to repaint | |
| 6164 | + | areas of an image that is being loaded.</doc> | |
| 6165 | + | <return-value transfer-ownership="none"> | |
| 6166 | + | <type name="none" c:type="void"/> | |
| 6167 | + | </return-value> | |
| 6168 | + | <parameters> | |
| 6169 | + | <parameter name="x" transfer-ownership="none"> | |
| 6170 | + | <doc xml:space="preserve" | |
| 6171 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6172 | + | line="177">X offset of upper-left corner of the updated area.</doc> | |
| 6173 | + | <type name="gint" c:type="gint"/> | |
| 6174 | + | </parameter> | |
| 6175 | + | <parameter name="y" transfer-ownership="none"> | |
| 6176 | + | <doc xml:space="preserve" | |
| 6177 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6178 | + | line="178">Y offset of upper-left corner of the updated area.</doc> | |
| 6179 | + | <type name="gint" c:type="gint"/> | |
| 6180 | + | </parameter> | |
| 6181 | + | <parameter name="width" transfer-ownership="none"> | |
| 6182 | + | <doc xml:space="preserve" | |
| 6183 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6184 | + | line="179">Width of updated area.</doc> | |
| 6185 | + | <type name="gint" c:type="gint"/> | |
| 6186 | + | </parameter> | |
| 6187 | + | <parameter name="height" transfer-ownership="none"> | |
| 6188 | + | <doc xml:space="preserve" | |
| 6189 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6190 | + | line="180">Height of updated area.</doc> | |
| 6191 | + | <type name="gint" c:type="gint"/> | |
| 6192 | + | </parameter> | |
| 6193 | + | </parameters> | |
| 6194 | + | </glib:signal> | |
| 6195 | + | <glib:signal name="closed" when="last"> | |
| 6196 | + | <doc xml:space="preserve" | |
| 6197 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6198 | + | line="204">This signal is emitted when gdk_pixbuf_loader_close() is called. | |
| 6199 | + | ||
| 6200 | + | It can be used by different parts of an application to receive | |
| 6201 | + | notification when an image loader is closed by the code that | |
| 6202 | + | drives it.</doc> | |
| 6203 | + | <return-value transfer-ownership="none"> | |
| 6204 | + | <type name="none" c:type="void"/> | |
| 6205 | + | </return-value> | |
| 6206 | + | </glib:signal> | |
| 6207 | + | <glib:signal name="size-prepared" when="last"> | |
| 6208 | + | <doc xml:space="preserve" | |
| 6209 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6210 | + | line="129">This signal is emitted when the pixbuf loader has been fed the | |
| 6211 | + | initial amount of data that is required to figure out the size | |
| 6212 | + | of the image that it will create. | |
| 6213 | + | ||
| 6214 | + | Applications can call gdk_pixbuf_loader_set_size() in response | |
| 6215 | + | to this signal to set the desired size to which the image | |
| 6216 | + | should be scaled.</doc> | |
| 6217 | + | <return-value transfer-ownership="none"> | |
| 6218 | + | <type name="none" c:type="void"/> | |
| 6219 | + | </return-value> | |
| 6220 | + | <parameters> | |
| 6221 | + | <parameter name="width" transfer-ownership="none"> | |
| 6222 | + | <doc xml:space="preserve" | |
| 6223 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6224 | + | line="132">the original width of the image</doc> | |
| 6225 | + | <type name="gint" c:type="gint"/> | |
| 6226 | + | </parameter> | |
| 6227 | + | <parameter name="height" transfer-ownership="none"> | |
| 6228 | + | <doc xml:space="preserve" | |
| 6229 | + | filename="../gdk-pixbuf/gdk-pixbuf-loader.c" | |
| 6230 | + | line="133">the original height of the image</doc> | |
| 6231 | + | <type name="gint" c:type="gint"/> | |
| 6232 | + | </parameter> | |
| 6233 | + | </parameters> | |
| 6234 | + | </glib:signal> | |
| 6235 | + | </class> | |
| 6236 | + | <record name="PixbufLoaderClass" | |
| 6237 | + | c:type="GdkPixbufLoaderClass" | |
| 6238 | + | glib:is-gtype-struct-for="PixbufLoader"> | |
| 6239 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" line="74"/> | |
| 6240 | + | <field name="parent_class"> | |
| 6241 | + | <type name="GObject.ObjectClass" c:type="GObjectClass"/> | |
| 6242 | + | </field> | |
| 6243 | + | <field name="size_prepared"> | |
| 6244 | + | <callback name="size_prepared"> | |
| 6245 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 6246 | + | line="60"/> | |
| 6247 | + | <return-value transfer-ownership="none"> | |
| 6248 | + | <type name="none" c:type="void"/> | |
| 6249 | + | </return-value> | |
| 6250 | + | <parameters> | |
| 6251 | + | <parameter name="loader" transfer-ownership="none"> | |
| 6252 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 6253 | + | </parameter> | |
| 6254 | + | <parameter name="width" transfer-ownership="none"> | |
| 6255 | + | <type name="gint" c:type="int"/> | |
| 6256 | + | </parameter> | |
| 6257 | + | <parameter name="height" transfer-ownership="none"> | |
| 6258 | + | <type name="gint" c:type="int"/> | |
| 6259 | + | </parameter> | |
| 6260 | + | </parameters> | |
| 6261 | + | </callback> | |
| 6262 | + | </field> | |
| 6263 | + | <field name="area_prepared"> | |
| 6264 | + | <callback name="area_prepared"> | |
| 6265 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 6266 | + | line="64"/> | |
| 6267 | + | <return-value transfer-ownership="none"> | |
| 6268 | + | <type name="none" c:type="void"/> | |
| 6269 | + | </return-value> | |
| 6270 | + | <parameters> | |
| 6271 | + | <parameter name="loader" transfer-ownership="none"> | |
| 6272 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 6273 | + | </parameter> | |
| 6274 | + | </parameters> | |
| 6275 | + | </callback> | |
| 6276 | + | </field> | |
| 6277 | + | <field name="area_updated"> | |
| 6278 | + | <callback name="area_updated"> | |
| 6279 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 6280 | + | line="67"/> | |
| 6281 | + | <return-value transfer-ownership="none"> | |
| 6282 | + | <type name="none" c:type="void"/> | |
| 6283 | + | </return-value> | |
| 6284 | + | <parameters> | |
| 6285 | + | <parameter name="loader" transfer-ownership="none"> | |
| 6286 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 6287 | + | </parameter> | |
| 6288 | + | <parameter name="x" transfer-ownership="none"> | |
| 6289 | + | <type name="gint" c:type="int"/> | |
| 6290 | + | </parameter> | |
| 6291 | + | <parameter name="y" transfer-ownership="none"> | |
| 6292 | + | <type name="gint" c:type="int"/> | |
| 6293 | + | </parameter> | |
| 6294 | + | <parameter name="width" transfer-ownership="none"> | |
| 6295 | + | <type name="gint" c:type="int"/> | |
| 6296 | + | </parameter> | |
| 6297 | + | <parameter name="height" transfer-ownership="none"> | |
| 6298 | + | <type name="gint" c:type="int"/> | |
| 6299 | + | </parameter> | |
| 6300 | + | </parameters> | |
| 6301 | + | </callback> | |
| 6302 | + | </field> | |
| 6303 | + | <field name="closed"> | |
| 6304 | + | <callback name="closed"> | |
| 6305 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-loader.h" | |
| 6306 | + | line="73"/> | |
| 6307 | + | <return-value transfer-ownership="none"> | |
| 6308 | + | <type name="none" c:type="void"/> | |
| 6309 | + | </return-value> | |
| 6310 | + | <parameters> | |
| 6311 | + | <parameter name="loader" transfer-ownership="none"> | |
| 6312 | + | <type name="PixbufLoader" c:type="GdkPixbufLoader*"/> | |
| 6313 | + | </parameter> | |
| 6314 | + | </parameters> | |
| 6315 | + | </callback> | |
| 6316 | + | </field> | |
| 6317 | + | </record> | |
| 6318 | + | <record name="PixbufModule" c:type="GdkPixbufModule"> | |
| 6319 | + | <doc xml:space="preserve" | |
| 6320 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 6321 | + | line="50">A `GdkPixbufModule` contains the necessary functions to load and save | |
| 6322 | + | images in a certain file format. | |
| 6323 | + | ||
| 6324 | + | If `GdkPixbuf` has been compiled with `GModule` support, it can be extended | |
| 6325 | + | by modules which can load (and perhaps also save) new image and animation | |
| 6326 | + | formats. | |
| 6327 | + | ||
| 6328 | + | ## Implementing modules | |
| 6329 | + | ||
| 6330 | + | The `GdkPixbuf` interfaces needed for implementing modules are contained in | |
| 6331 | + | `gdk-pixbuf-io.h` (and `gdk-pixbuf-animation.h` if the module supports | |
| 6332 | + | animations). They are not covered by the same stability guarantees as the | |
| 6333 | + | regular GdkPixbuf API. To underline this fact, they are protected by the | |
| 6334 | + | `GDK_PIXBUF_ENABLE_BACKEND` pre-processor symbol. | |
| 6335 | + | ||
| 6336 | + | Each loadable module must contain a `GdkPixbufModuleFillVtableFunc` function | |
| 6337 | + | named `fill_vtable`, which will get called when the module | |
| 6338 | + | is loaded and must set the function pointers of the `GdkPixbufModule`. | |
| 6339 | + | ||
| 6340 | + | In order to make format-checking work before actually loading the modules | |
| 6341 | + | (which may require calling `dlopen` to load image libraries), modules export | |
| 6342 | + | their signatures (and other information) via the `fill_info` function. An | |
| 6343 | + | external utility, `gdk-pixbuf-query-loaders`, uses this to create a text | |
| 6344 | + | file containing a list of all available loaders and their signatures. | |
| 6345 | + | This file is then read at runtime by `GdkPixbuf` to obtain the list of | |
| 6346 | + | available loaders and their signatures. | |
| 6347 | + | ||
| 6348 | + | Modules may only implement a subset of the functionality available via | |
| 6349 | + | `GdkPixbufModule`. If a particular functionality is not implemented, the | |
| 6350 | + | `fill_vtable` function will simply not set the corresponding | |
| 6351 | + | function pointers of the `GdkPixbufModule` structure. If a module supports | |
| 6352 | + | incremental loading (i.e. provides `begin_load`, `stop_load` and | |
| 6353 | + | `load_increment`), it doesn't have to implement `load`, since `GdkPixbuf` | |
| 6354 | + | can supply a generic `load` implementation wrapping the incremental loading. | |
| 6355 | + | ||
| 6356 | + | ## Installing modules | |
| 6357 | + | ||
| 6358 | + | Installing a module is a two-step process: | |
| 6359 | + | ||
| 6360 | + | - copy the module file(s) to the loader directory (normally | |
| 6361 | + | `$libdir/gdk-pixbuf-2.0/$version/loaders`, unless overridden by the | |
| 6362 | + | environment variable `GDK_PIXBUF_MODULEDIR`) | |
| 6363 | + | - call `gdk-pixbuf-query-loaders` to update the module file (normally | |
| 6364 | + | `$libdir/gdk-pixbuf-2.0/$version/loaders.cache`, unless overridden | |
| 6365 | + | by the environment variable `GDK_PIXBUF_MODULE_FILE`)</doc> | |
| 6366 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="400"/> | |
| 6367 | + | <field name="module_name" writable="1"> | |
| 6368 | + | <doc xml:space="preserve" | |
| 6369 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 6370 | + | line="52">the name of the module, usually the same as the | |
| 6371 | + | usual file extension for images of this type, eg. "xpm", "jpeg" or "png".</doc> | |
| 6372 | + | <type name="utf8" c:type="char*"/> | |
| 6373 | + | </field> | |
| 6374 | + | <field name="module_path" writable="1"> | |
| 6375 | + | <doc xml:space="preserve" | |
| 6376 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 6377 | + | line="54">the path from which the module is loaded.</doc> | |
| 6378 | + | <type name="utf8" c:type="char*"/> | |
| 6379 | + | </field> | |
| 6380 | + | <field name="module" writable="1"> | |
| 6381 | + | <doc xml:space="preserve" | |
| 6382 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 6383 | + | line="55">the loaded `GModule`.</doc> | |
| 6384 | + | <type name="GModule.Module" c:type="GModule*"/> | |
| 6385 | + | </field> | |
| 6386 | + | <field name="info" writable="1"> | |
| 6387 | + | <doc xml:space="preserve" | |
| 6388 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 6389 | + | line="56">a `GdkPixbufFormat` holding information about the module.</doc> | |
| 6390 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 6391 | + | </field> | |
| 6392 | + | <field name="load" writable="1"> | |
| 6393 | + | <doc xml:space="preserve" | |
| 6394 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 6395 | + | line="57">loads an image from a file.</doc> | |
| 6396 | + | <type name="PixbufModuleLoadFunc" c:type="GdkPixbufModuleLoadFunc"/> | |
| 6397 | + | </field> | |
| 6398 | + | <field name="load_xpm_data" writable="1"> | |
| 6399 | + | <doc xml:space="preserve" | |
| 6400 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 6401 | + | line="58">loads an image from data in memory.</doc> | |
| 6402 | + | <type name="PixbufModuleLoadXpmDataFunc" | |
| 6403 | + | c:type="GdkPixbufModuleLoadXpmDataFunc"/> | |
| 6404 | + | </field> | |
| 6405 | + | <field name="begin_load" introspectable="0" writable="1"> | |
| 6406 | + | <doc xml:space="preserve" | |
| 6407 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 6408 | + | line="59">begins an incremental load.</doc> | |
| 6409 | + | <type name="PixbufModuleBeginLoadFunc" | |
| 6410 | + | c:type="GdkPixbufModuleBeginLoadFunc"/> | |
| 6411 | + | </field> | |
| 6412 | + | <field name="stop_load" writable="1"> | |
| 6413 | + | <doc xml:space="preserve" | |
| 6414 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 6415 | + | line="60">stops an incremental load.</doc> | |
| 6416 | + | <type name="PixbufModuleStopLoadFunc" | |
| 6417 | + | c:type="GdkPixbufModuleStopLoadFunc"/> | |
| 6418 | + | </field> | |
| 6419 | + | <field name="load_increment" writable="1"> | |
| 6420 | + | <doc xml:space="preserve" | |
| 6421 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 6422 | + | line="61">continues an incremental load.</doc> | |
| 6423 | + | <type name="PixbufModuleIncrementLoadFunc" | |
| 6424 | + | c:type="GdkPixbufModuleIncrementLoadFunc"/> | |
| 6425 | + | </field> | |
| 6426 | + | <field name="load_animation" writable="1"> | |
| 6427 | + | <doc xml:space="preserve" | |
| 6428 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 6429 | + | line="62">loads an animation from a file.</doc> | |
| 6430 | + | <type name="PixbufModuleLoadAnimationFunc" | |
| 6431 | + | c:type="GdkPixbufModuleLoadAnimationFunc"/> | |
| 6432 | + | </field> | |
| 6433 | + | <field name="save" writable="1"> | |
| 6434 | + | <doc xml:space="preserve" | |
| 6435 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 6436 | + | line="63">saves a `GdkPixbuf` to a file.</doc> | |
| 6437 | + | <type name="PixbufModuleSaveFunc" c:type="GdkPixbufModuleSaveFunc"/> | |
| 6438 | + | </field> | |
| 6439 | + | <field name="save_to_callback" introspectable="0" writable="1"> | |
| 6440 | + | <doc xml:space="preserve" | |
| 6441 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 6442 | + | line="64">saves a `GdkPixbuf` by calling the given `GdkPixbufSaveFunc`.</doc> | |
| 6443 | + | <type name="PixbufModuleSaveCallbackFunc" | |
| 6444 | + | c:type="GdkPixbufModuleSaveCallbackFunc"/> | |
| 6445 | + | </field> | |
| 6446 | + | <field name="is_save_option_supported" writable="1"> | |
| 6447 | + | <doc xml:space="preserve" | |
| 6448 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.c" | |
| 6449 | + | line="65">returns whether a save option key is supported by the module</doc> | |
| 6450 | + | <type name="PixbufModuleSaveOptionSupportedFunc" | |
| 6451 | + | c:type="GdkPixbufModuleSaveOptionSupportedFunc"/> | |
| 6452 | + | </field> | |
| 6453 | + | <field name="_reserved1" introspectable="0"> | |
| 6454 | + | <callback name="_reserved1"> | |
| 6455 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6456 | + | line="396"/> | |
| 6457 | + | <return-value transfer-ownership="none"> | |
| 6458 | + | <type name="none" c:type="void"/> | |
| 6459 | + | </return-value> | |
| 6460 | + | </callback> | |
| 6461 | + | </field> | |
| 6462 | + | <field name="_reserved2" introspectable="0"> | |
| 6463 | + | <callback name="_reserved2"> | |
| 6464 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6465 | + | line="397"/> | |
| 6466 | + | <return-value transfer-ownership="none"> | |
| 6467 | + | <type name="none" c:type="void"/> | |
| 6468 | + | </return-value> | |
| 6469 | + | </callback> | |
| 6470 | + | </field> | |
| 6471 | + | <field name="_reserved3" introspectable="0"> | |
| 6472 | + | <callback name="_reserved3"> | |
| 6473 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6474 | + | line="398"/> | |
| 6475 | + | <return-value transfer-ownership="none"> | |
| 6476 | + | <type name="none" c:type="void"/> | |
| 6477 | + | </return-value> | |
| 6478 | + | </callback> | |
| 6479 | + | </field> | |
| 6480 | + | <field name="_reserved4" introspectable="0"> | |
| 6481 | + | <callback name="_reserved4"> | |
| 6482 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6483 | + | line="399"/> | |
| 6484 | + | <return-value transfer-ownership="none"> | |
| 6485 | + | <type name="none" c:type="void"/> | |
| 6486 | + | </return-value> | |
| 6487 | + | </callback> | |
| 6488 | + | </field> | |
| 6489 | + | </record> | |
| 6490 | + | <callback name="PixbufModuleBeginLoadFunc" | |
| 6491 | + | c:type="GdkPixbufModuleBeginLoadFunc" | |
| 6492 | + | introspectable="0" | |
| 6493 | + | throws="1"> | |
| 6494 | + | <doc xml:space="preserve" | |
| 6495 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6496 | + | line="255">Sets up the image loading state. | |
| 6497 | + | ||
| 6498 | + | The image loader is responsible for storing the given function pointers | |
| 6499 | + | and user data, and call them when needed. | |
| 6500 | + | ||
| 6501 | + | The image loader should set up an internal state object, and return it | |
| 6502 | + | from this function; the state object will then be updated from the | |
| 6503 | + | [callback@GdkPixbuf.PixbufModuleIncrementLoadFunc] callback, and will be freed | |
| 6504 | + | by [callback@GdkPixbuf.PixbufModuleStopLoadFunc] callback.</doc> | |
| 6505 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="277"/> | |
| 6506 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 6507 | + | <doc xml:space="preserve" | |
| 6508 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6509 | + | line="273">the data to be passed to | |
| 6510 | + | [callback@GdkPixbuf.PixbufModuleIncrementLoadFunc] | |
| 6511 | + | and [callback@GdkPixbuf.PixbufModuleStopLoadFunc], or `NULL` in case of error</doc> | |
| 6512 | + | <type name="gpointer" c:type="gpointer"/> | |
| 6513 | + | </return-value> | |
| 6514 | + | <parameters> | |
| 6515 | + | <parameter name="size_func" transfer-ownership="none"> | |
| 6516 | + | <doc xml:space="preserve" | |
| 6517 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6518 | + | line="257">the function to be called when the size is known</doc> | |
| 6519 | + | <type name="PixbufModuleSizeFunc" c:type="GdkPixbufModuleSizeFunc"/> | |
| 6520 | + | </parameter> | |
| 6521 | + | <parameter name="prepared_func" transfer-ownership="none"> | |
| 6522 | + | <doc xml:space="preserve" | |
| 6523 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6524 | + | line="258">the function to be called when the data has been prepared</doc> | |
| 6525 | + | <type name="PixbufModulePreparedFunc" | |
| 6526 | + | c:type="GdkPixbufModulePreparedFunc"/> | |
| 6527 | + | </parameter> | |
| 6528 | + | <parameter name="updated_func" transfer-ownership="none" closure="3"> | |
| 6529 | + | <doc xml:space="preserve" | |
| 6530 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6531 | + | line="259">the function to be called when the data has been updated</doc> | |
| 6532 | + | <type name="PixbufModuleUpdatedFunc" | |
| 6533 | + | c:type="GdkPixbufModuleUpdatedFunc"/> | |
| 6534 | + | </parameter> | |
| 6535 | + | <parameter name="user_data" | |
| 6536 | + | transfer-ownership="none" | |
| 6537 | + | nullable="1" | |
| 6538 | + | allow-none="1" | |
| 6539 | + | closure="3"> | |
| 6540 | + | <doc xml:space="preserve" | |
| 6541 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6542 | + | line="260">the data to be passed to the functions</doc> | |
| 6543 | + | <type name="gpointer" c:type="gpointer"/> | |
| 6544 | + | </parameter> | |
| 6545 | + | </parameters> | |
| 6546 | + | </callback> | |
| 6547 | + | <callback name="PixbufModuleFillInfoFunc" | |
| 6548 | + | c:type="GdkPixbufModuleFillInfoFunc" | |
| 6549 | + | version="2.2"> | |
| 6550 | + | <doc xml:space="preserve" | |
| 6551 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6552 | + | line="413">Defines the type of the function used to fill a | |
| 6553 | + | #GdkPixbufFormat structure with information about a module.</doc> | |
| 6554 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="422"/> | |
| 6555 | + | <return-value transfer-ownership="none"> | |
| 6556 | + | <type name="none" c:type="void"/> | |
| 6557 | + | </return-value> | |
| 6558 | + | <parameters> | |
| 6559 | + | <parameter name="info" transfer-ownership="none"> | |
| 6560 | + | <doc xml:space="preserve" | |
| 6561 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6562 | + | line="415">a #GdkPixbufFormat.</doc> | |
| 6563 | + | <type name="PixbufFormat" c:type="GdkPixbufFormat*"/> | |
| 6564 | + | </parameter> | |
| 6565 | + | </parameters> | |
| 6566 | + | </callback> | |
| 6567 | + | <callback name="PixbufModuleFillVtableFunc" | |
| 6568 | + | c:type="GdkPixbufModuleFillVtableFunc" | |
| 6569 | + | version="2.2"> | |
| 6570 | + | <doc xml:space="preserve" | |
| 6571 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6572 | + | line="402">Defines the type of the function used to set the vtable of a | |
| 6573 | + | #GdkPixbufModule when it is loaded.</doc> | |
| 6574 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="411"/> | |
| 6575 | + | <return-value transfer-ownership="none"> | |
| 6576 | + | <type name="none" c:type="void"/> | |
| 6577 | + | </return-value> | |
| 6578 | + | <parameters> | |
| 6579 | + | <parameter name="module" transfer-ownership="none"> | |
| 6580 | + | <doc xml:space="preserve" | |
| 6581 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6582 | + | line="404">a #GdkPixbufModule.</doc> | |
| 6583 | + | <type name="PixbufModule" c:type="GdkPixbufModule*"/> | |
| 6584 | + | </parameter> | |
| 6585 | + | </parameters> | |
| 6586 | + | </callback> | |
| 6587 | + | <callback name="PixbufModuleIncrementLoadFunc" | |
| 6588 | + | c:type="GdkPixbufModuleIncrementLoadFunc" | |
| 6589 | + | throws="1"> | |
| 6590 | + | <doc xml:space="preserve" | |
| 6591 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6592 | + | line="297">Incrementally loads a buffer into the image data.</doc> | |
| 6593 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="308"/> | |
| 6594 | + | <return-value transfer-ownership="none"> | |
| 6595 | + | <doc xml:space="preserve" | |
| 6596 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6597 | + | line="306">`TRUE` if the incremental load was successful</doc> | |
| 6598 | + | <type name="gboolean" c:type="gboolean"/> | |
| 6599 | + | </return-value> | |
| 6600 | + | <parameters> | |
| 6601 | + | <parameter name="context" | |
| 6602 | + | transfer-ownership="none" | |
| 6603 | + | nullable="1" | |
| 6604 | + | allow-none="1"> | |
| 6605 | + | <doc xml:space="preserve" | |
| 6606 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6607 | + | line="299">the state object created by [callback@GdkPixbuf.PixbufModuleBeginLoadFunc]</doc> | |
| 6608 | + | <type name="gpointer" c:type="gpointer"/> | |
| 6609 | + | </parameter> | |
| 6610 | + | <parameter name="buf" transfer-ownership="none"> | |
| 6611 | + | <doc xml:space="preserve" | |
| 6612 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6613 | + | line="300">the data to load</doc> | |
| 6614 | + | <array length="2" zero-terminated="0" c:type="const guchar*"> | |
| 6615 | + | <type name="guint8"/> | |
| 6616 | + | </array> | |
| 6617 | + | </parameter> | |
| 6618 | + | <parameter name="size" transfer-ownership="none"> | |
| 6619 | + | <doc xml:space="preserve" | |
| 6620 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6621 | + | line="301">the length of the data to load</doc> | |
| 6622 | + | <type name="guint" c:type="guint"/> | |
| 6623 | + | </parameter> | |
| 6624 | + | </parameters> | |
| 6625 | + | </callback> | |
| 6626 | + | <callback name="PixbufModuleLoadAnimationFunc" | |
| 6627 | + | c:type="GdkPixbufModuleLoadAnimationFunc" | |
| 6628 | + | throws="1"> | |
| 6629 | + | <doc xml:space="preserve" | |
| 6630 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6631 | + | line="241">Loads a file from a standard C file stream into a new `GdkPixbufAnimation`. | |
| 6632 | + | ||
| 6633 | + | In case of error, this function should return `NULL` and set the `error` argument.</doc> | |
| 6634 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="252"/> | |
| 6635 | + | <return-value transfer-ownership="full"> | |
| 6636 | + | <doc xml:space="preserve" | |
| 6637 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6638 | + | line="250">a newly created `GdkPixbufAnimation` for the contents of the file</doc> | |
| 6639 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 6640 | + | </return-value> | |
| 6641 | + | <parameters> | |
| 6642 | + | <parameter name="f" | |
| 6643 | + | transfer-ownership="none" | |
| 6644 | + | nullable="1" | |
| 6645 | + | allow-none="1"> | |
| 6646 | + | <doc xml:space="preserve" | |
| 6647 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6648 | + | line="243">the file stream from which the image should be loaded</doc> | |
| 6649 | + | <type name="gpointer" c:type="FILE*"/> | |
| 6650 | + | </parameter> | |
| 6651 | + | </parameters> | |
| 6652 | + | </callback> | |
| 6653 | + | <callback name="PixbufModuleLoadFunc" | |
| 6654 | + | c:type="GdkPixbufModuleLoadFunc" | |
| 6655 | + | throws="1"> | |
| 6656 | + | <doc xml:space="preserve" | |
| 6657 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6658 | + | line="217">Loads a file from a standard C file stream into a new `GdkPixbuf`. | |
| 6659 | + | ||
| 6660 | + | In case of error, this function should return `NULL` and set the `error` argument.</doc> | |
| 6661 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="228"/> | |
| 6662 | + | <return-value transfer-ownership="full"> | |
| 6663 | + | <doc xml:space="preserve" | |
| 6664 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6665 | + | line="226">a newly created `GdkPixbuf` for the contents of the file</doc> | |
| 6666 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 6667 | + | </return-value> | |
| 6668 | + | <parameters> | |
| 6669 | + | <parameter name="f" | |
| 6670 | + | transfer-ownership="none" | |
| 6671 | + | nullable="1" | |
| 6672 | + | allow-none="1"> | |
| 6673 | + | <doc xml:space="preserve" | |
| 6674 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6675 | + | line="219">the file stream from which the image should be loaded</doc> | |
| 6676 | + | <type name="gpointer" c:type="FILE*"/> | |
| 6677 | + | </parameter> | |
| 6678 | + | </parameters> | |
| 6679 | + | </callback> | |
| 6680 | + | <callback name="PixbufModuleLoadXpmDataFunc" | |
| 6681 | + | c:type="GdkPixbufModuleLoadXpmDataFunc"> | |
| 6682 | + | <doc xml:space="preserve" | |
| 6683 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6684 | + | line="231">Loads XPM data into a new `GdkPixbuf`.</doc> | |
| 6685 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="239"/> | |
| 6686 | + | <return-value transfer-ownership="full"> | |
| 6687 | + | <doc xml:space="preserve" | |
| 6688 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6689 | + | line="237">a newly created `GdkPixbuf` for the XPM data</doc> | |
| 6690 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 6691 | + | </return-value> | |
| 6692 | + | <parameters> | |
| 6693 | + | <parameter name="data" transfer-ownership="none"> | |
| 6694 | + | <doc xml:space="preserve" | |
| 6695 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6696 | + | line="233">the XPM data</doc> | |
| 6697 | + | <array c:type="const char**"> | |
| 6698 | + | <type name="utf8" c:type="char*"/> | |
| 6699 | + | </array> | |
| 6700 | + | </parameter> | |
| 6701 | + | </parameters> | |
| 6702 | + | </callback> | |
| 6703 | + | <record name="PixbufModulePattern" | |
| 6704 | + | c:type="GdkPixbufModulePattern" | |
| 6705 | + | version="2.2"> | |
| 6706 | + | <doc xml:space="preserve" | |
| 6707 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6708 | + | line="170">The signature prefix for a module. | |
| 6709 | + | ||
| 6710 | + | The signature of a module is a set of prefixes. Prefixes are encoded as | |
| 6711 | + | pairs of ordinary strings, where the second string, called the mask, if | |
| 6712 | + | not `NULL`, must be of the same length as the first one and may contain | |
| 6713 | + | ' ', '!', 'x', 'z', and 'n' to indicate bytes that must be matched, | |
| 6714 | + | not matched, "don't-care"-bytes, zeros and non-zeros, respectively. | |
| 6715 | + | ||
| 6716 | + | Each prefix has an associated integer that describes the relevance of | |
| 6717 | + | the prefix, with 0 meaning a mismatch and 100 a "perfect match". | |
| 6718 | + | ||
| 6719 | + | Starting with gdk-pixbuf 2.8, the first byte of the mask may be '*', | |
| 6720 | + | indicating an unanchored pattern that matches not only at the beginning, | |
| 6721 | + | but also in the middle. Versions prior to 2.8 will interpret the '*' | |
| 6722 | + | like an 'x'. | |
| 6723 | + | ||
| 6724 | + | The signature of a module is stored as an array of | |
| 6725 | + | `GdkPixbufModulePatterns`. The array is terminated by a pattern | |
| 6726 | + | where the `prefix` is `NULL`. | |
| 6727 | + | ||
| 6728 | + | ```c | |
| 6729 | + | GdkPixbufModulePattern *signature[] = { | |
| 6730 | + | { "abcdx", " !x z", 100 }, | |
| 6731 | + | { "bla", NULL, 90 }, | |
| 6732 | + | { NULL, NULL, 0 } | |
| 6733 | + | }; | |
| 6734 | + | ``` | |
| 6735 | + | ||
| 6736 | + | In the example above, the signature matches e.g. "auud\0" with | |
| 6737 | + | relevance 100, and "blau" with relevance 90.</doc> | |
| 6738 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="215"/> | |
| 6739 | + | <field name="prefix" writable="1"> | |
| 6740 | + | <doc xml:space="preserve" | |
| 6741 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6742 | + | line="172">the prefix for this pattern</doc> | |
| 6743 | + | <type name="utf8" c:type="char*"/> | |
| 6744 | + | </field> | |
| 6745 | + | <field name="mask" writable="1"> | |
| 6746 | + | <doc xml:space="preserve" | |
| 6747 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6748 | + | line="173">mask containing bytes which modify how the prefix is matched against | |
| 6749 | + | test data</doc> | |
| 6750 | + | <type name="utf8" c:type="char*"/> | |
| 6751 | + | </field> | |
| 6752 | + | <field name="relevance" writable="1"> | |
| 6753 | + | <doc xml:space="preserve" | |
| 6754 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6755 | + | line="175">relevance of this pattern</doc> | |
| 6756 | + | <type name="gint" c:type="int"/> | |
| 6757 | + | </field> | |
| 6758 | + | </record> | |
| 6759 | + | <callback name="PixbufModulePreparedFunc" | |
| 6760 | + | c:type="GdkPixbufModulePreparedFunc" | |
| 6761 | + | version="2.2"> | |
| 6762 | + | <doc xml:space="preserve" | |
| 6763 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6764 | + | line="126">Defines the type of the function that gets called once the initial | |
| 6765 | + | setup of @pixbuf is done. | |
| 6766 | + | ||
| 6767 | + | #GdkPixbufLoader uses a function of this type to emit the | |
| 6768 | + | "<link linkend="GdkPixbufLoader-area-prepared">area_prepared</link>" | |
| 6769 | + | signal.</doc> | |
| 6770 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="141"/> | |
| 6771 | + | <return-value transfer-ownership="none"> | |
| 6772 | + | <type name="none" c:type="void"/> | |
| 6773 | + | </return-value> | |
| 6774 | + | <parameters> | |
| 6775 | + | <parameter name="pixbuf" transfer-ownership="none"> | |
| 6776 | + | <doc xml:space="preserve" | |
| 6777 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6778 | + | line="128">the #GdkPixbuf that is currently being loaded.</doc> | |
| 6779 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 6780 | + | </parameter> | |
| 6781 | + | <parameter name="anim" transfer-ownership="none"> | |
| 6782 | + | <doc xml:space="preserve" | |
| 6783 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6784 | + | line="129">if an animation is being loaded, the #GdkPixbufAnimation, else %NULL.</doc> | |
| 6785 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 6786 | + | </parameter> | |
| 6787 | + | <parameter name="user_data" | |
| 6788 | + | transfer-ownership="none" | |
| 6789 | + | nullable="1" | |
| 6790 | + | allow-none="1" | |
| 6791 | + | closure="2"> | |
| 6792 | + | <doc xml:space="preserve" | |
| 6793 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6794 | + | line="130">the loader.</doc> | |
| 6795 | + | <type name="gpointer" c:type="gpointer"/> | |
| 6796 | + | </parameter> | |
| 6797 | + | </parameters> | |
| 6798 | + | </callback> | |
| 6799 | + | <callback name="PixbufModuleSaveCallbackFunc" | |
| 6800 | + | c:type="GdkPixbufModuleSaveCallbackFunc" | |
| 6801 | + | introspectable="0" | |
| 6802 | + | throws="1"> | |
| 6803 | + | <doc xml:space="preserve" | |
| 6804 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6805 | + | line="336">Saves a `GdkPixbuf` by calling the provided function. | |
| 6806 | + | ||
| 6807 | + | The optional `option_keys` and `option_values` arrays contain the keys and | |
| 6808 | + | values (in the same order) for attributes to be saved alongside the image | |
| 6809 | + | data.</doc> | |
| 6810 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="354"/> | |
| 6811 | + | <return-value transfer-ownership="none"> | |
| 6812 | + | <doc xml:space="preserve" | |
| 6813 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6814 | + | line="351">`TRUE` on success; in case of failure, `FALSE` is returned and | |
| 6815 | + | the `error` is set</doc> | |
| 6816 | + | <type name="gboolean" c:type="gboolean"/> | |
| 6817 | + | </return-value> | |
| 6818 | + | <parameters> | |
| 6819 | + | <parameter name="save_func" transfer-ownership="none" closure="1"> | |
| 6820 | + | <doc xml:space="preserve" | |
| 6821 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6822 | + | line="338">the function to call when saving</doc> | |
| 6823 | + | <type name="PixbufSaveFunc" c:type="GdkPixbufSaveFunc"/> | |
| 6824 | + | </parameter> | |
| 6825 | + | <parameter name="user_data" | |
| 6826 | + | transfer-ownership="none" | |
| 6827 | + | nullable="1" | |
| 6828 | + | allow-none="1" | |
| 6829 | + | closure="1"> | |
| 6830 | + | <doc xml:space="preserve" | |
| 6831 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6832 | + | line="339">the data to pass to @save_func</doc> | |
| 6833 | + | <type name="gpointer" c:type="gpointer"/> | |
| 6834 | + | </parameter> | |
| 6835 | + | <parameter name="pixbuf" transfer-ownership="none"> | |
| 6836 | + | <doc xml:space="preserve" | |
| 6837 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6838 | + | line="340">the `GdkPixbuf` to save</doc> | |
| 6839 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 6840 | + | </parameter> | |
| 6841 | + | <parameter name="option_keys" | |
| 6842 | + | transfer-ownership="none" | |
| 6843 | + | nullable="1" | |
| 6844 | + | allow-none="1"> | |
| 6845 | + | <doc xml:space="preserve" | |
| 6846 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6847 | + | line="341">an array of option names</doc> | |
| 6848 | + | <array c:type="gchar**"> | |
| 6849 | + | <type name="utf8" c:type="gchar*"/> | |
| 6850 | + | </array> | |
| 6851 | + | </parameter> | |
| 6852 | + | <parameter name="option_values" | |
| 6853 | + | transfer-ownership="none" | |
| 6854 | + | nullable="1" | |
| 6855 | + | allow-none="1"> | |
| 6856 | + | <doc xml:space="preserve" | |
| 6857 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6858 | + | line="342">an array of option values</doc> | |
| 6859 | + | <array c:type="gchar**"> | |
| 6860 | + | <type name="utf8" c:type="gchar*"/> | |
| 6861 | + | </array> | |
| 6862 | + | </parameter> | |
| 6863 | + | </parameters> | |
| 6864 | + | </callback> | |
| 6865 | + | <callback name="PixbufModuleSaveFunc" | |
| 6866 | + | c:type="GdkPixbufModuleSaveFunc" | |
| 6867 | + | throws="1"> | |
| 6868 | + | <doc xml:space="preserve" | |
| 6869 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6870 | + | line="313">Saves a `GdkPixbuf` into a standard C file stream. | |
| 6871 | + | ||
| 6872 | + | The optional `param_keys` and `param_values` arrays contain the keys and | |
| 6873 | + | values (in the same order) for attributes to be saved alongside the image | |
| 6874 | + | data.</doc> | |
| 6875 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="330"/> | |
| 6876 | + | <return-value transfer-ownership="none"> | |
| 6877 | + | <doc xml:space="preserve" | |
| 6878 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6879 | + | line="327">`TRUE` on success; in case of failure, `FALSE` is returned and | |
| 6880 | + | the `error` is set</doc> | |
| 6881 | + | <type name="gboolean" c:type="gboolean"/> | |
| 6882 | + | </return-value> | |
| 6883 | + | <parameters> | |
| 6884 | + | <parameter name="f" | |
| 6885 | + | transfer-ownership="none" | |
| 6886 | + | nullable="1" | |
| 6887 | + | allow-none="1"> | |
| 6888 | + | <doc xml:space="preserve" | |
| 6889 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6890 | + | line="315">the file stream into which the image should be saved</doc> | |
| 6891 | + | <type name="gpointer" c:type="FILE*"/> | |
| 6892 | + | </parameter> | |
| 6893 | + | <parameter name="pixbuf" transfer-ownership="none"> | |
| 6894 | + | <doc xml:space="preserve" | |
| 6895 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6896 | + | line="316">the image to save</doc> | |
| 6897 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 6898 | + | </parameter> | |
| 6899 | + | <parameter name="param_keys" | |
| 6900 | + | transfer-ownership="none" | |
| 6901 | + | nullable="1" | |
| 6902 | + | allow-none="1"> | |
| 6903 | + | <doc xml:space="preserve" | |
| 6904 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6905 | + | line="317">parameter keys to save</doc> | |
| 6906 | + | <array c:type="gchar**"> | |
| 6907 | + | <type name="utf8" c:type="gchar*"/> | |
| 6908 | + | </array> | |
| 6909 | + | </parameter> | |
| 6910 | + | <parameter name="param_values" | |
| 6911 | + | transfer-ownership="none" | |
| 6912 | + | nullable="1" | |
| 6913 | + | allow-none="1"> | |
| 6914 | + | <doc xml:space="preserve" | |
| 6915 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6916 | + | line="318">parameter values to save</doc> | |
| 6917 | + | <array c:type="gchar**"> | |
| 6918 | + | <type name="utf8" c:type="gchar*"/> | |
| 6919 | + | </array> | |
| 6920 | + | </parameter> | |
| 6921 | + | </parameters> | |
| 6922 | + | </callback> | |
| 6923 | + | <callback name="PixbufModuleSaveOptionSupportedFunc" | |
| 6924 | + | c:type="GdkPixbufModuleSaveOptionSupportedFunc"> | |
| 6925 | + | <doc xml:space="preserve" | |
| 6926 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6927 | + | line="361">Checks whether the given `option_key` is supported when saving.</doc> | |
| 6928 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="369"/> | |
| 6929 | + | <return-value transfer-ownership="none"> | |
| 6930 | + | <doc xml:space="preserve" | |
| 6931 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6932 | + | line="367">`TRUE` if the option is supported</doc> | |
| 6933 | + | <type name="gboolean" c:type="gboolean"/> | |
| 6934 | + | </return-value> | |
| 6935 | + | <parameters> | |
| 6936 | + | <parameter name="option_key" transfer-ownership="none"> | |
| 6937 | + | <doc xml:space="preserve" | |
| 6938 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6939 | + | line="363">the option key to check</doc> | |
| 6940 | + | <type name="utf8" c:type="const gchar*"/> | |
| 6941 | + | </parameter> | |
| 6942 | + | </parameters> | |
| 6943 | + | </callback> | |
| 6944 | + | <callback name="PixbufModuleSizeFunc" | |
| 6945 | + | c:type="GdkPixbufModuleSizeFunc" | |
| 6946 | + | version="2.2"> | |
| 6947 | + | <doc xml:space="preserve" | |
| 6948 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6949 | + | line="100">Defines the type of the function that gets called once the size | |
| 6950 | + | of the loaded image is known. | |
| 6951 | + | ||
| 6952 | + | The function is expected to set @width and @height to the desired | |
| 6953 | + | size to which the image should be scaled. If a module has no efficient | |
| 6954 | + | way to achieve the desired scaling during the loading of the image, it may | |
| 6955 | + | either ignore the size request, or only approximate it - gdk-pixbuf will | |
| 6956 | + | then perform the required scaling on the completely loaded image. | |
| 6957 | + | ||
| 6958 | + | If the function sets @width or @height to zero, the module should interpret | |
| 6959 | + | this as a hint that it will be closed soon and shouldn't allocate further | |
| 6960 | + | resources. This convention is used to implement gdk_pixbuf_get_file_info() | |
| 6961 | + | efficiently.</doc> | |
| 6962 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="122"/> | |
| 6963 | + | <return-value transfer-ownership="none"> | |
| 6964 | + | <type name="none" c:type="void"/> | |
| 6965 | + | </return-value> | |
| 6966 | + | <parameters> | |
| 6967 | + | <parameter name="width" transfer-ownership="none"> | |
| 6968 | + | <doc xml:space="preserve" | |
| 6969 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6970 | + | line="102">pointer to a location containing the current image width</doc> | |
| 6971 | + | <type name="gint" c:type="gint*"/> | |
| 6972 | + | </parameter> | |
| 6973 | + | <parameter name="height" transfer-ownership="none"> | |
| 6974 | + | <doc xml:space="preserve" | |
| 6975 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6976 | + | line="103">pointer to a location containing the current image height</doc> | |
| 6977 | + | <type name="gint" c:type="gint*"/> | |
| 6978 | + | </parameter> | |
| 6979 | + | <parameter name="user_data" | |
| 6980 | + | transfer-ownership="none" | |
| 6981 | + | nullable="1" | |
| 6982 | + | allow-none="1" | |
| 6983 | + | closure="2"> | |
| 6984 | + | <doc xml:space="preserve" | |
| 6985 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6986 | + | line="104">the loader.</doc> | |
| 6987 | + | <type name="gpointer" c:type="gpointer"/> | |
| 6988 | + | </parameter> | |
| 6989 | + | </parameters> | |
| 6990 | + | </callback> | |
| 6991 | + | <callback name="PixbufModuleStopLoadFunc" | |
| 6992 | + | c:type="GdkPixbufModuleStopLoadFunc" | |
| 6993 | + | throws="1"> | |
| 6994 | + | <doc xml:space="preserve" | |
| 6995 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 6996 | + | line="283">Finalizes the image loading state. | |
| 6997 | + | ||
| 6998 | + | This function is called on success and error states.</doc> | |
| 6999 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="294"/> | |
| 7000 | + | <return-value transfer-ownership="none"> | |
| 7001 | + | <doc xml:space="preserve" | |
| 7002 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 7003 | + | line="292">`TRUE` if the loading operation was successful</doc> | |
| 7004 | + | <type name="gboolean" c:type="gboolean"/> | |
| 7005 | + | </return-value> | |
| 7006 | + | <parameters> | |
| 7007 | + | <parameter name="context" | |
| 7008 | + | transfer-ownership="full" | |
| 7009 | + | nullable="1" | |
| 7010 | + | allow-none="1"> | |
| 7011 | + | <doc xml:space="preserve" | |
| 7012 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 7013 | + | line="285">the state object created by [callback@GdkPixbuf.PixbufModuleBeginLoadFunc]</doc> | |
| 7014 | + | <type name="gpointer" c:type="gpointer"/> | |
| 7015 | + | </parameter> | |
| 7016 | + | </parameters> | |
| 7017 | + | </callback> | |
| 7018 | + | <callback name="PixbufModuleUpdatedFunc" | |
| 7019 | + | c:type="GdkPixbufModuleUpdatedFunc" | |
| 7020 | + | version="2.2"> | |
| 7021 | + | <doc xml:space="preserve" | |
| 7022 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 7023 | + | line="145">Defines the type of the function that gets called every time a region | |
| 7024 | + | of @pixbuf is updated. | |
| 7025 | + | ||
| 7026 | + | #GdkPixbufLoader uses a function of this type to emit the | |
| 7027 | + | "<link linkend="GdkPixbufLoader-area-updated">area_updated</link>" | |
| 7028 | + | signal.</doc> | |
| 7029 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-io.h" line="163"/> | |
| 7030 | + | <return-value transfer-ownership="none"> | |
| 7031 | + | <type name="none" c:type="void"/> | |
| 7032 | + | </return-value> | |
| 7033 | + | <parameters> | |
| 7034 | + | <parameter name="pixbuf" transfer-ownership="none"> | |
| 7035 | + | <doc xml:space="preserve" | |
| 7036 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 7037 | + | line="147">the #GdkPixbuf that is currently being loaded.</doc> | |
| 7038 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 7039 | + | </parameter> | |
| 7040 | + | <parameter name="x" transfer-ownership="none"> | |
| 7041 | + | <doc xml:space="preserve" | |
| 7042 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 7043 | + | line="148">the X origin of the updated area.</doc> | |
| 7044 | + | <type name="gint" c:type="int"/> | |
| 7045 | + | </parameter> | |
| 7046 | + | <parameter name="y" transfer-ownership="none"> | |
| 7047 | + | <doc xml:space="preserve" | |
| 7048 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 7049 | + | line="149">the Y origin of the updated area.</doc> | |
| 7050 | + | <type name="gint" c:type="int"/> | |
| 7051 | + | </parameter> | |
| 7052 | + | <parameter name="width" transfer-ownership="none"> | |
| 7053 | + | <doc xml:space="preserve" | |
| 7054 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 7055 | + | line="150">the width of the updated area.</doc> | |
| 7056 | + | <type name="gint" c:type="int"/> | |
| 7057 | + | </parameter> | |
| 7058 | + | <parameter name="height" transfer-ownership="none"> | |
| 7059 | + | <doc xml:space="preserve" | |
| 7060 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 7061 | + | line="151">the height of the updated area.</doc> | |
| 7062 | + | <type name="gint" c:type="int"/> | |
| 7063 | + | </parameter> | |
| 7064 | + | <parameter name="user_data" | |
| 7065 | + | transfer-ownership="none" | |
| 7066 | + | nullable="1" | |
| 7067 | + | allow-none="1" | |
| 7068 | + | closure="5"> | |
| 7069 | + | <doc xml:space="preserve" | |
| 7070 | + | filename="../gdk-pixbuf/gdk-pixbuf-io.h" | |
| 7071 | + | line="152">the loader.</doc> | |
| 7072 | + | <type name="gpointer" c:type="gpointer"/> | |
| 7073 | + | </parameter> | |
| 7074 | + | </parameters> | |
| 7075 | + | </callback> | |
| 7076 | + | <class name="PixbufNonAnim" | |
| 7077 | + | c:symbol-prefix="pixbuf_non_anim" | |
| 7078 | + | parent="PixbufAnimation" | |
| 7079 | + | glib:type-name="GdkPixbufNonAnim" | |
| 7080 | + | glib:get-type="gdk_pixbuf_non_anim_get_type"> | |
| 7081 | + | <constructor name="new" c:identifier="gdk_pixbuf_non_anim_new"> | |
| 7082 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-animation.h" | |
| 7083 | + | line="215"/> | |
| 7084 | + | <return-value transfer-ownership="full"> | |
| 7085 | + | <type name="PixbufAnimation" c:type="GdkPixbufAnimation*"/> | |
| 7086 | + | </return-value> | |
| 7087 | + | <parameters> | |
| 7088 | + | <parameter name="pixbuf" transfer-ownership="none"> | |
| 7089 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 7090 | + | </parameter> | |
| 7091 | + | </parameters> | |
| 7092 | + | </constructor> | |
| 7093 | + | </class> | |
| 7094 | + | <enumeration name="PixbufRotation" | |
| 7095 | + | glib:type-name="GdkPixbufRotation" | |
| 7096 | + | glib:get-type="gdk_pixbuf_rotation_get_type" | |
| 7097 | + | c:type="GdkPixbufRotation"> | |
| 7098 | + | <doc xml:space="preserve" | |
| 7099 | + | filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 7100 | + | line="80">The possible rotations which can be passed to gdk_pixbuf_rotate_simple(). | |
| 7101 | + | ||
| 7102 | + | To make them easier to use, their numerical values are the actual degrees.</doc> | |
| 7103 | + | <member name="none" | |
| 7104 | + | value="0" | |
| 7105 | + | c:identifier="GDK_PIXBUF_ROTATE_NONE" | |
| 7106 | + | glib:nick="none" | |
| 7107 | + | glib:name="GDK_PIXBUF_ROTATE_NONE"> | |
| 7108 | + | <doc xml:space="preserve" | |
| 7109 | + | filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 7110 | + | line="82">No rotation.</doc> | |
| 7111 | + | </member> | |
| 7112 | + | <member name="counterclockwise" | |
| 7113 | + | value="90" | |
| 7114 | + | c:identifier="GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE" | |
| 7115 | + | glib:nick="counterclockwise" | |
| 7116 | + | glib:name="GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE"> | |
| 7117 | + | <doc xml:space="preserve" | |
| 7118 | + | filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 7119 | + | line="83">Rotate by 90 degrees.</doc> | |
| 7120 | + | </member> | |
| 7121 | + | <member name="upsidedown" | |
| 7122 | + | value="180" | |
| 7123 | + | c:identifier="GDK_PIXBUF_ROTATE_UPSIDEDOWN" | |
| 7124 | + | glib:nick="upsidedown" | |
| 7125 | + | glib:name="GDK_PIXBUF_ROTATE_UPSIDEDOWN"> | |
| 7126 | + | <doc xml:space="preserve" | |
| 7127 | + | filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 7128 | + | line="84">Rotate by 180 degrees.</doc> | |
| 7129 | + | </member> | |
| 7130 | + | <member name="clockwise" | |
| 7131 | + | value="270" | |
| 7132 | + | c:identifier="GDK_PIXBUF_ROTATE_CLOCKWISE" | |
| 7133 | + | glib:nick="clockwise" | |
| 7134 | + | glib:name="GDK_PIXBUF_ROTATE_CLOCKWISE"> | |
| 7135 | + | <doc xml:space="preserve" | |
| 7136 | + | filename="../gdk-pixbuf/gdk-pixbuf-transform.h" | |
| 7137 | + | line="85">Rotate by 270 degrees.</doc> | |
| 7138 | + | </member> | |
| 7139 | + | </enumeration> | |
| 7140 | + | <callback name="PixbufSaveFunc" c:type="GdkPixbufSaveFunc" version="2.4"> | |
| 7141 | + | <doc xml:space="preserve" | |
| 7142 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 7143 | + | line="346">Save functions used by [method@GdkPixbuf.Pixbuf.save_to_callback]. | |
| 7144 | + | ||
| 7145 | + | This function is called once for each block of bytes that is "written" | |
| 7146 | + | by `gdk_pixbuf_save_to_callback()`. | |
| 7147 | + | ||
| 7148 | + | If successful it should return `TRUE`; if an error occurs it should set | |
| 7149 | + | `error` and return `FALSE`, in which case `gdk_pixbuf_save_to_callback()` | |
| 7150 | + | will fail with the same error.</doc> | |
| 7151 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-core.h" line="367"/> | |
| 7152 | + | <return-value transfer-ownership="none"> | |
| 7153 | + | <doc xml:space="preserve" | |
| 7154 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 7155 | + | line="362">`TRUE` if successful, `FALSE` otherwise</doc> | |
| 7156 | + | <type name="gboolean" c:type="gboolean"/> | |
| 7157 | + | </return-value> | |
| 7158 | + | <parameters> | |
| 7159 | + | <parameter name="buf" transfer-ownership="none"> | |
| 7160 | + | <doc xml:space="preserve" | |
| 7161 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 7162 | + | line="348">bytes to be written.</doc> | |
| 7163 | + | <array length="1" zero-terminated="0" c:type="const gchar*"> | |
| 7164 | + | <type name="guint8"/> | |
| 7165 | + | </array> | |
| 7166 | + | </parameter> | |
| 7167 | + | <parameter name="count" transfer-ownership="none"> | |
| 7168 | + | <doc xml:space="preserve" | |
| 7169 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 7170 | + | line="349">number of bytes in @buf.</doc> | |
| 7171 | + | <type name="gsize" c:type="gsize"/> | |
| 7172 | + | </parameter> | |
| 7173 | + | <parameter name="error" | |
| 7174 | + | direction="out" | |
| 7175 | + | caller-allocates="0" | |
| 7176 | + | transfer-ownership="full"> | |
| 7177 | + | <doc xml:space="preserve" | |
| 7178 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 7179 | + | line="350">A location to return an error.</doc> | |
| 7180 | + | <type name="GLib.Error" c:type="GError**"/> | |
| 7181 | + | </parameter> | |
| 7182 | + | <parameter name="data" | |
| 7183 | + | transfer-ownership="none" | |
| 7184 | + | nullable="1" | |
| 7185 | + | allow-none="1" | |
| 7186 | + | closure="3"> | |
| 7187 | + | <doc xml:space="preserve" | |
| 7188 | + | filename="../gdk-pixbuf/gdk-pixbuf-core.h" | |
| 7189 | + | line="351">user data passed to gdk_pixbuf_save_to_callback().</doc> | |
| 7190 | + | <type name="gpointer" c:type="gpointer"/> | |
| 7191 | + | </parameter> | |
| 7192 | + | </parameters> | |
| 7193 | + | </callback> | |
| 7194 | + | <class name="PixbufSimpleAnim" | |
| 7195 | + | c:symbol-prefix="pixbuf_simple_anim" | |
| 7196 | + | c:type="GdkPixbufSimpleAnim" | |
| 7197 | + | parent="PixbufAnimation" | |
| 7198 | + | glib:type-name="GdkPixbufSimpleAnim" | |
| 7199 | + | glib:get-type="gdk_pixbuf_simple_anim_get_type" | |
| 7200 | + | glib:type-struct="PixbufSimpleAnimClass"> | |
| 7201 | + | <doc xml:space="preserve" | |
| 7202 | + | filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.h" | |
| 7203 | + | line="33">An opaque struct representing a simple animation.</doc> | |
| 7204 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.h" | |
| 7205 | + | line="39"/> | |
| 7206 | + | <constructor name="new" | |
| 7207 | + | c:identifier="gdk_pixbuf_simple_anim_new" | |
| 7208 | + | version="2.8"> | |
| 7209 | + | <doc xml:space="preserve" | |
| 7210 | + | filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.c" | |
| 7211 | + | line="413">Creates a new, empty animation.</doc> | |
| 7212 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.h" | |
| 7213 | + | line="55"/> | |
| 7214 | + | <return-value transfer-ownership="full"> | |
| 7215 | + | <doc xml:space="preserve" | |
| 7216 | + | filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.c" | |
| 7217 | + | line="421">a newly allocated #GdkPixbufSimpleAnim</doc> | |
| 7218 | + | <type name="PixbufSimpleAnim" c:type="GdkPixbufSimpleAnim*"/> | |
| 7219 | + | </return-value> | |
| 7220 | + | <parameters> | |
| 7221 | + | <parameter name="width" transfer-ownership="none"> | |
| 7222 | + | <doc xml:space="preserve" | |
| 7223 | + | filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.c" | |
| 7224 | + | line="415">the width of the animation</doc> | |
| 7225 | + | <type name="gint" c:type="gint"/> | |
| 7226 | + | </parameter> | |
| 7227 | + | <parameter name="height" transfer-ownership="none"> | |
| 7228 | + | <doc xml:space="preserve" | |
| 7229 | + | filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.c" | |
| 7230 | + | line="416">the height of the animation</doc> | |
| 7231 | + | <type name="gint" c:type="gint"/> | |
| 7232 | + | </parameter> | |
| 7233 | + | <parameter name="rate" transfer-ownership="none"> | |
| 7234 | + | <doc xml:space="preserve" | |
| 7235 | + | filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.c" | |
| 7236 | + | line="417">the speed of the animation, in frames per second</doc> | |
| 7237 | + | <type name="gfloat" c:type="gfloat"/> | |
| 7238 | + | </parameter> | |
| 7239 | + | </parameters> | |
| 7240 | + | </constructor> | |
| 7241 | + | <method name="add_frame" | |
| 7242 | + | c:identifier="gdk_pixbuf_simple_anim_add_frame" | |
| 7243 | + | version="2.8"> | |
| 7244 | + | <doc xml:space="preserve" | |
| 7245 | + | filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.c" | |
| 7246 | + | line="440">Adds a new frame to @animation. The @pixbuf must | |
| 7247 | + | have the dimensions specified when the animation | |
| 7248 | + | was constructed.</doc> | |
| 7249 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.h" | |
| 7250 | + | line="59"/> | |
| 7251 | + | <return-value transfer-ownership="none"> | |
| 7252 | + | <type name="none" c:type="void"/> | |
| 7253 | + | </return-value> | |
| 7254 | + | <parameters> | |
| 7255 | + | <instance-parameter name="animation" transfer-ownership="none"> | |
| 7256 | + | <doc xml:space="preserve" | |
| 7257 | + | filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.c" | |
| 7258 | + | line="442">a #GdkPixbufSimpleAnim</doc> | |
| 7259 | + | <type name="PixbufSimpleAnim" c:type="GdkPixbufSimpleAnim*"/> | |
| 7260 | + | </instance-parameter> | |
| 7261 | + | <parameter name="pixbuf" transfer-ownership="none"> | |
| 7262 | + | <doc xml:space="preserve" | |
| 7263 | + | filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.c" | |
| 7264 | + | line="443">the pixbuf to add</doc> | |
| 7265 | + | <type name="Pixbuf" c:type="GdkPixbuf*"/> | |
| 7266 | + | </parameter> | |
| 7267 | + | </parameters> | |
| 7268 | + | </method> | |
| 7269 | + | <method name="get_loop" | |
| 7270 | + | c:identifier="gdk_pixbuf_simple_anim_get_loop" | |
| 7271 | + | glib:get-property="loop" | |
| 7272 | + | version="2.18"> | |
| 7273 | + | <doc xml:space="preserve" | |
| 7274 | + | filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.c" | |
| 7275 | + | line="531">Gets whether @animation should loop indefinitely when it reaches the end.</doc> | |
| 7276 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.h" | |
| 7277 | + | line="65"/> | |
| 7278 | + | <return-value transfer-ownership="none"> | |
| 7279 | + | <doc xml:space="preserve" | |
| 7280 | + | filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.c" | |
| 7281 | + | line="537">%TRUE if the animation loops forever, %FALSE otherwise</doc> | |
| 7282 | + | <type name="gboolean" c:type="gboolean"/> | |
| 7283 | + | </return-value> | |
| 7284 | + | <parameters> | |
| 7285 | + | <instance-parameter name="animation" transfer-ownership="none"> | |
| 7286 | + | <doc xml:space="preserve" | |
| 7287 | + | filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.c" | |
| 7288 | + | line="533">a #GdkPixbufSimpleAnim</doc> | |
| 7289 | + | <type name="PixbufSimpleAnim" c:type="GdkPixbufSimpleAnim*"/> | |
| 7290 | + | </instance-parameter> | |
| 7291 | + | </parameters> | |
| 7292 | + | </method> | |
| 7293 | + | <method name="set_loop" | |
| 7294 | + | c:identifier="gdk_pixbuf_simple_anim_set_loop" | |
| 7295 | + | glib:set-property="loop" | |
| 7296 | + | version="2.18"> | |
| 7297 | + | <doc xml:space="preserve" | |
| 7298 | + | filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.c" | |
| 7299 | + | line="510">Sets whether @animation should loop indefinitely when it reaches the end.</doc> | |
| 7300 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.h" | |
| 7301 | + | line="62"/> | |
| 7302 | + | <return-value transfer-ownership="none"> | |
| 7303 | + | <type name="none" c:type="void"/> | |
| 7304 | + | </return-value> | |
| 7305 | + | <parameters> | |
| 7306 | + | <instance-parameter name="animation" transfer-ownership="none"> | |
| 7307 | + | <doc xml:space="preserve" | |
| 7308 | + | filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.c" | |
| 7309 | + | line="512">a #GdkPixbufSimpleAnim</doc> | |
| 7310 | + | <type name="PixbufSimpleAnim" c:type="GdkPixbufSimpleAnim*"/> | |
| 7311 | + | </instance-parameter> | |
| 7312 | + | <parameter name="loop" transfer-ownership="none"> | |
| 7313 | + | <doc xml:space="preserve" | |
| 7314 | + | filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.c" | |
| 7315 | + | line="513">whether to loop the animation</doc> | |
| 7316 | + | <type name="gboolean" c:type="gboolean"/> | |
| 7317 | + | </parameter> | |
| 7318 | + | </parameters> | |
| 7319 | + | </method> | |
| 7320 | + | <property name="loop" | |
| 7321 | + | version="2.18" | |
| 7322 | + | writable="1" | |
| 7323 | + | transfer-ownership="none" | |
| 7324 | + | setter="set_loop" | |
| 7325 | + | getter="get_loop"> | |
| 7326 | + | <doc xml:space="preserve" | |
| 7327 | + | filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.c" | |
| 7328 | + | line="152">Whether the animation should loop when it reaches the end.</doc> | |
| 7329 | + | <type name="gboolean" c:type="gboolean"/> | |
| 7330 | + | </property> | |
| 7331 | + | </class> | |
| 7332 | + | <record name="PixbufSimpleAnimClass" | |
| 7333 | + | c:type="GdkPixbufSimpleAnimClass" | |
| 7334 | + | disguised="1" | |
| 7335 | + | glib:is-gtype-struct-for="PixbufSimpleAnim"> | |
| 7336 | + | <source-position filename="../gdk-pixbuf/gdk-pixbuf-simple-anim.h" | |
| 7337 | + | line="39"/> | |
| 7338 | + | </record> | |
| 7339 | + | <class name="PixbufSimpleAnimIter" | |
| 7340 | + | c:symbol-prefix="pixbuf_simple_anim_iter" | |
| 7341 | + | parent="PixbufAnimationIter" | |
| 7342 | + | glib:type-name="GdkPixbufSimpleAnimIter" | |
| 7343 | + | glib:get-type="gdk_pixbuf_simple_anim_iter_get_type"> | |
| 7344 | + | </class> | |
| 7345 | + | <function name="pixbuf_error_quark" | |
| 7346 | + | c:identifier="gdk_pixbuf_error_quark" | |
| 7347 | + | moved-to="PixbufError.quark"> | |
| 7348 | + | <return-value transfer-ownership="none"> | |
| 7349 | + | <type name="GLib.Quark" c:type="GQuark"/> | |
| 7350 | + | </return-value> | |
| 7351 | + | </function> | |
| 7352 | + | </namespace> | |
| 7353 | + | </repository> | |
A internal/gir/spec/Gio-2.0.gir +134893 -0 large diff (134893 lines changed): collapsed
A internal/gir/spec/Graphene-1.0.gir +13375 -0 large diff (13375 lines changed): collapsed
A internal/gir/spec/Gsk-4.0.gir +7181 -0 large diff (7181 lines changed): collapsed
A internal/gir/spec/Gtk-4.0.gir +167916 -0 large diff (167916 lines changed): collapsed
A internal/gir/spec/Pango-1.0.gir +22709 -0 large diff (22709 lines changed): collapsed
A internal/gir/spec/PangoCairo-1.0.gir +1136 -0
| @@ -0,0 +1,1136 @@ | |||
| 1 | + | <?xml version="1.0"?> | |
| 2 | + | <!-- This file was automatically generated from C sources - DO NOT EDIT! | |
| 3 | + | To affect the contents of this file, edit the original C definitions, | |
| 4 | + | and/or use gtk-doc annotations. --> | |
| 5 | + | <repository version="1.2" | |
| 6 | + | xmlns="http://www.gtk.org/introspection/core/1.0" | |
| 7 | + | xmlns:c="http://www.gtk.org/introspection/c/1.0" | |
| 8 | + | xmlns:glib="http://www.gtk.org/introspection/glib/1.0"> | |
| 9 | + | <include name="GObject" version="2.0"/> | |
| 10 | + | <include name="Pango" version="1.0"/> | |
| 11 | + | <include name="cairo" version="1.0"/> | |
| 12 | + | <package name="pangocairo"/> | |
| 13 | + | <c:include name="pango/pangocairo.h"/> | |
| 14 | + | <namespace name="PangoCairo" | |
| 15 | + | version="1.0" | |
| 16 | + | shared-library="libpangocairo-1.0.so.0" | |
| 17 | + | c:identifier-prefixes="PangoCairo" | |
| 18 | + | c:symbol-prefixes="pango_cairo"> | |
| 19 | + | <function-macro name="FONT" | |
| 20 | + | c:identifier="PANGO_CAIRO_FONT" | |
| 21 | + | introspectable="0"> | |
| 22 | + | <source-position filename="../pango/pangocairo.h" line="49"/> | |
| 23 | + | <parameters> | |
| 24 | + | <parameter name="obj"> | |
| 25 | + | </parameter> | |
| 26 | + | </parameters> | |
| 27 | + | </function-macro> | |
| 28 | + | <function-macro name="FONT_MAP" | |
| 29 | + | c:identifier="PANGO_CAIRO_FONT_MAP" | |
| 30 | + | introspectable="0"> | |
| 31 | + | <source-position filename="../pango/pangocairo.h" line="72"/> | |
| 32 | + | <parameters> | |
| 33 | + | <parameter name="obj"> | |
| 34 | + | </parameter> | |
| 35 | + | </parameters> | |
| 36 | + | </function-macro> | |
| 37 | + | <interface name="Font" | |
| 38 | + | c:symbol-prefix="font" | |
| 39 | + | c:type="PangoCairoFont" | |
| 40 | + | version="1.18" | |
| 41 | + | glib:type-name="PangoCairoFont" | |
| 42 | + | glib:get-type="pango_cairo_font_get_type"> | |
| 43 | + | <doc xml:space="preserve" | |
| 44 | + | filename="../pango/pangocairo.h" | |
| 45 | + | line="30">`PangoCairoFont` is an interface exported by fonts for | |
| 46 | + | use with Cairo. | |
| 47 | + | ||
| 48 | + | The actual type of the font will depend on the particular | |
| 49 | + | font technology Cairo was compiled to use.</doc> | |
| 50 | + | <prerequisite name="Pango.Font"/> | |
| 51 | + | <method name="get_scaled_font" | |
| 52 | + | c:identifier="pango_cairo_font_get_scaled_font" | |
| 53 | + | version="1.18"> | |
| 54 | + | <doc xml:space="preserve" | |
| 55 | + | filename="../pango/pangocairo-font.c" | |
| 56 | + | line="138">Gets the `cairo_scaled_font_t` used by @font. | |
| 57 | + | The scaled font can be referenced and kept using | |
| 58 | + | cairo_scaled_font_reference().</doc> | |
| 59 | + | <source-position filename="../pango/pangocairo.h" line="133"/> | |
| 60 | + | <return-value transfer-ownership="none" nullable="1"> | |
| 61 | + | <doc xml:space="preserve" | |
| 62 | + | filename="../pango/pangocairo-font.c" | |
| 63 | + | line="146">the `cairo_scaled_font_t` | |
| 64 | + | used by @font</doc> | |
| 65 | + | <type name="cairo.ScaledFont" c:type="cairo_scaled_font_t*"/> | |
| 66 | + | </return-value> | |
| 67 | + | <parameters> | |
| 68 | + | <instance-parameter name="font" | |
| 69 | + | transfer-ownership="none" | |
| 70 | + | nullable="1" | |
| 71 | + | allow-none="1"> | |
| 72 | + | <doc xml:space="preserve" | |
| 73 | + | filename="../pango/pangocairo-font.c" | |
| 74 | + | line="140">a `PangoFont` from a `PangoCairoFontMap`</doc> | |
| 75 | + | <type name="Font" c:type="PangoCairoFont*"/> | |
| 76 | + | </instance-parameter> | |
| 77 | + | </parameters> | |
| 78 | + | </method> | |
| 79 | + | </interface> | |
| 80 | + | <interface name="FontMap" | |
| 81 | + | c:symbol-prefix="font_map" | |
| 82 | + | c:type="PangoCairoFontMap" | |
| 83 | + | version="1.10" | |
| 84 | + | glib:type-name="PangoCairoFontMap" | |
| 85 | + | glib:get-type="pango_cairo_font_map_get_type"> | |
| 86 | + | <doc xml:space="preserve" | |
| 87 | + | filename="../pango/pangocairo.h" | |
| 88 | + | line="57">`PangoCairoFontMap` is an interface exported by font maps for | |
| 89 | + | use with Cairo. | |
| 90 | + | ||
| 91 | + | The actual type of the font map will depend on the particular | |
| 92 | + | font technology Cairo was compiled to use.</doc> | |
| 93 | + | <prerequisite name="Pango.FontMap"/> | |
| 94 | + | <function name="get_default" | |
| 95 | + | c:identifier="pango_cairo_font_map_get_default" | |
| 96 | + | version="1.10"> | |
| 97 | + | <doc xml:space="preserve" | |
| 98 | + | filename="../pango/pangocairo-fontmap.c" | |
| 99 | + | line="151">Gets a default `PangoCairoFontMap` to use with Cairo. | |
| 100 | + | ||
| 101 | + | Note that the type of the returned object will depend on the | |
| 102 | + | particular font backend Cairo was compiled to use; you generally | |
| 103 | + | should only use the `PangoFontMap` and `PangoCairoFontMap` | |
| 104 | + | interfaces on the returned object. | |
| 105 | + | ||
| 106 | + | The default Cairo fontmap can be changed by using | |
| 107 | + | [method@PangoCairo.FontMap.set_default]. This can be used to | |
| 108 | + | change the Cairo font backend that the default fontmap uses | |
| 109 | + | for example. | |
| 110 | + | ||
| 111 | + | Note that since Pango 1.32.6, the default fontmap is per-thread. | |
| 112 | + | Each thread gets its own default fontmap. In this way, PangoCairo | |
| 113 | + | can be used safely from multiple threads.</doc> | |
| 114 | + | <source-position filename="../pango/pangocairo.h" line="110"/> | |
| 115 | + | <return-value transfer-ownership="none"> | |
| 116 | + | <doc xml:space="preserve" | |
| 117 | + | filename="../pango/pangocairo-fontmap.c" | |
| 118 | + | line="170">the default PangoCairo fontmap | |
| 119 | + | for the current thread. This object is owned by Pango and must | |
| 120 | + | not be freed.</doc> | |
| 121 | + | <type name="Pango.FontMap" c:type="PangoFontMap*"/> | |
| 122 | + | </return-value> | |
| 123 | + | </function> | |
| 124 | + | <function name="new" | |
| 125 | + | c:identifier="pango_cairo_font_map_new" | |
| 126 | + | version="1.10"> | |
| 127 | + | <doc xml:space="preserve" | |
| 128 | + | filename="../pango/pangocairo-fontmap.c" | |
| 129 | + | line="47">Creates a new `PangoCairoFontMap` object. | |
| 130 | + | ||
| 131 | + | A fontmap is used to cache information about available fonts, | |
| 132 | + | and holds certain global parameters such as the resolution. | |
| 133 | + | In most cases, you can use `func@PangoCairo.font_map_get_default] | |
| 134 | + | instead. | |
| 135 | + | ||
| 136 | + | Note that the type of the returned object will depend | |
| 137 | + | on the particular font backend Cairo was compiled to use; | |
| 138 | + | You generally should only use the `PangoFontMap` and | |
| 139 | + | `PangoCairoFontMap` interfaces on the returned object. | |
| 140 | + | ||
| 141 | + | You can override the type of backend returned by using an | |
| 142 | + | environment variable %PANGOCAIRO_BACKEND. Supported types, | |
| 143 | + | based on your build, are fc (fontconfig), win32, and coretext. | |
| 144 | + | If requested type is not available, NULL is returned. Ie. | |
| 145 | + | this is only useful for testing, when at least two backends | |
| 146 | + | are compiled in.</doc> | |
| 147 | + | <source-position filename="../pango/pangocairo.h" line="106"/> | |
| 148 | + | <return-value transfer-ownership="full"> | |
| 149 | + | <doc xml:space="preserve" | |
| 150 | + | filename="../pango/pangocairo-fontmap.c" | |
| 151 | + | line="69">the newly allocated `PangoFontMap`, | |
| 152 | + | which should be freed with g_object_unref().</doc> | |
| 153 | + | <type name="Pango.FontMap" c:type="PangoFontMap*"/> | |
| 154 | + | </return-value> | |
| 155 | + | </function> | |
| 156 | + | <function name="new_for_font_type" | |
| 157 | + | c:identifier="pango_cairo_font_map_new_for_font_type" | |
| 158 | + | version="1.18"> | |
| 159 | + | <doc xml:space="preserve" | |
| 160 | + | filename="../pango/pangocairo-fontmap.c" | |
| 161 | + | line="110">Creates a new `PangoCairoFontMap` object of the type suitable | |
| 162 | + | to be used with cairo font backend of type @fonttype. | |
| 163 | + | ||
| 164 | + | In most cases one should simply use [func@PangoCairo.FontMap.new], or | |
| 165 | + | in fact in most of those cases, just use [func@PangoCairo.FontMap.get_default].</doc> | |
| 166 | + | <source-position filename="../pango/pangocairo.h" line="108"/> | |
| 167 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 168 | + | <doc xml:space="preserve" | |
| 169 | + | filename="../pango/pangocairo-fontmap.c" | |
| 170 | + | line="120">the newly allocated | |
| 171 | + | `PangoFontMap` of suitable type which should be freed with | |
| 172 | + | g_object_unref(), or %NULL if the requested cairo font backend | |
| 173 | + | is not supported / compiled in.</doc> | |
| 174 | + | <type name="Pango.FontMap" c:type="PangoFontMap*"/> | |
| 175 | + | </return-value> | |
| 176 | + | <parameters> | |
| 177 | + | <parameter name="fonttype" transfer-ownership="none"> | |
| 178 | + | <doc xml:space="preserve" | |
| 179 | + | filename="../pango/pangocairo-fontmap.c" | |
| 180 | + | line="112">desired #cairo_font_type_t</doc> | |
| 181 | + | <type name="cairo.FontType" c:type="cairo_font_type_t"/> | |
| 182 | + | </parameter> | |
| 183 | + | </parameters> | |
| 184 | + | </function> | |
| 185 | + | <method name="create_context" | |
| 186 | + | c:identifier="pango_cairo_font_map_create_context" | |
| 187 | + | version="1.10" | |
| 188 | + | introspectable="0" | |
| 189 | + | deprecated="1" | |
| 190 | + | deprecated-version="1.22"> | |
| 191 | + | <doc xml:space="preserve" | |
| 192 | + | filename="../pango/pangocairo-fontmap.c" | |
| 193 | + | line="267">Create a `PangoContext` for the given fontmap.</doc> | |
| 194 | + | <doc-deprecated xml:space="preserve">Use pango_font_map_create_context() instead.</doc-deprecated> | |
| 195 | + | <source-position filename="../pango/pangocairo.h" line="123"/> | |
| 196 | + | <return-value> | |
| 197 | + | <doc xml:space="preserve" | |
| 198 | + | filename="../pango/pangocairo-fontmap.c" | |
| 199 | + | line="273">the newly created context; free with g_object_unref().</doc> | |
| 200 | + | <type name="Pango.Context" c:type="PangoContext*"/> | |
| 201 | + | </return-value> | |
| 202 | + | <parameters> | |
| 203 | + | <instance-parameter name="fontmap" transfer-ownership="none"> | |
| 204 | + | <doc xml:space="preserve" | |
| 205 | + | filename="../pango/pangocairo-fontmap.c" | |
| 206 | + | line="269">a `PangoCairoFontMap`</doc> | |
| 207 | + | <type name="FontMap" c:type="PangoCairoFontMap*"/> | |
| 208 | + | </instance-parameter> | |
| 209 | + | </parameters> | |
| 210 | + | </method> | |
| 211 | + | <method name="get_font_type" | |
| 212 | + | c:identifier="pango_cairo_font_map_get_font_type" | |
| 213 | + | version="1.18"> | |
| 214 | + | <doc xml:space="preserve" | |
| 215 | + | filename="../pango/pangocairo-fontmap.c" | |
| 216 | + | line="287">Gets the type of Cairo font backend that @fontmap uses.</doc> | |
| 217 | + | <source-position filename="../pango/pangocairo.h" line="114"/> | |
| 218 | + | <return-value transfer-ownership="none"> | |
| 219 | + | <doc xml:space="preserve" | |
| 220 | + | filename="../pango/pangocairo-fontmap.c" | |
| 221 | + | line="293">the `cairo_font_type_t` cairo font backend type</doc> | |
| 222 | + | <type name="cairo.FontType" c:type="cairo_font_type_t"/> | |
| 223 | + | </return-value> | |
| 224 | + | <parameters> | |
| 225 | + | <instance-parameter name="fontmap" transfer-ownership="none"> | |
| 226 | + | <doc xml:space="preserve" | |
| 227 | + | filename="../pango/pangocairo-fontmap.c" | |
| 228 | + | line="289">a `PangoCairoFontMap`</doc> | |
| 229 | + | <type name="FontMap" c:type="PangoCairoFontMap*"/> | |
| 230 | + | </instance-parameter> | |
| 231 | + | </parameters> | |
| 232 | + | </method> | |
| 233 | + | <method name="get_resolution" | |
| 234 | + | c:identifier="pango_cairo_font_map_get_resolution" | |
| 235 | + | version="1.10"> | |
| 236 | + | <doc xml:space="preserve" | |
| 237 | + | filename="../pango/pangocairo-fontmap.c" | |
| 238 | + | line="247">Gets the resolution for the fontmap. | |
| 239 | + | ||
| 240 | + | See [method@PangoCairo.FontMap.set_resolution].</doc> | |
| 241 | + | <source-position filename="../pango/pangocairo.h" line="120"/> | |
| 242 | + | <return-value transfer-ownership="none"> | |
| 243 | + | <doc xml:space="preserve" | |
| 244 | + | filename="../pango/pangocairo-fontmap.c" | |
| 245 | + | line="255">the resolution in "dots per inch"</doc> | |
| 246 | + | <type name="gdouble" c:type="double"/> | |
| 247 | + | </return-value> | |
| 248 | + | <parameters> | |
| 249 | + | <instance-parameter name="fontmap" transfer-ownership="none"> | |
| 250 | + | <doc xml:space="preserve" | |
| 251 | + | filename="../pango/pangocairo-fontmap.c" | |
| 252 | + | line="249">a `PangoCairoFontMap`</doc> | |
| 253 | + | <type name="FontMap" c:type="PangoCairoFontMap*"/> | |
| 254 | + | </instance-parameter> | |
| 255 | + | </parameters> | |
| 256 | + | </method> | |
| 257 | + | <method name="set_default" | |
| 258 | + | c:identifier="pango_cairo_font_map_set_default" | |
| 259 | + | version="1.22"> | |
| 260 | + | <doc xml:space="preserve" | |
| 261 | + | filename="../pango/pangocairo-fontmap.c" | |
| 262 | + | line="190">Sets a default `PangoCairoFontMap` to use with Cairo. | |
| 263 | + | ||
| 264 | + | This can be used to change the Cairo font backend that the | |
| 265 | + | default fontmap uses for example. The old default font map | |
| 266 | + | is unreffed and the new font map referenced. | |
| 267 | + | ||
| 268 | + | Note that since Pango 1.32.6, the default fontmap is per-thread. | |
| 269 | + | This function only changes the default fontmap for | |
| 270 | + | the current thread. Default fontmaps of existing threads | |
| 271 | + | are not changed. Default fontmaps of any new threads will | |
| 272 | + | still be created using [func@PangoCairo.FontMap.new]. | |
| 273 | + | ||
| 274 | + | A value of %NULL for @fontmap will cause the current default | |
| 275 | + | font map to be released and a new default font map to be created | |
| 276 | + | on demand, using [func@PangoCairo.FontMap.new].</doc> | |
| 277 | + | <source-position filename="../pango/pangocairo.h" line="112"/> | |
| 278 | + | <return-value transfer-ownership="none"> | |
| 279 | + | <type name="none" c:type="void"/> | |
| 280 | + | </return-value> | |
| 281 | + | <parameters> | |
| 282 | + | <instance-parameter name="fontmap" | |
| 283 | + | transfer-ownership="none" | |
| 284 | + | nullable="1" | |
| 285 | + | allow-none="1"> | |
| 286 | + | <doc xml:space="preserve" | |
| 287 | + | filename="../pango/pangocairo-fontmap.c" | |
| 288 | + | line="192">The new default font map</doc> | |
| 289 | + | <type name="FontMap" c:type="PangoCairoFontMap*"/> | |
| 290 | + | </instance-parameter> | |
| 291 | + | </parameters> | |
| 292 | + | </method> | |
| 293 | + | <method name="set_resolution" | |
| 294 | + | c:identifier="pango_cairo_font_map_set_resolution" | |
| 295 | + | version="1.10"> | |
| 296 | + | <doc xml:space="preserve" | |
| 297 | + | filename="../pango/pangocairo-fontmap.c" | |
| 298 | + | line="223">Sets the resolution for the fontmap. | |
| 299 | + | ||
| 300 | + | This is a scale factor between | |
| 301 | + | points specified in a `PangoFontDescription` and Cairo units. The | |
| 302 | + | default value is 96, meaning that a 10 point font will be 13 | |
| 303 | + | units high. (10 * 96. / 72. = 13.3).</doc> | |
| 304 | + | <source-position filename="../pango/pangocairo.h" line="117"/> | |
| 305 | + | <return-value transfer-ownership="none"> | |
| 306 | + | <type name="none" c:type="void"/> | |
| 307 | + | </return-value> | |
| 308 | + | <parameters> | |
| 309 | + | <instance-parameter name="fontmap" transfer-ownership="none"> | |
| 310 | + | <doc xml:space="preserve" | |
| 311 | + | filename="../pango/pangocairo-fontmap.c" | |
| 312 | + | line="225">a `PangoCairoFontMap`</doc> | |
| 313 | + | <type name="FontMap" c:type="PangoCairoFontMap*"/> | |
| 314 | + | </instance-parameter> | |
| 315 | + | <parameter name="dpi" transfer-ownership="none"> | |
| 316 | + | <doc xml:space="preserve" | |
| 317 | + | filename="../pango/pangocairo-fontmap.c" | |
| 318 | + | line="226">the resolution in "dots per inch". (Physical inches aren't actually | |
| 319 | + | involved; the terminology is conventional.)</doc> | |
| 320 | + | <type name="gdouble" c:type="double"/> | |
| 321 | + | </parameter> | |
| 322 | + | </parameters> | |
| 323 | + | </method> | |
| 324 | + | </interface> | |
| 325 | + | <function-macro name="IS_FONT" | |
| 326 | + | c:identifier="PANGO_CAIRO_IS_FONT" | |
| 327 | + | introspectable="0"> | |
| 328 | + | <source-position filename="../pango/pangocairo.h" line="50"/> | |
| 329 | + | <parameters> | |
| 330 | + | <parameter name="obj"> | |
| 331 | + | </parameter> | |
| 332 | + | </parameters> | |
| 333 | + | </function-macro> | |
| 334 | + | <function-macro name="IS_FONT_MAP" | |
| 335 | + | c:identifier="PANGO_CAIRO_IS_FONT_MAP" | |
| 336 | + | introspectable="0"> | |
| 337 | + | <source-position filename="../pango/pangocairo.h" line="73"/> | |
| 338 | + | <parameters> | |
| 339 | + | <parameter name="obj"> | |
| 340 | + | </parameter> | |
| 341 | + | </parameters> | |
| 342 | + | </function-macro> | |
| 343 | + | <callback name="ShapeRendererFunc" c:type="PangoCairoShapeRendererFunc"> | |
| 344 | + | <doc xml:space="preserve" | |
| 345 | + | filename="../pango/pangocairo.h" | |
| 346 | + | line="80">Function type for rendering attributes of type %PANGO_ATTR_SHAPE | |
| 347 | + | with Pango's Cairo renderer.</doc> | |
| 348 | + | <source-position filename="../pango/pangocairo.h" line="94"/> | |
| 349 | + | <return-value transfer-ownership="none"> | |
| 350 | + | <type name="none" c:type="void"/> | |
| 351 | + | </return-value> | |
| 352 | + | <parameters> | |
| 353 | + | <parameter name="cr" transfer-ownership="none"> | |
| 354 | + | <doc xml:space="preserve" | |
| 355 | + | filename="../pango/pangocairo.h" | |
| 356 | + | line="82">a Cairo context with current point set to where the shape should | |
| 357 | + | be rendered</doc> | |
| 358 | + | <type name="cairo.Context" c:type="cairo_t*"/> | |
| 359 | + | </parameter> | |
| 360 | + | <parameter name="attr" transfer-ownership="none"> | |
| 361 | + | <doc xml:space="preserve" | |
| 362 | + | filename="../pango/pangocairo.h" | |
| 363 | + | line="84">the %PANGO_ATTR_SHAPE to render</doc> | |
| 364 | + | <type name="Pango.AttrShape" c:type="PangoAttrShape*"/> | |
| 365 | + | </parameter> | |
| 366 | + | <parameter name="do_path" transfer-ownership="none"> | |
| 367 | + | <doc xml:space="preserve" | |
| 368 | + | filename="../pango/pangocairo.h" | |
| 369 | + | line="85">whether only the shape path should be appended to current | |
| 370 | + | path of @cr and no filling/stroking done. This will be set | |
| 371 | + | to %TRUE when called from pango_cairo_layout_path() and | |
| 372 | + | pango_cairo_layout_line_path() rendering functions.</doc> | |
| 373 | + | <type name="gboolean" c:type="gboolean"/> | |
| 374 | + | </parameter> | |
| 375 | + | <parameter name="data" | |
| 376 | + | transfer-ownership="none" | |
| 377 | + | nullable="1" | |
| 378 | + | allow-none="1" | |
| 379 | + | closure="3"> | |
| 380 | + | <doc xml:space="preserve" | |
| 381 | + | filename="../pango/pangocairo.h" | |
| 382 | + | line="89">user data passed to pango_cairo_context_set_shape_renderer()</doc> | |
| 383 | + | <type name="gpointer" c:type="gpointer"/> | |
| 384 | + | </parameter> | |
| 385 | + | </parameters> | |
| 386 | + | </callback> | |
| 387 | + | <function name="context_get_font_options" | |
| 388 | + | c:identifier="pango_cairo_context_get_font_options" | |
| 389 | + | version="1.10"> | |
| 390 | + | <doc xml:space="preserve" | |
| 391 | + | filename="../pango/pangocairo-context.c" | |
| 392 | + | line="284">Retrieves any font rendering options previously set with | |
| 393 | + | [func@PangoCairo.context_set_font_options]. | |
| 394 | + | ||
| 395 | + | This function does not report options that are derived from | |
| 396 | + | the target surface by [func@update_context].</doc> | |
| 397 | + | <source-position filename="../pango/pangocairo.h" line="145"/> | |
| 398 | + | <return-value transfer-ownership="none" nullable="1"> | |
| 399 | + | <doc xml:space="preserve" | |
| 400 | + | filename="../pango/pangocairo-context.c" | |
| 401 | + | line="294">the font options previously set on the | |
| 402 | + | context, or %NULL if no options have been set. This value is | |
| 403 | + | owned by the context and must not be modified or freed.</doc> | |
| 404 | + | <type name="cairo.FontOptions" c:type="const cairo_font_options_t*"/> | |
| 405 | + | </return-value> | |
| 406 | + | <parameters> | |
| 407 | + | <parameter name="context" transfer-ownership="none"> | |
| 408 | + | <doc xml:space="preserve" | |
| 409 | + | filename="../pango/pangocairo-context.c" | |
| 410 | + | line="286">a `PangoContext`, from a pangocairo font map</doc> | |
| 411 | + | <type name="Pango.Context" c:type="PangoContext*"/> | |
| 412 | + | </parameter> | |
| 413 | + | </parameters> | |
| 414 | + | </function> | |
| 415 | + | <function name="context_get_resolution" | |
| 416 | + | c:identifier="pango_cairo_context_get_resolution" | |
| 417 | + | version="1.10"> | |
| 418 | + | <doc xml:space="preserve" | |
| 419 | + | filename="../pango/pangocairo-context.c" | |
| 420 | + | line="205">Gets the resolution for the context. | |
| 421 | + | ||
| 422 | + | See [func@PangoCairo.context_set_resolution]</doc> | |
| 423 | + | <source-position filename="../pango/pangocairo.h" line="151"/> | |
| 424 | + | <return-value transfer-ownership="none"> | |
| 425 | + | <doc xml:space="preserve" | |
| 426 | + | filename="../pango/pangocairo-context.c" | |
| 427 | + | line="213">the resolution in "dots per inch". A negative value will | |
| 428 | + | be returned if no resolution has previously been set.</doc> | |
| 429 | + | <type name="gdouble" c:type="double"/> | |
| 430 | + | </return-value> | |
| 431 | + | <parameters> | |
| 432 | + | <parameter name="context" transfer-ownership="none"> | |
| 433 | + | <doc xml:space="preserve" | |
| 434 | + | filename="../pango/pangocairo-context.c" | |
| 435 | + | line="207">a `PangoContext`, from a pangocairo font map</doc> | |
| 436 | + | <type name="Pango.Context" c:type="PangoContext*"/> | |
| 437 | + | </parameter> | |
| 438 | + | </parameters> | |
| 439 | + | </function> | |
| 440 | + | <function name="context_get_shape_renderer" | |
| 441 | + | c:identifier="pango_cairo_context_get_shape_renderer" | |
| 442 | + | version="1.18" | |
| 443 | + | introspectable="0"> | |
| 444 | + | <doc xml:space="preserve" | |
| 445 | + | filename="../pango/pangocairo-context.c" | |
| 446 | + | line="380">Sets callback function for context to use for rendering attributes | |
| 447 | + | of type %PANGO_ATTR_SHAPE. | |
| 448 | + | ||
| 449 | + | See `PangoCairoShapeRendererFunc` for details. | |
| 450 | + | ||
| 451 | + | Retrieves callback function and associated user data for rendering | |
| 452 | + | attributes of type %PANGO_ATTR_SHAPE as set by | |
| 453 | + | [func@PangoCairo.context_set_shape_renderer], if any.</doc> | |
| 454 | + | <source-position filename="../pango/pangocairo.h" line="159"/> | |
| 455 | + | <return-value transfer-ownership="none" nullable="1"> | |
| 456 | + | <doc xml:space="preserve" | |
| 457 | + | filename="../pango/pangocairo-context.c" | |
| 458 | + | line="394">the shape rendering callback | |
| 459 | + | previously set on the context, or %NULL if no shape rendering callback | |
| 460 | + | have been set.</doc> | |
| 461 | + | <type name="ShapeRendererFunc" c:type="PangoCairoShapeRendererFunc"/> | |
| 462 | + | </return-value> | |
| 463 | + | <parameters> | |
| 464 | + | <parameter name="context" transfer-ownership="none"> | |
| 465 | + | <doc xml:space="preserve" | |
| 466 | + | filename="../pango/pangocairo-context.c" | |
| 467 | + | line="382">a `PangoContext`, from a pangocairo font map</doc> | |
| 468 | + | <type name="Pango.Context" c:type="PangoContext*"/> | |
| 469 | + | </parameter> | |
| 470 | + | <parameter name="data" | |
| 471 | + | transfer-ownership="none" | |
| 472 | + | nullable="1" | |
| 473 | + | allow-none="1"> | |
| 474 | + | <doc xml:space="preserve" | |
| 475 | + | filename="../pango/pangocairo-context.c" | |
| 476 | + | line="383">Pointer to `gpointer` to return user data</doc> | |
| 477 | + | <type name="gpointer" c:type="gpointer*"/> | |
| 478 | + | </parameter> | |
| 479 | + | </parameters> | |
| 480 | + | </function> | |
| 481 | + | <function name="context_set_font_options" | |
| 482 | + | c:identifier="pango_cairo_context_set_font_options" | |
| 483 | + | version="1.10"> | |
| 484 | + | <doc xml:space="preserve" | |
| 485 | + | filename="../pango/pangocairo-context.c" | |
| 486 | + | line="229">Sets the font options used when rendering text with this context. | |
| 487 | + | ||
| 488 | + | These options override any options that [func@update_context] | |
| 489 | + | derives from the target surface.</doc> | |
| 490 | + | <source-position filename="../pango/pangocairo.h" line="142"/> | |
| 491 | + | <return-value transfer-ownership="none"> | |
| 492 | + | <type name="none" c:type="void"/> | |
| 493 | + | </return-value> | |
| 494 | + | <parameters> | |
| 495 | + | <parameter name="context" transfer-ownership="none"> | |
| 496 | + | <doc xml:space="preserve" | |
| 497 | + | filename="../pango/pangocairo-context.c" | |
| 498 | + | line="231">a `PangoContext`, from a pangocairo font map</doc> | |
| 499 | + | <type name="Pango.Context" c:type="PangoContext*"/> | |
| 500 | + | </parameter> | |
| 501 | + | <parameter name="options" | |
| 502 | + | transfer-ownership="none" | |
| 503 | + | nullable="1" | |
| 504 | + | allow-none="1"> | |
| 505 | + | <doc xml:space="preserve" | |
| 506 | + | filename="../pango/pangocairo-context.c" | |
| 507 | + | line="232">a `cairo_font_options_t`, or %NULL to unset | |
| 508 | + | any previously set options. A copy is made.</doc> | |
| 509 | + | <type name="cairo.FontOptions" c:type="const cairo_font_options_t*"/> | |
| 510 | + | </parameter> | |
| 511 | + | </parameters> | |
| 512 | + | </function> | |
| 513 | + | <function name="context_set_resolution" | |
| 514 | + | c:identifier="pango_cairo_context_set_resolution" | |
| 515 | + | version="1.10"> | |
| 516 | + | <doc xml:space="preserve" | |
| 517 | + | filename="../pango/pangocairo-context.c" | |
| 518 | + | line="182">Sets the resolution for the context. | |
| 519 | + | ||
| 520 | + | This is a scale factor between points specified in a `PangoFontDescription` | |
| 521 | + | and Cairo units. The default value is 96, meaning that a 10 point font will | |
| 522 | + | be 13 units high. (10 * 96. / 72. = 13.3).</doc> | |
| 523 | + | <source-position filename="../pango/pangocairo.h" line="148"/> | |
| 524 | + | <return-value transfer-ownership="none"> | |
| 525 | + | <type name="none" c:type="void"/> | |
| 526 | + | </return-value> | |
| 527 | + | <parameters> | |
| 528 | + | <parameter name="context" transfer-ownership="none"> | |
| 529 | + | <doc xml:space="preserve" | |
| 530 | + | filename="../pango/pangocairo-context.c" | |
| 531 | + | line="184">a `PangoContext`, from a pangocairo font map</doc> | |
| 532 | + | <type name="Pango.Context" c:type="PangoContext*"/> | |
| 533 | + | </parameter> | |
| 534 | + | <parameter name="dpi" transfer-ownership="none"> | |
| 535 | + | <doc xml:space="preserve" | |
| 536 | + | filename="../pango/pangocairo-context.c" | |
| 537 | + | line="185">the resolution in "dots per inch". (Physical inches aren't actually | |
| 538 | + | involved; the terminology is conventional.) A 0 or negative value | |
| 539 | + | means to use the resolution from the font map.</doc> | |
| 540 | + | <type name="gdouble" c:type="double"/> | |
| 541 | + | </parameter> | |
| 542 | + | </parameters> | |
| 543 | + | </function> | |
| 544 | + | <function name="context_set_shape_renderer" | |
| 545 | + | c:identifier="pango_cairo_context_set_shape_renderer" | |
| 546 | + | version="1.18"> | |
| 547 | + | <doc xml:space="preserve" | |
| 548 | + | filename="../pango/pangocairo-context.c" | |
| 549 | + | line="344">Sets callback function for context to use for rendering attributes | |
| 550 | + | of type %PANGO_ATTR_SHAPE. | |
| 551 | + | ||
| 552 | + | See `PangoCairoShapeRendererFunc` for details.</doc> | |
| 553 | + | <source-position filename="../pango/pangocairo.h" line="154"/> | |
| 554 | + | <return-value transfer-ownership="none"> | |
| 555 | + | <type name="none" c:type="void"/> | |
| 556 | + | </return-value> | |
| 557 | + | <parameters> | |
| 558 | + | <parameter name="context" transfer-ownership="none"> | |
| 559 | + | <doc xml:space="preserve" | |
| 560 | + | filename="../pango/pangocairo-context.c" | |
| 561 | + | line="346">a `PangoContext`, from a pangocairo font map</doc> | |
| 562 | + | <type name="Pango.Context" c:type="PangoContext*"/> | |
| 563 | + | </parameter> | |
| 564 | + | <parameter name="func" | |
| 565 | + | transfer-ownership="none" | |
| 566 | + | nullable="1" | |
| 567 | + | allow-none="1" | |
| 568 | + | scope="notified" | |
| 569 | + | closure="2" | |
| 570 | + | destroy="3"> | |
| 571 | + | <doc xml:space="preserve" | |
| 572 | + | filename="../pango/pangocairo-context.c" | |
| 573 | + | line="347">Callback function for rendering attributes of | |
| 574 | + | type %PANGO_ATTR_SHAPE, or %NULL to disable shape rendering.</doc> | |
| 575 | + | <type name="ShapeRendererFunc" c:type="PangoCairoShapeRendererFunc"/> | |
| 576 | + | </parameter> | |
| 577 | + | <parameter name="data" | |
| 578 | + | transfer-ownership="none" | |
| 579 | + | nullable="1" | |
| 580 | + | allow-none="1"> | |
| 581 | + | <doc xml:space="preserve" | |
| 582 | + | filename="../pango/pangocairo-context.c" | |
| 583 | + | line="349">User data that will be passed to @func.</doc> | |
| 584 | + | <type name="gpointer" c:type="gpointer"/> | |
| 585 | + | </parameter> | |
| 586 | + | <parameter name="dnotify" | |
| 587 | + | transfer-ownership="none" | |
| 588 | + | nullable="1" | |
| 589 | + | allow-none="1" | |
| 590 | + | scope="async"> | |
| 591 | + | <doc xml:space="preserve" | |
| 592 | + | filename="../pango/pangocairo-context.c" | |
| 593 | + | line="350">Callback that will be called when the | |
| 594 | + | context is freed to release @data</doc> | |
| 595 | + | <type name="GLib.DestroyNotify" c:type="GDestroyNotify"/> | |
| 596 | + | </parameter> | |
| 597 | + | </parameters> | |
| 598 | + | </function> | |
| 599 | + | <function name="create_context" | |
| 600 | + | c:identifier="pango_cairo_create_context" | |
| 601 | + | version="1.22"> | |
| 602 | + | <doc xml:space="preserve" | |
| 603 | + | filename="../pango/pangocairo-context.c" | |
| 604 | + | line="424">Creates a context object set up to match the current transformation | |
| 605 | + | and target surface of the Cairo context. | |
| 606 | + | ||
| 607 | + | This context can then be | |
| 608 | + | used to create a layout using [ctor@Pango.Layout.new]. | |
| 609 | + | ||
| 610 | + | This function is a convenience function that creates a context using | |
| 611 | + | the default font map, then updates it to @cr. If you just need to | |
| 612 | + | create a layout for use with @cr and do not need to access `PangoContext` | |
| 613 | + | directly, you can use [func@create_layout] instead.</doc> | |
| 614 | + | <source-position filename="../pango/pangocairo.h" line="165"/> | |
| 615 | + | <return-value transfer-ownership="full"> | |
| 616 | + | <doc xml:space="preserve" | |
| 617 | + | filename="../pango/pangocairo-context.c" | |
| 618 | + | line="439">the newly created `PangoContext`</doc> | |
| 619 | + | <type name="Pango.Context" c:type="PangoContext*"/> | |
| 620 | + | </return-value> | |
| 621 | + | <parameters> | |
| 622 | + | <parameter name="cr" transfer-ownership="none"> | |
| 623 | + | <doc xml:space="preserve" | |
| 624 | + | filename="../pango/pangocairo-context.c" | |
| 625 | + | line="426">a Cairo context</doc> | |
| 626 | + | <type name="cairo.Context" c:type="cairo_t*"/> | |
| 627 | + | </parameter> | |
| 628 | + | </parameters> | |
| 629 | + | </function> | |
| 630 | + | <function name="create_layout" | |
| 631 | + | c:identifier="pango_cairo_create_layout" | |
| 632 | + | version="1.10"> | |
| 633 | + | <doc xml:space="preserve" | |
| 634 | + | filename="../pango/pangocairo-context.c" | |
| 635 | + | line="458">Creates a layout object set up to match the current transformation | |
| 636 | + | and target surface of the Cairo context. | |
| 637 | + | ||
| 638 | + | This layout can then be used for text measurement with functions | |
| 639 | + | like [method@Pango.Layout.get_size] or drawing with functions like | |
| 640 | + | [func@show_layout]. If you change the transformation or target | |
| 641 | + | surface for @cr, you need to call [func@update_layout]. | |
| 642 | + | ||
| 643 | + | This function is the most convenient way to use Cairo with Pango, | |
| 644 | + | however it is slightly inefficient since it creates a separate | |
| 645 | + | `PangoContext` object for each layout. This might matter in an | |
| 646 | + | application that was laying out large amounts of text.</doc> | |
| 647 | + | <source-position filename="../pango/pangocairo.h" line="167"/> | |
| 648 | + | <return-value transfer-ownership="full"> | |
| 649 | + | <doc xml:space="preserve" | |
| 650 | + | filename="../pango/pangocairo-context.c" | |
| 651 | + | line="475">the newly created `PangoLayout`</doc> | |
| 652 | + | <type name="Pango.Layout" c:type="PangoLayout*"/> | |
| 653 | + | </return-value> | |
| 654 | + | <parameters> | |
| 655 | + | <parameter name="cr" transfer-ownership="none"> | |
| 656 | + | <doc xml:space="preserve" | |
| 657 | + | filename="../pango/pangocairo-context.c" | |
| 658 | + | line="460">a Cairo context</doc> | |
| 659 | + | <type name="cairo.Context" c:type="cairo_t*"/> | |
| 660 | + | </parameter> | |
| 661 | + | </parameters> | |
| 662 | + | </function> | |
| 663 | + | <function name="error_underline_path" | |
| 664 | + | c:identifier="pango_cairo_error_underline_path" | |
| 665 | + | version="1.14"> | |
| 666 | + | <doc xml:space="preserve" | |
| 667 | + | filename="../pango/pangocairo-render.c" | |
| 668 | + | line="1244">Add a squiggly line to the current path in the specified cairo context that | |
| 669 | + | approximately covers the given rectangle in the style of an underline used | |
| 670 | + | to indicate a spelling error. | |
| 671 | + | ||
| 672 | + | The width of the underline is rounded to an integer number of up/down | |
| 673 | + | segments and the resulting rectangle is centered in the original rectangle.</doc> | |
| 674 | + | <source-position filename="../pango/pangocairo.h" line="212"/> | |
| 675 | + | <return-value transfer-ownership="none"> | |
| 676 | + | <type name="none" c:type="void"/> | |
| 677 | + | </return-value> | |
| 678 | + | <parameters> | |
| 679 | + | <parameter name="cr" transfer-ownership="none"> | |
| 680 | + | <doc xml:space="preserve" | |
| 681 | + | filename="../pango/pangocairo-render.c" | |
| 682 | + | line="1246">a Cairo context</doc> | |
| 683 | + | <type name="cairo.Context" c:type="cairo_t*"/> | |
| 684 | + | </parameter> | |
| 685 | + | <parameter name="x" transfer-ownership="none"> | |
| 686 | + | <doc xml:space="preserve" | |
| 687 | + | filename="../pango/pangocairo-render.c" | |
| 688 | + | line="1247">The X coordinate of one corner of the rectangle</doc> | |
| 689 | + | <type name="gdouble" c:type="double"/> | |
| 690 | + | </parameter> | |
| 691 | + | <parameter name="y" transfer-ownership="none"> | |
| 692 | + | <doc xml:space="preserve" | |
| 693 | + | filename="../pango/pangocairo-render.c" | |
| 694 | + | line="1248">The Y coordinate of one corner of the rectangle</doc> | |
| 695 | + | <type name="gdouble" c:type="double"/> | |
| 696 | + | </parameter> | |
| 697 | + | <parameter name="width" transfer-ownership="none"> | |
| 698 | + | <doc xml:space="preserve" | |
| 699 | + | filename="../pango/pangocairo-render.c" | |
| 700 | + | line="1249">Non-negative width of the rectangle</doc> | |
| 701 | + | <type name="gdouble" c:type="double"/> | |
| 702 | + | </parameter> | |
| 703 | + | <parameter name="height" transfer-ownership="none"> | |
| 704 | + | <doc xml:space="preserve" | |
| 705 | + | filename="../pango/pangocairo-render.c" | |
| 706 | + | line="1250">Non-negative height of the rectangle</doc> | |
| 707 | + | <type name="gdouble" c:type="double"/> | |
| 708 | + | </parameter> | |
| 709 | + | </parameters> | |
| 710 | + | </function> | |
| 711 | + | <function name="font_map_get_default" | |
| 712 | + | c:identifier="pango_cairo_font_map_get_default" | |
| 713 | + | moved-to="FontMap.get_default" | |
| 714 | + | version="1.10"> | |
| 715 | + | <doc xml:space="preserve" | |
| 716 | + | filename="../pango/pangocairo-fontmap.c" | |
| 717 | + | line="151">Gets a default `PangoCairoFontMap` to use with Cairo. | |
| 718 | + | ||
| 719 | + | Note that the type of the returned object will depend on the | |
| 720 | + | particular font backend Cairo was compiled to use; you generally | |
| 721 | + | should only use the `PangoFontMap` and `PangoCairoFontMap` | |
| 722 | + | interfaces on the returned object. | |
| 723 | + | ||
| 724 | + | The default Cairo fontmap can be changed by using | |
| 725 | + | [method@PangoCairo.FontMap.set_default]. This can be used to | |
| 726 | + | change the Cairo font backend that the default fontmap uses | |
| 727 | + | for example. | |
| 728 | + | ||
| 729 | + | Note that since Pango 1.32.6, the default fontmap is per-thread. | |
| 730 | + | Each thread gets its own default fontmap. In this way, PangoCairo | |
| 731 | + | can be used safely from multiple threads.</doc> | |
| 732 | + | <source-position filename="../pango/pangocairo.h" line="110"/> | |
| 733 | + | <return-value transfer-ownership="none"> | |
| 734 | + | <doc xml:space="preserve" | |
| 735 | + | filename="../pango/pangocairo-fontmap.c" | |
| 736 | + | line="170">the default PangoCairo fontmap | |
| 737 | + | for the current thread. This object is owned by Pango and must | |
| 738 | + | not be freed.</doc> | |
| 739 | + | <type name="Pango.FontMap" c:type="PangoFontMap*"/> | |
| 740 | + | </return-value> | |
| 741 | + | </function> | |
| 742 | + | <function name="font_map_new" | |
| 743 | + | c:identifier="pango_cairo_font_map_new" | |
| 744 | + | moved-to="FontMap.new" | |
| 745 | + | version="1.10"> | |
| 746 | + | <doc xml:space="preserve" | |
| 747 | + | filename="../pango/pangocairo-fontmap.c" | |
| 748 | + | line="47">Creates a new `PangoCairoFontMap` object. | |
| 749 | + | ||
| 750 | + | A fontmap is used to cache information about available fonts, | |
| 751 | + | and holds certain global parameters such as the resolution. | |
| 752 | + | In most cases, you can use `func@PangoCairo.font_map_get_default] | |
| 753 | + | instead. | |
| 754 | + | ||
| 755 | + | Note that the type of the returned object will depend | |
| 756 | + | on the particular font backend Cairo was compiled to use; | |
| 757 | + | You generally should only use the `PangoFontMap` and | |
| 758 | + | `PangoCairoFontMap` interfaces on the returned object. | |
| 759 | + | ||
| 760 | + | You can override the type of backend returned by using an | |
| 761 | + | environment variable %PANGOCAIRO_BACKEND. Supported types, | |
| 762 | + | based on your build, are fc (fontconfig), win32, and coretext. | |
| 763 | + | If requested type is not available, NULL is returned. Ie. | |
| 764 | + | this is only useful for testing, when at least two backends | |
| 765 | + | are compiled in.</doc> | |
| 766 | + | <source-position filename="../pango/pangocairo.h" line="106"/> | |
| 767 | + | <return-value transfer-ownership="full"> | |
| 768 | + | <doc xml:space="preserve" | |
| 769 | + | filename="../pango/pangocairo-fontmap.c" | |
| 770 | + | line="69">the newly allocated `PangoFontMap`, | |
| 771 | + | which should be freed with g_object_unref().</doc> | |
| 772 | + | <type name="Pango.FontMap" c:type="PangoFontMap*"/> | |
| 773 | + | </return-value> | |
| 774 | + | </function> | |
| 775 | + | <function name="font_map_new_for_font_type" | |
| 776 | + | c:identifier="pango_cairo_font_map_new_for_font_type" | |
| 777 | + | moved-to="FontMap.new_for_font_type" | |
| 778 | + | version="1.18"> | |
| 779 | + | <doc xml:space="preserve" | |
| 780 | + | filename="../pango/pangocairo-fontmap.c" | |
| 781 | + | line="110">Creates a new `PangoCairoFontMap` object of the type suitable | |
| 782 | + | to be used with cairo font backend of type @fonttype. | |
| 783 | + | ||
| 784 | + | In most cases one should simply use [func@PangoCairo.FontMap.new], or | |
| 785 | + | in fact in most of those cases, just use [func@PangoCairo.FontMap.get_default].</doc> | |
| 786 | + | <source-position filename="../pango/pangocairo.h" line="108"/> | |
| 787 | + | <return-value transfer-ownership="full" nullable="1"> | |
| 788 | + | <doc xml:space="preserve" | |
| 789 | + | filename="../pango/pangocairo-fontmap.c" | |
| 790 | + | line="120">the newly allocated | |
| 791 | + | `PangoFontMap` of suitable type which should be freed with | |
| 792 | + | g_object_unref(), or %NULL if the requested cairo font backend | |
| 793 | + | is not supported / compiled in.</doc> | |
| 794 | + | <type name="Pango.FontMap" c:type="PangoFontMap*"/> | |
| 795 | + | </return-value> | |
| 796 | + | <parameters> | |
| 797 | + | <parameter name="fonttype" transfer-ownership="none"> | |
| 798 | + | <doc xml:space="preserve" | |
| 799 | + | filename="../pango/pangocairo-fontmap.c" | |
| 800 | + | line="112">desired #cairo_font_type_t</doc> | |
| 801 | + | <type name="cairo.FontType" c:type="cairo_font_type_t"/> | |
| 802 | + | </parameter> | |
| 803 | + | </parameters> | |
| 804 | + | </function> | |
| 805 | + | <function name="glyph_string_path" | |
| 806 | + | c:identifier="pango_cairo_glyph_string_path" | |
| 807 | + | version="1.10"> | |
| 808 | + | <doc xml:space="preserve" | |
| 809 | + | filename="../pango/pangocairo-render.c" | |
| 810 | + | line="1173">Adds the glyphs in @glyphs to the current path in the specified | |
| 811 | + | cairo context. | |
| 812 | + | ||
| 813 | + | The origin of the glyphs (the left edge of the baseline) | |
| 814 | + | will be at the current point of the cairo context.</doc> | |
| 815 | + | <source-position filename="../pango/pangocairo.h" line="201"/> | |
| 816 | + | <return-value transfer-ownership="none"> | |
| 817 | + | <type name="none" c:type="void"/> | |
| 818 | + | </return-value> | |
| 819 | + | <parameters> | |
| 820 | + | <parameter name="cr" transfer-ownership="none"> | |
| 821 | + | <doc xml:space="preserve" | |
| 822 | + | filename="../pango/pangocairo-render.c" | |
| 823 | + | line="1175">a Cairo context</doc> | |
| 824 | + | <type name="cairo.Context" c:type="cairo_t*"/> | |
| 825 | + | </parameter> | |
| 826 | + | <parameter name="font" transfer-ownership="none"> | |
| 827 | + | <doc xml:space="preserve" | |
| 828 | + | filename="../pango/pangocairo-render.c" | |
| 829 | + | line="1176">a `PangoFont` from a `PangoCairoFontMap`</doc> | |
| 830 | + | <type name="Pango.Font" c:type="PangoFont*"/> | |
| 831 | + | </parameter> | |
| 832 | + | <parameter name="glyphs" transfer-ownership="none"> | |
| 833 | + | <doc xml:space="preserve" | |
| 834 | + | filename="../pango/pangocairo-render.c" | |
| 835 | + | line="1177">a `PangoGlyphString`</doc> | |
| 836 | + | <type name="Pango.GlyphString" c:type="PangoGlyphString*"/> | |
| 837 | + | </parameter> | |
| 838 | + | </parameters> | |
| 839 | + | </function> | |
| 840 | + | <function name="layout_line_path" | |
| 841 | + | c:identifier="pango_cairo_layout_line_path" | |
| 842 | + | version="1.10"> | |
| 843 | + | <doc xml:space="preserve" | |
| 844 | + | filename="../pango/pangocairo-render.c" | |
| 845 | + | line="1198">Adds the text in `PangoLayoutLine` to the current path in the | |
| 846 | + | specified cairo context. | |
| 847 | + | ||
| 848 | + | The origin of the glyphs (the left edge of the line) will be | |
| 849 | + | at the current point of the cairo context.</doc> | |
| 850 | + | <source-position filename="../pango/pangocairo.h" line="205"/> | |
| 851 | + | <return-value transfer-ownership="none"> | |
| 852 | + | <type name="none" c:type="void"/> | |
| 853 | + | </return-value> | |
| 854 | + | <parameters> | |
| 855 | + | <parameter name="cr" transfer-ownership="none"> | |
| 856 | + | <doc xml:space="preserve" | |
| 857 | + | filename="../pango/pangocairo-render.c" | |
| 858 | + | line="1200">a Cairo context</doc> | |
| 859 | + | <type name="cairo.Context" c:type="cairo_t*"/> | |
| 860 | + | </parameter> | |
| 861 | + | <parameter name="line" transfer-ownership="none"> | |
| 862 | + | <doc xml:space="preserve" | |
| 863 | + | filename="../pango/pangocairo-render.c" | |
| 864 | + | line="1201">a `PangoLayoutLine`</doc> | |
| 865 | + | <type name="Pango.LayoutLine" c:type="PangoLayoutLine*"/> | |
| 866 | + | </parameter> | |
| 867 | + | </parameters> | |
| 868 | + | </function> | |
| 869 | + | <function name="layout_path" | |
| 870 | + | c:identifier="pango_cairo_layout_path" | |
| 871 | + | version="1.10"> | |
| 872 | + | <doc xml:space="preserve" | |
| 873 | + | filename="../pango/pangocairo-render.c" | |
| 874 | + | line="1221">Adds the text in a `PangoLayout` to the current path in the | |
| 875 | + | specified cairo context. | |
| 876 | + | ||
| 877 | + | The top-left corner of the `PangoLayout` will be at the | |
| 878 | + | current point of the cairo context.</doc> | |
| 879 | + | <source-position filename="../pango/pangocairo.h" line="208"/> | |
| 880 | + | <return-value transfer-ownership="none"> | |
| 881 | + | <type name="none" c:type="void"/> | |
| 882 | + | </return-value> | |
| 883 | + | <parameters> | |
| 884 | + | <parameter name="cr" transfer-ownership="none"> | |
| 885 | + | <doc xml:space="preserve" | |
| 886 | + | filename="../pango/pangocairo-render.c" | |
| 887 | + | line="1223">a Cairo context</doc> | |
| 888 | + | <type name="cairo.Context" c:type="cairo_t*"/> | |
| 889 | + | </parameter> | |
| 890 | + | <parameter name="layout" transfer-ownership="none"> | |
| 891 | + | <doc xml:space="preserve" | |
| 892 | + | filename="../pango/pangocairo-render.c" | |
| 893 | + | line="1224">a Pango layout</doc> | |
| 894 | + | <type name="Pango.Layout" c:type="PangoLayout*"/> | |
| 895 | + | </parameter> | |
| 896 | + | </parameters> | |
| 897 | + | </function> | |
| 898 | + | <function name="show_error_underline" | |
| 899 | + | c:identifier="pango_cairo_show_error_underline" | |
| 900 | + | version="1.14"> | |
| 901 | + | <doc xml:space="preserve" | |
| 902 | + | filename="../pango/pangocairo-render.c" | |
| 903 | + | line="1142">Draw a squiggly line in the specified cairo context that approximately | |
| 904 | + | covers the given rectangle in the style of an underline used to indicate a | |
| 905 | + | spelling error. | |
| 906 | + | ||
| 907 | + | The width of the underline is rounded to an integer | |
| 908 | + | number of up/down segments and the resulting rectangle is centered in the | |
| 909 | + | original rectangle.</doc> | |
| 910 | + | <source-position filename="../pango/pangocairo.h" line="191"/> | |
| 911 | + | <return-value transfer-ownership="none"> | |
| 912 | + | <type name="none" c:type="void"/> | |
| 913 | + | </return-value> | |
| 914 | + | <parameters> | |
| 915 | + | <parameter name="cr" transfer-ownership="none"> | |
| 916 | + | <doc xml:space="preserve" | |
| 917 | + | filename="../pango/pangocairo-render.c" | |
| 918 | + | line="1144">a Cairo context</doc> | |
| 919 | + | <type name="cairo.Context" c:type="cairo_t*"/> | |
| 920 | + | </parameter> | |
| 921 | + | <parameter name="x" transfer-ownership="none"> | |
| 922 | + | <doc xml:space="preserve" | |
| 923 | + | filename="../pango/pangocairo-render.c" | |
| 924 | + | line="1145">The X coordinate of one corner of the rectangle</doc> | |
| 925 | + | <type name="gdouble" c:type="double"/> | |
| 926 | + | </parameter> | |
| 927 | + | <parameter name="y" transfer-ownership="none"> | |
| 928 | + | <doc xml:space="preserve" | |
| 929 | + | filename="../pango/pangocairo-render.c" | |
| 930 | + | line="1146">The Y coordinate of one corner of the rectangle</doc> | |
| 931 | + | <type name="gdouble" c:type="double"/> | |
| 932 | + | </parameter> | |
| 933 | + | <parameter name="width" transfer-ownership="none"> | |
| 934 | + | <doc xml:space="preserve" | |
| 935 | + | filename="../pango/pangocairo-render.c" | |
| 936 | + | line="1147">Non-negative width of the rectangle</doc> | |
| 937 | + | <type name="gdouble" c:type="double"/> | |
| 938 | + | </parameter> | |
| 939 | + | <parameter name="height" transfer-ownership="none"> | |
| 940 | + | <doc xml:space="preserve" | |
| 941 | + | filename="../pango/pangocairo-render.c" | |
| 942 | + | line="1148">Non-negative height of the rectangle</doc> | |
| 943 | + | <type name="gdouble" c:type="double"/> | |
| 944 | + | </parameter> | |
| 945 | + | </parameters> | |
| 946 | + | </function> | |
| 947 | + | <function name="show_glyph_item" | |
| 948 | + | c:identifier="pango_cairo_show_glyph_item" | |
| 949 | + | version="1.22"> | |
| 950 | + | <doc xml:space="preserve" | |
| 951 | + | filename="../pango/pangocairo-render.c" | |
| 952 | + | line="1066">Draws the glyphs in @glyph_item in the specified cairo context, | |
| 953 | + | ||
| 954 | + | embedding the text associated with the glyphs in the output if the | |
| 955 | + | output format supports it (PDF for example), otherwise it acts | |
| 956 | + | similar to [func@show_glyph_string]. | |
| 957 | + | ||
| 958 | + | The origin of the glyphs (the left edge of the baseline) will | |
| 959 | + | be drawn at the current point of the cairo context. | |
| 960 | + | ||
| 961 | + | Note that @text is the start of the text for layout, which is then | |
| 962 | + | indexed by `glyph_item->item->offset`.</doc> | |
| 963 | + | <source-position filename="../pango/pangocairo.h" line="180"/> | |
| 964 | + | <return-value transfer-ownership="none"> | |
| 965 | + | <type name="none" c:type="void"/> | |
| 966 | + | </return-value> | |
| 967 | + | <parameters> | |
| 968 | + | <parameter name="cr" transfer-ownership="none"> | |
| 969 | + | <doc xml:space="preserve" | |
| 970 | + | filename="../pango/pangocairo-render.c" | |
| 971 | + | line="1068">a Cairo context</doc> | |
| 972 | + | <type name="cairo.Context" c:type="cairo_t*"/> | |
| 973 | + | </parameter> | |
| 974 | + | <parameter name="text" transfer-ownership="none"> | |
| 975 | + | <doc xml:space="preserve" | |
| 976 | + | filename="../pango/pangocairo-render.c" | |
| 977 | + | line="1069">the UTF-8 text that @glyph_item refers to</doc> | |
| 978 | + | <type name="utf8" c:type="const char*"/> | |
| 979 | + | </parameter> | |
| 980 | + | <parameter name="glyph_item" transfer-ownership="none"> | |
| 981 | + | <doc xml:space="preserve" | |
| 982 | + | filename="../pango/pangocairo-render.c" | |
| 983 | + | line="1070">a `PangoGlyphItem`</doc> | |
| 984 | + | <type name="Pango.GlyphItem" c:type="PangoGlyphItem*"/> | |
| 985 | + | </parameter> | |
| 986 | + | </parameters> | |
| 987 | + | </function> | |
| 988 | + | <function name="show_glyph_string" | |
| 989 | + | c:identifier="pango_cairo_show_glyph_string" | |
| 990 | + | version="1.10"> | |
| 991 | + | <doc xml:space="preserve" | |
| 992 | + | filename="../pango/pangocairo-render.c" | |
| 993 | + | line="1041">Draws the glyphs in @glyphs in the specified cairo context. | |
| 994 | + | ||
| 995 | + | The origin of the glyphs (the left edge of the baseline) will | |
| 996 | + | be drawn at the current point of the cairo context.</doc> | |
| 997 | + | <source-position filename="../pango/pangocairo.h" line="176"/> | |
| 998 | + | <return-value transfer-ownership="none"> | |
| 999 | + | <type name="none" c:type="void"/> | |
| 1000 | + | </return-value> | |
| 1001 | + | <parameters> | |
| 1002 | + | <parameter name="cr" transfer-ownership="none"> | |
| 1003 | + | <doc xml:space="preserve" | |
| 1004 | + | filename="../pango/pangocairo-render.c" | |
| 1005 | + | line="1043">a Cairo context</doc> | |
| 1006 | + | <type name="cairo.Context" c:type="cairo_t*"/> | |
| 1007 | + | </parameter> | |
| 1008 | + | <parameter name="font" transfer-ownership="none"> | |
| 1009 | + | <doc xml:space="preserve" | |
| 1010 | + | filename="../pango/pangocairo-render.c" | |
| 1011 | + | line="1044">a `PangoFont` from a `PangoCairoFontMap`</doc> | |
| 1012 | + | <type name="Pango.Font" c:type="PangoFont*"/> | |
| 1013 | + | </parameter> | |
| 1014 | + | <parameter name="glyphs" transfer-ownership="none"> | |
| 1015 | + | <doc xml:space="preserve" | |
| 1016 | + | filename="../pango/pangocairo-render.c" | |
| 1017 | + | line="1045">a `PangoGlyphString`</doc> | |
| 1018 | + | <type name="Pango.GlyphString" c:type="PangoGlyphString*"/> | |
| 1019 | + | </parameter> | |
| 1020 | + | </parameters> | |
| 1021 | + | </function> | |
| 1022 | + | <function name="show_layout" | |
| 1023 | + | c:identifier="pango_cairo_show_layout" | |
| 1024 | + | version="1.10"> | |
| 1025 | + | <doc xml:space="preserve" | |
| 1026 | + | filename="../pango/pangocairo-render.c" | |
| 1027 | + | line="1120">Draws a `PangoLayout` in the specified cairo context. | |
| 1028 | + | ||
| 1029 | + | The top-left corner of the `PangoLayout` will be drawn | |
| 1030 | + | at the current point of the cairo context.</doc> | |
| 1031 | + | <source-position filename="../pango/pangocairo.h" line="187"/> | |
| 1032 | + | <return-value transfer-ownership="none"> | |
| 1033 | + | <type name="none" c:type="void"/> | |
| 1034 | + | </return-value> | |
| 1035 | + | <parameters> | |
| 1036 | + | <parameter name="cr" transfer-ownership="none"> | |
| 1037 | + | <doc xml:space="preserve" | |
| 1038 | + | filename="../pango/pangocairo-render.c" | |
| 1039 | + | line="1122">a Cairo context</doc> | |
| 1040 | + | <type name="cairo.Context" c:type="cairo_t*"/> | |
| 1041 | + | </parameter> | |
| 1042 | + | <parameter name="layout" transfer-ownership="none"> | |
| 1043 | + | <doc xml:space="preserve" | |
| 1044 | + | filename="../pango/pangocairo-render.c" | |
| 1045 | + | line="1123">a Pango layout</doc> | |
| 1046 | + | <type name="Pango.Layout" c:type="PangoLayout*"/> | |
| 1047 | + | </parameter> | |
| 1048 | + | </parameters> | |
| 1049 | + | </function> | |
| 1050 | + | <function name="show_layout_line" | |
| 1051 | + | c:identifier="pango_cairo_show_layout_line" | |
| 1052 | + | version="1.10"> | |
| 1053 | + | <doc xml:space="preserve" | |
| 1054 | + | filename="../pango/pangocairo-render.c" | |
| 1055 | + | line="1098">Draws a `PangoLayoutLine` in the specified cairo context. | |
| 1056 | + | ||
| 1057 | + | The origin of the glyphs (the left edge of the line) will | |
| 1058 | + | be drawn at the current point of the cairo context.</doc> | |
| 1059 | + | <source-position filename="../pango/pangocairo.h" line="184"/> | |
| 1060 | + | <return-value transfer-ownership="none"> | |
| 1061 | + | <type name="none" c:type="void"/> | |
| 1062 | + | </return-value> | |
| 1063 | + | <parameters> | |
| 1064 | + | <parameter name="cr" transfer-ownership="none"> | |
| 1065 | + | <doc xml:space="preserve" | |
| 1066 | + | filename="../pango/pangocairo-render.c" | |
| 1067 | + | line="1100">a Cairo context</doc> | |
| 1068 | + | <type name="cairo.Context" c:type="cairo_t*"/> | |
| 1069 | + | </parameter> | |
| 1070 | + | <parameter name="line" transfer-ownership="none"> | |
| 1071 | + | <doc xml:space="preserve" | |
| 1072 | + | filename="../pango/pangocairo-render.c" | |
| 1073 | + | line="1101">a `PangoLayoutLine`</doc> | |
| 1074 | + | <type name="Pango.LayoutLine" c:type="PangoLayoutLine*"/> | |
| 1075 | + | </parameter> | |
| 1076 | + | </parameters> | |
| 1077 | + | </function> | |
| 1078 | + | <function name="update_context" | |
| 1079 | + | c:identifier="pango_cairo_update_context" | |
| 1080 | + | version="1.10"> | |
| 1081 | + | <doc xml:space="preserve" | |
| 1082 | + | filename="../pango/pangocairo-context.c" | |
| 1083 | + | line="158">Updates a `PangoContext` previously created for use with Cairo to | |
| 1084 | + | match the current transformation and target surface of a Cairo | |
| 1085 | + | context. | |
| 1086 | + | ||
| 1087 | + | If any layouts have been created for the context, it's necessary | |
| 1088 | + | to call [method@Pango.Layout.context_changed] on those layouts.</doc> | |
| 1089 | + | <source-position filename="../pango/pangocairo.h" line="138"/> | |
| 1090 | + | <return-value transfer-ownership="none"> | |
| 1091 | + | <type name="none" c:type="void"/> | |
| 1092 | + | </return-value> | |
| 1093 | + | <parameters> | |
| 1094 | + | <parameter name="cr" transfer-ownership="none"> | |
| 1095 | + | <doc xml:space="preserve" | |
| 1096 | + | filename="../pango/pangocairo-context.c" | |
| 1097 | + | line="160">a Cairo context</doc> | |
| 1098 | + | <type name="cairo.Context" c:type="cairo_t*"/> | |
| 1099 | + | </parameter> | |
| 1100 | + | <parameter name="context" transfer-ownership="none"> | |
| 1101 | + | <doc xml:space="preserve" | |
| 1102 | + | filename="../pango/pangocairo-context.c" | |
| 1103 | + | line="161">a `PangoContext`, from a pangocairo font map</doc> | |
| 1104 | + | <type name="Pango.Context" c:type="PangoContext*"/> | |
| 1105 | + | </parameter> | |
| 1106 | + | </parameters> | |
| 1107 | + | </function> | |
| 1108 | + | <function name="update_layout" | |
| 1109 | + | c:identifier="pango_cairo_update_layout" | |
| 1110 | + | version="1.10"> | |
| 1111 | + | <doc xml:space="preserve" | |
| 1112 | + | filename="../pango/pangocairo-context.c" | |
| 1113 | + | line="494">Updates the private `PangoContext` of a `PangoLayout` created with | |
| 1114 | + | [func@create_layout] to match the current transformation and target | |
| 1115 | + | surface of a Cairo context.</doc> | |
| 1116 | + | <source-position filename="../pango/pangocairo.h" line="169"/> | |
| 1117 | + | <return-value transfer-ownership="none"> | |
| 1118 | + | <type name="none" c:type="void"/> | |
| 1119 | + | </return-value> | |
| 1120 | + | <parameters> | |
| 1121 | + | <parameter name="cr" transfer-ownership="none"> | |
| 1122 | + | <doc xml:space="preserve" | |
| 1123 | + | filename="../pango/pangocairo-context.c" | |
| 1124 | + | line="496">a Cairo context</doc> | |
| 1125 | + | <type name="cairo.Context" c:type="cairo_t*"/> | |
| 1126 | + | </parameter> | |
| 1127 | + | <parameter name="layout" transfer-ownership="none"> | |
| 1128 | + | <doc xml:space="preserve" | |
| 1129 | + | filename="../pango/pangocairo-context.c" | |
| 1130 | + | line="497">a `PangoLayout`, from [func@create_layout]</doc> | |
| 1131 | + | <type name="Pango.Layout" c:type="PangoLayout*"/> | |
| 1132 | + | </parameter> | |
| 1133 | + | </parameters> | |
| 1134 | + | </function> | |
| 1135 | + | </namespace> | |
| 1136 | + | </repository> | |
A internal/gir/spec/cairo-1.0.gir +688 -0
| @@ -0,0 +1,688 @@ | |||
| 1 | + | <?xml version="1.0"?> | |
| 2 | + | <repository version="1.2" | |
| 3 | + | xmlns="http://www.gtk.org/introspection/core/1.0" | |
| 4 | + | xmlns:c="http://www.gtk.org/introspection/c/1.0" | |
| 5 | + | xmlns:glib="http://www.gtk.org/introspection/glib/1.0"> | |
| 6 | + | <package name="cairo-gobject"/> | |
| 7 | + | <c:include name="cairo-gobject.h"/> | |
| 8 | + | <namespace name="cairo" version="1.0" | |
| 9 | + | shared-library="libcairo-gobject.so.2" | |
| 10 | + | c:identifier-prefixes="cairo" | |
| 11 | + | c:symbol-prefixes="cairo"> | |
| 12 | + | <record name="Context" c:type="cairo_t" foreign="1" | |
| 13 | + | glib:type-name="CairoContext" | |
| 14 | + | glib:get-type="cairo_gobject_context_get_type"/> | |
| 15 | + | <record name="Device" c:type="cairo_device_t" foreign="1" | |
| 16 | + | glib:type-name="CairoDevice" | |
| 17 | + | glib:get-type="cairo_gobject_device_get_type"/> | |
| 18 | + | <record name="Surface" c:type="cairo_surface_t" foreign="1" | |
| 19 | + | glib:type-name="CairoSurface" | |
| 20 | + | glib:get-type="cairo_gobject_surface_get_type"/> | |
| 21 | + | <record name="Matrix" c:type="cairo_matrix_t" foreign="1"/> | |
| 22 | + | <record name="Pattern" c:type="cairo_pattern_t" foreign="1" | |
| 23 | + | glib:type-name="CairoPattern" | |
| 24 | + | glib:get-type="cairo_gobject_pattern_get_type"/> | |
| 25 | + | <record name="Region" c:type="cairo_region_t" foreign="1" | |
| 26 | + | glib:type-name="CairoRegion" | |
| 27 | + | glib:get-type="cairo_gobject_region_get_type"/> | |
| 28 | + | <enumeration name="Status" c:type="cairo_status_t" | |
| 29 | + | glib:type-name="cairo_status_t" | |
| 30 | + | glib:get-type="cairo_gobject_status_get_type"> | |
| 31 | + | <member name="success" | |
| 32 | + | value="0" | |
| 33 | + | c:identifier="CAIRO_STATUS_SUCCESS"/> | |
| 34 | + | <member name="no_memory" | |
| 35 | + | value="1" | |
| 36 | + | c:identifier="CAIRO_STATUS_NO_MEMORY"/> | |
| 37 | + | <member name="invalid_restore" | |
| 38 | + | value="2" | |
| 39 | + | c:identifier="CAIRO_STATUS_INVALID_RESTORE"/> | |
| 40 | + | <member name="invalid_pop_group" | |
| 41 | + | value="3" | |
| 42 | + | c:identifier="CAIRO_STATUS_INVALID_POP_GROUP"/> | |
| 43 | + | <member name="no_current_point" | |
| 44 | + | value="4" | |
| 45 | + | c:identifier="CAIRO_STATUS_NO_CURRENT_POINT"/> | |
| 46 | + | <member name="invalid_matrix" | |
| 47 | + | value="5" | |
| 48 | + | c:identifier="CAIRO_STATUS_INVALID_MATRIX"/> | |
| 49 | + | <member name="invalid_status" | |
| 50 | + | value="6" | |
| 51 | + | c:identifier="CAIRO_STATUS_INVALID_STATUS"/> | |
| 52 | + | <member name="null_pointer" | |
| 53 | + | value="7" | |
| 54 | + | c:identifier="CAIRO_STATUS_NULL_POINTER"/> | |
| 55 | + | <member name="invalid_string" | |
| 56 | + | value="8" | |
| 57 | + | c:identifier="CAIRO_STATUS_INVALID_STRING"/> | |
| 58 | + | <member name="invalid_path_data" | |
| 59 | + | value="9" | |
| 60 | + | c:identifier="CAIRO_STATUS_INVALID_PATH_DATA"/> | |
| 61 | + | <member name="read_error" | |
| 62 | + | value="10" | |
| 63 | + | c:identifier="CAIRO_STATUS_READ_ERROR"/> | |
| 64 | + | <member name="write_error" | |
| 65 | + | value="11" | |
| 66 | + | c:identifier="CAIRO_STATUS_WRITE_ERROR"/> | |
| 67 | + | <member name="surface_finished" | |
| 68 | + | value="12" | |
| 69 | + | c:identifier="CAIRO_STATUS_SURFACE_FINISHED"/> | |
| 70 | + | <member name="surface_type_mismatch" | |
| 71 | + | value="13" | |
| 72 | + | c:identifier="CAIRO_STATUS_SURFACE_TYPE_MISMATCH"/> | |
| 73 | + | <member name="pattern_type_mismatch" | |
| 74 | + | value="14" | |
| 75 | + | c:identifier="CAIRO_STATUS_PATTERN_TYPE_MISMATCH"/> | |
| 76 | + | <member name="invalid_content" | |
| 77 | + | value="15" | |
| 78 | + | c:identifier="CAIRO_STATUS_INVALID_CONTENT"/> | |
| 79 | + | <member name="invalid_format" | |
| 80 | + | value="16" | |
| 81 | + | c:identifier="CAIRO_STATUS_INVALID_FORMAT"/> | |
| 82 | + | <member name="invalid_visual" | |
| 83 | + | value="17" | |
| 84 | + | c:identifier="CAIRO_STATUS_INVALID_VISUAL"/> | |
| 85 | + | <member name="file_not_found" | |
| 86 | + | value="18" | |
| 87 | + | c:identifier="CAIRO_STATUS_FILE_NOT_FOUND"/> | |
| 88 | + | <member name="invalid_dash" | |
| 89 | + | value="19" | |
| 90 | + | c:identifier="CAIRO_STATUS_INVALID_DASH"/> | |
| 91 | + | <member name="invalid_dsc_comment" | |
| 92 | + | value="20" | |
| 93 | + | c:identifier="CAIRO_STATUS_INVALID_DSC_COMMENT"/> | |
| 94 | + | <member name="invalid_index" | |
| 95 | + | value="21" | |
| 96 | + | c:identifier="CAIRO_STATUS_INVALID_INDEX"/> | |
| 97 | + | <member name="clip_not_representable" | |
| 98 | + | value="22" | |
| 99 | + | c:identifier="CAIRO_STATUS_CLIP_NOT_REPRESENTABLE"/> | |
| 100 | + | <member name="temp_file_error" | |
| 101 | + | value="23" | |
| 102 | + | c:identifier="CAIRO_STATUS_TEMP_FILE_ERROR"/> | |
| 103 | + | <member name="invalid_stride" | |
| 104 | + | value="24" | |
| 105 | + | c:identifier="CAIRO_STATUS_INVALID_STRIDE"/> | |
| 106 | + | <member name="font_type_mismatch" | |
| 107 | + | value="25" | |
| 108 | + | c:identifier="CAIRO_STATUS_FONT_TYPE_MISMATCH"/> | |
| 109 | + | <member name="user_font_immutable" | |
| 110 | + | value="26" | |
| 111 | + | c:identifier="CAIRO_STATUS_USER_FONT_IMMUTABLE"/> | |
| 112 | + | <member name="user_font_error" | |
| 113 | + | value="27" | |
| 114 | + | c:identifier="CAIRO_STATUS_USER_FONT_ERROR"/> | |
| 115 | + | <member name="negative_count" | |
| 116 | + | value="28" | |
| 117 | + | c:identifier="CAIRO_STATUS_NEGATIVE_COUNT"/> | |
| 118 | + | <member name="invalid_clusters" | |
| 119 | + | value="29" | |
| 120 | + | c:identifier="CAIRO_STATUS_INVALID_CLUSTERS"/> | |
| 121 | + | <member name="invalid_slant" | |
| 122 | + | value="30" | |
| 123 | + | c:identifier="CAIRO_STATUS_INVALID_SLANT"/> | |
| 124 | + | <member name="invalid_weight" | |
| 125 | + | value="31" | |
| 126 | + | c:identifier="CAIRO_STATUS_INVALID_WEIGHT"/> | |
| 127 | + | <member name="invalid_size" | |
| 128 | + | value="32" | |
| 129 | + | c:identifier="CAIRO_STATUS_INVALID_SIZE"/> | |
| 130 | + | <member name="user_font_not_implemented" | |
| 131 | + | value="33" | |
| 132 | + | c:identifier="CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED"/> | |
| 133 | + | <member name="device_type_mismatch" | |
| 134 | + | value="34" | |
| 135 | + | c:identifier="CAIRO_STATUS_DEVICE_TYPE_MISMATCH"/> | |
| 136 | + | <member name="device_error" | |
| 137 | + | value="35" | |
| 138 | + | c:identifier="CAIRO_STATUS_DEVICE_ERROR"/> | |
| 139 | + | <member name="invalid_mesh_construction" | |
| 140 | + | value="36" | |
| 141 | + | c:identifier="CAIRO_STATUS_INVALID_MESH_CONSTRUCTION"/> | |
| 142 | + | <member name="device_finished" | |
| 143 | + | value="37" | |
| 144 | + | c:identifier="CAIRO_STATUS_DEVICE_FINISHED"/> | |
| 145 | + | <member name="jbig2_global_missing" | |
| 146 | + | value="38" | |
| 147 | + | c:identifier="CAIRO_STATUS_JBIG2_GLOBAL_MISSING"/> | |
| 148 | + | </enumeration> | |
| 149 | + | <enumeration name="Content" c:type="cairo_content_t" | |
| 150 | + | glib:type-name="cairo_content_t" | |
| 151 | + | glib:get-type="cairo_gobject_content_get_type"> | |
| 152 | + | <member name="color" | |
| 153 | + | value="4096" | |
| 154 | + | c:identifier="CAIRO_CONTENT_COLOR"/> | |
| 155 | + | <member name="alpha" | |
| 156 | + | value="8192" | |
| 157 | + | c:identifier="CAIRO_CONTENT_ALPHA"/> | |
| 158 | + | <member name="color_alpha" | |
| 159 | + | value="12288" | |
| 160 | + | c:identifier="CAIRO_CONTENT_COLOR_ALPHA"/> | |
| 161 | + | </enumeration> | |
| 162 | + | <enumeration name="Operator" c:type="cairo_operator_t" | |
| 163 | + | glib:type-name="cairo_operator_t" | |
| 164 | + | glib:get-type="cairo_gobject_operator_get_type"> | |
| 165 | + | <member name="clear" | |
| 166 | + | value="0" | |
| 167 | + | c:identifier="CAIRO_OPERATOR_CLEAR"/> | |
| 168 | + | <member name="source" | |
| 169 | + | value="1" | |
| 170 | + | c:identifier="CAIRO_OPERATOR_SOURCE"/> | |
| 171 | + | <member name="over" | |
| 172 | + | value="2" | |
| 173 | + | c:identifier="CAIRO_OPERATOR_OVER"/> | |
| 174 | + | <member name="in" | |
| 175 | + | value="3" | |
| 176 | + | c:identifier="CAIRO_OPERATOR_IN"/> | |
| 177 | + | <member name="out" | |
| 178 | + | value="4" | |
| 179 | + | c:identifier="CAIRO_OPERATOR_OUT"/> | |
| 180 | + | <member name="atop" | |
| 181 | + | value="5" | |
| 182 | + | c:identifier="CAIRO_OPERATOR_ATOP"/> | |
| 183 | + | <member name="dest" | |
| 184 | + | value="6" | |
| 185 | + | c:identifier="CAIRO_OPERATOR_DEST"/> | |
| 186 | + | <member name="dest_over" | |
| 187 | + | value="7" | |
| 188 | + | c:identifier="CAIRO_OPERATOR_DEST_OVER"/> | |
| 189 | + | <member name="dest_in" | |
| 190 | + | value="8" | |
| 191 | + | c:identifier="CAIRO_OPERATOR_DEST_IN"/> | |
| 192 | + | <member name="dest_out" | |
| 193 | + | value="9" | |
| 194 | + | c:identifier="CAIRO_OPERATOR_DEST_OUT"/> | |
| 195 | + | <member name="dest_atop" | |
| 196 | + | value="10" | |
| 197 | + | c:identifier="CAIRO_OPERATOR_DEST_ATOP"/> | |
| 198 | + | <member name="xor" | |
| 199 | + | value="11" | |
| 200 | + | c:identifier="CAIRO_OPERATOR_XOR"/> | |
| 201 | + | <member name="add" | |
| 202 | + | value="12" | |
| 203 | + | c:identifier="CAIRO_OPERATOR_ADD"/> | |
| 204 | + | <member name="saturate" | |
| 205 | + | value="13" | |
| 206 | + | c:identifier="CAIRO_OPERATOR_SATURATE"/> | |
| 207 | + | <member name="multiply" | |
| 208 | + | value="14" | |
| 209 | + | c:identifier="CAIRO_OPERATOR_MULTIPLY"/> | |
| 210 | + | <member name="screen" | |
| 211 | + | value="15" | |
| 212 | + | c:identifier="CAIRO_OPERATOR_SCREEN"/> | |
| 213 | + | <member name="overlay" | |
| 214 | + | value="16" | |
| 215 | + | c:identifier="CAIRO_OPERATOR_OVERLAY"/> | |
| 216 | + | <member name="darken" | |
| 217 | + | value="17" | |
| 218 | + | c:identifier="CAIRO_OPERATOR_DARKEN"/> | |
| 219 | + | <member name="lighten" | |
| 220 | + | value="18" | |
| 221 | + | c:identifier="CAIRO_OPERATOR_LIGHTEN"/> | |
| 222 | + | <member name="color_dodge" | |
| 223 | + | value="19" | |
| 224 | + | c:identifier="CAIRO_OPERATOR_COLOR_DODGE"/> | |
| 225 | + | <member name="color_burn" | |
| 226 | + | value="20" | |
| 227 | + | c:identifier="CAIRO_OPERATOR_COLOR_BURN"/> | |
| 228 | + | <member name="hard_light" | |
| 229 | + | value="21" | |
| 230 | + | c:identifier="CAIRO_OPERATOR_HARD_LIGHT"/> | |
| 231 | + | <member name="soft_light" | |
| 232 | + | value="22" | |
| 233 | + | c:identifier="CAIRO_OPERATOR_SOFT_LIGHT"/> | |
| 234 | + | <member name="difference" | |
| 235 | + | value="23" | |
| 236 | + | c:identifier="CAIRO_OPERATOR_DIFFERENCE"/> | |
| 237 | + | <member name="exclusion" | |
| 238 | + | value="24" | |
| 239 | + | c:identifier="CAIRO_OPERATOR_EXCLUSION"/> | |
| 240 | + | <member name="hsl_hue" | |
| 241 | + | value="25" | |
| 242 | + | c:identifier="CAIRO_OPERATOR_HSL_HUE"/> | |
| 243 | + | <member name="hsl_saturation" | |
| 244 | + | value="26" | |
| 245 | + | c:identifier="CAIRO_OPERATOR_HSL_SATURATION"/> | |
| 246 | + | <member name="hsl_color" | |
| 247 | + | value="27" | |
| 248 | + | c:identifier="CAIRO_OPERATOR_HSL_COLOR"/> | |
| 249 | + | <member name="hsl_luminosity" | |
| 250 | + | value="28" | |
| 251 | + | c:identifier="CAIRO_OPERATOR_HSL_LUMINOSITY"/> | |
| 252 | + | </enumeration> | |
| 253 | + | <enumeration name="Antialias" c:type="cairo_antialias_t" | |
| 254 | + | glib:type-name="cairo_antialias_t" | |
| 255 | + | glib:get-type="cairo_gobject_antialias_get_type"> | |
| 256 | + | <member name="default" | |
| 257 | + | value="0" | |
| 258 | + | c:identifier="CAIRO_ANTIALIAS_DEFAULT"/> | |
| 259 | + | <member name="none" | |
| 260 | + | value="1" | |
| 261 | + | c:identifier="CAIRO_ANTIALIAS_NONE"/> | |
| 262 | + | <member name="gray" | |
| 263 | + | value="2" | |
| 264 | + | c:identifier="CAIRO_ANTIALIAS_GRAY"/> | |
| 265 | + | <member name="subpixel" | |
| 266 | + | value="3" | |
| 267 | + | c:identifier="CAIRO_ANTIALIAS_SUBPIXEL"/> | |
| 268 | + | <member name="fast" | |
| 269 | + | value="4" | |
| 270 | + | c:identifier="CAIRO_ANTIALIAS_FAST"/> | |
| 271 | + | <member name="good" | |
| 272 | + | value="5" | |
| 273 | + | c:identifier="CAIRO_ANTIALIAS_GOOD"/> | |
| 274 | + | <member name="best" | |
| 275 | + | value="6" | |
| 276 | + | c:identifier="CAIRO_ANTIALIAS_BEST"/> | |
| 277 | + | </enumeration> | |
| 278 | + | <enumeration name="FillRule" c:type="cairo_fill_rule_t" | |
| 279 | + | glib:type-name="cairo_fill_rule_t" | |
| 280 | + | glib:get-type="cairo_gobject_fill_rule_get_type"> | |
| 281 | + | <member name="winding" | |
| 282 | + | value="0" | |
| 283 | + | c:identifier="CAIRO_FILL_RULE_WINDING"/> | |
| 284 | + | <member name="even_odd" | |
| 285 | + | value="1" | |
| 286 | + | c:identifier="CAIRO_FILL_RULE_EVEN_ODD"/> | |
| 287 | + | </enumeration> | |
| 288 | + | <enumeration name="LineCap" c:type="cairo_line_cap_t" | |
| 289 | + | glib:type-name="cairo_line_cap_t" | |
| 290 | + | glib:get-type="cairo_gobject_line_cap_get_type"> | |
| 291 | + | <member name="butt" | |
| 292 | + | value="0" | |
| 293 | + | c:identifier="CAIRO_LINE_CAP_BUTT"/> | |
| 294 | + | <member name="round" | |
| 295 | + | value="1" | |
| 296 | + | c:identifier="CAIRO_LINE_CAP_ROUND"/> | |
| 297 | + | <member name="square" | |
| 298 | + | value="2" | |
| 299 | + | c:identifier="CAIRO_LINE_CAP_SQUARE"/> | |
| 300 | + | </enumeration> | |
| 301 | + | <enumeration name="LineJoin" c:type="cairo_line_join_t" | |
| 302 | + | glib:type-name="cairo_line_join_t" | |
| 303 | + | glib:get-type="cairo_gobject_line_join_get_type"> | |
| 304 | + | <member name="miter" | |
| 305 | + | value="0" | |
| 306 | + | c:identifier="CAIRO_LINE_JOIN_MITER"/> | |
| 307 | + | <member name="round" | |
| 308 | + | value="1" | |
| 309 | + | c:identifier="CAIRO_LINE_JOIN_ROUND"/> | |
| 310 | + | <member name="bevel" | |
| 311 | + | value="2" | |
| 312 | + | c:identifier="CAIRO_LINE_JOIN_BEVEL"/> | |
| 313 | + | </enumeration> | |
| 314 | + | <enumeration name="TextClusterFlags" c:type="cairo_text_cluster_flags_t" | |
| 315 | + | glib:type-name="cairo_text_cluster_flags_t" | |
| 316 | + | glib:get-type="cairo_gobject_text_cluster_flags_get_type"> | |
| 317 | + | <member name="backward" | |
| 318 | + | value="1" | |
| 319 | + | c:identifier="CAIRO_TEXT_CLUSTER_FLAG_BACKWARD"/> | |
| 320 | + | </enumeration> | |
| 321 | + | <enumeration name="FontSlant" c:type="cairo_font_slant_t" | |
| 322 | + | glib:type-name="cairo_font_slant_t" | |
| 323 | + | glib:get-type="cairo_gobject_font_slant_get_type"> | |
| 324 | + | <member name="normal" | |
| 325 | + | value="0" | |
| 326 | + | c:identifier="CAIRO_FONT_SLANT_NORMAL"/> | |
| 327 | + | <member name="italic" | |
| 328 | + | value="1" | |
| 329 | + | c:identifier="CAIRO_FONT_SLANT_ITALIC"/> | |
| 330 | + | <member name="oblique" | |
| 331 | + | value="2" | |
| 332 | + | c:identifier="CAIRO_FONT_SLANT_OBLIQUE"/> | |
| 333 | + | </enumeration> | |
| 334 | + | <enumeration name="FontWeight" c:type="cairo_font_weight_t" | |
| 335 | + | glib:type-name="cairo_font_weight_t" | |
| 336 | + | glib:get-type="cairo_gobject_font_weight_get_type"> | |
| 337 | + | <member name="normal" | |
| 338 | + | value="0" | |
| 339 | + | c:identifier="CAIRO_FONT_WEIGHT_NORMAL"/> | |
| 340 | + | <member name="bold" | |
| 341 | + | value="1" | |
| 342 | + | c:identifier="CAIRO_FONT_WEIGHT_BOLD"/> | |
| 343 | + | </enumeration> | |
| 344 | + | <enumeration name="SubpixelOrder" c:type="cairo_subpixel_order_t" | |
| 345 | + | glib:type-name="cairo_subpixel_order_t" | |
| 346 | + | glib:get-type="cairo_gobject_subpixel_order_get_type"> | |
| 347 | + | <member name="default" | |
| 348 | + | value="0" | |
| 349 | + | c:identifier="CAIRO_SUBPIXEL_ORDER_DEFAULT"/> | |
| 350 | + | <member name="rgb" | |
| 351 | + | value="1" | |
| 352 | + | c:identifier="CAIRO_SUBPIXEL_ORDER_RGB"/> | |
| 353 | + | <member name="bgr" | |
| 354 | + | value="2" | |
| 355 | + | c:identifier="CAIRO_SUBPIXEL_ORDER_BGR"/> | |
| 356 | + | <member name="vrgb" | |
| 357 | + | value="3" | |
| 358 | + | c:identifier="CAIRO_SUBPIXEL_ORDER_VRGB"/> | |
| 359 | + | <member name="vbgr" | |
| 360 | + | value="4" | |
| 361 | + | c:identifier="CAIRO_SUBPIXEL_ORDER_VBGR"/> | |
| 362 | + | </enumeration> | |
| 363 | + | <enumeration name="HintStyle" c:type="cairo_hint_style_t" | |
| 364 | + | glib:type-name="cairo_hint_style_t" | |
| 365 | + | glib:get-type="cairo_gobject_hint_style_get_type"> | |
| 366 | + | <member name="default" | |
| 367 | + | value="0" | |
| 368 | + | c:identifier="CAIRO_HINT_STYLE_DEFAULT"/> | |
| 369 | + | <member name="none" | |
| 370 | + | value="1" | |
| 371 | + | c:identifier="CAIRO_HINT_STYLE_NONE"/> | |
| 372 | + | <member name="slight" | |
| 373 | + | value="2" | |
| 374 | + | c:identifier="CAIRO_HINT_STYLE_SLIGHT"/> | |
| 375 | + | <member name="medium" | |
| 376 | + | value="3" | |
| 377 | + | c:identifier="CAIRO_HINT_STYLE_MEDIUM"/> | |
| 378 | + | <member name="full" | |
| 379 | + | value="4" | |
| 380 | + | c:identifier="CAIRO_HINT_STYLE_FULL"/> | |
| 381 | + | </enumeration> | |
| 382 | + | <enumeration name="HintMetrics" c:type="cairo_hint_metrics_t" | |
| 383 | + | glib:type-name="cairo_hint_metrics_t" | |
| 384 | + | glib:get-type="cairo_gobject_hint_metrics_get_type"> | |
| 385 | + | <member name="default" | |
| 386 | + | value="0" | |
| 387 | + | c:identifier="CAIRO_HINT_METRICS_DEFAULT"/> | |
| 388 | + | <member name="off" | |
| 389 | + | value="1" | |
| 390 | + | c:identifier="CAIRO_HINT_METRICS_OFF"/> | |
| 391 | + | <member name="on" | |
| 392 | + | value="2" | |
| 393 | + | c:identifier="CAIRO_HINT_METRICS_ON"/> | |
| 394 | + | </enumeration> | |
| 395 | + | <record name="FontOptions" c:type="cairo_font_options_t" foreign="1" | |
| 396 | + | glib:type-name="CairoFontOptions" | |
| 397 | + | glib:get-type="cairo_gobject_font_options_get_type"/> | |
| 398 | + | <enumeration name="FontType" c:type="cairo_font_type_t" | |
| 399 | + | glib:type-name="cairo_font_type_t" | |
| 400 | + | glib:get-type="cairo_gobject_font_type_get_type"> | |
| 401 | + | <member name="toy" | |
| 402 | + | value="0" | |
| 403 | + | c:identifier="CAIRO_FONT_TYPE_TOY"/> | |
| 404 | + | <member name="ft" | |
| 405 | + | value="1" | |
| 406 | + | c:identifier="CAIRO_FONT_TYPE_FT"/> | |
| 407 | + | <member name="win32" | |
| 408 | + | value="2" | |
| 409 | + | c:identifier="CAIRO_FONT_TYPE_WIN32"/> | |
| 410 | + | <member name="quartz" | |
| 411 | + | value="3" | |
| 412 | + | c:identifier="CAIRO_FONT_TYPE_QUARTZ"/> | |
| 413 | + | <member name="user" | |
| 414 | + | value="4" | |
| 415 | + | c:identifier="CAIRO_FONT_TYPE_USER"/> | |
| 416 | + | </enumeration> | |
| 417 | + | <enumeration name="PathDataType" c:type="cairo_path_data_type_t" | |
| 418 | + | glib:type-name="cairo_path_data_type_t" | |
| 419 | + | glib:get-type="cairo_gobject_path_data_type_get_type"> | |
| 420 | + | <member name="move_to" | |
| 421 | + | value="0" | |
| 422 | + | c:identifier="CAIRO_PATH_MOVE_TO"/> | |
| 423 | + | <member name="line_to" | |
| 424 | + | value="1" | |
| 425 | + | c:identifier="CAIRO_PATH_LINE_TO"/> | |
| 426 | + | <member name="curve_to" | |
| 427 | + | value="2" | |
| 428 | + | c:identifier="CAIRO_PATH_CURVE_TO"/> | |
| 429 | + | <member name="close_path" | |
| 430 | + | value="3" | |
| 431 | + | c:identifier="CAIRO_PATH_CLOSE_PATH"/> | |
| 432 | + | </enumeration> | |
| 433 | + | <enumeration name="DeviceType" c:type="cairo_device_type_t" | |
| 434 | + | glib:type-name="cairo_device_type_t" | |
| 435 | + | glib:get-type="cairo_gobject_device_type_get_type"> | |
| 436 | + | <member name="drm" | |
| 437 | + | value="0" | |
| 438 | + | c:identifier="CAIRO_DEVICE_TYPE_DRM"/> | |
| 439 | + | <member name="gl" | |
| 440 | + | value="1" | |
| 441 | + | c:identifier="CAIRO_DEVICE_TYPE_GL"/> | |
| 442 | + | <member name="script" | |
| 443 | + | value="2" | |
| 444 | + | c:identifier="CAIRO_DEVICE_TYPE_SCRIPT"/> | |
| 445 | + | <member name="xcb" | |
| 446 | + | value="3" | |
| 447 | + | c:identifier="CAIRO_DEVICE_TYPE_XCB"/> | |
| 448 | + | <member name="xlib" | |
| 449 | + | value="4" | |
| 450 | + | c:identifier="CAIRO_DEVICE_TYPE_XLIB"/> | |
| 451 | + | <member name="xml" | |
| 452 | + | value="5" | |
| 453 | + | c:identifier="CAIRO_DEVICE_TYPE_XML"/> | |
| 454 | + | <member name="cogl" | |
| 455 | + | value="6" | |
| 456 | + | c:identifier="CAIRO_DEVICE_TYPE_COGL"/> | |
| 457 | + | <member name="win32" | |
| 458 | + | value="7" | |
| 459 | + | c:identifier="CAIRO_DEVICE_TYPE_WIN32"/> | |
| 460 | + | <member name="invalid" | |
| 461 | + | value="-1" | |
| 462 | + | c:identifier="CAIRO_DEVICE_TYPE_INVALID"/> | |
| 463 | + | </enumeration> | |
| 464 | + | <enumeration name="SurfaceType" c:type="cairo_surface_type_t" | |
| 465 | + | glib:type-name="cairo_surface_type_t" | |
| 466 | + | glib:get-type="cairo_gobject_surface_type_get_type"> | |
| 467 | + | <member name="image" | |
| 468 | + | value="0" | |
| 469 | + | c:identifier="CAIRO_SURFACE_TYPE_IMAGE"/> | |
| 470 | + | <member name="pdf" | |
| 471 | + | value="1" | |
| 472 | + | c:identifier="CAIRO_SURFACE_TYPE_PDF"/> | |
| 473 | + | <member name="ps" | |
| 474 | + | value="2" | |
| 475 | + | c:identifier="CAIRO_SURFACE_TYPE_PS"/> | |
| 476 | + | <member name="xlib" | |
| 477 | + | value="3" | |
| 478 | + | c:identifier="CAIRO_SURFACE_TYPE_XLIB"/> | |
| 479 | + | <member name="xcb" | |
| 480 | + | value="4" | |
| 481 | + | c:identifier="CAIRO_SURFACE_TYPE_XCB"/> | |
| 482 | + | <member name="glitz" | |
| 483 | + | value="5" | |
| 484 | + | c:identifier="CAIRO_SURFACE_TYPE_GLITZ"/> | |
| 485 | + | <member name="quartz" | |
| 486 | + | value="6" | |
| 487 | + | c:identifier="CAIRO_SURFACE_TYPE_QUARTZ"/> | |
| 488 | + | <member name="win32" | |
| 489 | + | value="7" | |
| 490 | + | c:identifier="CAIRO_SURFACE_TYPE_WIN32"/> | |
| 491 | + | <member name="beos" | |
| 492 | + | value="8" | |
| 493 | + | c:identifier="CAIRO_SURFACE_TYPE_BEOS"/> | |
| 494 | + | <member name="directfb" | |
| 495 | + | value="9" | |
| 496 | + | c:identifier="CAIRO_SURFACE_TYPE_DIRECTFB"/> | |
| 497 | + | <member name="svg" | |
| 498 | + | value="10" | |
| 499 | + | c:identifier="CAIRO_SURFACE_TYPE_SVG"/> | |
| 500 | + | <member name="os2" | |
| 501 | + | value="11" | |
| 502 | + | c:identifier="CAIRO_SURFACE_TYPE_OS2"/> | |
| 503 | + | <member name="win32_printing" | |
| 504 | + | value="12" | |
| 505 | + | c:identifier="CAIRO_SURFACE_TYPE_WIN32_PRINTING"/> | |
| 506 | + | <member name="quartz_image" | |
| 507 | + | value="13" | |
| 508 | + | c:identifier="CAIRO_SURFACE_TYPE_QUARTZ_IMAGE"/> | |
| 509 | + | <member name="script" | |
| 510 | + | value="14" | |
| 511 | + | c:identifier="CAIRO_SURFACE_TYPE_SCRIPT"/> | |
| 512 | + | <member name="qt" | |
| 513 | + | value="15" | |
| 514 | + | c:identifier="CAIRO_SURFACE_TYPE_QT"/> | |
| 515 | + | <member name="recording" | |
| 516 | + | value="16" | |
| 517 | + | c:identifier="CAIRO_SURFACE_TYPE_RECORDING"/> | |
| 518 | + | <member name="vg" | |
| 519 | + | value="17" | |
| 520 | + | c:identifier="CAIRO_SURFACE_TYPE_VG"/> | |
| 521 | + | <member name="gl" | |
| 522 | + | value="18" | |
| 523 | + | c:identifier="CAIRO_SURFACE_TYPE_GL"/> | |
| 524 | + | <member name="drm" | |
| 525 | + | value="19" | |
| 526 | + | c:identifier="CAIRO_SURFACE_TYPE_DRM"/> | |
| 527 | + | <member name="tee" | |
| 528 | + | value="20" | |
| 529 | + | c:identifier="CAIRO_SURFACE_TYPE_TEE"/> | |
| 530 | + | <member name="xml" | |
| 531 | + | value="21" | |
| 532 | + | c:identifier="CAIRO_SURFACE_TYPE_XML"/> | |
| 533 | + | <member name="skia" | |
| 534 | + | value="22" | |
| 535 | + | c:identifier="CAIRO_SURFACE_TYPE_SKIA"/> | |
| 536 | + | <member name="subsurface" | |
| 537 | + | value="23" | |
| 538 | + | c:identifier="CAIRO_SURFACE_TYPE_SUBSURFACE"/> | |
| 539 | + | <member name="cogl" | |
| 540 | + | value="24" | |
| 541 | + | c:identifier="CAIRO_SURFACE_TYPE_COGL"/> | |
| 542 | + | </enumeration> | |
| 543 | + | <enumeration name="Format" c:type="cairo_format_t" | |
| 544 | + | glib:type-name="cairo_format_t" | |
| 545 | + | glib:get-type="cairo_gobject_format_get_type"> | |
| 546 | + | <member name="invalid" | |
| 547 | + | value="-1" | |
| 548 | + | c:identifier="CAIRO_FORMAT_INVALID"/> | |
| 549 | + | <member name="argb32" | |
| 550 | + | value="0" | |
| 551 | + | c:identifier="CAIRO_FORMAT_ARGB32"/> | |
| 552 | + | <member name="rgb24" | |
| 553 | + | value="1" | |
| 554 | + | c:identifier="CAIRO_FORMAT_RGB24"/> | |
| 555 | + | <member name="a8" | |
| 556 | + | value="2" | |
| 557 | + | c:identifier="CAIRO_FORMAT_A8"/> | |
| 558 | + | <member name="a1" | |
| 559 | + | value="3" | |
| 560 | + | c:identifier="CAIRO_FORMAT_A1"/> | |
| 561 | + | <member name="rgb16_565" | |
| 562 | + | value="4" | |
| 563 | + | c:identifier="CAIRO_FORMAT_RGB16_565"/> | |
| 564 | + | <member name="rgb30" | |
| 565 | + | value="5" | |
| 566 | + | c:identifier="CAIRO_FORMAT_RGB30"/> | |
| 567 | + | </enumeration> | |
| 568 | + | <enumeration name="PatternType" c:type="cairo_pattern_type_t" | |
| 569 | + | glib:type-name="cairo_pattern_type_t" | |
| 570 | + | glib:get-type="cairo_gobject_pattern_type_get_type"> | |
| 571 | + | <member name="solid" | |
| 572 | + | value="0" | |
| 573 | + | c:identifier="CAIRO_PATTERN_TYPE_SOLID"/> | |
| 574 | + | <member name="surface" | |
| 575 | + | value="1" | |
| 576 | + | c:identifier="CAIRO_PATTERN_TYPE_SURFACE"/> | |
| 577 | + | <member name="linear" | |
| 578 | + | value="2" | |
| 579 | + | c:identifier="CAIRO_PATTERN_TYPE_LINEAR"/> | |
| 580 | + | <member name="radial" | |
| 581 | + | value="3" | |
| 582 | + | c:identifier="CAIRO_PATTERN_TYPE_RADIAL"/> | |
| 583 | + | <member name="mesh" | |
| 584 | + | value="4" | |
| 585 | + | c:identifier="CAIRO_PATTERN_TYPE_MESH"/> | |
| 586 | + | <member name="raster_source" | |
| 587 | + | value="5" | |
| 588 | + | c:identifier="CAIRO_PATTERN_TYPE_RASTER_SOURCE"/> | |
| 589 | + | </enumeration> | |
| 590 | + | <enumeration name="Extend" c:type="cairo_extend_t" | |
| 591 | + | glib:type-name="cairo_extend_t" | |
| 592 | + | glib:get-type="cairo_gobject_extend_get_type"> | |
| 593 | + | <member name="none" | |
| 594 | + | value="0" | |
| 595 | + | c:identifier="CAIRO_EXTEND_NONE"/> | |
| 596 | + | <member name="repeat" | |
| 597 | + | value="1" | |
| 598 | + | c:identifier="CAIRO_EXTEND_REPEAT"/> | |
| 599 | + | <member name="reflect" | |
| 600 | + | value="2" | |
| 601 | + | c:identifier="CAIRO_EXTEND_REFLECT"/> | |
| 602 | + | <member name="pad" | |
| 603 | + | value="3" | |
| 604 | + | c:identifier="CAIRO_EXTEND_PAD"/> | |
| 605 | + | </enumeration> | |
| 606 | + | <enumeration name="Filter" c:type="cairo_filter_t" | |
| 607 | + | glib:type-name="cairo_filter_t" | |
| 608 | + | glib:get-type="cairo_gobject_filter_get_type"> | |
| 609 | + | <member name="fast" | |
| 610 | + | value="0" | |
| 611 | + | c:identifier="CAIRO_FILTER_FAST"/> | |
| 612 | + | <member name="good" | |
| 613 | + | value="1" | |
| 614 | + | c:identifier="CAIRO_FILTER_GOOD"/> | |
| 615 | + | <member name="best" | |
| 616 | + | value="2" | |
| 617 | + | c:identifier="CAIRO_FILTER_BEST"/> | |
| 618 | + | <member name="nearest" | |
| 619 | + | value="3" | |
| 620 | + | c:identifier="CAIRO_FILTER_NEAREST"/> | |
| 621 | + | <member name="bilinear" | |
| 622 | + | value="4" | |
| 623 | + | c:identifier="CAIRO_FILTER_BILINEAR"/> | |
| 624 | + | <member name="gaussian" | |
| 625 | + | value="5" | |
| 626 | + | c:identifier="CAIRO_FILTER_GAUSSIAN"/> | |
| 627 | + | </enumeration> | |
| 628 | + | <enumeration name="RegionOverlap" c:type="cairo_region_overlap_t" | |
| 629 | + | glib:type-name="cairo_region_overlap_t" | |
| 630 | + | glib:get-type="cairo_gobject_region_overlap_get_type"> | |
| 631 | + | <member name="in" | |
| 632 | + | value="0" | |
| 633 | + | c:identifier="CAIRO_REGION_OVERLAP_IN"/> | |
| 634 | + | <member name="out" | |
| 635 | + | value="1" | |
| 636 | + | c:identifier="CAIRO_REGION_OVERLAP_OUT"/> | |
| 637 | + | <member name="part" | |
| 638 | + | value="2" | |
| 639 | + | c:identifier="CAIRO_REGION_OVERLAP_PART"/> | |
| 640 | + | </enumeration> | |
| 641 | + | <record name="FontFace" c:type="cairo_font_face_t" foreign="1" | |
| 642 | + | glib:type-name="CairoFontFace" | |
| 643 | + | glib:get-type="cairo_gobject_font_face_get_type"/> | |
| 644 | + | <record name="ScaledFont" c:type="cairo_scaled_font_t" foreign="1" | |
| 645 | + | glib:type-name="CairoScaledFont" | |
| 646 | + | glib:get-type="cairo_gobject_scaled_font_get_type"/> | |
| 647 | + | <record name="Path" c:type="cairo_path_t" foreign="1"/> | |
| 648 | + | <record name="Rectangle" c:type="cairo_rectangle_t" | |
| 649 | + | glib:type-name="CairoRectangle" | |
| 650 | + | glib:get-type="cairo_gobject_rectangle_get_type"> | |
| 651 | + | <field name="x" writable="1"> | |
| 652 | + | <type name="gdouble" c:type="gdouble"/> | |
| 653 | + | </field> | |
| 654 | + | <field name="y" writable="1"> | |
| 655 | + | <type name="gdouble" c:type="gdouble"/> | |
| 656 | + | </field> | |
| 657 | + | <field name="width" writable="1"> | |
| 658 | + | <type name="gdouble" c:type="gdouble"/> | |
| 659 | + | </field> | |
| 660 | + | <field name="height" writable="1"> | |
| 661 | + | <type name="gdouble" c:type="gdouble"/> | |
| 662 | + | </field> | |
| 663 | + | </record> | |
| 664 | + | <record name="RectangleInt" c:type="cairo_rectangle_int_t" | |
| 665 | + | glib:type-name="CairoRectangleInt" | |
| 666 | + | glib:get-type="cairo_gobject_rectangle_int_get_type"> | |
| 667 | + | <field name="x" writable="1"> | |
| 668 | + | <type name="gint" c:type="gint"/> | |
| 669 | + | </field> | |
| 670 | + | <field name="y" writable="1"> | |
| 671 | + | <type name="gint" c:type="gint"/> | |
| 672 | + | </field> | |
| 673 | + | <field name="width" writable="1"> | |
| 674 | + | <type name="gint" c:type="gint"/> | |
| 675 | + | </field> | |
| 676 | + | <field name="height" writable="1"> | |
| 677 | + | <type name="gint" c:type="gint"/> | |
| 678 | + | </field> | |
| 679 | + | </record> | |
| 680 | + | <function name="image_surface_create" c:identifier="cairo_image_surface_create"> | |
| 681 | + | <return-value transfer-ownership="none"> | |
| 682 | + | <type name="none" c:type="void"/> | |
| 683 | + | </return-value> | |
| 684 | + | <parameters> | |
| 685 | + | </parameters> | |
| 686 | + | </function> | |
| 687 | + | </namespace> | |
| 688 | + | </repository> | |
A internal/gir/types/interface.go +52 -0
| @@ -0,0 +1,52 @@ | |||
| 1 | + | package types | |
| 2 | + | ||
| 3 | + | import ( | |
| 4 | + | "strings" | |
| 5 | + | ||
| 6 | + | "github.com/jwijenbergh/puregotk/internal/gir/util" | |
| 7 | + | ) | |
| 8 | + | ||
| 9 | + | func ConvertInterface(currns string, ins string, inter Interface, implemented map[string]bool, kinds KindMap) InterfaceTemplate { | |
| 10 | + | var methods []InterfaceFuncTemplate | |
| 11 | + | ||
| 12 | + | for _, m := range inter.Methods { | |
| 13 | + | name := util.SnakeToCamel(m.Name) | |
| 14 | + | if implemented != nil { | |
| 15 | + | v, ok := implemented[name] | |
| 16 | + | if v && ok { | |
| 17 | + | continue | |
| 18 | + | } | |
| 19 | + | } | |
| 20 | + | var newns string | |
| 21 | + | if ins != "" { | |
| 22 | + | newns = ins + "." | |
| 23 | + | } | |
| 24 | + | methods = append(methods, InterfaceFuncTemplate{ | |
| 25 | + | Namespace: newns, | |
| 26 | + | FullName: util.SnakeToCamel(m.CIdentifier), | |
| 27 | + | FuncTemplate: FuncTemplate{ | |
| 28 | + | Doc: m.Doc.StringSafe(), | |
| 29 | + | CName: m.CIdentifier, | |
| 30 | + | Name: name, | |
| 31 | + | Args: m.Parameters.Template(currns, ins, kinds), | |
| 32 | + | Ret: m.ReturnValue.Template(currns, ins, kinds), | |
| 33 | + | }, | |
| 34 | + | }) | |
| 35 | + | } | |
| 36 | + | name := util.SnakeToCamel(inter.Name) | |
| 37 | + | return InterfaceTemplate{ | |
| 38 | + | Name: name, | |
| 39 | + | Doc: inter.Doc.StringSafe(), | |
| 40 | + | Methods: methods, | |
| 41 | + | } | |
| 42 | + | } | |
| 43 | + | ||
| 44 | + | func GetInterfaceFuncs(ns string, name string, implemented map[string]bool, kinds KindMap) InterfaceTemplate { | |
| 45 | + | inter := kinds.MustInterface(ns, name) | |
| 46 | + | parts := strings.Split(name, ".") | |
| 47 | + | var ins string | |
| 48 | + | if len(parts) > 1 { | |
| 49 | + | ins = strings.ToLower(parts[0]) | |
| 50 | + | } | |
| 51 | + | return ConvertInterface(ns, ins, inter, implemented, kinds) | |
| 52 | + | } | |
A internal/gir/types/kind.go +51 -0
| @@ -0,0 +1,51 @@ | |||
| 1 | + | package types | |
| 2 | + | ||
| 3 | + | import "github.com/jwijenbergh/puregotk/internal/gir/util" | |
| 4 | + | ||
| 5 | + | type Kind int8 | |
| 6 | + | ||
| 7 | + | const ( | |
| 8 | + | UnknownType Kind = iota | |
| 9 | + | AliasType | |
| 10 | + | CallbackType | |
| 11 | + | ClassesType | |
| 12 | + | InterfacesType | |
| 13 | + | RecordsType | |
| 14 | + | OtherType | |
| 15 | + | ) | |
| 16 | + | ||
| 17 | + | type KindMap map[string]KindPair | |
| 18 | + | ||
| 19 | + | func (km KindMap) key(ns string, name string) string { | |
| 20 | + | return util.NormalizeNamespace(ns, name, false) | |
| 21 | + | } | |
| 22 | + | ||
| 23 | + | func (km KindMap) Add(ns string, name string, t Kind, v interface{}) { | |
| 24 | + | k := km.key(ns, name) | |
| 25 | + | km[k] = KindPair{ | |
| 26 | + | K: t, | |
| 27 | + | Value: v, | |
| 28 | + | } | |
| 29 | + | } | |
| 30 | + | ||
| 31 | + | func (km KindMap) pair(ns string, name string) KindPair { | |
| 32 | + | f := util.NormalizeNamespace(ns, name, false) | |
| 33 | + | return km[f] | |
| 34 | + | } | |
| 35 | + | ||
| 36 | + | func (km KindMap) Kind(ns string, name string) Kind { | |
| 37 | + | return km.pair(ns, name).K | |
| 38 | + | } | |
| 39 | + | ||
| 40 | + | func (km KindMap) MustInterface(ns string, name string) Interface { | |
| 41 | + | p := km.pair(ns, name) | |
| 42 | + | if p.K != InterfacesType { | |
| 43 | + | panic("value is not an interface") | |
| 44 | + | } | |
| 45 | + | return p.Value.(Interface) | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | type KindPair struct { | |
| 49 | + | K Kind | |
| 50 | + | Value interface{} | |
| 51 | + | } | |
A internal/gir/types/template.go +284 -0
| @@ -0,0 +1,284 @@ | |||
| 1 | + | package types | |
| 2 | + | ||
| 3 | + | import ( | |
| 4 | + | "fmt" | |
| 5 | + | "strings" | |
| 6 | + | ||
| 7 | + | "github.com/jwijenbergh/puregotk/internal/gir/util" | |
| 8 | + | ) | |
| 9 | + | ||
| 10 | + | type argsTemplate struct { | |
| 11 | + | // Names are the variables but just the names | |
| 12 | + | Names []string | |
| 13 | + | ||
| 14 | + | // Types are the variables but just the types | |
| 15 | + | Types []string | |
| 16 | + | ||
| 17 | + | // Call are the variables as given in a function call | |
| 18 | + | Call []string | |
| 19 | + | ||
| 20 | + | Full []string | |
| 21 | + | } | |
| 22 | + | ||
| 23 | + | type funcArgsTemplate struct { | |
| 24 | + | // Pure are the arguments as passed directly to PureGo | |
| 25 | + | // The pure Call is a special case that contains the arguments for a callback call | |
| 26 | + | Pure argsTemplate | |
| 27 | + | ||
| 28 | + | // API are the arguments as suitable for a Go API | |
| 29 | + | API argsTemplate | |
| 30 | + | } | |
| 31 | + | ||
| 32 | + | func (f *funcArgsTemplate) AddAPI(t string, n string, k Kind, ns string) { | |
| 33 | + | c := n | |
| 34 | + | stars := strings.Count(t, "*") | |
| 35 | + | gobjectNs := "gobject." | |
| 36 | + | if strings.ToLower(ns) == "gobject" { | |
| 37 | + | gobjectNs = "" | |
| 38 | + | } | |
| 39 | + | switch k { | |
| 40 | + | case CallbackType: | |
| 41 | + | c = fmt.Sprintf("purego.NewCallback(%s)", n) | |
| 42 | + | case ClassesType: | |
| 43 | + | if stars == 0 { | |
| 44 | + | c = n | |
| 45 | + | t = "uintptr" | |
| 46 | + | } else if stars > 1 { | |
| 47 | + | c = fmt.Sprintf("%sConvertPtr(%s)", gobjectNs, n) | |
| 48 | + | } else if stars == 1 { | |
| 49 | + | c = n + ".GoPointer()" | |
| 50 | + | } | |
| 51 | + | case InterfacesType: | |
| 52 | + | t = strings.TrimPrefix(t, "*") | |
| 53 | + | if stars == 0 { | |
| 54 | + | c = n | |
| 55 | + | t = "uintptr" | |
| 56 | + | } else if stars > 1 { | |
| 57 | + | c = fmt.Sprintf("%sConvertPtr(%s)", gobjectNs, n) | |
| 58 | + | } else if stars == 1 { | |
| 59 | + | c = n + ".GoPointer()" | |
| 60 | + | } | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // special case for varargs | |
| 64 | + | if n == "varArgs" { | |
| 65 | + | c = n + "..." | |
| 66 | + | } | |
| 67 | + | f.API.Names = append(f.API.Names, n) | |
| 68 | + | f.API.Types = append(f.API.Types, t) | |
| 69 | + | f.API.Call = append(f.API.Call, c) | |
| 70 | + | f.API.Full = append(f.API.Full, n+" "+t) | |
| 71 | + | } | |
| 72 | + | ||
| 73 | + | func (f *funcArgsTemplate) AddPure(t string, n string, k Kind) { | |
| 74 | + | n += "p" | |
| 75 | + | c := n | |
| 76 | + | stars := strings.Count(t, "*") | |
| 77 | + | switch k { | |
| 78 | + | case RecordsType: | |
| 79 | + | if stars == 0 { | |
| 80 | + | t = "uintptr" | |
| 81 | + | } | |
| 82 | + | case CallbackType: | |
| 83 | + | t = "uintptr" | |
| 84 | + | case ClassesType: | |
| 85 | + | if stars == 0 { | |
| 86 | + | c = n | |
| 87 | + | t = "uintptr" | |
| 88 | + | } else { | |
| 89 | + | c = fmt.Sprintf("%sNewFromInternalPtr(%s)", strings.TrimPrefix(t, "*"), n) | |
| 90 | + | t = strings.Repeat("*", stars-1) + "uintptr" | |
| 91 | + | } | |
| 92 | + | case InterfacesType: | |
| 93 | + | if stars == 0 { | |
| 94 | + | c = n | |
| 95 | + | t = "uintptr" | |
| 96 | + | } else { | |
| 97 | + | c = fmt.Sprintf("%s{Ptr: %s}", t+"Base", n) | |
| 98 | + | t = strings.Repeat("*", stars-1) + "uintptr" | |
| 99 | + | } | |
| 100 | + | } | |
| 101 | + | f.Pure.Names = append(f.Pure.Names, n) | |
| 102 | + | f.Pure.Types = append(f.Pure.Types, t) | |
| 103 | + | f.Pure.Call = append(f.Pure.Call, c) | |
| 104 | + | f.Pure.Full = append(f.Pure.Full, n+" "+t) | |
| 105 | + | } | |
| 106 | + | ||
| 107 | + | func (f *funcArgsTemplate) Add(p Parameter, ins string, ns string, kinds KindMap) { | |
| 108 | + | // get the lookup namespace | |
| 109 | + | // as if the interface namespace is non-empty | |
| 110 | + | // means we can also lookup in the namespace of the interface | |
| 111 | + | lns := ns | |
| 112 | + | if ins != "" { | |
| 113 | + | lns = ins | |
| 114 | + | } | |
| 115 | + | goType := p.Translate(lns, kinds) | |
| 116 | + | kind := kinds.Kind(lns, goType) | |
| 117 | + | stars := strings.Count(goType, "*") | |
| 118 | + | goType = util.NormalizeNamespace(ns, goType, true) | |
| 119 | + | if kind != OtherType && kind != UnknownType { | |
| 120 | + | if ins != "" && strings.Count(goType, ".") < 1 { | |
| 121 | + | goType = ins + "." + goType | |
| 122 | + | } | |
| 123 | + | } | |
| 124 | + | if stars > 0 { | |
| 125 | + | goType = strings.Repeat("*", stars) + strings.ReplaceAll(goType, "*", "") | |
| 126 | + | } | |
| 127 | + | ||
| 128 | + | // Get a suitable variable name | |
| 129 | + | varName := p.VarName() | |
| 130 | + | ||
| 131 | + | f.AddAPI(goType, varName, kind, ns) | |
| 132 | + | f.AddPure(goType, varName, kind) | |
| 133 | + | } | |
| 134 | + | ||
| 135 | + | type CallbackTemplate struct { | |
| 136 | + | Doc string | |
| 137 | + | Name string | |
| 138 | + | Args funcArgsTemplate | |
| 139 | + | Ret funcRetTemplate | |
| 140 | + | } | |
| 141 | + | ||
| 142 | + | type AliasTemplate struct { | |
| 143 | + | // Name is the name of the alias given to the Go type declaration | |
| 144 | + | Name string | |
| 145 | + | ||
| 146 | + | // Doc is the documentation of the alias | |
| 147 | + | Doc string | |
| 148 | + | ||
| 149 | + | // Value is the value for the alias as a Go type | |
| 150 | + | Value string | |
| 151 | + | } | |
| 152 | + | ||
| 153 | + | type RecordField struct { | |
| 154 | + | // Name is the Go name of the field | |
| 155 | + | Name string | |
| 156 | + | ||
| 157 | + | // Type is the Go type of the field | |
| 158 | + | Type string | |
| 159 | + | } | |
| 160 | + | ||
| 161 | + | type RecordTemplate struct { | |
| 162 | + | // Name is the name of the record given to the Go type declaration | |
| 163 | + | Name string | |
| 164 | + | ||
| 165 | + | // Doc is the documentation of the alias | |
| 166 | + | Doc string | |
| 167 | + | ||
| 168 | + | // Fields is the list of record fields | |
| 169 | + | Fields []RecordField | |
| 170 | + | } | |
| 171 | + | ||
| 172 | + | type enumValues struct { | |
| 173 | + | // Doc is the documentation for the value | |
| 174 | + | Doc string | |
| 175 | + | // Name is the name of the enumeration value | |
| 176 | + | Name string | |
| 177 | + | // Value is the actual underlying value | |
| 178 | + | Value int | |
| 179 | + | } | |
| 180 | + | ||
| 181 | + | type EnumTemplate struct { | |
| 182 | + | // Name is the name of the enumeration declared as the Go type for the int | |
| 183 | + | Name string | |
| 184 | + | // Doc is the documentation for the enumeration | |
| 185 | + | Doc string | |
| 186 | + | // Values are the list of values for the enumeration | |
| 187 | + | Values []enumValues | |
| 188 | + | } | |
| 189 | + | ||
| 190 | + | type funcRetTemplate struct { | |
| 191 | + | // Raw is the raw value for the underlying purego function | |
| 192 | + | Raw string | |
| 193 | + | // Value is the underlying return value as a Go type | |
| 194 | + | Value string | |
| 195 | + | // Class indicates whether or not the return value is a class | |
| 196 | + | Class bool | |
| 197 | + | // RefSink indicates whether or not we should increase the reference count using obj.RefSink() | |
| 198 | + | RefSink bool | |
| 199 | + | } | |
| 200 | + | ||
| 201 | + | func (fr *funcRetTemplate) Instance() string { | |
| 202 | + | if strings.HasPrefix(fr.Value, "*") { | |
| 203 | + | return "&"+fr.Value[1:] | |
| 204 | + | } | |
| 205 | + | return fr.Value | |
| 206 | + | } | |
| 207 | + | ||
| 208 | + | type FuncTemplate struct { | |
| 209 | + | // Name is the name of the function declared as the Go function variable and public exposed API | |
| 210 | + | Name string | |
| 211 | + | // CName is the raw c name to be passed to purego register | |
| 212 | + | CName string | |
| 213 | + | // Doc is the documentation for the function | |
| 214 | + | Doc string | |
| 215 | + | // Args are the arguments | |
| 216 | + | Args funcArgsTemplate | |
| 217 | + | // Ret is the return argument | |
| 218 | + | Ret funcRetTemplate | |
| 219 | + | } | |
| 220 | + | ||
| 221 | + | type InterfaceFuncTemplate struct { | |
| 222 | + | Namespace string | |
| 223 | + | FullName string | |
| 224 | + | FuncTemplate | |
| 225 | + | } | |
| 226 | + | ||
| 227 | + | type SignalsTemplate struct { | |
| 228 | + | Doc string | |
| 229 | + | Name string | |
| 230 | + | CName string | |
| 231 | + | Args funcArgsTemplate | |
| 232 | + | Ret funcRetTemplate | |
| 233 | + | } | |
| 234 | + | ||
| 235 | + | type ClassTemplate struct { | |
| 236 | + | // Doc is the documentation for the class | |
| 237 | + | Doc string | |
| 238 | + | // Name is the name of the class that is given to the Go struct | |
| 239 | + | Name string | |
| 240 | + | // Parent is a non-empty string of the embedded parent struct | |
| 241 | + | Parent string | |
| 242 | + | // Constructors is the slice of functions that create the class struct | |
| 243 | + | Constructors []FuncTemplate | |
| 244 | + | // Receivers is the slice of functions that have value receivers to the struct | |
| 245 | + | Receivers []FuncTemplate | |
| 246 | + | // Interfaces are receiver methods that are implemented because it needs to satisfy a certain interface | |
| 247 | + | Interfaces []InterfaceTemplate | |
| 248 | + | // Signals are helpers for ConnectX receivers | |
| 249 | + | Signals []SignalsTemplate | |
| 250 | + | } | |
| 251 | + | ||
| 252 | + | type InterfaceTemplate struct { | |
| 253 | + | Doc string | |
| 254 | + | Name string | |
| 255 | + | // Methods is the methods that this interface defines | |
| 256 | + | Methods []InterfaceFuncTemplate | |
| 257 | + | } | |
| 258 | + | ||
| 259 | + | type TemplateArg struct { | |
| 260 | + | // PkgName is the name of the package, declared at the top-level | |
| 261 | + | PkgName string | |
| 262 | + | // PkgEnv is the name of the package in the load environment variable | |
| 263 | + | PkgEnv string | |
| 264 | + | // NeedsInit declares whether or not this file needs an init code to register functions with purego | |
| 265 | + | NeedsInit bool | |
| 266 | + | // Imports defines the package imports that we need | |
| 267 | + | // This does not include purego | |
| 268 | + | // As the template already includes that if `NeedsInit` is set to true | |
| 269 | + | Imports []string | |
| 270 | + | // Aliases are type aliases declared as type ... = ... | |
| 271 | + | Aliases []AliasTemplate | |
| 272 | + | // Aliases are structs that are not classes | |
| 273 | + | Records []RecordTemplate | |
| 274 | + | // Callbacks are functions that will be converted with purego to uintptr | |
| 275 | + | Callbacks []CallbackTemplate | |
| 276 | + | // Enums are enumerations declared as const ... .... = .... | |
| 277 | + | Enums []EnumTemplate | |
| 278 | + | // Functions are the Go function declarations | |
| 279 | + | Functions []FuncTemplate | |
| 280 | + | // Interfaces is the list of interfaces that this package implements | |
| 281 | + | Interfaces []InterfaceTemplate | |
| 282 | + | // Classes are the Go struct with receiver declarations | |
| 283 | + | Classes []ClassTemplate | |
| 284 | + | } | |
A internal/gir/types/types.go +698 -0
| @@ -0,0 +1,698 @@ | |||
| 1 | + | // package types implements types as found in gir XML files | |
| 2 | + | // NOTE: This was copied largely from (the type definitions) from | |
| 3 | + | package types | |
| 4 | + | ||
| 5 | + | import ( | |
| 6 | + | "encoding/xml" | |
| 7 | + | "strconv" | |
| 8 | + | "strings" | |
| 9 | + | ||
| 10 | + | "github.com/jwijenbergh/puregotk/internal/gir/util" | |
| 11 | + | ) | |
| 12 | + | ||
| 13 | + | // convList maps the given GIR primitive type to a Go builtin type. | |
| 14 | + | // See https://github.com/diamondburned/gotk4/blob/fd960d20b525a07580938d10a214336bafb47d12/gir/girgen/types/types.go#LL483C1-L512C2 | |
| 15 | + | var convList = map[string]string{ | |
| 16 | + | "none": "", | |
| 17 | + | "gboolean": "bool", | |
| 18 | + | "gfloat": "float32", | |
| 19 | + | "gdouble": "float64", | |
| 20 | + | // This was changed because e.g. the error code in a GError struct is a gint and it has to be an int32 | |
| 21 | + | // gint is a typedef to an int and on 32 and 64 bit systems a c int is 32 bits commonly, whereas in go an int is 32 bits on 32 bits systems and 64 bits on 64 bits systems | |
| 22 | + | // gotk4 seems to not cast these, see e.g. https://github.com/diamondburned/gotk4/blob/fd960d20b525a07580938d10a214336bafb47d12/gir/girgen/types/types.go#L473-L481 | |
| 23 | + | "gint": "int32", | |
| 24 | + | "gssize": "int", | |
| 25 | + | "gint8": "int8", | |
| 26 | + | "gint16": "int16", | |
| 27 | + | "gshort": "int16", | |
| 28 | + | "gint32": "int32", | |
| 29 | + | "glong": "int32", | |
| 30 | + | "int32": "int32", | |
| 31 | + | "gint64": "int64", | |
| 32 | + | "guint": "uint", | |
| 33 | + | "gsize": "uint", | |
| 34 | + | "guchar": "byte", | |
| 35 | + | "gchar": "byte", | |
| 36 | + | "guint8": "byte", // some weird cases | |
| 37 | + | "guint16": "uint16", | |
| 38 | + | "gushort": "uint16", | |
| 39 | + | "guint32": "uint32", | |
| 40 | + | "gulong": "uint32", | |
| 41 | + | "gunichar": "uint32", | |
| 42 | + | "guint64": "uint64", | |
| 43 | + | "guintptr": "uintptr", | |
| 44 | + | "utf8": "string", | |
| 45 | + | "filename": "string", | |
| 46 | + | ||
| 47 | + | // these are probably not correct but needed to compile | |
| 48 | + | "long double": "float64", | |
| 49 | + | "va_list": "[]interface{}", | |
| 50 | + | "gpointer": "uintptr", | |
| 51 | + | "GType": "[]interface{}", | |
| 52 | + | "const char*": "string", | |
| 53 | + | "char**": "[]string", | |
| 54 | + | // not exported | |
| 55 | + | "HarfBuzz.font_t": "uintptr", | |
| 56 | + | //"GLib.Quark": "byte", | |
| 57 | + | //"Allocation": "uintptr", | |
| 58 | + | } | |
| 59 | + | ||
| 60 | + | // Repository represents a GObject Introspection Repository, which contains the | |
| 61 | + | // includes, C includes and namespaces of a single gir file. | |
| 62 | + | type Repository struct { | |
| 63 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 repository"` | |
| 64 | + | ||
| 65 | + | Version string `xml:"version,attr"` | |
| 66 | + | CIdentifierPrefixes string `xml:"http://www.gtk.org/introspection/c/1.0 identifier-prefixes,attr"` | |
| 67 | + | CSymbolPrefixes string `xml:"http://www.gtk.org/introspection/c/1.0 symbol-prefixes,attr"` | |
| 68 | + | ||
| 69 | + | Includes []Include `xml:"http://www.gtk.org/introspection/core/1.0 include"` | |
| 70 | + | CIncludes []CInclude `xml:"http://www.gtk.org/introspection/c/1.0 include"` | |
| 71 | + | Packages []Package `xml:"http://www.gtk.org/introspection/core/1.0 package"` | |
| 72 | + | Namespaces []Namespace `xml:"http://www.gtk.org/introspection/core/1.0 namespace"` | |
| 73 | + | } | |
| 74 | + | ||
| 75 | + | // https://gitlab.gnome.org/GNOME/gobject-introspection/-/blob/master/docs/gir-1.2.rnc | |
| 76 | + | ||
| 77 | + | type Alias struct { | |
| 78 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 alias"` | |
| 79 | + | ||
| 80 | + | Name string `xml:"name,attr"` | |
| 81 | + | CType string `xml:"http://www.gtk.org/introspection/c/1.0 type,attr"` | |
| 82 | + | ||
| 83 | + | InfoAttrs | |
| 84 | + | InfoElements | |
| 85 | + | ||
| 86 | + | Type Type `xml:"http://www.gtk.org/introspection/core/1.0 type"` | |
| 87 | + | } | |
| 88 | + | ||
| 89 | + | type AnyType struct { | |
| 90 | + | // Possible variants. | |
| 91 | + | Type *Type `xml:"http://www.gtk.org/introspection/core/1.0 type"` | |
| 92 | + | Array *Array `xml:"http://www.gtk.org/introspection/core/1.0 array"` | |
| 93 | + | } | |
| 94 | + | ||
| 95 | + | func (a *AnyType) Translate(ns string, kinds KindMap) string { | |
| 96 | + | if a == nil { | |
| 97 | + | panic("unknown type found") | |
| 98 | + | } | |
| 99 | + | t := a.Type | |
| 100 | + | if t == nil { | |
| 101 | + | if a.Array == nil { | |
| 102 | + | return "" | |
| 103 | + | } | |
| 104 | + | if v, ok := convList[a.Array.CType]; ok { | |
| 105 | + | return v | |
| 106 | + | } | |
| 107 | + | return "uintptr" | |
| 108 | + | } | |
| 109 | + | return a.Type.Template(ns, kinds) | |
| 110 | + | } | |
| 111 | + | ||
| 112 | + | type Annotation struct { | |
| 113 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 attribute"` | |
| 114 | + | Name string `xml:"name,attr"` | |
| 115 | + | Value string `xml:"value,attr"` | |
| 116 | + | } | |
| 117 | + | ||
| 118 | + | type Array struct { | |
| 119 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 array"` | |
| 120 | + | Name string `xml:"name,attr"` | |
| 121 | + | CType string `xml:"http://www.gtk.org/introspection/c/1.0 type,attr"` | |
| 122 | + | Length *int `xml:"length,attr"` // ix of .Parameters | |
| 123 | + | ZeroTerminated *bool `xml:"zero-terminated,attr"` | |
| 124 | + | FixedSize int `xml:"fixed-size,attr"` | |
| 125 | + | Introspectable bool `xml:"introspectable,attr"` | |
| 126 | + | // Type is the array's inner type. | |
| 127 | + | Type *Type `xml:"http://www.gtk.org/introspection/core/1.0 type"` | |
| 128 | + | } | |
| 129 | + | ||
| 130 | + | // IsZeroTerminated returns true if the Array is zero-terminated. It accounts | |
| 131 | + | // for edge cases of the structure. | |
| 132 | + | func (a Array) IsZeroTerminated() bool { | |
| 133 | + | return a.Name == "" && (a.ZeroTerminated == nil || *a.ZeroTerminated) | |
| 134 | + | } | |
| 135 | + | ||
| 136 | + | type Bitfield struct { | |
| 137 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 bitfield"` | |
| 138 | + | ||
| 139 | + | Name string `xml:"name,attr"` // Go case | |
| 140 | + | CType string `xml:"http://www.gtk.org/introspection/c/1.0 type,attr"` | |
| 141 | + | GLibTypeName string `xml:"http://www.gtk.org/introspection/glib/1.0 type-name,attr"` | |
| 142 | + | GLibGetType string `xml:"http://www.gtk.org/introspection/glib/1.0 get-type,attr"` | |
| 143 | + | ||
| 144 | + | Members []Member `xml:"http://www.gtk.org/introspection/core/1.0 member"` | |
| 145 | + | Functions []Function `xml:"http://www.gtk.org/introspection/core/1.0 function"` | |
| 146 | + | ||
| 147 | + | InfoAttrs | |
| 148 | + | InfoElements | |
| 149 | + | } | |
| 150 | + | ||
| 151 | + | func (b *Bitfield) Template(ns string) EnumTemplate { | |
| 152 | + | els := make([]enumValues, len(b.Members)) | |
| 153 | + | for i, m := range b.Members { | |
| 154 | + | v, err := strconv.Atoi(m.Value) | |
| 155 | + | if err != nil { | |
| 156 | + | panic(err) | |
| 157 | + | } | |
| 158 | + | // + Value needed to get rid of duplicates | |
| 159 | + | els[i] = enumValues{ | |
| 160 | + | Doc: m.Doc.StringSafe(), | |
| 161 | + | Name: util.SnakeToCamel(util.RemoveSnakePrefix(strings.ToLower(m.CIdentifier), ns)) + "Value", | |
| 162 | + | Value: v, | |
| 163 | + | } | |
| 164 | + | } | |
| 165 | + | return EnumTemplate{ | |
| 166 | + | Name: util.SnakeToCamel(b.Name), | |
| 167 | + | Doc: b.Doc.StringSafe(), | |
| 168 | + | Values: els, | |
| 169 | + | } | |
| 170 | + | } | |
| 171 | + | ||
| 172 | + | type Signal struct { | |
| 173 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/glib/1.0 signal"` | |
| 174 | + | Name string `xml:"name,attr"` | |
| 175 | + | Detailed bool `xml:"detailed,attr"` | |
| 176 | + | When SignalWhen `xml:"when,attr"` | |
| 177 | + | Action bool `xml:"action,attr"` | |
| 178 | + | NoHooks bool `xml:"no-hooks,attr"` | |
| 179 | + | NoRecurse bool `xml:"no-recurse,attr"` | |
| 180 | + | InfoElements | |
| 181 | + | Parameters *Parameters `xml:"http://www.gtk.org/introspection/core/1.0 parameters"` | |
| 182 | + | ReturnValue *ReturnValue `xml:"http://www.gtk.org/introspection/core/1.0 return-value"` | |
| 183 | + | } | |
| 184 | + | ||
| 185 | + | type SignalWhen string | |
| 186 | + | ||
| 187 | + | const ( | |
| 188 | + | SignalWhenFirst = "first" | |
| 189 | + | SignalWhenLast = "last" | |
| 190 | + | SignalWhenCleanup = "cleanup" | |
| 191 | + | ) | |
| 192 | + | ||
| 193 | + | type SourcePosition struct { | |
| 194 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 source-position"` | |
| 195 | + | Filename string `xml:"filename,attr"` | |
| 196 | + | Line int `xml:"line,attr"` | |
| 197 | + | Column int `xml:"column,attr"` | |
| 198 | + | } | |
| 199 | + | ||
| 200 | + | type TransferOwnership struct { | |
| 201 | + | TransferOwnership string `xml:"transfer-ownership,attr"` | |
| 202 | + | } | |
| 203 | + | ||
| 204 | + | type Type struct { | |
| 205 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 type"` | |
| 206 | + | ||
| 207 | + | Name string `xml:"name,attr"` | |
| 208 | + | CType string `xml:"http://www.gtk.org/introspection/c/1.0 type,attr"` | |
| 209 | + | Introspectable *bool `xml:"introspectable,attr"` | |
| 210 | + | ||
| 211 | + | DocElements | |
| 212 | + | // Types is the type's inner types. | |
| 213 | + | Types []Type `xml:"http://www.gtk.org/introspection/core/1.0 type"` | |
| 214 | + | } | |
| 215 | + | ||
| 216 | + | func (typ *Type) IsIntrospectable() bool { | |
| 217 | + | return typ.Introspectable == nil || *typ.Introspectable | |
| 218 | + | } | |
| 219 | + | ||
| 220 | + | func (t *Type) Template(ns string, kinds KindMap) string { | |
| 221 | + | if v, ok := convList[t.Name]; ok { | |
| 222 | + | return v | |
| 223 | + | } | |
| 224 | + | ||
| 225 | + | _type := util.NormalizeNamespace(ns, t.Name, true) | |
| 226 | + | ||
| 227 | + | kind := kinds.Kind(ns, _type) | |
| 228 | + | // find the total pointer count | |
| 229 | + | count := strings.Count(t.CType, "*") | |
| 230 | + | w := strings.Trim(t.CType, "*") | |
| 231 | + | if w == "gpointer" { | |
| 232 | + | count += 1 | |
| 233 | + | } | |
| 234 | + | // set the same pointer types on the name | |
| 235 | + | if count > 0 && kind != CallbackType { | |
| 236 | + | _type = strings.Repeat("*", count) + _type | |
| 237 | + | } else if kind == RecordsType { | |
| 238 | + | // if it's not a pointer | |
| 239 | + | // then purego doesn't support it (struct by value is not supported | |
| 240 | + | // so return uintptr | |
| 241 | + | _type = "uintptr" | |
| 242 | + | } | |
| 243 | + | return _type | |
| 244 | + | } | |
| 245 | + | ||
| 246 | + | type Union struct { | |
| 247 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 union"` | |
| 248 | + | ||
| 249 | + | Name string `xml:"name,attr"` // Go case | |
| 250 | + | CType string `xml:"http://www.gtk.org/introspection/c/1.0 type,attr"` | |
| 251 | + | CSymbolPrefix string `xml:"http://www.gtk.org/introspection/c/1.0 symbol-prefix,attr"` | |
| 252 | + | GLibTypeName string `xml:"http://www.gtk.org/introspection/glib/1.0 type-name,attr"` | |
| 253 | + | GLibGetType string `xml:"http://www.gtk.org/introspection/glib/1.0 get-type,attr"` | |
| 254 | + | ||
| 255 | + | InfoAttrs | |
| 256 | + | InfoElements | |
| 257 | + | ||
| 258 | + | Fields []Field `xml:"http://www.gtk.org/introspection/core/1.0 field"` | |
| 259 | + | Constructors []Constructor `xml:"http://www.gtk.org/introspection/core/1.0 constructor"` | |
| 260 | + | Methods []Method `xml:"http://www.gtk.org/introspection/core/1.0 method"` | |
| 261 | + | Functions []Function `xml:"http://www.gtk.org/introspection/core/1.0 function"` | |
| 262 | + | Records []Record `xml:"http://www.gtk.org/introspection/core/1.0 record"` | |
| 263 | + | } | |
| 264 | + | ||
| 265 | + | type VarArgs struct { | |
| 266 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 varargs"` | |
| 267 | + | } | |
| 268 | + | ||
| 269 | + | type VirtualMethod struct { | |
| 270 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 virtual-method"` | |
| 271 | + | ||
| 272 | + | Invoker string `xml:"invoker,attr"` | |
| 273 | + | CallableAttrs | |
| 274 | + | } | |
| 275 | + | ||
| 276 | + | type Boxed struct{} | |
| 277 | + | ||
| 278 | + | type CInclude struct { | |
| 279 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/c/1.0 include"` | |
| 280 | + | Name string `xml:"name,attr"` | |
| 281 | + | } | |
| 282 | + | ||
| 283 | + | type CallableAttrs struct { | |
| 284 | + | Name string `xml:"name,attr"` | |
| 285 | + | CIdentifier string `xml:"http://www.gtk.org/introspection/c/1.0 identifier,attr"` | |
| 286 | + | ShadowedBy string `xml:"shadowed-by,attr"` | |
| 287 | + | Shadows string `xml:"shadows,attr"` | |
| 288 | + | Throws bool `xml:"throws,attr"` | |
| 289 | + | MovedTo string `xml:"moved-to,attr"` | |
| 290 | + | Parameters *Parameters `xml:"http://www.gtk.org/introspection/core/1.0 parameters"` | |
| 291 | + | ReturnValue *ReturnValue `xml:"http://www.gtk.org/introspection/core/1.0 return-value"` | |
| 292 | + | InfoAttrs | |
| 293 | + | InfoElements | |
| 294 | + | } | |
| 295 | + | ||
| 296 | + | type Callback struct { | |
| 297 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 callback"` | |
| 298 | + | CallableAttrs | |
| 299 | + | } | |
| 300 | + | ||
| 301 | + | type Class struct { | |
| 302 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 class"` | |
| 303 | + | Name string `xml:"name,attr"` | |
| 304 | + | Parent string `xml:"parent,attr"` | |
| 305 | + | Abstract bool `xml:"abstract,attr"` | |
| 306 | + | ||
| 307 | + | CType string `xml:"http://www.gtk.org/introspection/c/1.0 type,attr"` | |
| 308 | + | CSymbolPrefix string `xml:"http://www.gtk.org/introspection/c/1.0 symbol-prefix,attr"` | |
| 309 | + | ||
| 310 | + | GLibTypeName string `xml:"http://www.gtk.org/introspection/glib/1.0 type-name,attr"` | |
| 311 | + | GLibGetType string `xml:"http://www.gtk.org/introspection/glib/1.0 get-type,attr"` | |
| 312 | + | GLibTypeStruct string `xml:"http://www.gtk.org/introspection/glib/1.0 type-struct,attr"` | |
| 313 | + | ||
| 314 | + | InfoAttrs | |
| 315 | + | InfoElements | |
| 316 | + | ||
| 317 | + | Functions []Function `xml:"http://www.gtk.org/introspection/core/1.0 function"` | |
| 318 | + | Implements []Implements `xml:"http://www.gtk.org/introspection/core/1.0 implements"` | |
| 319 | + | Constructors []Constructor `xml:"http://www.gtk.org/introspection/core/1.0 constructor"` | |
| 320 | + | Methods []Method `xml:"http://www.gtk.org/introspection/core/1.0 method"` | |
| 321 | + | VirtualMethods []VirtualMethod `xml:"http://www.gtk.org/introspection/core/1.0 virtual-method"` | |
| 322 | + | Fields []Field `xml:"http://www.gtk.org/introspection/core/1.0 field"` | |
| 323 | + | Signals []Signal `xml:"http://www.gtk.org/introspection/glib/1.0 signal"` | |
| 324 | + | } | |
| 325 | + | ||
| 326 | + | type Constant struct { | |
| 327 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 constant"` | |
| 328 | + | Name string `xml:"name,attr"` | |
| 329 | + | Value string `xml:"value,attr"` | |
| 330 | + | CType string `xml:"http://www.gtk.org/introspection/c/1.0 type,attr"` | |
| 331 | + | ||
| 332 | + | Type Type `xml:"http://www.gtk.org/introspection/core/1.0 type"` | |
| 333 | + | ||
| 334 | + | InfoAttrs | |
| 335 | + | InfoElements | |
| 336 | + | } | |
| 337 | + | ||
| 338 | + | type Constructor struct { | |
| 339 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 constructor"` | |
| 340 | + | CallableAttrs | |
| 341 | + | } | |
| 342 | + | ||
| 343 | + | type Doc struct { | |
| 344 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 doc"` | |
| 345 | + | Filename string `xml:"filename,attr"` | |
| 346 | + | String string `xml:",innerxml"` | |
| 347 | + | Line int `xml:"line,attr"` | |
| 348 | + | } | |
| 349 | + | ||
| 350 | + | func (d *Doc) StringSafe() string { | |
| 351 | + | if d == nil { | |
| 352 | + | return "" | |
| 353 | + | } | |
| 354 | + | lines := strings.Split(d.String, "\n") | |
| 355 | + | for i, l := range lines { | |
| 356 | + | lines[i] = "// " + l | |
| 357 | + | } | |
| 358 | + | return strings.Join(lines, "\n") | |
| 359 | + | } | |
| 360 | + | ||
| 361 | + | type DocDeprecated struct { | |
| 362 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 doc-deprecated"` | |
| 363 | + | String string `xml:",innerxml"` | |
| 364 | + | } | |
| 365 | + | ||
| 366 | + | type DocElements struct { | |
| 367 | + | Doc *Doc | |
| 368 | + | DocDeprecated *DocDeprecated | |
| 369 | + | SourcePosition *SourcePosition | |
| 370 | + | } | |
| 371 | + | ||
| 372 | + | func (d *DocElements) FilenameSafe() string { | |
| 373 | + | if d == nil || (d.SourcePosition == nil && d.Doc == nil) { | |
| 374 | + | return "main.go" | |
| 375 | + | } | |
| 376 | + | if d.SourcePosition != nil { | |
| 377 | + | return util.TranslateFilename(d.SourcePosition.Filename) | |
| 378 | + | } | |
| 379 | + | return util.TranslateFilename(d.Doc.Filename) | |
| 380 | + | } | |
| 381 | + | ||
| 382 | + | type Enum struct { | |
| 383 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 enumeration"` | |
| 384 | + | ||
| 385 | + | Name string `xml:"name,attr"` // Go case | |
| 386 | + | CType string `xml:"http://www.gtk.org/introspection/c/1.0 type,attr"` | |
| 387 | + | GLibTypeName string `xml:"http://www.gtk.org/introspection/glib/1.0 type-name,attr"` | |
| 388 | + | GLibGetType string `xml:"http://www.gtk.org/introspection/glib/1.0 get-type,attr"` | |
| 389 | + | GLibErrorDomain string `xml:"http://www.gtk.org/introspection/glib/1.0 error-domain,attr"` | |
| 390 | + | ||
| 391 | + | Members []Member `xml:"http://www.gtk.org/introspection/core/1.0 member"` | |
| 392 | + | Functions []Function `xml:"http://www.gtk.org/introspection/core/1.0 function"` | |
| 393 | + | ||
| 394 | + | InfoAttrs | |
| 395 | + | InfoElements | |
| 396 | + | } | |
| 397 | + | ||
| 398 | + | func (e *Enum) Template(ns string) EnumTemplate { | |
| 399 | + | els := make([]enumValues, len(e.Members)) | |
| 400 | + | ||
| 401 | + | for i, m := range e.Members { | |
| 402 | + | v, err := strconv.Atoi(m.Value) | |
| 403 | + | if err != nil { | |
| 404 | + | panic(err) | |
| 405 | + | } | |
| 406 | + | id := strings.ToLower(m.CIdentifier) | |
| 407 | + | sID := util.RemoveSnakePrefix(id, ns) | |
| 408 | + | els[i] = enumValues{ | |
| 409 | + | Doc: m.Doc.StringSafe(), | |
| 410 | + | // + Value needed to get rid of duplicates | |
| 411 | + | Name: util.SnakeToCamel(sID) + "Value", | |
| 412 | + | Value: v, | |
| 413 | + | } | |
| 414 | + | } | |
| 415 | + | return EnumTemplate{ | |
| 416 | + | Name: util.SnakeToCamel(e.Name), | |
| 417 | + | Doc: e.Doc.StringSafe(), | |
| 418 | + | Values: els, | |
| 419 | + | } | |
| 420 | + | } | |
| 421 | + | ||
| 422 | + | type Field struct { | |
| 423 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 field"` | |
| 424 | + | Name string `xml:"name,attr"` | |
| 425 | + | Bits int `xml:"bits,attr"` | |
| 426 | + | Private bool `xml:"private,attr"` | |
| 427 | + | Writable bool `xml:"writable,attr"` // default false | |
| 428 | + | Readable *bool `xml:"readable,attr"` // default true | |
| 429 | + | AnyType | |
| 430 | + | Callback *Callback | |
| 431 | + | Doc *Doc | |
| 432 | + | } | |
| 433 | + | ||
| 434 | + | // IsReadable returns true if the field is readable. | |
| 435 | + | func (f Field) IsReadable() bool { | |
| 436 | + | return f.Readable == nil || *f.Readable | |
| 437 | + | } | |
| 438 | + | ||
| 439 | + | type Function struct { | |
| 440 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 function"` | |
| 441 | + | CallableAttrs | |
| 442 | + | } | |
| 443 | + | ||
| 444 | + | type Implements struct { | |
| 445 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 implements"` | |
| 446 | + | Name string `xml:"name,attr"` | |
| 447 | + | } | |
| 448 | + | ||
| 449 | + | type Include struct { | |
| 450 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 include"` | |
| 451 | + | Name string `xml:"name,attr"` | |
| 452 | + | Version string `xml:"version,attr"` | |
| 453 | + | } | |
| 454 | + | ||
| 455 | + | type InfoAttrs struct { | |
| 456 | + | Introspectable *bool `xml:"introspectable,attr"` // default true | |
| 457 | + | Deprecated bool `xml:"deprecated,attr"` | |
| 458 | + | DeprecatedVersion string `xml:"deprecated-version,attr"` | |
| 459 | + | Version string `xml:"version,attr"` | |
| 460 | + | Stability string `xml:"stability,attr"` | |
| 461 | + | } | |
| 462 | + | ||
| 463 | + | // IsIntrospectable returns true if the InfoAttrs indicates that the type is | |
| 464 | + | // introspectable. | |
| 465 | + | func (inf InfoAttrs) IsIntrospectable() bool { | |
| 466 | + | return inf.Introspectable == nil || *inf.Introspectable | |
| 467 | + | } | |
| 468 | + | ||
| 469 | + | type InfoElements struct { | |
| 470 | + | DocElements | |
| 471 | + | Annotations []Annotation `xml:"http://www.gtk.org/introspection/core/1.0 attribute"` | |
| 472 | + | } | |
| 473 | + | ||
| 474 | + | type InstanceParameter struct { | |
| 475 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 instance-parameter"` | |
| 476 | + | ParameterAttrs | |
| 477 | + | } | |
| 478 | + | ||
| 479 | + | type Interface struct { | |
| 480 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 interface"` | |
| 481 | + | Name string `xml:"name,attr"` | |
| 482 | + | ||
| 483 | + | CType string `xml:"http://www.gtk.org/introspection/c/1.0 type,attr"` | |
| 484 | + | CSymbolPrefix string `xml:"http://www.gtk.org/introspection/c/1.0 symbol-prefix,attr"` | |
| 485 | + | ||
| 486 | + | GLibTypeName string `xml:"http://www.gtk.org/introspection/glib/1.0 type-name,attr"` | |
| 487 | + | GLibGetType string `xml:"http://www.gtk.org/introspection/glib/1.0 get-type,attr"` | |
| 488 | + | GLibTypeStruct string `xml:"http://www.gtk.org/introspection/glib/1.0 type-struct,attr"` | |
| 489 | + | ||
| 490 | + | Functions []Function `xml:"http://www.gtk.org/introspection/core/1.0 function"` | |
| 491 | + | Methods []Method `xml:"http://www.gtk.org/introspection/core/1.0 method"` | |
| 492 | + | VirtualMethods []VirtualMethod `xml:"http://www.gtk.org/introspection/core/1.0 virtual-method"` | |
| 493 | + | Prerequisites []Prerequisite `xml:"http://www.gtk.org/introspection/core/1.0 prerequisite"` | |
| 494 | + | Signals []Signal `xml:"http://www.gtk.org/introspection/glib/1.0 signal"` | |
| 495 | + | ||
| 496 | + | InfoAttrs | |
| 497 | + | InfoElements | |
| 498 | + | } | |
| 499 | + | ||
| 500 | + | type Member struct { | |
| 501 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 member"` | |
| 502 | + | ||
| 503 | + | Names []xml.Attr `xml:"name,attr"` | |
| 504 | + | Value string `xml:"value,attr"` | |
| 505 | + | CIdentifier string `xml:"http://www.gtk.org/introspection/c/1.0 identifier,attr"` | |
| 506 | + | GLibNick string `xml:"http://www.gtk.org/introspection/glib/1.0 nick,attr"` | |
| 507 | + | ||
| 508 | + | InfoAttrs | |
| 509 | + | InfoElements | |
| 510 | + | } | |
| 511 | + | ||
| 512 | + | func (m Member) Name() string { | |
| 513 | + | return m.nameAttr(xml.Name{Local: "name"}) | |
| 514 | + | } | |
| 515 | + | ||
| 516 | + | func (m Member) GLibName() string { | |
| 517 | + | return m.nameAttr(xml.Name{Space: "http://www.gtk.org/introspection/glib/1.0", Local: "name"}) | |
| 518 | + | } | |
| 519 | + | ||
| 520 | + | func (m Member) nameAttr(name xml.Name) string { | |
| 521 | + | for _, attr := range m.Names { | |
| 522 | + | if attr.Name == name { | |
| 523 | + | return attr.Value | |
| 524 | + | } | |
| 525 | + | } | |
| 526 | + | return "" | |
| 527 | + | } | |
| 528 | + | ||
| 529 | + | type Method struct { | |
| 530 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 method"` | |
| 531 | + | CallableAttrs | |
| 532 | + | } | |
| 533 | + | ||
| 534 | + | type Namespace struct { | |
| 535 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 namespace"` | |
| 536 | + | ||
| 537 | + | Name string `xml:"name,attr"` | |
| 538 | + | Version string `xml:"version,attr"` | |
| 539 | + | CIdentifierPrefixes string `xml:"http://www.gtk.org/introspection/c/1.0 identifier-prefixes,attr"` | |
| 540 | + | CSymbolPrefixes string `xml:"http://www.gtk.org/introspection/c/1.0 symbol-prefixes,attr"` | |
| 541 | + | Prefix string `xml:"http://www.gtk.org/introspection/c/1.0 prefix,attr"` | |
| 542 | + | SharedLibrary string `xml:"shared-library,attr"` | |
| 543 | + | ||
| 544 | + | Aliases []Alias `xml:"http://www.gtk.org/introspection/core/1.0 alias"` | |
| 545 | + | Classes []Class `xml:"http://www.gtk.org/introspection/core/1.0 class"` | |
| 546 | + | Interfaces []Interface `xml:"http://www.gtk.org/introspection/core/1.0 interface"` | |
| 547 | + | Records []Record `xml:"http://www.gtk.org/introspection/core/1.0 record"` | |
| 548 | + | Enums []Enum `xml:"http://www.gtk.org/introspection/core/1.0 enumeration"` | |
| 549 | + | Functions []Function `xml:"http://www.gtk.org/introspection/core/1.0 function"` | |
| 550 | + | Unions []Union `xml:"http://www.gtk.org/introspection/core/1.0 union"` | |
| 551 | + | Bitfields []Bitfield `xml:"http://www.gtk.org/introspection/core/1.0 bitfield"` | |
| 552 | + | Callbacks []Callback `xml:"http://www.gtk.org/introspection/core/1.0 callback"` | |
| 553 | + | Constants []Constant `xml:"http://www.gtk.org/introspection/core/1.0 constant"` | |
| 554 | + | Annotations []Annotation `xml:"http://www.gtk.org/introspection/core/1.0 attribute"` | |
| 555 | + | Boxeds []Boxed `xml:"http://www.gtk.org/introspection/core/1.0 boxed"` | |
| 556 | + | } | |
| 557 | + | ||
| 558 | + | type Package struct { | |
| 559 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 package"` | |
| 560 | + | Name string `xml:"name,attr"` | |
| 561 | + | } | |
| 562 | + | ||
| 563 | + | type Parameter struct { | |
| 564 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 parameter"` | |
| 565 | + | ParameterAttrs | |
| 566 | + | } | |
| 567 | + | ||
| 568 | + | func (p *Parameter) Translate(ns string, kinds KindMap) string { | |
| 569 | + | if p.Name == "..." { | |
| 570 | + | return "...interface{}" | |
| 571 | + | } | |
| 572 | + | return p.AnyType.Translate(ns, kinds) | |
| 573 | + | } | |
| 574 | + | ||
| 575 | + | func (p *Parameter) VarName() string { | |
| 576 | + | snaked := util.SnakeToCamel(p.Name) | |
| 577 | + | if snaked == "..." { | |
| 578 | + | return "varArgs" | |
| 579 | + | } | |
| 580 | + | // avoid clash between same name of type and var | |
| 581 | + | // could also do first letter to lower? | |
| 582 | + | return snaked + "Var" | |
| 583 | + | } | |
| 584 | + | ||
| 585 | + | func (p *Parameters) Template(ns string, ifacens string, kinds KindMap) funcArgsTemplate { | |
| 586 | + | if p == nil { | |
| 587 | + | return funcArgsTemplate{} | |
| 588 | + | } | |
| 589 | + | params := p.Parameters | |
| 590 | + | if len(params) == 0 { | |
| 591 | + | return funcArgsTemplate{} | |
| 592 | + | } | |
| 593 | + | args := funcArgsTemplate{} | |
| 594 | + | for _, par := range params { | |
| 595 | + | args.Add(par, ifacens, ns, kinds) | |
| 596 | + | } | |
| 597 | + | return args | |
| 598 | + | } | |
| 599 | + | ||
| 600 | + | type ParameterAttrs struct { | |
| 601 | + | Name string `xml:"name,attr"` | |
| 602 | + | Direction string `xml:"direction,attr"` | |
| 603 | + | Scope string `xml:"scope,attr"` | |
| 604 | + | Closure *int `xml:"closure,attr"` | |
| 605 | + | Destroy *int `xml:"destroy,attr"` | |
| 606 | + | CallerAllocates bool `xml:"caller-allocates,attr"` | |
| 607 | + | Skip bool `xml:"skip,attr"` | |
| 608 | + | Optional bool `xml:"optional,attr"` | |
| 609 | + | Nullable bool `xml:"nullable,attr"` | |
| 610 | + | ||
| 611 | + | TransferOwnership | |
| 612 | + | AnyType | |
| 613 | + | Doc *Doc | |
| 614 | + | } | |
| 615 | + | ||
| 616 | + | type Parameters struct { | |
| 617 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 parameters"` | |
| 618 | + | InstanceParameter *InstanceParameter `xml:"http://www.gtk.org/introspection/core/1.0 instance-parameter"` | |
| 619 | + | Parameters []Parameter `xml:"http://www.gtk.org/introspection/core/1.0 parameter"` | |
| 620 | + | } | |
| 621 | + | ||
| 622 | + | type Prerequisite struct { | |
| 623 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 prerequisite"` | |
| 624 | + | Name string `xml:"name,attr"` | |
| 625 | + | } | |
| 626 | + | ||
| 627 | + | type Property struct{} | |
| 628 | + | ||
| 629 | + | type Record struct { | |
| 630 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 record"` | |
| 631 | + | Name string `xml:"name,attr"` | |
| 632 | + | CType string `xml:"http://www.gtk.org/introspection/c/1.0 type,attr"` | |
| 633 | + | GLibTypeName string `xml:"http://www.gtk.org/introspection/glib/1.0 type-name,attr"` | |
| 634 | + | GLibGetType string `xml:"http://www.gtk.org/introspection/glib/1.0 get-type,attr"` | |
| 635 | + | CSymbolPrefix string `xml:"http://www.gtk.org/introspection/c/1.0 symbol-prefix,attr"` | |
| 636 | + | GLibIsGTypeStructFor string `xml:"http://www.gtk.org/introspection/glib/1.0 is-gtype-struct-for,attr"` | |
| 637 | + | Disguised bool `xml:"disguised,attr"` | |
| 638 | + | Foreign bool `xml:"foreign,attr"` | |
| 639 | + | ||
| 640 | + | Fields []Field `xml:"http://www.gtk.org/introspection/core/1.0 field"` | |
| 641 | + | Functions []Function `xml:"http://www.gtk.org/introspection/core/1.0 function"` | |
| 642 | + | Unions []Union `xml:"http://www.gtk.org/introspection/core/1.0 union"` | |
| 643 | + | Methods []Method `xml:"http://www.gtk.org/introspection/core/1.0 method"` | |
| 644 | + | Constructors []Constructor `xml:"http://www.gtk.org/introspection/core/1.0 constructor"` | |
| 645 | + | Properties []Property `xml:"http://www.gtk.org/introspection/core/1.0 property"` | |
| 646 | + | ||
| 647 | + | InfoAttrs | |
| 648 | + | InfoElements | |
| 649 | + | } | |
| 650 | + | ||
| 651 | + | type ReturnValue struct { | |
| 652 | + | XMLName xml.Name `xml:"http://www.gtk.org/introspection/core/1.0 return-value"` | |
| 653 | + | Scope string `xml:"scope,attr"` | |
| 654 | + | Closure *int `xml:"closure,attr"` | |
| 655 | + | Destroy *int `xml:"destroy,attr"` | |
| 656 | + | Introspectable bool `xml:"introspectable,attr"` | |
| 657 | + | Nullable bool `xml:"nullable,attr"` | |
| 658 | + | Skip bool `xml:"skip,attr"` | |
| 659 | + | AllowNone bool `xml:"allow-none,attr"` | |
| 660 | + | TransferOwnership | |
| 661 | + | DocElements | |
| 662 | + | AnyType | |
| 663 | + | } | |
| 664 | + | ||
| 665 | + | func (r *ReturnValue) Template(ns string, ins string, kinds KindMap) funcRetTemplate { | |
| 666 | + | val := r.AnyType.Translate(ns, kinds) | |
| 667 | + | raw := val | |
| 668 | + | class := false | |
| 669 | + | lns := ns | |
| 670 | + | if ins != "" { | |
| 671 | + | lns = ins | |
| 672 | + | } | |
| 673 | + | kind := kinds.Kind(lns, raw) | |
| 674 | + | stars := strings.Count(val, "*") | |
| 675 | + | if kind != OtherType && kind != UnknownType { | |
| 676 | + | if ins != "" && strings.Count(val, ".") < 1 { | |
| 677 | + | val = ins + "." + val | |
| 678 | + | } | |
| 679 | + | } | |
| 680 | + | if stars > 0 { | |
| 681 | + | val = strings.Repeat("*", stars) + strings.ReplaceAll(val, "*", "") | |
| 682 | + | } | |
| 683 | + | switch kind { | |
| 684 | + | case ClassesType: | |
| 685 | + | raw = "uintptr" | |
| 686 | + | class = true | |
| 687 | + | case InterfacesType: | |
| 688 | + | raw = "uintptr" | |
| 689 | + | val += "Base" | |
| 690 | + | class = true | |
| 691 | + | } | |
| 692 | + | return funcRetTemplate{ | |
| 693 | + | Raw: raw, | |
| 694 | + | Value: val, | |
| 695 | + | Class: class, | |
| 696 | + | RefSink: r.TransferOwnership.TransferOwnership == "none", | |
| 697 | + | } | |
| 698 | + | } | |
A internal/gir/util/util.go +93 -0
| @@ -0,0 +1,93 @@ | |||
| 1 | + | // package util implements some utility functions for parsing/converting gir files | |
| 2 | + | // TODO: Maybe some of this can more easily be done with regexes? | |
| 3 | + | // | |
| 4 | + | // But using regexes introduces 2 problems :^) | |
| 5 | + | package util | |
| 6 | + | ||
| 7 | + | import ( | |
| 8 | + | "path/filepath" | |
| 9 | + | "strings" | |
| 10 | + | ) | |
| 11 | + | ||
| 12 | + | // delimToCamel to camel converts a string with parts separated by `delim` to CamelCase | |
| 13 | + | func delimToCamel(s string, delim string) string { | |
| 14 | + | var sb strings.Builder | |
| 15 | + | words := strings.Split(s, delim) | |
| 16 | + | for _, w := range words { | |
| 17 | + | sb.WriteString(strings.Title(w)) | |
| 18 | + | } | |
| 19 | + | return sb.String() | |
| 20 | + | } | |
| 21 | + | ||
| 22 | + | // SnakeToCamel converts hello_world to HelloWorld | |
| 23 | + | func SnakeToCamel(s string) string { | |
| 24 | + | return delimToCamel(s, "_") | |
| 25 | + | } | |
| 26 | + | ||
| 27 | + | // DashToCamel converts hello-world to HelloWorld | |
| 28 | + | func DashToCamel(s string) string { | |
| 29 | + | return delimToCamel(s, "-") | |
| 30 | + | } | |
| 31 | + | ||
| 32 | + | // RemoveSnakePrefix removes `prefix` from string `s` if that prefix ise separated with a _ | |
| 33 | + | // it removes lowercase or all u | |
| 34 | + | func RemoveSnakePrefix(s string, prefix string) string { | |
| 35 | + | parts := strings.Split(s, "_") | |
| 36 | + | if len(parts) <= 1 { | |
| 37 | + | return s | |
| 38 | + | } | |
| 39 | + | if strings.EqualFold(parts[0], prefix) { | |
| 40 | + | parts = parts[1:] | |
| 41 | + | } | |
| 42 | + | return strings.Join(parts, "_") | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | // ReplaceExtension replaces an extension from filename with ext | |
| 46 | + | // the extension is found by splitting on "." and taking the last part | |
| 47 | + | func ReplaceExtension(filename string, ext string) string { | |
| 48 | + | splt := strings.Split(filename, ".") | |
| 49 | + | if len(splt) == 1 { | |
| 50 | + | return filename | |
| 51 | + | } | |
| 52 | + | splt[len(splt)-1] = ext | |
| 53 | + | return strings.Join(splt, ".") | |
| 54 | + | } | |
| 55 | + | ||
| 56 | + | // NormalizeNamespace converts a type to one that always includes a lowercase namespace | |
| 57 | + | // if no namespace is found, it adds `ns`, unless if strip is True then namespaces always equaling `ns` will be removed | |
| 58 | + | func NormalizeNamespace(ns string, gotype string, strip bool) string { | |
| 59 | + | if ns == "" { | |
| 60 | + | return "" | |
| 61 | + | } | |
| 62 | + | gotype = strings.Trim(gotype, "*") | |
| 63 | + | splt := strings.Split(gotype, ".") | |
| 64 | + | if len(splt) <= 1 { | |
| 65 | + | splt = append([]string{ns}, splt...) | |
| 66 | + | } | |
| 67 | + | splt[0] = strings.ToLower(splt[0]) | |
| 68 | + | if strip && splt[0] == strings.ToLower(ns) { | |
| 69 | + | splt = splt[1:] | |
| 70 | + | } | |
| 71 | + | return strings.Join(splt, ".") | |
| 72 | + | } | |
| 73 | + | ||
| 74 | + | // TranslateFilename translates a file path by renaming the file to a go suitable file | |
| 75 | + | func TranslateFilename(filename string) string { | |
| 76 | + | if filename == "" { | |
| 77 | + | return "main.go" | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | b := filepath.Base(filename) | |
| 81 | + | return ReplaceExtension(b, "go") | |
| 82 | + | } | |
| 83 | + | ||
| 84 | + | func ConvertArgs(a []string) string { | |
| 85 | + | return strings.Join(a, ", ") | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | func ConvertArgsComma(a []string) string { | |
| 89 | + | if len(a) == 0 { | |
| 90 | + | return "" | |
| 91 | + | } | |
| 92 | + | return ", " + strings.Join(a, ", ") | |
| 93 | + | } | |
A shell.nix +26 -0
| @@ -0,0 +1,26 @@ | |||
| 1 | + | { pkgs ? import <nixpkgs> {} }: | |
| 2 | + | pkgs.mkShell { | |
| 3 | + | # nativeBuildInputs is usually what you want -- tools you need to run | |
| 4 | + | buildInputs = [ | |
| 5 | + | pkgs.go | |
| 6 | + | pkgs.godef | |
| 7 | + | pkgs.go-tools | |
| 8 | + | pkgs.vim | |
| 9 | + | pkgs.gofumpt | |
| 10 | + | pkgs.gopls | |
| 11 | + | pkgs.python3 | |
| 12 | + | pkgs.libadwaita.dev | |
| 13 | + | pkgs.python3.pkgs.pip | |
| 14 | + | pkgs.gotools | |
| 15 | + | ]; | |
| 16 | + | shellHook = '' | |
| 17 | + | # Tells pip to put packages into $PIP_PREFIX instead of the usual locations. | |
| 18 | + | # See https://pip.pypa.io/en/stable/user_guide/#environment-variables. | |
| 19 | + | export PIP_PREFIX=$(pwd)/_build/pip_packages | |
| 20 | + | export PYTHONPATH="$PIP_PREFIX/${pkgs.python3.sitePackages}:$PYTHONPATH" | |
| 21 | + | export PATH="$PIP_PREFIX/bin:$PATH" | |
| 22 | + | export GOPATH="$HOME/go" | |
| 23 | + | unset SOURCE_DATE_EPOCH | |
| 24 | + | ''; | |
| 25 | + | } | |
| 26 | + | ||
A templates/go +264 -0
| @@ -0,0 +1,264 @@ | |||
| 1 | + | // Package {{.PkgName}} was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package {{.PkgName}} | |
| 3 | + | ||
| 4 | + | {{ $NotGObject := ne .PkgName "gobject" }} | |
| 5 | + | ||
| 6 | + | {{if or .Imports .NeedsInit}} | |
| 7 | + | import ( | |
| 8 | + | {{if .NeedsInit}} | |
| 9 | + | "github.com/jwijenbergh/purego" | |
| 10 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 11 | + | {{end}} | |
| 12 | + | {{range .Imports -}} | |
| 13 | + | "github.com/jwijenbergh/puregotk/v4/{{.}}" | |
| 14 | + | {{end}} | |
| 15 | + | ) | |
| 16 | + | {{end}} | |
| 17 | + | ||
| 18 | + | {{$outer := .}} | |
| 19 | + | ||
| 20 | + | {{range .Callbacks -}} | |
| 21 | + | {{.Doc}} | |
| 22 | + | type {{.Name}} func({{ conv .Args.Pure.Types }}) {{.Ret.Raw}} | |
| 23 | + | {{end}} | |
| 24 | + | ||
| 25 | + | {{range .Records -}} | |
| 26 | + | {{.Doc}} | |
| 27 | + | type {{.Name}} struct { | |
| 28 | + | {{range .Fields}} | |
| 29 | + | {{.Name}} {{.Type}} | |
| 30 | + | {{end}} | |
| 31 | + | } | |
| 32 | + | {{end}} | |
| 33 | + | ||
| 34 | + | {{range .Interfaces -}} | |
| 35 | + | {{.Doc}} | |
| 36 | + | type {{.Name}} interface { | |
| 37 | + | GoPointer() uintptr | |
| 38 | + | SetGoPointer(uintptr) | |
| 39 | + | {{range .Methods -}} | |
| 40 | + | {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Value}} | |
| 41 | + | {{end}} | |
| 42 | + | } | |
| 43 | + | type {{.Name}}Base struct { | |
| 44 | + | Ptr uintptr | |
| 45 | + | } | |
| 46 | + | ||
| 47 | + | func (x *{{.Name}}Base) GoPointer() uintptr { | |
| 48 | + | return x.Ptr | |
| 49 | + | } | |
| 50 | + | ||
| 51 | + | func (x *{{.Name}}Base) SetGoPointer(ptr uintptr) { | |
| 52 | + | x.Ptr = ptr | |
| 53 | + | } | |
| 54 | + | ||
| 55 | + | {{$outer := .}} | |
| 56 | + | {{range .Methods -}} | |
| 57 | + | {{.Doc}} | |
| 58 | + | func (x *{{$outer.Name}}Base) {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Value}} { | |
| 59 | + | {{if .Ret.Class}} | |
| 60 | + | {{.Name}}Ptr := {{.Namespace}}X{{.FullName}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 61 | + | if {{.Name}}Ptr == 0 { | |
| 62 | + | return nil | |
| 63 | + | } | |
| 64 | + | {{if .Ret.RefSink}} | |
| 65 | + | {{if $NotGObject}}gobject.{{end}}IncreaseRef({{.Name}}Ptr) | |
| 66 | + | {{end}} | |
| 67 | + | {{.Name}}Cls := {{.Ret.Instance}}{} | |
| 68 | + | {{.Name}}Cls.Ptr = {{.Name}}Ptr | |
| 69 | + | return {{.Name}}Cls | |
| 70 | + | {{else if .Ret.Value}} | |
| 71 | + | return {{.Namespace}}X{{.FullName}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 72 | + | {{else}} | |
| 73 | + | {{.Namespace}}X{{.FullName}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 74 | + | {{end}} | |
| 75 | + | } | |
| 76 | + | {{end}} | |
| 77 | + | ||
| 78 | + | {{range .Methods -}} | |
| 79 | + | var {{.Namespace}}X{{.FullName}} func(uintptr {{convc .Args.Pure.Types}}) {{.Ret.Raw}} | |
| 80 | + | {{end}} | |
| 81 | + | {{end}} | |
| 82 | + | ||
| 83 | + | {{range .Aliases -}} | |
| 84 | + | {{.Doc}} | |
| 85 | + | type {{.Name}} = {{.Value}} | |
| 86 | + | {{end}} | |
| 87 | + | ||
| 88 | + | {{range .Enums -}} | |
| 89 | + | {{.Doc}} | |
| 90 | + | type {{.Name}} int | |
| 91 | + | const ( | |
| 92 | + | {{$outer := .}} | |
| 93 | + | {{range .Values -}} | |
| 94 | + | {{.Doc}} | |
| 95 | + | {{.Name}} {{$outer.Name}} = {{.Value}} | |
| 96 | + | {{end}} | |
| 97 | + | ) | |
| 98 | + | {{end}} | |
| 99 | + | ||
| 100 | + | {{range .Functions -}} | |
| 101 | + | var x{{.Name}} func({{conv .Args.Pure.Types}}) {{.Ret.Raw}} | |
| 102 | + | ||
| 103 | + | {{.Doc}} | |
| 104 | + | func {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Value}} { | |
| 105 | + | {{if .Ret.Class}} | |
| 106 | + | {{.Name}}Ptr := x{{.Name}}({{conv .Args.API.Call}}) | |
| 107 | + | if {{.Name}}Ptr == 0 { | |
| 108 | + | return nil | |
| 109 | + | } | |
| 110 | + | {{if .Ret.RefSink}} | |
| 111 | + | {{if $NotGObject}}gobject.{{end}}IncreaseRef({{.Name}}Ptr) | |
| 112 | + | {{end}} | |
| 113 | + | {{.Name}}Cls := {{.Ret.Instance}}{} | |
| 114 | + | {{.Name}}Cls.Ptr = {{.Name}}Ptr | |
| 115 | + | return {{.Name}}Cls | |
| 116 | + | {{else if .Ret.Value}} | |
| 117 | + | return x{{.Name}}({{conv .Args.API.Call}}) | |
| 118 | + | {{else}} | |
| 119 | + | x{{.Name}}({{conv .Args.API.Call}}) | |
| 120 | + | {{end}} | |
| 121 | + | } | |
| 122 | + | {{end}} | |
| 123 | + | ||
| 124 | + | {{range .Classes -}} | |
| 125 | + | {{.Doc}} | |
| 126 | + | type {{.Name}} struct { | |
| 127 | + | {{.Parent}} | |
| 128 | + | {{if not .Parent}} | |
| 129 | + | Ptr uintptr | |
| 130 | + | {{end}} | |
| 131 | + | } | |
| 132 | + | ||
| 133 | + | {{$outer := .}} | |
| 134 | + | func {{.Name}}NewFromInternalPtr(ptr uintptr) *{{.Name}} { | |
| 135 | + | cls := &{{.Name}}{} | |
| 136 | + | cls.Ptr = ptr | |
| 137 | + | return cls | |
| 138 | + | } | |
| 139 | + | ||
| 140 | + | {{range .Constructors -}} | |
| 141 | + | var x{{.Name}}{{$outer.Name}} func({{conv .Args.Pure.Types}}) {{.Ret.Raw}} | |
| 142 | + | ||
| 143 | + | ||
| 144 | + | {{.Doc}} | |
| 145 | + | func {{.Name}}{{$outer.Name}}({{conv .Args.API.Full}}) {{.Ret.Value}} { | |
| 146 | + | {{.Name}}{{$outer.Name}}Ptr := x{{.Name}}{{$outer.Name}}({{conv .Args.API.Call}}) | |
| 147 | + | if {{.Name}}{{$outer.Name}}Ptr == 0 { | |
| 148 | + | return nil | |
| 149 | + | } | |
| 150 | + | {{if .Ret.RefSink}} | |
| 151 | + | {{if $NotGObject}}gobject.{{end}}IncreaseRef({{.Name}}{{$outer.Name}}Ptr) | |
| 152 | + | {{end}} | |
| 153 | + | {{.Name}}{{$outer.Name}}Cls := {{.Ret.Instance}}{} | |
| 154 | + | {{.Name}}{{$outer.Name}}Cls.Ptr = {{.Name}}{{$outer.Name}}Ptr | |
| 155 | + | return {{.Name}}{{$outer.Name}}Cls | |
| 156 | + | } | |
| 157 | + | {{end}} | |
| 158 | + | ||
| 159 | + | {{$outer := .}} | |
| 160 | + | {{range .Receivers -}} | |
| 161 | + | var x{{$outer.Name}}{{.Name}} func(uintptr {{convc .Args.Pure.Types}}) {{.Ret.Raw}} | |
| 162 | + | ||
| 163 | + | {{.Doc}} | |
| 164 | + | func (x *{{$outer.Name}}) {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Value}} { | |
| 165 | + | {{if .Ret.Class}} | |
| 166 | + | {{.Name}}Ptr := x{{$outer.Name}}{{.Name}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 167 | + | if {{.Name}}Ptr == 0 { | |
| 168 | + | return nil | |
| 169 | + | } | |
| 170 | + | {{if .Ret.RefSink}} | |
| 171 | + | {{if $NotGObject}}gobject.{{end}}IncreaseRef({{.Name}}Ptr) | |
| 172 | + | {{end}} | |
| 173 | + | {{.Name}}Cls := {{.Ret.Instance}}{} | |
| 174 | + | {{.Name}}Cls.Ptr = {{.Name}}Ptr | |
| 175 | + | return {{.Name}}Cls | |
| 176 | + | {{else if .Ret.Value}} | |
| 177 | + | return x{{$outer.Name}}{{.Name}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 178 | + | {{else}} | |
| 179 | + | x{{$outer.Name}}{{.Name}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 180 | + | {{end}} | |
| 181 | + | } | |
| 182 | + | {{end}} | |
| 183 | + | ||
| 184 | + | func (c *{{.Name}}) GoPointer() uintptr { | |
| 185 | + | return c.Ptr | |
| 186 | + | } | |
| 187 | + | ||
| 188 | + | func (c *{{.Name}}) SetGoPointer(ptr uintptr) { | |
| 189 | + | c.Ptr = ptr | |
| 190 | + | } | |
| 191 | + | ||
| 192 | + | {{range .Signals -}} | |
| 193 | + | ||
| 194 | + | {{.Doc}} | |
| 195 | + | func (x *{{$outer.Name}}) Connect{{.Name}}(cb func({{$outer.Name}} {{convc .Args.API.Types}}) {{.Ret.Value}}) { | |
| 196 | + | fcb := func(clsPtr uintptr {{convc .Args.Pure.Full}}) {{.Ret.Raw}} { | |
| 197 | + | fa := {{$outer.Name}}{} | |
| 198 | + | fa.Ptr = clsPtr | |
| 199 | + | {{if .Ret.Class}} | |
| 200 | + | {{.Name}}Cls := cb(fa {{convc .Args.Pure.Call}}) | |
| 201 | + | return {{.Name}}Cls.Ptr | |
| 202 | + | {{else if .Ret.Value}} | |
| 203 | + | return cb(fa {{convc .Args.Pure.Call}}) | |
| 204 | + | {{else}} | |
| 205 | + | cb(fa {{convc .Args.Pure.Call}}) | |
| 206 | + | {{end}} | |
| 207 | + | } | |
| 208 | + | {{if $NotGObject}}gobject.{{end}}ObjectConnect(x.GoPointer(), "signal::{{.CName}}", purego.NewCallback(fcb)) | |
| 209 | + | } | |
| 210 | + | {{end}} | |
| 211 | + | ||
| 212 | + | {{range .Interfaces -}} | |
| 213 | + | {{range .Methods -}} | |
| 214 | + | {{.Doc}} | |
| 215 | + | func (x *{{$outer.Name}}) {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Value}} { | |
| 216 | + | {{if .Ret.Class}} | |
| 217 | + | {{.Name}}Ptr := {{.Namespace}}X{{.FullName}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 218 | + | if {{.Name}}Ptr == 0 { | |
| 219 | + | return nil | |
| 220 | + | } | |
| 221 | + | {{if .Ret.RefSink}} | |
| 222 | + | {{if $NotGObject}}gobject.{{end}}IncreaseRef({{.Name}}Ptr) | |
| 223 | + | {{end}} | |
| 224 | + | {{.Name}}Cls := {{.Ret.Instance}}{} | |
| 225 | + | {{.Name}}Cls.Ptr = {{.Name}}Ptr | |
| 226 | + | return {{.Name}}Cls | |
| 227 | + | {{else if .Ret.Value}} | |
| 228 | + | return {{.Namespace}}X{{.FullName}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 229 | + | {{else}} | |
| 230 | + | {{.Namespace}}X{{.FullName}}(x.GoPointer() {{convc .Args.API.Call}}) | |
| 231 | + | {{end}} | |
| 232 | + | } | |
| 233 | + | {{end}} | |
| 234 | + | {{end}} | |
| 235 | + | ||
| 236 | + | {{end}} | |
| 237 | + | ||
| 238 | + | ||
| 239 | + | {{if .NeedsInit}} | |
| 240 | + | ||
| 241 | + | func init() { | |
| 242 | + | lib, err := purego.Dlopen(core.GetPath("{{.PkgEnv}}"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 243 | + | if err != nil { | |
| 244 | + | panic(err) | |
| 245 | + | } | |
| 246 | + | {{range .Functions -}} | |
| 247 | + | core.PuregoSafeRegister(&x{{.Name}}, lib, "{{.CName}}") | |
| 248 | + | {{end}} | |
| 249 | + | {{range .Classes -}} | |
| 250 | + | {{$cls := .}} | |
| 251 | + | {{range .Constructors -}} | |
| 252 | + | core.PuregoSafeRegister(&x{{.Name}}{{$cls.Name}}, lib, "{{.CName}}") | |
| 253 | + | {{end}} | |
| 254 | + | {{range .Receivers -}} | |
| 255 | + | core.PuregoSafeRegister(&x{{$cls.Name}}{{.Name}}, lib, "{{.CName}}") | |
| 256 | + | {{end}} | |
| 257 | + | {{end}} | |
| 258 | + | {{range .Interfaces -}} | |
| 259 | + | {{range .Methods -}} | |
| 260 | + | core.PuregoSafeRegister(&{{.Namespace}}X{{.FullName}}, lib, "{{.CName}}") | |
| 261 | + | {{end}} | |
| 262 | + | {{end}} | |
| 263 | + | } | |
| 264 | + | {{end}} | |
A templates/gobject +94 -0
| @@ -0,0 +1,94 @@ | |||
| 1 | + | package gobject | |
| 2 | + | ||
| 3 | + | import ( | |
| 4 | + | "os" | |
| 5 | + | "reflect" | |
| 6 | + | ||
| 7 | + | "github.com/jwijenbergh/purego" | |
| 8 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | type Ptr interface { | |
| 12 | + | GoPointer() uintptr | |
| 13 | + | SetGoPointer(uintptr) | |
| 14 | + | } | |
| 15 | + | ||
| 16 | + | func ConvertPtr(a interface{}) *uintptr { | |
| 17 | + | if a == nil || (reflect.ValueOf(a).Kind() == reflect.Ptr && reflect.ValueOf(a).IsNil()) { | |
| 18 | + | return nil | |
| 19 | + | } | |
| 20 | + | ptr := reflect.ValueOf(a).Elem() | |
| 21 | + | v, ok := ptr.Interface().(Ptr); | |
| 22 | + | if !ok { | |
| 23 | + | panic("not valid") | |
| 24 | + | } | |
| 25 | + | g := v.GoPointer() | |
| 26 | + | return &g | |
| 27 | + | } | |
| 28 | + | ||
| 29 | + | func IncreaseRef(a uintptr) { | |
| 30 | + | xObjectRefSink(a) | |
| 31 | + | } | |
| 32 | + | ||
| 33 | + | func ObjectConnect(a uintptr, b string, c ...interface{}) uintptr { | |
| 34 | + | return xObjectConnect(a, b, c...) | |
| 35 | + | } | |
| 36 | + | ||
| 37 | + | func (o Object) Cast(v Ptr) { | |
| 38 | + | v.SetGoPointer(o.GoPointer()) | |
| 39 | + | } | |
| 40 | + | ||
| 41 | + | // NewCallback is an alias to purego.NewCallback | |
| 42 | + | func NewCallback(fn interface{}) uintptr { | |
| 43 | + | return purego.NewCallback(fn) | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | // types | |
| 47 | + | const ( | |
| 48 | + | TypeInvalidVal Type = 0 | |
| 49 | + | TypeNoneVal = 1 << 2 | |
| 50 | + | TypeInterfaceVal = 2 << 2 | |
| 51 | + | TypeCharVal = 3 << 2 | |
| 52 | + | TypeUcharVal = 4 << 2 | |
| 53 | + | TypeBooleanVal = 5 << 2 | |
| 54 | + | TypeIntVal = 6 << 2 | |
| 55 | + | TypeUintVal = 7 << 2 | |
| 56 | + | TypeLongVal = 8 << 2 | |
| 57 | + | TypeUlongVal = 9 << 2 | |
| 58 | + | TypeInt64Val = 10 << 2 | |
| 59 | + | TypeUint64Val = 11 << 2 | |
| 60 | + | TypeEnumVal = 12 << 2 | |
| 61 | + | TypeFlagsVal = 13 << 2 | |
| 62 | + | TypeFloatVal = 14 << 2 | |
| 63 | + | TypeDoubleVal = 15 << 2 | |
| 64 | + | TypeStringVal = 16 << 2 | |
| 65 | + | TypePointerVal = 17 << 2 | |
| 66 | + | TypeBoxedVal = 18 << 2 | |
| 67 | + | TypeParamVal = 19 << 2 | |
| 68 | + | TypeObjectVal = 20 << 2 | |
| 69 | + | TypeReservedGLibLastVal = 31 << 2 | |
| 70 | + | TypeReservedBseFirstVal = 32 << 2 | |
| 71 | + | TypeReservedBseLastVal = 48 << 2 | |
| 72 | + | TypeReservedUserFirstVal = 49 << 2 | |
| 73 | + | ) | |
| 74 | + | ||
| 75 | + | var xValueDupString func(*Value) string | |
| 76 | + | ||
| 77 | + | func (v *Value) String() string { | |
| 78 | + | return xValueDupString(v) | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | var xValueGetInt func(*Value) int | |
| 82 | + | ||
| 83 | + | func (v *Value) Int() int { | |
| 84 | + | return xValueGetInt(v) | |
| 85 | + | } | |
| 86 | + | ||
| 87 | + | func init() { | |
| 88 | + | lib, err := purego.Dlopen(os.Getenv("PUREGOTK_GTK_PATH"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 89 | + | if err != nil { | |
| 90 | + | panic(err) | |
| 91 | + | } | |
| 92 | + | core.PuregoSafeRegister(&xValueDupString, lib, "g_value_dup_string") | |
| 93 | + | core.PuregoSafeRegister(&xValueGetInt, lib, "g_value_get_int") | |
| 94 | + | } | |
A v4/adw/adw-about-window.go +1220 -0
| @@ -0,0 +1,1220 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gdk" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gsk" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 11 | + | ) | |
| 12 | + | ||
| 13 | + | type AboutWindowClass struct { | |
| 14 | + | ParentClass uintptr | |
| 15 | + | } | |
| 16 | + | ||
| 17 | + | var xShowAboutWindow func(uintptr, string, ...interface{}) | |
| 18 | + | ||
| 19 | + | // A convenience function for showing an application’s about window. | |
| 20 | + | func ShowAboutWindow(ParentVar *gtk.Window, FirstPropertyNameVar string, varArgs ...interface{}) { | |
| 21 | + | ||
| 22 | + | xShowAboutWindow(ParentVar.GoPointer(), FirstPropertyNameVar, varArgs...) | |
| 23 | + | ||
| 24 | + | } | |
| 25 | + | ||
| 26 | + | // A window showing information about the application. | |
| 27 | + | // | |
| 28 | + | // <picture> | |
| 29 | + | // | |
| 30 | + | // <source srcset="about-window-dark.png" media="(prefers-color-scheme: dark)"> | |
| 31 | + | // <img src="about-window.png" alt="about-window"> | |
| 32 | + | // | |
| 33 | + | // </picture> | |
| 34 | + | // | |
| 35 | + | // An about window is typically opened when the user activates the `About …` | |
| 36 | + | // item in the application's primary menu. All parts of the window are optional. | |
| 37 | + | // | |
| 38 | + | // ## Main page | |
| 39 | + | // | |
| 40 | + | // `AdwAboutWindow` prominently displays the application's icon, name, developer | |
| 41 | + | // name and version. They can be set with the [property@AboutWindow:application-icon], | |
| 42 | + | // [property@AboutWindow:application-name], | |
| 43 | + | // [property@AboutWindow:developer-name] and [property@AboutWindow:version] | |
| 44 | + | // respectively. | |
| 45 | + | // | |
| 46 | + | // ## What's New | |
| 47 | + | // | |
| 48 | + | // `AdwAboutWindow` provides a way for applications to display their release | |
| 49 | + | // notes, set with the [property@AboutWindow:release-notes] property. | |
| 50 | + | // | |
| 51 | + | // Release notes are formatted the same way as | |
| 52 | + | // [AppStream descriptions](https://freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-description). | |
| 53 | + | // | |
| 54 | + | // The supported formatting options are: | |
| 55 | + | // | |
| 56 | + | // * Paragraph (`<p>`) | |
| 57 | + | // * Ordered list (`<ol>`), with list items (`<li>`) | |
| 58 | + | // * Unordered list (`<ul>`), with list items (`<li>`) | |
| 59 | + | // | |
| 60 | + | // Within paragraphs and list items, emphasis (`<em>`) and inline code | |
| 61 | + | // (`<code>`) text styles are supported. The emphasis is rendered in italic, | |
| 62 | + | // while inline code is shown in a monospaced font. | |
| 63 | + | // | |
| 64 | + | // Any text outside paragraphs or list items is ignored. | |
| 65 | + | // | |
| 66 | + | // Nested lists are not supported. | |
| 67 | + | // | |
| 68 | + | // Only one version can be shown at a time. By default, the displayed version | |
| 69 | + | // number matches [property@AboutWindow:version]. Use | |
| 70 | + | // [property@AboutWindow:release-notes-version] to override it. | |
| 71 | + | // | |
| 72 | + | // ## Details | |
| 73 | + | // | |
| 74 | + | // The Details page displays the application comments and links. | |
| 75 | + | // | |
| 76 | + | // The comments can be set with the [property@AboutWindow:comments] property. | |
| 77 | + | // Unlike [property@Gtk.AboutDialog:comments], this string can be long and | |
| 78 | + | // detailed. It can also contain links and Pango markup. | |
| 79 | + | // | |
| 80 | + | // To set the application website, use [property@AboutWindow:website]. | |
| 81 | + | // To add extra links below the website, use [method@AboutWindow.add_link]. | |
| 82 | + | // | |
| 83 | + | // If the Details page doesn't have any other content besides website, the | |
| 84 | + | // website will be displayed on the main page instead. | |
| 85 | + | // | |
| 86 | + | // ## Troubleshooting | |
| 87 | + | // | |
| 88 | + | // `AdwAboutWindow` displays the following two links on the main page: | |
| 89 | + | // | |
| 90 | + | // * Support Questions, set with the [property@AboutWindow:support-url] property, | |
| 91 | + | // * Report an Issue, set with the [property@AboutWindow:issue-url] property. | |
| 92 | + | // | |
| 93 | + | // Additionally, applications can provide debugging information. It will be | |
| 94 | + | // shown separately on the Troubleshooting page. Use the | |
| 95 | + | // [property@AboutWindow:debug-info] property to specify it. | |
| 96 | + | // | |
| 97 | + | // It's intended to be attached to issue reports when reporting issues against | |
| 98 | + | // the application. As such, it cannot contain markup or links. | |
| 99 | + | // | |
| 100 | + | // `AdwAboutWindow` provides a quick way to save debug information to a file. | |
| 101 | + | // When saving, [property@AboutWindow:debug-info-filename] would be used as | |
| 102 | + | // the suggested filename. | |
| 103 | + | // | |
| 104 | + | // ## Credits and Acknowledgements | |
| 105 | + | // | |
| 106 | + | // The Credits page has the following default sections: | |
| 107 | + | // | |
| 108 | + | // * Developers, set with the [property@AboutWindow:developers] property, | |
| 109 | + | // * Designers, set with the [property@AboutWindow:designers] property, | |
| 110 | + | // * Artists, set with the [property@AboutWindow:artists] property, | |
| 111 | + | // * Documenters, set with the [property@AboutWindow:documenters] property, | |
| 112 | + | // * Translators, set with the [property@AboutWindow:translator-credits] property. | |
| 113 | + | // | |
| 114 | + | // When setting translator credits, use the strings `"translator-credits"` or | |
| 115 | + | // `"translator_credits"` and mark them as translatable. | |
| 116 | + | // | |
| 117 | + | // The default sections that don't contain any names won't be displayed. | |
| 118 | + | // | |
| 119 | + | // The Credits page can also contain an arbitrary number of extra sections below | |
| 120 | + | // the default ones. Use [method@AboutWindow.add_credit_section] to add them. | |
| 121 | + | // | |
| 122 | + | // The Acknowledgements page can be used to acknowledge additional people and | |
| 123 | + | // organizations for their non-development contributions. Use | |
| 124 | + | // [method@AboutWindow.add_acknowledgement_section] to add sections to it. For | |
| 125 | + | // example, it can be used to list backers in a crowdfunded project or to give | |
| 126 | + | // special thanks. | |
| 127 | + | // | |
| 128 | + | // Each of the people or organizations can have an email address or a website | |
| 129 | + | // specified. To add a email address, use a string like | |
| 130 | + | // `Edgar Allan Poe <edgar@poe.com>`. To specify a website with a title, use a | |
| 131 | + | // string like `The GNOME Project https://www.gnome.org`: | |
| 132 | + | // | |
| 133 | + | // <picture> | |
| 134 | + | // | |
| 135 | + | // <source srcset="about-window-credits-dark.png" media="(prefers-color-scheme: dark)"> | |
| 136 | + | // <img src="about-window-credits.png" alt="about-window-credits"> | |
| 137 | + | // | |
| 138 | + | // </picture> | |
| 139 | + | // | |
| 140 | + | // ## Legal | |
| 141 | + | // | |
| 142 | + | // The Legal page displays the copyright and licensing information for the | |
| 143 | + | // application and other modules. | |
| 144 | + | // | |
| 145 | + | // The copyright string is set with the [property@AboutWindow:copyright] | |
| 146 | + | // property and should be a short string of one or two lines, for example: | |
| 147 | + | // `© 2022 Example`. | |
| 148 | + | // | |
| 149 | + | // Licensing information can be quickly set from a list of known licenses with | |
| 150 | + | // the [property@AboutWindow:license-type] property. If the application's | |
| 151 | + | // license is not in the list, [property@AboutWindow:license] can be used | |
| 152 | + | // instead. | |
| 153 | + | // | |
| 154 | + | // To add information about other modules, such as application dependencies or | |
| 155 | + | // data, use [method@AboutWindow.add_legal_section]. | |
| 156 | + | // | |
| 157 | + | // ## Constructing | |
| 158 | + | // | |
| 159 | + | // To make constructing an `AdwAboutWindow` as convenient as possible, you can | |
| 160 | + | // use the function [func@show_about_window] which constructs and shows a | |
| 161 | + | // window. | |
| 162 | + | // | |
| 163 | + | // ```c | |
| 164 | + | // static void | |
| 165 | + | // show_about (GtkApplication *app) | |
| 166 | + | // | |
| 167 | + | // { | |
| 168 | + | // const char *developers[] = { | |
| 169 | + | // "Angela Avery", | |
| 170 | + | // NULL | |
| 171 | + | // }; | |
| 172 | + | // | |
| 173 | + | // const char *designers[] = { | |
| 174 | + | // "GNOME Design Team", | |
| 175 | + | // NULL | |
| 176 | + | // }; | |
| 177 | + | // | |
| 178 | + | // adw_show_about_window (gtk_application_get_active_window (app), | |
| 179 | + | // "application-name", _("Example"), | |
| 180 | + | // "application-icon", "org.example.App", | |
| 181 | + | // "version", "1.2.3", | |
| 182 | + | // "copyright", "© 2022 Angela Avery", | |
| 183 | + | // "issue-url", "https://gitlab.gnome.org/example/example/-/issues/new", | |
| 184 | + | // "license-type", GTK_LICENSE_GPL_3_0, | |
| 185 | + | // "developers", developers, | |
| 186 | + | // "designers", designers, | |
| 187 | + | // "translator-credits", _("translator-credits"), | |
| 188 | + | // NULL); | |
| 189 | + | // } | |
| 190 | + | // | |
| 191 | + | // ``` | |
| 192 | + | // | |
| 193 | + | // ## CSS nodes | |
| 194 | + | // | |
| 195 | + | // `AdwAboutWindow` has a main CSS node with the name `window` and the | |
| 196 | + | // style class `.about`. | |
| 197 | + | type AboutWindow struct { | |
| 198 | + | Window | |
| 199 | + | } | |
| 200 | + | ||
| 201 | + | func AboutWindowNewFromInternalPtr(ptr uintptr) *AboutWindow { | |
| 202 | + | cls := &AboutWindow{} | |
| 203 | + | cls.Ptr = ptr | |
| 204 | + | return cls | |
| 205 | + | } | |
| 206 | + | ||
| 207 | + | var xNewAboutWindow func() uintptr | |
| 208 | + | ||
| 209 | + | // Creates a new `AdwAboutWindow`. | |
| 210 | + | func NewAboutWindow() *gtk.Widget { | |
| 211 | + | NewAboutWindowPtr := xNewAboutWindow() | |
| 212 | + | if NewAboutWindowPtr == 0 { | |
| 213 | + | return nil | |
| 214 | + | } | |
| 215 | + | ||
| 216 | + | gobject.IncreaseRef(NewAboutWindowPtr) | |
| 217 | + | ||
| 218 | + | NewAboutWindowCls := >k.Widget{} | |
| 219 | + | NewAboutWindowCls.Ptr = NewAboutWindowPtr | |
| 220 | + | return NewAboutWindowCls | |
| 221 | + | } | |
| 222 | + | ||
| 223 | + | var xAboutWindowAddAcknowledgementSection func(uintptr, string, uintptr) | |
| 224 | + | ||
| 225 | + | // Adds a section to the Acknowledgements page. | |
| 226 | + | // | |
| 227 | + | // This can be used to acknowledge additional people and organizations for their | |
| 228 | + | // non-development contributions - for example, backers in a crowdfunded | |
| 229 | + | // project. | |
| 230 | + | // | |
| 231 | + | // Each name may contain email addresses and URLs, see the introduction for more | |
| 232 | + | // details. | |
| 233 | + | // | |
| 234 | + | // See also: | |
| 235 | + | // | |
| 236 | + | // * [property@AboutWindow:developers] | |
| 237 | + | // * [property@AboutWindow:designers] | |
| 238 | + | // * [property@AboutWindow:artists] | |
| 239 | + | // * [property@AboutWindow:documenters] | |
| 240 | + | // * [property@AboutWindow:translator-credits] | |
| 241 | + | // * [method@AboutWindow.add_credit_section] | |
| 242 | + | func (x *AboutWindow) AddAcknowledgementSection(NameVar string, PeopleVar uintptr) { | |
| 243 | + | ||
| 244 | + | xAboutWindowAddAcknowledgementSection(x.GoPointer(), NameVar, PeopleVar) | |
| 245 | + | ||
| 246 | + | } | |
| 247 | + | ||
| 248 | + | var xAboutWindowAddCreditSection func(uintptr, string, uintptr) | |
| 249 | + | ||
| 250 | + | // Adds an extra section to the Credits page. | |
| 251 | + | // | |
| 252 | + | // Extra sections are displayed below the standard categories. | |
| 253 | + | // | |
| 254 | + | // Each name may contain email addresses and URLs, see the introduction for more | |
| 255 | + | // details. | |
| 256 | + | // | |
| 257 | + | // See also: | |
| 258 | + | // | |
| 259 | + | // * [property@AboutWindow:developers] | |
| 260 | + | // * [property@AboutWindow:designers] | |
| 261 | + | // * [property@AboutWindow:artists] | |
| 262 | + | // * [property@AboutWindow:documenters] | |
| 263 | + | // * [property@AboutWindow:translator-credits] | |
| 264 | + | // * [method@AboutWindow.add_acknowledgement_section] | |
| 265 | + | func (x *AboutWindow) AddCreditSection(NameVar string, PeopleVar uintptr) { | |
| 266 | + | ||
| 267 | + | xAboutWindowAddCreditSection(x.GoPointer(), NameVar, PeopleVar) | |
| 268 | + | ||
| 269 | + | } | |
| 270 | + | ||
| 271 | + | var xAboutWindowAddLegalSection func(uintptr, string, string, gtk.License, string) | |
| 272 | + | ||
| 273 | + | // Adds an extra section to the Legal page. | |
| 274 | + | // | |
| 275 | + | // Extra sections will be displayed below the application's own information. | |
| 276 | + | // | |
| 277 | + | // The parameters @copyright, @license_type and @license will be used to present | |
| 278 | + | // the it the same way as [property@AboutWindow:copyright], | |
| 279 | + | // [property@AboutWindow:license-type] and [property@AboutWindow:license] are | |
| 280 | + | // for the application's own information. | |
| 281 | + | // | |
| 282 | + | // See those properties for more details. | |
| 283 | + | // | |
| 284 | + | // This can be useful to attribute the application dependencies or data. | |
| 285 | + | // | |
| 286 | + | // Examples: | |
| 287 | + | // | |
| 288 | + | // ```c | |
| 289 | + | // adw_about_window_add_legal_section (ADW_ABOUT_WINDOW (about), | |
| 290 | + | // | |
| 291 | + | // _("Copyright and a known license"), | |
| 292 | + | // "© 2022 Example", | |
| 293 | + | // GTK_LICENSE_LGPL_2_1, | |
| 294 | + | // NULL); | |
| 295 | + | // | |
| 296 | + | // adw_about_window_add_legal_section (ADW_ABOUT_WINDOW (about), | |
| 297 | + | // | |
| 298 | + | // _("Copyright and custom license"), | |
| 299 | + | // "© 2022 Example", | |
| 300 | + | // GTK_LICENSE_CUSTOM, | |
| 301 | + | // "Custom license text"); | |
| 302 | + | // | |
| 303 | + | // adw_about_window_add_legal_section (ADW_ABOUT_WINDOW (about), | |
| 304 | + | // | |
| 305 | + | // _("Copyright only"), | |
| 306 | + | // "© 2022 Example", | |
| 307 | + | // GTK_LICENSE_UNKNOWN, | |
| 308 | + | // NULL); | |
| 309 | + | // | |
| 310 | + | // adw_about_window_add_legal_section (ADW_ABOUT_WINDOW (about), | |
| 311 | + | // | |
| 312 | + | // _("Custom license only"), | |
| 313 | + | // NULL, | |
| 314 | + | // GTK_LICENSE_CUSTOM, | |
| 315 | + | // "Something completely custom here."); | |
| 316 | + | // | |
| 317 | + | // ``` | |
| 318 | + | func (x *AboutWindow) AddLegalSection(TitleVar string, CopyrightVar string, LicenseTypeVar gtk.License, LicenseVar string) { | |
| 319 | + | ||
| 320 | + | xAboutWindowAddLegalSection(x.GoPointer(), TitleVar, CopyrightVar, LicenseTypeVar, LicenseVar) | |
| 321 | + | ||
| 322 | + | } | |
| 323 | + | ||
| 324 | + | var xAboutWindowAddLink func(uintptr, string, string) | |
| 325 | + | ||
| 326 | + | // Adds an extra link to the Details page. | |
| 327 | + | // | |
| 328 | + | // Extra links are displayed under the comment and website. | |
| 329 | + | // | |
| 330 | + | // Underlines in @title will be interpreted as indicating a mnemonic. | |
| 331 | + | // | |
| 332 | + | // See [property@AboutWindow:website]. | |
| 333 | + | func (x *AboutWindow) AddLink(TitleVar string, UrlVar string) { | |
| 334 | + | ||
| 335 | + | xAboutWindowAddLink(x.GoPointer(), TitleVar, UrlVar) | |
| 336 | + | ||
| 337 | + | } | |
| 338 | + | ||
| 339 | + | var xAboutWindowGetApplicationIcon func(uintptr) string | |
| 340 | + | ||
| 341 | + | // Gets the name of the application icon for @self. | |
| 342 | + | func (x *AboutWindow) GetApplicationIcon() string { | |
| 343 | + | ||
| 344 | + | return xAboutWindowGetApplicationIcon(x.GoPointer()) | |
| 345 | + | ||
| 346 | + | } | |
| 347 | + | ||
| 348 | + | var xAboutWindowGetApplicationName func(uintptr) string | |
| 349 | + | ||
| 350 | + | // Gets the application name for @self. | |
| 351 | + | func (x *AboutWindow) GetApplicationName() string { | |
| 352 | + | ||
| 353 | + | return xAboutWindowGetApplicationName(x.GoPointer()) | |
| 354 | + | ||
| 355 | + | } | |
| 356 | + | ||
| 357 | + | var xAboutWindowGetArtists func(uintptr) uintptr | |
| 358 | + | ||
| 359 | + | // Gets the list of artists of the application. | |
| 360 | + | func (x *AboutWindow) GetArtists() uintptr { | |
| 361 | + | ||
| 362 | + | return xAboutWindowGetArtists(x.GoPointer()) | |
| 363 | + | ||
| 364 | + | } | |
| 365 | + | ||
| 366 | + | var xAboutWindowGetComments func(uintptr) string | |
| 367 | + | ||
| 368 | + | // Gets the comments about the application. | |
| 369 | + | func (x *AboutWindow) GetComments() string { | |
| 370 | + | ||
| 371 | + | return xAboutWindowGetComments(x.GoPointer()) | |
| 372 | + | ||
| 373 | + | } | |
| 374 | + | ||
| 375 | + | var xAboutWindowGetCopyright func(uintptr) string | |
| 376 | + | ||
| 377 | + | // Gets the copyright information for @self. | |
| 378 | + | func (x *AboutWindow) GetCopyright() string { | |
| 379 | + | ||
| 380 | + | return xAboutWindowGetCopyright(x.GoPointer()) | |
| 381 | + | ||
| 382 | + | } | |
| 383 | + | ||
| 384 | + | var xAboutWindowGetDebugInfo func(uintptr) string | |
| 385 | + | ||
| 386 | + | // Gets the debug information for @self. | |
| 387 | + | func (x *AboutWindow) GetDebugInfo() string { | |
| 388 | + | ||
| 389 | + | return xAboutWindowGetDebugInfo(x.GoPointer()) | |
| 390 | + | ||
| 391 | + | } | |
| 392 | + | ||
| 393 | + | var xAboutWindowGetDebugInfoFilename func(uintptr) string | |
| 394 | + | ||
| 395 | + | // Gets the debug information filename for @self. | |
| 396 | + | func (x *AboutWindow) GetDebugInfoFilename() string { | |
| 397 | + | ||
| 398 | + | return xAboutWindowGetDebugInfoFilename(x.GoPointer()) | |
| 399 | + | ||
| 400 | + | } | |
| 401 | + | ||
| 402 | + | var xAboutWindowGetDesigners func(uintptr) uintptr | |
| 403 | + | ||
| 404 | + | // Gets the list of designers of the application. | |
| 405 | + | func (x *AboutWindow) GetDesigners() uintptr { | |
| 406 | + | ||
| 407 | + | return xAboutWindowGetDesigners(x.GoPointer()) | |
| 408 | + | ||
| 409 | + | } | |
| 410 | + | ||
| 411 | + | var xAboutWindowGetDeveloperName func(uintptr) string | |
| 412 | + | ||
| 413 | + | // Gets the developer name for @self. | |
| 414 | + | func (x *AboutWindow) GetDeveloperName() string { | |
| 415 | + | ||
| 416 | + | return xAboutWindowGetDeveloperName(x.GoPointer()) | |
| 417 | + | ||
| 418 | + | } | |
| 419 | + | ||
| 420 | + | var xAboutWindowGetDevelopers func(uintptr) uintptr | |
| 421 | + | ||
| 422 | + | // Gets the list of developers of the application. | |
| 423 | + | func (x *AboutWindow) GetDevelopers() uintptr { | |
| 424 | + | ||
| 425 | + | return xAboutWindowGetDevelopers(x.GoPointer()) | |
| 426 | + | ||
| 427 | + | } | |
| 428 | + | ||
| 429 | + | var xAboutWindowGetDocumenters func(uintptr) uintptr | |
| 430 | + | ||
| 431 | + | // Gets the list of documenters of the application. | |
| 432 | + | func (x *AboutWindow) GetDocumenters() uintptr { | |
| 433 | + | ||
| 434 | + | return xAboutWindowGetDocumenters(x.GoPointer()) | |
| 435 | + | ||
| 436 | + | } | |
| 437 | + | ||
| 438 | + | var xAboutWindowGetIssueUrl func(uintptr) string | |
| 439 | + | ||
| 440 | + | // Gets the issue tracker URL for @self. | |
| 441 | + | func (x *AboutWindow) GetIssueUrl() string { | |
| 442 | + | ||
| 443 | + | return xAboutWindowGetIssueUrl(x.GoPointer()) | |
| 444 | + | ||
| 445 | + | } | |
| 446 | + | ||
| 447 | + | var xAboutWindowGetLicense func(uintptr) string | |
| 448 | + | ||
| 449 | + | // Gets the license for @self. | |
| 450 | + | func (x *AboutWindow) GetLicense() string { | |
| 451 | + | ||
| 452 | + | return xAboutWindowGetLicense(x.GoPointer()) | |
| 453 | + | ||
| 454 | + | } | |
| 455 | + | ||
| 456 | + | var xAboutWindowGetLicenseType func(uintptr) gtk.License | |
| 457 | + | ||
| 458 | + | // Gets the license type for @self. | |
| 459 | + | func (x *AboutWindow) GetLicenseType() gtk.License { | |
| 460 | + | ||
| 461 | + | return xAboutWindowGetLicenseType(x.GoPointer()) | |
| 462 | + | ||
| 463 | + | } | |
| 464 | + | ||
| 465 | + | var xAboutWindowGetReleaseNotes func(uintptr) string | |
| 466 | + | ||
| 467 | + | // Gets the release notes for @self. | |
| 468 | + | func (x *AboutWindow) GetReleaseNotes() string { | |
| 469 | + | ||
| 470 | + | return xAboutWindowGetReleaseNotes(x.GoPointer()) | |
| 471 | + | ||
| 472 | + | } | |
| 473 | + | ||
| 474 | + | var xAboutWindowGetReleaseNotesVersion func(uintptr) string | |
| 475 | + | ||
| 476 | + | // Gets the version described by the application's release notes. | |
| 477 | + | func (x *AboutWindow) GetReleaseNotesVersion() string { | |
| 478 | + | ||
| 479 | + | return xAboutWindowGetReleaseNotesVersion(x.GoPointer()) | |
| 480 | + | ||
| 481 | + | } | |
| 482 | + | ||
| 483 | + | var xAboutWindowGetSupportUrl func(uintptr) string | |
| 484 | + | ||
| 485 | + | // Gets the URL of the support page for @self. | |
| 486 | + | func (x *AboutWindow) GetSupportUrl() string { | |
| 487 | + | ||
| 488 | + | return xAboutWindowGetSupportUrl(x.GoPointer()) | |
| 489 | + | ||
| 490 | + | } | |
| 491 | + | ||
| 492 | + | var xAboutWindowGetTranslatorCredits func(uintptr) string | |
| 493 | + | ||
| 494 | + | // Gets the translator credits string. | |
| 495 | + | func (x *AboutWindow) GetTranslatorCredits() string { | |
| 496 | + | ||
| 497 | + | return xAboutWindowGetTranslatorCredits(x.GoPointer()) | |
| 498 | + | ||
| 499 | + | } | |
| 500 | + | ||
| 501 | + | var xAboutWindowGetVersion func(uintptr) string | |
| 502 | + | ||
| 503 | + | // Gets the version for @self. | |
| 504 | + | func (x *AboutWindow) GetVersion() string { | |
| 505 | + | ||
| 506 | + | return xAboutWindowGetVersion(x.GoPointer()) | |
| 507 | + | ||
| 508 | + | } | |
| 509 | + | ||
| 510 | + | var xAboutWindowGetWebsite func(uintptr) string | |
| 511 | + | ||
| 512 | + | // Gets the application website URL for @self. | |
| 513 | + | func (x *AboutWindow) GetWebsite() string { | |
| 514 | + | ||
| 515 | + | return xAboutWindowGetWebsite(x.GoPointer()) | |
| 516 | + | ||
| 517 | + | } | |
| 518 | + | ||
| 519 | + | var xAboutWindowSetApplicationIcon func(uintptr, string) | |
| 520 | + | ||
| 521 | + | // Sets the name of the application icon for @self. | |
| 522 | + | // | |
| 523 | + | // The icon is displayed at the top of the main page. | |
| 524 | + | func (x *AboutWindow) SetApplicationIcon(ApplicationIconVar string) { | |
| 525 | + | ||
| 526 | + | xAboutWindowSetApplicationIcon(x.GoPointer(), ApplicationIconVar) | |
| 527 | + | ||
| 528 | + | } | |
| 529 | + | ||
| 530 | + | var xAboutWindowSetApplicationName func(uintptr, string) | |
| 531 | + | ||
| 532 | + | // Sets the application name for @self. | |
| 533 | + | // | |
| 534 | + | // The name is displayed at the top of the main page. | |
| 535 | + | func (x *AboutWindow) SetApplicationName(ApplicationNameVar string) { | |
| 536 | + | ||
| 537 | + | xAboutWindowSetApplicationName(x.GoPointer(), ApplicationNameVar) | |
| 538 | + | ||
| 539 | + | } | |
| 540 | + | ||
| 541 | + | var xAboutWindowSetArtists func(uintptr, uintptr) | |
| 542 | + | ||
| 543 | + | // Sets the list of artists of the application. | |
| 544 | + | // | |
| 545 | + | // It will be displayed on the Credits page. | |
| 546 | + | // | |
| 547 | + | // Each name may contain email addresses and URLs, see the introduction for more | |
| 548 | + | // details. | |
| 549 | + | // | |
| 550 | + | // See also: | |
| 551 | + | // | |
| 552 | + | // * [property@AboutWindow:developers] | |
| 553 | + | // * [property@AboutWindow:designers] | |
| 554 | + | // * [property@AboutWindow:documenters] | |
| 555 | + | // * [property@AboutWindow:translator-credits] | |
| 556 | + | // * [method@AboutWindow.add_credit_section] | |
| 557 | + | // * [method@AboutWindow.add_acknowledgement_section] | |
| 558 | + | func (x *AboutWindow) SetArtists(ArtistsVar uintptr) { | |
| 559 | + | ||
| 560 | + | xAboutWindowSetArtists(x.GoPointer(), ArtistsVar) | |
| 561 | + | ||
| 562 | + | } | |
| 563 | + | ||
| 564 | + | var xAboutWindowSetComments func(uintptr, string) | |
| 565 | + | ||
| 566 | + | // Sets the comments about the application. | |
| 567 | + | // | |
| 568 | + | // Comments will be shown on the Details page, above links. | |
| 569 | + | // | |
| 570 | + | // Unlike [property@Gtk.AboutDialog:comments], this string can be long and | |
| 571 | + | // detailed. It can also contain links and Pango markup. | |
| 572 | + | func (x *AboutWindow) SetComments(CommentsVar string) { | |
| 573 | + | ||
| 574 | + | xAboutWindowSetComments(x.GoPointer(), CommentsVar) | |
| 575 | + | ||
| 576 | + | } | |
| 577 | + | ||
| 578 | + | var xAboutWindowSetCopyright func(uintptr, string) | |
| 579 | + | ||
| 580 | + | // Sets the copyright information for @self. | |
| 581 | + | // | |
| 582 | + | // This should be a short string of one or two lines, for example: | |
| 583 | + | // `© 2022 Example`. | |
| 584 | + | // | |
| 585 | + | // The copyright information will be displayed on the Legal page, before the | |
| 586 | + | // application license. | |
| 587 | + | // | |
| 588 | + | // [method@AboutWindow.add_legal_section] can be used to add copyright | |
| 589 | + | // information for the application dependencies or other components. | |
| 590 | + | func (x *AboutWindow) SetCopyright(CopyrightVar string) { | |
| 591 | + | ||
| 592 | + | xAboutWindowSetCopyright(x.GoPointer(), CopyrightVar) | |
| 593 | + | ||
| 594 | + | } | |
| 595 | + | ||
| 596 | + | var xAboutWindowSetDebugInfo func(uintptr, string) | |
| 597 | + | ||
| 598 | + | // Sets the debug information for @self. | |
| 599 | + | // | |
| 600 | + | // Debug information will be shown on the Troubleshooting page. It's intended | |
| 601 | + | // to be attached to issue reports when reporting issues against the | |
| 602 | + | // application. | |
| 603 | + | // | |
| 604 | + | // `AdwAboutWindow` provides a quick way to save debug information to a file. | |
| 605 | + | // When saving, [property@AboutWindow:debug-info-filename] would be used as | |
| 606 | + | // the suggested filename. | |
| 607 | + | // | |
| 608 | + | // Debug information cannot contain markup or links. | |
| 609 | + | func (x *AboutWindow) SetDebugInfo(DebugInfoVar string) { | |
| 610 | + | ||
| 611 | + | xAboutWindowSetDebugInfo(x.GoPointer(), DebugInfoVar) | |
| 612 | + | ||
| 613 | + | } | |
| 614 | + | ||
| 615 | + | var xAboutWindowSetDebugInfoFilename func(uintptr, string) | |
| 616 | + | ||
| 617 | + | // Sets the debug information filename for @self. | |
| 618 | + | // | |
| 619 | + | // It will be used as the suggested filename when saving debug information to a | |
| 620 | + | // file. | |
| 621 | + | // | |
| 622 | + | // See [property@AboutWindow:debug-info]. | |
| 623 | + | func (x *AboutWindow) SetDebugInfoFilename(FilenameVar string) { | |
| 624 | + | ||
| 625 | + | xAboutWindowSetDebugInfoFilename(x.GoPointer(), FilenameVar) | |
| 626 | + | ||
| 627 | + | } | |
| 628 | + | ||
| 629 | + | var xAboutWindowSetDesigners func(uintptr, uintptr) | |
| 630 | + | ||
| 631 | + | // Sets the list of designers of the application. | |
| 632 | + | // | |
| 633 | + | // It will be displayed on the Credits page. | |
| 634 | + | // | |
| 635 | + | // Each name may contain email addresses and URLs, see the introduction for more | |
| 636 | + | // details. | |
| 637 | + | // | |
| 638 | + | // See also: | |
| 639 | + | // | |
| 640 | + | // * [property@AboutWindow:developers] | |
| 641 | + | // * [property@AboutWindow:artists] | |
| 642 | + | // * [property@AboutWindow:documenters] | |
| 643 | + | // * [property@AboutWindow:translator-credits] | |
| 644 | + | // * [method@AboutWindow.add_credit_section] | |
| 645 | + | // * [method@AboutWindow.add_acknowledgement_section] | |
| 646 | + | func (x *AboutWindow) SetDesigners(DesignersVar uintptr) { | |
| 647 | + | ||
| 648 | + | xAboutWindowSetDesigners(x.GoPointer(), DesignersVar) | |
| 649 | + | ||
| 650 | + | } | |
| 651 | + | ||
| 652 | + | var xAboutWindowSetDeveloperName func(uintptr, string) | |
| 653 | + | ||
| 654 | + | // Sets the developer name for @self. | |
| 655 | + | // | |
| 656 | + | // The developer name is displayed on the main page, under the application name. | |
| 657 | + | // | |
| 658 | + | // If the application is developed by multiple people, the developer name can be | |
| 659 | + | // set to values like "AppName team", "AppName developers" or | |
| 660 | + | // "The AppName project", and the individual contributors can be listed on the | |
| 661 | + | // Credits page, with [property@AboutWindow:developers] and related properties. | |
| 662 | + | func (x *AboutWindow) SetDeveloperName(DeveloperNameVar string) { | |
| 663 | + | ||
| 664 | + | xAboutWindowSetDeveloperName(x.GoPointer(), DeveloperNameVar) | |
| 665 | + | ||
| 666 | + | } | |
| 667 | + | ||
| 668 | + | var xAboutWindowSetDevelopers func(uintptr, uintptr) | |
| 669 | + | ||
| 670 | + | // Sets the list of developers of the application. | |
| 671 | + | // | |
| 672 | + | // It will be displayed on the Credits page. | |
| 673 | + | // | |
| 674 | + | // Each name may contain email addresses and URLs, see the introduction for more | |
| 675 | + | // details. | |
| 676 | + | // | |
| 677 | + | // See also: | |
| 678 | + | // | |
| 679 | + | // * [property@AboutWindow:designers] | |
| 680 | + | // * [property@AboutWindow:artists] | |
| 681 | + | // * [property@AboutWindow:documenters] | |
| 682 | + | // * [property@AboutWindow:translator-credits] | |
| 683 | + | // * [method@AboutWindow.add_credit_section] | |
| 684 | + | // * [method@AboutWindow.add_acknowledgement_section] | |
| 685 | + | func (x *AboutWindow) SetDevelopers(DevelopersVar uintptr) { | |
| 686 | + | ||
| 687 | + | xAboutWindowSetDevelopers(x.GoPointer(), DevelopersVar) | |
| 688 | + | ||
| 689 | + | } | |
| 690 | + | ||
| 691 | + | var xAboutWindowSetDocumenters func(uintptr, uintptr) | |
| 692 | + | ||
| 693 | + | // Sets the list of documenters of the application. | |
| 694 | + | // | |
| 695 | + | // It will be displayed on the Credits page. | |
| 696 | + | // | |
| 697 | + | // Each name may contain email addresses and URLs, see the introduction for more | |
| 698 | + | // details. | |
| 699 | + | // | |
| 700 | + | // See also: | |
| 701 | + | // | |
| 702 | + | // * [property@AboutWindow:developers] | |
| 703 | + | // * [property@AboutWindow:designers] | |
| 704 | + | // * [property@AboutWindow:artists] | |
| 705 | + | // * [property@AboutWindow:translator-credits] | |
| 706 | + | // * [method@AboutWindow.add_credit_section] | |
| 707 | + | // * [method@AboutWindow.add_acknowledgement_section] | |
| 708 | + | func (x *AboutWindow) SetDocumenters(DocumentersVar uintptr) { | |
| 709 | + | ||
| 710 | + | xAboutWindowSetDocumenters(x.GoPointer(), DocumentersVar) | |
| 711 | + | ||
| 712 | + | } | |
| 713 | + | ||
| 714 | + | var xAboutWindowSetIssueUrl func(uintptr, string) | |
| 715 | + | ||
| 716 | + | // Sets the issue tracker URL for @self. | |
| 717 | + | // | |
| 718 | + | // The issue tracker link is displayed on the main page. | |
| 719 | + | func (x *AboutWindow) SetIssueUrl(IssueUrlVar string) { | |
| 720 | + | ||
| 721 | + | xAboutWindowSetIssueUrl(x.GoPointer(), IssueUrlVar) | |
| 722 | + | ||
| 723 | + | } | |
| 724 | + | ||
| 725 | + | var xAboutWindowSetLicense func(uintptr, string) | |
| 726 | + | ||
| 727 | + | // Sets the license for @self. | |
| 728 | + | // | |
| 729 | + | // This can be used to set a custom text for the license if it can't be set via | |
| 730 | + | // [property@AboutWindow:license-type]. | |
| 731 | + | // | |
| 732 | + | // When set, [property@AboutWindow:license-type] will be set to | |
| 733 | + | // `GTK_LICENSE_CUSTOM`. | |
| 734 | + | // | |
| 735 | + | // The license text will be displayed on the Legal page, below the copyright | |
| 736 | + | // information. | |
| 737 | + | // | |
| 738 | + | // License text can contain Pango markup and links. | |
| 739 | + | // | |
| 740 | + | // [method@AboutWindow.add_legal_section] can be used to add license information | |
| 741 | + | // for the application dependencies or other components. | |
| 742 | + | func (x *AboutWindow) SetLicense(LicenseVar string) { | |
| 743 | + | ||
| 744 | + | xAboutWindowSetLicense(x.GoPointer(), LicenseVar) | |
| 745 | + | ||
| 746 | + | } | |
| 747 | + | ||
| 748 | + | var xAboutWindowSetLicenseType func(uintptr, gtk.License) | |
| 749 | + | ||
| 750 | + | // Sets the license for @self from a list of known licenses. | |
| 751 | + | // | |
| 752 | + | // If the application's license is not in the list, | |
| 753 | + | // [property@AboutWindow:license] can be used instead. The license type will be | |
| 754 | + | // automatically set to `GTK_LICENSE_CUSTOM` in that case. | |
| 755 | + | // | |
| 756 | + | // If @license_type is `GTK_LICENSE_UNKNOWN`, no information will be displayed. | |
| 757 | + | // | |
| 758 | + | // If @license_type is different from `GTK_LICENSE_CUSTOM`. | |
| 759 | + | // [property@AboutWindow:license] will be cleared out. | |
| 760 | + | // | |
| 761 | + | // The license description will be displayed on the Legal page, below the | |
| 762 | + | // copyright information. | |
| 763 | + | // | |
| 764 | + | // [method@AboutWindow.add_legal_section] can be used to add license information | |
| 765 | + | // for the application dependencies or other components. | |
| 766 | + | func (x *AboutWindow) SetLicenseType(LicenseTypeVar gtk.License) { | |
| 767 | + | ||
| 768 | + | xAboutWindowSetLicenseType(x.GoPointer(), LicenseTypeVar) | |
| 769 | + | ||
| 770 | + | } | |
| 771 | + | ||
| 772 | + | var xAboutWindowSetReleaseNotes func(uintptr, string) | |
| 773 | + | ||
| 774 | + | // Sets the release notes for @self. | |
| 775 | + | // | |
| 776 | + | // Release notes are displayed on the the What's New page. | |
| 777 | + | // | |
| 778 | + | // Release notes are formatted the same way as | |
| 779 | + | // [AppStream descriptions](https://freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-description). | |
| 780 | + | // | |
| 781 | + | // The supported formatting options are: | |
| 782 | + | // | |
| 783 | + | // * Paragraph (`<p>`) | |
| 784 | + | // * Ordered list (`<ol>`), with list items (`<li>`) | |
| 785 | + | // * Unordered list (`<ul>`), with list items (`<li>`) | |
| 786 | + | // | |
| 787 | + | // Within paragraphs and list items, emphasis (`<em>`) and inline code | |
| 788 | + | // (`<code>`) text styles are supported. The emphasis is rendered in italic, | |
| 789 | + | // while inline code is shown in a monospaced font. | |
| 790 | + | // | |
| 791 | + | // Any text outside paragraphs or list items is ignored. | |
| 792 | + | // | |
| 793 | + | // Nested lists are not supported. | |
| 794 | + | // | |
| 795 | + | // `AdwAboutWindow` displays the version above the release notes. If set, the | |
| 796 | + | // [property@AboutWindow:release-notes-version] of the property will be used | |
| 797 | + | // as the version; otherwise, [property@AboutWindow:version] is used. | |
| 798 | + | func (x *AboutWindow) SetReleaseNotes(ReleaseNotesVar string) { | |
| 799 | + | ||
| 800 | + | xAboutWindowSetReleaseNotes(x.GoPointer(), ReleaseNotesVar) | |
| 801 | + | ||
| 802 | + | } | |
| 803 | + | ||
| 804 | + | var xAboutWindowSetReleaseNotesVersion func(uintptr, string) | |
| 805 | + | ||
| 806 | + | // Sets the version described by the application's release notes. | |
| 807 | + | // | |
| 808 | + | // The release notes version is displayed on the What's New page, above the | |
| 809 | + | // release notes. | |
| 810 | + | // | |
| 811 | + | // If not set, [property@AboutWindow:version] will be used instead. | |
| 812 | + | // | |
| 813 | + | // For example, an application with the current version 2.0.2 might want to | |
| 814 | + | // keep the release notes from 2.0.0, and set the release notes version | |
| 815 | + | // accordingly. | |
| 816 | + | // | |
| 817 | + | // See [property@AboutWindow:release-notes]. | |
| 818 | + | func (x *AboutWindow) SetReleaseNotesVersion(VersionVar string) { | |
| 819 | + | ||
| 820 | + | xAboutWindowSetReleaseNotesVersion(x.GoPointer(), VersionVar) | |
| 821 | + | ||
| 822 | + | } | |
| 823 | + | ||
| 824 | + | var xAboutWindowSetSupportUrl func(uintptr, string) | |
| 825 | + | ||
| 826 | + | // Sets the URL of the support page for @self. | |
| 827 | + | // | |
| 828 | + | // The support page link is displayed on the main page. | |
| 829 | + | func (x *AboutWindow) SetSupportUrl(SupportUrlVar string) { | |
| 830 | + | ||
| 831 | + | xAboutWindowSetSupportUrl(x.GoPointer(), SupportUrlVar) | |
| 832 | + | ||
| 833 | + | } | |
| 834 | + | ||
| 835 | + | var xAboutWindowSetTranslatorCredits func(uintptr, string) | |
| 836 | + | ||
| 837 | + | // Sets the translator credits string. | |
| 838 | + | // | |
| 839 | + | // It will be displayed on the Credits page. | |
| 840 | + | // | |
| 841 | + | // This string should be `"translator-credits"` or `"translator_credits"` and | |
| 842 | + | // should be marked as translatable. | |
| 843 | + | // | |
| 844 | + | // The string may contain email addresses and URLs, see the introduction for | |
| 845 | + | // more details. | |
| 846 | + | // | |
| 847 | + | // See also: | |
| 848 | + | // | |
| 849 | + | // * [property@AboutWindow:developers] | |
| 850 | + | // * [property@AboutWindow:designers] | |
| 851 | + | // * [property@AboutWindow:artists] | |
| 852 | + | // * [property@AboutWindow:documenters] | |
| 853 | + | // * [method@AboutWindow.add_credit_section] | |
| 854 | + | // * [method@AboutWindow.add_acknowledgement_section] | |
| 855 | + | func (x *AboutWindow) SetTranslatorCredits(TranslatorCreditsVar string) { | |
| 856 | + | ||
| 857 | + | xAboutWindowSetTranslatorCredits(x.GoPointer(), TranslatorCreditsVar) | |
| 858 | + | ||
| 859 | + | } | |
| 860 | + | ||
| 861 | + | var xAboutWindowSetVersion func(uintptr, string) | |
| 862 | + | ||
| 863 | + | // Sets the version for @self. | |
| 864 | + | // | |
| 865 | + | // The version is displayed on the main page. | |
| 866 | + | // | |
| 867 | + | // If [property@AboutWindow:release-notes-version] is not set, the version will | |
| 868 | + | // also be displayed above the release notes on the What's New page. | |
| 869 | + | func (x *AboutWindow) SetVersion(VersionVar string) { | |
| 870 | + | ||
| 871 | + | xAboutWindowSetVersion(x.GoPointer(), VersionVar) | |
| 872 | + | ||
| 873 | + | } | |
| 874 | + | ||
| 875 | + | var xAboutWindowSetWebsite func(uintptr, string) | |
| 876 | + | ||
| 877 | + | // Sets the application website URL for @self. | |
| 878 | + | // | |
| 879 | + | // Website is displayed on the Details page, below comments, or on the main page | |
| 880 | + | // if the Details page doesn't have any other content. | |
| 881 | + | // | |
| 882 | + | // Applications can add other links below, see [method@AboutWindow.add_link]. | |
| 883 | + | func (x *AboutWindow) SetWebsite(WebsiteVar string) { | |
| 884 | + | ||
| 885 | + | xAboutWindowSetWebsite(x.GoPointer(), WebsiteVar) | |
| 886 | + | ||
| 887 | + | } | |
| 888 | + | ||
| 889 | + | func (c *AboutWindow) GoPointer() uintptr { | |
| 890 | + | return c.Ptr | |
| 891 | + | } | |
| 892 | + | ||
| 893 | + | func (c *AboutWindow) SetGoPointer(ptr uintptr) { | |
| 894 | + | c.Ptr = ptr | |
| 895 | + | } | |
| 896 | + | ||
| 897 | + | // Emitted when a URL is activated. | |
| 898 | + | // | |
| 899 | + | // Applications may connect to it to override the default behavior, which is | |
| 900 | + | // to call [func@Gtk.show_uri]. | |
| 901 | + | func (x *AboutWindow) ConnectActivateLink(cb func(AboutWindow, string) bool) { | |
| 902 | + | fcb := func(clsPtr uintptr, UriVarp string) bool { | |
| 903 | + | fa := AboutWindow{} | |
| 904 | + | fa.Ptr = clsPtr | |
| 905 | + | ||
| 906 | + | return cb(fa, UriVarp) | |
| 907 | + | ||
| 908 | + | } | |
| 909 | + | gobject.ObjectConnect(x.GoPointer(), "signal::activate-link", purego.NewCallback(fcb)) | |
| 910 | + | } | |
| 911 | + | ||
| 912 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 913 | + | func (x *AboutWindow) GetAccessibleRole() gtk.AccessibleRole { | |
| 914 | + | ||
| 915 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 916 | + | ||
| 917 | + | } | |
| 918 | + | ||
| 919 | + | // Resets the accessible @property to its default value. | |
| 920 | + | func (x *AboutWindow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 921 | + | ||
| 922 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 923 | + | ||
| 924 | + | } | |
| 925 | + | ||
| 926 | + | // Resets the accessible @relation to its default value. | |
| 927 | + | func (x *AboutWindow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 928 | + | ||
| 929 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 930 | + | ||
| 931 | + | } | |
| 932 | + | ||
| 933 | + | // Resets the accessible @state to its default value. | |
| 934 | + | func (x *AboutWindow) ResetState(StateVar gtk.AccessibleState) { | |
| 935 | + | ||
| 936 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 937 | + | ||
| 938 | + | } | |
| 939 | + | ||
| 940 | + | // Updates a list of accessible properties. | |
| 941 | + | // | |
| 942 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 943 | + | // value types of accessible properties. | |
| 944 | + | // | |
| 945 | + | // This function should be called by `GtkWidget` types whenever | |
| 946 | + | // an accessible property change must be communicated to assistive | |
| 947 | + | // technologies. | |
| 948 | + | // | |
| 949 | + | // Example: | |
| 950 | + | // ```c | |
| 951 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 952 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 953 | + | // | |
| 954 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 955 | + | // -1); | |
| 956 | + | // | |
| 957 | + | // ``` | |
| 958 | + | func (x *AboutWindow) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 959 | + | ||
| 960 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 961 | + | ||
| 962 | + | } | |
| 963 | + | ||
| 964 | + | // Updates an array of accessible properties. | |
| 965 | + | // | |
| 966 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 967 | + | // property change must be communicated to assistive technologies. | |
| 968 | + | // | |
| 969 | + | // This function is meant to be used by language bindings. | |
| 970 | + | func (x *AboutWindow) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 971 | + | ||
| 972 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 973 | + | ||
| 974 | + | } | |
| 975 | + | ||
| 976 | + | // Updates a list of accessible relations. | |
| 977 | + | // | |
| 978 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 979 | + | // relation change must be communicated to assistive technologies. | |
| 980 | + | // | |
| 981 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 982 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 983 | + | // | |
| 984 | + | // ```c | |
| 985 | + | // gtk_accessible_update_relation (accessible, | |
| 986 | + | // | |
| 987 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 988 | + | // ref1, NULL, | |
| 989 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 990 | + | // ref1, ref2, ref3, NULL, | |
| 991 | + | // -1); | |
| 992 | + | // | |
| 993 | + | // ``` | |
| 994 | + | func (x *AboutWindow) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 995 | + | ||
| 996 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 997 | + | ||
| 998 | + | } | |
| 999 | + | ||
| 1000 | + | // Updates an array of accessible relations. | |
| 1001 | + | // | |
| 1002 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 1003 | + | // relation change must be communicated to assistive technologies. | |
| 1004 | + | // | |
| 1005 | + | // This function is meant to be used by language bindings. | |
| 1006 | + | func (x *AboutWindow) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 1007 | + | ||
| 1008 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 1009 | + | ||
| 1010 | + | } | |
| 1011 | + | ||
| 1012 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 1013 | + | // documentation for the value types of accessible states. | |
| 1014 | + | // | |
| 1015 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 1016 | + | // state change must be communicated to assistive technologies. | |
| 1017 | + | // | |
| 1018 | + | // Example: | |
| 1019 | + | // ```c | |
| 1020 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 1021 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 1022 | + | // | |
| 1023 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 1024 | + | // -1); | |
| 1025 | + | // | |
| 1026 | + | // ``` | |
| 1027 | + | func (x *AboutWindow) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 1028 | + | ||
| 1029 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 1030 | + | ||
| 1031 | + | } | |
| 1032 | + | ||
| 1033 | + | // Updates an array of accessible states. | |
| 1034 | + | // | |
| 1035 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 1036 | + | // state change must be communicated to assistive technologies. | |
| 1037 | + | // | |
| 1038 | + | // This function is meant to be used by language bindings. | |
| 1039 | + | func (x *AboutWindow) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 1040 | + | ||
| 1041 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 1042 | + | ||
| 1043 | + | } | |
| 1044 | + | ||
| 1045 | + | // Gets the ID of the @buildable object. | |
| 1046 | + | // | |
| 1047 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 1048 | + | // of the <object> tag used to construct the @buildable. | |
| 1049 | + | func (x *AboutWindow) GetBuildableId() string { | |
| 1050 | + | ||
| 1051 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 1052 | + | ||
| 1053 | + | } | |
| 1054 | + | ||
| 1055 | + | // Returns the renderer that is used for this `GtkNative`. | |
| 1056 | + | func (x *AboutWindow) GetRenderer() *gsk.Renderer { | |
| 1057 | + | ||
| 1058 | + | GetRendererPtr := gtk.XGtkNativeGetRenderer(x.GoPointer()) | |
| 1059 | + | if GetRendererPtr == 0 { | |
| 1060 | + | return nil | |
| 1061 | + | } | |
| 1062 | + | ||
| 1063 | + | gobject.IncreaseRef(GetRendererPtr) | |
| 1064 | + | ||
| 1065 | + | GetRendererCls := &gsk.Renderer{} | |
| 1066 | + | GetRendererCls.Ptr = GetRendererPtr | |
| 1067 | + | return GetRendererCls | |
| 1068 | + | ||
| 1069 | + | } | |
| 1070 | + | ||
| 1071 | + | // Returns the surface of this `GtkNative`. | |
| 1072 | + | func (x *AboutWindow) GetSurface() *gdk.Surface { | |
| 1073 | + | ||
| 1074 | + | GetSurfacePtr := gtk.XGtkNativeGetSurface(x.GoPointer()) | |
| 1075 | + | if GetSurfacePtr == 0 { | |
| 1076 | + | return nil | |
| 1077 | + | } | |
| 1078 | + | ||
| 1079 | + | gobject.IncreaseRef(GetSurfacePtr) | |
| 1080 | + | ||
| 1081 | + | GetSurfaceCls := &gdk.Surface{} | |
| 1082 | + | GetSurfaceCls.Ptr = GetSurfacePtr | |
| 1083 | + | return GetSurfaceCls | |
| 1084 | + | ||
| 1085 | + | } | |
| 1086 | + | ||
| 1087 | + | // Retrieves the surface transform of @self. | |
| 1088 | + | // | |
| 1089 | + | // This is the translation from @self's surface coordinates into | |
| 1090 | + | // @self's widget coordinates. | |
| 1091 | + | func (x *AboutWindow) GetSurfaceTransform(XVar float64, YVar float64) { | |
| 1092 | + | ||
| 1093 | + | gtk.XGtkNativeGetSurfaceTransform(x.GoPointer(), XVar, YVar) | |
| 1094 | + | ||
| 1095 | + | } | |
| 1096 | + | ||
| 1097 | + | // Realizes a `GtkNative`. | |
| 1098 | + | // | |
| 1099 | + | // This should only be used by subclasses. | |
| 1100 | + | func (x *AboutWindow) Realize() { | |
| 1101 | + | ||
| 1102 | + | gtk.XGtkNativeRealize(x.GoPointer()) | |
| 1103 | + | ||
| 1104 | + | } | |
| 1105 | + | ||
| 1106 | + | // Unrealizes a `GtkNative`. | |
| 1107 | + | // | |
| 1108 | + | // This should only be used by subclasses. | |
| 1109 | + | func (x *AboutWindow) Unrealize() { | |
| 1110 | + | ||
| 1111 | + | gtk.XGtkNativeUnrealize(x.GoPointer()) | |
| 1112 | + | ||
| 1113 | + | } | |
| 1114 | + | ||
| 1115 | + | // Returns the display that this `GtkRoot` is on. | |
| 1116 | + | func (x *AboutWindow) GetDisplay() *gdk.Display { | |
| 1117 | + | ||
| 1118 | + | GetDisplayPtr := gtk.XGtkRootGetDisplay(x.GoPointer()) | |
| 1119 | + | if GetDisplayPtr == 0 { | |
| 1120 | + | return nil | |
| 1121 | + | } | |
| 1122 | + | ||
| 1123 | + | gobject.IncreaseRef(GetDisplayPtr) | |
| 1124 | + | ||
| 1125 | + | GetDisplayCls := &gdk.Display{} | |
| 1126 | + | GetDisplayCls.Ptr = GetDisplayPtr | |
| 1127 | + | return GetDisplayCls | |
| 1128 | + | ||
| 1129 | + | } | |
| 1130 | + | ||
| 1131 | + | // Retrieves the current focused widget within the root. | |
| 1132 | + | // | |
| 1133 | + | // Note that this is the widget that would have the focus | |
| 1134 | + | // if the root is active; if the root is not focused then | |
| 1135 | + | // `gtk_widget_has_focus (widget)` will be %FALSE for the | |
| 1136 | + | // widget. | |
| 1137 | + | func (x *AboutWindow) GetFocus() *gtk.Widget { | |
| 1138 | + | ||
| 1139 | + | GetFocusPtr := gtk.XGtkRootGetFocus(x.GoPointer()) | |
| 1140 | + | if GetFocusPtr == 0 { | |
| 1141 | + | return nil | |
| 1142 | + | } | |
| 1143 | + | ||
| 1144 | + | gobject.IncreaseRef(GetFocusPtr) | |
| 1145 | + | ||
| 1146 | + | GetFocusCls := >k.Widget{} | |
| 1147 | + | GetFocusCls.Ptr = GetFocusPtr | |
| 1148 | + | return GetFocusCls | |
| 1149 | + | ||
| 1150 | + | } | |
| 1151 | + | ||
| 1152 | + | // If @focus is not the current focus widget, and is focusable, sets | |
| 1153 | + | // it as the focus widget for the root. | |
| 1154 | + | // | |
| 1155 | + | // If @focus is %NULL, unsets the focus widget for the root. | |
| 1156 | + | // | |
| 1157 | + | // To set the focus to a particular widget in the root, it is usually | |
| 1158 | + | // more convenient to use [method@Gtk.Widget.grab_focus] instead of | |
| 1159 | + | // this function. | |
| 1160 | + | func (x *AboutWindow) SetFocus(FocusVar *gtk.Widget) { | |
| 1161 | + | ||
| 1162 | + | gtk.XGtkRootSetFocus(x.GoPointer(), FocusVar.GoPointer()) | |
| 1163 | + | ||
| 1164 | + | } | |
| 1165 | + | ||
| 1166 | + | func init() { | |
| 1167 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 1168 | + | if err != nil { | |
| 1169 | + | panic(err) | |
| 1170 | + | } | |
| 1171 | + | core.PuregoSafeRegister(&xShowAboutWindow, lib, "adw_show_about_window") | |
| 1172 | + | ||
| 1173 | + | core.PuregoSafeRegister(&xNewAboutWindow, lib, "adw_about_window_new") | |
| 1174 | + | ||
| 1175 | + | core.PuregoSafeRegister(&xAboutWindowAddAcknowledgementSection, lib, "adw_about_window_add_acknowledgement_section") | |
| 1176 | + | core.PuregoSafeRegister(&xAboutWindowAddCreditSection, lib, "adw_about_window_add_credit_section") | |
| 1177 | + | core.PuregoSafeRegister(&xAboutWindowAddLegalSection, lib, "adw_about_window_add_legal_section") | |
| 1178 | + | core.PuregoSafeRegister(&xAboutWindowAddLink, lib, "adw_about_window_add_link") | |
| 1179 | + | core.PuregoSafeRegister(&xAboutWindowGetApplicationIcon, lib, "adw_about_window_get_application_icon") | |
| 1180 | + | core.PuregoSafeRegister(&xAboutWindowGetApplicationName, lib, "adw_about_window_get_application_name") | |
| 1181 | + | core.PuregoSafeRegister(&xAboutWindowGetArtists, lib, "adw_about_window_get_artists") | |
| 1182 | + | core.PuregoSafeRegister(&xAboutWindowGetComments, lib, "adw_about_window_get_comments") | |
| 1183 | + | core.PuregoSafeRegister(&xAboutWindowGetCopyright, lib, "adw_about_window_get_copyright") | |
| 1184 | + | core.PuregoSafeRegister(&xAboutWindowGetDebugInfo, lib, "adw_about_window_get_debug_info") | |
| 1185 | + | core.PuregoSafeRegister(&xAboutWindowGetDebugInfoFilename, lib, "adw_about_window_get_debug_info_filename") | |
| 1186 | + | core.PuregoSafeRegister(&xAboutWindowGetDesigners, lib, "adw_about_window_get_designers") | |
| 1187 | + | core.PuregoSafeRegister(&xAboutWindowGetDeveloperName, lib, "adw_about_window_get_developer_name") | |
| 1188 | + | core.PuregoSafeRegister(&xAboutWindowGetDevelopers, lib, "adw_about_window_get_developers") | |
| 1189 | + | core.PuregoSafeRegister(&xAboutWindowGetDocumenters, lib, "adw_about_window_get_documenters") | |
| 1190 | + | core.PuregoSafeRegister(&xAboutWindowGetIssueUrl, lib, "adw_about_window_get_issue_url") | |
| 1191 | + | core.PuregoSafeRegister(&xAboutWindowGetLicense, lib, "adw_about_window_get_license") | |
| 1192 | + | core.PuregoSafeRegister(&xAboutWindowGetLicenseType, lib, "adw_about_window_get_license_type") | |
| 1193 | + | core.PuregoSafeRegister(&xAboutWindowGetReleaseNotes, lib, "adw_about_window_get_release_notes") | |
| 1194 | + | core.PuregoSafeRegister(&xAboutWindowGetReleaseNotesVersion, lib, "adw_about_window_get_release_notes_version") | |
| 1195 | + | core.PuregoSafeRegister(&xAboutWindowGetSupportUrl, lib, "adw_about_window_get_support_url") | |
| 1196 | + | core.PuregoSafeRegister(&xAboutWindowGetTranslatorCredits, lib, "adw_about_window_get_translator_credits") | |
| 1197 | + | core.PuregoSafeRegister(&xAboutWindowGetVersion, lib, "adw_about_window_get_version") | |
| 1198 | + | core.PuregoSafeRegister(&xAboutWindowGetWebsite, lib, "adw_about_window_get_website") | |
| 1199 | + | core.PuregoSafeRegister(&xAboutWindowSetApplicationIcon, lib, "adw_about_window_set_application_icon") | |
| 1200 | + | core.PuregoSafeRegister(&xAboutWindowSetApplicationName, lib, "adw_about_window_set_application_name") | |
| 1201 | + | core.PuregoSafeRegister(&xAboutWindowSetArtists, lib, "adw_about_window_set_artists") | |
| 1202 | + | core.PuregoSafeRegister(&xAboutWindowSetComments, lib, "adw_about_window_set_comments") | |
| 1203 | + | core.PuregoSafeRegister(&xAboutWindowSetCopyright, lib, "adw_about_window_set_copyright") | |
| 1204 | + | core.PuregoSafeRegister(&xAboutWindowSetDebugInfo, lib, "adw_about_window_set_debug_info") | |
| 1205 | + | core.PuregoSafeRegister(&xAboutWindowSetDebugInfoFilename, lib, "adw_about_window_set_debug_info_filename") | |
| 1206 | + | core.PuregoSafeRegister(&xAboutWindowSetDesigners, lib, "adw_about_window_set_designers") | |
| 1207 | + | core.PuregoSafeRegister(&xAboutWindowSetDeveloperName, lib, "adw_about_window_set_developer_name") | |
| 1208 | + | core.PuregoSafeRegister(&xAboutWindowSetDevelopers, lib, "adw_about_window_set_developers") | |
| 1209 | + | core.PuregoSafeRegister(&xAboutWindowSetDocumenters, lib, "adw_about_window_set_documenters") | |
| 1210 | + | core.PuregoSafeRegister(&xAboutWindowSetIssueUrl, lib, "adw_about_window_set_issue_url") | |
| 1211 | + | core.PuregoSafeRegister(&xAboutWindowSetLicense, lib, "adw_about_window_set_license") | |
| 1212 | + | core.PuregoSafeRegister(&xAboutWindowSetLicenseType, lib, "adw_about_window_set_license_type") | |
| 1213 | + | core.PuregoSafeRegister(&xAboutWindowSetReleaseNotes, lib, "adw_about_window_set_release_notes") | |
| 1214 | + | core.PuregoSafeRegister(&xAboutWindowSetReleaseNotesVersion, lib, "adw_about_window_set_release_notes_version") | |
| 1215 | + | core.PuregoSafeRegister(&xAboutWindowSetSupportUrl, lib, "adw_about_window_set_support_url") | |
| 1216 | + | core.PuregoSafeRegister(&xAboutWindowSetTranslatorCredits, lib, "adw_about_window_set_translator_credits") | |
| 1217 | + | core.PuregoSafeRegister(&xAboutWindowSetVersion, lib, "adw_about_window_set_version") | |
| 1218 | + | core.PuregoSafeRegister(&xAboutWindowSetWebsite, lib, "adw_about_window_set_website") | |
| 1219 | + | ||
| 1220 | + | } | |
A v4/adw/adw-action-row.go +524 -0
| @@ -0,0 +1,524 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 10 | + | ) | |
| 11 | + | ||
| 12 | + | type ActionRowClass struct { | |
| 13 | + | ParentClass uintptr | |
| 14 | + | ||
| 15 | + | Padding uintptr | |
| 16 | + | } | |
| 17 | + | ||
| 18 | + | // A [class@Gtk.ListBoxRow] used to present actions. | |
| 19 | + | // | |
| 20 | + | // <picture> | |
| 21 | + | // | |
| 22 | + | // <source srcset="action-row-dark.png" media="(prefers-color-scheme: dark)"> | |
| 23 | + | // <img src="action-row.png" alt="action-row"> | |
| 24 | + | // | |
| 25 | + | // </picture> | |
| 26 | + | // | |
| 27 | + | // The `AdwActionRow` widget can have a title, a subtitle and an icon. The row | |
| 28 | + | // can receive additional widgets at its end, or prefix widgets at its start. | |
| 29 | + | // | |
| 30 | + | // It is convenient to present a preference and its related actions. | |
| 31 | + | // | |
| 32 | + | // `AdwActionRow` is unactivatable by default, giving it an activatable widget | |
| 33 | + | // will automatically make it activatable, but unsetting it won't change the | |
| 34 | + | // row's activatability. | |
| 35 | + | // | |
| 36 | + | // ## AdwActionRow as GtkBuildable | |
| 37 | + | // | |
| 38 | + | // The `AdwActionRow` implementation of the [iface@Gtk.Buildable] interface | |
| 39 | + | // supports adding a child at its end by specifying “suffix” or omitting the | |
| 40 | + | // “type” attribute of a <child> element. | |
| 41 | + | // | |
| 42 | + | // It also supports adding a child as a prefix widget by specifying “prefix” as | |
| 43 | + | // the “type” attribute of a <child> element. | |
| 44 | + | // | |
| 45 | + | // ## CSS nodes | |
| 46 | + | // | |
| 47 | + | // `AdwActionRow` has a main CSS node with name `row`. | |
| 48 | + | // | |
| 49 | + | // It contains the subnode `box.header` for its main horizontal box, and | |
| 50 | + | // `box.title` for the vertical box containing the title and subtitle labels. | |
| 51 | + | // | |
| 52 | + | // It contains subnodes `label.title` and `label.subtitle` representing | |
| 53 | + | // respectively the title label and subtitle label. | |
| 54 | + | type ActionRow struct { | |
| 55 | + | PreferencesRow | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | func ActionRowNewFromInternalPtr(ptr uintptr) *ActionRow { | |
| 59 | + | cls := &ActionRow{} | |
| 60 | + | cls.Ptr = ptr | |
| 61 | + | return cls | |
| 62 | + | } | |
| 63 | + | ||
| 64 | + | var xNewActionRow func() uintptr | |
| 65 | + | ||
| 66 | + | // Creates a new `AdwActionRow`. | |
| 67 | + | func NewActionRow() *gtk.Widget { | |
| 68 | + | NewActionRowPtr := xNewActionRow() | |
| 69 | + | if NewActionRowPtr == 0 { | |
| 70 | + | return nil | |
| 71 | + | } | |
| 72 | + | ||
| 73 | + | gobject.IncreaseRef(NewActionRowPtr) | |
| 74 | + | ||
| 75 | + | NewActionRowCls := >k.Widget{} | |
| 76 | + | NewActionRowCls.Ptr = NewActionRowPtr | |
| 77 | + | return NewActionRowCls | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | var xActionRowActivate func(uintptr) | |
| 81 | + | ||
| 82 | + | // Activates @self. | |
| 83 | + | func (x *ActionRow) Activate() { | |
| 84 | + | ||
| 85 | + | xActionRowActivate(x.GoPointer()) | |
| 86 | + | ||
| 87 | + | } | |
| 88 | + | ||
| 89 | + | var xActionRowAddPrefix func(uintptr, uintptr) | |
| 90 | + | ||
| 91 | + | // Adds a prefix widget to @self. | |
| 92 | + | func (x *ActionRow) AddPrefix(WidgetVar *gtk.Widget) { | |
| 93 | + | ||
| 94 | + | xActionRowAddPrefix(x.GoPointer(), WidgetVar.GoPointer()) | |
| 95 | + | ||
| 96 | + | } | |
| 97 | + | ||
| 98 | + | var xActionRowAddSuffix func(uintptr, uintptr) | |
| 99 | + | ||
| 100 | + | // Adds a suffix widget to @self. | |
| 101 | + | func (x *ActionRow) AddSuffix(WidgetVar *gtk.Widget) { | |
| 102 | + | ||
| 103 | + | xActionRowAddSuffix(x.GoPointer(), WidgetVar.GoPointer()) | |
| 104 | + | ||
| 105 | + | } | |
| 106 | + | ||
| 107 | + | var xActionRowGetActivatableWidget func(uintptr) uintptr | |
| 108 | + | ||
| 109 | + | // Gets the widget activated when @self is activated. | |
| 110 | + | func (x *ActionRow) GetActivatableWidget() *gtk.Widget { | |
| 111 | + | ||
| 112 | + | GetActivatableWidgetPtr := xActionRowGetActivatableWidget(x.GoPointer()) | |
| 113 | + | if GetActivatableWidgetPtr == 0 { | |
| 114 | + | return nil | |
| 115 | + | } | |
| 116 | + | ||
| 117 | + | gobject.IncreaseRef(GetActivatableWidgetPtr) | |
| 118 | + | ||
| 119 | + | GetActivatableWidgetCls := >k.Widget{} | |
| 120 | + | GetActivatableWidgetCls.Ptr = GetActivatableWidgetPtr | |
| 121 | + | return GetActivatableWidgetCls | |
| 122 | + | ||
| 123 | + | } | |
| 124 | + | ||
| 125 | + | var xActionRowGetIconName func(uintptr) string | |
| 126 | + | ||
| 127 | + | // Gets the icon name for @self. | |
| 128 | + | func (x *ActionRow) GetIconName() string { | |
| 129 | + | ||
| 130 | + | return xActionRowGetIconName(x.GoPointer()) | |
| 131 | + | ||
| 132 | + | } | |
| 133 | + | ||
| 134 | + | var xActionRowGetSubtitle func(uintptr) string | |
| 135 | + | ||
| 136 | + | // Gets the subtitle for @self. | |
| 137 | + | func (x *ActionRow) GetSubtitle() string { | |
| 138 | + | ||
| 139 | + | return xActionRowGetSubtitle(x.GoPointer()) | |
| 140 | + | ||
| 141 | + | } | |
| 142 | + | ||
| 143 | + | var xActionRowGetSubtitleLines func(uintptr) int32 | |
| 144 | + | ||
| 145 | + | // Gets the number of lines at the end of which the subtitle label will be | |
| 146 | + | // ellipsized. | |
| 147 | + | func (x *ActionRow) GetSubtitleLines() int32 { | |
| 148 | + | ||
| 149 | + | return xActionRowGetSubtitleLines(x.GoPointer()) | |
| 150 | + | ||
| 151 | + | } | |
| 152 | + | ||
| 153 | + | var xActionRowGetSubtitleSelectable func(uintptr) bool | |
| 154 | + | ||
| 155 | + | // Gets whether the user can copy the subtitle from the label | |
| 156 | + | func (x *ActionRow) GetSubtitleSelectable() bool { | |
| 157 | + | ||
| 158 | + | return xActionRowGetSubtitleSelectable(x.GoPointer()) | |
| 159 | + | ||
| 160 | + | } | |
| 161 | + | ||
| 162 | + | var xActionRowGetTitleLines func(uintptr) int32 | |
| 163 | + | ||
| 164 | + | // Gets the number of lines at the end of which the title label will be | |
| 165 | + | // ellipsized. | |
| 166 | + | func (x *ActionRow) GetTitleLines() int32 { | |
| 167 | + | ||
| 168 | + | return xActionRowGetTitleLines(x.GoPointer()) | |
| 169 | + | ||
| 170 | + | } | |
| 171 | + | ||
| 172 | + | var xActionRowRemove func(uintptr, uintptr) | |
| 173 | + | ||
| 174 | + | // Removes a child from @self. | |
| 175 | + | func (x *ActionRow) Remove(WidgetVar *gtk.Widget) { | |
| 176 | + | ||
| 177 | + | xActionRowRemove(x.GoPointer(), WidgetVar.GoPointer()) | |
| 178 | + | ||
| 179 | + | } | |
| 180 | + | ||
| 181 | + | var xActionRowSetActivatableWidget func(uintptr, uintptr) | |
| 182 | + | ||
| 183 | + | // Sets the widget to activate when @self is activated. | |
| 184 | + | // | |
| 185 | + | // The row can be activated either by clicking on it, calling | |
| 186 | + | // [method@ActionRow.activate], or via mnemonics in the title. | |
| 187 | + | // See the [property@PreferencesRow:use-underline] property to enable mnemonics. | |
| 188 | + | // | |
| 189 | + | // The target widget will be activated by emitting the | |
| 190 | + | // [signal@Gtk.Widget::mnemonic-activate] signal on it. | |
| 191 | + | func (x *ActionRow) SetActivatableWidget(WidgetVar *gtk.Widget) { | |
| 192 | + | ||
| 193 | + | xActionRowSetActivatableWidget(x.GoPointer(), WidgetVar.GoPointer()) | |
| 194 | + | ||
| 195 | + | } | |
| 196 | + | ||
| 197 | + | var xActionRowSetIconName func(uintptr, string) | |
| 198 | + | ||
| 199 | + | // Sets the icon name for @self. | |
| 200 | + | func (x *ActionRow) SetIconName(IconNameVar string) { | |
| 201 | + | ||
| 202 | + | xActionRowSetIconName(x.GoPointer(), IconNameVar) | |
| 203 | + | ||
| 204 | + | } | |
| 205 | + | ||
| 206 | + | var xActionRowSetSubtitle func(uintptr, string) | |
| 207 | + | ||
| 208 | + | // Sets the subtitle for @self. | |
| 209 | + | // | |
| 210 | + | // The subtitle is interpreted as Pango markup unless | |
| 211 | + | // [property@PreferencesRow:use-markup] is set to `FALSE`. | |
| 212 | + | func (x *ActionRow) SetSubtitle(SubtitleVar string) { | |
| 213 | + | ||
| 214 | + | xActionRowSetSubtitle(x.GoPointer(), SubtitleVar) | |
| 215 | + | ||
| 216 | + | } | |
| 217 | + | ||
| 218 | + | var xActionRowSetSubtitleLines func(uintptr, int32) | |
| 219 | + | ||
| 220 | + | // Sets the number of lines at the end of which the subtitle label will be | |
| 221 | + | // ellipsized. | |
| 222 | + | // | |
| 223 | + | // If the value is 0, the number of lines won't be limited. | |
| 224 | + | func (x *ActionRow) SetSubtitleLines(SubtitleLinesVar int32) { | |
| 225 | + | ||
| 226 | + | xActionRowSetSubtitleLines(x.GoPointer(), SubtitleLinesVar) | |
| 227 | + | ||
| 228 | + | } | |
| 229 | + | ||
| 230 | + | var xActionRowSetSubtitleSelectable func(uintptr, bool) | |
| 231 | + | ||
| 232 | + | // Sets whether the user can copy the subtitle from the label | |
| 233 | + | // | |
| 234 | + | // See also [property@Gtk.Label:selectable]. | |
| 235 | + | func (x *ActionRow) SetSubtitleSelectable(SubtitleSelectableVar bool) { | |
| 236 | + | ||
| 237 | + | xActionRowSetSubtitleSelectable(x.GoPointer(), SubtitleSelectableVar) | |
| 238 | + | ||
| 239 | + | } | |
| 240 | + | ||
| 241 | + | var xActionRowSetTitleLines func(uintptr, int32) | |
| 242 | + | ||
| 243 | + | // Sets the number of lines at the end of which the title label will be | |
| 244 | + | // ellipsized. | |
| 245 | + | // | |
| 246 | + | // If the value is 0, the number of lines won't be limited. | |
| 247 | + | func (x *ActionRow) SetTitleLines(TitleLinesVar int32) { | |
| 248 | + | ||
| 249 | + | xActionRowSetTitleLines(x.GoPointer(), TitleLinesVar) | |
| 250 | + | ||
| 251 | + | } | |
| 252 | + | ||
| 253 | + | func (c *ActionRow) GoPointer() uintptr { | |
| 254 | + | return c.Ptr | |
| 255 | + | } | |
| 256 | + | ||
| 257 | + | func (c *ActionRow) SetGoPointer(ptr uintptr) { | |
| 258 | + | c.Ptr = ptr | |
| 259 | + | } | |
| 260 | + | ||
| 261 | + | // This signal is emitted after the row has been activated. | |
| 262 | + | func (x *ActionRow) ConnectActivated(cb func(ActionRow)) { | |
| 263 | + | fcb := func(clsPtr uintptr) { | |
| 264 | + | fa := ActionRow{} | |
| 265 | + | fa.Ptr = clsPtr | |
| 266 | + | ||
| 267 | + | cb(fa) | |
| 268 | + | ||
| 269 | + | } | |
| 270 | + | gobject.ObjectConnect(x.GoPointer(), "signal::activated", purego.NewCallback(fcb)) | |
| 271 | + | } | |
| 272 | + | ||
| 273 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 274 | + | func (x *ActionRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 275 | + | ||
| 276 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 277 | + | ||
| 278 | + | } | |
| 279 | + | ||
| 280 | + | // Resets the accessible @property to its default value. | |
| 281 | + | func (x *ActionRow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 282 | + | ||
| 283 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 284 | + | ||
| 285 | + | } | |
| 286 | + | ||
| 287 | + | // Resets the accessible @relation to its default value. | |
| 288 | + | func (x *ActionRow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 289 | + | ||
| 290 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 291 | + | ||
| 292 | + | } | |
| 293 | + | ||
| 294 | + | // Resets the accessible @state to its default value. | |
| 295 | + | func (x *ActionRow) ResetState(StateVar gtk.AccessibleState) { | |
| 296 | + | ||
| 297 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 298 | + | ||
| 299 | + | } | |
| 300 | + | ||
| 301 | + | // Updates a list of accessible properties. | |
| 302 | + | // | |
| 303 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 304 | + | // value types of accessible properties. | |
| 305 | + | // | |
| 306 | + | // This function should be called by `GtkWidget` types whenever | |
| 307 | + | // an accessible property change must be communicated to assistive | |
| 308 | + | // technologies. | |
| 309 | + | // | |
| 310 | + | // Example: | |
| 311 | + | // ```c | |
| 312 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 313 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 314 | + | // | |
| 315 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 316 | + | // -1); | |
| 317 | + | // | |
| 318 | + | // ``` | |
| 319 | + | func (x *ActionRow) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 320 | + | ||
| 321 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 322 | + | ||
| 323 | + | } | |
| 324 | + | ||
| 325 | + | // Updates an array of accessible properties. | |
| 326 | + | // | |
| 327 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 328 | + | // property change must be communicated to assistive technologies. | |
| 329 | + | // | |
| 330 | + | // This function is meant to be used by language bindings. | |
| 331 | + | func (x *ActionRow) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 332 | + | ||
| 333 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 334 | + | ||
| 335 | + | } | |
| 336 | + | ||
| 337 | + | // Updates a list of accessible relations. | |
| 338 | + | // | |
| 339 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 340 | + | // relation change must be communicated to assistive technologies. | |
| 341 | + | // | |
| 342 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 343 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 344 | + | // | |
| 345 | + | // ```c | |
| 346 | + | // gtk_accessible_update_relation (accessible, | |
| 347 | + | // | |
| 348 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 349 | + | // ref1, NULL, | |
| 350 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 351 | + | // ref1, ref2, ref3, NULL, | |
| 352 | + | // -1); | |
| 353 | + | // | |
| 354 | + | // ``` | |
| 355 | + | func (x *ActionRow) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 356 | + | ||
| 357 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 358 | + | ||
| 359 | + | } | |
| 360 | + | ||
| 361 | + | // Updates an array of accessible relations. | |
| 362 | + | // | |
| 363 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 364 | + | // relation change must be communicated to assistive technologies. | |
| 365 | + | // | |
| 366 | + | // This function is meant to be used by language bindings. | |
| 367 | + | func (x *ActionRow) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 368 | + | ||
| 369 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 370 | + | ||
| 371 | + | } | |
| 372 | + | ||
| 373 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 374 | + | // documentation for the value types of accessible states. | |
| 375 | + | // | |
| 376 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 377 | + | // state change must be communicated to assistive technologies. | |
| 378 | + | // | |
| 379 | + | // Example: | |
| 380 | + | // ```c | |
| 381 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 382 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 383 | + | // | |
| 384 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 385 | + | // -1); | |
| 386 | + | // | |
| 387 | + | // ``` | |
| 388 | + | func (x *ActionRow) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 389 | + | ||
| 390 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 391 | + | ||
| 392 | + | } | |
| 393 | + | ||
| 394 | + | // Updates an array of accessible states. | |
| 395 | + | // | |
| 396 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 397 | + | // state change must be communicated to assistive technologies. | |
| 398 | + | // | |
| 399 | + | // This function is meant to be used by language bindings. | |
| 400 | + | func (x *ActionRow) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 401 | + | ||
| 402 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 403 | + | ||
| 404 | + | } | |
| 405 | + | ||
| 406 | + | // Gets the action name for @actionable. | |
| 407 | + | func (x *ActionRow) GetActionName() string { | |
| 408 | + | ||
| 409 | + | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 410 | + | ||
| 411 | + | } | |
| 412 | + | ||
| 413 | + | // Gets the current target value of @actionable. | |
| 414 | + | func (x *ActionRow) GetActionTargetValue() *glib.Variant { | |
| 415 | + | ||
| 416 | + | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 417 | + | ||
| 418 | + | } | |
| 419 | + | ||
| 420 | + | // Specifies the name of the action with which this widget should be | |
| 421 | + | // associated. | |
| 422 | + | // | |
| 423 | + | // If @action_name is %NULL then the widget will be unassociated from | |
| 424 | + | // any previous action. | |
| 425 | + | // | |
| 426 | + | // Usually this function is used when the widget is located (or will be | |
| 427 | + | // located) within the hierarchy of a `GtkApplicationWindow`. | |
| 428 | + | // | |
| 429 | + | // Names are of the form “win.save” or “app.quit” for actions on the | |
| 430 | + | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 431 | + | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 432 | + | // associated with the window. | |
| 433 | + | func (x *ActionRow) SetActionName(ActionNameVar string) { | |
| 434 | + | ||
| 435 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 436 | + | ||
| 437 | + | } | |
| 438 | + | ||
| 439 | + | // Sets the target of an actionable widget. | |
| 440 | + | // | |
| 441 | + | // This is a convenience function that calls [ctor@GLib.Variant.new] for | |
| 442 | + | // @format_string and uses the result to call | |
| 443 | + | // [method@Gtk.Actionable.set_action_target_value]. | |
| 444 | + | // | |
| 445 | + | // If you are setting a string-valued target and want to set | |
| 446 | + | // the action name at the same time, you can use | |
| 447 | + | // [method@Gtk.Actionable.set_detailed_action_name]. | |
| 448 | + | func (x *ActionRow) SetActionTarget(FormatStringVar string, varArgs ...interface{}) { | |
| 449 | + | ||
| 450 | + | gtk.XGtkActionableSetActionTarget(x.GoPointer(), FormatStringVar, varArgs...) | |
| 451 | + | ||
| 452 | + | } | |
| 453 | + | ||
| 454 | + | // Sets the target value of an actionable widget. | |
| 455 | + | // | |
| 456 | + | // If @target_value is %NULL then the target value is unset. | |
| 457 | + | // | |
| 458 | + | // The target value has two purposes. First, it is used as the parameter | |
| 459 | + | // to activation of the action associated with the `GtkActionable` widget. | |
| 460 | + | // Second, it is used to determine if the widget should be rendered as | |
| 461 | + | // “active” — the widget is active if the state is equal to the given target. | |
| 462 | + | // | |
| 463 | + | // Consider the example of associating a set of buttons with a [iface@Gio.Action] | |
| 464 | + | // with string state in a typical “radio button” situation. Each button | |
| 465 | + | // will be associated with the same action, but with a different target | |
| 466 | + | // value for that action. Clicking on a particular button will activate | |
| 467 | + | // the action with the target of that button, which will typically cause | |
| 468 | + | // the action’s state to change to that value. Since the action’s state | |
| 469 | + | // is now equal to the target value of the button, the button will now | |
| 470 | + | // be rendered as active (and the other buttons, with different targets, | |
| 471 | + | // rendered inactive). | |
| 472 | + | func (x *ActionRow) SetActionTargetValue(TargetValueVar *glib.Variant) { | |
| 473 | + | ||
| 474 | + | gtk.XGtkActionableSetActionTargetValue(x.GoPointer(), TargetValueVar) | |
| 475 | + | ||
| 476 | + | } | |
| 477 | + | ||
| 478 | + | // Sets the action-name and associated string target value of an | |
| 479 | + | // actionable widget. | |
| 480 | + | // | |
| 481 | + | // @detailed_action_name is a string in the format accepted by | |
| 482 | + | // [func@Gio.Action.parse_detailed_name]. | |
| 483 | + | func (x *ActionRow) SetDetailedActionName(DetailedActionNameVar string) { | |
| 484 | + | ||
| 485 | + | gtk.XGtkActionableSetDetailedActionName(x.GoPointer(), DetailedActionNameVar) | |
| 486 | + | ||
| 487 | + | } | |
| 488 | + | ||
| 489 | + | // Gets the ID of the @buildable object. | |
| 490 | + | // | |
| 491 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 492 | + | // of the <object> tag used to construct the @buildable. | |
| 493 | + | func (x *ActionRow) GetBuildableId() string { | |
| 494 | + | ||
| 495 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 496 | + | ||
| 497 | + | } | |
| 498 | + | ||
| 499 | + | func init() { | |
| 500 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 501 | + | if err != nil { | |
| 502 | + | panic(err) | |
| 503 | + | } | |
| 504 | + | ||
| 505 | + | core.PuregoSafeRegister(&xNewActionRow, lib, "adw_action_row_new") | |
| 506 | + | ||
| 507 | + | core.PuregoSafeRegister(&xActionRowActivate, lib, "adw_action_row_activate") | |
| 508 | + | core.PuregoSafeRegister(&xActionRowAddPrefix, lib, "adw_action_row_add_prefix") | |
| 509 | + | core.PuregoSafeRegister(&xActionRowAddSuffix, lib, "adw_action_row_add_suffix") | |
| 510 | + | core.PuregoSafeRegister(&xActionRowGetActivatableWidget, lib, "adw_action_row_get_activatable_widget") | |
| 511 | + | core.PuregoSafeRegister(&xActionRowGetIconName, lib, "adw_action_row_get_icon_name") | |
| 512 | + | core.PuregoSafeRegister(&xActionRowGetSubtitle, lib, "adw_action_row_get_subtitle") | |
| 513 | + | core.PuregoSafeRegister(&xActionRowGetSubtitleLines, lib, "adw_action_row_get_subtitle_lines") | |
| 514 | + | core.PuregoSafeRegister(&xActionRowGetSubtitleSelectable, lib, "adw_action_row_get_subtitle_selectable") | |
| 515 | + | core.PuregoSafeRegister(&xActionRowGetTitleLines, lib, "adw_action_row_get_title_lines") | |
| 516 | + | core.PuregoSafeRegister(&xActionRowRemove, lib, "adw_action_row_remove") | |
| 517 | + | core.PuregoSafeRegister(&xActionRowSetActivatableWidget, lib, "adw_action_row_set_activatable_widget") | |
| 518 | + | core.PuregoSafeRegister(&xActionRowSetIconName, lib, "adw_action_row_set_icon_name") | |
| 519 | + | core.PuregoSafeRegister(&xActionRowSetSubtitle, lib, "adw_action_row_set_subtitle") | |
| 520 | + | core.PuregoSafeRegister(&xActionRowSetSubtitleLines, lib, "adw_action_row_set_subtitle_lines") | |
| 521 | + | core.PuregoSafeRegister(&xActionRowSetSubtitleSelectable, lib, "adw_action_row_set_subtitle_selectable") | |
| 522 | + | core.PuregoSafeRegister(&xActionRowSetTitleLines, lib, "adw_action_row_set_title_lines") | |
| 523 | + | ||
| 524 | + | } | |
A v4/adw/adw-animation-target.go +181 -0
| @@ -0,0 +1,181 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | // Prototype for animation targets based on user callbacks. | |
| 12 | + | type AnimationTargetFunc func(float64, uintptr) | |
| 13 | + | ||
| 14 | + | type AnimationTargetClass struct { | |
| 15 | + | } | |
| 16 | + | ||
| 17 | + | type CallbackAnimationTargetClass struct { | |
| 18 | + | } | |
| 19 | + | ||
| 20 | + | type PropertyAnimationTargetClass struct { | |
| 21 | + | } | |
| 22 | + | ||
| 23 | + | // Represents a value [class@Animation] can animate. | |
| 24 | + | type AnimationTarget struct { | |
| 25 | + | gobject.Object | |
| 26 | + | } | |
| 27 | + | ||
| 28 | + | func AnimationTargetNewFromInternalPtr(ptr uintptr) *AnimationTarget { | |
| 29 | + | cls := &AnimationTarget{} | |
| 30 | + | cls.Ptr = ptr | |
| 31 | + | return cls | |
| 32 | + | } | |
| 33 | + | ||
| 34 | + | func (c *AnimationTarget) GoPointer() uintptr { | |
| 35 | + | return c.Ptr | |
| 36 | + | } | |
| 37 | + | ||
| 38 | + | func (c *AnimationTarget) SetGoPointer(ptr uintptr) { | |
| 39 | + | c.Ptr = ptr | |
| 40 | + | } | |
| 41 | + | ||
| 42 | + | // An [class@AnimationTarget] that calls a given callback during the | |
| 43 | + | // animation. | |
| 44 | + | type CallbackAnimationTarget struct { | |
| 45 | + | AnimationTarget | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | func CallbackAnimationTargetNewFromInternalPtr(ptr uintptr) *CallbackAnimationTarget { | |
| 49 | + | cls := &CallbackAnimationTarget{} | |
| 50 | + | cls.Ptr = ptr | |
| 51 | + | return cls | |
| 52 | + | } | |
| 53 | + | ||
| 54 | + | var xNewCallbackAnimationTarget func(uintptr, uintptr, uintptr) uintptr | |
| 55 | + | ||
| 56 | + | // Creates a new `AdwAnimationTarget` that calls the given @callback during | |
| 57 | + | // the animation. | |
| 58 | + | func NewCallbackAnimationTarget(CallbackVar AnimationTargetFunc, UserDataVar uintptr, DestroyVar glib.DestroyNotify) *AnimationTarget { | |
| 59 | + | NewCallbackAnimationTargetPtr := xNewCallbackAnimationTarget(purego.NewCallback(CallbackVar), UserDataVar, purego.NewCallback(DestroyVar)) | |
| 60 | + | if NewCallbackAnimationTargetPtr == 0 { | |
| 61 | + | return nil | |
| 62 | + | } | |
| 63 | + | ||
| 64 | + | NewCallbackAnimationTargetCls := &AnimationTarget{} | |
| 65 | + | NewCallbackAnimationTargetCls.Ptr = NewCallbackAnimationTargetPtr | |
| 66 | + | return NewCallbackAnimationTargetCls | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | func (c *CallbackAnimationTarget) GoPointer() uintptr { | |
| 70 | + | return c.Ptr | |
| 71 | + | } | |
| 72 | + | ||
| 73 | + | func (c *CallbackAnimationTarget) SetGoPointer(ptr uintptr) { | |
| 74 | + | c.Ptr = ptr | |
| 75 | + | } | |
| 76 | + | ||
| 77 | + | // An [class@AnimationTarget] changing the value of a property of a | |
| 78 | + | // [class@GObject.Object] instance. | |
| 79 | + | type PropertyAnimationTarget struct { | |
| 80 | + | AnimationTarget | |
| 81 | + | } | |
| 82 | + | ||
| 83 | + | func PropertyAnimationTargetNewFromInternalPtr(ptr uintptr) *PropertyAnimationTarget { | |
| 84 | + | cls := &PropertyAnimationTarget{} | |
| 85 | + | cls.Ptr = ptr | |
| 86 | + | return cls | |
| 87 | + | } | |
| 88 | + | ||
| 89 | + | var xNewPropertyAnimationTarget func(uintptr, string) uintptr | |
| 90 | + | ||
| 91 | + | // Creates a new `AdwPropertyAnimationTarget` for the @property_name property on | |
| 92 | + | // @object. | |
| 93 | + | func NewPropertyAnimationTarget(ObjectVar *gobject.Object, PropertyNameVar string) *AnimationTarget { | |
| 94 | + | NewPropertyAnimationTargetPtr := xNewPropertyAnimationTarget(ObjectVar.GoPointer(), PropertyNameVar) | |
| 95 | + | if NewPropertyAnimationTargetPtr == 0 { | |
| 96 | + | return nil | |
| 97 | + | } | |
| 98 | + | ||
| 99 | + | NewPropertyAnimationTargetCls := &AnimationTarget{} | |
| 100 | + | NewPropertyAnimationTargetCls.Ptr = NewPropertyAnimationTargetPtr | |
| 101 | + | return NewPropertyAnimationTargetCls | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | var xNewForPspecPropertyAnimationTarget func(uintptr, uintptr) uintptr | |
| 105 | + | ||
| 106 | + | // Creates a new `AdwPropertyAnimationTarget` for the @pspec property on | |
| 107 | + | // @object. | |
| 108 | + | func NewForPspecPropertyAnimationTarget(ObjectVar *gobject.Object, PspecVar *gobject.ParamSpec) *AnimationTarget { | |
| 109 | + | NewForPspecPropertyAnimationTargetPtr := xNewForPspecPropertyAnimationTarget(ObjectVar.GoPointer(), PspecVar.GoPointer()) | |
| 110 | + | if NewForPspecPropertyAnimationTargetPtr == 0 { | |
| 111 | + | return nil | |
| 112 | + | } | |
| 113 | + | ||
| 114 | + | NewForPspecPropertyAnimationTargetCls := &AnimationTarget{} | |
| 115 | + | NewForPspecPropertyAnimationTargetCls.Ptr = NewForPspecPropertyAnimationTargetPtr | |
| 116 | + | return NewForPspecPropertyAnimationTargetCls | |
| 117 | + | } | |
| 118 | + | ||
| 119 | + | var xPropertyAnimationTargetGetObject func(uintptr) uintptr | |
| 120 | + | ||
| 121 | + | // Gets the object animated by @self. | |
| 122 | + | // | |
| 123 | + | // The `AdwPropertyAnimationTarget` instance does not hold a strong reference on | |
| 124 | + | // the object; make sure the object is kept alive throughout the target's | |
| 125 | + | // lifetime. | |
| 126 | + | func (x *PropertyAnimationTarget) GetObject() *gobject.Object { | |
| 127 | + | ||
| 128 | + | GetObjectPtr := xPropertyAnimationTargetGetObject(x.GoPointer()) | |
| 129 | + | if GetObjectPtr == 0 { | |
| 130 | + | return nil | |
| 131 | + | } | |
| 132 | + | ||
| 133 | + | gobject.IncreaseRef(GetObjectPtr) | |
| 134 | + | ||
| 135 | + | GetObjectCls := &gobject.Object{} | |
| 136 | + | GetObjectCls.Ptr = GetObjectPtr | |
| 137 | + | return GetObjectCls | |
| 138 | + | ||
| 139 | + | } | |
| 140 | + | ||
| 141 | + | var xPropertyAnimationTargetGetPspec func(uintptr) uintptr | |
| 142 | + | ||
| 143 | + | // Gets the `GParamSpec` of the property animated by @self. | |
| 144 | + | func (x *PropertyAnimationTarget) GetPspec() *gobject.ParamSpec { | |
| 145 | + | ||
| 146 | + | GetPspecPtr := xPropertyAnimationTargetGetPspec(x.GoPointer()) | |
| 147 | + | if GetPspecPtr == 0 { | |
| 148 | + | return nil | |
| 149 | + | } | |
| 150 | + | ||
| 151 | + | gobject.IncreaseRef(GetPspecPtr) | |
| 152 | + | ||
| 153 | + | GetPspecCls := &gobject.ParamSpec{} | |
| 154 | + | GetPspecCls.Ptr = GetPspecPtr | |
| 155 | + | return GetPspecCls | |
| 156 | + | ||
| 157 | + | } | |
| 158 | + | ||
| 159 | + | func (c *PropertyAnimationTarget) GoPointer() uintptr { | |
| 160 | + | return c.Ptr | |
| 161 | + | } | |
| 162 | + | ||
| 163 | + | func (c *PropertyAnimationTarget) SetGoPointer(ptr uintptr) { | |
| 164 | + | c.Ptr = ptr | |
| 165 | + | } | |
| 166 | + | ||
| 167 | + | func init() { | |
| 168 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 169 | + | if err != nil { | |
| 170 | + | panic(err) | |
| 171 | + | } | |
| 172 | + | ||
| 173 | + | core.PuregoSafeRegister(&xNewCallbackAnimationTarget, lib, "adw_callback_animation_target_new") | |
| 174 | + | ||
| 175 | + | core.PuregoSafeRegister(&xNewPropertyAnimationTarget, lib, "adw_property_animation_target_new") | |
| 176 | + | core.PuregoSafeRegister(&xNewForPspecPropertyAnimationTarget, lib, "adw_property_animation_target_new_for_pspec") | |
| 177 | + | ||
| 178 | + | core.PuregoSafeRegister(&xPropertyAnimationTargetGetObject, lib, "adw_property_animation_target_get_object") | |
| 179 | + | core.PuregoSafeRegister(&xPropertyAnimationTargetGetPspec, lib, "adw_property_animation_target_get_pspec") | |
| 180 | + | ||
| 181 | + | } | |
A v4/adw/adw-animation-util.go +39 -0
| @@ -0,0 +1,39 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 8 | + | ) | |
| 9 | + | ||
| 10 | + | var xGetEnableAnimations func(uintptr) bool | |
| 11 | + | ||
| 12 | + | // Checks whether animations are enabled for @widget. | |
| 13 | + | // | |
| 14 | + | // This should be used when implementing an animated widget to know whether to | |
| 15 | + | // animate it or not. | |
| 16 | + | func GetEnableAnimations(WidgetVar *gtk.Widget) bool { | |
| 17 | + | ||
| 18 | + | return xGetEnableAnimations(WidgetVar.GoPointer()) | |
| 19 | + | ||
| 20 | + | } | |
| 21 | + | ||
| 22 | + | var xLerp func(float64, float64, float64) float64 | |
| 23 | + | ||
| 24 | + | // Computes the linear interpolation between @a and @b for @t. | |
| 25 | + | func Lerp(AVar float64, BVar float64, TVar float64) float64 { | |
| 26 | + | ||
| 27 | + | return xLerp(AVar, BVar, TVar) | |
| 28 | + | ||
| 29 | + | } | |
| 30 | + | ||
| 31 | + | func init() { | |
| 32 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 33 | + | if err != nil { | |
| 34 | + | panic(err) | |
| 35 | + | } | |
| 36 | + | core.PuregoSafeRegister(&xGetEnableAnimations, lib, "adw_get_enable_animations") | |
| 37 | + | core.PuregoSafeRegister(&xLerp, lib, "adw_lerp") | |
| 38 | + | ||
| 39 | + | } | |
A v4/adw/adw-animation.go +307 -0
| @@ -0,0 +1,307 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | type AnimationClass struct { | |
| 12 | + | } | |
| 13 | + | ||
| 14 | + | // Describes the possible states of an [class@Animation]. | |
| 15 | + | // | |
| 16 | + | // The state can be controlled with [method@Animation.play], | |
| 17 | + | // [method@Animation.pause], [method@Animation.resume], | |
| 18 | + | // [method@Animation.reset] and [method@Animation.skip]. | |
| 19 | + | type AnimationState int | |
| 20 | + | ||
| 21 | + | const ( | |
| 22 | + | ||
| 23 | + | // The animation hasn't started yet. | |
| 24 | + | AnimationIdleValue AnimationState = 0 | |
| 25 | + | // The animation has been paused. | |
| 26 | + | AnimationPausedValue AnimationState = 1 | |
| 27 | + | // The animation is currently playing. | |
| 28 | + | AnimationPlayingValue AnimationState = 2 | |
| 29 | + | // The animation has finished. | |
| 30 | + | AnimationFinishedValue AnimationState = 3 | |
| 31 | + | ) | |
| 32 | + | ||
| 33 | + | // A base class for animations. | |
| 34 | + | // | |
| 35 | + | // `AdwAnimation` represents an animation on a widget. It has a target that | |
| 36 | + | // provides a value to animate, and a state indicating whether the | |
| 37 | + | // animation hasn't been started yet, is playing, paused or finished. | |
| 38 | + | // | |
| 39 | + | // Currently there are two concrete animation types: | |
| 40 | + | // [class@TimedAnimation] and [class@SpringAnimation]. | |
| 41 | + | // | |
| 42 | + | // `AdwAnimation` will automatically skip the animation if | |
| 43 | + | // [property@Animation:widget] is unmapped, or if | |
| 44 | + | // [property@Gtk.Settings:gtk-enable-animations] is `FALSE`. | |
| 45 | + | // | |
| 46 | + | // The [signal@Animation::done] signal can be used to perform an action after | |
| 47 | + | // the animation ends, for example hiding a widget after animating its | |
| 48 | + | // [property@Gtk.Widget:opacity] to 0. | |
| 49 | + | // | |
| 50 | + | // `AdwAnimation` will be kept alive while the animation is playing. As such, | |
| 51 | + | // it's safe to create an animation, start it and immediately unref it: | |
| 52 | + | // A fire-and-forget animation: | |
| 53 | + | // | |
| 54 | + | // ```c | |
| 55 | + | // static void | |
| 56 | + | // animation_cb (double value, | |
| 57 | + | // | |
| 58 | + | // MyObject *self) | |
| 59 | + | // | |
| 60 | + | // { | |
| 61 | + | // // Do something with @value | |
| 62 | + | // } | |
| 63 | + | // | |
| 64 | + | // static void | |
| 65 | + | // my_object_animate (MyObject *self) | |
| 66 | + | // | |
| 67 | + | // { | |
| 68 | + | // AdwAnimationTarget *target = | |
| 69 | + | // adw_callback_animation_target_new ((AdwAnimationTargetFunc) animation_cb, | |
| 70 | + | // self, NULL); | |
| 71 | + | // g_autoptr (AdwAnimation) animation = | |
| 72 | + | // adw_timed_animation_new (widget, 0, 1, 250, target); | |
| 73 | + | // | |
| 74 | + | // adw_animation_play (animation); | |
| 75 | + | // } | |
| 76 | + | // | |
| 77 | + | // ``` | |
| 78 | + | // | |
| 79 | + | // If there's a chance the previous animation for the same target hasn't yet | |
| 80 | + | // finished, the previous animation should be stopped first, or the existing | |
| 81 | + | // `AdwAnimation` object can be reused. | |
| 82 | + | type Animation struct { | |
| 83 | + | gobject.Object | |
| 84 | + | } | |
| 85 | + | ||
| 86 | + | func AnimationNewFromInternalPtr(ptr uintptr) *Animation { | |
| 87 | + | cls := &Animation{} | |
| 88 | + | cls.Ptr = ptr | |
| 89 | + | return cls | |
| 90 | + | } | |
| 91 | + | ||
| 92 | + | var xAnimationGetFollowEnableAnimationsSetting func(uintptr) bool | |
| 93 | + | ||
| 94 | + | // Gets whether @self should be skipped when animations are globally disabled. | |
| 95 | + | func (x *Animation) GetFollowEnableAnimationsSetting() bool { | |
| 96 | + | ||
| 97 | + | return xAnimationGetFollowEnableAnimationsSetting(x.GoPointer()) | |
| 98 | + | ||
| 99 | + | } | |
| 100 | + | ||
| 101 | + | var xAnimationGetState func(uintptr) AnimationState | |
| 102 | + | ||
| 103 | + | // Gets the current value of @self. | |
| 104 | + | // | |
| 105 | + | // The state indicates whether @self is currently playing, paused, finished or | |
| 106 | + | // hasn't been started yet. | |
| 107 | + | func (x *Animation) GetState() AnimationState { | |
| 108 | + | ||
| 109 | + | return xAnimationGetState(x.GoPointer()) | |
| 110 | + | ||
| 111 | + | } | |
| 112 | + | ||
| 113 | + | var xAnimationGetTarget func(uintptr) uintptr | |
| 114 | + | ||
| 115 | + | // Gets the target @self animates. | |
| 116 | + | func (x *Animation) GetTarget() *AnimationTarget { | |
| 117 | + | ||
| 118 | + | GetTargetPtr := xAnimationGetTarget(x.GoPointer()) | |
| 119 | + | if GetTargetPtr == 0 { | |
| 120 | + | return nil | |
| 121 | + | } | |
| 122 | + | ||
| 123 | + | gobject.IncreaseRef(GetTargetPtr) | |
| 124 | + | ||
| 125 | + | GetTargetCls := &AnimationTarget{} | |
| 126 | + | GetTargetCls.Ptr = GetTargetPtr | |
| 127 | + | return GetTargetCls | |
| 128 | + | ||
| 129 | + | } | |
| 130 | + | ||
| 131 | + | var xAnimationGetValue func(uintptr) float64 | |
| 132 | + | ||
| 133 | + | // Gets the current value of @self. | |
| 134 | + | func (x *Animation) GetValue() float64 { | |
| 135 | + | ||
| 136 | + | return xAnimationGetValue(x.GoPointer()) | |
| 137 | + | ||
| 138 | + | } | |
| 139 | + | ||
| 140 | + | var xAnimationGetWidget func(uintptr) uintptr | |
| 141 | + | ||
| 142 | + | // Gets the widget @self was created for. | |
| 143 | + | // | |
| 144 | + | // It provides the frame clock for the animation. It's not strictly necessary | |
| 145 | + | // for this widget to be same as the one being animated. | |
| 146 | + | // | |
| 147 | + | // The widget must be mapped in order for the animation to work. If it's not | |
| 148 | + | // mapped, or if it gets unmapped during an ongoing animation, the animation | |
| 149 | + | // will be automatically skipped. | |
| 150 | + | func (x *Animation) GetWidget() *gtk.Widget { | |
| 151 | + | ||
| 152 | + | GetWidgetPtr := xAnimationGetWidget(x.GoPointer()) | |
| 153 | + | if GetWidgetPtr == 0 { | |
| 154 | + | return nil | |
| 155 | + | } | |
| 156 | + | ||
| 157 | + | gobject.IncreaseRef(GetWidgetPtr) | |
| 158 | + | ||
| 159 | + | GetWidgetCls := >k.Widget{} | |
| 160 | + | GetWidgetCls.Ptr = GetWidgetPtr | |
| 161 | + | return GetWidgetCls | |
| 162 | + | ||
| 163 | + | } | |
| 164 | + | ||
| 165 | + | var xAnimationPause func(uintptr) | |
| 166 | + | ||
| 167 | + | // Pauses a playing animation for @self. | |
| 168 | + | // | |
| 169 | + | // Does nothing if the current state of @self isn't `ADW_ANIMATION_PLAYING`. | |
| 170 | + | // | |
| 171 | + | // Sets [property@Animation:state] to `ADW_ANIMATION_PAUSED`. | |
| 172 | + | func (x *Animation) Pause() { | |
| 173 | + | ||
| 174 | + | xAnimationPause(x.GoPointer()) | |
| 175 | + | ||
| 176 | + | } | |
| 177 | + | ||
| 178 | + | var xAnimationPlay func(uintptr) | |
| 179 | + | ||
| 180 | + | // Starts the animation for @self. | |
| 181 | + | // | |
| 182 | + | // If the animation is playing, paused or has been completed, restarts it from | |
| 183 | + | // the beginning. This allows to easily play an animation regardless of whether | |
| 184 | + | // it's already playing or not. | |
| 185 | + | // | |
| 186 | + | // Sets [property@Animation:state] to `ADW_ANIMATION_PLAYING`. | |
| 187 | + | // | |
| 188 | + | // The animation will be automatically skipped if [property@Animation:widget] is | |
| 189 | + | // unmapped, or if [property@Gtk.Settings:gtk-enable-animations] is `FALSE`. | |
| 190 | + | // | |
| 191 | + | // As such, it's not guaranteed that the animation will actually run. For | |
| 192 | + | // example, when using [func@GLib.idle_add] and starting an animation | |
| 193 | + | // immediately afterwards, it's entirely possible that the idle callback will | |
| 194 | + | // run after the animation has already finished, and not while it's playing. | |
| 195 | + | func (x *Animation) Play() { | |
| 196 | + | ||
| 197 | + | xAnimationPlay(x.GoPointer()) | |
| 198 | + | ||
| 199 | + | } | |
| 200 | + | ||
| 201 | + | var xAnimationReset func(uintptr) | |
| 202 | + | ||
| 203 | + | // Resets the animation for @self. | |
| 204 | + | // | |
| 205 | + | // Sets [property@Animation:state] to `ADW_ANIMATION_IDLE`. | |
| 206 | + | func (x *Animation) Reset() { | |
| 207 | + | ||
| 208 | + | xAnimationReset(x.GoPointer()) | |
| 209 | + | ||
| 210 | + | } | |
| 211 | + | ||
| 212 | + | var xAnimationResume func(uintptr) | |
| 213 | + | ||
| 214 | + | // Resumes a paused animation for @self. | |
| 215 | + | // | |
| 216 | + | // This function must only be used if the animation has been paused with | |
| 217 | + | // [method@Animation.pause]. | |
| 218 | + | // | |
| 219 | + | // Sets [property@Animation:state] to `ADW_ANIMATION_PLAYING`. | |
| 220 | + | func (x *Animation) Resume() { | |
| 221 | + | ||
| 222 | + | xAnimationResume(x.GoPointer()) | |
| 223 | + | ||
| 224 | + | } | |
| 225 | + | ||
| 226 | + | var xAnimationSetFollowEnableAnimationsSetting func(uintptr, bool) | |
| 227 | + | ||
| 228 | + | // Sets whether to skip @self when animations are globally disabled. | |
| 229 | + | // | |
| 230 | + | // The default behavior is to skip the animation. Set to `FALSE` to disable this | |
| 231 | + | // behavior. | |
| 232 | + | // | |
| 233 | + | // This can be useful for cases where animation is essential, like spinners, or | |
| 234 | + | // in demo applications. Most other animations should keep it enabled. | |
| 235 | + | // | |
| 236 | + | // See [property@Gtk.Settings:gtk-enable-animations]. | |
| 237 | + | func (x *Animation) SetFollowEnableAnimationsSetting(SettingVar bool) { | |
| 238 | + | ||
| 239 | + | xAnimationSetFollowEnableAnimationsSetting(x.GoPointer(), SettingVar) | |
| 240 | + | ||
| 241 | + | } | |
| 242 | + | ||
| 243 | + | var xAnimationSetTarget func(uintptr, uintptr) | |
| 244 | + | ||
| 245 | + | // Sets the target @self animates to @target. | |
| 246 | + | func (x *Animation) SetTarget(TargetVar *AnimationTarget) { | |
| 247 | + | ||
| 248 | + | xAnimationSetTarget(x.GoPointer(), TargetVar.GoPointer()) | |
| 249 | + | ||
| 250 | + | } | |
| 251 | + | ||
| 252 | + | var xAnimationSkip func(uintptr) | |
| 253 | + | ||
| 254 | + | // Skips the animation for @self. | |
| 255 | + | // | |
| 256 | + | // If the animation hasn't been started yet, is playing, or is paused, instantly | |
| 257 | + | // skips the animation to the end and causes [signal@Animation::done] to be | |
| 258 | + | // emitted. | |
| 259 | + | // | |
| 260 | + | // Sets [property@Animation:state] to `ADW_ANIMATION_FINISHED`. | |
| 261 | + | func (x *Animation) Skip() { | |
| 262 | + | ||
| 263 | + | xAnimationSkip(x.GoPointer()) | |
| 264 | + | ||
| 265 | + | } | |
| 266 | + | ||
| 267 | + | func (c *Animation) GoPointer() uintptr { | |
| 268 | + | return c.Ptr | |
| 269 | + | } | |
| 270 | + | ||
| 271 | + | func (c *Animation) SetGoPointer(ptr uintptr) { | |
| 272 | + | c.Ptr = ptr | |
| 273 | + | } | |
| 274 | + | ||
| 275 | + | // This signal is emitted when the animation has been completed, either on its | |
| 276 | + | // own or via calling [method@Animation.skip]. | |
| 277 | + | func (x *Animation) ConnectDone(cb func(Animation)) { | |
| 278 | + | fcb := func(clsPtr uintptr) { | |
| 279 | + | fa := Animation{} | |
| 280 | + | fa.Ptr = clsPtr | |
| 281 | + | ||
| 282 | + | cb(fa) | |
| 283 | + | ||
| 284 | + | } | |
| 285 | + | gobject.ObjectConnect(x.GoPointer(), "signal::done", purego.NewCallback(fcb)) | |
| 286 | + | } | |
| 287 | + | ||
| 288 | + | func init() { | |
| 289 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 290 | + | if err != nil { | |
| 291 | + | panic(err) | |
| 292 | + | } | |
| 293 | + | ||
| 294 | + | core.PuregoSafeRegister(&xAnimationGetFollowEnableAnimationsSetting, lib, "adw_animation_get_follow_enable_animations_setting") | |
| 295 | + | core.PuregoSafeRegister(&xAnimationGetState, lib, "adw_animation_get_state") | |
| 296 | + | core.PuregoSafeRegister(&xAnimationGetTarget, lib, "adw_animation_get_target") | |
| 297 | + | core.PuregoSafeRegister(&xAnimationGetValue, lib, "adw_animation_get_value") | |
| 298 | + | core.PuregoSafeRegister(&xAnimationGetWidget, lib, "adw_animation_get_widget") | |
| 299 | + | core.PuregoSafeRegister(&xAnimationPause, lib, "adw_animation_pause") | |
| 300 | + | core.PuregoSafeRegister(&xAnimationPlay, lib, "adw_animation_play") | |
| 301 | + | core.PuregoSafeRegister(&xAnimationReset, lib, "adw_animation_reset") | |
| 302 | + | core.PuregoSafeRegister(&xAnimationResume, lib, "adw_animation_resume") | |
| 303 | + | core.PuregoSafeRegister(&xAnimationSetFollowEnableAnimationsSetting, lib, "adw_animation_set_follow_enable_animations_setting") | |
| 304 | + | core.PuregoSafeRegister(&xAnimationSetTarget, lib, "adw_animation_set_target") | |
| 305 | + | core.PuregoSafeRegister(&xAnimationSkip, lib, "adw_animation_skip") | |
| 306 | + | ||
| 307 | + | } | |
A v4/adw/adw-application-window.go +686 -0
| @@ -0,0 +1,686 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gdk" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gio" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 11 | + | "github.com/jwijenbergh/puregotk/v4/gsk" | |
| 12 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 13 | + | ) | |
| 14 | + | ||
| 15 | + | type ApplicationWindowClass struct { | |
| 16 | + | ParentClass uintptr | |
| 17 | + | ||
| 18 | + | Padding uintptr | |
| 19 | + | } | |
| 20 | + | ||
| 21 | + | // A freeform application window. | |
| 22 | + | // | |
| 23 | + | // <picture> | |
| 24 | + | // | |
| 25 | + | // <source srcset="application-window-dark.png" media="(prefers-color-scheme: dark)"> | |
| 26 | + | // <img src="application-window.png" alt="application-window"> | |
| 27 | + | // | |
| 28 | + | // </picture> | |
| 29 | + | // | |
| 30 | + | // `AdwApplicationWindow` is a [class@Gtk.ApplicationWindow] subclass providing | |
| 31 | + | // the same features as [class@Window]. | |
| 32 | + | // | |
| 33 | + | // See [class@Window] for details. | |
| 34 | + | // | |
| 35 | + | // Using [property@Gtk.Application:menubar] is not supported and may result in | |
| 36 | + | // visual glitches. | |
| 37 | + | type ApplicationWindow struct { | |
| 38 | + | gtk.ApplicationWindow | |
| 39 | + | } | |
| 40 | + | ||
| 41 | + | func ApplicationWindowNewFromInternalPtr(ptr uintptr) *ApplicationWindow { | |
| 42 | + | cls := &ApplicationWindow{} | |
| 43 | + | cls.Ptr = ptr | |
| 44 | + | return cls | |
| 45 | + | } | |
| 46 | + | ||
| 47 | + | var xNewApplicationWindow func(uintptr) uintptr | |
| 48 | + | ||
| 49 | + | // Creates a new `AdwApplicationWindow` for @app. | |
| 50 | + | func NewApplicationWindow(AppVar *gtk.Application) *gtk.Widget { | |
| 51 | + | NewApplicationWindowPtr := xNewApplicationWindow(AppVar.GoPointer()) | |
| 52 | + | if NewApplicationWindowPtr == 0 { | |
| 53 | + | return nil | |
| 54 | + | } | |
| 55 | + | ||
| 56 | + | gobject.IncreaseRef(NewApplicationWindowPtr) | |
| 57 | + | ||
| 58 | + | NewApplicationWindowCls := >k.Widget{} | |
| 59 | + | NewApplicationWindowCls.Ptr = NewApplicationWindowPtr | |
| 60 | + | return NewApplicationWindowCls | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | var xApplicationWindowGetContent func(uintptr) uintptr | |
| 64 | + | ||
| 65 | + | // Gets the content widget of @self. | |
| 66 | + | // | |
| 67 | + | // This method should always be used instead of [method@Gtk.Window.get_child]. | |
| 68 | + | func (x *ApplicationWindow) GetContent() *gtk.Widget { | |
| 69 | + | ||
| 70 | + | GetContentPtr := xApplicationWindowGetContent(x.GoPointer()) | |
| 71 | + | if GetContentPtr == 0 { | |
| 72 | + | return nil | |
| 73 | + | } | |
| 74 | + | ||
| 75 | + | gobject.IncreaseRef(GetContentPtr) | |
| 76 | + | ||
| 77 | + | GetContentCls := >k.Widget{} | |
| 78 | + | GetContentCls.Ptr = GetContentPtr | |
| 79 | + | return GetContentCls | |
| 80 | + | ||
| 81 | + | } | |
| 82 | + | ||
| 83 | + | var xApplicationWindowSetContent func(uintptr, uintptr) | |
| 84 | + | ||
| 85 | + | // Sets the content widget of @self. | |
| 86 | + | // | |
| 87 | + | // This method should always be used instead of [method@Gtk.Window.set_child]. | |
| 88 | + | func (x *ApplicationWindow) SetContent(ContentVar *gtk.Widget) { | |
| 89 | + | ||
| 90 | + | xApplicationWindowSetContent(x.GoPointer(), ContentVar.GoPointer()) | |
| 91 | + | ||
| 92 | + | } | |
| 93 | + | ||
| 94 | + | func (c *ApplicationWindow) GoPointer() uintptr { | |
| 95 | + | return c.Ptr | |
| 96 | + | } | |
| 97 | + | ||
| 98 | + | func (c *ApplicationWindow) SetGoPointer(ptr uintptr) { | |
| 99 | + | c.Ptr = ptr | |
| 100 | + | } | |
| 101 | + | ||
| 102 | + | // Emits the #GActionGroup::action-added signal on @action_group. | |
| 103 | + | // | |
| 104 | + | // This function should only be called by #GActionGroup implementations. | |
| 105 | + | func (x *ApplicationWindow) ActionAdded(ActionNameVar string) { | |
| 106 | + | ||
| 107 | + | gio.XGActionGroupActionAdded(x.GoPointer(), ActionNameVar) | |
| 108 | + | ||
| 109 | + | } | |
| 110 | + | ||
| 111 | + | // Emits the #GActionGroup::action-enabled-changed signal on @action_group. | |
| 112 | + | // | |
| 113 | + | // This function should only be called by #GActionGroup implementations. | |
| 114 | + | func (x *ApplicationWindow) ActionEnabledChanged(ActionNameVar string, EnabledVar bool) { | |
| 115 | + | ||
| 116 | + | gio.XGActionGroupActionEnabledChanged(x.GoPointer(), ActionNameVar, EnabledVar) | |
| 117 | + | ||
| 118 | + | } | |
| 119 | + | ||
| 120 | + | // Emits the #GActionGroup::action-removed signal on @action_group. | |
| 121 | + | // | |
| 122 | + | // This function should only be called by #GActionGroup implementations. | |
| 123 | + | func (x *ApplicationWindow) ActionRemoved(ActionNameVar string) { | |
| 124 | + | ||
| 125 | + | gio.XGActionGroupActionRemoved(x.GoPointer(), ActionNameVar) | |
| 126 | + | ||
| 127 | + | } | |
| 128 | + | ||
| 129 | + | // Emits the #GActionGroup::action-state-changed signal on @action_group. | |
| 130 | + | // | |
| 131 | + | // This function should only be called by #GActionGroup implementations. | |
| 132 | + | func (x *ApplicationWindow) ActionStateChanged(ActionNameVar string, StateVar *glib.Variant) { | |
| 133 | + | ||
| 134 | + | gio.XGActionGroupActionStateChanged(x.GoPointer(), ActionNameVar, StateVar) | |
| 135 | + | ||
| 136 | + | } | |
| 137 | + | ||
| 138 | + | // Activate the named action within @action_group. | |
| 139 | + | // | |
| 140 | + | // If the action is expecting a parameter, then the correct type of | |
| 141 | + | // parameter must be given as @parameter. If the action is expecting no | |
| 142 | + | // parameters then @parameter must be %NULL. See | |
| 143 | + | // g_action_group_get_action_parameter_type(). | |
| 144 | + | // | |
| 145 | + | // If the #GActionGroup implementation supports asynchronous remote | |
| 146 | + | // activation over D-Bus, this call may return before the relevant | |
| 147 | + | // D-Bus traffic has been sent, or any replies have been received. In | |
| 148 | + | // order to block on such asynchronous activation calls, | |
| 149 | + | // g_dbus_connection_flush() should be called prior to the code, which | |
| 150 | + | // depends on the result of the action activation. Without flushing | |
| 151 | + | // the D-Bus connection, there is no guarantee that the action would | |
| 152 | + | // have been activated. | |
| 153 | + | // | |
| 154 | + | // The following code which runs in a remote app instance, shows an | |
| 155 | + | // example of a "quit" action being activated on the primary app | |
| 156 | + | // instance over D-Bus. Here g_dbus_connection_flush() is called | |
| 157 | + | // before `exit()`. Without g_dbus_connection_flush(), the "quit" action | |
| 158 | + | // may fail to be activated on the primary instance. | |
| 159 | + | // | |
| 160 | + | // |[<!-- language="C" --> | |
| 161 | + | // // call "quit" action on primary instance | |
| 162 | + | // g_action_group_activate_action (G_ACTION_GROUP (app), "quit", NULL); | |
| 163 | + | // | |
| 164 | + | // // make sure the action is activated now | |
| 165 | + | // g_dbus_connection_flush (...); | |
| 166 | + | // | |
| 167 | + | // g_debug ("application has been terminated. exiting."); | |
| 168 | + | // | |
| 169 | + | // exit (0); | |
| 170 | + | // ]| | |
| 171 | + | func (x *ApplicationWindow) ActivateAction(ActionNameVar string, ParameterVar *glib.Variant) { | |
| 172 | + | ||
| 173 | + | gio.XGActionGroupActivateAction(x.GoPointer(), ActionNameVar, ParameterVar) | |
| 174 | + | ||
| 175 | + | } | |
| 176 | + | ||
| 177 | + | // Request for the state of the named action within @action_group to be | |
| 178 | + | // changed to @value. | |
| 179 | + | // | |
| 180 | + | // The action must be stateful and @value must be of the correct type. | |
| 181 | + | // See g_action_group_get_action_state_type(). | |
| 182 | + | // | |
| 183 | + | // This call merely requests a change. The action may refuse to change | |
| 184 | + | // its state or may change its state to something other than @value. | |
| 185 | + | // See g_action_group_get_action_state_hint(). | |
| 186 | + | // | |
| 187 | + | // If the @value GVariant is floating, it is consumed. | |
| 188 | + | func (x *ApplicationWindow) ChangeActionState(ActionNameVar string, ValueVar *glib.Variant) { | |
| 189 | + | ||
| 190 | + | gio.XGActionGroupChangeActionState(x.GoPointer(), ActionNameVar, ValueVar) | |
| 191 | + | ||
| 192 | + | } | |
| 193 | + | ||
| 194 | + | // Checks if the named action within @action_group is currently enabled. | |
| 195 | + | // | |
| 196 | + | // An action must be enabled in order to be activated or in order to | |
| 197 | + | // have its state changed from outside callers. | |
| 198 | + | func (x *ApplicationWindow) GetActionEnabled(ActionNameVar string) bool { | |
| 199 | + | ||
| 200 | + | return gio.XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar) | |
| 201 | + | ||
| 202 | + | } | |
| 203 | + | ||
| 204 | + | // Queries the type of the parameter that must be given when activating | |
| 205 | + | // the named action within @action_group. | |
| 206 | + | // | |
| 207 | + | // When activating the action using g_action_group_activate_action(), | |
| 208 | + | // the #GVariant given to that function must be of the type returned | |
| 209 | + | // by this function. | |
| 210 | + | // | |
| 211 | + | // In the case that this function returns %NULL, you must not give any | |
| 212 | + | // #GVariant, but %NULL instead. | |
| 213 | + | // | |
| 214 | + | // The parameter type of a particular action will never change but it is | |
| 215 | + | // possible for an action to be removed and for a new action to be added | |
| 216 | + | // with the same name but a different parameter type. | |
| 217 | + | func (x *ApplicationWindow) GetActionParameterType(ActionNameVar string) *glib.VariantType { | |
| 218 | + | ||
| 219 | + | return gio.XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar) | |
| 220 | + | ||
| 221 | + | } | |
| 222 | + | ||
| 223 | + | // Queries the current state of the named action within @action_group. | |
| 224 | + | // | |
| 225 | + | // If the action is not stateful then %NULL will be returned. If the | |
| 226 | + | // action is stateful then the type of the return value is the type | |
| 227 | + | // given by g_action_group_get_action_state_type(). | |
| 228 | + | // | |
| 229 | + | // The return value (if non-%NULL) should be freed with | |
| 230 | + | // g_variant_unref() when it is no longer required. | |
| 231 | + | func (x *ApplicationWindow) GetActionState(ActionNameVar string) *glib.Variant { | |
| 232 | + | ||
| 233 | + | return gio.XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| 234 | + | ||
| 235 | + | } | |
| 236 | + | ||
| 237 | + | // Requests a hint about the valid range of values for the state of the | |
| 238 | + | // named action within @action_group. | |
| 239 | + | // | |
| 240 | + | // If %NULL is returned it either means that the action is not stateful | |
| 241 | + | // or that there is no hint about the valid range of values for the | |
| 242 | + | // state of the action. | |
| 243 | + | // | |
| 244 | + | // If a #GVariant array is returned then each item in the array is a | |
| 245 | + | // possible value for the state. If a #GVariant pair (ie: two-tuple) is | |
| 246 | + | // returned then the tuple specifies the inclusive lower and upper bound | |
| 247 | + | // of valid values for the state. | |
| 248 | + | // | |
| 249 | + | // In any case, the information is merely a hint. It may be possible to | |
| 250 | + | // have a state value outside of the hinted range and setting a value | |
| 251 | + | // within the range may fail. | |
| 252 | + | // | |
| 253 | + | // The return value (if non-%NULL) should be freed with | |
| 254 | + | // g_variant_unref() when it is no longer required. | |
| 255 | + | func (x *ApplicationWindow) GetActionStateHint(ActionNameVar string) *glib.Variant { | |
| 256 | + | ||
| 257 | + | return gio.XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| 258 | + | ||
| 259 | + | } | |
| 260 | + | ||
| 261 | + | // Queries the type of the state of the named action within | |
| 262 | + | // @action_group. | |
| 263 | + | // | |
| 264 | + | // If the action is stateful then this function returns the | |
| 265 | + | // #GVariantType of the state. All calls to | |
| 266 | + | // g_action_group_change_action_state() must give a #GVariant of this | |
| 267 | + | // type and g_action_group_get_action_state() will return a #GVariant | |
| 268 | + | // of the same type. | |
| 269 | + | // | |
| 270 | + | // If the action is not stateful then this function will return %NULL. | |
| 271 | + | // In that case, g_action_group_get_action_state() will return %NULL | |
| 272 | + | // and you must not call g_action_group_change_action_state(). | |
| 273 | + | // | |
| 274 | + | // The state type of a particular action will never change but it is | |
| 275 | + | // possible for an action to be removed and for a new action to be added | |
| 276 | + | // with the same name but a different state type. | |
| 277 | + | func (x *ApplicationWindow) GetActionStateType(ActionNameVar string) *glib.VariantType { | |
| 278 | + | ||
| 279 | + | return gio.XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar) | |
| 280 | + | ||
| 281 | + | } | |
| 282 | + | ||
| 283 | + | // Checks if the named action exists within @action_group. | |
| 284 | + | func (x *ApplicationWindow) HasAction(ActionNameVar string) bool { | |
| 285 | + | ||
| 286 | + | return gio.XGActionGroupHasAction(x.GoPointer(), ActionNameVar) | |
| 287 | + | ||
| 288 | + | } | |
| 289 | + | ||
| 290 | + | // Lists the actions contained within @action_group. | |
| 291 | + | // | |
| 292 | + | // The caller is responsible for freeing the list with g_strfreev() when | |
| 293 | + | // it is no longer required. | |
| 294 | + | func (x *ApplicationWindow) ListActions() uintptr { | |
| 295 | + | ||
| 296 | + | return gio.XGActionGroupListActions(x.GoPointer()) | |
| 297 | + | ||
| 298 | + | } | |
| 299 | + | ||
| 300 | + | // Queries all aspects of the named action within an @action_group. | |
| 301 | + | // | |
| 302 | + | // This function acquires the information available from | |
| 303 | + | // g_action_group_has_action(), g_action_group_get_action_enabled(), | |
| 304 | + | // g_action_group_get_action_parameter_type(), | |
| 305 | + | // g_action_group_get_action_state_type(), | |
| 306 | + | // g_action_group_get_action_state_hint() and | |
| 307 | + | // g_action_group_get_action_state() with a single function call. | |
| 308 | + | // | |
| 309 | + | // This provides two main benefits. | |
| 310 | + | // | |
| 311 | + | // The first is the improvement in efficiency that comes with not having | |
| 312 | + | // to perform repeated lookups of the action in order to discover | |
| 313 | + | // different things about it. The second is that implementing | |
| 314 | + | // #GActionGroup can now be done by only overriding this one virtual | |
| 315 | + | // function. | |
| 316 | + | // | |
| 317 | + | // The interface provides a default implementation of this function that | |
| 318 | + | // calls the individual functions, as required, to fetch the | |
| 319 | + | // information. The interface also provides default implementations of | |
| 320 | + | // those functions that call this function. All implementations, | |
| 321 | + | // therefore, must override either this function or all of the others. | |
| 322 | + | // | |
| 323 | + | // If the action exists, %TRUE is returned and any of the requested | |
| 324 | + | // fields (as indicated by having a non-%NULL reference passed in) are | |
| 325 | + | // filled. If the action doesn't exist, %FALSE is returned and the | |
| 326 | + | // fields may or may not have been modified. | |
| 327 | + | func (x *ApplicationWindow) QueryAction(ActionNameVar string, EnabledVar bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool { | |
| 328 | + | ||
| 329 | + | return gio.XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) | |
| 330 | + | ||
| 331 | + | } | |
| 332 | + | ||
| 333 | + | // Adds an action to the @action_map. | |
| 334 | + | // | |
| 335 | + | // If the action map already contains an action with the same name | |
| 336 | + | // as @action then the old action is dropped from the action map. | |
| 337 | + | // | |
| 338 | + | // The action map takes its own reference on @action. | |
| 339 | + | func (x *ApplicationWindow) AddAction(ActionVar gio.Action) { | |
| 340 | + | ||
| 341 | + | gio.XGActionMapAddAction(x.GoPointer(), ActionVar.GoPointer()) | |
| 342 | + | ||
| 343 | + | } | |
| 344 | + | ||
| 345 | + | // A convenience function for creating multiple #GSimpleAction instances | |
| 346 | + | // and adding them to a #GActionMap. | |
| 347 | + | // | |
| 348 | + | // Each action is constructed as per one #GActionEntry. | |
| 349 | + | // | |
| 350 | + | // |[<!-- language="C" --> | |
| 351 | + | // static void | |
| 352 | + | // activate_quit (GSimpleAction *simple, | |
| 353 | + | // | |
| 354 | + | // GVariant *parameter, | |
| 355 | + | // gpointer user_data) | |
| 356 | + | // | |
| 357 | + | // { | |
| 358 | + | // exit (0); | |
| 359 | + | // } | |
| 360 | + | // | |
| 361 | + | // static void | |
| 362 | + | // activate_print_string (GSimpleAction *simple, | |
| 363 | + | // | |
| 364 | + | // GVariant *parameter, | |
| 365 | + | // gpointer user_data) | |
| 366 | + | // | |
| 367 | + | // { | |
| 368 | + | // g_print ("%s\n", g_variant_get_string (parameter, NULL)); | |
| 369 | + | // } | |
| 370 | + | // | |
| 371 | + | // static GActionGroup * | |
| 372 | + | // create_action_group (void) | |
| 373 | + | // | |
| 374 | + | // { | |
| 375 | + | // const GActionEntry entries[] = { | |
| 376 | + | // { "quit", activate_quit }, | |
| 377 | + | // { "print-string", activate_print_string, "s" } | |
| 378 | + | // }; | |
| 379 | + | // GSimpleActionGroup *group; | |
| 380 | + | // | |
| 381 | + | // group = g_simple_action_group_new (); | |
| 382 | + | // g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL); | |
| 383 | + | // | |
| 384 | + | // return G_ACTION_GROUP (group); | |
| 385 | + | // } | |
| 386 | + | // | |
| 387 | + | // ]| | |
| 388 | + | func (x *ApplicationWindow) AddActionEntries(EntriesVar uintptr, NEntriesVar int32, UserDataVar uintptr) { | |
| 389 | + | ||
| 390 | + | gio.XGActionMapAddActionEntries(x.GoPointer(), EntriesVar, NEntriesVar, UserDataVar) | |
| 391 | + | ||
| 392 | + | } | |
| 393 | + | ||
| 394 | + | // Looks up the action with the name @action_name in @action_map. | |
| 395 | + | // | |
| 396 | + | // If no such action exists, returns %NULL. | |
| 397 | + | func (x *ApplicationWindow) LookupAction(ActionNameVar string) *gio.ActionBase { | |
| 398 | + | ||
| 399 | + | LookupActionPtr := gio.XGActionMapLookupAction(x.GoPointer(), ActionNameVar) | |
| 400 | + | if LookupActionPtr == 0 { | |
| 401 | + | return nil | |
| 402 | + | } | |
| 403 | + | ||
| 404 | + | gobject.IncreaseRef(LookupActionPtr) | |
| 405 | + | ||
| 406 | + | LookupActionCls := &gio.ActionBase{} | |
| 407 | + | LookupActionCls.Ptr = LookupActionPtr | |
| 408 | + | return LookupActionCls | |
| 409 | + | ||
| 410 | + | } | |
| 411 | + | ||
| 412 | + | // Removes the named action from the action map. | |
| 413 | + | // | |
| 414 | + | // If no action of this name is in the map then nothing happens. | |
| 415 | + | func (x *ApplicationWindow) RemoveAction(ActionNameVar string) { | |
| 416 | + | ||
| 417 | + | gio.XGActionMapRemoveAction(x.GoPointer(), ActionNameVar) | |
| 418 | + | ||
| 419 | + | } | |
| 420 | + | ||
| 421 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 422 | + | func (x *ApplicationWindow) GetAccessibleRole() gtk.AccessibleRole { | |
| 423 | + | ||
| 424 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 425 | + | ||
| 426 | + | } | |
| 427 | + | ||
| 428 | + | // Resets the accessible @property to its default value. | |
| 429 | + | func (x *ApplicationWindow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 430 | + | ||
| 431 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 432 | + | ||
| 433 | + | } | |
| 434 | + | ||
| 435 | + | // Resets the accessible @relation to its default value. | |
| 436 | + | func (x *ApplicationWindow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 437 | + | ||
| 438 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 439 | + | ||
| 440 | + | } | |
| 441 | + | ||
| 442 | + | // Resets the accessible @state to its default value. | |
| 443 | + | func (x *ApplicationWindow) ResetState(StateVar gtk.AccessibleState) { | |
| 444 | + | ||
| 445 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 446 | + | ||
| 447 | + | } | |
| 448 | + | ||
| 449 | + | // Updates a list of accessible properties. | |
| 450 | + | // | |
| 451 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 452 | + | // value types of accessible properties. | |
| 453 | + | // | |
| 454 | + | // This function should be called by `GtkWidget` types whenever | |
| 455 | + | // an accessible property change must be communicated to assistive | |
| 456 | + | // technologies. | |
| 457 | + | // | |
| 458 | + | // Example: | |
| 459 | + | // ```c | |
| 460 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 461 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 462 | + | // | |
| 463 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 464 | + | // -1); | |
| 465 | + | // | |
| 466 | + | // ``` | |
| 467 | + | func (x *ApplicationWindow) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 468 | + | ||
| 469 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 470 | + | ||
| 471 | + | } | |
| 472 | + | ||
| 473 | + | // Updates an array of accessible properties. | |
| 474 | + | // | |
| 475 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 476 | + | // property change must be communicated to assistive technologies. | |
| 477 | + | // | |
| 478 | + | // This function is meant to be used by language bindings. | |
| 479 | + | func (x *ApplicationWindow) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 480 | + | ||
| 481 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 482 | + | ||
| 483 | + | } | |
| 484 | + | ||
| 485 | + | // Updates a list of accessible relations. | |
| 486 | + | // | |
| 487 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 488 | + | // relation change must be communicated to assistive technologies. | |
| 489 | + | // | |
| 490 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 491 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 492 | + | // | |
| 493 | + | // ```c | |
| 494 | + | // gtk_accessible_update_relation (accessible, | |
| 495 | + | // | |
| 496 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 497 | + | // ref1, NULL, | |
| 498 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 499 | + | // ref1, ref2, ref3, NULL, | |
| 500 | + | // -1); | |
| 501 | + | // | |
| 502 | + | // ``` | |
| 503 | + | func (x *ApplicationWindow) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 504 | + | ||
| 505 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 506 | + | ||
| 507 | + | } | |
| 508 | + | ||
| 509 | + | // Updates an array of accessible relations. | |
| 510 | + | // | |
| 511 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 512 | + | // relation change must be communicated to assistive technologies. | |
| 513 | + | // | |
| 514 | + | // This function is meant to be used by language bindings. | |
| 515 | + | func (x *ApplicationWindow) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 516 | + | ||
| 517 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 518 | + | ||
| 519 | + | } | |
| 520 | + | ||
| 521 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 522 | + | // documentation for the value types of accessible states. | |
| 523 | + | // | |
| 524 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 525 | + | // state change must be communicated to assistive technologies. | |
| 526 | + | // | |
| 527 | + | // Example: | |
| 528 | + | // ```c | |
| 529 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 530 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 531 | + | // | |
| 532 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 533 | + | // -1); | |
| 534 | + | // | |
| 535 | + | // ``` | |
| 536 | + | func (x *ApplicationWindow) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 537 | + | ||
| 538 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 539 | + | ||
| 540 | + | } | |
| 541 | + | ||
| 542 | + | // Updates an array of accessible states. | |
| 543 | + | // | |
| 544 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 545 | + | // state change must be communicated to assistive technologies. | |
| 546 | + | // | |
| 547 | + | // This function is meant to be used by language bindings. | |
| 548 | + | func (x *ApplicationWindow) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 549 | + | ||
| 550 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 551 | + | ||
| 552 | + | } | |
| 553 | + | ||
| 554 | + | // Gets the ID of the @buildable object. | |
| 555 | + | // | |
| 556 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 557 | + | // of the <object> tag used to construct the @buildable. | |
| 558 | + | func (x *ApplicationWindow) GetBuildableId() string { | |
| 559 | + | ||
| 560 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 561 | + | ||
| 562 | + | } | |
| 563 | + | ||
| 564 | + | // Returns the renderer that is used for this `GtkNative`. | |
| 565 | + | func (x *ApplicationWindow) GetRenderer() *gsk.Renderer { | |
| 566 | + | ||
| 567 | + | GetRendererPtr := gtk.XGtkNativeGetRenderer(x.GoPointer()) | |
| 568 | + | if GetRendererPtr == 0 { | |
| 569 | + | return nil | |
| 570 | + | } | |
| 571 | + | ||
| 572 | + | gobject.IncreaseRef(GetRendererPtr) | |
| 573 | + | ||
| 574 | + | GetRendererCls := &gsk.Renderer{} | |
| 575 | + | GetRendererCls.Ptr = GetRendererPtr | |
| 576 | + | return GetRendererCls | |
| 577 | + | ||
| 578 | + | } | |
| 579 | + | ||
| 580 | + | // Returns the surface of this `GtkNative`. | |
| 581 | + | func (x *ApplicationWindow) GetSurface() *gdk.Surface { | |
| 582 | + | ||
| 583 | + | GetSurfacePtr := gtk.XGtkNativeGetSurface(x.GoPointer()) | |
| 584 | + | if GetSurfacePtr == 0 { | |
| 585 | + | return nil | |
| 586 | + | } | |
| 587 | + | ||
| 588 | + | gobject.IncreaseRef(GetSurfacePtr) | |
| 589 | + | ||
| 590 | + | GetSurfaceCls := &gdk.Surface{} | |
| 591 | + | GetSurfaceCls.Ptr = GetSurfacePtr | |
| 592 | + | return GetSurfaceCls | |
| 593 | + | ||
| 594 | + | } | |
| 595 | + | ||
| 596 | + | // Retrieves the surface transform of @self. | |
| 597 | + | // | |
| 598 | + | // This is the translation from @self's surface coordinates into | |
| 599 | + | // @self's widget coordinates. | |
| 600 | + | func (x *ApplicationWindow) GetSurfaceTransform(XVar float64, YVar float64) { | |
| 601 | + | ||
| 602 | + | gtk.XGtkNativeGetSurfaceTransform(x.GoPointer(), XVar, YVar) | |
| 603 | + | ||
| 604 | + | } | |
| 605 | + | ||
| 606 | + | // Realizes a `GtkNative`. | |
| 607 | + | // | |
| 608 | + | // This should only be used by subclasses. | |
| 609 | + | func (x *ApplicationWindow) Realize() { | |
| 610 | + | ||
| 611 | + | gtk.XGtkNativeRealize(x.GoPointer()) | |
| 612 | + | ||
| 613 | + | } | |
| 614 | + | ||
| 615 | + | // Unrealizes a `GtkNative`. | |
| 616 | + | // | |
| 617 | + | // This should only be used by subclasses. | |
| 618 | + | func (x *ApplicationWindow) Unrealize() { | |
| 619 | + | ||
| 620 | + | gtk.XGtkNativeUnrealize(x.GoPointer()) | |
| 621 | + | ||
| 622 | + | } | |
| 623 | + | ||
| 624 | + | // Returns the display that this `GtkRoot` is on. | |
| 625 | + | func (x *ApplicationWindow) GetDisplay() *gdk.Display { | |
| 626 | + | ||
| 627 | + | GetDisplayPtr := gtk.XGtkRootGetDisplay(x.GoPointer()) | |
| 628 | + | if GetDisplayPtr == 0 { | |
| 629 | + | return nil | |
| 630 | + | } | |
| 631 | + | ||
| 632 | + | gobject.IncreaseRef(GetDisplayPtr) | |
| 633 | + | ||
| 634 | + | GetDisplayCls := &gdk.Display{} | |
| 635 | + | GetDisplayCls.Ptr = GetDisplayPtr | |
| 636 | + | return GetDisplayCls | |
| 637 | + | ||
| 638 | + | } | |
| 639 | + | ||
| 640 | + | // Retrieves the current focused widget within the root. | |
| 641 | + | // | |
| 642 | + | // Note that this is the widget that would have the focus | |
| 643 | + | // if the root is active; if the root is not focused then | |
| 644 | + | // `gtk_widget_has_focus (widget)` will be %FALSE for the | |
| 645 | + | // widget. | |
| 646 | + | func (x *ApplicationWindow) GetFocus() *gtk.Widget { | |
| 647 | + | ||
| 648 | + | GetFocusPtr := gtk.XGtkRootGetFocus(x.GoPointer()) | |
| 649 | + | if GetFocusPtr == 0 { | |
| 650 | + | return nil | |
| 651 | + | } | |
| 652 | + | ||
| 653 | + | gobject.IncreaseRef(GetFocusPtr) | |
| 654 | + | ||
| 655 | + | GetFocusCls := >k.Widget{} | |
| 656 | + | GetFocusCls.Ptr = GetFocusPtr | |
| 657 | + | return GetFocusCls | |
| 658 | + | ||
| 659 | + | } | |
| 660 | + | ||
| 661 | + | // If @focus is not the current focus widget, and is focusable, sets | |
| 662 | + | // it as the focus widget for the root. | |
| 663 | + | // | |
| 664 | + | // If @focus is %NULL, unsets the focus widget for the root. | |
| 665 | + | // | |
| 666 | + | // To set the focus to a particular widget in the root, it is usually | |
| 667 | + | // more convenient to use [method@Gtk.Widget.grab_focus] instead of | |
| 668 | + | // this function. | |
| 669 | + | func (x *ApplicationWindow) SetFocus(FocusVar *gtk.Widget) { | |
| 670 | + | ||
| 671 | + | gtk.XGtkRootSetFocus(x.GoPointer(), FocusVar.GoPointer()) | |
| 672 | + | ||
| 673 | + | } | |
| 674 | + | ||
| 675 | + | func init() { | |
| 676 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 677 | + | if err != nil { | |
| 678 | + | panic(err) | |
| 679 | + | } | |
| 680 | + | ||
| 681 | + | core.PuregoSafeRegister(&xNewApplicationWindow, lib, "adw_application_window_new") | |
| 682 | + | ||
| 683 | + | core.PuregoSafeRegister(&xApplicationWindowGetContent, lib, "adw_application_window_get_content") | |
| 684 | + | core.PuregoSafeRegister(&xApplicationWindowSetContent, lib, "adw_application_window_set_content") | |
| 685 | + | ||
| 686 | + | } | |
A v4/adw/adw-application.go +433 -0
| @@ -0,0 +1,433 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gio" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 11 | + | ) | |
| 12 | + | ||
| 13 | + | type ApplicationClass struct { | |
| 14 | + | ParentClass uintptr | |
| 15 | + | ||
| 16 | + | Padding uintptr | |
| 17 | + | } | |
| 18 | + | ||
| 19 | + | // A base class for Adwaita applications. | |
| 20 | + | // | |
| 21 | + | // `AdwApplication` handles library initialization by calling [func@init] in the | |
| 22 | + | // default [signal@Gio.Application::startup] signal handler, in turn chaining up | |
| 23 | + | // as required by [class@Gtk.Application]. Therefore, any subclass of | |
| 24 | + | // `AdwApplication` should always chain up its `startup` handler before using | |
| 25 | + | // any Adwaita or GTK API. | |
| 26 | + | // | |
| 27 | + | // ## Automatic Resources | |
| 28 | + | // | |
| 29 | + | // `AdwApplication` will automatically load stylesheets located in the | |
| 30 | + | // application's resource base path (see | |
| 31 | + | // [method@Gio.Application.set_resource_base_path], if they're present. | |
| 32 | + | // | |
| 33 | + | // They can be used to add custom styles to the application, as follows: | |
| 34 | + | // | |
| 35 | + | // - `style.css` contains styles that are always present. | |
| 36 | + | // | |
| 37 | + | // - `style-dark.css` contains styles only used when | |
| 38 | + | // [property@StyleManager:dark] is `TRUE`. | |
| 39 | + | // | |
| 40 | + | // - `style-hc.css` contains styles used when the system high contrast | |
| 41 | + | // preference is enabled. | |
| 42 | + | // | |
| 43 | + | // - `style-hc-dark.css` contains styles used when the system high contrast | |
| 44 | + | // preference is enabled and [property@StyleManager:dark] is `TRUE`. | |
| 45 | + | type Application struct { | |
| 46 | + | gtk.Application | |
| 47 | + | } | |
| 48 | + | ||
| 49 | + | func ApplicationNewFromInternalPtr(ptr uintptr) *Application { | |
| 50 | + | cls := &Application{} | |
| 51 | + | cls.Ptr = ptr | |
| 52 | + | return cls | |
| 53 | + | } | |
| 54 | + | ||
| 55 | + | var xNewApplication func(string, gio.ApplicationFlags) uintptr | |
| 56 | + | ||
| 57 | + | // Creates a new `AdwApplication`. | |
| 58 | + | // | |
| 59 | + | // If `application_id` is not `NULL`, then it must be valid. See | |
| 60 | + | // [func@Gio.Application.id_is_valid]. | |
| 61 | + | // | |
| 62 | + | // If no application ID is given then some features (most notably application | |
| 63 | + | // uniqueness) will be disabled. | |
| 64 | + | func NewApplication(ApplicationIdVar string, FlagsVar gio.ApplicationFlags) *Application { | |
| 65 | + | NewApplicationPtr := xNewApplication(ApplicationIdVar, FlagsVar) | |
| 66 | + | if NewApplicationPtr == 0 { | |
| 67 | + | return nil | |
| 68 | + | } | |
| 69 | + | ||
| 70 | + | NewApplicationCls := &Application{} | |
| 71 | + | NewApplicationCls.Ptr = NewApplicationPtr | |
| 72 | + | return NewApplicationCls | |
| 73 | + | } | |
| 74 | + | ||
| 75 | + | var xApplicationGetStyleManager func(uintptr) uintptr | |
| 76 | + | ||
| 77 | + | // Gets the style manager for @self. | |
| 78 | + | // | |
| 79 | + | // This is a convenience property allowing to access `AdwStyleManager` through | |
| 80 | + | // property bindings or expressions. | |
| 81 | + | func (x *Application) GetStyleManager() *StyleManager { | |
| 82 | + | ||
| 83 | + | GetStyleManagerPtr := xApplicationGetStyleManager(x.GoPointer()) | |
| 84 | + | if GetStyleManagerPtr == 0 { | |
| 85 | + | return nil | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | gobject.IncreaseRef(GetStyleManagerPtr) | |
| 89 | + | ||
| 90 | + | GetStyleManagerCls := &StyleManager{} | |
| 91 | + | GetStyleManagerCls.Ptr = GetStyleManagerPtr | |
| 92 | + | return GetStyleManagerCls | |
| 93 | + | ||
| 94 | + | } | |
| 95 | + | ||
| 96 | + | func (c *Application) GoPointer() uintptr { | |
| 97 | + | return c.Ptr | |
| 98 | + | } | |
| 99 | + | ||
| 100 | + | func (c *Application) SetGoPointer(ptr uintptr) { | |
| 101 | + | c.Ptr = ptr | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | // Emits the #GActionGroup::action-added signal on @action_group. | |
| 105 | + | // | |
| 106 | + | // This function should only be called by #GActionGroup implementations. | |
| 107 | + | func (x *Application) ActionAdded(ActionNameVar string) { | |
| 108 | + | ||
| 109 | + | gio.XGActionGroupActionAdded(x.GoPointer(), ActionNameVar) | |
| 110 | + | ||
| 111 | + | } | |
| 112 | + | ||
| 113 | + | // Emits the #GActionGroup::action-enabled-changed signal on @action_group. | |
| 114 | + | // | |
| 115 | + | // This function should only be called by #GActionGroup implementations. | |
| 116 | + | func (x *Application) ActionEnabledChanged(ActionNameVar string, EnabledVar bool) { | |
| 117 | + | ||
| 118 | + | gio.XGActionGroupActionEnabledChanged(x.GoPointer(), ActionNameVar, EnabledVar) | |
| 119 | + | ||
| 120 | + | } | |
| 121 | + | ||
| 122 | + | // Emits the #GActionGroup::action-removed signal on @action_group. | |
| 123 | + | // | |
| 124 | + | // This function should only be called by #GActionGroup implementations. | |
| 125 | + | func (x *Application) ActionRemoved(ActionNameVar string) { | |
| 126 | + | ||
| 127 | + | gio.XGActionGroupActionRemoved(x.GoPointer(), ActionNameVar) | |
| 128 | + | ||
| 129 | + | } | |
| 130 | + | ||
| 131 | + | // Emits the #GActionGroup::action-state-changed signal on @action_group. | |
| 132 | + | // | |
| 133 | + | // This function should only be called by #GActionGroup implementations. | |
| 134 | + | func (x *Application) ActionStateChanged(ActionNameVar string, StateVar *glib.Variant) { | |
| 135 | + | ||
| 136 | + | gio.XGActionGroupActionStateChanged(x.GoPointer(), ActionNameVar, StateVar) | |
| 137 | + | ||
| 138 | + | } | |
| 139 | + | ||
| 140 | + | // Activate the named action within @action_group. | |
| 141 | + | // | |
| 142 | + | // If the action is expecting a parameter, then the correct type of | |
| 143 | + | // parameter must be given as @parameter. If the action is expecting no | |
| 144 | + | // parameters then @parameter must be %NULL. See | |
| 145 | + | // g_action_group_get_action_parameter_type(). | |
| 146 | + | // | |
| 147 | + | // If the #GActionGroup implementation supports asynchronous remote | |
| 148 | + | // activation over D-Bus, this call may return before the relevant | |
| 149 | + | // D-Bus traffic has been sent, or any replies have been received. In | |
| 150 | + | // order to block on such asynchronous activation calls, | |
| 151 | + | // g_dbus_connection_flush() should be called prior to the code, which | |
| 152 | + | // depends on the result of the action activation. Without flushing | |
| 153 | + | // the D-Bus connection, there is no guarantee that the action would | |
| 154 | + | // have been activated. | |
| 155 | + | // | |
| 156 | + | // The following code which runs in a remote app instance, shows an | |
| 157 | + | // example of a "quit" action being activated on the primary app | |
| 158 | + | // instance over D-Bus. Here g_dbus_connection_flush() is called | |
| 159 | + | // before `exit()`. Without g_dbus_connection_flush(), the "quit" action | |
| 160 | + | // may fail to be activated on the primary instance. | |
| 161 | + | // | |
| 162 | + | // |[<!-- language="C" --> | |
| 163 | + | // // call "quit" action on primary instance | |
| 164 | + | // g_action_group_activate_action (G_ACTION_GROUP (app), "quit", NULL); | |
| 165 | + | // | |
| 166 | + | // // make sure the action is activated now | |
| 167 | + | // g_dbus_connection_flush (...); | |
| 168 | + | // | |
| 169 | + | // g_debug ("application has been terminated. exiting."); | |
| 170 | + | // | |
| 171 | + | // exit (0); | |
| 172 | + | // ]| | |
| 173 | + | func (x *Application) ActivateAction(ActionNameVar string, ParameterVar *glib.Variant) { | |
| 174 | + | ||
| 175 | + | gio.XGActionGroupActivateAction(x.GoPointer(), ActionNameVar, ParameterVar) | |
| 176 | + | ||
| 177 | + | } | |
| 178 | + | ||
| 179 | + | // Request for the state of the named action within @action_group to be | |
| 180 | + | // changed to @value. | |
| 181 | + | // | |
| 182 | + | // The action must be stateful and @value must be of the correct type. | |
| 183 | + | // See g_action_group_get_action_state_type(). | |
| 184 | + | // | |
| 185 | + | // This call merely requests a change. The action may refuse to change | |
| 186 | + | // its state or may change its state to something other than @value. | |
| 187 | + | // See g_action_group_get_action_state_hint(). | |
| 188 | + | // | |
| 189 | + | // If the @value GVariant is floating, it is consumed. | |
| 190 | + | func (x *Application) ChangeActionState(ActionNameVar string, ValueVar *glib.Variant) { | |
| 191 | + | ||
| 192 | + | gio.XGActionGroupChangeActionState(x.GoPointer(), ActionNameVar, ValueVar) | |
| 193 | + | ||
| 194 | + | } | |
| 195 | + | ||
| 196 | + | // Checks if the named action within @action_group is currently enabled. | |
| 197 | + | // | |
| 198 | + | // An action must be enabled in order to be activated or in order to | |
| 199 | + | // have its state changed from outside callers. | |
| 200 | + | func (x *Application) GetActionEnabled(ActionNameVar string) bool { | |
| 201 | + | ||
| 202 | + | return gio.XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar) | |
| 203 | + | ||
| 204 | + | } | |
| 205 | + | ||
| 206 | + | // Queries the type of the parameter that must be given when activating | |
| 207 | + | // the named action within @action_group. | |
| 208 | + | // | |
| 209 | + | // When activating the action using g_action_group_activate_action(), | |
| 210 | + | // the #GVariant given to that function must be of the type returned | |
| 211 | + | // by this function. | |
| 212 | + | // | |
| 213 | + | // In the case that this function returns %NULL, you must not give any | |
| 214 | + | // #GVariant, but %NULL instead. | |
| 215 | + | // | |
| 216 | + | // The parameter type of a particular action will never change but it is | |
| 217 | + | // possible for an action to be removed and for a new action to be added | |
| 218 | + | // with the same name but a different parameter type. | |
| 219 | + | func (x *Application) GetActionParameterType(ActionNameVar string) *glib.VariantType { | |
| 220 | + | ||
| 221 | + | return gio.XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar) | |
| 222 | + | ||
| 223 | + | } | |
| 224 | + | ||
| 225 | + | // Queries the current state of the named action within @action_group. | |
| 226 | + | // | |
| 227 | + | // If the action is not stateful then %NULL will be returned. If the | |
| 228 | + | // action is stateful then the type of the return value is the type | |
| 229 | + | // given by g_action_group_get_action_state_type(). | |
| 230 | + | // | |
| 231 | + | // The return value (if non-%NULL) should be freed with | |
| 232 | + | // g_variant_unref() when it is no longer required. | |
| 233 | + | func (x *Application) GetActionState(ActionNameVar string) *glib.Variant { | |
| 234 | + | ||
| 235 | + | return gio.XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| 236 | + | ||
| 237 | + | } | |
| 238 | + | ||
| 239 | + | // Requests a hint about the valid range of values for the state of the | |
| 240 | + | // named action within @action_group. | |
| 241 | + | // | |
| 242 | + | // If %NULL is returned it either means that the action is not stateful | |
| 243 | + | // or that there is no hint about the valid range of values for the | |
| 244 | + | // state of the action. | |
| 245 | + | // | |
| 246 | + | // If a #GVariant array is returned then each item in the array is a | |
| 247 | + | // possible value for the state. If a #GVariant pair (ie: two-tuple) is | |
| 248 | + | // returned then the tuple specifies the inclusive lower and upper bound | |
| 249 | + | // of valid values for the state. | |
| 250 | + | // | |
| 251 | + | // In any case, the information is merely a hint. It may be possible to | |
| 252 | + | // have a state value outside of the hinted range and setting a value | |
| 253 | + | // within the range may fail. | |
| 254 | + | // | |
| 255 | + | // The return value (if non-%NULL) should be freed with | |
| 256 | + | // g_variant_unref() when it is no longer required. | |
| 257 | + | func (x *Application) GetActionStateHint(ActionNameVar string) *glib.Variant { | |
| 258 | + | ||
| 259 | + | return gio.XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| 260 | + | ||
| 261 | + | } | |
| 262 | + | ||
| 263 | + | // Queries the type of the state of the named action within | |
| 264 | + | // @action_group. | |
| 265 | + | // | |
| 266 | + | // If the action is stateful then this function returns the | |
| 267 | + | // #GVariantType of the state. All calls to | |
| 268 | + | // g_action_group_change_action_state() must give a #GVariant of this | |
| 269 | + | // type and g_action_group_get_action_state() will return a #GVariant | |
| 270 | + | // of the same type. | |
| 271 | + | // | |
| 272 | + | // If the action is not stateful then this function will return %NULL. | |
| 273 | + | // In that case, g_action_group_get_action_state() will return %NULL | |
| 274 | + | // and you must not call g_action_group_change_action_state(). | |
| 275 | + | // | |
| 276 | + | // The state type of a particular action will never change but it is | |
| 277 | + | // possible for an action to be removed and for a new action to be added | |
| 278 | + | // with the same name but a different state type. | |
| 279 | + | func (x *Application) GetActionStateType(ActionNameVar string) *glib.VariantType { | |
| 280 | + | ||
| 281 | + | return gio.XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar) | |
| 282 | + | ||
| 283 | + | } | |
| 284 | + | ||
| 285 | + | // Checks if the named action exists within @action_group. | |
| 286 | + | func (x *Application) HasAction(ActionNameVar string) bool { | |
| 287 | + | ||
| 288 | + | return gio.XGActionGroupHasAction(x.GoPointer(), ActionNameVar) | |
| 289 | + | ||
| 290 | + | } | |
| 291 | + | ||
| 292 | + | // Lists the actions contained within @action_group. | |
| 293 | + | // | |
| 294 | + | // The caller is responsible for freeing the list with g_strfreev() when | |
| 295 | + | // it is no longer required. | |
| 296 | + | func (x *Application) ListActions() uintptr { | |
| 297 | + | ||
| 298 | + | return gio.XGActionGroupListActions(x.GoPointer()) | |
| 299 | + | ||
| 300 | + | } | |
| 301 | + | ||
| 302 | + | // Queries all aspects of the named action within an @action_group. | |
| 303 | + | // | |
| 304 | + | // This function acquires the information available from | |
| 305 | + | // g_action_group_has_action(), g_action_group_get_action_enabled(), | |
| 306 | + | // g_action_group_get_action_parameter_type(), | |
| 307 | + | // g_action_group_get_action_state_type(), | |
| 308 | + | // g_action_group_get_action_state_hint() and | |
| 309 | + | // g_action_group_get_action_state() with a single function call. | |
| 310 | + | // | |
| 311 | + | // This provides two main benefits. | |
| 312 | + | // | |
| 313 | + | // The first is the improvement in efficiency that comes with not having | |
| 314 | + | // to perform repeated lookups of the action in order to discover | |
| 315 | + | // different things about it. The second is that implementing | |
| 316 | + | // #GActionGroup can now be done by only overriding this one virtual | |
| 317 | + | // function. | |
| 318 | + | // | |
| 319 | + | // The interface provides a default implementation of this function that | |
| 320 | + | // calls the individual functions, as required, to fetch the | |
| 321 | + | // information. The interface also provides default implementations of | |
| 322 | + | // those functions that call this function. All implementations, | |
| 323 | + | // therefore, must override either this function or all of the others. | |
| 324 | + | // | |
| 325 | + | // If the action exists, %TRUE is returned and any of the requested | |
| 326 | + | // fields (as indicated by having a non-%NULL reference passed in) are | |
| 327 | + | // filled. If the action doesn't exist, %FALSE is returned and the | |
| 328 | + | // fields may or may not have been modified. | |
| 329 | + | func (x *Application) QueryAction(ActionNameVar string, EnabledVar bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool { | |
| 330 | + | ||
| 331 | + | return gio.XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) | |
| 332 | + | ||
| 333 | + | } | |
| 334 | + | ||
| 335 | + | // Adds an action to the @action_map. | |
| 336 | + | // | |
| 337 | + | // If the action map already contains an action with the same name | |
| 338 | + | // as @action then the old action is dropped from the action map. | |
| 339 | + | // | |
| 340 | + | // The action map takes its own reference on @action. | |
| 341 | + | func (x *Application) AddAction(ActionVar gio.Action) { | |
| 342 | + | ||
| 343 | + | gio.XGActionMapAddAction(x.GoPointer(), ActionVar.GoPointer()) | |
| 344 | + | ||
| 345 | + | } | |
| 346 | + | ||
| 347 | + | // A convenience function for creating multiple #GSimpleAction instances | |
| 348 | + | // and adding them to a #GActionMap. | |
| 349 | + | // | |
| 350 | + | // Each action is constructed as per one #GActionEntry. | |
| 351 | + | // | |
| 352 | + | // |[<!-- language="C" --> | |
| 353 | + | // static void | |
| 354 | + | // activate_quit (GSimpleAction *simple, | |
| 355 | + | // | |
| 356 | + | // GVariant *parameter, | |
| 357 | + | // gpointer user_data) | |
| 358 | + | // | |
| 359 | + | // { | |
| 360 | + | // exit (0); | |
| 361 | + | // } | |
| 362 | + | // | |
| 363 | + | // static void | |
| 364 | + | // activate_print_string (GSimpleAction *simple, | |
| 365 | + | // | |
| 366 | + | // GVariant *parameter, | |
| 367 | + | // gpointer user_data) | |
| 368 | + | // | |
| 369 | + | // { | |
| 370 | + | // g_print ("%s\n", g_variant_get_string (parameter, NULL)); | |
| 371 | + | // } | |
| 372 | + | // | |
| 373 | + | // static GActionGroup * | |
| 374 | + | // create_action_group (void) | |
| 375 | + | // | |
| 376 | + | // { | |
| 377 | + | // const GActionEntry entries[] = { | |
| 378 | + | // { "quit", activate_quit }, | |
| 379 | + | // { "print-string", activate_print_string, "s" } | |
| 380 | + | // }; | |
| 381 | + | // GSimpleActionGroup *group; | |
| 382 | + | // | |
| 383 | + | // group = g_simple_action_group_new (); | |
| 384 | + | // g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL); | |
| 385 | + | // | |
| 386 | + | // return G_ACTION_GROUP (group); | |
| 387 | + | // } | |
| 388 | + | // | |
| 389 | + | // ]| | |
| 390 | + | func (x *Application) AddActionEntries(EntriesVar uintptr, NEntriesVar int32, UserDataVar uintptr) { | |
| 391 | + | ||
| 392 | + | gio.XGActionMapAddActionEntries(x.GoPointer(), EntriesVar, NEntriesVar, UserDataVar) | |
| 393 | + | ||
| 394 | + | } | |
| 395 | + | ||
| 396 | + | // Looks up the action with the name @action_name in @action_map. | |
| 397 | + | // | |
| 398 | + | // If no such action exists, returns %NULL. | |
| 399 | + | func (x *Application) LookupAction(ActionNameVar string) *gio.ActionBase { | |
| 400 | + | ||
| 401 | + | LookupActionPtr := gio.XGActionMapLookupAction(x.GoPointer(), ActionNameVar) | |
| 402 | + | if LookupActionPtr == 0 { | |
| 403 | + | return nil | |
| 404 | + | } | |
| 405 | + | ||
| 406 | + | gobject.IncreaseRef(LookupActionPtr) | |
| 407 | + | ||
| 408 | + | LookupActionCls := &gio.ActionBase{} | |
| 409 | + | LookupActionCls.Ptr = LookupActionPtr | |
| 410 | + | return LookupActionCls | |
| 411 | + | ||
| 412 | + | } | |
| 413 | + | ||
| 414 | + | // Removes the named action from the action map. | |
| 415 | + | // | |
| 416 | + | // If no action of this name is in the map then nothing happens. | |
| 417 | + | func (x *Application) RemoveAction(ActionNameVar string) { | |
| 418 | + | ||
| 419 | + | gio.XGActionMapRemoveAction(x.GoPointer(), ActionNameVar) | |
| 420 | + | ||
| 421 | + | } | |
| 422 | + | ||
| 423 | + | func init() { | |
| 424 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 425 | + | if err != nil { | |
| 426 | + | panic(err) | |
| 427 | + | } | |
| 428 | + | ||
| 429 | + | core.PuregoSafeRegister(&xNewApplication, lib, "adw_application_new") | |
| 430 | + | ||
| 431 | + | core.PuregoSafeRegister(&xApplicationGetStyleManager, lib, "adw_application_get_style_manager") | |
| 432 | + | ||
| 433 | + | } | |
A v4/adw/adw-avatar.go +364 -0
| @@ -0,0 +1,364 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gdk" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 10 | + | ) | |
| 11 | + | ||
| 12 | + | type AvatarClass struct { | |
| 13 | + | ParentClass uintptr | |
| 14 | + | } | |
| 15 | + | ||
| 16 | + | // A widget displaying an image, with a generated fallback. | |
| 17 | + | // | |
| 18 | + | // <picture> | |
| 19 | + | // | |
| 20 | + | // <source srcset="avatar-dark.png" media="(prefers-color-scheme: dark)"> | |
| 21 | + | // <img src="avatar.png" alt="avatar"> | |
| 22 | + | // | |
| 23 | + | // </picture> | |
| 24 | + | // | |
| 25 | + | // `AdwAvatar` is a widget that shows a round avatar. | |
| 26 | + | // | |
| 27 | + | // `AdwAvatar` generates an avatar with the initials of the | |
| 28 | + | // [property@Avatar:text] on top of a colored background. | |
| 29 | + | // | |
| 30 | + | // The color is picked based on the hash of the [property@Avatar:text]. | |
| 31 | + | // | |
| 32 | + | // If [property@Avatar:show-initials] is set to `FALSE`, | |
| 33 | + | // [property@Avatar:icon-name] or `avatar-default-symbolic` is shown instead of | |
| 34 | + | // the initials. | |
| 35 | + | // | |
| 36 | + | // Use [property@Avatar:custom-image] to set a custom image. | |
| 37 | + | // | |
| 38 | + | // ## CSS nodes | |
| 39 | + | // | |
| 40 | + | // `AdwAvatar` has a single CSS node with name `avatar`. | |
| 41 | + | type Avatar struct { | |
| 42 | + | gtk.Widget | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | func AvatarNewFromInternalPtr(ptr uintptr) *Avatar { | |
| 46 | + | cls := &Avatar{} | |
| 47 | + | cls.Ptr = ptr | |
| 48 | + | return cls | |
| 49 | + | } | |
| 50 | + | ||
| 51 | + | var xNewAvatar func(int32, string, bool) uintptr | |
| 52 | + | ||
| 53 | + | // Creates a new `AdwAvatar`. | |
| 54 | + | func NewAvatar(SizeVar int32, TextVar string, ShowInitialsVar bool) *gtk.Widget { | |
| 55 | + | NewAvatarPtr := xNewAvatar(SizeVar, TextVar, ShowInitialsVar) | |
| 56 | + | if NewAvatarPtr == 0 { | |
| 57 | + | return nil | |
| 58 | + | } | |
| 59 | + | ||
| 60 | + | gobject.IncreaseRef(NewAvatarPtr) | |
| 61 | + | ||
| 62 | + | NewAvatarCls := >k.Widget{} | |
| 63 | + | NewAvatarCls.Ptr = NewAvatarPtr | |
| 64 | + | return NewAvatarCls | |
| 65 | + | } | |
| 66 | + | ||
| 67 | + | var xAvatarDrawToTexture func(uintptr, int32) uintptr | |
| 68 | + | ||
| 69 | + | // Renders @self into a [class@Gdk.Texture] at @scale_factor. | |
| 70 | + | // | |
| 71 | + | // This can be used to export the fallback avatar. | |
| 72 | + | func (x *Avatar) DrawToTexture(ScaleFactorVar int32) *gdk.Texture { | |
| 73 | + | ||
| 74 | + | DrawToTexturePtr := xAvatarDrawToTexture(x.GoPointer(), ScaleFactorVar) | |
| 75 | + | if DrawToTexturePtr == 0 { | |
| 76 | + | return nil | |
| 77 | + | } | |
| 78 | + | ||
| 79 | + | DrawToTextureCls := &gdk.Texture{} | |
| 80 | + | DrawToTextureCls.Ptr = DrawToTexturePtr | |
| 81 | + | return DrawToTextureCls | |
| 82 | + | ||
| 83 | + | } | |
| 84 | + | ||
| 85 | + | var xAvatarGetCustomImage func(uintptr) uintptr | |
| 86 | + | ||
| 87 | + | // Gets the custom image paintable. | |
| 88 | + | func (x *Avatar) GetCustomImage() *gdk.PaintableBase { | |
| 89 | + | ||
| 90 | + | GetCustomImagePtr := xAvatarGetCustomImage(x.GoPointer()) | |
| 91 | + | if GetCustomImagePtr == 0 { | |
| 92 | + | return nil | |
| 93 | + | } | |
| 94 | + | ||
| 95 | + | gobject.IncreaseRef(GetCustomImagePtr) | |
| 96 | + | ||
| 97 | + | GetCustomImageCls := &gdk.PaintableBase{} | |
| 98 | + | GetCustomImageCls.Ptr = GetCustomImagePtr | |
| 99 | + | return GetCustomImageCls | |
| 100 | + | ||
| 101 | + | } | |
| 102 | + | ||
| 103 | + | var xAvatarGetIconName func(uintptr) string | |
| 104 | + | ||
| 105 | + | // Gets the name of an icon to use as a fallback. | |
| 106 | + | func (x *Avatar) GetIconName() string { | |
| 107 | + | ||
| 108 | + | return xAvatarGetIconName(x.GoPointer()) | |
| 109 | + | ||
| 110 | + | } | |
| 111 | + | ||
| 112 | + | var xAvatarGetShowInitials func(uintptr) bool | |
| 113 | + | ||
| 114 | + | // Gets whether initials are used instead of an icon on the fallback avatar. | |
| 115 | + | func (x *Avatar) GetShowInitials() bool { | |
| 116 | + | ||
| 117 | + | return xAvatarGetShowInitials(x.GoPointer()) | |
| 118 | + | ||
| 119 | + | } | |
| 120 | + | ||
| 121 | + | var xAvatarGetSize func(uintptr) int32 | |
| 122 | + | ||
| 123 | + | // Gets the size of the avatar. | |
| 124 | + | func (x *Avatar) GetSize() int32 { | |
| 125 | + | ||
| 126 | + | return xAvatarGetSize(x.GoPointer()) | |
| 127 | + | ||
| 128 | + | } | |
| 129 | + | ||
| 130 | + | var xAvatarGetText func(uintptr) string | |
| 131 | + | ||
| 132 | + | // Gets the text used to generate the fallback initials and color. | |
| 133 | + | func (x *Avatar) GetText() string { | |
| 134 | + | ||
| 135 | + | return xAvatarGetText(x.GoPointer()) | |
| 136 | + | ||
| 137 | + | } | |
| 138 | + | ||
| 139 | + | var xAvatarSetCustomImage func(uintptr, uintptr) | |
| 140 | + | ||
| 141 | + | // Sets the custom image paintable. | |
| 142 | + | // | |
| 143 | + | // Custom image is displayed instead of initials or icon. | |
| 144 | + | func (x *Avatar) SetCustomImage(CustomImageVar gdk.Paintable) { | |
| 145 | + | ||
| 146 | + | xAvatarSetCustomImage(x.GoPointer(), CustomImageVar.GoPointer()) | |
| 147 | + | ||
| 148 | + | } | |
| 149 | + | ||
| 150 | + | var xAvatarSetIconName func(uintptr, string) | |
| 151 | + | ||
| 152 | + | // Sets the name of an icon to use as a fallback. | |
| 153 | + | // | |
| 154 | + | // If no name is set, `avatar-default-symbolic` will be used. | |
| 155 | + | func (x *Avatar) SetIconName(IconNameVar string) { | |
| 156 | + | ||
| 157 | + | xAvatarSetIconName(x.GoPointer(), IconNameVar) | |
| 158 | + | ||
| 159 | + | } | |
| 160 | + | ||
| 161 | + | var xAvatarSetShowInitials func(uintptr, bool) | |
| 162 | + | ||
| 163 | + | // Sets whether to use initials instead of an icon on the fallback avatar. | |
| 164 | + | // | |
| 165 | + | // See [property@Avatar:icon-name] for how to change the fallback icon. | |
| 166 | + | func (x *Avatar) SetShowInitials(ShowInitialsVar bool) { | |
| 167 | + | ||
| 168 | + | xAvatarSetShowInitials(x.GoPointer(), ShowInitialsVar) | |
| 169 | + | ||
| 170 | + | } | |
| 171 | + | ||
| 172 | + | var xAvatarSetSize func(uintptr, int32) | |
| 173 | + | ||
| 174 | + | // Sets the size of the avatar. | |
| 175 | + | func (x *Avatar) SetSize(SizeVar int32) { | |
| 176 | + | ||
| 177 | + | xAvatarSetSize(x.GoPointer(), SizeVar) | |
| 178 | + | ||
| 179 | + | } | |
| 180 | + | ||
| 181 | + | var xAvatarSetText func(uintptr, string) | |
| 182 | + | ||
| 183 | + | // Sets the text used to generate the fallback initials and color. | |
| 184 | + | // | |
| 185 | + | // It's only used to generate the color if [property@Avatar:show-initials] is | |
| 186 | + | // `FALSE`. | |
| 187 | + | func (x *Avatar) SetText(TextVar string) { | |
| 188 | + | ||
| 189 | + | xAvatarSetText(x.GoPointer(), TextVar) | |
| 190 | + | ||
| 191 | + | } | |
| 192 | + | ||
| 193 | + | func (c *Avatar) GoPointer() uintptr { | |
| 194 | + | return c.Ptr | |
| 195 | + | } | |
| 196 | + | ||
| 197 | + | func (c *Avatar) SetGoPointer(ptr uintptr) { | |
| 198 | + | c.Ptr = ptr | |
| 199 | + | } | |
| 200 | + | ||
| 201 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 202 | + | func (x *Avatar) GetAccessibleRole() gtk.AccessibleRole { | |
| 203 | + | ||
| 204 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 205 | + | ||
| 206 | + | } | |
| 207 | + | ||
| 208 | + | // Resets the accessible @property to its default value. | |
| 209 | + | func (x *Avatar) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 210 | + | ||
| 211 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 212 | + | ||
| 213 | + | } | |
| 214 | + | ||
| 215 | + | // Resets the accessible @relation to its default value. | |
| 216 | + | func (x *Avatar) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 217 | + | ||
| 218 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 219 | + | ||
| 220 | + | } | |
| 221 | + | ||
| 222 | + | // Resets the accessible @state to its default value. | |
| 223 | + | func (x *Avatar) ResetState(StateVar gtk.AccessibleState) { | |
| 224 | + | ||
| 225 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 226 | + | ||
| 227 | + | } | |
| 228 | + | ||
| 229 | + | // Updates a list of accessible properties. | |
| 230 | + | // | |
| 231 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 232 | + | // value types of accessible properties. | |
| 233 | + | // | |
| 234 | + | // This function should be called by `GtkWidget` types whenever | |
| 235 | + | // an accessible property change must be communicated to assistive | |
| 236 | + | // technologies. | |
| 237 | + | // | |
| 238 | + | // Example: | |
| 239 | + | // ```c | |
| 240 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 241 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 242 | + | // | |
| 243 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 244 | + | // -1); | |
| 245 | + | // | |
| 246 | + | // ``` | |
| 247 | + | func (x *Avatar) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 248 | + | ||
| 249 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 250 | + | ||
| 251 | + | } | |
| 252 | + | ||
| 253 | + | // Updates an array of accessible properties. | |
| 254 | + | // | |
| 255 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 256 | + | // property change must be communicated to assistive technologies. | |
| 257 | + | // | |
| 258 | + | // This function is meant to be used by language bindings. | |
| 259 | + | func (x *Avatar) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 260 | + | ||
| 261 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 262 | + | ||
| 263 | + | } | |
| 264 | + | ||
| 265 | + | // Updates a list of accessible relations. | |
| 266 | + | // | |
| 267 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 268 | + | // relation change must be communicated to assistive technologies. | |
| 269 | + | // | |
| 270 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 271 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 272 | + | // | |
| 273 | + | // ```c | |
| 274 | + | // gtk_accessible_update_relation (accessible, | |
| 275 | + | // | |
| 276 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 277 | + | // ref1, NULL, | |
| 278 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 279 | + | // ref1, ref2, ref3, NULL, | |
| 280 | + | // -1); | |
| 281 | + | // | |
| 282 | + | // ``` | |
| 283 | + | func (x *Avatar) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 284 | + | ||
| 285 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 286 | + | ||
| 287 | + | } | |
| 288 | + | ||
| 289 | + | // Updates an array of accessible relations. | |
| 290 | + | // | |
| 291 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 292 | + | // relation change must be communicated to assistive technologies. | |
| 293 | + | // | |
| 294 | + | // This function is meant to be used by language bindings. | |
| 295 | + | func (x *Avatar) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 296 | + | ||
| 297 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 298 | + | ||
| 299 | + | } | |
| 300 | + | ||
| 301 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 302 | + | // documentation for the value types of accessible states. | |
| 303 | + | // | |
| 304 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 305 | + | // state change must be communicated to assistive technologies. | |
| 306 | + | // | |
| 307 | + | // Example: | |
| 308 | + | // ```c | |
| 309 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 310 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 311 | + | // | |
| 312 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 313 | + | // -1); | |
| 314 | + | // | |
| 315 | + | // ``` | |
| 316 | + | func (x *Avatar) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 317 | + | ||
| 318 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 319 | + | ||
| 320 | + | } | |
| 321 | + | ||
| 322 | + | // Updates an array of accessible states. | |
| 323 | + | // | |
| 324 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 325 | + | // state change must be communicated to assistive technologies. | |
| 326 | + | // | |
| 327 | + | // This function is meant to be used by language bindings. | |
| 328 | + | func (x *Avatar) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 329 | + | ||
| 330 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 331 | + | ||
| 332 | + | } | |
| 333 | + | ||
| 334 | + | // Gets the ID of the @buildable object. | |
| 335 | + | // | |
| 336 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 337 | + | // of the <object> tag used to construct the @buildable. | |
| 338 | + | func (x *Avatar) GetBuildableId() string { | |
| 339 | + | ||
| 340 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 341 | + | ||
| 342 | + | } | |
| 343 | + | ||
| 344 | + | func init() { | |
| 345 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 346 | + | if err != nil { | |
| 347 | + | panic(err) | |
| 348 | + | } | |
| 349 | + | ||
| 350 | + | core.PuregoSafeRegister(&xNewAvatar, lib, "adw_avatar_new") | |
| 351 | + | ||
| 352 | + | core.PuregoSafeRegister(&xAvatarDrawToTexture, lib, "adw_avatar_draw_to_texture") | |
| 353 | + | core.PuregoSafeRegister(&xAvatarGetCustomImage, lib, "adw_avatar_get_custom_image") | |
| 354 | + | core.PuregoSafeRegister(&xAvatarGetIconName, lib, "adw_avatar_get_icon_name") | |
| 355 | + | core.PuregoSafeRegister(&xAvatarGetShowInitials, lib, "adw_avatar_get_show_initials") | |
| 356 | + | core.PuregoSafeRegister(&xAvatarGetSize, lib, "adw_avatar_get_size") | |
| 357 | + | core.PuregoSafeRegister(&xAvatarGetText, lib, "adw_avatar_get_text") | |
| 358 | + | core.PuregoSafeRegister(&xAvatarSetCustomImage, lib, "adw_avatar_set_custom_image") | |
| 359 | + | core.PuregoSafeRegister(&xAvatarSetIconName, lib, "adw_avatar_set_icon_name") | |
| 360 | + | core.PuregoSafeRegister(&xAvatarSetShowInitials, lib, "adw_avatar_set_show_initials") | |
| 361 | + | core.PuregoSafeRegister(&xAvatarSetSize, lib, "adw_avatar_set_size") | |
| 362 | + | core.PuregoSafeRegister(&xAvatarSetText, lib, "adw_avatar_set_text") | |
| 363 | + | ||
| 364 | + | } | |
A v4/adw/adw-banner.go +412 -0
| @@ -0,0 +1,412 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 10 | + | ) | |
| 11 | + | ||
| 12 | + | type BannerClass struct { | |
| 13 | + | ParentClass uintptr | |
| 14 | + | } | |
| 15 | + | ||
| 16 | + | // A bar with contextual information. | |
| 17 | + | // | |
| 18 | + | // <picture> | |
| 19 | + | // | |
| 20 | + | // <source srcset="banner-dark.png" media="(prefers-color-scheme: dark)"> | |
| 21 | + | // <img src="banner.png" alt="banner"> | |
| 22 | + | // | |
| 23 | + | // </picture> | |
| 24 | + | // | |
| 25 | + | // Banners are hidden by default, use [property@Banner:revealed] to show them. | |
| 26 | + | // | |
| 27 | + | // Banners have a title, set with [property@Banner:title]. Titles can be marked | |
| 28 | + | // up with Pango markup, use [property@Banner:use-markup] to enable it. | |
| 29 | + | // | |
| 30 | + | // The title will be shown centered or left-aligned depending on available | |
| 31 | + | // space. | |
| 32 | + | // | |
| 33 | + | // Banners can optionally have a button with text on it, set through | |
| 34 | + | // [property@Banner:button-label]. The button can be used with a `GAction`, | |
| 35 | + | // or with the [signal@Banner::button-clicked] signal. | |
| 36 | + | // | |
| 37 | + | // ## CSS nodes | |
| 38 | + | // | |
| 39 | + | // `AdwBanner` has a main CSS node with the name `banner`. | |
| 40 | + | type Banner struct { | |
| 41 | + | gtk.Widget | |
| 42 | + | } | |
| 43 | + | ||
| 44 | + | func BannerNewFromInternalPtr(ptr uintptr) *Banner { | |
| 45 | + | cls := &Banner{} | |
| 46 | + | cls.Ptr = ptr | |
| 47 | + | return cls | |
| 48 | + | } | |
| 49 | + | ||
| 50 | + | var xNewBanner func(string) uintptr | |
| 51 | + | ||
| 52 | + | // Creates a new `AdwBanner`. | |
| 53 | + | func NewBanner(TitleVar string) *gtk.Widget { | |
| 54 | + | NewBannerPtr := xNewBanner(TitleVar) | |
| 55 | + | if NewBannerPtr == 0 { | |
| 56 | + | return nil | |
| 57 | + | } | |
| 58 | + | ||
| 59 | + | gobject.IncreaseRef(NewBannerPtr) | |
| 60 | + | ||
| 61 | + | NewBannerCls := >k.Widget{} | |
| 62 | + | NewBannerCls.Ptr = NewBannerPtr | |
| 63 | + | return NewBannerCls | |
| 64 | + | } | |
| 65 | + | ||
| 66 | + | var xBannerGetButtonLabel func(uintptr) string | |
| 67 | + | ||
| 68 | + | // Gets the button label for @self. | |
| 69 | + | func (x *Banner) GetButtonLabel() string { | |
| 70 | + | ||
| 71 | + | return xBannerGetButtonLabel(x.GoPointer()) | |
| 72 | + | ||
| 73 | + | } | |
| 74 | + | ||
| 75 | + | var xBannerGetRevealed func(uintptr) bool | |
| 76 | + | ||
| 77 | + | // Gets if a banner is revealed | |
| 78 | + | func (x *Banner) GetRevealed() bool { | |
| 79 | + | ||
| 80 | + | return xBannerGetRevealed(x.GoPointer()) | |
| 81 | + | ||
| 82 | + | } | |
| 83 | + | ||
| 84 | + | var xBannerGetTitle func(uintptr) string | |
| 85 | + | ||
| 86 | + | // Gets the title for @self. | |
| 87 | + | func (x *Banner) GetTitle() string { | |
| 88 | + | ||
| 89 | + | return xBannerGetTitle(x.GoPointer()) | |
| 90 | + | ||
| 91 | + | } | |
| 92 | + | ||
| 93 | + | var xBannerGetUseMarkup func(uintptr) bool | |
| 94 | + | ||
| 95 | + | // Gets whether to use Pango markup for the banner title. | |
| 96 | + | func (x *Banner) GetUseMarkup() bool { | |
| 97 | + | ||
| 98 | + | return xBannerGetUseMarkup(x.GoPointer()) | |
| 99 | + | ||
| 100 | + | } | |
| 101 | + | ||
| 102 | + | var xBannerSetButtonLabel func(uintptr, string) | |
| 103 | + | ||
| 104 | + | // Sets the button label for @self. | |
| 105 | + | // | |
| 106 | + | // If set to `""` or `NULL`, the button won't be shown. | |
| 107 | + | // | |
| 108 | + | // The button can be used with a `GAction`, or with the | |
| 109 | + | // [signal@Banner::button-clicked] signal. | |
| 110 | + | func (x *Banner) SetButtonLabel(LabelVar string) { | |
| 111 | + | ||
| 112 | + | xBannerSetButtonLabel(x.GoPointer(), LabelVar) | |
| 113 | + | ||
| 114 | + | } | |
| 115 | + | ||
| 116 | + | var xBannerSetRevealed func(uintptr, bool) | |
| 117 | + | ||
| 118 | + | // Sets whether a banner should be revealed | |
| 119 | + | func (x *Banner) SetRevealed(RevealedVar bool) { | |
| 120 | + | ||
| 121 | + | xBannerSetRevealed(x.GoPointer(), RevealedVar) | |
| 122 | + | ||
| 123 | + | } | |
| 124 | + | ||
| 125 | + | var xBannerSetTitle func(uintptr, string) | |
| 126 | + | ||
| 127 | + | // Sets the title for this banner. | |
| 128 | + | // | |
| 129 | + | // See also: [property@Banner:use-markup]. | |
| 130 | + | func (x *Banner) SetTitle(TitleVar string) { | |
| 131 | + | ||
| 132 | + | xBannerSetTitle(x.GoPointer(), TitleVar) | |
| 133 | + | ||
| 134 | + | } | |
| 135 | + | ||
| 136 | + | var xBannerSetUseMarkup func(uintptr, bool) | |
| 137 | + | ||
| 138 | + | // Sets whether to use Pango markup for the banner title. | |
| 139 | + | // | |
| 140 | + | // See also [func@Pango.parse_markup]. | |
| 141 | + | func (x *Banner) SetUseMarkup(UseMarkupVar bool) { | |
| 142 | + | ||
| 143 | + | xBannerSetUseMarkup(x.GoPointer(), UseMarkupVar) | |
| 144 | + | ||
| 145 | + | } | |
| 146 | + | ||
| 147 | + | func (c *Banner) GoPointer() uintptr { | |
| 148 | + | return c.Ptr | |
| 149 | + | } | |
| 150 | + | ||
| 151 | + | func (c *Banner) SetGoPointer(ptr uintptr) { | |
| 152 | + | c.Ptr = ptr | |
| 153 | + | } | |
| 154 | + | ||
| 155 | + | // This signal is emitted after the action button has been clicked. | |
| 156 | + | // | |
| 157 | + | // It can be used as an alternative to setting an action. | |
| 158 | + | func (x *Banner) ConnectButtonClicked(cb func(Banner)) { | |
| 159 | + | fcb := func(clsPtr uintptr) { | |
| 160 | + | fa := Banner{} | |
| 161 | + | fa.Ptr = clsPtr | |
| 162 | + | ||
| 163 | + | cb(fa) | |
| 164 | + | ||
| 165 | + | } | |
| 166 | + | gobject.ObjectConnect(x.GoPointer(), "signal::button-clicked", purego.NewCallback(fcb)) | |
| 167 | + | } | |
| 168 | + | ||
| 169 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 170 | + | func (x *Banner) GetAccessibleRole() gtk.AccessibleRole { | |
| 171 | + | ||
| 172 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 173 | + | ||
| 174 | + | } | |
| 175 | + | ||
| 176 | + | // Resets the accessible @property to its default value. | |
| 177 | + | func (x *Banner) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 178 | + | ||
| 179 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 180 | + | ||
| 181 | + | } | |
| 182 | + | ||
| 183 | + | // Resets the accessible @relation to its default value. | |
| 184 | + | func (x *Banner) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 185 | + | ||
| 186 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 187 | + | ||
| 188 | + | } | |
| 189 | + | ||
| 190 | + | // Resets the accessible @state to its default value. | |
| 191 | + | func (x *Banner) ResetState(StateVar gtk.AccessibleState) { | |
| 192 | + | ||
| 193 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 194 | + | ||
| 195 | + | } | |
| 196 | + | ||
| 197 | + | // Updates a list of accessible properties. | |
| 198 | + | // | |
| 199 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 200 | + | // value types of accessible properties. | |
| 201 | + | // | |
| 202 | + | // This function should be called by `GtkWidget` types whenever | |
| 203 | + | // an accessible property change must be communicated to assistive | |
| 204 | + | // technologies. | |
| 205 | + | // | |
| 206 | + | // Example: | |
| 207 | + | // ```c | |
| 208 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 209 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 210 | + | // | |
| 211 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 212 | + | // -1); | |
| 213 | + | // | |
| 214 | + | // ``` | |
| 215 | + | func (x *Banner) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 216 | + | ||
| 217 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 218 | + | ||
| 219 | + | } | |
| 220 | + | ||
| 221 | + | // Updates an array of accessible properties. | |
| 222 | + | // | |
| 223 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 224 | + | // property change must be communicated to assistive technologies. | |
| 225 | + | // | |
| 226 | + | // This function is meant to be used by language bindings. | |
| 227 | + | func (x *Banner) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 228 | + | ||
| 229 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 230 | + | ||
| 231 | + | } | |
| 232 | + | ||
| 233 | + | // Updates a list of accessible relations. | |
| 234 | + | // | |
| 235 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 236 | + | // relation change must be communicated to assistive technologies. | |
| 237 | + | // | |
| 238 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 239 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 240 | + | // | |
| 241 | + | // ```c | |
| 242 | + | // gtk_accessible_update_relation (accessible, | |
| 243 | + | // | |
| 244 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 245 | + | // ref1, NULL, | |
| 246 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 247 | + | // ref1, ref2, ref3, NULL, | |
| 248 | + | // -1); | |
| 249 | + | // | |
| 250 | + | // ``` | |
| 251 | + | func (x *Banner) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 252 | + | ||
| 253 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 254 | + | ||
| 255 | + | } | |
| 256 | + | ||
| 257 | + | // Updates an array of accessible relations. | |
| 258 | + | // | |
| 259 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 260 | + | // relation change must be communicated to assistive technologies. | |
| 261 | + | // | |
| 262 | + | // This function is meant to be used by language bindings. | |
| 263 | + | func (x *Banner) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 264 | + | ||
| 265 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 266 | + | ||
| 267 | + | } | |
| 268 | + | ||
| 269 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 270 | + | // documentation for the value types of accessible states. | |
| 271 | + | // | |
| 272 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 273 | + | // state change must be communicated to assistive technologies. | |
| 274 | + | // | |
| 275 | + | // Example: | |
| 276 | + | // ```c | |
| 277 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 278 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 279 | + | // | |
| 280 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 281 | + | // -1); | |
| 282 | + | // | |
| 283 | + | // ``` | |
| 284 | + | func (x *Banner) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 285 | + | ||
| 286 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 287 | + | ||
| 288 | + | } | |
| 289 | + | ||
| 290 | + | // Updates an array of accessible states. | |
| 291 | + | // | |
| 292 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 293 | + | // state change must be communicated to assistive technologies. | |
| 294 | + | // | |
| 295 | + | // This function is meant to be used by language bindings. | |
| 296 | + | func (x *Banner) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 297 | + | ||
| 298 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 299 | + | ||
| 300 | + | } | |
| 301 | + | ||
| 302 | + | // Gets the action name for @actionable. | |
| 303 | + | func (x *Banner) GetActionName() string { | |
| 304 | + | ||
| 305 | + | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 306 | + | ||
| 307 | + | } | |
| 308 | + | ||
| 309 | + | // Gets the current target value of @actionable. | |
| 310 | + | func (x *Banner) GetActionTargetValue() *glib.Variant { | |
| 311 | + | ||
| 312 | + | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 313 | + | ||
| 314 | + | } | |
| 315 | + | ||
| 316 | + | // Specifies the name of the action with which this widget should be | |
| 317 | + | // associated. | |
| 318 | + | // | |
| 319 | + | // If @action_name is %NULL then the widget will be unassociated from | |
| 320 | + | // any previous action. | |
| 321 | + | // | |
| 322 | + | // Usually this function is used when the widget is located (or will be | |
| 323 | + | // located) within the hierarchy of a `GtkApplicationWindow`. | |
| 324 | + | // | |
| 325 | + | // Names are of the form “win.save” or “app.quit” for actions on the | |
| 326 | + | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 327 | + | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 328 | + | // associated with the window. | |
| 329 | + | func (x *Banner) SetActionName(ActionNameVar string) { | |
| 330 | + | ||
| 331 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 332 | + | ||
| 333 | + | } | |
| 334 | + | ||
| 335 | + | // Sets the target of an actionable widget. | |
| 336 | + | // | |
| 337 | + | // This is a convenience function that calls [ctor@GLib.Variant.new] for | |
| 338 | + | // @format_string and uses the result to call | |
| 339 | + | // [method@Gtk.Actionable.set_action_target_value]. | |
| 340 | + | // | |
| 341 | + | // If you are setting a string-valued target and want to set | |
| 342 | + | // the action name at the same time, you can use | |
| 343 | + | // [method@Gtk.Actionable.set_detailed_action_name]. | |
| 344 | + | func (x *Banner) SetActionTarget(FormatStringVar string, varArgs ...interface{}) { | |
| 345 | + | ||
| 346 | + | gtk.XGtkActionableSetActionTarget(x.GoPointer(), FormatStringVar, varArgs...) | |
| 347 | + | ||
| 348 | + | } | |
| 349 | + | ||
| 350 | + | // Sets the target value of an actionable widget. | |
| 351 | + | // | |
| 352 | + | // If @target_value is %NULL then the target value is unset. | |
| 353 | + | // | |
| 354 | + | // The target value has two purposes. First, it is used as the parameter | |
| 355 | + | // to activation of the action associated with the `GtkActionable` widget. | |
| 356 | + | // Second, it is used to determine if the widget should be rendered as | |
| 357 | + | // “active” — the widget is active if the state is equal to the given target. | |
| 358 | + | // | |
| 359 | + | // Consider the example of associating a set of buttons with a [iface@Gio.Action] | |
| 360 | + | // with string state in a typical “radio button” situation. Each button | |
| 361 | + | // will be associated with the same action, but with a different target | |
| 362 | + | // value for that action. Clicking on a particular button will activate | |
| 363 | + | // the action with the target of that button, which will typically cause | |
| 364 | + | // the action’s state to change to that value. Since the action’s state | |
| 365 | + | // is now equal to the target value of the button, the button will now | |
| 366 | + | // be rendered as active (and the other buttons, with different targets, | |
| 367 | + | // rendered inactive). | |
| 368 | + | func (x *Banner) SetActionTargetValue(TargetValueVar *glib.Variant) { | |
| 369 | + | ||
| 370 | + | gtk.XGtkActionableSetActionTargetValue(x.GoPointer(), TargetValueVar) | |
| 371 | + | ||
| 372 | + | } | |
| 373 | + | ||
| 374 | + | // Sets the action-name and associated string target value of an | |
| 375 | + | // actionable widget. | |
| 376 | + | // | |
| 377 | + | // @detailed_action_name is a string in the format accepted by | |
| 378 | + | // [func@Gio.Action.parse_detailed_name]. | |
| 379 | + | func (x *Banner) SetDetailedActionName(DetailedActionNameVar string) { | |
| 380 | + | ||
| 381 | + | gtk.XGtkActionableSetDetailedActionName(x.GoPointer(), DetailedActionNameVar) | |
| 382 | + | ||
| 383 | + | } | |
| 384 | + | ||
| 385 | + | // Gets the ID of the @buildable object. | |
| 386 | + | // | |
| 387 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 388 | + | // of the <object> tag used to construct the @buildable. | |
| 389 | + | func (x *Banner) GetBuildableId() string { | |
| 390 | + | ||
| 391 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 392 | + | ||
| 393 | + | } | |
| 394 | + | ||
| 395 | + | func init() { | |
| 396 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 397 | + | if err != nil { | |
| 398 | + | panic(err) | |
| 399 | + | } | |
| 400 | + | ||
| 401 | + | core.PuregoSafeRegister(&xNewBanner, lib, "adw_banner_new") | |
| 402 | + | ||
| 403 | + | core.PuregoSafeRegister(&xBannerGetButtonLabel, lib, "adw_banner_get_button_label") | |
| 404 | + | core.PuregoSafeRegister(&xBannerGetRevealed, lib, "adw_banner_get_revealed") | |
| 405 | + | core.PuregoSafeRegister(&xBannerGetTitle, lib, "adw_banner_get_title") | |
| 406 | + | core.PuregoSafeRegister(&xBannerGetUseMarkup, lib, "adw_banner_get_use_markup") | |
| 407 | + | core.PuregoSafeRegister(&xBannerSetButtonLabel, lib, "adw_banner_set_button_label") | |
| 408 | + | core.PuregoSafeRegister(&xBannerSetRevealed, lib, "adw_banner_set_revealed") | |
| 409 | + | core.PuregoSafeRegister(&xBannerSetTitle, lib, "adw_banner_set_title") | |
| 410 | + | core.PuregoSafeRegister(&xBannerSetUseMarkup, lib, "adw_banner_set_use_markup") | |
| 411 | + | ||
| 412 | + | } | |
A v4/adw/adw-bin.go +244 -0
| @@ -0,0 +1,244 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | type BinClass struct { | |
| 12 | + | ParentClass uintptr | |
| 13 | + | } | |
| 14 | + | ||
| 15 | + | // A widget with one child. | |
| 16 | + | // | |
| 17 | + | // <picture> | |
| 18 | + | // | |
| 19 | + | // <source srcset="bin-dark.png" media="(prefers-color-scheme: dark)"> | |
| 20 | + | // <img src="bin.png" alt="bin"> | |
| 21 | + | // | |
| 22 | + | // </picture> | |
| 23 | + | // | |
| 24 | + | // The `AdwBin` widget has only one child, set with the [property@Bin:child] | |
| 25 | + | // property. | |
| 26 | + | // | |
| 27 | + | // It is useful for deriving subclasses, since it provides common code needed | |
| 28 | + | // for handling a single child widget. | |
| 29 | + | type Bin struct { | |
| 30 | + | gtk.Widget | |
| 31 | + | } | |
| 32 | + | ||
| 33 | + | func BinNewFromInternalPtr(ptr uintptr) *Bin { | |
| 34 | + | cls := &Bin{} | |
| 35 | + | cls.Ptr = ptr | |
| 36 | + | return cls | |
| 37 | + | } | |
| 38 | + | ||
| 39 | + | var xNewBin func() uintptr | |
| 40 | + | ||
| 41 | + | // Creates a new `AdwBin`. | |
| 42 | + | func NewBin() *gtk.Widget { | |
| 43 | + | NewBinPtr := xNewBin() | |
| 44 | + | if NewBinPtr == 0 { | |
| 45 | + | return nil | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | gobject.IncreaseRef(NewBinPtr) | |
| 49 | + | ||
| 50 | + | NewBinCls := >k.Widget{} | |
| 51 | + | NewBinCls.Ptr = NewBinPtr | |
| 52 | + | return NewBinCls | |
| 53 | + | } | |
| 54 | + | ||
| 55 | + | var xBinGetChild func(uintptr) uintptr | |
| 56 | + | ||
| 57 | + | // Gets the child widget of @self. | |
| 58 | + | func (x *Bin) GetChild() *gtk.Widget { | |
| 59 | + | ||
| 60 | + | GetChildPtr := xBinGetChild(x.GoPointer()) | |
| 61 | + | if GetChildPtr == 0 { | |
| 62 | + | return nil | |
| 63 | + | } | |
| 64 | + | ||
| 65 | + | gobject.IncreaseRef(GetChildPtr) | |
| 66 | + | ||
| 67 | + | GetChildCls := >k.Widget{} | |
| 68 | + | GetChildCls.Ptr = GetChildPtr | |
| 69 | + | return GetChildCls | |
| 70 | + | ||
| 71 | + | } | |
| 72 | + | ||
| 73 | + | var xBinSetChild func(uintptr, uintptr) | |
| 74 | + | ||
| 75 | + | // Sets the child widget of @self. | |
| 76 | + | func (x *Bin) SetChild(ChildVar *gtk.Widget) { | |
| 77 | + | ||
| 78 | + | xBinSetChild(x.GoPointer(), ChildVar.GoPointer()) | |
| 79 | + | ||
| 80 | + | } | |
| 81 | + | ||
| 82 | + | func (c *Bin) GoPointer() uintptr { | |
| 83 | + | return c.Ptr | |
| 84 | + | } | |
| 85 | + | ||
| 86 | + | func (c *Bin) SetGoPointer(ptr uintptr) { | |
| 87 | + | c.Ptr = ptr | |
| 88 | + | } | |
| 89 | + | ||
| 90 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 91 | + | func (x *Bin) GetAccessibleRole() gtk.AccessibleRole { | |
| 92 | + | ||
| 93 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 94 | + | ||
| 95 | + | } | |
| 96 | + | ||
| 97 | + | // Resets the accessible @property to its default value. | |
| 98 | + | func (x *Bin) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 99 | + | ||
| 100 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 101 | + | ||
| 102 | + | } | |
| 103 | + | ||
| 104 | + | // Resets the accessible @relation to its default value. | |
| 105 | + | func (x *Bin) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 106 | + | ||
| 107 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 108 | + | ||
| 109 | + | } | |
| 110 | + | ||
| 111 | + | // Resets the accessible @state to its default value. | |
| 112 | + | func (x *Bin) ResetState(StateVar gtk.AccessibleState) { | |
| 113 | + | ||
| 114 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 115 | + | ||
| 116 | + | } | |
| 117 | + | ||
| 118 | + | // Updates a list of accessible properties. | |
| 119 | + | // | |
| 120 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 121 | + | // value types of accessible properties. | |
| 122 | + | // | |
| 123 | + | // This function should be called by `GtkWidget` types whenever | |
| 124 | + | // an accessible property change must be communicated to assistive | |
| 125 | + | // technologies. | |
| 126 | + | // | |
| 127 | + | // Example: | |
| 128 | + | // ```c | |
| 129 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 130 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 131 | + | // | |
| 132 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 133 | + | // -1); | |
| 134 | + | // | |
| 135 | + | // ``` | |
| 136 | + | func (x *Bin) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 137 | + | ||
| 138 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 139 | + | ||
| 140 | + | } | |
| 141 | + | ||
| 142 | + | // Updates an array of accessible properties. | |
| 143 | + | // | |
| 144 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 145 | + | // property change must be communicated to assistive technologies. | |
| 146 | + | // | |
| 147 | + | // This function is meant to be used by language bindings. | |
| 148 | + | func (x *Bin) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 149 | + | ||
| 150 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 151 | + | ||
| 152 | + | } | |
| 153 | + | ||
| 154 | + | // Updates a list of accessible relations. | |
| 155 | + | // | |
| 156 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 157 | + | // relation change must be communicated to assistive technologies. | |
| 158 | + | // | |
| 159 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 160 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 161 | + | // | |
| 162 | + | // ```c | |
| 163 | + | // gtk_accessible_update_relation (accessible, | |
| 164 | + | // | |
| 165 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 166 | + | // ref1, NULL, | |
| 167 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 168 | + | // ref1, ref2, ref3, NULL, | |
| 169 | + | // -1); | |
| 170 | + | // | |
| 171 | + | // ``` | |
| 172 | + | func (x *Bin) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 173 | + | ||
| 174 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 175 | + | ||
| 176 | + | } | |
| 177 | + | ||
| 178 | + | // Updates an array of accessible relations. | |
| 179 | + | // | |
| 180 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 181 | + | // relation change must be communicated to assistive technologies. | |
| 182 | + | // | |
| 183 | + | // This function is meant to be used by language bindings. | |
| 184 | + | func (x *Bin) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 185 | + | ||
| 186 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 187 | + | ||
| 188 | + | } | |
| 189 | + | ||
| 190 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 191 | + | // documentation for the value types of accessible states. | |
| 192 | + | // | |
| 193 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 194 | + | // state change must be communicated to assistive technologies. | |
| 195 | + | // | |
| 196 | + | // Example: | |
| 197 | + | // ```c | |
| 198 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 199 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 200 | + | // | |
| 201 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 202 | + | // -1); | |
| 203 | + | // | |
| 204 | + | // ``` | |
| 205 | + | func (x *Bin) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 206 | + | ||
| 207 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 208 | + | ||
| 209 | + | } | |
| 210 | + | ||
| 211 | + | // Updates an array of accessible states. | |
| 212 | + | // | |
| 213 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 214 | + | // state change must be communicated to assistive technologies. | |
| 215 | + | // | |
| 216 | + | // This function is meant to be used by language bindings. | |
| 217 | + | func (x *Bin) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 218 | + | ||
| 219 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 220 | + | ||
| 221 | + | } | |
| 222 | + | ||
| 223 | + | // Gets the ID of the @buildable object. | |
| 224 | + | // | |
| 225 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 226 | + | // of the <object> tag used to construct the @buildable. | |
| 227 | + | func (x *Bin) GetBuildableId() string { | |
| 228 | + | ||
| 229 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 230 | + | ||
| 231 | + | } | |
| 232 | + | ||
| 233 | + | func init() { | |
| 234 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 235 | + | if err != nil { | |
| 236 | + | panic(err) | |
| 237 | + | } | |
| 238 | + | ||
| 239 | + | core.PuregoSafeRegister(&xNewBin, lib, "adw_bin_new") | |
| 240 | + | ||
| 241 | + | core.PuregoSafeRegister(&xBinGetChild, lib, "adw_bin_get_child") | |
| 242 | + | core.PuregoSafeRegister(&xBinSetChild, lib, "adw_bin_set_child") | |
| 243 | + | ||
| 244 | + | } | |
A v4/adw/adw-button-content.go +317 -0
| @@ -0,0 +1,317 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | type ButtonContentClass struct { | |
| 12 | + | ParentClass uintptr | |
| 13 | + | } | |
| 14 | + | ||
| 15 | + | // A helper widget for creating buttons. | |
| 16 | + | // | |
| 17 | + | // <picture> | |
| 18 | + | // | |
| 19 | + | // <source srcset="button-content-dark.png" media="(prefers-color-scheme: dark)"> | |
| 20 | + | // <img src="button-content.png" alt="button-content"> | |
| 21 | + | // | |
| 22 | + | // </picture> | |
| 23 | + | // | |
| 24 | + | // `AdwButtonContent` is a box-like widget with an icon and a label. | |
| 25 | + | // | |
| 26 | + | // It's intended to be used as a direct child of [class@Gtk.Button], | |
| 27 | + | // [class@Gtk.MenuButton] or [class@SplitButton], when they need to have both an | |
| 28 | + | // icon and a label, as follows: | |
| 29 | + | // | |
| 30 | + | // ```xml | |
| 31 | + | // <object class="GtkButton"> | |
| 32 | + | // | |
| 33 | + | // <property name="child"> | |
| 34 | + | // <object class="AdwButtonContent"> | |
| 35 | + | // <property name="icon-name">document-open-symbolic</property> | |
| 36 | + | // <property name="label" translatable="yes">_Open</property> | |
| 37 | + | // <property name="use-underline">True</property> | |
| 38 | + | // </object> | |
| 39 | + | // </property> | |
| 40 | + | // | |
| 41 | + | // </object> | |
| 42 | + | // ``` | |
| 43 | + | // | |
| 44 | + | // `AdwButtonContent` handles style classes and connecting the mnemonic to the | |
| 45 | + | // button automatically. | |
| 46 | + | // | |
| 47 | + | // ## CSS nodes | |
| 48 | + | // | |
| 49 | + | // ``` | |
| 50 | + | // buttoncontent | |
| 51 | + | // ├── image | |
| 52 | + | // ╰── label | |
| 53 | + | // ``` | |
| 54 | + | // | |
| 55 | + | // `AdwButtonContent`'s CSS node is called `buttoncontent`. It contains the | |
| 56 | + | // subnodes `image` and `label`. | |
| 57 | + | // | |
| 58 | + | // When inside a `GtkButton` or `AdwSplitButton`, the button will receive the | |
| 59 | + | // `.image-text-button` style class. When inside a `GtkMenuButton`, the | |
| 60 | + | // internal `GtkButton` will receive it instead. | |
| 61 | + | // | |
| 62 | + | // ## Accessibility | |
| 63 | + | // | |
| 64 | + | // `AdwButtonContent` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role. | |
| 65 | + | type ButtonContent struct { | |
| 66 | + | gtk.Widget | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | func ButtonContentNewFromInternalPtr(ptr uintptr) *ButtonContent { | |
| 70 | + | cls := &ButtonContent{} | |
| 71 | + | cls.Ptr = ptr | |
| 72 | + | return cls | |
| 73 | + | } | |
| 74 | + | ||
| 75 | + | var xNewButtonContent func() uintptr | |
| 76 | + | ||
| 77 | + | // Creates a new `AdwButtonContent`. | |
| 78 | + | func NewButtonContent() *gtk.Widget { | |
| 79 | + | NewButtonContentPtr := xNewButtonContent() | |
| 80 | + | if NewButtonContentPtr == 0 { | |
| 81 | + | return nil | |
| 82 | + | } | |
| 83 | + | ||
| 84 | + | gobject.IncreaseRef(NewButtonContentPtr) | |
| 85 | + | ||
| 86 | + | NewButtonContentCls := >k.Widget{} | |
| 87 | + | NewButtonContentCls.Ptr = NewButtonContentPtr | |
| 88 | + | return NewButtonContentCls | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | var xButtonContentGetIconName func(uintptr) string | |
| 92 | + | ||
| 93 | + | // Gets the name of the displayed icon. | |
| 94 | + | func (x *ButtonContent) GetIconName() string { | |
| 95 | + | ||
| 96 | + | return xButtonContentGetIconName(x.GoPointer()) | |
| 97 | + | ||
| 98 | + | } | |
| 99 | + | ||
| 100 | + | var xButtonContentGetLabel func(uintptr) string | |
| 101 | + | ||
| 102 | + | // Gets the displayed label. | |
| 103 | + | func (x *ButtonContent) GetLabel() string { | |
| 104 | + | ||
| 105 | + | return xButtonContentGetLabel(x.GoPointer()) | |
| 106 | + | ||
| 107 | + | } | |
| 108 | + | ||
| 109 | + | var xButtonContentGetUseUnderline func(uintptr) bool | |
| 110 | + | ||
| 111 | + | // Gets whether an underline in the text indicates a mnemonic. | |
| 112 | + | func (x *ButtonContent) GetUseUnderline() bool { | |
| 113 | + | ||
| 114 | + | return xButtonContentGetUseUnderline(x.GoPointer()) | |
| 115 | + | ||
| 116 | + | } | |
| 117 | + | ||
| 118 | + | var xButtonContentSetIconName func(uintptr, string) | |
| 119 | + | ||
| 120 | + | // Sets the name of the displayed icon. | |
| 121 | + | // | |
| 122 | + | // If empty, the icon is not shown. | |
| 123 | + | func (x *ButtonContent) SetIconName(IconNameVar string) { | |
| 124 | + | ||
| 125 | + | xButtonContentSetIconName(x.GoPointer(), IconNameVar) | |
| 126 | + | ||
| 127 | + | } | |
| 128 | + | ||
| 129 | + | var xButtonContentSetLabel func(uintptr, string) | |
| 130 | + | ||
| 131 | + | // Sets the displayed label. | |
| 132 | + | func (x *ButtonContent) SetLabel(LabelVar string) { | |
| 133 | + | ||
| 134 | + | xButtonContentSetLabel(x.GoPointer(), LabelVar) | |
| 135 | + | ||
| 136 | + | } | |
| 137 | + | ||
| 138 | + | var xButtonContentSetUseUnderline func(uintptr, bool) | |
| 139 | + | ||
| 140 | + | // Sets whether an underline in the text indicates a mnemonic. | |
| 141 | + | // | |
| 142 | + | // The mnemonic can be used to activate the parent button. | |
| 143 | + | // | |
| 144 | + | // See [property@ButtonContent:label]. | |
| 145 | + | func (x *ButtonContent) SetUseUnderline(UseUnderlineVar bool) { | |
| 146 | + | ||
| 147 | + | xButtonContentSetUseUnderline(x.GoPointer(), UseUnderlineVar) | |
| 148 | + | ||
| 149 | + | } | |
| 150 | + | ||
| 151 | + | func (c *ButtonContent) GoPointer() uintptr { | |
| 152 | + | return c.Ptr | |
| 153 | + | } | |
| 154 | + | ||
| 155 | + | func (c *ButtonContent) SetGoPointer(ptr uintptr) { | |
| 156 | + | c.Ptr = ptr | |
| 157 | + | } | |
| 158 | + | ||
| 159 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 160 | + | func (x *ButtonContent) GetAccessibleRole() gtk.AccessibleRole { | |
| 161 | + | ||
| 162 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 163 | + | ||
| 164 | + | } | |
| 165 | + | ||
| 166 | + | // Resets the accessible @property to its default value. | |
| 167 | + | func (x *ButtonContent) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 168 | + | ||
| 169 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 170 | + | ||
| 171 | + | } | |
| 172 | + | ||
| 173 | + | // Resets the accessible @relation to its default value. | |
| 174 | + | func (x *ButtonContent) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 175 | + | ||
| 176 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 177 | + | ||
| 178 | + | } | |
| 179 | + | ||
| 180 | + | // Resets the accessible @state to its default value. | |
| 181 | + | func (x *ButtonContent) ResetState(StateVar gtk.AccessibleState) { | |
| 182 | + | ||
| 183 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 184 | + | ||
| 185 | + | } | |
| 186 | + | ||
| 187 | + | // Updates a list of accessible properties. | |
| 188 | + | // | |
| 189 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 190 | + | // value types of accessible properties. | |
| 191 | + | // | |
| 192 | + | // This function should be called by `GtkWidget` types whenever | |
| 193 | + | // an accessible property change must be communicated to assistive | |
| 194 | + | // technologies. | |
| 195 | + | // | |
| 196 | + | // Example: | |
| 197 | + | // ```c | |
| 198 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 199 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 200 | + | // | |
| 201 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 202 | + | // -1); | |
| 203 | + | // | |
| 204 | + | // ``` | |
| 205 | + | func (x *ButtonContent) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 206 | + | ||
| 207 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 208 | + | ||
| 209 | + | } | |
| 210 | + | ||
| 211 | + | // Updates an array of accessible properties. | |
| 212 | + | // | |
| 213 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 214 | + | // property change must be communicated to assistive technologies. | |
| 215 | + | // | |
| 216 | + | // This function is meant to be used by language bindings. | |
| 217 | + | func (x *ButtonContent) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 218 | + | ||
| 219 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 220 | + | ||
| 221 | + | } | |
| 222 | + | ||
| 223 | + | // Updates a list of accessible relations. | |
| 224 | + | // | |
| 225 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 226 | + | // relation change must be communicated to assistive technologies. | |
| 227 | + | // | |
| 228 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 229 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 230 | + | // | |
| 231 | + | // ```c | |
| 232 | + | // gtk_accessible_update_relation (accessible, | |
| 233 | + | // | |
| 234 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 235 | + | // ref1, NULL, | |
| 236 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 237 | + | // ref1, ref2, ref3, NULL, | |
| 238 | + | // -1); | |
| 239 | + | // | |
| 240 | + | // ``` | |
| 241 | + | func (x *ButtonContent) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 242 | + | ||
| 243 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 244 | + | ||
| 245 | + | } | |
| 246 | + | ||
| 247 | + | // Updates an array of accessible relations. | |
| 248 | + | // | |
| 249 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 250 | + | // relation change must be communicated to assistive technologies. | |
| 251 | + | // | |
| 252 | + | // This function is meant to be used by language bindings. | |
| 253 | + | func (x *ButtonContent) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 254 | + | ||
| 255 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 256 | + | ||
| 257 | + | } | |
| 258 | + | ||
| 259 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 260 | + | // documentation for the value types of accessible states. | |
| 261 | + | // | |
| 262 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 263 | + | // state change must be communicated to assistive technologies. | |
| 264 | + | // | |
| 265 | + | // Example: | |
| 266 | + | // ```c | |
| 267 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 268 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 269 | + | // | |
| 270 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 271 | + | // -1); | |
| 272 | + | // | |
| 273 | + | // ``` | |
| 274 | + | func (x *ButtonContent) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 275 | + | ||
| 276 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 277 | + | ||
| 278 | + | } | |
| 279 | + | ||
| 280 | + | // Updates an array of accessible states. | |
| 281 | + | // | |
| 282 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 283 | + | // state change must be communicated to assistive technologies. | |
| 284 | + | // | |
| 285 | + | // This function is meant to be used by language bindings. | |
| 286 | + | func (x *ButtonContent) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 287 | + | ||
| 288 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 289 | + | ||
| 290 | + | } | |
| 291 | + | ||
| 292 | + | // Gets the ID of the @buildable object. | |
| 293 | + | // | |
| 294 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 295 | + | // of the <object> tag used to construct the @buildable. | |
| 296 | + | func (x *ButtonContent) GetBuildableId() string { | |
| 297 | + | ||
| 298 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 299 | + | ||
| 300 | + | } | |
| 301 | + | ||
| 302 | + | func init() { | |
| 303 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 304 | + | if err != nil { | |
| 305 | + | panic(err) | |
| 306 | + | } | |
| 307 | + | ||
| 308 | + | core.PuregoSafeRegister(&xNewButtonContent, lib, "adw_button_content_new") | |
| 309 | + | ||
| 310 | + | core.PuregoSafeRegister(&xButtonContentGetIconName, lib, "adw_button_content_get_icon_name") | |
| 311 | + | core.PuregoSafeRegister(&xButtonContentGetLabel, lib, "adw_button_content_get_label") | |
| 312 | + | core.PuregoSafeRegister(&xButtonContentGetUseUnderline, lib, "adw_button_content_get_use_underline") | |
| 313 | + | core.PuregoSafeRegister(&xButtonContentSetIconName, lib, "adw_button_content_set_icon_name") | |
| 314 | + | core.PuregoSafeRegister(&xButtonContentSetLabel, lib, "adw_button_content_set_label") | |
| 315 | + | core.PuregoSafeRegister(&xButtonContentSetUseUnderline, lib, "adw_button_content_set_use_underline") | |
| 316 | + | ||
| 317 | + | } | |
A v4/adw/adw-carousel-indicator-dots.go +264 -0
| @@ -0,0 +1,264 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | type CarouselIndicatorDotsClass struct { | |
| 12 | + | ParentClass uintptr | |
| 13 | + | } | |
| 14 | + | ||
| 15 | + | // A dots indicator for [class@Carousel]. | |
| 16 | + | // | |
| 17 | + | // <picture> | |
| 18 | + | // | |
| 19 | + | // <source srcset="carousel-indicator-dots-dark.png" media="(prefers-color-scheme: dark)"> | |
| 20 | + | // <img src="carousel-indicator-dots.png" alt="carousel-indicator-dots"> | |
| 21 | + | // | |
| 22 | + | // </picture> | |
| 23 | + | // | |
| 24 | + | // The `AdwCarouselIndicatorDots` widget shows a set of dots for each page of a | |
| 25 | + | // given [class@Carousel]. The dot representing the carousel's active page is | |
| 26 | + | // larger and more opaque than the others, the transition to the active and | |
| 27 | + | // inactive state is gradual to match the carousel's position. | |
| 28 | + | // | |
| 29 | + | // See also [class@CarouselIndicatorLines]. | |
| 30 | + | // | |
| 31 | + | // ## CSS nodes | |
| 32 | + | // | |
| 33 | + | // `AdwCarouselIndicatorDots` has a single CSS node with name | |
| 34 | + | // `carouselindicatordots`. | |
| 35 | + | type CarouselIndicatorDots struct { | |
| 36 | + | gtk.Widget | |
| 37 | + | } | |
| 38 | + | ||
| 39 | + | func CarouselIndicatorDotsNewFromInternalPtr(ptr uintptr) *CarouselIndicatorDots { | |
| 40 | + | cls := &CarouselIndicatorDots{} | |
| 41 | + | cls.Ptr = ptr | |
| 42 | + | return cls | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | var xNewCarouselIndicatorDots func() uintptr | |
| 46 | + | ||
| 47 | + | // Creates a new `AdwCarouselIndicatorDots`. | |
| 48 | + | func NewCarouselIndicatorDots() *gtk.Widget { | |
| 49 | + | NewCarouselIndicatorDotsPtr := xNewCarouselIndicatorDots() | |
| 50 | + | if NewCarouselIndicatorDotsPtr == 0 { | |
| 51 | + | return nil | |
| 52 | + | } | |
| 53 | + | ||
| 54 | + | gobject.IncreaseRef(NewCarouselIndicatorDotsPtr) | |
| 55 | + | ||
| 56 | + | NewCarouselIndicatorDotsCls := >k.Widget{} | |
| 57 | + | NewCarouselIndicatorDotsCls.Ptr = NewCarouselIndicatorDotsPtr | |
| 58 | + | return NewCarouselIndicatorDotsCls | |
| 59 | + | } | |
| 60 | + | ||
| 61 | + | var xCarouselIndicatorDotsGetCarousel func(uintptr) uintptr | |
| 62 | + | ||
| 63 | + | // Gets the displayed carousel. | |
| 64 | + | func (x *CarouselIndicatorDots) GetCarousel() *Carousel { | |
| 65 | + | ||
| 66 | + | GetCarouselPtr := xCarouselIndicatorDotsGetCarousel(x.GoPointer()) | |
| 67 | + | if GetCarouselPtr == 0 { | |
| 68 | + | return nil | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | gobject.IncreaseRef(GetCarouselPtr) | |
| 72 | + | ||
| 73 | + | GetCarouselCls := &Carousel{} | |
| 74 | + | GetCarouselCls.Ptr = GetCarouselPtr | |
| 75 | + | return GetCarouselCls | |
| 76 | + | ||
| 77 | + | } | |
| 78 | + | ||
| 79 | + | var xCarouselIndicatorDotsSetCarousel func(uintptr, uintptr) | |
| 80 | + | ||
| 81 | + | // Sets the displayed carousel. | |
| 82 | + | func (x *CarouselIndicatorDots) SetCarousel(CarouselVar *Carousel) { | |
| 83 | + | ||
| 84 | + | xCarouselIndicatorDotsSetCarousel(x.GoPointer(), CarouselVar.GoPointer()) | |
| 85 | + | ||
| 86 | + | } | |
| 87 | + | ||
| 88 | + | func (c *CarouselIndicatorDots) GoPointer() uintptr { | |
| 89 | + | return c.Ptr | |
| 90 | + | } | |
| 91 | + | ||
| 92 | + | func (c *CarouselIndicatorDots) SetGoPointer(ptr uintptr) { | |
| 93 | + | c.Ptr = ptr | |
| 94 | + | } | |
| 95 | + | ||
| 96 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 97 | + | func (x *CarouselIndicatorDots) GetAccessibleRole() gtk.AccessibleRole { | |
| 98 | + | ||
| 99 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 100 | + | ||
| 101 | + | } | |
| 102 | + | ||
| 103 | + | // Resets the accessible @property to its default value. | |
| 104 | + | func (x *CarouselIndicatorDots) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 105 | + | ||
| 106 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 107 | + | ||
| 108 | + | } | |
| 109 | + | ||
| 110 | + | // Resets the accessible @relation to its default value. | |
| 111 | + | func (x *CarouselIndicatorDots) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 112 | + | ||
| 113 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 114 | + | ||
| 115 | + | } | |
| 116 | + | ||
| 117 | + | // Resets the accessible @state to its default value. | |
| 118 | + | func (x *CarouselIndicatorDots) ResetState(StateVar gtk.AccessibleState) { | |
| 119 | + | ||
| 120 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 121 | + | ||
| 122 | + | } | |
| 123 | + | ||
| 124 | + | // Updates a list of accessible properties. | |
| 125 | + | // | |
| 126 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 127 | + | // value types of accessible properties. | |
| 128 | + | // | |
| 129 | + | // This function should be called by `GtkWidget` types whenever | |
| 130 | + | // an accessible property change must be communicated to assistive | |
| 131 | + | // technologies. | |
| 132 | + | // | |
| 133 | + | // Example: | |
| 134 | + | // ```c | |
| 135 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 136 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 137 | + | // | |
| 138 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 139 | + | // -1); | |
| 140 | + | // | |
| 141 | + | // ``` | |
| 142 | + | func (x *CarouselIndicatorDots) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 143 | + | ||
| 144 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 145 | + | ||
| 146 | + | } | |
| 147 | + | ||
| 148 | + | // Updates an array of accessible properties. | |
| 149 | + | // | |
| 150 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 151 | + | // property change must be communicated to assistive technologies. | |
| 152 | + | // | |
| 153 | + | // This function is meant to be used by language bindings. | |
| 154 | + | func (x *CarouselIndicatorDots) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 155 | + | ||
| 156 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 157 | + | ||
| 158 | + | } | |
| 159 | + | ||
| 160 | + | // Updates a list of accessible relations. | |
| 161 | + | // | |
| 162 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 163 | + | // relation change must be communicated to assistive technologies. | |
| 164 | + | // | |
| 165 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 166 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 167 | + | // | |
| 168 | + | // ```c | |
| 169 | + | // gtk_accessible_update_relation (accessible, | |
| 170 | + | // | |
| 171 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 172 | + | // ref1, NULL, | |
| 173 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 174 | + | // ref1, ref2, ref3, NULL, | |
| 175 | + | // -1); | |
| 176 | + | // | |
| 177 | + | // ``` | |
| 178 | + | func (x *CarouselIndicatorDots) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 179 | + | ||
| 180 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 181 | + | ||
| 182 | + | } | |
| 183 | + | ||
| 184 | + | // Updates an array of accessible relations. | |
| 185 | + | // | |
| 186 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 187 | + | // relation change must be communicated to assistive technologies. | |
| 188 | + | // | |
| 189 | + | // This function is meant to be used by language bindings. | |
| 190 | + | func (x *CarouselIndicatorDots) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 191 | + | ||
| 192 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 193 | + | ||
| 194 | + | } | |
| 195 | + | ||
| 196 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 197 | + | // documentation for the value types of accessible states. | |
| 198 | + | // | |
| 199 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 200 | + | // state change must be communicated to assistive technologies. | |
| 201 | + | // | |
| 202 | + | // Example: | |
| 203 | + | // ```c | |
| 204 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 205 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 206 | + | // | |
| 207 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 208 | + | // -1); | |
| 209 | + | // | |
| 210 | + | // ``` | |
| 211 | + | func (x *CarouselIndicatorDots) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 212 | + | ||
| 213 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 214 | + | ||
| 215 | + | } | |
| 216 | + | ||
| 217 | + | // Updates an array of accessible states. | |
| 218 | + | // | |
| 219 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 220 | + | // state change must be communicated to assistive technologies. | |
| 221 | + | // | |
| 222 | + | // This function is meant to be used by language bindings. | |
| 223 | + | func (x *CarouselIndicatorDots) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 224 | + | ||
| 225 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 226 | + | ||
| 227 | + | } | |
| 228 | + | ||
| 229 | + | // Gets the ID of the @buildable object. | |
| 230 | + | // | |
| 231 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 232 | + | // of the <object> tag used to construct the @buildable. | |
| 233 | + | func (x *CarouselIndicatorDots) GetBuildableId() string { | |
| 234 | + | ||
| 235 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 236 | + | ||
| 237 | + | } | |
| 238 | + | ||
| 239 | + | // Retrieves the orientation of the @orientable. | |
| 240 | + | func (x *CarouselIndicatorDots) GetOrientation() gtk.Orientation { | |
| 241 | + | ||
| 242 | + | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 243 | + | ||
| 244 | + | } | |
| 245 | + | ||
| 246 | + | // Sets the orientation of the @orientable. | |
| 247 | + | func (x *CarouselIndicatorDots) SetOrientation(OrientationVar gtk.Orientation) { | |
| 248 | + | ||
| 249 | + | gtk.XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar) | |
| 250 | + | ||
| 251 | + | } | |
| 252 | + | ||
| 253 | + | func init() { | |
| 254 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 255 | + | if err != nil { | |
| 256 | + | panic(err) | |
| 257 | + | } | |
| 258 | + | ||
| 259 | + | core.PuregoSafeRegister(&xNewCarouselIndicatorDots, lib, "adw_carousel_indicator_dots_new") | |
| 260 | + | ||
| 261 | + | core.PuregoSafeRegister(&xCarouselIndicatorDotsGetCarousel, lib, "adw_carousel_indicator_dots_get_carousel") | |
| 262 | + | core.PuregoSafeRegister(&xCarouselIndicatorDotsSetCarousel, lib, "adw_carousel_indicator_dots_set_carousel") | |
| 263 | + | ||
| 264 | + | } | |
A v4/adw/adw-carousel-indicator-lines.go +263 -0
| @@ -0,0 +1,263 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | type CarouselIndicatorLinesClass struct { | |
| 12 | + | ParentClass uintptr | |
| 13 | + | } | |
| 14 | + | ||
| 15 | + | // A lines indicator for [class@Carousel]. | |
| 16 | + | // | |
| 17 | + | // <picture> | |
| 18 | + | // | |
| 19 | + | // <source srcset="carousel-indicator-dots-lines.png" media="(prefers-color-scheme: dark)"> | |
| 20 | + | // <img src="carousel-indicator-lines.png" alt="carousel-indicator-lines"> | |
| 21 | + | // | |
| 22 | + | // </picture> | |
| 23 | + | // | |
| 24 | + | // The `AdwCarouselIndicatorLines` widget shows a set of lines for each page of | |
| 25 | + | // a given [class@Carousel]. The carousel's active page is shown as another line | |
| 26 | + | // that moves between them to match the carousel's position. | |
| 27 | + | // | |
| 28 | + | // See also [class@CarouselIndicatorDots]. | |
| 29 | + | // | |
| 30 | + | // ## CSS nodes | |
| 31 | + | // | |
| 32 | + | // `AdwCarouselIndicatorLines` has a single CSS node with name | |
| 33 | + | // `carouselindicatorlines`. | |
| 34 | + | type CarouselIndicatorLines struct { | |
| 35 | + | gtk.Widget | |
| 36 | + | } | |
| 37 | + | ||
| 38 | + | func CarouselIndicatorLinesNewFromInternalPtr(ptr uintptr) *CarouselIndicatorLines { | |
| 39 | + | cls := &CarouselIndicatorLines{} | |
| 40 | + | cls.Ptr = ptr | |
| 41 | + | return cls | |
| 42 | + | } | |
| 43 | + | ||
| 44 | + | var xNewCarouselIndicatorLines func() uintptr | |
| 45 | + | ||
| 46 | + | // Creates a new `AdwCarouselIndicatorLines`. | |
| 47 | + | func NewCarouselIndicatorLines() *gtk.Widget { | |
| 48 | + | NewCarouselIndicatorLinesPtr := xNewCarouselIndicatorLines() | |
| 49 | + | if NewCarouselIndicatorLinesPtr == 0 { | |
| 50 | + | return nil | |
| 51 | + | } | |
| 52 | + | ||
| 53 | + | gobject.IncreaseRef(NewCarouselIndicatorLinesPtr) | |
| 54 | + | ||
| 55 | + | NewCarouselIndicatorLinesCls := >k.Widget{} | |
| 56 | + | NewCarouselIndicatorLinesCls.Ptr = NewCarouselIndicatorLinesPtr | |
| 57 | + | return NewCarouselIndicatorLinesCls | |
| 58 | + | } | |
| 59 | + | ||
| 60 | + | var xCarouselIndicatorLinesGetCarousel func(uintptr) uintptr | |
| 61 | + | ||
| 62 | + | // Gets the displayed carousel. | |
| 63 | + | func (x *CarouselIndicatorLines) GetCarousel() *Carousel { | |
| 64 | + | ||
| 65 | + | GetCarouselPtr := xCarouselIndicatorLinesGetCarousel(x.GoPointer()) | |
| 66 | + | if GetCarouselPtr == 0 { | |
| 67 | + | return nil | |
| 68 | + | } | |
| 69 | + | ||
| 70 | + | gobject.IncreaseRef(GetCarouselPtr) | |
| 71 | + | ||
| 72 | + | GetCarouselCls := &Carousel{} | |
| 73 | + | GetCarouselCls.Ptr = GetCarouselPtr | |
| 74 | + | return GetCarouselCls | |
| 75 | + | ||
| 76 | + | } | |
| 77 | + | ||
| 78 | + | var xCarouselIndicatorLinesSetCarousel func(uintptr, uintptr) | |
| 79 | + | ||
| 80 | + | // Sets the displayed carousel. | |
| 81 | + | func (x *CarouselIndicatorLines) SetCarousel(CarouselVar *Carousel) { | |
| 82 | + | ||
| 83 | + | xCarouselIndicatorLinesSetCarousel(x.GoPointer(), CarouselVar.GoPointer()) | |
| 84 | + | ||
| 85 | + | } | |
| 86 | + | ||
| 87 | + | func (c *CarouselIndicatorLines) GoPointer() uintptr { | |
| 88 | + | return c.Ptr | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | func (c *CarouselIndicatorLines) SetGoPointer(ptr uintptr) { | |
| 92 | + | c.Ptr = ptr | |
| 93 | + | } | |
| 94 | + | ||
| 95 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 96 | + | func (x *CarouselIndicatorLines) GetAccessibleRole() gtk.AccessibleRole { | |
| 97 | + | ||
| 98 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 99 | + | ||
| 100 | + | } | |
| 101 | + | ||
| 102 | + | // Resets the accessible @property to its default value. | |
| 103 | + | func (x *CarouselIndicatorLines) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 104 | + | ||
| 105 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 106 | + | ||
| 107 | + | } | |
| 108 | + | ||
| 109 | + | // Resets the accessible @relation to its default value. | |
| 110 | + | func (x *CarouselIndicatorLines) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 111 | + | ||
| 112 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 113 | + | ||
| 114 | + | } | |
| 115 | + | ||
| 116 | + | // Resets the accessible @state to its default value. | |
| 117 | + | func (x *CarouselIndicatorLines) ResetState(StateVar gtk.AccessibleState) { | |
| 118 | + | ||
| 119 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 120 | + | ||
| 121 | + | } | |
| 122 | + | ||
| 123 | + | // Updates a list of accessible properties. | |
| 124 | + | // | |
| 125 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 126 | + | // value types of accessible properties. | |
| 127 | + | // | |
| 128 | + | // This function should be called by `GtkWidget` types whenever | |
| 129 | + | // an accessible property change must be communicated to assistive | |
| 130 | + | // technologies. | |
| 131 | + | // | |
| 132 | + | // Example: | |
| 133 | + | // ```c | |
| 134 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 135 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 136 | + | // | |
| 137 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 138 | + | // -1); | |
| 139 | + | // | |
| 140 | + | // ``` | |
| 141 | + | func (x *CarouselIndicatorLines) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 142 | + | ||
| 143 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 144 | + | ||
| 145 | + | } | |
| 146 | + | ||
| 147 | + | // Updates an array of accessible properties. | |
| 148 | + | // | |
| 149 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 150 | + | // property change must be communicated to assistive technologies. | |
| 151 | + | // | |
| 152 | + | // This function is meant to be used by language bindings. | |
| 153 | + | func (x *CarouselIndicatorLines) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 154 | + | ||
| 155 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 156 | + | ||
| 157 | + | } | |
| 158 | + | ||
| 159 | + | // Updates a list of accessible relations. | |
| 160 | + | // | |
| 161 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 162 | + | // relation change must be communicated to assistive technologies. | |
| 163 | + | // | |
| 164 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 165 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 166 | + | // | |
| 167 | + | // ```c | |
| 168 | + | // gtk_accessible_update_relation (accessible, | |
| 169 | + | // | |
| 170 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 171 | + | // ref1, NULL, | |
| 172 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 173 | + | // ref1, ref2, ref3, NULL, | |
| 174 | + | // -1); | |
| 175 | + | // | |
| 176 | + | // ``` | |
| 177 | + | func (x *CarouselIndicatorLines) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 178 | + | ||
| 179 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 180 | + | ||
| 181 | + | } | |
| 182 | + | ||
| 183 | + | // Updates an array of accessible relations. | |
| 184 | + | // | |
| 185 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 186 | + | // relation change must be communicated to assistive technologies. | |
| 187 | + | // | |
| 188 | + | // This function is meant to be used by language bindings. | |
| 189 | + | func (x *CarouselIndicatorLines) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 190 | + | ||
| 191 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 192 | + | ||
| 193 | + | } | |
| 194 | + | ||
| 195 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 196 | + | // documentation for the value types of accessible states. | |
| 197 | + | // | |
| 198 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 199 | + | // state change must be communicated to assistive technologies. | |
| 200 | + | // | |
| 201 | + | // Example: | |
| 202 | + | // ```c | |
| 203 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 204 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 205 | + | // | |
| 206 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 207 | + | // -1); | |
| 208 | + | // | |
| 209 | + | // ``` | |
| 210 | + | func (x *CarouselIndicatorLines) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 211 | + | ||
| 212 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 213 | + | ||
| 214 | + | } | |
| 215 | + | ||
| 216 | + | // Updates an array of accessible states. | |
| 217 | + | // | |
| 218 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 219 | + | // state change must be communicated to assistive technologies. | |
| 220 | + | // | |
| 221 | + | // This function is meant to be used by language bindings. | |
| 222 | + | func (x *CarouselIndicatorLines) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 223 | + | ||
| 224 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 225 | + | ||
| 226 | + | } | |
| 227 | + | ||
| 228 | + | // Gets the ID of the @buildable object. | |
| 229 | + | // | |
| 230 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 231 | + | // of the <object> tag used to construct the @buildable. | |
| 232 | + | func (x *CarouselIndicatorLines) GetBuildableId() string { | |
| 233 | + | ||
| 234 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 235 | + | ||
| 236 | + | } | |
| 237 | + | ||
| 238 | + | // Retrieves the orientation of the @orientable. | |
| 239 | + | func (x *CarouselIndicatorLines) GetOrientation() gtk.Orientation { | |
| 240 | + | ||
| 241 | + | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 242 | + | ||
| 243 | + | } | |
| 244 | + | ||
| 245 | + | // Sets the orientation of the @orientable. | |
| 246 | + | func (x *CarouselIndicatorLines) SetOrientation(OrientationVar gtk.Orientation) { | |
| 247 | + | ||
| 248 | + | gtk.XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar) | |
| 249 | + | ||
| 250 | + | } | |
| 251 | + | ||
| 252 | + | func init() { | |
| 253 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 254 | + | if err != nil { | |
| 255 | + | panic(err) | |
| 256 | + | } | |
| 257 | + | ||
| 258 | + | core.PuregoSafeRegister(&xNewCarouselIndicatorLines, lib, "adw_carousel_indicator_lines_new") | |
| 259 | + | ||
| 260 | + | core.PuregoSafeRegister(&xCarouselIndicatorLinesGetCarousel, lib, "adw_carousel_indicator_lines_get_carousel") | |
| 261 | + | core.PuregoSafeRegister(&xCarouselIndicatorLinesSetCarousel, lib, "adw_carousel_indicator_lines_set_carousel") | |
| 262 | + | ||
| 263 | + | } | |
A v4/adw/adw-carousel.go +565 -0
| @@ -0,0 +1,565 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gdk" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 10 | + | ) | |
| 11 | + | ||
| 12 | + | type CarouselClass struct { | |
| 13 | + | ParentClass uintptr | |
| 14 | + | } | |
| 15 | + | ||
| 16 | + | // A paginated scrolling widget. | |
| 17 | + | // | |
| 18 | + | // <picture> | |
| 19 | + | // | |
| 20 | + | // <source srcset="carousel-dark.png" media="(prefers-color-scheme: dark)"> | |
| 21 | + | // <img src="carousel.png" alt="carousel"> | |
| 22 | + | // | |
| 23 | + | // </picture> | |
| 24 | + | // | |
| 25 | + | // The `AdwCarousel` widget can be used to display a set of pages with | |
| 26 | + | // swipe-based navigation between them. | |
| 27 | + | // | |
| 28 | + | // [class@CarouselIndicatorDots] and [class@CarouselIndicatorLines] can be used | |
| 29 | + | // to provide page indicators for `AdwCarousel`. | |
| 30 | + | // | |
| 31 | + | // ## CSS nodes | |
| 32 | + | // | |
| 33 | + | // `AdwCarousel` has a single CSS node with name `carousel`. | |
| 34 | + | type Carousel struct { | |
| 35 | + | gtk.Widget | |
| 36 | + | } | |
| 37 | + | ||
| 38 | + | func CarouselNewFromInternalPtr(ptr uintptr) *Carousel { | |
| 39 | + | cls := &Carousel{} | |
| 40 | + | cls.Ptr = ptr | |
| 41 | + | return cls | |
| 42 | + | } | |
| 43 | + | ||
| 44 | + | var xNewCarousel func() uintptr | |
| 45 | + | ||
| 46 | + | // Creates a new `AdwCarousel`. | |
| 47 | + | func NewCarousel() *gtk.Widget { | |
| 48 | + | NewCarouselPtr := xNewCarousel() | |
| 49 | + | if NewCarouselPtr == 0 { | |
| 50 | + | return nil | |
| 51 | + | } | |
| 52 | + | ||
| 53 | + | gobject.IncreaseRef(NewCarouselPtr) | |
| 54 | + | ||
| 55 | + | NewCarouselCls := >k.Widget{} | |
| 56 | + | NewCarouselCls.Ptr = NewCarouselPtr | |
| 57 | + | return NewCarouselCls | |
| 58 | + | } | |
| 59 | + | ||
| 60 | + | var xCarouselAppend func(uintptr, uintptr) | |
| 61 | + | ||
| 62 | + | // Appends @child to @self. | |
| 63 | + | func (x *Carousel) Append(ChildVar *gtk.Widget) { | |
| 64 | + | ||
| 65 | + | xCarouselAppend(x.GoPointer(), ChildVar.GoPointer()) | |
| 66 | + | ||
| 67 | + | } | |
| 68 | + | ||
| 69 | + | var xCarouselGetAllowLongSwipes func(uintptr) bool | |
| 70 | + | ||
| 71 | + | // Gets whether to allow swiping for more than one page at a time. | |
| 72 | + | func (x *Carousel) GetAllowLongSwipes() bool { | |
| 73 | + | ||
| 74 | + | return xCarouselGetAllowLongSwipes(x.GoPointer()) | |
| 75 | + | ||
| 76 | + | } | |
| 77 | + | ||
| 78 | + | var xCarouselGetAllowMouseDrag func(uintptr) bool | |
| 79 | + | ||
| 80 | + | // Sets whether @self can be dragged with mouse pointer. | |
| 81 | + | func (x *Carousel) GetAllowMouseDrag() bool { | |
| 82 | + | ||
| 83 | + | return xCarouselGetAllowMouseDrag(x.GoPointer()) | |
| 84 | + | ||
| 85 | + | } | |
| 86 | + | ||
| 87 | + | var xCarouselGetAllowScrollWheel func(uintptr) bool | |
| 88 | + | ||
| 89 | + | // Gets whether @self will respond to scroll wheel events. | |
| 90 | + | func (x *Carousel) GetAllowScrollWheel() bool { | |
| 91 | + | ||
| 92 | + | return xCarouselGetAllowScrollWheel(x.GoPointer()) | |
| 93 | + | ||
| 94 | + | } | |
| 95 | + | ||
| 96 | + | var xCarouselGetInteractive func(uintptr) bool | |
| 97 | + | ||
| 98 | + | // Gets whether @self can be navigated. | |
| 99 | + | func (x *Carousel) GetInteractive() bool { | |
| 100 | + | ||
| 101 | + | return xCarouselGetInteractive(x.GoPointer()) | |
| 102 | + | ||
| 103 | + | } | |
| 104 | + | ||
| 105 | + | var xCarouselGetNPages func(uintptr) uint | |
| 106 | + | ||
| 107 | + | // Gets the number of pages in @self. | |
| 108 | + | func (x *Carousel) GetNPages() uint { | |
| 109 | + | ||
| 110 | + | return xCarouselGetNPages(x.GoPointer()) | |
| 111 | + | ||
| 112 | + | } | |
| 113 | + | ||
| 114 | + | var xCarouselGetNthPage func(uintptr, uint) uintptr | |
| 115 | + | ||
| 116 | + | // Gets the page at position @n. | |
| 117 | + | func (x *Carousel) GetNthPage(NVar uint) *gtk.Widget { | |
| 118 | + | ||
| 119 | + | GetNthPagePtr := xCarouselGetNthPage(x.GoPointer(), NVar) | |
| 120 | + | if GetNthPagePtr == 0 { | |
| 121 | + | return nil | |
| 122 | + | } | |
| 123 | + | ||
| 124 | + | gobject.IncreaseRef(GetNthPagePtr) | |
| 125 | + | ||
| 126 | + | GetNthPageCls := >k.Widget{} | |
| 127 | + | GetNthPageCls.Ptr = GetNthPagePtr | |
| 128 | + | return GetNthPageCls | |
| 129 | + | ||
| 130 | + | } | |
| 131 | + | ||
| 132 | + | var xCarouselGetPosition func(uintptr) float64 | |
| 133 | + | ||
| 134 | + | // Gets current scroll position in @self, unitless. | |
| 135 | + | // | |
| 136 | + | // 1 matches 1 page. Use [method@Carousel.scroll_to] for changing it. | |
| 137 | + | func (x *Carousel) GetPosition() float64 { | |
| 138 | + | ||
| 139 | + | return xCarouselGetPosition(x.GoPointer()) | |
| 140 | + | ||
| 141 | + | } | |
| 142 | + | ||
| 143 | + | var xCarouselGetRevealDuration func(uintptr) uint | |
| 144 | + | ||
| 145 | + | // Gets the page reveal duration, in milliseconds. | |
| 146 | + | func (x *Carousel) GetRevealDuration() uint { | |
| 147 | + | ||
| 148 | + | return xCarouselGetRevealDuration(x.GoPointer()) | |
| 149 | + | ||
| 150 | + | } | |
| 151 | + | ||
| 152 | + | var xCarouselGetScrollParams func(uintptr) *SpringParams | |
| 153 | + | ||
| 154 | + | // Gets the scroll animation spring parameters for @self. | |
| 155 | + | func (x *Carousel) GetScrollParams() *SpringParams { | |
| 156 | + | ||
| 157 | + | return xCarouselGetScrollParams(x.GoPointer()) | |
| 158 | + | ||
| 159 | + | } | |
| 160 | + | ||
| 161 | + | var xCarouselGetSpacing func(uintptr) uint | |
| 162 | + | ||
| 163 | + | // Gets spacing between pages in pixels. | |
| 164 | + | func (x *Carousel) GetSpacing() uint { | |
| 165 | + | ||
| 166 | + | return xCarouselGetSpacing(x.GoPointer()) | |
| 167 | + | ||
| 168 | + | } | |
| 169 | + | ||
| 170 | + | var xCarouselInsert func(uintptr, uintptr, int32) | |
| 171 | + | ||
| 172 | + | // Inserts @child into @self at position @position. | |
| 173 | + | // | |
| 174 | + | // If position is -1, or larger than the number of pages, | |
| 175 | + | // @child will be appended to the end. | |
| 176 | + | func (x *Carousel) Insert(ChildVar *gtk.Widget, PositionVar int32) { | |
| 177 | + | ||
| 178 | + | xCarouselInsert(x.GoPointer(), ChildVar.GoPointer(), PositionVar) | |
| 179 | + | ||
| 180 | + | } | |
| 181 | + | ||
| 182 | + | var xCarouselPrepend func(uintptr, uintptr) | |
| 183 | + | ||
| 184 | + | // Prepends @child to @self. | |
| 185 | + | func (x *Carousel) Prepend(ChildVar *gtk.Widget) { | |
| 186 | + | ||
| 187 | + | xCarouselPrepend(x.GoPointer(), ChildVar.GoPointer()) | |
| 188 | + | ||
| 189 | + | } | |
| 190 | + | ||
| 191 | + | var xCarouselRemove func(uintptr, uintptr) | |
| 192 | + | ||
| 193 | + | // Removes @child from @self. | |
| 194 | + | func (x *Carousel) Remove(ChildVar *gtk.Widget) { | |
| 195 | + | ||
| 196 | + | xCarouselRemove(x.GoPointer(), ChildVar.GoPointer()) | |
| 197 | + | ||
| 198 | + | } | |
| 199 | + | ||
| 200 | + | var xCarouselReorder func(uintptr, uintptr, int32) | |
| 201 | + | ||
| 202 | + | // Moves @child into position @position. | |
| 203 | + | // | |
| 204 | + | // If position is -1, or larger than the number of pages, @child will be moved | |
| 205 | + | // at the end. | |
| 206 | + | func (x *Carousel) Reorder(ChildVar *gtk.Widget, PositionVar int32) { | |
| 207 | + | ||
| 208 | + | xCarouselReorder(x.GoPointer(), ChildVar.GoPointer(), PositionVar) | |
| 209 | + | ||
| 210 | + | } | |
| 211 | + | ||
| 212 | + | var xCarouselScrollTo func(uintptr, uintptr, bool) | |
| 213 | + | ||
| 214 | + | // Scrolls to @widget. | |
| 215 | + | // | |
| 216 | + | // If @animate is `TRUE`, the transition will be animated. | |
| 217 | + | func (x *Carousel) ScrollTo(WidgetVar *gtk.Widget, AnimateVar bool) { | |
| 218 | + | ||
| 219 | + | xCarouselScrollTo(x.GoPointer(), WidgetVar.GoPointer(), AnimateVar) | |
| 220 | + | ||
| 221 | + | } | |
| 222 | + | ||
| 223 | + | var xCarouselSetAllowLongSwipes func(uintptr, bool) | |
| 224 | + | ||
| 225 | + | // Sets whether to allow swiping for more than one page at a time. | |
| 226 | + | // | |
| 227 | + | // If @allow_long_swipes is `FALSE`, each swipe can only move to the adjacent | |
| 228 | + | // pages. | |
| 229 | + | func (x *Carousel) SetAllowLongSwipes(AllowLongSwipesVar bool) { | |
| 230 | + | ||
| 231 | + | xCarouselSetAllowLongSwipes(x.GoPointer(), AllowLongSwipesVar) | |
| 232 | + | ||
| 233 | + | } | |
| 234 | + | ||
| 235 | + | var xCarouselSetAllowMouseDrag func(uintptr, bool) | |
| 236 | + | ||
| 237 | + | // Sets whether @self can be dragged with mouse pointer. | |
| 238 | + | // | |
| 239 | + | // If @allow_mouse_drag is `FALSE`, dragging is only available on touch. | |
| 240 | + | func (x *Carousel) SetAllowMouseDrag(AllowMouseDragVar bool) { | |
| 241 | + | ||
| 242 | + | xCarouselSetAllowMouseDrag(x.GoPointer(), AllowMouseDragVar) | |
| 243 | + | ||
| 244 | + | } | |
| 245 | + | ||
| 246 | + | var xCarouselSetAllowScrollWheel func(uintptr, bool) | |
| 247 | + | ||
| 248 | + | // Sets whether @self will respond to scroll wheel events. | |
| 249 | + | // | |
| 250 | + | // If @allow_scroll_wheel is `FALSE`, wheel events will be ignored. | |
| 251 | + | func (x *Carousel) SetAllowScrollWheel(AllowScrollWheelVar bool) { | |
| 252 | + | ||
| 253 | + | xCarouselSetAllowScrollWheel(x.GoPointer(), AllowScrollWheelVar) | |
| 254 | + | ||
| 255 | + | } | |
| 256 | + | ||
| 257 | + | var xCarouselSetInteractive func(uintptr, bool) | |
| 258 | + | ||
| 259 | + | // Sets whether @self can be navigated. | |
| 260 | + | // | |
| 261 | + | // This can be used to temporarily disable the carousel to only allow navigating | |
| 262 | + | // it in a certain state. | |
| 263 | + | func (x *Carousel) SetInteractive(InteractiveVar bool) { | |
| 264 | + | ||
| 265 | + | xCarouselSetInteractive(x.GoPointer(), InteractiveVar) | |
| 266 | + | ||
| 267 | + | } | |
| 268 | + | ||
| 269 | + | var xCarouselSetRevealDuration func(uintptr, uint) | |
| 270 | + | ||
| 271 | + | // Sets the page reveal duration, in milliseconds. | |
| 272 | + | // | |
| 273 | + | // Reveal duration is used when animating adding or removing pages. | |
| 274 | + | func (x *Carousel) SetRevealDuration(RevealDurationVar uint) { | |
| 275 | + | ||
| 276 | + | xCarouselSetRevealDuration(x.GoPointer(), RevealDurationVar) | |
| 277 | + | ||
| 278 | + | } | |
| 279 | + | ||
| 280 | + | var xCarouselSetScrollParams func(uintptr, *SpringParams) | |
| 281 | + | ||
| 282 | + | // Sets the scroll animation spring parameters for @self. | |
| 283 | + | // | |
| 284 | + | // The default value is equivalent to: | |
| 285 | + | // | |
| 286 | + | // ```c | |
| 287 | + | // adw_spring_params_new (1, 0.5, 500) | |
| 288 | + | // ``` | |
| 289 | + | func (x *Carousel) SetScrollParams(ParamsVar *SpringParams) { | |
| 290 | + | ||
| 291 | + | xCarouselSetScrollParams(x.GoPointer(), ParamsVar) | |
| 292 | + | ||
| 293 | + | } | |
| 294 | + | ||
| 295 | + | var xCarouselSetSpacing func(uintptr, uint) | |
| 296 | + | ||
| 297 | + | // Sets spacing between pages in pixels. | |
| 298 | + | func (x *Carousel) SetSpacing(SpacingVar uint) { | |
| 299 | + | ||
| 300 | + | xCarouselSetSpacing(x.GoPointer(), SpacingVar) | |
| 301 | + | ||
| 302 | + | } | |
| 303 | + | ||
| 304 | + | func (c *Carousel) GoPointer() uintptr { | |
| 305 | + | return c.Ptr | |
| 306 | + | } | |
| 307 | + | ||
| 308 | + | func (c *Carousel) SetGoPointer(ptr uintptr) { | |
| 309 | + | c.Ptr = ptr | |
| 310 | + | } | |
| 311 | + | ||
| 312 | + | // This signal is emitted after a page has been changed. | |
| 313 | + | // | |
| 314 | + | // It can be used to implement "infinite scrolling" by amending the pages | |
| 315 | + | // after every scroll. Note that an empty carousel is indicated by | |
| 316 | + | // `(int)index == -1`. | |
| 317 | + | func (x *Carousel) ConnectPageChanged(cb func(Carousel, uint)) { | |
| 318 | + | fcb := func(clsPtr uintptr, IndexVarp uint) { | |
| 319 | + | fa := Carousel{} | |
| 320 | + | fa.Ptr = clsPtr | |
| 321 | + | ||
| 322 | + | cb(fa, IndexVarp) | |
| 323 | + | ||
| 324 | + | } | |
| 325 | + | gobject.ObjectConnect(x.GoPointer(), "signal::page-changed", purego.NewCallback(fcb)) | |
| 326 | + | } | |
| 327 | + | ||
| 328 | + | // Gets the progress @self will snap back to after the gesture is canceled. | |
| 329 | + | func (x *Carousel) GetCancelProgress() float64 { | |
| 330 | + | ||
| 331 | + | return XAdwSwipeableGetCancelProgress(x.GoPointer()) | |
| 332 | + | ||
| 333 | + | } | |
| 334 | + | ||
| 335 | + | // Gets the swipe distance of @self. | |
| 336 | + | // | |
| 337 | + | // This corresponds to how many pixels 1 unit represents. | |
| 338 | + | func (x *Carousel) GetDistance() float64 { | |
| 339 | + | ||
| 340 | + | return XAdwSwipeableGetDistance(x.GoPointer()) | |
| 341 | + | ||
| 342 | + | } | |
| 343 | + | ||
| 344 | + | // Gets the current progress of @self. | |
| 345 | + | func (x *Carousel) GetProgress() float64 { | |
| 346 | + | ||
| 347 | + | return XAdwSwipeableGetProgress(x.GoPointer()) | |
| 348 | + | ||
| 349 | + | } | |
| 350 | + | ||
| 351 | + | // Gets the snap points of @self. | |
| 352 | + | // | |
| 353 | + | // Each snap point represents a progress value that is considered acceptable to | |
| 354 | + | // end the swipe on. | |
| 355 | + | func (x *Carousel) GetSnapPoints(NSnapPointsVar int32) uintptr { | |
| 356 | + | ||
| 357 | + | return XAdwSwipeableGetSnapPoints(x.GoPointer(), NSnapPointsVar) | |
| 358 | + | ||
| 359 | + | } | |
| 360 | + | ||
| 361 | + | // Gets the area @self can start a swipe from for the given direction and | |
| 362 | + | // gesture type. | |
| 363 | + | // | |
| 364 | + | // This can be used to restrict swipes to only be possible from a certain area, | |
| 365 | + | // for example, to only allow edge swipes, or to have a draggable element and | |
| 366 | + | // ignore swipes elsewhere. | |
| 367 | + | // | |
| 368 | + | // If not implemented, the default implementation returns the allocation of | |
| 369 | + | // @self, allowing swipes from anywhere. | |
| 370 | + | func (x *Carousel) GetSwipeArea(NavigationDirectionVar NavigationDirection, IsDragVar bool, RectVar *gdk.Rectangle) { | |
| 371 | + | ||
| 372 | + | XAdwSwipeableGetSwipeArea(x.GoPointer(), NavigationDirectionVar, IsDragVar, RectVar) | |
| 373 | + | ||
| 374 | + | } | |
| 375 | + | ||
| 376 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 377 | + | func (x *Carousel) GetAccessibleRole() gtk.AccessibleRole { | |
| 378 | + | ||
| 379 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 380 | + | ||
| 381 | + | } | |
| 382 | + | ||
| 383 | + | // Resets the accessible @property to its default value. | |
| 384 | + | func (x *Carousel) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 385 | + | ||
| 386 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 387 | + | ||
| 388 | + | } | |
| 389 | + | ||
| 390 | + | // Resets the accessible @relation to its default value. | |
| 391 | + | func (x *Carousel) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 392 | + | ||
| 393 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 394 | + | ||
| 395 | + | } | |
| 396 | + | ||
| 397 | + | // Resets the accessible @state to its default value. | |
| 398 | + | func (x *Carousel) ResetState(StateVar gtk.AccessibleState) { | |
| 399 | + | ||
| 400 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 401 | + | ||
| 402 | + | } | |
| 403 | + | ||
| 404 | + | // Updates a list of accessible properties. | |
| 405 | + | // | |
| 406 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 407 | + | // value types of accessible properties. | |
| 408 | + | // | |
| 409 | + | // This function should be called by `GtkWidget` types whenever | |
| 410 | + | // an accessible property change must be communicated to assistive | |
| 411 | + | // technologies. | |
| 412 | + | // | |
| 413 | + | // Example: | |
| 414 | + | // ```c | |
| 415 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 416 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 417 | + | // | |
| 418 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 419 | + | // -1); | |
| 420 | + | // | |
| 421 | + | // ``` | |
| 422 | + | func (x *Carousel) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 423 | + | ||
| 424 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 425 | + | ||
| 426 | + | } | |
| 427 | + | ||
| 428 | + | // Updates an array of accessible properties. | |
| 429 | + | // | |
| 430 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 431 | + | // property change must be communicated to assistive technologies. | |
| 432 | + | // | |
| 433 | + | // This function is meant to be used by language bindings. | |
| 434 | + | func (x *Carousel) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 435 | + | ||
| 436 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 437 | + | ||
| 438 | + | } | |
| 439 | + | ||
| 440 | + | // Updates a list of accessible relations. | |
| 441 | + | // | |
| 442 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 443 | + | // relation change must be communicated to assistive technologies. | |
| 444 | + | // | |
| 445 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 446 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 447 | + | // | |
| 448 | + | // ```c | |
| 449 | + | // gtk_accessible_update_relation (accessible, | |
| 450 | + | // | |
| 451 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 452 | + | // ref1, NULL, | |
| 453 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 454 | + | // ref1, ref2, ref3, NULL, | |
| 455 | + | // -1); | |
| 456 | + | // | |
| 457 | + | // ``` | |
| 458 | + | func (x *Carousel) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 459 | + | ||
| 460 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 461 | + | ||
| 462 | + | } | |
| 463 | + | ||
| 464 | + | // Updates an array of accessible relations. | |
| 465 | + | // | |
| 466 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 467 | + | // relation change must be communicated to assistive technologies. | |
| 468 | + | // | |
| 469 | + | // This function is meant to be used by language bindings. | |
| 470 | + | func (x *Carousel) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 471 | + | ||
| 472 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 473 | + | ||
| 474 | + | } | |
| 475 | + | ||
| 476 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 477 | + | // documentation for the value types of accessible states. | |
| 478 | + | // | |
| 479 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 480 | + | // state change must be communicated to assistive technologies. | |
| 481 | + | // | |
| 482 | + | // Example: | |
| 483 | + | // ```c | |
| 484 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 485 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 486 | + | // | |
| 487 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 488 | + | // -1); | |
| 489 | + | // | |
| 490 | + | // ``` | |
| 491 | + | func (x *Carousel) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 492 | + | ||
| 493 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 494 | + | ||
| 495 | + | } | |
| 496 | + | ||
| 497 | + | // Updates an array of accessible states. | |
| 498 | + | // | |
| 499 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 500 | + | // state change must be communicated to assistive technologies. | |
| 501 | + | // | |
| 502 | + | // This function is meant to be used by language bindings. | |
| 503 | + | func (x *Carousel) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 504 | + | ||
| 505 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 506 | + | ||
| 507 | + | } | |
| 508 | + | ||
| 509 | + | // Gets the ID of the @buildable object. | |
| 510 | + | // | |
| 511 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 512 | + | // of the <object> tag used to construct the @buildable. | |
| 513 | + | func (x *Carousel) GetBuildableId() string { | |
| 514 | + | ||
| 515 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 516 | + | ||
| 517 | + | } | |
| 518 | + | ||
| 519 | + | // Retrieves the orientation of the @orientable. | |
| 520 | + | func (x *Carousel) GetOrientation() gtk.Orientation { | |
| 521 | + | ||
| 522 | + | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 523 | + | ||
| 524 | + | } | |
| 525 | + | ||
| 526 | + | // Sets the orientation of the @orientable. | |
| 527 | + | func (x *Carousel) SetOrientation(OrientationVar gtk.Orientation) { | |
| 528 | + | ||
| 529 | + | gtk.XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar) | |
| 530 | + | ||
| 531 | + | } | |
| 532 | + | ||
| 533 | + | func init() { | |
| 534 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 535 | + | if err != nil { | |
| 536 | + | panic(err) | |
| 537 | + | } | |
| 538 | + | ||
| 539 | + | core.PuregoSafeRegister(&xNewCarousel, lib, "adw_carousel_new") | |
| 540 | + | ||
| 541 | + | core.PuregoSafeRegister(&xCarouselAppend, lib, "adw_carousel_append") | |
| 542 | + | core.PuregoSafeRegister(&xCarouselGetAllowLongSwipes, lib, "adw_carousel_get_allow_long_swipes") | |
| 543 | + | core.PuregoSafeRegister(&xCarouselGetAllowMouseDrag, lib, "adw_carousel_get_allow_mouse_drag") | |
| 544 | + | core.PuregoSafeRegister(&xCarouselGetAllowScrollWheel, lib, "adw_carousel_get_allow_scroll_wheel") | |
| 545 | + | core.PuregoSafeRegister(&xCarouselGetInteractive, lib, "adw_carousel_get_interactive") | |
| 546 | + | core.PuregoSafeRegister(&xCarouselGetNPages, lib, "adw_carousel_get_n_pages") | |
| 547 | + | core.PuregoSafeRegister(&xCarouselGetNthPage, lib, "adw_carousel_get_nth_page") | |
| 548 | + | core.PuregoSafeRegister(&xCarouselGetPosition, lib, "adw_carousel_get_position") | |
| 549 | + | core.PuregoSafeRegister(&xCarouselGetRevealDuration, lib, "adw_carousel_get_reveal_duration") | |
| 550 | + | core.PuregoSafeRegister(&xCarouselGetScrollParams, lib, "adw_carousel_get_scroll_params") | |
| 551 | + | core.PuregoSafeRegister(&xCarouselGetSpacing, lib, "adw_carousel_get_spacing") | |
| 552 | + | core.PuregoSafeRegister(&xCarouselInsert, lib, "adw_carousel_insert") | |
| 553 | + | core.PuregoSafeRegister(&xCarouselPrepend, lib, "adw_carousel_prepend") | |
| 554 | + | core.PuregoSafeRegister(&xCarouselRemove, lib, "adw_carousel_remove") | |
| 555 | + | core.PuregoSafeRegister(&xCarouselReorder, lib, "adw_carousel_reorder") | |
| 556 | + | core.PuregoSafeRegister(&xCarouselScrollTo, lib, "adw_carousel_scroll_to") | |
| 557 | + | core.PuregoSafeRegister(&xCarouselSetAllowLongSwipes, lib, "adw_carousel_set_allow_long_swipes") | |
| 558 | + | core.PuregoSafeRegister(&xCarouselSetAllowMouseDrag, lib, "adw_carousel_set_allow_mouse_drag") | |
| 559 | + | core.PuregoSafeRegister(&xCarouselSetAllowScrollWheel, lib, "adw_carousel_set_allow_scroll_wheel") | |
| 560 | + | core.PuregoSafeRegister(&xCarouselSetInteractive, lib, "adw_carousel_set_interactive") | |
| 561 | + | core.PuregoSafeRegister(&xCarouselSetRevealDuration, lib, "adw_carousel_set_reveal_duration") | |
| 562 | + | core.PuregoSafeRegister(&xCarouselSetScrollParams, lib, "adw_carousel_set_scroll_params") | |
| 563 | + | core.PuregoSafeRegister(&xCarouselSetSpacing, lib, "adw_carousel_set_spacing") | |
| 564 | + | ||
| 565 | + | } | |
A v4/adw/adw-clamp-layout.go +150 -0
| @@ -0,0 +1,150 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 8 | + | ) | |
| 9 | + | ||
| 10 | + | type ClampLayoutClass struct { | |
| 11 | + | ParentClass uintptr | |
| 12 | + | } | |
| 13 | + | ||
| 14 | + | // A layout manager constraining its children to a given size. | |
| 15 | + | // | |
| 16 | + | // <picture> | |
| 17 | + | // | |
| 18 | + | // <source srcset="clamp-wide-dark.png" media="(prefers-color-scheme: dark)"> | |
| 19 | + | // <img src="clamp-wide.png" alt="clamp-wide"> | |
| 20 | + | // | |
| 21 | + | // </picture> | |
| 22 | + | // <picture> | |
| 23 | + | // | |
| 24 | + | // <source srcset="clamp-narrow-dark.png" media="(prefers-color-scheme: dark)"> | |
| 25 | + | // <img src="clamp-narrow.png" alt="clamp-narrow"> | |
| 26 | + | // | |
| 27 | + | // </picture> | |
| 28 | + | // | |
| 29 | + | // `AdwClampLayout` constraints the size of the widgets it contains to a given | |
| 30 | + | // maximum size. It will constrain the width if it is horizontal, or the height | |
| 31 | + | // if it is vertical. The expansion of the children from their minimum to their | |
| 32 | + | // maximum size is eased out for a smooth transition. | |
| 33 | + | // | |
| 34 | + | // If a child requires more than the requested maximum size, it will be | |
| 35 | + | // allocated the minimum size it can fit in instead. | |
| 36 | + | // | |
| 37 | + | // Each child will get the style classes .large when it reached its maximum | |
| 38 | + | // size, .small when it's allocated the full size, .medium in-between, or none | |
| 39 | + | // if it hasn't been allocated yet. | |
| 40 | + | type ClampLayout struct { | |
| 41 | + | gtk.LayoutManager | |
| 42 | + | } | |
| 43 | + | ||
| 44 | + | func ClampLayoutNewFromInternalPtr(ptr uintptr) *ClampLayout { | |
| 45 | + | cls := &ClampLayout{} | |
| 46 | + | cls.Ptr = ptr | |
| 47 | + | return cls | |
| 48 | + | } | |
| 49 | + | ||
| 50 | + | var xNewClampLayout func() uintptr | |
| 51 | + | ||
| 52 | + | // Creates a new `AdwClampLayout`. | |
| 53 | + | func NewClampLayout() *gtk.LayoutManager { | |
| 54 | + | NewClampLayoutPtr := xNewClampLayout() | |
| 55 | + | if NewClampLayoutPtr == 0 { | |
| 56 | + | return nil | |
| 57 | + | } | |
| 58 | + | ||
| 59 | + | NewClampLayoutCls := >k.LayoutManager{} | |
| 60 | + | NewClampLayoutCls.Ptr = NewClampLayoutPtr | |
| 61 | + | return NewClampLayoutCls | |
| 62 | + | } | |
| 63 | + | ||
| 64 | + | var xClampLayoutGetMaximumSize func(uintptr) int32 | |
| 65 | + | ||
| 66 | + | // Gets the maximum size allocated to the children. | |
| 67 | + | func (x *ClampLayout) GetMaximumSize() int32 { | |
| 68 | + | ||
| 69 | + | return xClampLayoutGetMaximumSize(x.GoPointer()) | |
| 70 | + | ||
| 71 | + | } | |
| 72 | + | ||
| 73 | + | var xClampLayoutGetTighteningThreshold func(uintptr) int32 | |
| 74 | + | ||
| 75 | + | // Gets the size above which the children are clamped. | |
| 76 | + | func (x *ClampLayout) GetTighteningThreshold() int32 { | |
| 77 | + | ||
| 78 | + | return xClampLayoutGetTighteningThreshold(x.GoPointer()) | |
| 79 | + | ||
| 80 | + | } | |
| 81 | + | ||
| 82 | + | var xClampLayoutSetMaximumSize func(uintptr, int32) | |
| 83 | + | ||
| 84 | + | // Sets the maximum size allocated to the children. | |
| 85 | + | // | |
| 86 | + | // It is the width if the layout is horizontal, or the height if it is vertical. | |
| 87 | + | func (x *ClampLayout) SetMaximumSize(MaximumSizeVar int32) { | |
| 88 | + | ||
| 89 | + | xClampLayoutSetMaximumSize(x.GoPointer(), MaximumSizeVar) | |
| 90 | + | ||
| 91 | + | } | |
| 92 | + | ||
| 93 | + | var xClampLayoutSetTighteningThreshold func(uintptr, int32) | |
| 94 | + | ||
| 95 | + | // Sets the size above which the children are clamped. | |
| 96 | + | // | |
| 97 | + | // Starting from this size, the layout will tighten its grip on the children, | |
| 98 | + | // slowly allocating less and less of the available size up to the maximum | |
| 99 | + | // allocated size. Below that threshold and below the maximum size, the children | |
| 100 | + | // will be allocated all the available size. | |
| 101 | + | // | |
| 102 | + | // If the threshold is greater than the maximum size to allocate to the | |
| 103 | + | // children, they will be allocated the whole size up to the maximum. If the | |
| 104 | + | // threshold is lower than the minimum size to allocate to the children, that | |
| 105 | + | // size will be used as the tightening threshold. | |
| 106 | + | // | |
| 107 | + | // Effectively, tightening the grip on a child before it reaches its maximum | |
| 108 | + | // size makes transitions to and from the maximum size smoother when resizing. | |
| 109 | + | func (x *ClampLayout) SetTighteningThreshold(TighteningThresholdVar int32) { | |
| 110 | + | ||
| 111 | + | xClampLayoutSetTighteningThreshold(x.GoPointer(), TighteningThresholdVar) | |
| 112 | + | ||
| 113 | + | } | |
| 114 | + | ||
| 115 | + | func (c *ClampLayout) GoPointer() uintptr { | |
| 116 | + | return c.Ptr | |
| 117 | + | } | |
| 118 | + | ||
| 119 | + | func (c *ClampLayout) SetGoPointer(ptr uintptr) { | |
| 120 | + | c.Ptr = ptr | |
| 121 | + | } | |
| 122 | + | ||
| 123 | + | // Retrieves the orientation of the @orientable. | |
| 124 | + | func (x *ClampLayout) GetOrientation() gtk.Orientation { | |
| 125 | + | ||
| 126 | + | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 127 | + | ||
| 128 | + | } | |
| 129 | + | ||
| 130 | + | // Sets the orientation of the @orientable. | |
| 131 | + | func (x *ClampLayout) SetOrientation(OrientationVar gtk.Orientation) { | |
| 132 | + | ||
| 133 | + | gtk.XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar) | |
| 134 | + | ||
| 135 | + | } | |
| 136 | + | ||
| 137 | + | func init() { | |
| 138 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 139 | + | if err != nil { | |
| 140 | + | panic(err) | |
| 141 | + | } | |
| 142 | + | ||
| 143 | + | core.PuregoSafeRegister(&xNewClampLayout, lib, "adw_clamp_layout_new") | |
| 144 | + | ||
| 145 | + | core.PuregoSafeRegister(&xClampLayoutGetMaximumSize, lib, "adw_clamp_layout_get_maximum_size") | |
| 146 | + | core.PuregoSafeRegister(&xClampLayoutGetTighteningThreshold, lib, "adw_clamp_layout_get_tightening_threshold") | |
| 147 | + | core.PuregoSafeRegister(&xClampLayoutSetMaximumSize, lib, "adw_clamp_layout_set_maximum_size") | |
| 148 | + | core.PuregoSafeRegister(&xClampLayoutSetTighteningThreshold, lib, "adw_clamp_layout_set_tightening_threshold") | |
| 149 | + | ||
| 150 | + | } | |
A v4/adw/adw-clamp-scrollable.go +398 -0
| @@ -0,0 +1,398 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | type ClampScrollableClass struct { | |
| 12 | + | ParentClass uintptr | |
| 13 | + | } | |
| 14 | + | ||
| 15 | + | // A scrollable [class@Clamp]. | |
| 16 | + | // | |
| 17 | + | // `AdwClampScrollable` is a variant of [class@Clamp] that implements the | |
| 18 | + | // [iface@Gtk.Scrollable] interface. | |
| 19 | + | // | |
| 20 | + | // The primary use case for `AdwClampScrollable` is clamping | |
| 21 | + | // [class@Gtk.ListView]. | |
| 22 | + | type ClampScrollable struct { | |
| 23 | + | gtk.Widget | |
| 24 | + | } | |
| 25 | + | ||
| 26 | + | func ClampScrollableNewFromInternalPtr(ptr uintptr) *ClampScrollable { | |
| 27 | + | cls := &ClampScrollable{} | |
| 28 | + | cls.Ptr = ptr | |
| 29 | + | return cls | |
| 30 | + | } | |
| 31 | + | ||
| 32 | + | var xNewClampScrollable func() uintptr | |
| 33 | + | ||
| 34 | + | // Creates a new `AdwClampScrollable`. | |
| 35 | + | func NewClampScrollable() *gtk.Widget { | |
| 36 | + | NewClampScrollablePtr := xNewClampScrollable() | |
| 37 | + | if NewClampScrollablePtr == 0 { | |
| 38 | + | return nil | |
| 39 | + | } | |
| 40 | + | ||
| 41 | + | gobject.IncreaseRef(NewClampScrollablePtr) | |
| 42 | + | ||
| 43 | + | NewClampScrollableCls := >k.Widget{} | |
| 44 | + | NewClampScrollableCls.Ptr = NewClampScrollablePtr | |
| 45 | + | return NewClampScrollableCls | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | var xClampScrollableGetChild func(uintptr) uintptr | |
| 49 | + | ||
| 50 | + | // Gets the child widget of @self. | |
| 51 | + | func (x *ClampScrollable) GetChild() *gtk.Widget { | |
| 52 | + | ||
| 53 | + | GetChildPtr := xClampScrollableGetChild(x.GoPointer()) | |
| 54 | + | if GetChildPtr == 0 { | |
| 55 | + | return nil | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | gobject.IncreaseRef(GetChildPtr) | |
| 59 | + | ||
| 60 | + | GetChildCls := >k.Widget{} | |
| 61 | + | GetChildCls.Ptr = GetChildPtr | |
| 62 | + | return GetChildCls | |
| 63 | + | ||
| 64 | + | } | |
| 65 | + | ||
| 66 | + | var xClampScrollableGetMaximumSize func(uintptr) int32 | |
| 67 | + | ||
| 68 | + | // Gets the maximum size allocated to the child. | |
| 69 | + | func (x *ClampScrollable) GetMaximumSize() int32 { | |
| 70 | + | ||
| 71 | + | return xClampScrollableGetMaximumSize(x.GoPointer()) | |
| 72 | + | ||
| 73 | + | } | |
| 74 | + | ||
| 75 | + | var xClampScrollableGetTighteningThreshold func(uintptr) int32 | |
| 76 | + | ||
| 77 | + | // Gets the size above which the child is clamped. | |
| 78 | + | func (x *ClampScrollable) GetTighteningThreshold() int32 { | |
| 79 | + | ||
| 80 | + | return xClampScrollableGetTighteningThreshold(x.GoPointer()) | |
| 81 | + | ||
| 82 | + | } | |
| 83 | + | ||
| 84 | + | var xClampScrollableSetChild func(uintptr, uintptr) | |
| 85 | + | ||
| 86 | + | // Sets the child widget of @self. | |
| 87 | + | func (x *ClampScrollable) SetChild(ChildVar *gtk.Widget) { | |
| 88 | + | ||
| 89 | + | xClampScrollableSetChild(x.GoPointer(), ChildVar.GoPointer()) | |
| 90 | + | ||
| 91 | + | } | |
| 92 | + | ||
| 93 | + | var xClampScrollableSetMaximumSize func(uintptr, int32) | |
| 94 | + | ||
| 95 | + | // Sets the maximum size allocated to the child. | |
| 96 | + | // | |
| 97 | + | // It is the width if the clamp is horizontal, or the height if it is vertical. | |
| 98 | + | func (x *ClampScrollable) SetMaximumSize(MaximumSizeVar int32) { | |
| 99 | + | ||
| 100 | + | xClampScrollableSetMaximumSize(x.GoPointer(), MaximumSizeVar) | |
| 101 | + | ||
| 102 | + | } | |
| 103 | + | ||
| 104 | + | var xClampScrollableSetTighteningThreshold func(uintptr, int32) | |
| 105 | + | ||
| 106 | + | // Sets the size above which the child is clamped. | |
| 107 | + | // | |
| 108 | + | // Starting from this size, the clamp will tighten its grip on the child, slowly | |
| 109 | + | // allocating less and less of the available size up to the maximum allocated | |
| 110 | + | // size. Below that threshold and below the maximum width, the child will be | |
| 111 | + | // allocated all the available size. | |
| 112 | + | // | |
| 113 | + | // If the threshold is greater than the maximum size to allocate to the child, | |
| 114 | + | // the child will be allocated all the width up to the maximum. If the threshold | |
| 115 | + | // is lower than the minimum size to allocate to the child, that size will be | |
| 116 | + | // used as the tightening threshold. | |
| 117 | + | // | |
| 118 | + | // Effectively, tightening the grip on the child before it reaches its maximum | |
| 119 | + | // size makes transitions to and from the maximum size smoother when resizing. | |
| 120 | + | func (x *ClampScrollable) SetTighteningThreshold(TighteningThresholdVar int32) { | |
| 121 | + | ||
| 122 | + | xClampScrollableSetTighteningThreshold(x.GoPointer(), TighteningThresholdVar) | |
| 123 | + | ||
| 124 | + | } | |
| 125 | + | ||
| 126 | + | func (c *ClampScrollable) GoPointer() uintptr { | |
| 127 | + | return c.Ptr | |
| 128 | + | } | |
| 129 | + | ||
| 130 | + | func (c *ClampScrollable) SetGoPointer(ptr uintptr) { | |
| 131 | + | c.Ptr = ptr | |
| 132 | + | } | |
| 133 | + | ||
| 134 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 135 | + | func (x *ClampScrollable) GetAccessibleRole() gtk.AccessibleRole { | |
| 136 | + | ||
| 137 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 138 | + | ||
| 139 | + | } | |
| 140 | + | ||
| 141 | + | // Resets the accessible @property to its default value. | |
| 142 | + | func (x *ClampScrollable) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 143 | + | ||
| 144 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 145 | + | ||
| 146 | + | } | |
| 147 | + | ||
| 148 | + | // Resets the accessible @relation to its default value. | |
| 149 | + | func (x *ClampScrollable) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 150 | + | ||
| 151 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 152 | + | ||
| 153 | + | } | |
| 154 | + | ||
| 155 | + | // Resets the accessible @state to its default value. | |
| 156 | + | func (x *ClampScrollable) ResetState(StateVar gtk.AccessibleState) { | |
| 157 | + | ||
| 158 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 159 | + | ||
| 160 | + | } | |
| 161 | + | ||
| 162 | + | // Updates a list of accessible properties. | |
| 163 | + | // | |
| 164 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 165 | + | // value types of accessible properties. | |
| 166 | + | // | |
| 167 | + | // This function should be called by `GtkWidget` types whenever | |
| 168 | + | // an accessible property change must be communicated to assistive | |
| 169 | + | // technologies. | |
| 170 | + | // | |
| 171 | + | // Example: | |
| 172 | + | // ```c | |
| 173 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 174 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 175 | + | // | |
| 176 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 177 | + | // -1); | |
| 178 | + | // | |
| 179 | + | // ``` | |
| 180 | + | func (x *ClampScrollable) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 181 | + | ||
| 182 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 183 | + | ||
| 184 | + | } | |
| 185 | + | ||
| 186 | + | // Updates an array of accessible properties. | |
| 187 | + | // | |
| 188 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 189 | + | // property change must be communicated to assistive technologies. | |
| 190 | + | // | |
| 191 | + | // This function is meant to be used by language bindings. | |
| 192 | + | func (x *ClampScrollable) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 193 | + | ||
| 194 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 195 | + | ||
| 196 | + | } | |
| 197 | + | ||
| 198 | + | // Updates a list of accessible relations. | |
| 199 | + | // | |
| 200 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 201 | + | // relation change must be communicated to assistive technologies. | |
| 202 | + | // | |
| 203 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 204 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 205 | + | // | |
| 206 | + | // ```c | |
| 207 | + | // gtk_accessible_update_relation (accessible, | |
| 208 | + | // | |
| 209 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 210 | + | // ref1, NULL, | |
| 211 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 212 | + | // ref1, ref2, ref3, NULL, | |
| 213 | + | // -1); | |
| 214 | + | // | |
| 215 | + | // ``` | |
| 216 | + | func (x *ClampScrollable) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 217 | + | ||
| 218 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 219 | + | ||
| 220 | + | } | |
| 221 | + | ||
| 222 | + | // Updates an array of accessible relations. | |
| 223 | + | // | |
| 224 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 225 | + | // relation change must be communicated to assistive technologies. | |
| 226 | + | // | |
| 227 | + | // This function is meant to be used by language bindings. | |
| 228 | + | func (x *ClampScrollable) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 229 | + | ||
| 230 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 231 | + | ||
| 232 | + | } | |
| 233 | + | ||
| 234 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 235 | + | // documentation for the value types of accessible states. | |
| 236 | + | // | |
| 237 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 238 | + | // state change must be communicated to assistive technologies. | |
| 239 | + | // | |
| 240 | + | // Example: | |
| 241 | + | // ```c | |
| 242 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 243 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 244 | + | // | |
| 245 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 246 | + | // -1); | |
| 247 | + | // | |
| 248 | + | // ``` | |
| 249 | + | func (x *ClampScrollable) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 250 | + | ||
| 251 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 252 | + | ||
| 253 | + | } | |
| 254 | + | ||
| 255 | + | // Updates an array of accessible states. | |
| 256 | + | // | |
| 257 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 258 | + | // state change must be communicated to assistive technologies. | |
| 259 | + | // | |
| 260 | + | // This function is meant to be used by language bindings. | |
| 261 | + | func (x *ClampScrollable) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 262 | + | ||
| 263 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 264 | + | ||
| 265 | + | } | |
| 266 | + | ||
| 267 | + | // Gets the ID of the @buildable object. | |
| 268 | + | // | |
| 269 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 270 | + | // of the <object> tag used to construct the @buildable. | |
| 271 | + | func (x *ClampScrollable) GetBuildableId() string { | |
| 272 | + | ||
| 273 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 274 | + | ||
| 275 | + | } | |
| 276 | + | ||
| 277 | + | // Retrieves the orientation of the @orientable. | |
| 278 | + | func (x *ClampScrollable) GetOrientation() gtk.Orientation { | |
| 279 | + | ||
| 280 | + | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 281 | + | ||
| 282 | + | } | |
| 283 | + | ||
| 284 | + | // Sets the orientation of the @orientable. | |
| 285 | + | func (x *ClampScrollable) SetOrientation(OrientationVar gtk.Orientation) { | |
| 286 | + | ||
| 287 | + | gtk.XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar) | |
| 288 | + | ||
| 289 | + | } | |
| 290 | + | ||
| 291 | + | // Returns the size of a non-scrolling border around the | |
| 292 | + | // outside of the scrollable. | |
| 293 | + | // | |
| 294 | + | // An example for this would be treeview headers. GTK can use | |
| 295 | + | // this information to display overlaid graphics, like the | |
| 296 | + | // overshoot indication, at the right position. | |
| 297 | + | func (x *ClampScrollable) GetBorder(BorderVar *gtk.Border) bool { | |
| 298 | + | ||
| 299 | + | return gtk.XGtkScrollableGetBorder(x.GoPointer(), BorderVar) | |
| 300 | + | ||
| 301 | + | } | |
| 302 | + | ||
| 303 | + | // Retrieves the `GtkAdjustment` used for horizontal scrolling. | |
| 304 | + | func (x *ClampScrollable) GetHadjustment() *gtk.Adjustment { | |
| 305 | + | ||
| 306 | + | GetHadjustmentPtr := gtk.XGtkScrollableGetHadjustment(x.GoPointer()) | |
| 307 | + | if GetHadjustmentPtr == 0 { | |
| 308 | + | return nil | |
| 309 | + | } | |
| 310 | + | ||
| 311 | + | gobject.IncreaseRef(GetHadjustmentPtr) | |
| 312 | + | ||
| 313 | + | GetHadjustmentCls := >k.Adjustment{} | |
| 314 | + | GetHadjustmentCls.Ptr = GetHadjustmentPtr | |
| 315 | + | return GetHadjustmentCls | |
| 316 | + | ||
| 317 | + | } | |
| 318 | + | ||
| 319 | + | // Gets the horizontal `GtkScrollablePolicy`. | |
| 320 | + | func (x *ClampScrollable) GetHscrollPolicy() gtk.ScrollablePolicy { | |
| 321 | + | ||
| 322 | + | return gtk.XGtkScrollableGetHscrollPolicy(x.GoPointer()) | |
| 323 | + | ||
| 324 | + | } | |
| 325 | + | ||
| 326 | + | // Retrieves the `GtkAdjustment` used for vertical scrolling. | |
| 327 | + | func (x *ClampScrollable) GetVadjustment() *gtk.Adjustment { | |
| 328 | + | ||
| 329 | + | GetVadjustmentPtr := gtk.XGtkScrollableGetVadjustment(x.GoPointer()) | |
| 330 | + | if GetVadjustmentPtr == 0 { | |
| 331 | + | return nil | |
| 332 | + | } | |
| 333 | + | ||
| 334 | + | gobject.IncreaseRef(GetVadjustmentPtr) | |
| 335 | + | ||
| 336 | + | GetVadjustmentCls := >k.Adjustment{} | |
| 337 | + | GetVadjustmentCls.Ptr = GetVadjustmentPtr | |
| 338 | + | return GetVadjustmentCls | |
| 339 | + | ||
| 340 | + | } | |
| 341 | + | ||
| 342 | + | // Gets the vertical `GtkScrollablePolicy`. | |
| 343 | + | func (x *ClampScrollable) GetVscrollPolicy() gtk.ScrollablePolicy { | |
| 344 | + | ||
| 345 | + | return gtk.XGtkScrollableGetVscrollPolicy(x.GoPointer()) | |
| 346 | + | ||
| 347 | + | } | |
| 348 | + | ||
| 349 | + | // Sets the horizontal adjustment of the `GtkScrollable`. | |
| 350 | + | func (x *ClampScrollable) SetHadjustment(HadjustmentVar *gtk.Adjustment) { | |
| 351 | + | ||
| 352 | + | gtk.XGtkScrollableSetHadjustment(x.GoPointer(), HadjustmentVar.GoPointer()) | |
| 353 | + | ||
| 354 | + | } | |
| 355 | + | ||
| 356 | + | // Sets the `GtkScrollablePolicy`. | |
| 357 | + | // | |
| 358 | + | // The policy determines whether horizontal scrolling should start | |
| 359 | + | // below the minimum width or below the natural width. | |
| 360 | + | func (x *ClampScrollable) SetHscrollPolicy(PolicyVar gtk.ScrollablePolicy) { | |
| 361 | + | ||
| 362 | + | gtk.XGtkScrollableSetHscrollPolicy(x.GoPointer(), PolicyVar) | |
| 363 | + | ||
| 364 | + | } | |
| 365 | + | ||
| 366 | + | // Sets the vertical adjustment of the `GtkScrollable`. | |
| 367 | + | func (x *ClampScrollable) SetVadjustment(VadjustmentVar *gtk.Adjustment) { | |
| 368 | + | ||
| 369 | + | gtk.XGtkScrollableSetVadjustment(x.GoPointer(), VadjustmentVar.GoPointer()) | |
| 370 | + | ||
| 371 | + | } | |
| 372 | + | ||
| 373 | + | // Sets the `GtkScrollablePolicy`. | |
| 374 | + | // | |
| 375 | + | // The policy determines whether vertical scrolling should start | |
| 376 | + | // below the minimum height or below the natural height. | |
| 377 | + | func (x *ClampScrollable) SetVscrollPolicy(PolicyVar gtk.ScrollablePolicy) { | |
| 378 | + | ||
| 379 | + | gtk.XGtkScrollableSetVscrollPolicy(x.GoPointer(), PolicyVar) | |
| 380 | + | ||
| 381 | + | } | |
| 382 | + | ||
| 383 | + | func init() { | |
| 384 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 385 | + | if err != nil { | |
| 386 | + | panic(err) | |
| 387 | + | } | |
| 388 | + | ||
| 389 | + | core.PuregoSafeRegister(&xNewClampScrollable, lib, "adw_clamp_scrollable_new") | |
| 390 | + | ||
| 391 | + | core.PuregoSafeRegister(&xClampScrollableGetChild, lib, "adw_clamp_scrollable_get_child") | |
| 392 | + | core.PuregoSafeRegister(&xClampScrollableGetMaximumSize, lib, "adw_clamp_scrollable_get_maximum_size") | |
| 393 | + | core.PuregoSafeRegister(&xClampScrollableGetTighteningThreshold, lib, "adw_clamp_scrollable_get_tightening_threshold") | |
| 394 | + | core.PuregoSafeRegister(&xClampScrollableSetChild, lib, "adw_clamp_scrollable_set_child") | |
| 395 | + | core.PuregoSafeRegister(&xClampScrollableSetMaximumSize, lib, "adw_clamp_scrollable_set_maximum_size") | |
| 396 | + | core.PuregoSafeRegister(&xClampScrollableSetTighteningThreshold, lib, "adw_clamp_scrollable_set_tightening_threshold") | |
| 397 | + | ||
| 398 | + | } | |
A v4/adw/adw-clamp.go +329 -0
| @@ -0,0 +1,329 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | type ClampClass struct { | |
| 12 | + | ParentClass uintptr | |
| 13 | + | } | |
| 14 | + | ||
| 15 | + | // A widget constraining its child to a given size. | |
| 16 | + | // | |
| 17 | + | // <picture> | |
| 18 | + | // | |
| 19 | + | // <source srcset="clamp-wide-dark.png" media="(prefers-color-scheme: dark)"> | |
| 20 | + | // <img src="clamp-wide.png" alt="clamp-wide"> | |
| 21 | + | // | |
| 22 | + | // </picture> | |
| 23 | + | // <picture> | |
| 24 | + | // | |
| 25 | + | // <source srcset="clamp-narrow-dark.png" media="(prefers-color-scheme: dark)"> | |
| 26 | + | // <img src="clamp-narrow.png" alt="clamp-narrow"> | |
| 27 | + | // | |
| 28 | + | // </picture> | |
| 29 | + | // | |
| 30 | + | // The `AdwClamp` widget constrains the size of the widget it contains to a | |
| 31 | + | // given maximum size. It will constrain the width if it is horizontal, or the | |
| 32 | + | // height if it is vertical. The expansion of the child from its minimum to its | |
| 33 | + | // maximum size is eased out for a smooth transition. | |
| 34 | + | // | |
| 35 | + | // If the child requires more than the requested maximum size, it will be | |
| 36 | + | // allocated the minimum size it can fit in instead. | |
| 37 | + | // | |
| 38 | + | // ## CSS nodes | |
| 39 | + | // | |
| 40 | + | // `AdwClamp` has a single CSS node with name `clamp`. | |
| 41 | + | // | |
| 42 | + | // Its children will receive the style classes `.large` when the child reached | |
| 43 | + | // its maximum size, `.small` when the clamp allocates its full size to the | |
| 44 | + | // child, `.medium` in-between, or none if it hasn't computed its size yet. | |
| 45 | + | type Clamp struct { | |
| 46 | + | gtk.Widget | |
| 47 | + | } | |
| 48 | + | ||
| 49 | + | func ClampNewFromInternalPtr(ptr uintptr) *Clamp { | |
| 50 | + | cls := &Clamp{} | |
| 51 | + | cls.Ptr = ptr | |
| 52 | + | return cls | |
| 53 | + | } | |
| 54 | + | ||
| 55 | + | var xNewClamp func() uintptr | |
| 56 | + | ||
| 57 | + | // Creates a new `AdwClamp`. | |
| 58 | + | func NewClamp() *gtk.Widget { | |
| 59 | + | NewClampPtr := xNewClamp() | |
| 60 | + | if NewClampPtr == 0 { | |
| 61 | + | return nil | |
| 62 | + | } | |
| 63 | + | ||
| 64 | + | gobject.IncreaseRef(NewClampPtr) | |
| 65 | + | ||
| 66 | + | NewClampCls := >k.Widget{} | |
| 67 | + | NewClampCls.Ptr = NewClampPtr | |
| 68 | + | return NewClampCls | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | var xClampGetChild func(uintptr) uintptr | |
| 72 | + | ||
| 73 | + | // Gets the child widget of @self. | |
| 74 | + | func (x *Clamp) GetChild() *gtk.Widget { | |
| 75 | + | ||
| 76 | + | GetChildPtr := xClampGetChild(x.GoPointer()) | |
| 77 | + | if GetChildPtr == 0 { | |
| 78 | + | return nil | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | gobject.IncreaseRef(GetChildPtr) | |
| 82 | + | ||
| 83 | + | GetChildCls := >k.Widget{} | |
| 84 | + | GetChildCls.Ptr = GetChildPtr | |
| 85 | + | return GetChildCls | |
| 86 | + | ||
| 87 | + | } | |
| 88 | + | ||
| 89 | + | var xClampGetMaximumSize func(uintptr) int32 | |
| 90 | + | ||
| 91 | + | // Gets the maximum size allocated to the child. | |
| 92 | + | func (x *Clamp) GetMaximumSize() int32 { | |
| 93 | + | ||
| 94 | + | return xClampGetMaximumSize(x.GoPointer()) | |
| 95 | + | ||
| 96 | + | } | |
| 97 | + | ||
| 98 | + | var xClampGetTighteningThreshold func(uintptr) int32 | |
| 99 | + | ||
| 100 | + | // Gets the size above which the child is clamped. | |
| 101 | + | func (x *Clamp) GetTighteningThreshold() int32 { | |
| 102 | + | ||
| 103 | + | return xClampGetTighteningThreshold(x.GoPointer()) | |
| 104 | + | ||
| 105 | + | } | |
| 106 | + | ||
| 107 | + | var xClampSetChild func(uintptr, uintptr) | |
| 108 | + | ||
| 109 | + | // Sets the child widget of @self. | |
| 110 | + | func (x *Clamp) SetChild(ChildVar *gtk.Widget) { | |
| 111 | + | ||
| 112 | + | xClampSetChild(x.GoPointer(), ChildVar.GoPointer()) | |
| 113 | + | ||
| 114 | + | } | |
| 115 | + | ||
| 116 | + | var xClampSetMaximumSize func(uintptr, int32) | |
| 117 | + | ||
| 118 | + | // Sets the maximum size allocated to the child. | |
| 119 | + | // | |
| 120 | + | // It is the width if the clamp is horizontal, or the height if it is vertical. | |
| 121 | + | func (x *Clamp) SetMaximumSize(MaximumSizeVar int32) { | |
| 122 | + | ||
| 123 | + | xClampSetMaximumSize(x.GoPointer(), MaximumSizeVar) | |
| 124 | + | ||
| 125 | + | } | |
| 126 | + | ||
| 127 | + | var xClampSetTighteningThreshold func(uintptr, int32) | |
| 128 | + | ||
| 129 | + | // Sets the size above which the child is clamped. | |
| 130 | + | // | |
| 131 | + | // Starting from this size, the clamp will tighten its grip on the child, slowly | |
| 132 | + | // allocating less and less of the available size up to the maximum allocated | |
| 133 | + | // size. Below that threshold and below the maximum size, the child will be | |
| 134 | + | // allocated all the available size. | |
| 135 | + | // | |
| 136 | + | // If the threshold is greater than the maximum size to allocate to the child, | |
| 137 | + | // the child will be allocated all the size up to the maximum. If the threshold | |
| 138 | + | // is lower than the minimum size to allocate to the child, that size will be | |
| 139 | + | // used as the tightening threshold. | |
| 140 | + | // | |
| 141 | + | // Effectively, tightening the grip on the child before it reaches its maximum | |
| 142 | + | // size makes transitions to and from the maximum size smoother when resizing. | |
| 143 | + | func (x *Clamp) SetTighteningThreshold(TighteningThresholdVar int32) { | |
| 144 | + | ||
| 145 | + | xClampSetTighteningThreshold(x.GoPointer(), TighteningThresholdVar) | |
| 146 | + | ||
| 147 | + | } | |
| 148 | + | ||
| 149 | + | func (c *Clamp) GoPointer() uintptr { | |
| 150 | + | return c.Ptr | |
| 151 | + | } | |
| 152 | + | ||
| 153 | + | func (c *Clamp) SetGoPointer(ptr uintptr) { | |
| 154 | + | c.Ptr = ptr | |
| 155 | + | } | |
| 156 | + | ||
| 157 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 158 | + | func (x *Clamp) GetAccessibleRole() gtk.AccessibleRole { | |
| 159 | + | ||
| 160 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 161 | + | ||
| 162 | + | } | |
| 163 | + | ||
| 164 | + | // Resets the accessible @property to its default value. | |
| 165 | + | func (x *Clamp) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 166 | + | ||
| 167 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 168 | + | ||
| 169 | + | } | |
| 170 | + | ||
| 171 | + | // Resets the accessible @relation to its default value. | |
| 172 | + | func (x *Clamp) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 173 | + | ||
| 174 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 175 | + | ||
| 176 | + | } | |
| 177 | + | ||
| 178 | + | // Resets the accessible @state to its default value. | |
| 179 | + | func (x *Clamp) ResetState(StateVar gtk.AccessibleState) { | |
| 180 | + | ||
| 181 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 182 | + | ||
| 183 | + | } | |
| 184 | + | ||
| 185 | + | // Updates a list of accessible properties. | |
| 186 | + | // | |
| 187 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 188 | + | // value types of accessible properties. | |
| 189 | + | // | |
| 190 | + | // This function should be called by `GtkWidget` types whenever | |
| 191 | + | // an accessible property change must be communicated to assistive | |
| 192 | + | // technologies. | |
| 193 | + | // | |
| 194 | + | // Example: | |
| 195 | + | // ```c | |
| 196 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 197 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 198 | + | // | |
| 199 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 200 | + | // -1); | |
| 201 | + | // | |
| 202 | + | // ``` | |
| 203 | + | func (x *Clamp) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 204 | + | ||
| 205 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 206 | + | ||
| 207 | + | } | |
| 208 | + | ||
| 209 | + | // Updates an array of accessible properties. | |
| 210 | + | // | |
| 211 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 212 | + | // property change must be communicated to assistive technologies. | |
| 213 | + | // | |
| 214 | + | // This function is meant to be used by language bindings. | |
| 215 | + | func (x *Clamp) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 216 | + | ||
| 217 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 218 | + | ||
| 219 | + | } | |
| 220 | + | ||
| 221 | + | // Updates a list of accessible relations. | |
| 222 | + | // | |
| 223 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 224 | + | // relation change must be communicated to assistive technologies. | |
| 225 | + | // | |
| 226 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 227 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 228 | + | // | |
| 229 | + | // ```c | |
| 230 | + | // gtk_accessible_update_relation (accessible, | |
| 231 | + | // | |
| 232 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 233 | + | // ref1, NULL, | |
| 234 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 235 | + | // ref1, ref2, ref3, NULL, | |
| 236 | + | // -1); | |
| 237 | + | // | |
| 238 | + | // ``` | |
| 239 | + | func (x *Clamp) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 240 | + | ||
| 241 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 242 | + | ||
| 243 | + | } | |
| 244 | + | ||
| 245 | + | // Updates an array of accessible relations. | |
| 246 | + | // | |
| 247 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 248 | + | // relation change must be communicated to assistive technologies. | |
| 249 | + | // | |
| 250 | + | // This function is meant to be used by language bindings. | |
| 251 | + | func (x *Clamp) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 252 | + | ||
| 253 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 254 | + | ||
| 255 | + | } | |
| 256 | + | ||
| 257 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 258 | + | // documentation for the value types of accessible states. | |
| 259 | + | // | |
| 260 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 261 | + | // state change must be communicated to assistive technologies. | |
| 262 | + | // | |
| 263 | + | // Example: | |
| 264 | + | // ```c | |
| 265 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 266 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 267 | + | // | |
| 268 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 269 | + | // -1); | |
| 270 | + | // | |
| 271 | + | // ``` | |
| 272 | + | func (x *Clamp) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 273 | + | ||
| 274 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 275 | + | ||
| 276 | + | } | |
| 277 | + | ||
| 278 | + | // Updates an array of accessible states. | |
| 279 | + | // | |
| 280 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 281 | + | // state change must be communicated to assistive technologies. | |
| 282 | + | // | |
| 283 | + | // This function is meant to be used by language bindings. | |
| 284 | + | func (x *Clamp) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 285 | + | ||
| 286 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 287 | + | ||
| 288 | + | } | |
| 289 | + | ||
| 290 | + | // Gets the ID of the @buildable object. | |
| 291 | + | // | |
| 292 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 293 | + | // of the <object> tag used to construct the @buildable. | |
| 294 | + | func (x *Clamp) GetBuildableId() string { | |
| 295 | + | ||
| 296 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 297 | + | ||
| 298 | + | } | |
| 299 | + | ||
| 300 | + | // Retrieves the orientation of the @orientable. | |
| 301 | + | func (x *Clamp) GetOrientation() gtk.Orientation { | |
| 302 | + | ||
| 303 | + | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 304 | + | ||
| 305 | + | } | |
| 306 | + | ||
| 307 | + | // Sets the orientation of the @orientable. | |
| 308 | + | func (x *Clamp) SetOrientation(OrientationVar gtk.Orientation) { | |
| 309 | + | ||
| 310 | + | gtk.XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar) | |
| 311 | + | ||
| 312 | + | } | |
| 313 | + | ||
| 314 | + | func init() { | |
| 315 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 316 | + | if err != nil { | |
| 317 | + | panic(err) | |
| 318 | + | } | |
| 319 | + | ||
| 320 | + | core.PuregoSafeRegister(&xNewClamp, lib, "adw_clamp_new") | |
| 321 | + | ||
| 322 | + | core.PuregoSafeRegister(&xClampGetChild, lib, "adw_clamp_get_child") | |
| 323 | + | core.PuregoSafeRegister(&xClampGetMaximumSize, lib, "adw_clamp_get_maximum_size") | |
| 324 | + | core.PuregoSafeRegister(&xClampGetTighteningThreshold, lib, "adw_clamp_get_tightening_threshold") | |
| 325 | + | core.PuregoSafeRegister(&xClampSetChild, lib, "adw_clamp_set_child") | |
| 326 | + | core.PuregoSafeRegister(&xClampSetMaximumSize, lib, "adw_clamp_set_maximum_size") | |
| 327 | + | core.PuregoSafeRegister(&xClampSetTighteningThreshold, lib, "adw_clamp_set_tightening_threshold") | |
| 328 | + | ||
| 329 | + | } | |
A v4/adw/adw-combo-row.go +533 -0
| @@ -0,0 +1,533 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gio" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 11 | + | ) | |
| 12 | + | ||
| 13 | + | type ComboRowClass struct { | |
| 14 | + | ParentClass uintptr | |
| 15 | + | ||
| 16 | + | Padding uintptr | |
| 17 | + | } | |
| 18 | + | ||
| 19 | + | // A [class@Gtk.ListBoxRow] used to choose from a list of items. | |
| 20 | + | // | |
| 21 | + | // <picture> | |
| 22 | + | // | |
| 23 | + | // <source srcset="combo-row-dark.png" media="(prefers-color-scheme: dark)"> | |
| 24 | + | // <img src="combo-row.png" alt="combo-row"> | |
| 25 | + | // | |
| 26 | + | // </picture> | |
| 27 | + | // | |
| 28 | + | // The `AdwComboRow` widget allows the user to choose from a list of valid | |
| 29 | + | // choices. The row displays the selected choice. When activated, the row | |
| 30 | + | // displays a popover which allows the user to make a new choice. | |
| 31 | + | // | |
| 32 | + | // Example of an `AdwComboRow` UI definition: | |
| 33 | + | // ```xml | |
| 34 | + | // <object class="AdwComboRow"> | |
| 35 | + | // | |
| 36 | + | // <property name="title" translatable="yes">Combo Row</property> | |
| 37 | + | // <property name="model"> | |
| 38 | + | // <object class="GtkStringList"> | |
| 39 | + | // <items> | |
| 40 | + | // <item translatable="yes">Foo</item> | |
| 41 | + | // <item translatable="yes">Bar</item> | |
| 42 | + | // <item translatable="yes">Baz</item> | |
| 43 | + | // </items> | |
| 44 | + | // </object> | |
| 45 | + | // </property> | |
| 46 | + | // | |
| 47 | + | // </object> | |
| 48 | + | // ``` | |
| 49 | + | // | |
| 50 | + | // The [property@ComboRow:selected] and [property@ComboRow:selected-item] | |
| 51 | + | // properties can be used to keep track of the selected item and react to their | |
| 52 | + | // changes. | |
| 53 | + | // | |
| 54 | + | // `AdwComboRow` mirrors [class@Gtk.DropDown], see that widget for details. | |
| 55 | + | // | |
| 56 | + | // `AdwComboRow` is [property@Gtk.ListBoxRow:activatable] if a model is set. | |
| 57 | + | // | |
| 58 | + | // ## CSS nodes | |
| 59 | + | // | |
| 60 | + | // `AdwComboRow` has a main CSS node with name `row` and the `.combo` style | |
| 61 | + | // class. | |
| 62 | + | // | |
| 63 | + | // Its popover has the node named `popover` with the `.menu` style class, it | |
| 64 | + | // contains a [class@Gtk.ScrolledWindow], which in turn contains a | |
| 65 | + | // [class@Gtk.ListView], both are accessible via their regular nodes. | |
| 66 | + | // | |
| 67 | + | // ## Accessibility | |
| 68 | + | // | |
| 69 | + | // `AdwComboRow` uses the `GTK_ACCESSIBLE_ROLE_COMBO_BOX` role. | |
| 70 | + | type ComboRow struct { | |
| 71 | + | ActionRow | |
| 72 | + | } | |
| 73 | + | ||
| 74 | + | func ComboRowNewFromInternalPtr(ptr uintptr) *ComboRow { | |
| 75 | + | cls := &ComboRow{} | |
| 76 | + | cls.Ptr = ptr | |
| 77 | + | return cls | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | var xNewComboRow func() uintptr | |
| 81 | + | ||
| 82 | + | // Creates a new `AdwComboRow`. | |
| 83 | + | func NewComboRow() *gtk.Widget { | |
| 84 | + | NewComboRowPtr := xNewComboRow() | |
| 85 | + | if NewComboRowPtr == 0 { | |
| 86 | + | return nil | |
| 87 | + | } | |
| 88 | + | ||
| 89 | + | gobject.IncreaseRef(NewComboRowPtr) | |
| 90 | + | ||
| 91 | + | NewComboRowCls := >k.Widget{} | |
| 92 | + | NewComboRowCls.Ptr = NewComboRowPtr | |
| 93 | + | return NewComboRowCls | |
| 94 | + | } | |
| 95 | + | ||
| 96 | + | var xComboRowGetExpression func(uintptr) uintptr | |
| 97 | + | ||
| 98 | + | // Gets the expression used to obtain strings from items. | |
| 99 | + | func (x *ComboRow) GetExpression() *gtk.Expression { | |
| 100 | + | ||
| 101 | + | GetExpressionPtr := xComboRowGetExpression(x.GoPointer()) | |
| 102 | + | if GetExpressionPtr == 0 { | |
| 103 | + | return nil | |
| 104 | + | } | |
| 105 | + | ||
| 106 | + | gobject.IncreaseRef(GetExpressionPtr) | |
| 107 | + | ||
| 108 | + | GetExpressionCls := >k.Expression{} | |
| 109 | + | GetExpressionCls.Ptr = GetExpressionPtr | |
| 110 | + | return GetExpressionCls | |
| 111 | + | ||
| 112 | + | } | |
| 113 | + | ||
| 114 | + | var xComboRowGetFactory func(uintptr) uintptr | |
| 115 | + | ||
| 116 | + | // Gets the factory for populating list items. | |
| 117 | + | func (x *ComboRow) GetFactory() *gtk.ListItemFactory { | |
| 118 | + | ||
| 119 | + | GetFactoryPtr := xComboRowGetFactory(x.GoPointer()) | |
| 120 | + | if GetFactoryPtr == 0 { | |
| 121 | + | return nil | |
| 122 | + | } | |
| 123 | + | ||
| 124 | + | gobject.IncreaseRef(GetFactoryPtr) | |
| 125 | + | ||
| 126 | + | GetFactoryCls := >k.ListItemFactory{} | |
| 127 | + | GetFactoryCls.Ptr = GetFactoryPtr | |
| 128 | + | return GetFactoryCls | |
| 129 | + | ||
| 130 | + | } | |
| 131 | + | ||
| 132 | + | var xComboRowGetListFactory func(uintptr) uintptr | |
| 133 | + | ||
| 134 | + | // Gets the factory for populating list items in the popup. | |
| 135 | + | func (x *ComboRow) GetListFactory() *gtk.ListItemFactory { | |
| 136 | + | ||
| 137 | + | GetListFactoryPtr := xComboRowGetListFactory(x.GoPointer()) | |
| 138 | + | if GetListFactoryPtr == 0 { | |
| 139 | + | return nil | |
| 140 | + | } | |
| 141 | + | ||
| 142 | + | gobject.IncreaseRef(GetListFactoryPtr) | |
| 143 | + | ||
| 144 | + | GetListFactoryCls := >k.ListItemFactory{} | |
| 145 | + | GetListFactoryCls.Ptr = GetListFactoryPtr | |
| 146 | + | return GetListFactoryCls | |
| 147 | + | ||
| 148 | + | } | |
| 149 | + | ||
| 150 | + | var xComboRowGetModel func(uintptr) uintptr | |
| 151 | + | ||
| 152 | + | // Gets the model that provides the displayed items. | |
| 153 | + | func (x *ComboRow) GetModel() *gio.ListModelBase { | |
| 154 | + | ||
| 155 | + | GetModelPtr := xComboRowGetModel(x.GoPointer()) | |
| 156 | + | if GetModelPtr == 0 { | |
| 157 | + | return nil | |
| 158 | + | } | |
| 159 | + | ||
| 160 | + | gobject.IncreaseRef(GetModelPtr) | |
| 161 | + | ||
| 162 | + | GetModelCls := &gio.ListModelBase{} | |
| 163 | + | GetModelCls.Ptr = GetModelPtr | |
| 164 | + | return GetModelCls | |
| 165 | + | ||
| 166 | + | } | |
| 167 | + | ||
| 168 | + | var xComboRowGetSelected func(uintptr) uint | |
| 169 | + | ||
| 170 | + | // Gets the position of the selected item. | |
| 171 | + | func (x *ComboRow) GetSelected() uint { | |
| 172 | + | ||
| 173 | + | return xComboRowGetSelected(x.GoPointer()) | |
| 174 | + | ||
| 175 | + | } | |
| 176 | + | ||
| 177 | + | var xComboRowGetSelectedItem func(uintptr) uintptr | |
| 178 | + | ||
| 179 | + | // Gets the selected item. | |
| 180 | + | func (x *ComboRow) GetSelectedItem() *gobject.Object { | |
| 181 | + | ||
| 182 | + | GetSelectedItemPtr := xComboRowGetSelectedItem(x.GoPointer()) | |
| 183 | + | if GetSelectedItemPtr == 0 { | |
| 184 | + | return nil | |
| 185 | + | } | |
| 186 | + | ||
| 187 | + | gobject.IncreaseRef(GetSelectedItemPtr) | |
| 188 | + | ||
| 189 | + | GetSelectedItemCls := &gobject.Object{} | |
| 190 | + | GetSelectedItemCls.Ptr = GetSelectedItemPtr | |
| 191 | + | return GetSelectedItemCls | |
| 192 | + | ||
| 193 | + | } | |
| 194 | + | ||
| 195 | + | var xComboRowGetUseSubtitle func(uintptr) bool | |
| 196 | + | ||
| 197 | + | // Gets whether to use the current value as the subtitle. | |
| 198 | + | func (x *ComboRow) GetUseSubtitle() bool { | |
| 199 | + | ||
| 200 | + | return xComboRowGetUseSubtitle(x.GoPointer()) | |
| 201 | + | ||
| 202 | + | } | |
| 203 | + | ||
| 204 | + | var xComboRowSetExpression func(uintptr, uintptr) | |
| 205 | + | ||
| 206 | + | // Sets the expression used to obtain strings from items. | |
| 207 | + | // | |
| 208 | + | // The expression must have a value type of `G_TYPE_STRING`. | |
| 209 | + | // | |
| 210 | + | // It's used to bind strings to labels produced by the default factory if | |
| 211 | + | // [property@ComboRow:factory] is not set, or when | |
| 212 | + | // [property@ComboRow:use-subtitle] is set to `TRUE`. | |
| 213 | + | func (x *ComboRow) SetExpression(ExpressionVar *gtk.Expression) { | |
| 214 | + | ||
| 215 | + | xComboRowSetExpression(x.GoPointer(), ExpressionVar.GoPointer()) | |
| 216 | + | ||
| 217 | + | } | |
| 218 | + | ||
| 219 | + | var xComboRowSetFactory func(uintptr, uintptr) | |
| 220 | + | ||
| 221 | + | // Sets the factory for populating list items. | |
| 222 | + | // | |
| 223 | + | // This factory is always used for the item in the row. It is also used for | |
| 224 | + | // items in the popup unless [property@ComboRow:list-factory] is set. | |
| 225 | + | func (x *ComboRow) SetFactory(FactoryVar *gtk.ListItemFactory) { | |
| 226 | + | ||
| 227 | + | xComboRowSetFactory(x.GoPointer(), FactoryVar.GoPointer()) | |
| 228 | + | ||
| 229 | + | } | |
| 230 | + | ||
| 231 | + | var xComboRowSetListFactory func(uintptr, uintptr) | |
| 232 | + | ||
| 233 | + | // Sets the factory for populating list items in the popup. | |
| 234 | + | // | |
| 235 | + | // If this is not set, [property@ComboRow:factory] is used. | |
| 236 | + | func (x *ComboRow) SetListFactory(FactoryVar *gtk.ListItemFactory) { | |
| 237 | + | ||
| 238 | + | xComboRowSetListFactory(x.GoPointer(), FactoryVar.GoPointer()) | |
| 239 | + | ||
| 240 | + | } | |
| 241 | + | ||
| 242 | + | var xComboRowSetModel func(uintptr, uintptr) | |
| 243 | + | ||
| 244 | + | // Sets the model that provides the displayed items. | |
| 245 | + | func (x *ComboRow) SetModel(ModelVar gio.ListModel) { | |
| 246 | + | ||
| 247 | + | xComboRowSetModel(x.GoPointer(), ModelVar.GoPointer()) | |
| 248 | + | ||
| 249 | + | } | |
| 250 | + | ||
| 251 | + | var xComboRowSetSelected func(uintptr, uint) | |
| 252 | + | ||
| 253 | + | // Selects the item at the given position. | |
| 254 | + | func (x *ComboRow) SetSelected(PositionVar uint) { | |
| 255 | + | ||
| 256 | + | xComboRowSetSelected(x.GoPointer(), PositionVar) | |
| 257 | + | ||
| 258 | + | } | |
| 259 | + | ||
| 260 | + | var xComboRowSetUseSubtitle func(uintptr, bool) | |
| 261 | + | ||
| 262 | + | // Sets whether to use the current value as the subtitle. | |
| 263 | + | // | |
| 264 | + | // If you use a custom list item factory, you will need to give the row a | |
| 265 | + | // name conversion expression with [property@ComboRow:expression]. | |
| 266 | + | // | |
| 267 | + | // If set to `TRUE`, you should not access [property@ActionRow:subtitle]. | |
| 268 | + | // | |
| 269 | + | // The subtitle is interpreted as Pango markup if | |
| 270 | + | // [property@PreferencesRow:use-markup] is set to `TRUE`. | |
| 271 | + | func (x *ComboRow) SetUseSubtitle(UseSubtitleVar bool) { | |
| 272 | + | ||
| 273 | + | xComboRowSetUseSubtitle(x.GoPointer(), UseSubtitleVar) | |
| 274 | + | ||
| 275 | + | } | |
| 276 | + | ||
| 277 | + | func (c *ComboRow) GoPointer() uintptr { | |
| 278 | + | return c.Ptr | |
| 279 | + | } | |
| 280 | + | ||
| 281 | + | func (c *ComboRow) SetGoPointer(ptr uintptr) { | |
| 282 | + | c.Ptr = ptr | |
| 283 | + | } | |
| 284 | + | ||
| 285 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 286 | + | func (x *ComboRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 287 | + | ||
| 288 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 289 | + | ||
| 290 | + | } | |
| 291 | + | ||
| 292 | + | // Resets the accessible @property to its default value. | |
| 293 | + | func (x *ComboRow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 294 | + | ||
| 295 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 296 | + | ||
| 297 | + | } | |
| 298 | + | ||
| 299 | + | // Resets the accessible @relation to its default value. | |
| 300 | + | func (x *ComboRow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 301 | + | ||
| 302 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 303 | + | ||
| 304 | + | } | |
| 305 | + | ||
| 306 | + | // Resets the accessible @state to its default value. | |
| 307 | + | func (x *ComboRow) ResetState(StateVar gtk.AccessibleState) { | |
| 308 | + | ||
| 309 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 310 | + | ||
| 311 | + | } | |
| 312 | + | ||
| 313 | + | // Updates a list of accessible properties. | |
| 314 | + | // | |
| 315 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 316 | + | // value types of accessible properties. | |
| 317 | + | // | |
| 318 | + | // This function should be called by `GtkWidget` types whenever | |
| 319 | + | // an accessible property change must be communicated to assistive | |
| 320 | + | // technologies. | |
| 321 | + | // | |
| 322 | + | // Example: | |
| 323 | + | // ```c | |
| 324 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 325 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 326 | + | // | |
| 327 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 328 | + | // -1); | |
| 329 | + | // | |
| 330 | + | // ``` | |
| 331 | + | func (x *ComboRow) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 332 | + | ||
| 333 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 334 | + | ||
| 335 | + | } | |
| 336 | + | ||
| 337 | + | // Updates an array of accessible properties. | |
| 338 | + | // | |
| 339 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 340 | + | // property change must be communicated to assistive technologies. | |
| 341 | + | // | |
| 342 | + | // This function is meant to be used by language bindings. | |
| 343 | + | func (x *ComboRow) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 344 | + | ||
| 345 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 346 | + | ||
| 347 | + | } | |
| 348 | + | ||
| 349 | + | // Updates a list of accessible relations. | |
| 350 | + | // | |
| 351 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 352 | + | // relation change must be communicated to assistive technologies. | |
| 353 | + | // | |
| 354 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 355 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 356 | + | // | |
| 357 | + | // ```c | |
| 358 | + | // gtk_accessible_update_relation (accessible, | |
| 359 | + | // | |
| 360 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 361 | + | // ref1, NULL, | |
| 362 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 363 | + | // ref1, ref2, ref3, NULL, | |
| 364 | + | // -1); | |
| 365 | + | // | |
| 366 | + | // ``` | |
| 367 | + | func (x *ComboRow) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 368 | + | ||
| 369 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 370 | + | ||
| 371 | + | } | |
| 372 | + | ||
| 373 | + | // Updates an array of accessible relations. | |
| 374 | + | // | |
| 375 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 376 | + | // relation change must be communicated to assistive technologies. | |
| 377 | + | // | |
| 378 | + | // This function is meant to be used by language bindings. | |
| 379 | + | func (x *ComboRow) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 380 | + | ||
| 381 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 382 | + | ||
| 383 | + | } | |
| 384 | + | ||
| 385 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 386 | + | // documentation for the value types of accessible states. | |
| 387 | + | // | |
| 388 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 389 | + | // state change must be communicated to assistive technologies. | |
| 390 | + | // | |
| 391 | + | // Example: | |
| 392 | + | // ```c | |
| 393 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 394 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 395 | + | // | |
| 396 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 397 | + | // -1); | |
| 398 | + | // | |
| 399 | + | // ``` | |
| 400 | + | func (x *ComboRow) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 401 | + | ||
| 402 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 403 | + | ||
| 404 | + | } | |
| 405 | + | ||
| 406 | + | // Updates an array of accessible states. | |
| 407 | + | // | |
| 408 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 409 | + | // state change must be communicated to assistive technologies. | |
| 410 | + | // | |
| 411 | + | // This function is meant to be used by language bindings. | |
| 412 | + | func (x *ComboRow) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 413 | + | ||
| 414 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 415 | + | ||
| 416 | + | } | |
| 417 | + | ||
| 418 | + | // Gets the action name for @actionable. | |
| 419 | + | func (x *ComboRow) GetActionName() string { | |
| 420 | + | ||
| 421 | + | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 422 | + | ||
| 423 | + | } | |
| 424 | + | ||
| 425 | + | // Gets the current target value of @actionable. | |
| 426 | + | func (x *ComboRow) GetActionTargetValue() *glib.Variant { | |
| 427 | + | ||
| 428 | + | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 429 | + | ||
| 430 | + | } | |
| 431 | + | ||
| 432 | + | // Specifies the name of the action with which this widget should be | |
| 433 | + | // associated. | |
| 434 | + | // | |
| 435 | + | // If @action_name is %NULL then the widget will be unassociated from | |
| 436 | + | // any previous action. | |
| 437 | + | // | |
| 438 | + | // Usually this function is used when the widget is located (or will be | |
| 439 | + | // located) within the hierarchy of a `GtkApplicationWindow`. | |
| 440 | + | // | |
| 441 | + | // Names are of the form “win.save” or “app.quit” for actions on the | |
| 442 | + | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 443 | + | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 444 | + | // associated with the window. | |
| 445 | + | func (x *ComboRow) SetActionName(ActionNameVar string) { | |
| 446 | + | ||
| 447 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 448 | + | ||
| 449 | + | } | |
| 450 | + | ||
| 451 | + | // Sets the target of an actionable widget. | |
| 452 | + | // | |
| 453 | + | // This is a convenience function that calls [ctor@GLib.Variant.new] for | |
| 454 | + | // @format_string and uses the result to call | |
| 455 | + | // [method@Gtk.Actionable.set_action_target_value]. | |
| 456 | + | // | |
| 457 | + | // If you are setting a string-valued target and want to set | |
| 458 | + | // the action name at the same time, you can use | |
| 459 | + | // [method@Gtk.Actionable.set_detailed_action_name]. | |
| 460 | + | func (x *ComboRow) SetActionTarget(FormatStringVar string, varArgs ...interface{}) { | |
| 461 | + | ||
| 462 | + | gtk.XGtkActionableSetActionTarget(x.GoPointer(), FormatStringVar, varArgs...) | |
| 463 | + | ||
| 464 | + | } | |
| 465 | + | ||
| 466 | + | // Sets the target value of an actionable widget. | |
| 467 | + | // | |
| 468 | + | // If @target_value is %NULL then the target value is unset. | |
| 469 | + | // | |
| 470 | + | // The target value has two purposes. First, it is used as the parameter | |
| 471 | + | // to activation of the action associated with the `GtkActionable` widget. | |
| 472 | + | // Second, it is used to determine if the widget should be rendered as | |
| 473 | + | // “active” — the widget is active if the state is equal to the given target. | |
| 474 | + | // | |
| 475 | + | // Consider the example of associating a set of buttons with a [iface@Gio.Action] | |
| 476 | + | // with string state in a typical “radio button” situation. Each button | |
| 477 | + | // will be associated with the same action, but with a different target | |
| 478 | + | // value for that action. Clicking on a particular button will activate | |
| 479 | + | // the action with the target of that button, which will typically cause | |
| 480 | + | // the action’s state to change to that value. Since the action’s state | |
| 481 | + | // is now equal to the target value of the button, the button will now | |
| 482 | + | // be rendered as active (and the other buttons, with different targets, | |
| 483 | + | // rendered inactive). | |
| 484 | + | func (x *ComboRow) SetActionTargetValue(TargetValueVar *glib.Variant) { | |
| 485 | + | ||
| 486 | + | gtk.XGtkActionableSetActionTargetValue(x.GoPointer(), TargetValueVar) | |
| 487 | + | ||
| 488 | + | } | |
| 489 | + | ||
| 490 | + | // Sets the action-name and associated string target value of an | |
| 491 | + | // actionable widget. | |
| 492 | + | // | |
| 493 | + | // @detailed_action_name is a string in the format accepted by | |
| 494 | + | // [func@Gio.Action.parse_detailed_name]. | |
| 495 | + | func (x *ComboRow) SetDetailedActionName(DetailedActionNameVar string) { | |
| 496 | + | ||
| 497 | + | gtk.XGtkActionableSetDetailedActionName(x.GoPointer(), DetailedActionNameVar) | |
| 498 | + | ||
| 499 | + | } | |
| 500 | + | ||
| 501 | + | // Gets the ID of the @buildable object. | |
| 502 | + | // | |
| 503 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 504 | + | // of the <object> tag used to construct the @buildable. | |
| 505 | + | func (x *ComboRow) GetBuildableId() string { | |
| 506 | + | ||
| 507 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 508 | + | ||
| 509 | + | } | |
| 510 | + | ||
| 511 | + | func init() { | |
| 512 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 513 | + | if err != nil { | |
| 514 | + | panic(err) | |
| 515 | + | } | |
| 516 | + | ||
| 517 | + | core.PuregoSafeRegister(&xNewComboRow, lib, "adw_combo_row_new") | |
| 518 | + | ||
| 519 | + | core.PuregoSafeRegister(&xComboRowGetExpression, lib, "adw_combo_row_get_expression") | |
| 520 | + | core.PuregoSafeRegister(&xComboRowGetFactory, lib, "adw_combo_row_get_factory") | |
| 521 | + | core.PuregoSafeRegister(&xComboRowGetListFactory, lib, "adw_combo_row_get_list_factory") | |
| 522 | + | core.PuregoSafeRegister(&xComboRowGetModel, lib, "adw_combo_row_get_model") | |
| 523 | + | core.PuregoSafeRegister(&xComboRowGetSelected, lib, "adw_combo_row_get_selected") | |
| 524 | + | core.PuregoSafeRegister(&xComboRowGetSelectedItem, lib, "adw_combo_row_get_selected_item") | |
| 525 | + | core.PuregoSafeRegister(&xComboRowGetUseSubtitle, lib, "adw_combo_row_get_use_subtitle") | |
| 526 | + | core.PuregoSafeRegister(&xComboRowSetExpression, lib, "adw_combo_row_set_expression") | |
| 527 | + | core.PuregoSafeRegister(&xComboRowSetFactory, lib, "adw_combo_row_set_factory") | |
| 528 | + | core.PuregoSafeRegister(&xComboRowSetListFactory, lib, "adw_combo_row_set_list_factory") | |
| 529 | + | core.PuregoSafeRegister(&xComboRowSetModel, lib, "adw_combo_row_set_model") | |
| 530 | + | core.PuregoSafeRegister(&xComboRowSetSelected, lib, "adw_combo_row_set_selected") | |
| 531 | + | core.PuregoSafeRegister(&xComboRowSetUseSubtitle, lib, "adw_combo_row_set_use_subtitle") | |
| 532 | + | ||
| 533 | + | } | |
A v4/adw/adw-easing.go +114 -0
| @@ -0,0 +1,114 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | ) | |
| 8 | + | ||
| 9 | + | // Describes the available easing functions for use with | |
| 10 | + | // [class@TimedAnimation]. | |
| 11 | + | // | |
| 12 | + | // New values may be added to this enumeration over time. | |
| 13 | + | type Easing int | |
| 14 | + | ||
| 15 | + | const ( | |
| 16 | + | ||
| 17 | + | // Linear tweening. | |
| 18 | + | LinearValue Easing = 0 | |
| 19 | + | // Quadratic tweening. | |
| 20 | + | EaseInQuadValue Easing = 1 | |
| 21 | + | // Quadratic tweening, inverse of `ADW_EASE_IN_QUAD`. | |
| 22 | + | EaseOutQuadValue Easing = 2 | |
| 23 | + | // Quadratic tweening, combining `ADW_EASE_IN_QUAD` and | |
| 24 | + | // `ADW_EASE_OUT_QUAD`. | |
| 25 | + | EaseInOutQuadValue Easing = 3 | |
| 26 | + | // Cubic tweening. | |
| 27 | + | EaseInCubicValue Easing = 4 | |
| 28 | + | // Cubic tweening, inverse of `ADW_EASE_IN_CUBIC`. | |
| 29 | + | EaseOutCubicValue Easing = 5 | |
| 30 | + | // Cubic tweening, combining `ADW_EASE_IN_CUBIC` and | |
| 31 | + | // `ADW_EASE_OUT_CUBIC`. | |
| 32 | + | EaseInOutCubicValue Easing = 6 | |
| 33 | + | // Quartic tweening. | |
| 34 | + | EaseInQuartValue Easing = 7 | |
| 35 | + | // Quartic tweening, inverse of `ADW_EASE_IN_QUART`. | |
| 36 | + | EaseOutQuartValue Easing = 8 | |
| 37 | + | // Quartic tweening, combining `ADW_EASE_IN_QUART` and | |
| 38 | + | // `ADW_EASE_OUT_QUART`. | |
| 39 | + | EaseInOutQuartValue Easing = 9 | |
| 40 | + | // Quintic tweening. | |
| 41 | + | EaseInQuintValue Easing = 10 | |
| 42 | + | // Quintic tweening, inverse of `ADW_EASE_IN_QUINT`. | |
| 43 | + | EaseOutQuintValue Easing = 11 | |
| 44 | + | // Quintic tweening, combining `ADW_EASE_IN_QUINT` and | |
| 45 | + | // `ADW_EASE_OUT_QUINT`. | |
| 46 | + | EaseInOutQuintValue Easing = 12 | |
| 47 | + | // Sine wave tweening. | |
| 48 | + | EaseInSineValue Easing = 13 | |
| 49 | + | // Sine wave tweening, inverse of `ADW_EASE_IN_SINE`. | |
| 50 | + | EaseOutSineValue Easing = 14 | |
| 51 | + | // Sine wave tweening, combining `ADW_EASE_IN_SINE` and | |
| 52 | + | // `ADW_EASE_OUT_SINE`. | |
| 53 | + | EaseInOutSineValue Easing = 15 | |
| 54 | + | // Exponential tweening. | |
| 55 | + | EaseInExpoValue Easing = 16 | |
| 56 | + | // Exponential tweening, inverse of `ADW_EASE_IN_EXPO`. | |
| 57 | + | EaseOutExpoValue Easing = 17 | |
| 58 | + | // Exponential tweening, combining `ADW_EASE_IN_EXPO` and | |
| 59 | + | // `ADW_EASE_OUT_EXPO`. | |
| 60 | + | EaseInOutExpoValue Easing = 18 | |
| 61 | + | // Circular tweening. | |
| 62 | + | EaseInCircValue Easing = 19 | |
| 63 | + | // Circular tweening, inverse of `ADW_EASE_IN_CIRC`. | |
| 64 | + | EaseOutCircValue Easing = 20 | |
| 65 | + | // Circular tweening, combining `ADW_EASE_IN_CIRC` and | |
| 66 | + | // `ADW_EASE_OUT_CIRC`. | |
| 67 | + | EaseInOutCircValue Easing = 21 | |
| 68 | + | // Elastic tweening, with offshoot on start. | |
| 69 | + | EaseInElasticValue Easing = 22 | |
| 70 | + | // Elastic tweening, with offshoot on end, inverse of | |
| 71 | + | // `ADW_EASE_IN_ELASTIC`. | |
| 72 | + | EaseOutElasticValue Easing = 23 | |
| 73 | + | // Elastic tweening, with offshoot on both ends, | |
| 74 | + | // combining `ADW_EASE_IN_ELASTIC` and `ADW_EASE_OUT_ELASTIC`. | |
| 75 | + | EaseInOutElasticValue Easing = 24 | |
| 76 | + | // Overshooting cubic tweening, with backtracking on start. | |
| 77 | + | EaseInBackValue Easing = 25 | |
| 78 | + | // Overshooting cubic tweening, with backtracking on end, | |
| 79 | + | // inverse of `ADW_EASE_IN_BACK`. | |
| 80 | + | EaseOutBackValue Easing = 26 | |
| 81 | + | // Overshooting cubic tweening, with backtracking on both | |
| 82 | + | // ends, combining `ADW_EASE_IN_BACK` and `ADW_EASE_OUT_BACK`. | |
| 83 | + | EaseInOutBackValue Easing = 27 | |
| 84 | + | // Exponentially decaying parabolic (bounce) tweening, | |
| 85 | + | // on start. | |
| 86 | + | EaseInBounceValue Easing = 28 | |
| 87 | + | // Exponentially decaying parabolic (bounce) tweening, | |
| 88 | + | // with bounce on end, inverse of `ADW_EASE_IN_BOUNCE`. | |
| 89 | + | EaseOutBounceValue Easing = 29 | |
| 90 | + | // Exponentially decaying parabolic (bounce) tweening, | |
| 91 | + | // with bounce on both ends, combining `ADW_EASE_IN_BOUNCE` and | |
| 92 | + | // `ADW_EASE_OUT_BOUNCE`. | |
| 93 | + | EaseInOutBounceValue Easing = 30 | |
| 94 | + | ) | |
| 95 | + | ||
| 96 | + | var xEasingEase func(Easing, float64) float64 | |
| 97 | + | ||
| 98 | + | // Computes easing with @easing for @value. | |
| 99 | + | // | |
| 100 | + | // @value should generally be in the [0, 1] range. | |
| 101 | + | func EasingEase(SelfVar Easing, ValueVar float64) float64 { | |
| 102 | + | ||
| 103 | + | return xEasingEase(SelfVar, ValueVar) | |
| 104 | + | ||
| 105 | + | } | |
| 106 | + | ||
| 107 | + | func init() { | |
| 108 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 109 | + | if err != nil { | |
| 110 | + | panic(err) | |
| 111 | + | } | |
| 112 | + | core.PuregoSafeRegister(&xEasingEase, lib, "adw_easing_ease") | |
| 113 | + | ||
| 114 | + | } | |
A v4/adw/adw-entry-row.go +772 -0
| @@ -0,0 +1,772 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/pango" | |
| 11 | + | ) | |
| 12 | + | ||
| 13 | + | type EntryRowClass struct { | |
| 14 | + | ParentClass uintptr | |
| 15 | + | } | |
| 16 | + | ||
| 17 | + | // A [class@Gtk.ListBoxRow] with an embedded text entry. | |
| 18 | + | // | |
| 19 | + | // <picture> | |
| 20 | + | // | |
| 21 | + | // <source srcset="entry-row-dark.png" media="(prefers-color-scheme: dark)"> | |
| 22 | + | // <img src="entry-row.png" alt="entry-row"> | |
| 23 | + | // | |
| 24 | + | // </picture> | |
| 25 | + | // | |
| 26 | + | // `AdwEntryRow` has a title that doubles as placeholder text. It shows an icon | |
| 27 | + | // indicating that it's editable and can receive additional widgets before or | |
| 28 | + | // after the editable part. | |
| 29 | + | // | |
| 30 | + | // If [property@EntryRow:show-apply-button] is set to `TRUE`, `AdwEntryRow` can | |
| 31 | + | // show an apply button when editing its contents. This can be useful if | |
| 32 | + | // changing its contents can result in an expensive operation, such as network | |
| 33 | + | // activity. | |
| 34 | + | // | |
| 35 | + | // `AdwEntryRow` provides only minimal API and should be used with the | |
| 36 | + | // [iface@Gtk.Editable] API. | |
| 37 | + | // | |
| 38 | + | // See also [class@PasswordEntryRow]. | |
| 39 | + | // | |
| 40 | + | // ## AdwEntryRow as GtkBuildable | |
| 41 | + | // | |
| 42 | + | // The `AdwEntryRow` implementation of the [iface@Gtk.Buildable] interface | |
| 43 | + | // supports adding a child at its end by specifying “suffix” or omitting the | |
| 44 | + | // “type” attribute of a <child> element. | |
| 45 | + | // | |
| 46 | + | // It also supports adding a child as a prefix widget by specifying “prefix” as | |
| 47 | + | // the “type” attribute of a <child> element. | |
| 48 | + | // | |
| 49 | + | // ## CSS nodes | |
| 50 | + | // | |
| 51 | + | // `AdwEntryRow` has a single CSS node with name `row` and the `.entry` style | |
| 52 | + | // class. | |
| 53 | + | type EntryRow struct { | |
| 54 | + | PreferencesRow | |
| 55 | + | } | |
| 56 | + | ||
| 57 | + | func EntryRowNewFromInternalPtr(ptr uintptr) *EntryRow { | |
| 58 | + | cls := &EntryRow{} | |
| 59 | + | cls.Ptr = ptr | |
| 60 | + | return cls | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | var xNewEntryRow func() uintptr | |
| 64 | + | ||
| 65 | + | // Creates a new `AdwEntryRow`. | |
| 66 | + | func NewEntryRow() *gtk.Widget { | |
| 67 | + | NewEntryRowPtr := xNewEntryRow() | |
| 68 | + | if NewEntryRowPtr == 0 { | |
| 69 | + | return nil | |
| 70 | + | } | |
| 71 | + | ||
| 72 | + | gobject.IncreaseRef(NewEntryRowPtr) | |
| 73 | + | ||
| 74 | + | NewEntryRowCls := >k.Widget{} | |
| 75 | + | NewEntryRowCls.Ptr = NewEntryRowPtr | |
| 76 | + | return NewEntryRowCls | |
| 77 | + | } | |
| 78 | + | ||
| 79 | + | var xEntryRowAddPrefix func(uintptr, uintptr) | |
| 80 | + | ||
| 81 | + | // Adds a prefix widget to @self. | |
| 82 | + | func (x *EntryRow) AddPrefix(WidgetVar *gtk.Widget) { | |
| 83 | + | ||
| 84 | + | xEntryRowAddPrefix(x.GoPointer(), WidgetVar.GoPointer()) | |
| 85 | + | ||
| 86 | + | } | |
| 87 | + | ||
| 88 | + | var xEntryRowAddSuffix func(uintptr, uintptr) | |
| 89 | + | ||
| 90 | + | // Adds a suffix widget to @self. | |
| 91 | + | func (x *EntryRow) AddSuffix(WidgetVar *gtk.Widget) { | |
| 92 | + | ||
| 93 | + | xEntryRowAddSuffix(x.GoPointer(), WidgetVar.GoPointer()) | |
| 94 | + | ||
| 95 | + | } | |
| 96 | + | ||
| 97 | + | var xEntryRowGetActivatesDefault func(uintptr) bool | |
| 98 | + | ||
| 99 | + | // Gets whether activating the embedded entry can activate the default widget. | |
| 100 | + | func (x *EntryRow) GetActivatesDefault() bool { | |
| 101 | + | ||
| 102 | + | return xEntryRowGetActivatesDefault(x.GoPointer()) | |
| 103 | + | ||
| 104 | + | } | |
| 105 | + | ||
| 106 | + | var xEntryRowGetAttributes func(uintptr) *pango.AttrList | |
| 107 | + | ||
| 108 | + | // Gets Pango attributes applied to the text of the embedded entry. | |
| 109 | + | func (x *EntryRow) GetAttributes() *pango.AttrList { | |
| 110 | + | ||
| 111 | + | return xEntryRowGetAttributes(x.GoPointer()) | |
| 112 | + | ||
| 113 | + | } | |
| 114 | + | ||
| 115 | + | var xEntryRowGetEnableEmojiCompletion func(uintptr) bool | |
| 116 | + | ||
| 117 | + | // Gets whether to suggest emoji replacements on @self. | |
| 118 | + | func (x *EntryRow) GetEnableEmojiCompletion() bool { | |
| 119 | + | ||
| 120 | + | return xEntryRowGetEnableEmojiCompletion(x.GoPointer()) | |
| 121 | + | ||
| 122 | + | } | |
| 123 | + | ||
| 124 | + | var xEntryRowGetInputHints func(uintptr) gtk.InputHints | |
| 125 | + | ||
| 126 | + | // Gets the additional input hints of @self. | |
| 127 | + | func (x *EntryRow) GetInputHints() gtk.InputHints { | |
| 128 | + | ||
| 129 | + | return xEntryRowGetInputHints(x.GoPointer()) | |
| 130 | + | ||
| 131 | + | } | |
| 132 | + | ||
| 133 | + | var xEntryRowGetInputPurpose func(uintptr) gtk.InputPurpose | |
| 134 | + | ||
| 135 | + | // Gets the input purpose of @self. | |
| 136 | + | func (x *EntryRow) GetInputPurpose() gtk.InputPurpose { | |
| 137 | + | ||
| 138 | + | return xEntryRowGetInputPurpose(x.GoPointer()) | |
| 139 | + | ||
| 140 | + | } | |
| 141 | + | ||
| 142 | + | var xEntryRowGetShowApplyButton func(uintptr) bool | |
| 143 | + | ||
| 144 | + | // Gets whether @self can show the apply button. | |
| 145 | + | func (x *EntryRow) GetShowApplyButton() bool { | |
| 146 | + | ||
| 147 | + | return xEntryRowGetShowApplyButton(x.GoPointer()) | |
| 148 | + | ||
| 149 | + | } | |
| 150 | + | ||
| 151 | + | var xEntryRowGrabFocusWithoutSelecting func(uintptr) bool | |
| 152 | + | ||
| 153 | + | // Causes @self to have keyboard focus without selecting the text. | |
| 154 | + | // | |
| 155 | + | // See [method@Gtk.Text.grab_focus_without_selecting] for more information. | |
| 156 | + | func (x *EntryRow) GrabFocusWithoutSelecting() bool { | |
| 157 | + | ||
| 158 | + | return xEntryRowGrabFocusWithoutSelecting(x.GoPointer()) | |
| 159 | + | ||
| 160 | + | } | |
| 161 | + | ||
| 162 | + | var xEntryRowRemove func(uintptr, uintptr) | |
| 163 | + | ||
| 164 | + | // Removes a child from @self. | |
| 165 | + | func (x *EntryRow) Remove(WidgetVar *gtk.Widget) { | |
| 166 | + | ||
| 167 | + | xEntryRowRemove(x.GoPointer(), WidgetVar.GoPointer()) | |
| 168 | + | ||
| 169 | + | } | |
| 170 | + | ||
| 171 | + | var xEntryRowSetActivatesDefault func(uintptr, bool) | |
| 172 | + | ||
| 173 | + | // Sets whether activating the embedded entry can activate the default widget. | |
| 174 | + | func (x *EntryRow) SetActivatesDefault(ActivatesVar bool) { | |
| 175 | + | ||
| 176 | + | xEntryRowSetActivatesDefault(x.GoPointer(), ActivatesVar) | |
| 177 | + | ||
| 178 | + | } | |
| 179 | + | ||
| 180 | + | var xEntryRowSetAttributes func(uintptr, *pango.AttrList) | |
| 181 | + | ||
| 182 | + | // Sets Pango attributes to apply to the text of the embedded entry. | |
| 183 | + | // | |
| 184 | + | // The [struct@Pango.Attribute]'s `start_index` and `end_index` must refer to | |
| 185 | + | // the [class@Gtk.EntryBuffer] text, i.e. without the preedit string. | |
| 186 | + | func (x *EntryRow) SetAttributes(AttributesVar *pango.AttrList) { | |
| 187 | + | ||
| 188 | + | xEntryRowSetAttributes(x.GoPointer(), AttributesVar) | |
| 189 | + | ||
| 190 | + | } | |
| 191 | + | ||
| 192 | + | var xEntryRowSetEnableEmojiCompletion func(uintptr, bool) | |
| 193 | + | ||
| 194 | + | // Sets whether to suggest emoji replacements on @self. | |
| 195 | + | // | |
| 196 | + | // Emoji replacement is done with :-delimited names, like `:heart:`. | |
| 197 | + | func (x *EntryRow) SetEnableEmojiCompletion(EnableEmojiCompletionVar bool) { | |
| 198 | + | ||
| 199 | + | xEntryRowSetEnableEmojiCompletion(x.GoPointer(), EnableEmojiCompletionVar) | |
| 200 | + | ||
| 201 | + | } | |
| 202 | + | ||
| 203 | + | var xEntryRowSetInputHints func(uintptr, gtk.InputHints) | |
| 204 | + | ||
| 205 | + | // Set additional input hints for @self. | |
| 206 | + | // | |
| 207 | + | // Input hints allow input methods to fine-tune their behavior. | |
| 208 | + | // | |
| 209 | + | // See also: [property@AdwEntryRow:input-purpose] | |
| 210 | + | func (x *EntryRow) SetInputHints(HintsVar gtk.InputHints) { | |
| 211 | + | ||
| 212 | + | xEntryRowSetInputHints(x.GoPointer(), HintsVar) | |
| 213 | + | ||
| 214 | + | } | |
| 215 | + | ||
| 216 | + | var xEntryRowSetInputPurpose func(uintptr, gtk.InputPurpose) | |
| 217 | + | ||
| 218 | + | // Sets the input purpose of @self. | |
| 219 | + | // | |
| 220 | + | // The input purpose can be used by input methods to adjust their behavior. | |
| 221 | + | func (x *EntryRow) SetInputPurpose(PurposeVar gtk.InputPurpose) { | |
| 222 | + | ||
| 223 | + | xEntryRowSetInputPurpose(x.GoPointer(), PurposeVar) | |
| 224 | + | ||
| 225 | + | } | |
| 226 | + | ||
| 227 | + | var xEntryRowSetShowApplyButton func(uintptr, bool) | |
| 228 | + | ||
| 229 | + | // Sets whether @self can show the apply button. | |
| 230 | + | // | |
| 231 | + | // When set to `TRUE`, typing text in the entry will reveal an apply button. | |
| 232 | + | // Clicking it or pressing the <kbd>Enter</kbd> key will hide the button and | |
| 233 | + | // emit the [signal@EntryRow::apply] signal. | |
| 234 | + | // | |
| 235 | + | // This is useful if changing the entry contents can trigger an expensive | |
| 236 | + | // operation, e.g. network activity, to avoid triggering it after typing every | |
| 237 | + | // character. | |
| 238 | + | func (x *EntryRow) SetShowApplyButton(ShowApplyButtonVar bool) { | |
| 239 | + | ||
| 240 | + | xEntryRowSetShowApplyButton(x.GoPointer(), ShowApplyButtonVar) | |
| 241 | + | ||
| 242 | + | } | |
| 243 | + | ||
| 244 | + | func (c *EntryRow) GoPointer() uintptr { | |
| 245 | + | return c.Ptr | |
| 246 | + | } | |
| 247 | + | ||
| 248 | + | func (c *EntryRow) SetGoPointer(ptr uintptr) { | |
| 249 | + | c.Ptr = ptr | |
| 250 | + | } | |
| 251 | + | ||
| 252 | + | // Emitted when the apply button is pressed. | |
| 253 | + | // | |
| 254 | + | // See [property@EntryRow:show-apply-button]. | |
| 255 | + | func (x *EntryRow) ConnectApply(cb func(EntryRow)) { | |
| 256 | + | fcb := func(clsPtr uintptr) { | |
| 257 | + | fa := EntryRow{} | |
| 258 | + | fa.Ptr = clsPtr | |
| 259 | + | ||
| 260 | + | cb(fa) | |
| 261 | + | ||
| 262 | + | } | |
| 263 | + | gobject.ObjectConnect(x.GoPointer(), "signal::apply", purego.NewCallback(fcb)) | |
| 264 | + | } | |
| 265 | + | ||
| 266 | + | // Emitted when the embedded entry is activated. | |
| 267 | + | func (x *EntryRow) ConnectEntryActivated(cb func(EntryRow)) { | |
| 268 | + | fcb := func(clsPtr uintptr) { | |
| 269 | + | fa := EntryRow{} | |
| 270 | + | fa.Ptr = clsPtr | |
| 271 | + | ||
| 272 | + | cb(fa) | |
| 273 | + | ||
| 274 | + | } | |
| 275 | + | gobject.ObjectConnect(x.GoPointer(), "signal::entry-activated", purego.NewCallback(fcb)) | |
| 276 | + | } | |
| 277 | + | ||
| 278 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 279 | + | func (x *EntryRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 280 | + | ||
| 281 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 282 | + | ||
| 283 | + | } | |
| 284 | + | ||
| 285 | + | // Resets the accessible @property to its default value. | |
| 286 | + | func (x *EntryRow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 287 | + | ||
| 288 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 289 | + | ||
| 290 | + | } | |
| 291 | + | ||
| 292 | + | // Resets the accessible @relation to its default value. | |
| 293 | + | func (x *EntryRow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 294 | + | ||
| 295 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 296 | + | ||
| 297 | + | } | |
| 298 | + | ||
| 299 | + | // Resets the accessible @state to its default value. | |
| 300 | + | func (x *EntryRow) ResetState(StateVar gtk.AccessibleState) { | |
| 301 | + | ||
| 302 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 303 | + | ||
| 304 | + | } | |
| 305 | + | ||
| 306 | + | // Updates a list of accessible properties. | |
| 307 | + | // | |
| 308 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 309 | + | // value types of accessible properties. | |
| 310 | + | // | |
| 311 | + | // This function should be called by `GtkWidget` types whenever | |
| 312 | + | // an accessible property change must be communicated to assistive | |
| 313 | + | // technologies. | |
| 314 | + | // | |
| 315 | + | // Example: | |
| 316 | + | // ```c | |
| 317 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 318 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 319 | + | // | |
| 320 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 321 | + | // -1); | |
| 322 | + | // | |
| 323 | + | // ``` | |
| 324 | + | func (x *EntryRow) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 325 | + | ||
| 326 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 327 | + | ||
| 328 | + | } | |
| 329 | + | ||
| 330 | + | // Updates an array of accessible properties. | |
| 331 | + | // | |
| 332 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 333 | + | // property change must be communicated to assistive technologies. | |
| 334 | + | // | |
| 335 | + | // This function is meant to be used by language bindings. | |
| 336 | + | func (x *EntryRow) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 337 | + | ||
| 338 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 339 | + | ||
| 340 | + | } | |
| 341 | + | ||
| 342 | + | // Updates a list of accessible relations. | |
| 343 | + | // | |
| 344 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 345 | + | // relation change must be communicated to assistive technologies. | |
| 346 | + | // | |
| 347 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 348 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 349 | + | // | |
| 350 | + | // ```c | |
| 351 | + | // gtk_accessible_update_relation (accessible, | |
| 352 | + | // | |
| 353 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 354 | + | // ref1, NULL, | |
| 355 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 356 | + | // ref1, ref2, ref3, NULL, | |
| 357 | + | // -1); | |
| 358 | + | // | |
| 359 | + | // ``` | |
| 360 | + | func (x *EntryRow) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 361 | + | ||
| 362 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 363 | + | ||
| 364 | + | } | |
| 365 | + | ||
| 366 | + | // Updates an array of accessible relations. | |
| 367 | + | // | |
| 368 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 369 | + | // relation change must be communicated to assistive technologies. | |
| 370 | + | // | |
| 371 | + | // This function is meant to be used by language bindings. | |
| 372 | + | func (x *EntryRow) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 373 | + | ||
| 374 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 375 | + | ||
| 376 | + | } | |
| 377 | + | ||
| 378 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 379 | + | // documentation for the value types of accessible states. | |
| 380 | + | // | |
| 381 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 382 | + | // state change must be communicated to assistive technologies. | |
| 383 | + | // | |
| 384 | + | // Example: | |
| 385 | + | // ```c | |
| 386 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 387 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 388 | + | // | |
| 389 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 390 | + | // -1); | |
| 391 | + | // | |
| 392 | + | // ``` | |
| 393 | + | func (x *EntryRow) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 394 | + | ||
| 395 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 396 | + | ||
| 397 | + | } | |
| 398 | + | ||
| 399 | + | // Updates an array of accessible states. | |
| 400 | + | // | |
| 401 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 402 | + | // state change must be communicated to assistive technologies. | |
| 403 | + | // | |
| 404 | + | // This function is meant to be used by language bindings. | |
| 405 | + | func (x *EntryRow) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 406 | + | ||
| 407 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 408 | + | ||
| 409 | + | } | |
| 410 | + | ||
| 411 | + | // Gets the action name for @actionable. | |
| 412 | + | func (x *EntryRow) GetActionName() string { | |
| 413 | + | ||
| 414 | + | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 415 | + | ||
| 416 | + | } | |
| 417 | + | ||
| 418 | + | // Gets the current target value of @actionable. | |
| 419 | + | func (x *EntryRow) GetActionTargetValue() *glib.Variant { | |
| 420 | + | ||
| 421 | + | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 422 | + | ||
| 423 | + | } | |
| 424 | + | ||
| 425 | + | // Specifies the name of the action with which this widget should be | |
| 426 | + | // associated. | |
| 427 | + | // | |
| 428 | + | // If @action_name is %NULL then the widget will be unassociated from | |
| 429 | + | // any previous action. | |
| 430 | + | // | |
| 431 | + | // Usually this function is used when the widget is located (or will be | |
| 432 | + | // located) within the hierarchy of a `GtkApplicationWindow`. | |
| 433 | + | // | |
| 434 | + | // Names are of the form “win.save” or “app.quit” for actions on the | |
| 435 | + | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 436 | + | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 437 | + | // associated with the window. | |
| 438 | + | func (x *EntryRow) SetActionName(ActionNameVar string) { | |
| 439 | + | ||
| 440 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 441 | + | ||
| 442 | + | } | |
| 443 | + | ||
| 444 | + | // Sets the target of an actionable widget. | |
| 445 | + | // | |
| 446 | + | // This is a convenience function that calls [ctor@GLib.Variant.new] for | |
| 447 | + | // @format_string and uses the result to call | |
| 448 | + | // [method@Gtk.Actionable.set_action_target_value]. | |
| 449 | + | // | |
| 450 | + | // If you are setting a string-valued target and want to set | |
| 451 | + | // the action name at the same time, you can use | |
| 452 | + | // [method@Gtk.Actionable.set_detailed_action_name]. | |
| 453 | + | func (x *EntryRow) SetActionTarget(FormatStringVar string, varArgs ...interface{}) { | |
| 454 | + | ||
| 455 | + | gtk.XGtkActionableSetActionTarget(x.GoPointer(), FormatStringVar, varArgs...) | |
| 456 | + | ||
| 457 | + | } | |
| 458 | + | ||
| 459 | + | // Sets the target value of an actionable widget. | |
| 460 | + | // | |
| 461 | + | // If @target_value is %NULL then the target value is unset. | |
| 462 | + | // | |
| 463 | + | // The target value has two purposes. First, it is used as the parameter | |
| 464 | + | // to activation of the action associated with the `GtkActionable` widget. | |
| 465 | + | // Second, it is used to determine if the widget should be rendered as | |
| 466 | + | // “active” — the widget is active if the state is equal to the given target. | |
| 467 | + | // | |
| 468 | + | // Consider the example of associating a set of buttons with a [iface@Gio.Action] | |
| 469 | + | // with string state in a typical “radio button” situation. Each button | |
| 470 | + | // will be associated with the same action, but with a different target | |
| 471 | + | // value for that action. Clicking on a particular button will activate | |
| 472 | + | // the action with the target of that button, which will typically cause | |
| 473 | + | // the action’s state to change to that value. Since the action’s state | |
| 474 | + | // is now equal to the target value of the button, the button will now | |
| 475 | + | // be rendered as active (and the other buttons, with different targets, | |
| 476 | + | // rendered inactive). | |
| 477 | + | func (x *EntryRow) SetActionTargetValue(TargetValueVar *glib.Variant) { | |
| 478 | + | ||
| 479 | + | gtk.XGtkActionableSetActionTargetValue(x.GoPointer(), TargetValueVar) | |
| 480 | + | ||
| 481 | + | } | |
| 482 | + | ||
| 483 | + | // Sets the action-name and associated string target value of an | |
| 484 | + | // actionable widget. | |
| 485 | + | // | |
| 486 | + | // @detailed_action_name is a string in the format accepted by | |
| 487 | + | // [func@Gio.Action.parse_detailed_name]. | |
| 488 | + | func (x *EntryRow) SetDetailedActionName(DetailedActionNameVar string) { | |
| 489 | + | ||
| 490 | + | gtk.XGtkActionableSetDetailedActionName(x.GoPointer(), DetailedActionNameVar) | |
| 491 | + | ||
| 492 | + | } | |
| 493 | + | ||
| 494 | + | // Gets the ID of the @buildable object. | |
| 495 | + | // | |
| 496 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 497 | + | // of the <object> tag used to construct the @buildable. | |
| 498 | + | func (x *EntryRow) GetBuildableId() string { | |
| 499 | + | ||
| 500 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 501 | + | ||
| 502 | + | } | |
| 503 | + | ||
| 504 | + | // Deletes the currently selected text of the editable. | |
| 505 | + | // | |
| 506 | + | // This call doesn’t do anything if there is no selected text. | |
| 507 | + | func (x *EntryRow) DeleteSelection() { | |
| 508 | + | ||
| 509 | + | gtk.XGtkEditableDeleteSelection(x.GoPointer()) | |
| 510 | + | ||
| 511 | + | } | |
| 512 | + | ||
| 513 | + | // Deletes a sequence of characters. | |
| 514 | + | // | |
| 515 | + | // The characters that are deleted are those characters at positions | |
| 516 | + | // from @start_pos up to, but not including @end_pos. If @end_pos is | |
| 517 | + | // negative, then the characters deleted are those from @start_pos to | |
| 518 | + | // the end of the text. | |
| 519 | + | // | |
| 520 | + | // Note that the positions are specified in characters, not bytes. | |
| 521 | + | func (x *EntryRow) DeleteText(StartPosVar int32, EndPosVar int32) { | |
| 522 | + | ||
| 523 | + | gtk.XGtkEditableDeleteText(x.GoPointer(), StartPosVar, EndPosVar) | |
| 524 | + | ||
| 525 | + | } | |
| 526 | + | ||
| 527 | + | // Undoes the setup done by [method@Gtk.Editable.init_delegate]. | |
| 528 | + | // | |
| 529 | + | // This is a helper function that should be called from dispose, | |
| 530 | + | // before removing the delegate object. | |
| 531 | + | func (x *EntryRow) FinishDelegate() { | |
| 532 | + | ||
| 533 | + | gtk.XGtkEditableFinishDelegate(x.GoPointer()) | |
| 534 | + | ||
| 535 | + | } | |
| 536 | + | ||
| 537 | + | // Gets the alignment of the editable. | |
| 538 | + | func (x *EntryRow) GetAlignment() float32 { | |
| 539 | + | ||
| 540 | + | return gtk.XGtkEditableGetAlignment(x.GoPointer()) | |
| 541 | + | ||
| 542 | + | } | |
| 543 | + | ||
| 544 | + | // Retrieves a sequence of characters. | |
| 545 | + | // | |
| 546 | + | // The characters that are retrieved are those characters at positions | |
| 547 | + | // from @start_pos up to, but not including @end_pos. If @end_pos is negative, | |
| 548 | + | // then the characters retrieved are those characters from @start_pos to | |
| 549 | + | // the end of the text. | |
| 550 | + | // | |
| 551 | + | // Note that positions are specified in characters, not bytes. | |
| 552 | + | func (x *EntryRow) GetChars(StartPosVar int32, EndPosVar int32) string { | |
| 553 | + | ||
| 554 | + | return gtk.XGtkEditableGetChars(x.GoPointer(), StartPosVar, EndPosVar) | |
| 555 | + | ||
| 556 | + | } | |
| 557 | + | ||
| 558 | + | // Gets the `GtkEditable` that @editable is delegating its | |
| 559 | + | // implementation to. | |
| 560 | + | // | |
| 561 | + | // Typically, the delegate is a [class@Gtk.Text] widget. | |
| 562 | + | func (x *EntryRow) GetDelegate() *gtk.EditableBase { | |
| 563 | + | ||
| 564 | + | GetDelegatePtr := gtk.XGtkEditableGetDelegate(x.GoPointer()) | |
| 565 | + | if GetDelegatePtr == 0 { | |
| 566 | + | return nil | |
| 567 | + | } | |
| 568 | + | ||
| 569 | + | gobject.IncreaseRef(GetDelegatePtr) | |
| 570 | + | ||
| 571 | + | GetDelegateCls := >k.EditableBase{} | |
| 572 | + | GetDelegateCls.Ptr = GetDelegatePtr | |
| 573 | + | return GetDelegateCls | |
| 574 | + | ||
| 575 | + | } | |
| 576 | + | ||
| 577 | + | // Retrieves whether @editable is editable. | |
| 578 | + | func (x *EntryRow) GetEditable() bool { | |
| 579 | + | ||
| 580 | + | return gtk.XGtkEditableGetEditable(x.GoPointer()) | |
| 581 | + | ||
| 582 | + | } | |
| 583 | + | ||
| 584 | + | // Gets if undo/redo actions are enabled for @editable | |
| 585 | + | func (x *EntryRow) GetEnableUndo() bool { | |
| 586 | + | ||
| 587 | + | return gtk.XGtkEditableGetEnableUndo(x.GoPointer()) | |
| 588 | + | ||
| 589 | + | } | |
| 590 | + | ||
| 591 | + | // Retrieves the desired maximum width of @editable, in characters. | |
| 592 | + | func (x *EntryRow) GetMaxWidthChars() int32 { | |
| 593 | + | ||
| 594 | + | return gtk.XGtkEditableGetMaxWidthChars(x.GoPointer()) | |
| 595 | + | ||
| 596 | + | } | |
| 597 | + | ||
| 598 | + | // Retrieves the current position of the cursor relative | |
| 599 | + | // to the start of the content of the editable. | |
| 600 | + | // | |
| 601 | + | // Note that this position is in characters, not in bytes. | |
| 602 | + | func (x *EntryRow) GetPosition() int32 { | |
| 603 | + | ||
| 604 | + | return gtk.XGtkEditableGetPosition(x.GoPointer()) | |
| 605 | + | ||
| 606 | + | } | |
| 607 | + | ||
| 608 | + | // Retrieves the selection bound of the editable. | |
| 609 | + | // | |
| 610 | + | // @start_pos will be filled with the start of the selection and | |
| 611 | + | // @end_pos with end. If no text was selected both will be identical | |
| 612 | + | // and %FALSE will be returned. | |
| 613 | + | // | |
| 614 | + | // Note that positions are specified in characters, not bytes. | |
| 615 | + | func (x *EntryRow) GetSelectionBounds(StartPosVar int32, EndPosVar int32) bool { | |
| 616 | + | ||
| 617 | + | return gtk.XGtkEditableGetSelectionBounds(x.GoPointer(), StartPosVar, EndPosVar) | |
| 618 | + | ||
| 619 | + | } | |
| 620 | + | ||
| 621 | + | // Retrieves the contents of @editable. | |
| 622 | + | // | |
| 623 | + | // The returned string is owned by GTK and must not be modified or freed. | |
| 624 | + | func (x *EntryRow) GetText() string { | |
| 625 | + | ||
| 626 | + | return gtk.XGtkEditableGetText(x.GoPointer()) | |
| 627 | + | ||
| 628 | + | } | |
| 629 | + | ||
| 630 | + | // Gets the number of characters of space reserved | |
| 631 | + | // for the contents of the editable. | |
| 632 | + | func (x *EntryRow) GetWidthChars() int32 { | |
| 633 | + | ||
| 634 | + | return gtk.XGtkEditableGetWidthChars(x.GoPointer()) | |
| 635 | + | ||
| 636 | + | } | |
| 637 | + | ||
| 638 | + | // Sets up a delegate for `GtkEditable`. | |
| 639 | + | // | |
| 640 | + | // This is assuming that the get_delegate vfunc in the `GtkEditable` | |
| 641 | + | // interface has been set up for the @editable's type. | |
| 642 | + | // | |
| 643 | + | // This is a helper function that should be called in instance init, | |
| 644 | + | // after creating the delegate object. | |
| 645 | + | func (x *EntryRow) InitDelegate() { | |
| 646 | + | ||
| 647 | + | gtk.XGtkEditableInitDelegate(x.GoPointer()) | |
| 648 | + | ||
| 649 | + | } | |
| 650 | + | ||
| 651 | + | // Inserts @length bytes of @text into the contents of the | |
| 652 | + | // widget, at position @position. | |
| 653 | + | // | |
| 654 | + | // Note that the position is in characters, not in bytes. | |
| 655 | + | // The function updates @position to point after the newly | |
| 656 | + | // inserted text. | |
| 657 | + | func (x *EntryRow) InsertText(TextVar string, LengthVar int32, PositionVar int32) { | |
| 658 | + | ||
| 659 | + | gtk.XGtkEditableInsertText(x.GoPointer(), TextVar, LengthVar, PositionVar) | |
| 660 | + | ||
| 661 | + | } | |
| 662 | + | ||
| 663 | + | // Selects a region of text. | |
| 664 | + | // | |
| 665 | + | // The characters that are selected are those characters at positions | |
| 666 | + | // from @start_pos up to, but not including @end_pos. If @end_pos is | |
| 667 | + | // negative, then the characters selected are those characters from | |
| 668 | + | // @start_pos to the end of the text. | |
| 669 | + | // | |
| 670 | + | // Note that positions are specified in characters, not bytes. | |
| 671 | + | func (x *EntryRow) SelectRegion(StartPosVar int32, EndPosVar int32) { | |
| 672 | + | ||
| 673 | + | gtk.XGtkEditableSelectRegion(x.GoPointer(), StartPosVar, EndPosVar) | |
| 674 | + | ||
| 675 | + | } | |
| 676 | + | ||
| 677 | + | // Sets the alignment for the contents of the editable. | |
| 678 | + | // | |
| 679 | + | // This controls the horizontal positioning of the contents when | |
| 680 | + | // the displayed text is shorter than the width of the editable. | |
| 681 | + | func (x *EntryRow) SetAlignment(XalignVar float32) { | |
| 682 | + | ||
| 683 | + | gtk.XGtkEditableSetAlignment(x.GoPointer(), XalignVar) | |
| 684 | + | ||
| 685 | + | } | |
| 686 | + | ||
| 687 | + | // Determines if the user can edit the text in the editable widget. | |
| 688 | + | func (x *EntryRow) SetEditable(IsEditableVar bool) { | |
| 689 | + | ||
| 690 | + | gtk.XGtkEditableSetEditable(x.GoPointer(), IsEditableVar) | |
| 691 | + | ||
| 692 | + | } | |
| 693 | + | ||
| 694 | + | // If enabled, changes to @editable will be saved for undo/redo | |
| 695 | + | // actions. | |
| 696 | + | // | |
| 697 | + | // This results in an additional copy of text changes and are not | |
| 698 | + | // stored in secure memory. As such, undo is forcefully disabled | |
| 699 | + | // when [property@Gtk.Text:visibility] is set to %FALSE. | |
| 700 | + | func (x *EntryRow) SetEnableUndo(EnableUndoVar bool) { | |
| 701 | + | ||
| 702 | + | gtk.XGtkEditableSetEnableUndo(x.GoPointer(), EnableUndoVar) | |
| 703 | + | ||
| 704 | + | } | |
| 705 | + | ||
| 706 | + | // Sets the desired maximum width in characters of @editable. | |
| 707 | + | func (x *EntryRow) SetMaxWidthChars(NCharsVar int32) { | |
| 708 | + | ||
| 709 | + | gtk.XGtkEditableSetMaxWidthChars(x.GoPointer(), NCharsVar) | |
| 710 | + | ||
| 711 | + | } | |
| 712 | + | ||
| 713 | + | // Sets the cursor position in the editable to the given value. | |
| 714 | + | // | |
| 715 | + | // The cursor is displayed before the character with the given (base 0) | |
| 716 | + | // index in the contents of the editable. The value must be less than | |
| 717 | + | // or equal to the number of characters in the editable. A value of -1 | |
| 718 | + | // indicates that the position should be set after the last character | |
| 719 | + | // of the editable. Note that @position is in characters, not in bytes. | |
| 720 | + | func (x *EntryRow) SetPosition(PositionVar int32) { | |
| 721 | + | ||
| 722 | + | gtk.XGtkEditableSetPosition(x.GoPointer(), PositionVar) | |
| 723 | + | ||
| 724 | + | } | |
| 725 | + | ||
| 726 | + | // Sets the text in the editable to the given value. | |
| 727 | + | // | |
| 728 | + | // This is replacing the current contents. | |
| 729 | + | func (x *EntryRow) SetText(TextVar string) { | |
| 730 | + | ||
| 731 | + | gtk.XGtkEditableSetText(x.GoPointer(), TextVar) | |
| 732 | + | ||
| 733 | + | } | |
| 734 | + | ||
| 735 | + | // Changes the size request of the editable to be about the | |
| 736 | + | // right size for @n_chars characters. | |
| 737 | + | // | |
| 738 | + | // Note that it changes the size request, the size can still | |
| 739 | + | // be affected by how you pack the widget into containers. | |
| 740 | + | // If @n_chars is -1, the size reverts to the default size. | |
| 741 | + | func (x *EntryRow) SetWidthChars(NCharsVar int32) { | |
| 742 | + | ||
| 743 | + | gtk.XGtkEditableSetWidthChars(x.GoPointer(), NCharsVar) | |
| 744 | + | ||
| 745 | + | } | |
| 746 | + | ||
| 747 | + | func init() { | |
| 748 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 749 | + | if err != nil { | |
| 750 | + | panic(err) | |
| 751 | + | } | |
| 752 | + | ||
| 753 | + | core.PuregoSafeRegister(&xNewEntryRow, lib, "adw_entry_row_new") | |
| 754 | + | ||
| 755 | + | core.PuregoSafeRegister(&xEntryRowAddPrefix, lib, "adw_entry_row_add_prefix") | |
| 756 | + | core.PuregoSafeRegister(&xEntryRowAddSuffix, lib, "adw_entry_row_add_suffix") | |
| 757 | + | core.PuregoSafeRegister(&xEntryRowGetActivatesDefault, lib, "adw_entry_row_get_activates_default") | |
| 758 | + | core.PuregoSafeRegister(&xEntryRowGetAttributes, lib, "adw_entry_row_get_attributes") | |
| 759 | + | core.PuregoSafeRegister(&xEntryRowGetEnableEmojiCompletion, lib, "adw_entry_row_get_enable_emoji_completion") | |
| 760 | + | core.PuregoSafeRegister(&xEntryRowGetInputHints, lib, "adw_entry_row_get_input_hints") | |
| 761 | + | core.PuregoSafeRegister(&xEntryRowGetInputPurpose, lib, "adw_entry_row_get_input_purpose") | |
| 762 | + | core.PuregoSafeRegister(&xEntryRowGetShowApplyButton, lib, "adw_entry_row_get_show_apply_button") | |
| 763 | + | core.PuregoSafeRegister(&xEntryRowGrabFocusWithoutSelecting, lib, "adw_entry_row_grab_focus_without_selecting") | |
| 764 | + | core.PuregoSafeRegister(&xEntryRowRemove, lib, "adw_entry_row_remove") | |
| 765 | + | core.PuregoSafeRegister(&xEntryRowSetActivatesDefault, lib, "adw_entry_row_set_activates_default") | |
| 766 | + | core.PuregoSafeRegister(&xEntryRowSetAttributes, lib, "adw_entry_row_set_attributes") | |
| 767 | + | core.PuregoSafeRegister(&xEntryRowSetEnableEmojiCompletion, lib, "adw_entry_row_set_enable_emoji_completion") | |
| 768 | + | core.PuregoSafeRegister(&xEntryRowSetInputHints, lib, "adw_entry_row_set_input_hints") | |
| 769 | + | core.PuregoSafeRegister(&xEntryRowSetInputPurpose, lib, "adw_entry_row_set_input_purpose") | |
| 770 | + | core.PuregoSafeRegister(&xEntryRowSetShowApplyButton, lib, "adw_entry_row_set_show_apply_button") | |
| 771 | + | ||
| 772 | + | } | |
A v4/adw/adw-enum-list-model.go +224 -0
| @@ -0,0 +1,224 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gio" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | type EnumListItemClass struct { | |
| 12 | + | ParentClass uintptr | |
| 13 | + | } | |
| 14 | + | ||
| 15 | + | type EnumListModelClass struct { | |
| 16 | + | ParentClass uintptr | |
| 17 | + | } | |
| 18 | + | ||
| 19 | + | // `AdwEnumListItem` is the type of items in a [class@EnumListModel]. | |
| 20 | + | type EnumListItem struct { | |
| 21 | + | gobject.Object | |
| 22 | + | } | |
| 23 | + | ||
| 24 | + | func EnumListItemNewFromInternalPtr(ptr uintptr) *EnumListItem { | |
| 25 | + | cls := &EnumListItem{} | |
| 26 | + | cls.Ptr = ptr | |
| 27 | + | return cls | |
| 28 | + | } | |
| 29 | + | ||
| 30 | + | var xEnumListItemGetName func(uintptr) string | |
| 31 | + | ||
| 32 | + | // Gets the enum value name. | |
| 33 | + | func (x *EnumListItem) GetName() string { | |
| 34 | + | ||
| 35 | + | return xEnumListItemGetName(x.GoPointer()) | |
| 36 | + | ||
| 37 | + | } | |
| 38 | + | ||
| 39 | + | var xEnumListItemGetNick func(uintptr) string | |
| 40 | + | ||
| 41 | + | // Gets the enum value nick. | |
| 42 | + | func (x *EnumListItem) GetNick() string { | |
| 43 | + | ||
| 44 | + | return xEnumListItemGetNick(x.GoPointer()) | |
| 45 | + | ||
| 46 | + | } | |
| 47 | + | ||
| 48 | + | var xEnumListItemGetValue func(uintptr) int32 | |
| 49 | + | ||
| 50 | + | // Gets the enum value. | |
| 51 | + | func (x *EnumListItem) GetValue() int32 { | |
| 52 | + | ||
| 53 | + | return xEnumListItemGetValue(x.GoPointer()) | |
| 54 | + | ||
| 55 | + | } | |
| 56 | + | ||
| 57 | + | func (c *EnumListItem) GoPointer() uintptr { | |
| 58 | + | return c.Ptr | |
| 59 | + | } | |
| 60 | + | ||
| 61 | + | func (c *EnumListItem) SetGoPointer(ptr uintptr) { | |
| 62 | + | c.Ptr = ptr | |
| 63 | + | } | |
| 64 | + | ||
| 65 | + | // A [iface@Gio.ListModel] representing values of a given enum. | |
| 66 | + | // | |
| 67 | + | // `AdwEnumListModel` contains objects of type [class@EnumListItem]. | |
| 68 | + | type EnumListModel struct { | |
| 69 | + | gobject.Object | |
| 70 | + | } | |
| 71 | + | ||
| 72 | + | func EnumListModelNewFromInternalPtr(ptr uintptr) *EnumListModel { | |
| 73 | + | cls := &EnumListModel{} | |
| 74 | + | cls.Ptr = ptr | |
| 75 | + | return cls | |
| 76 | + | } | |
| 77 | + | ||
| 78 | + | var xNewEnumListModel func([]interface{}) uintptr | |
| 79 | + | ||
| 80 | + | // Creates a new `AdwEnumListModel` for @enum_type. | |
| 81 | + | func NewEnumListModel(EnumTypeVar []interface{}) *EnumListModel { | |
| 82 | + | NewEnumListModelPtr := xNewEnumListModel(EnumTypeVar) | |
| 83 | + | if NewEnumListModelPtr == 0 { | |
| 84 | + | return nil | |
| 85 | + | } | |
| 86 | + | ||
| 87 | + | NewEnumListModelCls := &EnumListModel{} | |
| 88 | + | NewEnumListModelCls.Ptr = NewEnumListModelPtr | |
| 89 | + | return NewEnumListModelCls | |
| 90 | + | } | |
| 91 | + | ||
| 92 | + | var xEnumListModelFindPosition func(uintptr, int32) uint | |
| 93 | + | ||
| 94 | + | // Finds the position of a given enum value in @self. | |
| 95 | + | func (x *EnumListModel) FindPosition(ValueVar int32) uint { | |
| 96 | + | ||
| 97 | + | return xEnumListModelFindPosition(x.GoPointer(), ValueVar) | |
| 98 | + | ||
| 99 | + | } | |
| 100 | + | ||
| 101 | + | var xEnumListModelGetEnumType func(uintptr) []interface{} | |
| 102 | + | ||
| 103 | + | // Gets the type of the enum represented by @self. | |
| 104 | + | func (x *EnumListModel) GetEnumType() []interface{} { | |
| 105 | + | ||
| 106 | + | return xEnumListModelGetEnumType(x.GoPointer()) | |
| 107 | + | ||
| 108 | + | } | |
| 109 | + | ||
| 110 | + | func (c *EnumListModel) GoPointer() uintptr { | |
| 111 | + | return c.Ptr | |
| 112 | + | } | |
| 113 | + | ||
| 114 | + | func (c *EnumListModel) SetGoPointer(ptr uintptr) { | |
| 115 | + | c.Ptr = ptr | |
| 116 | + | } | |
| 117 | + | ||
| 118 | + | // Get the item at @position. | |
| 119 | + | // | |
| 120 | + | // If @position is greater than the number of items in @list, %NULL is | |
| 121 | + | // returned. | |
| 122 | + | // | |
| 123 | + | // %NULL is never returned for an index that is smaller than the length | |
| 124 | + | // of the list. | |
| 125 | + | // | |
| 126 | + | // See also: g_list_model_get_n_items() | |
| 127 | + | func (x *EnumListModel) GetItem(PositionVar uint) uintptr { | |
| 128 | + | ||
| 129 | + | return gio.XGListModelGetItem(x.GoPointer(), PositionVar) | |
| 130 | + | ||
| 131 | + | } | |
| 132 | + | ||
| 133 | + | // Gets the type of the items in @list. | |
| 134 | + | // | |
| 135 | + | // All items returned from g_list_model_get_item() are of the type | |
| 136 | + | // returned by this function, or a subtype, or if the type is an | |
| 137 | + | // interface, they are an implementation of that interface. | |
| 138 | + | // | |
| 139 | + | // The item type of a #GListModel can not change during the life of the | |
| 140 | + | // model. | |
| 141 | + | func (x *EnumListModel) GetItemType() []interface{} { | |
| 142 | + | ||
| 143 | + | return gio.XGListModelGetItemType(x.GoPointer()) | |
| 144 | + | ||
| 145 | + | } | |
| 146 | + | ||
| 147 | + | // Gets the number of items in @list. | |
| 148 | + | // | |
| 149 | + | // Depending on the model implementation, calling this function may be | |
| 150 | + | // less efficient than iterating the list with increasing values for | |
| 151 | + | // @position until g_list_model_get_item() returns %NULL. | |
| 152 | + | func (x *EnumListModel) GetNItems() uint { | |
| 153 | + | ||
| 154 | + | return gio.XGListModelGetNItems(x.GoPointer()) | |
| 155 | + | ||
| 156 | + | } | |
| 157 | + | ||
| 158 | + | // Get the item at @position. | |
| 159 | + | // | |
| 160 | + | // If @position is greater than the number of items in @list, %NULL is | |
| 161 | + | // returned. | |
| 162 | + | // | |
| 163 | + | // %NULL is never returned for an index that is smaller than the length | |
| 164 | + | // of the list. | |
| 165 | + | // | |
| 166 | + | // This function is meant to be used by language bindings in place | |
| 167 | + | // of g_list_model_get_item(). | |
| 168 | + | // | |
| 169 | + | // See also: g_list_model_get_n_items() | |
| 170 | + | func (x *EnumListModel) GetObject(PositionVar uint) *gobject.Object { | |
| 171 | + | ||
| 172 | + | GetObjectPtr := gio.XGListModelGetObject(x.GoPointer(), PositionVar) | |
| 173 | + | if GetObjectPtr == 0 { | |
| 174 | + | return nil | |
| 175 | + | } | |
| 176 | + | ||
| 177 | + | GetObjectCls := &gobject.Object{} | |
| 178 | + | GetObjectCls.Ptr = GetObjectPtr | |
| 179 | + | return GetObjectCls | |
| 180 | + | ||
| 181 | + | } | |
| 182 | + | ||
| 183 | + | // Emits the #GListModel::items-changed signal on @list. | |
| 184 | + | // | |
| 185 | + | // This function should only be called by classes implementing | |
| 186 | + | // #GListModel. It has to be called after the internal representation | |
| 187 | + | // of @list has been updated, because handlers connected to this signal | |
| 188 | + | // might query the new state of the list. | |
| 189 | + | // | |
| 190 | + | // Implementations must only make changes to the model (as visible to | |
| 191 | + | // its consumer) in places that will not cause problems for that | |
| 192 | + | // consumer. For models that are driven directly by a write API (such | |
| 193 | + | // as #GListStore), changes can be reported in response to uses of that | |
| 194 | + | // API. For models that represent remote data, changes should only be | |
| 195 | + | // made from a fresh mainloop dispatch. It is particularly not | |
| 196 | + | // permitted to make changes in response to a call to the #GListModel | |
| 197 | + | // consumer API. | |
| 198 | + | // | |
| 199 | + | // Stated another way: in general, it is assumed that code making a | |
| 200 | + | // series of accesses to the model via the API, without returning to the | |
| 201 | + | // mainloop, and without calling other code, will continue to view the | |
| 202 | + | // same contents of the model. | |
| 203 | + | func (x *EnumListModel) ItemsChanged(PositionVar uint, RemovedVar uint, AddedVar uint) { | |
| 204 | + | ||
| 205 | + | gio.XGListModelItemsChanged(x.GoPointer(), PositionVar, RemovedVar, AddedVar) | |
| 206 | + | ||
| 207 | + | } | |
| 208 | + | ||
| 209 | + | func init() { | |
| 210 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 211 | + | if err != nil { | |
| 212 | + | panic(err) | |
| 213 | + | } | |
| 214 | + | ||
| 215 | + | core.PuregoSafeRegister(&xEnumListItemGetName, lib, "adw_enum_list_item_get_name") | |
| 216 | + | core.PuregoSafeRegister(&xEnumListItemGetNick, lib, "adw_enum_list_item_get_nick") | |
| 217 | + | core.PuregoSafeRegister(&xEnumListItemGetValue, lib, "adw_enum_list_item_get_value") | |
| 218 | + | ||
| 219 | + | core.PuregoSafeRegister(&xNewEnumListModel, lib, "adw_enum_list_model_new") | |
| 220 | + | ||
| 221 | + | core.PuregoSafeRegister(&xEnumListModelFindPosition, lib, "adw_enum_list_model_find_position") | |
| 222 | + | core.PuregoSafeRegister(&xEnumListModelGetEnumType, lib, "adw_enum_list_model_get_enum_type") | |
| 223 | + | ||
| 224 | + | } | |
A v4/adw/adw-expander-row.go +509 -0
| @@ -0,0 +1,509 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 10 | + | ) | |
| 11 | + | ||
| 12 | + | type ExpanderRowClass struct { | |
| 13 | + | ParentClass uintptr | |
| 14 | + | ||
| 15 | + | Padding uintptr | |
| 16 | + | } | |
| 17 | + | ||
| 18 | + | // A [class@Gtk.ListBoxRow] used to reveal widgets. | |
| 19 | + | // | |
| 20 | + | // <picture> | |
| 21 | + | // | |
| 22 | + | // <source srcset="expander-row-dark.png" media="(prefers-color-scheme: dark)"> | |
| 23 | + | // <img src="expander-row.png" alt="expander-row"> | |
| 24 | + | // | |
| 25 | + | // </picture> | |
| 26 | + | // | |
| 27 | + | // The `AdwExpanderRow` widget allows the user to reveal or hide widgets below | |
| 28 | + | // it. It also allows the user to enable the expansion of the row, allowing to | |
| 29 | + | // disable all that the row contains. | |
| 30 | + | // | |
| 31 | + | // ## AdwExpanderRow as GtkBuildable | |
| 32 | + | // | |
| 33 | + | // The `AdwExpanderRow` implementation of the [iface@Gtk.Buildable] interface | |
| 34 | + | // supports adding a child as an action widget by specifying “action” as the | |
| 35 | + | // “type” attribute of a <child> element. | |
| 36 | + | // | |
| 37 | + | // It also supports adding it as a prefix widget by specifying “prefix” as the | |
| 38 | + | // “type” attribute of a <child> element. | |
| 39 | + | // | |
| 40 | + | // ## CSS nodes | |
| 41 | + | // | |
| 42 | + | // `AdwExpanderRow` has a main CSS node with name `row` and the `.expander` | |
| 43 | + | // style class. It has the `.empty` style class when it contains no children. | |
| 44 | + | // | |
| 45 | + | // It contains the subnodes `row.header` for its main embedded row, | |
| 46 | + | // `list.nested` for the list it can expand, and `image.expander-row-arrow` for | |
| 47 | + | // its arrow. | |
| 48 | + | type ExpanderRow struct { | |
| 49 | + | PreferencesRow | |
| 50 | + | } | |
| 51 | + | ||
| 52 | + | func ExpanderRowNewFromInternalPtr(ptr uintptr) *ExpanderRow { | |
| 53 | + | cls := &ExpanderRow{} | |
| 54 | + | cls.Ptr = ptr | |
| 55 | + | return cls | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | var xNewExpanderRow func() uintptr | |
| 59 | + | ||
| 60 | + | // Creates a new `AdwExpanderRow`. | |
| 61 | + | func NewExpanderRow() *gtk.Widget { | |
| 62 | + | NewExpanderRowPtr := xNewExpanderRow() | |
| 63 | + | if NewExpanderRowPtr == 0 { | |
| 64 | + | return nil | |
| 65 | + | } | |
| 66 | + | ||
| 67 | + | gobject.IncreaseRef(NewExpanderRowPtr) | |
| 68 | + | ||
| 69 | + | NewExpanderRowCls := >k.Widget{} | |
| 70 | + | NewExpanderRowCls.Ptr = NewExpanderRowPtr | |
| 71 | + | return NewExpanderRowCls | |
| 72 | + | } | |
| 73 | + | ||
| 74 | + | var xExpanderRowAddAction func(uintptr, uintptr) | |
| 75 | + | ||
| 76 | + | // Adds an action widget to @self. | |
| 77 | + | func (x *ExpanderRow) AddAction(WidgetVar *gtk.Widget) { | |
| 78 | + | ||
| 79 | + | xExpanderRowAddAction(x.GoPointer(), WidgetVar.GoPointer()) | |
| 80 | + | ||
| 81 | + | } | |
| 82 | + | ||
| 83 | + | var xExpanderRowAddPrefix func(uintptr, uintptr) | |
| 84 | + | ||
| 85 | + | // Adds a prefix widget to @self. | |
| 86 | + | func (x *ExpanderRow) AddPrefix(WidgetVar *gtk.Widget) { | |
| 87 | + | ||
| 88 | + | xExpanderRowAddPrefix(x.GoPointer(), WidgetVar.GoPointer()) | |
| 89 | + | ||
| 90 | + | } | |
| 91 | + | ||
| 92 | + | var xExpanderRowAddRow func(uintptr, uintptr) | |
| 93 | + | ||
| 94 | + | // Adds a widget to @self. | |
| 95 | + | // | |
| 96 | + | // The widget will appear in the expanding list below @self. | |
| 97 | + | func (x *ExpanderRow) AddRow(ChildVar *gtk.Widget) { | |
| 98 | + | ||
| 99 | + | xExpanderRowAddRow(x.GoPointer(), ChildVar.GoPointer()) | |
| 100 | + | ||
| 101 | + | } | |
| 102 | + | ||
| 103 | + | var xExpanderRowGetEnableExpansion func(uintptr) bool | |
| 104 | + | ||
| 105 | + | // Gets whether the expansion of @self is enabled. | |
| 106 | + | func (x *ExpanderRow) GetEnableExpansion() bool { | |
| 107 | + | ||
| 108 | + | return xExpanderRowGetEnableExpansion(x.GoPointer()) | |
| 109 | + | ||
| 110 | + | } | |
| 111 | + | ||
| 112 | + | var xExpanderRowGetExpanded func(uintptr) bool | |
| 113 | + | ||
| 114 | + | // Gets whether @self is expanded. | |
| 115 | + | func (x *ExpanderRow) GetExpanded() bool { | |
| 116 | + | ||
| 117 | + | return xExpanderRowGetExpanded(x.GoPointer()) | |
| 118 | + | ||
| 119 | + | } | |
| 120 | + | ||
| 121 | + | var xExpanderRowGetIconName func(uintptr) string | |
| 122 | + | ||
| 123 | + | // Gets the icon name for @self. | |
| 124 | + | func (x *ExpanderRow) GetIconName() string { | |
| 125 | + | ||
| 126 | + | return xExpanderRowGetIconName(x.GoPointer()) | |
| 127 | + | ||
| 128 | + | } | |
| 129 | + | ||
| 130 | + | var xExpanderRowGetShowEnableSwitch func(uintptr) bool | |
| 131 | + | ||
| 132 | + | // Gets whether the switch enabling the expansion of @self is visible. | |
| 133 | + | func (x *ExpanderRow) GetShowEnableSwitch() bool { | |
| 134 | + | ||
| 135 | + | return xExpanderRowGetShowEnableSwitch(x.GoPointer()) | |
| 136 | + | ||
| 137 | + | } | |
| 138 | + | ||
| 139 | + | var xExpanderRowGetSubtitle func(uintptr) string | |
| 140 | + | ||
| 141 | + | // Gets the subtitle for @self. | |
| 142 | + | func (x *ExpanderRow) GetSubtitle() string { | |
| 143 | + | ||
| 144 | + | return xExpanderRowGetSubtitle(x.GoPointer()) | |
| 145 | + | ||
| 146 | + | } | |
| 147 | + | ||
| 148 | + | var xExpanderRowGetSubtitleLines func(uintptr) bool | |
| 149 | + | ||
| 150 | + | // Gets the number of lines at the end of which the subtitle label will be | |
| 151 | + | // ellipsized. | |
| 152 | + | func (x *ExpanderRow) GetSubtitleLines() bool { | |
| 153 | + | ||
| 154 | + | return xExpanderRowGetSubtitleLines(x.GoPointer()) | |
| 155 | + | ||
| 156 | + | } | |
| 157 | + | ||
| 158 | + | var xExpanderRowGetTitleLines func(uintptr) bool | |
| 159 | + | ||
| 160 | + | // Gets the number of lines at the end of which the title label will be | |
| 161 | + | // ellipsized. | |
| 162 | + | func (x *ExpanderRow) GetTitleLines() bool { | |
| 163 | + | ||
| 164 | + | return xExpanderRowGetTitleLines(x.GoPointer()) | |
| 165 | + | ||
| 166 | + | } | |
| 167 | + | ||
| 168 | + | var xExpanderRowRemove func(uintptr, uintptr) | |
| 169 | + | ||
| 170 | + | func (x *ExpanderRow) Remove(ChildVar *gtk.Widget) { | |
| 171 | + | ||
| 172 | + | xExpanderRowRemove(x.GoPointer(), ChildVar.GoPointer()) | |
| 173 | + | ||
| 174 | + | } | |
| 175 | + | ||
| 176 | + | var xExpanderRowSetEnableExpansion func(uintptr, bool) | |
| 177 | + | ||
| 178 | + | // Sets whether the expansion of @self is enabled. | |
| 179 | + | func (x *ExpanderRow) SetEnableExpansion(EnableExpansionVar bool) { | |
| 180 | + | ||
| 181 | + | xExpanderRowSetEnableExpansion(x.GoPointer(), EnableExpansionVar) | |
| 182 | + | ||
| 183 | + | } | |
| 184 | + | ||
| 185 | + | var xExpanderRowSetExpanded func(uintptr, bool) | |
| 186 | + | ||
| 187 | + | // Sets whether @self is expanded. | |
| 188 | + | func (x *ExpanderRow) SetExpanded(ExpandedVar bool) { | |
| 189 | + | ||
| 190 | + | xExpanderRowSetExpanded(x.GoPointer(), ExpandedVar) | |
| 191 | + | ||
| 192 | + | } | |
| 193 | + | ||
| 194 | + | var xExpanderRowSetIconName func(uintptr, string) | |
| 195 | + | ||
| 196 | + | // Sets the icon name for @self. | |
| 197 | + | func (x *ExpanderRow) SetIconName(IconNameVar string) { | |
| 198 | + | ||
| 199 | + | xExpanderRowSetIconName(x.GoPointer(), IconNameVar) | |
| 200 | + | ||
| 201 | + | } | |
| 202 | + | ||
| 203 | + | var xExpanderRowSetShowEnableSwitch func(uintptr, bool) | |
| 204 | + | ||
| 205 | + | // Sets whether the switch enabling the expansion of @self is visible. | |
| 206 | + | func (x *ExpanderRow) SetShowEnableSwitch(ShowEnableSwitchVar bool) { | |
| 207 | + | ||
| 208 | + | xExpanderRowSetShowEnableSwitch(x.GoPointer(), ShowEnableSwitchVar) | |
| 209 | + | ||
| 210 | + | } | |
| 211 | + | ||
| 212 | + | var xExpanderRowSetSubtitle func(uintptr, string) | |
| 213 | + | ||
| 214 | + | // Sets the subtitle for @self. | |
| 215 | + | // | |
| 216 | + | // The subtitle is interpreted as Pango markup unless | |
| 217 | + | // [property@PreferencesRow:use-markup] is set to `FALSE`. | |
| 218 | + | func (x *ExpanderRow) SetSubtitle(SubtitleVar string) { | |
| 219 | + | ||
| 220 | + | xExpanderRowSetSubtitle(x.GoPointer(), SubtitleVar) | |
| 221 | + | ||
| 222 | + | } | |
| 223 | + | ||
| 224 | + | var xExpanderRowSetSubtitleLines func(uintptr, int32) | |
| 225 | + | ||
| 226 | + | // Sets the number of lines at the end of which the subtitle label will be | |
| 227 | + | // ellipsized. | |
| 228 | + | // | |
| 229 | + | // If the value is 0, the number of lines won't be limited. | |
| 230 | + | func (x *ExpanderRow) SetSubtitleLines(SubtitleLinesVar int32) { | |
| 231 | + | ||
| 232 | + | xExpanderRowSetSubtitleLines(x.GoPointer(), SubtitleLinesVar) | |
| 233 | + | ||
| 234 | + | } | |
| 235 | + | ||
| 236 | + | var xExpanderRowSetTitleLines func(uintptr, int32) | |
| 237 | + | ||
| 238 | + | // Sets the number of lines at the end of which the title label will be | |
| 239 | + | // ellipsized. | |
| 240 | + | // | |
| 241 | + | // If the value is 0, the number of lines won't be limited. | |
| 242 | + | func (x *ExpanderRow) SetTitleLines(TitleLinesVar int32) { | |
| 243 | + | ||
| 244 | + | xExpanderRowSetTitleLines(x.GoPointer(), TitleLinesVar) | |
| 245 | + | ||
| 246 | + | } | |
| 247 | + | ||
| 248 | + | func (c *ExpanderRow) GoPointer() uintptr { | |
| 249 | + | return c.Ptr | |
| 250 | + | } | |
| 251 | + | ||
| 252 | + | func (c *ExpanderRow) SetGoPointer(ptr uintptr) { | |
| 253 | + | c.Ptr = ptr | |
| 254 | + | } | |
| 255 | + | ||
| 256 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 257 | + | func (x *ExpanderRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 258 | + | ||
| 259 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 260 | + | ||
| 261 | + | } | |
| 262 | + | ||
| 263 | + | // Resets the accessible @property to its default value. | |
| 264 | + | func (x *ExpanderRow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 265 | + | ||
| 266 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 267 | + | ||
| 268 | + | } | |
| 269 | + | ||
| 270 | + | // Resets the accessible @relation to its default value. | |
| 271 | + | func (x *ExpanderRow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 272 | + | ||
| 273 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 274 | + | ||
| 275 | + | } | |
| 276 | + | ||
| 277 | + | // Resets the accessible @state to its default value. | |
| 278 | + | func (x *ExpanderRow) ResetState(StateVar gtk.AccessibleState) { | |
| 279 | + | ||
| 280 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 281 | + | ||
| 282 | + | } | |
| 283 | + | ||
| 284 | + | // Updates a list of accessible properties. | |
| 285 | + | // | |
| 286 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 287 | + | // value types of accessible properties. | |
| 288 | + | // | |
| 289 | + | // This function should be called by `GtkWidget` types whenever | |
| 290 | + | // an accessible property change must be communicated to assistive | |
| 291 | + | // technologies. | |
| 292 | + | // | |
| 293 | + | // Example: | |
| 294 | + | // ```c | |
| 295 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 296 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 297 | + | // | |
| 298 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 299 | + | // -1); | |
| 300 | + | // | |
| 301 | + | // ``` | |
| 302 | + | func (x *ExpanderRow) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 303 | + | ||
| 304 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 305 | + | ||
| 306 | + | } | |
| 307 | + | ||
| 308 | + | // Updates an array of accessible properties. | |
| 309 | + | // | |
| 310 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 311 | + | // property change must be communicated to assistive technologies. | |
| 312 | + | // | |
| 313 | + | // This function is meant to be used by language bindings. | |
| 314 | + | func (x *ExpanderRow) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 315 | + | ||
| 316 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 317 | + | ||
| 318 | + | } | |
| 319 | + | ||
| 320 | + | // Updates a list of accessible relations. | |
| 321 | + | // | |
| 322 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 323 | + | // relation change must be communicated to assistive technologies. | |
| 324 | + | // | |
| 325 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 326 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 327 | + | // | |
| 328 | + | // ```c | |
| 329 | + | // gtk_accessible_update_relation (accessible, | |
| 330 | + | // | |
| 331 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 332 | + | // ref1, NULL, | |
| 333 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 334 | + | // ref1, ref2, ref3, NULL, | |
| 335 | + | // -1); | |
| 336 | + | // | |
| 337 | + | // ``` | |
| 338 | + | func (x *ExpanderRow) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 339 | + | ||
| 340 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 341 | + | ||
| 342 | + | } | |
| 343 | + | ||
| 344 | + | // Updates an array of accessible relations. | |
| 345 | + | // | |
| 346 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 347 | + | // relation change must be communicated to assistive technologies. | |
| 348 | + | // | |
| 349 | + | // This function is meant to be used by language bindings. | |
| 350 | + | func (x *ExpanderRow) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 351 | + | ||
| 352 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 353 | + | ||
| 354 | + | } | |
| 355 | + | ||
| 356 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 357 | + | // documentation for the value types of accessible states. | |
| 358 | + | // | |
| 359 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 360 | + | // state change must be communicated to assistive technologies. | |
| 361 | + | // | |
| 362 | + | // Example: | |
| 363 | + | // ```c | |
| 364 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 365 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 366 | + | // | |
| 367 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 368 | + | // -1); | |
| 369 | + | // | |
| 370 | + | // ``` | |
| 371 | + | func (x *ExpanderRow) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 372 | + | ||
| 373 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 374 | + | ||
| 375 | + | } | |
| 376 | + | ||
| 377 | + | // Updates an array of accessible states. | |
| 378 | + | // | |
| 379 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 380 | + | // state change must be communicated to assistive technologies. | |
| 381 | + | // | |
| 382 | + | // This function is meant to be used by language bindings. | |
| 383 | + | func (x *ExpanderRow) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 384 | + | ||
| 385 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 386 | + | ||
| 387 | + | } | |
| 388 | + | ||
| 389 | + | // Gets the action name for @actionable. | |
| 390 | + | func (x *ExpanderRow) GetActionName() string { | |
| 391 | + | ||
| 392 | + | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 393 | + | ||
| 394 | + | } | |
| 395 | + | ||
| 396 | + | // Gets the current target value of @actionable. | |
| 397 | + | func (x *ExpanderRow) GetActionTargetValue() *glib.Variant { | |
| 398 | + | ||
| 399 | + | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 400 | + | ||
| 401 | + | } | |
| 402 | + | ||
| 403 | + | // Specifies the name of the action with which this widget should be | |
| 404 | + | // associated. | |
| 405 | + | // | |
| 406 | + | // If @action_name is %NULL then the widget will be unassociated from | |
| 407 | + | // any previous action. | |
| 408 | + | // | |
| 409 | + | // Usually this function is used when the widget is located (or will be | |
| 410 | + | // located) within the hierarchy of a `GtkApplicationWindow`. | |
| 411 | + | // | |
| 412 | + | // Names are of the form “win.save” or “app.quit” for actions on the | |
| 413 | + | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 414 | + | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 415 | + | // associated with the window. | |
| 416 | + | func (x *ExpanderRow) SetActionName(ActionNameVar string) { | |
| 417 | + | ||
| 418 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 419 | + | ||
| 420 | + | } | |
| 421 | + | ||
| 422 | + | // Sets the target of an actionable widget. | |
| 423 | + | // | |
| 424 | + | // This is a convenience function that calls [ctor@GLib.Variant.new] for | |
| 425 | + | // @format_string and uses the result to call | |
| 426 | + | // [method@Gtk.Actionable.set_action_target_value]. | |
| 427 | + | // | |
| 428 | + | // If you are setting a string-valued target and want to set | |
| 429 | + | // the action name at the same time, you can use | |
| 430 | + | // [method@Gtk.Actionable.set_detailed_action_name]. | |
| 431 | + | func (x *ExpanderRow) SetActionTarget(FormatStringVar string, varArgs ...interface{}) { | |
| 432 | + | ||
| 433 | + | gtk.XGtkActionableSetActionTarget(x.GoPointer(), FormatStringVar, varArgs...) | |
| 434 | + | ||
| 435 | + | } | |
| 436 | + | ||
| 437 | + | // Sets the target value of an actionable widget. | |
| 438 | + | // | |
| 439 | + | // If @target_value is %NULL then the target value is unset. | |
| 440 | + | // | |
| 441 | + | // The target value has two purposes. First, it is used as the parameter | |
| 442 | + | // to activation of the action associated with the `GtkActionable` widget. | |
| 443 | + | // Second, it is used to determine if the widget should be rendered as | |
| 444 | + | // “active” — the widget is active if the state is equal to the given target. | |
| 445 | + | // | |
| 446 | + | // Consider the example of associating a set of buttons with a [iface@Gio.Action] | |
| 447 | + | // with string state in a typical “radio button” situation. Each button | |
| 448 | + | // will be associated with the same action, but with a different target | |
| 449 | + | // value for that action. Clicking on a particular button will activate | |
| 450 | + | // the action with the target of that button, which will typically cause | |
| 451 | + | // the action’s state to change to that value. Since the action’s state | |
| 452 | + | // is now equal to the target value of the button, the button will now | |
| 453 | + | // be rendered as active (and the other buttons, with different targets, | |
| 454 | + | // rendered inactive). | |
| 455 | + | func (x *ExpanderRow) SetActionTargetValue(TargetValueVar *glib.Variant) { | |
| 456 | + | ||
| 457 | + | gtk.XGtkActionableSetActionTargetValue(x.GoPointer(), TargetValueVar) | |
| 458 | + | ||
| 459 | + | } | |
| 460 | + | ||
| 461 | + | // Sets the action-name and associated string target value of an | |
| 462 | + | // actionable widget. | |
| 463 | + | // | |
| 464 | + | // @detailed_action_name is a string in the format accepted by | |
| 465 | + | // [func@Gio.Action.parse_detailed_name]. | |
| 466 | + | func (x *ExpanderRow) SetDetailedActionName(DetailedActionNameVar string) { | |
| 467 | + | ||
| 468 | + | gtk.XGtkActionableSetDetailedActionName(x.GoPointer(), DetailedActionNameVar) | |
| 469 | + | ||
| 470 | + | } | |
| 471 | + | ||
| 472 | + | // Gets the ID of the @buildable object. | |
| 473 | + | // | |
| 474 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 475 | + | // of the <object> tag used to construct the @buildable. | |
| 476 | + | func (x *ExpanderRow) GetBuildableId() string { | |
| 477 | + | ||
| 478 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 479 | + | ||
| 480 | + | } | |
| 481 | + | ||
| 482 | + | func init() { | |
| 483 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 484 | + | if err != nil { | |
| 485 | + | panic(err) | |
| 486 | + | } | |
| 487 | + | ||
| 488 | + | core.PuregoSafeRegister(&xNewExpanderRow, lib, "adw_expander_row_new") | |
| 489 | + | ||
| 490 | + | core.PuregoSafeRegister(&xExpanderRowAddAction, lib, "adw_expander_row_add_action") | |
| 491 | + | core.PuregoSafeRegister(&xExpanderRowAddPrefix, lib, "adw_expander_row_add_prefix") | |
| 492 | + | core.PuregoSafeRegister(&xExpanderRowAddRow, lib, "adw_expander_row_add_row") | |
| 493 | + | core.PuregoSafeRegister(&xExpanderRowGetEnableExpansion, lib, "adw_expander_row_get_enable_expansion") | |
| 494 | + | core.PuregoSafeRegister(&xExpanderRowGetExpanded, lib, "adw_expander_row_get_expanded") | |
| 495 | + | core.PuregoSafeRegister(&xExpanderRowGetIconName, lib, "adw_expander_row_get_icon_name") | |
| 496 | + | core.PuregoSafeRegister(&xExpanderRowGetShowEnableSwitch, lib, "adw_expander_row_get_show_enable_switch") | |
| 497 | + | core.PuregoSafeRegister(&xExpanderRowGetSubtitle, lib, "adw_expander_row_get_subtitle") | |
| 498 | + | core.PuregoSafeRegister(&xExpanderRowGetSubtitleLines, lib, "adw_expander_row_get_subtitle_lines") | |
| 499 | + | core.PuregoSafeRegister(&xExpanderRowGetTitleLines, lib, "adw_expander_row_get_title_lines") | |
| 500 | + | core.PuregoSafeRegister(&xExpanderRowRemove, lib, "adw_expander_row_remove") | |
| 501 | + | core.PuregoSafeRegister(&xExpanderRowSetEnableExpansion, lib, "adw_expander_row_set_enable_expansion") | |
| 502 | + | core.PuregoSafeRegister(&xExpanderRowSetExpanded, lib, "adw_expander_row_set_expanded") | |
| 503 | + | core.PuregoSafeRegister(&xExpanderRowSetIconName, lib, "adw_expander_row_set_icon_name") | |
| 504 | + | core.PuregoSafeRegister(&xExpanderRowSetShowEnableSwitch, lib, "adw_expander_row_set_show_enable_switch") | |
| 505 | + | core.PuregoSafeRegister(&xExpanderRowSetSubtitle, lib, "adw_expander_row_set_subtitle") | |
| 506 | + | core.PuregoSafeRegister(&xExpanderRowSetSubtitleLines, lib, "adw_expander_row_set_subtitle_lines") | |
| 507 | + | core.PuregoSafeRegister(&xExpanderRowSetTitleLines, lib, "adw_expander_row_set_title_lines") | |
| 508 | + | ||
| 509 | + | } | |
A v4/adw/adw-flap.go +739 -0
| @@ -0,0 +1,739 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gdk" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 10 | + | ) | |
| 11 | + | ||
| 12 | + | type FlapClass struct { | |
| 13 | + | ParentClass uintptr | |
| 14 | + | } | |
| 15 | + | ||
| 16 | + | // Describes the possible folding behavior of a [class@Flap] widget. | |
| 17 | + | type FlapFoldPolicy int | |
| 18 | + | ||
| 19 | + | const ( | |
| 20 | + | ||
| 21 | + | // Disable folding, the flap cannot reach narrow | |
| 22 | + | // sizes. | |
| 23 | + | FlapFoldPolicyNeverValue FlapFoldPolicy = 0 | |
| 24 | + | // Keep the flap always folded. | |
| 25 | + | FlapFoldPolicyAlwaysValue FlapFoldPolicy = 1 | |
| 26 | + | // Fold and unfold the flap based on available | |
| 27 | + | // space. | |
| 28 | + | FlapFoldPolicyAutoValue FlapFoldPolicy = 2 | |
| 29 | + | ) | |
| 30 | + | ||
| 31 | + | // Describes transitions types of a [class@Flap] widget. | |
| 32 | + | // | |
| 33 | + | // It determines the type of animation when transitioning between children in a | |
| 34 | + | // [class@Flap] widget, as well as which areas can be swiped via | |
| 35 | + | // [property@Flap:swipe-to-open] and [property@Flap:swipe-to-close]. | |
| 36 | + | // | |
| 37 | + | // New values may be added to this enum over time. | |
| 38 | + | type FlapTransitionType int | |
| 39 | + | ||
| 40 | + | const ( | |
| 41 | + | ||
| 42 | + | // The flap slides over the content, which is | |
| 43 | + | // dimmed. When folded, only the flap can be swiped. | |
| 44 | + | FlapTransitionTypeOverValue FlapTransitionType = 0 | |
| 45 | + | // The content slides over the flap. Only the | |
| 46 | + | // content can be swiped. | |
| 47 | + | FlapTransitionTypeUnderValue FlapTransitionType = 1 | |
| 48 | + | // The flap slides offscreen when hidden, | |
| 49 | + | // neither the flap nor content overlap each other. Both widgets can be | |
| 50 | + | // swiped. | |
| 51 | + | FlapTransitionTypeSlideValue FlapTransitionType = 2 | |
| 52 | + | ) | |
| 53 | + | ||
| 54 | + | // An adaptive container acting like a box or an overlay. | |
| 55 | + | // | |
| 56 | + | // <picture> | |
| 57 | + | // | |
| 58 | + | // <source srcset="flap-wide-dark.png" media="(prefers-color-scheme: dark)"> | |
| 59 | + | // <img src="flap-wide.png" alt="flap-wide"> | |
| 60 | + | // | |
| 61 | + | // </picture> | |
| 62 | + | // <picture> | |
| 63 | + | // | |
| 64 | + | // <source srcset="flap-narrow-dark.png" media="(prefers-color-scheme: dark)"> | |
| 65 | + | // <img src="flap-narrow.png" alt="flap-narrow"> | |
| 66 | + | // | |
| 67 | + | // </picture> | |
| 68 | + | // | |
| 69 | + | // The `AdwFlap` widget can display its children like a [class@Gtk.Box] does or | |
| 70 | + | // like a [class@Gtk.Overlay] does, according to the | |
| 71 | + | // [property@Flap:fold-policy] value. | |
| 72 | + | // | |
| 73 | + | // `AdwFlap` has at most three children: [property@Flap:content], | |
| 74 | + | // [property@Flap:flap] and [property@Flap:separator]. Content is the primary | |
| 75 | + | // child, flap is displayed next to it when unfolded, or overlays it when | |
| 76 | + | // folded. Flap can be shown or hidden by changing the | |
| 77 | + | // [property@Flap:reveal-flap] value, as well as via swipe gestures if | |
| 78 | + | // [property@Flap:swipe-to-open] and/or [property@Flap:swipe-to-close] are set | |
| 79 | + | // to `TRUE`. | |
| 80 | + | // | |
| 81 | + | // Optionally, a separator can be provided, which would be displayed between | |
| 82 | + | // the content and the flap when there's no shadow to separate them, depending | |
| 83 | + | // on the transition type. | |
| 84 | + | // | |
| 85 | + | // [property@Flap:flap] is transparent by default; add the | |
| 86 | + | // [`.background`](style-classes.html#background) style class to it if this is | |
| 87 | + | // unwanted. | |
| 88 | + | // | |
| 89 | + | // If [property@Flap:modal] is set to `TRUE`, content becomes completely | |
| 90 | + | // inaccessible when the flap is revealed while folded. | |
| 91 | + | // | |
| 92 | + | // The position of the flap and separator children relative to the content is | |
| 93 | + | // determined by orientation, as well as the [property@Flap:flap-position] | |
| 94 | + | // value. | |
| 95 | + | // | |
| 96 | + | // Folding the flap will automatically hide the flap widget, and unfolding it | |
| 97 | + | // will automatically reveal it. If this behavior is not desired, the | |
| 98 | + | // [property@Flap:locked] property can be used to override it. | |
| 99 | + | // | |
| 100 | + | // Common use cases include sidebars, header bars that need to be able to | |
| 101 | + | // overlap the window content (for example, in fullscreen mode) and bottom | |
| 102 | + | // sheets. | |
| 103 | + | // | |
| 104 | + | // ## AdwFlap as GtkBuildable | |
| 105 | + | // | |
| 106 | + | // The `AdwFlap` implementation of the [iface@Gtk.Buildable] interface supports | |
| 107 | + | // setting the flap child by specifying “flap” as the “type” attribute of a | |
| 108 | + | // `<child>` element, and separator by specifying “separator”. Specifying | |
| 109 | + | // “content” child type or omitting it results in setting the content child. | |
| 110 | + | // | |
| 111 | + | // ## CSS nodes | |
| 112 | + | // | |
| 113 | + | // `AdwFlap` has a single CSS node with name `flap`. The node will get the style | |
| 114 | + | // classes `.folded` when it is folded, and `.unfolded` when it's not. | |
| 115 | + | type Flap struct { | |
| 116 | + | gtk.Widget | |
| 117 | + | } | |
| 118 | + | ||
| 119 | + | func FlapNewFromInternalPtr(ptr uintptr) *Flap { | |
| 120 | + | cls := &Flap{} | |
| 121 | + | cls.Ptr = ptr | |
| 122 | + | return cls | |
| 123 | + | } | |
| 124 | + | ||
| 125 | + | var xNewFlap func() uintptr | |
| 126 | + | ||
| 127 | + | // Creates a new `AdwFlap`. | |
| 128 | + | func NewFlap() *gtk.Widget { | |
| 129 | + | NewFlapPtr := xNewFlap() | |
| 130 | + | if NewFlapPtr == 0 { | |
| 131 | + | return nil | |
| 132 | + | } | |
| 133 | + | ||
| 134 | + | gobject.IncreaseRef(NewFlapPtr) | |
| 135 | + | ||
| 136 | + | NewFlapCls := >k.Widget{} | |
| 137 | + | NewFlapCls.Ptr = NewFlapPtr | |
| 138 | + | return NewFlapCls | |
| 139 | + | } | |
| 140 | + | ||
| 141 | + | var xFlapGetContent func(uintptr) uintptr | |
| 142 | + | ||
| 143 | + | // Gets the content widget for @self. | |
| 144 | + | func (x *Flap) GetContent() *gtk.Widget { | |
| 145 | + | ||
| 146 | + | GetContentPtr := xFlapGetContent(x.GoPointer()) | |
| 147 | + | if GetContentPtr == 0 { | |
| 148 | + | return nil | |
| 149 | + | } | |
| 150 | + | ||
| 151 | + | gobject.IncreaseRef(GetContentPtr) | |
| 152 | + | ||
| 153 | + | GetContentCls := >k.Widget{} | |
| 154 | + | GetContentCls.Ptr = GetContentPtr | |
| 155 | + | return GetContentCls | |
| 156 | + | ||
| 157 | + | } | |
| 158 | + | ||
| 159 | + | var xFlapGetFlap func(uintptr) uintptr | |
| 160 | + | ||
| 161 | + | // Gets the flap widget for @self. | |
| 162 | + | func (x *Flap) GetFlap() *gtk.Widget { | |
| 163 | + | ||
| 164 | + | GetFlapPtr := xFlapGetFlap(x.GoPointer()) | |
| 165 | + | if GetFlapPtr == 0 { | |
| 166 | + | return nil | |
| 167 | + | } | |
| 168 | + | ||
| 169 | + | gobject.IncreaseRef(GetFlapPtr) | |
| 170 | + | ||
| 171 | + | GetFlapCls := >k.Widget{} | |
| 172 | + | GetFlapCls.Ptr = GetFlapPtr | |
| 173 | + | return GetFlapCls | |
| 174 | + | ||
| 175 | + | } | |
| 176 | + | ||
| 177 | + | var xFlapGetFlapPosition func(uintptr) gtk.PackType | |
| 178 | + | ||
| 179 | + | // Gets the flap position for @self. | |
| 180 | + | func (x *Flap) GetFlapPosition() gtk.PackType { | |
| 181 | + | ||
| 182 | + | return xFlapGetFlapPosition(x.GoPointer()) | |
| 183 | + | ||
| 184 | + | } | |
| 185 | + | ||
| 186 | + | var xFlapGetFoldDuration func(uintptr) uint | |
| 187 | + | ||
| 188 | + | // Gets the fold transition animation duration for @self, in milliseconds. | |
| 189 | + | func (x *Flap) GetFoldDuration() uint { | |
| 190 | + | ||
| 191 | + | return xFlapGetFoldDuration(x.GoPointer()) | |
| 192 | + | ||
| 193 | + | } | |
| 194 | + | ||
| 195 | + | var xFlapGetFoldPolicy func(uintptr) FlapFoldPolicy | |
| 196 | + | ||
| 197 | + | // Gets the fold policy for @self. | |
| 198 | + | func (x *Flap) GetFoldPolicy() FlapFoldPolicy { | |
| 199 | + | ||
| 200 | + | return xFlapGetFoldPolicy(x.GoPointer()) | |
| 201 | + | ||
| 202 | + | } | |
| 203 | + | ||
| 204 | + | var xFlapGetFoldThresholdPolicy func(uintptr) FoldThresholdPolicy | |
| 205 | + | ||
| 206 | + | // Gets the fold threshold policy for @self. | |
| 207 | + | func (x *Flap) GetFoldThresholdPolicy() FoldThresholdPolicy { | |
| 208 | + | ||
| 209 | + | return xFlapGetFoldThresholdPolicy(x.GoPointer()) | |
| 210 | + | ||
| 211 | + | } | |
| 212 | + | ||
| 213 | + | var xFlapGetFolded func(uintptr) bool | |
| 214 | + | ||
| 215 | + | // Gets whether @self is currently folded. | |
| 216 | + | // | |
| 217 | + | // See [property@Flap:fold-policy]. | |
| 218 | + | func (x *Flap) GetFolded() bool { | |
| 219 | + | ||
| 220 | + | return xFlapGetFolded(x.GoPointer()) | |
| 221 | + | ||
| 222 | + | } | |
| 223 | + | ||
| 224 | + | var xFlapGetLocked func(uintptr) bool | |
| 225 | + | ||
| 226 | + | // Gets whether @self is locked. | |
| 227 | + | func (x *Flap) GetLocked() bool { | |
| 228 | + | ||
| 229 | + | return xFlapGetLocked(x.GoPointer()) | |
| 230 | + | ||
| 231 | + | } | |
| 232 | + | ||
| 233 | + | var xFlapGetModal func(uintptr) bool | |
| 234 | + | ||
| 235 | + | // Gets whether @self is modal. | |
| 236 | + | func (x *Flap) GetModal() bool { | |
| 237 | + | ||
| 238 | + | return xFlapGetModal(x.GoPointer()) | |
| 239 | + | ||
| 240 | + | } | |
| 241 | + | ||
| 242 | + | var xFlapGetRevealFlap func(uintptr) bool | |
| 243 | + | ||
| 244 | + | // Gets whether the flap widget is revealed for @self. | |
| 245 | + | func (x *Flap) GetRevealFlap() bool { | |
| 246 | + | ||
| 247 | + | return xFlapGetRevealFlap(x.GoPointer()) | |
| 248 | + | ||
| 249 | + | } | |
| 250 | + | ||
| 251 | + | var xFlapGetRevealParams func(uintptr) *SpringParams | |
| 252 | + | ||
| 253 | + | // Gets the reveal animation spring parameters for @self. | |
| 254 | + | func (x *Flap) GetRevealParams() *SpringParams { | |
| 255 | + | ||
| 256 | + | return xFlapGetRevealParams(x.GoPointer()) | |
| 257 | + | ||
| 258 | + | } | |
| 259 | + | ||
| 260 | + | var xFlapGetRevealProgress func(uintptr) float64 | |
| 261 | + | ||
| 262 | + | // Gets the current reveal progress for @self. | |
| 263 | + | // | |
| 264 | + | // 0 means fully hidden, 1 means fully revealed. | |
| 265 | + | // | |
| 266 | + | // See [property@Flap:reveal-flap]. | |
| 267 | + | func (x *Flap) GetRevealProgress() float64 { | |
| 268 | + | ||
| 269 | + | return xFlapGetRevealProgress(x.GoPointer()) | |
| 270 | + | ||
| 271 | + | } | |
| 272 | + | ||
| 273 | + | var xFlapGetSeparator func(uintptr) uintptr | |
| 274 | + | ||
| 275 | + | // Gets the separator widget for @self. | |
| 276 | + | func (x *Flap) GetSeparator() *gtk.Widget { | |
| 277 | + | ||
| 278 | + | GetSeparatorPtr := xFlapGetSeparator(x.GoPointer()) | |
| 279 | + | if GetSeparatorPtr == 0 { | |
| 280 | + | return nil | |
| 281 | + | } | |
| 282 | + | ||
| 283 | + | gobject.IncreaseRef(GetSeparatorPtr) | |
| 284 | + | ||
| 285 | + | GetSeparatorCls := >k.Widget{} | |
| 286 | + | GetSeparatorCls.Ptr = GetSeparatorPtr | |
| 287 | + | return GetSeparatorCls | |
| 288 | + | ||
| 289 | + | } | |
| 290 | + | ||
| 291 | + | var xFlapGetSwipeToClose func(uintptr) bool | |
| 292 | + | ||
| 293 | + | // Gets whether @self can be closed with a swipe gesture. | |
| 294 | + | func (x *Flap) GetSwipeToClose() bool { | |
| 295 | + | ||
| 296 | + | return xFlapGetSwipeToClose(x.GoPointer()) | |
| 297 | + | ||
| 298 | + | } | |
| 299 | + | ||
| 300 | + | var xFlapGetSwipeToOpen func(uintptr) bool | |
| 301 | + | ||
| 302 | + | // Gets whether @self can be opened with a swipe gesture. | |
| 303 | + | func (x *Flap) GetSwipeToOpen() bool { | |
| 304 | + | ||
| 305 | + | return xFlapGetSwipeToOpen(x.GoPointer()) | |
| 306 | + | ||
| 307 | + | } | |
| 308 | + | ||
| 309 | + | var xFlapGetTransitionType func(uintptr) FlapTransitionType | |
| 310 | + | ||
| 311 | + | // Gets the type of animation used for reveal and fold transitions in @self. | |
| 312 | + | func (x *Flap) GetTransitionType() FlapTransitionType { | |
| 313 | + | ||
| 314 | + | return xFlapGetTransitionType(x.GoPointer()) | |
| 315 | + | ||
| 316 | + | } | |
| 317 | + | ||
| 318 | + | var xFlapSetContent func(uintptr, uintptr) | |
| 319 | + | ||
| 320 | + | // Sets the content widget for @self. | |
| 321 | + | // | |
| 322 | + | // It's always displayed when unfolded, and partially visible when folded. | |
| 323 | + | func (x *Flap) SetContent(ContentVar *gtk.Widget) { | |
| 324 | + | ||
| 325 | + | xFlapSetContent(x.GoPointer(), ContentVar.GoPointer()) | |
| 326 | + | ||
| 327 | + | } | |
| 328 | + | ||
| 329 | + | var xFlapSetFlap func(uintptr, uintptr) | |
| 330 | + | ||
| 331 | + | // Sets the flap widget for @self. | |
| 332 | + | // | |
| 333 | + | // It's only visible when [property@Flap:reveal-progress] is greater than 0. | |
| 334 | + | func (x *Flap) SetFlap(FlapVar *gtk.Widget) { | |
| 335 | + | ||
| 336 | + | xFlapSetFlap(x.GoPointer(), FlapVar.GoPointer()) | |
| 337 | + | ||
| 338 | + | } | |
| 339 | + | ||
| 340 | + | var xFlapSetFlapPosition func(uintptr, gtk.PackType) | |
| 341 | + | ||
| 342 | + | // Sets the flap position for @self. | |
| 343 | + | // | |
| 344 | + | // If it's set to `GTK_PACK_START`, the flap is displayed before the content, | |
| 345 | + | // if `GTK_PACK_END`, it's displayed after the content. | |
| 346 | + | func (x *Flap) SetFlapPosition(PositionVar gtk.PackType) { | |
| 347 | + | ||
| 348 | + | xFlapSetFlapPosition(x.GoPointer(), PositionVar) | |
| 349 | + | ||
| 350 | + | } | |
| 351 | + | ||
| 352 | + | var xFlapSetFoldDuration func(uintptr, uint) | |
| 353 | + | ||
| 354 | + | // Sets the fold transition animation duration for @self, in milliseconds. | |
| 355 | + | func (x *Flap) SetFoldDuration(DurationVar uint) { | |
| 356 | + | ||
| 357 | + | xFlapSetFoldDuration(x.GoPointer(), DurationVar) | |
| 358 | + | ||
| 359 | + | } | |
| 360 | + | ||
| 361 | + | var xFlapSetFoldPolicy func(uintptr, FlapFoldPolicy) | |
| 362 | + | ||
| 363 | + | // Sets the fold policy for @self. | |
| 364 | + | func (x *Flap) SetFoldPolicy(PolicyVar FlapFoldPolicy) { | |
| 365 | + | ||
| 366 | + | xFlapSetFoldPolicy(x.GoPointer(), PolicyVar) | |
| 367 | + | ||
| 368 | + | } | |
| 369 | + | ||
| 370 | + | var xFlapSetFoldThresholdPolicy func(uintptr, FoldThresholdPolicy) | |
| 371 | + | ||
| 372 | + | // Sets the fold threshold policy for @self. | |
| 373 | + | // | |
| 374 | + | // If set to `ADW_FOLD_THRESHOLD_POLICY_MINIMUM`, flap will only fold when the | |
| 375 | + | // children cannot fit anymore. With `ADW_FOLD_THRESHOLD_POLICY_NATURAL`, it | |
| 376 | + | // will fold as soon as children don't get their natural size. | |
| 377 | + | // | |
| 378 | + | // This can be useful if you have a long ellipsizing label and want to let it | |
| 379 | + | // ellipsize instead of immediately folding. | |
| 380 | + | func (x *Flap) SetFoldThresholdPolicy(PolicyVar FoldThresholdPolicy) { | |
| 381 | + | ||
| 382 | + | xFlapSetFoldThresholdPolicy(x.GoPointer(), PolicyVar) | |
| 383 | + | ||
| 384 | + | } | |
| 385 | + | ||
| 386 | + | var xFlapSetLocked func(uintptr, bool) | |
| 387 | + | ||
| 388 | + | // Sets whether @self is locked. | |
| 389 | + | // | |
| 390 | + | // If `FALSE`, folding when the flap is revealed automatically closes it, and | |
| 391 | + | // unfolding it when the flap is not revealed opens it. If `TRUE`, | |
| 392 | + | // [property@Flap:reveal-flap] value never changes on its own. | |
| 393 | + | func (x *Flap) SetLocked(LockedVar bool) { | |
| 394 | + | ||
| 395 | + | xFlapSetLocked(x.GoPointer(), LockedVar) | |
| 396 | + | ||
| 397 | + | } | |
| 398 | + | ||
| 399 | + | var xFlapSetModal func(uintptr, bool) | |
| 400 | + | ||
| 401 | + | // Sets whether @self is modal. | |
| 402 | + | // | |
| 403 | + | // If `TRUE`, clicking the content widget while flap is revealed, as well as | |
| 404 | + | // pressing the <kbd>Esc</kbd> key, will close the flap. If `FALSE`, clicks are | |
| 405 | + | // passed through to the content widget. | |
| 406 | + | func (x *Flap) SetModal(ModalVar bool) { | |
| 407 | + | ||
| 408 | + | xFlapSetModal(x.GoPointer(), ModalVar) | |
| 409 | + | ||
| 410 | + | } | |
| 411 | + | ||
| 412 | + | var xFlapSetRevealFlap func(uintptr, bool) | |
| 413 | + | ||
| 414 | + | // Sets whether the flap widget is revealed for @self. | |
| 415 | + | func (x *Flap) SetRevealFlap(RevealFlapVar bool) { | |
| 416 | + | ||
| 417 | + | xFlapSetRevealFlap(x.GoPointer(), RevealFlapVar) | |
| 418 | + | ||
| 419 | + | } | |
| 420 | + | ||
| 421 | + | var xFlapSetRevealParams func(uintptr, *SpringParams) | |
| 422 | + | ||
| 423 | + | // Sets the reveal animation spring parameters for @self. | |
| 424 | + | // | |
| 425 | + | // The default value is equivalent to: | |
| 426 | + | // | |
| 427 | + | // ```c | |
| 428 | + | // adw_spring_params_new (1, 0.5, 500) | |
| 429 | + | // ``` | |
| 430 | + | func (x *Flap) SetRevealParams(ParamsVar *SpringParams) { | |
| 431 | + | ||
| 432 | + | xFlapSetRevealParams(x.GoPointer(), ParamsVar) | |
| 433 | + | ||
| 434 | + | } | |
| 435 | + | ||
| 436 | + | var xFlapSetSeparator func(uintptr, uintptr) | |
| 437 | + | ||
| 438 | + | // Sets the separator widget for @self. | |
| 439 | + | // | |
| 440 | + | // It's displayed between content and flap when there's no shadow to display. | |
| 441 | + | // When exactly it's visible depends on the [property@Flap:transition-type] | |
| 442 | + | // value. | |
| 443 | + | func (x *Flap) SetSeparator(SeparatorVar *gtk.Widget) { | |
| 444 | + | ||
| 445 | + | xFlapSetSeparator(x.GoPointer(), SeparatorVar.GoPointer()) | |
| 446 | + | ||
| 447 | + | } | |
| 448 | + | ||
| 449 | + | var xFlapSetSwipeToClose func(uintptr, bool) | |
| 450 | + | ||
| 451 | + | // Sets whether @self can be closed with a swipe gesture. | |
| 452 | + | // | |
| 453 | + | // The area that can be swiped depends on the [property@Flap:transition-type] | |
| 454 | + | // value. | |
| 455 | + | func (x *Flap) SetSwipeToClose(SwipeToCloseVar bool) { | |
| 456 | + | ||
| 457 | + | xFlapSetSwipeToClose(x.GoPointer(), SwipeToCloseVar) | |
| 458 | + | ||
| 459 | + | } | |
| 460 | + | ||
| 461 | + | var xFlapSetSwipeToOpen func(uintptr, bool) | |
| 462 | + | ||
| 463 | + | // Sets whether @self can be opened with a swipe gesture. | |
| 464 | + | // | |
| 465 | + | // The area that can be swiped depends on the [property@Flap:transition-type] | |
| 466 | + | // value. | |
| 467 | + | func (x *Flap) SetSwipeToOpen(SwipeToOpenVar bool) { | |
| 468 | + | ||
| 469 | + | xFlapSetSwipeToOpen(x.GoPointer(), SwipeToOpenVar) | |
| 470 | + | ||
| 471 | + | } | |
| 472 | + | ||
| 473 | + | var xFlapSetTransitionType func(uintptr, FlapTransitionType) | |
| 474 | + | ||
| 475 | + | // Sets the type of animation used for reveal and fold transitions in @self. | |
| 476 | + | // | |
| 477 | + | // [property@Flap:flap] is transparent by default, which means the content will | |
| 478 | + | // be seen through it with `ADW_FLAP_TRANSITION_TYPE_OVER` transitions; add the | |
| 479 | + | // [`.background`](style-classes.html#background) style class to it if this is | |
| 480 | + | // unwanted. | |
| 481 | + | func (x *Flap) SetTransitionType(TransitionTypeVar FlapTransitionType) { | |
| 482 | + | ||
| 483 | + | xFlapSetTransitionType(x.GoPointer(), TransitionTypeVar) | |
| 484 | + | ||
| 485 | + | } | |
| 486 | + | ||
| 487 | + | func (c *Flap) GoPointer() uintptr { | |
| 488 | + | return c.Ptr | |
| 489 | + | } | |
| 490 | + | ||
| 491 | + | func (c *Flap) SetGoPointer(ptr uintptr) { | |
| 492 | + | c.Ptr = ptr | |
| 493 | + | } | |
| 494 | + | ||
| 495 | + | // Gets the progress @self will snap back to after the gesture is canceled. | |
| 496 | + | func (x *Flap) GetCancelProgress() float64 { | |
| 497 | + | ||
| 498 | + | return XAdwSwipeableGetCancelProgress(x.GoPointer()) | |
| 499 | + | ||
| 500 | + | } | |
| 501 | + | ||
| 502 | + | // Gets the swipe distance of @self. | |
| 503 | + | // | |
| 504 | + | // This corresponds to how many pixels 1 unit represents. | |
| 505 | + | func (x *Flap) GetDistance() float64 { | |
| 506 | + | ||
| 507 | + | return XAdwSwipeableGetDistance(x.GoPointer()) | |
| 508 | + | ||
| 509 | + | } | |
| 510 | + | ||
| 511 | + | // Gets the current progress of @self. | |
| 512 | + | func (x *Flap) GetProgress() float64 { | |
| 513 | + | ||
| 514 | + | return XAdwSwipeableGetProgress(x.GoPointer()) | |
| 515 | + | ||
| 516 | + | } | |
| 517 | + | ||
| 518 | + | // Gets the snap points of @self. | |
| 519 | + | // | |
| 520 | + | // Each snap point represents a progress value that is considered acceptable to | |
| 521 | + | // end the swipe on. | |
| 522 | + | func (x *Flap) GetSnapPoints(NSnapPointsVar int32) uintptr { | |
| 523 | + | ||
| 524 | + | return XAdwSwipeableGetSnapPoints(x.GoPointer(), NSnapPointsVar) | |
| 525 | + | ||
| 526 | + | } | |
| 527 | + | ||
| 528 | + | // Gets the area @self can start a swipe from for the given direction and | |
| 529 | + | // gesture type. | |
| 530 | + | // | |
| 531 | + | // This can be used to restrict swipes to only be possible from a certain area, | |
| 532 | + | // for example, to only allow edge swipes, or to have a draggable element and | |
| 533 | + | // ignore swipes elsewhere. | |
| 534 | + | // | |
| 535 | + | // If not implemented, the default implementation returns the allocation of | |
| 536 | + | // @self, allowing swipes from anywhere. | |
| 537 | + | func (x *Flap) GetSwipeArea(NavigationDirectionVar NavigationDirection, IsDragVar bool, RectVar *gdk.Rectangle) { | |
| 538 | + | ||
| 539 | + | XAdwSwipeableGetSwipeArea(x.GoPointer(), NavigationDirectionVar, IsDragVar, RectVar) | |
| 540 | + | ||
| 541 | + | } | |
| 542 | + | ||
| 543 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 544 | + | func (x *Flap) GetAccessibleRole() gtk.AccessibleRole { | |
| 545 | + | ||
| 546 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 547 | + | ||
| 548 | + | } | |
| 549 | + | ||
| 550 | + | // Resets the accessible @property to its default value. | |
| 551 | + | func (x *Flap) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 552 | + | ||
| 553 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 554 | + | ||
| 555 | + | } | |
| 556 | + | ||
| 557 | + | // Resets the accessible @relation to its default value. | |
| 558 | + | func (x *Flap) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 559 | + | ||
| 560 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 561 | + | ||
| 562 | + | } | |
| 563 | + | ||
| 564 | + | // Resets the accessible @state to its default value. | |
| 565 | + | func (x *Flap) ResetState(StateVar gtk.AccessibleState) { | |
| 566 | + | ||
| 567 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 568 | + | ||
| 569 | + | } | |
| 570 | + | ||
| 571 | + | // Updates a list of accessible properties. | |
| 572 | + | // | |
| 573 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 574 | + | // value types of accessible properties. | |
| 575 | + | // | |
| 576 | + | // This function should be called by `GtkWidget` types whenever | |
| 577 | + | // an accessible property change must be communicated to assistive | |
| 578 | + | // technologies. | |
| 579 | + | // | |
| 580 | + | // Example: | |
| 581 | + | // ```c | |
| 582 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 583 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 584 | + | // | |
| 585 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 586 | + | // -1); | |
| 587 | + | // | |
| 588 | + | // ``` | |
| 589 | + | func (x *Flap) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 590 | + | ||
| 591 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 592 | + | ||
| 593 | + | } | |
| 594 | + | ||
| 595 | + | // Updates an array of accessible properties. | |
| 596 | + | // | |
| 597 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 598 | + | // property change must be communicated to assistive technologies. | |
| 599 | + | // | |
| 600 | + | // This function is meant to be used by language bindings. | |
| 601 | + | func (x *Flap) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 602 | + | ||
| 603 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 604 | + | ||
| 605 | + | } | |
| 606 | + | ||
| 607 | + | // Updates a list of accessible relations. | |
| 608 | + | // | |
| 609 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 610 | + | // relation change must be communicated to assistive technologies. | |
| 611 | + | // | |
| 612 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 613 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 614 | + | // | |
| 615 | + | // ```c | |
| 616 | + | // gtk_accessible_update_relation (accessible, | |
| 617 | + | // | |
| 618 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 619 | + | // ref1, NULL, | |
| 620 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 621 | + | // ref1, ref2, ref3, NULL, | |
| 622 | + | // -1); | |
| 623 | + | // | |
| 624 | + | // ``` | |
| 625 | + | func (x *Flap) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 626 | + | ||
| 627 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 628 | + | ||
| 629 | + | } | |
| 630 | + | ||
| 631 | + | // Updates an array of accessible relations. | |
| 632 | + | // | |
| 633 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 634 | + | // relation change must be communicated to assistive technologies. | |
| 635 | + | // | |
| 636 | + | // This function is meant to be used by language bindings. | |
| 637 | + | func (x *Flap) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 638 | + | ||
| 639 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 640 | + | ||
| 641 | + | } | |
| 642 | + | ||
| 643 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 644 | + | // documentation for the value types of accessible states. | |
| 645 | + | // | |
| 646 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 647 | + | // state change must be communicated to assistive technologies. | |
| 648 | + | // | |
| 649 | + | // Example: | |
| 650 | + | // ```c | |
| 651 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 652 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 653 | + | // | |
| 654 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 655 | + | // -1); | |
| 656 | + | // | |
| 657 | + | // ``` | |
| 658 | + | func (x *Flap) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 659 | + | ||
| 660 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 661 | + | ||
| 662 | + | } | |
| 663 | + | ||
| 664 | + | // Updates an array of accessible states. | |
| 665 | + | // | |
| 666 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 667 | + | // state change must be communicated to assistive technologies. | |
| 668 | + | // | |
| 669 | + | // This function is meant to be used by language bindings. | |
| 670 | + | func (x *Flap) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 671 | + | ||
| 672 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 673 | + | ||
| 674 | + | } | |
| 675 | + | ||
| 676 | + | // Gets the ID of the @buildable object. | |
| 677 | + | // | |
| 678 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 679 | + | // of the <object> tag used to construct the @buildable. | |
| 680 | + | func (x *Flap) GetBuildableId() string { | |
| 681 | + | ||
| 682 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 683 | + | ||
| 684 | + | } | |
| 685 | + | ||
| 686 | + | // Retrieves the orientation of the @orientable. | |
| 687 | + | func (x *Flap) GetOrientation() gtk.Orientation { | |
| 688 | + | ||
| 689 | + | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 690 | + | ||
| 691 | + | } | |
| 692 | + | ||
| 693 | + | // Sets the orientation of the @orientable. | |
| 694 | + | func (x *Flap) SetOrientation(OrientationVar gtk.Orientation) { | |
| 695 | + | ||
| 696 | + | gtk.XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar) | |
| 697 | + | ||
| 698 | + | } | |
| 699 | + | ||
| 700 | + | func init() { | |
| 701 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 702 | + | if err != nil { | |
| 703 | + | panic(err) | |
| 704 | + | } | |
| 705 | + | ||
| 706 | + | core.PuregoSafeRegister(&xNewFlap, lib, "adw_flap_new") | |
| 707 | + | ||
| 708 | + | core.PuregoSafeRegister(&xFlapGetContent, lib, "adw_flap_get_content") | |
| 709 | + | core.PuregoSafeRegister(&xFlapGetFlap, lib, "adw_flap_get_flap") | |
| 710 | + | core.PuregoSafeRegister(&xFlapGetFlapPosition, lib, "adw_flap_get_flap_position") | |
| 711 | + | core.PuregoSafeRegister(&xFlapGetFoldDuration, lib, "adw_flap_get_fold_duration") | |
| 712 | + | core.PuregoSafeRegister(&xFlapGetFoldPolicy, lib, "adw_flap_get_fold_policy") | |
| 713 | + | core.PuregoSafeRegister(&xFlapGetFoldThresholdPolicy, lib, "adw_flap_get_fold_threshold_policy") | |
| 714 | + | core.PuregoSafeRegister(&xFlapGetFolded, lib, "adw_flap_get_folded") | |
| 715 | + | core.PuregoSafeRegister(&xFlapGetLocked, lib, "adw_flap_get_locked") | |
| 716 | + | core.PuregoSafeRegister(&xFlapGetModal, lib, "adw_flap_get_modal") | |
| 717 | + | core.PuregoSafeRegister(&xFlapGetRevealFlap, lib, "adw_flap_get_reveal_flap") | |
| 718 | + | core.PuregoSafeRegister(&xFlapGetRevealParams, lib, "adw_flap_get_reveal_params") | |
| 719 | + | core.PuregoSafeRegister(&xFlapGetRevealProgress, lib, "adw_flap_get_reveal_progress") | |
| 720 | + | core.PuregoSafeRegister(&xFlapGetSeparator, lib, "adw_flap_get_separator") | |
| 721 | + | core.PuregoSafeRegister(&xFlapGetSwipeToClose, lib, "adw_flap_get_swipe_to_close") | |
| 722 | + | core.PuregoSafeRegister(&xFlapGetSwipeToOpen, lib, "adw_flap_get_swipe_to_open") | |
| 723 | + | core.PuregoSafeRegister(&xFlapGetTransitionType, lib, "adw_flap_get_transition_type") | |
| 724 | + | core.PuregoSafeRegister(&xFlapSetContent, lib, "adw_flap_set_content") | |
| 725 | + | core.PuregoSafeRegister(&xFlapSetFlap, lib, "adw_flap_set_flap") | |
| 726 | + | core.PuregoSafeRegister(&xFlapSetFlapPosition, lib, "adw_flap_set_flap_position") | |
| 727 | + | core.PuregoSafeRegister(&xFlapSetFoldDuration, lib, "adw_flap_set_fold_duration") | |
| 728 | + | core.PuregoSafeRegister(&xFlapSetFoldPolicy, lib, "adw_flap_set_fold_policy") | |
| 729 | + | core.PuregoSafeRegister(&xFlapSetFoldThresholdPolicy, lib, "adw_flap_set_fold_threshold_policy") | |
| 730 | + | core.PuregoSafeRegister(&xFlapSetLocked, lib, "adw_flap_set_locked") | |
| 731 | + | core.PuregoSafeRegister(&xFlapSetModal, lib, "adw_flap_set_modal") | |
| 732 | + | core.PuregoSafeRegister(&xFlapSetRevealFlap, lib, "adw_flap_set_reveal_flap") | |
| 733 | + | core.PuregoSafeRegister(&xFlapSetRevealParams, lib, "adw_flap_set_reveal_params") | |
| 734 | + | core.PuregoSafeRegister(&xFlapSetSeparator, lib, "adw_flap_set_separator") | |
| 735 | + | core.PuregoSafeRegister(&xFlapSetSwipeToClose, lib, "adw_flap_set_swipe_to_close") | |
| 736 | + | core.PuregoSafeRegister(&xFlapSetSwipeToOpen, lib, "adw_flap_set_swipe_to_open") | |
| 737 | + | core.PuregoSafeRegister(&xFlapSetTransitionType, lib, "adw_flap_set_transition_type") | |
| 738 | + | ||
| 739 | + | } | |
A v4/adw/adw-fold-threshold-policy.go +13 -0
| @@ -0,0 +1,13 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | // Determines when [class@Flap] and [class@Leaflet] will fold. | |
| 5 | + | type FoldThresholdPolicy int | |
| 6 | + | ||
| 7 | + | const ( | |
| 8 | + | ||
| 9 | + | // Folding is based on the minimum size | |
| 10 | + | FoldThresholdPolicyMinimumValue FoldThresholdPolicy = 0 | |
| 11 | + | // Folding is based on the natural size | |
| 12 | + | FoldThresholdPolicyNaturalValue FoldThresholdPolicy = 1 | |
| 13 | + | ) | |
A v4/adw/adw-header-bar.go +486 -0
| @@ -0,0 +1,486 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | type HeaderBarClass struct { | |
| 12 | + | ParentClass uintptr | |
| 13 | + | } | |
| 14 | + | ||
| 15 | + | // Describes title centering behavior of a [class@HeaderBar] widget. | |
| 16 | + | type CenteringPolicy int | |
| 17 | + | ||
| 18 | + | const ( | |
| 19 | + | ||
| 20 | + | // Keep the title centered when possible | |
| 21 | + | CenteringPolicyLooseValue CenteringPolicy = 0 | |
| 22 | + | // Keep the title centered at all cost | |
| 23 | + | CenteringPolicyStrictValue CenteringPolicy = 1 | |
| 24 | + | ) | |
| 25 | + | ||
| 26 | + | // A title bar widget. | |
| 27 | + | // | |
| 28 | + | // <picture> | |
| 29 | + | // | |
| 30 | + | // <source srcset="header-bar-dark.png" media="(prefers-color-scheme: dark)"> | |
| 31 | + | // <img src="header-bar.png" alt="header-bar"> | |
| 32 | + | // | |
| 33 | + | // </picture> | |
| 34 | + | // | |
| 35 | + | // `AdwHeaderBar` is similar to [class@Gtk.HeaderBar], but provides additional | |
| 36 | + | // features compared to it. Refer to `GtkHeaderBar` for details. | |
| 37 | + | // | |
| 38 | + | // [property@HeaderBar:centering-policy] allows to enforce strict centering of | |
| 39 | + | // the title widget, this is useful for [class@ViewSwitcherTitle]. | |
| 40 | + | // | |
| 41 | + | // [property@HeaderBar:show-start-title-buttons] and | |
| 42 | + | // [property@HeaderBar:show-end-title-buttons] allow to easily create split | |
| 43 | + | // header bar layouts using [class@Leaflet], as follows: | |
| 44 | + | // | |
| 45 | + | // ```xml | |
| 46 | + | // <object class="AdwLeaflet" id="leaflet"> | |
| 47 | + | // | |
| 48 | + | // <child> | |
| 49 | + | // <object class="GtkBox"> | |
| 50 | + | // <property name="orientation">vertical</property> | |
| 51 | + | // <child> | |
| 52 | + | // <object class="AdwHeaderBar"> | |
| 53 | + | // <binding name="show-end-title-buttons"> | |
| 54 | + | // <lookup name="folded">leaflet</lookup> | |
| 55 | + | // </binding> | |
| 56 | + | // </object> | |
| 57 | + | // </child> | |
| 58 | + | // <!-- ... --> | |
| 59 | + | // </object> | |
| 60 | + | // </child> | |
| 61 | + | // <!-- ... --> | |
| 62 | + | // <child> | |
| 63 | + | // <object class="GtkBox"> | |
| 64 | + | // <property name="orientation">vertical</property> | |
| 65 | + | // <property name="hexpand">True</property> | |
| 66 | + | // <child> | |
| 67 | + | // <object class="AdwHeaderBar"> | |
| 68 | + | // <binding name="show-start-title-buttons"> | |
| 69 | + | // <lookup name="folded">leaflet</lookup> | |
| 70 | + | // </binding> | |
| 71 | + | // </object> | |
| 72 | + | // </child> | |
| 73 | + | // <!-- ... --> | |
| 74 | + | // </object> | |
| 75 | + | // </child> | |
| 76 | + | // | |
| 77 | + | // </object> | |
| 78 | + | // ``` | |
| 79 | + | // | |
| 80 | + | // <picture> | |
| 81 | + | // | |
| 82 | + | // <source srcset="header-bar-split-dark.png" media="(prefers-color-scheme: dark)"> | |
| 83 | + | // <img src="header-bar-split.png" alt="header-bar-split"> | |
| 84 | + | // | |
| 85 | + | // </picture> | |
| 86 | + | // | |
| 87 | + | // ## CSS nodes | |
| 88 | + | // | |
| 89 | + | // ``` | |
| 90 | + | // headerbar | |
| 91 | + | // ╰── windowhandle | |
| 92 | + | // | |
| 93 | + | // ╰── box | |
| 94 | + | // ├── widget | |
| 95 | + | // │ ╰── box.start | |
| 96 | + | // │ ├── windowcontrols.start | |
| 97 | + | // │ ╰── [other children] | |
| 98 | + | // ├── [Title Widget] | |
| 99 | + | // ╰── widget | |
| 100 | + | // ╰── box.end | |
| 101 | + | // ├── [other children] | |
| 102 | + | // ╰── windowcontrols.end | |
| 103 | + | // | |
| 104 | + | // ``` | |
| 105 | + | // | |
| 106 | + | // `AdwHeaderBar`'s CSS node is called `headerbar`. It contains a `windowhandle` | |
| 107 | + | // subnode, which contains a `box` subnode, which contains two `widget` subnodes | |
| 108 | + | // at the start and end of the header bar, each of which contains a `box` | |
| 109 | + | // subnode with the `.start` and `.end` style classes respectively, as well as a | |
| 110 | + | // center node that represents the title. | |
| 111 | + | // | |
| 112 | + | // Each of the boxes contains a `windowcontrols` subnode, see | |
| 113 | + | // [class@Gtk.WindowControls] for details, as well as other children. | |
| 114 | + | // | |
| 115 | + | // ## Accessibility | |
| 116 | + | // | |
| 117 | + | // `AdwHeaderBar` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role. | |
| 118 | + | type HeaderBar struct { | |
| 119 | + | gtk.Widget | |
| 120 | + | } | |
| 121 | + | ||
| 122 | + | func HeaderBarNewFromInternalPtr(ptr uintptr) *HeaderBar { | |
| 123 | + | cls := &HeaderBar{} | |
| 124 | + | cls.Ptr = ptr | |
| 125 | + | return cls | |
| 126 | + | } | |
| 127 | + | ||
| 128 | + | var xNewHeaderBar func() uintptr | |
| 129 | + | ||
| 130 | + | // Creates a new `AdwHeaderBar`. | |
| 131 | + | func NewHeaderBar() *gtk.Widget { | |
| 132 | + | NewHeaderBarPtr := xNewHeaderBar() | |
| 133 | + | if NewHeaderBarPtr == 0 { | |
| 134 | + | return nil | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | gobject.IncreaseRef(NewHeaderBarPtr) | |
| 138 | + | ||
| 139 | + | NewHeaderBarCls := >k.Widget{} | |
| 140 | + | NewHeaderBarCls.Ptr = NewHeaderBarPtr | |
| 141 | + | return NewHeaderBarCls | |
| 142 | + | } | |
| 143 | + | ||
| 144 | + | var xHeaderBarGetCenteringPolicy func(uintptr) CenteringPolicy | |
| 145 | + | ||
| 146 | + | // Gets the policy for aligning the center widget. | |
| 147 | + | func (x *HeaderBar) GetCenteringPolicy() CenteringPolicy { | |
| 148 | + | ||
| 149 | + | return xHeaderBarGetCenteringPolicy(x.GoPointer()) | |
| 150 | + | ||
| 151 | + | } | |
| 152 | + | ||
| 153 | + | var xHeaderBarGetDecorationLayout func(uintptr) string | |
| 154 | + | ||
| 155 | + | // Gets the decoration layout for @self. | |
| 156 | + | func (x *HeaderBar) GetDecorationLayout() string { | |
| 157 | + | ||
| 158 | + | return xHeaderBarGetDecorationLayout(x.GoPointer()) | |
| 159 | + | ||
| 160 | + | } | |
| 161 | + | ||
| 162 | + | var xHeaderBarGetShowEndTitleButtons func(uintptr) bool | |
| 163 | + | ||
| 164 | + | // Gets whether to show title buttons at the end of @self. | |
| 165 | + | func (x *HeaderBar) GetShowEndTitleButtons() bool { | |
| 166 | + | ||
| 167 | + | return xHeaderBarGetShowEndTitleButtons(x.GoPointer()) | |
| 168 | + | ||
| 169 | + | } | |
| 170 | + | ||
| 171 | + | var xHeaderBarGetShowStartTitleButtons func(uintptr) bool | |
| 172 | + | ||
| 173 | + | // Gets whether to show title buttons at the start of @self. | |
| 174 | + | func (x *HeaderBar) GetShowStartTitleButtons() bool { | |
| 175 | + | ||
| 176 | + | return xHeaderBarGetShowStartTitleButtons(x.GoPointer()) | |
| 177 | + | ||
| 178 | + | } | |
| 179 | + | ||
| 180 | + | var xHeaderBarGetTitleWidget func(uintptr) uintptr | |
| 181 | + | ||
| 182 | + | // Gets the title widget widget of @self. | |
| 183 | + | func (x *HeaderBar) GetTitleWidget() *gtk.Widget { | |
| 184 | + | ||
| 185 | + | GetTitleWidgetPtr := xHeaderBarGetTitleWidget(x.GoPointer()) | |
| 186 | + | if GetTitleWidgetPtr == 0 { | |
| 187 | + | return nil | |
| 188 | + | } | |
| 189 | + | ||
| 190 | + | gobject.IncreaseRef(GetTitleWidgetPtr) | |
| 191 | + | ||
| 192 | + | GetTitleWidgetCls := >k.Widget{} | |
| 193 | + | GetTitleWidgetCls.Ptr = GetTitleWidgetPtr | |
| 194 | + | return GetTitleWidgetCls | |
| 195 | + | ||
| 196 | + | } | |
| 197 | + | ||
| 198 | + | var xHeaderBarPackEnd func(uintptr, uintptr) | |
| 199 | + | ||
| 200 | + | // Adds @child to @self, packed with reference to the end of @self. | |
| 201 | + | func (x *HeaderBar) PackEnd(ChildVar *gtk.Widget) { | |
| 202 | + | ||
| 203 | + | xHeaderBarPackEnd(x.GoPointer(), ChildVar.GoPointer()) | |
| 204 | + | ||
| 205 | + | } | |
| 206 | + | ||
| 207 | + | var xHeaderBarPackStart func(uintptr, uintptr) | |
| 208 | + | ||
| 209 | + | // Adds @child to @self, packed with reference to the start of the @self. | |
| 210 | + | func (x *HeaderBar) PackStart(ChildVar *gtk.Widget) { | |
| 211 | + | ||
| 212 | + | xHeaderBarPackStart(x.GoPointer(), ChildVar.GoPointer()) | |
| 213 | + | ||
| 214 | + | } | |
| 215 | + | ||
| 216 | + | var xHeaderBarRemove func(uintptr, uintptr) | |
| 217 | + | ||
| 218 | + | // Removes a child from @self. | |
| 219 | + | // | |
| 220 | + | // The child must have been added with [method@HeaderBar.pack_start], | |
| 221 | + | // [method@HeaderBar.pack_end] or [property@HeaderBar:title-widget]. | |
| 222 | + | func (x *HeaderBar) Remove(ChildVar *gtk.Widget) { | |
| 223 | + | ||
| 224 | + | xHeaderBarRemove(x.GoPointer(), ChildVar.GoPointer()) | |
| 225 | + | ||
| 226 | + | } | |
| 227 | + | ||
| 228 | + | var xHeaderBarSetCenteringPolicy func(uintptr, CenteringPolicy) | |
| 229 | + | ||
| 230 | + | // Sets the policy for aligning the center widget. | |
| 231 | + | func (x *HeaderBar) SetCenteringPolicy(CenteringPolicyVar CenteringPolicy) { | |
| 232 | + | ||
| 233 | + | xHeaderBarSetCenteringPolicy(x.GoPointer(), CenteringPolicyVar) | |
| 234 | + | ||
| 235 | + | } | |
| 236 | + | ||
| 237 | + | var xHeaderBarSetDecorationLayout func(uintptr, string) | |
| 238 | + | ||
| 239 | + | // Sets the decoration layout for @self. | |
| 240 | + | // | |
| 241 | + | // If this property is not set, the | |
| 242 | + | // [property@Gtk.Settings:gtk-decoration-layout] setting is used. | |
| 243 | + | // | |
| 244 | + | // The format of the string is button names, separated by commas. A colon | |
| 245 | + | // separates the buttons that should appear at the start from those at the end. | |
| 246 | + | // Recognized button names are minimize, maximize, close and icon (the window | |
| 247 | + | // icon). | |
| 248 | + | // | |
| 249 | + | // For example, “icon:minimize,maximize,close” specifies an icon at the start, | |
| 250 | + | // and minimize, maximize and close buttons at the end. | |
| 251 | + | func (x *HeaderBar) SetDecorationLayout(LayoutVar string) { | |
| 252 | + | ||
| 253 | + | xHeaderBarSetDecorationLayout(x.GoPointer(), LayoutVar) | |
| 254 | + | ||
| 255 | + | } | |
| 256 | + | ||
| 257 | + | var xHeaderBarSetShowEndTitleButtons func(uintptr, bool) | |
| 258 | + | ||
| 259 | + | // Sets whether to show title buttons at the end of @self. | |
| 260 | + | // | |
| 261 | + | // See [property@HeaderBar:show-start-title-buttons] for the other side. | |
| 262 | + | // | |
| 263 | + | // Which buttons are actually shown and where is determined by the | |
| 264 | + | // [property@HeaderBar:decoration-layout] property, and by the state of the | |
| 265 | + | // window (e.g. a close button will not be shown if the window can't be closed). | |
| 266 | + | func (x *HeaderBar) SetShowEndTitleButtons(SettingVar bool) { | |
| 267 | + | ||
| 268 | + | xHeaderBarSetShowEndTitleButtons(x.GoPointer(), SettingVar) | |
| 269 | + | ||
| 270 | + | } | |
| 271 | + | ||
| 272 | + | var xHeaderBarSetShowStartTitleButtons func(uintptr, bool) | |
| 273 | + | ||
| 274 | + | // Sets whether to show title buttons at the start of @self. | |
| 275 | + | // | |
| 276 | + | // See [property@HeaderBar:show-end-title-buttons] for the other side. | |
| 277 | + | // | |
| 278 | + | // Which buttons are actually shown and where is determined by the | |
| 279 | + | // [property@HeaderBar:decoration-layout] property, and by the state of the | |
| 280 | + | // window (e.g. a close button will not be shown if the window can't be closed). | |
| 281 | + | func (x *HeaderBar) SetShowStartTitleButtons(SettingVar bool) { | |
| 282 | + | ||
| 283 | + | xHeaderBarSetShowStartTitleButtons(x.GoPointer(), SettingVar) | |
| 284 | + | ||
| 285 | + | } | |
| 286 | + | ||
| 287 | + | var xHeaderBarSetTitleWidget func(uintptr, uintptr) | |
| 288 | + | ||
| 289 | + | // Sets the title widget for @self. | |
| 290 | + | // | |
| 291 | + | // When set to `NULL`, the header bar will display the title of the window it | |
| 292 | + | // is contained in. | |
| 293 | + | // | |
| 294 | + | // To use a different title, use [class@WindowTitle]: | |
| 295 | + | // | |
| 296 | + | // ```xml | |
| 297 | + | // <object class="AdwHeaderBar"> | |
| 298 | + | // | |
| 299 | + | // <property name="title-widget"> | |
| 300 | + | // <object class="AdwWindowTitle"> | |
| 301 | + | // <property name="title" translatable="yes">Title</property> | |
| 302 | + | // </object> | |
| 303 | + | // </property> | |
| 304 | + | // | |
| 305 | + | // </object> | |
| 306 | + | // ``` | |
| 307 | + | func (x *HeaderBar) SetTitleWidget(TitleWidgetVar *gtk.Widget) { | |
| 308 | + | ||
| 309 | + | xHeaderBarSetTitleWidget(x.GoPointer(), TitleWidgetVar.GoPointer()) | |
| 310 | + | ||
| 311 | + | } | |
| 312 | + | ||
| 313 | + | func (c *HeaderBar) GoPointer() uintptr { | |
| 314 | + | return c.Ptr | |
| 315 | + | } | |
| 316 | + | ||
| 317 | + | func (c *HeaderBar) SetGoPointer(ptr uintptr) { | |
| 318 | + | c.Ptr = ptr | |
| 319 | + | } | |
| 320 | + | ||
| 321 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 322 | + | func (x *HeaderBar) GetAccessibleRole() gtk.AccessibleRole { | |
| 323 | + | ||
| 324 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 325 | + | ||
| 326 | + | } | |
| 327 | + | ||
| 328 | + | // Resets the accessible @property to its default value. | |
| 329 | + | func (x *HeaderBar) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 330 | + | ||
| 331 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 332 | + | ||
| 333 | + | } | |
| 334 | + | ||
| 335 | + | // Resets the accessible @relation to its default value. | |
| 336 | + | func (x *HeaderBar) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 337 | + | ||
| 338 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 339 | + | ||
| 340 | + | } | |
| 341 | + | ||
| 342 | + | // Resets the accessible @state to its default value. | |
| 343 | + | func (x *HeaderBar) ResetState(StateVar gtk.AccessibleState) { | |
| 344 | + | ||
| 345 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 346 | + | ||
| 347 | + | } | |
| 348 | + | ||
| 349 | + | // Updates a list of accessible properties. | |
| 350 | + | // | |
| 351 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 352 | + | // value types of accessible properties. | |
| 353 | + | // | |
| 354 | + | // This function should be called by `GtkWidget` types whenever | |
| 355 | + | // an accessible property change must be communicated to assistive | |
| 356 | + | // technologies. | |
| 357 | + | // | |
| 358 | + | // Example: | |
| 359 | + | // ```c | |
| 360 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 361 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 362 | + | // | |
| 363 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 364 | + | // -1); | |
| 365 | + | // | |
| 366 | + | // ``` | |
| 367 | + | func (x *HeaderBar) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 368 | + | ||
| 369 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 370 | + | ||
| 371 | + | } | |
| 372 | + | ||
| 373 | + | // Updates an array of accessible properties. | |
| 374 | + | // | |
| 375 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 376 | + | // property change must be communicated to assistive technologies. | |
| 377 | + | // | |
| 378 | + | // This function is meant to be used by language bindings. | |
| 379 | + | func (x *HeaderBar) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 380 | + | ||
| 381 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 382 | + | ||
| 383 | + | } | |
| 384 | + | ||
| 385 | + | // Updates a list of accessible relations. | |
| 386 | + | // | |
| 387 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 388 | + | // relation change must be communicated to assistive technologies. | |
| 389 | + | // | |
| 390 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 391 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 392 | + | // | |
| 393 | + | // ```c | |
| 394 | + | // gtk_accessible_update_relation (accessible, | |
| 395 | + | // | |
| 396 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 397 | + | // ref1, NULL, | |
| 398 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 399 | + | // ref1, ref2, ref3, NULL, | |
| 400 | + | // -1); | |
| 401 | + | // | |
| 402 | + | // ``` | |
| 403 | + | func (x *HeaderBar) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 404 | + | ||
| 405 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 406 | + | ||
| 407 | + | } | |
| 408 | + | ||
| 409 | + | // Updates an array of accessible relations. | |
| 410 | + | // | |
| 411 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 412 | + | // relation change must be communicated to assistive technologies. | |
| 413 | + | // | |
| 414 | + | // This function is meant to be used by language bindings. | |
| 415 | + | func (x *HeaderBar) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 416 | + | ||
| 417 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 418 | + | ||
| 419 | + | } | |
| 420 | + | ||
| 421 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 422 | + | // documentation for the value types of accessible states. | |
| 423 | + | // | |
| 424 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 425 | + | // state change must be communicated to assistive technologies. | |
| 426 | + | // | |
| 427 | + | // Example: | |
| 428 | + | // ```c | |
| 429 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 430 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 431 | + | // | |
| 432 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 433 | + | // -1); | |
| 434 | + | // | |
| 435 | + | // ``` | |
| 436 | + | func (x *HeaderBar) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 437 | + | ||
| 438 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 439 | + | ||
| 440 | + | } | |
| 441 | + | ||
| 442 | + | // Updates an array of accessible states. | |
| 443 | + | // | |
| 444 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 445 | + | // state change must be communicated to assistive technologies. | |
| 446 | + | // | |
| 447 | + | // This function is meant to be used by language bindings. | |
| 448 | + | func (x *HeaderBar) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 449 | + | ||
| 450 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 451 | + | ||
| 452 | + | } | |
| 453 | + | ||
| 454 | + | // Gets the ID of the @buildable object. | |
| 455 | + | // | |
| 456 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 457 | + | // of the <object> tag used to construct the @buildable. | |
| 458 | + | func (x *HeaderBar) GetBuildableId() string { | |
| 459 | + | ||
| 460 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 461 | + | ||
| 462 | + | } | |
| 463 | + | ||
| 464 | + | func init() { | |
| 465 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 466 | + | if err != nil { | |
| 467 | + | panic(err) | |
| 468 | + | } | |
| 469 | + | ||
| 470 | + | core.PuregoSafeRegister(&xNewHeaderBar, lib, "adw_header_bar_new") | |
| 471 | + | ||
| 472 | + | core.PuregoSafeRegister(&xHeaderBarGetCenteringPolicy, lib, "adw_header_bar_get_centering_policy") | |
| 473 | + | core.PuregoSafeRegister(&xHeaderBarGetDecorationLayout, lib, "adw_header_bar_get_decoration_layout") | |
| 474 | + | core.PuregoSafeRegister(&xHeaderBarGetShowEndTitleButtons, lib, "adw_header_bar_get_show_end_title_buttons") | |
| 475 | + | core.PuregoSafeRegister(&xHeaderBarGetShowStartTitleButtons, lib, "adw_header_bar_get_show_start_title_buttons") | |
| 476 | + | core.PuregoSafeRegister(&xHeaderBarGetTitleWidget, lib, "adw_header_bar_get_title_widget") | |
| 477 | + | core.PuregoSafeRegister(&xHeaderBarPackEnd, lib, "adw_header_bar_pack_end") | |
| 478 | + | core.PuregoSafeRegister(&xHeaderBarPackStart, lib, "adw_header_bar_pack_start") | |
| 479 | + | core.PuregoSafeRegister(&xHeaderBarRemove, lib, "adw_header_bar_remove") | |
| 480 | + | core.PuregoSafeRegister(&xHeaderBarSetCenteringPolicy, lib, "adw_header_bar_set_centering_policy") | |
| 481 | + | core.PuregoSafeRegister(&xHeaderBarSetDecorationLayout, lib, "adw_header_bar_set_decoration_layout") | |
| 482 | + | core.PuregoSafeRegister(&xHeaderBarSetShowEndTitleButtons, lib, "adw_header_bar_set_show_end_title_buttons") | |
| 483 | + | core.PuregoSafeRegister(&xHeaderBarSetShowStartTitleButtons, lib, "adw_header_bar_set_show_start_title_buttons") | |
| 484 | + | core.PuregoSafeRegister(&xHeaderBarSetTitleWidget, lib, "adw_header_bar_set_title_widget") | |
| 485 | + | ||
| 486 | + | } | |
A v4/adw/adw-leaflet.go +880 -0
| @@ -0,0 +1,880 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gdk" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 10 | + | ) | |
| 11 | + | ||
| 12 | + | type LeafletClass struct { | |
| 13 | + | ParentClass uintptr | |
| 14 | + | } | |
| 15 | + | ||
| 16 | + | type LeafletPageClass struct { | |
| 17 | + | ParentClass uintptr | |
| 18 | + | } | |
| 19 | + | ||
| 20 | + | // Describes the possible transitions in a [class@Leaflet] widget. | |
| 21 | + | // | |
| 22 | + | // New values may be added to this enumeration over time. | |
| 23 | + | type LeafletTransitionType int | |
| 24 | + | ||
| 25 | + | const ( | |
| 26 | + | ||
| 27 | + | // Cover the old page or uncover the new page, sliding from or towards the end according to orientation, text direction and children order | |
| 28 | + | LeafletTransitionTypeOverValue LeafletTransitionType = 0 | |
| 29 | + | // Uncover the new page or cover the old page, sliding from or towards the start according to orientation, text direction and children order | |
| 30 | + | LeafletTransitionTypeUnderValue LeafletTransitionType = 1 | |
| 31 | + | // Slide from left, right, up or down according to the orientation, text direction and the children order | |
| 32 | + | LeafletTransitionTypeSlideValue LeafletTransitionType = 2 | |
| 33 | + | ) | |
| 34 | + | ||
| 35 | + | // An adaptive container acting like a box or a stack. | |
| 36 | + | // | |
| 37 | + | // <picture> | |
| 38 | + | // | |
| 39 | + | // <source srcset="leaflet-wide-dark.png" media="(prefers-color-scheme: dark)"> | |
| 40 | + | // <img src="leaflet-wide.png" alt="leaflet-wide"> | |
| 41 | + | // | |
| 42 | + | // </picture> | |
| 43 | + | // <picture> | |
| 44 | + | // | |
| 45 | + | // <source srcset="leaflet-narrow-dark.png" media="(prefers-color-scheme: dark)"> | |
| 46 | + | // <img src="leaflet-narrow.png" alt="leaflet-narrow"> | |
| 47 | + | // | |
| 48 | + | // </picture> | |
| 49 | + | // | |
| 50 | + | // The `AdwLeaflet` widget can display its children like a [class@Gtk.Box] does | |
| 51 | + | // or like a [class@Gtk.Stack] does, adapting to size changes by switching | |
| 52 | + | // between the two modes. | |
| 53 | + | // | |
| 54 | + | // When there is enough space the children are displayed side by side, otherwise | |
| 55 | + | // only one is displayed and the leaflet is said to be “folded”. | |
| 56 | + | // The threshold is dictated by the preferred minimum sizes of the children. | |
| 57 | + | // When a leaflet is folded, the children can be navigated using swipe gestures. | |
| 58 | + | // | |
| 59 | + | // The “over” and “under” transition types stack the children one on top of the | |
| 60 | + | // other, while the “slide” transition puts the children side by side. While | |
| 61 | + | // navigating to a child on the side or below can be performed by swiping the | |
| 62 | + | // current child away, navigating to an upper child requires dragging it from | |
| 63 | + | // the edge where it resides. This doesn't affect non-dragging swipes. | |
| 64 | + | // | |
| 65 | + | // ## CSS nodes | |
| 66 | + | // | |
| 67 | + | // `AdwLeaflet` has a single CSS node with name `leaflet`. The node will get the | |
| 68 | + | // style classes `.folded` when it is folded, `.unfolded` when it's not, or none | |
| 69 | + | // if it hasn't computed its fold yet. | |
| 70 | + | type Leaflet struct { | |
| 71 | + | gtk.Widget | |
| 72 | + | } | |
| 73 | + | ||
| 74 | + | func LeafletNewFromInternalPtr(ptr uintptr) *Leaflet { | |
| 75 | + | cls := &Leaflet{} | |
| 76 | + | cls.Ptr = ptr | |
| 77 | + | return cls | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | var xNewLeaflet func() uintptr | |
| 81 | + | ||
| 82 | + | // Creates a new `AdwLeaflet`. | |
| 83 | + | func NewLeaflet() *gtk.Widget { | |
| 84 | + | NewLeafletPtr := xNewLeaflet() | |
| 85 | + | if NewLeafletPtr == 0 { | |
| 86 | + | return nil | |
| 87 | + | } | |
| 88 | + | ||
| 89 | + | gobject.IncreaseRef(NewLeafletPtr) | |
| 90 | + | ||
| 91 | + | NewLeafletCls := >k.Widget{} | |
| 92 | + | NewLeafletCls.Ptr = NewLeafletPtr | |
| 93 | + | return NewLeafletCls | |
| 94 | + | } | |
| 95 | + | ||
| 96 | + | var xLeafletAppend func(uintptr, uintptr) uintptr | |
| 97 | + | ||
| 98 | + | // Adds a child to @self. | |
| 99 | + | func (x *Leaflet) Append(ChildVar *gtk.Widget) *LeafletPage { | |
| 100 | + | ||
| 101 | + | AppendPtr := xLeafletAppend(x.GoPointer(), ChildVar.GoPointer()) | |
| 102 | + | if AppendPtr == 0 { | |
| 103 | + | return nil | |
| 104 | + | } | |
| 105 | + | ||
| 106 | + | gobject.IncreaseRef(AppendPtr) | |
| 107 | + | ||
| 108 | + | AppendCls := &LeafletPage{} | |
| 109 | + | AppendCls.Ptr = AppendPtr | |
| 110 | + | return AppendCls | |
| 111 | + | ||
| 112 | + | } | |
| 113 | + | ||
| 114 | + | var xLeafletGetAdjacentChild func(uintptr, NavigationDirection) uintptr | |
| 115 | + | ||
| 116 | + | // Finds the previous or next navigatable child. | |
| 117 | + | // | |
| 118 | + | // This will be the same child [method@Leaflet.navigate] or swipe gestures will | |
| 119 | + | // navigate to. | |
| 120 | + | // | |
| 121 | + | // If there's no child to navigate to, `NULL` will be returned instead. | |
| 122 | + | // | |
| 123 | + | // See [property@LeafletPage:navigatable]. | |
| 124 | + | func (x *Leaflet) GetAdjacentChild(DirectionVar NavigationDirection) *gtk.Widget { | |
| 125 | + | ||
| 126 | + | GetAdjacentChildPtr := xLeafletGetAdjacentChild(x.GoPointer(), DirectionVar) | |
| 127 | + | if GetAdjacentChildPtr == 0 { | |
| 128 | + | return nil | |
| 129 | + | } | |
| 130 | + | ||
| 131 | + | gobject.IncreaseRef(GetAdjacentChildPtr) | |
| 132 | + | ||
| 133 | + | GetAdjacentChildCls := >k.Widget{} | |
| 134 | + | GetAdjacentChildCls.Ptr = GetAdjacentChildPtr | |
| 135 | + | return GetAdjacentChildCls | |
| 136 | + | ||
| 137 | + | } | |
| 138 | + | ||
| 139 | + | var xLeafletGetCanNavigateBack func(uintptr) bool | |
| 140 | + | ||
| 141 | + | // Gets whether gestures and shortcuts for navigating backward are enabled. | |
| 142 | + | func (x *Leaflet) GetCanNavigateBack() bool { | |
| 143 | + | ||
| 144 | + | return xLeafletGetCanNavigateBack(x.GoPointer()) | |
| 145 | + | ||
| 146 | + | } | |
| 147 | + | ||
| 148 | + | var xLeafletGetCanNavigateForward func(uintptr) bool | |
| 149 | + | ||
| 150 | + | // Gets whether gestures and shortcuts for navigating forward are enabled. | |
| 151 | + | func (x *Leaflet) GetCanNavigateForward() bool { | |
| 152 | + | ||
| 153 | + | return xLeafletGetCanNavigateForward(x.GoPointer()) | |
| 154 | + | ||
| 155 | + | } | |
| 156 | + | ||
| 157 | + | var xLeafletGetCanUnfold func(uintptr) bool | |
| 158 | + | ||
| 159 | + | // Gets whether @self can unfold. | |
| 160 | + | func (x *Leaflet) GetCanUnfold() bool { | |
| 161 | + | ||
| 162 | + | return xLeafletGetCanUnfold(x.GoPointer()) | |
| 163 | + | ||
| 164 | + | } | |
| 165 | + | ||
| 166 | + | var xLeafletGetChildByName func(uintptr, string) uintptr | |
| 167 | + | ||
| 168 | + | // Finds the child of @self with @name. | |
| 169 | + | // | |
| 170 | + | // Returns `NULL` if there is no child with this name. | |
| 171 | + | // | |
| 172 | + | // See [property@LeafletPage:name]. | |
| 173 | + | func (x *Leaflet) GetChildByName(NameVar string) *gtk.Widget { | |
| 174 | + | ||
| 175 | + | GetChildByNamePtr := xLeafletGetChildByName(x.GoPointer(), NameVar) | |
| 176 | + | if GetChildByNamePtr == 0 { | |
| 177 | + | return nil | |
| 178 | + | } | |
| 179 | + | ||
| 180 | + | gobject.IncreaseRef(GetChildByNamePtr) | |
| 181 | + | ||
| 182 | + | GetChildByNameCls := >k.Widget{} | |
| 183 | + | GetChildByNameCls.Ptr = GetChildByNamePtr | |
| 184 | + | return GetChildByNameCls | |
| 185 | + | ||
| 186 | + | } | |
| 187 | + | ||
| 188 | + | var xLeafletGetChildTransitionParams func(uintptr) *SpringParams | |
| 189 | + | ||
| 190 | + | // Gets the child transition spring parameters for @self. | |
| 191 | + | func (x *Leaflet) GetChildTransitionParams() *SpringParams { | |
| 192 | + | ||
| 193 | + | return xLeafletGetChildTransitionParams(x.GoPointer()) | |
| 194 | + | ||
| 195 | + | } | |
| 196 | + | ||
| 197 | + | var xLeafletGetChildTransitionRunning func(uintptr) bool | |
| 198 | + | ||
| 199 | + | // Gets whether a child transition is currently running for @self. | |
| 200 | + | func (x *Leaflet) GetChildTransitionRunning() bool { | |
| 201 | + | ||
| 202 | + | return xLeafletGetChildTransitionRunning(x.GoPointer()) | |
| 203 | + | ||
| 204 | + | } | |
| 205 | + | ||
| 206 | + | var xLeafletGetFoldThresholdPolicy func(uintptr) FoldThresholdPolicy | |
| 207 | + | ||
| 208 | + | // Gets the fold threshold policy for @self. | |
| 209 | + | func (x *Leaflet) GetFoldThresholdPolicy() FoldThresholdPolicy { | |
| 210 | + | ||
| 211 | + | return xLeafletGetFoldThresholdPolicy(x.GoPointer()) | |
| 212 | + | ||
| 213 | + | } | |
| 214 | + | ||
| 215 | + | var xLeafletGetFolded func(uintptr) bool | |
| 216 | + | ||
| 217 | + | // Gets whether @self is folded. | |
| 218 | + | // | |
| 219 | + | // The leaflet will be folded if the size allocated to it is smaller than the | |
| 220 | + | // sum of the minimum or natural sizes of the children (see | |
| 221 | + | // [property@Leaflet:fold-threshold-policy]), it will be unfolded otherwise. | |
| 222 | + | func (x *Leaflet) GetFolded() bool { | |
| 223 | + | ||
| 224 | + | return xLeafletGetFolded(x.GoPointer()) | |
| 225 | + | ||
| 226 | + | } | |
| 227 | + | ||
| 228 | + | var xLeafletGetHomogeneous func(uintptr) bool | |
| 229 | + | ||
| 230 | + | // Gets whether @self is homogeneous. | |
| 231 | + | func (x *Leaflet) GetHomogeneous() bool { | |
| 232 | + | ||
| 233 | + | return xLeafletGetHomogeneous(x.GoPointer()) | |
| 234 | + | ||
| 235 | + | } | |
| 236 | + | ||
| 237 | + | var xLeafletGetModeTransitionDuration func(uintptr) uint | |
| 238 | + | ||
| 239 | + | // Gets the mode transition animation duration for @self. | |
| 240 | + | func (x *Leaflet) GetModeTransitionDuration() uint { | |
| 241 | + | ||
| 242 | + | return xLeafletGetModeTransitionDuration(x.GoPointer()) | |
| 243 | + | ||
| 244 | + | } | |
| 245 | + | ||
| 246 | + | var xLeafletGetPage func(uintptr, uintptr) uintptr | |
| 247 | + | ||
| 248 | + | // Returns the [class@LeafletPage] object for @child. | |
| 249 | + | func (x *Leaflet) GetPage(ChildVar *gtk.Widget) *LeafletPage { | |
| 250 | + | ||
| 251 | + | GetPagePtr := xLeafletGetPage(x.GoPointer(), ChildVar.GoPointer()) | |
| 252 | + | if GetPagePtr == 0 { | |
| 253 | + | return nil | |
| 254 | + | } | |
| 255 | + | ||
| 256 | + | gobject.IncreaseRef(GetPagePtr) | |
| 257 | + | ||
| 258 | + | GetPageCls := &LeafletPage{} | |
| 259 | + | GetPageCls.Ptr = GetPagePtr | |
| 260 | + | return GetPageCls | |
| 261 | + | ||
| 262 | + | } | |
| 263 | + | ||
| 264 | + | var xLeafletGetPages func(uintptr) uintptr | |
| 265 | + | ||
| 266 | + | // Returns a [iface@Gio.ListModel] that contains the pages of the leaflet. | |
| 267 | + | // | |
| 268 | + | // This can be used to keep an up-to-date view. The model also implements | |
| 269 | + | // [iface@Gtk.SelectionModel] and can be used to track and change the visible | |
| 270 | + | // page. | |
| 271 | + | func (x *Leaflet) GetPages() *gtk.SelectionModelBase { | |
| 272 | + | ||
| 273 | + | GetPagesPtr := xLeafletGetPages(x.GoPointer()) | |
| 274 | + | if GetPagesPtr == 0 { | |
| 275 | + | return nil | |
| 276 | + | } | |
| 277 | + | ||
| 278 | + | GetPagesCls := >k.SelectionModelBase{} | |
| 279 | + | GetPagesCls.Ptr = GetPagesPtr | |
| 280 | + | return GetPagesCls | |
| 281 | + | ||
| 282 | + | } | |
| 283 | + | ||
| 284 | + | var xLeafletGetTransitionType func(uintptr) LeafletTransitionType | |
| 285 | + | ||
| 286 | + | // Gets the type of animation used for transitions between modes and children. | |
| 287 | + | func (x *Leaflet) GetTransitionType() LeafletTransitionType { | |
| 288 | + | ||
| 289 | + | return xLeafletGetTransitionType(x.GoPointer()) | |
| 290 | + | ||
| 291 | + | } | |
| 292 | + | ||
| 293 | + | var xLeafletGetVisibleChild func(uintptr) uintptr | |
| 294 | + | ||
| 295 | + | // Gets the widget currently visible when the leaflet is folded. | |
| 296 | + | func (x *Leaflet) GetVisibleChild() *gtk.Widget { | |
| 297 | + | ||
| 298 | + | GetVisibleChildPtr := xLeafletGetVisibleChild(x.GoPointer()) | |
| 299 | + | if GetVisibleChildPtr == 0 { | |
| 300 | + | return nil | |
| 301 | + | } | |
| 302 | + | ||
| 303 | + | gobject.IncreaseRef(GetVisibleChildPtr) | |
| 304 | + | ||
| 305 | + | GetVisibleChildCls := >k.Widget{} | |
| 306 | + | GetVisibleChildCls.Ptr = GetVisibleChildPtr | |
| 307 | + | return GetVisibleChildCls | |
| 308 | + | ||
| 309 | + | } | |
| 310 | + | ||
| 311 | + | var xLeafletGetVisibleChildName func(uintptr) string | |
| 312 | + | ||
| 313 | + | // Gets the name of the currently visible child widget. | |
| 314 | + | func (x *Leaflet) GetVisibleChildName() string { | |
| 315 | + | ||
| 316 | + | return xLeafletGetVisibleChildName(x.GoPointer()) | |
| 317 | + | ||
| 318 | + | } | |
| 319 | + | ||
| 320 | + | var xLeafletInsertChildAfter func(uintptr, uintptr, uintptr) uintptr | |
| 321 | + | ||
| 322 | + | // Inserts @child in the position after @sibling in the list of children. | |
| 323 | + | // | |
| 324 | + | // If @sibling is `NULL`, inserts @child at the first position. | |
| 325 | + | func (x *Leaflet) InsertChildAfter(ChildVar *gtk.Widget, SiblingVar *gtk.Widget) *LeafletPage { | |
| 326 | + | ||
| 327 | + | InsertChildAfterPtr := xLeafletInsertChildAfter(x.GoPointer(), ChildVar.GoPointer(), SiblingVar.GoPointer()) | |
| 328 | + | if InsertChildAfterPtr == 0 { | |
| 329 | + | return nil | |
| 330 | + | } | |
| 331 | + | ||
| 332 | + | gobject.IncreaseRef(InsertChildAfterPtr) | |
| 333 | + | ||
| 334 | + | InsertChildAfterCls := &LeafletPage{} | |
| 335 | + | InsertChildAfterCls.Ptr = InsertChildAfterPtr | |
| 336 | + | return InsertChildAfterCls | |
| 337 | + | ||
| 338 | + | } | |
| 339 | + | ||
| 340 | + | var xLeafletNavigate func(uintptr, NavigationDirection) bool | |
| 341 | + | ||
| 342 | + | // Navigates to the previous or next child. | |
| 343 | + | // | |
| 344 | + | // The child must have the [property@LeafletPage:navigatable] property set to | |
| 345 | + | // `TRUE`, otherwise it will be skipped. | |
| 346 | + | // | |
| 347 | + | // This will be the same child as returned by | |
| 348 | + | // [method@Leaflet.get_adjacent_child] or navigated to via swipe gestures. | |
| 349 | + | func (x *Leaflet) Navigate(DirectionVar NavigationDirection) bool { | |
| 350 | + | ||
| 351 | + | return xLeafletNavigate(x.GoPointer(), DirectionVar) | |
| 352 | + | ||
| 353 | + | } | |
| 354 | + | ||
| 355 | + | var xLeafletPrepend func(uintptr, uintptr) uintptr | |
| 356 | + | ||
| 357 | + | // Inserts @child at the first position in @self. | |
| 358 | + | func (x *Leaflet) Prepend(ChildVar *gtk.Widget) *LeafletPage { | |
| 359 | + | ||
| 360 | + | PrependPtr := xLeafletPrepend(x.GoPointer(), ChildVar.GoPointer()) | |
| 361 | + | if PrependPtr == 0 { | |
| 362 | + | return nil | |
| 363 | + | } | |
| 364 | + | ||
| 365 | + | gobject.IncreaseRef(PrependPtr) | |
| 366 | + | ||
| 367 | + | PrependCls := &LeafletPage{} | |
| 368 | + | PrependCls.Ptr = PrependPtr | |
| 369 | + | return PrependCls | |
| 370 | + | ||
| 371 | + | } | |
| 372 | + | ||
| 373 | + | var xLeafletRemove func(uintptr, uintptr) | |
| 374 | + | ||
| 375 | + | // Removes a child widget from @self. | |
| 376 | + | func (x *Leaflet) Remove(ChildVar *gtk.Widget) { | |
| 377 | + | ||
| 378 | + | xLeafletRemove(x.GoPointer(), ChildVar.GoPointer()) | |
| 379 | + | ||
| 380 | + | } | |
| 381 | + | ||
| 382 | + | var xLeafletReorderChildAfter func(uintptr, uintptr, uintptr) | |
| 383 | + | ||
| 384 | + | // Moves @child to the position after @sibling in the list of children. | |
| 385 | + | // | |
| 386 | + | // If @sibling is `NULL`, moves @child to the first position. | |
| 387 | + | func (x *Leaflet) ReorderChildAfter(ChildVar *gtk.Widget, SiblingVar *gtk.Widget) { | |
| 388 | + | ||
| 389 | + | xLeafletReorderChildAfter(x.GoPointer(), ChildVar.GoPointer(), SiblingVar.GoPointer()) | |
| 390 | + | ||
| 391 | + | } | |
| 392 | + | ||
| 393 | + | var xLeafletSetCanNavigateBack func(uintptr, bool) | |
| 394 | + | ||
| 395 | + | // Sets whether gestures and shortcuts for navigating backward are enabled. | |
| 396 | + | // | |
| 397 | + | // The supported gestures are: | |
| 398 | + | // | |
| 399 | + | // - One-finger swipe on touchscreens | |
| 400 | + | // - Horizontal scrolling on touchpads (usually two-finger swipe) | |
| 401 | + | // - Back/forward mouse buttons | |
| 402 | + | // | |
| 403 | + | // The keyboard back/forward keys are also supported, as well as the | |
| 404 | + | // <kbd>Alt</kbd>+<kbd>←</kbd> shortcut for horizontal orientation, or | |
| 405 | + | // <kbd>Alt</kbd>+<kbd>↑</kbd> for vertical orientation. | |
| 406 | + | // | |
| 407 | + | // If the orientation is horizontal, for right-to-left locales, gestures and | |
| 408 | + | // shortcuts are reversed. | |
| 409 | + | // | |
| 410 | + | // Only children that have [property@LeafletPage:navigatable] set to `TRUE` can | |
| 411 | + | // be navigated to. | |
| 412 | + | func (x *Leaflet) SetCanNavigateBack(CanNavigateBackVar bool) { | |
| 413 | + | ||
| 414 | + | xLeafletSetCanNavigateBack(x.GoPointer(), CanNavigateBackVar) | |
| 415 | + | ||
| 416 | + | } | |
| 417 | + | ||
| 418 | + | var xLeafletSetCanNavigateForward func(uintptr, bool) | |
| 419 | + | ||
| 420 | + | // Sets whether gestures and shortcuts for navigating forward are enabled. | |
| 421 | + | // | |
| 422 | + | // The supported gestures are: | |
| 423 | + | // | |
| 424 | + | // - One-finger swipe on touchscreens | |
| 425 | + | // - Horizontal scrolling on touchpads (usually two-finger swipe) | |
| 426 | + | // - Back/forward mouse buttons | |
| 427 | + | // | |
| 428 | + | // The keyboard back/forward keys are also supported, as well as the | |
| 429 | + | // <kbd>Alt</kbd>+<kbd>→</kbd> shortcut for horizontal orientation, or | |
| 430 | + | // <kbd>Alt</kbd>+<kbd>↓</kbd> for vertical orientation. | |
| 431 | + | // | |
| 432 | + | // If the orientation is horizontal, for right-to-left locales, gestures and | |
| 433 | + | // shortcuts are reversed. | |
| 434 | + | // | |
| 435 | + | // Only children that have [property@LeafletPage:navigatable] set to `TRUE` can | |
| 436 | + | // be navigated to. | |
| 437 | + | func (x *Leaflet) SetCanNavigateForward(CanNavigateForwardVar bool) { | |
| 438 | + | ||
| 439 | + | xLeafletSetCanNavigateForward(x.GoPointer(), CanNavigateForwardVar) | |
| 440 | + | ||
| 441 | + | } | |
| 442 | + | ||
| 443 | + | var xLeafletSetCanUnfold func(uintptr, bool) | |
| 444 | + | ||
| 445 | + | // Sets whether @self can unfold. | |
| 446 | + | func (x *Leaflet) SetCanUnfold(CanUnfoldVar bool) { | |
| 447 | + | ||
| 448 | + | xLeafletSetCanUnfold(x.GoPointer(), CanUnfoldVar) | |
| 449 | + | ||
| 450 | + | } | |
| 451 | + | ||
| 452 | + | var xLeafletSetChildTransitionParams func(uintptr, *SpringParams) | |
| 453 | + | ||
| 454 | + | // Sets the child transition spring parameters for @self. | |
| 455 | + | // | |
| 456 | + | // The default value is equivalent to: | |
| 457 | + | // | |
| 458 | + | // ```c | |
| 459 | + | // adw_spring_params_new (1, 0.5, 500) | |
| 460 | + | // ``` | |
| 461 | + | func (x *Leaflet) SetChildTransitionParams(ParamsVar *SpringParams) { | |
| 462 | + | ||
| 463 | + | xLeafletSetChildTransitionParams(x.GoPointer(), ParamsVar) | |
| 464 | + | ||
| 465 | + | } | |
| 466 | + | ||
| 467 | + | var xLeafletSetFoldThresholdPolicy func(uintptr, FoldThresholdPolicy) | |
| 468 | + | ||
| 469 | + | // Sets the fold threshold policy for @self. | |
| 470 | + | // | |
| 471 | + | // If set to `ADW_FOLD_THRESHOLD_POLICY_MINIMUM`, it will only fold when the | |
| 472 | + | // children cannot fit anymore. With `ADW_FOLD_THRESHOLD_POLICY_NATURAL`, it | |
| 473 | + | // will fold as soon as children don't get their natural size. | |
| 474 | + | // | |
| 475 | + | // This can be useful if you have a long ellipsizing label and want to let it | |
| 476 | + | // ellipsize instead of immediately folding. | |
| 477 | + | func (x *Leaflet) SetFoldThresholdPolicy(PolicyVar FoldThresholdPolicy) { | |
| 478 | + | ||
| 479 | + | xLeafletSetFoldThresholdPolicy(x.GoPointer(), PolicyVar) | |
| 480 | + | ||
| 481 | + | } | |
| 482 | + | ||
| 483 | + | var xLeafletSetHomogeneous func(uintptr, bool) | |
| 484 | + | ||
| 485 | + | // Sets @self to be homogeneous or not. | |
| 486 | + | // | |
| 487 | + | // If set to `FALSE`, different children can have different size along the | |
| 488 | + | // opposite orientation. | |
| 489 | + | func (x *Leaflet) SetHomogeneous(HomogeneousVar bool) { | |
| 490 | + | ||
| 491 | + | xLeafletSetHomogeneous(x.GoPointer(), HomogeneousVar) | |
| 492 | + | ||
| 493 | + | } | |
| 494 | + | ||
| 495 | + | var xLeafletSetModeTransitionDuration func(uintptr, uint) | |
| 496 | + | ||
| 497 | + | // Sets the mode transition animation duration for @self. | |
| 498 | + | func (x *Leaflet) SetModeTransitionDuration(DurationVar uint) { | |
| 499 | + | ||
| 500 | + | xLeafletSetModeTransitionDuration(x.GoPointer(), DurationVar) | |
| 501 | + | ||
| 502 | + | } | |
| 503 | + | ||
| 504 | + | var xLeafletSetTransitionType func(uintptr, LeafletTransitionType) | |
| 505 | + | ||
| 506 | + | // Sets the type of animation used for transitions between modes and children. | |
| 507 | + | // | |
| 508 | + | // The transition type can be changed without problems at runtime, so it is | |
| 509 | + | // possible to change the animation based on the mode or child that is about to | |
| 510 | + | // become current. | |
| 511 | + | func (x *Leaflet) SetTransitionType(TransitionVar LeafletTransitionType) { | |
| 512 | + | ||
| 513 | + | xLeafletSetTransitionType(x.GoPointer(), TransitionVar) | |
| 514 | + | ||
| 515 | + | } | |
| 516 | + | ||
| 517 | + | var xLeafletSetVisibleChild func(uintptr, uintptr) | |
| 518 | + | ||
| 519 | + | // Sets the widget currently visible when the leaflet is folded. | |
| 520 | + | // | |
| 521 | + | // The transition is determined by [property@Leaflet:transition-type] and | |
| 522 | + | // [property@Leaflet:child-transition-params]. The transition can be cancelled | |
| 523 | + | // by the user, in which case visible child will change back to the previously | |
| 524 | + | // visible child. | |
| 525 | + | func (x *Leaflet) SetVisibleChild(VisibleChildVar *gtk.Widget) { | |
| 526 | + | ||
| 527 | + | xLeafletSetVisibleChild(x.GoPointer(), VisibleChildVar.GoPointer()) | |
| 528 | + | ||
| 529 | + | } | |
| 530 | + | ||
| 531 | + | var xLeafletSetVisibleChildName func(uintptr, string) | |
| 532 | + | ||
| 533 | + | // Makes the child with the name @name visible. | |
| 534 | + | // | |
| 535 | + | // See [property@Leaflet:visible-child]. | |
| 536 | + | func (x *Leaflet) SetVisibleChildName(NameVar string) { | |
| 537 | + | ||
| 538 | + | xLeafletSetVisibleChildName(x.GoPointer(), NameVar) | |
| 539 | + | ||
| 540 | + | } | |
| 541 | + | ||
| 542 | + | func (c *Leaflet) GoPointer() uintptr { | |
| 543 | + | return c.Ptr | |
| 544 | + | } | |
| 545 | + | ||
| 546 | + | func (c *Leaflet) SetGoPointer(ptr uintptr) { | |
| 547 | + | c.Ptr = ptr | |
| 548 | + | } | |
| 549 | + | ||
| 550 | + | // Gets the progress @self will snap back to after the gesture is canceled. | |
| 551 | + | func (x *Leaflet) GetCancelProgress() float64 { | |
| 552 | + | ||
| 553 | + | return XAdwSwipeableGetCancelProgress(x.GoPointer()) | |
| 554 | + | ||
| 555 | + | } | |
| 556 | + | ||
| 557 | + | // Gets the swipe distance of @self. | |
| 558 | + | // | |
| 559 | + | // This corresponds to how many pixels 1 unit represents. | |
| 560 | + | func (x *Leaflet) GetDistance() float64 { | |
| 561 | + | ||
| 562 | + | return XAdwSwipeableGetDistance(x.GoPointer()) | |
| 563 | + | ||
| 564 | + | } | |
| 565 | + | ||
| 566 | + | // Gets the current progress of @self. | |
| 567 | + | func (x *Leaflet) GetProgress() float64 { | |
| 568 | + | ||
| 569 | + | return XAdwSwipeableGetProgress(x.GoPointer()) | |
| 570 | + | ||
| 571 | + | } | |
| 572 | + | ||
| 573 | + | // Gets the snap points of @self. | |
| 574 | + | // | |
| 575 | + | // Each snap point represents a progress value that is considered acceptable to | |
| 576 | + | // end the swipe on. | |
| 577 | + | func (x *Leaflet) GetSnapPoints(NSnapPointsVar int32) uintptr { | |
| 578 | + | ||
| 579 | + | return XAdwSwipeableGetSnapPoints(x.GoPointer(), NSnapPointsVar) | |
| 580 | + | ||
| 581 | + | } | |
| 582 | + | ||
| 583 | + | // Gets the area @self can start a swipe from for the given direction and | |
| 584 | + | // gesture type. | |
| 585 | + | // | |
| 586 | + | // This can be used to restrict swipes to only be possible from a certain area, | |
| 587 | + | // for example, to only allow edge swipes, or to have a draggable element and | |
| 588 | + | // ignore swipes elsewhere. | |
| 589 | + | // | |
| 590 | + | // If not implemented, the default implementation returns the allocation of | |
| 591 | + | // @self, allowing swipes from anywhere. | |
| 592 | + | func (x *Leaflet) GetSwipeArea(NavigationDirectionVar NavigationDirection, IsDragVar bool, RectVar *gdk.Rectangle) { | |
| 593 | + | ||
| 594 | + | XAdwSwipeableGetSwipeArea(x.GoPointer(), NavigationDirectionVar, IsDragVar, RectVar) | |
| 595 | + | ||
| 596 | + | } | |
| 597 | + | ||
| 598 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 599 | + | func (x *Leaflet) GetAccessibleRole() gtk.AccessibleRole { | |
| 600 | + | ||
| 601 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 602 | + | ||
| 603 | + | } | |
| 604 | + | ||
| 605 | + | // Resets the accessible @property to its default value. | |
| 606 | + | func (x *Leaflet) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 607 | + | ||
| 608 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 609 | + | ||
| 610 | + | } | |
| 611 | + | ||
| 612 | + | // Resets the accessible @relation to its default value. | |
| 613 | + | func (x *Leaflet) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 614 | + | ||
| 615 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 616 | + | ||
| 617 | + | } | |
| 618 | + | ||
| 619 | + | // Resets the accessible @state to its default value. | |
| 620 | + | func (x *Leaflet) ResetState(StateVar gtk.AccessibleState) { | |
| 621 | + | ||
| 622 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 623 | + | ||
| 624 | + | } | |
| 625 | + | ||
| 626 | + | // Updates a list of accessible properties. | |
| 627 | + | // | |
| 628 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 629 | + | // value types of accessible properties. | |
| 630 | + | // | |
| 631 | + | // This function should be called by `GtkWidget` types whenever | |
| 632 | + | // an accessible property change must be communicated to assistive | |
| 633 | + | // technologies. | |
| 634 | + | // | |
| 635 | + | // Example: | |
| 636 | + | // ```c | |
| 637 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 638 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 639 | + | // | |
| 640 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 641 | + | // -1); | |
| 642 | + | // | |
| 643 | + | // ``` | |
| 644 | + | func (x *Leaflet) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 645 | + | ||
| 646 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 647 | + | ||
| 648 | + | } | |
| 649 | + | ||
| 650 | + | // Updates an array of accessible properties. | |
| 651 | + | // | |
| 652 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 653 | + | // property change must be communicated to assistive technologies. | |
| 654 | + | // | |
| 655 | + | // This function is meant to be used by language bindings. | |
| 656 | + | func (x *Leaflet) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 657 | + | ||
| 658 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 659 | + | ||
| 660 | + | } | |
| 661 | + | ||
| 662 | + | // Updates a list of accessible relations. | |
| 663 | + | // | |
| 664 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 665 | + | // relation change must be communicated to assistive technologies. | |
| 666 | + | // | |
| 667 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 668 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 669 | + | // | |
| 670 | + | // ```c | |
| 671 | + | // gtk_accessible_update_relation (accessible, | |
| 672 | + | // | |
| 673 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 674 | + | // ref1, NULL, | |
| 675 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 676 | + | // ref1, ref2, ref3, NULL, | |
| 677 | + | // -1); | |
| 678 | + | // | |
| 679 | + | // ``` | |
| 680 | + | func (x *Leaflet) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 681 | + | ||
| 682 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 683 | + | ||
| 684 | + | } | |
| 685 | + | ||
| 686 | + | // Updates an array of accessible relations. | |
| 687 | + | // | |
| 688 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 689 | + | // relation change must be communicated to assistive technologies. | |
| 690 | + | // | |
| 691 | + | // This function is meant to be used by language bindings. | |
| 692 | + | func (x *Leaflet) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 693 | + | ||
| 694 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 695 | + | ||
| 696 | + | } | |
| 697 | + | ||
| 698 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 699 | + | // documentation for the value types of accessible states. | |
| 700 | + | // | |
| 701 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 702 | + | // state change must be communicated to assistive technologies. | |
| 703 | + | // | |
| 704 | + | // Example: | |
| 705 | + | // ```c | |
| 706 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 707 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 708 | + | // | |
| 709 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 710 | + | // -1); | |
| 711 | + | // | |
| 712 | + | // ``` | |
| 713 | + | func (x *Leaflet) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 714 | + | ||
| 715 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 716 | + | ||
| 717 | + | } | |
| 718 | + | ||
| 719 | + | // Updates an array of accessible states. | |
| 720 | + | // | |
| 721 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 722 | + | // state change must be communicated to assistive technologies. | |
| 723 | + | // | |
| 724 | + | // This function is meant to be used by language bindings. | |
| 725 | + | func (x *Leaflet) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 726 | + | ||
| 727 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 728 | + | ||
| 729 | + | } | |
| 730 | + | ||
| 731 | + | // Gets the ID of the @buildable object. | |
| 732 | + | // | |
| 733 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 734 | + | // of the <object> tag used to construct the @buildable. | |
| 735 | + | func (x *Leaflet) GetBuildableId() string { | |
| 736 | + | ||
| 737 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 738 | + | ||
| 739 | + | } | |
| 740 | + | ||
| 741 | + | // Retrieves the orientation of the @orientable. | |
| 742 | + | func (x *Leaflet) GetOrientation() gtk.Orientation { | |
| 743 | + | ||
| 744 | + | return gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 745 | + | ||
| 746 | + | } | |
| 747 | + | ||
| 748 | + | // Sets the orientation of the @orientable. | |
| 749 | + | func (x *Leaflet) SetOrientation(OrientationVar gtk.Orientation) { | |
| 750 | + | ||
| 751 | + | gtk.XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar) | |
| 752 | + | ||
| 753 | + | } | |
| 754 | + | ||
| 755 | + | // An auxiliary class used by [class@Leaflet]. | |
| 756 | + | type LeafletPage struct { | |
| 757 | + | gobject.Object | |
| 758 | + | } | |
| 759 | + | ||
| 760 | + | func LeafletPageNewFromInternalPtr(ptr uintptr) *LeafletPage { | |
| 761 | + | cls := &LeafletPage{} | |
| 762 | + | cls.Ptr = ptr | |
| 763 | + | return cls | |
| 764 | + | } | |
| 765 | + | ||
| 766 | + | var xLeafletPageGetChild func(uintptr) uintptr | |
| 767 | + | ||
| 768 | + | // Gets the leaflet child to which @self belongs. | |
| 769 | + | func (x *LeafletPage) GetChild() *gtk.Widget { | |
| 770 | + | ||
| 771 | + | GetChildPtr := xLeafletPageGetChild(x.GoPointer()) | |
| 772 | + | if GetChildPtr == 0 { | |
| 773 | + | return nil | |
| 774 | + | } | |
| 775 | + | ||
| 776 | + | gobject.IncreaseRef(GetChildPtr) | |
| 777 | + | ||
| 778 | + | GetChildCls := >k.Widget{} | |
| 779 | + | GetChildCls.Ptr = GetChildPtr | |
| 780 | + | return GetChildCls | |
| 781 | + | ||
| 782 | + | } | |
| 783 | + | ||
| 784 | + | var xLeafletPageGetName func(uintptr) string | |
| 785 | + | ||
| 786 | + | // Gets the name of @self. | |
| 787 | + | func (x *LeafletPage) GetName() string { | |
| 788 | + | ||
| 789 | + | return xLeafletPageGetName(x.GoPointer()) | |
| 790 | + | ||
| 791 | + | } | |
| 792 | + | ||
| 793 | + | var xLeafletPageGetNavigatable func(uintptr) bool | |
| 794 | + | ||
| 795 | + | // Gets whether the child can be navigated to when folded. | |
| 796 | + | func (x *LeafletPage) GetNavigatable() bool { | |
| 797 | + | ||
| 798 | + | return xLeafletPageGetNavigatable(x.GoPointer()) | |
| 799 | + | ||
| 800 | + | } | |
| 801 | + | ||
| 802 | + | var xLeafletPageSetName func(uintptr, string) | |
| 803 | + | ||
| 804 | + | // Sets the name of the @self. | |
| 805 | + | func (x *LeafletPage) SetName(NameVar string) { | |
| 806 | + | ||
| 807 | + | xLeafletPageSetName(x.GoPointer(), NameVar) | |
| 808 | + | ||
| 809 | + | } | |
| 810 | + | ||
| 811 | + | var xLeafletPageSetNavigatable func(uintptr, bool) | |
| 812 | + | ||
| 813 | + | // Sets whether @self can be navigated to when folded. | |
| 814 | + | // | |
| 815 | + | // If `FALSE`, the child will be ignored by [method@Leaflet.get_adjacent_child], | |
| 816 | + | // [method@Leaflet.navigate], and swipe gestures. | |
| 817 | + | // | |
| 818 | + | // This can be used used to prevent switching to widgets like separators. | |
| 819 | + | func (x *LeafletPage) SetNavigatable(NavigatableVar bool) { | |
| 820 | + | ||
| 821 | + | xLeafletPageSetNavigatable(x.GoPointer(), NavigatableVar) | |
| 822 | + | ||
| 823 | + | } | |
| 824 | + | ||
| 825 | + | func (c *LeafletPage) GoPointer() uintptr { | |
| 826 | + | return c.Ptr | |
| 827 | + | } | |
| 828 | + | ||
| 829 | + | func (c *LeafletPage) SetGoPointer(ptr uintptr) { | |
| 830 | + | c.Ptr = ptr | |
| 831 | + | } | |
| 832 | + | ||
| 833 | + | func init() { | |
| 834 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 835 | + | if err != nil { | |
| 836 | + | panic(err) | |
| 837 | + | } | |
| 838 | + | ||
| 839 | + | core.PuregoSafeRegister(&xNewLeaflet, lib, "adw_leaflet_new") | |
| 840 | + | ||
| 841 | + | core.PuregoSafeRegister(&xLeafletAppend, lib, "adw_leaflet_append") | |
| 842 | + | core.PuregoSafeRegister(&xLeafletGetAdjacentChild, lib, "adw_leaflet_get_adjacent_child") | |
| 843 | + | core.PuregoSafeRegister(&xLeafletGetCanNavigateBack, lib, "adw_leaflet_get_can_navigate_back") | |
| 844 | + | core.PuregoSafeRegister(&xLeafletGetCanNavigateForward, lib, "adw_leaflet_get_can_navigate_forward") | |
| 845 | + | core.PuregoSafeRegister(&xLeafletGetCanUnfold, lib, "adw_leaflet_get_can_unfold") | |
| 846 | + | core.PuregoSafeRegister(&xLeafletGetChildByName, lib, "adw_leaflet_get_child_by_name") | |
| 847 | + | core.PuregoSafeRegister(&xLeafletGetChildTransitionParams, lib, "adw_leaflet_get_child_transition_params") | |
| 848 | + | core.PuregoSafeRegister(&xLeafletGetChildTransitionRunning, lib, "adw_leaflet_get_child_transition_running") | |
| 849 | + | core.PuregoSafeRegister(&xLeafletGetFoldThresholdPolicy, lib, "adw_leaflet_get_fold_threshold_policy") | |
| 850 | + | core.PuregoSafeRegister(&xLeafletGetFolded, lib, "adw_leaflet_get_folded") | |
| 851 | + | core.PuregoSafeRegister(&xLeafletGetHomogeneous, lib, "adw_leaflet_get_homogeneous") | |
| 852 | + | core.PuregoSafeRegister(&xLeafletGetModeTransitionDuration, lib, "adw_leaflet_get_mode_transition_duration") | |
| 853 | + | core.PuregoSafeRegister(&xLeafletGetPage, lib, "adw_leaflet_get_page") | |
| 854 | + | core.PuregoSafeRegister(&xLeafletGetPages, lib, "adw_leaflet_get_pages") | |
| 855 | + | core.PuregoSafeRegister(&xLeafletGetTransitionType, lib, "adw_leaflet_get_transition_type") | |
| 856 | + | core.PuregoSafeRegister(&xLeafletGetVisibleChild, lib, "adw_leaflet_get_visible_child") | |
| 857 | + | core.PuregoSafeRegister(&xLeafletGetVisibleChildName, lib, "adw_leaflet_get_visible_child_name") | |
| 858 | + | core.PuregoSafeRegister(&xLeafletInsertChildAfter, lib, "adw_leaflet_insert_child_after") | |
| 859 | + | core.PuregoSafeRegister(&xLeafletNavigate, lib, "adw_leaflet_navigate") | |
| 860 | + | core.PuregoSafeRegister(&xLeafletPrepend, lib, "adw_leaflet_prepend") | |
| 861 | + | core.PuregoSafeRegister(&xLeafletRemove, lib, "adw_leaflet_remove") | |
| 862 | + | core.PuregoSafeRegister(&xLeafletReorderChildAfter, lib, "adw_leaflet_reorder_child_after") | |
| 863 | + | core.PuregoSafeRegister(&xLeafletSetCanNavigateBack, lib, "adw_leaflet_set_can_navigate_back") | |
| 864 | + | core.PuregoSafeRegister(&xLeafletSetCanNavigateForward, lib, "adw_leaflet_set_can_navigate_forward") | |
| 865 | + | core.PuregoSafeRegister(&xLeafletSetCanUnfold, lib, "adw_leaflet_set_can_unfold") | |
| 866 | + | core.PuregoSafeRegister(&xLeafletSetChildTransitionParams, lib, "adw_leaflet_set_child_transition_params") | |
| 867 | + | core.PuregoSafeRegister(&xLeafletSetFoldThresholdPolicy, lib, "adw_leaflet_set_fold_threshold_policy") | |
| 868 | + | core.PuregoSafeRegister(&xLeafletSetHomogeneous, lib, "adw_leaflet_set_homogeneous") | |
| 869 | + | core.PuregoSafeRegister(&xLeafletSetModeTransitionDuration, lib, "adw_leaflet_set_mode_transition_duration") | |
| 870 | + | core.PuregoSafeRegister(&xLeafletSetTransitionType, lib, "adw_leaflet_set_transition_type") | |
| 871 | + | core.PuregoSafeRegister(&xLeafletSetVisibleChild, lib, "adw_leaflet_set_visible_child") | |
| 872 | + | core.PuregoSafeRegister(&xLeafletSetVisibleChildName, lib, "adw_leaflet_set_visible_child_name") | |
| 873 | + | ||
| 874 | + | core.PuregoSafeRegister(&xLeafletPageGetChild, lib, "adw_leaflet_page_get_child") | |
| 875 | + | core.PuregoSafeRegister(&xLeafletPageGetName, lib, "adw_leaflet_page_get_name") | |
| 876 | + | core.PuregoSafeRegister(&xLeafletPageGetNavigatable, lib, "adw_leaflet_page_get_navigatable") | |
| 877 | + | core.PuregoSafeRegister(&xLeafletPageSetName, lib, "adw_leaflet_page_set_name") | |
| 878 | + | core.PuregoSafeRegister(&xLeafletPageSetNavigatable, lib, "adw_leaflet_page_set_navigatable") | |
| 879 | + | ||
| 880 | + | } | |
A v4/adw/adw-main.go +46 -0
| @@ -0,0 +1,46 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | ) | |
| 8 | + | ||
| 9 | + | var xInit func() | |
| 10 | + | ||
| 11 | + | // Initializes Libadwaita. | |
| 12 | + | // | |
| 13 | + | // This function can be used instead of [func@Gtk.init] as it initializes GTK | |
| 14 | + | // implicitly. | |
| 15 | + | // | |
| 16 | + | // There's no need to call this function if you're using [class@Application]. | |
| 17 | + | // | |
| 18 | + | // If Libadwaita has already been initialized, the function will simply return. | |
| 19 | + | // | |
| 20 | + | // This makes sure translations, types, themes, and icons for the Adwaita | |
| 21 | + | // library are set up properly. | |
| 22 | + | func Init() { | |
| 23 | + | ||
| 24 | + | xInit() | |
| 25 | + | ||
| 26 | + | } | |
| 27 | + | ||
| 28 | + | var xIsInitialized func() bool | |
| 29 | + | ||
| 30 | + | // Use this function to check if libadwaita has been initialized with | |
| 31 | + | // [func@init]. | |
| 32 | + | func IsInitialized() bool { | |
| 33 | + | ||
| 34 | + | return xIsInitialized() | |
| 35 | + | ||
| 36 | + | } | |
| 37 | + | ||
| 38 | + | func init() { | |
| 39 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 40 | + | if err != nil { | |
| 41 | + | panic(err) | |
| 42 | + | } | |
| 43 | + | core.PuregoSafeRegister(&xInit, lib, "adw_init") | |
| 44 | + | core.PuregoSafeRegister(&xIsInitialized, lib, "adw_is_initialized") | |
| 45 | + | ||
| 46 | + | } | |
A v4/adw/adw-message-dialog.go +928 -0
| @@ -0,0 +1,928 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gdk" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gio" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/gsk" | |
| 11 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 12 | + | ) | |
| 13 | + | ||
| 14 | + | type MessageDialogClass struct { | |
| 15 | + | ParentClass uintptr | |
| 16 | + | ||
| 17 | + | Padding uintptr | |
| 18 | + | } | |
| 19 | + | ||
| 20 | + | // Describes the possible styles of [class@MessageDialog] response buttons. | |
| 21 | + | // | |
| 22 | + | // See [method@MessageDialog.set_response_appearance]. | |
| 23 | + | type ResponseAppearance int | |
| 24 | + | ||
| 25 | + | const ( | |
| 26 | + | ||
| 27 | + | // the default appearance. | |
| 28 | + | ResponseDefaultValue ResponseAppearance = 0 | |
| 29 | + | // used to denote important responses such as the | |
| 30 | + | // affirmative action. | |
| 31 | + | ResponseSuggestedValue ResponseAppearance = 1 | |
| 32 | + | // used to draw attention to the potentially damaging | |
| 33 | + | // consequences of using the response. This appearance acts as a warning to | |
| 34 | + | // the user. | |
| 35 | + | ResponseDestructiveValue ResponseAppearance = 2 | |
| 36 | + | ) | |
| 37 | + | ||
| 38 | + | // A dialog presenting a message or a question. | |
| 39 | + | // | |
| 40 | + | // <picture> | |
| 41 | + | // | |
| 42 | + | // <source srcset="message-dialog-dark.png" media="(prefers-color-scheme: dark)"> | |
| 43 | + | // <img src="message-dialog.png" alt="message-dialog"> | |
| 44 | + | // | |
| 45 | + | // </picture> | |
| 46 | + | // | |
| 47 | + | // Message dialogs have a heading, a body, an optional child widget, and one or | |
| 48 | + | // multiple responses, each presented as a button. | |
| 49 | + | // | |
| 50 | + | // Each response has a unique string ID, and a button label. Additionally, each | |
| 51 | + | // response can be enabled or disabled, and can have a suggested or destructive | |
| 52 | + | // appearance. | |
| 53 | + | // | |
| 54 | + | // When one of the responses is activated, or the dialog is closed, the | |
| 55 | + | // [signal@MessageDialog::response] signal will be emitted. This signal is | |
| 56 | + | // detailed, and the detail, as well as the `response` parameter will be set to | |
| 57 | + | // the ID of the activated response, or to the value of the | |
| 58 | + | // [property@MessageDialog:close-response] property if the dialog had been | |
| 59 | + | // closed without activating any of the responses. | |
| 60 | + | // | |
| 61 | + | // Response buttons can be presented horizontally or vertically depending on | |
| 62 | + | // available space. | |
| 63 | + | // | |
| 64 | + | // When a response is activated, `AdwMessageDialog` is closed automatically. | |
| 65 | + | // | |
| 66 | + | // An example of using a message dialog: | |
| 67 | + | // | |
| 68 | + | // ```c | |
| 69 | + | // GtkWidget *dialog; | |
| 70 | + | // | |
| 71 | + | // dialog = adw_message_dialog_new (parent, _("Replace File?"), NULL); | |
| 72 | + | // | |
| 73 | + | // adw_message_dialog_format_body (ADW_MESSAGE_DIALOG (dialog), | |
| 74 | + | // | |
| 75 | + | // _("A file named “%s” already exists. Do you want to replace it?"), | |
| 76 | + | // filename); | |
| 77 | + | // | |
| 78 | + | // adw_message_dialog_add_responses (ADW_MESSAGE_DIALOG (dialog), | |
| 79 | + | // | |
| 80 | + | // "cancel", _("_Cancel"), | |
| 81 | + | // "replace", _("_Replace"), | |
| 82 | + | // NULL); | |
| 83 | + | // | |
| 84 | + | // adw_message_dialog_set_response_appearance (ADW_MESSAGE_DIALOG (dialog), "replace", ADW_RESPONSE_DESTRUCTIVE); | |
| 85 | + | // | |
| 86 | + | // adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG (dialog), "cancel"); | |
| 87 | + | // adw_message_dialog_set_close_response (ADW_MESSAGE_DIALOG (dialog), "cancel"); | |
| 88 | + | // | |
| 89 | + | // g_signal_connect (dialog, "response", G_CALLBACK (response_cb), self); | |
| 90 | + | // | |
| 91 | + | // gtk_window_present (GTK_WINDOW (dialog)); | |
| 92 | + | // ``` | |
| 93 | + | // | |
| 94 | + | // ## Async API | |
| 95 | + | // | |
| 96 | + | // `AdwMessageDialog` can also be used via the [method@MessageDialog.choose] | |
| 97 | + | // method. This API follows the GIO async pattern, and the result can be | |
| 98 | + | // obtained by calling [method@MessageDialog.choose_finish], for example: | |
| 99 | + | // | |
| 100 | + | // ```c | |
| 101 | + | // static void | |
| 102 | + | // dialog_cb (AdwMessageDialog *dialog, | |
| 103 | + | // | |
| 104 | + | // GAsyncResult *result, | |
| 105 | + | // MyWindow *self) | |
| 106 | + | // | |
| 107 | + | // { | |
| 108 | + | // const char *response = adw_message_dialog_choose_finish (dialog, result); | |
| 109 | + | // | |
| 110 | + | // // ... | |
| 111 | + | // } | |
| 112 | + | // | |
| 113 | + | // static void | |
| 114 | + | // show_dialog (MyWindow *self) | |
| 115 | + | // | |
| 116 | + | // { | |
| 117 | + | // GtkWidget *dialog; | |
| 118 | + | // | |
| 119 | + | // dialog = adw_message_dialog_new (GTK_WINDOW (self), _("Replace File?"), NULL); | |
| 120 | + | // | |
| 121 | + | // adw_message_dialog_format_body (ADW_MESSAGE_DIALOG (dialog), | |
| 122 | + | // _("A file named “%s” already exists. Do you want to replace it?"), | |
| 123 | + | // filename); | |
| 124 | + | // | |
| 125 | + | // adw_message_dialog_add_responses (ADW_MESSAGE_DIALOG (dialog), | |
| 126 | + | // "cancel", _("_Cancel"), | |
| 127 | + | // "replace", _("_Replace"), | |
| 128 | + | // NULL); | |
| 129 | + | // | |
| 130 | + | // adw_message_dialog_set_response_appearance (ADW_MESSAGE_DIALOG (dialog), "replace", ADW_RESPONSE_DESTRUCTIVE); | |
| 131 | + | // | |
| 132 | + | // adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG (dialog), "cancel"); | |
| 133 | + | // adw_message_dialog_set_close_response (ADW_MESSAGE_DIALOG (dialog), "cancel"); | |
| 134 | + | // | |
| 135 | + | // adw_message_dialog_choose (ADW_MESSAGE_DIALOG (dialog), NULL, (GAsyncReadyCallback) dialog_cb, self); | |
| 136 | + | // } | |
| 137 | + | // | |
| 138 | + | // ``` | |
| 139 | + | // | |
| 140 | + | // ## AdwMessageDialog as GtkBuildable | |
| 141 | + | // | |
| 142 | + | // `AdwMessageDialog` supports adding responses in UI definitions by via the | |
| 143 | + | // `<responses>` element that may contain multiple `<response>` elements, each | |
| 144 | + | // respresenting a response. | |
| 145 | + | // | |
| 146 | + | // Each of the `<response>` elements must have the `id` attribute specifying the | |
| 147 | + | // response ID. The contents of the element are used as the response label. | |
| 148 | + | // | |
| 149 | + | // Response labels can be translated with the usual `translatable`, `context` | |
| 150 | + | // and `comments` attributes. | |
| 151 | + | // | |
| 152 | + | // The `<response>` elements can also have `enabled` and/or `appearance` | |
| 153 | + | // attributes. See [method@MessageDialog.set_response_enabled] and | |
| 154 | + | // [method@MessageDialog.set_response_appearance] for details. | |
| 155 | + | // | |
| 156 | + | // Example of an `AdwMessageDialog` UI definition: | |
| 157 | + | // | |
| 158 | + | // ```xml | |
| 159 | + | // <object class="AdwMessageDialog" id="dialog"> | |
| 160 | + | // | |
| 161 | + | // <property name="heading" translatable="yes">Save Changes?</property> | |
| 162 | + | // <property name="body" translatable="yes">Open documents contain unsaved changes. Changes which are not saved will be permanently lost.</property> | |
| 163 | + | // <property name="default-response">save</property> | |
| 164 | + | // <property name="close-response">cancel</property> | |
| 165 | + | // <signal name="response" handler="response_cb"/> | |
| 166 | + | // <responses> | |
| 167 | + | // <response id="cancel" translatable="yes">_Cancel</response> | |
| 168 | + | // <response id="discard" translatable="yes" appearance="destructive">_Discard</response> | |
| 169 | + | // <response id="save" translatable="yes" appearance="suggested" enabled="false">_Save</response> | |
| 170 | + | // </responses> | |
| 171 | + | // | |
| 172 | + | // </object> | |
| 173 | + | // ``` | |
| 174 | + | // | |
| 175 | + | // ## Accessibility | |
| 176 | + | // | |
| 177 | + | // `AdwMessageDialog` uses the `GTK_ACCESSIBLE_ROLE_DIALOG` role. | |
| 178 | + | type MessageDialog struct { | |
| 179 | + | gtk.Window | |
| 180 | + | } | |
| 181 | + | ||
| 182 | + | func MessageDialogNewFromInternalPtr(ptr uintptr) *MessageDialog { | |
| 183 | + | cls := &MessageDialog{} | |
| 184 | + | cls.Ptr = ptr | |
| 185 | + | return cls | |
| 186 | + | } | |
| 187 | + | ||
| 188 | + | var xNewMessageDialog func(uintptr, string, string) uintptr | |
| 189 | + | ||
| 190 | + | // Creates a new `AdwMessageDialog`. | |
| 191 | + | // | |
| 192 | + | // @heading and @body can be set to `NULL`. This can be useful if they need to | |
| 193 | + | // be formatted or use markup. In that case, set them to `NULL` and call | |
| 194 | + | // [method@MessageDialog.format_body] or similar methods afterwards: | |
| 195 | + | // | |
| 196 | + | // ```c | |
| 197 | + | // GtkWidget *dialog; | |
| 198 | + | // | |
| 199 | + | // dialog = adw_message_dialog_new (parent, _("Replace File?"), NULL); | |
| 200 | + | // adw_message_dialog_format_body (ADW_MESSAGE_DIALOG (dialog), | |
| 201 | + | // | |
| 202 | + | // _("A file named “%s” already exists. Do you want to replace it?"), | |
| 203 | + | // filename); | |
| 204 | + | // | |
| 205 | + | // ``` | |
| 206 | + | func NewMessageDialog(ParentVar *gtk.Window, HeadingVar string, BodyVar string) *gtk.Widget { | |
| 207 | + | NewMessageDialogPtr := xNewMessageDialog(ParentVar.GoPointer(), HeadingVar, BodyVar) | |
| 208 | + | if NewMessageDialogPtr == 0 { | |
| 209 | + | return nil | |
| 210 | + | } | |
| 211 | + | ||
| 212 | + | gobject.IncreaseRef(NewMessageDialogPtr) | |
| 213 | + | ||
| 214 | + | NewMessageDialogCls := >k.Widget{} | |
| 215 | + | NewMessageDialogCls.Ptr = NewMessageDialogPtr | |
| 216 | + | return NewMessageDialogCls | |
| 217 | + | } | |
| 218 | + | ||
| 219 | + | var xMessageDialogAddResponse func(uintptr, string, string) | |
| 220 | + | ||
| 221 | + | // Adds a response with @id and @label to @self. | |
| 222 | + | // | |
| 223 | + | // Responses are represented as buttons in the dialog. | |
| 224 | + | // | |
| 225 | + | // Response ID must be unique. It will be used in | |
| 226 | + | // [signal@MessageDialog::response] to tell which response had been activated, | |
| 227 | + | // as well as to inspect and modify the response later. | |
| 228 | + | // | |
| 229 | + | // An embedded underline in @label indicates a mnemonic. | |
| 230 | + | // | |
| 231 | + | // [method@MessageDialog.set_response_label] can be used to change the response | |
| 232 | + | // label after it had been added. | |
| 233 | + | // | |
| 234 | + | // [method@MessageDialog.set_response_enabled] and | |
| 235 | + | // [method@MessageDialog.set_response_appearance] can be used to customize the | |
| 236 | + | // responses further. | |
| 237 | + | func (x *MessageDialog) AddResponse(IdVar string, LabelVar string) { | |
| 238 | + | ||
| 239 | + | xMessageDialogAddResponse(x.GoPointer(), IdVar, LabelVar) | |
| 240 | + | ||
| 241 | + | } | |
| 242 | + | ||
| 243 | + | var xMessageDialogAddResponses func(uintptr, string, ...interface{}) | |
| 244 | + | ||
| 245 | + | // Adds multiple responses to @self. | |
| 246 | + | // | |
| 247 | + | // This is the same as calling [method@MessageDialog.add_response] repeatedly. | |
| 248 | + | // The variable argument list should be `NULL`-terminated list of response IDs | |
| 249 | + | // and labels. | |
| 250 | + | // | |
| 251 | + | // Example: | |
| 252 | + | // | |
| 253 | + | // ```c | |
| 254 | + | // adw_message_dialog_add_responses (dialog, | |
| 255 | + | // | |
| 256 | + | // "cancel", _("_Cancel"), | |
| 257 | + | // "discard", _("_Discard"), | |
| 258 | + | // "save", _("_Save"), | |
| 259 | + | // NULL); | |
| 260 | + | // | |
| 261 | + | // ``` | |
| 262 | + | func (x *MessageDialog) AddResponses(FirstIdVar string, varArgs ...interface{}) { | |
| 263 | + | ||
| 264 | + | xMessageDialogAddResponses(x.GoPointer(), FirstIdVar, varArgs...) | |
| 265 | + | ||
| 266 | + | } | |
| 267 | + | ||
| 268 | + | var xMessageDialogChoose func(uintptr, uintptr, uintptr, uintptr) | |
| 269 | + | ||
| 270 | + | // This function shows @self to the user. | |
| 271 | + | // | |
| 272 | + | // The @callback will be called when the alert is dismissed. It should call | |
| 273 | + | // [method@MessageDialog.choose_finish] to obtain the result. | |
| 274 | + | func (x *MessageDialog) Choose(CancellableVar *gio.Cancellable, CallbackVar gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 275 | + | ||
| 276 | + | xMessageDialogChoose(x.GoPointer(), CancellableVar.GoPointer(), purego.NewCallback(CallbackVar), UserDataVar) | |
| 277 | + | ||
| 278 | + | } | |
| 279 | + | ||
| 280 | + | var xMessageDialogChooseFinish func(uintptr, uintptr) string | |
| 281 | + | ||
| 282 | + | // Finishes the [method@MessageDialog.choose] call and returns the response ID. | |
| 283 | + | func (x *MessageDialog) ChooseFinish(ResultVar gio.AsyncResult) string { | |
| 284 | + | ||
| 285 | + | return xMessageDialogChooseFinish(x.GoPointer(), ResultVar.GoPointer()) | |
| 286 | + | ||
| 287 | + | } | |
| 288 | + | ||
| 289 | + | var xMessageDialogFormatBody func(uintptr, string, ...interface{}) | |
| 290 | + | ||
| 291 | + | // Sets the formatted body text of @self. | |
| 292 | + | // | |
| 293 | + | // See [property@MessageDialog:body]. | |
| 294 | + | func (x *MessageDialog) FormatBody(FormatVar string, varArgs ...interface{}) { | |
| 295 | + | ||
| 296 | + | xMessageDialogFormatBody(x.GoPointer(), FormatVar, varArgs...) | |
| 297 | + | ||
| 298 | + | } | |
| 299 | + | ||
| 300 | + | var xMessageDialogFormatBodyMarkup func(uintptr, string, ...interface{}) | |
| 301 | + | ||
| 302 | + | // Sets the formatted body text of @self with Pango markup. | |
| 303 | + | // | |
| 304 | + | // The @format is assumed to contain Pango markup. | |
| 305 | + | // | |
| 306 | + | // Special XML characters in the `printf()` arguments passed to this function | |
| 307 | + | // will automatically be escaped as necessary, see | |
| 308 | + | // [func@GLib.markup_printf_escaped]. | |
| 309 | + | // | |
| 310 | + | // See [property@MessageDialog:body]. | |
| 311 | + | func (x *MessageDialog) FormatBodyMarkup(FormatVar string, varArgs ...interface{}) { | |
| 312 | + | ||
| 313 | + | xMessageDialogFormatBodyMarkup(x.GoPointer(), FormatVar, varArgs...) | |
| 314 | + | ||
| 315 | + | } | |
| 316 | + | ||
| 317 | + | var xMessageDialogFormatHeading func(uintptr, string, ...interface{}) | |
| 318 | + | ||
| 319 | + | // Sets the formatted heading of @self. | |
| 320 | + | // | |
| 321 | + | // See [property@MessageDialog:heading]. | |
| 322 | + | func (x *MessageDialog) FormatHeading(FormatVar string, varArgs ...interface{}) { | |
| 323 | + | ||
| 324 | + | xMessageDialogFormatHeading(x.GoPointer(), FormatVar, varArgs...) | |
| 325 | + | ||
| 326 | + | } | |
| 327 | + | ||
| 328 | + | var xMessageDialogFormatHeadingMarkup func(uintptr, string, ...interface{}) | |
| 329 | + | ||
| 330 | + | // Sets the formatted heading of @self with Pango markup. | |
| 331 | + | // | |
| 332 | + | // The @format is assumed to contain Pango markup. | |
| 333 | + | // | |
| 334 | + | // Special XML characters in the `printf()` arguments passed to this function | |
| 335 | + | // will automatically be escaped as necessary, see | |
| 336 | + | // [func@GLib.markup_printf_escaped]. | |
| 337 | + | // | |
| 338 | + | // See [property@MessageDialog:heading]. | |
| 339 | + | func (x *MessageDialog) FormatHeadingMarkup(FormatVar string, varArgs ...interface{}) { | |
| 340 | + | ||
| 341 | + | xMessageDialogFormatHeadingMarkup(x.GoPointer(), FormatVar, varArgs...) | |
| 342 | + | ||
| 343 | + | } | |
| 344 | + | ||
| 345 | + | var xMessageDialogGetBody func(uintptr) string | |
| 346 | + | ||
| 347 | + | // Gets the body text of @self. | |
| 348 | + | func (x *MessageDialog) GetBody() string { | |
| 349 | + | ||
| 350 | + | return xMessageDialogGetBody(x.GoPointer()) | |
| 351 | + | ||
| 352 | + | } | |
| 353 | + | ||
| 354 | + | var xMessageDialogGetBodyUseMarkup func(uintptr) bool | |
| 355 | + | ||
| 356 | + | // Gets whether the body text of @self includes Pango markup. | |
| 357 | + | func (x *MessageDialog) GetBodyUseMarkup() bool { | |
| 358 | + | ||
| 359 | + | return xMessageDialogGetBodyUseMarkup(x.GoPointer()) | |
| 360 | + | ||
| 361 | + | } | |
| 362 | + | ||
| 363 | + | var xMessageDialogGetCloseResponse func(uintptr) string | |
| 364 | + | ||
| 365 | + | // Gets the ID of the close response of @self. | |
| 366 | + | func (x *MessageDialog) GetCloseResponse() string { | |
| 367 | + | ||
| 368 | + | return xMessageDialogGetCloseResponse(x.GoPointer()) | |
| 369 | + | ||
| 370 | + | } | |
| 371 | + | ||
| 372 | + | var xMessageDialogGetDefaultResponse func(uintptr) string | |
| 373 | + | ||
| 374 | + | // Gets the ID of the default response of @self. | |
| 375 | + | func (x *MessageDialog) GetDefaultResponse() string { | |
| 376 | + | ||
| 377 | + | return xMessageDialogGetDefaultResponse(x.GoPointer()) | |
| 378 | + | ||
| 379 | + | } | |
| 380 | + | ||
| 381 | + | var xMessageDialogGetExtraChild func(uintptr) uintptr | |
| 382 | + | ||
| 383 | + | // Gets the child widget of @self. | |
| 384 | + | func (x *MessageDialog) GetExtraChild() *gtk.Widget { | |
| 385 | + | ||
| 386 | + | GetExtraChildPtr := xMessageDialogGetExtraChild(x.GoPointer()) | |
| 387 | + | if GetExtraChildPtr == 0 { | |
| 388 | + | return nil | |
| 389 | + | } | |
| 390 | + | ||
| 391 | + | gobject.IncreaseRef(GetExtraChildPtr) | |
| 392 | + | ||
| 393 | + | GetExtraChildCls := >k.Widget{} | |
| 394 | + | GetExtraChildCls.Ptr = GetExtraChildPtr | |
| 395 | + | return GetExtraChildCls | |
| 396 | + | ||
| 397 | + | } | |
| 398 | + | ||
| 399 | + | var xMessageDialogGetHeading func(uintptr) string | |
| 400 | + | ||
| 401 | + | // Gets the heading of @self. | |
| 402 | + | func (x *MessageDialog) GetHeading() string { | |
| 403 | + | ||
| 404 | + | return xMessageDialogGetHeading(x.GoPointer()) | |
| 405 | + | ||
| 406 | + | } | |
| 407 | + | ||
| 408 | + | var xMessageDialogGetHeadingUseMarkup func(uintptr) bool | |
| 409 | + | ||
| 410 | + | // Gets whether the heading of @self includes Pango markup. | |
| 411 | + | func (x *MessageDialog) GetHeadingUseMarkup() bool { | |
| 412 | + | ||
| 413 | + | return xMessageDialogGetHeadingUseMarkup(x.GoPointer()) | |
| 414 | + | ||
| 415 | + | } | |
| 416 | + | ||
| 417 | + | var xMessageDialogGetResponseAppearance func(uintptr, string) ResponseAppearance | |
| 418 | + | ||
| 419 | + | // Gets the appearance of @response. | |
| 420 | + | // | |
| 421 | + | // See [method@MessageDialog.set_response_appearance]. | |
| 422 | + | func (x *MessageDialog) GetResponseAppearance(ResponseVar string) ResponseAppearance { | |
| 423 | + | ||
| 424 | + | return xMessageDialogGetResponseAppearance(x.GoPointer(), ResponseVar) | |
| 425 | + | ||
| 426 | + | } | |
| 427 | + | ||
| 428 | + | var xMessageDialogGetResponseEnabled func(uintptr, string) bool | |
| 429 | + | ||
| 430 | + | // Gets whether @response is enabled. | |
| 431 | + | // | |
| 432 | + | // See [method@MessageDialog.set_response_enabled]. | |
| 433 | + | func (x *MessageDialog) GetResponseEnabled(ResponseVar string) bool { | |
| 434 | + | ||
| 435 | + | return xMessageDialogGetResponseEnabled(x.GoPointer(), ResponseVar) | |
| 436 | + | ||
| 437 | + | } | |
| 438 | + | ||
| 439 | + | var xMessageDialogGetResponseLabel func(uintptr, string) string | |
| 440 | + | ||
| 441 | + | // Gets the label of @response. | |
| 442 | + | // | |
| 443 | + | // See [method@MessageDialog.set_response_label]. | |
| 444 | + | func (x *MessageDialog) GetResponseLabel(ResponseVar string) string { | |
| 445 | + | ||
| 446 | + | return xMessageDialogGetResponseLabel(x.GoPointer(), ResponseVar) | |
| 447 | + | ||
| 448 | + | } | |
| 449 | + | ||
| 450 | + | var xMessageDialogHasResponse func(uintptr, string) bool | |
| 451 | + | ||
| 452 | + | // Gets whether @self has a response with the ID @response. | |
| 453 | + | func (x *MessageDialog) HasResponse(ResponseVar string) bool { | |
| 454 | + | ||
| 455 | + | return xMessageDialogHasResponse(x.GoPointer(), ResponseVar) | |
| 456 | + | ||
| 457 | + | } | |
| 458 | + | ||
| 459 | + | var xMessageDialogResponse func(uintptr, string) | |
| 460 | + | ||
| 461 | + | // Emits the [signal@MessageDialog::response] signal with the given response ID. | |
| 462 | + | // | |
| 463 | + | // Used to indicate that the user has responded to the dialog in some way. | |
| 464 | + | func (x *MessageDialog) Response(ResponseVar string) { | |
| 465 | + | ||
| 466 | + | xMessageDialogResponse(x.GoPointer(), ResponseVar) | |
| 467 | + | ||
| 468 | + | } | |
| 469 | + | ||
| 470 | + | var xMessageDialogSetBody func(uintptr, string) | |
| 471 | + | ||
| 472 | + | // Sets the body text of @self. | |
| 473 | + | func (x *MessageDialog) SetBody(BodyVar string) { | |
| 474 | + | ||
| 475 | + | xMessageDialogSetBody(x.GoPointer(), BodyVar) | |
| 476 | + | ||
| 477 | + | } | |
| 478 | + | ||
| 479 | + | var xMessageDialogSetBodyUseMarkup func(uintptr, bool) | |
| 480 | + | ||
| 481 | + | // Sets whether the body text of @self includes Pango markup. | |
| 482 | + | // | |
| 483 | + | // See [func@Pango.parse_markup]. | |
| 484 | + | func (x *MessageDialog) SetBodyUseMarkup(UseMarkupVar bool) { | |
| 485 | + | ||
| 486 | + | xMessageDialogSetBodyUseMarkup(x.GoPointer(), UseMarkupVar) | |
| 487 | + | ||
| 488 | + | } | |
| 489 | + | ||
| 490 | + | var xMessageDialogSetCloseResponse func(uintptr, string) | |
| 491 | + | ||
| 492 | + | // Sets the ID of the close response of @self. | |
| 493 | + | // | |
| 494 | + | // It will be passed to [signal@MessageDialog::response] if the window is | |
| 495 | + | // closed by pressing <kbd>Escape</kbd> or with a system action. | |
| 496 | + | // | |
| 497 | + | // It doesn't have to correspond to any of the responses in the dialog. | |
| 498 | + | // | |
| 499 | + | // The default close response is `close`. | |
| 500 | + | func (x *MessageDialog) SetCloseResponse(ResponseVar string) { | |
| 501 | + | ||
| 502 | + | xMessageDialogSetCloseResponse(x.GoPointer(), ResponseVar) | |
| 503 | + | ||
| 504 | + | } | |
| 505 | + | ||
| 506 | + | var xMessageDialogSetDefaultResponse func(uintptr, string) | |
| 507 | + | ||
| 508 | + | // Sets the ID of the default response of @self. | |
| 509 | + | // | |
| 510 | + | // If set, pressing <kbd>Enter</kbd> will activate the corresponding button. | |
| 511 | + | // | |
| 512 | + | // If set to `NULL` or to a non-existent response ID, pressing <kbd>Enter</kbd> | |
| 513 | + | // will do nothing. | |
| 514 | + | func (x *MessageDialog) SetDefaultResponse(ResponseVar string) { | |
| 515 | + | ||
| 516 | + | xMessageDialogSetDefaultResponse(x.GoPointer(), ResponseVar) | |
| 517 | + | ||
| 518 | + | } | |
| 519 | + | ||
| 520 | + | var xMessageDialogSetExtraChild func(uintptr, uintptr) | |
| 521 | + | ||
| 522 | + | // Sets the child widget of @self. | |
| 523 | + | // | |
| 524 | + | // The child widget is displayed below the heading and body. | |
| 525 | + | func (x *MessageDialog) SetExtraChild(ChildVar *gtk.Widget) { | |
| 526 | + | ||
| 527 | + | xMessageDialogSetExtraChild(x.GoPointer(), ChildVar.GoPointer()) | |
| 528 | + | ||
| 529 | + | } | |
| 530 | + | ||
| 531 | + | var xMessageDialogSetHeading func(uintptr, string) | |
| 532 | + | ||
| 533 | + | // Sets the heading of @self. | |
| 534 | + | func (x *MessageDialog) SetHeading(HeadingVar string) { | |
| 535 | + | ||
| 536 | + | xMessageDialogSetHeading(x.GoPointer(), HeadingVar) | |
| 537 | + | ||
| 538 | + | } | |
| 539 | + | ||
| 540 | + | var xMessageDialogSetHeadingUseMarkup func(uintptr, bool) | |
| 541 | + | ||
| 542 | + | // Sets whether the heading of @self includes Pango markup. | |
| 543 | + | // | |
| 544 | + | // See [func@Pango.parse_markup]. | |
| 545 | + | func (x *MessageDialog) SetHeadingUseMarkup(UseMarkupVar bool) { | |
| 546 | + | ||
| 547 | + | xMessageDialogSetHeadingUseMarkup(x.GoPointer(), UseMarkupVar) | |
| 548 | + | ||
| 549 | + | } | |
| 550 | + | ||
| 551 | + | var xMessageDialogSetResponseAppearance func(uintptr, string, ResponseAppearance) | |
| 552 | + | ||
| 553 | + | // Sets the appearance for @response. | |
| 554 | + | // | |
| 555 | + | // <picture> | |
| 556 | + | // | |
| 557 | + | // <source srcset="message-dialog-appearance-dark.png" media="(prefers-color-scheme: dark)"> | |
| 558 | + | // <img src="message-dialog-appearance.png" alt="message-dialog-appearance"> | |
| 559 | + | // | |
| 560 | + | // </picture> | |
| 561 | + | // | |
| 562 | + | // Use `ADW_RESPONSE_SUGGESTED` to mark important responses such as the | |
| 563 | + | // affirmative action, like the Save button in the example. | |
| 564 | + | // | |
| 565 | + | // Use `ADW_RESPONSE_DESTRUCTIVE` to draw attention to the potentially damaging | |
| 566 | + | // consequences of using @response. This appearance acts as a warning to the | |
| 567 | + | // user. The Discard button in the example is using this appearance. | |
| 568 | + | // | |
| 569 | + | // The default appearance is `ADW_RESPONSE_DEFAULT`. | |
| 570 | + | // | |
| 571 | + | // Negative responses like Cancel or Close should use the default appearance. | |
| 572 | + | func (x *MessageDialog) SetResponseAppearance(ResponseVar string, AppearanceVar ResponseAppearance) { | |
| 573 | + | ||
| 574 | + | xMessageDialogSetResponseAppearance(x.GoPointer(), ResponseVar, AppearanceVar) | |
| 575 | + | ||
| 576 | + | } | |
| 577 | + | ||
| 578 | + | var xMessageDialogSetResponseEnabled func(uintptr, string, bool) | |
| 579 | + | ||
| 580 | + | // Sets whether @response is enabled. | |
| 581 | + | // | |
| 582 | + | // If @response is not enabled, the corresponding button will have | |
| 583 | + | // [property@Gtk.Widget:sensitive] set to `FALSE` and it can't be activated as | |
| 584 | + | // a default response. | |
| 585 | + | // | |
| 586 | + | // @response can still be used as [property@MessageDialog:close-response] while | |
| 587 | + | // it's not enabled. | |
| 588 | + | // | |
| 589 | + | // Responses are enabled by default. | |
| 590 | + | func (x *MessageDialog) SetResponseEnabled(ResponseVar string, EnabledVar bool) { | |
| 591 | + | ||
| 592 | + | xMessageDialogSetResponseEnabled(x.GoPointer(), ResponseVar, EnabledVar) | |
| 593 | + | ||
| 594 | + | } | |
| 595 | + | ||
| 596 | + | var xMessageDialogSetResponseLabel func(uintptr, string, string) | |
| 597 | + | ||
| 598 | + | // Sets the label of @response to @label. | |
| 599 | + | // | |
| 600 | + | // Labels are displayed on the dialog buttons. An embedded underline in @label | |
| 601 | + | // indicates a mnemonic. | |
| 602 | + | func (x *MessageDialog) SetResponseLabel(ResponseVar string, LabelVar string) { | |
| 603 | + | ||
| 604 | + | xMessageDialogSetResponseLabel(x.GoPointer(), ResponseVar, LabelVar) | |
| 605 | + | ||
| 606 | + | } | |
| 607 | + | ||
| 608 | + | func (c *MessageDialog) GoPointer() uintptr { | |
| 609 | + | return c.Ptr | |
| 610 | + | } | |
| 611 | + | ||
| 612 | + | func (c *MessageDialog) SetGoPointer(ptr uintptr) { | |
| 613 | + | c.Ptr = ptr | |
| 614 | + | } | |
| 615 | + | ||
| 616 | + | // This signal is emitted when the dialog is closed. | |
| 617 | + | // | |
| 618 | + | // @response will be set to the response ID of the button that had been | |
| 619 | + | // activated. | |
| 620 | + | // | |
| 621 | + | // if the dialog was closed by pressing <kbd>Escape</kbd> or with a system | |
| 622 | + | // action, @response will be set to the value of | |
| 623 | + | // [property@MessageDialog:close-response]. | |
| 624 | + | func (x *MessageDialog) ConnectResponse(cb func(MessageDialog, string)) { | |
| 625 | + | fcb := func(clsPtr uintptr, ResponseVarp string) { | |
| 626 | + | fa := MessageDialog{} | |
| 627 | + | fa.Ptr = clsPtr | |
| 628 | + | ||
| 629 | + | cb(fa, ResponseVarp) | |
| 630 | + | ||
| 631 | + | } | |
| 632 | + | gobject.ObjectConnect(x.GoPointer(), "signal::response", purego.NewCallback(fcb)) | |
| 633 | + | } | |
| 634 | + | ||
| 635 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 636 | + | func (x *MessageDialog) GetAccessibleRole() gtk.AccessibleRole { | |
| 637 | + | ||
| 638 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 639 | + | ||
| 640 | + | } | |
| 641 | + | ||
| 642 | + | // Resets the accessible @property to its default value. | |
| 643 | + | func (x *MessageDialog) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 644 | + | ||
| 645 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 646 | + | ||
| 647 | + | } | |
| 648 | + | ||
| 649 | + | // Resets the accessible @relation to its default value. | |
| 650 | + | func (x *MessageDialog) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 651 | + | ||
| 652 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 653 | + | ||
| 654 | + | } | |
| 655 | + | ||
| 656 | + | // Resets the accessible @state to its default value. | |
| 657 | + | func (x *MessageDialog) ResetState(StateVar gtk.AccessibleState) { | |
| 658 | + | ||
| 659 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 660 | + | ||
| 661 | + | } | |
| 662 | + | ||
| 663 | + | // Updates a list of accessible properties. | |
| 664 | + | // | |
| 665 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 666 | + | // value types of accessible properties. | |
| 667 | + | // | |
| 668 | + | // This function should be called by `GtkWidget` types whenever | |
| 669 | + | // an accessible property change must be communicated to assistive | |
| 670 | + | // technologies. | |
| 671 | + | // | |
| 672 | + | // Example: | |
| 673 | + | // ```c | |
| 674 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 675 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 676 | + | // | |
| 677 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 678 | + | // -1); | |
| 679 | + | // | |
| 680 | + | // ``` | |
| 681 | + | func (x *MessageDialog) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 682 | + | ||
| 683 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 684 | + | ||
| 685 | + | } | |
| 686 | + | ||
| 687 | + | // Updates an array of accessible properties. | |
| 688 | + | // | |
| 689 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 690 | + | // property change must be communicated to assistive technologies. | |
| 691 | + | // | |
| 692 | + | // This function is meant to be used by language bindings. | |
| 693 | + | func (x *MessageDialog) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 694 | + | ||
| 695 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 696 | + | ||
| 697 | + | } | |
| 698 | + | ||
| 699 | + | // Updates a list of accessible relations. | |
| 700 | + | // | |
| 701 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 702 | + | // relation change must be communicated to assistive technologies. | |
| 703 | + | // | |
| 704 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 705 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 706 | + | // | |
| 707 | + | // ```c | |
| 708 | + | // gtk_accessible_update_relation (accessible, | |
| 709 | + | // | |
| 710 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 711 | + | // ref1, NULL, | |
| 712 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 713 | + | // ref1, ref2, ref3, NULL, | |
| 714 | + | // -1); | |
| 715 | + | // | |
| 716 | + | // ``` | |
| 717 | + | func (x *MessageDialog) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 718 | + | ||
| 719 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 720 | + | ||
| 721 | + | } | |
| 722 | + | ||
| 723 | + | // Updates an array of accessible relations. | |
| 724 | + | // | |
| 725 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 726 | + | // relation change must be communicated to assistive technologies. | |
| 727 | + | // | |
| 728 | + | // This function is meant to be used by language bindings. | |
| 729 | + | func (x *MessageDialog) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 730 | + | ||
| 731 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 732 | + | ||
| 733 | + | } | |
| 734 | + | ||
| 735 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 736 | + | // documentation for the value types of accessible states. | |
| 737 | + | // | |
| 738 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 739 | + | // state change must be communicated to assistive technologies. | |
| 740 | + | // | |
| 741 | + | // Example: | |
| 742 | + | // ```c | |
| 743 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 744 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 745 | + | // | |
| 746 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 747 | + | // -1); | |
| 748 | + | // | |
| 749 | + | // ``` | |
| 750 | + | func (x *MessageDialog) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 751 | + | ||
| 752 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 753 | + | ||
| 754 | + | } | |
| 755 | + | ||
| 756 | + | // Updates an array of accessible states. | |
| 757 | + | // | |
| 758 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 759 | + | // state change must be communicated to assistive technologies. | |
| 760 | + | // | |
| 761 | + | // This function is meant to be used by language bindings. | |
| 762 | + | func (x *MessageDialog) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 763 | + | ||
| 764 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 765 | + | ||
| 766 | + | } | |
| 767 | + | ||
| 768 | + | // Gets the ID of the @buildable object. | |
| 769 | + | // | |
| 770 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 771 | + | // of the <object> tag used to construct the @buildable. | |
| 772 | + | func (x *MessageDialog) GetBuildableId() string { | |
| 773 | + | ||
| 774 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 775 | + | ||
| 776 | + | } | |
| 777 | + | ||
| 778 | + | // Returns the renderer that is used for this `GtkNative`. | |
| 779 | + | func (x *MessageDialog) GetRenderer() *gsk.Renderer { | |
| 780 | + | ||
| 781 | + | GetRendererPtr := gtk.XGtkNativeGetRenderer(x.GoPointer()) | |
| 782 | + | if GetRendererPtr == 0 { | |
| 783 | + | return nil | |
| 784 | + | } | |
| 785 | + | ||
| 786 | + | gobject.IncreaseRef(GetRendererPtr) | |
| 787 | + | ||
| 788 | + | GetRendererCls := &gsk.Renderer{} | |
| 789 | + | GetRendererCls.Ptr = GetRendererPtr | |
| 790 | + | return GetRendererCls | |
| 791 | + | ||
| 792 | + | } | |
| 793 | + | ||
| 794 | + | // Returns the surface of this `GtkNative`. | |
| 795 | + | func (x *MessageDialog) GetSurface() *gdk.Surface { | |
| 796 | + | ||
| 797 | + | GetSurfacePtr := gtk.XGtkNativeGetSurface(x.GoPointer()) | |
| 798 | + | if GetSurfacePtr == 0 { | |
| 799 | + | return nil | |
| 800 | + | } | |
| 801 | + | ||
| 802 | + | gobject.IncreaseRef(GetSurfacePtr) | |
| 803 | + | ||
| 804 | + | GetSurfaceCls := &gdk.Surface{} | |
| 805 | + | GetSurfaceCls.Ptr = GetSurfacePtr | |
| 806 | + | return GetSurfaceCls | |
| 807 | + | ||
| 808 | + | } | |
| 809 | + | ||
| 810 | + | // Retrieves the surface transform of @self. | |
| 811 | + | // | |
| 812 | + | // This is the translation from @self's surface coordinates into | |
| 813 | + | // @self's widget coordinates. | |
| 814 | + | func (x *MessageDialog) GetSurfaceTransform(XVar float64, YVar float64) { | |
| 815 | + | ||
| 816 | + | gtk.XGtkNativeGetSurfaceTransform(x.GoPointer(), XVar, YVar) | |
| 817 | + | ||
| 818 | + | } | |
| 819 | + | ||
| 820 | + | // Realizes a `GtkNative`. | |
| 821 | + | // | |
| 822 | + | // This should only be used by subclasses. | |
| 823 | + | func (x *MessageDialog) Realize() { | |
| 824 | + | ||
| 825 | + | gtk.XGtkNativeRealize(x.GoPointer()) | |
| 826 | + | ||
| 827 | + | } | |
| 828 | + | ||
| 829 | + | // Unrealizes a `GtkNative`. | |
| 830 | + | // | |
| 831 | + | // This should only be used by subclasses. | |
| 832 | + | func (x *MessageDialog) Unrealize() { | |
| 833 | + | ||
| 834 | + | gtk.XGtkNativeUnrealize(x.GoPointer()) | |
| 835 | + | ||
| 836 | + | } | |
| 837 | + | ||
| 838 | + | // Returns the display that this `GtkRoot` is on. | |
| 839 | + | func (x *MessageDialog) GetDisplay() *gdk.Display { | |
| 840 | + | ||
| 841 | + | GetDisplayPtr := gtk.XGtkRootGetDisplay(x.GoPointer()) | |
| 842 | + | if GetDisplayPtr == 0 { | |
| 843 | + | return nil | |
| 844 | + | } | |
| 845 | + | ||
| 846 | + | gobject.IncreaseRef(GetDisplayPtr) | |
| 847 | + | ||
| 848 | + | GetDisplayCls := &gdk.Display{} | |
| 849 | + | GetDisplayCls.Ptr = GetDisplayPtr | |
| 850 | + | return GetDisplayCls | |
| 851 | + | ||
| 852 | + | } | |
| 853 | + | ||
| 854 | + | // Retrieves the current focused widget within the root. | |
| 855 | + | // | |
| 856 | + | // Note that this is the widget that would have the focus | |
| 857 | + | // if the root is active; if the root is not focused then | |
| 858 | + | // `gtk_widget_has_focus (widget)` will be %FALSE for the | |
| 859 | + | // widget. | |
| 860 | + | func (x *MessageDialog) GetFocus() *gtk.Widget { | |
| 861 | + | ||
| 862 | + | GetFocusPtr := gtk.XGtkRootGetFocus(x.GoPointer()) | |
| 863 | + | if GetFocusPtr == 0 { | |
| 864 | + | return nil | |
| 865 | + | } | |
| 866 | + | ||
| 867 | + | gobject.IncreaseRef(GetFocusPtr) | |
| 868 | + | ||
| 869 | + | GetFocusCls := >k.Widget{} | |
| 870 | + | GetFocusCls.Ptr = GetFocusPtr | |
| 871 | + | return GetFocusCls | |
| 872 | + | ||
| 873 | + | } | |
| 874 | + | ||
| 875 | + | // If @focus is not the current focus widget, and is focusable, sets | |
| 876 | + | // it as the focus widget for the root. | |
| 877 | + | // | |
| 878 | + | // If @focus is %NULL, unsets the focus widget for the root. | |
| 879 | + | // | |
| 880 | + | // To set the focus to a particular widget in the root, it is usually | |
| 881 | + | // more convenient to use [method@Gtk.Widget.grab_focus] instead of | |
| 882 | + | // this function. | |
| 883 | + | func (x *MessageDialog) SetFocus(FocusVar *gtk.Widget) { | |
| 884 | + | ||
| 885 | + | gtk.XGtkRootSetFocus(x.GoPointer(), FocusVar.GoPointer()) | |
| 886 | + | ||
| 887 | + | } | |
| 888 | + | ||
| 889 | + | func init() { | |
| 890 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 891 | + | if err != nil { | |
| 892 | + | panic(err) | |
| 893 | + | } | |
| 894 | + | ||
| 895 | + | core.PuregoSafeRegister(&xNewMessageDialog, lib, "adw_message_dialog_new") | |
| 896 | + | ||
| 897 | + | core.PuregoSafeRegister(&xMessageDialogAddResponse, lib, "adw_message_dialog_add_response") | |
| 898 | + | core.PuregoSafeRegister(&xMessageDialogAddResponses, lib, "adw_message_dialog_add_responses") | |
| 899 | + | core.PuregoSafeRegister(&xMessageDialogChoose, lib, "adw_message_dialog_choose") | |
| 900 | + | core.PuregoSafeRegister(&xMessageDialogChooseFinish, lib, "adw_message_dialog_choose_finish") | |
| 901 | + | core.PuregoSafeRegister(&xMessageDialogFormatBody, lib, "adw_message_dialog_format_body") | |
| 902 | + | core.PuregoSafeRegister(&xMessageDialogFormatBodyMarkup, lib, "adw_message_dialog_format_body_markup") | |
| 903 | + | core.PuregoSafeRegister(&xMessageDialogFormatHeading, lib, "adw_message_dialog_format_heading") | |
| 904 | + | core.PuregoSafeRegister(&xMessageDialogFormatHeadingMarkup, lib, "adw_message_dialog_format_heading_markup") | |
| 905 | + | core.PuregoSafeRegister(&xMessageDialogGetBody, lib, "adw_message_dialog_get_body") | |
| 906 | + | core.PuregoSafeRegister(&xMessageDialogGetBodyUseMarkup, lib, "adw_message_dialog_get_body_use_markup") | |
| 907 | + | core.PuregoSafeRegister(&xMessageDialogGetCloseResponse, lib, "adw_message_dialog_get_close_response") | |
| 908 | + | core.PuregoSafeRegister(&xMessageDialogGetDefaultResponse, lib, "adw_message_dialog_get_default_response") | |
| 909 | + | core.PuregoSafeRegister(&xMessageDialogGetExtraChild, lib, "adw_message_dialog_get_extra_child") | |
| 910 | + | core.PuregoSafeRegister(&xMessageDialogGetHeading, lib, "adw_message_dialog_get_heading") | |
| 911 | + | core.PuregoSafeRegister(&xMessageDialogGetHeadingUseMarkup, lib, "adw_message_dialog_get_heading_use_markup") | |
| 912 | + | core.PuregoSafeRegister(&xMessageDialogGetResponseAppearance, lib, "adw_message_dialog_get_response_appearance") | |
| 913 | + | core.PuregoSafeRegister(&xMessageDialogGetResponseEnabled, lib, "adw_message_dialog_get_response_enabled") | |
| 914 | + | core.PuregoSafeRegister(&xMessageDialogGetResponseLabel, lib, "adw_message_dialog_get_response_label") | |
| 915 | + | core.PuregoSafeRegister(&xMessageDialogHasResponse, lib, "adw_message_dialog_has_response") | |
| 916 | + | core.PuregoSafeRegister(&xMessageDialogResponse, lib, "adw_message_dialog_response") | |
| 917 | + | core.PuregoSafeRegister(&xMessageDialogSetBody, lib, "adw_message_dialog_set_body") | |
| 918 | + | core.PuregoSafeRegister(&xMessageDialogSetBodyUseMarkup, lib, "adw_message_dialog_set_body_use_markup") | |
| 919 | + | core.PuregoSafeRegister(&xMessageDialogSetCloseResponse, lib, "adw_message_dialog_set_close_response") | |
| 920 | + | core.PuregoSafeRegister(&xMessageDialogSetDefaultResponse, lib, "adw_message_dialog_set_default_response") | |
| 921 | + | core.PuregoSafeRegister(&xMessageDialogSetExtraChild, lib, "adw_message_dialog_set_extra_child") | |
| 922 | + | core.PuregoSafeRegister(&xMessageDialogSetHeading, lib, "adw_message_dialog_set_heading") | |
| 923 | + | core.PuregoSafeRegister(&xMessageDialogSetHeadingUseMarkup, lib, "adw_message_dialog_set_heading_use_markup") | |
| 924 | + | core.PuregoSafeRegister(&xMessageDialogSetResponseAppearance, lib, "adw_message_dialog_set_response_appearance") | |
| 925 | + | core.PuregoSafeRegister(&xMessageDialogSetResponseEnabled, lib, "adw_message_dialog_set_response_enabled") | |
| 926 | + | core.PuregoSafeRegister(&xMessageDialogSetResponseLabel, lib, "adw_message_dialog_set_response_label") | |
| 927 | + | ||
| 928 | + | } | |
A v4/adw/adw-navigation-direction.go +13 -0
| @@ -0,0 +1,13 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | // Describes the direction of a swipe navigation gesture. | |
| 5 | + | type NavigationDirection int | |
| 6 | + | ||
| 7 | + | const ( | |
| 8 | + | ||
| 9 | + | // Corresponds to start or top, depending on orientation and text direction | |
| 10 | + | NavigationDirectionBackValue NavigationDirection = 0 | |
| 11 | + | // Corresponds to end or bottom, depending on orientation and text direction | |
| 12 | + | NavigationDirectionForwardValue NavigationDirection = 1 | |
| 13 | + | ) | |
A v4/adw/adw-password-entry-row.go +548 -0
| @@ -0,0 +1,548 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 10 | + | ) | |
| 11 | + | ||
| 12 | + | type PasswordEntryRowClass struct { | |
| 13 | + | ParentClass uintptr | |
| 14 | + | } | |
| 15 | + | ||
| 16 | + | // A [class@EntryRow] tailored for entering secrets. | |
| 17 | + | // | |
| 18 | + | // <picture> | |
| 19 | + | // | |
| 20 | + | // <source srcset="password-entry-row-dark.png" media="(prefers-color-scheme: dark)"> | |
| 21 | + | // <img src="password-entry-row.png" alt="password-entry-row"> | |
| 22 | + | // | |
| 23 | + | // </picture> | |
| 24 | + | // | |
| 25 | + | // It does not show its contents in clear text, does not allow to copy it to the | |
| 26 | + | // clipboard, and shows a warning when Caps Lock is engaged. If the underlying | |
| 27 | + | // platform allows it, `AdwPasswordEntryRow` will also place the text in a | |
| 28 | + | // non-pageable memory area, to avoid it being written out to disk by the | |
| 29 | + | // operating system. | |
| 30 | + | // | |
| 31 | + | // It offer a way to reveal the contents in clear text. | |
| 32 | + | // | |
| 33 | + | // ## CSS Nodes | |
| 34 | + | // | |
| 35 | + | // `AdwPasswordEntryRow` has a single CSS node with name `row` that carries | |
| 36 | + | // `.entry` and `.password` style classes. | |
| 37 | + | type PasswordEntryRow struct { | |
| 38 | + | EntryRow | |
| 39 | + | } | |
| 40 | + | ||
| 41 | + | func PasswordEntryRowNewFromInternalPtr(ptr uintptr) *PasswordEntryRow { | |
| 42 | + | cls := &PasswordEntryRow{} | |
| 43 | + | cls.Ptr = ptr | |
| 44 | + | return cls | |
| 45 | + | } | |
| 46 | + | ||
| 47 | + | var xNewPasswordEntryRow func() uintptr | |
| 48 | + | ||
| 49 | + | // Creates a new `AdwPasswordEntryRow`. | |
| 50 | + | func NewPasswordEntryRow() *gtk.Widget { | |
| 51 | + | NewPasswordEntryRowPtr := xNewPasswordEntryRow() | |
| 52 | + | if NewPasswordEntryRowPtr == 0 { | |
| 53 | + | return nil | |
| 54 | + | } | |
| 55 | + | ||
| 56 | + | gobject.IncreaseRef(NewPasswordEntryRowPtr) | |
| 57 | + | ||
| 58 | + | NewPasswordEntryRowCls := >k.Widget{} | |
| 59 | + | NewPasswordEntryRowCls.Ptr = NewPasswordEntryRowPtr | |
| 60 | + | return NewPasswordEntryRowCls | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | func (c *PasswordEntryRow) GoPointer() uintptr { | |
| 64 | + | return c.Ptr | |
| 65 | + | } | |
| 66 | + | ||
| 67 | + | func (c *PasswordEntryRow) SetGoPointer(ptr uintptr) { | |
| 68 | + | c.Ptr = ptr | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 72 | + | func (x *PasswordEntryRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 73 | + | ||
| 74 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 75 | + | ||
| 76 | + | } | |
| 77 | + | ||
| 78 | + | // Resets the accessible @property to its default value. | |
| 79 | + | func (x *PasswordEntryRow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 80 | + | ||
| 81 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 82 | + | ||
| 83 | + | } | |
| 84 | + | ||
| 85 | + | // Resets the accessible @relation to its default value. | |
| 86 | + | func (x *PasswordEntryRow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 87 | + | ||
| 88 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 89 | + | ||
| 90 | + | } | |
| 91 | + | ||
| 92 | + | // Resets the accessible @state to its default value. | |
| 93 | + | func (x *PasswordEntryRow) ResetState(StateVar gtk.AccessibleState) { | |
| 94 | + | ||
| 95 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 96 | + | ||
| 97 | + | } | |
| 98 | + | ||
| 99 | + | // Updates a list of accessible properties. | |
| 100 | + | // | |
| 101 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 102 | + | // value types of accessible properties. | |
| 103 | + | // | |
| 104 | + | // This function should be called by `GtkWidget` types whenever | |
| 105 | + | // an accessible property change must be communicated to assistive | |
| 106 | + | // technologies. | |
| 107 | + | // | |
| 108 | + | // Example: | |
| 109 | + | // ```c | |
| 110 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 111 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 112 | + | // | |
| 113 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 114 | + | // -1); | |
| 115 | + | // | |
| 116 | + | // ``` | |
| 117 | + | func (x *PasswordEntryRow) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 118 | + | ||
| 119 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 120 | + | ||
| 121 | + | } | |
| 122 | + | ||
| 123 | + | // Updates an array of accessible properties. | |
| 124 | + | // | |
| 125 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 126 | + | // property change must be communicated to assistive technologies. | |
| 127 | + | // | |
| 128 | + | // This function is meant to be used by language bindings. | |
| 129 | + | func (x *PasswordEntryRow) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 130 | + | ||
| 131 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 132 | + | ||
| 133 | + | } | |
| 134 | + | ||
| 135 | + | // Updates a list of accessible relations. | |
| 136 | + | // | |
| 137 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 138 | + | // relation change must be communicated to assistive technologies. | |
| 139 | + | // | |
| 140 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 141 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 142 | + | // | |
| 143 | + | // ```c | |
| 144 | + | // gtk_accessible_update_relation (accessible, | |
| 145 | + | // | |
| 146 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 147 | + | // ref1, NULL, | |
| 148 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 149 | + | // ref1, ref2, ref3, NULL, | |
| 150 | + | // -1); | |
| 151 | + | // | |
| 152 | + | // ``` | |
| 153 | + | func (x *PasswordEntryRow) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 154 | + | ||
| 155 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 156 | + | ||
| 157 | + | } | |
| 158 | + | ||
| 159 | + | // Updates an array of accessible relations. | |
| 160 | + | // | |
| 161 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 162 | + | // relation change must be communicated to assistive technologies. | |
| 163 | + | // | |
| 164 | + | // This function is meant to be used by language bindings. | |
| 165 | + | func (x *PasswordEntryRow) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 166 | + | ||
| 167 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 168 | + | ||
| 169 | + | } | |
| 170 | + | ||
| 171 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 172 | + | // documentation for the value types of accessible states. | |
| 173 | + | // | |
| 174 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 175 | + | // state change must be communicated to assistive technologies. | |
| 176 | + | // | |
| 177 | + | // Example: | |
| 178 | + | // ```c | |
| 179 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 180 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 181 | + | // | |
| 182 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 183 | + | // -1); | |
| 184 | + | // | |
| 185 | + | // ``` | |
| 186 | + | func (x *PasswordEntryRow) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 187 | + | ||
| 188 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 189 | + | ||
| 190 | + | } | |
| 191 | + | ||
| 192 | + | // Updates an array of accessible states. | |
| 193 | + | // | |
| 194 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 195 | + | // state change must be communicated to assistive technologies. | |
| 196 | + | // | |
| 197 | + | // This function is meant to be used by language bindings. | |
| 198 | + | func (x *PasswordEntryRow) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 199 | + | ||
| 200 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 201 | + | ||
| 202 | + | } | |
| 203 | + | ||
| 204 | + | // Gets the action name for @actionable. | |
| 205 | + | func (x *PasswordEntryRow) GetActionName() string { | |
| 206 | + | ||
| 207 | + | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 208 | + | ||
| 209 | + | } | |
| 210 | + | ||
| 211 | + | // Gets the current target value of @actionable. | |
| 212 | + | func (x *PasswordEntryRow) GetActionTargetValue() *glib.Variant { | |
| 213 | + | ||
| 214 | + | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 215 | + | ||
| 216 | + | } | |
| 217 | + | ||
| 218 | + | // Specifies the name of the action with which this widget should be | |
| 219 | + | // associated. | |
| 220 | + | // | |
| 221 | + | // If @action_name is %NULL then the widget will be unassociated from | |
| 222 | + | // any previous action. | |
| 223 | + | // | |
| 224 | + | // Usually this function is used when the widget is located (or will be | |
| 225 | + | // located) within the hierarchy of a `GtkApplicationWindow`. | |
| 226 | + | // | |
| 227 | + | // Names are of the form “win.save” or “app.quit” for actions on the | |
| 228 | + | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 229 | + | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 230 | + | // associated with the window. | |
| 231 | + | func (x *PasswordEntryRow) SetActionName(ActionNameVar string) { | |
| 232 | + | ||
| 233 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 234 | + | ||
| 235 | + | } | |
| 236 | + | ||
| 237 | + | // Sets the target of an actionable widget. | |
| 238 | + | // | |
| 239 | + | // This is a convenience function that calls [ctor@GLib.Variant.new] for | |
| 240 | + | // @format_string and uses the result to call | |
| 241 | + | // [method@Gtk.Actionable.set_action_target_value]. | |
| 242 | + | // | |
| 243 | + | // If you are setting a string-valued target and want to set | |
| 244 | + | // the action name at the same time, you can use | |
| 245 | + | // [method@Gtk.Actionable.set_detailed_action_name]. | |
| 246 | + | func (x *PasswordEntryRow) SetActionTarget(FormatStringVar string, varArgs ...interface{}) { | |
| 247 | + | ||
| 248 | + | gtk.XGtkActionableSetActionTarget(x.GoPointer(), FormatStringVar, varArgs...) | |
| 249 | + | ||
| 250 | + | } | |
| 251 | + | ||
| 252 | + | // Sets the target value of an actionable widget. | |
| 253 | + | // | |
| 254 | + | // If @target_value is %NULL then the target value is unset. | |
| 255 | + | // | |
| 256 | + | // The target value has two purposes. First, it is used as the parameter | |
| 257 | + | // to activation of the action associated with the `GtkActionable` widget. | |
| 258 | + | // Second, it is used to determine if the widget should be rendered as | |
| 259 | + | // “active” — the widget is active if the state is equal to the given target. | |
| 260 | + | // | |
| 261 | + | // Consider the example of associating a set of buttons with a [iface@Gio.Action] | |
| 262 | + | // with string state in a typical “radio button” situation. Each button | |
| 263 | + | // will be associated with the same action, but with a different target | |
| 264 | + | // value for that action. Clicking on a particular button will activate | |
| 265 | + | // the action with the target of that button, which will typically cause | |
| 266 | + | // the action’s state to change to that value. Since the action’s state | |
| 267 | + | // is now equal to the target value of the button, the button will now | |
| 268 | + | // be rendered as active (and the other buttons, with different targets, | |
| 269 | + | // rendered inactive). | |
| 270 | + | func (x *PasswordEntryRow) SetActionTargetValue(TargetValueVar *glib.Variant) { | |
| 271 | + | ||
| 272 | + | gtk.XGtkActionableSetActionTargetValue(x.GoPointer(), TargetValueVar) | |
| 273 | + | ||
| 274 | + | } | |
| 275 | + | ||
| 276 | + | // Sets the action-name and associated string target value of an | |
| 277 | + | // actionable widget. | |
| 278 | + | // | |
| 279 | + | // @detailed_action_name is a string in the format accepted by | |
| 280 | + | // [func@Gio.Action.parse_detailed_name]. | |
| 281 | + | func (x *PasswordEntryRow) SetDetailedActionName(DetailedActionNameVar string) { | |
| 282 | + | ||
| 283 | + | gtk.XGtkActionableSetDetailedActionName(x.GoPointer(), DetailedActionNameVar) | |
| 284 | + | ||
| 285 | + | } | |
| 286 | + | ||
| 287 | + | // Gets the ID of the @buildable object. | |
| 288 | + | // | |
| 289 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 290 | + | // of the <object> tag used to construct the @buildable. | |
| 291 | + | func (x *PasswordEntryRow) GetBuildableId() string { | |
| 292 | + | ||
| 293 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 294 | + | ||
| 295 | + | } | |
| 296 | + | ||
| 297 | + | // Deletes the currently selected text of the editable. | |
| 298 | + | // | |
| 299 | + | // This call doesn’t do anything if there is no selected text. | |
| 300 | + | func (x *PasswordEntryRow) DeleteSelection() { | |
| 301 | + | ||
| 302 | + | gtk.XGtkEditableDeleteSelection(x.GoPointer()) | |
| 303 | + | ||
| 304 | + | } | |
| 305 | + | ||
| 306 | + | // Deletes a sequence of characters. | |
| 307 | + | // | |
| 308 | + | // The characters that are deleted are those characters at positions | |
| 309 | + | // from @start_pos up to, but not including @end_pos. If @end_pos is | |
| 310 | + | // negative, then the characters deleted are those from @start_pos to | |
| 311 | + | // the end of the text. | |
| 312 | + | // | |
| 313 | + | // Note that the positions are specified in characters, not bytes. | |
| 314 | + | func (x *PasswordEntryRow) DeleteText(StartPosVar int32, EndPosVar int32) { | |
| 315 | + | ||
| 316 | + | gtk.XGtkEditableDeleteText(x.GoPointer(), StartPosVar, EndPosVar) | |
| 317 | + | ||
| 318 | + | } | |
| 319 | + | ||
| 320 | + | // Undoes the setup done by [method@Gtk.Editable.init_delegate]. | |
| 321 | + | // | |
| 322 | + | // This is a helper function that should be called from dispose, | |
| 323 | + | // before removing the delegate object. | |
| 324 | + | func (x *PasswordEntryRow) FinishDelegate() { | |
| 325 | + | ||
| 326 | + | gtk.XGtkEditableFinishDelegate(x.GoPointer()) | |
| 327 | + | ||
| 328 | + | } | |
| 329 | + | ||
| 330 | + | // Gets the alignment of the editable. | |
| 331 | + | func (x *PasswordEntryRow) GetAlignment() float32 { | |
| 332 | + | ||
| 333 | + | return gtk.XGtkEditableGetAlignment(x.GoPointer()) | |
| 334 | + | ||
| 335 | + | } | |
| 336 | + | ||
| 337 | + | // Retrieves a sequence of characters. | |
| 338 | + | // | |
| 339 | + | // The characters that are retrieved are those characters at positions | |
| 340 | + | // from @start_pos up to, but not including @end_pos. If @end_pos is negative, | |
| 341 | + | // then the characters retrieved are those characters from @start_pos to | |
| 342 | + | // the end of the text. | |
| 343 | + | // | |
| 344 | + | // Note that positions are specified in characters, not bytes. | |
| 345 | + | func (x *PasswordEntryRow) GetChars(StartPosVar int32, EndPosVar int32) string { | |
| 346 | + | ||
| 347 | + | return gtk.XGtkEditableGetChars(x.GoPointer(), StartPosVar, EndPosVar) | |
| 348 | + | ||
| 349 | + | } | |
| 350 | + | ||
| 351 | + | // Gets the `GtkEditable` that @editable is delegating its | |
| 352 | + | // implementation to. | |
| 353 | + | // | |
| 354 | + | // Typically, the delegate is a [class@Gtk.Text] widget. | |
| 355 | + | func (x *PasswordEntryRow) GetDelegate() *gtk.EditableBase { | |
| 356 | + | ||
| 357 | + | GetDelegatePtr := gtk.XGtkEditableGetDelegate(x.GoPointer()) | |
| 358 | + | if GetDelegatePtr == 0 { | |
| 359 | + | return nil | |
| 360 | + | } | |
| 361 | + | ||
| 362 | + | gobject.IncreaseRef(GetDelegatePtr) | |
| 363 | + | ||
| 364 | + | GetDelegateCls := >k.EditableBase{} | |
| 365 | + | GetDelegateCls.Ptr = GetDelegatePtr | |
| 366 | + | return GetDelegateCls | |
| 367 | + | ||
| 368 | + | } | |
| 369 | + | ||
| 370 | + | // Retrieves whether @editable is editable. | |
| 371 | + | func (x *PasswordEntryRow) GetEditable() bool { | |
| 372 | + | ||
| 373 | + | return gtk.XGtkEditableGetEditable(x.GoPointer()) | |
| 374 | + | ||
| 375 | + | } | |
| 376 | + | ||
| 377 | + | // Gets if undo/redo actions are enabled for @editable | |
| 378 | + | func (x *PasswordEntryRow) GetEnableUndo() bool { | |
| 379 | + | ||
| 380 | + | return gtk.XGtkEditableGetEnableUndo(x.GoPointer()) | |
| 381 | + | ||
| 382 | + | } | |
| 383 | + | ||
| 384 | + | // Retrieves the desired maximum width of @editable, in characters. | |
| 385 | + | func (x *PasswordEntryRow) GetMaxWidthChars() int32 { | |
| 386 | + | ||
| 387 | + | return gtk.XGtkEditableGetMaxWidthChars(x.GoPointer()) | |
| 388 | + | ||
| 389 | + | } | |
| 390 | + | ||
| 391 | + | // Retrieves the current position of the cursor relative | |
| 392 | + | // to the start of the content of the editable. | |
| 393 | + | // | |
| 394 | + | // Note that this position is in characters, not in bytes. | |
| 395 | + | func (x *PasswordEntryRow) GetPosition() int32 { | |
| 396 | + | ||
| 397 | + | return gtk.XGtkEditableGetPosition(x.GoPointer()) | |
| 398 | + | ||
| 399 | + | } | |
| 400 | + | ||
| 401 | + | // Retrieves the selection bound of the editable. | |
| 402 | + | // | |
| 403 | + | // @start_pos will be filled with the start of the selection and | |
| 404 | + | // @end_pos with end. If no text was selected both will be identical | |
| 405 | + | // and %FALSE will be returned. | |
| 406 | + | // | |
| 407 | + | // Note that positions are specified in characters, not bytes. | |
| 408 | + | func (x *PasswordEntryRow) GetSelectionBounds(StartPosVar int32, EndPosVar int32) bool { | |
| 409 | + | ||
| 410 | + | return gtk.XGtkEditableGetSelectionBounds(x.GoPointer(), StartPosVar, EndPosVar) | |
| 411 | + | ||
| 412 | + | } | |
| 413 | + | ||
| 414 | + | // Retrieves the contents of @editable. | |
| 415 | + | // | |
| 416 | + | // The returned string is owned by GTK and must not be modified or freed. | |
| 417 | + | func (x *PasswordEntryRow) GetText() string { | |
| 418 | + | ||
| 419 | + | return gtk.XGtkEditableGetText(x.GoPointer()) | |
| 420 | + | ||
| 421 | + | } | |
| 422 | + | ||
| 423 | + | // Gets the number of characters of space reserved | |
| 424 | + | // for the contents of the editable. | |
| 425 | + | func (x *PasswordEntryRow) GetWidthChars() int32 { | |
| 426 | + | ||
| 427 | + | return gtk.XGtkEditableGetWidthChars(x.GoPointer()) | |
| 428 | + | ||
| 429 | + | } | |
| 430 | + | ||
| 431 | + | // Sets up a delegate for `GtkEditable`. | |
| 432 | + | // | |
| 433 | + | // This is assuming that the get_delegate vfunc in the `GtkEditable` | |
| 434 | + | // interface has been set up for the @editable's type. | |
| 435 | + | // | |
| 436 | + | // This is a helper function that should be called in instance init, | |
| 437 | + | // after creating the delegate object. | |
| 438 | + | func (x *PasswordEntryRow) InitDelegate() { | |
| 439 | + | ||
| 440 | + | gtk.XGtkEditableInitDelegate(x.GoPointer()) | |
| 441 | + | ||
| 442 | + | } | |
| 443 | + | ||
| 444 | + | // Inserts @length bytes of @text into the contents of the | |
| 445 | + | // widget, at position @position. | |
| 446 | + | // | |
| 447 | + | // Note that the position is in characters, not in bytes. | |
| 448 | + | // The function updates @position to point after the newly | |
| 449 | + | // inserted text. | |
| 450 | + | func (x *PasswordEntryRow) InsertText(TextVar string, LengthVar int32, PositionVar int32) { | |
| 451 | + | ||
| 452 | + | gtk.XGtkEditableInsertText(x.GoPointer(), TextVar, LengthVar, PositionVar) | |
| 453 | + | ||
| 454 | + | } | |
| 455 | + | ||
| 456 | + | // Selects a region of text. | |
| 457 | + | // | |
| 458 | + | // The characters that are selected are those characters at positions | |
| 459 | + | // from @start_pos up to, but not including @end_pos. If @end_pos is | |
| 460 | + | // negative, then the characters selected are those characters from | |
| 461 | + | // @start_pos to the end of the text. | |
| 462 | + | // | |
| 463 | + | // Note that positions are specified in characters, not bytes. | |
| 464 | + | func (x *PasswordEntryRow) SelectRegion(StartPosVar int32, EndPosVar int32) { | |
| 465 | + | ||
| 466 | + | gtk.XGtkEditableSelectRegion(x.GoPointer(), StartPosVar, EndPosVar) | |
| 467 | + | ||
| 468 | + | } | |
| 469 | + | ||
| 470 | + | // Sets the alignment for the contents of the editable. | |
| 471 | + | // | |
| 472 | + | // This controls the horizontal positioning of the contents when | |
| 473 | + | // the displayed text is shorter than the width of the editable. | |
| 474 | + | func (x *PasswordEntryRow) SetAlignment(XalignVar float32) { | |
| 475 | + | ||
| 476 | + | gtk.XGtkEditableSetAlignment(x.GoPointer(), XalignVar) | |
| 477 | + | ||
| 478 | + | } | |
| 479 | + | ||
| 480 | + | // Determines if the user can edit the text in the editable widget. | |
| 481 | + | func (x *PasswordEntryRow) SetEditable(IsEditableVar bool) { | |
| 482 | + | ||
| 483 | + | gtk.XGtkEditableSetEditable(x.GoPointer(), IsEditableVar) | |
| 484 | + | ||
| 485 | + | } | |
| 486 | + | ||
| 487 | + | // If enabled, changes to @editable will be saved for undo/redo | |
| 488 | + | // actions. | |
| 489 | + | // | |
| 490 | + | // This results in an additional copy of text changes and are not | |
| 491 | + | // stored in secure memory. As such, undo is forcefully disabled | |
| 492 | + | // when [property@Gtk.Text:visibility] is set to %FALSE. | |
| 493 | + | func (x *PasswordEntryRow) SetEnableUndo(EnableUndoVar bool) { | |
| 494 | + | ||
| 495 | + | gtk.XGtkEditableSetEnableUndo(x.GoPointer(), EnableUndoVar) | |
| 496 | + | ||
| 497 | + | } | |
| 498 | + | ||
| 499 | + | // Sets the desired maximum width in characters of @editable. | |
| 500 | + | func (x *PasswordEntryRow) SetMaxWidthChars(NCharsVar int32) { | |
| 501 | + | ||
| 502 | + | gtk.XGtkEditableSetMaxWidthChars(x.GoPointer(), NCharsVar) | |
| 503 | + | ||
| 504 | + | } | |
| 505 | + | ||
| 506 | + | // Sets the cursor position in the editable to the given value. | |
| 507 | + | // | |
| 508 | + | // The cursor is displayed before the character with the given (base 0) | |
| 509 | + | // index in the contents of the editable. The value must be less than | |
| 510 | + | // or equal to the number of characters in the editable. A value of -1 | |
| 511 | + | // indicates that the position should be set after the last character | |
| 512 | + | // of the editable. Note that @position is in characters, not in bytes. | |
| 513 | + | func (x *PasswordEntryRow) SetPosition(PositionVar int32) { | |
| 514 | + | ||
| 515 | + | gtk.XGtkEditableSetPosition(x.GoPointer(), PositionVar) | |
| 516 | + | ||
| 517 | + | } | |
| 518 | + | ||
| 519 | + | // Sets the text in the editable to the given value. | |
| 520 | + | // | |
| 521 | + | // This is replacing the current contents. | |
| 522 | + | func (x *PasswordEntryRow) SetText(TextVar string) { | |
| 523 | + | ||
| 524 | + | gtk.XGtkEditableSetText(x.GoPointer(), TextVar) | |
| 525 | + | ||
| 526 | + | } | |
| 527 | + | ||
| 528 | + | // Changes the size request of the editable to be about the | |
| 529 | + | // right size for @n_chars characters. | |
| 530 | + | // | |
| 531 | + | // Note that it changes the size request, the size can still | |
| 532 | + | // be affected by how you pack the widget into containers. | |
| 533 | + | // If @n_chars is -1, the size reverts to the default size. | |
| 534 | + | func (x *PasswordEntryRow) SetWidthChars(NCharsVar int32) { | |
| 535 | + | ||
| 536 | + | gtk.XGtkEditableSetWidthChars(x.GoPointer(), NCharsVar) | |
| 537 | + | ||
| 538 | + | } | |
| 539 | + | ||
| 540 | + | func init() { | |
| 541 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 542 | + | if err != nil { | |
| 543 | + | panic(err) | |
| 544 | + | } | |
| 545 | + | ||
| 546 | + | core.PuregoSafeRegister(&xNewPasswordEntryRow, lib, "adw_password_entry_row_new") | |
| 547 | + | ||
| 548 | + | } | |
A v4/adw/adw-preferences-group.go +329 -0
| @@ -0,0 +1,329 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | type PreferencesGroupClass struct { | |
| 12 | + | ParentClass uintptr | |
| 13 | + | ||
| 14 | + | Padding uintptr | |
| 15 | + | } | |
| 16 | + | ||
| 17 | + | // A group of preference rows. | |
| 18 | + | // | |
| 19 | + | // <picture> | |
| 20 | + | // | |
| 21 | + | // <source srcset="preferences-group-dark.png" media="(prefers-color-scheme: dark)"> | |
| 22 | + | // <img src="preferences-group.png" alt="preferences-group"> | |
| 23 | + | // | |
| 24 | + | // </picture> | |
| 25 | + | // | |
| 26 | + | // An `AdwPreferencesGroup` represents a group or tightly related preferences, | |
| 27 | + | // which in turn are represented by [class@PreferencesRow]. | |
| 28 | + | // | |
| 29 | + | // To summarize the role of the preferences it gathers, a group can have both a | |
| 30 | + | // title and a description. The title will be used by [class@PreferencesWindow] | |
| 31 | + | // to let the user look for a preference. | |
| 32 | + | // | |
| 33 | + | // ## AdwPreferencesGroup as GtkBuildable | |
| 34 | + | // | |
| 35 | + | // The `AdwPreferencesGroup` implementation of the [iface@Gtk.Buildable] interface | |
| 36 | + | // supports adding [class@PreferencesRow]s to the list by omitting "type". If "type" | |
| 37 | + | // is omitted and the widget isn't a [class@PreferencesRow] the child is added to | |
| 38 | + | // a box below the list. | |
| 39 | + | // | |
| 40 | + | // When the "type" attribute of a child is `header-suffix`, the child | |
| 41 | + | // is set as the suffix on the end of the title and description. | |
| 42 | + | // | |
| 43 | + | // ## CSS nodes | |
| 44 | + | // | |
| 45 | + | // `AdwPreferencesGroup` has a single CSS node with name `preferencesgroup`. | |
| 46 | + | // | |
| 47 | + | // ## Accessibility | |
| 48 | + | // | |
| 49 | + | // `AdwPreferencesGroup` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role. | |
| 50 | + | type PreferencesGroup struct { | |
| 51 | + | gtk.Widget | |
| 52 | + | } | |
| 53 | + | ||
| 54 | + | func PreferencesGroupNewFromInternalPtr(ptr uintptr) *PreferencesGroup { | |
| 55 | + | cls := &PreferencesGroup{} | |
| 56 | + | cls.Ptr = ptr | |
| 57 | + | return cls | |
| 58 | + | } | |
| 59 | + | ||
| 60 | + | var xNewPreferencesGroup func() uintptr | |
| 61 | + | ||
| 62 | + | // Creates a new `AdwPreferencesGroup`. | |
| 63 | + | func NewPreferencesGroup() *gtk.Widget { | |
| 64 | + | NewPreferencesGroupPtr := xNewPreferencesGroup() | |
| 65 | + | if NewPreferencesGroupPtr == 0 { | |
| 66 | + | return nil | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | gobject.IncreaseRef(NewPreferencesGroupPtr) | |
| 70 | + | ||
| 71 | + | NewPreferencesGroupCls := >k.Widget{} | |
| 72 | + | NewPreferencesGroupCls.Ptr = NewPreferencesGroupPtr | |
| 73 | + | return NewPreferencesGroupCls | |
| 74 | + | } | |
| 75 | + | ||
| 76 | + | var xPreferencesGroupAdd func(uintptr, uintptr) | |
| 77 | + | ||
| 78 | + | // Adds a child to @self. | |
| 79 | + | func (x *PreferencesGroup) Add(ChildVar *gtk.Widget) { | |
| 80 | + | ||
| 81 | + | xPreferencesGroupAdd(x.GoPointer(), ChildVar.GoPointer()) | |
| 82 | + | ||
| 83 | + | } | |
| 84 | + | ||
| 85 | + | var xPreferencesGroupGetDescription func(uintptr) string | |
| 86 | + | ||
| 87 | + | // Gets the description of @self. | |
| 88 | + | func (x *PreferencesGroup) GetDescription() string { | |
| 89 | + | ||
| 90 | + | return xPreferencesGroupGetDescription(x.GoPointer()) | |
| 91 | + | ||
| 92 | + | } | |
| 93 | + | ||
| 94 | + | var xPreferencesGroupGetHeaderSuffix func(uintptr) uintptr | |
| 95 | + | ||
| 96 | + | // Gets the suffix for @self's header. | |
| 97 | + | func (x *PreferencesGroup) GetHeaderSuffix() *gtk.Widget { | |
| 98 | + | ||
| 99 | + | GetHeaderSuffixPtr := xPreferencesGroupGetHeaderSuffix(x.GoPointer()) | |
| 100 | + | if GetHeaderSuffixPtr == 0 { | |
| 101 | + | return nil | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | gobject.IncreaseRef(GetHeaderSuffixPtr) | |
| 105 | + | ||
| 106 | + | GetHeaderSuffixCls := >k.Widget{} | |
| 107 | + | GetHeaderSuffixCls.Ptr = GetHeaderSuffixPtr | |
| 108 | + | return GetHeaderSuffixCls | |
| 109 | + | ||
| 110 | + | } | |
| 111 | + | ||
| 112 | + | var xPreferencesGroupGetTitle func(uintptr) string | |
| 113 | + | ||
| 114 | + | // Gets the title of @self. | |
| 115 | + | func (x *PreferencesGroup) GetTitle() string { | |
| 116 | + | ||
| 117 | + | return xPreferencesGroupGetTitle(x.GoPointer()) | |
| 118 | + | ||
| 119 | + | } | |
| 120 | + | ||
| 121 | + | var xPreferencesGroupRemove func(uintptr, uintptr) | |
| 122 | + | ||
| 123 | + | // Removes a child from @self. | |
| 124 | + | func (x *PreferencesGroup) Remove(ChildVar *gtk.Widget) { | |
| 125 | + | ||
| 126 | + | xPreferencesGroupRemove(x.GoPointer(), ChildVar.GoPointer()) | |
| 127 | + | ||
| 128 | + | } | |
| 129 | + | ||
| 130 | + | var xPreferencesGroupSetDescription func(uintptr, string) | |
| 131 | + | ||
| 132 | + | // Sets the description for @self. | |
| 133 | + | func (x *PreferencesGroup) SetDescription(DescriptionVar string) { | |
| 134 | + | ||
| 135 | + | xPreferencesGroupSetDescription(x.GoPointer(), DescriptionVar) | |
| 136 | + | ||
| 137 | + | } | |
| 138 | + | ||
| 139 | + | var xPreferencesGroupSetHeaderSuffix func(uintptr, uintptr) | |
| 140 | + | ||
| 141 | + | // Sets the suffix for @self's header. | |
| 142 | + | // | |
| 143 | + | // Displayed above the list, next to the title and description. | |
| 144 | + | // | |
| 145 | + | // Suffixes are commonly used to show a button or a spinner for the whole group. | |
| 146 | + | func (x *PreferencesGroup) SetHeaderSuffix(SuffixVar *gtk.Widget) { | |
| 147 | + | ||
| 148 | + | xPreferencesGroupSetHeaderSuffix(x.GoPointer(), SuffixVar.GoPointer()) | |
| 149 | + | ||
| 150 | + | } | |
| 151 | + | ||
| 152 | + | var xPreferencesGroupSetTitle func(uintptr, string) | |
| 153 | + | ||
| 154 | + | // Sets the title for @self. | |
| 155 | + | func (x *PreferencesGroup) SetTitle(TitleVar string) { | |
| 156 | + | ||
| 157 | + | xPreferencesGroupSetTitle(x.GoPointer(), TitleVar) | |
| 158 | + | ||
| 159 | + | } | |
| 160 | + | ||
| 161 | + | func (c *PreferencesGroup) GoPointer() uintptr { | |
| 162 | + | return c.Ptr | |
| 163 | + | } | |
| 164 | + | ||
| 165 | + | func (c *PreferencesGroup) SetGoPointer(ptr uintptr) { | |
| 166 | + | c.Ptr = ptr | |
| 167 | + | } | |
| 168 | + | ||
| 169 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 170 | + | func (x *PreferencesGroup) GetAccessibleRole() gtk.AccessibleRole { | |
| 171 | + | ||
| 172 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 173 | + | ||
| 174 | + | } | |
| 175 | + | ||
| 176 | + | // Resets the accessible @property to its default value. | |
| 177 | + | func (x *PreferencesGroup) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 178 | + | ||
| 179 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 180 | + | ||
| 181 | + | } | |
| 182 | + | ||
| 183 | + | // Resets the accessible @relation to its default value. | |
| 184 | + | func (x *PreferencesGroup) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 185 | + | ||
| 186 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 187 | + | ||
| 188 | + | } | |
| 189 | + | ||
| 190 | + | // Resets the accessible @state to its default value. | |
| 191 | + | func (x *PreferencesGroup) ResetState(StateVar gtk.AccessibleState) { | |
| 192 | + | ||
| 193 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 194 | + | ||
| 195 | + | } | |
| 196 | + | ||
| 197 | + | // Updates a list of accessible properties. | |
| 198 | + | // | |
| 199 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 200 | + | // value types of accessible properties. | |
| 201 | + | // | |
| 202 | + | // This function should be called by `GtkWidget` types whenever | |
| 203 | + | // an accessible property change must be communicated to assistive | |
| 204 | + | // technologies. | |
| 205 | + | // | |
| 206 | + | // Example: | |
| 207 | + | // ```c | |
| 208 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 209 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 210 | + | // | |
| 211 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 212 | + | // -1); | |
| 213 | + | // | |
| 214 | + | // ``` | |
| 215 | + | func (x *PreferencesGroup) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 216 | + | ||
| 217 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 218 | + | ||
| 219 | + | } | |
| 220 | + | ||
| 221 | + | // Updates an array of accessible properties. | |
| 222 | + | // | |
| 223 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 224 | + | // property change must be communicated to assistive technologies. | |
| 225 | + | // | |
| 226 | + | // This function is meant to be used by language bindings. | |
| 227 | + | func (x *PreferencesGroup) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 228 | + | ||
| 229 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 230 | + | ||
| 231 | + | } | |
| 232 | + | ||
| 233 | + | // Updates a list of accessible relations. | |
| 234 | + | // | |
| 235 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 236 | + | // relation change must be communicated to assistive technologies. | |
| 237 | + | // | |
| 238 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 239 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 240 | + | // | |
| 241 | + | // ```c | |
| 242 | + | // gtk_accessible_update_relation (accessible, | |
| 243 | + | // | |
| 244 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 245 | + | // ref1, NULL, | |
| 246 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 247 | + | // ref1, ref2, ref3, NULL, | |
| 248 | + | // -1); | |
| 249 | + | // | |
| 250 | + | // ``` | |
| 251 | + | func (x *PreferencesGroup) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 252 | + | ||
| 253 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 254 | + | ||
| 255 | + | } | |
| 256 | + | ||
| 257 | + | // Updates an array of accessible relations. | |
| 258 | + | // | |
| 259 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 260 | + | // relation change must be communicated to assistive technologies. | |
| 261 | + | // | |
| 262 | + | // This function is meant to be used by language bindings. | |
| 263 | + | func (x *PreferencesGroup) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 264 | + | ||
| 265 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 266 | + | ||
| 267 | + | } | |
| 268 | + | ||
| 269 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 270 | + | // documentation for the value types of accessible states. | |
| 271 | + | // | |
| 272 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 273 | + | // state change must be communicated to assistive technologies. | |
| 274 | + | // | |
| 275 | + | // Example: | |
| 276 | + | // ```c | |
| 277 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 278 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 279 | + | // | |
| 280 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 281 | + | // -1); | |
| 282 | + | // | |
| 283 | + | // ``` | |
| 284 | + | func (x *PreferencesGroup) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 285 | + | ||
| 286 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 287 | + | ||
| 288 | + | } | |
| 289 | + | ||
| 290 | + | // Updates an array of accessible states. | |
| 291 | + | // | |
| 292 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 293 | + | // state change must be communicated to assistive technologies. | |
| 294 | + | // | |
| 295 | + | // This function is meant to be used by language bindings. | |
| 296 | + | func (x *PreferencesGroup) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 297 | + | ||
| 298 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 299 | + | ||
| 300 | + | } | |
| 301 | + | ||
| 302 | + | // Gets the ID of the @buildable object. | |
| 303 | + | // | |
| 304 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 305 | + | // of the <object> tag used to construct the @buildable. | |
| 306 | + | func (x *PreferencesGroup) GetBuildableId() string { | |
| 307 | + | ||
| 308 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 309 | + | ||
| 310 | + | } | |
| 311 | + | ||
| 312 | + | func init() { | |
| 313 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 314 | + | if err != nil { | |
| 315 | + | panic(err) | |
| 316 | + | } | |
| 317 | + | ||
| 318 | + | core.PuregoSafeRegister(&xNewPreferencesGroup, lib, "adw_preferences_group_new") | |
| 319 | + | ||
| 320 | + | core.PuregoSafeRegister(&xPreferencesGroupAdd, lib, "adw_preferences_group_add") | |
| 321 | + | core.PuregoSafeRegister(&xPreferencesGroupGetDescription, lib, "adw_preferences_group_get_description") | |
| 322 | + | core.PuregoSafeRegister(&xPreferencesGroupGetHeaderSuffix, lib, "adw_preferences_group_get_header_suffix") | |
| 323 | + | core.PuregoSafeRegister(&xPreferencesGroupGetTitle, lib, "adw_preferences_group_get_title") | |
| 324 | + | core.PuregoSafeRegister(&xPreferencesGroupRemove, lib, "adw_preferences_group_remove") | |
| 325 | + | core.PuregoSafeRegister(&xPreferencesGroupSetDescription, lib, "adw_preferences_group_set_description") | |
| 326 | + | core.PuregoSafeRegister(&xPreferencesGroupSetHeaderSuffix, lib, "adw_preferences_group_set_header_suffix") | |
| 327 | + | core.PuregoSafeRegister(&xPreferencesGroupSetTitle, lib, "adw_preferences_group_set_title") | |
| 328 | + | ||
| 329 | + | } | |
A v4/adw/adw-preferences-page.go +332 -0
| @@ -0,0 +1,332 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | type PreferencesPageClass struct { | |
| 12 | + | ParentClass uintptr | |
| 13 | + | ||
| 14 | + | Padding uintptr | |
| 15 | + | } | |
| 16 | + | ||
| 17 | + | // A page from [class@PreferencesWindow]. | |
| 18 | + | // | |
| 19 | + | // <picture> | |
| 20 | + | // | |
| 21 | + | // <source srcset="preferences-page-dark.png" media="(prefers-color-scheme: dark)"> | |
| 22 | + | // <img src="preferences-page.png" alt="preferences-page"> | |
| 23 | + | // | |
| 24 | + | // </picture> | |
| 25 | + | // | |
| 26 | + | // The `AdwPreferencesPage` widget gathers preferences groups into a single page | |
| 27 | + | // of a preferences window. | |
| 28 | + | // | |
| 29 | + | // ## CSS nodes | |
| 30 | + | // | |
| 31 | + | // `AdwPreferencesPage` has a single CSS node with name `preferencespage`. | |
| 32 | + | // | |
| 33 | + | // ## Accessibility | |
| 34 | + | // | |
| 35 | + | // `AdwPreferencesPage` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role. | |
| 36 | + | type PreferencesPage struct { | |
| 37 | + | gtk.Widget | |
| 38 | + | } | |
| 39 | + | ||
| 40 | + | func PreferencesPageNewFromInternalPtr(ptr uintptr) *PreferencesPage { | |
| 41 | + | cls := &PreferencesPage{} | |
| 42 | + | cls.Ptr = ptr | |
| 43 | + | return cls | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | var xNewPreferencesPage func() uintptr | |
| 47 | + | ||
| 48 | + | // Creates a new `AdwPreferencesPage`. | |
| 49 | + | func NewPreferencesPage() *gtk.Widget { | |
| 50 | + | NewPreferencesPagePtr := xNewPreferencesPage() | |
| 51 | + | if NewPreferencesPagePtr == 0 { | |
| 52 | + | return nil | |
| 53 | + | } | |
| 54 | + | ||
| 55 | + | gobject.IncreaseRef(NewPreferencesPagePtr) | |
| 56 | + | ||
| 57 | + | NewPreferencesPageCls := >k.Widget{} | |
| 58 | + | NewPreferencesPageCls.Ptr = NewPreferencesPagePtr | |
| 59 | + | return NewPreferencesPageCls | |
| 60 | + | } | |
| 61 | + | ||
| 62 | + | var xPreferencesPageAdd func(uintptr, uintptr) | |
| 63 | + | ||
| 64 | + | // Adds a preferences group to @self. | |
| 65 | + | func (x *PreferencesPage) Add(GroupVar *PreferencesGroup) { | |
| 66 | + | ||
| 67 | + | xPreferencesPageAdd(x.GoPointer(), GroupVar.GoPointer()) | |
| 68 | + | ||
| 69 | + | } | |
| 70 | + | ||
| 71 | + | var xPreferencesPageGetIconName func(uintptr) string | |
| 72 | + | ||
| 73 | + | // Gets the icon name for @self. | |
| 74 | + | func (x *PreferencesPage) GetIconName() string { | |
| 75 | + | ||
| 76 | + | return xPreferencesPageGetIconName(x.GoPointer()) | |
| 77 | + | ||
| 78 | + | } | |
| 79 | + | ||
| 80 | + | var xPreferencesPageGetName func(uintptr) string | |
| 81 | + | ||
| 82 | + | // Gets the name of @self. | |
| 83 | + | func (x *PreferencesPage) GetName() string { | |
| 84 | + | ||
| 85 | + | return xPreferencesPageGetName(x.GoPointer()) | |
| 86 | + | ||
| 87 | + | } | |
| 88 | + | ||
| 89 | + | var xPreferencesPageGetTitle func(uintptr) string | |
| 90 | + | ||
| 91 | + | // Gets the title of @self. | |
| 92 | + | func (x *PreferencesPage) GetTitle() string { | |
| 93 | + | ||
| 94 | + | return xPreferencesPageGetTitle(x.GoPointer()) | |
| 95 | + | ||
| 96 | + | } | |
| 97 | + | ||
| 98 | + | var xPreferencesPageGetUseUnderline func(uintptr) bool | |
| 99 | + | ||
| 100 | + | // Gets whether an embedded underline in the title indicates a mnemonic. | |
| 101 | + | func (x *PreferencesPage) GetUseUnderline() bool { | |
| 102 | + | ||
| 103 | + | return xPreferencesPageGetUseUnderline(x.GoPointer()) | |
| 104 | + | ||
| 105 | + | } | |
| 106 | + | ||
| 107 | + | var xPreferencesPageRemove func(uintptr, uintptr) | |
| 108 | + | ||
| 109 | + | // Removes a group from @self. | |
| 110 | + | func (x *PreferencesPage) Remove(GroupVar *PreferencesGroup) { | |
| 111 | + | ||
| 112 | + | xPreferencesPageRemove(x.GoPointer(), GroupVar.GoPointer()) | |
| 113 | + | ||
| 114 | + | } | |
| 115 | + | ||
| 116 | + | var xPreferencesPageScrollToTop func(uintptr) | |
| 117 | + | ||
| 118 | + | // Scrolls the scrolled window of @self to the top. | |
| 119 | + | func (x *PreferencesPage) ScrollToTop() { | |
| 120 | + | ||
| 121 | + | xPreferencesPageScrollToTop(x.GoPointer()) | |
| 122 | + | ||
| 123 | + | } | |
| 124 | + | ||
| 125 | + | var xPreferencesPageSetIconName func(uintptr, string) | |
| 126 | + | ||
| 127 | + | // Sets the icon name for @self. | |
| 128 | + | func (x *PreferencesPage) SetIconName(IconNameVar string) { | |
| 129 | + | ||
| 130 | + | xPreferencesPageSetIconName(x.GoPointer(), IconNameVar) | |
| 131 | + | ||
| 132 | + | } | |
| 133 | + | ||
| 134 | + | var xPreferencesPageSetName func(uintptr, string) | |
| 135 | + | ||
| 136 | + | // Sets the name of @self. | |
| 137 | + | func (x *PreferencesPage) SetName(NameVar string) { | |
| 138 | + | ||
| 139 | + | xPreferencesPageSetName(x.GoPointer(), NameVar) | |
| 140 | + | ||
| 141 | + | } | |
| 142 | + | ||
| 143 | + | var xPreferencesPageSetTitle func(uintptr, string) | |
| 144 | + | ||
| 145 | + | // Sets the title of @self. | |
| 146 | + | func (x *PreferencesPage) SetTitle(TitleVar string) { | |
| 147 | + | ||
| 148 | + | xPreferencesPageSetTitle(x.GoPointer(), TitleVar) | |
| 149 | + | ||
| 150 | + | } | |
| 151 | + | ||
| 152 | + | var xPreferencesPageSetUseUnderline func(uintptr, bool) | |
| 153 | + | ||
| 154 | + | // Sets whether an embedded underline in the title indicates a mnemonic. | |
| 155 | + | func (x *PreferencesPage) SetUseUnderline(UseUnderlineVar bool) { | |
| 156 | + | ||
| 157 | + | xPreferencesPageSetUseUnderline(x.GoPointer(), UseUnderlineVar) | |
| 158 | + | ||
| 159 | + | } | |
| 160 | + | ||
| 161 | + | func (c *PreferencesPage) GoPointer() uintptr { | |
| 162 | + | return c.Ptr | |
| 163 | + | } | |
| 164 | + | ||
| 165 | + | func (c *PreferencesPage) SetGoPointer(ptr uintptr) { | |
| 166 | + | c.Ptr = ptr | |
| 167 | + | } | |
| 168 | + | ||
| 169 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 170 | + | func (x *PreferencesPage) GetAccessibleRole() gtk.AccessibleRole { | |
| 171 | + | ||
| 172 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 173 | + | ||
| 174 | + | } | |
| 175 | + | ||
| 176 | + | // Resets the accessible @property to its default value. | |
| 177 | + | func (x *PreferencesPage) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 178 | + | ||
| 179 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 180 | + | ||
| 181 | + | } | |
| 182 | + | ||
| 183 | + | // Resets the accessible @relation to its default value. | |
| 184 | + | func (x *PreferencesPage) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 185 | + | ||
| 186 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 187 | + | ||
| 188 | + | } | |
| 189 | + | ||
| 190 | + | // Resets the accessible @state to its default value. | |
| 191 | + | func (x *PreferencesPage) ResetState(StateVar gtk.AccessibleState) { | |
| 192 | + | ||
| 193 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 194 | + | ||
| 195 | + | } | |
| 196 | + | ||
| 197 | + | // Updates a list of accessible properties. | |
| 198 | + | // | |
| 199 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 200 | + | // value types of accessible properties. | |
| 201 | + | // | |
| 202 | + | // This function should be called by `GtkWidget` types whenever | |
| 203 | + | // an accessible property change must be communicated to assistive | |
| 204 | + | // technologies. | |
| 205 | + | // | |
| 206 | + | // Example: | |
| 207 | + | // ```c | |
| 208 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 209 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 210 | + | // | |
| 211 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 212 | + | // -1); | |
| 213 | + | // | |
| 214 | + | // ``` | |
| 215 | + | func (x *PreferencesPage) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 216 | + | ||
| 217 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 218 | + | ||
| 219 | + | } | |
| 220 | + | ||
| 221 | + | // Updates an array of accessible properties. | |
| 222 | + | // | |
| 223 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 224 | + | // property change must be communicated to assistive technologies. | |
| 225 | + | // | |
| 226 | + | // This function is meant to be used by language bindings. | |
| 227 | + | func (x *PreferencesPage) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 228 | + | ||
| 229 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 230 | + | ||
| 231 | + | } | |
| 232 | + | ||
| 233 | + | // Updates a list of accessible relations. | |
| 234 | + | // | |
| 235 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 236 | + | // relation change must be communicated to assistive technologies. | |
| 237 | + | // | |
| 238 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 239 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 240 | + | // | |
| 241 | + | // ```c | |
| 242 | + | // gtk_accessible_update_relation (accessible, | |
| 243 | + | // | |
| 244 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 245 | + | // ref1, NULL, | |
| 246 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 247 | + | // ref1, ref2, ref3, NULL, | |
| 248 | + | // -1); | |
| 249 | + | // | |
| 250 | + | // ``` | |
| 251 | + | func (x *PreferencesPage) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 252 | + | ||
| 253 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 254 | + | ||
| 255 | + | } | |
| 256 | + | ||
| 257 | + | // Updates an array of accessible relations. | |
| 258 | + | // | |
| 259 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 260 | + | // relation change must be communicated to assistive technologies. | |
| 261 | + | // | |
| 262 | + | // This function is meant to be used by language bindings. | |
| 263 | + | func (x *PreferencesPage) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 264 | + | ||
| 265 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 266 | + | ||
| 267 | + | } | |
| 268 | + | ||
| 269 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 270 | + | // documentation for the value types of accessible states. | |
| 271 | + | // | |
| 272 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 273 | + | // state change must be communicated to assistive technologies. | |
| 274 | + | // | |
| 275 | + | // Example: | |
| 276 | + | // ```c | |
| 277 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 278 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 279 | + | // | |
| 280 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 281 | + | // -1); | |
| 282 | + | // | |
| 283 | + | // ``` | |
| 284 | + | func (x *PreferencesPage) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 285 | + | ||
| 286 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 287 | + | ||
| 288 | + | } | |
| 289 | + | ||
| 290 | + | // Updates an array of accessible states. | |
| 291 | + | // | |
| 292 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 293 | + | // state change must be communicated to assistive technologies. | |
| 294 | + | // | |
| 295 | + | // This function is meant to be used by language bindings. | |
| 296 | + | func (x *PreferencesPage) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 297 | + | ||
| 298 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 299 | + | ||
| 300 | + | } | |
| 301 | + | ||
| 302 | + | // Gets the ID of the @buildable object. | |
| 303 | + | // | |
| 304 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 305 | + | // of the <object> tag used to construct the @buildable. | |
| 306 | + | func (x *PreferencesPage) GetBuildableId() string { | |
| 307 | + | ||
| 308 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 309 | + | ||
| 310 | + | } | |
| 311 | + | ||
| 312 | + | func init() { | |
| 313 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 314 | + | if err != nil { | |
| 315 | + | panic(err) | |
| 316 | + | } | |
| 317 | + | ||
| 318 | + | core.PuregoSafeRegister(&xNewPreferencesPage, lib, "adw_preferences_page_new") | |
| 319 | + | ||
| 320 | + | core.PuregoSafeRegister(&xPreferencesPageAdd, lib, "adw_preferences_page_add") | |
| 321 | + | core.PuregoSafeRegister(&xPreferencesPageGetIconName, lib, "adw_preferences_page_get_icon_name") | |
| 322 | + | core.PuregoSafeRegister(&xPreferencesPageGetName, lib, "adw_preferences_page_get_name") | |
| 323 | + | core.PuregoSafeRegister(&xPreferencesPageGetTitle, lib, "adw_preferences_page_get_title") | |
| 324 | + | core.PuregoSafeRegister(&xPreferencesPageGetUseUnderline, lib, "adw_preferences_page_get_use_underline") | |
| 325 | + | core.PuregoSafeRegister(&xPreferencesPageRemove, lib, "adw_preferences_page_remove") | |
| 326 | + | core.PuregoSafeRegister(&xPreferencesPageScrollToTop, lib, "adw_preferences_page_scroll_to_top") | |
| 327 | + | core.PuregoSafeRegister(&xPreferencesPageSetIconName, lib, "adw_preferences_page_set_icon_name") | |
| 328 | + | core.PuregoSafeRegister(&xPreferencesPageSetName, lib, "adw_preferences_page_set_name") | |
| 329 | + | core.PuregoSafeRegister(&xPreferencesPageSetTitle, lib, "adw_preferences_page_set_title") | |
| 330 | + | core.PuregoSafeRegister(&xPreferencesPageSetUseUnderline, lib, "adw_preferences_page_set_use_underline") | |
| 331 | + | ||
| 332 | + | } | |
A v4/adw/adw-preferences-row.go +385 -0
| @@ -0,0 +1,385 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 10 | + | ) | |
| 11 | + | ||
| 12 | + | type PreferencesRowClass struct { | |
| 13 | + | ParentClass uintptr | |
| 14 | + | ||
| 15 | + | Padding uintptr | |
| 16 | + | } | |
| 17 | + | ||
| 18 | + | // A [class@Gtk.ListBoxRow] used to present preferences. | |
| 19 | + | // | |
| 20 | + | // The `AdwPreferencesRow` widget has a title that [class@PreferencesWindow] | |
| 21 | + | // will use to let the user look for a preference. It doesn't present the title | |
| 22 | + | // in any way and lets you present the preference as you please. | |
| 23 | + | // | |
| 24 | + | // [class@ActionRow] and its derivatives are convenient to use as preference | |
| 25 | + | // rows as they take care of presenting the preference's title while letting you | |
| 26 | + | // compose the inputs of the preference around it. | |
| 27 | + | type PreferencesRow struct { | |
| 28 | + | gtk.ListBoxRow | |
| 29 | + | } | |
| 30 | + | ||
| 31 | + | func PreferencesRowNewFromInternalPtr(ptr uintptr) *PreferencesRow { | |
| 32 | + | cls := &PreferencesRow{} | |
| 33 | + | cls.Ptr = ptr | |
| 34 | + | return cls | |
| 35 | + | } | |
| 36 | + | ||
| 37 | + | var xNewPreferencesRow func() uintptr | |
| 38 | + | ||
| 39 | + | // Creates a new `AdwPreferencesRow`. | |
| 40 | + | func NewPreferencesRow() *gtk.Widget { | |
| 41 | + | NewPreferencesRowPtr := xNewPreferencesRow() | |
| 42 | + | if NewPreferencesRowPtr == 0 { | |
| 43 | + | return nil | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | gobject.IncreaseRef(NewPreferencesRowPtr) | |
| 47 | + | ||
| 48 | + | NewPreferencesRowCls := >k.Widget{} | |
| 49 | + | NewPreferencesRowCls.Ptr = NewPreferencesRowPtr | |
| 50 | + | return NewPreferencesRowCls | |
| 51 | + | } | |
| 52 | + | ||
| 53 | + | var xPreferencesRowGetTitle func(uintptr) string | |
| 54 | + | ||
| 55 | + | // Gets the title of the preference represented by @self. | |
| 56 | + | func (x *PreferencesRow) GetTitle() string { | |
| 57 | + | ||
| 58 | + | return xPreferencesRowGetTitle(x.GoPointer()) | |
| 59 | + | ||
| 60 | + | } | |
| 61 | + | ||
| 62 | + | var xPreferencesRowGetTitleSelectable func(uintptr) bool | |
| 63 | + | ||
| 64 | + | // Gets whether the user can copy the title from the label | |
| 65 | + | func (x *PreferencesRow) GetTitleSelectable() bool { | |
| 66 | + | ||
| 67 | + | return xPreferencesRowGetTitleSelectable(x.GoPointer()) | |
| 68 | + | ||
| 69 | + | } | |
| 70 | + | ||
| 71 | + | var xPreferencesRowGetUseMarkup func(uintptr) bool | |
| 72 | + | ||
| 73 | + | // Gets whether to use Pango markup for the title label. | |
| 74 | + | func (x *PreferencesRow) GetUseMarkup() bool { | |
| 75 | + | ||
| 76 | + | return xPreferencesRowGetUseMarkup(x.GoPointer()) | |
| 77 | + | ||
| 78 | + | } | |
| 79 | + | ||
| 80 | + | var xPreferencesRowGetUseUnderline func(uintptr) bool | |
| 81 | + | ||
| 82 | + | // Gets whether an embedded underline in the title indicates a mnemonic. | |
| 83 | + | func (x *PreferencesRow) GetUseUnderline() bool { | |
| 84 | + | ||
| 85 | + | return xPreferencesRowGetUseUnderline(x.GoPointer()) | |
| 86 | + | ||
| 87 | + | } | |
| 88 | + | ||
| 89 | + | var xPreferencesRowSetTitle func(uintptr, string) | |
| 90 | + | ||
| 91 | + | // Sets the title of the preference represented by @self. | |
| 92 | + | // | |
| 93 | + | // The title is interpreted as Pango markup unless | |
| 94 | + | // [property@PreferencesRow:use-markup] is set to `FALSE`. | |
| 95 | + | func (x *PreferencesRow) SetTitle(TitleVar string) { | |
| 96 | + | ||
| 97 | + | xPreferencesRowSetTitle(x.GoPointer(), TitleVar) | |
| 98 | + | ||
| 99 | + | } | |
| 100 | + | ||
| 101 | + | var xPreferencesRowSetTitleSelectable func(uintptr, bool) | |
| 102 | + | ||
| 103 | + | // Sets whether the user can copy the title from the label | |
| 104 | + | // | |
| 105 | + | // See also [property@Gtk.Label:selectable]. | |
| 106 | + | func (x *PreferencesRow) SetTitleSelectable(TitleSelectableVar bool) { | |
| 107 | + | ||
| 108 | + | xPreferencesRowSetTitleSelectable(x.GoPointer(), TitleSelectableVar) | |
| 109 | + | ||
| 110 | + | } | |
| 111 | + | ||
| 112 | + | var xPreferencesRowSetUseMarkup func(uintptr, bool) | |
| 113 | + | ||
| 114 | + | // Sets whether to use Pango markup for the title label. | |
| 115 | + | // | |
| 116 | + | // Subclasses may also use it for other labels, such as subtitle. | |
| 117 | + | // | |
| 118 | + | // See also [func@Pango.parse_markup]. | |
| 119 | + | func (x *PreferencesRow) SetUseMarkup(UseMarkupVar bool) { | |
| 120 | + | ||
| 121 | + | xPreferencesRowSetUseMarkup(x.GoPointer(), UseMarkupVar) | |
| 122 | + | ||
| 123 | + | } | |
| 124 | + | ||
| 125 | + | var xPreferencesRowSetUseUnderline func(uintptr, bool) | |
| 126 | + | ||
| 127 | + | // Sets whether an embedded underline in the title indicates a mnemonic. | |
| 128 | + | func (x *PreferencesRow) SetUseUnderline(UseUnderlineVar bool) { | |
| 129 | + | ||
| 130 | + | xPreferencesRowSetUseUnderline(x.GoPointer(), UseUnderlineVar) | |
| 131 | + | ||
| 132 | + | } | |
| 133 | + | ||
| 134 | + | func (c *PreferencesRow) GoPointer() uintptr { | |
| 135 | + | return c.Ptr | |
| 136 | + | } | |
| 137 | + | ||
| 138 | + | func (c *PreferencesRow) SetGoPointer(ptr uintptr) { | |
| 139 | + | c.Ptr = ptr | |
| 140 | + | } | |
| 141 | + | ||
| 142 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 143 | + | func (x *PreferencesRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 144 | + | ||
| 145 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 146 | + | ||
| 147 | + | } | |
| 148 | + | ||
| 149 | + | // Resets the accessible @property to its default value. | |
| 150 | + | func (x *PreferencesRow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 151 | + | ||
| 152 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 153 | + | ||
| 154 | + | } | |
| 155 | + | ||
| 156 | + | // Resets the accessible @relation to its default value. | |
| 157 | + | func (x *PreferencesRow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 158 | + | ||
| 159 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 160 | + | ||
| 161 | + | } | |
| 162 | + | ||
| 163 | + | // Resets the accessible @state to its default value. | |
| 164 | + | func (x *PreferencesRow) ResetState(StateVar gtk.AccessibleState) { | |
| 165 | + | ||
| 166 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 167 | + | ||
| 168 | + | } | |
| 169 | + | ||
| 170 | + | // Updates a list of accessible properties. | |
| 171 | + | // | |
| 172 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 173 | + | // value types of accessible properties. | |
| 174 | + | // | |
| 175 | + | // This function should be called by `GtkWidget` types whenever | |
| 176 | + | // an accessible property change must be communicated to assistive | |
| 177 | + | // technologies. | |
| 178 | + | // | |
| 179 | + | // Example: | |
| 180 | + | // ```c | |
| 181 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 182 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 183 | + | // | |
| 184 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 185 | + | // -1); | |
| 186 | + | // | |
| 187 | + | // ``` | |
| 188 | + | func (x *PreferencesRow) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 189 | + | ||
| 190 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 191 | + | ||
| 192 | + | } | |
| 193 | + | ||
| 194 | + | // Updates an array of accessible properties. | |
| 195 | + | // | |
| 196 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 197 | + | // property change must be communicated to assistive technologies. | |
| 198 | + | // | |
| 199 | + | // This function is meant to be used by language bindings. | |
| 200 | + | func (x *PreferencesRow) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 201 | + | ||
| 202 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 203 | + | ||
| 204 | + | } | |
| 205 | + | ||
| 206 | + | // Updates a list of accessible relations. | |
| 207 | + | // | |
| 208 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 209 | + | // relation change must be communicated to assistive technologies. | |
| 210 | + | // | |
| 211 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 212 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 213 | + | // | |
| 214 | + | // ```c | |
| 215 | + | // gtk_accessible_update_relation (accessible, | |
| 216 | + | // | |
| 217 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 218 | + | // ref1, NULL, | |
| 219 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 220 | + | // ref1, ref2, ref3, NULL, | |
| 221 | + | // -1); | |
| 222 | + | // | |
| 223 | + | // ``` | |
| 224 | + | func (x *PreferencesRow) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 225 | + | ||
| 226 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 227 | + | ||
| 228 | + | } | |
| 229 | + | ||
| 230 | + | // Updates an array of accessible relations. | |
| 231 | + | // | |
| 232 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 233 | + | // relation change must be communicated to assistive technologies. | |
| 234 | + | // | |
| 235 | + | // This function is meant to be used by language bindings. | |
| 236 | + | func (x *PreferencesRow) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 237 | + | ||
| 238 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 239 | + | ||
| 240 | + | } | |
| 241 | + | ||
| 242 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 243 | + | // documentation for the value types of accessible states. | |
| 244 | + | // | |
| 245 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 246 | + | // state change must be communicated to assistive technologies. | |
| 247 | + | // | |
| 248 | + | // Example: | |
| 249 | + | // ```c | |
| 250 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 251 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 252 | + | // | |
| 253 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 254 | + | // -1); | |
| 255 | + | // | |
| 256 | + | // ``` | |
| 257 | + | func (x *PreferencesRow) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 258 | + | ||
| 259 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 260 | + | ||
| 261 | + | } | |
| 262 | + | ||
| 263 | + | // Updates an array of accessible states. | |
| 264 | + | // | |
| 265 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 266 | + | // state change must be communicated to assistive technologies. | |
| 267 | + | // | |
| 268 | + | // This function is meant to be used by language bindings. | |
| 269 | + | func (x *PreferencesRow) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 270 | + | ||
| 271 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 272 | + | ||
| 273 | + | } | |
| 274 | + | ||
| 275 | + | // Gets the action name for @actionable. | |
| 276 | + | func (x *PreferencesRow) GetActionName() string { | |
| 277 | + | ||
| 278 | + | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 279 | + | ||
| 280 | + | } | |
| 281 | + | ||
| 282 | + | // Gets the current target value of @actionable. | |
| 283 | + | func (x *PreferencesRow) GetActionTargetValue() *glib.Variant { | |
| 284 | + | ||
| 285 | + | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 286 | + | ||
| 287 | + | } | |
| 288 | + | ||
| 289 | + | // Specifies the name of the action with which this widget should be | |
| 290 | + | // associated. | |
| 291 | + | // | |
| 292 | + | // If @action_name is %NULL then the widget will be unassociated from | |
| 293 | + | // any previous action. | |
| 294 | + | // | |
| 295 | + | // Usually this function is used when the widget is located (or will be | |
| 296 | + | // located) within the hierarchy of a `GtkApplicationWindow`. | |
| 297 | + | // | |
| 298 | + | // Names are of the form “win.save” or “app.quit” for actions on the | |
| 299 | + | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 300 | + | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 301 | + | // associated with the window. | |
| 302 | + | func (x *PreferencesRow) SetActionName(ActionNameVar string) { | |
| 303 | + | ||
| 304 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 305 | + | ||
| 306 | + | } | |
| 307 | + | ||
| 308 | + | // Sets the target of an actionable widget. | |
| 309 | + | // | |
| 310 | + | // This is a convenience function that calls [ctor@GLib.Variant.new] for | |
| 311 | + | // @format_string and uses the result to call | |
| 312 | + | // [method@Gtk.Actionable.set_action_target_value]. | |
| 313 | + | // | |
| 314 | + | // If you are setting a string-valued target and want to set | |
| 315 | + | // the action name at the same time, you can use | |
| 316 | + | // [method@Gtk.Actionable.set_detailed_action_name]. | |
| 317 | + | func (x *PreferencesRow) SetActionTarget(FormatStringVar string, varArgs ...interface{}) { | |
| 318 | + | ||
| 319 | + | gtk.XGtkActionableSetActionTarget(x.GoPointer(), FormatStringVar, varArgs...) | |
| 320 | + | ||
| 321 | + | } | |
| 322 | + | ||
| 323 | + | // Sets the target value of an actionable widget. | |
| 324 | + | // | |
| 325 | + | // If @target_value is %NULL then the target value is unset. | |
| 326 | + | // | |
| 327 | + | // The target value has two purposes. First, it is used as the parameter | |
| 328 | + | // to activation of the action associated with the `GtkActionable` widget. | |
| 329 | + | // Second, it is used to determine if the widget should be rendered as | |
| 330 | + | // “active” — the widget is active if the state is equal to the given target. | |
| 331 | + | // | |
| 332 | + | // Consider the example of associating a set of buttons with a [iface@Gio.Action] | |
| 333 | + | // with string state in a typical “radio button” situation. Each button | |
| 334 | + | // will be associated with the same action, but with a different target | |
| 335 | + | // value for that action. Clicking on a particular button will activate | |
| 336 | + | // the action with the target of that button, which will typically cause | |
| 337 | + | // the action’s state to change to that value. Since the action’s state | |
| 338 | + | // is now equal to the target value of the button, the button will now | |
| 339 | + | // be rendered as active (and the other buttons, with different targets, | |
| 340 | + | // rendered inactive). | |
| 341 | + | func (x *PreferencesRow) SetActionTargetValue(TargetValueVar *glib.Variant) { | |
| 342 | + | ||
| 343 | + | gtk.XGtkActionableSetActionTargetValue(x.GoPointer(), TargetValueVar) | |
| 344 | + | ||
| 345 | + | } | |
| 346 | + | ||
| 347 | + | // Sets the action-name and associated string target value of an | |
| 348 | + | // actionable widget. | |
| 349 | + | // | |
| 350 | + | // @detailed_action_name is a string in the format accepted by | |
| 351 | + | // [func@Gio.Action.parse_detailed_name]. | |
| 352 | + | func (x *PreferencesRow) SetDetailedActionName(DetailedActionNameVar string) { | |
| 353 | + | ||
| 354 | + | gtk.XGtkActionableSetDetailedActionName(x.GoPointer(), DetailedActionNameVar) | |
| 355 | + | ||
| 356 | + | } | |
| 357 | + | ||
| 358 | + | // Gets the ID of the @buildable object. | |
| 359 | + | // | |
| 360 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 361 | + | // of the <object> tag used to construct the @buildable. | |
| 362 | + | func (x *PreferencesRow) GetBuildableId() string { | |
| 363 | + | ||
| 364 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 365 | + | ||
| 366 | + | } | |
| 367 | + | ||
| 368 | + | func init() { | |
| 369 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 370 | + | if err != nil { | |
| 371 | + | panic(err) | |
| 372 | + | } | |
| 373 | + | ||
| 374 | + | core.PuregoSafeRegister(&xNewPreferencesRow, lib, "adw_preferences_row_new") | |
| 375 | + | ||
| 376 | + | core.PuregoSafeRegister(&xPreferencesRowGetTitle, lib, "adw_preferences_row_get_title") | |
| 377 | + | core.PuregoSafeRegister(&xPreferencesRowGetTitleSelectable, lib, "adw_preferences_row_get_title_selectable") | |
| 378 | + | core.PuregoSafeRegister(&xPreferencesRowGetUseMarkup, lib, "adw_preferences_row_get_use_markup") | |
| 379 | + | core.PuregoSafeRegister(&xPreferencesRowGetUseUnderline, lib, "adw_preferences_row_get_use_underline") | |
| 380 | + | core.PuregoSafeRegister(&xPreferencesRowSetTitle, lib, "adw_preferences_row_set_title") | |
| 381 | + | core.PuregoSafeRegister(&xPreferencesRowSetTitleSelectable, lib, "adw_preferences_row_set_title_selectable") | |
| 382 | + | core.PuregoSafeRegister(&xPreferencesRowSetUseMarkup, lib, "adw_preferences_row_set_use_markup") | |
| 383 | + | core.PuregoSafeRegister(&xPreferencesRowSetUseUnderline, lib, "adw_preferences_row_set_use_underline") | |
| 384 | + | ||
| 385 | + | } | |
A v4/adw/adw-preferences-window.go +491 -0
| @@ -0,0 +1,491 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gdk" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gsk" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 11 | + | ) | |
| 12 | + | ||
| 13 | + | type PreferencesWindowClass struct { | |
| 14 | + | ParentClass uintptr | |
| 15 | + | ||
| 16 | + | Padding uintptr | |
| 17 | + | } | |
| 18 | + | ||
| 19 | + | // A window to present an application's preferences. | |
| 20 | + | // | |
| 21 | + | // <picture> | |
| 22 | + | // | |
| 23 | + | // <source srcset="preferences-window-dark.png" media="(prefers-color-scheme: dark)"> | |
| 24 | + | // <img src="preferences-window.png" alt="preferences-window"> | |
| 25 | + | // | |
| 26 | + | // </picture> | |
| 27 | + | // | |
| 28 | + | // The `AdwPreferencesWindow` widget presents an application's preferences | |
| 29 | + | // gathered into pages and groups. The preferences are searchable by the user. | |
| 30 | + | // | |
| 31 | + | // ## CSS nodes | |
| 32 | + | // | |
| 33 | + | // `AdwPreferencesWindow` has a main CSS node with the name `window` and the | |
| 34 | + | // style class `.preferences`. | |
| 35 | + | type PreferencesWindow struct { | |
| 36 | + | Window | |
| 37 | + | } | |
| 38 | + | ||
| 39 | + | func PreferencesWindowNewFromInternalPtr(ptr uintptr) *PreferencesWindow { | |
| 40 | + | cls := &PreferencesWindow{} | |
| 41 | + | cls.Ptr = ptr | |
| 42 | + | return cls | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | var xNewPreferencesWindow func() uintptr | |
| 46 | + | ||
| 47 | + | // Creates a new `AdwPreferencesWindow`. | |
| 48 | + | func NewPreferencesWindow() *gtk.Widget { | |
| 49 | + | NewPreferencesWindowPtr := xNewPreferencesWindow() | |
| 50 | + | if NewPreferencesWindowPtr == 0 { | |
| 51 | + | return nil | |
| 52 | + | } | |
| 53 | + | ||
| 54 | + | gobject.IncreaseRef(NewPreferencesWindowPtr) | |
| 55 | + | ||
| 56 | + | NewPreferencesWindowCls := >k.Widget{} | |
| 57 | + | NewPreferencesWindowCls.Ptr = NewPreferencesWindowPtr | |
| 58 | + | return NewPreferencesWindowCls | |
| 59 | + | } | |
| 60 | + | ||
| 61 | + | var xPreferencesWindowAdd func(uintptr, uintptr) | |
| 62 | + | ||
| 63 | + | // Adds a preferences page to @self. | |
| 64 | + | func (x *PreferencesWindow) Add(PageVar *PreferencesPage) { | |
| 65 | + | ||
| 66 | + | xPreferencesWindowAdd(x.GoPointer(), PageVar.GoPointer()) | |
| 67 | + | ||
| 68 | + | } | |
| 69 | + | ||
| 70 | + | var xPreferencesWindowAddToast func(uintptr, uintptr) | |
| 71 | + | ||
| 72 | + | // Displays @toast. | |
| 73 | + | // | |
| 74 | + | // See [method@ToastOverlay.add_toast]. | |
| 75 | + | func (x *PreferencesWindow) AddToast(ToastVar *Toast) { | |
| 76 | + | ||
| 77 | + | xPreferencesWindowAddToast(x.GoPointer(), ToastVar.GoPointer()) | |
| 78 | + | ||
| 79 | + | } | |
| 80 | + | ||
| 81 | + | var xPreferencesWindowCloseSubpage func(uintptr) | |
| 82 | + | ||
| 83 | + | // Closes the current subpage. | |
| 84 | + | // | |
| 85 | + | // If there is no presented subpage, this does nothing. | |
| 86 | + | func (x *PreferencesWindow) CloseSubpage() { | |
| 87 | + | ||
| 88 | + | xPreferencesWindowCloseSubpage(x.GoPointer()) | |
| 89 | + | ||
| 90 | + | } | |
| 91 | + | ||
| 92 | + | var xPreferencesWindowGetCanNavigateBack func(uintptr) bool | |
| 93 | + | ||
| 94 | + | // Gets whether gestures and shortcuts for closing subpages are enabled. | |
| 95 | + | func (x *PreferencesWindow) GetCanNavigateBack() bool { | |
| 96 | + | ||
| 97 | + | return xPreferencesWindowGetCanNavigateBack(x.GoPointer()) | |
| 98 | + | ||
| 99 | + | } | |
| 100 | + | ||
| 101 | + | var xPreferencesWindowGetSearchEnabled func(uintptr) bool | |
| 102 | + | ||
| 103 | + | // Gets whether search is enabled for @self. | |
| 104 | + | func (x *PreferencesWindow) GetSearchEnabled() bool { | |
| 105 | + | ||
| 106 | + | return xPreferencesWindowGetSearchEnabled(x.GoPointer()) | |
| 107 | + | ||
| 108 | + | } | |
| 109 | + | ||
| 110 | + | var xPreferencesWindowGetVisiblePage func(uintptr) uintptr | |
| 111 | + | ||
| 112 | + | // Gets the currently visible page of @self. | |
| 113 | + | func (x *PreferencesWindow) GetVisiblePage() *PreferencesPage { | |
| 114 | + | ||
| 115 | + | GetVisiblePagePtr := xPreferencesWindowGetVisiblePage(x.GoPointer()) | |
| 116 | + | if GetVisiblePagePtr == 0 { | |
| 117 | + | return nil | |
| 118 | + | } | |
| 119 | + | ||
| 120 | + | gobject.IncreaseRef(GetVisiblePagePtr) | |
| 121 | + | ||
| 122 | + | GetVisiblePageCls := &PreferencesPage{} | |
| 123 | + | GetVisiblePageCls.Ptr = GetVisiblePagePtr | |
| 124 | + | return GetVisiblePageCls | |
| 125 | + | ||
| 126 | + | } | |
| 127 | + | ||
| 128 | + | var xPreferencesWindowGetVisiblePageName func(uintptr) string | |
| 129 | + | ||
| 130 | + | // Gets the name of currently visible page of @self. | |
| 131 | + | func (x *PreferencesWindow) GetVisiblePageName() string { | |
| 132 | + | ||
| 133 | + | return xPreferencesWindowGetVisiblePageName(x.GoPointer()) | |
| 134 | + | ||
| 135 | + | } | |
| 136 | + | ||
| 137 | + | var xPreferencesWindowPresentSubpage func(uintptr, uintptr) | |
| 138 | + | ||
| 139 | + | // Sets @subpage as the window's subpage and opens it. | |
| 140 | + | // | |
| 141 | + | // The transition can be cancelled by the user, in which case visible child will | |
| 142 | + | // change back to the previously visible child. | |
| 143 | + | func (x *PreferencesWindow) PresentSubpage(SubpageVar *gtk.Widget) { | |
| 144 | + | ||
| 145 | + | xPreferencesWindowPresentSubpage(x.GoPointer(), SubpageVar.GoPointer()) | |
| 146 | + | ||
| 147 | + | } | |
| 148 | + | ||
| 149 | + | var xPreferencesWindowRemove func(uintptr, uintptr) | |
| 150 | + | ||
| 151 | + | // Removes a page from @self. | |
| 152 | + | func (x *PreferencesWindow) Remove(PageVar *PreferencesPage) { | |
| 153 | + | ||
| 154 | + | xPreferencesWindowRemove(x.GoPointer(), PageVar.GoPointer()) | |
| 155 | + | ||
| 156 | + | } | |
| 157 | + | ||
| 158 | + | var xPreferencesWindowSetCanNavigateBack func(uintptr, bool) | |
| 159 | + | ||
| 160 | + | // Sets whether gestures and shortcuts for closing subpages are enabled. | |
| 161 | + | // | |
| 162 | + | // The supported gestures are: | |
| 163 | + | // | |
| 164 | + | // - One-finger swipe on touchscreens | |
| 165 | + | // - Horizontal scrolling on touchpads (usually two-finger swipe) | |
| 166 | + | // - Back mouse button | |
| 167 | + | // | |
| 168 | + | // The keyboard back key is also supported, as well as the | |
| 169 | + | // <kbd>Alt</kbd>+<kbd>←</kbd> shortcut. | |
| 170 | + | // | |
| 171 | + | // For right-to-left locales, gestures and shortcuts are reversed. | |
| 172 | + | func (x *PreferencesWindow) SetCanNavigateBack(CanNavigateBackVar bool) { | |
| 173 | + | ||
| 174 | + | xPreferencesWindowSetCanNavigateBack(x.GoPointer(), CanNavigateBackVar) | |
| 175 | + | ||
| 176 | + | } | |
| 177 | + | ||
| 178 | + | var xPreferencesWindowSetSearchEnabled func(uintptr, bool) | |
| 179 | + | ||
| 180 | + | // Sets whether search is enabled for @self. | |
| 181 | + | func (x *PreferencesWindow) SetSearchEnabled(SearchEnabledVar bool) { | |
| 182 | + | ||
| 183 | + | xPreferencesWindowSetSearchEnabled(x.GoPointer(), SearchEnabledVar) | |
| 184 | + | ||
| 185 | + | } | |
| 186 | + | ||
| 187 | + | var xPreferencesWindowSetVisiblePage func(uintptr, uintptr) | |
| 188 | + | ||
| 189 | + | // Makes @page the visible page of @self. | |
| 190 | + | func (x *PreferencesWindow) SetVisiblePage(PageVar *PreferencesPage) { | |
| 191 | + | ||
| 192 | + | xPreferencesWindowSetVisiblePage(x.GoPointer(), PageVar.GoPointer()) | |
| 193 | + | ||
| 194 | + | } | |
| 195 | + | ||
| 196 | + | var xPreferencesWindowSetVisiblePageName func(uintptr, string) | |
| 197 | + | ||
| 198 | + | // Makes the page with the given name visible. | |
| 199 | + | // | |
| 200 | + | // See [property@ViewStack:visible-child]. | |
| 201 | + | func (x *PreferencesWindow) SetVisiblePageName(NameVar string) { | |
| 202 | + | ||
| 203 | + | xPreferencesWindowSetVisiblePageName(x.GoPointer(), NameVar) | |
| 204 | + | ||
| 205 | + | } | |
| 206 | + | ||
| 207 | + | func (c *PreferencesWindow) GoPointer() uintptr { | |
| 208 | + | return c.Ptr | |
| 209 | + | } | |
| 210 | + | ||
| 211 | + | func (c *PreferencesWindow) SetGoPointer(ptr uintptr) { | |
| 212 | + | c.Ptr = ptr | |
| 213 | + | } | |
| 214 | + | ||
| 215 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 216 | + | func (x *PreferencesWindow) GetAccessibleRole() gtk.AccessibleRole { | |
| 217 | + | ||
| 218 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 219 | + | ||
| 220 | + | } | |
| 221 | + | ||
| 222 | + | // Resets the accessible @property to its default value. | |
| 223 | + | func (x *PreferencesWindow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 224 | + | ||
| 225 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 226 | + | ||
| 227 | + | } | |
| 228 | + | ||
| 229 | + | // Resets the accessible @relation to its default value. | |
| 230 | + | func (x *PreferencesWindow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 231 | + | ||
| 232 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 233 | + | ||
| 234 | + | } | |
| 235 | + | ||
| 236 | + | // Resets the accessible @state to its default value. | |
| 237 | + | func (x *PreferencesWindow) ResetState(StateVar gtk.AccessibleState) { | |
| 238 | + | ||
| 239 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 240 | + | ||
| 241 | + | } | |
| 242 | + | ||
| 243 | + | // Updates a list of accessible properties. | |
| 244 | + | // | |
| 245 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 246 | + | // value types of accessible properties. | |
| 247 | + | // | |
| 248 | + | // This function should be called by `GtkWidget` types whenever | |
| 249 | + | // an accessible property change must be communicated to assistive | |
| 250 | + | // technologies. | |
| 251 | + | // | |
| 252 | + | // Example: | |
| 253 | + | // ```c | |
| 254 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 255 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 256 | + | // | |
| 257 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 258 | + | // -1); | |
| 259 | + | // | |
| 260 | + | // ``` | |
| 261 | + | func (x *PreferencesWindow) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 262 | + | ||
| 263 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 264 | + | ||
| 265 | + | } | |
| 266 | + | ||
| 267 | + | // Updates an array of accessible properties. | |
| 268 | + | // | |
| 269 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 270 | + | // property change must be communicated to assistive technologies. | |
| 271 | + | // | |
| 272 | + | // This function is meant to be used by language bindings. | |
| 273 | + | func (x *PreferencesWindow) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 274 | + | ||
| 275 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 276 | + | ||
| 277 | + | } | |
| 278 | + | ||
| 279 | + | // Updates a list of accessible relations. | |
| 280 | + | // | |
| 281 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 282 | + | // relation change must be communicated to assistive technologies. | |
| 283 | + | // | |
| 284 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 285 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 286 | + | // | |
| 287 | + | // ```c | |
| 288 | + | // gtk_accessible_update_relation (accessible, | |
| 289 | + | // | |
| 290 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 291 | + | // ref1, NULL, | |
| 292 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 293 | + | // ref1, ref2, ref3, NULL, | |
| 294 | + | // -1); | |
| 295 | + | // | |
| 296 | + | // ``` | |
| 297 | + | func (x *PreferencesWindow) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 298 | + | ||
| 299 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 300 | + | ||
| 301 | + | } | |
| 302 | + | ||
| 303 | + | // Updates an array of accessible relations. | |
| 304 | + | // | |
| 305 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 306 | + | // relation change must be communicated to assistive technologies. | |
| 307 | + | // | |
| 308 | + | // This function is meant to be used by language bindings. | |
| 309 | + | func (x *PreferencesWindow) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 310 | + | ||
| 311 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 312 | + | ||
| 313 | + | } | |
| 314 | + | ||
| 315 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 316 | + | // documentation for the value types of accessible states. | |
| 317 | + | // | |
| 318 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 319 | + | // state change must be communicated to assistive technologies. | |
| 320 | + | // | |
| 321 | + | // Example: | |
| 322 | + | // ```c | |
| 323 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 324 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 325 | + | // | |
| 326 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 327 | + | // -1); | |
| 328 | + | // | |
| 329 | + | // ``` | |
| 330 | + | func (x *PreferencesWindow) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 331 | + | ||
| 332 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 333 | + | ||
| 334 | + | } | |
| 335 | + | ||
| 336 | + | // Updates an array of accessible states. | |
| 337 | + | // | |
| 338 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 339 | + | // state change must be communicated to assistive technologies. | |
| 340 | + | // | |
| 341 | + | // This function is meant to be used by language bindings. | |
| 342 | + | func (x *PreferencesWindow) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 343 | + | ||
| 344 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 345 | + | ||
| 346 | + | } | |
| 347 | + | ||
| 348 | + | // Gets the ID of the @buildable object. | |
| 349 | + | // | |
| 350 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 351 | + | // of the <object> tag used to construct the @buildable. | |
| 352 | + | func (x *PreferencesWindow) GetBuildableId() string { | |
| 353 | + | ||
| 354 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 355 | + | ||
| 356 | + | } | |
| 357 | + | ||
| 358 | + | // Returns the renderer that is used for this `GtkNative`. | |
| 359 | + | func (x *PreferencesWindow) GetRenderer() *gsk.Renderer { | |
| 360 | + | ||
| 361 | + | GetRendererPtr := gtk.XGtkNativeGetRenderer(x.GoPointer()) | |
| 362 | + | if GetRendererPtr == 0 { | |
| 363 | + | return nil | |
| 364 | + | } | |
| 365 | + | ||
| 366 | + | gobject.IncreaseRef(GetRendererPtr) | |
| 367 | + | ||
| 368 | + | GetRendererCls := &gsk.Renderer{} | |
| 369 | + | GetRendererCls.Ptr = GetRendererPtr | |
| 370 | + | return GetRendererCls | |
| 371 | + | ||
| 372 | + | } | |
| 373 | + | ||
| 374 | + | // Returns the surface of this `GtkNative`. | |
| 375 | + | func (x *PreferencesWindow) GetSurface() *gdk.Surface { | |
| 376 | + | ||
| 377 | + | GetSurfacePtr := gtk.XGtkNativeGetSurface(x.GoPointer()) | |
| 378 | + | if GetSurfacePtr == 0 { | |
| 379 | + | return nil | |
| 380 | + | } | |
| 381 | + | ||
| 382 | + | gobject.IncreaseRef(GetSurfacePtr) | |
| 383 | + | ||
| 384 | + | GetSurfaceCls := &gdk.Surface{} | |
| 385 | + | GetSurfaceCls.Ptr = GetSurfacePtr | |
| 386 | + | return GetSurfaceCls | |
| 387 | + | ||
| 388 | + | } | |
| 389 | + | ||
| 390 | + | // Retrieves the surface transform of @self. | |
| 391 | + | // | |
| 392 | + | // This is the translation from @self's surface coordinates into | |
| 393 | + | // @self's widget coordinates. | |
| 394 | + | func (x *PreferencesWindow) GetSurfaceTransform(XVar float64, YVar float64) { | |
| 395 | + | ||
| 396 | + | gtk.XGtkNativeGetSurfaceTransform(x.GoPointer(), XVar, YVar) | |
| 397 | + | ||
| 398 | + | } | |
| 399 | + | ||
| 400 | + | // Realizes a `GtkNative`. | |
| 401 | + | // | |
| 402 | + | // This should only be used by subclasses. | |
| 403 | + | func (x *PreferencesWindow) Realize() { | |
| 404 | + | ||
| 405 | + | gtk.XGtkNativeRealize(x.GoPointer()) | |
| 406 | + | ||
| 407 | + | } | |
| 408 | + | ||
| 409 | + | // Unrealizes a `GtkNative`. | |
| 410 | + | // | |
| 411 | + | // This should only be used by subclasses. | |
| 412 | + | func (x *PreferencesWindow) Unrealize() { | |
| 413 | + | ||
| 414 | + | gtk.XGtkNativeUnrealize(x.GoPointer()) | |
| 415 | + | ||
| 416 | + | } | |
| 417 | + | ||
| 418 | + | // Returns the display that this `GtkRoot` is on. | |
| 419 | + | func (x *PreferencesWindow) GetDisplay() *gdk.Display { | |
| 420 | + | ||
| 421 | + | GetDisplayPtr := gtk.XGtkRootGetDisplay(x.GoPointer()) | |
| 422 | + | if GetDisplayPtr == 0 { | |
| 423 | + | return nil | |
| 424 | + | } | |
| 425 | + | ||
| 426 | + | gobject.IncreaseRef(GetDisplayPtr) | |
| 427 | + | ||
| 428 | + | GetDisplayCls := &gdk.Display{} | |
| 429 | + | GetDisplayCls.Ptr = GetDisplayPtr | |
| 430 | + | return GetDisplayCls | |
| 431 | + | ||
| 432 | + | } | |
| 433 | + | ||
| 434 | + | // Retrieves the current focused widget within the root. | |
| 435 | + | // | |
| 436 | + | // Note that this is the widget that would have the focus | |
| 437 | + | // if the root is active; if the root is not focused then | |
| 438 | + | // `gtk_widget_has_focus (widget)` will be %FALSE for the | |
| 439 | + | // widget. | |
| 440 | + | func (x *PreferencesWindow) GetFocus() *gtk.Widget { | |
| 441 | + | ||
| 442 | + | GetFocusPtr := gtk.XGtkRootGetFocus(x.GoPointer()) | |
| 443 | + | if GetFocusPtr == 0 { | |
| 444 | + | return nil | |
| 445 | + | } | |
| 446 | + | ||
| 447 | + | gobject.IncreaseRef(GetFocusPtr) | |
| 448 | + | ||
| 449 | + | GetFocusCls := >k.Widget{} | |
| 450 | + | GetFocusCls.Ptr = GetFocusPtr | |
| 451 | + | return GetFocusCls | |
| 452 | + | ||
| 453 | + | } | |
| 454 | + | ||
| 455 | + | // If @focus is not the current focus widget, and is focusable, sets | |
| 456 | + | // it as the focus widget for the root. | |
| 457 | + | // | |
| 458 | + | // If @focus is %NULL, unsets the focus widget for the root. | |
| 459 | + | // | |
| 460 | + | // To set the focus to a particular widget in the root, it is usually | |
| 461 | + | // more convenient to use [method@Gtk.Widget.grab_focus] instead of | |
| 462 | + | // this function. | |
| 463 | + | func (x *PreferencesWindow) SetFocus(FocusVar *gtk.Widget) { | |
| 464 | + | ||
| 465 | + | gtk.XGtkRootSetFocus(x.GoPointer(), FocusVar.GoPointer()) | |
| 466 | + | ||
| 467 | + | } | |
| 468 | + | ||
| 469 | + | func init() { | |
| 470 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 471 | + | if err != nil { | |
| 472 | + | panic(err) | |
| 473 | + | } | |
| 474 | + | ||
| 475 | + | core.PuregoSafeRegister(&xNewPreferencesWindow, lib, "adw_preferences_window_new") | |
| 476 | + | ||
| 477 | + | core.PuregoSafeRegister(&xPreferencesWindowAdd, lib, "adw_preferences_window_add") | |
| 478 | + | core.PuregoSafeRegister(&xPreferencesWindowAddToast, lib, "adw_preferences_window_add_toast") | |
| 479 | + | core.PuregoSafeRegister(&xPreferencesWindowCloseSubpage, lib, "adw_preferences_window_close_subpage") | |
| 480 | + | core.PuregoSafeRegister(&xPreferencesWindowGetCanNavigateBack, lib, "adw_preferences_window_get_can_navigate_back") | |
| 481 | + | core.PuregoSafeRegister(&xPreferencesWindowGetSearchEnabled, lib, "adw_preferences_window_get_search_enabled") | |
| 482 | + | core.PuregoSafeRegister(&xPreferencesWindowGetVisiblePage, lib, "adw_preferences_window_get_visible_page") | |
| 483 | + | core.PuregoSafeRegister(&xPreferencesWindowGetVisiblePageName, lib, "adw_preferences_window_get_visible_page_name") | |
| 484 | + | core.PuregoSafeRegister(&xPreferencesWindowPresentSubpage, lib, "adw_preferences_window_present_subpage") | |
| 485 | + | core.PuregoSafeRegister(&xPreferencesWindowRemove, lib, "adw_preferences_window_remove") | |
| 486 | + | core.PuregoSafeRegister(&xPreferencesWindowSetCanNavigateBack, lib, "adw_preferences_window_set_can_navigate_back") | |
| 487 | + | core.PuregoSafeRegister(&xPreferencesWindowSetSearchEnabled, lib, "adw_preferences_window_set_search_enabled") | |
| 488 | + | core.PuregoSafeRegister(&xPreferencesWindowSetVisiblePage, lib, "adw_preferences_window_set_visible_page") | |
| 489 | + | core.PuregoSafeRegister(&xPreferencesWindowSetVisiblePageName, lib, "adw_preferences_window_set_visible_page_name") | |
| 490 | + | ||
| 491 | + | } | |
A v4/adw/adw-split-button.go +594 -0
| @@ -0,0 +1,594 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gio" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 11 | + | ) | |
| 12 | + | ||
| 13 | + | type SplitButtonClass struct { | |
| 14 | + | ParentClass uintptr | |
| 15 | + | } | |
| 16 | + | ||
| 17 | + | // A combined button and dropdown widget. | |
| 18 | + | // | |
| 19 | + | // <picture> | |
| 20 | + | // | |
| 21 | + | // <source srcset="split-button-dark.png" media="(prefers-color-scheme: dark)"> | |
| 22 | + | // <img src="split-button.png" alt="split-button"> | |
| 23 | + | // | |
| 24 | + | // </picture> | |
| 25 | + | // | |
| 26 | + | // `AdwSplitButton` is typically used to present a set of actions in a menu, | |
| 27 | + | // but allow access to one of them with a single click. | |
| 28 | + | // | |
| 29 | + | // The API is very similar to [class@Gtk.Button] and [class@Gtk.MenuButton], see | |
| 30 | + | // their documentation for details. | |
| 31 | + | // | |
| 32 | + | // ## CSS nodes | |
| 33 | + | // | |
| 34 | + | // ``` | |
| 35 | + | // splitbutton[.image-button][.text-button] | |
| 36 | + | // ├── button | |
| 37 | + | // │ ╰── <content> | |
| 38 | + | // ├── separator | |
| 39 | + | // ╰── menubutton | |
| 40 | + | // | |
| 41 | + | // ╰── button.toggle | |
| 42 | + | // ╰── arrow | |
| 43 | + | // | |
| 44 | + | // ``` | |
| 45 | + | // | |
| 46 | + | // `AdwSplitButton`'s CSS node is called `splitbutton`. It contains the css | |
| 47 | + | // nodes: `button`, `separator`, `menubutton`. See [class@Gtk.MenuButton] | |
| 48 | + | // documentation for the `menubutton` contents. | |
| 49 | + | // | |
| 50 | + | // The main CSS node will contain the `.image-button` or `.text-button` style | |
| 51 | + | // classes matching the button contents. The nested button nodes will never | |
| 52 | + | // contain them. | |
| 53 | + | // | |
| 54 | + | // ## Accessibility | |
| 55 | + | // | |
| 56 | + | // `AdwSplitButton` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role. | |
| 57 | + | type SplitButton struct { | |
| 58 | + | gtk.Widget | |
| 59 | + | } | |
| 60 | + | ||
| 61 | + | func SplitButtonNewFromInternalPtr(ptr uintptr) *SplitButton { | |
| 62 | + | cls := &SplitButton{} | |
| 63 | + | cls.Ptr = ptr | |
| 64 | + | return cls | |
| 65 | + | } | |
| 66 | + | ||
| 67 | + | var xNewSplitButton func() uintptr | |
| 68 | + | ||
| 69 | + | // Creates a new `AdwSplitButton`. | |
| 70 | + | func NewSplitButton() *gtk.Widget { | |
| 71 | + | NewSplitButtonPtr := xNewSplitButton() | |
| 72 | + | if NewSplitButtonPtr == 0 { | |
| 73 | + | return nil | |
| 74 | + | } | |
| 75 | + | ||
| 76 | + | gobject.IncreaseRef(NewSplitButtonPtr) | |
| 77 | + | ||
| 78 | + | NewSplitButtonCls := >k.Widget{} | |
| 79 | + | NewSplitButtonCls.Ptr = NewSplitButtonPtr | |
| 80 | + | return NewSplitButtonCls | |
| 81 | + | } | |
| 82 | + | ||
| 83 | + | var xSplitButtonGetChild func(uintptr) uintptr | |
| 84 | + | ||
| 85 | + | // Gets the child widget. | |
| 86 | + | func (x *SplitButton) GetChild() *gtk.Widget { | |
| 87 | + | ||
| 88 | + | GetChildPtr := xSplitButtonGetChild(x.GoPointer()) | |
| 89 | + | if GetChildPtr == 0 { | |
| 90 | + | return nil | |
| 91 | + | } | |
| 92 | + | ||
| 93 | + | gobject.IncreaseRef(GetChildPtr) | |
| 94 | + | ||
| 95 | + | GetChildCls := >k.Widget{} | |
| 96 | + | GetChildCls.Ptr = GetChildPtr | |
| 97 | + | return GetChildCls | |
| 98 | + | ||
| 99 | + | } | |
| 100 | + | ||
| 101 | + | var xSplitButtonGetDirection func(uintptr) gtk.ArrowType | |
| 102 | + | ||
| 103 | + | // Gets the direction in which the popup will be popped up. | |
| 104 | + | func (x *SplitButton) GetDirection() gtk.ArrowType { | |
| 105 | + | ||
| 106 | + | return xSplitButtonGetDirection(x.GoPointer()) | |
| 107 | + | ||
| 108 | + | } | |
| 109 | + | ||
| 110 | + | var xSplitButtonGetDropdownTooltip func(uintptr) string | |
| 111 | + | ||
| 112 | + | // Gets the tooltip of the dropdown button of @self. | |
| 113 | + | func (x *SplitButton) GetDropdownTooltip() string { | |
| 114 | + | ||
| 115 | + | return xSplitButtonGetDropdownTooltip(x.GoPointer()) | |
| 116 | + | ||
| 117 | + | } | |
| 118 | + | ||
| 119 | + | var xSplitButtonGetIconName func(uintptr) string | |
| 120 | + | ||
| 121 | + | // Gets the name of the icon used to automatically populate the button. | |
| 122 | + | func (x *SplitButton) GetIconName() string { | |
| 123 | + | ||
| 124 | + | return xSplitButtonGetIconName(x.GoPointer()) | |
| 125 | + | ||
| 126 | + | } | |
| 127 | + | ||
| 128 | + | var xSplitButtonGetLabel func(uintptr) string | |
| 129 | + | ||
| 130 | + | // Gets the label for @self. | |
| 131 | + | func (x *SplitButton) GetLabel() string { | |
| 132 | + | ||
| 133 | + | return xSplitButtonGetLabel(x.GoPointer()) | |
| 134 | + | ||
| 135 | + | } | |
| 136 | + | ||
| 137 | + | var xSplitButtonGetMenuModel func(uintptr) uintptr | |
| 138 | + | ||
| 139 | + | // Gets the menu model from which the popup will be created. | |
| 140 | + | func (x *SplitButton) GetMenuModel() *gio.MenuModel { | |
| 141 | + | ||
| 142 | + | GetMenuModelPtr := xSplitButtonGetMenuModel(x.GoPointer()) | |
| 143 | + | if GetMenuModelPtr == 0 { | |
| 144 | + | return nil | |
| 145 | + | } | |
| 146 | + | ||
| 147 | + | gobject.IncreaseRef(GetMenuModelPtr) | |
| 148 | + | ||
| 149 | + | GetMenuModelCls := &gio.MenuModel{} | |
| 150 | + | GetMenuModelCls.Ptr = GetMenuModelPtr | |
| 151 | + | return GetMenuModelCls | |
| 152 | + | ||
| 153 | + | } | |
| 154 | + | ||
| 155 | + | var xSplitButtonGetPopover func(uintptr) uintptr | |
| 156 | + | ||
| 157 | + | // Gets the popover that will be popped up when the dropdown is clicked. | |
| 158 | + | func (x *SplitButton) GetPopover() *gtk.Popover { | |
| 159 | + | ||
| 160 | + | GetPopoverPtr := xSplitButtonGetPopover(x.GoPointer()) | |
| 161 | + | if GetPopoverPtr == 0 { | |
| 162 | + | return nil | |
| 163 | + | } | |
| 164 | + | ||
| 165 | + | gobject.IncreaseRef(GetPopoverPtr) | |
| 166 | + | ||
| 167 | + | GetPopoverCls := >k.Popover{} | |
| 168 | + | GetPopoverCls.Ptr = GetPopoverPtr | |
| 169 | + | return GetPopoverCls | |
| 170 | + | ||
| 171 | + | } | |
| 172 | + | ||
| 173 | + | var xSplitButtonGetUseUnderline func(uintptr) bool | |
| 174 | + | ||
| 175 | + | // Gets whether an underline in the text indicates a mnemonic. | |
| 176 | + | func (x *SplitButton) GetUseUnderline() bool { | |
| 177 | + | ||
| 178 | + | return xSplitButtonGetUseUnderline(x.GoPointer()) | |
| 179 | + | ||
| 180 | + | } | |
| 181 | + | ||
| 182 | + | var xSplitButtonPopdown func(uintptr) | |
| 183 | + | ||
| 184 | + | // Dismisses the menu. | |
| 185 | + | func (x *SplitButton) Popdown() { | |
| 186 | + | ||
| 187 | + | xSplitButtonPopdown(x.GoPointer()) | |
| 188 | + | ||
| 189 | + | } | |
| 190 | + | ||
| 191 | + | var xSplitButtonPopup func(uintptr) | |
| 192 | + | ||
| 193 | + | // Pops up the menu. | |
| 194 | + | func (x *SplitButton) Popup() { | |
| 195 | + | ||
| 196 | + | xSplitButtonPopup(x.GoPointer()) | |
| 197 | + | ||
| 198 | + | } | |
| 199 | + | ||
| 200 | + | var xSplitButtonSetChild func(uintptr, uintptr) | |
| 201 | + | ||
| 202 | + | // Sets the child widget. | |
| 203 | + | // | |
| 204 | + | // Setting the child widget will set [property@SplitButton:label] and | |
| 205 | + | // [property@SplitButton:icon-name] to `NULL`. | |
| 206 | + | func (x *SplitButton) SetChild(ChildVar *gtk.Widget) { | |
| 207 | + | ||
| 208 | + | xSplitButtonSetChild(x.GoPointer(), ChildVar.GoPointer()) | |
| 209 | + | ||
| 210 | + | } | |
| 211 | + | ||
| 212 | + | var xSplitButtonSetDirection func(uintptr, gtk.ArrowType) | |
| 213 | + | ||
| 214 | + | // Sets the direction in which the popup will be popped up. | |
| 215 | + | // | |
| 216 | + | // The dropdown arrow icon will point at the same direction. | |
| 217 | + | // | |
| 218 | + | // If the does not fit in the available space in the given direction, GTK will | |
| 219 | + | // try its best to keep it inside the screen and fully visible. | |
| 220 | + | // | |
| 221 | + | // If you pass `GTK_ARROW_NONE`, it's equivalent to `GTK_ARROW_DOWN`. | |
| 222 | + | func (x *SplitButton) SetDirection(DirectionVar gtk.ArrowType) { | |
| 223 | + | ||
| 224 | + | xSplitButtonSetDirection(x.GoPointer(), DirectionVar) | |
| 225 | + | ||
| 226 | + | } | |
| 227 | + | ||
| 228 | + | var xSplitButtonSetDropdownTooltip func(uintptr, string) | |
| 229 | + | ||
| 230 | + | // Sets the tooltip of the dropdown button of @self. | |
| 231 | + | // | |
| 232 | + | // The tooltip can be marked up with the Pango text markup language. | |
| 233 | + | func (x *SplitButton) SetDropdownTooltip(TooltipVar string) { | |
| 234 | + | ||
| 235 | + | xSplitButtonSetDropdownTooltip(x.GoPointer(), TooltipVar) | |
| 236 | + | ||
| 237 | + | } | |
| 238 | + | ||
| 239 | + | var xSplitButtonSetIconName func(uintptr, string) | |
| 240 | + | ||
| 241 | + | // Sets the name of the icon used to automatically populate the button. | |
| 242 | + | // | |
| 243 | + | // Setting the icon name will set [property@SplitButton:label] and | |
| 244 | + | // [property@SplitButton:child] to `NULL`. | |
| 245 | + | func (x *SplitButton) SetIconName(IconNameVar string) { | |
| 246 | + | ||
| 247 | + | xSplitButtonSetIconName(x.GoPointer(), IconNameVar) | |
| 248 | + | ||
| 249 | + | } | |
| 250 | + | ||
| 251 | + | var xSplitButtonSetLabel func(uintptr, string) | |
| 252 | + | ||
| 253 | + | // Sets the label for @self. | |
| 254 | + | // | |
| 255 | + | // Setting the label will set [property@SplitButton:icon-name] and | |
| 256 | + | // [property@SplitButton:child] to `NULL`. | |
| 257 | + | func (x *SplitButton) SetLabel(LabelVar string) { | |
| 258 | + | ||
| 259 | + | xSplitButtonSetLabel(x.GoPointer(), LabelVar) | |
| 260 | + | ||
| 261 | + | } | |
| 262 | + | ||
| 263 | + | var xSplitButtonSetMenuModel func(uintptr, uintptr) | |
| 264 | + | ||
| 265 | + | // Sets the menu model from which the popup will be created. | |
| 266 | + | // | |
| 267 | + | // If the menu model is `NULL`, the dropdown is disabled. | |
| 268 | + | // | |
| 269 | + | // A [class@Gtk.Popover] will be created from the menu model with | |
| 270 | + | // [ctor@Gtk.PopoverMenu.new_from_model]. Actions will be connected as | |
| 271 | + | // documented for this function. | |
| 272 | + | // | |
| 273 | + | // If [property@SplitButton:popover] is already set, it will be dissociated from | |
| 274 | + | // the button, and the property is set to `NULL`. | |
| 275 | + | func (x *SplitButton) SetMenuModel(MenuModelVar *gio.MenuModel) { | |
| 276 | + | ||
| 277 | + | xSplitButtonSetMenuModel(x.GoPointer(), MenuModelVar.GoPointer()) | |
| 278 | + | ||
| 279 | + | } | |
| 280 | + | ||
| 281 | + | var xSplitButtonSetPopover func(uintptr, uintptr) | |
| 282 | + | ||
| 283 | + | // Sets the popover that will be popped up when the dropdown is clicked. | |
| 284 | + | // | |
| 285 | + | // If the popover is `NULL`, the dropdown is disabled. | |
| 286 | + | // | |
| 287 | + | // If [property@SplitButton:menu-model] is set, the menu model is dissociated | |
| 288 | + | // from the button, and the property is set to `NULL`. | |
| 289 | + | func (x *SplitButton) SetPopover(PopoverVar *gtk.Popover) { | |
| 290 | + | ||
| 291 | + | xSplitButtonSetPopover(x.GoPointer(), PopoverVar.GoPointer()) | |
| 292 | + | ||
| 293 | + | } | |
| 294 | + | ||
| 295 | + | var xSplitButtonSetUseUnderline func(uintptr, bool) | |
| 296 | + | ||
| 297 | + | // Sets whether an underline in the text indicates a mnemonic. | |
| 298 | + | // | |
| 299 | + | // See [property@SplitButton:label]. | |
| 300 | + | func (x *SplitButton) SetUseUnderline(UseUnderlineVar bool) { | |
| 301 | + | ||
| 302 | + | xSplitButtonSetUseUnderline(x.GoPointer(), UseUnderlineVar) | |
| 303 | + | ||
| 304 | + | } | |
| 305 | + | ||
| 306 | + | func (c *SplitButton) GoPointer() uintptr { | |
| 307 | + | return c.Ptr | |
| 308 | + | } | |
| 309 | + | ||
| 310 | + | func (c *SplitButton) SetGoPointer(ptr uintptr) { | |
| 311 | + | c.Ptr = ptr | |
| 312 | + | } | |
| 313 | + | ||
| 314 | + | // Emitted to animate press then release. | |
| 315 | + | // | |
| 316 | + | // This is an action signal. Applications should never connect to this signal, | |
| 317 | + | // but use the [signal@SplitButton::clicked] signal. | |
| 318 | + | func (x *SplitButton) ConnectActivate(cb func(SplitButton)) { | |
| 319 | + | fcb := func(clsPtr uintptr) { | |
| 320 | + | fa := SplitButton{} | |
| 321 | + | fa.Ptr = clsPtr | |
| 322 | + | ||
| 323 | + | cb(fa) | |
| 324 | + | ||
| 325 | + | } | |
| 326 | + | gobject.ObjectConnect(x.GoPointer(), "signal::activate", purego.NewCallback(fcb)) | |
| 327 | + | } | |
| 328 | + | ||
| 329 | + | // Emitted when the button has been activated (pressed and released). | |
| 330 | + | func (x *SplitButton) ConnectClicked(cb func(SplitButton)) { | |
| 331 | + | fcb := func(clsPtr uintptr) { | |
| 332 | + | fa := SplitButton{} | |
| 333 | + | fa.Ptr = clsPtr | |
| 334 | + | ||
| 335 | + | cb(fa) | |
| 336 | + | ||
| 337 | + | } | |
| 338 | + | gobject.ObjectConnect(x.GoPointer(), "signal::clicked", purego.NewCallback(fcb)) | |
| 339 | + | } | |
| 340 | + | ||
| 341 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 342 | + | func (x *SplitButton) GetAccessibleRole() gtk.AccessibleRole { | |
| 343 | + | ||
| 344 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 345 | + | ||
| 346 | + | } | |
| 347 | + | ||
| 348 | + | // Resets the accessible @property to its default value. | |
| 349 | + | func (x *SplitButton) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 350 | + | ||
| 351 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 352 | + | ||
| 353 | + | } | |
| 354 | + | ||
| 355 | + | // Resets the accessible @relation to its default value. | |
| 356 | + | func (x *SplitButton) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 357 | + | ||
| 358 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 359 | + | ||
| 360 | + | } | |
| 361 | + | ||
| 362 | + | // Resets the accessible @state to its default value. | |
| 363 | + | func (x *SplitButton) ResetState(StateVar gtk.AccessibleState) { | |
| 364 | + | ||
| 365 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 366 | + | ||
| 367 | + | } | |
| 368 | + | ||
| 369 | + | // Updates a list of accessible properties. | |
| 370 | + | // | |
| 371 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 372 | + | // value types of accessible properties. | |
| 373 | + | // | |
| 374 | + | // This function should be called by `GtkWidget` types whenever | |
| 375 | + | // an accessible property change must be communicated to assistive | |
| 376 | + | // technologies. | |
| 377 | + | // | |
| 378 | + | // Example: | |
| 379 | + | // ```c | |
| 380 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 381 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 382 | + | // | |
| 383 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 384 | + | // -1); | |
| 385 | + | // | |
| 386 | + | // ``` | |
| 387 | + | func (x *SplitButton) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 388 | + | ||
| 389 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 390 | + | ||
| 391 | + | } | |
| 392 | + | ||
| 393 | + | // Updates an array of accessible properties. | |
| 394 | + | // | |
| 395 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 396 | + | // property change must be communicated to assistive technologies. | |
| 397 | + | // | |
| 398 | + | // This function is meant to be used by language bindings. | |
| 399 | + | func (x *SplitButton) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 400 | + | ||
| 401 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 402 | + | ||
| 403 | + | } | |
| 404 | + | ||
| 405 | + | // Updates a list of accessible relations. | |
| 406 | + | // | |
| 407 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 408 | + | // relation change must be communicated to assistive technologies. | |
| 409 | + | // | |
| 410 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 411 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 412 | + | // | |
| 413 | + | // ```c | |
| 414 | + | // gtk_accessible_update_relation (accessible, | |
| 415 | + | // | |
| 416 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 417 | + | // ref1, NULL, | |
| 418 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 419 | + | // ref1, ref2, ref3, NULL, | |
| 420 | + | // -1); | |
| 421 | + | // | |
| 422 | + | // ``` | |
| 423 | + | func (x *SplitButton) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 424 | + | ||
| 425 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 426 | + | ||
| 427 | + | } | |
| 428 | + | ||
| 429 | + | // Updates an array of accessible relations. | |
| 430 | + | // | |
| 431 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 432 | + | // relation change must be communicated to assistive technologies. | |
| 433 | + | // | |
| 434 | + | // This function is meant to be used by language bindings. | |
| 435 | + | func (x *SplitButton) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 436 | + | ||
| 437 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 438 | + | ||
| 439 | + | } | |
| 440 | + | ||
| 441 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 442 | + | // documentation for the value types of accessible states. | |
| 443 | + | // | |
| 444 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 445 | + | // state change must be communicated to assistive technologies. | |
| 446 | + | // | |
| 447 | + | // Example: | |
| 448 | + | // ```c | |
| 449 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 450 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 451 | + | // | |
| 452 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 453 | + | // -1); | |
| 454 | + | // | |
| 455 | + | // ``` | |
| 456 | + | func (x *SplitButton) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 457 | + | ||
| 458 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 459 | + | ||
| 460 | + | } | |
| 461 | + | ||
| 462 | + | // Updates an array of accessible states. | |
| 463 | + | // | |
| 464 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 465 | + | // state change must be communicated to assistive technologies. | |
| 466 | + | // | |
| 467 | + | // This function is meant to be used by language bindings. | |
| 468 | + | func (x *SplitButton) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 469 | + | ||
| 470 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 471 | + | ||
| 472 | + | } | |
| 473 | + | ||
| 474 | + | // Gets the action name for @actionable. | |
| 475 | + | func (x *SplitButton) GetActionName() string { | |
| 476 | + | ||
| 477 | + | return gtk.XGtkActionableGetActionName(x.GoPointer()) | |
| 478 | + | ||
| 479 | + | } | |
| 480 | + | ||
| 481 | + | // Gets the current target value of @actionable. | |
| 482 | + | func (x *SplitButton) GetActionTargetValue() *glib.Variant { | |
| 483 | + | ||
| 484 | + | return gtk.XGtkActionableGetActionTargetValue(x.GoPointer()) | |
| 485 | + | ||
| 486 | + | } | |
| 487 | + | ||
| 488 | + | // Specifies the name of the action with which this widget should be | |
| 489 | + | // associated. | |
| 490 | + | // | |
| 491 | + | // If @action_name is %NULL then the widget will be unassociated from | |
| 492 | + | // any previous action. | |
| 493 | + | // | |
| 494 | + | // Usually this function is used when the widget is located (or will be | |
| 495 | + | // located) within the hierarchy of a `GtkApplicationWindow`. | |
| 496 | + | // | |
| 497 | + | // Names are of the form “win.save” or “app.quit” for actions on the | |
| 498 | + | // containing [class@ApplicationWindow] or its associated [class@Application], | |
| 499 | + | // respectively. This is the same form used for actions in the [class@Gio.Menu] | |
| 500 | + | // associated with the window. | |
| 501 | + | func (x *SplitButton) SetActionName(ActionNameVar string) { | |
| 502 | + | ||
| 503 | + | gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVar) | |
| 504 | + | ||
| 505 | + | } | |
| 506 | + | ||
| 507 | + | // Sets the target of an actionable widget. | |
| 508 | + | // | |
| 509 | + | // This is a convenience function that calls [ctor@GLib.Variant.new] for | |
| 510 | + | // @format_string and uses the result to call | |
| 511 | + | // [method@Gtk.Actionable.set_action_target_value]. | |
| 512 | + | // | |
| 513 | + | // If you are setting a string-valued target and want to set | |
| 514 | + | // the action name at the same time, you can use | |
| 515 | + | // [method@Gtk.Actionable.set_detailed_action_name]. | |
| 516 | + | func (x *SplitButton) SetActionTarget(FormatStringVar string, varArgs ...interface{}) { | |
| 517 | + | ||
| 518 | + | gtk.XGtkActionableSetActionTarget(x.GoPointer(), FormatStringVar, varArgs...) | |
| 519 | + | ||
| 520 | + | } | |
| 521 | + | ||
| 522 | + | // Sets the target value of an actionable widget. | |
| 523 | + | // | |
| 524 | + | // If @target_value is %NULL then the target value is unset. | |
| 525 | + | // | |
| 526 | + | // The target value has two purposes. First, it is used as the parameter | |
| 527 | + | // to activation of the action associated with the `GtkActionable` widget. | |
| 528 | + | // Second, it is used to determine if the widget should be rendered as | |
| 529 | + | // “active” — the widget is active if the state is equal to the given target. | |
| 530 | + | // | |
| 531 | + | // Consider the example of associating a set of buttons with a [iface@Gio.Action] | |
| 532 | + | // with string state in a typical “radio button” situation. Each button | |
| 533 | + | // will be associated with the same action, but with a different target | |
| 534 | + | // value for that action. Clicking on a particular button will activate | |
| 535 | + | // the action with the target of that button, which will typically cause | |
| 536 | + | // the action’s state to change to that value. Since the action’s state | |
| 537 | + | // is now equal to the target value of the button, the button will now | |
| 538 | + | // be rendered as active (and the other buttons, with different targets, | |
| 539 | + | // rendered inactive). | |
| 540 | + | func (x *SplitButton) SetActionTargetValue(TargetValueVar *glib.Variant) { | |
| 541 | + | ||
| 542 | + | gtk.XGtkActionableSetActionTargetValue(x.GoPointer(), TargetValueVar) | |
| 543 | + | ||
| 544 | + | } | |
| 545 | + | ||
| 546 | + | // Sets the action-name and associated string target value of an | |
| 547 | + | // actionable widget. | |
| 548 | + | // | |
| 549 | + | // @detailed_action_name is a string in the format accepted by | |
| 550 | + | // [func@Gio.Action.parse_detailed_name]. | |
| 551 | + | func (x *SplitButton) SetDetailedActionName(DetailedActionNameVar string) { | |
| 552 | + | ||
| 553 | + | gtk.XGtkActionableSetDetailedActionName(x.GoPointer(), DetailedActionNameVar) | |
| 554 | + | ||
| 555 | + | } | |
| 556 | + | ||
| 557 | + | // Gets the ID of the @buildable object. | |
| 558 | + | // | |
| 559 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 560 | + | // of the <object> tag used to construct the @buildable. | |
| 561 | + | func (x *SplitButton) GetBuildableId() string { | |
| 562 | + | ||
| 563 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 564 | + | ||
| 565 | + | } | |
| 566 | + | ||
| 567 | + | func init() { | |
| 568 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 569 | + | if err != nil { | |
| 570 | + | panic(err) | |
| 571 | + | } | |
| 572 | + | ||
| 573 | + | core.PuregoSafeRegister(&xNewSplitButton, lib, "adw_split_button_new") | |
| 574 | + | ||
| 575 | + | core.PuregoSafeRegister(&xSplitButtonGetChild, lib, "adw_split_button_get_child") | |
| 576 | + | core.PuregoSafeRegister(&xSplitButtonGetDirection, lib, "adw_split_button_get_direction") | |
| 577 | + | core.PuregoSafeRegister(&xSplitButtonGetDropdownTooltip, lib, "adw_split_button_get_dropdown_tooltip") | |
| 578 | + | core.PuregoSafeRegister(&xSplitButtonGetIconName, lib, "adw_split_button_get_icon_name") | |
| 579 | + | core.PuregoSafeRegister(&xSplitButtonGetLabel, lib, "adw_split_button_get_label") | |
| 580 | + | core.PuregoSafeRegister(&xSplitButtonGetMenuModel, lib, "adw_split_button_get_menu_model") | |
| 581 | + | core.PuregoSafeRegister(&xSplitButtonGetPopover, lib, "adw_split_button_get_popover") | |
| 582 | + | core.PuregoSafeRegister(&xSplitButtonGetUseUnderline, lib, "adw_split_button_get_use_underline") | |
| 583 | + | core.PuregoSafeRegister(&xSplitButtonPopdown, lib, "adw_split_button_popdown") | |
| 584 | + | core.PuregoSafeRegister(&xSplitButtonPopup, lib, "adw_split_button_popup") | |
| 585 | + | core.PuregoSafeRegister(&xSplitButtonSetChild, lib, "adw_split_button_set_child") | |
| 586 | + | core.PuregoSafeRegister(&xSplitButtonSetDirection, lib, "adw_split_button_set_direction") | |
| 587 | + | core.PuregoSafeRegister(&xSplitButtonSetDropdownTooltip, lib, "adw_split_button_set_dropdown_tooltip") | |
| 588 | + | core.PuregoSafeRegister(&xSplitButtonSetIconName, lib, "adw_split_button_set_icon_name") | |
| 589 | + | core.PuregoSafeRegister(&xSplitButtonSetLabel, lib, "adw_split_button_set_label") | |
| 590 | + | core.PuregoSafeRegister(&xSplitButtonSetMenuModel, lib, "adw_split_button_set_menu_model") | |
| 591 | + | core.PuregoSafeRegister(&xSplitButtonSetPopover, lib, "adw_split_button_set_popover") | |
| 592 | + | core.PuregoSafeRegister(&xSplitButtonSetUseUnderline, lib, "adw_split_button_set_use_underline") | |
| 593 | + | ||
| 594 | + | } | |
A v4/adw/adw-spring-animation.go +288 -0
| @@ -0,0 +1,288 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | type SpringAnimationClass struct { | |
| 12 | + | } | |
| 13 | + | ||
| 14 | + | // A spring-based [class@Animation]. | |
| 15 | + | // | |
| 16 | + | // `AdwSpringAnimation` implements an animation driven by a physical model of a | |
| 17 | + | // spring described by [struct@SpringParams], with a resting position in | |
| 18 | + | // [property@SpringAnimation:value-to], stretched to | |
| 19 | + | // [property@SpringAnimation:value-from]. | |
| 20 | + | // | |
| 21 | + | // Since the animation is physically simulated, spring animations don't have a | |
| 22 | + | // fixed duration. The animation will stop when the simulated spring comes to a | |
| 23 | + | // rest - when the amplitude of the oscillations becomes smaller than | |
| 24 | + | // [property@SpringAnimation:epsilon], or immediately when it reaches | |
| 25 | + | // [property@SpringAnimation:value-to] if | |
| 26 | + | // [property@SpringAnimation:clamp] is set to `TRUE`. The estimated duration can | |
| 27 | + | // be obtained with [property@SpringAnimation:estimated-duration]. | |
| 28 | + | // | |
| 29 | + | // Due to the nature of spring-driven motion the animation can overshoot | |
| 30 | + | // [property@SpringAnimation:value-to] before coming to a rest. Whether the | |
| 31 | + | // animation will overshoot or not depends on the damping ratio of the spring. | |
| 32 | + | // See [struct@SpringParams] for more information about specific damping ratio | |
| 33 | + | // values. | |
| 34 | + | // | |
| 35 | + | // If [property@SpringAnimation:clamp] is `TRUE`, the animation will abruptly | |
| 36 | + | // end as soon as it reaches the final value, preventing overshooting. | |
| 37 | + | // | |
| 38 | + | // Animations can have an initial velocity value, set via | |
| 39 | + | // [property@SpringAnimation:initial-velocity], which adjusts the curve without | |
| 40 | + | // changing the duration. This makes spring animations useful for deceleration | |
| 41 | + | // at the end of gestures. | |
| 42 | + | // | |
| 43 | + | // If the initial and final values are equal, and the initial velocity is not 0, | |
| 44 | + | // the animation value will bounce and return to its resting position. | |
| 45 | + | type SpringAnimation struct { | |
| 46 | + | Animation | |
| 47 | + | } | |
| 48 | + | ||
| 49 | + | func SpringAnimationNewFromInternalPtr(ptr uintptr) *SpringAnimation { | |
| 50 | + | cls := &SpringAnimation{} | |
| 51 | + | cls.Ptr = ptr | |
| 52 | + | return cls | |
| 53 | + | } | |
| 54 | + | ||
| 55 | + | var xNewSpringAnimation func(uintptr, float64, float64, *SpringParams, uintptr) uintptr | |
| 56 | + | ||
| 57 | + | // Creates a new `AdwSpringAnimation` on @widget. | |
| 58 | + | // | |
| 59 | + | // The animation will animate @target from @from to @to with the dynamics of a | |
| 60 | + | // spring described by @spring_params. | |
| 61 | + | func NewSpringAnimation(WidgetVar *gtk.Widget, FromVar float64, ToVar float64, SpringParamsVar *SpringParams, TargetVar *AnimationTarget) *Animation { | |
| 62 | + | NewSpringAnimationPtr := xNewSpringAnimation(WidgetVar.GoPointer(), FromVar, ToVar, SpringParamsVar, TargetVar.GoPointer()) | |
| 63 | + | if NewSpringAnimationPtr == 0 { | |
| 64 | + | return nil | |
| 65 | + | } | |
| 66 | + | ||
| 67 | + | gobject.IncreaseRef(NewSpringAnimationPtr) | |
| 68 | + | ||
| 69 | + | NewSpringAnimationCls := &Animation{} | |
| 70 | + | NewSpringAnimationCls.Ptr = NewSpringAnimationPtr | |
| 71 | + | return NewSpringAnimationCls | |
| 72 | + | } | |
| 73 | + | ||
| 74 | + | var xSpringAnimationCalculateValue func(uintptr, uint) float64 | |
| 75 | + | ||
| 76 | + | // Calculates the value @self will have at @time. | |
| 77 | + | // | |
| 78 | + | // The time starts at 0 and ends at | |
| 79 | + | // [property@SpringAnimation:estimated_duration]. | |
| 80 | + | // | |
| 81 | + | // See also [method@SpringAnimation.calculate_velocity]. | |
| 82 | + | func (x *SpringAnimation) CalculateValue(TimeVar uint) float64 { | |
| 83 | + | ||
| 84 | + | return xSpringAnimationCalculateValue(x.GoPointer(), TimeVar) | |
| 85 | + | ||
| 86 | + | } | |
| 87 | + | ||
| 88 | + | var xSpringAnimationCalculateVelocity func(uintptr, uint) float64 | |
| 89 | + | ||
| 90 | + | // Calculates the velocity @self will have at @time. | |
| 91 | + | // | |
| 92 | + | // The time starts at 0 and ends at | |
| 93 | + | // [property@SpringAnimation:estimated_duration]. | |
| 94 | + | // | |
| 95 | + | // See also [method@SpringAnimation.calculate_value]. | |
| 96 | + | func (x *SpringAnimation) CalculateVelocity(TimeVar uint) float64 { | |
| 97 | + | ||
| 98 | + | return xSpringAnimationCalculateVelocity(x.GoPointer(), TimeVar) | |
| 99 | + | ||
| 100 | + | } | |
| 101 | + | ||
| 102 | + | var xSpringAnimationGetClamp func(uintptr) bool | |
| 103 | + | ||
| 104 | + | // Gets whether @self should be clamped. | |
| 105 | + | func (x *SpringAnimation) GetClamp() bool { | |
| 106 | + | ||
| 107 | + | return xSpringAnimationGetClamp(x.GoPointer()) | |
| 108 | + | ||
| 109 | + | } | |
| 110 | + | ||
| 111 | + | var xSpringAnimationGetEpsilon func(uintptr) float64 | |
| 112 | + | ||
| 113 | + | // Gets the precision of the spring. | |
| 114 | + | func (x *SpringAnimation) GetEpsilon() float64 { | |
| 115 | + | ||
| 116 | + | return xSpringAnimationGetEpsilon(x.GoPointer()) | |
| 117 | + | ||
| 118 | + | } | |
| 119 | + | ||
| 120 | + | var xSpringAnimationGetEstimatedDuration func(uintptr) uint | |
| 121 | + | ||
| 122 | + | // Gets the estimated duration of @self, in milliseconds. | |
| 123 | + | // | |
| 124 | + | // Can be [const@DURATION_INFINITE] if the spring damping is set to 0. | |
| 125 | + | func (x *SpringAnimation) GetEstimatedDuration() uint { | |
| 126 | + | ||
| 127 | + | return xSpringAnimationGetEstimatedDuration(x.GoPointer()) | |
| 128 | + | ||
| 129 | + | } | |
| 130 | + | ||
| 131 | + | var xSpringAnimationGetInitialVelocity func(uintptr) float64 | |
| 132 | + | ||
| 133 | + | // Gets the initial velocity of @self. | |
| 134 | + | func (x *SpringAnimation) GetInitialVelocity() float64 { | |
| 135 | + | ||
| 136 | + | return xSpringAnimationGetInitialVelocity(x.GoPointer()) | |
| 137 | + | ||
| 138 | + | } | |
| 139 | + | ||
| 140 | + | var xSpringAnimationGetSpringParams func(uintptr) *SpringParams | |
| 141 | + | ||
| 142 | + | // Gets the physical parameters of the spring of @self. | |
| 143 | + | func (x *SpringAnimation) GetSpringParams() *SpringParams { | |
| 144 | + | ||
| 145 | + | return xSpringAnimationGetSpringParams(x.GoPointer()) | |
| 146 | + | ||
| 147 | + | } | |
| 148 | + | ||
| 149 | + | var xSpringAnimationGetValueFrom func(uintptr) float64 | |
| 150 | + | ||
| 151 | + | // Gets the value @self will animate from. | |
| 152 | + | func (x *SpringAnimation) GetValueFrom() float64 { | |
| 153 | + | ||
| 154 | + | return xSpringAnimationGetValueFrom(x.GoPointer()) | |
| 155 | + | ||
| 156 | + | } | |
| 157 | + | ||
| 158 | + | var xSpringAnimationGetValueTo func(uintptr) float64 | |
| 159 | + | ||
| 160 | + | // Gets the value @self will animate to. | |
| 161 | + | func (x *SpringAnimation) GetValueTo() float64 { | |
| 162 | + | ||
| 163 | + | return xSpringAnimationGetValueTo(x.GoPointer()) | |
| 164 | + | ||
| 165 | + | } | |
| 166 | + | ||
| 167 | + | var xSpringAnimationGetVelocity func(uintptr) float64 | |
| 168 | + | ||
| 169 | + | // Gets the current velocity of @self. | |
| 170 | + | func (x *SpringAnimation) GetVelocity() float64 { | |
| 171 | + | ||
| 172 | + | return xSpringAnimationGetVelocity(x.GoPointer()) | |
| 173 | + | ||
| 174 | + | } | |
| 175 | + | ||
| 176 | + | var xSpringAnimationSetClamp func(uintptr, bool) | |
| 177 | + | ||
| 178 | + | // Sets whether @self should be clamped. | |
| 179 | + | // | |
| 180 | + | // If set to `TRUE`, the animation will abruptly end as soon as it reaches the | |
| 181 | + | // final value, preventing overshooting. | |
| 182 | + | // | |
| 183 | + | // It won't prevent overshooting [property@SpringAnimation:value-from] if a | |
| 184 | + | // relative negative [property@SpringAnimation:initial-velocity] is set. | |
| 185 | + | func (x *SpringAnimation) SetClamp(ClampVar bool) { | |
| 186 | + | ||
| 187 | + | xSpringAnimationSetClamp(x.GoPointer(), ClampVar) | |
| 188 | + | ||
| 189 | + | } | |
| 190 | + | ||
| 191 | + | var xSpringAnimationSetEpsilon func(uintptr, float64) | |
| 192 | + | ||
| 193 | + | // Sets the precision of the spring. | |
| 194 | + | // | |
| 195 | + | // The level of precision used to determine when the animation has come to a | |
| 196 | + | // rest, that is, when the amplitude of the oscillations becomes smaller than | |
| 197 | + | // this value. | |
| 198 | + | // | |
| 199 | + | // If the epsilon value is too small, the animation will take a long time to | |
| 200 | + | // stop after the animated value has stopped visibly changing. | |
| 201 | + | // | |
| 202 | + | // If the epsilon value is too large, the animation will end prematurely. | |
| 203 | + | // | |
| 204 | + | // The default value is 0.001. | |
| 205 | + | func (x *SpringAnimation) SetEpsilon(EpsilonVar float64) { | |
| 206 | + | ||
| 207 | + | xSpringAnimationSetEpsilon(x.GoPointer(), EpsilonVar) | |
| 208 | + | ||
| 209 | + | } | |
| 210 | + | ||
| 211 | + | var xSpringAnimationSetInitialVelocity func(uintptr, float64) | |
| 212 | + | ||
| 213 | + | // Sets the initial velocity of @self. | |
| 214 | + | // | |
| 215 | + | // Initial velocity affects only the animation curve, but not its duration. | |
| 216 | + | func (x *SpringAnimation) SetInitialVelocity(VelocityVar float64) { | |
| 217 | + | ||
| 218 | + | xSpringAnimationSetInitialVelocity(x.GoPointer(), VelocityVar) | |
| 219 | + | ||
| 220 | + | } | |
| 221 | + | ||
| 222 | + | var xSpringAnimationSetSpringParams func(uintptr, *SpringParams) | |
| 223 | + | ||
| 224 | + | // Sets the physical parameters of the spring of @self. | |
| 225 | + | func (x *SpringAnimation) SetSpringParams(SpringParamsVar *SpringParams) { | |
| 226 | + | ||
| 227 | + | xSpringAnimationSetSpringParams(x.GoPointer(), SpringParamsVar) | |
| 228 | + | ||
| 229 | + | } | |
| 230 | + | ||
| 231 | + | var xSpringAnimationSetValueFrom func(uintptr, float64) | |
| 232 | + | ||
| 233 | + | // Sets the value @self will animate from. | |
| 234 | + | // | |
| 235 | + | // The animation will start at this value and end at | |
| 236 | + | // [property@SpringAnimation:value-to]. | |
| 237 | + | func (x *SpringAnimation) SetValueFrom(ValueVar float64) { | |
| 238 | + | ||
| 239 | + | xSpringAnimationSetValueFrom(x.GoPointer(), ValueVar) | |
| 240 | + | ||
| 241 | + | } | |
| 242 | + | ||
| 243 | + | var xSpringAnimationSetValueTo func(uintptr, float64) | |
| 244 | + | ||
| 245 | + | // Sets the value @self will animate to. | |
| 246 | + | // | |
| 247 | + | // The animation will start at [property@SpringAnimation:value-from] and end at | |
| 248 | + | // this value. | |
| 249 | + | func (x *SpringAnimation) SetValueTo(ValueVar float64) { | |
| 250 | + | ||
| 251 | + | xSpringAnimationSetValueTo(x.GoPointer(), ValueVar) | |
| 252 | + | ||
| 253 | + | } | |
| 254 | + | ||
| 255 | + | func (c *SpringAnimation) GoPointer() uintptr { | |
| 256 | + | return c.Ptr | |
| 257 | + | } | |
| 258 | + | ||
| 259 | + | func (c *SpringAnimation) SetGoPointer(ptr uintptr) { | |
| 260 | + | c.Ptr = ptr | |
| 261 | + | } | |
| 262 | + | ||
| 263 | + | func init() { | |
| 264 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 265 | + | if err != nil { | |
| 266 | + | panic(err) | |
| 267 | + | } | |
| 268 | + | ||
| 269 | + | core.PuregoSafeRegister(&xNewSpringAnimation, lib, "adw_spring_animation_new") | |
| 270 | + | ||
| 271 | + | core.PuregoSafeRegister(&xSpringAnimationCalculateValue, lib, "adw_spring_animation_calculate_value") | |
| 272 | + | core.PuregoSafeRegister(&xSpringAnimationCalculateVelocity, lib, "adw_spring_animation_calculate_velocity") | |
| 273 | + | core.PuregoSafeRegister(&xSpringAnimationGetClamp, lib, "adw_spring_animation_get_clamp") | |
| 274 | + | core.PuregoSafeRegister(&xSpringAnimationGetEpsilon, lib, "adw_spring_animation_get_epsilon") | |
| 275 | + | core.PuregoSafeRegister(&xSpringAnimationGetEstimatedDuration, lib, "adw_spring_animation_get_estimated_duration") | |
| 276 | + | core.PuregoSafeRegister(&xSpringAnimationGetInitialVelocity, lib, "adw_spring_animation_get_initial_velocity") | |
| 277 | + | core.PuregoSafeRegister(&xSpringAnimationGetSpringParams, lib, "adw_spring_animation_get_spring_params") | |
| 278 | + | core.PuregoSafeRegister(&xSpringAnimationGetValueFrom, lib, "adw_spring_animation_get_value_from") | |
| 279 | + | core.PuregoSafeRegister(&xSpringAnimationGetValueTo, lib, "adw_spring_animation_get_value_to") | |
| 280 | + | core.PuregoSafeRegister(&xSpringAnimationGetVelocity, lib, "adw_spring_animation_get_velocity") | |
| 281 | + | core.PuregoSafeRegister(&xSpringAnimationSetClamp, lib, "adw_spring_animation_set_clamp") | |
| 282 | + | core.PuregoSafeRegister(&xSpringAnimationSetEpsilon, lib, "adw_spring_animation_set_epsilon") | |
| 283 | + | core.PuregoSafeRegister(&xSpringAnimationSetInitialVelocity, lib, "adw_spring_animation_set_initial_velocity") | |
| 284 | + | core.PuregoSafeRegister(&xSpringAnimationSetSpringParams, lib, "adw_spring_animation_set_spring_params") | |
| 285 | + | core.PuregoSafeRegister(&xSpringAnimationSetValueFrom, lib, "adw_spring_animation_set_value_from") | |
| 286 | + | core.PuregoSafeRegister(&xSpringAnimationSetValueTo, lib, "adw_spring_animation_set_value_to") | |
| 287 | + | ||
| 288 | + | } | |
A v4/adw/adw-spring-params.go +35 -0
| @@ -0,0 +1,35 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | // Physical parameters of a spring for [class@SpringAnimation]. | |
| 5 | + | // | |
| 6 | + | // Any spring can be described by three parameters: mass, stiffness and damping. | |
| 7 | + | // | |
| 8 | + | // An undamped spring will produce an oscillatory motion which will go on | |
| 9 | + | // forever. | |
| 10 | + | // | |
| 11 | + | // The frequency and amplitude of the oscillations will be determined by the | |
| 12 | + | // stiffness (how "strong" the spring is) and its mass (how much "inertia" it | |
| 13 | + | // has). | |
| 14 | + | // | |
| 15 | + | // If damping is larger than 0, the amplitude of that oscillating motion will | |
| 16 | + | // exponientally decrease over time. If that damping is strong enough that the | |
| 17 | + | // spring can't complete a full oscillation, it's called an overdamped spring. | |
| 18 | + | // | |
| 19 | + | // If we the spring can oscillate, it's called an underdamped spring. | |
| 20 | + | // | |
| 21 | + | // The value between these two behaviors is called critical damping; a | |
| 22 | + | // critically damped spring will comes to rest in the minimum possible time | |
| 23 | + | // without producing oscillations. | |
| 24 | + | // | |
| 25 | + | // The damping can be replaced by damping ratio, which produces the following | |
| 26 | + | // springs: | |
| 27 | + | // | |
| 28 | + | // * 0: an undamped spring. | |
| 29 | + | // * Between 0 and 1: an underdamped spring. | |
| 30 | + | // * 1: a critically damped spring. | |
| 31 | + | // * Larger than 1: an overdamped spring. | |
| 32 | + | // | |
| 33 | + | // As such | |
| 34 | + | type SpringParams struct { | |
| 35 | + | } | |
A v4/adw/adw-squeezer.go +619 -0 collapsed to keep the page light
A v4/adw/adw-status-page.go +347 -0
| @@ -0,0 +1,347 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gdk" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 10 | + | ) | |
| 11 | + | ||
| 12 | + | type StatusPageClass struct { | |
| 13 | + | ParentClass uintptr | |
| 14 | + | } | |
| 15 | + | ||
| 16 | + | // A page used for empty/error states and similar use-cases. | |
| 17 | + | // | |
| 18 | + | // <picture> | |
| 19 | + | // | |
| 20 | + | // <source srcset="status-page-dark.png" media="(prefers-color-scheme: dark)"> | |
| 21 | + | // <img src="status-page.png" alt="status-page"> | |
| 22 | + | // | |
| 23 | + | // </picture> | |
| 24 | + | // | |
| 25 | + | // The `AdwStatusPage` widget can have an icon, a title, a description and a | |
| 26 | + | // custom widget which is displayed below them. | |
| 27 | + | // | |
| 28 | + | // ## CSS nodes | |
| 29 | + | // | |
| 30 | + | // `AdwStatusPage` has a main CSS node with name `statuspage`. | |
| 31 | + | // | |
| 32 | + | // `AdwStatusPage` can use the | |
| 33 | + | // [`.compact`](style-classes.html#compact-status-page) style class for when it | |
| 34 | + | // needs to fit into a small space such a sidebar or a popover. | |
| 35 | + | type StatusPage struct { | |
| 36 | + | gtk.Widget | |
| 37 | + | } | |
| 38 | + | ||
| 39 | + | func StatusPageNewFromInternalPtr(ptr uintptr) *StatusPage { | |
| 40 | + | cls := &StatusPage{} | |
| 41 | + | cls.Ptr = ptr | |
| 42 | + | return cls | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | var xNewStatusPage func() uintptr | |
| 46 | + | ||
| 47 | + | // Creates a new `AdwStatusPage`. | |
| 48 | + | func NewStatusPage() *gtk.Widget { | |
| 49 | + | NewStatusPagePtr := xNewStatusPage() | |
| 50 | + | if NewStatusPagePtr == 0 { | |
| 51 | + | return nil | |
| 52 | + | } | |
| 53 | + | ||
| 54 | + | gobject.IncreaseRef(NewStatusPagePtr) | |
| 55 | + | ||
| 56 | + | NewStatusPageCls := >k.Widget{} | |
| 57 | + | NewStatusPageCls.Ptr = NewStatusPagePtr | |
| 58 | + | return NewStatusPageCls | |
| 59 | + | } | |
| 60 | + | ||
| 61 | + | var xStatusPageGetChild func(uintptr) uintptr | |
| 62 | + | ||
| 63 | + | // Gets the child widget of @self. | |
| 64 | + | func (x *StatusPage) GetChild() *gtk.Widget { | |
| 65 | + | ||
| 66 | + | GetChildPtr := xStatusPageGetChild(x.GoPointer()) | |
| 67 | + | if GetChildPtr == 0 { | |
| 68 | + | return nil | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | gobject.IncreaseRef(GetChildPtr) | |
| 72 | + | ||
| 73 | + | GetChildCls := >k.Widget{} | |
| 74 | + | GetChildCls.Ptr = GetChildPtr | |
| 75 | + | return GetChildCls | |
| 76 | + | ||
| 77 | + | } | |
| 78 | + | ||
| 79 | + | var xStatusPageGetDescription func(uintptr) string | |
| 80 | + | ||
| 81 | + | // Gets the description for @self. | |
| 82 | + | func (x *StatusPage) GetDescription() string { | |
| 83 | + | ||
| 84 | + | return xStatusPageGetDescription(x.GoPointer()) | |
| 85 | + | ||
| 86 | + | } | |
| 87 | + | ||
| 88 | + | var xStatusPageGetIconName func(uintptr) string | |
| 89 | + | ||
| 90 | + | // Gets the icon name for @self. | |
| 91 | + | func (x *StatusPage) GetIconName() string { | |
| 92 | + | ||
| 93 | + | return xStatusPageGetIconName(x.GoPointer()) | |
| 94 | + | ||
| 95 | + | } | |
| 96 | + | ||
| 97 | + | var xStatusPageGetPaintable func(uintptr) uintptr | |
| 98 | + | ||
| 99 | + | // Gets the paintable for @self. | |
| 100 | + | func (x *StatusPage) GetPaintable() *gdk.PaintableBase { | |
| 101 | + | ||
| 102 | + | GetPaintablePtr := xStatusPageGetPaintable(x.GoPointer()) | |
| 103 | + | if GetPaintablePtr == 0 { | |
| 104 | + | return nil | |
| 105 | + | } | |
| 106 | + | ||
| 107 | + | gobject.IncreaseRef(GetPaintablePtr) | |
| 108 | + | ||
| 109 | + | GetPaintableCls := &gdk.PaintableBase{} | |
| 110 | + | GetPaintableCls.Ptr = GetPaintablePtr | |
| 111 | + | return GetPaintableCls | |
| 112 | + | ||
| 113 | + | } | |
| 114 | + | ||
| 115 | + | var xStatusPageGetTitle func(uintptr) string | |
| 116 | + | ||
| 117 | + | // Gets the title for @self. | |
| 118 | + | func (x *StatusPage) GetTitle() string { | |
| 119 | + | ||
| 120 | + | return xStatusPageGetTitle(x.GoPointer()) | |
| 121 | + | ||
| 122 | + | } | |
| 123 | + | ||
| 124 | + | var xStatusPageSetChild func(uintptr, uintptr) | |
| 125 | + | ||
| 126 | + | // Sets the child widget of @self. | |
| 127 | + | func (x *StatusPage) SetChild(ChildVar *gtk.Widget) { | |
| 128 | + | ||
| 129 | + | xStatusPageSetChild(x.GoPointer(), ChildVar.GoPointer()) | |
| 130 | + | ||
| 131 | + | } | |
| 132 | + | ||
| 133 | + | var xStatusPageSetDescription func(uintptr, string) | |
| 134 | + | ||
| 135 | + | // Sets the description for @self. | |
| 136 | + | // | |
| 137 | + | // The description is displayed below the title. | |
| 138 | + | func (x *StatusPage) SetDescription(DescriptionVar string) { | |
| 139 | + | ||
| 140 | + | xStatusPageSetDescription(x.GoPointer(), DescriptionVar) | |
| 141 | + | ||
| 142 | + | } | |
| 143 | + | ||
| 144 | + | var xStatusPageSetIconName func(uintptr, string) | |
| 145 | + | ||
| 146 | + | // Sets the icon name for @self. | |
| 147 | + | // | |
| 148 | + | // Changing this will set [property@StatusPage:paintable] to `NULL`. | |
| 149 | + | func (x *StatusPage) SetIconName(IconNameVar string) { | |
| 150 | + | ||
| 151 | + | xStatusPageSetIconName(x.GoPointer(), IconNameVar) | |
| 152 | + | ||
| 153 | + | } | |
| 154 | + | ||
| 155 | + | var xStatusPageSetPaintable func(uintptr, uintptr) | |
| 156 | + | ||
| 157 | + | // Sets the paintable for @self. | |
| 158 | + | // | |
| 159 | + | // Changing this will set [property@StatusPage:icon-name] to `NULL`. | |
| 160 | + | func (x *StatusPage) SetPaintable(PaintableVar gdk.Paintable) { | |
| 161 | + | ||
| 162 | + | xStatusPageSetPaintable(x.GoPointer(), PaintableVar.GoPointer()) | |
| 163 | + | ||
| 164 | + | } | |
| 165 | + | ||
| 166 | + | var xStatusPageSetTitle func(uintptr, string) | |
| 167 | + | ||
| 168 | + | // Sets the title for @self. | |
| 169 | + | // | |
| 170 | + | // The title is displayed below the icon. | |
| 171 | + | func (x *StatusPage) SetTitle(TitleVar string) { | |
| 172 | + | ||
| 173 | + | xStatusPageSetTitle(x.GoPointer(), TitleVar) | |
| 174 | + | ||
| 175 | + | } | |
| 176 | + | ||
| 177 | + | func (c *StatusPage) GoPointer() uintptr { | |
| 178 | + | return c.Ptr | |
| 179 | + | } | |
| 180 | + | ||
| 181 | + | func (c *StatusPage) SetGoPointer(ptr uintptr) { | |
| 182 | + | c.Ptr = ptr | |
| 183 | + | } | |
| 184 | + | ||
| 185 | + | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 186 | + | func (x *StatusPage) GetAccessibleRole() gtk.AccessibleRole { | |
| 187 | + | ||
| 188 | + | return gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 189 | + | ||
| 190 | + | } | |
| 191 | + | ||
| 192 | + | // Resets the accessible @property to its default value. | |
| 193 | + | func (x *StatusPage) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 194 | + | ||
| 195 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 196 | + | ||
| 197 | + | } | |
| 198 | + | ||
| 199 | + | // Resets the accessible @relation to its default value. | |
| 200 | + | func (x *StatusPage) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 201 | + | ||
| 202 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 203 | + | ||
| 204 | + | } | |
| 205 | + | ||
| 206 | + | // Resets the accessible @state to its default value. | |
| 207 | + | func (x *StatusPage) ResetState(StateVar gtk.AccessibleState) { | |
| 208 | + | ||
| 209 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 210 | + | ||
| 211 | + | } | |
| 212 | + | ||
| 213 | + | // Updates a list of accessible properties. | |
| 214 | + | // | |
| 215 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 216 | + | // value types of accessible properties. | |
| 217 | + | // | |
| 218 | + | // This function should be called by `GtkWidget` types whenever | |
| 219 | + | // an accessible property change must be communicated to assistive | |
| 220 | + | // technologies. | |
| 221 | + | // | |
| 222 | + | // Example: | |
| 223 | + | // ```c | |
| 224 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 225 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 226 | + | // | |
| 227 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 228 | + | // -1); | |
| 229 | + | // | |
| 230 | + | // ``` | |
| 231 | + | func (x *StatusPage) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 232 | + | ||
| 233 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 234 | + | ||
| 235 | + | } | |
| 236 | + | ||
| 237 | + | // Updates an array of accessible properties. | |
| 238 | + | // | |
| 239 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 240 | + | // property change must be communicated to assistive technologies. | |
| 241 | + | // | |
| 242 | + | // This function is meant to be used by language bindings. | |
| 243 | + | func (x *StatusPage) UpdatePropertyValue(NPropertiesVar int32, PropertiesVar uintptr, ValuesVar uintptr) { | |
| 244 | + | ||
| 245 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 246 | + | ||
| 247 | + | } | |
| 248 | + | ||
| 249 | + | // Updates a list of accessible relations. | |
| 250 | + | // | |
| 251 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 252 | + | // relation change must be communicated to assistive technologies. | |
| 253 | + | // | |
| 254 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 255 | + | // you should pass each reference individually, followed by %NULL, e.g. | |
| 256 | + | // | |
| 257 | + | // ```c | |
| 258 | + | // gtk_accessible_update_relation (accessible, | |
| 259 | + | // | |
| 260 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 261 | + | // ref1, NULL, | |
| 262 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 263 | + | // ref1, ref2, ref3, NULL, | |
| 264 | + | // -1); | |
| 265 | + | // | |
| 266 | + | // ``` | |
| 267 | + | func (x *StatusPage) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 268 | + | ||
| 269 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 270 | + | ||
| 271 | + | } | |
| 272 | + | ||
| 273 | + | // Updates an array of accessible relations. | |
| 274 | + | // | |
| 275 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 276 | + | // relation change must be communicated to assistive technologies. | |
| 277 | + | // | |
| 278 | + | // This function is meant to be used by language bindings. | |
| 279 | + | func (x *StatusPage) UpdateRelationValue(NRelationsVar int32, RelationsVar uintptr, ValuesVar uintptr) { | |
| 280 | + | ||
| 281 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 282 | + | ||
| 283 | + | } | |
| 284 | + | ||
| 285 | + | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 286 | + | // documentation for the value types of accessible states. | |
| 287 | + | // | |
| 288 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 289 | + | // state change must be communicated to assistive technologies. | |
| 290 | + | // | |
| 291 | + | // Example: | |
| 292 | + | // ```c | |
| 293 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 294 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 295 | + | // | |
| 296 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 297 | + | // -1); | |
| 298 | + | // | |
| 299 | + | // ``` | |
| 300 | + | func (x *StatusPage) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 301 | + | ||
| 302 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 303 | + | ||
| 304 | + | } | |
| 305 | + | ||
| 306 | + | // Updates an array of accessible states. | |
| 307 | + | // | |
| 308 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 309 | + | // state change must be communicated to assistive technologies. | |
| 310 | + | // | |
| 311 | + | // This function is meant to be used by language bindings. | |
| 312 | + | func (x *StatusPage) UpdateStateValue(NStatesVar int32, StatesVar uintptr, ValuesVar uintptr) { | |
| 313 | + | ||
| 314 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 315 | + | ||
| 316 | + | } | |
| 317 | + | ||
| 318 | + | // Gets the ID of the @buildable object. | |
| 319 | + | // | |
| 320 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 321 | + | // of the <object> tag used to construct the @buildable. | |
| 322 | + | func (x *StatusPage) GetBuildableId() string { | |
| 323 | + | ||
| 324 | + | return gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 325 | + | ||
| 326 | + | } | |
| 327 | + | ||
| 328 | + | func init() { | |
| 329 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 330 | + | if err != nil { | |
| 331 | + | panic(err) | |
| 332 | + | } | |
| 333 | + | ||
| 334 | + | core.PuregoSafeRegister(&xNewStatusPage, lib, "adw_status_page_new") | |
| 335 | + | ||
| 336 | + | core.PuregoSafeRegister(&xStatusPageGetChild, lib, "adw_status_page_get_child") | |
| 337 | + | core.PuregoSafeRegister(&xStatusPageGetDescription, lib, "adw_status_page_get_description") | |
| 338 | + | core.PuregoSafeRegister(&xStatusPageGetIconName, lib, "adw_status_page_get_icon_name") | |
| 339 | + | core.PuregoSafeRegister(&xStatusPageGetPaintable, lib, "adw_status_page_get_paintable") | |
| 340 | + | core.PuregoSafeRegister(&xStatusPageGetTitle, lib, "adw_status_page_get_title") | |
| 341 | + | core.PuregoSafeRegister(&xStatusPageSetChild, lib, "adw_status_page_set_child") | |
| 342 | + | core.PuregoSafeRegister(&xStatusPageSetDescription, lib, "adw_status_page_set_description") | |
| 343 | + | core.PuregoSafeRegister(&xStatusPageSetIconName, lib, "adw_status_page_set_icon_name") | |
| 344 | + | core.PuregoSafeRegister(&xStatusPageSetPaintable, lib, "adw_status_page_set_paintable") | |
| 345 | + | core.PuregoSafeRegister(&xStatusPageSetTitle, lib, "adw_status_page_set_title") | |
| 346 | + | ||
| 347 | + | } | |
A v4/adw/adw-style-manager.go +180 -0 collapsed to keep the page light
A v4/adw/adw-swipe-tracker.go +258 -0 collapsed to keep the page light
A v4/adw/adw-swipeable.go +109 -0
| @@ -0,0 +1,109 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gdk" | |
| 8 | + | ) | |
| 9 | + | ||
| 10 | + | // An interface for swipeable widgets. | |
| 11 | + | type SwipeableInterface struct { | |
| 12 | + | Parent uintptr | |
| 13 | + | ||
| 14 | + | Padding uintptr | |
| 15 | + | } | |
| 16 | + | ||
| 17 | + | // An interface for swipeable widgets. | |
| 18 | + | // | |
| 19 | + | // The `AdwSwipeable` interface is implemented by all swipeable widgets. | |
| 20 | + | // | |
| 21 | + | // See [class@SwipeTracker] for details about implementing it. | |
| 22 | + | type Swipeable interface { | |
| 23 | + | GoPointer() uintptr | |
| 24 | + | SetGoPointer(uintptr) | |
| 25 | + | GetCancelProgress() float64 | |
| 26 | + | GetDistance() float64 | |
| 27 | + | GetProgress() float64 | |
| 28 | + | GetSnapPoints(NSnapPointsVar int32) uintptr | |
| 29 | + | GetSwipeArea(NavigationDirectionVar NavigationDirection, IsDragVar bool, RectVar *gdk.Rectangle) | |
| 30 | + | } | |
| 31 | + | type SwipeableBase struct { | |
| 32 | + | Ptr uintptr | |
| 33 | + | } | |
| 34 | + | ||
| 35 | + | func (x *SwipeableBase) GoPointer() uintptr { | |
| 36 | + | return x.Ptr | |
| 37 | + | } | |
| 38 | + | ||
| 39 | + | func (x *SwipeableBase) SetGoPointer(ptr uintptr) { | |
| 40 | + | x.Ptr = ptr | |
| 41 | + | } | |
| 42 | + | ||
| 43 | + | // Gets the progress @self will snap back to after the gesture is canceled. | |
| 44 | + | func (x *SwipeableBase) GetCancelProgress() float64 { | |
| 45 | + | ||
| 46 | + | return XAdwSwipeableGetCancelProgress(x.GoPointer()) | |
| 47 | + | ||
| 48 | + | } | |
| 49 | + | ||
| 50 | + | // Gets the swipe distance of @self. | |
| 51 | + | // | |
| 52 | + | // This corresponds to how many pixels 1 unit represents. | |
| 53 | + | func (x *SwipeableBase) GetDistance() float64 { | |
| 54 | + | ||
| 55 | + | return XAdwSwipeableGetDistance(x.GoPointer()) | |
| 56 | + | ||
| 57 | + | } | |
| 58 | + | ||
| 59 | + | // Gets the current progress of @self. | |
| 60 | + | func (x *SwipeableBase) GetProgress() float64 { | |
| 61 | + | ||
| 62 | + | return XAdwSwipeableGetProgress(x.GoPointer()) | |
| 63 | + | ||
| 64 | + | } | |
| 65 | + | ||
| 66 | + | // Gets the snap points of @self. | |
| 67 | + | // | |
| 68 | + | // Each snap point represents a progress value that is considered acceptable to | |
| 69 | + | // end the swipe on. | |
| 70 | + | func (x *SwipeableBase) GetSnapPoints(NSnapPointsVar int32) uintptr { | |
| 71 | + | ||
| 72 | + | return XAdwSwipeableGetSnapPoints(x.GoPointer(), NSnapPointsVar) | |
| 73 | + | ||
| 74 | + | } | |
| 75 | + | ||
| 76 | + | // Gets the area @self can start a swipe from for the given direction and | |
| 77 | + | // gesture type. | |
| 78 | + | // | |
| 79 | + | // This can be used to restrict swipes to only be possible from a certain area, | |
| 80 | + | // for example, to only allow edge swipes, or to have a draggable element and | |
| 81 | + | // ignore swipes elsewhere. | |
| 82 | + | // | |
| 83 | + | // If not implemented, the default implementation returns the allocation of | |
| 84 | + | // @self, allowing swipes from anywhere. | |
| 85 | + | func (x *SwipeableBase) GetSwipeArea(NavigationDirectionVar NavigationDirection, IsDragVar bool, RectVar *gdk.Rectangle) { | |
| 86 | + | ||
| 87 | + | XAdwSwipeableGetSwipeArea(x.GoPointer(), NavigationDirectionVar, IsDragVar, RectVar) | |
| 88 | + | ||
| 89 | + | } | |
| 90 | + | ||
| 91 | + | var XAdwSwipeableGetCancelProgress func(uintptr) float64 | |
| 92 | + | var XAdwSwipeableGetDistance func(uintptr) float64 | |
| 93 | + | var XAdwSwipeableGetProgress func(uintptr) float64 | |
| 94 | + | var XAdwSwipeableGetSnapPoints func(uintptr, int32) uintptr | |
| 95 | + | var XAdwSwipeableGetSwipeArea func(uintptr, NavigationDirection, bool, *gdk.Rectangle) | |
| 96 | + | ||
| 97 | + | func init() { | |
| 98 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 99 | + | if err != nil { | |
| 100 | + | panic(err) | |
| 101 | + | } | |
| 102 | + | ||
| 103 | + | core.PuregoSafeRegister(&XAdwSwipeableGetCancelProgress, lib, "adw_swipeable_get_cancel_progress") | |
| 104 | + | core.PuregoSafeRegister(&XAdwSwipeableGetDistance, lib, "adw_swipeable_get_distance") | |
| 105 | + | core.PuregoSafeRegister(&XAdwSwipeableGetProgress, lib, "adw_swipeable_get_progress") | |
| 106 | + | core.PuregoSafeRegister(&XAdwSwipeableGetSnapPoints, lib, "adw_swipeable_get_snap_points") | |
| 107 | + | core.PuregoSafeRegister(&XAdwSwipeableGetSwipeArea, lib, "adw_swipeable_get_swipe_area") | |
| 108 | + | ||
| 109 | + | } | |
A v4/adw/adw-tab-bar.go +485 -0 collapsed to keep the page light
A v4/adw/adw-tab-button.go +373 -0 collapsed to keep the page light
A v4/adw/adw-tab-overview.go +601 -0 collapsed to keep the page light
A v4/adw/adw-tab-view.go +1637 -0 collapsed to keep the page light
A v4/adw/adw-timed-animation.go +232 -0 collapsed to keep the page light
A v4/adw/adw-toast-overlay.go +292 -0 collapsed to keep the page light
A v4/adw/adw-toast.go +484 -0 collapsed to keep the page light
A v4/adw/adw-version.go +66 -0 collapsed to keep the page light
A v4/adw/adw-view-stack.go +842 -0 collapsed to keep the page light
A v4/adw/adw-view-switcher-bar.go +308 -0 collapsed to keep the page light
A v4/adw/adw-view-switcher-title.go +379 -0 collapsed to keep the page light
A v4/adw/adw-view-switcher.go +290 -0 collapsed to keep the page light
A v4/adw/adw-window-title.go +261 -0 collapsed to keep the page light
A v4/adw/adw-window.go +382 -0 collapsed to keep the page light
A v4/cairo/main.go +510 -0 collapsed to keep the page light
A v4/gdk/gdkapplaunchcontext.go +149 -0 collapsed to keep the page light
A v4/gdk/gdkcairo.go +101 -0 collapsed to keep the page light
A v4/gdk/gdkcairocontext.go +58 -0 collapsed to keep the page light
A v4/gdk/gdkclipboard.go +378 -0 collapsed to keep the page light
A v4/gdk/gdkcontentdeserializer.go +267 -0 collapsed to keep the page light
A v4/gdk/gdkcontentformats.go +54 -0 collapsed to keep the page light
A v4/gdk/gdkcontentprovider.go +231 -0 collapsed to keep the page light
A v4/gdk/gdkcontentserializer.go +268 -0 collapsed to keep the page light
A v4/gdk/gdkcursor.go +205 -0 collapsed to keep the page light
A v4/gdk/gdkdevice.go +375 -0 collapsed to keep the page light
A v4/gdk/gdkdevicepad.go +112 -0 collapsed to keep the page light
A v4/gdk/gdkdevicetool.go +113 -0 collapsed to keep the page light
A v4/gdk/gdkdisplay.go +564 -0 collapsed to keep the page light
A v4/gdk/gdkdisplaymanager.go +196 -0 collapsed to keep the page light
A v4/gdk/gdkdrag.go +274 -0 collapsed to keep the page light
A v4/gdk/gdkdragsurface.go +48 -0
| @@ -0,0 +1,48 @@ | |||
| 1 | + | // Package gdk was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package gdk | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/internal/core" | |
| 7 | + | ) | |
| 8 | + | ||
| 9 | + | // The `GdkDragSurfaceInterface` implementation is private to GDK. | |
| 10 | + | type DragSurfaceInterface struct { | |
| 11 | + | } | |
| 12 | + | ||
| 13 | + | // A `GdkDragSurface` is an interface for surfaces used during DND. | |
| 14 | + | type DragSurface interface { | |
| 15 | + | GoPointer() uintptr | |
| 16 | + | SetGoPointer(uintptr) | |
| 17 | + | Present(WidthVar int32, HeightVar int32) bool | |
| 18 | + | } | |
| 19 | + | type DragSurfaceBase struct { | |
| 20 | + | Ptr uintptr | |
| 21 | + | } | |
| 22 | + | ||
| 23 | + | func (x *DragSurfaceBase) GoPointer() uintptr { | |
| 24 | + | return x.Ptr | |
| 25 | + | } | |
| 26 | + | ||
| 27 | + | func (x *DragSurfaceBase) SetGoPointer(ptr uintptr) { | |
| 28 | + | x.Ptr = ptr | |
| 29 | + | } | |
| 30 | + | ||
| 31 | + | // Present @drag_surface. | |
| 32 | + | func (x *DragSurfaceBase) Present(WidthVar int32, HeightVar int32) bool { | |
| 33 | + | ||
| 34 | + | return XGdkDragSurfacePresent(x.GoPointer(), WidthVar, HeightVar) | |
| 35 | + | ||
| 36 | + | } | |
| 37 | + | ||
| 38 | + | var XGdkDragSurfacePresent func(uintptr, int32, int32) bool | |
| 39 | + | ||
| 40 | + | func init() { | |
| 41 | + | lib, err := purego.Dlopen(core.GetPath("GDK"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 42 | + | if err != nil { | |
| 43 | + | panic(err) | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | core.PuregoSafeRegister(&XGdkDragSurfacePresent, lib, "gdk_drag_surface_present") | |
| 47 | + | ||
| 48 | + | } | |